:root {
    --cream: #FFFBF7;
    --sage: #D4E5D4;
    --sage-deep: #7C9A7E;
    --rose: #F2D5D5;
    --text: #333333;
    --hint: #9a938c;
    --white: #ffffff;
    --border: #ece6dd;
    --radius: 20px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--cream);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden;
}

.screen { padding: 20px 18px 40px; min-height: 100vh; }
.center { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.hidden { display: none !important; }
.hint { color: var(--hint); font-size: 14px; }
.leaf { font-size: 44px; }

h1 { font-size: 24px; margin-bottom: 4px; }
h2 { font-size: 20px; }
h3 { font-size: 18px; margin-bottom: 16px; }

.loader {
    width: 40px; height: 40px;
    border: 3px solid var(--sage);
    border-top-color: var(--sage-deep);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Header */
#header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.badge {
    background: var(--sage);
    color: var(--text);
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

/* Cards */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 26px 22px;
    margin: 16px 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.card.tap { cursor: pointer; transition: transform .15s; text-align: center; }
.card.tap:active { transform: scale(0.98); }

/* Bare minimum button */
.pulse-button {
    width: 130px; height: 130px;
    border-radius: 50%;
    background: var(--sage);
    color: var(--text);
    display: flex; align-items: center; justify-content: center;
    text-align: center;
    margin: 0 auto 14px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    animation: pulse 3s infinite;
    transition: transform .2s;
}
.pulse-button:active { transform: scale(0.95); }
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(212,229,212,0.5); }
    50% { box-shadow: 0 0 0 16px rgba(212,229,212,0); }
}
#bare-quote { min-height: 20px; margin-top: 6px; font-style: italic; color: var(--text); }

/* Menu */
#menu { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 8px; }
.menu-item {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px 8px;
    text-align: center;
    cursor: pointer;
    transition: transform .15s;
    position: relative;
}
.menu-item:active { transform: scale(0.95); }
.menu-item .ico { display: block; font-size: 26px; margin-bottom: 6px; }
.menu-item .lock { position: absolute; top: 6px; right: 8px; font-size: 12px; }
.menu-item.locked { opacity: 0.6; }

/* Section overlay */
.section { padding: 16px 18px 40px; }
.btn {
    display: inline-block;
    width: 100%;
    border: 0;
    border-radius: 14px;
    padding: 14px 18px;
    font-size: 16px;
    font-weight: 600;
    background: var(--sage-deep);
    color: #fff;
    cursor: pointer;
    text-align: center;
}
.btn.secondary { background: transparent; color: var(--sage-deep); border: 1px solid var(--sage-deep); }

.letter-date { color: var(--hint); font-size: 13px; }
.list-item { background: var(--white); border: 1px solid var(--border); border-radius: 16px; padding: 16px; margin: 12px 0; }
.slip { background: var(--white); border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; margin: 10px 0; }
.disclaimer { color: var(--hint); font-size: 12px; margin-top: 14px; text-align: center; }

/* Breathing */
.breathing-circle {
    width: 150px; height: 150px;
    border-radius: 50%;
    background: var(--sage);
    margin: 40px auto 20px;
    transform: scale(1);
    transition: transform linear;
}
#breathing-text { text-align: center; font-size: 18px; min-height: 26px; }

/* Chat (Jamie) */
#chat-messages {
    height: 46vh; overflow-y: auto;
    background: var(--white); border: 1px solid var(--border);
    border-radius: 16px; padding: 14px; margin-bottom: 12px;
}
.msg { margin: 8px 0; }
.msg .who { font-weight: 600; }
.msg.crisis { background: var(--rose); border-radius: 12px; padding: 10px; }
#chat-input { display: flex; gap: 8px; }
#chat-input input {
    flex: 1; padding: 12px; border: 1px solid var(--border);
    border-radius: 12px; outline: none; font-size: 15px;
}
#chat-input button {
    padding: 12px 18px; background: var(--sage-deep); color: #fff;
    border: none; border-radius: 12px; cursor: pointer; font-weight: 600;
}
