@font-face {
  font-family: Unbounded;
  src: url("/assets/Unbounded.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --canvas: #fff;
  --sidebar: #f7f8fa;
  --control-bg: #fff;
  --control-border: #7b889b;
  --control-hover: #526681;
  --toolbar-bg: #eef2f7;
  --line: #e7ecf4;
  --ink: #111a2c;
  --muted: #536078;
  --blue: #0047ff;
  --blue-hover: #205dff;
  --blue-text: #1348d2;
  --green: #137651;
  --amber: #875311;
  --red: #a72c46;
  --gutter: clamp(18px, 3.15vw, 52px);
  --sans: Inter, Geist, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: Unbounded, var(--sans);
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --pico-font-family: var(--sans);
  --pico-font-size: 16px;
  --pico-color: var(--ink);
  --pico-muted-color: var(--muted);
  --pico-primary: var(--blue-text);
  --pico-primary-hover: var(--blue);
  --pico-primary-background: var(--blue);
  --pico-primary-border: var(--blue);
  --pico-primary-hover-background: var(--blue-hover);
  --pico-primary-hover-border: var(--blue-hover);
  --pico-border-radius: 8px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 15px/1.5 var(--sans); }
h1, h2, h3 { color: var(--ink); margin: 0; overflow-wrap: anywhere; }
h1 { font: 640 clamp(25px, 3.1vw, 37px)/1.23 var(--display); letter-spacing: -.047em; }
h2 { font-size: 17px; font-weight: 650; letter-spacing: -.018em; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0; }
form { margin: 0; }
small, .muted, .subtle { color: var(--muted); }
.subtle { font-size: 13px; }
a { color: var(--blue-text); text-decoration: none; }
a:hover { color: var(--blue); }
:is(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid #7498ff;
  outline-offset: 2px;
}
.icon { flex: 0 0 auto; width: 17px; height: 17px; vertical-align: middle; }
.numeric, time, code { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.numeric { white-space: nowrap; }
code { color: #294575; background: #edf2fb; overflow-wrap: anywhere; white-space: normal; }

.shell { display: grid; grid-template-columns: 226px minmax(0, 1fr); min-height: 100svh; }
.sidebar {
  position: sticky; top: 0; height: 100svh; min-width: 0;
  display: flex; flex-direction: column;
  background: var(--sidebar); padding: 27px 15px 17px;
}
.brand { display: flex; align-items: center; gap: 13px; padding: 5px 8px; width: fit-content; color: var(--ink); }
.brand img { flex: 0 0 auto; }
.brand strong { display: block; font: 640 14px/1.14 var(--display); letter-spacing: -.035em; }
.brand small, .account-label small { display: block; font-size: 11px; margin-top: 3px; color: var(--muted); }
.nav { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; margin-top: 42px; }
.nav a {
  min-height: 43px; padding: 0 11px; gap: 10px; display: flex; align-items: center;
  border-radius: 8px; color: var(--muted); font-size: 14px; font-weight: 580;
  transition: color 120ms ease, background 120ms ease;
}
.nav a:hover { color: var(--ink); background: #eff3fa; }
.nav a[aria-current="page"] { color: var(--blue); background: #e9efff; }
.nav .nav-compact { display: none; }
.sidebar-footer { margin-top: auto; display: flex; align-items: center; gap: 9px; padding: 10px 4px 0; }
.account-avatar {
  flex: 0 0 auto; width: 31px; height: 31px; border-radius: 8px; display: grid; place-items: center;
  background: #e8effd; color: #234eae; font-size: 13px; font-weight: 680;
}
.account-label { flex: 1; min-width: 0; font-size: 12px; line-height: 1.2; }
.account-label strong, .account-label small { display: block; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.workspace { min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 62px; padding: 0 var(--gutter); color: var(--muted); font-size: 12px;
}
.breadcrumb { display: flex; align-items: center; gap: 9px; min-width: 0; }
.breadcrumb strong { color: #24324b; font-weight: 600; }
.breadcrumb .slash { color: #8290a5; }
.timezone { white-space: nowrap; }
.main { max-width: 1530px; margin-inline: auto; padding: 37px var(--gutter) 48px; }
.page-head {
  display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 14px 18px;
  margin-bottom: clamp(20px, 3vw, 33px);
}
.page-head p { color: var(--muted); margin-top: 8px; font-size: 14px; }

button, a[role=button] {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: auto; max-width: 100%; min-height: 38px; margin: 0; padding: 7px 13px;
  border: 1px solid var(--blue); border-radius: 8px; background: var(--blue); color: #fff;
  font-size: 14px; font-weight: 580; line-height: 1.4; text-align: center; text-decoration: none;
  white-space: normal; box-shadow: none; transition: color 120ms ease, background 120ms ease, border-color 120ms ease;
}
button:hover, a[role=button]:hover { background: var(--blue-hover); border-color: var(--blue-hover); color: #fff; }
button.outline, a[role=button].outline {
  color: #354560; background: var(--control-bg); border-color: var(--control-border);
}
button.outline:hover, a[role=button].outline:hover {
  color: var(--ink); background: #eef3fc; border-color: var(--control-hover);
}
button.outline.danger { color: var(--red); }
button.outline.danger:hover { background: #fbeaf0; }
button.icon-button {
  width: 34px; min-height: 34px; padding: 0; color: #354560; background: transparent; border-color: transparent;
}
button.icon-button:hover { color: var(--ink); background: #eaf0fa; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.actions form { min-width: 0; }

:is(input:not([type=hidden], [type=checkbox], [type=radio]), textarea, select) {
  width: 100%; min-width: 0; min-height: 40px; height: auto; margin: 0 0 10px; padding: 8px 11px;
  border: 1px solid var(--control-border); border-radius: 8px; background-color: var(--control-bg); color: var(--ink);
  font: inherit; box-shadow: none;
}
:is(input:not([type=hidden], [type=checkbox], [type=radio]), textarea, select):hover {
  border-color: var(--control-hover);
}
:is(input:not([type=hidden], [type=checkbox], [type=radio]), textarea, select):focus {
  border-color: var(--blue);
  outline: 2px solid var(--blue);
  outline-offset: 1px;
  box-shadow: none;
}
:is(input[type=checkbox], input[type=radio]):not(:checked) {
  background-color: var(--control-bg);
  border-color: var(--control-border);
}
input::placeholder, textarea::placeholder { color: var(--muted); }
select:not([multiple]) { padding-inline-end: 32px; }
textarea { resize: vertical; }
input[type=file] { max-width: 100%; }
input[type=file]::file-selector-button {
  padding: 5px 8px; margin-right: 8px; border: 0; border-radius: 5px;
  background: #e4ebf7; color: #33486a; font: inherit; cursor: pointer;
}
label { display: block; margin: 0 0 6px; color: var(--muted); font-size: 14px; }
label :is(input:not([type=checkbox]), select) { margin-top: 6px; }
.field-note { display: block; margin: -4px 0 13px; font-size: 12px; }
.option-hint { margin-bottom: 7px; }
.preview { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 12px; min-height: 36px; }
.preview, .body-wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.rich-field { margin: 8px 0 12px; min-width: 0; }
.rich-editor { background: var(--control-bg); border: 1px solid var(--control-border); border-radius: 8px; overflow: clip; }
.rich-editor:hover { border-color: var(--control-hover); }
.rich-editor:focus-within { border-color: var(--blue); outline: 2px solid var(--blue); outline-offset: 1px; }
.rich-toolbar {
  display: flex; gap: 3px; flex-wrap: wrap; padding: 4px; background: var(--toolbar-bg);
  border-bottom: 1px solid #c4cddd;
}
button.rich-button {
  min-width: 30px; min-height: 30px; padding: 3px 6px; border: 0; border-radius: 5px;
  background: transparent; color: #263751; font-size: 13px; line-height: 1.15;
}
button.rich-button:hover { color: var(--blue-text); background: #e1e8f8; }
button.rich-button[aria-pressed=true] { color: #123fa9; background: #dce9ff; }
button.rich-button:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
button.rich-button[data-format=bold] { font-weight: 800; }
button.rich-button[data-format=italic] { font-style: italic; }
button.rich-button[data-format=underline] { text-decoration: underline; }
button.rich-button[data-format=strikeThrough] { text-decoration: line-through; }
.rich-toolbar .rich-source-toggle { margin-left: auto; font: 600 11px/1 var(--mono); }
.rich-body, textarea.rich-source {
  min-height: 94px; padding: 9px 11px; overflow-wrap: anywhere;
}
.rich-body { white-space: pre-wrap; color: var(--ink); }
.rich-body:focus, .rich-editor textarea.rich-source:focus { outline: none; }
textarea.rich-source { display: block; margin: 0; border: 0; border-radius: 0; font-family: var(--mono); font-size: 12px; }
.rich-status { margin: 6px 0 0; color: var(--amber); font-size: 12px; }
.rich-preview { margin: 7px 0 0; padding: 5px 0 0; border: 0; }
.rich-preview summary { color: var(--muted); font-size: 13px; }
.rich-preview:has(.preview) .preview { margin-bottom: 0; }
.rich-rendered { margin-bottom: 7px; }
:is(.rich-body, .preview, .rich-rendered) blockquote {
  padding: 3px 0 3px 9px; margin: 5px 0; border: 0; border-left: 2px solid #668fff; color: #375087;
}
:is(.rich-body, .preview, .rich-rendered) :is(code, pre) { white-space: pre-wrap; }
:is(.rich-body, .preview, .rich-rendered) a { text-decoration: underline; text-underline-offset: 2px; }
tg-spoiler { background: #dce5f8; border-radius: 3px; }

.panel { min-width: 0; padding: 20px 22px; background: var(--sidebar); border-radius: 12px; margin-bottom: 18px; }
.panel > :is(h2, h3) { margin-bottom: 12px; }
.main > h2, form[data-editor] > h2 { margin: 20px 0 12px; }
.panel > p + p { margin-top: 8px; }
.panel form > .actions { margin-top: 5px; }
.columns { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.columns > .panel { margin-bottom: 0; }
.stretch { margin-bottom: 18px; }
.heading-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.heading-line + :is(p, div, label) { margin-top: 9px; }
.sep { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.metric { font-size: 18px; font-weight: 650; letter-spacing: -.02em; overflow-wrap: anywhere; }
.flash, .warning {
  margin: 0 0 13px; padding: 10px 13px; border-radius: 8px; overflow-wrap: anywhere;
  background: #edf3ff; color: #21468e; font-size: 14px;
}
.warning { background: #fbf0db; color: #74480f; }
.badge {
  display: inline-flex; align-items: center; gap: 5px; width: fit-content; max-width: 100%; padding: 5px 7px;
  border-radius: 5px; background: #edf1f7; color: #4b5b75; font-size: 12px; line-height: 1.2;
}
.badge::before { content: ""; flex: 0 0 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.testing, .badge.scheduled { background: #fbf0db; color: var(--amber); }
.badge.publishing, .badge.collecting_answers { background: #e7efff; color: #204bb5; }
.badge.finished, .badge.ok { background: #e4f4ec; color: var(--green); }
.badge.cancelled { background: #fbeaf0; color: var(--red); }
.award { color: var(--green); white-space: nowrap; }

.dashboard { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(255px, 1fr); align-items: start; gap: clamp(18px, 3vw, 36px); }
.dashboard .panel { margin-bottom: 0; }
.dashboard-side { min-width: 0; display: grid; gap: 18px; }
.activity-panel { min-width: 0; }
.section-heading { display: flex; align-items: center; gap: 8px; margin: 0 0 15px; }
.section-heading .icon { color: var(--muted); }
.empty-state {
  min-height: 185px; display: grid; align-content: center; justify-items: center; gap: 7px; padding: 22px 14px;
  background: var(--sidebar); text-align: center; border-radius: 12px;
}
.empty-state .icon { width: 24px; height: 24px; color: var(--blue-text); margin-bottom: 3px; }
.empty-state strong { color: #293b5a; font-size: 15px; }
.empty-state p { color: var(--muted); font-size: 13px; }
.activity-row { padding: 14px 0; border-top: 1px solid var(--line); }
.activity-row a { font-weight: 650; overflow-wrap: anywhere; }
.activity-row .actions { margin-top: 12px; }
.game-data { display: flex; gap: 5px 15px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.schedule-time { display: block; margin-bottom: 5px; color: #203454; font-size: 20px; font-weight: 580; }
.schedule-detail { font-size: 14px; margin-bottom: 8px; }
.channel-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 7px 10px; }
.channel-row strong { font-size: 14px; }
.channel-row p { font-size: 14px; overflow-wrap: anywhere; }
.channel-row small { font-size: 12px; overflow-wrap: anywhere; }
.channel-actions { margin-top: 16px; font-size: 13px; }
.channel-actions a { display: inline-flex; align-items: center; gap: 3px; }
.channel-actions .icon { width: 14px; height: 14px; }

.table-panel { padding: 0; background: transparent; }
.table-wrap { min-width: 0; overflow-x: auto; }
table { margin: 0; font-size: 14px; }
table :is(th, td) { padding: 11px 10px; border-bottom: 1px solid var(--line); background: transparent; }
table th { color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
table td { color: var(--ink); vertical-align: middle; }
table tbody tr:hover > td { background: #f6f8fd; }
.table-wrap .actions button { min-height: 32px; padding: 5px 8px; font-size: 12px; }
.table-wrap .actions a { font-size: 13px; font-weight: 600; }
.events-table .cell-label { display: none; }
.events-table .event-time time { white-space: nowrap; }
details { border-bottom: 1px solid #dfe5ef; padding: 10px 0; margin: 0; }
details summary { color: #273a60; font-weight: 590; }
details .body-wrap { margin-bottom: 7px; }

.login { min-height: 100svh; display: grid; place-items: center; padding: 22px; }
.login-content { width: min(100%, 360px); }
.login-card .login-logo { display: block; margin-bottom: 14px; }
.login-card h1 { font-size: clamp(24px, 8vw, 29px); margin-bottom: 7px; }
.login-card .login-description { color: var(--muted); margin-bottom: 23px; }
.login-card input:not([type=hidden]) { min-height: 44px; }
.login-card form button { width: 100%; margin-top: 4px; min-height: 42px; }
.login-help { margin-top: 16px; color: var(--muted); font-size: 13px; }
.error-page { max-width: 42rem; }
.error-page h1 { margin-bottom: 16px; }

@media (max-width: 1120px) {
  .shell { grid-template-columns: 188px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
}
@media (max-width: 875px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .sidebar {
    z-index: 2; flex-direction: row; height: auto; align-items: center; gap: 8px;
    padding: 6px 10px; border-bottom: 1px solid var(--line);
  }
  .brand { padding: 3px; }
  .brand span, .sidebar-footer .account-avatar, .sidebar-footer .account-label { display: none; }
  .nav { flex: 1; min-width: 0; display: flex; justify-content: flex-start; gap: 3px; overflow-x: auto; margin: 0; }
  .nav a { min-height: 38px; padding: 0 8px; white-space: nowrap; gap: 6px; }
  .sidebar-footer { padding: 0; margin: 0; }
  .topbar { min-height: 46px; }
  .main { padding-top: 24px; }
}
@media (max-width: 670px) {
  .nav a { font-size: 12px; }
  .nav a .icon, .nav .nav-full { display: none; }
  .nav .nav-compact { display: inline; }
  .sidebar { gap: 5px; }
  .topbar { gap: 5px; }
  .breadcrumb { gap: 6px; }
  .topbar, .timezone { font-size: 11px; }
  .panel { padding: 16px; }
  .table-panel { padding: 0; }
  :is(input:not([type=hidden], [type=checkbox], [type=radio]), textarea, select) { min-height: 44px; }
  button.rich-button { min-height: 34px; }
  .page-head { align-items: flex-start; margin-bottom: 20px; }
  .columns, .dashboard { grid-template-columns: minmax(0, 1fr); }
  .empty-state { min-height: 145px; }
  .events-table, .events-table tbody { display: block; }
  .events-table thead {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%);
  }
  .events-table tr {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 9px 12px;
    padding: 14px; background: var(--sidebar); border-radius: 10px; margin-bottom: 9px;
  }
  .events-table td { display: block; min-width: 0; border: 0; padding: 0; overflow-wrap: anywhere; }
  .events-table tbody tr:hover > td { background: transparent; }
  .events-table .cell-label { display: block; color: var(--muted); font-size: 11px; }
  .events-table .event-id { grid-row: 1; grid-column: 1; }
  .events-table .event-status { grid-row: 1; grid-column: 2; justify-self: end; }
  .events-table .event-time, .events-table .event-actions { grid-column: 1 / -1; }
  .events-table .event-actions { margin-top: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
