/* Home page. Same palette as the app (src/ui/theme.js) and the legal pages (styles.css). */
:root {
  --bg: #0f1216;
  --surface: #181c22;
  --surface-2: #1f242c;
  --border: #2c333d;
  --text: #eceef1;
  --muted: #a3acb8;
  --accent: #6fd3b8;
  --on-accent: #0f1216;
  --radius: 18px;
  --max: 1120px;
  --warn: #f2b56b;
  --bad: #e46a6a;
  --header-bg: rgba(15, 18, 22, 0.86);
  --bar-bg: rgba(24, 28, 34, 0.94);
  --shadow: var(--shadow);
  --frame: #0b0d10;
  color-scheme: dark;
}

/* Light theme, chosen with the sun/moon button in the header (theme.js). */
:root[data-theme="light"] {
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-2: #eef2f4;
  --border: #dbe1e6;
  --text: #12171c;
  --muted: #55606c;
  --accent: #0e8366;
  --on-accent: #ffffff;
  --warn: #a35f0c;
  --bad: #c03b3b;
  --header-bg: rgba(245, 247, 248, 0.88);
  --bar-bg: rgba(255, 255, 255, 0.95);
  --shadow: rgba(18, 28, 38, 0.14);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; line-height: 1.15; }
p { margin: 0; }

/* Top bar */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 20px;
  background: var(--header-bg);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 650; font-size: 19px; }
.brand img { border-radius: 9px; }
.top-links { display: flex; gap: 24px; font-size: 15px; }
.top-links a { color: var(--muted); text-decoration: none; }
.top-links a:hover { color: var(--text); }

main { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
section { padding: 72px 0; }

.eyebrow { color: var(--accent); font-size: 14px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 12px; }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(30px, 4vw, 42px); }
.section-head .sub { color: var(--muted); margin-top: 14px; }

/* Hero */
.hero { display: grid; grid-template-columns: 1.15fr 0.85fr; align-items: center; gap: 48px; padding-top: 48px; }
.hero h1 { font-size: clamp(44px, 7vw, 76px); letter-spacing: -0.035em; }
.lede { color: var(--muted); font-size: 19px; margin-top: 22px; max-width: 540px; }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; margin-top: 32px; }
.store {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 22px;
  border-radius: 14px;
  text-align: center;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 650;
  text-decoration: none;
}
.text-link { text-decoration: none; font-weight: 550; }
.pills { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 28px 0 0; }
.pills li { font-size: 14px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; }
.hero-phone { display: flex; justify-content: center; }

.phone {
  width: 300px;
  height: auto;
  border-radius: 40px;
  border: 1px solid var(--border);
  box-shadow: 0 30px 80px var(--shadow), 0 0 0 10px var(--frame);
}
.phone.small { width: 260px; border-radius: 36px; }

/* Promises */
.promises { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.promises article { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; }
.promises h2 { font-size: 21px; margin-bottom: 10px; }
.promises p { color: var(--muted); }

/* Features */
.feature-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 56px; margin-bottom: 64px; }
.feature-row.reverse { grid-template-columns: auto 1fr; }
.feature-row.reverse .feature-copy { order: 2; }
.feature-copy h3 { font-size: 28px; margin-bottom: 18px; }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.ticks li { position: relative; padding-left: 30px; color: var(--muted); }
.ticks li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 16px;
  height: 9px;
  border-left: 2.5px solid var(--accent);
  border-bottom: 2.5px solid var(--accent);
  transform: rotate(-45deg);
}
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.tile h3 { font-size: 17px; margin-bottom: 6px; }
.tile p { color: var(--muted); font-size: 15px; }

/* Security */
.spec { display: grid; grid-template-columns: 1fr auto; gap: 56px; align-items: center; }
.spec dl { margin: 0; display: grid; gap: 0; border-top: 1px solid var(--border); }
.spec dl > div { display: grid; grid-template-columns: 200px 1fr; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.spec dt { font-weight: 600; }
.spec dd { margin: 0; color: var(--muted); }

/* Pricing */
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 340px)); gap: 16px; }
.plan { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.plan.featured { border-color: var(--accent); }
.plan h3 { font-size: 18px; color: var(--muted); font-weight: 600; }
.price { font-size: 40px; font-weight: 700; letter-spacing: -0.02em; margin: 8px 0 12px; }
.price span { font-size: 17px; font-weight: 500; color: var(--muted); }
.plan p:last-child { color: var(--muted); font-size: 15px; }
.fine { color: var(--muted); font-size: 14px; margin-top: 18px; }

/* Android waitlist */
#android { scroll-margin-top: 72px; }
.notify { display: flex; flex-wrap: wrap; gap: 12px; max-width: 560px; }
.notify input[type="email"] {
  flex: 1 1 260px;
  min-height: 52px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.notify input[type="email"]::placeholder { color: var(--muted); opacity: 0.7; }
.notify input[type="email"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-color: transparent; }
.notify button { border: 0; cursor: pointer; font: inherit; font-weight: 650; }
.notify button:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.notify .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* FAQ */
.faq details { border-bottom: 1px solid var(--border); padding: 18px 0; max-width: 760px; }
.faq details:first-of-type { border-top: 1px solid var(--border); }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--accent); font-size: 22px; line-height: 1; }
.faq details[open] summary::after { content: '–'; }
.faq details p { color: var(--muted); margin-top: 10px; }

/* Footer */
.foot { max-width: var(--max); margin: 0 auto; padding: 40px 20px 56px; border-top: 1px solid var(--border); display: grid; gap: 16px; }
.foot-brand { display: flex; align-items: center; gap: 10px; font-weight: 650; }
.foot-brand img { border-radius: 7px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 20px; font-size: 15px; }
.foot p { color: var(--muted); font-size: 13px; }

a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* Tablet */
@media (max-width: 900px) {
  .hero, .feature-row, .feature-row.reverse, .spec { grid-template-columns: 1fr; gap: 36px; }
  .feature-row.reverse .feature-copy { order: 0; }
  .feature-row img, .spec img { justify-self: center; }
  .promises, .grid { grid-template-columns: 1fr 1fr; }
}

/* Phone */
@media (max-width: 600px) {
  body { font-size: 16px; }
  section { padding: 52px 0; }
  .top-links a:not(:last-child) { display: none; }
  .hero { padding-top: 24px; }
  .lede { font-size: 17px; }
  .promises, .grid, .plans { grid-template-columns: 1fr; }
  .spec dl > div { grid-template-columns: 1fr; gap: 4px; }
  .phone { width: 250px; border-radius: 34px; }
  .phone.small { width: 230px; border-radius: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ── Added for the fuller site: trust strip, steps, security card, scenario,
      compare callout, article pages (features and comparisons). ── */

.trust {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: center;
  margin-bottom: 22px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.trust b { color: var(--text); font-weight: 600; }
/* Separators sit after each item, so a wrapped line never starts with one. */
.trust span:not(:last-child)::after { content: '·'; margin-left: 14px; color: var(--border); }

.explainer { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.explainer .box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; }
.explainer .box h3 { font-size: 19px; margin-bottom: 10px; }
.explainer .box p { color: var(--muted); }
.explainer .box.bad h3::before { content: '✕  '; color: var(--bad); }
.explainer .box.good { border-color: var(--accent); }
.explainer .box.good h3::before { content: '✓  '; color: var(--accent); }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.card-link {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s;
}
.card-link:hover { border-color: var(--accent); }
.card-link h3 { font-size: 18px; }
.card-link p { color: var(--muted); font-size: 15px; flex: 1; }
.card-link span { color: var(--accent); font-size: 14px; font-weight: 600; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: step; }
.steps li { counter-increment: step; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; }
.steps li::before { content: '0' counter(step); display: block; color: var(--accent); font-weight: 700; font-size: 15px; letter-spacing: 0.08em; margin-bottom: 14px; }
.steps h3 { font-size: 19px; margin-bottom: 8px; }
.steps p { color: var(--muted); font-size: 15px; }

.code {
  margin: 0;
  background: #0b0d10;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  overflow-x: auto;
  font: 14px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #c9d1d9;
}
.code .k { color: var(--accent); }
.code .c { color: #6b7684; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.split .ticks { margin-top: 4px; }

.scenario { background: var(--surface); border: 1px solid var(--border); border-radius: 28px; padding: 48px; }
.scenario h2 { font-size: clamp(30px, 4vw, 44px); margin-bottom: 14px; }
.scenario > p { color: var(--muted); max-width: 640px; }
.scenario .ticks { margin-top: 28px; grid-template-columns: 1fr 1fr; gap: 16px 40px; }
.scenario .ticks strong { display: block; color: var(--text); }

.limits { border-left: 3px solid var(--accent); padding-left: 22px; }
.limits li { color: var(--muted); }

/* Article pages */
.crumbs { font-size: 14px; color: var(--muted); padding-top: 28px; }
.crumbs a { color: var(--muted); }
.article { max-width: 760px; padding-top: 24px; }
.article h1 { font-size: clamp(36px, 5vw, 54px); margin: 6px 0 18px; }
.article .lede { max-width: none; }
.article h2 { font-size: 26px; margin: 48px 0 12px; }
.article h3 { font-size: 19px; margin: 28px 0 8px; }
.article p, .article li { color: var(--muted); }
.article p + p { margin-top: 14px; }
.article ul, .article ol { padding-left: 22px; display: grid; gap: 8px; }
.article strong { color: var(--text); }
.article .code { margin-top: 18px; }
.article .faq { padding-top: 8px; }
.note { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; margin-top: 20px; }
.note p { margin: 0; }

.table-wrap { overflow-x: auto; margin-top: 20px; border: 1px solid var(--border); border-radius: var(--radius); }
table.compare { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 560px; }
.compare th, .compare td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.compare thead th { background: var(--surface); font-size: 14px; color: var(--muted); font-weight: 600; }
.compare tbody tr:last-child td { border-bottom: 0; }
.compare td:first-child { color: var(--text); }
.compare td:first-child small { display: block; color: var(--muted); font-size: 13px; }
.compare .yes { color: var(--accent); font-weight: 600; }
.compare .no { color: var(--muted); }

.more { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 20px; }

@media (max-width: 900px) {
  .explainer, .split { grid-template-columns: 1fr; }
  .cards, .steps, .more { grid-template-columns: 1fr 1fr; }
  .scenario { padding: 32px; }
  .scenario .ticks { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .cards, .steps, .more { grid-template-columns: 1fr; }
  .scenario { padding: 24px; border-radius: 22px; }
  .trust { border-radius: 14px; }
}

/* Comparison table on phones: one card per row, answers labelled underneath. */
@media (max-width: 600px) {
  .table-wrap { border: 0; overflow: visible; }
  table.compare { min-width: 0; }
  .compare thead { display: none; }
  .compare, .compare tbody, .compare tr, .compare td { display: block; width: 100%; }
  .compare tr { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 10px; padding: 6px 0; }
  .compare td { border: 0; padding: 6px 16px; }
  .compare td:nth-child(2)::before { content: 'Scell\0000E9: '; color: var(--muted); font-weight: 500; }
  .compare td:nth-child(3)::before { content: var(--other, 'Hidden album: '); color: var(--muted); font-weight: 500; }
}

/* Guides and comparison pages built by scripts/build_guides.py */
.top-links .top-cta {
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 650;
}
.top-links .top-cta:hover { color: var(--on-accent); filter: brightness(1.06); }
.guide-date { color: var(--muted); font-size: 14px; margin: -6px 0 22px; }
.answer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 14px;
  padding: 18px 20px;
}
.article .answer p { color: var(--text); font-size: 18px; }
.article .answer .answer-label { color: var(--accent); font-size: 13px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 6px; }
.guide-cta {
  margin: 40px 0;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.article .guide-cta p { color: var(--muted); }
.article .guide-cta .guide-cta-title { color: var(--text); font-size: 19px; font-weight: 650; margin-bottom: 6px; }
.guide-cta .store { margin-top: 16px; }
.guides-h1 { font-size: clamp(36px, 5vw, 54px); }
.guide-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 700px) {
  .guide-list { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .top-links .top-cta { padding: 7px 12px; font-size: 14px; }
}

/* ── Home page redesign (2026-11-09): hero with QR, promise band, feature grid,
      timeline, bolder scenario, guides teaser, closing call to action. ── */

body { background:
  radial-gradient(1200px 600px at 85% -10%, rgba(111, 211, 184, 0.10), transparent 60%),
  radial-gradient(900px 500px at -10% 20%, rgba(111, 211, 184, 0.05), transparent 60%),
  var(--bg); background-repeat: no-repeat; }

.accent-line { display: block; color: var(--accent); }
.hero-v2 h1 { font-size: clamp(40px, 6.2vw, 68px); }
.hero-v2 h1 .accent-line { font-size: 0.56em; letter-spacing: -0.02em; margin-top: 14px; line-height: 1.2; }
.hero-v2 .hero-phone { position: relative; }
.glow {
  position: absolute;
  inset: 10% 5%;
  background: radial-gradient(closest-side, rgba(111, 211, 184, 0.28), transparent);
  filter: blur(30px);
  z-index: -1;
}

.get { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 32px; }
.store-lg { min-height: 56px; padding: 14px 26px; font-size: 17px; gap: 10px; box-shadow: 0 10px 30px rgba(111, 211, 184, 0.18); }
.store:hover { filter: brightness(1.06); }
.qr-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px 10px 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  max-width: 300px;
}
.qr-card img { width: 84px; height: 84px; border-radius: 8px; flex: none; }
.qr-card p { color: var(--muted); font-size: 13px; line-height: 1.45; }
.qr-card strong { display: block; color: var(--text); font-size: 14px; margin-bottom: 2px; }

/* Full-width promise band */
.band {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, rgba(111, 211, 184, 0.04), rgba(111, 211, 184, 0.10), rgba(111, 211, 184, 0.04));
}
.band-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 22px 20px;
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 14px 32px;
}
.band p { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 17px; letter-spacing: 0.01em; }
.band svg, .fcard svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* Feature grid */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 80px; }
.fcard {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
.fcard:hover { border-color: var(--accent); transform: translateY(-2px); }
.fcard svg {
  width: 40px;
  height: 40px;
  padding: 9px;
  border-radius: 12px;
  background: rgba(111, 211, 184, 0.10);
  border: 1px solid rgba(111, 211, 184, 0.25);
}
.fcard h3 { font-size: 18px; margin-top: 4px; }
.fcard p { color: var(--muted); font-size: 15px; flex: 1; }
.fcard span { color: var(--accent); font-size: 14px; font-weight: 600; }

/* How it works: vertical timeline */
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.timeline { list-style: none; padding: 0; margin: 0 auto; max-width: 720px; counter-reset: step; position: relative; }
.timeline::before { content: ''; position: absolute; left: 27px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--accent), rgba(111, 211, 184, 0.1)); }
.timeline li { counter-increment: step; position: relative; padding: 0 0 36px 84px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: '0' counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  color: var(--accent);
  font-weight: 700;
  font-size: 17px;
}
.timeline h3 { font-size: 22px; padding-top: 12px; margin-bottom: 8px; }
.timeline p { color: var(--muted); }

/* Scenario, bolder */
.scenario-v2 {
  background: radial-gradient(800px 300px at 100% 0%, rgba(111, 211, 184, 0.10), transparent 70%), var(--surface);
}
.scenario-v2 h2 .accent-line { font-size: 0.7em; margin-top: 6px; }
.scenario-v2 .cta { margin-top: 36px; }

/* Section head with a link on the right */
.section-head.with-link { max-width: none; display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; }

/* Closing call to action */
.final-cta {
  margin-top: 40px;
  border-top: 1px solid var(--border);
  background: radial-gradient(900px 400px at 50% 120%, rgba(111, 211, 184, 0.16), transparent 70%);
  padding: 80px 0;
}
.final-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}
.final-cta h2 { font-size: clamp(34px, 5vw, 52px); }
.final-cta p { color: var(--muted); margin-top: 10px; font-size: 18px; }
.qr-large { flex-direction: column; text-align: center; padding: 16px; max-width: none; }
.qr-large img { width: 132px; height: 132px; }

@media (max-width: 900px) {
  .feature-grid { grid-template-columns: 1fr 1fr; }
  /* QR codes are for people on a computer. */
  .qr-card { display: none; }
}
@media (max-width: 600px) {
  .feature-grid { grid-template-columns: 1fr; margin-bottom: 56px; }
  .band-inner { justify-content: flex-start; flex-direction: column; gap: 12px; }
  .timeline::before { left: 21px; }
  .timeline li { padding-left: 64px; }
  .timeline li::before { width: 44px; height: 44px; font-size: 15px; }
  .timeline h3 { padding-top: 8px; font-size: 19px; }
  .final-cta { padding: 56px 0; }
}

/* Language switcher (header) and "the app is in English" note — scripts/build_i18n.py */
.top { gap: 12px; }
.top-links { margin-left: auto; align-items: center; }
.lang-switch { position: relative; }
.lang-switch summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
}
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-switch summary:hover, .lang-switch[open] summary { color: var(--text); border-color: var(--accent); }
.lang-switch svg { fill: none; stroke: currentColor; stroke-width: 1.7; }
.lang-switch ul {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 190px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 20px 50px var(--shadow);
  z-index: 20;
}
.lang-switch li a { display: block; padding: 9px 12px; border-radius: 9px; color: var(--text); text-decoration: none; font-size: 15px; }
.lang-switch li a:hover { background: var(--surface-2); }
.lang-switch li a[aria-current="page"] { color: var(--accent); }
.lang-note { color: var(--muted); font-size: 14px; margin-top: 14px; }
.lang-note::before { content: 'ⓘ '; color: var(--accent); }

@media (max-width: 600px) {
  .lang-switch summary span { display: none; }
  .lang-switch summary { padding: 8px; }
}

/* Guide images: app screenshots and diagrams (built from <!--FIGURE--> and <!--DIAGRAM--> by scripts/build_guides.py). */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.article figure { margin: 32px 0; }
.shot { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.shot img {
  width: 270px;
  height: auto;
  border-radius: 34px;
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px var(--shadow), 0 0 0 8px var(--frame);
}
.shot figcaption, .article .dg-note { color: var(--muted); font-size: 14px; line-height: 1.5; }
.shot figcaption { max-width: 420px; text-align: center; margin-top: 8px; }

.dg {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.dg .dg-title { color: var(--text); font-weight: 650; font-size: 17px; margin-bottom: 18px; }
.dg b { display: block; color: var(--text); font-weight: 600; font-size: 15px; line-height: 1.35; }
.dg .dg-note { display: block; margin-top: 3px; font-size: 13.5px; }
.dg ul, .dg ol { list-style: none; padding: 0; margin: 0; }
.dg-badge {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--accent);
}
.dg-icon { width: 22px; height: 22px; }
.dg-out { --tone: var(--warn); }
.dg-safe { --tone: var(--accent); }
.dg-neutral { --tone: var(--muted); }

/* flow: numbered steps, side by side on wide screens, stacked on phones */
.dg-steps { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 26px; }
.dg-steps li { position: relative; display: flex; flex-direction: column; gap: 8px; }
.dg-steps .dg-n { position: absolute; left: 30px; top: -6px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.dg-steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 16px;
  right: -19px;
  width: 9px;
  height: 9px;
  border-top: 2px solid var(--muted);
  border-right: 2px solid var(--muted);
  transform: rotate(45deg);
  opacity: 0.6;
}

/* paths: one starting point, several places it ends up */
.dg-origin { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; margin-bottom: 6px; border-bottom: 1px dashed var(--border); }
.dg-routes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-top: 16px !important; }
.dg-routes li {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 8px 12px;
  padding: 12px;
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--tone);
}
.dg-routes li > div { flex: 1; min-width: 0; }
.dg-routes .dg-badge { width: 34px; height: 34px; border-radius: 10px; color: var(--tone); }
.dg-routes .dg-icon { width: 19px; height: 19px; }
.dg-tag { grid-column: 2; justify-self: start; font-size: 12px; font-weight: 650; color: var(--tone); border: 1px solid var(--tone); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }

/* versus: two columns */
.dg-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dg-col { background: var(--bg); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.dg-col.dg-hl { border-color: rgba(111, 211, 184, 0.55); }
.article .dg-col-title { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 650; margin-bottom: 12px; }
.dg-col-title .dg-badge { width: 34px; height: 34px; border-radius: 10px; }
.dg-col-title .dg-icon { width: 19px; height: 19px; }
.dg-col ul { display: grid; gap: 9px; }
.dg-col li { display: flex; gap: 9px; align-items: flex-start; color: var(--muted); font-size: 14.5px; line-height: 1.45; }
.dg-mark { flex: none; width: 17px; height: 17px; margin-top: 2px; color: var(--tone); stroke-width: 2.4; }

@media (max-width: 640px) {
  .dg { padding: 18px 16px; }
  .shot img { width: 240px; border-radius: 30px; }
  .dg-steps { grid-template-columns: 1fr; gap: 14px; }
  .dg-steps li { flex-direction: row; align-items: flex-start; gap: 12px; padding-bottom: 14px; }
  .dg-steps li > b, .dg-steps li > .dg-note { margin-left: 0; }
  .dg-steps li { display: grid; grid-template-columns: 40px 1fr; column-gap: 12px; row-gap: 2px; }
  .dg-steps .dg-badge { grid-row: span 2; }
  .dg-steps .dg-note { grid-column: 2; margin-top: 0; }
  .dg-steps li:not(:last-child)::after { top: auto; bottom: 0; left: 16px; right: auto; transform: rotate(135deg); }
  .dg-cols { grid-template-columns: 1fr; }
  .dg-routes { grid-template-columns: 1fr; }
}

/* Guide extras: data tables, steps, callouts, FAQ and sources. */
table.data { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 520px; }
.data th, .data td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; color: var(--muted); }
.data thead th { background: var(--surface); font-size: 14px; font-weight: 600; }
.data tbody tr:last-child td { border-bottom: 0; }
.data td:first-child { color: var(--text); font-weight: 500; }
.article ol.steps { counter-reset: step; list-style: none; padding-left: 0; gap: 12px; }
.article ol.steps > li { counter-increment: step; position: relative; padding-left: 42px; }
.article ol.steps > li::before { content: counter(step); position: absolute; left: 0; top: 1px; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); color: var(--accent); font-size: 14px; font-weight: 700; display: grid; place-items: center; }
.callout { margin: 28px 0; padding: 18px 20px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); }
.callout.warn { border-left-color: var(--warn); }
.article .callout p { color: var(--text); }
.article .callout .callout-label { color: var(--accent); font-size: 13px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 6px; }
.article .callout.warn .callout-label { color: var(--warn); }
.guide-faq h3 { font-size: 18px; margin-top: 24px; }
.guide-faq p { margin-top: 6px; }
.guide-sources ul { font-size: 15px; }
.article .guide-sources li { color: var(--muted); }
@media (max-width: 640px) {
  .article ol.steps > li { padding-left: 38px; }
}
@media (max-width: 640px) {
  .table-wrap:has(table.data) { border: 0; overflow: visible; }
  table.data { min-width: 0; }
  .data thead { display: none; }
  .data, .data tbody, .data tr, .data td { display: block; width: 100%; }
  .data tr { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 10px; padding: 8px 0; }
  .data td { border: 0; padding: 4px 16px; }
  .data td:first-child { font-weight: 600; padding-bottom: 6px; }
  .data td:not(:first-child)::before { content: attr(data-label) " "; color: var(--text); font-weight: 500; }
}

/* Guide page layout (top to bottom): centered hero, intro, body, FAQ, keep reading, summary,
   sources, closing CTA, "Save this guide" infographic, sticky app bar. */
.guide-hero { text-align: center; margin: 4px 0 36px; }
.guide-hero-img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 22px; border: 1px solid var(--border); box-shadow: 0 30px 70px var(--shadow); margin-bottom: 30px; }
.article .guide-hero h1 { margin: 0 auto 12px; max-width: 760px; }
.article .guide-hero .hero-lead { color: var(--text); font-size: 19px; max-width: 620px; margin: 0 auto; }
.guide-hero .guide-date { margin: 10px 0 0; }
.guide-hero-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 16px; margin-top: 26px; }
.guide-hero-actions .qr-card { text-align: left; }
.article .guide-intro { color: var(--text); font-size: 19px; line-height: 1.65; padding-bottom: 6px; }
.guide-faq h3 { padding-left: 14px; border-left: 3px solid var(--accent); }
.guide-faq p { padding-left: 17px; }
.keep-reading { margin: 40px 0 0; padding: 20px 22px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.article .keep-reading-title { color: var(--text); font-weight: 650; margin-bottom: 8px; }
.keep-reading ul { gap: 6px; }
.guide-summary { margin-top: 8px; }
.save-guide { padding-top: 8px; }
.save-guide h2 { font-size: 22px; padding-bottom: 10px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.save-guide-media img { width: 340px; max-width: 100%; height: auto; border-radius: 16px; border: 1px solid var(--border); box-shadow: 0 20px 50px var(--shadow); }
.article .save-guide p { margin-top: 12px; font-size: 15px; }
.app-bar {
  position: fixed; right: 18px; bottom: 18px; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 10px 10px 12px; border-radius: 16px;
  background: var(--bar-bg); border: 1px solid var(--border);
  box-shadow: 0 16px 40px var(--shadow); backdrop-filter: blur(10px);
}
.app-bar img { border-radius: 9px; }
.app-bar p { display: grid; font-size: 13px; line-height: 1.3; color: var(--muted); }
.app-bar strong { color: var(--text); font-size: 15px; }
.app-bar .store { min-height: 40px; padding: 8px 16px; font-size: 14px; white-space: nowrap; }
@media (max-width: 640px) {
  .guide-hero-img { border-radius: 16px; margin-bottom: 22px; }
  .article .guide-hero .hero-lead, .article .guide-intro { font-size: 17px; }
  .guide-hero-actions .store { width: 100%; justify-content: center; }
  .app-bar { left: 10px; right: 10px; bottom: 10px; }
  .app-bar .store { margin-left: auto; }
  body:has(.app-bar) .foot { padding-bottom: 96px; }
}

/* Theme button (theme.js): a sun shows in dark mode, a moon in light mode. */
.theme-toggle {
  flex: none; display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0;
  border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
}
.theme-toggle:hover { border-color: var(--muted); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .i-moon, :root[data-theme="light"] .theme-toggle .i-sun { display: none; }
:root[data-theme="light"] .theme-toggle .i-moon { display: block; }
.top-links .top-cta { white-space: nowrap; }
@media (max-width: 420px) {
  .top { gap: 8px; padding-left: 14px; padding-right: 14px; }
  .brand { font-size: 17px; gap: 8px; }
  .brand img { width: 30px; height: 30px; }
  .theme-toggle { height: 34px; padding: 0 9px; gap: 5px; border-radius: 10px; font-size: 13px; }
}

/* Words on the theme button: shows the mode you switch to. */
.theme-toggle { width: auto; padding: 0 12px; gap: 7px; display: inline-flex; align-items: center; font: inherit; font-size: 14px; font-weight: 600; }
.theme-toggle .w-dark, :root[data-theme="light"] .theme-toggle .w-light { display: none; }
:root[data-theme="light"] .theme-toggle .w-dark { display: inline; }
@media (max-width: 420px) {
  .theme-toggle { height: 34px; padding: 0 9px; gap: 5px; border-radius: 10px; font-size: 13px; }
}
@media (max-width: 360px) {
  .theme-toggle { width: 34px; padding: 0; justify-content: center; }
  .theme-toggle .w-light, .theme-toggle .w-dark { display: none !important; }
  .top .brand span { display: none; }
}

/* Screen recordings (GIFs) of the app; a still frame is used when motion is reduced. */
picture.demo { display: block; }
@media (max-width: 900px) { .feature-row picture.demo { justify-self: center; } }
.demo-figure { margin: 28px 0; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.demo-figure .phone { box-shadow: 0 24px 60px var(--shadow), 0 0 0 8px var(--frame); }
.article .demo-figure figcaption { color: var(--muted); font-size: 14px; text-align: center; max-width: 420px; }
