/* One look only: Eli picked the dark palette for everyone, so it no longer follows the phone's Light/Dark setting. */
:root {
  --bg: #0a0f1d;
  --surface: #141b2e;
  --surface-2: #1d2641;
  --ink: #edf0f7;
  --ink-2: #b4bcd1;
  --ink-3: #8a93ab;
  --line: #2a3350;
  --card-border: #232c47;
  --header: #0f1d45;
  --header-ink: #ffffff;
  --brand: #f5b400;
  --brand-ink: #111a2e;
  --gold: #f5b400;
  --gold-soft: #372c0b;
  --gold-ink: #ffd766;
  --good: #62d69c;
  --danger: #ff7a6b;
  --radius: 16px;
  --shadow: none;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.2; }
svg { flex: none; }

/* ---------- header ---------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  padding-top: var(--safe-top);
  background: var(--header);
  color: var(--header-ink);
}
.bar-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  max-width: 680px;
  min-height: 52px;
  margin: 0 auto;
  padding: 0 6px;
}
.bar-title {
  margin: 0;
  max-width: 55vw;
  overflow: hidden;
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bar-side { display: flex; align-items: center; min-width: 0; }
.bar-right { justify-content: flex-end; }
.bar-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: inherit;
  font-size: 17px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.bar-btn:active { background: rgba(255, 255, 255, 0.14); }
.bar-btn.strong { color: var(--gold); font-weight: 700; }
.bar-btn svg,
.btn svg,
.tab svg,
.copy-hint svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.bar-btn svg { width: 22px; height: 22px; }
svg.star-ico { fill: var(--gold); stroke: none; }

/* ---------- layout ---------- */

.view {
  max-width: 680px;
  margin: 0 auto;
  padding: 16px 16px calc(40px + var(--safe-bottom));
}
.view.with-tabs { padding-bottom: calc(96px + var(--safe-bottom)); }

.tabbar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  padding-bottom: var(--safe-bottom);
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.tabbar-inner { display: grid; grid-template-columns: repeat(3, 1fr); max-width: 680px; margin: 0 auto; }
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 56px;
  padding: 7px 0 6px;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}
.tab svg { width: 26px; height: 26px; }
.tab.on { color: var(--brand); }
.tab.on svg { stroke-width: 2.4; }
body.typing .tabbar { display: none; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 12px 18px;
  border: 0;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 17px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}
.btn:active { transform: scale(0.98); filter: brightness(0.95); }
.btn:disabled { opacity: 0.75; transform: none; }
.btn svg { width: 20px; height: 20px; }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-outline { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-white { background: #fff; color: #14285f; } /* New lesson: white with the school blue, so it stands out */
.btn-danger { margin-top: 28px; background: transparent; color: var(--danger); }
.btn-danger:disabled { color: var(--ink-3); opacity: 0.55; }
.check.wipe-check { align-items: flex-start; margin-top: 18px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: 15px; line-height: 1.4; }
.check.wipe-check input { flex: none; margin-top: 1px; }
.check.wipe-check + .btn-danger { margin-top: 10px; }
.btn-block { display: flex; width: 100%; }
.btn-block + .btn-block { margin-top: 10px; }
.btn-tall { min-height: 56px; font-size: 18px; }
.btn-small { min-height: 40px; padding: 8px 14px; border-radius: 12px; font-size: 15px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.two .btn { padding-inline: 10px; }
.link-btn {
  padding: 12px 8px;
  border: 0;
  background: none;
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- cards & lists ---------- */

.card {
  padding: 16px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.list { display: grid; gap: 10px; }
.list-title {
  margin: 22px 4px 10px;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.empty-note { padding: 24px 0; color: var(--ink-3); text-align: center; }
mark { padding: 0 1px; border-radius: 3px; background: var(--gold-soft); color: inherit; }

.welcome h2 { margin: 0 0 8px; font-size: 22px; }
.welcome p { margin: 0 0 10px; color: var(--ink-2); }
.welcome p:last-child { margin-bottom: 0; }

.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface-2);
  font-size: 15px;
}
.banner-gold { background: var(--gold-soft); color: var(--gold-ink); }
.banner .btn { flex: none; }

.search { margin-bottom: 6px; }
.view .search input[type=search] {
  padding-left: 40px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a93a8' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 13px center / 18px;
}

.hint { margin: 6px 2px 0; color: var(--ink-3); font-size: 14px; }
.hint a { color: var(--ink-2); font-weight: 700; }
.top-hint { margin: 10px 4px 0; }
.fine { color: var(--ink-3); font-size: 14px; }
.center { text-align: center; }

/* ---------- install walkthrough ---------- */

.install { padding-bottom: calc(120px + var(--safe-bottom)); }
.install-card { text-align: center; }
.install-icon { display: block; margin: 4px auto 14px; border-radius: 18px; box-shadow: var(--shadow); }
.install-card h2 { margin: 0 0 8px; font-size: 24px; text-wrap: balance; }
.install-card > p { margin: 0 0 18px; color: var(--ink-2); }
.install-card .link-btn { display: block; margin: 8px auto 0; }
.install-steps { display: grid; gap: 14px; margin: 0 0 6px; padding: 0; list-style: none; text-align: left; }
.install-steps li { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: start; }
.install-steps .num { margin-top: 1px; }
.install-steps .fine { display: block; margin-top: 4px; }
.install-steps .key {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--brand);
}
.glyph { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -5px; }
.install-steps .fine .glyph { width: 18px; height: 18px; color: var(--ink-2); }
.sheet-demo {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  font-size: 15px;
  color: var(--ink-3);
}
.sheet-demo div { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; }
.sheet-demo div + div { border-top: 1px solid var(--line); }
.sheet-demo .hit { color: var(--ink); font-weight: 700; background: var(--gold-soft); box-shadow: inset 0 0 0 2px var(--gold); }
.sheet-demo .glyph { width: 18px; height: 18px; }
/* The animated three-tap demo. One 10-second loop; every part keys off the same timeline. */
.demo { --cycle: 10s; display: grid; justify-items: center; gap: 10px; margin: 4px 0 18px; }
.demo-phone {
  width: 150px;
  padding: 6px;
  border-radius: 24px;
  background: #0b1022;
  box-shadow: 0 10px 26px rgba(13, 26, 66, 0.22), inset 0 0 0 1.5px #2a3558;
}
.demo-screen {
  position: relative;
  aspect-ratio: 9 / 18;
  overflow: hidden;
  border-radius: 18px;
  background: #f4f6fa;
  color: #111a2e;
  font-size: 8px;
  line-height: 1.2;
}
.demo-page { position: absolute; inset: 14px 12px auto; display: grid; gap: 7px; }
.demo-page i { display: block; height: 7px; border-radius: 4px; background: #d6dce7; }
.demo-page i:nth-child(2) { width: 70%; }
.demo-page i:nth-child(4) { width: 55%; }
.demo-bar {
  position: absolute;
  right: 6px;
  bottom: 6px;
  left: 6px;
  display: flex;
  justify-content: center;
  height: 24px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.demo-android .demo-bar { top: 6px; bottom: auto; justify-content: flex-end; padding-right: 4px; }
.demo-trigger {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 12px;
  color: #14285f;
  animation: demoPulse var(--cycle) infinite;
}
.demo-trigger .glyph { width: 13px; height: 13px; }
.demo-sheet {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 6px 6px 8px;
  border-radius: 12px 12px 0 0;
  background: #fff;
  box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.15);
  transform: translateY(105%);
  animation: demoSheet var(--cycle) infinite;
}
.demo-row { display: flex; align-items: center; justify-content: space-between; padding: 5px 6px; border-radius: 5px; color: #6e7890; }
.demo-row .glyph { width: 9px; height: 9px; }
.demo-row.hit { color: #111a2e; font-weight: 700; animation: demoRow var(--cycle) infinite; }
.demo-add {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-between;
  padding: 10px 8px;
  background: #f4f6fa;
  color: #0a84ff;
  opacity: 0;
  animation: demoAdd var(--cycle) infinite;
}
.demo-add b { color: #111a2e; }
.demo-add .hit { font-weight: 700; padding: 0 3px; border-radius: 4px; animation: demoPulseSoft var(--cycle) infinite; }
.demo-home {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)); /* minmax(0) so the tiny label can't widen the columns */
  align-content: start;
  gap: 9px 8px;
  padding: 16px 12px;
  background: radial-gradient(120% 90% at 20% 10%, #3a5ba0 0%, #1d2f63 45%, #0e1633 100%);
  opacity: 0;
  animation: demoHome var(--cycle) infinite;
}
.demo-home i { display: block; min-width: 0; aspect-ratio: 1; border-radius: 6px; background: rgba(255, 255, 255, 0.85); }
.demo-icon { display: grid; min-width: 0; justify-items: center; gap: 2px; transform: scale(0); animation: demoPop var(--cycle) infinite; }
.demo-icon img { display: block; width: 100%; max-width: 100%; aspect-ratio: 1; border-radius: 6px; }
.demo-icon b { max-width: 100%; overflow: hidden; font-size: 5px; color: #fff; white-space: nowrap; text-overflow: ellipsis; }
.demo-tap {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(245, 180, 0, 0.55);
  box-shadow: 0 0 0 2px rgba(245, 180, 0, 0.9);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.4);
  animation: demoTap var(--cycle) infinite;
}
.demo-caption { position: relative; width: 100%; height: 22px; text-align: center; font-size: 14px; font-weight: 700; color: var(--brand); }
.demo-caption span { position: absolute; inset: 0; opacity: 0; animation: demoCap var(--cycle) infinite; }
.demo-caption span:nth-child(2) { animation-name: demoCap2; }
.demo-caption span:nth-child(3) { animation-name: demoCap3; }
.demo-caption span:nth-child(4) { animation-name: demoCap4; }

@keyframes demoPulse {
  0%, 4% { box-shadow: 0 0 0 0 rgba(245, 180, 0, 0.8); }
  12% { box-shadow: 0 0 0 9px rgba(245, 180, 0, 0); }
  13%, 16% { box-shadow: 0 0 0 0 rgba(245, 180, 0, 0.8); }
  24% { box-shadow: 0 0 0 9px rgba(245, 180, 0, 0); }
  25%, 100% { box-shadow: 0 0 0 0 rgba(245, 180, 0, 0); }
}
@keyframes demoSheet {
  0%, 26% { transform: translateY(105%); }
  31%, 55% { transform: translateY(0); }
  57%, 100% { transform: translateY(105%); }
}
@keyframes demoRow {
  0%, 38% { background: transparent; box-shadow: none; }
  42%, 55% { background: #fff1c7; box-shadow: inset 0 0 0 2px #f5b400; }
  56%, 100% { background: transparent; box-shadow: none; }
}
@keyframes demoAdd {
  0%, 55% { opacity: 0; }
  58%, 77% { opacity: 1; }
  80%, 100% { opacity: 0; }
}
@keyframes demoPulseSoft {
  0%, 60% { box-shadow: 0 0 0 0 rgba(245, 180, 0, 0); }
  63% { box-shadow: 0 0 0 0 rgba(245, 180, 0, 0.9); }
  71% { box-shadow: 0 0 0 8px rgba(245, 180, 0, 0); }
  72%, 100% { box-shadow: 0 0 0 0 rgba(245, 180, 0, 0); }
}
@keyframes demoHome {
  0%, 79% { opacity: 0; }
  83%, 100% { opacity: 1; }
}
@keyframes demoPop {
  0%, 84% { transform: scale(0); }
  90% { transform: scale(1.18); }
  94%, 100% { transform: scale(1); }
}
@keyframes demoTap {
  0%, 16% { opacity: 0; left: 50%; top: 92%; transform: translate(-50%, -50%) scale(0.4); }
  18% { opacity: 0.9; transform: translate(-50%, -50%) scale(0.6); }
  23% { opacity: 0; transform: translate(-50%, -50%) scale(1.7); }
  24%, 46% { opacity: 0; left: 50%; top: 75%; transform: translate(-50%, -50%) scale(0.4); }
  48% { opacity: 0.9; transform: translate(-50%, -50%) scale(0.6); }
  53% { opacity: 0; transform: translate(-50%, -50%) scale(1.7); }
  54%, 66% { opacity: 0; left: 86%; top: 8%; transform: translate(-50%, -50%) scale(0.4); }
  68% { opacity: 0.9; transform: translate(-50%, -50%) scale(0.6); }
  73% { opacity: 0; transform: translate(-50%, -50%) scale(1.7); }
  74%, 100% { opacity: 0; }
}
.demo-android .demo-tap { animation-name: demoTapAndroid; }
@keyframes demoTapAndroid {
  0%, 16% { opacity: 0; left: 88%; top: 8%; transform: translate(-50%, -50%) scale(0.4); }
  18% { opacity: 0.9; transform: translate(-50%, -50%) scale(0.6); }
  23% { opacity: 0; transform: translate(-50%, -50%) scale(1.7); }
  24%, 46% { opacity: 0; left: 50%; top: 75%; transform: translate(-50%, -50%) scale(0.4); }
  48% { opacity: 0.9; transform: translate(-50%, -50%) scale(0.6); }
  53% { opacity: 0; transform: translate(-50%, -50%) scale(1.7); }
  54%, 66% { opacity: 0; left: 86%; top: 8%; transform: translate(-50%, -50%) scale(0.4); }
  68% { opacity: 0.9; transform: translate(-50%, -50%) scale(0.6); }
  73% { opacity: 0; transform: translate(-50%, -50%) scale(1.7); }
  74%, 100% { opacity: 0; }
}
@keyframes demoCap { 0%, 2% { opacity: 0; } 4%, 24% { opacity: 1; } 27%, 100% { opacity: 0; } }
@keyframes demoCap2 { 0%, 28% { opacity: 0; } 31%, 53% { opacity: 1; } 56%, 100% { opacity: 0; } }
@keyframes demoCap3 { 0%, 57% { opacity: 0; } 60%, 76% { opacity: 1; } 79%, 100% { opacity: 0; } }
@keyframes demoCap4 { 0%, 80% { opacity: 0; } 83%, 98% { opacity: 1; } 100% { opacity: 0; } }

/* No motion: show the share sheet with the right row lit, and all the captions at once. */
@media (prefers-reduced-motion: reduce) {
  .demo * { animation: none !important; }
  .demo-sheet { transform: none; }
  .demo-row.hit { background: #fff1c7; box-shadow: inset 0 0 0 2px #f5b400; }
  .demo-caption { height: auto; display: grid; gap: 2px; }
  .demo-caption span { position: static; opacity: 1; }
  .demo-caption span:nth-child(4) { display: none; }
}

/* ---------- break down tab ---------- */

.setup-card { margin-bottom: 18px; border: 2px solid var(--gold); }
.setup-card h2 { margin: 0 0 6px; font-size: 20px; }
.setup-card p { margin: 0 0 12px; color: var(--ink-2); }
.setup-card .hint { margin: 8px 2px 14px; }
.setup-card .link-btn { display: block; margin: 0 auto; padding: 6px 12px; }
.setup-card .field { margin-bottom: 12px; }
.link-inline {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-2);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

/* ---------- my style (settings) ---------- */

.style-row { margin-bottom: 14px; }
.style-row .label { margin-bottom: 8px; }
.chips { display: flex; gap: 6px; }
.chip {
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  padding: 8px 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}
.chip.on { border-color: var(--brand); background: var(--brand); color: var(--brand-ink); }
.style-examples { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin: 0 0 10px; }
.style-example {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 14px;
}
.style-example .mini { flex: none; }
.style-example .snip { flex: 1; min-width: 0; overflow: hidden; color: var(--ink-2); text-overflow: ellipsis; white-space: nowrap; }

/* ---------- phones (admin) ---------- */

.card-title { margin: 0 0 8px; font-size: 19px; }
.phone-card { display: grid; gap: 4px; }
.phone-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 17px; font-weight: 700; }
.phone-meta { color: var(--ink-3); font-size: 14px; }
.phone-card .two { margin-top: 10px; }
.phone-card .two + .btn-block { margin-top: 10px; }
.transfer-card { margin-bottom: 14px; border: 2px solid var(--gold); }
.transfer-card p { margin: 0 0 4px; }
.btn-danger-soft { color: var(--danger); }

.label.big-label { margin-bottom: 10px; color: var(--ink); font-size: 19px; }
.write-actions { margin-top: 18px; }
.write-actions .two { margin-bottom: 10px; }
.write-actions > .hint { margin-top: 12px; }
.ai-next {
  margin-bottom: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  font-size: 15px;
}
.ai-next p { margin: 0 0 10px; }
.prompt-box { margin-bottom: 10px; font-size: 14px; }
.paste-wrap { margin-top: 10px; }
.paste-wrap .btn { margin-top: 10px; }

.result { margin-top: 22px; scroll-margin-top: calc(var(--safe-top) + 64px); }
.result-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.result-head h2 { margin: 0; font-size: 19px; }
.pill {
  padding: 3px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--good) 16%, transparent);
  color: var(--good);
  font-size: 13px;
  font-weight: 700;
}
.text { white-space: pre-wrap; overflow-wrap: anywhere; }
.result-copy { margin: 14px 0 12px; } /* under the breakdown text, above the other buttons */
.result .two + .two { margin-top: 10px; }
.pill-gold { background: var(--gold-soft); color: var(--gold-ink); }
.modify .step { margin-top: 22px; }
.result-text { margin: 14px 2px 16px; font-size: 16px; line-height: 1.5; }
.result-edit { margin: 14px 0 16px; font-size: 16px; }

/* ---------- saved tab ---------- */

.item { cursor: pointer; transition: box-shadow 0.2s, border-color 0.2s; }
.item:active { background: var(--surface-2); }
.item.copied { border-color: var(--good); box-shadow: 0 0 0 2px var(--good); }
.item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.item-title { padding-top: 6px; font-weight: 700; }
.item-actions { display: flex; flex: none; gap: 6px; }
.item-text {
  display: -webkit-box;
  margin-top: 4px;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 15px;
  white-space: pre-wrap;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}
.item-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; color: var(--ink-3); font-size: 13px; }
.copy-hint { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; font-weight: 700; }
.copy-hint svg { width: 15px; height: 15px; }
.item.copied .copy-hint { color: var(--good); }
.mini {
  flex: none;
  min-height: 36px;
  padding: 7px 12px;
  border: 0;
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

/* ---------- forms ---------- */

.field { display: block; margin-bottom: 14px; }
.label { display: block; margin: 0 0 6px 2px; color: var(--ink-2); font-size: 14px; font-weight: 700; }
.optional { color: var(--ink-3); font-size: 13px; font-weight: 500; }
input:not([type=checkbox]):not([type=file]),
textarea {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background-color: var(--surface);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.4;
  -webkit-appearance: none;
  appearance: none;
}
input:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);
}
textarea { min-height: 64px; resize: none; }
textarea.big { min-height: 170px; }
.check { display: flex; align-items: center; gap: 12px; padding: 6px 2px 16px; font-size: 16px; }
.check input { width: 22px; height: 22px; accent-color: var(--brand); }

.settings .card { margin-bottom: 14px; }
.settings h2 { margin: 0 0 8px; font-size: 19px; }
.settings p { margin: 0 0 12px; }
.settings .steps { margin: 0 0 14px; padding-left: 22px; }
.settings .steps li { margin: 6px 0; }
.settings a { font-weight: 600; }
.ok-line { color: var(--good); font-weight: 600; }
/* Settings sections: a title row you tap to unfold. Sub-sections are the same inside a section. */
.fold summary {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}
.fold summary::-webkit-details-marker { display: none; }
.fold summary > span:first-child { flex: 1; min-width: 0; }
.fold summary::after {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  margin: 0 4px 3px 0;
  border-right: 2px solid var(--ink-3);
  border-bottom: 2px solid var(--ink-3);
  transform: rotate(45deg);
  transition: transform 0.15s;
}
.fold[open] > summary::after { transform: rotate(225deg); margin-bottom: -3px; }
.settings-section { padding: 0; }
.settings-section > summary { padding: 15px 16px; font-size: 18px; }
.settings-section > .section-body { padding: 2px 16px 16px; }
.section-body > :first-child { margin-top: 0; }
.sub-section { border-top: 1px solid var(--line); }
.sub-section > summary { padding: 13px 0; font-size: 16px; }
.sub-section > .section-body { padding: 0 0 14px; }
.sub-section:last-child > .section-body { padding-bottom: 4px; }
.model-field { margin-top: 16px; }

/* ---------- review card (always light, so it scans well) ---------- */

.review-view { padding-top: 12px; }

/* Eli's full card, sized to fit between the header and the tab bar without scrolling. */
.rv-image-wrap {
  position: relative;
  width: min(100%, 520px, calc((100vh - 136px - var(--safe-top) - var(--safe-bottom)) * 1023 / 1537));
  width: min(100%, 520px, calc((100svh - 136px - var(--safe-top) - var(--safe-bottom)) * 1023 / 1537));
  margin: 0 auto;
  aspect-ratio: 1023 / 1537;
}
.rv-image-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 3% / 2%;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
}
/* Invisible tap target over the SCAN QR CODE bar printed on the card: tapping it copies the link. */
.rv-link-hit {
  position: absolute;
  top: 61.7%;
  left: 15.2%;
  width: 69.5%;
  height: 8.3%;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
}
.rv-link-hit:active { background: rgba(255, 255, 255, 0.18); }
.review-card {
  padding: 16px 14px 14px;
  border: 2px solid #13265c;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  color: #13265c;
  text-align: center;
}
.rv-title { margin: 0; font-size: clamp(22px, 7vw, 36px); font-weight: 900; letter-spacing: -0.5px; line-height: 1.05; }
.rv-stars { display: flex; justify-content: center; gap: 6px; margin: 8px 0 4px; }
.rv-stars svg { width: 26px; height: 26px; fill: #f5b400; stroke: none; }
.rv-sub { margin: 0 0 10px; color: #111; font-size: 14px; font-weight: 800; letter-spacing: 0.02em; text-transform: uppercase; }
.rv-qr {
  width: min(62vw, 34vh, 300px);
  margin: 0 auto;
  padding: 6px;
  border: 3px solid #f5b400;
  border-radius: 16px;
  background: #fff;
}
.rv-qr svg { display: block; width: 100%; height: auto; }
.rv-error { margin: 12px; color: #c23b2e; font-size: 15px; }
.rv-link {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 14px;
  border: 0;
  border-radius: 10px;
  background: #13265c;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.rv-hint { margin: 6px 0 10px; font-size: 13px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.rv-name { font-size: clamp(28px, 9.5vw, 44px); font-style: italic; font-weight: 900; letter-spacing: -1px; line-height: 1; }
.rv-road { position: relative; height: 9px; margin: 6px 6px 8px; border-radius: 2px; background: #111; }
.rv-road::after {
  content: "";
  position: absolute;
  top: 3.5px;
  right: 6px;
  left: 6px;
  height: 2px;
  background: repeating-linear-gradient(90deg, #f5b400 0 14px, transparent 14px 22px);
}
.rv-school { margin-right: -0.5em; font-size: 15px; font-weight: 800; letter-spacing: 0.5em; text-transform: uppercase; }
.rv-thanks { margin: 10px 0 0; font-size: 13px; font-weight: 700; }

/* ---------- toast ---------- */

#toast {
  position: fixed;
  top: calc(var(--safe-top) + 62px);
  left: 50%;
  z-index: 50;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--ink);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  color: var(--bg);
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -8px);
  transition: opacity 0.2s, transform 0.2s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.with-action { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; pointer-events: auto; }
.toast-action {
  flex: none;
  min-height: 36px;
  padding: 6px 14px;
  border: 0;
  border-radius: 9px;
  background: var(--brand);
  color: var(--brand-ink);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

/* ---------- pull down to reload ---------- */

.ptr {
  position: fixed;
  top: calc(var(--safe-top) + 52px);
  right: 0;
  left: 0;
  z-index: 9; /* slides out from under the header */
  display: flex;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-70px);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.ptr.pulling { transition: none; }
.ptr-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
}
.ptr svg { width: 18px; height: 18px; transition: transform 0.2s; }
.ptr.ready .ptr-pill { border-color: var(--brand); color: var(--brand); }
.ptr.ready svg { transform: rotate(180deg); }
.ptr .spinner { width: 16px; height: 16px; border-width: 2px; }
.version .link-btn { padding: 2px 4px; color: var(--brand); font-size: inherit; }
