/* VocabSprint site. One stylesheet, no build step. Tokens repeat docs/design.md. */

@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-semibold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: #F3EFE7;
  --card: #FFFDF8;
  --ink: #0E1726;
  --muted: #5A5648;
  --line: #E4DDCF;
  --accent: #6B2A5B;
  --accent-ink: #FFFFFF;
  --accent-soft: #EFE1EA;
  --positive: #0F6B46;
  --positive-soft: #DDF1E7;
  --negative: #A8431A;
  --negative-soft: #FBE8DC;
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius-l: 20px;
  --radius-m: 16px;
  --radius-s: 14px;
  --gutter: 16px;
  --max: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B111C;
    --card: #141C2B;
    --ink: #EDF1F7;
    --muted: #97A3B6;
    --line: #243047;
    --accent: #D9A0C8;
    --accent-ink: #2A0F23;
    --accent-soft: #3A1F33;
    --positive: #63CFA0;
    --positive-soft: #12301F;
    --negative: #F2A074;
    --negative-soft: #3A2012;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 16px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

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

.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 16px;
  border-radius: var(--radius-s);
  font-weight: 700;
  z-index: 10;
}
.skip:focus { top: 16px; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
@media (min-width: 700px) { :root { --gutter: 24px; } }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0;
}
h1 { font-size: clamp(2.3rem, 1.6rem + 3.4vw, 4rem); }
h2 { font-size: clamp(1.8rem, 1.4rem + 1.8vw, 2.6rem); }
h3 { font-size: 1.4rem; }
p { margin: 0 0 1em; }

.label {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
}

.lead { font-size: 1.2rem; color: var(--muted); max-width: 38em; }

/* ---------- Header and footer ---------- */

.site-header { padding: 16px 0; }
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.35rem;
  min-height: 44px;
}
.brand img { width: 46px; height: auto; }
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
  font-weight: 600;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
}
.site-nav a:hover { color: var(--accent); }
.site-nav .lang { color: var(--accent); }
@media (max-width: 699px) {
  .site-nav .opt { display: none; }
}

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 72px;
  padding: 40px 0 48px;
  color: var(--muted);
  font-size: 0.92rem;
}
.footer-main { display: grid; gap: 28px 40px; }
@media (min-width: 900px) { .footer-main { grid-template-columns: 1fr 2.4fr; } }
.footer-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--serif); font-weight: 600; font-size: 1.2rem; min-height: 44px; }
.footer-brand img { width: 36px; height: auto; }
.footer-about p { margin: 4px 0 0; max-width: 22em; }
.footer-cols { display: grid; gap: 20px 24px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 700px) { .footer-cols { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.footer-head {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 4px;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer a { color: var(--muted); display: inline-flex; min-height: 40px; align-items: center; }
.site-footer a:hover { color: var(--accent); }
.footer-legal { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 20px; }
.footer-legal p { margin: 0 0 6px; }
.footer-legal .trademark { font-size: 0.82rem; max-width: 52em; }

/* ---------- Buttons ---------- */

.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 28px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 24px;
  border-radius: var(--radius-s);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
}
.button:hover { text-decoration: none; }
.button.secondary { background: var(--accent-soft); color: var(--accent); border-radius: 999px; }
.store-soon {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  min-height: 52px;
  padding: 6px 22px;
  border-radius: var(--radius-s);
  border: 2px solid var(--accent);
  color: var(--accent);
  line-height: 1.25;
  margin: 0;
}
.store-soon strong { font-size: 1rem; }
.store-soon span { font-size: 0.82rem; color: var(--muted); }

/* ---------- Sections ---------- */

section { padding: 56px 0; }
@media (min-width: 900px) { section { padding: 88px 0; } }
.section-head { max-width: 44em; margin-bottom: 36px; }
.section-head h2 + p { margin-top: 16px; }

.card {
  background: var(--card);
  border-radius: var(--radius-l);
  padding: 20px;
}
@media (min-width: 700px) { .card { padding: 28px; } }

/* ---------- Hero ---------- */

.hero { padding-top: 24px; }
.hero .wrap {
  display: grid;
  gap: 40px;
  align-items: center;
}
@media (min-width: 900px) {
  .hero { padding-top: 40px; }
  .hero .wrap { grid-template-columns: 1.25fr 1fr; gap: 56px; }
}
.hero-mark { width: 132px; margin-bottom: 20px; }
@media (min-width: 900px) { .hero-mark { width: 160px; } }
.hero h1 { max-width: 12em; }
.hero .lead { margin-top: 20px; }
.hero-shot { justify-self: center; }

@media (prefers-reduced-motion: no-preference) {
  .hero-mark {
    animation: run-in 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) 0.15s both;
  }
  @keyframes run-in {
    from { transform: translateX(-48px); opacity: 0; }
    60% { opacity: 1; }
    to { transform: none; opacity: 1; }
  }
}

/* ---------- Screenshots ---------- */

.shot {
  margin: 0;
  max-width: 300px;
}
.shot img {
  border-radius: 28px;
  border: 1px solid var(--line);
  background: var(--card);
  width: 100%;
}
.shot figcaption {
  font-size: 0.92rem;
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.45;
}
.shot figcaption strong { color: var(--ink); display: block; font-size: 1rem; }

.shots {
  list-style: none;
  margin: 0;
  padding: 0 0 8px;
  display: grid;
  gap: 32px 20px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  justify-items: center;
}
@media (max-width: 459px) {
  .shots { grid-template-columns: 1fr; }
  .shots .shot { max-width: 280px; }
}
.step-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 6px;
}

/* ---------- Session tour ----------
   Without the script (assets/session.js) this is a static, numbered layout: every screen in a
   grid, then the numbered steps. The script adds .is-enhanced and the controls: one phone in a
   frame with arrows beside it, dots and Pause under it, the steps as buttons with only the current
   one open. Autoplay is timed by the current step's progress line (.tour-bar), a CSS animation the
   script listens to; reduced motion: no autoplay, no cross-fade. */

.tour { display: grid; gap: 32px; counter-reset: tour-shot; }
.tour-screens {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 20px 14px;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
@media (min-width: 700px) { .tour-screens { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }
.tour-screens li { counter-increment: tour-shot; position: relative; }
.tour-screens li::before {
  content: counter(tour-shot);
  position: absolute;
  top: -10px;
  left: -6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 0.85rem;
}
.tour-screens img {
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--card);
  width: 100%;
}
.tour-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tour-steps li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 0 14px;
  padding: 12px 16px 12px 12px;
  align-content: start;
}
.tour-steps .step-no { margin: 0; grid-row: span 2; }
.tour-steps strong { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; line-height: 1.3; }
.tour-text { color: var(--muted); }

/* --- Enhanced: the viewer --- */

.tour.is-enhanced {
  gap: 28px;
  justify-items: center;
}
.is-enhanced .tour-stage {
  display: grid;
  grid-template-columns: 44px auto 44px;
  grid-template-areas: "prev device next" "controls controls controls";
  align-items: center;
  gap: 18px 10px;
}
@media (min-width: 420px) { .is-enhanced .tour-stage { gap: 20px 18px; grid-template-columns: 48px auto 48px; } }

.is-enhanced .tour-device { grid-area: device; width: min(62vw, 300px); }
/* The phone frame, shared by the session viewer and the library viewer. */
.is-enhanced .tour-device,
.lib-device {
  padding: 9px;
  border-radius: 46px;
  background: var(--ink);
  box-shadow: 0 28px 56px -28px rgb(14 23 38 / 0.55);
  touch-action: pan-y;
}
@media (prefers-color-scheme: dark) {
  .is-enhanced .tour-device,
  .lib-device {
    background: var(--card);
    box-shadow: inset 0 0 0 1px var(--line), 0 28px 56px -24px rgb(0 0 0 / 0.6);
  }
}
.is-enhanced .tour-screens,
.lib-screens {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-radius: 37px;
  overflow: hidden;
  background: var(--bg);
}
.is-enhanced .tour-screens li,
.lib-screens li { grid-area: 1 / 1; opacity: 0; }
.is-enhanced .tour-screens li.is-current,
.lib-screens li.is-current { opacity: 1; position: relative; z-index: 1; }
.is-enhanced .tour-screens li::before { content: none; }
.is-enhanced .tour-screens img,
.lib-screens img { border: 0; border-radius: 0; }

.tour-arrow {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
@media (min-width: 420px) { .tour-arrow { width: 48px; height: 48px; } }
.tour-arrow svg { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tour-arrow:hover { background: var(--accent-soft); }
.tour-prev { grid-area: prev; }
.tour-next { grid-area: next; }

.tour-controls {
  grid-area: controls;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
  flex-wrap: wrap;
}
.tour-dots { display: flex; }
.tour-dot {
  width: 26px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tour-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--muted);
  opacity: 0.4;
}
.tour-dot:hover::before { opacity: 0.8; }
.tour-dot[aria-current]::before { width: 22px; background: var(--accent); opacity: 1; }
.tour-dot[aria-hidden="true"] { cursor: default; width: 20px; }
.tour-toggle {
  min-height: 44px;
  padding: 0 14px 0 12px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.tour-toggle:hover { color: var(--accent); background: var(--accent-soft); }
/* Pause: two bars. Play: a triangle. */
.tour-toggle-icon { width: 10px; height: 12px; border-left: 3px solid currentColor; border-right: 3px solid currentColor; }
.tour-toggle.is-paused .tour-toggle-icon {
  width: 0;
  height: 0;
  border-left: 10px solid currentColor;
  border-right: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

/* Steps: one card; only the current step is open. Narrow: only the current step shows (the dots
   and arrows reach the others). */
.is-enhanced .tour-steps {
  width: 100%;
  max-width: 34em;
  gap: 0;
  background: var(--card);
  border-radius: var(--radius-l);
  padding: 6px;
}
.is-enhanced .tour-steps li {
  display: block;
  position: relative;
  padding: 0;
  border-radius: var(--radius-m);
}
.is-enhanced .tour-steps li:not(.is-current) { display: none; }
.tour-step {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 52px;
  padding: 10px 14px;
  border: 0;
  border-radius: var(--radius-m);
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.tour-step .step-no { margin: 0; flex: none; }
.tour-step strong { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; line-height: 1.25; }
.is-current .tour-step .step-no { background: var(--accent); color: var(--accent-ink); }
.is-enhanced .tour-text { display: block; padding: 0 16px 16px 56px; }
.tour-bar {
  position: absolute;
  left: 56px;
  right: 16px;
  bottom: 8px;
  height: 2px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
  display: none;
}
.tour-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
}
.is-playing .is-current .tour-bar { display: block; }
.is-playing .is-current .tour-bar::after { animation: tour-progress 5s linear forwards; }
.is-held .is-current .tour-bar::after { animation-play-state: paused; }
@keyframes tour-progress { to { transform: scaleX(1); } }
.is-playing .is-current .tour-text { padding-bottom: 22px; }

@media (min-width: 900px) {
  .tour.is-enhanced {
    grid-template-columns: auto minmax(0, 30em);
    justify-content: center;
    align-items: center;
    gap: 72px;
  }
  .is-enhanced .tour-device { width: 300px; }
  .is-enhanced .tour-steps li:not(.is-current) { display: block; }
  .is-enhanced .tour-steps li:not(.is-current) .tour-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .is-enhanced .tour-steps li:not(.is-current) strong { color: var(--muted); }
  .is-enhanced .tour-steps li:not(.is-current) .tour-step:hover strong { color: var(--ink); }
  .is-enhanced .tour-steps li.is-current { background: var(--bg); }
  .is-enhanced .tour-steps li + li { margin-top: 2px; }
}

/* The screens cross-fade; the step text opens gently. Off with reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  /* The new screen fades in over the old one, which disappears once it is covered. */
  .is-enhanced .tour-screens li,
  .lib-screens li { transition: opacity 0s linear 0.4s; }
  .is-enhanced .tour-screens li.is-current,
  .lib-screens li.is-current { transition: opacity 0.4s ease; }
  .is-enhanced .tour-steps li.is-current .tour-text { animation: tour-open 0.3s ease both; }
  @keyframes tour-open { from { opacity: 0; transform: translateY(-4px); } }
}

/* A row of three screens under a text block (plan, library, progress). */
.shots.three { grid-template-columns: repeat(3, minmax(0, 260px)); justify-content: center; gap: 24px 20px; }
@media (max-width: 699px) {
  .shots.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shots.three .shot { max-width: none; }
}
.shots.two { grid-template-columns: repeat(2, minmax(0, 260px)); justify-content: center; }
@media (max-width: 459px) { .shots.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } .shots.two .shot { max-width: none; } }
.stack { margin-top: 56px; }
.stack > div { max-width: 46em; margin-bottom: 32px; }
.stack h3 { font-size: 1.8rem; margin-bottom: 14px; }
.stack p { color: var(--muted); }

/* ---------- Problem ---------- */

.contrast {
  display: grid;
  gap: 16px;
  margin-top: 8px;
}
@media (min-width: 800px) { .contrast { grid-template-columns: 1fr 1fr; gap: 20px; } }
.contrast .card p:last-child { margin-bottom: 0; }
.example {
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.4;
  margin: 8px 0 12px;
}
.example .bad { color: var(--negative); text-decoration: line-through; text-decoration-thickness: 2px; }
.example .good { color: var(--accent); font-weight: 600; }
.tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
}
.tag.neg { background: var(--negative-soft); color: var(--negative); }
.tag.pos { background: var(--accent-soft); color: var(--accent); }

/* ---------- Word anatomy ---------- */

.anatomy {
  display: grid;
  gap: 40px;
  align-items: start;
}
@media (min-width: 900px) { .anatomy { grid-template-columns: 1.1fr 1fr; gap: 56px; } }
.specimen .head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.headword { font-family: var(--serif); font-weight: 600; font-size: 2.3rem; line-height: 1.1; }
.level {
  border: 1.5px solid var(--accent);
  color: var(--accent);
  border-radius: 999px;
  padding: 1px 10px;
  font-size: 0.85rem;
  font-weight: 700;
}
.meta { color: var(--muted); font-size: 0.95rem; margin: 6px 0 14px; }
.definition { font-family: var(--serif); font-size: 1.3rem; line-height: 1.35; margin: 0 0 8px; }
.gloss { color: var(--muted); font-size: 0.98rem; }
.gloss b { font-size: 0.75rem; letter-spacing: 0.08em; margin-right: 6px; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.sentence { font-family: var(--serif); font-size: 1.15rem; line-height: 1.45; margin: 0; }
.sentence b { color: var(--accent); font-weight: 600; }
.chips { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 5px 14px;
  border-radius: 999px;
}
.chips.not li {
  background: var(--negative-soft);
  color: var(--negative);
  text-decoration: line-through;
}
.label.neg { color: var(--negative); }
.points { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.points li { padding-left: 20px; border-left: 3px solid var(--accent-soft); }
.points strong { display: block; font-family: var(--serif); font-size: 1.2rem; font-weight: 600; }
.points span { color: var(--muted); }
.anatomy-shots { display: grid; grid-template-columns: repeat(2, minmax(0, 280px)); gap: 20px; margin: 48px auto 0; justify-content: center; }
@media (min-width: 900px) { .anatomy-shots { gap: 40px; } }

/* ---------- Method ---------- */

.method {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}
.method .card h3 { font-size: 1.3rem; margin-bottom: 8px; }
.method .card p { color: var(--muted); margin: 0; }
.method .card p + p { margin-top: 0.8em; }

.split {
  display: grid;
  gap: 40px;
  align-items: center;
  margin-top: 56px;
}
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; gap: 64px; } }
.split .shots { justify-items: start; }
@media (max-width: 899px) { .split .shots { justify-items: center; } }
.split h3 { font-size: 1.8rem; margin-bottom: 14px; }
.split p { color: var(--muted); }

/* ---------- Library: how the words are grouped ----------
   Without the script (assets/session.js): the three groups stacked, each with its list and its
   screenshot. The script adds .is-enhanced, a tab row (role="tablist") built from each group's
   name and count, and one phone (.lib-device) holding the three screenshots, which cross-fade as
   the selected tab changes. Reduced motion: no cross-fade, no fade-in. */

.stack > .library { max-width: none; margin: 0; }
.lib-panel { display: grid; gap: 20px 48px; padding-top: 28px; margin-top: 28px; border-top: 1px solid var(--line); }
.lib-panel:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
@media (min-width: 800px) {
  .lib-panel { grid-template-columns: minmax(0, 36em) 240px; grid-template-rows: auto 1fr; justify-content: space-between; align-items: start; }
  .lib-panel .lib-shot { grid-column: 2; grid-row: 1 / span 2; }
}
.lib-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.lib-name { font-family: var(--serif); font-size: 1.4rem; font-weight: 600; line-height: 1.2; margin: 0; }
.stack .lib-count { margin: 0; font-size: 0.9rem; font-weight: 600; color: var(--accent); }
.stack .lib-line { color: var(--ink); margin: 0 0 14px; font-size: 1.05rem; }
.lib-shot { max-width: 240px; justify-self: center; }
/* Inside the phone frame the screenshot fills the screen: the 240px cap is for the stacked layout only. */
.lib-screens .lib-shot, .lib-screens .shot { max-width: none; width: 100%; margin: 0; }
.lib-screens img { width: 100%; height: auto; display: block; }

.lib-list { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 24px; counter-reset: lib; }
@media (min-width: 560px) { .lib-list.three { columns: 3; } }
.lib-list.single { columns: 1; }
.lib-list li {
  break-inside: avoid;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 10px;
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
  font-family: var(--serif);
  font-size: 1.1rem;
  line-height: 1.3;
}
.lib-list.numbered li { counter-increment: lib; flex-wrap: nowrap; }
.lib-list.numbered li::before {
  content: counter(lib);
  flex: none;
  min-width: 1.3em;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.lib-list.single li { flex-wrap: nowrap; justify-content: space-between; gap: 16px; }
.lib-task { flex: none; font-family: var(--sans); font-size: 0.82rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.stack .lib-along {
  margin: 16px 0 0;
  padding: 12px 16px;
  border-radius: var(--radius-m);
  background: var(--accent-soft);
  color: var(--ink);
  text-wrap: pretty;
}
.lib-along strong { color: var(--accent); }
.lib-groups { display: grid; gap: 24px 28px; }
@media (min-width: 560px) { .lib-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.lib-groups .label { margin: 0 0 2px; }

/* --- Enhanced: tabs, one phone, one panel --- */

.library.is-enhanced {
  display: grid;
  grid-template-areas: "tabs" "device" "panel";
  gap: 24px;
  justify-items: center;
}
.is-enhanced .lib-panel { grid-area: panel; display: block; width: 100%; max-width: 34em; margin: 0; padding: 0; border: 0; }
.is-enhanced .lib-panel[hidden] { display: none; }
.is-enhanced .lib-head {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.is-enhanced .lib-panel:focus-visible { outline-offset: 8px; }
.lib-stage { grid-area: device; }
.lib-device { width: min(60vw, 280px); touch-action: pan-y; }

.lib-tabs {
  grid-area: tabs;
  width: 100%;
  max-width: 34em;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 5px;
  background: var(--card);
  border-radius: var(--radius-l);
}
.lib-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 64px;
  padding: 8px 6px;
  border: 0;
  border-radius: var(--radius-m);
  background: none;
  color: var(--muted);
  font: inherit;
  text-align: center;
  cursor: pointer;
}
.lib-tab-name { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; line-height: 1.15; }
.lib-tab-count { font-size: 0.8rem; font-weight: 600; line-height: 1.3; }
.lib-tab:hover { color: var(--ink); }
.lib-tab[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); }
.lib-tab:focus-visible { outline-offset: 1px; }
@media (max-width: 439px) {
  .lib-tabs { padding: 4px; gap: 2px; }
  .lib-tab { padding: 8px 2px; }
  .lib-tab-name { font-size: 1.05rem; }
}

@media (min-width: 900px) {
  .library.is-enhanced {
    grid-template-columns: auto minmax(0, 34em);
    grid-template-rows: auto 1fr;
    grid-template-areas: "device tabs" "device panel";
    justify-content: center;
    justify-items: stretch;
    align-items: start;
    gap: 28px 72px;
  }
  .lib-device { width: 300px; }
  .lib-tab { min-height: 72px; }
  .lib-tab-name { font-size: 1.25rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .is-enhanced .lib-panel:not([hidden]) { animation: tour-open 0.3s ease both; }
}

/* ---------- Pricing ---------- */

.plans {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}
.plan h3 { font-size: 1.4rem; }
.plan .price { font-family: var(--serif); font-size: 2.6rem; font-weight: 600; line-height: 1.1; margin: 14px 0 4px; }
.plan .price small { font-family: var(--sans); font-size: 1rem; font-weight: 600; color: var(--muted); }
.plan .sub { color: var(--muted); margin-bottom: 16px; font-size: 0.95rem; }
.plan ul { margin: 0; padding-left: 1.2em; }
.plan li { margin-bottom: 6px; }
.plan.best { outline: 2px solid var(--accent); outline-offset: -2px; }
.badge {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: middle;
}
.fine { color: var(--muted); font-size: 0.92rem; margin-top: 20px; max-width: 48em; }

/* ---------- FAQ ---------- */

.faq { max-width: 50em; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.25rem;
  padding: 18px 36px 18px 0;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 14px;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 1.6rem;
  color: var(--accent);
}
.faq details[open] summary::after { content: "\2013"; }
.faq details > div { padding: 0 0 18px; color: var(--muted); }
.faq details > div p:last-child { margin-bottom: 0; }

/* ---------- Download ---------- */

.download .card {
  display: grid;
  gap: 24px;
  align-items: center;
  text-align: center;
  justify-items: center;
  padding: 40px 20px;
}
.download img { width: 120px; }
.download .actions { justify-content: center; margin-top: 0; }

/* ---------- Text pages (privacy, terms, support, 404) ---------- */

.doc { max-width: 46em; padding-top: 24px; }
.doc h1 { font-size: clamp(2.2rem, 1.8rem + 2vw, 3rem); margin-bottom: 12px; }
.doc .updated { color: var(--muted); font-size: 0.95rem; }
.doc h2 { font-size: 1.6rem; margin: 40px 0 12px; }
.doc h3 { font-size: 1.2rem; margin: 24px 0 8px; }
.doc ul, .doc ol { padding-left: 1.3em; margin: 0 0 1em; }
.doc li { margin-bottom: 6px; }
.doc .summary { margin: 24px 0 8px; }
.doc .summary ul { margin: 0; }
.doc .note { color: var(--muted); font-size: 0.95rem; }
.not-found { text-align: center; padding: 64px 0 24px; }
.not-found img { width: 140px; margin: 0 auto 24px; }
.not-found .actions { justify-content: center; }

@media print {
  .site-header nav, .skip, .actions { display: none; }
  body { background: #fff; color: #000; }
}

.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;
}
