/* KSIA Annual Gathering — Tournament Manager theme
   ------------------------------------------------------------------
   BRAND PLACEHOLDER: official KSIA brand guidelines/logos were not supplied.
   Replace the tokens below and /static/shared/logo.svg with the official
   assets — every screen reads colours, fonts and radii from these variables. */
:root {
  --brand: #0b3b5c;          /* primary (navy) */
  --brand-2: #12507a;
  --brand-ink: #ffffff;
  --accent: #f2b632;         /* secondary (gold) */
  --accent-ink: #1d1600;
  --teal: #0f8b8d;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #94a3b8;
  --ok: #15803d;   --ok-bg: #dcfce7;
  --warn: #b45309; --warn-bg: #fef3c7;
  --err: #b91c1c;  --err-bg: #fee2e2;
  --info: #1d4ed8; --info-bg: #dbeafe;
  --live: #dc2626;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, .18);
  --font: 'Inter', 'Noto Kufi Arabic', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --sport-jackaroo: #7c3aed;
  --sport-baloot: #c2410c;
  --sport-padel: #0f8b8d;
  --sport-football: #15803d;
  /* flat geometric brand pattern */
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.07' stroke-width='2'%3E%3Cpath d='M24 4 44 24 24 44 4 24Z'/%3E%3Ccircle cx='24' cy='24' r='6'/%3E%3C/g%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--brand-2); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.2; }
h1 { font-size: 1.5rem; font-weight: 800; } h2 { font-size: 1.15rem; font-weight: 700; } h3 { font-size: 1rem; font-weight: 700; }
.muted { color: var(--ink-2); } .faint { color: var(--ink-3); } .small { font-size: 12px; } .tiny { font-size: 11px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.nowrap { white-space: nowrap; } .right { text-align: right; } .center { text-align: center; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; } .row.end { justify-content: flex-end; } .row.top { align-items: flex-start; }
.col { display: flex; flex-direction: column; gap: .5rem; }
.grow { flex: 1 1 auto; min-width: 0; }
.grid { display: grid; gap: 1rem; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.mt { margin-top: 1rem; } .mt-s { margin-top: .5rem; } .mb { margin-bottom: 1rem; } .mb-s { margin-bottom: .5rem; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.boot { min-height: 100vh; display: grid; place-content: center; text-align: center; color: var(--ink-2); }

/* ---------- cards & panels */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; }
.card.flat { box-shadow: none; }
.card > header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .75rem; flex-wrap: wrap; }
.card > header h2, .card > header h3 { margin: 0; }
.section-title { display: flex; align-items: center; gap: .5rem; margin: 1.25rem 0 .6rem; }
.section-title h2 { margin: 0; }
.empty { text-align: center; padding: 2rem 1rem; color: var(--ink-2); border: 1px dashed var(--line-2); border-radius: var(--radius); background: var(--surface-2); }
.empty i { font-size: 1.6rem; color: var(--ink-3); display: block; margin-bottom: .5rem; }

/* ---------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  padding: .5rem .85rem; border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; font-size: 13px; line-height: 1.2; text-decoration: none; white-space: nowrap; min-height: 36px; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--surface-2); border-color: var(--ink-3); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: var(--brand-2); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.success { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { background: var(--surface); border-color: #fca5a5; color: var(--err); }
.btn.danger:hover { background: var(--err-bg); }
.btn.danger.solid { background: var(--err); color: #fff; border-color: var(--err); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: rgba(15, 23, 42, .06); }
.btn.sm { padding: .3rem .55rem; min-height: 28px; font-size: 12px; }
.btn.lg { padding: .75rem 1.1rem; min-height: 46px; font-size: 15px; }
.btn.icon { padding: .35rem; min-width: 32px; }
.btn-group { display: inline-flex; } .btn-group .btn { border-radius: 0; } .btn-group .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); } .btn-group .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; } .btn-group .btn + .btn { margin-left: -1px; }
.btn-group .btn.on { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ---------- forms */
label.field { display: flex; flex-direction: column; gap: .25rem; font-size: 12px; font-weight: 600; color: var(--ink-2); }
label.field > span.hint { font-weight: 400; color: var(--ink-3); }
.input, input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=search], select, textarea {
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff; padding: .45rem .6rem; min-height: 36px; font-size: 14px; width: 100%; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--brand-2); }
input.sm, select.sm { min-height: 30px; padding: .25rem .4rem; font-size: 13px; }
input.invalid, select.invalid { border-color: var(--err); background: var(--err-bg); }
input.changed, select.changed { border-color: var(--accent); background: #fffbeb; }
textarea { min-height: 70px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--brand); }
.check { display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; font-size: 13px; }
.form-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.form-grid .span-2 { grid-column: span 2; } .form-grid .span-all { grid-column: 1 / -1; }
@media (max-width: 520px) { .form-grid .span-2 { grid-column: auto; } }
.search { position: relative; } .search i { position: absolute; left: .65rem; top: 50%; transform: translateY(-50%); color: var(--ink-3); } .search input { padding-left: 2rem; }

/* ---------- badges & pills */
.badge { display: inline-flex; align-items: center; gap: .25rem; padding: .1rem .45rem; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge.err { background: var(--err-bg); color: var(--err); border-color: transparent; }
.badge.info { background: var(--info-bg); color: var(--info); border-color: transparent; }
.badge.brand { background: var(--brand); color: #fff; border-color: transparent; }
.badge.gold { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.badge.live { background: var(--live); color: #fff; border-color: transparent; }
.badge.live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: pulse 1.4s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .25 } }
.sport-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.sport-jackaroo { --sport: var(--sport-jackaroo); } .sport-baloot { --sport: var(--sport-baloot); } .sport-padel { --sport: var(--sport-padel); } .sport-football { --sport: var(--sport-football); }
.sport-dot { background: var(--sport, var(--brand)); }

/* ---------- alerts */
.alert { display: flex; gap: .6rem; align-items: flex-start; padding: .7rem .85rem; border-radius: var(--radius-sm); border: 1px solid; font-size: 13px; }
.alert i { margin-top: 2px; }
.alert.info { background: var(--info-bg); border-color: #bfdbfe; color: #1e3a8a; }
.alert.warn { background: var(--warn-bg); border-color: #fde68a; color: #78350f; }
.alert.err { background: var(--err-bg); border-color: #fecaca; color: #7f1d1d; }
.alert.ok { background: var(--ok-bg); border-color: #bbf7d0; color: #14532d; }
.alert ul { margin: .25rem 0 0; padding-left: 1.1rem; }

/* ---------- tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); background: var(--surface-2); padding: .55rem .6rem; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.table td { padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr.sel td { background: #fffbeb; }
.table tr.err td { background: #fff5f5; } .table tr.warnrow td { background: #fffdf2; } .table tr.done td { color: var(--ink-2); } .table tr.off td { opacity: .45; }
.table tbody tr:hover td { background: #f8fafc; }

/* ---------- admin layout */
body.admin { background: var(--bg); }
.layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: var(--brand); color: #dbe7f1; background-image: var(--pattern); padding: 1rem .75rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 1rem; }
.brandmark { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; padding: 0 .25rem; }
.brandmark img { width: 38px; height: 38px; border-radius: 8px; }
.brandmark b { display: block; font-size: 14px; } .brandmark small { color: var(--accent); font-size: 11px; font-weight: 600; letter-spacing: .03em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: .65rem; color: #cfe0ee; text-decoration: none; padding: .55rem .65rem; border-radius: 8px; font-weight: 600; font-size: 13px; }
.nav a i { width: 18px; text-align: center; opacity: .85; }
.nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav a.on { background: #fff; color: var(--brand); }
.nav a .count { margin-left: auto; background: var(--accent); color: var(--accent-ink); border-radius: 999px; font-size: 10px; padding: 0 .4rem; font-weight: 800; }
.nav .group { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: #8fb0c9; margin: .75rem .65rem .25rem; }
.sidebar .foot { margin-top: auto; font-size: 12px; color: #a9c3d8; padding: 0 .25rem; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); padding: .6rem 1.25rem; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.topbar .menu-btn { display: none; }
.content { padding: 1.25rem; max-width: 1400px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head p { margin: .2rem 0 0; color: var(--ink-2); }
.sport-switch { display: flex; gap: .35rem; flex-wrap: wrap; }
.sport-switch button { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: .35rem .75rem; cursor: pointer; font-weight: 600; font-size: 13px; }
.sport-switch button.on { background: var(--sport, var(--brand)); color: #fff; border-color: transparent; }
.sport-switch button.on .sport-dot { background: #fff; }
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .topbar .menu-btn { display: inline-flex; }
  .content { padding: .85rem; }
  .scrim { position: fixed; inset: 0; background: rgba(15, 23, 42, .4); z-index: 40; }
}

/* ---------- workflow stepper */
.steps { display: flex; gap: .35rem; flex-wrap: wrap; counter-reset: step; }
.steps a { flex: 1 1 120px; display: flex; align-items: center; gap: .45rem; padding: .5rem .6rem; border-radius: 8px; border: 1px solid var(--line); background: #fff; text-decoration: none; color: var(--ink-2); font-size: 12px; font-weight: 600; }
.steps a::before { counter-increment: step; content: counter(step); width: 20px; height: 20px; border-radius: 50%; display: grid; place-content: center; background: var(--surface-2); border: 1px solid var(--line-2); font-size: 11px; flex: none; }
.steps a.done { color: var(--ok); } .steps a.done::before { content: '✓'; background: var(--ok); color: #fff; border-color: var(--ok); }
.steps a.now { border-color: var(--accent); background: #fffbeb; color: var(--ink); } .steps a.now::before { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.steps a.warn { color: var(--warn); }

/* ---------- stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .6rem; }
.stat { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: .55rem .7rem; }
.stat b { display: block; font-size: 1.35rem; font-weight: 800; line-height: 1.1; }
.stat span { font-size: 11px; color: var(--ink-2); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.stat.warn { background: var(--warn-bg); border-color: #fde68a; } .stat.err { background: var(--err-bg); border-color: #fecaca; } .stat.ok { background: var(--ok-bg); border-color: #bbf7d0; }

.sport-card { border-top: 4px solid var(--sport, var(--brand)); }
.sport-card h3 { display: flex; align-items: center; gap: .5rem; }

/* ---------- team cards */
.team-card { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: .7rem .8rem; display: flex; flex-direction: column; gap: .4rem; }
.team-card.incomplete { border-color: #fcd34d; background: #fffdf5; }
.team-card.locked { border-left: 4px solid var(--brand); }
.team-card .name { font-weight: 700; display: flex; align-items: center; gap: .4rem; }
.chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.chip { display: inline-flex; align-items: center; gap: .3rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: .15rem .55rem; font-size: 12px; }
.chip.empty-slot { border-style: dashed; color: var(--ink-3); background: transparent; }
.chip.sel { background: var(--accent); border-color: var(--accent); }
.chip button { border: none; background: none; padding: 0; cursor: pointer; color: var(--ink-3); }
.pool { display: flex; flex-wrap: wrap; gap: .4rem; }
.pool .chip { cursor: pointer; font-size: 13px; padding: .3rem .65rem; }

/* ---------- bracket */
.bracket-wrap { overflow-x: auto; padding-bottom: .5rem; -webkit-overflow-scrolling: touch; }
.bracket { display: flex; gap: 1.75rem; min-width: min-content; padding: .25rem; }
.bracket .round { display: flex; flex-direction: column; min-width: 220px; width: 220px; }
.bracket .round > h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); margin: 0 0 .5rem; text-align: center; }
.bracket .round .slots { display: flex; flex-direction: column; justify-content: space-around; flex: 1; gap: .6rem; }
.bm { position: relative; background: #fff; border: 1px solid var(--line-2); border-radius: 8px; font-size: 13px; overflow: hidden; }
.bm .meta { display: flex; justify-content: space-between; gap: .3rem; padding: .2rem .5rem; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 10.5px; color: var(--ink-2); font-weight: 600; }
.bm .side { display: flex; align-items: center; justify-content: space-between; gap: .4rem; padding: .35rem .5rem; min-height: 30px; }
.bm .side + .side { border-top: 1px solid var(--line); }
.bm .side .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm .side.tbd .nm { color: var(--ink-3); font-style: italic; }
.bm .side.win { background: var(--ok-bg); font-weight: 700; }
.bm .side.lose .nm { color: var(--ink-3); text-decoration: line-through; }
.bm .side .sc { font-weight: 700; font-variant-numeric: tabular-nums; }
.bm.ongoing { border-color: var(--live); box-shadow: 0 0 0 2px rgba(220, 38, 38, .15); }
.bm.completed { border-color: #86efac; }
.bm.hl { outline: 3px solid var(--accent); }
.bm.bye-only { opacity: .65; border-style: dashed; }
.bm .byetag { font-size: 10px; color: var(--teal); font-weight: 700; }
.bracket .round:not(:last-child) .bm::after { content: ''; position: absolute; right: -1.75rem; top: 50%; width: 1.75rem; border-top: 2px solid var(--line-2); }
.bracket .round .bm { overflow: visible; }
.bracket .round .bm .meta { border-radius: 8px 8px 0 0; }
.champion-box { background: var(--accent); color: var(--accent-ink); border-radius: 10px; padding: .8rem; text-align: center; font-weight: 800; }

/* draw slot editor */
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .6rem; }
.slot-pair { border: 1px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; }
.slot-pair .hd { font-size: 11px; font-weight: 700; color: var(--ink-2); padding: .25rem .5rem; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.slot { display: flex; align-items: center; gap: .4rem; width: 100%; padding: .45rem .55rem; border: none; background: none; cursor: pointer; text-align: left; font-size: 13px; }
.slot + .slot { border-top: 1px solid var(--line); }
.slot:hover { background: #f1f5f9; }
.slot.bye { color: var(--teal); font-style: italic; }
.slot.picked { background: var(--accent); }

/* ---------- match cards (results / public) */
.match-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem .85rem; display: flex; flex-direction: column; gap: .5rem; }
.match-card.ongoing { border-color: var(--live); box-shadow: 0 0 0 3px rgba(220, 38, 38, .1); }
.match-card.completed { background: #fbfefb; }
.match-card .teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .5rem; }
.match-card .teams .t { font-weight: 700; font-size: 15px; }
.match-card .teams .t.b { text-align: right; }
.match-card .teams .vs { color: var(--ink-3); font-weight: 700; font-size: 12px; }
.match-card .teams .t.tbd { color: var(--ink-3); font-style: italic; font-weight: 500; }
.match-card .teams .t.win { color: var(--ok); }
.match-card .teams .t.win::after { content: ' ✓'; }
.match-card .where { display: flex; gap: .75rem; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); }
.match-card .where i { width: 14px; text-align: center; color: var(--ink-3); }
.winner-pick { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.winner-pick button { border: 2px solid var(--line-2); background: #fff; border-radius: 8px; padding: .65rem; font-weight: 700; cursor: pointer; text-align: center; }
.winner-pick button.on { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }

/* ---------- modal & toast */
.modal-back { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 1rem; z-index: 100; overflow-y: auto; }
.modal { background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; display: flex; flex-direction: column; max-height: 92vh; }
.modal.wide { max-width: 900px; } .modal.xwide { max-width: 1200px; }
.modal > header { display: flex; justify-content: space-between; align-items: center; padding: .9rem 1rem; border-bottom: 1px solid var(--line); gap: .5rem; }
.modal > header h2 { margin: 0; font-size: 1.05rem; }
.modal > .body { padding: 1rem; overflow-y: auto; display: flex; flex-direction: column; gap: .75rem; }
.modal > footer { display: flex; justify-content: flex-end; gap: .5rem; padding: .75rem 1rem; border-top: 1px solid var(--line); flex-wrap: wrap; background: var(--surface-2); border-radius: 0 0 12px 12px; }
@media (max-width: 600px) { .modal-back { padding: 0; align-items: stretch; } .modal { max-height: 100vh; border-radius: 0; max-width: none !important; } }
.toasts { position: fixed; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: .5rem; z-index: 200; max-width: min(420px, calc(100vw - 2rem)); }
.toast { background: var(--ink); color: #fff; padding: .7rem .9rem; border-radius: 8px; box-shadow: var(--shadow-lg); font-size: 13px; display: flex; gap: .5rem; align-items: flex-start; animation: slidein .18s ease-out; }
.toast.err { background: var(--err); } .toast.ok { background: var(--ok); } .toast.warn { background: var(--warn); }
@keyframes slidein { from { transform: translateY(8px); opacity: 0 } to { transform: none; opacity: 1 } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.diff-list { display: flex; flex-direction: column; gap: .35rem; }
.diff-list .d { border: 1px solid var(--line); border-radius: 6px; padding: .4rem .55rem; font-size: 13px; background: var(--surface-2); }
.diff-list .d del { color: var(--err); } .diff-list .d ins { color: var(--ok); text-decoration: none; font-weight: 600; }

.conn { display: inline-flex; align-items: center; gap: .35rem; font-size: 12px; color: var(--ink-2); font-weight: 600; }
.conn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.conn.live .dot { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }
.conn.poll .dot { background: var(--accent); } .conn.off .dot { background: var(--err); }

.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; overflow-x: auto; }
.tabs button { border: none; background: none; padding: .6rem .85rem; font-weight: 700; color: var(--ink-2); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; font-size: 13px; }
.tabs button.on { color: var(--brand); border-color: var(--accent); }

.login-wrap { min-height: 100vh; display: grid; place-items: center; background: var(--brand); background-image: var(--pattern); padding: 1rem; }
.login-card { width: 100%; max-width: 380px; }
.login-card .brandmark { color: var(--ink); justify-content: center; margin-bottom: 1rem; }
.login-card .brandmark small { color: var(--warn); }
.kbd { font-family: ui-monospace, monospace; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 .3rem; font-size: 11px; }
details.raw summary { cursor: pointer; color: var(--ink-2); font-size: 12px; }
details.raw pre { white-space: pre-wrap; word-break: break-word; background: var(--surface-2); border: 1px solid var(--line); padding: .5rem; border-radius: 6px; font-size: 11px; max-height: 260px; overflow: auto; }

/* ---------- public viewing app (placeholder design — to be replaced with the supplied design) */
body.public { background: var(--bg); font-size: 15px; }
.pub-head { background: var(--brand); background-image: var(--pattern); color: #fff; position: sticky; top: 0; z-index: 20; }
.pub-head-in { max-width: 1280px; margin: 0 auto; padding: .7rem 1rem; display: flex; align-items: center; gap: .75rem; }
.pub-head .brandmark small { color: var(--accent); }
.pub-head .conn { color: #dbe7f1; } .pub-head .conn .faint { color: #9fbbd2; }
.pub-sports { max-width: 1280px; margin: 0 auto; padding: 0 1rem .6rem; display: flex; gap: .4rem; overflow-x: auto; }
.pub-sports button { flex: none; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.06); color: #fff; border-radius: 999px; padding: .45rem .9rem; font-weight: 700; cursor: pointer; font-size: 14px; }
.pub-sports button.on { background: #fff; color: var(--sport, var(--brand)); border-color: #fff; }
.pub-main { max-width: 1280px; margin: 0 auto; padding: 1rem; }
.pub-tabs { position: sticky; top: 104px; background: var(--bg); z-index: 10; }
.pub-h { display: flex; align-items: center; gap: .5rem; font-size: 1.1rem; margin: 1.25rem 0 .6rem; }
.pub-search .search input { font-size: 16px; min-height: 48px; border-radius: 12px; }
.pub-search .find { border-left: 4px solid var(--sport, var(--brand)); }
.pub-search .hit { background: #fef08a; border-radius: 3px; padding: 0 2px; font-weight: 700; }
.pub-search .next { background: var(--surface-2); border-radius: 8px; padding: .6rem .7rem; }
.match-card .score { font-weight: 800; color: var(--ink); font-size: 14px; white-space: nowrap; }
.match-card .t.me { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; }
.match-card { border-left: 4px solid var(--sport, var(--line)); }
.match-card.ongoing { border-left-color: var(--live); }
.team-card.out { opacity: .6; }
.champs { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .6rem; margin-top: .5rem; }
.champ { display: flex; align-items: center; gap: .8rem; background: var(--accent); color: var(--accent-ink); border-radius: 12px; padding: .8rem 1rem; }
.champ i { font-size: 1.6rem; } .champ small { display: block; font-weight: 700; text-transform: uppercase; font-size: 11px; letter-spacing: .05em; } .champ b { font-size: 1.15rem; }
.champ.big { margin-bottom: .6rem; } .champ.big b { font-size: 1.4rem; }
.pub-foot { text-align: center; color: var(--ink-3); font-size: 12px; padding: 2rem 1rem; }
@media (max-width: 600px) { .pub-tabs { top: 100px; } .match-card .teams .t { font-size: 14px; } .pub-head .conn .faint { display: none; } }

.topbar .sport-switch { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; min-width: 0; flex: 1 1 auto; scrollbar-width: thin; padding-bottom: 2px; }
.topbar .sport-switch button { flex: none; }
@media (max-width: 960px) { .topbar { flex-wrap: nowrap; } .topbar .badge { display: none; } }
.sample-ribbon { background: var(--accent); color: var(--accent-ink); text-align: center; font-size: 12px; font-weight: 700; padding: .3rem; }
