:root {
  --bg: #fbf8f3;
  --surface: #ffffff;
  --ink: #1d2a26;
  --muted: #5d6b66;
  --line: #e7e1d6;
  --brand: #1f6f5c;
  --brand-ink: #ffffff;
  --brand-soft: #e3f1ec;
  --accent: #e8833a;
  --accent-soft: #fdeedf;
  --accent-ink: #b35a17;   /* accent-colored text: readable on white and on --accent-soft */
  --danger: #b4412f;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(29, 42, 38, .06), 0 6px 20px rgba(29, 42, 38, .06);
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141a18; --surface: #1c2421; --ink: #ecf1ee; --muted: #a2b0aa; --line: #2c3632;
    --brand: #4fb79a; --brand-ink: #0d1412; --brand-soft: #1f3530; --accent: #f0a062; --accent-soft: #3a2a1d; --accent-ink: #f0a062;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 17.5px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }
h1, h2, h3 { font-family: var(--display); line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.02em; }
h1 { font-size: clamp(2rem, 6vw, 3.2rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 4vw, 2rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .93rem; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; } /* long dropdown text must not widen cards past the screen */
@media (min-width: 760px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.hidden { display: none !important; }

/* Header */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 12px; }
.logo { font-family: var(--display); font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; display: flex; gap: 8px; align-items: center; }
.logo-mark { width: 30px; height: 30px; border-radius: 8px; display: block; }
nav.links { display: flex; gap: 6px; }
nav.links a { text-decoration: none; color: var(--muted); padding: 8px 10px; border-radius: 8px; font-weight: 600; font-size: .95rem; }
nav.links a.on, nav.links a:hover { color: var(--ink); background: var(--brand-soft); }

/* Buttons & inputs */
.btn { appearance: none; border: 0; border-radius: 10px; padding: 11px 18px; font: 700 .95rem var(--font); cursor: pointer;
  background: var(--brand); color: var(--brand-ink); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.btn:hover { filter: brightness(1.05); }
.btn.secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn.accent { background: var(--accent); color: #fff; }
.btn.ghost { background: transparent; color: var(--brand); padding: 8px 10px; }
.btn.sm { padding: 7px 12px; min-height: 38px; font-size: .92rem; }
.btn:disabled { opacity: .55; cursor: default; }
label { display: block; font-weight: 700; font-size: .93rem; margin-bottom: 6px; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; min-height: 44px; }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }
.field { margin-bottom: 14px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 7px 13px;
  font: 600 .93rem var(--font); cursor: pointer; min-height: 38px; }
.chip.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.pill { display: inline-block; font-size: .82rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); }
.pill.free { background: var(--accent-soft); color: var(--accent-ink); }
.pill.gray { background: var(--line); color: var(--muted); }

/* Landing */
.hero { padding: 56px 0 36px; }
.hero .lead { font-size: 1.2rem; color: var(--muted); max-width: 640px; }
.teaser { margin-top: 26px; }
.teaser form { display: grid; gap: 12px; }
@media (min-width: 760px) { .teaser form { grid-template-columns: 140px 1fr 140px auto; align-items: end; } }
.stat { font-family: var(--display); font-size: 2.6rem; font-weight: 700; color: var(--brand); line-height: 1; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 18px 0; }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stats .card { padding: 14px; }
.bars { display: grid; gap: 6px; }
.bar { display: grid; grid-template-columns: 120px 1fr 40px; gap: 8px; align-items: center; font-size: .875rem; }
.bar > div { height: 10px; border-radius: 6px; background: var(--brand); filter: blur(0); }
.blur { filter: blur(5px); user-select: none; }
section.band { padding: 44px 0; border-top: 1px solid var(--line); }
.feature h3 { margin-top: 8px; }
.icon { width: 40px; height: 40px; border-radius: 12px; background: var(--brand-soft); display: grid; place-items: center; font-size: 20px; }
.price { font-family: var(--display); font-size: 3rem; font-weight: 700; }
.check { list-style: none; padding: 0; margin: 0 0 16px; }
.check li { padding: 6px 0 6px 28px; position: relative; }
.check li::before { content: "✓"; position: absolute; left: 0; color: var(--brand); font-weight: 800; }
footer { padding: 30px 0 50px; color: var(--muted); font-size: .875rem; border-top: 1px solid var(--line); }

/* App */
.app-tabs { display: flex; gap: 4px; overflow-x: auto; padding: 12px 0; scrollbar-width: none; }
.app-tabs button { flex: 0 0 auto; }
.toolbar { display: grid; gap: 10px; margin-bottom: 14px; }
@media (min-width: 760px) { .toolbar { grid-template-columns: repeat(3, 1fr); } .toolbar #q { grid-column: 1 / -1; } }
.list { display: grid; gap: 12px; }
.item { display: grid; gap: 6px; }
.item .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: .92rem; color: var(--muted); }
.item h3 { margin: 0; font-family: var(--font); font-weight: 800; font-size: 1.12rem; }
.item .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.day { margin: 18px 0 8px; font-weight: 800; color: var(--muted); text-transform: uppercase; font-size: .86rem; letter-spacing: .06em; }
.plan-item { border-left: 4px solid var(--brand); }
.done { opacity: .6; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 18px;
  border-radius: 10px; font-weight: 700; z-index: 50; box-shadow: var(--shadow); max-width: calc(100% - 32px); }
.kid { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.copy { display: flex; gap: 8px; }
.copy input { font-size: .8rem; }
table.admin { width: 100%; border-collapse: collapse; font-size: .85rem; }
table.admin td, table.admin th { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; vertical-align: top; word-break: break-word; }

/* Small screens: keep the header on one line */
.logo, nav.links a, .top .btn { white-space: nowrap; }
.top .row { flex-wrap: nowrap; gap: 4px; }
@media (max-width: 560px) {
  .logo { font-size: 1rem; gap: 6px; }
  .logo-mark { width: 26px; height: 26px; font-size: 15px; }
  nav.links a { padding: 6px 7px; font-size: .875rem; }
  nav.links a.hide-sm { display: none; }
  .hero { padding-top: 32px; }
}
@media (max-width: 560px) {
  .chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .chips.scroll .chip { flex: 0 0 auto; }
}

@media (max-width: 560px) { .top .hide-sm { display: none; } }

/* Back-to-top chevron */
#to-top {
  position: fixed; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 40;
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--brand); box-shadow: var(--shadow);
  display: grid; place-items: center; cursor: pointer;
  opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s, transform .2s;
}
#to-top.show { opacity: 1; transform: none; pointer-events: auto; }
#to-top:hover { background: var(--brand); color: var(--brand-ink); }

details.how-popular { margin: 0 0 12px; }
details.how-popular summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.pill-btn { border: 0; cursor: pointer; font-family: inherit; }
.pill-btn:hover { filter: brightness(.95); text-decoration: underline; }

/* Admin tables become stacked cards on phones */
@media (max-width: 640px) {
  table.admin, table.admin tbody, table.admin tr, table.admin td { display: block; width: 100%; }
  table.admin tr:first-child { display: none; }               /* header row */
  table.admin tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  table.admin td { border: 0; padding: 3px 0; display: grid; grid-template-columns: 7.5em 1fr; gap: 8px; }
  table.admin td::before { content: attr(data-label); font-weight: 700; color: var(--muted); font-size: .85em; text-transform: capitalize; }
  table.admin td.act { display: block; padding-top: 6px; }
  table.admin td.act::before { content: none; }
  .admin-wrap .card { overflow-x: visible; }
}
details.log > summary { cursor: pointer; font-weight: 700; font-size: 1.05rem; padding: 10px 0; color: var(--ink); }
details.log > summary::marker { color: var(--brand); }

/* Search boxes with a clear (✕) button */
.search-wrap { position: relative; }
.search-wrap input { padding-right: 44px; }
.search-wrap input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-clear { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: var(--line); color: var(--ink); font-size: 15px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.search-clear:hover { background: var(--brand-soft); }
@media (min-width: 760px) { .toolbar #q-wrap { grid-column: 1 / -1; } }

video.pitch{display:block;width:100%;height:auto;aspect-ratio:16/9;margin-top:18px;border-radius:16px;border:1px solid var(--line);background:#fbf8f3;box-shadow:0 20px 40px -28px rgba(29,42,38,.45)}
.pitch-wrap{position:relative;margin-top:18px;scroll-margin-top:calc(var(--header-h,64px) + 12px)}
.pitch-wrap video.pitch{margin-top:0}
.pitch-play{position:absolute;inset:0;border:0;border-radius:16px;background:rgba(29,42,38,.18);cursor:pointer;display:flex;align-items:center;justify-content:center}
.pitch-play span{width:76px;height:76px;border-radius:50%;background:var(--accent);color:#fff;font-size:30px;display:flex;align-items:center;justify-content:center;padding-left:6px;box-shadow:0 12px 30px -10px rgba(0,0,0,.5);transition:transform .15s}
.pitch-play:hover span{transform:scale(1.06)}
.linkish{background:none;border:0;padding:0;color:inherit;font:inherit;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.offline-bar{position:sticky;top:0;z-index:20;background:#5d4a1a;color:#fff;padding:8px 16px;font-size:.92rem;font-weight:600;text-align:center}
.gate{position:fixed;inset:0;z-index:50;background:rgba(20,26,24,.55);display:flex;align-items:center;justify-content:center;padding:16px;overflow:auto}
.gate-card{max-width:560px;width:100%;max-height:calc(100vh - 32px);overflow:auto}
.gate-card ul{padding-left:20px;margin:8px 0}
.gate-card li{margin:6px 0}
