:root {
  color-scheme: light;
  --ink: #23352c;
  --muted: #66746b;
  --paper: #f8f7f1;
  --surface: #fffefa;
  --line: #dfe4d9;
  --green: #315c47;
  --green-dark: #244633;
  --green-pale: #e9f0e8;
  --gold: #bd8a3b;
  --serif: Georgia, "Times New Roman", serif;
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--paper); font-size: 16px; line-height: 1.7; }
a { color: var(--green); text-underline-offset: .18em; }
a:hover { color: var(--green-dark); }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #d1a34e; outline-offset: 3px; }
.shell { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }
.skip-link { position: absolute; top: -5rem; left: 1rem; z-index: 10; padding: .6rem 1rem; background: white; }
.skip-link:focus { top: 1rem; }

.site-header { border-bottom: 1px solid var(--line); background: rgba(255, 254, 250, .92); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.4rem; min-height: 88px; }
.brand { display: inline-flex; align-items: center; gap: .7rem; flex: 0 0 auto; color: var(--ink); text-decoration: none; }
.brand-mark { display: block; width: 46px; height: 46px; flex: 0 0 auto; object-fit: contain; }
.brand-name { display: grid; font-family: var(--serif); font-size: 1.15rem; font-weight: 700; line-height: 1.15; }
.brand-name small { margin-top: .25rem; color: var(--muted); font-family: inherit; font-size: .68rem; font-weight: 400; letter-spacing: .04em; }
.primary-nav { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: .35rem 1.05rem; }
.primary-nav a { color: var(--ink); font-size: .9rem; text-decoration: none; }
.primary-nav a:hover, .primary-nav a[aria-current="page"] { color: var(--green); text-decoration: underline; text-underline-offset: .35em; }
.button { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--green); border-radius: 999px; padding: .65rem 1.05rem; background: var(--green); color: white; font-size: .88rem; font-weight: 650; line-height: 1.3; text-decoration: none; white-space: nowrap; }
.button:hover { border-color: var(--green-dark); background: var(--green-dark); color: white; }
.button.secondary { border-color: var(--line); background: var(--surface); color: var(--ink); }
.button.secondary:hover { border-color: var(--green); color: var(--green); }

main { min-height: 65vh; }
.page-main { padding-block: 2.8rem 5rem; }
.eyebrow { margin: 0 0 .75rem; color: var(--green); font-size: .76rem; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, h3 { color: var(--ink); font-family: var(--serif); font-weight: 500; line-height: 1.18; text-wrap: balance; }
h1 { margin: 0; font-size: clamp(2.5rem, 6vw, 4.8rem); letter-spacing: -.04em; }
h2 { margin: 0 0 .75rem; font-size: clamp(1.65rem, 3vw, 2.35rem); letter-spacing: -.025em; }
h3 { margin: 0 0 .55rem; font-size: 1.28rem; }
p { margin: 0 0 1rem; }
.lede { max-width: 68ch; margin-top: 1.1rem; color: #4d5c52; font-size: clamp(1.08rem, 2vw, 1.27rem); line-height: 1.75; }
.muted, .note { color: var(--muted); }
.small { font-size: .88rem; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.section-heading p { max-width: 55ch; margin: 0; color: var(--muted); }
.section { margin-top: 4rem; }
.home-section + .home-section { margin-top: 3rem; border-top: 1px solid var(--line); padding-top: 1.5rem; }
.hero { padding: 4.5rem 0 3.7rem; }
.hero h1 { max-width: 850px; }
.hero .lede { max-width: 650px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.7rem; }
.hero-note { display: inline-flex; align-items: center; gap: .55rem; margin-top: 2rem; color: var(--muted); font-size: .9rem; }
.hero-note::before { width: 28px; height: 1px; background: var(--gold); content: ""; }
.feature-grid, .card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.feature-card, .card, .callout, .stat-card { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.feature-card { display: flex; flex-direction: column; min-height: 260px; padding: clamp(1.2rem, 3vw, 2rem); }
.feature-card p { color: #536158; }
.experiment-request .button { align-self: flex-start; margin-top: 1.25rem; }
.feature-card .card-link { margin-top: auto; font-weight: 700; }
.feature-card.featured { border-color: #cfddce; background: var(--green-pale); }
.number-feature { position: relative; overflow: hidden; }
.number-feature::after { position: absolute; top: -48px; right: -24px; color: rgba(49, 92, 71, .08); content: "1516"; font-family: var(--serif); font-size: 8rem; font-weight: 700; letter-spacing: -.08em; pointer-events: none; }
.feature-number { position: relative; z-index: 1; margin: .2rem 0 .5rem; color: var(--green-dark); font-family: var(--serif); font-size: clamp(3.7rem, 7vw, 5.2rem); line-height: 1; letter-spacing: .06em; }
.feature-number-caption { color: var(--muted); font-size: .9rem; }
.feature-card .card-link { position: relative; z-index: 1; }
.stats-inline { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; margin: .6rem 0 1rem; color: #415349; font-size: .9rem; }
.stats-inline strong { color: var(--ink); }
.text-link { font-weight: 700; }
.callout { margin-top: 1.2rem; padding: 1.1rem 1.25rem; background: #f1f2e9; color: #47584c; }
.callout strong { color: var(--ink); }
.card { padding: 1.25rem; }
.card p:last-child, .feature-card p:last-of-type { margin-bottom: 0; }
.card-link { display: inline-flex; gap: .35rem; align-items: center; }
.link-arrow { font-size: 1.1em; }

.content-narrow { width: min(760px, 100%); }
.content-narrow > p, .content-narrow li { max-width: 70ch; }
.prose h2 { margin-top: 2.7rem; }
.prose h3 { margin-top: 1.7rem; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin: .45rem 0; }
.prose blockquote { margin: 1.6rem 0; padding: .25rem 0 .25rem 1.2rem; border-left: 3px solid var(--gold); color: #4d5c52; font-family: var(--serif); font-size: 1.22rem; }
.article-header { max-width: 850px; padding-bottom: 1.8rem; border-bottom: 1px solid var(--line); }
.article-header h1 { font-size: clamp(2.35rem, 5vw, 4rem); }
.article-meta { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; margin-top: 1rem; color: var(--muted); font-size: .9rem; }
.article-body { margin-top: 2rem; }
.article-body .callout { margin: 1.5rem 0 2rem; }
.math-display { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .25em .4em; margin: 1.5rem 0 2rem; color: var(--ink); font-family: var(--serif); font-size: clamp(1.25rem, 3vw, 1.8rem); line-height: 1.15; text-align: center; }
.math-fraction { display: inline-grid; grid-template-rows: auto auto; text-align: center; vertical-align: middle; }
.math-numerator { padding: 0 .3em .12em; border-bottom: 1px solid currentColor; }
.math-denominator { padding: .12em .3em 0; }
.math-binomial { display: inline-flex; align-items: center; gap: .08em; }
.math-binomial-values { display: grid; font-size: .78em; line-height: .9; text-align: center; }
.math-binomial-bracket { font-size: 1.8em; font-weight: 300; line-height: .8; }
.calculation-disclosures { display: grid; gap: .6rem; margin: 1.2rem 0 2rem; }
.calculation-details { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.calculation-details summary { padding: .85rem 1rem; cursor: pointer; font-weight: 700; }
.calculation-detail-body { padding: 0 1rem 1rem; }
.calculation-detail-body p:last-child { margin-bottom: 0; }
.calculation-detail-body .math-display { margin: .75rem 0 0; }
.math-steps { margin: 1rem 0 2rem; padding: .5rem 1rem .5rem 2.5rem; border-left: 3px solid var(--gold); background: var(--surface); }
.math-steps li { margin: .75rem 0; }
.math-steps .math-display { margin: .6rem 0; font-size: clamp(1.1rem, 2.5vw, 1.4rem); }
.article-answer .math-display { margin: .8rem 0; }
.math-negative { color: #8d3e37; font-weight: 700; }
.article-intro { margin: 0 0 2rem; padding: 1rem 1.2rem; border-left: 3px solid var(--gold); background: var(--surface); color: #4d5c52; }
.probability-visual { margin: 1.5rem 0 2rem; padding: clamp(1rem, 3vw, 1.5rem); border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.probability-visual-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.probability-visual-panel { min-width: 0; padding: 1rem; border-radius: 12px; background: #f1f2e9; }
.article-body .probability-visual-title { margin: 0 0 .8rem; font-size: .98rem; font-weight: 700; }
.coin-outcomes { display: flex; flex-wrap: wrap; gap: .65rem; }
.coin-face { display: inline-flex; width: 68px; aspect-ratio: 1; align-items: center; justify-content: center; border: 2px solid #c8b67f; border-radius: 50%; background: var(--surface); color: var(--ink); font-size: .82rem; font-weight: 700; }
.die-outcomes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .35rem; }
.die-face { display: grid; aspect-ratio: 1; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font-weight: 700; }
.coin-face.is-event, .die-face.is-event { border-color: var(--green); background: var(--green); color: white; }
.article-body .probability-visual-result { margin: .75rem 0 0; font-size: .94rem; }
.probability-visual figcaption { margin-top: 1rem; color: var(--muted); font-size: .9rem; }
.order-visual { margin: 1.5rem 0 2rem; padding: clamp(1rem, 3vw, 1.5rem); border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.order-visual-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.order-visual-panel { padding: 1rem; border-radius: 12px; background: #f1f2e9; }
.article-body .order-visual-title { margin: 0 0 .8rem; font-size: .98rem; font-weight: 700; }
.order-visual-rows { display: grid; gap: .5rem; }
.article-body .order-visual-row { display: flex; align-items: center; gap: .5rem; margin: 0; }
.order-card { display: inline-flex; min-width: 4.2rem; min-height: 2.5rem; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-weight: 700; }
.order-card-red { color: #8d3e37; }
.order-card-blue { color: #315c7a; }
.order-word { color: var(--muted); font-size: .86rem; }
.article-body .order-visual-explanation { margin: .75rem 0 0; color: var(--muted); font-size: .9rem; }
.order-visual figcaption { margin-top: 1rem; color: var(--muted); font-size: .9rem; }
.article-body h2 { margin-top: 2.5rem; font-size: 1.75rem; }
.article-body h3 { margin-top: 1.6rem; }
.article-body p, .article-body li { font-size: 1.04rem; }
.article-answer { margin: 1.5rem 0; padding: 1.3rem 1.5rem; border-left: 4px solid var(--green); border-radius: 0 12px 12px 0; background: var(--green-pale); font-family: var(--serif); font-size: 1.24rem; line-height: 1.55; }
.data-table-wrap { overflow-x: auto; margin: 1.4rem 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; min-width: 480px; font-size: .95rem; }
table caption { padding: .75rem .9rem; color: var(--ink); font-weight: 700; text-align: left; }
th, td { padding: .75rem .9rem; border-bottom: 1px solid var(--line); text-align: left; }
th { background: #f0f2eb; font-size: .82rem; letter-spacing: .025em; }
td:not(:first-child), th:not(:first-child) { font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: 0; }
.source-note { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .86rem; }

.search-panel { max-width: 760px; margin-top: 2rem; padding: clamp(1.15rem, 3vw, 1.7rem); border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.search-form { display: flex; align-items: end; flex-wrap: wrap; gap: .75rem; margin-top: 1rem; }
.search-form .field { flex: 1 1 240px; }
.search-form .button { min-height: 48px; align-self: end; }
.search-form > .status-message { flex-basis: 100%; }
.field-label-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem .75rem; }
.field-label-row .search-hint { margin: 0; }
.random-number-button { margin-top: .5rem; }
.field { display: grid; flex: 1; gap: .35rem; min-width: 0; }
.field label, .control label, .control-label { font-size: .86rem; font-weight: 700; }
.field input, .control select { width: 100%; min-height: 48px; border: 1px solid #cdd6ca; border-radius: 9px; padding: .55rem .75rem; background: white; color: var(--ink); }
.date-range-control { box-sizing: border-box; min-width: min(100%, 420px); max-width: 460px; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.date-range-inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.date-range-inputs input { width: 100%; min-height: 48px; border: 1px solid #cdd6ca; border-radius: 9px; padding: .55rem .65rem; background: white; color: var(--ink); font-variant-numeric: tabular-nums; }
.date-range-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .75rem; }
.date-range-presets { display: flex; flex-wrap: wrap; gap: .4rem; }
.date-preset, .date-range-reset { display: inline-flex; min-height: 36px; align-items: center; justify-content: center; border: 1px solid #cdd6ca; border-radius: 999px; padding: .4rem .75rem; background: white; color: var(--green-dark); cursor: pointer; font-size: .82rem; font-weight: 650; line-height: 1.2; text-decoration: none; white-space: nowrap; }
.date-preset:hover, .date-range-reset:hover { border-color: var(--green); background: var(--green-pale); color: var(--green-dark); }
.date-preset:focus-visible, .date-range-reset:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.date-range-reset { background: #f3f4ee; }
.text-button { width: fit-content; padding: .2rem 0; border: 0; background: transparent; color: var(--green-dark); cursor: pointer; font-size: .86rem; font-weight: 700; text-align: left; text-decoration: underline; text-underline-offset: .15em; }
.date-range-control .status-message { margin-top: 0; }
.date-range-control .status-message:empty { display: none; }
.field input { font-size: 1.1rem; font-variant-numeric: tabular-nums; letter-spacing: .06em; }
.search-hint { margin: .65rem 0 0; color: var(--muted); font-size: .85rem; }
.number-chip { min-width: 38px; padding: .23rem .55rem; border: 1px solid var(--line); border-radius: 999px; background: white; color: var(--green); font-variant-numeric: tabular-nums; font-weight: 650; text-align: center; text-decoration: none; }
.number-chip:hover { border-color: var(--green); background: var(--green-pale); }
.number-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .5rem; max-width: 540px; margin-top: 1.5rem; }
.number-grid .number-chip { display: grid; place-items: center; min-height: 42px; }
.number-picker { margin-top: 1.2rem; }
.number-picker > summary { color: var(--green-dark); cursor: pointer; font-weight: 700; }
.number-picker[open] .number-grid { margin-top: .9rem; }
.number-chip[aria-current="page"] { border-color: var(--green-dark); background: var(--green); color: white; }
.number-profile { margin-top: 2rem; }
.number-profile h2 { font-size: 1.7rem; }
.profile-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; margin: 1.2rem 0; }
.stat-card { padding: 1rem; }
.stat-value { display: block; color: var(--green-dark); font-family: var(--serif); font-size: 2rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: .8rem; line-height: 1.4; }
.controls { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .8rem 1rem; margin: 1rem 0; }
.control { display: grid; gap: .3rem; min-width: 170px; }
.switch-control { display: inline-flex; width: fit-content; min-height: 48px; align-items: center; gap: .6rem; cursor: pointer; font-size: .9rem; }
.switch-control input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.switch-track { position: relative; width: 42px; height: 24px; flex: 0 0 auto; border-radius: 999px; background: #b9c2b8; transition: background-color .15s ease; }
.switch-track::after { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: white; content: ""; transition: transform .15s ease; }
.switch-control input:checked + .switch-track { background: var(--green); }
.switch-control input:checked + .switch-track::after { transform: translateX(18px); }
.switch-control input:focus-visible + .switch-track { outline: 3px solid var(--gold); outline-offset: 3px; }
.matching-toggle { display: inline-flex; width: fit-content; gap: .2rem; padding: .2rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.matching-toggle button { border: 0; border-radius: 7px; padding: .45rem .7rem; background: transparent; color: var(--ink); cursor: pointer; font-size: .9rem; }
.matching-toggle button[aria-pressed="true"] { background: var(--green); color: white; }
.matching-toggle button[aria-pressed="true"]:hover { background: var(--green-dark); color: white; }
.matching-toggle button:not([aria-pressed="true"]):hover { color: var(--green-dark); }
.appearance-controls { display: flex; flex-wrap: wrap; align-items: end; gap: .8rem 1.2rem; margin: .8rem 0; }
.appearance-controls > .control { flex: 0 1 220px; min-width: min(170px, 100%); }
.appearance-period-control { display: grid; flex: 0 0 auto; gap: .3rem; min-width: 170px; }
.appearance-period-toggle { display: inline-flex; width: fit-content; gap: .15rem; padding: .2rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.appearance-period-toggle button { min-width: 72px; border: 0; border-radius: 999px; padding: .5rem .8rem; background: transparent; color: var(--ink); cursor: pointer; font-size: .9rem; font-weight: 650; }
.appearance-period-toggle button[aria-pressed="true"] { background: var(--green); color: white; }
.appearance-period-toggle button[aria-pressed="true"]:hover { background: var(--green-dark); }
.appearance-period-toggle button:not([aria-pressed="true"]):hover { color: var(--green-dark); }
.appearance-period-toggle button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.appearance-chart { display: block; width: 100%; height: auto; margin: 1rem 0 .35rem; overflow: visible; }
.appearance-chart text { fill: var(--muted); font-family: inherit; font-size: 12px; }
.appearance-chart .chart-grid { stroke: var(--line); stroke-dasharray: 3 4; }
.appearance-chart .chart-axis { stroke: #879387; }
.appearance-chart .chart-expected-line { stroke: var(--gold); stroke-dasharray: 7 5; stroke-width: 2; }
.appearance-chart .chart-expected-label { fill: #76541e; font-size: 11px; font-weight: 700; }
.appearance-chart .chart-hit-area { fill: none; pointer-events: all; cursor: help; }
.appearance-chart .chart-bar { fill: var(--green); }
.appearance-chart .chart-bar-group:hover .chart-bar { fill: var(--gold); }
.appearance-chart .chart-prize-bar-group:hover .chart-prize-observed,
.appearance-chart .chart-prize-bar-group:hover .chart-prize-expected { opacity: .78; }
.prize-chart { margin: .4rem 0 1rem; }
.prize-chart-legend { display: flex; flex-wrap: wrap; gap: .45rem 1rem; margin: .5rem 0; }
.prize-chart-legend-item { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .8rem; }
.prize-chart-swatch { display: inline-block; width: 12px; height: 10px; flex: 0 0 auto; border-radius: 2px; }
.chart-note { margin: 0 0 1rem; color: var(--muted); font-size: .84rem; }
.data-details { margin: .8rem 0 1.4rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.data-details > summary, .year-details > summary { padding: .8rem 1rem; cursor: pointer; font-weight: 700; }
.data-details-content { padding: 0 1rem 1rem; }
.data-details-content > :first-child { margin-top: 0; }
.data-details-content > :last-child { margin-bottom: 0; }
.month-table { width: 100%; min-width: 0; border-collapse: collapse; }
.month-table caption { padding: .5rem 0; color: var(--muted); font-size: .85rem; text-align: left; }
.month-table th, .month-table td { padding: .5rem .65rem; }
.record-disclosure { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: .5rem 1rem; margin: 1.3rem 0; }
.record-details { margin: 0; }
.record-expand-button { align-self: start; margin: .55rem .6rem 0 0; border: 1px solid var(--line); border-radius: 999px; padding: .45rem .75rem; background: var(--surface); text-decoration: none; white-space: nowrap; }
.record-expand-button:hover { border-color: var(--green); background: var(--green-pale); }
.year-details { margin: .6rem 0; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.year-details > summary { padding: .65rem .8rem; }
.year-details .result-list { margin: 0; padding: 0 1rem 1rem 2rem; }
.year-details .result-list li { padding-block: .1rem; font-variant-numeric: tabular-nums; }
.result-list { margin: 1rem 0 0; padding-left: 1.2rem; }
.result-list li { margin: .35rem 0; }
.placeholder { padding: 1.2rem; border: 1px dashed #cbd5c8; border-radius: 12px; background: #fafbf7; color: var(--muted); }
.status-message { min-height: 1.4em; margin: .5rem 0 0; color: #a33d2b; font-size: .9rem; }
.views-note { margin-top: 1.25rem; padding: .8rem 1rem; border-radius: 10px; background: #f0f2eb; color: var(--muted); font-size: .84rem; }
.breadcrumbs { margin: 0 0 1.2rem; color: var(--muted); font-size: .86rem; }
.breadcrumbs a { color: var(--muted); }
.article-list { display: grid; gap: .8rem; margin-top: 1.5rem; }
.article-list-item { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 1rem; padding: 1.25rem 0; border-bottom: 1px solid var(--line); }
.article-list-meta { display: grid; align-content: start; gap: .3rem; }
.article-list-item .eyebrow { margin: .15rem 0; }
.article-list-date { font-size: .84rem; }
.article-list-item h2 { margin: 0 0 .5rem; font-size: 1.5rem; }
.article-list-item h3 { margin: 0 0 .5rem; font-size: 1.5rem; }
.article-list-item p { margin: 0; color: var(--muted); }
.number-articles { margin-top: 2rem; }

.site-footer { margin-top: 4rem; border-top: 1px solid var(--line); background: #f0f1e9; }
.footer-inner { display: flex; justify-content: space-between; gap: 1.5rem; padding-block: 1.5rem; color: var(--muted); font-size: .85rem; }
.footer-disclaimer { color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: .5rem 1rem; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--green-dark); }

@media (max-width: 900px) {
  .header-inner { align-items: flex-start; flex-wrap: wrap; padding-block: 1rem; }
  .primary-nav { order: 3; width: 100%; justify-content: flex-start; padding-top: .2rem; }
}
@media (max-width: 620px) {
  body { font-size: 15px; }
  .shell { width: min(100% - 28px, 1120px); }
  .header-inner { gap: .8rem; }
  .brand-mark { width: 40px; height: 40px; }
  .brand-name { font-size: 1rem; }
  .primary-nav { gap: .45rem .8rem; }
  .primary-nav a { font-size: .84rem; }
  .hero { padding: 3.2rem 0 2.7rem; }
  .page-main { padding-block: 2rem 3.5rem; }
  .section { margin-top: 3rem; }
  .feature-grid, .card-grid { grid-template-columns: 1fr; }
  .feature-card { min-height: 230px; }
  .search-form { align-items: stretch; flex-direction: column; }
  .search-form .field, .search-form .button, .search-form > .status-message { width: 100%; flex-basis: auto; }
  .search-form .button { width: 100%; }
  .profile-stats { grid-template-columns: 1fr; }
  .date-range-inputs { grid-template-columns: 1fr; }
  .record-disclosure { grid-template-columns: 1fr; }
  .record-expand-button { margin: 0; }
  .number-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .35rem; }
  .number-grid .number-chip { min-height: 38px; padding-inline: .2rem; }
  .article-list-item { grid-template-columns: 1fr; gap: .35rem; }
  .footer-inner { flex-direction: column; }
  .probability-visual-grid, .order-visual-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
