/* Styles every site shares (engine/build.mjs puts them ahead of each site's own site.css, in one
   file). Colors and fonts come from the custom properties each site's site.css sets on :root. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.65 var(--font);
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: var(--accent-ink); text-underline-offset: 2px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
code, kbd { font-family: var(--mono); font-size: 0.88em; }
code { background: var(--surface-2); padding: 0.1em 0.35em; border-radius: 5px; }
kbd { background: var(--surface); border: 1px solid var(--line); border-bottom-width: 2px; padding: 0.05em 0.4em; border-radius: 6px; white-space: nowrap; }
pre { background: var(--surface-2); padding: 14px 16px; border-radius: 10px; overflow-x: auto; font-size: 0.9em; }
pre code { background: none; padding: 0; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 10; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.header-inner { display: flex; align-items: center; gap: 20px; min-height: 64px; flex-wrap: wrap; }
.site-nav { margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.site-nav a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: 0.95rem; white-space: nowrap; }
.site-nav a:hover, .site-nav a[aria-current="page"] { background: var(--surface-2); color: var(--ink); }
@media (max-width: 760px) {
  .header-inner { gap: 4px; padding-top: 10px; }
  .site-nav { margin: 0 -16px; padding: 0 12px 8px; width: calc(100% + 32px); }
}

/* Breadcrumbs */
.crumbs { margin: 22px 0 0; font-size: 0.88rem; color: var(--ink-3); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line); }
.crumbs a { color: var(--ink-3); }

/* Page head */
.page-head { padding: 18px 0 8px; }
.page-head h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 12px; }
.lead { font-size: 1.15rem; color: var(--ink-2); margin: 0 0 18px; }

/* Article body */
.prose h2 { font-size: 1.45rem; line-height: 1.25; margin: 2.2em 0 0.6em; letter-spacing: -0.01em; }
.prose h3 { font-size: 1.12rem; margin: 1.8em 0 0.4em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 0.3em 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: 0.95rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-weight: 650; color: var(--ink-2); background: var(--surface-2); }
.prose blockquote { margin: 1.2em 0; padding: 4px 18px; border-left: 4px solid var(--accent); color: var(--ink-2); }
.note { background: var(--surface-2); border-radius: var(--radius); padding: 14px 18px; margin: 1.4em 0; }
.note p { margin: 0.3em 0; }

/* Cards and lists */
.card-list { list-style: none; padding: 0 !important; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.card-list li { margin: 0 !important; }
.card-list a { display: block; height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: var(--ink); }
.card-list a:hover { border-color: var(--accent); }
.card-list strong { display: block; margin-bottom: 2px; }
.card-list span { color: var(--ink-2); font-size: 0.92rem; line-height: 1.45; display: block; }

/* Offers */
.offer { margin: 2em 0; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.offer-heading { font-weight: 700; margin: 0 0 12px; }
.offer-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.offer-card { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 10px; background: var(--surface-2); text-decoration: none; color: var(--ink); }
.offer-card:hover { outline: 2px solid var(--accent); }
.offer-card span { font-size: 0.9rem; color: var(--ink-2); line-height: 1.45; }
.offer-card .offer-cta { margin-top: auto; padding-top: 6px; font-weight: 700; color: var(--accent-ink); }
.offer-disclosure { margin: 12px 0 0; font-size: 0.8rem; color: var(--ink-3); }
.offer.shop .shop-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.offer.shop .shop-list li { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); }
.offer.shop .shop-list a { font-weight: 700; color: var(--accent-ink); }
.offer.shop .shop-list span { display: block; margin-top: 2px; font-size: 0.9rem; color: var(--ink-2); line-height: 1.45; }
/* The marker on an affiliate link, and the one small line below the links that decodes it. */
.aff { color: var(--ink-3); }
.aff-note { margin: 0.4em 0 1.6em; font-size: 0.78rem; color: var(--ink-3); }

/* Promo slots: Moob image creatives from engine/promos, at the slot widths render.mjs gives `sizes`.
   The side rail only exists once the article has a gutter wide enough to hold it. */
.rail-scope { position: relative; }
.promo-card {
  display: block;
  box-sizing: border-box;
  overflow: hidden;
  line-height: 0;
  background: #140c3c;
  border: 1px solid rgba(104, 52, 248, 0.5);
  border-radius: 16px;
}
.promo-card[hidden] { display: none; }
.promo-card:hover { border-color: #6834f8; }
.promo-card picture, .promo-card img { display: block; width: 100%; height: auto; }

.promo-rect { display: flex; justify-content: center; margin: 2em auto; }
.promo-card-rect { width: min(728px, 100%); border-radius: 12px; }

.promo-banner { display: flex; justify-content: center; margin: 0 auto 28px; padding: 0 16px; }
.promo-card-banner { width: min(728px, 100%); border-radius: 12px; }

.promo-rail { display: none; }
@media (min-width: 1180px) {
  .rail-scope:not(.rail-scope-home) .promo-rail {
    display: block;
    position: absolute;
    top: 0;
    left: calc(50% + 412px);
    width: 160px;
    height: auto;
    pointer-events: none;
  }
}
@media (min-width: 1500px) {
  .rail-scope-home .promo-rail {
    display: block;
    position: absolute;
    top: 0;
    left: calc(50% + 564px);
    width: 160px;
    height: auto;
    pointer-events: none;
  }
}
.promo-rail > .promo-card-rail { pointer-events: auto; }
a.promo-card.promo-card-rail { position: sticky; top: 24px; width: 160px; }

/* Buttons */
.btn svg { width: 18px; height: 18px; }

/* Article footer */
.article-foot { margin: 3em 0 0; padding-top: 1.4em; border-top: 1px solid var(--line); }
.article-foot h2 { font-size: 1.1rem; margin: 0 0 12px; }
.share-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 26px; color: var(--ink-3); font-size: 0.88rem; }

/* Footer */
.site-footer { margin-top: 72px; border-top: 1px solid var(--line); background: var(--surface-2); padding: 34px 0 26px; font-size: 0.92rem; }
.footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 24px; }
.footer-cols h2 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); margin: 0 0 8px; }
.footer-cols ul { list-style: none; margin: 0; padding: 0; }
.footer-cols li { margin: 4px 0; }
.footer-cols a { color: var(--ink-2); text-decoration: none; }
.footer-cols a:hover { color: var(--accent-ink); text-decoration: underline; }
.footer-bottom { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--ink-3); }
.footer-bottom p { margin: 0; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 650;
  transition: opacity 0.18s, transform 0.18s; z-index: 20;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

/* 404 */
.not-found { text-align: center; padding: 60px 0 20px; }

/* TaxAs Hold'em's theme: card-table felt green with chip gold, on off-white. Gold is decoration
   only (borders, the mark); text stays at 4.5:1 or better in light and dark mode (npm run
   audit:browser -- taxasholdem --local). The brand color, #1d5c40, is also in lib/brand.mjs and
   site.config.json. */
:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --surface-2: #eeece7;
  --ink: #1c2128;
  --ink-2: #434b56;
  --ink-3: #636a76;
  --line: #dcd9d2;
  --accent: #1d5c40;
  --accent-ink: #17533a;
  --accent-soft: #e3efe8;
  --gold: #d9ac3b;
  --gold-soft: #f7efd9;
  --alert: #b45309;
  --alert-soft: #fbefdf;
  --live: #b45309;
  --high: #b42318;
  --high-soft: #fdecea;
  --mid: #b45309;
  --low: #2f6b3a;
  --focus: #2563eb;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(28 33 40 / 6%), 0 6px 20px rgb(28 33 40 / 6%);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --surface: #1c1f23;
    --surface-2: #24282d;
    --ink: #eceae6;
    --ink-2: #c3c0ba;
    --ink-3: #959189;
    --line: #34383e;
    --accent: #7fd1a6;
    --accent-ink: #8fdab2;
    --accent-soft: #17302a;
    --gold: #e2bb55;
    --gold-soft: #2f2a1a;
    --alert: #f0a957;
    --alert-soft: #33261a;
    --live: #f0a957;
    --high: #f28b82;
    --high-soft: #3a1f1d;
    --mid: #f0a957;
    --low: #8fd19e;
    --focus: #8cc4ff;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 6px 20px rgb(0 0 0 / 25%);
  }
}
.narrow { max-width: 780px; }

/* Header */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1.2rem; letter-spacing: -0.01em; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: #1d5c40; color: #f3d27a; }
.brand-mark svg { width: 22px; height: 22px; }

/* Page head */
.home-head { text-align: center; padding: 34px 0 6px; }
.home-head h1 { font-size: clamp(2rem, 6vw, 3rem); line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 10px; }
.home-head .lead { max-width: 600px; margin: 0 auto 18px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font: inherit; font-weight: 650; font-size: 0.95rem;
  background: var(--ink); color: var(--bg); border: 1px solid var(--ink); border-radius: 999px; padding: 8px 16px; text-decoration: none;
}
.btn:hover { background: #1d5c40; border-color: #1d5c40; color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }

/* 404 */
.not-found .big { width: 72px; height: 72px; color: var(--accent); }

/* Tools (shared) */
.tool { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 18px; margin: 8px 0 26px; }
.tool-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 18px; }
@media (max-width: 760px) { .tool-grid { grid-template-columns: 1fr; } }
.tool-panel { min-width: 0; }
.tool-step { font-weight: 700; margin: 4px 0 10px; color: var(--ink); }
.tool-field { display: flex; flex-direction: column; gap: 4px; margin: 14px 0 0; font-size: 0.92rem; color: var(--ink-2); }
.tool-field.inline { margin: 0; max-width: 360px; }
.tool-field input, .tool-field select { font: inherit; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.tool-note { font-size: 0.85rem; color: var(--ink-3); margin: 14px 0 0; }
.tool-results { background: var(--surface-2); border-radius: 14px; padding: 14px 16px; margin-top: 16px; }
.tool-grid .tool-results { margin-top: 0; align-self: start; }
.tool-results h3 { font-size: 1rem; margin: 16px 0 4px; }
.tool-results p { margin: 0.4em 0; }
[hidden] { display: none !important; }

/* Calculator results */
.calc { width: 100%; border-collapse: collapse; font-size: 0.92rem; margin: 6px 0 10px; }
.calc th, .calc td { text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--line); vertical-align: top; font-weight: 400; }
.calc thead th { font-weight: 700; }
.calc td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.calc tr.total th, .calc tr.total td { font-weight: 700; }
.table-wrap { overflow-x: auto; }
.tool-summary { margin: 0 0 10px; }
.hint { font-size: 0.8rem; color: var(--ink-3); }
.callout { border-left: 4px solid var(--gold); background: var(--gold-soft); padding: 10px 14px; border-radius: 8px; margin: 14px 0; }
.callout p { margin: 0; }
.whatif { border-left: 4px solid var(--accent); background: var(--accent-soft); padding: 10px 14px; border-radius: 8px; margin: 14px 0; }
.whatif h3 { margin-top: 0; }
.helpline { border-left-color: var(--accent); background: var(--surface-2); font-size: 0.92rem; }

/* Repeal tracker */
.timeline { list-style: none; padding: 0; margin: 10px 0 20px; border-left: 3px solid var(--line); }
.timeline li { padding: 0 0 14px 18px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -8px; top: 6px; width: 13px; height: 13px; border-radius: 50%; background: var(--gold); border: 2px solid var(--surface); }
.timeline time { font-size: 0.85rem; color: var(--ink-3); font-weight: 650; }
.timeline h3 { margin: 2px 0 4px; font-size: 1.05rem; }
.timeline p { margin: 0; }
.tool-results h2.result-h { font-size: 1rem; margin: 16px 0 4px; }
.whatif h2.result-h { margin-top: 0; }

/* Buttons in tools, checkboxes */
.tool-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.tool-check { display: flex; gap: 8px; align-items: center; margin: 14px 0 0; font-size: 0.92rem; color: var(--ink-2); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: 0.85rem; color: var(--accent-ink); text-decoration: underline; cursor: pointer; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Diary */
.diary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 14px; }
.diary-store { margin: 14px 0; }
.diary-log { font-size: 0.85rem; }
.diary-notes { max-width: 220px; overflow-wrap: anywhere; }
@media print {
  header, footer, nav, .crumbs, .diary-form, .diary-store, .diary-files, .no-print, .prose > :not(.diary), .page-head, aside { display: none !important; }
  .tool, .tool-results { box-shadow: none; border: 0; background: none; padding: 0; }
}
