:root {
  --bg: #f6f2ea; --surface: #fffdf9; --sunk: #efe9de; --ink: #1c2230; --muted: #5d6676; --line: #e2dbcd;
  --accent: #23614f; --accent-2: #2f7d66; --accent-ink: #ffffff; --warn: #9a4a12; --warn-bg: #fbeedd;
  --bad: #a3271f; --hi: #ffe873; --hi-ink: #1c2230; --chip: #e7efe9; --shadow: 0 1px 2px rgb(28 34 48 / 6%), 0 4px 16px rgb(28 34 48 / 6%);
  --radius: 14px; --serif: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12161d; --surface: #1a1f28; --sunk: #232a35; --ink: #e8ebf0; --muted: #9ca5b4; --line: #2c3442;
    --accent: #5db497; --accent-2: #74c6aa; --accent-ink: #0d1a15; --warn: #f0a868; --warn-bg: #3a2a1a;
    --bad: #ff8a80; --hi: rgb(255 214 10 / 32%); --hi-ink: #fff6c8; --chip: #22332c; --shadow: 0 1px 2px rgb(0 0 0 / 30%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12161d; --surface: #1a1f28; --sunk: #232a35; --ink: #e8ebf0; --muted: #9ca5b4; --line: #2c3442;
  --accent: #5db497; --accent-2: #74c6aa; --accent-ink: #0d1a15; --warn: #f0a868; --warn-bg: #3a2a1a;
  --bad: #ff8a80; --hi: rgb(255 214 10 / 32%); --hi-ink: #fff6c8; --chip: #22332c; --shadow: 0 1px 2px rgb(0 0 0 / 30%);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--sans); }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* top bar */
.top { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.01em; text-decoration: none; color: var(--ink); }
.brand img { width: 30px; height: 30px; border-radius: 8px; }

/* cards and forms */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
input[type=text], input[type=password], input[type=date], input[type=time], select, textarea {
  width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 10px 12px; min-height: 44px;
}
textarea { min-height: 150px; resize: vertical; line-height: 1.45; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, .chip:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px;
}
.field + .field { margin-top: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .grid2 { grid-template-columns: 1fr; } }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.check input { width: 20px; height: 20px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; text-decoration: none; color: var(--ink); }
.btn:hover { background: var(--sunk); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger { color: var(--bad); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: .9rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.chip { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--chip); cursor: pointer; font-size: .875rem; font-weight: 600; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.filebtn { position: relative; overflow: hidden; }
.filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* results / review items */
.items { display: grid; gap: 12px; margin: 16px 0; }
.item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.item.needs-check { border-left: 4px solid var(--warn); }
.item.is-ready { border-left: 4px solid var(--accent); }
.item h3 { font-size: 1.1rem; margin: 2px 0 2px; }
.when { font-weight: 600; }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: 6px; background: var(--chip); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.reasons { margin: 8px 0 0; padding: 8px 12px; background: var(--warn-bg); color: var(--warn); border-radius: 10px; font-size: .9rem; list-style: none; }
.reasons li + li { margin-top: 2px; }
.quote { margin: 10px 0 0; padding: 8px 12px; border-left: 3px solid var(--line); color: var(--muted); font-size: .9rem; white-space: pre-wrap; word-break: break-word; }
mark { background: var(--hi); color: var(--hi-ink); padding: 0 2px; border-radius: 3px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
mark small { font-size: .65rem; font-weight: 700; text-transform: uppercase; opacity: .6; margin-left: 3px; }
.actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.empty { text-align: center; padding: 32px 16px; color: var(--muted); }
.notice { padding: 10px 14px; border-radius: 10px; background: var(--chip); font-size: .92rem; }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.toast { position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px;
  border-radius: 999px; font-weight: 600; box-shadow: var(--shadow); z-index: 20; max-width: calc(100% - 32px); }

footer { padding: 24px 0 40px; font-size: .85rem; color: var(--muted); }

/* app shell */
.app main { padding-bottom: 96px; }
nav.tabs { position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--line); z-index: 10;
  display: grid; grid-template-columns: repeat(5, 1fr); padding-bottom: env(safe-area-inset-bottom); }
nav.tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 10px; text-decoration: none; color: var(--muted); font-size: .75rem; font-weight: 600; position: relative; }
nav.tabs a svg { width: 22px; height: 22px; }
nav.tabs a[aria-current="page"] { color: var(--accent); }
nav.tabs .count { position: absolute; top: 4px; left: calc(50% + 6px); background: var(--warn); color: #fff; border-radius: 999px; font-size: .68rem; padding: 0 6px; min-width: 18px; text-align: center; }
@media (min-width: 900px) {
  nav.tabs { position: sticky; top: 0; bottom: auto; border-top: 0; border-bottom: 1px solid var(--line); display: flex; justify-content: center; gap: 8px; }
  nav.tabs a { flex-direction: row; gap: 6px; padding: 12px 14px; font-size: .9rem; }
  nav.tabs .count { position: static; }
  .app main { padding-bottom: 40px; }
}
.view h2 { font: 600 1.6rem/1.15 var(--serif); margin-top: 8px; }

/* calendar */
.month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; font-size: .85rem; }
.month .dow { color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; }
.month button { border: 0; background: transparent; min-height: 40px; border-radius: 10px; cursor: pointer; position: relative; }
.month button.has::after { content: ""; position: absolute; left: 50%; bottom: 5px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--accent); }
.month button.today { outline: 2px solid var(--accent); }
.month button.out { color: var(--muted); opacity: .45; }
.day { margin-top: 18px; }
.day h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 6px; }
.ev { display: grid; grid-template-columns: 88px 1fr; gap: 10px; padding: 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; width: 100%; text-align: left; }
.ev + .ev { margin-top: 6px; }
.ev .t { font-weight: 700; font-variant-numeric: tabular-nums; }
.ev.cancelled .title, .ev.removed .title { text-decoration: line-through; color: var(--muted); }
.ev.optional { border-style: dashed; }
.tag { font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
pre.digest { white-space: pre-wrap; font: .92rem/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; overflow-wrap: anywhere; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.secret { font: .85rem ui-monospace, Menlo, monospace; word-break: break-all; background: var(--sunk); padding: 10px; border-radius: 10px; }
dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); width: min(520px, calc(100% - 32px)); padding: 18px; }
dialog::backdrop { background: rgb(0 0 0 / 40%); }
.w-date { max-width: 200px; }
.h-serif { font: 600 1.35rem/1.2 var(--serif); }
html { scroll-padding-bottom: 96px; }
@media (min-width: 900px) { html { scroll-padding-bottom: 0; scroll-padding-top: 56px; } }
.ev { grid-template-columns: max-content 1fr; }
.ev .t { white-space: nowrap; min-width: 64px; }
#who { max-width: 55%; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qr { width: 240px; height: 240px; image-rendering: pixelated; background: #fff; padding: 8px; border-radius: 12px; }
.paircode { font: 700 2rem/1 ui-monospace, Menlo, monospace; letter-spacing: .12em; padding: 14px 18px; background: var(--sunk); border-radius: 12px; display: inline-block; }
.groups { display: grid; gap: 6px; max-height: 360px; overflow: auto; padding: 4px; border: 1px solid var(--line); border-radius: 10px; }
.check.group { padding: 8px; border-radius: 8px; }
.check.group:hover { background: var(--sunk); }

/* landing page (index.html): every rule is scoped under body.landing so the app pages are untouched */
@media (prefers-reduced-motion: no-preference) { html:has(body.landing) { scroll-behavior: smooth; } }
.landing .wrap { max-width: 1040px; }
.landing main > section { scroll-margin-top: 16px; }
.landing .skip { position: absolute; left: 12px; top: -60px; z-index: 30; padding: 8px 14px; border-radius: 10px; background: var(--ink); color: var(--bg); font-weight: 600; }
.landing .skip:focus { top: 12px; }
.landing p { margin: 0 0 .75em; }

.landing .l-hero { padding: 20px 0 8px; max-width: 760px; }
.landing .l-eyebrow { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent); background: var(--chip); padding: 4px 10px; border-radius: 999px; margin-bottom: 14px; }
.landing .l-hero h1 { font: 600 clamp(2rem, 7.2vw, 3.4rem)/1.06 var(--serif); letter-spacing: -.02em; margin-bottom: .45em; }
.landing .l-hero h1 em { font-style: normal; background: linear-gradient(transparent 58%, var(--hi) 58%, var(--hi) 92%, transparent 92%);
  box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.landing .l-lede { font-size: 1.12rem; color: var(--muted); max-width: 38em; }
.landing .l-ctas { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 12px; }
.landing .l-big { min-height: 50px; padding: 0 22px; font-size: 1.05rem; }
@media (max-width: 420px) { .landing .l-hero .l-ctas .btn { flex: 1 1 100%; } }

.landing .l-section { padding: 36px 0 8px; }
.landing .l-h2 { font: 600 clamp(1.5rem, 4.6vw, 2.1rem)/1.15 var(--serif); letter-spacing: -.01em; }
.landing .l-intro { color: var(--muted); max-width: 40em; font-size: 1.05rem; }

/* before / after illustration */
.landing .l-demo { margin: 18px 0 0; display: grid; gap: 12px; }
.landing .l-demo figcaption { grid-column: 1 / -1; }
.landing .l-chat { background: var(--sunk); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.landing .l-chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
.landing .l-chat-head b { display: block; line-height: 1.2; }
.landing .l-chat-sub { display: block; font-size: .8rem; color: var(--muted); }
.landing .l-avatar { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: .8rem; }
.landing .l-unread { margin-left: auto; flex: none; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }
.landing .l-bubbles { list-style: none; margin: 0; padding: 12px; display: grid; gap: 8px; }
.landing .l-bubble { max-width: 88%; padding: 7px 11px; background: var(--surface); border-radius: 4px 12px 12px 12px; font-size: .92rem; line-height: 1.4; color: var(--muted);
  box-shadow: 0 1px 1px rgb(28 34 48 / 8%); overflow-wrap: anywhere; }
.landing .l-bubble b { display: block; font-size: .78rem; color: var(--ink); opacity: .75; }
.landing .l-bubble.is-key { color: var(--ink); outline: 2px solid var(--accent); outline-offset: 0; }
.landing .l-arrow { display: grid; place-items: center; color: var(--accent); }
.landing .l-arrow svg { width: 32px; height: 32px; }
.landing .l-found { display: grid; gap: 12px; align-content: start; }
.landing .l-entry { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.landing .l-entry.needs-check { border-left-color: var(--warn); }
.landing .l-entry p { margin: 0; }
.landing .l-entry .badge { margin-bottom: 6px; }
.landing .l-entry-when { font-weight: 600; }
.landing .l-entry-title { font-size: 1.1rem; font-weight: 700; }
.landing .l-reason { margin-top: 8px !important; padding: 8px 12px; background: var(--warn-bg); color: var(--warn); border-radius: 10px; font-size: .9rem; }
.landing .l-source { margin-top: 10px !important; padding: 6px 12px; border-left: 3px solid var(--line); color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
.landing .l-source span { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
@media (min-width: 820px) {
  .landing .l-demo { grid-template-columns: minmax(0, 1.1fr) auto minmax(0, 1fr); align-items: center; gap: 18px; }
  .landing .l-arrow svg { transform: rotate(-90deg); }
}

/* how it works */
.landing .l-steps { list-style: none; counter-reset: step; margin: 18px 0 0; padding: 0; display: grid; gap: 12px; }
.landing .l-steps li { counter-increment: step; position: relative; padding: 16px 16px 14px 64px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.landing .l-steps li::before { content: counter(step); position: absolute; left: 16px; top: 14px; width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.landing .l-steps h3 { font-size: 1.05rem; margin: 4px 0 4px; }
.landing .l-steps p { margin: 0; color: var(--muted); }
@media (min-width: 820px) {
  .landing .l-steps { grid-template-columns: repeat(4, 1fr); }
  .landing .l-steps li { padding: 60px 16px 16px; }
  .landing .l-steps li::before { top: 16px; }
}

/* try box */
.landing .l-try .card { max-width: 760px; }
.landing .l-try [aria-live] { max-width: 760px; }

/* trust */
.landing .l-trust { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
@media (min-width: 600px) { .landing .l-trust { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .landing .l-trust { grid-template-columns: repeat(3, 1fr); } .landing .l-trust .l-honest { grid-column: span 2; } }
.landing .l-trust li { padding: 14px 16px; border-radius: var(--radius); background: var(--sunk); color: var(--muted); }
.landing .l-trust b { display: block; color: var(--ink); margin-bottom: 2px; }
.landing .l-trust .l-honest { padding: 16px; background: var(--warn-bg); color: var(--ink); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); }
.landing .l-trust .l-honest h3 { font-size: 1.05rem; color: var(--warn); }
.landing .l-trust .l-honest p { margin: 0; max-width: 60em; }

/* FAQ */
.landing .l-faq { margin-top: 14px; max-width: 760px; border-top: 1px solid var(--line); }
.landing .l-faq details { border-bottom: 1px solid var(--line); }
.landing .l-faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 2px; min-height: 44px; font-weight: 600; }
.landing .l-faq summary::-webkit-details-marker { display: none; }
.landing .l-faq summary::after { content: "+"; flex: none; font-size: 1.4rem; line-height: 1; color: var(--accent); }
.landing .l-faq details[open] summary::after { content: "\2212"; }
.landing .l-faq summary:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; border-radius: 6px; }
.landing .l-faq details p { margin: 0 2px 16px; color: var(--muted); max-width: 42em; }

.landing .l-end { margin: 36px 0 0; padding: 22px 20px; }
.landing .l-end .l-ctas { margin-bottom: 0; }
.landing footer p { margin: 0 0 .5em; max-width: 60em; }

/* pricing (landing) */
.beta { display: inline-block; vertical-align: middle; font: 700 .66rem/1 var(--sans); letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 6px; border-radius: 6px; background: var(--warn-bg); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }
.landing .l-plans { display: grid; gap: 12px; margin-top: 16px; max-width: 820px; }
@media (min-width: 700px) { .landing .l-plans { grid-template-columns: 1fr 1fr; } }
.landing .l-plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.landing .l-plan.is-paid { border: 2px solid var(--accent); box-shadow: var(--shadow); }
.landing .l-plan h3 { font-size: 1.1rem; }
.landing .l-price { font: 600 2rem/1 var(--serif); margin: 6px 0 12px; }
.landing .l-price span { font: 500 .9rem var(--sans); color: var(--muted); }
.landing .l-plan ul { margin: 0 0 14px; padding-left: 1.2em; color: var(--muted); }
.landing .l-plan li + li { margin-top: 4px; }

/* privacy and terms */
.landing .l-legal { max-width: 760px; padding: 8px 0 24px; }
.landing .l-legal h1 { font: 600 clamp(1.9rem, 6vw, 2.6rem)/1.1 var(--serif); }
.landing .l-legal h2 { font: 600 1.3rem/1.2 var(--serif); margin-top: 1.6em; }
.landing .l-legal ul { padding-left: 1.2em; }
.landing .l-legal li + li { margin-top: 6px; }
.landing footer a { color: inherit; }

/* plan banner and paywall (app) */
.plan-banner { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 4px 0 12px; }
.plan-banner.ended { background: var(--warn-bg); color: var(--warn); }
.paywall { border: 2px solid var(--accent); }
.paywall h3 { font: 600 1.25rem/1.2 var(--serif); }
.wa-warning { border: 2px solid var(--warn); }
.wa-warning h3 { color: var(--warn); }
.wa-warning ul { margin: 0; padding-left: 1.2em; }
.wa-warning li + li { margin-top: 6px; }
.agree a { font-weight: 600; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
