:root {
    --bg: #f6f1e9;
    --surface: #fffaf4;
    --surface-2: #f1ebe2;
    --text: #3f4d46;
    --muted: #778178;
    --sage: #aebba7;
    --sage-deep: #6f8775;
    --peach: #e8c4ae;
    --lavender: #cbc3d5;
    --blue: #c9d8df;
    --gold: #dfc58c;
    --line: rgba(63, 77, 70, 0.12);
    --shadow: 0 18px 50px rgba(79, 70, 58, 0.08);
    --radius-xl: 30px;
    --radius-lg: 22px;
    --radius-md: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(232,196,174,.22), transparent 30%),
        radial-gradient(circle at top right, rgba(174,187,167,.20), transparent 27%),
        var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.app-shell { width: min(100%, 760px); margin: 0 auto; padding: 0 18px 120px; }
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 2px 18px;
}
.brand { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.brand strong { display: block; font-family: Georgia, serif; font-size: 30px; font-weight: 500; letter-spacing: .2px; }
.brand small { display: block; color: var(--muted); margin-top: 2px; font-size: 12px; }
.brand-mark {
    display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
    background: linear-gradient(145deg, #d8c7a4, #9fb1a3); color: white; box-shadow: var(--shadow);
}
.main-content { display: grid; gap: 18px; }
.hero-card, .card, .choice-card {
    background: rgba(255,250,244,.92);
    border: 1px solid rgba(255,255,255,.9);
    box-shadow: var(--shadow);
}
.hero-card { border-radius: var(--radius-xl); padding: 30px 24px; text-align: center; }
.hero-card h1, .section-heading h2, .card h3, .choice-card h3 {
    font-family: Georgia, serif; font-weight: 500; margin: 0; color: #44544c;
}
.hero-card h1 { font-size: clamp(32px, 6vw, 48px); }
.intro { color: var(--muted); max-width: 520px; margin: 12px auto 0; line-height: 1.6; }
.eyebrow { margin: 0 0 8px; text-transform: uppercase; letter-spacing: .16em; font-size: 11px; color: #9b7867; font-weight: 700; }

.mood-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin-top: 26px; }
.mood {
    border: 0; border-radius: 18px; min-height: 88px; padding: 10px 5px;
    background: #f2ede5; color: var(--text); transition: .2s ease;
}
.mood:nth-child(1), .mood:nth-child(2) { background: #dce5d7; }
.mood:nth-child(3) { background: #eee7db; }
.mood:nth-child(4) { background: #f1d8c8; }
.mood:nth-child(5) { background: #e9d2cc; }
.mood:nth-child(6) { background: #ddd5e4; }
.mood:nth-child(7) { background: #d9e2e6; }
.mood span { display: block; font-size: 28px; margin-bottom: 7px; }
.mood b { font-size: 11px; font-weight: 600; }
.mood:hover, .mood.is-selected { transform: translateY(-2px); outline: 2px solid rgba(111,135,117,.45); }

.content-section { display: grid; gap: 14px; }
.section-heading { padding: 8px 4px 0; }
.section-heading h2 { font-size: 30px; }
.card { border-radius: var(--radius-lg); padding: 22px; }
.card-stack { display: grid; gap: 12px; }
.choice-card { border-radius: var(--radius-lg); padding: 20px; }
.choice-card p, .card p { color: var(--muted); line-height: 1.6; }

label { display: block; font-weight: 650; margin-bottom: 8px; }
textarea, input, select {
    width: 100%; border: 1px solid var(--line); background: #fffdf9; color: var(--text);
    border-radius: 14px; padding: 14px 15px; outline: none;
}
textarea:focus, input:focus, select:focus { border-color: rgba(111,135,117,.55); box-shadow: 0 0 0 4px rgba(174,187,167,.15); }
textarea, select { margin-bottom: 16px; }

.button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.primary-button, .soft-button, .feedback-row button, .action-chips button, .need-card {
    border: 0; border-radius: 999px; padding: 11px 16px;
}
.primary-button { background: var(--sage-deep); color: white; }
.soft-button { background: var(--surface-2); color: var(--text); }
.primary-button:hover, .soft-button:hover { filter: brightness(.98); transform: translateY(-1px); }
.microcopy, .status-line, .source { font-size: 12px; color: var(--muted); }
.status-line { min-height: 18px; margin: 10px 0 0; }

.need-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.need-card { min-height: 72px; border-radius: 18px; background: #efe9df; color: var(--text); }
.need-card:nth-child(3n+1) { background: #dde5d8; }
.need-card:nth-child(3n+2) { background: #f0d9cc; }
.need-card:nth-child(3n) { background: #ddd6e4; }
.need-card.is-selected { outline: 2px solid var(--sage-deep); }

.inspiration-card blockquote { margin: 16px 0; font-family: Georgia, serif; font-size: 24px; line-height: 1.5; color: #4d5c55; }
.feedback-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.feedback-row button { background: #f3ede5; color: var(--text); font-size: 13px; }

.warning-card { border-left: 4px solid #d6a58d; }
.action-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.action-chips button { background: #edf1ea; color: var(--text); }
.action-chips button.is-selected { background: #dbe5d7; outline: 2px solid var(--sage-deep); }

.history-list { display: grid; gap: 10px; margin-top: 14px; }
.history-item { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: #fffdf9; }
.history-item strong { display: block; margin-bottom: 4px; }
.history-item small { color: var(--muted); }

.bottom-nav {
    position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%);
    width: min(calc(100% - 24px), 736px); padding: 8px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px;
    background: rgba(255,250,244,.94); backdrop-filter: blur(16px); border: 1px solid rgba(255,255,255,.9);
    border-radius: 22px; box-shadow: 0 18px 45px rgba(79,70,58,.13); z-index: 20;
}
.nav-item { border: 0; background: transparent; color: var(--muted); border-radius: 16px; padding: 8px 4px; }
.nav-item span { display: block; font-size: 20px; margin-bottom: 3px; }
.nav-item small { font-size: 10px; }
.nav-item.is-active { background: #eef2eb; color: var(--sage-deep); }
.is-hidden { display: none; }

.dialog-card { border: 0; border-radius: 22px; padding: 0; width: min(92vw, 520px); color: var(--text); box-shadow: 0 30px 70px rgba(0,0,0,.18); }
.dialog-card::backdrop { background: rgba(46,55,50,.28); backdrop-filter: blur(4px); }
.dialog-card form { padding: 26px; position: relative; }
.dialog-close { position: absolute; right: 14px; top: 12px; border: 0; background: transparent; font-size: 26px; color: var(--muted); }

@media (max-width: 680px) {
    .app-shell { padding-inline: 12px; }
    .site-header { align-items: flex-start; }
    .brand small { max-width: 210px; }
    .mood-grid { grid-template-columns: repeat(4, 1fr); }
    .need-grid { grid-template-columns: repeat(2, 1fr); }
    .bottom-nav { bottom: 8px; }
}

@media (max-width: 420px) {
    .brand strong { font-size: 25px; }
    .brand-mark { width: 40px; height: 40px; }
    .hero-card { padding-inline: 16px; }
    .mood-grid { grid-template-columns: repeat(2, 1fr); }
    .mood { min-height: 72px; }
    .inspiration-card blockquote { font-size: 21px; }
}
