:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --brand: #4f46e5;
  --brand-solid: #4f46e5;
  --border: #e2e8f0;
  --good: #15803d;
  --good-bg: #ecfdf3;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020;
    --surface: #121a2f;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --brand: #818cf8;
    --brand-solid: #4f46e5;
    --border: #1e293b;
    --good: #4ade80;
    --good-bg: #0f2a1c;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding-bottom: 72px;
}
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
a { color: var(--brand); }
img { max-width: 100%; height: auto; }
.top { background: var(--surface); border-bottom: 1px solid var(--border); }
.top .wrap { padding-top: 10px; padding-bottom: 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); text-decoration: none; }
.brand img { border-radius: 8px; }
main { padding-top: 16px; padding-bottom: 32px; }
h1 { font-size: 24px; line-height: 1.25; margin: 8px 0 8px; }
h2 { font-size: 20px; margin: 32px 0 8px; }
h3 { font-size: 17px; margin: 20px 0 6px; }
.lead { color: var(--muted); margin: 0 0 12px; }
.muted { color: var(--muted); font-size: 14px; }
.crumbs { font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.cta { margin: 12px 0 16px; }
.cta-label { margin: 0 0 8px; font-weight: 600; }
.badges { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.badge { display: inline-block; line-height: 0; }
.badge.play img { width: 180px; height: auto; margin: -10px -10px; }
.badge.ios img { width: 150px; height: auto; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--brand-solid); color: #fff; font-weight: 700;
  padding: 12px 18px; border-radius: 12px; text-decoration: none;
}
/* A phone sees its own store's badge and the other store as a link; desktop and no-JS see both badges. */
.alt { display: none; margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.is-android .badge.ios, .is-ios .badge.play { display: none; }
.is-android .alt-ios, .is-ios .alt-play { display: block; }
.is-android .stickybar .ios, .is-ios .stickybar .play { display: none; }
.stickybar .ios { display: none; }
.is-ios .stickybar .ios { display: inline-flex; }
.jump { display: flex; gap: 16px; margin: 8px 0; }
.qs { padding-left: 28px; margin: 8px 0; }
.q { margin: 0 0 20px; padding-left: 4px; }
.q::marker { font-weight: 700; }
.qtext { margin-bottom: 6px; }
.opts { list-style: none; padding: 0; margin: 0; }
.opts li { padding: 4px 8px; border-radius: 8px; }
.opts li.correct { background: var(--good-bg); }
.answer { margin-top: 8px; padding: 8px 12px; border-left: 3px solid var(--good); background: var(--surface); border-radius: 0 8px 8px 0; }
.answer b { color: var(--good); }
.solution { margin-top: 4px; }
.instr { font-style: italic; color: var(--muted); }
.passage { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; margin: 12px 0; }
.gate { background: var(--surface); border: 2px solid var(--brand); border-radius: 16px; padding: 16px; margin: 20px 0; }
.gate p { margin: 0 0 4px; }
.tablewrap { overflow-x: auto; margin: 8px 0; }
table { border-collapse: collapse; font-size: 14px; }
th, td { border: 1px solid var(--border); padding: 6px 8px; text-align: left; vertical-align: top; }
.papers { list-style: none; padding: 0; }
.papers li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.papers a { font-weight: 600; margin-right: 8px; }
.grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.grid a { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; text-decoration: none; color: var(--text); }
.pills { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pills a { display: inline-block; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); text-decoration: none; }
.katex { font-size: 1.05em; }
.katex-display { overflow-x: auto; overflow-y: hidden; }
footer { padding-top: 16px; padding-bottom: 24px; border-top: 1px solid var(--border); }
.stickybar { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 16px; background: var(--surface); border-top: 1px solid var(--border); text-align: center; }
.stickybar .btn { width: 100%; max-width: 420px; }
@media (min-width: 900px) { .stickybar { display: none; } body { padding-bottom: 0; } }
