/* Stormless website, "Daylight Glass" (DESIGN.md at the repo root; tokens
   from lib/src/theme/app_colors.dart). Warm paper under every page, colour
   as light: a honey wash at the top and a soft glow behind each drawing.
   Content sits on solid white cards lifted by tinted shadows, never a
   border. Glass only on what floats (the header and its menu). New York
   for display headlines, the system font for everything else. */
@import url('fonts.css');

:root {
  color-scheme: light;

  /* Base */
  --paper: #F7F4EE;
  --surface: #FFFFFF;
  --sunk: #F1EDE5;
  --ink: #1A1E22;
  --ink-soft: #585C63;
  --muted: #6A655B;      /* only on paper, white and sunk */
  --on-ink: #FFFDF8;
  --danger: #B3261E;

  /* Honey, the one accent */
  --honey: #E7BE58;
  --honey-lit: #F0CD72;
  --honey-deep: #E0B249;
  --honey-text: #7A5C14;
  --cta-shade: 138 100 22;

  /* The page's hue (honey by default; see the .hue-* classes):
     wash (top of a page), plate (behind drawings on covers), glow (the
     light behind a drawing) and shade (the tint of shadows), as RGB. */
  --wash: #F5E8C8;
  --plate: #F3E3B8;
  --glow: #E9C86F;
  --glow-opacity: .55;
  --shade: 58 46 20;

  --font-ui: -apple-system, BlinkMacSystemFont, system-ui, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  /* New York on Apple devices (ui-serif); a close serif elsewhere. */
  --font-display: ui-serif, 'New York', Georgia, 'Times New Roman', serif;
  --font-brand: 'Quicksand', ui-rounded, system-ui, sans-serif;

  --radius-sm: 14px;
  --radius: 24px;
  --radius-lg: 32px;

  --gutter: 20px;
  --max: 1120px;
}

/* Category families, as in the app (AppHue). A section wears one. */
.hue-honey { --wash: #F5E8C8; --plate: #F3E3B8; --glow: #E9C86F; --shade: 58 46 20; --glow-opacity: .55; }
.hue-mist { --wash: #D9EDF8; --plate: #CDE6F5; --glow: #8FCBEE; --shade: 31 46 58; --glow-opacity: .5; }
.hue-lilac { --wash: #E6E0F6; --plate: #DCD4F2; --glow: #B3A3E6; --shade: 46 42 61; --glow-opacity: .5; }
.hue-blush { --wash: #F9E0D8; --plate: #F6D5CA; --glow: #F2A893; --shade: 58 36 32; --glow-opacity: .4; }
.hue-sage { --wash: #DDEDD8; --plate: #D0E7C9; --glow: #97CE8C; --shade: 34 48 31; --glow-opacity: .45; }

*, *::before, *::after { box-sizing: border-box; }

/* Component display rules must never override the hidden attribute. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  /* The honey wash at the top of every page fades into the paper. */
  background:
    linear-gradient(180deg, #F5E8C8 0, rgb(245 232 200 / .55) 280px, rgb(245 232 200 / 0) 680px) no-repeat,
    var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; }
/* Display lines: New York, upright, Apple's display tracking. */
h1, h2, .display {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.1;
}
h1 { font-size: clamp(2.4rem, 5.4vw, 3.75rem); }
h2 { font-size: clamp(1.85rem, 3.6vw, 2.6rem); }
h3 {
  font-family: var(--font-ui);
  font-size: 1.2rem; line-height: 1.25; letter-spacing: -0.01em;
}
p { margin: 0; text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 10px;
}

.nowrap { white-space: nowrap; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -80px; z-index: 100;
  background: var(--ink); color: var(--on-ink); padding: 12px 18px; border-radius: 999px;
  text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 12px; }

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- surfaces ---------- */
/* A solid white card, lifted by the page's tinted three-layer shadow. */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow:
    0 1px 2px rgb(var(--shade) / .05),
    0 4px 12px rgb(var(--shade) / .05),
    0 12px 32px -4px rgb(var(--shade) / .06);
}
/* What floats: dialogs, the consent card, a selected thumb. */
.float {
  box-shadow:
    0 2px 4px rgb(var(--shade) / .06),
    0 8px 20px rgb(var(--shade) / .07),
    0 24px 48px -8px rgb(var(--shade) / .09);
}

/* A drawing standing in its own light: a blurred glow of the drawing in
   its family's colour sits behind it and lights up as the page opens.
   Markup: <div class="lit" style="--art:url(...)"><span class="glow"></span><img></div> */
.lit { position: relative; isolation: isolate; }
.lit > .glow {
  position: absolute; inset: 2%; z-index: -1; pointer-events: none;
  filter: blur(clamp(18px, 4vw, 38px));
  opacity: var(--glow-opacity);
  transform: scale(1.08);
  animation: light-up 1.4s ease-out both;
}
.lit > .glow::before {
  content: ''; position: absolute; inset: 0;
  background: var(--glow);
  -webkit-mask: var(--art) center / contain no-repeat;
  mask: var(--art) center / contain no-repeat;
}
@keyframes light-up { from { opacity: 0; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px;
  border-radius: 999px; border: 0;
  font-family: var(--font-ui); font-weight: 600; font-size: 1.0625rem; line-height: 1.2;
  letter-spacing: -0.01em; text-align: center;
  text-decoration: none; cursor: pointer;
  transition: transform .2s cubic-bezier(.3, .7, .4, 1), filter .2s ease, background-color .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; filter: none; }
/* The honey capsule: the one main action. */
.btn-primary {
  color: var(--ink);
  background: linear-gradient(180deg, var(--honey-lit), var(--honey-deep));
  box-shadow:
    0 2px 4px rgb(26 30 34 / .06),
    0 8px 20px rgb(var(--cta-shade) / .22),
    0 24px 48px -8px rgb(var(--cta-shade) / .10);
}
.btn-primary:hover { filter: brightness(1.03); }
/* Everyday actions: ink pills. */
.btn-ink { color: var(--on-ink); background: var(--ink); }
.btn-ink:hover { background: #2C3137; }
/* A capsule sunk into a card or the page. */
.btn-sunk { color: var(--ink); background: var(--sunk); }
.btn-sunk:hover { background: #E9E4DA; }
/* Text-only, for a quiet second action. */
.btn-quiet { color: var(--ink); background: transparent; }
.btn-quiet:hover { background: rgb(255 255 255 / .7); }
.btn-block { width: 100%; }
.btn-small { min-height: 44px; padding: 0 18px; font-size: .97rem; }
.btn-link {
  background: none; border: 0; padding: 10px 4px; min-height: 44px; cursor: pointer;
  font-weight: 600; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px;
}
.btn-link:hover { color: var(--ink); }
.btn-text {
  display: inline-flex; align-items: center; min-height: 52px; padding: 0 6px;
  font-weight: 600; color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px;
  text-underline-offset: 5px; text-decoration-color: var(--honey);
}
.btn-text:hover { text-decoration-color: var(--ink); }

/* The App Store: "Coming soon" until APP_STORE_URL is set in site.js. */
.store-soon {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  font-weight: 600; font-size: .97rem; color: var(--ink-soft);
}
.store-soon svg, .store-link svg { width: 18px; height: 18px; flex: none; }

/* ---------- header: a floating capsule of warm glass ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  padding: 12px var(--gutter) 0;
}
.site-header .nav {
  position: relative;
  max-width: calc(var(--max) - 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 8px 0 14px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 64px;
  background: rgb(255 255 255 / .72);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  backdrop-filter: saturate(180%) blur(22px);
  box-shadow:
    0 2px 4px rgb(43 38 32 / .05),
    0 8px 20px rgb(43 38 32 / .06),
    0 24px 48px -12px rgb(43 38 32 / .10);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header .nav, .mobile-menu { background: rgb(255 255 255 / .96); }
}
@media (prefers-contrast: more) {
  .site-header .nav, .mobile-menu { background: #fff; }
}
/* The scroll edge: once the page scrolls, content dissolves into the wash
   and a soft blur beneath the floating header instead of meeting a bar. */
.site-header::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  inset: 0 0 -28px;
  background: linear-gradient(180deg, rgb(247 244 238 / .85), rgb(247 244 238 / 0));
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  -webkit-mask-image: linear-gradient(180deg, #000 45%, transparent);
  mask-image: linear-gradient(180deg, #000 45%, transparent);
  opacity: 0; transition: opacity .25s ease;
}
.site-header.scrolled::before { opacity: 1; }

.logo {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  text-decoration: none; font-family: var(--font-brand); font-weight: 700; font-size: 1.35rem;
  letter-spacing: -0.02em; border-radius: 12px;
}
.logo-mark {
  width: 38px; height: 38px; border-radius: 11px; background: var(--honey);
  display: grid; place-items: center; flex: none;
}
.logo-mark img { width: 22px; }
.nav-links { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px;
  text-decoration: none; font-weight: 500; color: var(--ink);
}
.nav-links a:hover { background: rgb(241 237 229 / .9); }
.nav-actions { display: flex; align-items: center; gap: 6px; }
.nav-toggle {
  display: none; width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  align-items: center; justify-content: center; background: var(--sunk); color: var(--ink);
}
.nav-toggle svg { width: 22px; height: 22px; }
.mobile-menu { display: none; }

@media (max-width: 900px) {
  .nav-links, .nav-actions .btn-signin { display: none; }
  .nav-toggle { display: inline-flex; }
  .mobile-menu {
    display: block; position: absolute; left: var(--gutter); right: var(--gutter); top: 86px;
    border-radius: var(--radius);
    padding: 8px;
    background: rgb(255 255 255 / .9);
    -webkit-backdrop-filter: saturate(180%) blur(22px);
    backdrop-filter: saturate(180%) blur(22px);
    box-shadow:
      0 2px 4px rgb(43 38 32 / .06),
      0 8px 20px rgb(43 38 32 / .07),
      0 24px 48px -8px rgb(43 38 32 / .12);
  }
  .mobile-menu[hidden] { display: none; }
  .mobile-menu a {
    display: flex; align-items: center; min-height: 48px; padding: 0 14px; border-radius: 16px;
    font-weight: 600; text-decoration: none;
  }
  .mobile-menu a:hover { background: var(--sunk); }
}
@media (max-width: 420px) {
  .site-header .nav { padding: 0 6px 0 8px; gap: 8px; height: 60px; }
  .logo { font-size: 1.18rem; gap: 8px; }
  .logo-mark { width: 34px; height: 34px; border-radius: 10px; }
  .logo-mark img { width: 20px; }
  .nav-actions .btn-create { padding: 0 14px; font-size: .92rem; }
  .mobile-menu { top: 80px; }
}

/* ---------- hero ---------- */
.hero { padding: 48px 0 64px; }
.hero-grid {
  display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 48px;
}
.hero h1 { margin: 0 0 20px; }
.hero .lead { font-size: 1.2rem; color: var(--ink-soft); max-width: 33em; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin: 32px 0 14px; }
.hero-note { font-size: .97rem; color: var(--ink-soft); max-width: 32em; }
.hero-art { width: 100%; max-width: 480px; margin: 0 auto; }
.hero-art img { width: 100%; }

@media (max-width: 860px) {
  .hero { padding: 28px 0 48px; }
  .hero-grid { grid-template-columns: 1fr; gap: 20px; }
  .hero-art { max-width: 240px; order: -1; }
}
@media (max-width: 480px) {
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
  .hero-actions .store-soon { justify-content: center; }
}

/* ---------- sections ---------- */
.section { padding: 72px 0; }
section[id] { scroll-margin-top: 96px; }
.section-tight { padding: 40px 0; }
.section-head { max-width: 660px; margin-bottom: 40px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head p { margin-top: 14px; color: var(--ink-soft); font-size: 1.1rem; }
@media (max-width: 600px) {
  .section { padding: 56px 0; }
  .section-head { margin-bottom: 28px; }
}

/* ---------- a look inside: the app's own screens ---------- */
.shots {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px 32px;
}
.shot { display: flex; flex-direction: column; align-items: center; text-align: center; }
.phone {
  width: 100%; max-width: 270px;
  padding: 5px; border-radius: 40px; background: var(--surface);
  box-shadow:
    0 2px 4px rgb(43 38 32 / .06),
    0 10px 24px rgb(43 38 32 / .08),
    0 30px 60px -12px rgb(43 38 32 / .16);
}
.phone img { width: 100%; height: auto; border-radius: 35px; background: var(--paper); }
.shot h3 { margin-top: 22px; font-size: 1.08rem; }
.shot p { margin-top: 6px; color: var(--ink-soft); font-size: .97rem; max-width: 22em; }
@media (max-width: 760px) {
  .shots { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 14px; }
  .phone { padding: 4px; border-radius: 30px; }
  .phone img { border-radius: 26px; }
  .shot h3 { margin-top: 16px; font-size: 1rem; }
  .shot p { font-size: .9rem; }
}

/* ---------- how it works ---------- */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 32px; counter-reset: step; list-style: none; margin: 0; padding: 0; }
.step-art { width: 210px; max-width: 70%; margin: 0 0 22px; }
.step h3::before {
  counter-increment: step; content: counter(step);
  display: inline-grid; place-items: center; width: 30px; height: 30px; margin-right: 10px;
  border-radius: 50%; background: var(--sunk); font-size: .95rem; vertical-align: 2px;
}
.step p { margin-top: 10px; color: var(--ink-soft); }
.daily {
  margin-top: 44px; font-size: 1.1rem; color: var(--ink-soft); max-width: 46em;
}
.daily strong { color: var(--ink); font-weight: 600; }
@media (max-width: 860px) {
  .steps { grid-template-columns: 1fr; gap: 36px; }
  .step { display: grid; grid-template-columns: 116px 1fr; gap: 0 20px; align-items: start; }
  .step-art { width: 116px; max-width: none; margin: 0; grid-row: span 2; }
}

/* ---------- topics: covers grouped by family, as in the Programs tab ---------- */
.topic-groups {
  /* Sized so Calm, Sleep and Confidence share a row, then Focus and Health
     (1120px), and three covers fill a row on a phone. */
  --tile: min(118px, calc((100vw - 2 * var(--gutter) - 2 * 14px) / 3));
  display: flex; flex-wrap: wrap; gap: 36px;
}
.topic-group h3 { font-size: 1.08rem; margin-bottom: 14px; }
.covers { display: flex; flex-wrap: wrap; gap: 20px 14px; list-style: none; margin: 0; padding: 0; }
.cover { width: var(--tile); display: flex; flex-direction: column; gap: 10px; }
/* A print on its plate: a soft gradient, the drawing sitting a little low. */
.cover img {
  width: 100%; aspect-ratio: 1; object-fit: contain; padding: 15% 13% 9%;
  border-radius: 22px;
  background: var(--plate);
  background: linear-gradient(180deg, color-mix(in srgb, var(--plate) 65%, #fff), var(--plate));
  box-shadow:
    0 1px 2px rgb(var(--shade) / .05),
    0 4px 12px rgb(var(--shade) / .05),
    0 12px 32px -4px rgb(var(--shade) / .06);
}
.cover span { font-weight: 600; font-size: .95rem; line-height: 1.25; -webkit-hyphens: manual; hyphens: manual; }
.library-more { margin-top: 40px; color: var(--ink-soft); max-width: 46em; font-size: 1.05rem; }
.library-more strong { color: var(--ink); font-weight: 600; }
@media (max-width: 480px) { .cover span { font-size: .88rem; } }

/* ---------- also in the app: one card, rows by space ---------- */
.facts-card { padding: 34px 36px; }
.facts-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px 36px; margin: 0; }
.facts-grid div { margin: 0; }
.facts-grid dt { font-weight: 600; font-size: 1.06rem; }
.facts-grid dd { margin: 6px 0 0; color: var(--ink-soft); font-size: .98rem; }
@media (max-width: 860px) { .facts-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .facts-card { padding: 26px 22px; } .facts-grid { grid-template-columns: 1fr; gap: 22px; } }

/* ---------- privacy and account ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.panel { padding: 30px; display: grid; grid-template-columns: 120px 1fr; gap: 24px; align-items: center; }
.panel-art { width: 120px; }
.panel p { margin-top: 10px; color: var(--ink-soft); }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .panel { grid-template-columns: 1fr; padding: 26px 24px; gap: 14px; } .panel-art { width: 104px; } }

.care { margin-top: 28px; color: var(--ink-soft); font-size: .97rem; max-width: 52em; }
.care strong { color: var(--ink); font-weight: 600; }

/* ---------- faq: questions as white cards, separated by space ---------- */
.faq { display: grid; gap: 10px; max-width: 780px; }
.faq details {
  background: var(--surface); border-radius: 20px;
  box-shadow:
    0 1px 2px rgb(var(--shade) / .05),
    0 4px 12px rgb(var(--shade) / .04);
}
.faq summary {
  cursor: pointer; list-style: none; padding: 18px 56px 18px 22px; position: relative;
  min-height: 60px; display: flex; align-items: center;
  font-weight: 600; font-size: 1.06rem; border-radius: 20px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ''; position: absolute; right: 24px; top: 50%; width: 10px; height: 10px; margin-top: -7px;
  border-right: 2.2px solid var(--ink-soft); border-bottom: 2.2px solid var(--ink-soft); transform: rotate(45deg);
  transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq .answer { padding: 0 22px 22px; color: var(--ink-soft); max-width: 42em; }
.faq .answer p + p { margin-top: 10px; }
.faq .answer a { color: var(--ink); font-weight: 600; }

/* ---------- closing call to action ---------- */
.cta-band {
  padding: 34px 40px 34px 30px; display: grid; grid-template-columns: 150px 1fr auto; gap: 30px; align-items: center;
  border-radius: var(--radius-lg);
}
.cta-band .lit { width: 150px; }
.cta-band p { color: var(--ink-soft); margin-top: 8px; font-size: 1.08rem; }
@media (max-width: 760px) {
  .cta-band { grid-template-columns: 1fr; padding: 28px 24px 30px; gap: 16px; }
  .cta-band .lit { width: 120px; }
  .cta-band .btn { width: 100%; }
}

/* ---------- footer ---------- */
.site-footer { padding: 56px 0 40px; margin-top: 24px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
.footer-grid p { color: var(--ink-soft); margin-top: 12px; max-width: 30em; font-size: .97rem; }
.footer-grid .store-soon { margin-top: 6px; }
.footer-title { font-weight: 600; font-size: .95rem; color: var(--ink-soft); margin-bottom: 6px; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.footer-links a, .footer-links button {
  display: inline-flex; align-items: center; min-height: 44px;
  text-decoration: none; font-weight: 500; background: none; border: 0; padding: 0; cursor: pointer; text-align: left;
}
.footer-links a:hover, .footer-links button:hover { text-decoration: underline; text-underline-offset: 3px; }
.footer-bottom { margin-top: 36px; color: var(--muted); font-size: .9rem; }
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}

/* ---------- documents (privacy, terms, support) ---------- */
.doc { max-width: 760px; margin: 0 auto; padding: 40px 0 64px; }
.doc header { margin-bottom: 30px; }
.doc h1 { font-size: clamp(2.1rem, 4.6vw, 3rem); }
.doc .updated { margin-top: 12px; color: var(--ink-soft); font-weight: 500; }
.doc .updated a { color: var(--ink); }
.doc h2 {
  font-family: var(--font-ui); font-size: 1.4rem; letter-spacing: -0.015em; line-height: 1.25;
  margin: 44px 0 12px;
}
.doc h3 { font-size: 1.12rem; margin: 28px 0 8px; }
.doc p, .doc li { color: #33373D; }
.doc p + p { margin-top: 12px; }
.doc ul { padding-left: 1.2em; margin: 10px 0; }
.doc li + li { margin-top: 6px; }
.doc a { color: var(--ink); text-underline-offset: 3px; }
.doc .summary { padding: 24px 26px; margin: 8px 0 12px; }
.doc .summary h2 { margin-top: 0; font-size: 1.2rem; }
.doc .summary p + p { margin-top: 10px; }
.doc-art { width: 150px; margin: 0 0 14px -6px; }
/* Tables: a white card, rows told apart by a sunk fill, no lines. */
.table-card { margin: 12px 0 20px; padding: 6px; }
.doc table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .95rem; }
.doc th, .doc td { text-align: left; padding: 11px 14px; vertical-align: top; }
.doc th { font-weight: 600; color: var(--ink); }
.doc tbody tr:nth-child(odd) > *, .doc table.facts tr:nth-child(odd) > * { background: var(--sunk); }
.doc tr > :first-child { border-radius: 12px 0 0 12px; }
.doc tr > :last-child { border-radius: 0 12px 12px 0; }
.doc table.facts th { width: 128px; }
.doc table code, .doc code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: .88em;
  background: var(--sunk); padding: 1px 5px; border-radius: 6px;
}
.doc table td code { background: rgb(255 255 255 / .8); }
@media (max-width: 600px) {
  .doc table.facts th { width: 92px; }
  .doc th, .doc td { padding: 10px 10px; }
  /* Wide tables become one block per row: no sideways scrolling. */
  .doc table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .doc table.stack, .doc table.stack tbody, .doc table.stack tr, .doc table.stack td { display: block; width: 100%; }
  .doc table.stack tr { border-radius: 12px; padding: 6px 0; }
  .doc table.stack tr:nth-child(odd) { background: var(--sunk); }
  .doc table.stack tr > * { background: none !important; border-radius: 0 !important; padding: 4px 12px; }
  .doc table.stack td::before {
    content: attr(data-label); display: block; font-weight: 600; color: var(--ink); font-size: .85rem;
  }
}

/* ---------- account ---------- */
.auth-wrap { max-width: 460px; margin: 0 auto; padding: 20px 0 64px; }
.auth-art { width: 160px; margin: 0 auto 8px; }
.auth-art img { width: 100%; }
.auth-card { padding: 28px 26px 30px; }
.auth-card h1 { font-size: 2rem; text-align: center; }
.auth-sub { text-align: center; color: var(--ink-soft); margin: 8px 0 22px; }
/* iOS segmented control: a sunk track with a white thumb. */
.segmented {
  display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 999px;
  margin-bottom: 22px; background: var(--sunk);
}
.segmented button {
  border: 0; background: transparent; border-radius: 999px; min-height: 44px;
  font-weight: 600; color: var(--ink-soft); cursor: pointer;
  transition: background-color .18s ease, box-shadow .18s ease, color .18s ease;
}
.segmented button[aria-selected="true"] {
  background: var(--surface); color: var(--ink);
  box-shadow: 0 1px 2px rgb(43 38 32 / .08), 0 4px 10px rgb(43 38 32 / .08);
}
.social { display: grid; gap: 10px; }
.social-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 52px; border-radius: 999px; cursor: pointer; border: 0;
  font-weight: 600; font-size: 1.0625rem; background: var(--sunk); color: var(--ink);
  transition: transform .2s ease, background-color .2s ease;
}
.social-btn:hover { background: #E9E4DA; }
.social-btn:active { transform: scale(.97); }
/* Sign in with Apple: Apple's black style. */
.social-btn.apple { background: #000; color: #fff; }
.social-btn.apple:hover { background: #1d1d1f; }
.social-btn svg { width: 20px; height: 20px; flex: none; }
.or { margin: 22px 0; text-align: center; color: var(--ink-soft); font-weight: 500; font-size: .92rem; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: .95rem; }
.input-wrap { position: relative; }
/* Fields sink into the card. The website keeps a hairline around fields
   (DESIGN.md), dark enough (3:1) to show where to type. */
.input {
  width: 100%; min-height: 52px; padding: 12px 16px; border-radius: var(--radius-sm);
  border: 0; background: var(--sunk);
  box-shadow: inset 0 0 0 1px rgb(26 30 34 / .42);
  font-size: 1.0625rem; font-weight: 400;
  transition: box-shadow .15s ease, background-color .15s ease;
}
.input:hover { box-shadow: inset 0 0 0 1px rgb(26 30 34 / .6); }
.input:focus { outline: none; background: #fff; box-shadow: inset 0 0 0 2px var(--ink); }
.input[aria-invalid="true"] { box-shadow: inset 0 0 0 2px var(--danger); }
.input-wrap .input { padding-right: 80px; }
.reveal {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; font-weight: 600; font-size: .92rem; color: var(--ink-soft);
  min-height: 44px; padding: 0 14px; border-radius: 999px; cursor: pointer;
}
.reveal:hover { background: rgb(255 255 255 / .8); color: var(--ink); }
.hint { font-size: .88rem; color: var(--ink-soft); font-weight: 400; }
.field-error { color: var(--danger); font-weight: 600; font-size: .9rem; margin: 0; }
#consent-error { margin: -10px 0 16px; }
.check { display: flex; gap: 12px; align-items: flex-start; margin: 4px 0 18px; font-size: .95rem; color: var(--ink-soft); }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--ink); flex: none; }
.check a { color: var(--ink); font-weight: 600; }
.form-foot { text-align: center; margin-top: 10px; }
/* Messages: a tinted fill. */
.alert {
  border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 16px;
  font-weight: 500; font-size: .95rem;
}
.alert.error { background: #FBE3DD; color: #7A1F17; }
.alert.success { background: #DDEDD8; color: #1F4D23; }
.alert.info { background: #D9EDF8; color: #174A63; }
.alert[hidden] { display: none; }
.legal-line { text-align: center; font-size: .88rem; color: var(--ink-soft); margin-top: 18px; }
.legal-line a { color: var(--ink); font-weight: 600; }
.spinner {
  width: 30px; height: 30px; border-radius: 50%; margin: 36px auto;
  border: 3px solid rgb(26 30 34 / .1); border-top-color: var(--ink); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.profile { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.avatar {
  width: 64px; height: 64px; border-radius: 50%; flex: none;
  background: linear-gradient(180deg, #F8EED3, #F3E3B8);
  display: grid; place-items: center; font-weight: 600; font-size: 1.6rem;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile h1 { font-size: 1.6rem; text-align: left; }
.profile p { color: var(--ink-soft); font-weight: 400; word-break: break-word; }
.badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -6px 0 20px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: var(--sunk); font-weight: 600; font-size: .85rem; color: var(--ink-soft);
}
.badge.ok { background: #DDEDD8; color: #1F4D23; }
.badge.warn { background: #F5E8C8; color: #5E470F; }
.badges .btn-link { font-size: .88rem; }
/* Inside the card, a surface sinks and drops its shadow. */
.info-card { border-radius: 18px; padding: 18px 20px; margin-bottom: 12px; background: var(--sunk); }
.info-card h2 { font-family: var(--font-ui); font-size: 1.08rem; letter-spacing: -0.01em; margin-bottom: 6px; }
.info-card p, .info-card li { color: var(--ink-soft); font-size: .96rem; }
.info-card a { color: var(--ink); font-weight: 600; }
.info-card ol { margin: 8px 0 0; padding-left: 1.2em; }
.account-actions { display: grid; gap: 10px; margin-top: 18px; }
.danger-zone { margin-top: 18px; text-align: center; }
.btn-danger-link { color: var(--danger); }
.btn-danger-link:hover { color: #7A1F17; }

/* Dialogs: white, over a light veil, with capsule buttons. */
dialog {
  border: 0; border-radius: var(--radius-lg); padding: 26px 24px; max-width: 420px; width: calc(100% - 32px);
  color: var(--ink); background: var(--surface);
  box-shadow: 0 24px 60px -18px rgb(26 30 34 / .35);
}
dialog::backdrop { background: rgb(26 30 34 / .2); }
dialog h2 { font-family: var(--font-ui); font-size: 1.35rem; letter-spacing: -0.015em; margin-bottom: 10px; }
dialog p { color: var(--ink-soft); }
dialog .dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
dialog .btn { padding: 0 16px; }
dialog .btn-danger { color: #fff; background: var(--danger); }
dialog .btn-danger:hover { background: #9C2019; }

/* ---------- 404 ---------- */
.lost { text-align: center; padding-top: 40px; padding-bottom: 80px; }
.lost .lit { width: 220px; margin: 0 auto 18px; }
.lost p { color: var(--ink-soft); margin: 12px auto 26px; max-width: 26em; }

/* ---------- analytics consent: a small white card at the bottom ---------- */
.consent {
  position: fixed; z-index: 60; left: 0; right: 0;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  padding: 0 12px; pointer-events: none;
}
.consent-card {
  pointer-events: auto;
  max-width: 560px; margin: 0 auto; padding: 20px 20px 18px;
  background: var(--surface); border-radius: var(--radius);
  box-shadow:
    0 2px 4px rgb(43 38 32 / .06),
    0 8px 20px rgb(43 38 32 / .08),
    0 24px 48px -8px rgb(43 38 32 / .14);
  animation: rise .45s cubic-bezier(.3, .7, .4, 1) both;
}
@keyframes rise { from { transform: translateY(16px); opacity: 0; } }
.consent-title { font-family: var(--font-ui); font-size: 1.06rem; letter-spacing: -0.01em; line-height: 1.3; }
.consent-card p { margin-top: 6px; color: var(--ink-soft); font-size: .94rem; line-height: 1.45; }
.consent-card a { color: var(--ink); font-weight: 600; }
.consent-card .consent-status { color: var(--ink); font-weight: 500; }
.consent-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.consent-actions .btn { min-height: 48px; padding: 0 16px; }
