/* ------------------------------------------------------------------
   Pay.UK Digital Rulebook design system (Claude Design, Sep 2026)
   Tokens below are taken from that system. Change them here.
------------------------------------------------------------------ */
@font-face { font-family: "Source Sans 3"; src: url("fonts/source-sans-3-latin-var.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;
  --brand-green: #00cc88;
  --brand-black: #000000;
  --green-50: #e6faf3;  --green-100: #c2f3e1; --green-200: #8fe8c8;
  --green-600: #00b87a; --green-700: #007f55; --green-800: #006644;
  --neutral-50: #f6f8f7; --neutral-100: #eef1ef; --neutral-200: #e0e5e2; --neutral-300: #c9d0cc;
  --neutral-400: #a3ada7; --neutral-500: #6b756f; --neutral-600: #5e6863; --neutral-700: #4b5550;
  --amber-600: #b54708; --amber-50: #fff6ed;

  --surface-page: var(--neutral-50);
  --surface-card: #ffffff;
  --surface-sunken: var(--neutral-100);
  --surface-hover: rgba(13, 18, 16, 0.05);
  --surface-selected: var(--green-50);
  --text-primary: #000000;
  --text-secondary: var(--neutral-600);
  --text-tertiary: var(--neutral-500);
  --text-brand: var(--green-700);
  --border-subtle: var(--neutral-200);
  --border-default: var(--neutral-300);
  --border-strong: var(--neutral-500);
  --border-focus: var(--green-700);

  --font: "Source Sans 3", "Source Sans Pro", Arial, "Helvetica Neue", sans-serif;
  --radius-sm: 4px; --radius-md: 6px; --radius-lg: 10px;
  --shadow-md: 0 4px 12px rgba(13, 18, 16, 0.10), 0 1px 3px rgba(13, 18, 16, 0.06);
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--text-primary); background: var(--surface-page); font-size: 16px; line-height: 24px; -webkit-font-smoothing: antialiased; font-feature-settings: "lnum" 1, "tnum" 1; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--text-primary); text-decoration: underline; text-underline-offset: 3px; transition: color 80ms var(--ease); }
a:hover { color: var(--text-brand); }
:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
h1, h2, h3 { margin: 0; }
p { margin: 0 0 12px; }
ul { margin: 4px 0 14px 20px; padding: 0; }
li { margin: 4px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.overline { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-secondary); }

/* ---------- Lockup ---------- */
.wordmark { display: inline-flex; align-items: center; gap: 12px; color: var(--text-primary); text-decoration: none; }
.wordmark:hover { color: var(--text-primary); }
.wordmark .logo { height: 26px; width: auto; display: block; }
.wordmark .wm-div { width: 1px; height: 28px; background: var(--border-subtle); }
.wordmark .wm-text { display: flex; flex-direction: column; font-size: 12px; line-height: 14px; color: var(--text-secondary); white-space: nowrap; }
.wordmark.lg .logo { height: 34px; }
.wordmark.lg .wm-text { font-size: 13px; line-height: 16px; }

/* ---------- Illustrative banner ---------- */
.demo-strip { background: var(--amber-50); color: var(--amber-600); font-size: 13px; line-height: 18px; padding: 6px 20px; text-align: center; border-bottom: 1px solid #f5dcc4; font-weight: 600; }

/* ---------- Buttons and inputs ---------- */
.btn { height: 40px; border: 1px solid transparent; border-radius: var(--radius-md); padding: 0 16px; font-weight: 600; font-size: 16px; cursor: pointer; background: var(--brand-green); color: #000; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: background-color 80ms var(--ease); }
.btn:hover { background: var(--green-600); }
.btn:active { background: #00ad74; }
.btn[disabled] { background: var(--neutral-100); color: var(--neutral-400); cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.lg { height: 48px; }
.btn.secondary { background: #fff; border-color: var(--border-default); }
.btn.secondary:hover { background: var(--neutral-50); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--text-primary); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.linkbtn:hover { color: var(--text-brand); }
.field-label { display: block; font-size: 14px; line-height: 20px; font-weight: 600; margin: 16px 0 6px; }
.input { width: 100%; height: 40px; border: 1px solid var(--border-default); border-radius: var(--radius-md); padding: 0 12px; background: #fff; }
.input:hover { border-color: var(--border-strong); }
.input:focus { border-color: var(--border-focus); outline: none; box-shadow: 0 0 0 3px rgba(0,127,85,.25); }
.error { color: #b42318; font-size: 14px; margin-top: 8px; }

/* ---------- Passcode ---------- */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #000; position: relative; overflow: hidden; }
.gate .ring { position: absolute; right: -140px; top: -160px; width: 520px; height: 520px; }
.gate-card { position: relative; background: #fff; width: 100%; max-width: 400px; border-radius: var(--radius-lg); padding: 32px; }
.gate-card .wordmark { margin-bottom: 28px; }
.gate-card h1 { font-size: 28px; line-height: 36px; font-weight: 300; margin-bottom: 4px; }
.gate-card p { color: var(--text-secondary); font-size: 14px; line-height: 20px; }

/* ---------- Entry ---------- */
.entry { min-height: calc(100vh - 31px); display: grid; grid-template-columns: minmax(420px, 1fr) 1fr; align-items: start; }
.entry-main { padding: 48px 64px 40px; background: var(--surface-page); display: flex; flex-direction: column; }
.entry-main .inner { max-width: 440px; width: 100%; margin: 0 auto; }
.entry-main h1 { font-size: 36px; line-height: 44px; font-weight: 300; margin: 40px 0 4px; }
.entry-main h2 { font-size: 18px; line-height: 28px; font-weight: 600; }
.entry-main .hint { color: var(--text-secondary); font-size: 14px; line-height: 20px; margin: 2px 0 0; }
.role-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.role-btn { width: 100%; text-align: left; background: #fff; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 12px 14px 12px 16px; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 0 12px; align-items: center; position: relative; transition: border-color 80ms var(--ease), background-color 80ms var(--ease); }
.role-btn:hover { border-color: var(--border-default); background: var(--neutral-50); }
.role-btn[aria-pressed="true"] { border-color: var(--green-700); background: var(--surface-selected); }
.role-btn[aria-pressed="true"]::before { content: ""; position: absolute; left: -1px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 2px 2px 0; background: var(--brand-green); }
.role-btn .rn { font-weight: 600; }
.role-btn .rd { grid-column: 1; color: var(--text-secondary); font-size: 14px; line-height: 20px; }
.role-btn .chev { grid-row: 1 / span 2; grid-column: 2; color: var(--text-tertiary); }
.step { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--border-subtle); }
.entry-foot { margin-top: auto; padding-top: 32px; font-size: 13px; color: var(--text-secondary); display: flex; gap: 20px; flex-wrap: wrap; max-width: 440px; width: 100%; margin-left: auto; margin-right: auto; }
.entry-foot a { color: var(--text-secondary); }

.entry-hero { background: #000; color: #fff; position: sticky; top: 0; height: 100vh; overflow: hidden; padding: 48px 64px; display: flex; flex-direction: column; justify-content: flex-end; }
.entry-hero .ring { position: absolute; right: -120px; top: -150px; width: 560px; height: 560px; }
.entry-hero h2 { font-size: 44px; line-height: 52px; font-weight: 300; letter-spacing: -.01em; max-width: 16ch; position: relative; }
.entry-hero .lede { color: var(--neutral-400); font-size: 18px; line-height: 28px; max-width: 44ch; margin-top: 16px; position: relative; }
.feature-list { list-style: none; margin: 28px 0 0; padding: 0; max-width: 520px; position: relative; border-top: 1px solid #2b322e; }
.feature-list li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid #2b322e; margin: 0; }
.feature-list svg { color: var(--brand-green); margin-top: 3px; }
.feature-list b { display: block; font-weight: 600; }
.feature-list span { color: var(--neutral-400); font-size: 14px; line-height: 20px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; line-height: 16px; font-weight: 600; padding: 2px 8px; border-radius: 9999px; background: var(--green-50); color: var(--green-800); }
.pill.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--brand-green); }
.note { background: var(--surface-sunken); border: 1px solid var(--border-subtle); color: var(--text-primary); padding: 10px 14px; border-radius: var(--radius-md); font-size: 14px; line-height: 20px; }

/* ---------- App chrome ---------- */
.topbar { background: #fff; border-bottom: 1px solid var(--border-subtle); position: sticky; top: 0; z-index: 10; }
.topbar-inner { max-width: 1280px; margin: 0 auto; padding: 0 32px; display: flex; align-items: center; gap: 32px; height: 56px; }
.nav { display: flex; gap: 4px; height: 100%; align-items: center; }
.nav a { white-space: nowrap; color: var(--text-secondary); text-decoration: none; font-weight: 400; font-size: 15px; padding: 0 12px; height: 36px; display: flex; align-items: center; border-radius: var(--radius-md); position: relative; transition: background-color 80ms var(--ease), color 80ms var(--ease); }
.nav a:hover { color: var(--text-primary); background: var(--surface-hover); }
.nav a[aria-current="page"] { color: var(--text-primary); font-weight: 600; background: var(--surface-selected); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -10px; height: 2px; background: var(--brand-green); border-radius: 2px; }
.role-switch { margin-left: auto; position: relative; }
.role-switch button { background: #fff; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); color: var(--text-primary); padding: 3px 10px 3px 12px; cursor: pointer; text-align: right; display: flex; align-items: center; gap: 10px; height: 40px; }
.role-switch button:hover { background: var(--neutral-50); }
.role-switch small { display: block; font-size: 12px; line-height: 14px; color: var(--text-tertiary); }
.role-switch b { font-size: 14px; line-height: 18px; font-weight: 600; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); min-width: 240px; padding: 6px; z-index: 20; box-shadow: var(--shadow-md); }
.menu button { border: 0; width: 100%; display: block; text-align: left; padding: 8px 10px; border-radius: var(--radius-md); background: none; height: auto; }
.menu button:hover { background: var(--surface-hover); }
.menu button[aria-checked="true"] { background: var(--surface-selected); font-weight: 600; }
.menu .menu-sep { border-top: 1px solid var(--border-subtle); margin: 6px 0; }

.page { max-width: 1280px; margin: 0 auto; padding: 32px 32px 48px; }
.page-head { margin-bottom: 24px; }
.page-head h1 { font-size: 36px; line-height: 44px; font-weight: 300; letter-spacing: -.01em; }
.page-head p { color: var(--text-secondary); margin: 4px 0 0; font-size: 18px; line-height: 28px; }
.panel { background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); }
.footer { max-width: 1280px; margin: 0 auto; padding: 20px 32px 32px; display: flex; justify-content: space-between; color: var(--text-secondary); font-size: 13px; border-top: 1px solid var(--border-subtle); flex-wrap: wrap; gap: 8px; }
.footer .powered { color: var(--text-primary); font-weight: 600; }

/* ---------- Controls ---------- */
.toolbar { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.ctl label { display: block; font-size: 14px; line-height: 20px; font-weight: 600; margin-bottom: 6px; }
.select { height: 40px; border: 1px solid var(--border-default); border-radius: var(--radius-md); padding: 0 34px 0 12px; background: #fff url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' fill='none' stroke='%235e6863' stroke-width='1.6'/></svg>") no-repeat right 12px center; appearance: none; min-width: 200px; }
.seg { display: inline-flex; background: var(--surface-sunken); border: 1px solid var(--border-subtle); border-radius: 9999px; padding: 3px; gap: 2px; }
.seg button { white-space: nowrap; border: 0; background: transparent; padding: 0 14px; height: 32px; border-radius: 9999px; cursor: pointer; font-size: 14px; color: var(--text-secondary); }
.seg button:hover { color: var(--text-primary); }
.seg button[aria-pressed="true"] { background: #000; color: #fff; font-weight: 600; }

/* ---------- Tier ladder ---------- */
.ladder { display: grid; grid-template-columns: repeat(3, 1fr) 0.8fr; gap: 12px; margin-bottom: 24px; }
.rung { padding: 16px 20px; border: 1px solid var(--border-subtle); background: #fff; border-radius: var(--radius-md); position: relative; overflow: hidden; }
.rung .rl { font-size: 14px; line-height: 20px; font-weight: 600; }
.rung .rv { font-size: 36px; line-height: 44px; font-weight: 300; margin-top: 4px; }
.rung .rs { font-size: 13px; color: var(--text-secondary); }
.rung.off { background: var(--neutral-50); }
.rung.off .rl, .rung.off .rv { color: var(--text-tertiary); }
.rung.on::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--brand-green); }
.rung.meta { background: var(--surface-sunken); border-color: transparent; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-secondary); padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); background: var(--neutral-50); white-space: nowrap; }
th:first-child { border-top-left-radius: var(--radius-lg); } th:last-child { border-top-right-radius: var(--radius-lg); }
td { padding: 14px 16px; border-bottom: 1px solid var(--border-subtle); vertical-align: top; }
tbody tr { cursor: pointer; transition: background-color 80ms var(--ease); }
tbody tr:hover td { background: var(--surface-hover); }
tbody tr:last-child td { border-bottom: 0; }
td.ref { white-space: nowrap; font-weight: 600; }
.row-link { color: inherit; text-decoration: none; }
.row-link:hover { color: var(--text-primary); text-decoration: underline; }
.table-foot { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-top: 1px solid var(--border-subtle); color: var(--text-secondary); font-size: 14px; flex-wrap: wrap; gap: 8px; }
.pager { display: flex; gap: 4px; }
.pager button { min-width: 32px; height: 32px; border: 1px solid var(--border-subtle); background: #fff; border-radius: var(--radius-md); cursor: pointer; font-size: 14px; }
.pager button:hover { background: var(--neutral-50); }
.pager button[aria-current="page"] { background: #000; border-color: #000; color: #fff; font-weight: 600; }
.pager button[disabled] { opacity: .4; cursor: default; }

/* Tier chips: neutral, not status colours */
.tier { display: inline-block; font-size: 12px; line-height: 16px; font-weight: 600; padding: 3px 8px; border-radius: var(--radius-sm); white-space: nowrap; border: 1px solid transparent; }
.tier.Primary { background: #000; color: #fff; }
.tier.Secondary { background: var(--neutral-100); color: #000; border-color: var(--neutral-200); }
.tier.Tertiary { background: #fff; color: var(--neutral-700); border-color: var(--neutral-300); }
mark { background: var(--green-100); color: inherit; padding: 0 2px; border-radius: 2px; }

/* ---------- Rule detail ---------- */
.crumbs { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; font-size: 15px; flex-wrap: wrap; gap: 8px; }
.crumbs .pn { display: flex; gap: 20px; }
.crumbs .dim { color: var(--neutral-400); }
.rule-title { margin-bottom: 20px; }
.rule-title .code { display: block; font-size: 16px; line-height: 24px; font-weight: 600; color: var(--text-brand); }
.rule-title h1 { font-size: 36px; line-height: 44px; font-weight: 300; letter-spacing: -.01em; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: #fff; margin: 0 0 16px; }
.fact { padding: 14px 20px; border-left: 1px solid var(--border-subtle); }
.fact:first-child { border-left: 0; }
.fact dt { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 6px; }
.fact dd { margin: 0; font-weight: 600; font-size: 15px; }
.systemic { background: var(--surface-selected); border: 1px solid var(--green-100); padding: 14px 20px 14px 22px; margin-bottom: 20px; border-radius: var(--radius-md); position: relative; }
.systemic::before { content: ""; position: absolute; left: -1px; top: 12px; bottom: 12px; width: 3px; border-radius: 0 2px 2px 0; background: var(--brand-green); }
.systemic b { display: block; font-size: 14px; line-height: 20px; font-weight: 600; }
.detail-grid { display: grid; grid-template-columns: 1fr 330px; gap: 20px; align-items: start; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-subtle); padding: 0 16px; }
.tabs button { white-space: nowrap; border: 0; background: none; padding: 14px 10px 12px; cursor: pointer; color: var(--text-secondary); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button:hover { color: var(--text-primary); }
.tabs button[aria-selected="true"] { color: var(--text-primary); font-weight: 600; border-bottom-color: var(--brand-green); }
.tab-body { padding: 20px 24px; max-width: 68ch; }
.meta-line { color: var(--text-secondary); font-size: 13px; padding: 12px 24px; border-top: 1px solid var(--border-subtle); display: flex; gap: 24px; flex-wrap: wrap; }

/* Family spine */
.family { padding: 20px 16px 14px; }
.family h2 { font-size: 18px; line-height: 28px; font-weight: 600; margin-bottom: 8px; }
.spine { list-style: none; margin: 0; padding: 0; position: relative; }
.spine li { margin: 0; position: relative; padding-left: calc(var(--depth) * 18px + 22px); }
.spine li.below::after { content: ""; position: absolute; left: calc(var(--depth) * 18px + 6px); top: 21px; bottom: 0; border-left: 2px solid var(--neutral-300); }
.spine .elbow { position: absolute; left: calc((var(--depth) - 1) * 18px + 6px); top: 0; height: 16px; width: 14px; border-left: 2px solid var(--neutral-300); border-bottom: 2px solid var(--neutral-300); border-bottom-left-radius: 6px; }
.spine li.sib::before { content: ""; position: absolute; left: calc((var(--depth) - 1) * 18px + 6px); top: 0; bottom: 0; border-left: 2px solid var(--neutral-300); }
.spine .node { position: absolute; z-index: 1; left: calc(var(--depth) * 18px + 1px); top: 9px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--neutral-400); }
.spine li.anc .node { border-color: #000; }
.spine li.here .node { background: var(--brand-green); border-color: var(--green-700); }
.spine button { display: block; width: 100%; text-align: left; border: 1px solid transparent; background: none; padding: 5px 8px; border-radius: var(--radius-md); cursor: pointer; margin-bottom: 4px; }
.spine button:hover { background: var(--surface-hover); }
.spine li.here button { background: var(--surface-selected); border-color: var(--green-100); cursor: default; }
.spine .fr { font-size: 13px; line-height: 18px; font-weight: 600; }
.spine .ft { font-size: 14px; line-height: 18px; display: block; }
.spine-label { margin: 10px 0 6px; }

.related { list-style: none; margin: 0; padding: 0; }
.related li { margin: 0; border-bottom: 1px solid var(--border-subtle); }
.related li:last-child { border-bottom: 0; }
.related button { width: 100%; background: none; border: 0; padding: 12px 4px; cursor: pointer; display: grid; grid-template-columns: 104px 1fr auto 16px; gap: 12px; text-align: left; align-items: center; border-radius: var(--radius-sm); }
.related button:hover { background: var(--surface-hover); }
.related button:hover .rt { text-decoration: underline; }
.related .rr { font-weight: 600; font-size: 14px; }
.related .go { color: var(--text-tertiary); }

/* ---------- Explore ---------- */
.explore-grid { display: grid; grid-template-columns: 260px 1fr; gap: 20px; align-items: start; }
.refine { padding: 20px; }
.refine h2 { font-size: 18px; line-height: 28px; font-weight: 600; margin-bottom: 12px; }
.refine fieldset { border: 0; margin: 0 0 18px; padding: 0; }
.refine legend { margin-bottom: 6px; padding: 0; }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; padding: 4px 0; cursor: pointer; }
.check input { accent-color: #000; width: 18px; height: 18px; }
.check .n { margin-left: auto; color: var(--text-tertiary); font-size: 13px; }
.search-row { display: flex; gap: 8px; flex: 1; min-width: 280px; }
.search-row .input { height: 48px; padding-left: 44px; background: #fff url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%235e6863' stroke-width='2'><circle cx='11' cy='11' r='7'/><path d='M20 20l-3.5-3.5'/></svg>") no-repeat 14px center; font-size: 16px; }
.search-row .btn { height: 48px; padding: 0 24px; }
.result-head { padding: 16px 20px; border-bottom: 1px solid var(--border-subtle); }
.result-head b { font-weight: 600; font-size: 18px; line-height: 28px; }
.result { padding: 16px 20px; border-bottom: 1px solid var(--border-subtle); display: grid; grid-template-columns: 96px 110px 1fr 190px; gap: 12px; cursor: pointer; transition: background-color 80ms var(--ease); }
.result:hover { background: var(--surface-hover); }
.result .rtitle { font-weight: 600; }
.result .snip { color: var(--text-secondary); font-size: 15px; margin-top: 2px; }
.result .rcat { color: var(--text-secondary); font-size: 14px; }
.empty { padding: 32px 20px; text-align: center; color: var(--text-secondary); }

/* ---------- Ask ---------- */
.ask-grid { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
.prompts { padding: 20px; }
.prompts h2, .answer h2 { font-size: 18px; line-height: 28px; font-weight: 600; }
.prompts .hint { color: var(--text-secondary); font-size: 14px; line-height: 20px; margin-bottom: 14px; }
.prompt { display: block; width: 100%; text-align: left; background: #fff; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 10px 14px; margin-bottom: 8px; cursor: pointer; font-size: 15px; line-height: 21px; position: relative; transition: border-color 80ms var(--ease), background-color 80ms var(--ease); }
.prompt:hover { border-color: var(--border-default); background: var(--neutral-50); }
.prompt[aria-pressed="true"] { border-color: var(--green-700); background: var(--surface-selected); }
.answer { padding: 24px 28px; min-height: 440px; border-color: var(--green-200); }
.answer .q { font-size: 28px; line-height: 36px; font-weight: 300; margin: 8px 0 16px; max-width: 32ch; }
.answer .a { max-width: 68ch; font-size: 17px; line-height: 27px; }
.basis { margin-top: 24px; border-top: 1px solid var(--border-subtle); padding-top: 16px; }
.basis .overline { margin-bottom: 4px; }
.helpful { margin-top: 20px; display: flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 14px; }
.helpful button { border: 1px solid var(--border-subtle); background: #fff; border-radius: var(--radius-md); width: 36px; height: 32px; cursor: pointer; color: var(--text-secondary); display: grid; place-items: center; }
.helpful button:hover { background: var(--neutral-50); }
.helpful button[aria-pressed="true"] { border-color: var(--green-700); color: var(--green-800); background: var(--surface-selected); }
.thinking { color: var(--text-secondary); display: flex; gap: 10px; align-items: center; }
.dots span { display: inline-block; width: 6px; height: 6px; margin: 0 2px; background: var(--brand-green); border-radius: 50%; animation: pulse 1s infinite var(--ease); }
.dots span:nth-child(2) { animation-delay: .15s; } .dots span:nth-child(3) { animation-delay: .3s; }
@keyframes pulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

/* ---------- Take it away ---------- */
.scope-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 20px 0 24px; }
.scope { text-align: left; background: #fff; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 18px; cursor: pointer; position: relative; transition: border-color 80ms var(--ease), background-color 80ms var(--ease); }
.scope:hover { border-color: var(--border-default); }
.scope[aria-pressed="true"] { border-color: var(--green-700); background: var(--surface-selected); }
.scope b { display: block; font-size: 18px; line-height: 26px; font-weight: 600; }
.scope .ss { font-size: 14px; color: var(--text-secondary); }
.scope .sd { color: var(--text-secondary); font-size: 14px; line-height: 20px; display: block; margin: 8px 0 14px; }
.scope .sc { font-size: 28px; line-height: 36px; font-weight: 300; }
.takeaway { padding: 28px 32px; max-width: 960px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #000; color: #fff; padding: 12px 18px; border-radius: var(--radius-md); font-size: 15px; z-index: 50; box-shadow: var(--shadow-md); animation: toastIn 320ms cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .entry { grid-template-columns: 1fr; }
  .entry-hero { position: relative; height: auto; min-height: 380px; }
  .entry-hero h2 { font-size: 36px; line-height: 44px; }
  .detail-grid, .explore-grid, .ask-grid { grid-template-columns: 1fr; }
  .result { grid-template-columns: 90px 1fr; }
  .result .rcat, .result .rtier-col { display: none; }
}
@media (max-width: 760px) {
  .topbar-inner { height: auto; flex-wrap: wrap; gap: 8px; padding: 10px 16px; }
  .nav { order: 3; width: 100%; overflow-x: auto; height: 44px; }
  .nav a[aria-current="page"]::after { display: none; }
  .page { padding: 24px 16px 40px; }
  .page-head h1, .rule-title h1 { font-size: 28px; line-height: 36px; }
  .ladder { grid-template-columns: 1fr 1fr; }
  .facts { grid-template-columns: 1fr 1fr; }
  .fact:nth-child(3) { border-left: 0; }
  .fact:nth-child(n+3) { border-top: 1px solid var(--border-subtle); }
  .scope-grid { grid-template-columns: 1fr; }
  .entry-main, .entry-hero { padding: 28px 20px; }
  .col-hide-sm { display: none; }
  .seg { display: flex; width: 100%; } .seg button { flex: 1; padding: 0 6px; font-size: 13px; }
  .tabs { overflow-x: auto; padding: 0 8px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
