:root {
  --pine: #173f35;
  --pine-2: #245548;
  --pine-soft: #dcebe5;
  --cream: #f7f2e8;
  --paper: #fffdf9;
  --ink: #20302b;
  --muted: #5b6a65;
  --line: #d7ddd7;
  --coral: #b84f42;
  --coral-soft: #f8e2dc;
  --gold: #e9c46a;
  --gold-soft: #fff4d4;
  --blue: #376b82;
  --blue-soft: #e3eff5;
  --danger: #a93434;
  --success: #216a4c;
  --shadow: 0 22px 60px rgba(20, 55, 46, .12);
  --radius: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--cream); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--pine-2); }
h1, h2, h3 { margin: 0; color: var(--pine); font-family: Georgia, "Times New Roman", serif; line-height: 1.08; }
p { line-height: 1.65; }
.hidden { display: none !important; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 1000; padding: 10px 16px; border-radius: 10px; color: white; background: var(--pine); }
.skip-link:focus { top: 12px; }
.app-shell { min-height: 100vh; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 76px; padding: 14px clamp(20px, 5vw, 72px); color: white; background: var(--pine); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.4); border-radius: 14px; font-family: Georgia, serif; font-size: 1rem; background: rgba(255,255,255,.08); }
.brand strong { display: block; font-family: Georgia, serif; font-size: 1.1rem; }
.brand small { display: block; color: #cadbd4; font-size: .75rem; margin-top: 2px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.top-actions button { color: white; border-color: rgba(255,255,255,.35); }

.hero { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(330px, .72fr); gap: clamp(36px, 6vw, 88px); align-items: center; min-height: calc(100vh - 76px); padding: clamp(46px, 8vw, 104px) clamp(22px, 7vw, 110px); background: radial-gradient(circle at 88% 18%, rgba(233,196,106,.32), transparent 26%), radial-gradient(circle at 4% 88%, rgba(55,107,130,.16), transparent 30%), var(--cream); }
.hero-copy { max-width: 760px; }
.eyebrow { margin: 0 0 12px; color: var(--coral); font-size: .76rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.hero h1 { max-width: 720px; font-size: clamp(3rem, 7vw, 6.6rem); letter-spacing: -.055em; }
.hero h1 em { color: var(--coral); font-style: italic; }
.hero-lead { max-width: 670px; margin: 26px 0 30px; color: #455851; font-size: clamp(1.05rem, 2vw, 1.28rem); }
.hero-points { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 0; padding: 0; list-style: none; }
.hero-points li { padding: 9px 13px; border: 1px solid #cbd7d1; border-radius: 999px; color: var(--pine); background: rgba(255,255,255,.58); font-size: .88rem; font-weight: 700; }
.auth-card, .panel, .course-card, .child-card, .report-card { border: 1px solid rgba(23,63,53,.12); background: var(--paper); box-shadow: var(--shadow); }
.auth-card { padding: clamp(24px, 4vw, 38px); border-radius: var(--radius); }
.auth-card h2 { font-size: 2rem; }
.tab-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 22px 0; padding: 5px; border-radius: 14px; background: #edf0ec; }
.tab-row button { min-height: 44px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; cursor: pointer; font-weight: 800; }
.tab-row button.active { color: white; background: var(--pine); }

.form-stack { display: grid; gap: 16px; }
.field { display: grid; gap: 7px; }
.field label, .field-label { color: #344740; font-size: .84rem; font-weight: 800; }
.field small { color: var(--muted); line-height: 1.45; }
input, select, textarea { width: 100%; border: 1px solid #c8d2cc; border-radius: 13px; outline: none; color: var(--ink); background: white; transition: border .15s, box-shadow .15s; }
input, select { min-height: 48px; padding: 0 13px; }
textarea { min-height: 132px; padding: 13px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { border-color: var(--pine-2); box-shadow: 0 0 0 4px rgba(36,85,72,.12); }
.check { display: flex; align-items: flex-start; gap: 10px; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.check input { flex: 0 0 auto; width: 18px; min-height: 18px; margin-top: 2px; }
.error-box, .info-box, .warning-box, .success-box { padding: 13px 15px; border-radius: 13px; font-size: .88rem; line-height: 1.5; }
.error-box { color: #7c2222; background: #fde8e8; }
.info-box { color: #254c5d; background: var(--blue-soft); }
.warning-box { color: #604813; background: var(--gold-soft); }
.success-box { color: #18583e; background: #e1f2e9; }
.form-note { color: var(--muted); font-size: .78rem; }
.legal-prompt { margin: 0; }
.inline-legal { display: inline; padding: 0; border: 0; color: var(--pine-2); background: transparent; cursor: pointer; font: inherit; font-weight: 800; text-decoration: underline; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 19px; border: 1px solid transparent; border-radius: 13px; cursor: pointer; font-weight: 850; text-decoration: none; transition: transform .15s, background .15s, opacity .15s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .55; transform: none; }
.button.primary { color: white; background: var(--pine); }
.button.primary:hover { background: var(--pine-2); }
.button.secondary { color: var(--pine); border-color: #b9c9c2; background: white; }
.button.soft { color: var(--pine); background: var(--pine-soft); }
.button.danger { color: var(--danger); border-color: #e8c7c7; background: white; }
.button.small { min-height: 38px; padding: 0 13px; border-radius: 10px; font-size: .82rem; }
.link-button { padding: 0; border: 0; color: var(--pine-2); background: none; cursor: pointer; text-decoration: underline; }
.icon-button { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 12px; color: var(--pine); background: white; cursor: pointer; font-size: 1.35rem; }
.full { width: 100%; }

.page { min-height: calc(100vh - 76px); padding: clamp(28px, 5vw, 64px) clamp(18px, 5vw, 72px) 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; max-width: 1280px; margin: 0 auto 30px; }
.page-head h1 { font-size: clamp(2.4rem, 5vw, 4.5rem); letter-spacing: -.04em; }
.page-head p { max-width: 620px; margin: 12px 0 0; color: var(--muted); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 24px; max-width: 1280px; margin: auto; }
.panel { padding: clamp(20px, 3vw, 30px); border-radius: 22px; box-shadow: 0 14px 45px rgba(20,55,46,.08); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.panel-head h2 { font-size: 1.6rem; }
.child-list, .report-list, .observation-list { display: grid; gap: 14px; }
.child-card { padding: 20px; border-radius: 18px; box-shadow: none; }
.child-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.child-card h3 { font-size: 1.45rem; }
.meta { margin: 5px 0 0; color: var(--muted); font-size: .82rem; }
.progress-track { height: 9px; margin: 18px 0 8px; overflow: hidden; border-radius: 999px; background: #e5e9e6; }
.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--pine-2), #77a58f); }
.progress-copy { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: .75rem; }
.code-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: var(--pine-soft); }
.code-box code { color: var(--pine); font-size: 1.02rem; font-weight: 900; letter-spacing: .12em; }
.child-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 15px; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat { padding: 18px; border-radius: 16px; background: #f2f4f0; }
.stat strong { display: block; color: var(--pine); font-family: Georgia, serif; font-size: 2rem; }
.stat span { color: var(--muted); font-size: .78rem; }
.section-tabs { display: flex; gap: 8px; overflow-x: auto; max-width: 1280px; margin: 0 auto 18px; padding-bottom: 2px; }
.section-tabs button { white-space: nowrap; }
.empty { padding: 28px 18px; border: 1px dashed #bdc9c2; border-radius: 16px; text-align: center; color: var(--muted); }
.empty strong { display: block; margin-bottom: 5px; color: var(--pine); }
.badge { display: inline-flex; align-items: center; min-height: 27px; padding: 0 9px; border-radius: 999px; font-size: .72rem; font-weight: 850; }
.badge.sent, .badge.positive { color: #18583e; background: #dff1e7; }
.badge.queued, .badge.mixed { color: #664d16; background: #fff1c7; }
.badge.failed, .badge.difficult { color: #7c2222; background: #f9dddd; }
.badge.neutral { color: #385260; background: #e2edf2; }
.report-card { padding: 18px; border-radius: 16px; box-shadow: none; }
.report-card summary { cursor: pointer; list-style: none; }
.report-card summary::-webkit-details-marker { display: none; }
.report-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.report-details { padding-top: 16px; }
.answer-row { padding: 12px 0; border-top: 1px solid var(--line); }
.answer-row strong { display: block; margin-bottom: 4px; color: var(--pine); font-size: .84rem; }
.answer-row p { margin: 0; white-space: pre-wrap; }
.observation-row { padding: 16px 0; border-top: 1px solid var(--line); }
.observation-row:first-child { border-top: 0; }
.observation-row h3 { font-family: inherit; font-size: 1rem; }
.observation-row p { margin: 7px 0 0; color: var(--muted); font-size: .88rem; }

.child-home { min-height: calc(100vh - 76px); padding: clamp(28px, 7vw, 80px) 20px; background: radial-gradient(circle at 85% 8%, rgba(233,196,106,.27), transparent 26%), var(--cream); }
.child-home-inner { max-width: 920px; margin: auto; }
.child-home h1 { max-width: 720px; font-size: clamp(2.8rem, 7vw, 5.5rem); letter-spacing: -.05em; }
.today-card { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; margin-top: 32px; padding: clamp(24px, 5vw, 42px); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); }
.today-card h2 { font-size: clamp(1.8rem, 4vw, 3rem); }
.today-card p { max-width: 640px; color: var(--muted); }
.lock-visual { display: grid; place-items: center; width: 92px; height: 92px; border-radius: 28px; color: var(--pine); background: var(--pine-soft); font-size: 2rem; }
.privacy-note { margin-top: 22px; padding: 16px 18px; border-radius: 14px; color: var(--muted); background: rgba(255,255,255,.62); font-size: .86rem; }

.course-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: 100vh; background: var(--cream); }
.course-rail { position: sticky; top: 0; align-self: start; display: flex; flex-direction: column; min-height: 100vh; padding: 28px; color: white; background: var(--pine); }
.course-rail h1 { margin-top: 28px; color: white; font-size: 2.25rem; }
.course-rail p { color: #c8d9d2; font-size: .9rem; }
.course-progress { display: grid; gap: 8px; margin: 30px 0; padding: 0; list-style: none; }
.course-progress li { display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 8px 10px; border-radius: 11px; color: #b9ccc4; font-size: .82rem; font-weight: 700; }
.course-progress li span { display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid rgba(255,255,255,.28); border-radius: 50%; }
.course-progress li.active { color: white; background: rgba(255,255,255,.1); }
.course-progress li.done span { color: var(--pine); background: #bcd8cb; }
.rail-bottom { display: grid; gap: 9px; margin-top: auto; }
.rail-bottom .button { color: white; border-color: rgba(255,255,255,.3); background: transparent; }
.rail-legal { display: flex; justify-content: center; gap: 14px; margin-top: 4px; }
.rail-legal button { padding: 0; border: 0; color: #c8d9d2; background: transparent; cursor: pointer; font-size: .74rem; text-decoration: underline; }
.course-main { padding: clamp(24px, 5vw, 72px); }
.course-top { display: flex; justify-content: space-between; gap: 20px; max-width: 900px; margin: 0 auto 18px; color: var(--muted); font-size: .8rem; }
.course-card { max-width: 900px; margin: auto; padding: clamp(24px, 5vw, 52px); border-radius: var(--radius); }
.course-card h2 { max-width: 720px; font-size: clamp(2rem, 5vw, 3.8rem); letter-spacing: -.035em; }
.intro { max-width: 720px; color: var(--muted); font-size: 1rem; }
.sharing-label { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 18px; padding: 7px 10px; border-radius: 999px; font-size: .73rem; font-weight: 850; }
.sharing-label.shared { color: #724035; background: var(--coral-soft); }
.sharing-label.private { color: #315f72; background: var(--blue-soft); }
.option-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 22px; }
.option { min-height: 56px; padding: 12px 14px; border: 1px solid #c7d1cb; border-radius: 13px; color: var(--ink); background: white; cursor: pointer; text-align: left; }
.option:hover, .option.selected { border-color: var(--pine-2); color: var(--pine); background: var(--pine-soft); }
.scale-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 7px; margin-top: 22px; }
.scale-grid .option { display: grid; place-items: center; min-height: 48px; padding: 0; text-align: center; }
.scale-labels { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; color: var(--muted); font-size: .72rem; }
.voice-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.voice-status { color: var(--muted); font-size: .78rem; }
.voice-button.listening { color: white; border-color: var(--coral); background: var(--coral); }
.truth-check { margin-top: 22px; padding: 20px; border: 1px solid #e4c99b; border-radius: 16px; background: #fff8e8; }
.truth-check h3 { font-family: inherit; font-size: 1.06rem; }
.truth-check p { color: var(--muted); font-size: .86rem; }
.button-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 28px; }
.button-group { display: flex; gap: 10px; }
.results-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 24px 0; }
.result-card { padding: 22px; border-radius: 17px; }
.result-card.coping { background: var(--pine-soft); }
.result-card.action { background: var(--gold-soft); }
.result-card h3 { margin: 8px 0; font-size: 1.45rem; }
.result-card p, .result-card li { font-size: .88rem; line-height: 1.55; }
.result-card ol { padding-left: 20px; }
.tag { color: var(--coral); font-size: .7rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.email-preview { margin-top: 24px; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; }
.email-head { padding: 18px 20px; color: white; background: var(--pine); }
.email-head div + div { margin-top: 6px; color: #cadbd4; font-size: .82rem; }
.email-body { padding: 22px; background: #fff; }
.email-body h3 { margin: 24px 0 10px; font-family: inherit; font-size: 1rem; }
.email-body h3:first-child { margin-top: 0; }
.finished-icon { display: grid; place-items: center; width: 76px; height: 76px; margin-bottom: 22px; border-radius: 24px; color: white; background: var(--success); font-size: 2rem; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; background: rgba(11,31,26,.72); }
.modal-card { position: relative; width: min(620px, 100%); max-height: 90vh; overflow-y: auto; padding: clamp(24px, 5vw, 40px); border-radius: 22px; background: var(--paper); box-shadow: 0 30px 80px rgba(0,0,0,.24); }
.modal-card h2 { font-size: 2rem; }
.modal-close { position: absolute; top: 15px; right: 15px; }
.support-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.support-grid a { display: grid; gap: 4px; padding: 15px; border-radius: 13px; color: var(--pine); background: var(--pine-soft); text-decoration: none; }
.support-grid span { color: var(--muted); font-size: .78rem; }
.legal-copy { color: #455851; }
.legal-copy h3 { margin: 24px 0 7px; font-family: inherit; font-size: 1rem; }
.legal-copy p { margin: 0; font-size: .9rem; }
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 22px clamp(20px, 5vw, 72px); color: #cadbd4; background: var(--pine); font-size: .78rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 14px; }
.site-footer button { padding: 0; border: 0; color: white; background: transparent; cursor: pointer; font-size: inherit; text-decoration: underline; }
.toast { position: fixed; right: 18px; bottom: 18px; z-index: 200; max-width: 380px; padding: 13px 16px; border-radius: 13px; color: white; background: var(--pine); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(12px); transition: .2s; }
.toast.show { opacity: 1; transform: none; }
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4); border-top-color: white; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .hero, .dashboard-grid { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
  .auth-card { max-width: 620px; }
  .course-layout { grid-template-columns: 1fr; }
  .course-rail { position: static; min-height: auto; }
  .course-rail h1, .course-rail > p { display: none; }
  .course-progress { grid-template-columns: repeat(5, minmax(110px,1fr)); overflow-x: auto; margin: 20px 0 0; }
  .rail-bottom { display: none; }
}

@media (max-width: 650px) {
  .topbar { padding-inline: 16px; }
  .brand small { display: none; }
  .hero { padding-inline: 18px; }
  .hero h1 { font-size: 3.2rem; }
  .page { padding-inline: 14px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .today-card, .results-grid { grid-template-columns: 1fr; }
  .lock-visual { display: none; }
  .option-grid { grid-template-columns: 1fr; }
  .scale-grid { grid-template-columns: repeat(5, 1fr); }
  .button-row { align-items: stretch; flex-direction: column-reverse; }
  .button-group { display: grid; grid-template-columns: 1fr; width: 100%; }
  .button-row > .button { width: 100%; }
  .support-grid { grid-template-columns: 1fr; }
  .site-footer { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
