@font-face { font-family: "Atkinson Hyperlegible Next"; src: url("/fonts/ahn-400.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible Next"; src: url("/fonts/ahn-700.ttf") format("truetype"); font-weight: 700 800; font-display: swap; }
:root {
  --bg: #f7f5f0; --card: #ffffff; --ink: #1d2428; --muted: #4a5257;
  --accent: #1f4e79; --accent-ink: #ffffff; --good: #1f4e79; --warn: #8a4500;
  --line: #e4dfd4; --soft: #dce8f3; --focus: #f2b84b; --banner-ink: #ffffff; color-scheme: light;
}
/* Dark follows the phone unless the sun/moon switch picked a theme (data-theme on <html>). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121619; --card: #1c2227; --ink: #eef1f3; --muted: #b3bcc2;
    --accent: #8cb8e6; --accent-ink: #0d1e2e; --good: #8cb8e6; --warn: #ffb866;
    --line: #2f383f; --soft: #1e3246; --banner-ink: #0b0b0b; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121619; --card: #1c2227; --ink: #eef1f3; --muted: #b3bcc2;
    --accent: #8cb8e6; --accent-ink: #0d1e2e; --good: #8cb8e6; --warn: #ffb866;
    --line: #2f383f; --soft: #1e3246; --banner-ink: #0b0b0b; color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 1.125rem/1.45 "Atkinson Hyperlegible Next", "Noto Sans Devanagari", "Kohinoor Devanagari", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}
main { max-width: 520px; margin: 0 auto; }
.topbar { display: flex; justify-content: flex-end; margin-bottom: 8px; }
/* Shared header: logo + name on the left, language and light/dark switch on the right. */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 16px; }
.site-header .home { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1.2rem; min-height: 44px; }
.site-header .actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { flex: 0 0 44px; width: 44px; height: 44px; min-height: 44px; margin: 0; border-radius: 22px; border: 1px solid var(--line); background: var(--card); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.icon-btn svg { width: 22px; height: 22px; }
/* Shared footer: the stacked logo, then links. */
.site-footer { text-align: center; color: var(--muted); font-size: 1rem; margin-top: 24px; padding-top: 20px; border-top: 2px solid var(--line); }
.site-footer nav { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; }
.site-footer nav a { min-height: 44px; display: inline-flex; align-items: center; font-weight: 700; }
.lang {
  font: inherit; font-size: 1rem; background: transparent; color: var(--accent);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; min-height: 44px; margin: 0; width: auto; cursor: pointer;
}
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; border-width: 2px; padding: 20px; margin-bottom: 16px; }
.banner { background: var(--warn); color: var(--banner-ink); border-radius: 12px; padding: 12px 16px; font-weight: 700; margin-bottom: 16px; }
h1 { font-size: 1.75rem; line-height: 1.2; margin: 0 0 8px; }
h2 { font-size: 1.125rem; margin: 0 0 8px; }
p { margin: 0 0 12px; }
.lead { font-size: 1.25rem; }
ul, ol { margin: 0; padding-left: 24px; }
li { margin-bottom: 6px; }
.photo { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; float: right; margin-left: 12px; }
.guide { background: var(--soft); }
.consent-list { margin-bottom: 8px; font-size: 1rem; }
button, .btn {
  display: block; width: 100%; min-height: 60px; border: 0; border-radius: 14px;
  font: inherit; font-weight: 700; font-size: 1.25rem; text-align: center; text-decoration: none;
  padding: 16px; margin: 0 0 12px; cursor: pointer;
}
.primary { background: var(--accent); color: var(--accent-ink); }
.secondary { background: var(--soft); color: var(--ink); border: 1px solid var(--line); }
.danger { background: transparent; color: var(--warn); border: 2px solid var(--warn); }
button[disabled] { opacity: .6; cursor: default; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
label { display: block; font-weight: 600; margin: 12px 0 6px; font-size: 1rem; }
input, textarea {
  width: 100%; font: inherit; font-size: 1.0625rem; padding: 12px; border-radius: 10px;
  border: 1px solid var(--muted); background: var(--bg); color: var(--ink);
}
textarea { min-height: 80px; resize: vertical; }
.muted { color: var(--muted); font-size: 0.9375rem; }
.status { font-weight: 700; }
.status:empty { display: none; }
.status.ok { color: var(--good); }
.status.err { color: var(--warn); }
.hidden { display: none !important; }
footer { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: no-preference) { button { transition: opacity .15s; } }

a { color: var(--accent); }
/* Stacked logo: mark, name, tagline in small capitals. */
.brand { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; margin: 0 0 16px; }
.brand .name { font-weight: 800; font-size: 1.5rem; color: var(--ink, inherit); line-height: 1.15; }
.brand .tagline { font-weight: 700; font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
footer .brand { margin-top: 8px; }
details.more { margin: 0 0 16px; }
details.more summary { min-height: 44px; display: flex; align-items: center; color: var(--accent); font-weight: 700; cursor: pointer; }
.guide ul + ul:not(:empty) { margin-top: 6px; }
#consent .primary { margin-top: 20px; }

/* Privacy policy */
.glance { background: var(--soft); border-color: transparent; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.checks li { padding-left: 32px; position: relative; }
.checks li::before { content: ""; position: absolute; left: 4px; top: .35em; width: 14px; height: 8px; border-left: 3px solid var(--accent); border-bottom: 3px solid var(--accent); transform: rotate(-45deg); }
.toc ol { margin: 0; padding-left: 1.4em; display: grid; gap: 2px; }
.toc a { display: inline-flex; align-items: center; min-height: 44px; }
section.card h2 { margin-top: 0; }
section.card[id] { scroll-margin-top: 16px; }

/* ===== New look (Dec 2026): blue header band, floating cards, chips and numbered steps ===== */
:root { --band-a: #1f4e79; --band-b: #2a659a; --shadow: 0 1px 2px rgba(29,36,40,.06), 0 8px 24px rgba(29,36,40,.07); --amber: #f2b84b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --band-a: #133250; --band-b: #1f4e79; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35); } }
:root[data-theme="dark"] { --band-a: #133250; --band-b: #1f4e79; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35); }

body { padding-top: 0; }
.band {
  background: linear-gradient(160deg, var(--band-a) 0%, var(--band-b) 100%); color: #fff;
  margin: 0 -16px; padding: max(14px, env(safe-area-inset-top)) 20px 64px; border-radius: 0 0 32px 32px;
}
@media (min-width: 560px) { .band { margin: 0; border-radius: 0 0 32px 32px; } }
.band { margin-bottom: -40px; }
.band ~ * { position: relative; }
.band a, .band .home { color: #fff; }
.band .site-header { margin-bottom: 20px; }
.band .icon-btn, .band .lang { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.28); color: #fff; }
.band .lang option { color: #1d2428; background: #fff; }
.band :focus-visible { outline-color: var(--amber); }
.hero-intro h1 { font-size: 2rem; line-height: 1.15; margin: 0 0 10px; }
.hero-intro .lead { font-size: 1.2rem; margin: 0; }
.hero-intro .small { font-size: .95rem; margin: 12px 0 0; opacity: .9; }
.hero-name { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.hero-name h1 { margin: 0; }
.initial:empty { display: none; }
.initial, .band .photo {
  flex: 0 0 64px; width: 64px; height: 64px; border-radius: 50%; float: none; margin: 0;
  box-shadow: 0 0 0 4px rgba(255,255,255,.35);
}
.initial { background: #ffe2bf; color: #8a4500; display: flex; align-items: center; justify-content: center; font-size: 1.75rem; font-weight: 800; }

.card { border: 0; border-radius: 24px; box-shadow: var(--shadow); padding: 22px; }
.card h2 { font-size: 1.3rem; line-height: 1.25; margin-bottom: 10px; }
.card.note { background: var(--soft); box-shadow: none; font-size: 1rem; }
.card.note p { margin: 0; }
.banner {
  background: var(--amber); color: #1d2428; border-radius: 18px; padding: 14px 16px 14px 48px; font-size: 1.05rem; font-weight: 800;
  box-shadow: var(--shadow); position: relative;
}
.banner::before { content: "!"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border-radius: 12px; background: #1d2428; color: var(--amber); font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: .95rem; }
button, .btn { border-radius: 18px; min-height: 58px; }
.secondary { border: 0; }
.danger { border-width: 2px; }
input, textarea { border-radius: 14px; border: 2px solid var(--line); background: var(--bg); }
input:focus, textarea:focus { border-color: var(--accent); }

/* Numbered steps (calming tips, how it works) */
ol.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; display: grid; gap: 14px; }
ol.steps > li { counter-increment: step; position: relative; padding-left: 46px; margin: 0; min-height: 32px; }
ol.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: -2px; width: 32px; height: 32px; border-radius: 16px;
  background: var(--soft); color: var(--accent); font-weight: 800; font-size: 1rem; display: flex; align-items: center; justify-content: center;
}
ol.steps > li.hidden + li { counter-increment: step; }
#comfort { counter-increment: none; }
#comfort::before { content: "♥"; }
ul.dots { margin-top: 14px; padding-left: 0; list-style: none; display: grid; gap: 8px; }
ul.dots li { position: relative; padding-left: 46px; margin: 0; }
ul.dots li::before { content: ""; position: absolute; left: 12px; top: .55em; width: 8px; height: 8px; border-radius: 4px; background: var(--accent); }
ul.checks li { margin: 0; }

.site-footer { border-top: 0; margin-top: 32px; }
.glance { box-shadow: none; }

/* ===== Simpler finder page (Dec 2026): actions first ===== */
.chip-911 {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 22px;
  background: #b3261e; color: #fff !important; font-weight: 800; font-size: 1.05rem; text-decoration: none; white-space: nowrap;
}
.band .site-header { flex-wrap: nowrap; }
.band .site-header .home { min-width: 0; }
@media (max-width: 380px) { .band .site-header .home .label { display: none; } }
#c1 { font-size: 1rem; color: var(--muted); margin-bottom: 14px; }
#consent .primary { margin-top: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row2 .btn { margin: 0 0 12px; font-size: 1.1rem; padding: 16px 8px; }
.row2 .btn.hidden + .btn.hidden { display: none; }
#consent-info details.more { margin: 0; }
.note-form { border-top: 2px solid var(--line); margin-top: 8px; padding-top: 14px; }
.note-form h3 { font-size: 1.1rem; margin: 0 0 4px; }
.note-form button { margin-top: 14px; }
.ghost { background: transparent; color: var(--accent); min-height: 48px; margin: 4px 0 0; padding: 8px; font-size: 1.05rem; }

/* Ko-fi button and footer links (Dec 2026) */
.btn.kofi { display: flex; align-items: center; justify-content: center; gap: 10px; }
.site-footer nav { gap: 4px 18px; }

/* Home page (Dec 2026) */
.home-hero { text-align: center; }
.home-hero .home-mark { width: 72px; height: 72px; display: block; margin: 0 auto 10px; }
.home-hero h1 { margin-bottom: 2px; }
.home-tagline { color: var(--amber); font-weight: 800; text-transform: uppercase; letter-spacing: .05em; font-size: .95rem; margin: 0 0 12px; }
.card.found { border: 3px solid var(--amber); }
.card.found .btn { margin-top: 16px; }
.checks + p { margin-top: 14px; }
.step-pic { display: block; width: 100%; max-width: 420px; height: auto; border-radius: 20px; margin: 12px 0 6px; }
.video-card video { display: block; width: 100%; height: auto; border-radius: 16px; background: #1f4e79; margin: 4px 0 10px; }
/* Inspired by Krishav (Dec 2026) */
.brand .byline { font-style: italic; color: var(--muted); font-size: .95rem; }
.site-footer .dedication { margin: 0 0 10px; color: var(--muted); }
.dedication .heart { color: var(--warn); }
.home-by { font-style: italic; opacity: .9; margin: -6px 0 12px; }
.dedication-card { background: var(--soft); box-shadow: none; }

/* ===== Warm and illustrated (Dec 2026) ===== */
.scene { display: block; width: calc(100% + 40px); max-width: none; margin: 4px -20px -1px; height: auto; }
.scene .sun { fill: var(--amber); opacity: .9; }
.scene .hill { fill: rgba(255,255,255,.12); }
.scene .ground { fill: var(--bg); }
.scene .house { fill: #fff; }
.scene .roof { fill: none; stroke: var(--amber); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.scene .door { fill: var(--amber); }
.scene .win { fill: #dce8f3; }
.scene .path { fill: none; stroke: var(--amber); stroke-width: 3; stroke-dasharray: 2 8; stroke-linecap: round; }
.scene .skin { fill: #ffe2bf; }
.scene .adult { fill: #9ec3e6; }
.scene .child { fill: var(--amber); }
.scene .hand { fill: none; stroke: #ffe2bf; stroke-width: 4; stroke-linecap: round; }
.band.has-scene { padding-bottom: 0; margin-bottom: 0; border-radius: 0; overflow: hidden; }
.band.has-scene + * { margin-top: 16px; }
.home-hero { text-align: left; }
.home-hero h1 { font-size: 2.1rem; }
/* Calmer cards: lighter shadow; amber only for urgent things */
:root { --shadow: 0 1px 2px rgba(29,36,40,.05), 0 4px 16px rgba(29,36,40,.05); --warm: #fff6e6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --warm: #2a2115; } }
:root[data-theme="dark"] { --warm: #2a2115; }
.card.found { border: 0; background: var(--warm); }
.btn.solid-danger { background: #b3261e; color: #fff; border: 0; }
.row2b { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row2b .btn { margin: 0; font-size: 1.05rem; padding: 14px 8px; display: flex; align-items: center; justify-content: center; }
.brand .tagline { color: var(--accent); }
.testing-note { margin-top: 12px; }

/* Family replies on the finder page (Dec 2026) */
:root { --calm-bg: #e2f2e6; --calm-ink: #14502a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --calm-bg: #17331f; --calm-ink: #bfe8cc; } }
:root[data-theme="dark"] { --calm-bg: #17331f; --calm-ink: #bfe8cc; }
.family-banner { display: flex; gap: 12px; align-items: flex-start; background: var(--calm-bg); color: var(--calm-ink); border-radius: 18px; padding: 14px 16px; margin-bottom: 16px; position: relative; }
.family-banner.hidden { display: none; }
.family-banner svg { flex: none; margin-top: 1px; }
.family-banner strong { display: block; font-size: 1.15rem; }
.family-banner.on-way strong { font-size: 1.3rem; }

/* In the iPhone app: no donation links (see theme.js). */
.in-app-ios a[href="/support.html"], .in-app-ios a[href="/donate"], .in-app-ios a[href*="ko-fi.com"], .in-app-ios .donate-only { display: none !important; }

/* Inside the iPhone app the app's own blue header already shows the page name, a Back button and the
   theme follows the phone: drop the site's logo row (keep the language picker on the finder page). */
.in-app-ios .site-header:not(:has(.lang)) { display: none; }
.in-app-ios .site-header .home, .in-app-ios .site-header #theme { display: none; }
.in-app-ios .site-header:has(.lang) { justify-content: flex-end; margin-bottom: 12px; }
.in-app-ios .band { padding-top: 18px; }
/* …and on our own pages (not the finder preview) the intro sits on the page instead of a second blue band. */
.in-app-ios .band:not(:has(.lang)) { background: none; color: var(--ink); margin: 0; padding: 20px 4px 4px; border-radius: 0; }
.in-app-ios .band:not(:has(.lang)) a { color: var(--accent, inherit); }
.in-app-ios .band:not(:has(.lang)) + * { margin-top: 12px; }
.lock-pic { display: block; width: 100%; max-width: 280px; margin: 0 auto; border-radius: 22px; border: 2px solid var(--line); }

/* Suggest a feature */
select { width: 100%; font: inherit; font-size: 1.0625rem; padding: 12px; min-height: 52px; border-radius: 14px; border: 2px solid var(--line); background: var(--bg); color: var(--ink); }
select:focus { border-color: var(--accent); }
fieldset.choice { border: 0; margin: 0; padding: 0; }
fieldset.choice legend { font-weight: 600; font-size: 1rem; margin-bottom: 8px; padding: 0; }
label.pill { display: flex; align-items: center; gap: 12px; margin: 0 0 8px; padding: 12px 14px; min-height: 52px; border: 2px solid var(--line); border-radius: 14px; background: var(--bg); font-weight: 600; cursor: pointer; }
label.pill input { width: 22px; height: 22px; margin: 0; flex: 0 0 22px; accent-color: var(--accent); }
label.pill:has(input:checked) { border-color: var(--accent); background: var(--soft); }
.counter { text-align: right; margin: 4px 0 0; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
#suggest .primary { margin-top: 16px; }

/* About story (Dec 2026) */
.quote { font-size: 1.3rem; font-weight: 700; line-height: 1.35; padding-left: 16px; border-left: 4px solid var(--amber); }
ul.facts { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
ul.facts li { margin: 0; padding-left: 14px; border-left: 4px solid var(--accent); }
.card.sources { box-shadow: none; background: transparent; padding: 8px 4px; font-size: .95rem; color: var(--muted); }
.card.sources h2 { font-size: 1rem; }
.card.sources ol { padding-left: 20px; display: grid; gap: 6px; }
sup a { display: inline-block; min-width: 24px; min-height: 24px; line-height: 24px; text-align: center; text-decoration: none; font-weight: 700; }

/* Polish batch (Dec 2026) */
.hero-name h1, .card h1, .card h2 { min-width: 0; overflow-wrap: anywhere; }
.btn, a { overflow-wrap: anywhere; }
.site-footer nav { max-width: 300px; margin: 0 auto; }
.site-footer .dedication { text-wrap: balance; }

/* Scenes on About and How it works (Dec 2026) */
.scene .parent { fill: #cfe0f0; }
.scene .heart-s { fill: var(--amber); }
.scene .pin { fill: var(--amber); }
.scene .phone { fill: #1d2428; stroke: #fff; stroke-width: 2; }
.scene .wave { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; opacity: .8; }
.scene .tagbox { fill: #fff; stroke: #1d2428; stroke-width: 1.5; }
/* In the app, pages with a scene keep their blue band so the drawing shows, flowing on from the app's own header. */
.in-app-ios .band.has-scene:not(:has(.lang)) { background: linear-gradient(160deg, var(--band-a) 0%, var(--band-b) 100%); color: #fff; margin: 0 -16px; padding: 12px 20px 0; }
.in-app-ios .band.has-scene:not(:has(.lang)) a { color: #fff; }
