/* Public economy guide — <public host>/guide, and the same guide under a
   server event (events.<apex>/<event>/guide). Served as-is by
   dashboard/routes/guide.js (CSP: style-src 'self', no inline styles, no
   external fonts).

   The frame (fonts, colour and type tokens, top bar, section tab bar,
   footer, buttons) is the website's: /site/static/base.css loads first.
   This file is the reading page only, built the way the legal pages are:
   a reading column on hairlines, 2px ink rules over tables and lists,
   and on wide screens the page's contents float into the margin beside
   the text. Ended events serve a saved copy of their guide, so every
   class here stays stable. */

:root {
    --code-bg: var(--s2);
    --measure: 740px;
    --wide: 1000px;
}

/* ---- the page column (left-aligned with the brand, like the legal pages) ---- */
.g-main { padding-top: 40px; padding-bottom: 80px; }
.g-body { max-width: var(--measure); line-height: 1.65; }
.g-body.wide { max-width: var(--wide); }
@media (max-width: 640px) { .g-main { padding-top: 24px; padding-bottom: 48px; } }

/* Under an event: the guide's own sections, as links at the top of the page. */
.g-sections { display: flex; gap: 4px 18px; overflow-x: auto; scrollbar-width: none; margin: 0 0 26px; padding-bottom: 2px; border-bottom: 1px solid var(--rule); -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); }
.g-sections::-webkit-scrollbar { display: none; }
/* Wide screens: the row wraps rather than scrolls, so nothing sits under a
   fade (the last tab, "Changelog", was always faded although it fitted). */
@media (min-width: 820px) { .g-sections { flex-wrap: wrap; overflow: visible; -webkit-mask-image: none; mask-image: none; } }
.g-sections a { flex: none; padding: 6px 0 9px; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--text-2); text-decoration: none; font-size: 14px; font-weight: 500; white-space: nowrap; }
.g-sections a:hover { color: var(--text); }
.g-sections a[aria-current="page"] { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }
.g-event-kicker { display: block; font: 600 11px/1 var(--font); letter-spacing: .02em; color: var(--accent-text); margin-bottom: 3px; }
.subnav-label:has(.g-event-kicker) { flex-direction: column; align-items: flex-start; gap: 0; }

/* About these pages: where the numbers come from, and credits. */
.g-note { margin-top: 64px; padding-top: 16px; border-top: 2px solid var(--ink); color: var(--text-3); font-size: 14px; line-height: 1.55; }
.g-note p { margin: 0 0 6px; max-width: 64ch; }
.g-note a { color: inherit; }

/* ---- type ---- */
:where(.g-body) h1 { font-size: var(--fs-2xl); line-height: 1.04; margin: 6px 0 14px; }
:where(.g-body) h2 { font-size: var(--fs-lg); line-height: 1.2; margin: 52px 0 12px; padding-top: 18px; border-top: 1px solid var(--rule); }
:where(.g-body) h3 { font-size: var(--fs-md); margin: 28px 0 8px; }
:where(.g-body) p { margin: 0 0 14px; }
:where(.g-body) ul, :where(.g-body) ol { padding-left: 22px; margin: 0 0 16px; }
:where(.g-body) li { margin: 5px 0; }
:where(.g-body) li::marker { color: var(--text-3); }
.lede { font-size: var(--fs-md); color: var(--text-2); line-height: 1.55; }
.muted { color: var(--text-3); }
.eyebrow { font-size: 14px; margin: 0; }
.eyebrow a { color: var(--text-3); text-decoration: none; }
.eyebrow a:hover { color: var(--accent-text); text-decoration: underline; }
.note { background: var(--s1); border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px 16px; color: var(--text-2); }
code {
    font-family: var(--mono);
    font-size: 0.86em;
    background: var(--code-bg);
    border: 1px solid var(--border);
    padding: 1px 5px;
    border-radius: 5px;
}
a code { white-space: nowrap; }
h1 code { font-size: 0.85em; padding: 2px 8px; background: transparent; border: 0; padding-left: 0; }

.g-body .crumbs { padding-top: 0; margin: 0 0 12px; }

/* ---- start page ---- */
.hero h1 { font-size: var(--fs-2xl); line-height: 1.02; }
.quick { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 24px; margin: 32px 0 12px; border-top: 2px solid var(--ink); }
.quick li { margin: 0; border-bottom: 1px solid var(--rule); }
.quick a { display: block; height: 100%; padding: 14px 0 16px; text-decoration: none; color: var(--text); }
.quick strong { display: block; color: var(--text); font: 700 18px/1.25 var(--display); font-stretch: 92%; letter-spacing: -0.01em; }
.quick a:hover strong { color: var(--accent-text); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.quick span { display: block; font-size: 14.5px; color: var(--text-2); line-height: 1.45; margin-top: 4px; }
.steps li { margin: 8px 0; }
.groups { list-style: none; padding: 0; border-top: 2px solid var(--ink); }
.groups li { padding: 12px 0; margin: 0; border-bottom: 1px solid var(--rule); }
.groups a { font-weight: 600; margin-right: 8px; }
.groups span { color: var(--text-2); }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; margin: 4px 0 20px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule); }
table { border-collapse: collapse; width: 100%; font-size: 15px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
th:first-child, td:first-child { padding-left: 0; }
th { font-weight: 600; color: var(--text-3); font-size: 13px; border-bottom-color: var(--border-strong); }
td { color: var(--text-2); }
tbody tr:hover td { background: var(--s1); }
tr:last-child td { border-bottom: 0; }

/* ---- at a glance ---- */
.glance { margin: 0; border-top: 2px solid var(--ink); }
.glance div { display: grid; grid-template-columns: 190px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.glance dt { color: var(--text-3); font-size: 15px; }
.glance dd { margin: 0; }

/* ---- examples ---- */
.example { margin: 0 0 14px; }
.example .cmd { display: inline-block; font-size: 15px; padding: 6px 10px; background: var(--code-bg); border-radius: 8px; word-break: break-word; }
.example p { margin: 4px 0 0; color: var(--text-2); font-size: 16px; }
.related { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.related li { margin: 0; }

/* ---- filters + lists ---- */
.filter { margin: 24px 0 8px; }
.filter label { display: block; font-size: 14px; color: var(--text-2); font-weight: 600; margin-bottom: 6px; }
.filter input {
    width: 100%; font: inherit; color: var(--text); background: var(--field);
    border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 11px 14px;
}
.filter input::placeholder { color: var(--text-3); opacity: 1; }
.filter input:focus { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--border-strong); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.chips button {
    font: inherit; font-size: 14px; color: var(--text-2); background: transparent;
    border: 1px solid var(--border-strong); border-radius: 8px; padding: 4px 12px; cursor: pointer;
}
.chips button:hover { color: var(--text); }
.chips button[aria-pressed="true"] { color: var(--text); border-color: var(--accent-border); background: var(--accent-dim); font-weight: 600; }
.empty { color: var(--text-3); }

.group h2 { margin-top: 40px; }
.group > p { margin-top: -4px; color: var(--text-2); }
.cmd-list { list-style: none; padding: 0; margin: 0; border-top: 2px solid var(--ink); }
.cmd-row { display: grid; grid-template-columns: 210px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--rule); margin: 0; }
.cmd-row a { text-decoration: none; }
.cmd-row a:hover code { border-color: var(--accent-border); }
.cmd-row span { color: var(--text-2); }

.item-list { list-style: none; padding: 0; margin: 12px 0 0; border-top: 2px solid var(--ink); }
.item-row { margin: 0; border-bottom: 1px solid var(--rule); }
.item-row a { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; padding: 10px 6px; color: var(--text); text-decoration: none; border-radius: 8px; }
.item-row a:hover { background: var(--s1); }
.item-row a:hover strong { color: var(--accent-text); }
.item-emo { font-size: 22px; text-align: center; line-height: 1; }
.item-main strong { display: block; }
.item-main .muted { font-size: 14px; }
.item-price { display: flex; flex-direction: column; align-items: flex-end; font-size: 14px; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.item-price b { color: var(--text); font-weight: 600; }
.emo { display: inline-block; vertical-align: -3px; }
img.emo { width: 22px; height: 22px; }
.item-emo img.emo { width: 32px; height: 32px; vertical-align: middle; }
.item-title { display: flex; align-items: center; gap: 14px; }
.item-title .emo.big, .item-title img.emo { width: 48px; height: 48px; font-size: 36px; line-height: 48px; }
/* The item's own art, large, on its page (the PNGs are 128 px). */
.item-title img.item-hero { width: 96px; height: 96px; flex: none; }

/* ---- long pages: contents, FAQ, glossary ---- */
.toc { margin: 22px 0 10px; padding: 14px 0 0; border-top: 2px solid var(--ink); }
.toc-title { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 0 0 8px; }
.toc ul { margin: 0; padding-left: 18px; columns: 2; column-gap: 24px; }
.toc li { margin: 4px 0; break-inside: avoid; font-size: 15px; }
.toc a { color: var(--text-2); text-decoration: none; }
.toc a:hover { color: var(--accent-text); text-decoration: underline; }
/* Wide screens: the contents sit in the margin beside the text (a float
   pulled fully outside the column, so the text never wraps around it). */
@media (min-width: 1200px) {
    .g-body:not(.wide) > .toc { float: right; clear: right; width: 250px; margin: 6px -330px 24px 0; }
    .g-body:not(.wide) > .toc ul { columns: 1; padding-left: 16px; }
    .g-body:not(.wide) > .toc li { font-size: 14.5px; margin: 7px 0; line-height: 1.4; }
}
.qa { padding: 18px 0 4px; border-top: 1px solid var(--rule); }
.qa .q { font-weight: 600; font-size: 18px; margin: 0 0 6px; }
.qa .q a { color: var(--text); text-decoration: none; }
.qa .q a:hover { color: var(--accent-text); }
.qa:target .q a { color: var(--accent-text); }
.terms { margin: 16px 0 0; border-top: 2px solid var(--ink); }
.terms > div { display: grid; grid-template-columns: 170px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.terms dt { font-weight: 600; }
.terms dd { margin: 0; color: var(--text-2); }
.terms > div:target dt { color: var(--accent-text); }
.guide-links { margin-top: 28px; font-size: 15px; }
.pager { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 32px; padding-top: 14px; border-top: 1px solid var(--rule); font-size: 15px; }
.pager .sep { color: var(--text-3); }

/* ---- phones ---- */
@media (max-width: 640px) {
    body { font-size: 16px; }
    :where(.g-body) h2 { font-size: 21px; }
    .lede { font-size: 17px; }
    .quick { grid-template-columns: 1fr; }
    .glance div { grid-template-columns: 1fr; gap: 0; }
    .cmd-row { grid-template-columns: 1fr; gap: 2px; }
    .item-row a { grid-template-columns: 30px 1fr auto; gap: 10px; }
    .toc ul { columns: 1; }
    .terms > div { grid-template-columns: 1fr; gap: 2px; }
    th, td { padding: 8px 9px; }
}
@media (min-width: 641px) and (max-width: 900px) { .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- server event: the bar under the tabs and the big countdown ---- */
.event-bar { background: var(--accent-dim); border-bottom: 1px solid var(--rule); font-size: 15px; }
.event-bar-in { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding-top: 10px; padding-bottom: 10px; }
.event-bar-name { font-weight: 700; color: var(--text); font-family: var(--display); }
.event-bar-time { color: var(--text-2); }
.event-bar-time time { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text); }
.event-bar-link { margin-left: auto; font-weight: 600; }
@media (max-width: 640px) { .event-bar-link { margin-left: 0; } }
.event-bar-ended { background: var(--s1); }

.cd { margin: 22px 0 10px; padding: 20px 22px; background: var(--s1); border: 1px solid var(--rule); border-radius: var(--radius-lg); }
.cd-title { margin: 0 0 14px; font-weight: 600; font-size: 15px; color: var(--text-2); }
.cd-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cd-cell { display: flex; flex-direction: column; padding: 0 0 0 16px; border-left: 1px solid var(--rule); }
.cd-cell:first-child { padding-left: 0; border-left: 0; }
.cd-num { font: 600 clamp(1.75rem, 5vw, 2.6rem)/1 var(--display); font-stretch: 88%; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.cd-label { margin-top: 6px; font-size: 13px; color: var(--text-3); }
.cd-end { margin: 14px 0 0; font-size: 0.88rem; color: var(--text-2); }
