/* Arch & Flo Non-League — shared interface kit.
   Club identity arrives as --brand / --on-brand / --accent / --on-accent, set per tenant.
   Everything else is neutral so each club's colours carry the personality. */
@font-face { font-family: "Figtree"; src: url("../fonts/figtree-latin-wght-normal.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("../fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("../fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("../fonts/barlow-condensed-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; }
:root {
  /* One type scale (standards 4.0.0, MOBILE_STANDARD §2): six sizes, nothing under 12px, body 16px. */
  --fs-1: 12px; --fs-2: 14px; --fs-3: 16px; --fs-4: 20px; --fs-5: 28px; --fs-6: 40px;
  --brand: #14213d; --on-brand: #fff; --accent: #f2b632; --on-accent: #111418;
  --bg: #f4f2ee; --surface: #ffffff; --surface-2: #ebe8e1; --ink: #14171c; --ink-2: #5a616c; --line: #dcd8cf;
  --good: #0f7b4f; --warn: #b45309; --bad: #b42318; --info: #1d5fbf;
  --pitch: #2f7d4a; --pitch-2: #2a7243;
  --r-s: 8px; --r-m: 14px; --r-l: 22px;
  --shadow: 0 1px 2px rgb(20 23 28 / .06), 0 6px 20px rgb(20 23 28 / .06);
  --font: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Barlow Condensed", "Avenir Next Condensed", "Arial Narrow", "Roboto Condensed", var(--font);
  --tap: 44px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1116; --surface: #171b22; --surface-2: #1f242d; --ink: #f1f3f5; --ink-2: #9aa3af; --line: #2a303a;
    --good: #34d399; --warn: #fbbf24; --bad: #f87171; --info: #7fb2ff;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px rgb(0 0 0 / .3);
  }
}
:root[data-theme="dark"] {
  --bg: #0e1116; --surface: #171b22; --surface-2: #1f242d; --ink: #f1f3f5; --ink-2: #9aa3af; --line: #2a303a;
  --good: #34d399; --warn: #fbbf24; --bad: #f87171; --info: #7fb2ff;
  --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px rgb(0 0 0 / .3);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: var(--fs-3)/1.45 var(--font); -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
h1, h2, h3, h4 { font-family: var(--display); letter-spacing: 0; line-height: 1.02; margin: 0; font-weight: 800; text-wrap: balance; }
h1 { font-size: var(--fs-6); text-transform: uppercase; letter-spacing: -.005em; } h2 { font-size: var(--fs-5); } h3 { font-size: var(--fs-4); font-weight: 700; } h4 { font-size: var(--fs-3); font-weight: 700; }
p { margin: 0 0 .6em; } a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--ink-2); } .small { font-size: var(--fs-2); } .tiny { font-size: var(--fs-1); }
.num { font-variant-numeric: tabular-nums; } .right { text-align: right; } .center { text-align: center; }
.upper { text-transform: uppercase; letter-spacing: .1em; font: 700 var(--fs-2)/1.2 var(--display); color: var(--ink-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Layout */
.page { max-width: 1080px; margin: 0 auto; padding: 16px 16px 96px; display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.stack { display: grid; gap: 12px; } .stack.tight { gap: 6px; } .stack.loose { gap: 20px; }
.row { display: flex; align-items: center; gap: 10px; } .row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 6px; }

/* Surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.brand { background: var(--brand); color: var(--on-brand); border-color: transparent; }
.card.brand .muted, .card.brand .upper { color: color-mix(in srgb, var(--on-brand) 72%, transparent); }
.card.tap { cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; text-decoration: none; display: block; }
.card.tap:hover { transform: translateY(-2px); }
.card.tap:active { transform: scale(.99); }
.hero { border-radius: var(--r-l); padding: 24px 20px; background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 70%, #000)); color: var(--on-brand); position: relative; overflow: hidden; }
.hero .muted { color: color-mix(in srgb, var(--on-brand) 75%, transparent); }

/* Buttons */
.btn { min-height: var(--tap); padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 650; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; transition: transform .1s ease, filter .15s ease; max-width: 100%; text-align: center; line-height: 1.15; }
.btn:hover { filter: brightness(1.05); } .btn:active { transform: scale(.97); }
.btn.primary { background: var(--brand); color: var(--on-brand); border-color: transparent; }
.btn.accent { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.danger { color: var(--bad); }
.btn.small { min-height: 44px; padding: 0 12px; font-size: var(--fs-2); }
.btn.icon { width: var(--tap); padding: 0; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.hero .btn.primary, .card.brand .btn.primary { background: var(--accent); color: var(--on-accent); }

/* Badges & chips */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: var(--fs-1); font-weight: 700; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.badge.good { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.badge.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.badge.bad { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.badge.info { background: color-mix(in srgb, var(--info) 16%, transparent); color: var(--info); }
.badge.brand { background: var(--brand); color: var(--on-brand); }
.badge.synthetic { background: transparent; border: 1px dashed var(--ink-2); color: var(--ink-2); font-weight: 600; }
.badge.sim { background: color-mix(in srgb, #7c3aed 16%, transparent); color: #7c3aed; }
.chip { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; font-size: var(--fs-2); }
.chip[aria-pressed="true"], .chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Lists & tables */
.list { display: grid; }
.list > .item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); min-height: 56px; text-decoration: none; }
.list > .item:first-child { border-top: 0; }
.list > .item.tap { cursor: pointer; } .list > .item.tap:hover { background: var(--surface-2); }
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: var(--fs-2); }
.table th { text-align: left; font-size: var(--fs-1); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); padding: 8px 10px; white-space: nowrap; }
.table td { padding: 10px; border-top: 1px solid var(--line); white-space: nowrap; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr.me td { background: color-mix(in srgb, var(--accent) 16%, transparent); font-weight: 700; }
.table tr.tap { cursor: pointer; } .table tr.tap:hover td { background: var(--surface-2); }

/* Stats */
.stat { background: var(--surface-2); border-radius: var(--r-s); padding: 10px 12px; }
.stat-value { font: 800 var(--fs-5)/1 var(--display); font-variant-numeric: tabular-nums; }
.stat-label { font-size: var(--fs-1); color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; margin-top: 4px; }
.bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }

/* Forms */
.field { display: grid; gap: 4px; }
.field-label { font-size: var(--fs-1); font-weight: 650; color: var(--ink-2); }
.field-hint { font-size: var(--fs-1); color: var(--ink-2); }
input, select, textarea { min-height: var(--tap); padding: 8px 12px; border-radius: var(--r-s); border: 1px solid var(--line); background: var(--surface); width: 100%; }
input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; min-height: 0; accent-color: var(--brand); }
input[type="range"] { padding: 0; accent-color: var(--brand); border: 0; background: transparent; }
textarea { min-height: 88px; resize: vertical; }
.form { display: grid; gap: 12px; }
.form.cols { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }

/* Tabs */
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.tab { min-height: 44px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; font-weight: 650; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.tab[aria-selected="true"] { background: var(--ink); color: var(--bg); }

/* Sheet (native dialog) */
dialog.sheet { border: 0; padding: 0; border-radius: var(--r-l); background: var(--surface); color: var(--ink); width: min(560px, calc(100vw - 24px)); max-height: min(86vh, 860px); box-shadow: 0 24px 80px rgb(0 0 0 / .35); }
dialog.sheet.wide { width: min(880px, calc(100vw - 24px)); }
dialog.sheet::backdrop { background: rgb(8 10 14 / .55); backdrop-filter: blur(3px); }
dialog.sheet[open] { display: flex; flex-direction: column; animation: sheet-in .22s ease; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 8px 20px; }
.sheet-body { padding: 8px 20px 20px; overflow: auto; display: grid; gap: 12px; }
.sheet-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
@keyframes sheet-in { from { transform: translateY(16px); opacity: 0; } }

/* Toast */
.toast-host { position: fixed; left: 0; right: 0; bottom: 88px; display: grid; justify-items: center; gap: 8px; z-index: 100; pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: var(--fs-2); box-shadow: var(--shadow); animation: sheet-in .2s ease; transition: opacity .3s; }
.toast.good { background: var(--good); color: #fff; } .toast.bad { background: var(--bad); color: #fff; }
.toast.out { opacity: 0; }

.empty { color: var(--ink-2); text-align: center; padding: 24px 12px; margin: 0; }
.crest { display: inline-block; flex: none; } .crest svg { display: block; width: 100%; height: 100%; }
.notice { border-radius: var(--r-s); padding: 10px 12px; font-size: var(--fs-2); background: color-mix(in srgb, var(--info) 10%, transparent); border: 1px solid color-mix(in srgb, var(--info) 30%, transparent); }
.notice.warn { background: color-mix(in srgb, var(--warn) 10%, transparent); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* Touch targets: at least 44 × 44 CSS pixels everywhere (standards 4.0.0, MOBILE_STANDARD §2.3). */
.btn, .chip, .tab, summary, button.item, a.item { min-height: 44px; }
.btn { min-width: 44px; }
a.small, .section-head a, .tiny a, .small a, p a { display: inline-flex; align-items: center; min-height: 44px; }
.btn.icon { min-width: 44px; min-height: 44px; }
input, select, textarea { font-size: var(--fs-3); min-height: 44px; }
/* Body copy at 16px; tables keep 16px figures with tighter padding. */
table.table { font-size: var(--fs-3); }
.table td { padding: 8px 8px; }
