/* SK Javornik Timing — shared tokens and components for every timing app.
   This is live-timing's app.css with the colours lifted into :root variables and the pieces the
   operator and outdoor apps need added (buttons, inputs, subnav, modal, toast, log pane, outdoor
   rows, dark variant). See docs/ui-design-guidelines.md. No hex literal belongs outside this file. */

/* ---------- 1. Tokens ---------- */
:root, :root[data-theme="light"] {
  --blue-dark: #0D3B87;
  --blue: #1565C0;
  --blue-light: #1976D2;
  --primary: #0D47A1;
  --orange: #E65100;
  --amber: #FFB74D;
  --green: #2E7D32;
  --green-soft: #E8F5E9;
  --green-deep: #1B5E20;
  --red: #C62828;
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --surface-2: #FAFAFA;
  --text: #1A1A1A;
  --text-2: #333333;
  --muted: #666666;
  --faint: #757575;
  --line: #E8E8E8;
  --line-table: #F0F0F0;
  --line-head: #E0E0E0;
  --line-input: #D0D5DD;
  --row-hover: #F5F7FA;
  --started: #E3F2FD;
  --started-strong: #90CAF9;
  --current: #FFF8E1;
  --next-row: #FFF4D2;
  --warn-text: #8F3206; --warn-border: #F57C00; --warn-fill: #FFF3E0;
  --danger-fill: #FFEBEE;
  --accent-fill: #E3F2FD;
  --muted-fill: #F1F1F1; --muted-border: #CCCCCC;
  --th-text: #555555;
  --gap-text: #6B6B6B;
  --on-blue: #FFFFFF;
  --on-blue-soft: rgba(255,255,255,.75);
  --on-blue-faint: rgba(255,255,255,.5);
  --on-blue-line: rgba(255,255,255,.15);
  --log-bg: #13202A; --log-text: #E6EDF1; --log-muted: #8FA1AD; --log-line: #4A5D6A;
  --badge-rx: #9ED0FF; --badge-pub: #A9E5C3; --badge-sub: #D4C5FF; --badge-tx: #FFD28A; --badge-rej: #FF9E97; --badge-sys: #C7D1D8;

  --ok: var(--green); --live: var(--orange); --fault: var(--red); --next: var(--amber); --action: var(--primary);

  --shadow-card: 0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.08);
  --shadow-topbar: 0 3px 6px rgba(0,0,0,.2);
  --shadow-modal: 0 12px 40px rgba(0,0,0,.35);
  --font: 'Roboto', 'Helvetica Neue', Arial, system-ui, sans-serif;
  --font-mono: ui-monospace, Consolas, monospace;
  color-scheme: light;
}

/* Operator tools that run in the dark (engine admin, photofinish). The blue chrome stays. */
:root[data-theme="dark"] {
  --primary: #4F8CFF;
  --bg: #0F1420;
  --surface: #171E2E;
  --surface-2: #1D2638;
  --text: #E8ECF4;
  --text-2: #C9D1E0;
  --muted: #93A0B8;
  --faint: #6B7890;
  --line: #2A3550;
  --line-table: #222C44;
  --line-head: #2A3550;
  --line-input: #34405C;
  --row-hover: #202B42;
  --started: #1E2F4D;
  --started-strong: #2A4A7A;
  --current: #3A3420;
  --next-row: #3F3A1E;
  --green-soft: #1C3324; --green-deep: #7ED49A;
  --warn-text: #FFB74D; --warn-fill: #3A2C18;
  --danger-fill: #3B2022;
  --accent-fill: #1E2F4D;
  --muted-fill: #232B3E; --muted-border: #3B4660;
  --th-text: #93A0B8;
  --gap-text: #93A0B8;
  --shadow-card: 0 1px 3px rgba(0,0,0,.5), 0 1px 2px rgba(0,0,0,.4);
  --shadow-modal: 0 12px 40px rgba(0,0,0,.6);
  color-scheme: dark;
}

/* ---------- 2. Base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); display: flex; flex-direction: column; }
#app { min-height: 100vh; display: flex; flex-direction: column; }
.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 16px; }
.container.wide { max-width: 1600px; padding: 0 24px; }
a { color: var(--primary); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- 3. Top bar, subnav, footer ---------- */
#topbar .btn.on-blue:hover, .topbar .btn.on-blue:hover { background: rgba(255,255,255,.12); }
#topbar, .topbar { background: var(--blue-dark); color: var(--on-blue); box-shadow: var(--shadow-topbar); position: relative; z-index: 20; }
.topbar-inner { display: flex; align-items: center; gap: 8px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--on-blue); text-decoration: none; font-weight: 700; font-size: 1.1rem; letter-spacing: .3px; margin-right: auto; }
.brand img { height: 44px; width: auto; padding: 3px; }
.brand small { font-weight: 400; color: var(--on-blue-soft); font-size: .85rem; margin-left: 4px; }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--on-blue); text-decoration: none; font-weight: 500; padding: 8px 14px; border-radius: 6px; border-bottom: 2px solid transparent; text-transform: uppercase; font-size: .9rem; letter-spacing: .3px; }
.nav a:hover { background: rgba(255,255,255,.1); }
.nav a.active { border-bottom-color: rgba(255,255,255,.85); border-radius: 0; font-weight: 600; }
.nav-toggle { display: none; background: transparent; border: 0; color: var(--on-blue); font-size: 1.6rem; padding: 6px 10px; cursor: pointer; }
.topbar-status { display: flex; align-items: center; gap: 16px; color: var(--on-blue-soft); font-size: .85rem; font-weight: 600; }
.topbar-status .dot { margin-right: 4px; }
#topbar .btn.on-blue, .topbar .btn.on-blue { background: transparent; color: var(--on-blue); border-color: rgba(255,255,255,.35); }

.subnav { background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-card); position: relative; z-index: 10; }
.subnav-inner { display: flex; align-items: center; gap: 2px; min-height: 48px; overflow-x: auto; }
.subnav a { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); text-decoration: none; font-weight: 500; padding: 0 14px; min-height: 48px; border-bottom: 2px solid transparent; white-space: nowrap; }
.subnav a:hover { color: var(--primary); background: var(--row-hover); }
.subnav a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }
.subnav .gap { width: 24px; flex: none; }
.subnav .spacer { flex: 1; }

#main { flex: 1; padding-top: 24px; padding-bottom: 80px; }
#footer, .footer { background: var(--blue-dark); color: var(--on-blue-soft); padding: 20px 0; margin-top: auto; font-size: .85rem; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: rgba(255,255,255,.6); text-decoration: none; }

/* ---------- 4. Live pulses ---------- */
@keyframes pulse-live { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes pulse-row { 0%, 100% { background-color: var(--started); } 50% { background-color: var(--started-strong); } }
.live-dot { animation: pulse-live 1.4s ease-in-out infinite; }
.live-nav-dot { animation: pulse-live 1.4s ease-in-out infinite; color: var(--amber); font-size: .75rem; vertical-align: super; margin-left: 2px; }
.live-nav-dot[hidden] { display: none; }

/* ---------- 5. Cards & generic ---------- */
.card { background: var(--surface); border-radius: 8px; box-shadow: var(--shadow-card); overflow: hidden; }
.card + .card, .card + h2, h2 + .card, .card + section, section + section { margin-top: 24px; }
.card.pad, .pad { padding: 24px; }
.card.soft { background: var(--bg); }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.card-title { padding: 16px 24px; border-bottom: 1px solid var(--line); font-weight: 600; color: var(--primary); font-size: 1.1rem; display: flex; align-items: center; gap: 12px; }
.card-title .count { color: var(--muted); font-weight: 400; font-size: .9rem; }
.card-title .spacer { flex: 1; }
.card-foot { padding: 10px 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.section-title { font-weight: 700; color: var(--primary); font-size: 1.4rem; margin-bottom: 16px; }
.page-title { font-size: 1.6rem; font-weight: 700; color: var(--primary); }
.page-header { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.page-header .sub { color: var(--muted); font-size: .9rem; margin-top: 4px; }
.page-header .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.prose { color: var(--text-2); line-height: 1.7; margin: 0; }
.empty { padding: 32px; text-align: center; color: var(--faint); font-style: italic; }
.empty .btn { margin-top: 12px; font-style: normal; }
.center { text-align: center; }
.tnum { font-variant-numeric: tabular-nums; }
hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.grid-main-side { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .grid-2, .grid-main-side { grid-template-columns: 1fr; } }

/* ---------- 6. Hero (home, o nas) ---------- */
.hero { background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 60%, var(--blue-light) 100%); border-radius: 12px; padding: 40px 32px; color: var(--on-blue); display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 24px; }
.hero h1 { font-size: 2.4rem; font-weight: 700; }
.hero-sub { color: var(--on-blue-soft); margin: 6px 0 0; font-size: 1.05rem; }
.hero-muted { color: var(--on-blue-faint); font-style: italic; margin: 16px 0 0; }
.hero-live { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.hero-event { font-size: 1.2rem; font-weight: 500; }
.live-chip { background: var(--orange); color: #fff; padding: 4px 12px; border-radius: 20px; font-size: .82rem; font-weight: 700; letter-spacing: .5px; }
.btn-hero { display: inline-block; background: #fff; color: var(--primary); font-weight: 700; border-radius: 8px; padding: 12px 24px; text-decoration: none; margin-top: 24px; font-size: 1rem; box-shadow: 0 2px 4px rgba(0,0,0,.2); border: 0; cursor: pointer; }
.btn-hero:hover { filter: brightness(.95); }
.hero-logo { flex: 0 0 auto; }
.hero-logo-img { height: 150px; max-width: 200px; width: auto; object-fit: contain; opacity: .9; }

/* ---------- 7. Stats + event list ---------- */
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border-radius: 8px; padding: 24px; text-align: center; box-shadow: var(--shadow-card); border-top: 3px solid var(--primary); }
.stat-blue { border-top-color: var(--primary); } .stat-orange { border-top-color: var(--orange); } .stat-green { border-top-color: var(--green); } .stat-lightblue { border-top-color: var(--blue); }
.stat-value { font-size: 2.4rem; font-weight: 700; color: var(--primary); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-orange .stat-value { color: var(--orange); }
.stat-icon { font-size: 2.4rem; line-height: 1.1; }
.stat-label { color: var(--muted); margin-top: 4px; font-size: .9rem; }
.event-list { display: flex; flex-direction: column; }
.event-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 24px; border-bottom: 1px solid var(--surface-2); color: var(--text); text-decoration: none; }
.event-row:last-child { border-bottom: 0; }
.event-row:hover { background: var(--row-hover); }
.event-row-main { display: flex; align-items: center; gap: 10px; }
.event-name { font-weight: 500; }
.event-row.active .event-name { font-weight: 700; color: var(--primary); }
.event-date { color: var(--faint); font-size: .8rem; }
.event-logo { height: 36px; width: auto; max-width: 120px; object-fit: contain; border-radius: 4px; }
.event-logo.small { height: 26px; max-width: 60px; }
.event-logo.on-blue { padding-left: 14px; border-left: 1px solid rgba(255,255,255,.25); border-radius: 0; }

/* ---------- 8. Chips / badges / dots ---------- */
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; line-height: 20px; border: 1px solid transparent; white-space: nowrap; }
.chip.ok { color: var(--green); border-color: var(--green); background: var(--green-soft); }
.chip.warn { color: var(--warn-text); border-color: var(--warn-border); background: var(--warn-fill); }
.chip.danger { color: var(--red); border-color: var(--red); background: var(--danger-fill); }
.chip.accent { color: var(--primary); border-color: var(--primary); background: var(--accent-fill); }
.chip.muted { color: var(--muted); border-color: var(--muted-border); background: var(--muted-fill); }
.chip.live { background: var(--orange); color: #fff; border-color: var(--orange); animation: pulse-live 1.4s ease-in-out infinite; }
.chip.lg { font-size: .85rem; padding: 4px 14px; line-height: 20px; }
.chip.on-blue { color: var(--on-blue); border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.12); font-size: .85rem; padding: 4px 12px; line-height: 20px; }
.chip.on-blue.ok { background: rgba(255,255,255,.12); border-color: #4CAF50; color: #fff; }
.chip.on-blue.warn { border-color: var(--amber); color: #fff; }
.chip.on-blue.danger { border-color: #EF9A9A; color: #fff; }
.chip .dot { margin-right: 5px; width: 8px; height: 8px; vertical-align: 0; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.dot.ok { background: #4CAF50; } .dot.warn { background: var(--amber); } .dot.danger { background: #E53935; } .dot.muted { background: var(--muted-border); }
.dot.live { background: var(--amber); animation: pulse-live 1.4s ease-in-out infinite; }
.status-line { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: .9rem; white-space: nowrap; }
.next-chip { display: inline-block; font-size: .7rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; background: var(--amber); color: var(--blue-dark); border-radius: 999px; padding: 2px 8px; }

/* ---------- 9. Live page header & pills ---------- */
.live-header { background: linear-gradient(90deg, var(--blue-dark) 0%, var(--blue) 100%); border-radius: 10px; padding: 16px 24px; color: var(--on-blue); margin-bottom: 20px; }
.live-header-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.live-header-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-logo { height: 36px; width: auto; object-fit: contain; }
.live-event-name { font-size: 1.35rem; font-weight: 700; }
.live-session-line { color: var(--amber); font-size: .85rem; font-weight: 600; letter-spacing: .5px; margin-top: 2px; }
.live-status { display: flex; align-items: center; gap: 6px; color: #CFE0FA; font-size: .85rem; font-weight: 600; }
.viewers { color: rgba(255,255,255,.65); margin-right: 10px; font-weight: 500; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--on-blue-line); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; border: 0; background: rgba(255,255,255,.12); color: var(--on-blue); }
.pill.combined { background: rgba(255,255,255,.25); font-weight: 700; }
.pill.selected { background: var(--amber); color: var(--blue-dark); }
.pill-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.pill-dot.Active { background: #4CAF50; } .pill-dot.Completed { background: #90A4AE; }
.view-toggle { display: flex; gap: 6px; margin-top: 12px; }
.view-toggle[hidden] { display: none; }
.view-btn { font: inherit; font-size: .85rem; font-weight: 700; padding: 6px 14px; border-radius: 8px; border: 1px solid rgba(255,255,255,.35); background: transparent; color: var(--on-blue); cursor: pointer; }
.view-btn.selected { background: #fff; color: var(--blue-dark); border-color: #fff; }
.startlist-note { color: var(--muted); font-size: .85rem; margin: 0 0 12px; }

/* ---------- 10. Flying banner ---------- */
.banner-bar { overflow: hidden; white-space: nowrap; background: var(--blue); border-radius: 8px; margin-bottom: 20px; }
.banner-bar[hidden] { display: none; }
.banner-track { display: inline-block; padding: 10px 0 10px 100%; color: #fff; font-weight: 700; font-size: .95rem; animation: banner-scroll 22s linear infinite; }
.banner-track span { padding-right: 80px; }
@keyframes banner-scroll { from { transform: translateX(0); } to { transform: translateX(-100%); } }

/* ---------- 11. Tables (standings) ---------- */
.boards .board + .board { margin-top: 24px; }
.category-title { font-size: 1.15rem; font-weight: 700; color: var(--blue-dark); margin: 0 0 8px 4px; }
.table-wrap { overflow-x: clip; }
thead th { position: sticky; top: 0; z-index: 1; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line-table); white-space: nowrap; vertical-align: middle; }
thead tr { background: var(--bg); border-bottom: 2px solid var(--line-head); }
th { font-size: .76rem; text-transform: uppercase; letter-spacing: .4px; color: var(--th-text); font-weight: 700; }
tbody tr:hover { background: var(--row-hover); }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.pos { font-weight: 700; width: 56px; font-size: 1.2rem; }
td.bib { font-weight: 700; font-size: 1.2rem; width: 64px; }
td.name .competitor { font-size: 1.05rem; font-weight: 500; }
td.name .club { display: block; color: var(--faint); font-size: .78rem; font-weight: 400; }
td.time { font-size: 1.2rem; font-weight: 500; font-variant-numeric: tabular-nums; }
td.gap { color: var(--gap-text); font-size: .95rem; font-variant-numeric: tabular-nums; }
td.best { color: var(--green); }
td.actions { text-align: right; }
td.actions .btn + .btn { margin-left: 6px; }
th.current, td.current { background: var(--current); }
thead th.current { box-shadow: inset 0 2px 0 var(--amber); color: var(--text); }
tr.row-finished td { background: var(--green-soft); font-weight: 700; }
tr.row-finished td.time { color: var(--green-deep); }
tr.row-finished td.gap { color: var(--th-text); }
tr.row-started > td { animation: pulse-row 2s ease-in-out infinite; }
tr.row-out td.name, tr.row-out td.pos { color: var(--faint); }
tr.row-next > td { background: var(--next-row); }
tr.row-next td.start-order, tr.row-next td.bib { color: var(--blue-dark); }
tr.row-done > td { color: var(--muted); }
tr.row-selected > td, tr.row-selected:hover > td { background: var(--primary); color: #fff; }
tr.row-selected td.name .club, tr.row-selected td.gap { color: rgba(255,255,255,.75); }
td.start-order { font-weight: 800; width: 48px; }
td.hand { outline: 1px dashed var(--primary); outline-offset: -4px; }
.hand-tag { display: inline-block; font-size: .65rem; font-weight: 800; color: #fff; background: var(--primary); border-radius: 4px; padding: 1px 5px; margin-left: 6px; vertical-align: middle; line-height: 1.3; }
tr.expandable { cursor: pointer; }
tr.row-expanded td { background: var(--started) !important; }
tr.lap-detail td { padding: 10px 16px; background: var(--surface-2); cursor: default; }
tr.lap-detail:hover { background: transparent; }
.lap-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.lap-chip { display: inline-flex; flex-direction: column; align-items: center; background: var(--surface); border: 1px solid var(--line-head); border-radius: 8px; padding: 5px 12px; min-width: 72px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.lap-chip-best { background: #F1F8E9; border-color: #66BB6A; box-shadow: 0 1px 4px rgba(76,175,80,.18); }
.lap-chip-num { font-size: .65rem; color: #aaa; font-weight: 600; letter-spacing: .3px; line-height: 1.2; }
.lap-chip-best .lap-chip-num { color: #388E3C; }
.lap-chip-time { font-size: .88rem; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; line-height: 1.4; }
.lap-chip-best .lap-chip-time { color: var(--green); font-weight: 700; }
table.simple th { color: var(--primary); text-transform: none; font-size: .9rem; letter-spacing: 0; }
table.simple td { white-space: normal; }
table.simple tbody tr:nth-child(odd) { background: var(--bg); }
table.big td { font-size: 1.15rem; padding: 13px 16px; }
table.big td.pos, table.big td.bib, table.big td.time { font-size: 1.35rem; }

/* ---------- 12. Controls (operator apps) ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 8px 16px; border-radius: 8px; font-weight: 500; cursor: pointer; white-space: nowrap; background: var(--surface); color: var(--text); border: 1px solid var(--line-input); }
.btn:hover { background: var(--row-hover); }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 700; }
.btn.primary:hover { filter: brightness(1.1); background: var(--primary); }
.btn.danger { background: transparent; color: var(--red); border-color: var(--red); }
.btn.danger.confirm { background: var(--red); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--primary); }
.btn.small { min-height: 32px; padding: 4px 10px; font-size: .9rem; }
.btn.touch { min-height: 48px; }
.btn.xl { min-height: 56px; font-size: 1.1rem; font-weight: 700; border-radius: 10px; }
.btn:disabled, .btn.disabled { opacity: .5; cursor: default; }
.btn.waiting { background: var(--warn-fill); color: var(--warn-text); border-color: var(--warn-border); }
.btn kbd { margin-left: 4px; }

.field label { display: block; color: var(--muted); font-size: .85rem; margin-bottom: 4px; }
.input, input[type="text"], input[type="search"], input[type="number"], input[type="password"], select, textarea { width: 100%; min-height: 42px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line-input); border-radius: 8px; color: var(--text); }
input.time, .input.time { text-align: right; font-variant-numeric: tabular-nums; }
input.invalid, .input.invalid { border-color: var(--red); }
.field .error { color: var(--red); font-size: .85rem; margin-top: 4px; }
.field .hint { color: var(--faint); font-size: .8rem; margin-top: 4px; }
.toolbar { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .field { min-width: 220px; }
.toolbar .spacer { flex: 1; }
.segmented { display: inline-flex; border: 1px solid var(--primary); border-radius: 8px; overflow: hidden; }
.segmented button { background: var(--surface); color: var(--primary); border: 0; padding: 0 16px; min-height: 40px; font-weight: 600; cursor: pointer; }
.segmented button.selected { background: var(--primary); color: #fff; }
kbd { font-size: .75rem; color: var(--muted); border: 1px solid var(--line-input); border-radius: 4px; padding: 0 5px; font-family: inherit; background: var(--surface); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.form-grid .full { grid-column: 1 / -1; }

/* ---------- 13. Feedback ---------- */
.banner { display: flex; align-items: center; gap: 12px; padding: 10px 16px; font-weight: 500; border-radius: 8px; }
.banner.warn { background: var(--warn-fill); color: var(--warn-text); }
.banner.danger { background: var(--danger-fill); color: var(--red); }
.banner .btn { margin-left: auto; }
.card > .banner { border-radius: 0; }
.toast-root { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 100; }
.toast { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-left: 4px solid var(--primary); border-radius: 8px; padding: 12px 16px; min-width: 260px; max-width: 420px; box-shadow: var(--shadow-modal); }
.toast.ok { border-left-color: var(--green); } .toast.error { border-left-color: var(--red); }
.skeleton { height: 44px; border-bottom: 1px solid var(--line-table); background: linear-gradient(90deg, var(--surface) 0%, var(--bg) 50%, var(--surface) 100%); }
.modal-backdrop { position: fixed; inset: 0; background: rgba(5,8,15,.5); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 50; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-modal); width: 560px; max-width: 100%; }
.modal.wide { width: 860px; }
.modal header { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal header h2 { font-size: 1.1rem; font-weight: 600; color: var(--primary); flex: 1; }
.modal .modal-body { padding: 20px; }
.modal footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); }
.modal .close { background: none; border: 0; color: var(--muted); font-size: 22px; cursor: pointer; }

/* ---------- 14. Log pane (raw device data, always dark) ---------- */
.log { background: var(--log-bg); color: var(--log-text); font: 13px/18px var(--font-mono); border-radius: 8px; overflow: hidden; box-shadow: var(--shadow-card); }
.log .log-head { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 16px; border-bottom: 1px solid var(--log-line); font-family: var(--font); }
.log .log-head .title { font-weight: 700; font-size: 1rem; }
.log .log-head .spacer { flex: 1; }
.log .log-head .chip { color: var(--log-text); border-color: var(--log-line); background: transparent; cursor: pointer; }
.log .log-head .chip.selected { background: var(--log-text); color: var(--log-bg); border-color: var(--log-text); }
.log .row { display: grid; grid-template-columns: 86px 48px 50px 1fr; gap: 10px; align-items: center; min-height: 26px; padding: 0 16px; border-bottom: 1px solid var(--log-line); }
.log .row:last-child { border-bottom: 0; }
.log .row .ts, .log .row .dev { color: var(--log-muted); }
.log .row .text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { display: inline-block; width: 46px; height: 20px; text-align: center; border: 1px solid currentColor; border-radius: 4px; font: 500 11px/18px var(--font-mono); }
.badge.rx { color: var(--badge-rx); } .badge.pub { color: var(--badge-pub); } .badge.sub { color: var(--badge-sub); } .badge.tx { color: var(--badge-tx); } .badge.rej { color: var(--badge-rej); } .badge.sys { color: var(--badge-sys); }

/* ---------- 15. Outdoor pieces (alge_mobile) ---------- */
.bib-row { display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 8px 20px; border: 0; border-bottom: 1px solid var(--line-table); background: var(--surface); color: var(--text); width: 100%; text-align: left; cursor: pointer; }
.bib-row .num { font-size: 2.6rem; font-weight: 700; line-height: 1; min-width: 92px; font-variant-numeric: tabular-nums; }
.bib-row .who { flex: 1; min-width: 0; }
.bib-row .who .nm { font-size: 1.05rem; font-weight: 500; }
.bib-row .who .sub { color: var(--faint); font-size: .8rem; }
.bib-row.selected { background: var(--primary); color: #fff; }
.bib-row.selected .who .sub { color: rgba(255,255,255,.8); }
.bib-row.sent { background: var(--warn-fill); }
.bib-row.written { background: var(--green-soft); }
.bib-row.warning { background: var(--danger-fill); }
.action-bar { background: var(--bg); border-top: 1px solid var(--line); padding: 14px 20px 16px; display: grid; gap: 10px; }
.action-bar .info { font-weight: 600; }
.device-row { display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; align-items: center; min-height: 92px; padding: 12px 20px; border-bottom: 1px solid var(--line-table); }
.device-tile { width: 72px; height: 56px; display: flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 2rem; font-weight: 700; }
.device-tile.a { background: var(--blue-dark); color: #fff; }
.device-tile.b { border: 2px solid var(--blue-dark); color: var(--blue-dark); }
.device-tile.backup { border: 2px dashed var(--muted); color: var(--muted); font-size: 1rem; }
.switch { width: 52px; height: 30px; border-radius: 15px; background: #7D8C97; position: relative; display: inline-block; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; }
.switch.on { background: var(--red); } .switch.on::after { left: 25px; }

/* ---------- 16. O nas / Kontakt (public) ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.feature { border-top: 3px solid var(--primary); }
.feature-icon { font-size: 2rem; }
.feature h3 { font-size: 1.05rem; font-weight: 700; margin-top: 10px; }
.feature p { color: var(--muted); font-size: .9rem; margin: 8px 0 0; }
.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; color: var(--text-2); font-size: .95rem; }
.team-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-bottom: 24px; }
.team { text-align: center; }
.avatar { width: 64px; height: 64px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 1.6rem; font-weight: 700; color: #fff; margin-bottom: 10px; }
.avatar.lg { width: 80px; height: 80px; font-size: 2rem; margin: 0; }
.av-orange { background: var(--orange); } .av-green { background: var(--green); } .av-blue { background: var(--blue); }
.team-name { font-weight: 700; font-size: 1.05rem; }
.team-role { color: var(--primary); font-weight: 600; font-size: .9rem; margin-top: 2px; }
.contact { border-radius: 12px; }
.contact-head { background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 100%); padding: 32px; display: flex; justify-content: center; }
.phone, .email { color: var(--text); text-decoration: none; font-size: 1rem; font-weight: 500; }
.email { color: var(--primary); font-weight: 600; }
.email-card { display: flex; align-items: center; gap: 16px; border-radius: 12px; }
.email-icon { font-size: 1.75rem; color: var(--primary); }
.eyebrow { color: var(--gap-text); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; font-size: .72rem; }
.cta { text-align: center; border-radius: 12px; padding: 32px; color: #fff; background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 100%); }
.cta h2 { font-size: 1.4rem; font-weight: 700; }
.cta p { color: rgba(255,255,255,.8); margin: 8px 0 0; }
.cta .btn-hero { margin-top: 20px; }

/* ---------- 17. Responsive ---------- */
@media (max-width: 900px) {
  .feature-grid, .team-grid { grid-template-columns: repeat(2, 1fr); }
  .why-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .nav { display: none; flex-direction: column; width: 100%; padding-bottom: 8px; }
  .nav.open { display: flex; }
  .nav a { padding: 10px 8px; }
  .hero { padding: 28px 20px; }
  .hero h1 { font-size: 1.8rem; }
  .hero-logo { display: none; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .stat-wide { display: none; }
  .feature-grid, .team-grid { grid-template-columns: 1fr; }
  .live-header { padding: 14px 16px; }
  .live-event-name { font-size: 1.1rem; }
  .brand-logo { height: 30px; }
  th, td { padding: 9px 8px; }
  td.name .competitor { font-size: 1rem; white-space: normal; }
  td.pos, td.bib, td.time { font-size: 1.1rem; }
  td.pos { width: 40px; } td.bib { width: 48px; }
  /* The gap moves under the time (the boards put it in data-gap); the column goes. */
  th.gap, td.gap { display: none; }
  td.time[data-gap]:not([data-gap=""])::after { content: attr(data-gap); display: block; font-size: .8rem; font-weight: 400; color: var(--gap-text); line-height: 1.2; }
  .table-wrap { overflow-x: auto; }
  thead th { position: static; }
  .card.pad, .pad { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  /* Operator shell on a phone: the bar wraps, tabs scroll, fields and actions go full width. */
  .topbar-inner { padding-top: 6px; padding-bottom: 6px; }
  .topbar-status { width: 100%; justify-content: flex-start; gap: 10px; font-size: .8rem; }
  .subnav a { padding: 0 10px; min-height: 44px; font-size: .9rem; }
  .subnav a kbd { display: none; }
  .page-header .actions { width: 100%; margin-left: 0; }
  .page-header .actions .btn { flex: 1 1 auto; }
  .toolbar .field { min-width: 100%; }
  .grid-main-side { grid-template-columns: 1fr; }
  .modal footer { flex-wrap: wrap; }
  .toast-root { left: 12px; right: 12px; bottom: 12px; }
  .toast { min-width: 0; max-width: none; }
}
