/* PracticeRC - shared styles for static SEO/content pages.
   Brand tokens mirror the app (see frontend/src/index.css & landing Layout.astro).
   Theme follows the app: default dark, overridable via data-theme on <html>. */

:root {
  color-scheme: light;
  --page-bg: #f4eee3;
  --page-bg-tint: #efe7d8;
  --surface: #fffcf6;
  --surface-2: #faf4e8;
  --border: #e4dac8;
  --text: #18241f;
  --text-muted: #5f6a62;
  --text-soft: #7d887f;
  --primary: #d26c45;
  --primary-strong: #b85733;
  --primary-soft: rgba(210, 108, 69, 0.12);
  --shadow: 0 18px 50px rgba(31, 26, 17, 0.1);
  --radius: 14px;
}

html[data-theme='dark'] {
  color-scheme: dark;
  --page-bg: #101513;
  --page-bg-tint: #1a211e;
  --surface: #151b18;
  --surface-2: #1a221e;
  --border: #2b3832;
  --text: #e5ece6;
  --text-muted: #aab6ad;
  --text-soft: #7f8e84;
  --primary: #df7f58;
  --primary-strong: #f0a27f;
  --primary-soft: rgba(223, 127, 88, 0.14);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background-color: var(--page-bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.65;
  font-size: 1.02rem;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: min(760px, calc(100% - 40px)); margin: 0 auto; }
.wrap-wide { width: min(1040px, calc(100% - 40px)); margin: 0 auto; }

/* ---- Header / nav ---- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-header .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
  gap: 1rem;
}
.brand { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 800; letter-spacing: -0.01em; color: var(--text); text-decoration: none; font-size: 1.05rem; }
.brand img { width: 26px; height: 26px; }
.nav-links { display: flex; gap: 1.1rem; flex-wrap: wrap; align-items: center; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-weight: 600; font-size: 0.92rem; }
.nav-links a:hover { color: var(--primary-strong); }
.nav-cta { padding: 0.5rem 0.9rem; border-radius: 10px; background: var(--primary); color: #fff !important; }
.nav-cta:hover { background: var(--primary-strong); }

/* ---- Breadcrumb ---- */
.crumb { font-size: 0.86rem; color: var(--text-soft); padding: 1rem 0 0; }
.crumb a { color: var(--text-muted); text-decoration: none; }
.crumb a:hover { color: var(--primary-strong); text-decoration: underline; }
.crumb span[aria-current] { color: var(--text); }

/* ---- Typography ---- */
h1, h2, h3, h4 {
  font-family: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  line-height: 1.14;
  color: var(--text);
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2rem, 5.2vw, 3.1rem); margin: 0.6rem 0 0.4rem; }
h2 { font-size: clamp(1.45rem, 3.4vw, 2rem); margin: 2.4rem 0 0.6rem; }
h3 { font-size: 1.2rem; margin: 1.6rem 0 0.4rem; }
p { margin: 0.8rem 0; }
a { color: var(--primary-strong); font-weight: 600; }
.lead { font-size: 1.16rem; color: var(--text); }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem; font-weight: 700; color: var(--primary-strong); font-family: Inter, system-ui, sans-serif; }
ul, ol { padding-left: 1.25rem; }
li { margin: 0.35rem 0; }
main { padding: 0 0 4rem; }
section { padding-top: 0.3rem; }

/* ---- CTA ---- */
.cta {
  display: inline-block;
  margin: 0.6rem 0;
  padding: 0.85rem 1.35rem;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  box-shadow: var(--shadow);
  transition: background 0.15s ease, transform 0.15s ease;
}
.cta:hover { background: var(--primary-strong); transform: translateY(-1px); }
.cta-row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; margin: 1rem 0; }
.cta-ghost { background: transparent; color: var(--primary-strong); border: 1px solid var(--border); box-shadow: none; }
.cta-ghost:hover { background: var(--primary-soft); }

/* ---- Cards / grid ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin: 1.4rem 0; }
.card {
  display: block;
  padding: 1.15rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); }
.card h3 { margin: 0 0 0.3rem; font-size: 1.1rem; }
.card p { margin: 0; color: var(--text-muted); font-size: 0.94rem; }
.card .tag { display: inline-block; font-family: Inter, sans-serif; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--primary-strong); margin-bottom: 0.4rem; }

/* ---- Callout / feature box ---- */
.callout {
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin: 1.4rem 0;
}
.callout h3 { margin-top: 0; }

/* ---- Comparison / data tables ---- */
.table-scroll { overflow-x: auto; margin: 1.2rem 0; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 0.7rem 0.85rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--surface-2); font-weight: 700; font-family: Inter, sans-serif; }
tr:last-child td { border-bottom: none; }

/* ---- FAQ ---- */
.faq { margin: 1.4rem 0; }
.faq details {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 0.4rem 1rem;
  margin: 0.6rem 0;
}
.faq summary { cursor: pointer; font-weight: 700; padding: 0.55rem 0; list-style: none; font-family: 'Iowan Old Style', Georgia, serif; font-size: 1.05rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; float: right; color: var(--primary-strong); font-weight: 700; }
.faq details[open] summary::after { content: '\2013'; }
.faq details p { margin: 0.2rem 0 0.7rem; color: var(--text-muted); }

/* ---- Sample RC block ---- */
.sample {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.2rem 1.35rem;
  margin: 1.4rem 0;
}
.sample .passage { color: var(--text); }
.sample .q { font-weight: 700; margin-top: 1rem; }
.sample .opts { list-style: upper-alpha; }
.sample .ans { margin-top: 0.6rem; color: var(--primary-strong); font-weight: 600; font-size: 0.95rem; }

/* ---- Hero ---- */
.hero { padding: 2.2rem 0 0.6rem; }
.meta-line { color: var(--text-soft); font-size: 0.85rem; font-family: Inter, sans-serif; margin: 0.3rem 0 0; }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--page-bg-tint);
  margin-top: 3rem;
  padding: 2.4rem 0;
  font-size: 0.9rem;
}
.foot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1.5rem; }
.foot-grid h4 { font-family: Inter, sans-serif; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-soft); margin: 0 0 0.6rem; }
.foot-grid a { display: block; color: var(--text-muted); text-decoration: none; font-weight: 500; margin: 0.35rem 0; }
.foot-grid a:hover { color: var(--primary-strong); }
.foot-legal { color: var(--text-soft); margin-top: 1.8rem; font-size: 0.82rem; }

/* ---- Theme toggle ---- */
.theme-toggle {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 30;
  display: grid; width: 2.5rem; height: 2.5rem; place-items: center;
  cursor: pointer; border-radius: 12px; border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--text); box-shadow: var(--shadow); backdrop-filter: blur(12px);
}
.theme-toggle span { grid-area: 1 / 1; font-size: 0.95rem; font-weight: 700; transition: opacity 0.18s ease, transform 0.18s ease; }
html[data-theme='dark'] .tt-light, html:not([data-theme='dark']) .tt-dark { opacity: 0; transform: scale(0.75); }
html[data-theme='dark'] .tt-dark, html:not([data-theme='dark']) .tt-light { opacity: 1; transform: scale(1); }

@media (max-width: 560px) {
  .nav-links .nav-hide { display: none; }
}

/* ─────────────────────────────────────────────────────────────────────────
   Public practice set (rc-sets.mjs renders the markup, rc-set.js drives it)

   The explanations are in the HTML so they can be indexed, and blurred until
   the visitor signs in. That is only legitimate alongside the paywall
   structured data the renderer emits - see rc-sets.mjs.
   ───────────────────────────────────────────────────────────────────────── */
:root {
  --rc-correct: #2f7d54; --rc-correct-soft: rgba(47, 125, 84, 0.12);
  --rc-wrong: #c0512f;   --rc-wrong-soft: rgba(192, 81, 47, 0.12);
}
html[data-theme='dark'] {
  --rc-correct: #73c996; --rc-correct-soft: rgba(115, 201, 150, 0.14);
  --rc-wrong: #f08b6d;   --rc-wrong-soft: rgba(240, 139, 109, 0.14);
}

.rc-set { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); padding: 1.3rem 1.4rem 1.5rem; margin: 2rem 0; }
.rc-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.7rem; }
.rc-head h2 { margin: 0; flex: 1 1 14rem; font-size: 1.25rem; }
.rc-chip { font-size: 0.72rem; font-weight: 600; padding: 0.2rem 0.55rem; border-radius: 999px; background: var(--primary-soft); color: var(--primary-strong); white-space: nowrap; }
.rc-intro p { color: var(--text-muted); margin: 0 0 1rem; }
.rc-note { border: 1px solid var(--primary); background: var(--primary-soft); border-radius: var(--radius); padding: 0.8rem 1rem; margin: 0 0 1.1rem; font-size: 0.92rem; }

.rc-passage { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; line-height: 1.75; }
.rc-passage p { margin: 0 0 0.85rem; }
.rc-passage p:last-child { margin-bottom: 0; }

.rc-q { border-top: 1px solid var(--border); margin-top: 1.4rem; padding-top: 1.1rem; }
.rc-qnum { font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-soft); font-weight: 600; margin: 0; }
.rc-stem { font-weight: 600; color: var(--text); margin: 0.3rem 0 0.7rem; }
.rc-opts { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.rc-opt { display: flex; gap: 0.6rem; align-items: flex-start; border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 0.62rem 0.8rem; cursor: pointer; transition: border-color 0.12s ease, background 0.12s ease; }
.rc-opt:hover { border-color: var(--primary); }
.rc-lab { font-weight: 700; color: var(--text-soft); min-width: 1rem; }
.rc-otext { flex: 1; }
.rc-opt.is-picked { border-color: var(--primary); background: var(--primary-soft); }
.rc-opt.is-picked .rc-lab { color: var(--primary-strong); }
.rc-opt.is-correct { border-color: var(--rc-correct); background: var(--rc-correct-soft); }
.rc-opt.is-correct .rc-lab { color: var(--rc-correct); }
.rc-opt.is-wrong { border-color: var(--rc-wrong); background: var(--rc-wrong-soft); }
.rc-opt.is-wrong .rc-lab { color: var(--rc-wrong); }
.rc-verdict { font-size: 0.74rem; font-weight: 700; white-space: nowrap; align-self: center; }
.rc-opt.is-correct .rc-verdict { color: var(--rc-correct); }
.rc-opt.is-wrong .rc-verdict { color: var(--rc-wrong); }
/* Pointer feedback stops once the set is scored - the options are a result now. */
.rc-set.is-submitted .rc-opt { cursor: default; }
.rc-set.is-submitted .rc-opt:hover { border-color: var(--border); }
.rc-set.is-submitted .rc-opt.is-correct:hover { border-color: var(--rc-correct); }
.rc-set.is-submitted .rc-opt.is-wrong:hover { border-color: var(--rc-wrong); }

/* Gated: present for crawlers and search, unreadable until sign-in. */
.rc-expls { margin-top: 0.7rem; position: relative; }
.rc-expl { font-size: 0.9rem; color: var(--text-muted); border-left: 3px solid var(--border); padding: 0.15rem 0 0.15rem 0.8rem; margin: 0 0 0.4rem; filter: blur(4.5px); opacity: 0.55; user-select: none; }
.rc-expl b { color: var(--text); }

.rc-actions { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; margin-top: 1.4rem; }
.rc-btn { border: none; border-radius: 999px; background: var(--primary); color: #fff; font: inherit; font-weight: 600; padding: 0.65rem 1.3rem; cursor: pointer; }
.rc-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.rc-progress { font-size: 0.85rem; color: var(--text-soft); }

.rc-score { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); padding: 1rem 1.15rem; margin-top: 1.3rem; }
.rc-score-big { font-family: Fraunces, Georgia, serif; font-size: 2.1rem; font-weight: 700; line-height: 1; color: var(--text); }
.rc-score-big small { font-size: 1.05rem; color: var(--text-soft); font-weight: 400; }
.rc-score-meta { flex: 1 1 12rem; font-size: 0.86rem; color: var(--text-muted); }

.rc-gate { border: 1px solid var(--primary); background: var(--surface); border-radius: var(--radius); padding: 1.15rem 1.25rem; margin-top: 1rem; box-shadow: var(--shadow); }
.rc-gate h3 { margin: 0 0 0.35rem; }
.rc-gate p { margin: 0 0 0.85rem; color: var(--text-muted); font-size: 0.93rem; }
.rc-gbtn { display: inline-flex; align-items: center; gap: 0.55rem; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 0.58rem 1.1rem; font-weight: 600; text-decoration: none; }
.rc-gbtn:hover { border-color: var(--primary); }
.rc-g { width: 1.05rem; height: 1.05rem; border-radius: 50%; background: conic-gradient(#ea4335 0 25%, #fbbc05 0 50%, #34a853 0 75%, #4285f4 0); }
.rc-fine { margin: 0.55rem 0 0 !important; font-size: 0.78rem; color: var(--text-soft); }
.rc-why { list-style: none; margin: 0.8rem 0 0; padding: 0; display: grid; gap: 0.35rem; font-size: 0.87rem; color: var(--text-muted); }
.rc-why li { padding-left: 1.2rem; position: relative; }
.rc-why li::before { content: '✓'; position: absolute; left: 0; color: var(--rc-correct); font-weight: 700; }

.rc-others { margin-top: 1.1rem; border-top: 1px solid var(--border); padding-top: 0.9rem; }
.rc-others-h { font-size: 0.72rem !important; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-soft); font-weight: 600; margin: 0 0 0.5rem !important; }
.rc-other { display: flex; justify-content: space-between; gap: 0.8rem; align-items: center; border: 1px solid var(--border); background: var(--page-bg-tint); border-radius: 12px; padding: 0.5rem 0.75rem; margin-bottom: 0.35rem; font-size: 0.89rem; text-decoration: none; color: var(--text); }
.rc-other:hover { border-color: var(--primary); }
.rc-other span { font-size: 0.75rem; color: var(--text-soft); }

@media (max-width: 560px) {
  .rc-set { padding: 1rem 0.9rem 1.2rem; }
  .rc-passage { padding: 0.9rem 1rem; }
  .rc-verdict { align-self: flex-start; }
}

/* ---- CAT previous-year-question pages (scripts/pyq-pages.mjs) ---- */
.table-scroll th[scope='row'] { white-space: nowrap; }
.table-scroll thead th { white-space: nowrap; }
.pyq-jump { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 0; }
.pyq-chip { display: inline-block; padding: 0.35rem 0.85rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font-family: Inter, sans-serif; font-size: 0.85rem; font-weight: 600; text-decoration: none; }
.pyq-chip:hover { border-color: var(--primary); color: var(--primary-strong); }

.pyq-year { scroll-margin-top: 1rem; }
.pyq-slot { margin: 1rem 0 1.4rem; scroll-margin-top: 1rem; }
.pyq-slot h3 { margin: 0 0 0.5rem; font-size: 1.05rem; color: var(--text-muted); }
.pyq-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.pyq-list li { margin: 0; }
.pyq-list a { display: grid; grid-template-columns: auto 1fr; column-gap: 0.7rem; align-items: baseline; height: 100%; padding: 0.75rem 0.9rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; transition: border-color 0.15s ease, transform 0.15s ease; }
.pyq-list a:hover { border-color: var(--primary); transform: translateY(-1px); }
.pyq-item-n { grid-row: span 2; font-family: Inter, sans-serif; font-weight: 700; font-size: 0.85rem; color: var(--primary-strong); background: var(--primary-soft); border-radius: 999px; width: 1.6rem; height: 1.6rem; display: inline-flex; align-items: center; justify-content: center; }
.pyq-item-t { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.pyq-item-m { color: var(--text-soft); font-family: Inter, sans-serif; font-size: 0.78rem; }

.pyq-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.6rem; margin: 0.8rem 0; }
.pyq-facts div { padding: 0.7rem 0.85rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.pyq-facts dt { font-family: Inter, sans-serif; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-soft); }
.pyq-facts dd { margin: 0.15rem 0 0; font-weight: 600; overflow-wrap: anywhere; }
.pyq-origin { color: var(--text-muted); font-size: 0.93rem; overflow-wrap: anywhere; }
.pyq-stems { padding-left: 1.4rem; }
.pyq-stems li { margin: 0.7rem 0; }
.pyq-note { color: var(--text-soft); font-size: 0.85rem; }

/* Locked preview: skeleton bars behind an overlay card. No real text in the bars. */
.pyq-lock { position: relative; margin: 1.8rem 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.pyq-lock-bars { display: grid; align-content: start; gap: 0.75rem; padding: 1.4rem 1.3rem; filter: blur(3px); opacity: 0.55; padding-bottom: 3.4rem; }
.pyq-bar { display: block; height: 0.7rem; border-radius: 999px; background: var(--border); width: 100%; }
.pyq-bar:nth-child(3n+2) { width: 94%; }
.pyq-bar:nth-child(4n+3) { width: 86%; }
.pyq-bar:nth-child(5n) { width: 72%; }
.pyq-bar:nth-child(9) { width: 48%; }
.pyq-lock-card { position: relative; z-index: 1; width: min(34rem, calc(100% - 2rem)); margin: -2.4rem auto 1.3rem; padding: 1.25rem 1.3rem; border: 1px solid var(--primary); border-radius: var(--radius); background: var(--page-bg); box-shadow: var(--shadow); text-align: center; }
.pyq-lock-card h2 { margin: 0.2rem 0 0.5rem; font-size: 1.25rem; }
.pyq-lock-card p { margin: 0 0 0.6rem; color: var(--text-muted); font-size: 0.95rem; }
.pyq-lock-card .cta-row { justify-content: center; margin: 0.6rem 0 0.4rem; }
.pyq-lock-icon { font-size: 1.4rem; }
.pyq-lock-card .pyq-lock-sub { margin: 0; font-size: 0.88rem; }

.pyq-sibs { margin: 0.5rem 0; }
.pyq-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin: 1.8rem 0 0.4rem; }
.pyq-nav-link { display: grid; gap: 0.15rem; padding: 0.8rem 0.95rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; min-width: 0; }
.pyq-nav-link:nth-child(2) { text-align: right; }
.pyq-nav-link:hover { border-color: var(--primary); }
.pyq-nav-link.is-empty { border: none; background: none; }
.pyq-nav-dir { font-family: Inter, sans-serif; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-soft); }
.pyq-nav-t { font-weight: 600; font-size: 0.93rem; overflow-wrap: anywhere; }
.pyq-related { color: var(--text-muted); font-size: 0.93rem; }
@media (max-width: 560px) {
  .pyq-nav { grid-template-columns: 1fr; }
  .pyq-nav-link:nth-child(2) { text-align: left; }
  .pyq-nav-link.is-empty { display: none; }
}

/* ---- RC trap guide (blog/how-to-solve-cat-rc-like-a-99-percentiler) ----
   One colour per trap family; the stripe and tag of each .trap carry it. */
:root {
  --fam-scope: #b8860b;
  --fam-wording: var(--primary-strong);
  --fam-logic: #2f8a5f;
  --fam-voice: #2f6fa8;
  --fam-qtype: #8a6a45;
  --ok: #2f8a5f;
}
html[data-theme='dark'] {
  --fam-scope: #f2c55c;
  --fam-wording: var(--primary);
  --fam-logic: #86c9a4;
  --fam-voice: #8dbbe3;
  --fam-qtype: #e2cfb3;
  --ok: #86c9a4;
}
.fam-scope { --fam: var(--fam-scope); }
.fam-wording { --fam: var(--fam-wording); }
.fam-logic { --fam: var(--fam-logic); }
.fam-voice { --fam: var(--fam-voice); }
.fam-qtype { --fam: var(--fam-qtype); }

.fam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.75rem; margin: 1.2rem 0; }
.fam-card { display: block; text-decoration: none; color: var(--text); border: 1px solid var(--border); border-left: 3px solid var(--fam); border-radius: 12px; background: var(--surface); padding: 0.8rem 1rem; }
.fam-card strong { display: block; color: var(--fam); font-family: Inter, sans-serif; }
.fam-card span { color: var(--text-muted); font-size: 0.94rem; }

.passage-box { border: 1px solid var(--border); border-left: 3px solid var(--primary); border-radius: var(--radius); background: var(--surface-2); padding: 1.1rem 1.3rem; margin: 1.3rem 0; font-family: 'Iowan Old Style', 'Palatino Linotype', Georgia, serif; font-size: 1.08rem; line-height: 1.7; }

.trap { border: 1px solid var(--border); border-left: 3px solid var(--fam); border-radius: var(--radius); background: var(--surface); padding: 1.1rem 1.25rem; margin: 1.1rem 0; }
.trap, [id^="family-"], #cheat-sheet { scroll-margin-top: 5rem; }
.trap-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.trap-head h3 { margin: 0; font-size: 1.35rem; }
.trap-num { color: var(--fam); margin-right: 0.4rem; }
.trap-tag { font-family: Inter, sans-serif; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--fam); border: 1px solid var(--fam); border-radius: 999px; padding: 0.15rem 0.6rem; white-space: nowrap; }
.trap-what { margin: 0.5rem 0 0.4rem; }
.trap-spot { font-family: Inter, sans-serif; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--fam); margin: 0.8rem 0 0.2rem; }
.trap ul { margin: 0.2rem 0 0; color: var(--text-muted); }
.trap-ex { border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); padding: 0.85rem 1rem; margin-top: 0.9rem; font-size: 0.96rem; }
.trap-ex p { margin: 0.25rem 0; color: var(--text-muted); }
.trap-ex .trap-opt { color: var(--text); font-family: 'Iowan Old Style', Georgia, serif; font-size: 1.08rem; font-weight: 700; }
.trap-ex .trap-opt::before { content: 'Trap option'; display: block; font-family: Inter, sans-serif; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--primary-strong); }
.trap-ex b { color: var(--text); }
.trap-ex .trap-right, .trap-ex .trap-right b { color: var(--ok); }

.cheat td:first-child { font-weight: 700; color: var(--fam); }
@media (min-width: 560px) { .cheat td:first-child { white-space: nowrap; } }
.cheat td:first-child a { color: inherit; text-decoration: none; }
.cheat td:first-child a:hover { text-decoration: underline; }

.steps { list-style: none; padding: 0; counter-reset: step; margin: 1.2rem 0; }
.steps li { counter-increment: step; position: relative; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 0.8rem 1rem 0.8rem 3.4rem; margin: 0.6rem 0; color: var(--text-muted); }
.steps li::before { content: counter(step); position: absolute; left: 0.9rem; top: 0.8rem; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--primary-soft); color: var(--primary-strong); font-weight: 800; display: grid; place-items: center; font-family: 'Iowan Old Style', Georgia, serif; }
.steps li strong { display: block; color: var(--text); }
