:root {
  --bg: #fbf7f0;
  --surface: #ffffff;
  --text: #22232b;
  --muted: #5a5c68;
  --accent: #4a5c92;
  --accent-soft: #e6e9f5;
  --line: #e4ded3;
  --todo: #fff1c2;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17181f;
    --surface: #20222b;
    --text: #ece9e3;
    --muted: #b3b1ab;
    --accent: #b6c4ff;
    --accent-soft: #2c3350;
    --line: #34363f;
    --todo: #5a4a12;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); }

header, main, footer {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1rem;
}

header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem 1.5rem;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

header .brand {
  font-weight: 650;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
}

header nav a { margin-left: 1rem; }
header nav a:first-child { margin-left: 0; }

main { padding-top: 2rem; padding-bottom: 3rem; }

h1 { font-size: 2rem; line-height: 1.25; margin: 0 0 0.75rem; font-weight: 650; }
h2 { font-size: 1.3rem; margin: 2.25rem 0 0.5rem; font-weight: 650; }
h3 { font-size: 1.05rem; margin: 1.5rem 0 0.25rem; }

.lead { font-size: 1.15rem; color: var(--muted); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

.card h2, .card h3 { margin-top: 0; }

.notice {
  background: var(--accent-soft);
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
}

dl { margin: 0; }
dt { font-weight: 600; margin-top: 0.75rem; }
dd { margin: 0; }

.todo { background: var(--todo); padding: 0 0.25rem; border-radius: 4px; }

.updated { color: var(--muted); font-size: 0.95rem; }

footer {
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
  padding-bottom: 2rem;
  color: var(--muted);
  font-size: 0.95rem;
}

/* App landing page */
:root { --correct: #1f6f5c; --correct-bg: #dff1ea; --wrong: #9a4a1f; --wrong-bg: #f8e6da; }
@media (prefers-color-scheme: dark) {
  :root { --correct: #8fd6bf; --correct-bg: #1d3a32; --wrong: #f2b391; --wrong-bg: #45291b; }
}

main.wide { max-width: 64rem; }
header.wide, footer.wide { max-width: 64rem; }

.lang-switch { font-size: 0.95rem; }

.hero { display: grid; gap: 2rem; align-items: center; padding: 1rem 0 1.5rem; }
@media (min-width: 52rem) { .hero { grid-template-columns: 1.2fr 0.8fr; } }
.hero h1 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); }

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0; margin: 1.25rem 0; list-style: none; }
.chips li { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0.3rem 0.85rem; font-size: 0.95rem; }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-top: 1.25rem; }
.button { display: inline-block; background: var(--accent); color: var(--bg); border-radius: 999px; padding: 0.75rem 1.4rem; font-weight: 600; text-decoration: none; }
.button.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.soon { color: var(--muted); font-size: 0.95rem; }

.phone { margin: 0 auto; max-width: 17rem; border: 10px solid #23242c; border-radius: 2.2rem; overflow: hidden; background: #23242c; box-shadow: 0 20px 50px rgba(30, 30, 50, 0.18); }
.phone img { display: block; width: 100%; height: auto; }

.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.grid .card { margin: 0; }
.grid h3 { margin: 0 0 0.35rem; }
.grid p { margin: 0; color: var(--muted); }

.shots { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); margin-top: 1rem; }
.shots figure { margin: 0; }
.shots .phone { max-width: 14rem; border-width: 8px; border-radius: 1.8rem; }
.shots figcaption { text-align: center; color: var(--muted); font-size: 0.95rem; margin-top: 0.6rem; }

.steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.steps li { counter-increment: step; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 1.1rem 1.25rem; }
.steps li::before { content: counter(step); display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; margin-bottom: 0.5rem; }
.steps strong { display: block; }

.quiz-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 1rem 0; }
.quiz-bar select { font: inherit; padding: 0.4rem 0.6rem; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.question { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 1.25rem 1.5rem; margin: 1rem 0; }
.question .prompt { font-size: 1.15rem; font-weight: 600; margin: 0 0 0.25rem; }
.question .translated { color: var(--muted); margin: 0 0 0.75rem; }
.choices { display: grid; gap: 0.5rem; }
.choices button { font: inherit; text-align: start; padding: 0.75rem 1rem; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); color: var(--text); cursor: pointer; }
.choices button:hover:not(:disabled) { border-color: var(--accent); }
.choices button:disabled { cursor: default; }
.choices button.is-correct { background: var(--correct-bg); border-color: var(--correct); }
.choices button.is-wrong { background: var(--wrong-bg); border-color: var(--wrong); }
.feedback { margin-top: 0.9rem; }
.feedback .verdict { font-weight: 700; margin: 0 0 0.35rem; }
.feedback .verdict.ok { color: var(--correct); }
.feedback .verdict.no { color: var(--wrong); }
.feedback .explanation { background: var(--accent-soft); border-radius: 14px; padding: 0.8rem 1rem; margin: 0 0 0.4rem; }
.feedback .source { font-size: 0.9rem; color: var(--muted); }

table.compare { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: 20px; overflow: hidden; }
.compare th, .compare td { text-align: start; padding: 0.7rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.compare thead th { background: var(--accent-soft); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 20px; }

details { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 0.9rem 1.2rem; margin: 0.6rem 0; }
summary { cursor: pointer; font-weight: 600; }
details p { margin: 0.6rem 0 0; }

.facts dt { margin-top: 0.9rem; }
.checked { color: var(--muted); font-size: 0.95rem; }

h1, h2, h3 { overflow-wrap: break-word; hyphens: auto; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.75rem; margin: 1.5rem 0; padding: 0; list-style: none; }
.stats li { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 1rem; text-align: center; }
.stats strong { display: block; font-size: 1.9rem; line-height: 1.1; color: var(--accent); }
.stats span { color: var(--muted); font-size: 0.95rem; }
