/* Big Board admin: plain, neutral, colour only for the phases (wc-admin-portal-v2.jpg). */

:root {
  --bg: #F5F6F8;
  --panel: #FFFFFF;
  --line: #E4E7EC;
  --line-2: #EEF0F3;
  --text: #101828;
  --text-2: #344054;
  --muted: #667085;
  --ink: #111827;
  --focus: #2E6BE6;
  --green: #067647; --green-bg: #ECFDF3; --green-solid: #16A34A;
  --amber: #B54708; --amber-bg: #FEF0C7;
  --blue: #175CD3; --blue-bg: #EFF8FF;
  --red: #C01048; --red-bg: #FFF1F3; --red-solid: #D92D20;
  --grey-bg: #F2F4F7;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.loading { padding: 40px; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.strong { font-weight: 600; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.upper { text-transform: uppercase; }
.grow { flex: 1; }
.pad { padding: 14px 16px; }
.pad-s { padding: 6px 10px; margin: 0; }
.error-text { color: var(--red-solid); }
.link { color: var(--blue); font-weight: 500; text-decoration: none; cursor: pointer; }
.link:hover { text-decoration: underline; }
.stack { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.inline { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.scroll-x { overflow-x: auto; }
.sep { border: 0; border-top: 1px solid var(--line-2); margin: 16px 0; }
.icon { width: 16px; height: 16px; flex: none; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: #FBFBFC; border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 10px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 6px 10px; }
.brand strong { display: block; font-size: 14px; }
.brand span { display: block; font-size: 12px; color: var(--muted); }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: #101828; color: #F2B33D; font-weight: 800; font-size: 12px; display: grid; place-items: center; flex: none; }
.nav-group { margin-top: 6px; }
.nav-title { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #98A2B3; padding: 8px 8px 4px; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 7px; text-decoration: none; color: var(--text-2); font-size: 13.5px; }
.nav-item .icon { color: #667085; }
.nav-item:hover { background: var(--grey-bg); }
.nav-item.active { background: #EAECF0; color: var(--text); font-weight: 600; }
.nav-item.active .icon { color: var(--text); }
.nav-badge { margin-left: auto; font-size: 11px; font-weight: 600; background: var(--grey-bg); color: var(--muted); border-radius: 99px; padding: 0 7px; line-height: 18px; }
.nav-badge-red { background: var(--red-bg); color: var(--red); }
.whoami { margin-top: auto; display: flex; gap: 10px; align-items: center; padding: 12px 6px 0; border-top: 1px solid var(--line); }
.whoami strong { display: block; font-size: 13px; }
.whoami span { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: #EAECF0; color: var(--text-2); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }

.main { padding: 22px 26px 48px; min-width: 0; }
.page { display: flex; flex-direction: column; gap: 16px; max-width: 1360px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.crumb { font-size: 12px; color: var(--muted); }
.title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.title-row h1 { font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.page-actions input[type=search] { width: 260px; }
.sim-note { margin-top: 6px; font-size: 12px; color: var(--amber); background: var(--amber-bg); display: inline-block; padding: 2px 8px; border-radius: 6px; }

/* ---------- panels ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.panel.narrow { max-width: 720px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); min-height: 48px; }
.panel-head h3 { font-size: 14px; font-weight: 650; }
.panel-sub { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.panel-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--line-2); }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.empty strong { color: var(--text-2); display: block; margin-bottom: 4px; }
.empty p { margin: 0; }

/* ---------- buttons, inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 13px; border: 1px solid #D0D5DD; background: #fff; border-radius: 8px; font-weight: 550; font-size: 13.5px; cursor: pointer; text-decoration: none; white-space: nowrap; color: var(--text-2); box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.btn:hover { background: #F9FAFB; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: #1F2937; }
.btn-approve { background: var(--green-solid); border-color: var(--green-solid); color: #fff; }
.btn-approve:hover { background: #15803D; }
.btn-danger { background: var(--red-solid); border-color: var(--red-solid); color: #fff; }
.btn-ghost-danger { color: var(--red-solid); border-color: transparent; box-shadow: none; background: transparent; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn-block { width: 100%; }
.icon-btn { width: 28px; height: 28px; display: inline-grid; place-items: center; border: 0; background: transparent; border-radius: 6px; cursor: pointer; color: var(--muted); }
.icon-btn:hover { background: var(--grey-bg); color: var(--text); }

input[type=text], input[type=password], input[type=number], input[type=url], input[type=search], input[type=date], input[type=time], select {
  height: 34px; border: 1px solid #D0D5DD; border-radius: 8px; padding: 0 10px; background: #fff; min-width: 0; width: 100%;
}
select { padding-right: 28px; }
input:disabled, select:disabled { background: var(--grey-bg); color: var(--muted); }
.inline select, .inline input { width: auto; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field-hint { font-size: 12px; color: var(--muted); }
.check-line { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.num { width: 90px !important; text-align: right; font-variant-numeric: tabular-nums; }
.num-sm { width: 60px !important; }
.row-actions { display: flex; gap: 8px; }
.note { font-size: 12.5px; color: var(--muted); margin: 0; }
.note-danger { color: var(--red-solid); }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13px; font-weight: 550; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { width: 36px; height: 20px; border-radius: 99px; background: #D0D5DD; position: relative; transition: background .15s; flex: none; }
.switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + .switch-track { background: var(--green-solid); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--focus); outline-offset: 2px; }

.stepper { display: inline-flex; align-items: center; border: 1px solid #D0D5DD; border-radius: 8px; overflow: hidden; height: 34px; }
.stepper-btn { width: 32px; height: 100%; border: 0; background: #F9FAFB; cursor: pointer; font-size: 16px; }
.stepper-btn:hover { background: #EAECF0; }
.stepper-value { min-width: 34px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.sets-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; border-radius: 99px; padding: 1px 9px; line-height: 20px; white-space: nowrap; }
.pill + .pill { margin-left: 4px; }
.pill-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-green { background: var(--green-bg); color: var(--green); }
.pill-amber { background: var(--amber-bg); color: var(--amber); }
.pill-blue { background: var(--blue-bg); color: var(--blue); }
.pill-red { background: var(--red-bg); color: var(--red); }
.pill-grey { background: var(--grey-bg); color: var(--muted); }
.pill-gold { background: #FEF7C3; color: #854A0E; }
.pill-outline { border: 1px solid var(--line); color: var(--text-2); background: #fff; font-weight: 500; }
.tag-mini { font-size: 10.5px; font-weight: 700; margin-left: 8px; color: #854A0E; background: #FEF7C3; padding: 1px 6px; border-radius: 4px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 9px 12px; border-bottom: 1px solid var(--line); background: #FCFCFD; white-space: nowrap; }
.table td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody:last-child tr:last-child td { border-bottom: 0; }
.table.compact td, .table.compact th { padding: 6px 10px; }
.table.clickable tbody tr { cursor: pointer; }
.table.clickable tbody tr:hover td { background: #F9FAFB; }
.table tr.current td { background: #F5F8FF; }
.table td { font-variant-numeric: tabular-nums; }
.table.kv th { width: 180px; background: transparent; border-bottom: 1px solid var(--line-2); font-size: 13px; color: var(--muted); font-weight: 500; }
.diff-scroll { max-height: 380px; overflow: auto; }
.diff-scroll thead th { position: sticky; top: 0; z-index: 1; }
.diff { table-layout: fixed; }
.diff th:nth-child(1) { width: 27%; } .diff th:nth-child(2) { width: 29%; } .diff th:nth-child(3) { width: 19%; }
.diff .diff-item { vertical-align: top; }
.diff-group + .diff-group tr:first-child td { border-top: 1px solid var(--line); }
.diff .diff-field { font-family: var(--mono); font-size: 11.5px; color: var(--text-2); overflow-wrap: anywhere; }
.diff td .muted { white-space: nowrap; }
.diff td { overflow-wrap: break-word; }
.diff .diff-val { overflow-wrap: anywhere; }
.diff .before { color: var(--muted); }
.diff .after { color: var(--green); font-weight: 600; }
.format-table td:nth-child(2) { width: 34%; }
.stats-table { max-width: 520px; }
.stats-table th:first-child { width: 140px; }

.legs { display: flex; flex-direction: column; gap: 6px; }
.leg-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.leg-row > span:first-child { width: 44px; }

/* ---------- tabs ---------- */
.tabs { display: flex; align-items: center; gap: 4px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tab { padding: 9px 0; text-decoration: none; color: var(--muted); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 6px; align-items: center; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--ink); }
.tab-badge { font-size: 11px; color: var(--amber); font-weight: 700; }
.tab-day { color: var(--muted); font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.tab-select { height: 28px !important; width: auto !important; font-size: 13px; }
.tab-select.active { border-color: var(--ink); }

/* ---------- banners, checks ---------- */
.banner { display: flex; align-items: center; gap: 10px; border-radius: 10px; padding: 10px 14px; font-size: 13.5px; border: 1px solid var(--line); background: #fff; }
.banner > span { flex: 1; }
.banner-error { background: var(--red-bg); border-color: #FECDD6; color: #89123E; }
.banner-warn { background: #FFFAEB; border-color: #FEDF89; color: #93370D; }
.banner-info { background: var(--blue-bg); border-color: #D1E9FF; color: #194185; }
.center-page { max-width: 560px; margin: 80px auto; padding: 0 16px; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.check:last-child { border-bottom: 0; }
.check-icon { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.check-ok .check-icon { color: var(--green-solid); }
.check-warn .check-icon { color: #F79009; }
.check-error .check-icon { color: var(--red-solid); }
.check-error strong { color: #89123E; }
.issues { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.issue { padding-left: 20px; position: relative; }
.issue::before { position: absolute; left: 0; top: 0; font-weight: 800; }
.issue-ok { color: var(--green); }
.issue-ok::before { content: "✓"; }
.issue-warn { color: var(--amber); }
.issue-warn::before { content: "!"; left: 4px; }
.issue-error { color: var(--red-solid); }
.issue-error::before { content: "✕"; }

/* ---------- toasts, modal ---------- */
.toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; max-width: calc(100vw - 40px); }
.toast { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 9px; font-size: 13.5px; box-shadow: 0 10px 30px rgba(16,24,40,.2); transition: opacity .3s, transform .3s; max-width: 420px; }
.toast-error { background: #89123E; }
.toast-success { background: #075E3A; }
.toast.out { opacity: 0; transform: translateY(6px); }
.modal-back { position: fixed; inset: 0; background: rgba(16, 24, 40, .45); display: grid; place-items: center; padding: 20px; z-index: 50; overflow-y: auto; }
.modal { background: #fff; border-radius: 12px; width: min(520px, 100%); box-shadow: 0 20px 50px rgba(16,24,40,.25); display: flex; flex-direction: column; max-height: calc(100vh - 40px); }
.modal-wide { width: min(820px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.modal-head h2 { font-size: 16px; }
.modal-body { padding: 16px 18px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line-2); }
.modal-text { margin: 0; color: var(--text-2); }

/* ---------- login ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(380px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 26px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 8px 30px rgba(16,24,40,.06); }
.brand-login { padding: 0 0 6px; }
.login-error { color: var(--red-solid); font-size: 13px; min-height: 18px; }
.login-note { font-size: 12px; color: var(--muted); margin: 0; }

/* ---------- status ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi-label { font-size: 12px; color: var(--muted); }
.kpi-value { font-size: 22px; font-weight: 750; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12px; color: var(--muted); }
.phase-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }

.timeline { padding: 4px 0 0; }
.tl-track { position: relative; height: 58px; }
.tl-bar { position: absolute; left: 0; right: 0; top: 24px; height: 26px; }
.tl-seg { position: absolute; top: 0; height: 26px; border-radius: 5px; color: #fff; font-size: 11.5px; font-weight: 650; display: flex; align-items: center; padding: 0 8px; overflow: hidden; white-space: nowrap; }
.tl-seg span { overflow: hidden; text-overflow: ellipsis; }
.tl-today { position: absolute; top: 4px; bottom: 0; width: 2px; background: var(--red-solid); transform: translateX(-1px); }
.tl-today span { position: absolute; top: -2px; left: 4px; font-size: 11px; color: var(--red-solid); font-weight: 700; }
.tl-ticks { position: relative; height: 18px; margin-top: 4px; }
.tl-tick { position: absolute; font-size: 11px; color: var(--muted); transform: translateX(-50%); white-space: nowrap; }
.tl-tick:first-child { transform: none; }
.tl-tick:last-child { transform: translateX(-100%); }
.tl-manual .tl-bar { opacity: .55; }
.tl-override { margin-top: 8px; font-size: 12.5px; color: var(--amber); }

.phase-cards { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.phase-card { position: relative; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 12px 10px 10px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-height: 84px; }
.phase-card:hover { border-color: #98A2B3; }
.phase-card.live { border: 2px solid var(--ink); padding: 11px 9px 9px; }
.phase-bar { height: 4px; border-radius: 3px; margin-bottom: 8px; }
.phase-card strong { font-size: 13px; }
.phase-desc { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.phase-live { position: absolute; top: 9px; right: 9px; font-size: 10.5px; font-weight: 700; color: var(--green); background: var(--green-bg); padding: 0 6px; border-radius: 4px; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.home-form { display: flex; flex-direction: column; gap: 14px; }
.home-form .inline select:first-child { flex: 1; }
.preview-host { margin-top: 6px; }

/* ---------- import ---------- */
.import-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.editor { display: flex; height: 560px; border-bottom: 1px solid var(--line-2); }
.editor.editor-short { height: 200px; }
.gutter { margin: 0; padding: 12px 8px 12px 12px; color: #98A2B3; text-align: right; font: 12.5px/1.6 var(--mono); overflow: hidden; user-select: none; background: #FCFCFD; border-right: 1px solid var(--line-2); min-width: 46px; }
.code { flex: 1; border: 0; resize: none; padding: 12px; font: 12.5px/1.6 var(--mono); color: #1D2939; white-space: pre; overflow: auto; outline: none; background: #fff; tab-size: 2; }
.code:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); outline: none; }
.previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }

/* ---------- order of play ---------- */
.days-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 14px; align-items: start; }
.sessions { display: flex; flex-direction: column; }
.session { padding: 10px 16px; border-bottom: 1px solid var(--line-2); }
.session:last-child { border-bottom: 0; }
.session-head { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.session-head .mono { margin-left: auto; }
.om-list { margin: 0; padding: 0 0 0 22px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.om-list li { padding-left: 4px; }
.om-list li > * + * { margin-left: 8px; }
.om-edit li { display: flex; align-items: center; gap: 6px; }
.om-edit li > * + * { margin-left: 0; }
.session-edit { border: 1px solid var(--line); border-radius: 9px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.session-edit > select { width: 100%; }

/* ---------- draw ---------- */
.bracket { display: flex; gap: 18px; min-width: max-content; }
.br-col { display: flex; flex-direction: column; width: 200px; }
.br-head { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--text-2); padding-bottom: 8px; }
.br-list { display: flex; flex-direction: column; justify-content: space-around; flex: 1; gap: 8px; }
.br-match { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; font-size: 12.5px; }
.br-match.br-on { border-color: #FDA29B; }
.br-side { display: flex; justify-content: space-between; padding: 4px 8px; gap: 6px; }
.br-side + .br-side { border-top: 1px solid var(--line-2); }
.br-side.win { font-weight: 700; }
.br-side.tbd { color: #98A2B3; }
.br-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.br-seed { color: var(--muted); font-weight: 400; }
.br-score { font-variant-numeric: tabular-nums; }
.br-meta { display: flex; gap: 8px; background: #FCFCFD; border-top: 1px solid var(--line-2); padding: 2px 8px; font-size: 10.5px; color: var(--muted); }
.br-on { color: var(--red-solid); font-weight: 700; margin-left: auto; }

/* ---------- leg / checkout ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.leg-editor { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.picker { display: flex; flex-direction: column; gap: 8px; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid #D0D5DD; border-radius: 8px; overflow: hidden; }
.seg { border: 0; background: #fff; height: 32px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--text-2); }
.seg + .seg { border-left: 1px solid #D0D5DD; }
.seg.active { background: var(--ink); color: #fff; }
.dart-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.dart-key { height: 34px; border: 1px solid var(--line); background: #F9FAFB; border-radius: 7px; cursor: pointer; font-weight: 600; font-variant-numeric: tabular-nums; }
.dart-key:hover { background: #EAECF0; }
.dart-key.wide { grid-column: span 1; }
.dart-key.muted { color: var(--muted); }
.visits { display: flex; flex-direction: column; gap: 4px; }
.visit-row { display: grid; grid-template-columns: 60px 1fr 40px 60px; gap: 8px; align-items: center; font-size: 13px; }
.route-row { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.dart-chip { font: 600 12px/20px var(--mono); padding: 0 6px; border-radius: 5px; background: var(--grey-bg); color: var(--text-2); }
.dart-T { background: #EEF4FF; color: #3538CD; }
.dart-D, .dart-B { background: var(--green-bg); color: var(--green); }
.totals { display: flex; gap: 18px; font-size: 13px; color: var(--muted); }
.totals strong { color: var(--text); font-variant-numeric: tabular-nums; }
.side-list { list-style: none; margin: 0; padding: 6px; }
.side-list a { display: flex; flex-direction: column; padding: 7px 10px; border-radius: 7px; text-decoration: none; font-size: 13px; }
.side-list a span { color: var(--muted); font-size: 12px; }
.side-list a:hover { background: var(--grey-bg); }
.side-list a.active { background: #EAECF0; }

/* ---------- format ---------- */
.rules { margin: 0; display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: 13px; }
.rules dt { font-weight: 600; }
.rules dd { margin: 0; color: var(--text-2); }
.steps { margin: 0 0 10px; padding-left: 20px; display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.code-block { margin: 0; padding: 14px 16px; font: 12.5px/1.55 var(--mono); overflow-x: auto; background: #FCFCFD; border-radius: 0 0 var(--radius) var(--radius); }

/* ---------- app previews (the event's purple night style) ---------- */
.hc { position: relative; overflow: hidden; border-radius: 16px; padding: 14px 16px; color: #fff; min-height: 126px; display: flex; flex-direction: column; gap: 6px;
  background: linear-gradient(135deg, #3B1E7A 0%, #2A1461 48%, #4A1747 100%); border: 1px solid rgba(255,255,255,.12); box-shadow: 0 6px 18px rgba(42, 20, 97, .25); font-family: ui-rounded, "SF Pro Rounded", var(--font); }
.hc-glow { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 80% at 100% 0%, rgba(229, 55, 91, .28), transparent 60%); }
.hc > * { position: relative; }
.hc-opening { background: linear-gradient(135deg, #4B1B6E 0%, #2E1460 50%, #6A1440 100%); }
.hc-opening .hc-glow { background: radial-gradient(120% 90% at 100% 0%, rgba(229, 55, 91, .45), transparent 60%); }
.hc-xmas { background: linear-gradient(135deg, #123F35 0%, #1E2A5E 55%, #2A1461 100%); }
.hc-xmas .hc-glow { background: radial-gradient(110% 80% at 0% 0%, rgba(31, 122, 77, .5), transparent 60%); }
.hc-final { background: linear-gradient(135deg, #3B1E7A 0%, #2A1461 55%, #5A2A1A 100%); border-color: rgba(232, 119, 46, .55); }
.hc-final .hc-glow { background: radial-gradient(120% 80% at 100% 100%, rgba(232, 119, 46, .35), transparent 60%); }
.hc-champion { background: linear-gradient(135deg, #3B1E7A 0%, #2A1461 50%, #4A3410 100%); border-color: rgba(242, 179, 61, .6); }
.hc-champion .hc-glow { background: radial-gradient(120% 80% at 100% 0%, rgba(242, 179, 61, .3), transparent 60%); }
.hc-leg-card { background: linear-gradient(135deg, #4A2B12 0%, #3A1E5A 100%); border-color: rgba(242, 179, 61, .55); min-height: 96px; }
.hc-co-card { background: linear-gradient(135deg, #2A1461 0%, #3B1E7A 100%); min-height: 96px; }
.hc-closed { background: repeating-linear-gradient(-45deg, #F9FAFB 0 10px, #F2F4F7 10px 20px); color: var(--muted); border: 1px dashed #D0D5DD; box-shadow: none; justify-content: center; align-items: flex-start; font-family: var(--font); font-size: 13px; }
.hc-closed strong { color: var(--text-2); font-size: 15px; }
.hc-tag { align-self: flex-start; display: inline-flex; gap: 5px; align-items: center; font-size: 10px; font-weight: 800; letter-spacing: .06em; padding: 2px 8px; border-radius: 99px; background: #E5375B; color: #fff; }
.hc-tag-dot { width: 6px; height: 6px; border-radius: 50%; background: #fff; }
.hc-tag-green { background: #1F7A4D; }
.hc-tag-orange { background: #F2B33D; color: #2A1A00; }
.hc-tag-orange .hc-tag-dot { background: #2A1A00; }
.hc-tag-gold { background: #F2B33D; color: #2A1A00; }
.hc-tag-plain { background: rgba(255,255,255,.12); color: #E9E3FF; }
.hc-title { font-size: 19px; font-weight: 800; line-height: 1.15; letter-spacing: -.01em; }
.hc-big { font-size: 24px; }
.hc-gold { color: #F2B33D; }
.hc-sub { font-size: 12px; color: #D9D0F5; }
.hc-msg { margin-top: 2px; color: #FFFFFF; font-weight: 600; }
.hc-mono { font-family: var(--mono); font-size: 11.5px; }
.hc-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hc-cta { background: #F2B33D; color: #2A1A00; font-weight: 800; font-size: 12px; border-radius: 99px; padding: 4px 12px; white-space: nowrap; flex: none; }
.hc-countdown { display: flex; align-items: flex-start; gap: 4px; margin-top: 2px; }
.hc-unit { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.hc-digits { display: flex; gap: 3px; }
.hc-digit { width: 22px; height: 28px; border-radius: 5px; background: rgba(255,255,255,.95); color: #1B0F3D; font-weight: 900; font-size: 17px; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.hc-unit-label { font-size: 8.5px; font-weight: 700; letter-spacing: .08em; color: #C9BEEE; }
.hc-colon { color: #C9BEEE; font-weight: 800; padding-top: 5px; }
.hc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.hc-stat { background: rgba(10, 4, 30, .35); border: 1px solid rgba(255,255,255,.1); border-radius: 9px; padding: 5px 9px; display: flex; flex-direction: column; }
.hc-stat span { font-size: 10px; color: #C9BEEE; }
.hc-stat strong { font-size: 14px; }
.hc-leg { font-size: 12px; color: #E9E3FF; }
.hc-finalists { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hc-finalist { display: flex; flex-direction: column; }
.hc-finalist strong { font-size: 16px; }
.hc-finalist span { font-size: 10.5px; color: #D9D0F5; }
.hc-r { text-align: right; }
.hc-v { color: #C9BEEE; font-weight: 700; }
.hc-foot { font-size: 11px; color: #F2B33D; font-weight: 700; }

/* ---------- narrow screens: usable, not designed for ---------- */
@media (max-width: 1180px) {
  .phase-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .import-grid, .split { grid-template-columns: minmax(0, 1fr); }
  .home-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 2px; width: 100%; }
  .nav-group { display: contents; }
  .nav-title { display: none; }
  .whoami { display: none; }
  .main { padding: 16px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-3, .leg-editor { grid-template-columns: minmax(0, 1fr); }
  .phase-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .days-grid { grid-template-columns: minmax(0, 1fr); }
  .page-actions input[type=search] { width: 100%; }
}
