/* Public pages: landing, sign-in, legal, admin. Same tokens as the portal. */
:root {
  --bg: #f6f4f1; --surface: #ffffff; --surface-2: #f3f1ee; --border: #e7e2dc;
  --text: #1d2127; --muted: #66707d; --accent: #2f6fed; --accent-ink: #fff;
  --accent-soft: #e8f0fe; --warm: #f59e0b; --warm-soft: #fff4dc; --ok: #12805c;
  --danger: #c0352b; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 10px 30px rgba(16,24,40,.08);
  --radius: 16px; --max: 1120px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1216; --surface: #171b21; --surface-2: #1d222a; --border: #2a303a; --text: #e8ebf0;
    --muted: #9aa4b2; --accent: #5b8def; --accent-soft: #1d2a44; --warm: #f5b43c; --warm-soft: #33270f;
    --ok: #3ccf91; --danger: #f06b60; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"] {
  --bg: #0f1216; --surface: #171b21; --surface-2: #1d222a; --border: #2a303a; --text: #e8ebf0;
  --muted: #9aa4b2; --accent: #5b8def; --accent-soft: #1d2a44; --warm: #f5b43c; --warm-soft: #33270f;
  --ok: #3ccf91; --danger: #f06b60; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font: 16px/1.6 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
img, svg { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { width: min(var(--max), 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* header */
.site-head { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent);
             backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.site-head .wrap { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 750; font-size: 18px; color: var(--text); text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; flex: none;
              background: center / cover no-repeat url("/static/logo-mark.svg");
              font-size: 0; color: transparent; overflow: hidden; }
.brand small { font-weight: 500; font-size: 12px; color: var(--muted); margin-left: 2px; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; }
.nav a:hover { color: var(--text); }
.nav-toggle { display: none; margin-left: auto; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 6px 10px; color: var(--text); }
@media (max-width: 760px) {
  .nav-toggle { display: inline-block; }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; gap: 4px;
         background: var(--surface); border-bottom: 1px solid var(--border); padding: 12px 16px; align-items: stretch; }
  .nav.open { display: flex; }
  .nav a { padding: 10px 4px; }
}

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 12px; padding: 11px 20px;
       font: inherit; font-weight: 650; text-decoration: none; border: 1px solid transparent; cursor: pointer; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.07); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 7px 14px; font-size: 14px; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* hero */
.hero { padding: clamp(40px, 8vw, 96px) 0 48px; }
.hero .wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: 1fr; } }
.eyebrow { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 700; color: #9a5b00;
           background: var(--warm-soft); border-radius: 999px; padding: 4px 12px; }
:root[data-theme="dark"] .eyebrow { color: var(--warm); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .eyebrow { color: var(--warm); } }
.hero h1 { font-size: clamp(34px, 5.2vw, 56px); line-height: 1.08; letter-spacing: -1.5px; margin: 16px 0; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--warm), #ef6c4a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: clamp(17px, 2vw, 20px); color: var(--muted); max-width: 560px; margin: 0 0 28px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .fine { margin-top: 18px; font-size: 13px; color: var(--muted); }

/* hero illustration (pure CSS) */
.mock { background: var(--surface); border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow); padding: 18px; display: grid; gap: 10px; }
.mock-head { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.mock-av { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #7cc4a4, #3f8f6e); display: grid; place-items: center; color: #fff; font-weight: 700; }
.mock-name { font-weight: 700; line-height: 1.2; }
.mock-sub { font-size: 12px; color: var(--muted); }
.b { max-width: 80%; padding: 9px 13px; border-radius: 18px; font-size: 14px; line-height: 1.4; }
.b.in { background: var(--surface-2); border-bottom-left-radius: 6px; }
.b.out { background: var(--accent); color: #fff; margin-left: auto; border-bottom-right-radius: 6px; }
.b.sched { margin-left: auto; border: 1.5px dashed var(--accent); color: var(--text); background: transparent; }
.b-meta { font-size: 11px; color: var(--muted); text-align: right; margin-top: -4px; }
.b-photo { margin-left: auto; width: 62%; aspect-ratio: 4/3; border-radius: 16px; background: linear-gradient(135deg, #fcd34d, #f97316 55%, #7c3aed); }

/* sections */
section { padding: 64px 0; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 40px; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 38px); letter-spacing: -.8px; margin: 0 0 10px; line-height: 1.15; }
.section-head p { color: var(--muted); margin: 0; font-size: 17px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.card h3 { margin: 12px 0 6px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.ico.warm { background: var(--warm-soft); color: var(--warm); }
.ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.alt { background: var(--surface); border-block: 1px solid var(--border); }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; counter-reset: step; }
@media (max-width: 800px) { .steps { grid-template-columns: 1fr; } }
.step { position: relative; padding: 22px 22px 22px 70px; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--border); }
.step::before { counter-increment: step; content: counter(step); position: absolute; left: 22px; top: 22px; width: 34px; height: 34px; border-radius: 50%;
                background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; }
.step h3 { margin: 0 0 4px; font-size: 17px; }
.step p { margin: 0; color: var(--muted); font-size: 15px; }
.notice { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 800px) { .notice { grid-template-columns: 1fr; } }
.notice .card { border-left: 4px solid var(--warm); }

/* contact */
.contact-wrap { display: grid; grid-template-columns: .8fr 1.2fr; gap: 36px; align-items: start; }
@media (max-width: 860px) { .contact-wrap { grid-template-columns: 1fr; } }
form.stack { display: grid; gap: 14px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); font: inherit; }
.field textarea { min-height: 140px; resize: vertical; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .two { grid-template-columns: 1fr; } }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-msg { padding: 10px 14px; border-radius: 10px; font-size: 15px; margin: 0; }
.form-msg.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.form-msg.err { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }

/* footer */
.site-foot { border-top: 1px solid var(--border); padding: 32px 0 40px; color: var(--muted); font-size: 14px; }
.site-foot .wrap { display: grid; gap: 14px; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: center; }
.foot-links { display: flex; gap: 18px; flex-wrap: wrap; }
.foot-links a { color: var(--muted); text-decoration: none; }
.foot-links a:hover { color: var(--text); }
.disclaimer { font-size: 13px; max-width: 860px; }

/* sign-in */
.auth { min-height: calc(100dvh - 64px); display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); padding: 30px; display: grid; gap: 16px; }
.auth-card h1 { margin: 0; font-size: 24px; letter-spacing: -.4px; }
.demo-hint { margin: 0; font-size: 13px; padding: 8px 12px; border-radius: 10px; background: var(--warm-soft); color: #7a4d00; }

/* legal */
.legal { padding: 48px 0 64px; }
.legal article { width: min(760px, 100% - 32px); margin-inline: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: clamp(22px, 4vw, 44px); }
.legal h1 { margin-top: 0; letter-spacing: -.6px; }
.legal h2 { font-size: 19px; margin-top: 32px; }
.legal li { margin: 6px 0; }
.legal .updated { color: var(--muted); font-size: 14px; margin-top: -8px; }
.lock-badge { font-size: 36px; margin-bottom: 8px; }

/* resource link cards */
.grid.two-up { grid-template-columns: repeat(2, 1fr); max-width: 820px; margin-inline: auto; }
@media (max-width: 680px) { .grid.two-up { grid-template-columns: 1fr; } }
.link-card { text-decoration: none; color: inherit; display: block; transition: border-color .15s, transform .15s; }
.link-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.link-card h3 { margin: 0 0 8px; }
.link-more { display: inline-block; margin-top: 12px; color: var(--accent); font-weight: 650; font-size: 14px; }

/* faq */
.faq { width: min(780px, 100%); margin-inline: auto; display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 0 20px; }
.faq summary { cursor: pointer; list-style: none; padding: 18px 28px 18px 0; font-weight: 700; font-size: 17px; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
    font-size: 22px; font-weight: 400; color: var(--muted); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 0 0 18px; color: var(--muted); line-height: 1.6; }

/* dedication */
.dedication { padding: clamp(48px, 9vw, 104px) 0 72px; }
.dedication article { width: min(680px, 100% - 32px); margin-inline: auto; text-align: center; }
.dedication .mark { width: 84px; height: 84px; border-radius: 22px; margin: 0 auto 26px;
    background: center / cover no-repeat url("/static/logo-mark.svg");
    font-size: 0; color: transparent; }
.dedication .eyebrow { text-transform: uppercase; letter-spacing: 2px; font-size: 13px;
    font-weight: 700; color: var(--warm); margin: 0 0 10px; }
.dedication h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.12; letter-spacing: -1px; margin: 0 0 8px; }
.dedication .names { font-size: clamp(22px, 3.4vw, 30px); font-weight: 700; margin: 22px 0 6px;
    background: linear-gradient(90deg, var(--warm), #ef6c4a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.dedication .body { font-size: clamp(17px, 2vw, 20px); color: var(--text); line-height: 1.6; max-width: 560px; margin: 24px auto 0; }
.dedication .body + .body { margin-top: 16px; }
.dedication .solo { margin-top: 28px; font-size: 15px; color: var(--muted); }
.dedication .rule { width: 56px; height: 3px; border-radius: 3px; margin: 30px auto 0;
    background: linear-gradient(90deg, var(--warm), #ef6c4a); border: 0; }

/* admin */
.admin { padding: 32px 0 64px; }
.admin h1 { margin-bottom: 4px; }
.note-line { margin: 10px 0 24px; padding: 10px 14px; border-radius: 10px; font-size: 14px;
    background: var(--accent-soft); color: var(--text); border: 1px solid var(--border); }
.admin-section { margin: 32px 0; }
.admin-section h2 { font-size: 18px; margin: 0 0 12px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; display: grid; gap: 2px; }
.stat-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 28px; font-weight: 800; letter-spacing: -.5px; }
.stat-foot { font-size: 12px; color: var(--muted); }
.chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; position: relative; }
.chart { width: 100%; height: 160px; display: block; }
.chart .bar-msg { fill: var(--accent); }
.chart .bar-send { fill: var(--warm); }
.chart .axis { stroke: var(--border); stroke-width: 1; }
.chart-x { position: absolute; bottom: 6px; left: 20px; font-size: 11px; color: var(--muted); }
.chart-x-right { left: auto; right: 20px; }
.chart-legend { display: flex; gap: 16px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.key::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.key-msg::before { background: var(--accent); }
.key-send::before { background: var(--warm); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--surface); }
.admin-table th, .admin-table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.admin-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table .mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.pill { border: 1px solid var(--border); background: var(--bg); color: var(--muted); border-radius: 999px; padding: 4px 14px; font-weight: 700; font-size: 13px; cursor: pointer; }
.pill.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.pill:disabled { opacity: .5; cursor: default; }
.msg-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; display: grid; gap: 6px; }
.msg-card.unread { border-left: 4px solid var(--accent); }
.msg-top { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline; }
.msg-top strong { font-size: 16px; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 4px 0; }
.msg-actions { display: flex; gap: 8px; }
.list { display: grid; gap: 12px; }
.nav a.btn-primary { color: var(--accent-ink); }
.section-head.left { text-align: left; margin: 0 0 16px; }
@media (max-width: 760px) {
  .nav.nav-plain { display: flex; position: static; flex-direction: row; background: none; border: 0; padding: 0; gap: 14px; }
}
