:root {
  --bg: #f6f7f9;
  --paper: #fff;
  --ink: #202a36;
  --muted: #697481;
  --line: #dce1e7;
  --green: #264f82;
  --red: #a13737;
  --radius: 5px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { touch-action: manipulation; }
a { color: var(--green); text-underline-offset: 3px; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
button:focus-visible, a:focus-visible { outline: 2px solid #4979b4; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 28px; line-height: 1.25; font-weight: 600; }
h2 { font-size: 20px; line-height: 1.35; font-weight: 600; }
h3 { font-size: 15px; line-height: 1.4; font-weight: 600; }
p { line-height: 1.6; }
small { font-size: 12px; }
.muted { color: var(--muted); }
.eyebrow { color: var(--muted); font-size: 12px; font-weight: 400; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 12px; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.spacer { flex: 1; min-width: 0; }
.gap { display: grid; gap: 20px; }
.space-top { margin-top: 20px; }
.right { text-align: right; }
.full { grid-column: 1 / -1; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 15px; min-height: 40px; line-height: 1.3;
  background: white; color: var(--ink); border: 1px solid #cdd4dc;
  border-radius: 4px; font-size: 13px; font-weight: 500; text-decoration: none;
}
.button:hover { background: #f1f3f6; border-color: #a5b0bc; }
.button.primary { background: var(--green); border-color: var(--green); color: white; }
.button.primary:hover { background: #1d406b; }
.button.danger { background: white; color: var(--red); border-color: #cf9c9c; }
.button.danger:hover { background: #fff3f3; }
.button.small { padding: 7px 10px; min-height: 34px; font-size: 12px; }
.button.ghost { background: transparent; }
.icon {
  width: 18px; height: 18px; flex: none; vertical-align: middle;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.brand { display: inline-block; color: var(--ink); text-decoration: none; }
.brand-title { font-size: 17px; line-height: 1.45; font-weight: 600; }
.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  padding: 25px 14px 22px; background: #f0f2f5; border-right: 1px solid var(--line);
}
.sidebar .brand { margin: 0 12px 30px; }
.sidebar .brand-title { font-size: 17px; }
.nav { display: grid; gap: 3px; }
.nav button, .nav a {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px;
  padding: 11px 12px; border: 0; border-radius: 3px; background: transparent;
  color: #4d5966; text-align: left; text-decoration: none; font-size: 13px;
}
.nav button:hover, .nav a:hover { background: #e7ebf0; color: var(--ink); }
.nav .active { background: #e0e8f3; color: #224b7b; font-weight: 600; }
.nav .icon { width: 17px; height: 17px; }
.sidebar-bottom { margin-top: auto; padding: 20px 12px 0; border-top: 1px solid #d4dbe3; }
.sidebar-bottom .name { margin-bottom: 5px; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.sidebar-bottom small { font-size: 12px; color: var(--muted); }
.sidebar-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 18px; }
.sidebar-links button { padding: 0; border: 0; background: transparent; color: #52667f; font-size: 12px; }
.workspace { min-width: 0; }
.topbar {
  height: 61px; padding: 0 32px; border-bottom: 1px solid var(--line);
  background: white; display: flex; align-items: center; justify-content: space-between; gap: 15px;
}
.crumb { color: var(--muted); font-size: 13px; }
.content { max-width: 1480px; padding: 30px 32px 45px; margin: 0 auto; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-heading p { margin-top: 9px; color: var(--muted); font-size: 13px; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 22px; background: white; border: 1px solid var(--line); border-radius: 5px; }
.metric { display: flex; align-items: baseline; gap: 12px; padding: 20px 22px; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric strong { font-size: 25px; line-height: 1.1; font-weight: 600; font-variant-numeric: tabular-nums; }
.metric strong small { font-size: 13px; color: var(--muted); font-weight: 400; }
.metric span { font-size: 12px; color: var(--muted); }
.stage-track { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line); background: var(--line); border-radius: 4px; overflow: hidden; margin-bottom: 24px; }
.stage-step {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 7px; min-height: 48px; border: 0; border-radius: 0;
  background: #fff; color: #737e8a; font-size: 11px; line-height: 1.4; text-align: left;
}
button.stage-step:hover { background: #f1f4f8; }
.stage-step .step { display: inline-grid; place-items: center; width: 19px; height: 19px; font-size: 11px; flex: none; }
.stage-step .step .icon { width: 14px; height: 14px; }
.stage-step.done { color: #4f6c5e; }
.stage-step.current { background: #eaf0f8; color: #234c7b; font-weight: 600; box-shadow: inset 0 -2px #315f97; }
.stage-hero { display: flex; align-items: center; justify-content: space-between; gap: 26px; padding: 23px 25px; border: 1px solid var(--line); border-radius: 5px; background: white; }
.stage-hero .eyebrow { display: block; margin-bottom: 7px; }
.stage-hero h2 { font-size: 24px; margin-bottom: 10px; }
.stage-hero p { color: var(--muted); font-size: 13px; max-width: 560px; }
.hero-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; flex-wrap: wrap; flex: none; }
.two-col { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; margin-top: 24px; align-items: start; }
.panel { background: white; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.panel-pad { padding: 22px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 16px; }
.panel-head p { color: var(--muted); margin-top: 6px; font-size: 12px; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
.data-table th { font-size: 11px; color: #697582; font-weight: 500; background: #fafbfc; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.data-table td { padding: 14px 20px; border-bottom: 1px solid #e8ecf0; }
.data-table tr:last-child td { border-bottom: 0; }
.team-dot { display: inline-block; color: #7b8591; font-size: 12px; font-weight: 400; min-width: 21px; margin-right: 9px; font-variant-numeric: tabular-nums; }
.rank { color: #687582; font-weight: 500; }
.table-scroll { overflow-x: auto; }
.status-row { display: flex; align-items: center; gap: 12px; padding: 16px 22px; border-bottom: 1px solid #e8ecf0; font-size: 13px; }
.status-row .muted { margin-top: 5px; font-size: 12px; }
.status-row strong { font-weight: 500; }
.section-footer { border-top: 1px solid var(--line); padding: 13px 20px; color: var(--muted); font-size: 12px; }
.badge { display: inline-block; padding: 4px 7px; border-radius: 3px; font-size: 11px; font-weight: 400; color: #606c79; background: #f0f2f5; line-height: 1.4; white-space: nowrap; }
.badge.active { color: #355e44; background: #edf4ee; }
.badge.orange { color: #7d6643; background: #f7f3e9; }
.badge.red { color: #8d3b3b; background: #faf0f0; }
.notice { padding: 14px 17px; border: 1px solid #e3d9bf; border-radius: 4px; background: #fcfaf4; color: #74613f; font-size: 13px; line-height: 1.6; }
.notice.success { background: #f5f9f5; color: #386044; border-color: #ceddcf; }
.notice.danger { background: #fff6f6; color: var(--red); border-color: #e4c5c5; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.team-card { min-width: 0; padding: 20px; background: white; border: 1px solid var(--line); border-radius: 5px; }
.team-card input { margin: 14px 0 0; font-size: 16px; font-weight: 500; }
.team-card .space-top { margin-top: 10px; }
.team-card .meta { margin-top: 20px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); }
.team-card .meta button { border: 0; padding: 0; background: transparent; color: var(--green); text-decoration: underline; font-size: 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
form { display: grid; gap: 17px; }
label { display: grid; gap: 8px; color: #4e5a68; font-size: 13px; font-weight: 500; }
input, select, textarea { width: 100%; padding: 10px 12px; color: var(--ink); background: white; border: 1px solid #c9d1dc; border-radius: 4px; outline: none; font-size: 14px; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: #4874a9; box-shadow: 0 0 0 2px #e4edf8; }
textarea { min-height: 108px; resize: vertical; }
label .hint, .hint { color: var(--muted); font-weight: 400; font-size: 12px; line-height: 1.6; }
.question-preview { padding: 22px; border-bottom: 1px solid var(--line); }
.question-preview:last-child { border-bottom: 0; }
.question-preview h3 { font-size: 14px; line-height: 1.65; margin-bottom: 12px; }
.question-preview p { font-size: 13px; padding: 8px 10px; }
.question-preview .correct { background: #f0f6ef; border-left: 2px solid #77996c; color: #41603b; }
.public-header, .board-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 70px; padding: 16px 4vw; background: white; border-bottom: 1px solid var(--line); }
.team-name { color: #596879; font-size: 13px; }
.public-main { max-width: 1160px; margin: auto; padding: 30px 28px 40px; }
.public-footer { display: flex; gap: 22px; margin-top: 38px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 12px; }
.public-footer a { color: #687585; text-decoration: none; }
.public-footer a:hover { color: var(--green); text-decoration: underline; }
.event-banner { display: flex; align-items: center; justify-content: center; min-height: 400px; padding: 70px 24px; text-align: center; }
.event-banner h1 { font-size: clamp(30px, 4vw, 46px); font-weight: 500; line-height: 1.3; }
.event-banner p { margin-top: 22px; color: var(--muted); max-width: 640px; font-size: 16px; }
.waiting { padding: 30px; background: white; border: 1px solid var(--line); border-radius: 5px; }
.waiting h2 { margin-bottom: 12px; font-size: 23px; }
.waiting p { max-width: 690px; color: var(--muted); font-size: 14px; }
.login-page { display: flex; align-items: flex-start; justify-content: center; min-height: calc(100vh - 70px); padding: 70px 22px; }
.login-box { width: 100%; max-width: 420px; background: white; border: 1px solid var(--line); border-radius: 5px; padding: 30px; }
.login-box h1 { font-size: 23px; margin-bottom: 28px; }
.login-box .button { width: 100%; }
.login-box .foot { display: flex; justify-content: space-between; gap: 18px; padding-top: 22px; margin-top: 25px; border-top: 1px solid #e8ecf0; font-size: 12px; }
.text-link { border: 0; background: transparent; padding: 0; color: var(--green); font-size: 13px; text-decoration: underline; }
.quiz-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.quiz-info { margin-top: 10px; font-size: 13px; }
.timer { display: flex; align-items: center; gap: 12px; min-width: 142px; padding: 10px 17px; background: white; border: 1px solid #c2cdda; border-radius: 4px; color: #29486c; }
.timer span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 3px; }
.timer strong { font-size: 27px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.timer.urgent { background: #fff5f5; border-color: #cd9e9e; color: #a23535; }
.quiz-layout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 22px; align-items: start; }
.question-card { background: white; padding: 26px; margin-bottom: 20px; border: 1px solid var(--line); border-radius: 5px; scroll-margin-top: 20px; }
.question-num { display: block; color: var(--muted); font-size: 12px; margin-bottom: 14px; }
.question-card h2 { font-size: 17px; font-weight: 500; line-height: 1.65; white-space: pre-line; }
.options { display: grid; gap: 10px; margin-top: 23px; }
.option { display: flex; align-items: flex-start; gap: 11px; padding: 14px; border: 1px solid var(--line); border-radius: 4px; cursor: pointer; font-size: 14px; font-weight: 400; line-height: 1.6; color: #394655; }
.option:hover { background: #fafbfc; }
.option:has(input:checked) { border-color: #799ac2; background: #f2f6fb; }
.option input { width: 17px; height: 17px; flex: none; margin: 3px 0 0; accent-color: #315b8d; box-shadow: none; }
.option .letter { color: #758393; font-weight: 500; margin-right: 6px; }
.quiz-aside { position: sticky; top: 20px; border: 1px solid var(--line); border-radius: 5px; padding: 20px; background: white; }
.quiz-nav { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 18px 0; }
.quiz-nav a { display: grid; place-items: center; aspect-ratio: 1; border: 1px solid #d0d8e1; border-radius: 3px; color: #6a7889; text-decoration: none; font-size: 13px; }
.quiz-nav a.answered { background: #e9f0f9; color: #234c7b; border-color: #91aac9; }
.quiz-aside .button { width: 100%; font-size: 12px; }
.quiz-aside .hint { display: block; margin-top: 13px; }
.save-status { font-size: 12px; color: #566d59; line-height: 1.6; margin: 14px 0 20px; }
.save-status.error { color: var(--red); }
.board-page { background: white; min-height: 100vh; }
.board-header .brand-title { font-size: 18px; }
.board-main { max-width: 1320px; margin: auto; padding: 40px 35px; }
.board-title { margin-bottom: 25px; }
.board-title h1 { font-size: 30px; }
.board-title p { color: var(--muted); margin-top: 10px; font-size: 14px; }
.board-table { width: 100%; border-collapse: collapse; text-align: center; }
.board-table th { color: #687583; font-size: 12px; font-weight: 500; background: #f5f7fa; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 15px 20px; }
.board-table th:nth-child(2) { text-align: left; }
.board-table td { background: white; border-bottom: 1px solid var(--line); padding: 23px 20px; font-size: 20px; font-weight: 400; font-variant-numeric: tabular-nums; }
.board-table td:first-child { width: 85px; }
.board-table td:nth-child(2) { text-align: left; width: 40%; font-size: 19px; overflow-wrap: anywhere; }
.board-table tr.leader td { background: #f2f6fb; }
.board-table .place { font-size: 17px; color: #657588; }
.board-table .total { font-weight: 600; color: #274c79; font-size: 25px; }
.board-table .not-published { color: #a0a9b4; }
.board-note { color: var(--muted); margin-top: 18px; font-size: 12px; line-height: 1.65; }
.jury-main { max-width: 1220px; margin: auto; padding: 32px 28px 50px; }
.tab-bar { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.tab-bar button { background: transparent; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 13px 0; color: #6b7785; font-size: 14px; }
.tab-bar button.selected { border-bottom-color: #315b8d; color: #264f82; font-weight: 500; }
.jury-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 22px; align-items: start; }
.score-team { background: white; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; margin-bottom: 18px; }
.score-team-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 22px; background: #fafbfc; border-bottom: 1px solid var(--line); }
.score-team-head strong { font-size: 17px; font-weight: 500; }
.score-criterion { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid #e8ecf0; padding: 14px 22px; font-size: 14px; line-height: 1.6; }
.score-criterion:last-child { border: 0; }
.score-toggle { display: flex; gap: 5px; flex: none; }
.score-toggle button { background: white; color: #657487; border: 1px solid #cdd5df; border-radius: 3px; width: 43px; height: 34px; font-size: 14px; }
.score-toggle button:hover { background: #f0f4fa; }
.score-toggle button.chosen { color: #224a7c; border-color: #7c9abd; background: #eaf1fa; font-weight: 600; }
.jury-aside { position: sticky; top: 20px; padding: 22px; background: white; border: 1px solid var(--line); border-radius: 5px; }
.jury-aside strong { display: block; font-size: 27px; font-weight: 500; margin-top: 10px; font-variant-numeric: tabular-nums; }
.jury-aside p { margin: 18px 0; font-size: 13px; color: var(--muted); }
.jury-aside .button { width: 100%; }
.jury-aside .text-link { display: inline-block; }
.compact-list { display: grid; gap: 10px; margin-top: 16px; }
.compact-list > div { display: flex; align-items: center; justify-content: space-between; gap: 15px; font-size: 13px; line-height: 1.5; }
.compact-list .button { flex: none; }
.countdown-inline { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.inline-btns, .pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.audit { font-size: 12px; }
.connection { position: fixed; z-index: 100; bottom: 20px; left: 50%; transform: translateX(-50%); padding: 13px 20px; max-width: 90vw; border-radius: 4px; background: #873c3c; color: white; font-size: 13px; text-align: center; }
.toast { position: fixed; z-index: 200; top: 20px; right: 22px; max-width: min(440px, 90vw); padding: 14px 20px; border-radius: 4px; color: white; background: #365644; font-size: 13px; line-height: 1.6; }
.toast.error { background: #923e3e; }
dialog { width: 600px; max-width: min(600px, 92vw); padding: 0; color: var(--ink); border: 1px solid #bdc7d3; border-radius: 7px; background: white; box-shadow: 0 12px 40px #13294124; }
dialog::backdrop { background: #1b263d66; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 21px 24px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 21px; }
.modal-head button { background: transparent; border: 0; color: #667488; padding: 0 6px; font-size: 25px; }
.modal-body { padding: 24px; }
.modal-body p { font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.modal-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.codes-row { display: grid; grid-template-columns: 1fr auto; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.codes-row code { font-size: 17px; color: #2d527e; letter-spacing: .5px; }
.form-error { color: var(--red); font-size: 13px; line-height: 1.6; }
.form-error:empty { display: none; }
.setup-card { display: grid; gap: 22px; max-width: 560px; padding: 30px; margin: 7vh auto; background: white; border: 1px solid var(--line); border-radius: 5px; }
.setup-card p { font-size: 13px; }
.loading { min-height: 100vh; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 14px; }
.loading p { font-size: 18px; }
.empty { padding: 35px 20px; text-align: center; font-size: 13px; color: var(--muted); }
@media (max-width: 1150px) {
  .content { padding: 26px 24px 40px; }
  .topbar { padding: 0 24px; }
  .two-col { grid-template-columns: 1fr; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stage-track { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stage-step { justify-content: flex-start; padding-left: 13px; font-size: 12px; }
  .metric { padding: 18px; gap: 9px; }
  .stage-hero { align-items: flex-start; flex-direction: column; gap: 20px; }
  .hero-actions { justify-content: flex-start; }
}
@media (max-width: 800px) {
  .shell { display: block; }
  .sidebar { position: static; height: auto; padding: 19px 18px 13px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar .brand { margin: 0 3px 17px; }
  .sidebar-bottom { display: none; }
  .nav { display: flex; gap: 3px; overflow-x: auto; }
  .nav button, .nav a { width: auto; white-space: nowrap; padding: 9px 11px; font-size: 12px; }
  .nav .icon { width: 15px; height: 15px; }
  .topbar { height: 53px; padding: 0 21px; }
  .content { padding: 25px 20px 40px; }
  .page-heading { align-items: flex-start; margin-bottom: 21px; }
  h1 { font-size: 26px; }
  .metric { display: block; padding: 16px; }
  .metric strong { display: block; margin-bottom: 8px; }
  .metric span { font-size: 11px; }
  .public-header, .board-header { min-height: 64px; padding: 15px 20px; gap: 18px; }
  .brand-title { font-size: 15px; }
  .board-header .brand-title { font-size: 16px; }
  .public-header .team-name { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .public-main { padding: 24px 20px 40px; }
  .event-banner { padding: 55px 10px; min-height: 360px; }
  .event-banner h1 { font-size: 35px; }
  .event-banner p { font-size: 14px; }
  .waiting { padding: 25px; }
  .waiting h2 { font-size: 22px; }
  .quiz-layout { display: flex; flex-direction: column; gap: 19px; }
  .quiz-questions { width: 100%; }
  .quiz-aside { order: -1; position: sticky; top: 0; z-index: 10; width: 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; }
  .quiz-aside h3, .quiz-aside > .hint { display: none; }
  .quiz-nav { display: flex; margin: 0; }
  .quiz-nav a { aspect-ratio: auto; width: 28px; height: 28px; }
  .quiz-aside .button { width: auto; font-size: 11px; }
  .quiz-aside .save-status { width: 100%; margin: 0; order: 2; font-size: 11px; }
  .quiz-header { align-items: flex-start; }
  .timer { min-width: 127px; padding: 10px 13px; }
  .timer strong { font-size: 25px; }
  .question-card { scroll-margin-top: 130px; padding: 23px; }
  .jury-main { padding: 28px 20px 45px; }
  .jury-grid { display: flex; flex-direction: column; }
  .jury-grid > section { width: 100%; }
  .jury-aside { width: 100%; order: -1; position: static; padding: 19px; display: flex; align-items: center; flex-wrap: wrap; gap: 15px; }
  .jury-aside p { order: 2; width: 100%; margin: 0; }
  .jury-aside .button { width: auto; margin-left: auto; }
  .jury-aside strong { font-size: 25px; margin-top: 5px; }
  .jury-aside .text-link { margin-top: 0; }
  .board-main { padding: 30px 20px; }
  .board-title h1 { font-size: 28px; }
  .board-table th { padding: 14px 10px; font-size: 10px; }
  .board-table td { padding: 19px 11px; font-size: 17px; }
  .board-table td:nth-child(2) { font-size: 16px; }
  .board-table .total { font-size: 23px; }
  .login-page { padding-top: 45px; }
}
@media (max-width: 480px) {
  .cards, .form-grid { grid-template-columns: 1fr; }
  .page-heading { flex-wrap: wrap; gap: 15px; }
  .metrics { margin-bottom: 20px; }
  .metric { padding: 15px 10px; }
  .metric span { font-size: 10px; }
  .metric strong { font-size: 23px; }
  .stage-track { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stage-step { flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 65px; padding: 8px 4px; text-align: center; font-size: 10px; }
  .stage-hero { padding: 21px; }
  .stage-hero h2 { font-size: 22px; }
  .brand-title { font-size: 14px; }
  .public-header, .board-header { padding: 14px 17px; gap: 12px; }
  .public-header .row { gap: 8px; }
  .public-header .button { font-size: 11px; padding: 8px 9px; }
  .public-header .team-name { max-width: 90px; font-size: 12px; }
  .public-main { padding-left: 16px; padding-right: 16px; }
  .public-footer { gap: 22px; margin-top: 28px; }
  .event-banner h1 { font-size: 30px; }
  .event-banner { min-height: 310px; }
  .waiting { padding: 23px 20px; }
  .waiting p { font-size: 13px; }
  .quiz-header { gap: 10px; }
  .quiz-header h1 { font-size: 24px; }
  .quiz-info { font-size: 12px; max-width: 170px; line-height: 1.6; }
  .timer { min-width: 112px; padding: 10px 12px; }
  .timer .icon { display: none; }
  .quiz-nav { gap: 4px; }
  .quiz-nav a { width: 24px; height: 26px; font-size: 11px; }
  .quiz-aside { padding: 12px; gap: 9px; }
  .quiz-aside .button { padding: 8px; min-height: 34px; font-size: 10px; }
  .question-card { padding: 22px 17px; }
  .question-card h2 { font-size: 15px; }
  .option { padding: 12px; font-size: 13px; }
  .tab-bar { gap: 20px; }
  .tab-bar button { font-size: 12px; line-height: 1.5; text-align: left; }
  .score-team-head { padding: 17px; }
  .score-team-head strong { font-size: 16px; }
  .score-criterion { padding: 14px 17px; font-size: 13px; gap: 13px; }
  .score-toggle button { width: 36px; height: 35px; }
  .jury-aside h3 { font-size: 13px; }
  .jury-aside .button { padding: 9px; font-size: 11px; }
  .jury-main { padding-left: 16px; padding-right: 16px; }
  .board-header .brand-title { font-size: 14px; }
  .board-header .button { font-size: 11px; padding: 7px 9px; }
  .board-header .icon { width: 15px; height: 15px; }
  .board-main { padding-left: 15px; padding-right: 15px; }
  .board-table td:first-child { width: 46px; }
  .board-table td:nth-child(2) { width: auto; min-width: 130px; }
  .board-table th, .board-table td { padding-left: 9px; padding-right: 9px; }
  .board-table .contest-column { display: none; }
  .data-table th, .data-table td { padding: 13px 12px; }
  .panel-head, .panel-pad, .status-row { padding: 18px; }
  .compact-list > div { font-size: 12px; gap: 10px; }
  .modal-head, .modal-body { padding: 21px; }
  .codes-row { gap: 10px; font-size: 12px; }
  .codes-row code { font-size: 15px; }
  .login-page { padding: 30px 18px; }
  .login-box { padding: 25px; }
  .login-box h1 { font-size: 22px; }
  .setup-card { margin: 30px 18px; padding: 25px; }
}
@media (prefers-reduced-motion: no-preference) {
  .button, .option, .score-toggle button { transition: background-color .12s, border-color .12s; }
  html { scroll-behavior: smooth; }
}
@media print {
  .sidebar, .topbar, .button, .public-footer, .connection, .toast, .tab-bar { display: none !important; }
  .shell { display: block; }
  .content, .board-main { padding: 0; }
  body { background: white; }
  .panel, .score-team { break-inside: avoid; }
}

/* Версия 1.1: акценты мероприятия, читаемое табло и состояния блица. */
:root { --bg: #f0f3f8; --ink: #203247; --muted: #68778b; --line: #dce4ee; --green: #2c5d96; --accent: #d59b52; --radius: 8px; }
body { min-height: 100vh; background: var(--bg); transition: background-color .6s ease; }
.brand-title { font-weight: 650; }
.public-header, .board-header { border-top: 3px solid var(--green); }
.sidebar { background: #192e46; border-right: 0; color: #d7e2f0; }
.sidebar .brand { color: #fff; padding-left: 10px; border-left: 3px solid var(--accent); }
.nav button, .nav a { color: #b6c8de; border-radius: 6px; }
.nav button:hover, .nav a:hover { color: #fff; background: #243f5d; }
.nav .active { color: #fff; background: #2d4c70; box-shadow: inset 3px 0 var(--accent); }
.sidebar-bottom { border-top-color: #35506b; }
.sidebar-bottom small, .sidebar-links button { color: #adbed4; }
.topbar { border-bottom-color: #d5deea; }
.button { border-radius: 6px; font-weight: 500; }
.button.primary { box-shadow: 0 2px 4px #224b7620; }
.button.primary:hover { background: #234c7e; }
.panel, .team-card, .question-card, .score-team, .waiting, .login-box, .quiz-aside, .jury-aside, .setup-card { border-radius: 8px; box-shadow: 0 2px 7px #243b5307; }
.metrics { border-radius: 8px; overflow: hidden; }
.metric { border-top: 3px solid #6b91bc; }
.metric:nth-child(2) { border-top-color: #d8aa70; }
.metric:nth-child(3) { border-top-color: #779d98; }
.stage-hero { border-radius: 8px; background: #fff; border-left: 4px solid #537da9; }
.stage-track { border-radius: 7px; }
.stage-step.current { color: #234e80; background: #e3edf9; box-shadow: inset 0 -3px #315f97; }
.panel-head, .score-team-head { background: #f8faff; }
.event-banner { min-height: 390px; padding: 65px 35px; border-radius: 10px; border-top: 4px solid var(--accent); background: linear-gradient(125deg, #1c344f, #2c537f); color: #fff; }
.event-banner h1 { font-size: clamp(30px, 4vw, 49px); font-weight: 600; }
.event-banner p { color: #d3e1f1; font-size: clamp(16px, 1.7vw, 23px); line-height: 1.7; margin-left: auto; margin-right: auto; }
.login-box { border-top: 3px solid #537da9; }
.table-number { display: inline-block; color: #617a97; font-size: 12px; font-weight: 500; line-height: 1.4; }
.board-team .table-number { display: block; margin-bottom: 5px; }
.team-title { display: block; }
.team-card form { margin-top: 16px; }
.team-registration { max-width: 680px; }
.captain-code { font-family: ui-monospace, Consolas, monospace; font-size: 23px; letter-spacing: .3em; }
.moderation-panel { border-top: 3px solid #d3a164; margin-bottom: 24px; }
.name-request { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 22px; border-bottom: 1px solid var(--line); }
.name-request:last-child { border-bottom: 0; }
.name-request .table-number { margin-right: 16px; }
.name-request strong { font-size: 16px; font-weight: 500; overflow-wrap: anywhere; }
.reset-panel { border-color: #e1c5c5; margin-top: 25px; }
.reset-panel .hint { margin-top: 10px; max-width: 640px; }
.quiz-live { animation: quiz-calm 14s ease-in-out infinite alternate; }
.quiz-last-minute { background: #ecc0c0; animation: quiz-urgency 2.8s ease-in-out infinite; }
.quiz-warning { position: sticky; top: 0; z-index: 15; margin-bottom: 18px; border-radius: 6px; padding: 12px 18px; color: white; background: #a13035; font-size: 16px; font-weight: 600; text-align: center; }
.quiz-last-minute .public-header { border-top-color: #a13035; }
.quiz-last-minute .question-card { border-color: #d0a5a5; scroll-margin-top: 180px; }
.quiz-last-minute .quiz-aside { top: 65px; border-color: #c98c8c; }
.quiz-last-minute .timer { background: #a13035; border-color: #a13035; color: #fff; }
.quiz-last-minute .timer span { color: #fff; }
@keyframes quiz-calm { from { background-color: #eef3fb; } to { background-color: #e2ecf9; } }
@keyframes quiz-urgency { 0%,100% { background-color: #efcccc; } 50% { background-color: #e8aaaa; } }
.board-page { background: #f7f9fc; }
.board-page .board-header { min-height: 76px; color: #fff; background: #192e46; border-top: 0; border-bottom: 3px solid var(--accent); }
.board-header .brand-title { color: #fff; font-size: clamp(18px, 1.65vw, 29px); }
.board-header .button { color: #d7e5f5; background: transparent; border-color: #657d99; }
.board-header .button:hover { color: #fff; background: #2d4868; }
.board-page .board-main { width: 100%; max-width: none; padding: 2.6vh 3.8vw 3vh; }
.board-page .board-title { margin-bottom: 2.1vh; }
.board-page .board-title h1 { font-size: clamp(32px, min(3.2vw, 5.2vh), 58px); color: #203b5c; }
.board-page .board-title p { font-size: clamp(16px, 1.35vw, 24px); margin-top: 8px; }
.board-page .board-table { background: #fff; border: 1px solid #d8e2ed; }
.board-page .board-table th { font-size: clamp(13px, 1.35vw, 23px); color: #526883; padding: 1.3vh 1.3vw; background: #e9eff7; }
.board-page .board-table td { height: clamp(65px, 9vh, 110px); padding: 1vh 1.3vw; font-size: clamp(24px, min(3vw, 4.1vh), 50px); line-height: 1.2; color: #253a51; }
.board-page .board-table td:nth-child(2) { width: 40%; }
.board-page .team-title { font-size: clamp(24px, min(2.5vw, 3.8vh), 48px); font-weight: 600; }
.board-page .board-team .table-number { font-size: clamp(15px, min(1.3vw, 1.8vh), 23px); margin-bottom: 5px; }
.board-page .board-table .place { color: #3f5b7c; font-size: clamp(28px, min(3vw, 4vh), 53px); font-weight: 600; }
.board-page .board-table .total { color: #264e7e; font-size: clamp(32px, min(3.7vw, 4.8vh), 64px); font-weight: 650; }
.board-page .board-table .not-published { color: #a0aaba; }
.board-page .board-table tr.leader td { background: #fff8e9; }
.board-page .board-table tr.leader td:first-child { border-left: 4px solid var(--accent); }
.board-page .board-note { font-size: clamp(16px, 1.4vw, 24px); margin-top: 2vh; }
@media (max-width: 800px) {
  .sidebar { border-bottom-color: #304c6e; }
  .sidebar .brand { margin-left: 4px; }
  .name-request { flex-wrap: wrap; gap: 13px; }
  .name-request > div:first-child { width: 100%; }
  .event-banner { min-height: 330px; padding: 45px 24px; }
}
@media (max-width: 480px) {
  .event-banner { min-height: 290px; padding: 36px 20px; }
  .event-banner h1 { font-size: 30px; }
  .event-banner p { font-size: 16px; }
  .name-request { padding: 16px 18px; }
  .name-request .table-number { display: block; margin-bottom: 5px; }
  .name-request .inline-btns { width: 100%; }
  .name-request .button { flex: 1; }
  .quiz-warning { padding: 10px 12px; font-size: 14px; }
  .quiz-last-minute .quiz-aside { top: 43px; }
  .board-page .board-header { min-height: 66px; gap: 12px; }
  .board-header .brand-title { font-size: 15px; }
  .board-page .board-main { padding: 23px 13px 30px; }
  .board-page .board-title h1 { font-size: 30px; }
  .board-page .board-title p { font-size: 14px; }
  .board-page .board-table th { font-size: 12px; padding: 13px 9px; }
  .board-page .board-table td { padding: 15px 9px; height: 76px; }
  .board-page .board-table td:nth-child(2) { width: auto; }
  .board-page .team-title { font-size: 20px; }
  .board-page .board-team .table-number { font-size: 13px; }
  .board-page .board-table .place { font-size: 23px; }
  .board-page .board-table .total { font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .quiz-live, .quiz-last-minute { animation: none; }
  .quiz-last-minute { background: #e8aaaa; }
  body { transition: none; }
}

.board-page .table-scroll { overflow: visible; }

/* 1.2: fixed quiz controls and the organizer's final reveal. */
.toast { top: auto; bottom: 22px; pointer-events: none; }
.quiz-aside .timer { width: 100%; min-width: 0; margin-bottom: 20px; }
.shell .stage-track { grid-template-columns: repeat(9, minmax(0, 1fr)); }
.finale-controls { margin: 18px 0; border-left: 3px solid var(--accent); }
.rolling-value { display: inline-block; width: 2ch; text-align: center; font-variant-numeric: tabular-nums; color: #947137; }
.board-team > div { display: inline-block; vertical-align: middle; max-width: 100%; }
.trophy { width: 94px; height: 94px; flex: none; }
.trophy-gold { color: #dfb45f; }
.trophy-silver { color: #b9c7d7; }
.trophy-bronze { color: #ba875f; }
.trophy-small { width: 38px; height: 42px; display: inline-block; vertical-align: middle; margin-right: 12px; }
.final-table .board-team > div { max-width: calc(100% - 55px); }
.final-table tbody tr { animation: final-row .7s ease both; }
.final-table tbody tr:nth-child(2) { animation-delay: .08s; }
.final-table tbody tr:nth-child(3) { animation-delay: .16s; }
.final-table tbody tr:nth-child(4) { animation-delay: .24s; }
.final-table tbody tr:nth-child(5) { animation-delay: .32s; }
.final-table tbody tr:nth-child(6) { animation-delay: .4s; }
@keyframes final-row { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.ceremony-page { background: #14283d; color: #f5f7fb; }
.ceremony-page .board-header { background: #102236; }
.ceremony { max-width: 1640px; margin: auto; padding: 2.5vh 4vw 3vh; text-align: center; }
.ceremony h1 { font-size: clamp(22px, 2.5vw, 44px); color: #f5f7fb; }
.ceremony-heading { font-size: clamp(16px, 1.7vw, 27px); color: #cbb68f; margin-top: 8px; }
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2vw; align-items: end; margin-top: 3vh; }
.podium-card { padding: 2vh 1.5vw 3vh; border: 1px solid #456079; border-top: 3px solid #b9c7d7; border-radius: 8px; background: #20374e; animation: award-in .85s ease both; }
.podium-place-1 { grid-column: 2; grid-row: 1; min-height: 40vh; border-top-color: #dfb45f; background: #2b3e50; animation-delay: .9s; }
.podium-place-2 { grid-column: 1; grid-row: 1; min-height: 35vh; animation-delay: .45s; }
.podium-place-3 { grid-column: 3; grid-row: 1; min-height: 31vh; border-top-color: #ba875f; }
.podium-card h2 { color: #f3efe5; font-size: clamp(17px, 1.8vw, 30px); margin: 1vh 0 2vh; }
.podium-card .trophy { width: clamp(64px, 8vw, 120px); height: clamp(64px, 8vw, 120px); }
.podium-teams { display: grid; gap: 2vh; }
.podium-card:only-child { grid-column: 1 / -1; }
.podium-card:only-child .podium-teams { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.podium-card:has(.podium-team:nth-child(3)) .trophy { width: 64px; height: 64px; }
.podium-card:has(.podium-team:nth-child(3)) .podium-teams { gap: 1vh; }
.podium-card:has(.podium-team:nth-child(3)) .podium-team strong { font-size: clamp(17px, 1.65vw, 25px); }
.podium-team { display: grid; gap: .7vh; }
.podium-team .table-number { color: #b7c8d9; font-size: clamp(12px, 1.25vw, 20px); }
.podium-team strong { font-size: clamp(18px, 2.2vw, 36px); line-height: 1.2; overflow-wrap: anywhere; }
.award-points { color: #eed9ac; font-size: clamp(17px, 1.8vw, 29px); font-variant-numeric: tabular-nums; }
.other-teams { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.3vw; margin-top: 3vh; text-align: left; animation: award-in .8s 1.3s ease both; }
.other-teams > div { display: flex; gap: 16px; align-items: center; padding: 1.6vh 1.3vw; border-top: 1px solid #577087; }
.other-teams strong { display: block; font-size: clamp(16px, 1.6vw, 26px); overflow-wrap: anywhere; line-height: 1.3; }
.other-teams .table-number { color: #b7c8d9; }
.other-place { color: #cbb68f; font-size: 28px; }
.other-points { margin-left: auto; white-space: nowrap; color: #e9d6ae; font-size: clamp(16px, 1.5vw, 24px); }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }
@keyframes award-in { from { opacity: 0; transform: translateY(26px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* Event screens share the navy palette of the awards screen. */
.board-page { background: #14283d; color: #f5f7fb; transition: none; }
.board-page .board-header, .thematic-page .board-header { background: #102236; }
.board-page .board-title h1 { color: #f5f7fb; }
.board-page .board-title p, .board-page .board-note, .board-page .table-number { color: #b7c8d9; }
.board-page .board-table { background: #20374e; border-color: #456079; }
.board-page .board-table th { background: #20374e; color: #bdcfdf; border-color: #456079; }
.board-page .board-table td { background: #1b3147; color: #f5f7fb; border-color: #456079; }
.board-page .board-table .place { color: #d0deea; }
.board-page .board-table .total { color: #eed9ac; }
.board-page .board-table .not-published { color: #a9b8c7; }
.board-page .board-table tr.leader td { background: #2e3e4b; }
.thematic-page { background: #14283d; color: #f5f7fb; }
.thematic-main { padding: 3vh 4vw; max-width: 1680px; margin: auto; }
.block-title-only { min-height: 76vh; display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; gap: 4vh; }
.block-title-only h1, .block-heading h1 { color: #f5f7fb; font-size: clamp(30px, 4.5vw, 76px); }
.block-title-only p, .block-heading p { color: #bdcfdf; font-size: clamp(22px, 2.3vw, 36px); }
.block-heading { text-align: center; margin-bottom: 3vh; }
.block-heading h1 { font-size: clamp(28px, 3vw, 50px); }
.card-draw-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2vw; }
.draw-card { border: 1px solid #456079; border-top: 3px solid #c6a56a; background: #20374e; padding: 3vh 2vw; min-height: 27vh; border-radius: 8px; display: flex; flex-direction: column; gap: 2vh; }
.draw-card .table-number { color: #b7c8d9; font-size: clamp(16px, 1.5vw, 25px); }
.draw-card h2 { color: #f5f7fb; font-size: clamp(20px, 2vw, 34px); overflow-wrap: anywhere; }
.draw-card strong { font-size: clamp(24px, 2.5vw, 42px); color: #eed9ac; margin-top: auto; }
.team-draw-result { color: #eed9ac; font-size: clamp(34px, 4.7vw, 80px); min-height: 2.5em; display: grid; place-items: center; overflow-wrap: anywhere; }
.show-player { position: relative; max-width: 1400px; margin: auto; }
.show-video { width: 100%; height: 67vh; object-fit: contain; background: #0c1c2c; }
.play-sound { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); font-size: 20px; }
.assignment-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.program-overview { margin: 20px 0; }
.program-status { padding: 10px 0 0; color: #5d7084; font-size: 13px; }
.checkbox-label { display: flex; align-items: center; gap: 9px; }
.checkbox-label input { width: 18px; height: 18px; flex: none; }
.video-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.video-admin { border: 1px solid var(--line); border-radius: 6px; padding: 18px; }
.video-admin video, .jury-task video { width: 100%; max-height: 280px; background: #102236; margin-top: 12px; }
.video-admin summary, .jury-task summary { cursor: pointer; font-size: 13px; color: #375b82; }
.jury-task { padding: 15px 20px; border-bottom: 1px solid var(--line); }
.jury-task .task-body { font-size: 13px; margin-top: 12px; }
.jury-answer { padding: 12px; margin-top: 12px; background: #f3f0e9; color: #5f5140; font-size: 13px; }
.task-body { white-space: pre-line; line-height: 1.8; overflow-wrap: anywhere; }
.assigned-task h1 { margin: 15px 0 24px; }
.assigned-task h2 { margin-bottom: 15px; }
.captain-video { display: block; width: 100%; max-height: 55vh; background: #102236; margin: 20px 0; }
.public-main .stage-track { grid-template-columns: repeat(auto-fit, minmax(75px, 1fr)); }
.stage-introduced { animation: stage-introduced .65s ease both; }
@keyframes stage-introduced { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.quiz-nav-toggle { display: none; }
@media (max-width: 800px) {
  .quiz-aside .timer { flex: 1; width: auto; margin: 0; padding: 8px 11px; order: 0; }
  .quiz-aside .timer strong { font-size: 25px; }
  .quiz-aside .button { order: 1; }
  .quiz-aside .quiz-nav { width: 100%; order: 2; }
  .quiz-aside .quiz-nav a { flex: 1; max-width: 44px; }
  .quiz-aside .save-status { order: 3; }
  .question-card, .quiz-last-minute .question-card { scroll-margin-top: 210px; }
  .shell .stage-track { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .other-teams { grid-template-columns: 1fr; }
  .other-teams > div { padding: 14px; }
  .quiz-aside { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 8px 10px; }
  .quiz-aside .timer { grid-column: 1; grid-row: 1; min-width: 0; padding: 3px 0; border: 0; background: transparent; display: flex; gap: 7px; }
  .quiz-aside .timer > div { display: flex; align-items: baseline; gap: 7px; }
  .quiz-aside .timer span { margin: 0; font-size: 10px; }
  .quiz-aside .timer strong { font-size: 24px; }
  .quiz-aside .button { grid-column: 2; grid-row: 1; min-height: 30px; padding: 7px 9px; font-size: 10px; }
  .quiz-nav-toggle { display: block; grid-column: 1; grid-row: 2; border: 0; padding: 2px 0; background: transparent; color: #375b82; text-align: left; font-size: 10px; }
  .quiz-aside .quiz-nav { display: none; grid-row: 3; grid-column: 1 / -1; margin: 5px 0 0; }
  .quiz-aside.nav-open .quiz-nav { display: flex; }
  .quiz-aside .save-status { grid-column: 2; grid-row: 2; width: auto; text-align: right; font-size: 0; line-height: 1.2; }
  .quiz-aside .save-status::after { content: attr(data-short); font-size: 10px; }
  .quiz-last-minute .quiz-aside .timer { color: #a13035; }
  .quiz-last-minute .quiz-aside .timer span { color: #a13035; }
  .question-card, .quiz-last-minute .question-card { scroll-margin-top: 150px; }
  .card-draw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .podium { display: flex; flex-direction: column; align-items: stretch; gap: 15px; }
  .podium-card { min-height: 0; padding: 18px; }
  .podium-place-1 { order: -1; }
  .trophy-small { width: 25px; height: 30px; margin-right: 6px; }
  .final-table .board-team > div { max-width: calc(100% - 36px); }
  .assignment-grid, .video-list { grid-template-columns: 1fr; }
  .draw-card { min-height: 160px; }
}
@media (prefers-reduced-motion: reduce) {
  .podium-card, .other-teams, .final-table tbody tr, .stage-introduced { animation: none; }
}
