@font-face {
  font-family: Plex Sans; font-weight: 400; font-display: swap;
  src: url(fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2");
}
@font-face {
  font-family: Plex Sans; font-weight: 400; font-display: swap;
  src: url(fonts/ibm-plex-sans-cyrillic-400-normal.woff2) format("woff2");
  unicode-range: U+0400-052F, U+2116;
}
@font-face {
  font-family: Plex Sans; font-weight: 600; font-display: swap;
  src: url(fonts/ibm-plex-sans-latin-600-normal.woff2) format("woff2");
}
@font-face {
  font-family: Plex Sans; font-weight: 600; font-display: swap;
  src: url(fonts/ibm-plex-sans-cyrillic-600-normal.woff2) format("woff2");
  unicode-range: U+0400-052F, U+2116;
}
@font-face {
  font-family: Plex Mono; font-weight: 400; font-display: swap;
  src: url(fonts/ibm-plex-mono-latin-400-normal.woff2) format("woff2");
}

:root {
  color-scheme: light;
  --paper: #F3F0E9;
  --ink: #24211F;
  --muted: #625A53;
  --accent: #9E2638;
  --line: #C9C1B5;
  --strong-line: #80766D;
  --mono: "Plex Mono", monospace;
  font: 14px/1.45 "Plex Sans", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0 auto; max-width: 1336px; padding: 0 clamp(16px, 5vw, 72px) 48px; }
h1, h2, h3, p, ol, dl, dd { margin: 0; }
button, input, select { font: inherit; color: inherit; background: transparent; }
button, input, select { min-height: 36px; border: 1px solid var(--strong-line); border-radius: 0; padding: 5px 9px; }
button, summary { cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
button:disabled { opacity: .46; cursor: default; }
a { color: var(--ink); text-underline-offset: .22em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.masthead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px 24px; padding: 24px 0 15px; border-bottom: 2px solid var(--ink); }
.masthead h1 { font-size: 15px; font-weight: 600; }
.masthead nav { display: flex; justify-content: space-between; gap: 20px; font-size: 12px; }
#connection { color: var(--muted); white-space: nowrap; }
#connection.offline { color: var(--accent); }
.workspace { display: grid; align-items: start; }
.workspace:has(#moderator) { grid-template-columns: minmax(0, 1fr) minmax(318px, 368px); }
.board { min-width: 0; }
.board-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 21px; }
.caption { color: var(--muted); font-size: 12px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
#question-number { color: var(--accent); }
.progress { width: min(38%, 220px); display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.progress span { height: 4px; background: var(--line); }
.progress .past { background: var(--strong-line); }
.progress .current { background: var(--accent); }
#question { max-width: 38em; min-height: 2.64em; margin: 9px 0 15px; font-size: clamp(20px, 2.5vw, 24px); font-weight: 600; line-height: 1.28; }
.turn { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 20px; min-height: 154px; padding: 17px 0; border-top: 1px solid var(--strong-line); border-bottom: 1px solid var(--line); }
.turn-info { display: grid; gap: 3px; }
#speaker { font-size: clamp(21px, 3vw, 28px); font-weight: 600; line-height: 1.2; }
#asker { font-size: 13px; }
.clock { text-align: right; }
#time { font-size: clamp(64px, 8vw, 80px); line-height: 1.03; letter-spacing: -.075em; padding-inline-end: .075em; white-space: nowrap; }
#time.long { font-size: clamp(40px, 6vw, 65px); }
#time.overtime, #timer-state.overtime { color: var(--accent); }
#timer-state { min-height: 1.45em; margin-top: 5px; }
.sequence { padding: 11px 0 20px; min-height: 80px; }
#order { list-style: none; display: flex; flex-wrap: wrap; gap: 5px 18px; padding: 6px 0 0; }
#order li { border-top: 2px solid var(--line); padding-top: 3px; min-width: 82px; }
#order .active { border-color: var(--accent); color: var(--accent); font-weight: 600; }
#order .past { color: var(--muted); }
#order small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); }

summary { width: fit-content; font-weight: 600; }
.agenda { border-top: 2px solid var(--ink); padding-top: 12px; }
.agenda-grid { margin-top: 11px; }
.agenda-grid:has(#questions) { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); column-gap: clamp(20px, 5vw, 64px); }
#questions { padding: 0; list-style: none; }
#questions li { display: grid; grid-template-columns: 2.3em 1fr; gap: 3px; padding: 8px 0; border-top: 1px solid var(--line); }
#questions li[aria-current] > span { color: var(--accent); }
#questions li[aria-current] p { font-weight: 600; }
#questions small, .rules small, .rules-note { color: var(--muted); font-size: 12px; }
.agenda-grid:not(:has(#questions)) .rules { max-width: 470px; }
.rules > div { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; border-top: 1px solid var(--line); padding: 8px 0; }
.rules span { font: 12px/1.7 var(--mono); }
.rules small { grid-column: 1 / -1; }
.rules-note { padding-top: 7px; }

#moderator { border-left: 1px solid var(--line); padding: 18px 0 18px 20px; margin-left: 22px; }
#moderator h2 { font-size: 16px; }
.control-group, .shortcuts { border-top: 1px solid var(--line); padding: 8px 0; margin-top: 5px; }
.control-group h3 { font-size: 13px; margin-bottom: 6px; }
.buttons { display: flex; flex-wrap: wrap; gap: 4px; }
.timer-control button { flex: 1 0 20%; font-size: 12px; }
button.primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
button.primary:hover:not(:disabled) { background: var(--accent); color: var(--paper); }
.inline { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 8px; margin-top: 6px; }
#manual-time { width: 85px; font-family: var(--mono); }
.nav-controls { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 4px; margin-bottom: 5px; }
#jump button { min-width: 37px; }
#jump [aria-current] { border-color: var(--accent); color: var(--accent); }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-bottom: 5px; }
.pair select { display: block; width: 100%; }
.marks { display: grid; gap: 3px; margin-top: 8px; }
.marks label { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.shortcuts summary { font-size: 13px; }
.shortcuts dl { margin-top: 6px; }
.shortcuts dl div { display: grid; grid-template-columns: 76px 1fr; }
.shortcuts dt { font-weight: 600; }
.danger, #error { color: var(--accent); }
#error { padding: 6px 0; }

@media (max-width: 820px) {
  .workspace:has(#moderator) { grid-template-columns: 1fr; }
  #moderator { margin-left: 0; border-left: 0; border-top: 2px solid var(--ink); padding-left: 0; }
}
@media (max-width: 600px) {
  .masthead { align-items: start; flex-direction: column; padding-top: 16px; }
  .masthead nav { width: 100%; }
  .agenda-grid:has(#questions) { grid-template-columns: 1fr; row-gap: 12px; }
  .turn { grid-template-columns: 1fr; gap: 9px; }
  .clock { text-align: left; }
  .board-top { padding-top: 14px; }
  #question { min-height: 0; }
}
