/* Components of mockup A «Folha de Programa», moved as drawn; the ones the
 * mockup did not draw (fields, filters, empty state, overlays, switches,
 * table scroller) are designed here on the same tokens. States: hover, focus,
 * active, disabled, selected, error — everywhere. */

.ico { width: 18px; height: 18px; flex: none; }
.icon { fill: none; stroke: currentColor; }
.icon--missing { display: inline-block; width: 1em; height: 1em; outline: 1px dashed var(--color-error); }

/* ── octagon: distintivo octogonal (Estatuto, Art. 6º) — signature 1 ──── */
.oct {
  --s: 40px; width: var(--s); height: var(--s); flex: none; display: inline-grid; place-items: center;
  clip-path: var(--oct); background: var(--color-brand); color: var(--color-on-brand);
  font-family: var(--font-mono); font-weight: 600; font-size: calc(var(--s) * .4); line-height: 1;
  position: relative; letter-spacing: -.02em;
}
.oct .ico { width: 45%; height: 45%; }
.oct--ring::before { content: ""; position: absolute; inset: 2px; clip-path: var(--oct); background: var(--color-on-brand); }
.oct--ring::after { content: ""; position: absolute; inset: 3.5px; clip-path: var(--oct); background: var(--color-brand); }
.oct--ring > span { position: relative; z-index: 1; }
.oct--paper { background: var(--color-surface); color: var(--color-brand); }
.oct--ink { background: var(--color-text); }
.oct--blank { background: var(--color-border); }
.oct--line { background: var(--color-brand-tint); color: var(--color-brand); }
.oct--sm { --s: 28px; font-size: 12px; background: var(--color-text); }

/* ── buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 20px; border: 1px solid var(--color-text); border-radius: var(--radius);
  background: transparent; color: var(--color-text); text-decoration: none; font-weight: 600; font-size: 16px; letter-spacing: -.005em;
  cursor: pointer;
  transition: background-color var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast);
}
.btn:hover { background: var(--color-text); color: var(--color-surface); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; background: transparent; color: var(--color-text); }
.btn--primary { background: var(--color-brand); border-color: var(--color-brand); color: var(--color-on-brand); }
.btn--primary:hover { background: var(--color-brand-deep); border-color: var(--color-brand-deep); color: var(--color-on-brand); }
.btn--primary:active { background: var(--color-brand-active); }
.btn--primary:disabled, .btn--primary[aria-disabled="true"] { background: var(--color-brand); color: var(--color-on-brand); }
.btn--sm { min-height: 44px; padding: 0 14px; font-size: 14px; gap: 8px; }
.btn--quiet { border-color: transparent; text-decoration: underline; text-underline-offset: 3px; }
.btn--quiet:hover { background: var(--color-bg); color: var(--color-brand); }
.btn.is-busy { pointer-events: none; opacity: .7; }
.cta { display: flex; flex-wrap: wrap; gap: 8px; }
.cta .btn { padding: 0 16px; font-size: 15px; }

.lnk { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--color-brand); text-decoration: none; min-height: 44px; }
.lnk span { border-bottom: 1px solid currentColor; line-height: 1.2; }
.lnk:hover { color: var(--color-brand-deep); }
.lnk .ico { transition: transform var(--dur-fast) var(--ease); }
.lnk:hover .ico { transform: translateX(3px); }

.iconbtn { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--color-text); background: var(--color-surface); color: var(--color-text); transition: background-color var(--dur-fast), color var(--dur-fast); }
.iconbtn:hover { background: var(--color-text); color: #fff; }

/* ── hairline sheet (bento) — signature 2 ─────────────────────────────── */
.sheet { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1px; background: var(--color-border); border: 1px solid var(--color-border); }
.sheet > * { background: var(--color-surface); min-width: 0; }
.tile { padding: 26px 28px 22px; }
.tile__head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 18px; }
.tile__h { font-size: var(--fs-h3); letter-spacing: -.03em; line-height: 1.1; margin: 6px 0 0; font-weight: 600; }
.tile__h a { text-decoration: none; }
.tile__h a:hover { color: var(--color-brand); }
.tile__date { font-family: var(--font-mono); font-size: 13px; color: var(--color-muted); white-space: nowrap; }
.span-4 { grid-column: span 4; } .span-6 { grid-column: span 6; } .span-8 { grid-column: span 8; } .span-12 { grid-column: 1 / -1; }

/* ── programme-sheet table ────────────────────────────────────────────── */
.psheet { width: 100%; border-collapse: collapse; font-size: 15px; }
.psheet caption { text-align: left; padding-bottom: 8px; }
.psheet th { font-family: var(--font-mono); font-weight: 500; font-size: var(--fs-mono-xs); letter-spacing: .12em; text-transform: uppercase; color: var(--color-muted); text-align: left; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--color-text); white-space: nowrap; }
.psheet td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
.psheet th + th, .psheet td + td { padding-left: 12px; border-left: 1px solid var(--color-border); }
.psheet .num { font-family: var(--font-mono); font-weight: 600; white-space: nowrap; }
.psheet .r, .psheet th.r { text-align: right; }
.psheet .horse { font-weight: 600; letter-spacing: -.01em; overflow-wrap: anywhere; }
.psheet a { color: inherit; text-underline-offset: 3px; }
.psheet a:hover { color: var(--color-brand); }
.table-scroll { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch;
  /* scroll hint: a soft shadow shows on the edge that still hides columns, and fades once scrolled there */
  background:
    linear-gradient(to right, var(--color-surface) 30%, rgb(255 255 255 / 0)) left / 32px 100% no-repeat local,
    linear-gradient(to left, var(--color-surface) 30%, rgb(255 255 255 / 0)) right / 32px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgb(20 23 42 / .16), rgb(20 23 42 / 0)) left / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgb(20 23 42 / .16), rgb(20 23 42 / 0)) right / 12px 100% no-repeat scroll;
}
.table-scroll:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 2px; }

.dist { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); white-space: nowrap; }
.post { width: 5px; height: 15px; flex: none; background: repeating-linear-gradient(180deg, var(--color-accent) 0 3px, #fff 3px 6px); outline: 1px solid var(--color-accent); }
.turma { display: inline-grid; place-items: center; min-width: 44px; height: 28px; padding: 0 6px; border: 1px solid var(--color-text); font-family: var(--font-mono); font-weight: 600; font-size: 13px; }
.note { font-size: 14px; color: var(--color-muted); margin: 16px 0 0; }
.dash { color: var(--color-muted); }
.pos { font-weight: 600; }
.restable tr.is-win td { background: var(--color-brand-tint); }
.restable .num .oct { --s: 30px; font-size: 11px; background: var(--color-brand); }

/* status of the next meeting */
.status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 22px 0; padding: 12px 14px; background: var(--color-bg); border-left: 3px solid var(--color-brand); }
.status__label { font-weight: 600; }
.status__sub { font-family: var(--font-mono); font-size: 13px; color: var(--color-muted); }
.status[data-state="closed"] { border-left-color: var(--color-muted); }
.status[data-state="today"] { border-left-color: var(--color-accent); }

/* ── documents ────────────────────────────────────────────────────────── */
.docs { margin: 0; padding: 0; border-top: 1px solid var(--color-text); }
.docs li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--color-border); }
.docs li > .ico { color: var(--color-brand); }
.docs__name { font-weight: 500; line-height: 1.3; }
.docs__name small { display: block; font-family: var(--font-mono); font-size: 12px; color: var(--color-muted); font-weight: 400; margin-top: 2px; }
.docs__act { display: flex; gap: 6px; flex-wrap: wrap; }
.ibtn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; min-width: 44px; justify-content: center; padding: 0 10px;
  border: 1px solid var(--color-border); text-decoration: none; font-size: 13px; font-weight: 600; color: var(--color-text); background: var(--color-surface);
  transition: border-color var(--dur-fast), color var(--dur-fast), background-color var(--dur-fast);
}
.ibtn:hover { border-color: var(--color-brand); color: var(--color-brand); background: var(--color-brand-tint); }
.ibtn .ico { width: 16px; height: 16px; }
.ibtn[aria-disabled="true"] { opacity: .45; pointer-events: none; }

/* ── replay facade ────────────────────────────────────────────────────── */
.facade { position: relative; aspect-ratio: 16 / 9; background: var(--color-text); margin: 0; overflow: hidden; }
.facade > button { all: unset; position: absolute; inset: 0; cursor: pointer; display: block; }
.facade > button:focus-visible { outline: 3px solid var(--color-accent); outline-offset: -3px; }
.facade img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.9); transition: transform .4s var(--ease); }
.facade > button:hover img { transform: scale(1.03); }
.facade__play { position: absolute; left: 18px; bottom: 18px; display: flex; align-items: center; gap: 12px; color: #fff; font-weight: 600; }
.facade__play .oct { --s: 60px; background: var(--color-surface); color: var(--color-brand); }
.facade__play .oct .ico { width: 22px; height: 22px; fill: currentColor; margin-left: 3px; }
.facade__play .lbl { background: var(--color-caption); padding: 6px 10px; font-size: 14px; }
.facade iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.facade--sm .facade__play { left: 12px; bottom: 12px; }
.facade--sm .facade__play .oct { --s: 44px; }
.facade--sm .facade__play .lbl { font-size: 13px; padding: 4px 8px; }
.replay__cap { margin: 12px 0 0; font-size: 15px; }
.replay__cap .mono { font-size: 13px; color: var(--color-muted); display: block; }
.live { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--color-muted); margin: 0; }

/* ── tabs (páreos) ────────────────────────────────────────────────────── */
.prog { background: var(--color-surface); border: 1px solid var(--color-border); }
.tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); border-bottom: 1px solid var(--color-text); }
.tab { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 14px; padding: 16px 20px; min-height: 72px; border-right: 1px solid var(--color-border); position: relative; transition: background-color var(--dur-fast); }
.tab:last-child { border-right: 0; }
.tab:hover { background: var(--color-bg); }
.tab:focus-visible { outline: 2px solid var(--color-brand); outline-offset: -4px; }
.tab .oct { --s: 40px; font-size: 16px; background: var(--color-border); color: var(--color-text); }
.tab[aria-selected="true"] .oct { background: var(--color-brand); color: #fff; }
.tab[aria-selected="true"] { background: var(--color-surface); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 4px; background: var(--color-brand); }
.tab__t { display: flex; flex-direction: column; gap: 2px; line-height: 1.25; }
.tab__t .tab__d { font: inherit; color: inherit; }
.tab__t b { font-weight: 600; font-size: 16px; }
.tab__t span { font-family: var(--font-mono); font-size: 13px; color: var(--color-muted); }

.panel { padding: 32px 32px 28px; }
.phead { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 300px); gap: 20px 32px; align-items: start; padding-bottom: 24px; border-bottom: 1px solid var(--color-border); }
.phead__n { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.phead__n .oct { --s: 88px; font-size: 40px; }
.phead__n .mono { font-size: 14px; color: var(--color-muted); }
.phead h3 { font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.25rem); letter-spacing: -.04em; line-height: 1.02; margin: 4px 0 8px; font-weight: 600; }
.phead__cond { margin: 0; color: var(--color-muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 0; padding: 0; }
.chips li { font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; padding: 4px 8px; border: 1px solid var(--color-text); text-transform: uppercase; }
.pmeta { margin: 0; border-top: 1px solid var(--color-text); }
.pmeta div { display: grid; grid-template-columns: 96px 1fr; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--color-border); }
.pmeta dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--color-muted); padding-top: 3px; }
.pmeta dd { margin: 0; font-family: var(--font-mono); font-size: 15px; font-weight: 500; }
.times { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--color-text); border-bottom: 1px solid var(--color-border); margin: 0 0 14px; }
.times div { padding: 8px 10px 8px 0; }
.times div + div { padding-left: 10px; border-left: 1px solid var(--color-border); }
.times dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.times dd { margin: 0; font-family: var(--font-mono); font-size: 20px; font-weight: 600; color: var(--color-text); }

/* runners */
.runners { margin-top: 24px; overflow-x: auto; }
.runners .psheet td.num .oct { --s: 34px; font-size: 14px; }
.runners .horse { font-size: 16px; }
.runners tbody tr.runner { transition: background-color var(--dur-fast); }
.runners tbody tr.runner:hover { background: var(--color-surface-2); }
.xbtn { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 10px; border: 1px solid var(--color-border); font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; transition: border-color var(--dur-fast), color var(--dur-fast), background-color var(--dur-fast); }
.xbtn:hover { border-color: var(--color-brand); color: var(--color-brand); }
.xbtn:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 2px; }
.xbtn .ico { width: 15px; height: 15px; transition: transform var(--dur-base) var(--ease); }
.xbtn[aria-expanded="true"] { border-color: var(--color-brand); color: var(--color-brand); background: var(--color-brand-tint); }
.xbtn[aria-expanded="true"] .ico { transform: rotate(180deg); }
tr.detail td { background: var(--color-bg); padding: 12px 16px 14px 58px; border-left: 0 !important; }
tr.detail dl { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 28px; }
tr.detail dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--color-muted); }
tr.detail dd { margin: 2px 0 0; font-weight: 500; }
tr.detail dd.mono { font-weight: 600; }
.pfoot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; align-items: center; margin-top: 20px; font-size: 15px; }
.won { display: flex; align-items: center; gap: 10px; margin: 0; }
.won .oct { --s: 28px; font-size: 12px; background: var(--color-text); }
.won b { font-weight: 600; }
.won > span:not(.oct) { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; }

/* retrospecto list */
.retro { margin: 0; padding: 0; border-top: 1px solid var(--color-text); }
.retro li { display: grid; grid-template-columns: 62px 1fr auto; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--color-border); }
.retro__n { font-family: var(--font-mono); font-weight: 600; font-size: 20px; letter-spacing: -.03em; }
.retro__n small { font-size: 12px; font-weight: 500; color: var(--color-muted); margin-right: 2px; }
.retro__d { font-size: 15px; line-height: 1.3; }
.retro__d small { display: block; font-family: var(--font-mono); font-size: 12px; color: var(--color-muted); }
.camp { margin: 16px 0 0; padding: 12px 14px; border: 1px dashed var(--color-muted); font-size: 14px; }
.camp .mono { display: block; font-size: 13px; margin-top: 4px; }

/* rateios */
.rateios td.val { font-weight: 600; font-size: 18px; }

/* steps + external handoff + official warning */
.steps { counter-reset: s; margin: 0 0 18px; padding: 0; border-top: 1px solid var(--color-text); }
.steps li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--color-border); font-size: 15px; line-height: 1.35; }
.steps li::before { content: counter(s, decimal-leading-zero); font-family: var(--font-mono); font-size: 12px; color: var(--color-muted); padding-top: 2px; }
.extnote { display: flex; gap: 6px; align-items: center; font-family: var(--font-mono); font-size: 12px; color: var(--color-muted); margin: 8px 0 0; }
.extnote .ico { width: 14px; height: 14px; }
.aviso { margin: 16px 0 0; padding: 10px 12px; border-left: 3px solid var(--color-accent); background: var(--color-bg); font-size: 13px; line-height: 1.4; font-weight: 600; letter-spacing: .01em; }

/* ── filters (GET, work without JS) ───────────────────────────────────── */
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 16px; padding: 18px 20px; background: var(--color-surface); border: 1px solid var(--color-border); border-top: 2px solid var(--color-text); margin-bottom: 24px; }
.filters__field { display: grid; gap: 6px; min-width: 0; flex: 1 1 220px; }
/* four short filters (Temporada · Reunião · Data · Status) share one row with the buttons */
.filters:has(> .filters__field:nth-of-type(4)) > .filters__field { flex-basis: 180px; }
@media (max-width: 1365px) { .filters:has(> .filters__field:nth-of-type(4)) > .filters__field { flex-basis: 160px; } }
.filters__field label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--color-muted); }
.filters__act { display: flex; gap: 8px; flex: 0 0 auto; margin-left: auto; align-self: stretch; align-items: flex-end; }
@media (max-width: 1365px) { .filters { padding-inline: 14px; } }
@media (max-width: 899px) { .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); } .filters__act { grid-column: 1 / -1; } }
@media (max-width: 759px) { .filters { grid-template-columns: 1fr; } }
.select { position: relative; display: block; }
.select select {
  appearance: none; width: 100%; min-height: 44px; padding: 0 32px 0 12px;
  border: 1px solid var(--color-text); border-radius: var(--radius); background: var(--color-surface); color: var(--color-text);
  font: 500 15px/1.2 var(--font-body); cursor: pointer; transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.select select:hover { border-color: var(--color-brand); }
.select select:focus-visible { outline: none; border-color: var(--color-brand); box-shadow: var(--focus-ring); }
.select .ico { position: absolute; right: 10px; top: 50%; translate: 0 -50%; pointer-events: none; width: 16px; height: 16px; }
.result-count { font-family: var(--font-mono); font-size: 13px; color: var(--color-muted); margin: 0 0 12px; }

/* ── empty state ──────────────────────────────────────────────────────── */
.empty { display: flex; gap: 16px; align-items: flex-start; padding: 28px; background: var(--color-surface); border: 1px dashed var(--color-muted); }
.empty .oct { --s: 48px; }
.empty__t { font-weight: 600; font-size: 18px; margin: 0 0 4px; }
.empty__s { margin: 0; color: var(--color-muted); }

/* ── fields (contact, ouvidoria, help search) ─────────────────────────── */
.form { display: grid; gap: 16px; }
.form__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.field { display: grid; gap: 6px; }
.field__label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--color-muted); }
.field__hint { font-size: 13px; color: var(--color-muted); }
.field input:not(.visually-hidden):not([type=checkbox]):not([type=radio]), .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--color-text); border-radius: var(--radius);
  background: var(--color-surface); color: var(--color-text); font: 400 16px/1.4 var(--font-body);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.field textarea { min-height: 140px; padding-block: 12px; resize: vertical; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--color-brand); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--color-brand); box-shadow: var(--focus-ring); outline: none; }
.field input[aria-invalid="true"]:not([type=checkbox]):not([type=radio]), .field select[aria-invalid="true"], .field textarea[aria-invalid="true"], .field.has-error input:not([type=checkbox]):not([type=radio]), .field.has-error select, .field.has-error textarea { border-color: var(--color-error); background: var(--color-error-bg); }
.field__error { color: var(--color-error); font-size: 14px; font-weight: 500; }
.field--check { grid-template-columns: auto 1fr; align-items: start; gap: 10px; }
.field--check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--color-brand); }
.field--check .field__label { font: 400 15px/1.45 var(--font-body); letter-spacing: 0; text-transform: none; color: var(--color-text); }
.form__error { color: var(--color-error); background: var(--color-error-bg); border-left: 3px solid var(--color-error); padding: 10px 12px; font-weight: 500; }
.form__success { color: var(--color-success); background: var(--color-success-bg); border-left: 3px solid var(--color-success); padding: 14px 16px; }

/* ── overlays ─────────────────────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; z-index: var(--z-modal); display: grid; place-items: center; padding: 16px;
  background: var(--color-scrim); opacity: 0; transition: opacity var(--dur-slow) var(--ease);
}
.overlay.is-open { opacity: 1; }
.overlay__panel {
  width: min(100%, 560px); max-height: calc(100vh - 32px); overflow: auto;
  background: var(--color-surface); border-top: 4px solid var(--color-brand); padding: 32px;
  box-shadow: var(--shadow-panel); transform: translateY(8px); transition: transform var(--dur-slow) var(--ease);
}
.overlay.is-open .overlay__panel { transform: none; }
.overlay--gate { background: rgb(20 23 42 / .82); z-index: calc(var(--z-modal) + 1); }

.gate__head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.gate__head .oct { --s: 64px; font-size: 20px; background: var(--color-text); }
.gate__h { font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem); line-height: 1; letter-spacing: -.045em; font-weight: 600; margin: 0 0 12px; }
.gate__p { color: var(--color-muted); margin: 0 0 22px; }
.gate__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.gate__actions .btn--primary { flex: 1 1 260px; }
.gate__actions .btn:not(.btn--primary) { flex: 0 1 120px; }
.gate__note { display: flex; gap: 8px; align-items: center; margin: 16px 0 0; padding: 10px 12px; border-left: 3px solid var(--color-accent); background: var(--color-bg); font-weight: 600; font-size: 14px; }
.gate__small { margin: 18px 0 0; padding-top: 12px; border-top: 1px solid var(--color-border); font-size: 13px; color: var(--color-muted); }

.cookiebar {
  position: fixed; left: calc(var(--rail) + 16px); right: 16px; bottom: 16px; z-index: var(--z-overlay);
  background: var(--color-surface); border: 1px solid var(--color-text); box-shadow: var(--shadow-panel);
  transition: opacity var(--dur-base) var(--ease-in), transform var(--dur-base) var(--ease-in);
}
.cookiebar.is-leaving { opacity: 0; transform: translateY(12px); }
.cookiebar__in { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px 20px; align-items: center; padding: 16px 20px; }
.cookiebar .oct { --s: 44px; }
.cookiebar__h { font-weight: 600; font-size: 16px; margin: 0 0 2px; }
.cookiebar__txt p { margin: 0; font-size: 14px; color: var(--color-muted); }
.cookiebar__txt a { color: var(--color-brand); text-underline-offset: 3px; }
.cookiebar__act { display: flex; flex-wrap: wrap; gap: 8px; }

.cset__head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 8px; }
.cset__h { font-size: var(--fs-h3); letter-spacing: -.03em; font-weight: 600; margin: 0; }
.cset__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--color-border); }
.cset__t { font-weight: 600; margin: 0 0 2px; }
.cset__d { margin: 0; font-size: 14px; color: var(--color-muted); }
.cset__act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }

.switch { position: relative; display: inline-block; width: 52px; height: 30px; cursor: pointer; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; }
.switch__ui { position: absolute; inset: 0; border: 1px solid var(--color-text); background: var(--color-bg); transition: background-color var(--dur-fast); }
.switch__ui::after { content: ""; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; background: var(--color-text); clip-path: var(--oct); transition: transform var(--dur-base) var(--ease), background-color var(--dur-fast); }
.switch input:checked + .switch__ui { background: var(--color-brand); border-color: var(--color-brand); }
.switch input:checked + .switch__ui::after { transform: translateX(22px); background: #fff; }
.switch input:focus-visible + .switch__ui { box-shadow: var(--focus-ring); }
.switch input:disabled + .switch__ui { opacity: .6; }
.switch input:disabled { cursor: not-allowed; }

/* ── responsive ───────────────────────────────────────────────────────── */
@media (max-width: 1279px) {
  .phead { grid-template-columns: auto minmax(0, 1fr); }
  .pmeta { grid-column: 1 / -1; }
}
@media (max-width: 1023px) {
  .cookiebar { left: 16px; }
  .cookiebar__in { grid-template-columns: auto minmax(0, 1fr); }
  .cookiebar__act { grid-column: 1 / -1; }
}
@media (max-width: 899px) {
  .span-4, .span-6, .span-8 { grid-column: 1 / -1; }
}
@media (max-width: 759px) {
  .sheet > * { grid-column: 1 / -1 !important; }
  .tile { padding: 22px 18px; }
  .docs li { grid-template-columns: auto 1fr; }
  .docs li .docs__act { grid-column: 1 / -1; padding-left: 30px; }
  .docs li .docs__act .ibtn { flex: 1; }
  .tab__d { display: none; }
  .tab { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; min-height: 88px; }
  .tab .oct { --s: 34px; font-size: 14px; }
  .tab__t span { font-size: 12px; }
  .panel { padding: 22px 16px; }
  .phead { grid-template-columns: 1fr; gap: 16px; }
  .phead__n { flex-direction: row; }
  .phead__n .oct { --s: 64px; font-size: 28px; }
  .retro li { grid-template-columns: 52px 1fr auto; }
  .retro li .docs__act { padding-left: 0; }
  .filters { padding: 16px; }
  .filters__act { width: 100%; }
  .filters__act .btn { flex: 1; }
  .overlay__panel { padding: 24px 20px; }
  .gate__actions .btn { flex: 1 1 100% !important; }
  .cookiebar { left: 8px; right: 8px; bottom: 8px; }
  .cookiebar__in { padding: 14px; gap: 12px; }
  .cookiebar .oct { display: none; }
  .cookiebar__in { grid-template-columns: 1fr; }
  .cookiebar__act .btn { flex: 1 1 auto; }
  .empty { padding: 20px; }
}

/* runners table → stacked cards. With the 248px rail the 7-column sheet (≈704px) does not fit
   below ~1180px, so the cards start there instead of at phone width. */
@media (max-width: 1180px) {
  /* runners table → stacked cards */
  .runners { overflow: visible; }
  .runners .psheet thead { display: none; }   /* each cell carries its label (data-label) in card mode */
  .runners .psheet, .runners .psheet tbody, .runners .psheet tr, .runners .psheet td { display: block; width: 100%; }
  .runners .psheet tr.runner { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 4px 12px; padding: 14px 0 12px; border-bottom: 1px solid var(--color-border); }
  .runners .psheet tr.runner:first-child { border-top: 1px solid var(--color-text); }
  .runners .psheet td { border: 0 !important; padding: 0 !important; }
  .runners .psheet td.horse { align-self: center; font-size: 18px; }
  .runners .psheet td[data-label] { grid-column: 2; display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 8px; font-size: 15px; }
  .runners .psheet td[data-label]::before { content: attr(data-label); font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; color: var(--color-muted); padding-top: 3px; }
  .runners .psheet td.act { grid-column: 2; padding-top: 6px !important; }
  .runners .psheet td.act:empty { display: none; }
  .runners .psheet tr[hidden] { display: none !important; }
  .xbtn { min-height: 44px; }
  tr.detail td { padding: 12px 14px !important; }
  .runners .psheet tr.detail { border-bottom: 1px solid var(--color-border); }
}
