/* Большая игра. Сетка: светлая консоль ведущего, сигнально-жёлтый акцент, цвета команд как язык всей системы. */
:root {
  --bg: #f1f2f8; --surface: #ffffff; --surface-2: #f6f7fc; --ink: #14162b; --muted: #5d627e; --line: #dcdeeb;
  --brand: #ffd23f; --brand-ink: #14162b; --brand-hover: #ffdc67; --danger: #d63644; --danger-soft: #fde8ea; --ok: #0f9a63; --ok-soft: #dcf5ea;
  --c-quiz: #1d4fb8; --c-activity: #b3500f; --c-break: #0b7a4d; --c-slide: #6b3bc0; --c-scores: #7a5a00; --c-winner: #b02a37; --c-lobby: #3b4170;
  --focus: #14162b; --shadow: 0 1px 0 rgba(20, 22, 43, .04), 0 8px 24px -12px rgba(20, 22, 43, .18);
  --display: 'Unbounded', 'Onest', system-ui, sans-serif; --body: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif; --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --r: 10px; --gutter: max(16px, env(safe-area-inset-left, 0px));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0f1f; --surface: #171933; --surface-2: #1d2040; --ink: #eef0fb; --muted: #9ca2c4; --line: #2b2e52;
    --danger: #ff6b78; --danger-soft: #3a1f2c; --ok: #38d39f; --ok-soft: #153a35; --focus: #ffd23f; --shadow: none; color-scheme: dark;
    --c-quiz: #8db4ff; --c-activity: #ffab74; --c-break: #6fe0b0; --c-slide: #c6a8ff; --c-scores: #ffd668; --c-winner: #ff9aa4; --c-lobby: #aab1e6;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0f1f; --surface: #171933; --surface-2: #1d2040; --ink: #eef0fb; --muted: #9ca2c4; --line: #2b2e52;
  --danger: #ff6b78; --danger-soft: #3a1f2c; --ok: #38d39f; --ok-soft: #153a35; --focus: #ffd23f; --shadow: none; color-scheme: dark;
  --c-quiz: #8db4ff; --c-activity: #ffab74; --c-break: #6fe0b0; --c-slide: #c6a8ff; --c-scores: #ffd668; --c-winner: #ff9aa4; --c-lobby: #aab1e6;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font: 400 15px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -.02em; line-height: 1.1; text-wrap: balance; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg, video { max-width: 100%; }
.i { flex: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.grow { flex: 1; min-width: 0; }
.stack { display: grid; gap: 14px; }

/* кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 16px; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink); font-weight: 600; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, transform .05s; white-space: nowrap; }
.btn:hover { border-color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); background: var(--danger-soft); }
.btn.sm { min-height: 34px; padding: 5px 11px; font-size: 13px; }
.btn.lg { min-height: 52px; padding: 13px 22px; font-size: 16px; }
.btn.icon-only { padding: 0; width: 42px; }
.btn.sm.icon-only { width: 34px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.block { width: 100%; }

/* поля */
.field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.field > span small { font-weight: 400; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea { width: 100%; min-width: 0; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink); font-weight: 500; }
textarea { min-height: 92px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); outline-offset: 0; }
[data-theme="dark"] input:focus, [data-theme="dark"] select:focus, [data-theme="dark"] textarea:focus { border-color: var(--brand); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .7; font-weight: 400; }
input[type=file] { font-size: 13px; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--ink); flex: none; }
.check { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--surface); font-weight: 600; font-size: 14px; color: var(--ink); cursor: pointer; }
.check:has(input:checked) { border-color: var(--ink); }
[data-theme="dark"] .check:has(input:checked) { border-color: var(--brand); }

/* карточки и метки */
.card { background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card h2 { font-size: 20px; }
.card h3 { font-size: 16px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.chip.live { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.chip.live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.code-chip { font: 700 15px var(--mono); letter-spacing: .14em; padding: 5px 12px; border-radius: 8px; background: var(--ink); color: var(--bg); }
.dot { width: 12px; height: 12px; border-radius: 4px; background: var(--c, var(--muted)); flex: none; }

/* шапка */
.page { width: 100%; max-width: 1240px; margin: 0 auto; padding-block: 0 56px; padding-left: var(--gutter); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.topbar { display: flex; align-items: center; gap: 16px; min-height: 68px; border-bottom: 1.5px solid var(--line); margin-bottom: 28px; flex-wrap: wrap; padding-block: 10px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font: 900 15px var(--display); letter-spacing: -.03em; line-height: 1; }
.brand small { display: block; font: 500 11px var(--body); letter-spacing: 0; color: var(--muted); margin-top: 3px; }
.logo-mark { --s: 28px; width: var(--s); height: var(--s); display: grid; grid-template: 1fr 1fr / 1fr 1fr; gap: calc(var(--s) / 9); flex: none; }
.logo-mark i { border-radius: calc(var(--s) / 7); }
.logo-mark i:nth-child(1) { background: #ff4d5a; } .logo-mark i:nth-child(2) { background: #3d8bff; } .logo-mark i:nth-child(3) { background: #ffc233; } .logo-mark i:nth-child(4) { background: #38d39f; }
.nav { display: flex; gap: 4px; margin-left: 10px; }
.nav a { padding: 8px 14px; border-radius: 99px; font-weight: 600; text-decoration: none; color: var(--muted); }
.nav a[aria-current=page] { background: var(--ink); color: var(--bg); }
.nav a:not([aria-current=page]):hover { color: var(--ink); }
.userbox { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 800; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.userbox .name { font-weight: 600; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* лендинг */
.landing { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(28px, 5vw, 72px); align-items: center; padding-block: clamp(16px, 5vh, 56px) 40px; }
.landing h1 { font-size: clamp(32px, 4.6vw, 58px); line-height: 1.04; letter-spacing: -.04em; font-weight: 900; }
.landing h1 mark { background: var(--brand); color: var(--brand-ink); padding: 0 .12em; border-radius: .12em; }
.landing .lead { font-size: clamp(16px, 1.6vw, 19px); color: var(--muted); max-width: 46ch; margin-top: 20px; }
.landing .cta { margin-top: 30px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.yandex-mark { width: 22px; height: 22px; border-radius: 50%; background: #fc3f1d; color: #fff; display: grid; place-items: center; font: 800 13px var(--body); }
.join-card { padding: 26px; }
.join-card h2 { font-size: 22px; }
.code-input { font: 700 clamp(26px, 5vw, 38px) var(--mono) !important; letter-spacing: .3em; text-transform: uppercase; text-align: center; padding: 14px 8px !important; }
.hero-board { margin-top: 18px; display: grid; gap: 10px; }
.mini-stage { border-radius: 14px; background: #0b0c1c; padding: 14px; display: grid; gap: 10px; color: #fff; }
.mini-stage .mini-bar { display: flex; justify-content: space-between; font: 600 12px var(--body); color: #9ca2c4; }
.mini-stage .t { font: 600 14px var(--mono); color: #fff; }
.mini-stage .q { font: 800 15px/1.2 var(--display); letter-spacing: -.02em; }
.mini-answers { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.mini-answers span { padding: 10px 12px; border-radius: 6px; font-weight: 800; font-size: 13px; color: #14162b; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 34px; }
.steps article { padding: 18px 0 0; border-top: 3px solid var(--ink); }
.steps h3 { font-size: 16px; margin-bottom: 8px; }
.steps p { color: var(--muted); font-size: 14px; }
.notice { padding: 12px 14px; border-radius: var(--r); background: var(--danger-soft); color: var(--danger); font-weight: 600; margin-bottom: 18px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 16px 0; }
.divider::before, .divider::after { content: ''; height: 1.5px; background: var(--line); flex: 1; }

/* кабинет */
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: clamp(26px, 3.4vw, 38px); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.quiz-card { display: grid; gap: 14px; align-content: space-between; }
.quiz-card h3 { font-size: 18px; line-height: 1.2; overflow-wrap: anywhere; }
.quiz-card .meta { display: flex; gap: 8px; flex-wrap: wrap; }
.quiz-card .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.empty { display: grid; justify-items: start; gap: 12px; padding: 36px; border: 2px dashed var(--line); border-radius: 16px; }
.empty h2 { font-size: 22px; }
.empty p { color: var(--muted); max-width: 50ch; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 0 12px 10px; font-weight: 700; }
.table td { padding: 14px 12px; border-top: 1.5px solid var(--line); vertical-align: middle; }
.table .code { font: 700 18px var(--mono); letter-spacing: .12em; }
.scroll-x { overflow-x: auto; }
.templates { display: grid; gap: 8px; }
.template { display: flex; gap: 12px; align-items: start; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--r); cursor: pointer; }
.template:has(input:checked) { border-color: var(--ink); background: var(--surface-2); }
[data-theme="dark"] .template:has(input:checked) { border-color: var(--brand); }
.template strong { display: block; font-size: 15px; color: var(--ink); }
.template span { color: var(--muted); font-size: 13px; font-weight: 400; }
dialog { border: 0; border-radius: 18px; padding: 0; width: min(520px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); }
dialog::backdrop { background: rgba(10, 11, 28, .6); }
.dlg { padding: 24px; display: grid; gap: 16px; }
.dlg h2 { font-size: 20px; }
.dlg p { color: var(--muted); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 190px; padding: 6px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .35); display: grid; }
.menu button { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 0; background: none; border-radius: 8px; font-weight: 600; cursor: pointer; text-align: left; }
.menu button:hover { background: var(--surface-2); }
.menu button.danger { color: var(--danger); }

/* редактор */
.workbench { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.outline { position: sticky; top: 12px; display: grid; gap: 6px; padding: 10px; max-height: calc(100vh - 24px); overflow: auto; }
.outline-item { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px; border: 1.5px solid transparent; border-radius: 10px; background: none; text-align: left; cursor: pointer; width: 100%; }
.outline-item:hover { background: var(--surface-2); }
.outline-item[aria-current=true] { border-color: var(--ink); background: var(--surface-2); }
[data-theme="dark"] .outline-item[aria-current=true] { border-color: var(--brand); }
.outline-item.is-live { box-shadow: inset 4px 0 0 var(--ok); }
.outline-item strong { display: block; font-size: 14px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.outline-item small { color: var(--muted); font-size: 12px; }
.type-ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: var(--c-lobby); background: color-mix(in srgb, currentColor 14%, var(--surface)); }
.type-ico.t-quiz { color: var(--c-quiz); } .type-ico.t-activity { color: var(--c-activity); } .type-ico.t-break { color: var(--c-break); } .type-ico.t-slide { color: var(--c-slide); }
.type-ico.t-scores { color: var(--c-scores); } .type-ico.t-winner { color: var(--c-winner); } .type-ico.t-lobby { color: var(--c-lobby); }
.outline-add { display: flex; gap: 8px; padding-top: 8px; border-top: 1.5px solid var(--line); margin-top: 4px; }
.outline-add select { flex: 1; min-width: 0; }
.panel { display: grid; gap: 22px; align-content: start; }
.panel-head { display: flex; align-items: start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.panel-head h2 { font-size: 22px; overflow-wrap: anywhere; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.question { display: grid; gap: 12px; padding: 16px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.question-head { display: flex; align-items: center; gap: 10px; }
.question-head .num { font: 700 13px var(--mono); color: var(--muted); }
.option-row { display: flex; align-items: center; gap: 8px; }
.option-row .letter { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; font: 800 13px var(--display); color: #14162b; flex: none; background: var(--c); }
.option-row label.correct { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; cursor: pointer; }
.savebar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin: 20px -4px -4px; background: var(--surface); border: 1.5px solid var(--ink); border-radius: 14px; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .35); }
.savebar.clean { border-color: var(--line); box-shadow: none; }
[data-theme="dark"] .savebar:not(.clean) { border-color: var(--brand); }
.teams-edit { display: grid; gap: 10px; }
.team-row { display: flex; gap: 10px; align-items: center; }
.media-box { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1.5px dashed var(--line); border-radius: 12px; flex-wrap: wrap; }
.media-box img, .media-box video { max-height: 90px; border-radius: 8px; }
details.bulk { border: 1.5px dashed var(--line); border-radius: 12px; padding: 12px 14px; }
details.bulk summary { cursor: pointer; font-weight: 700; }
details.bulk .stack { margin-top: 12px; }

/* пульт комнаты */
.room-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.room-head h1 { font-size: clamp(22px, 3vw, 32px); }
.tabs { display: flex; gap: 4px; border-bottom: 1.5px solid var(--line); margin-bottom: 22px; overflow-x: auto; }
.tabs button { padding: 11px 16px; border: 0; border-bottom: 3px solid transparent; background: none; font-weight: 700; color: var(--muted); cursor: pointer; white-space: nowrap; margin-bottom: -1.5px; }
.tabs button[aria-selected=true] { color: var(--ink); border-bottom-color: var(--brand); }
.onair { display: grid; gap: 18px; }
.onair-top { display: flex; justify-content: space-between; align-items: start; gap: 16px; flex-wrap: wrap; }
.onair h2 { font-size: clamp(22px, 2.6vw, 30px); overflow-wrap: anywhere; }
.big-clock { font: 600 clamp(40px, 6vw, 64px) var(--mono); letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.controls { display: flex; gap: 8px; flex-wrap: wrap; }
.progress { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.progress i { display: block; height: 100%; background: var(--brand); transition: width .3s linear; }
.team-people { display: grid; gap: 10px; }
.team-people .head { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.team-people .head b { margin-left: auto; font: 700 16px var(--mono); }
.team-people p { color: var(--muted); font-size: 13px; margin: 4px 0 0 22px; }
.share { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 16px; align-items: center; }
.share img { width: 132px; border-radius: 10px; background: #fff; padding: 6px; border: 1px solid var(--line); }
.share-link { display: flex; gap: 8px; align-items: center; padding: 8px 8px 8px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface-2); min-width: 0; }
.share-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 13px var(--mono); flex: 1; min-width: 0; }
.cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.score-line { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1.5px solid var(--line); }
.score-line:first-child { border-top: 0; }
.score-line .rank { width: 24px; font: 700 14px var(--mono); color: var(--muted); }
.score-line .total { margin-left: auto; font: 700 22px var(--mono); }
.score-line small { display: block; color: var(--muted); }

/* телефон участника */
.phone { min-height: 100vh; display: flex; flex-direction: column; padding-left: var(--gutter); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: max(14px, env(safe-area-inset-top, 0px)) max(18px, env(safe-area-inset-bottom, 0px)); max-width: 560px; margin: 0 auto; width: 100%; gap: 18px; }
.phone-top { display: flex; align-items: center; gap: 10px; justify-content: space-between; min-height: 40px; }
.team-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 99px; background: var(--c); color: #14162b; font-weight: 800; font-size: 14px; max-width: 60%; }
.team-badge span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phone h1 { font-size: clamp(30px, 8vw, 40px); letter-spacing: -.035em; font-weight: 900; }
.phone h2 { font-size: clamp(22px, 6vw, 28px); line-height: 1.2; }
.phone .lead { color: var(--muted); font-size: 16px; }
.team-pick { display: grid; gap: 8px; }
.team-pick label { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--c); color: #14162b; font-weight: 800; cursor: pointer; border: 3px solid transparent; }
.team-pick input { position: absolute; opacity: 0; pointer-events: none; }
.team-pick label:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--ink); }
[data-theme="dark"] .team-pick label:has(input:checked) { border-color: #fff; box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px #fff; }
.team-pick label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.team-pick .count { margin-left: auto; font: 700 13px var(--mono); opacity: .75; }
.play-answers { display: grid; gap: 10px; }
.play-answer { display: flex; align-items: center; gap: 14px; min-height: 68px; padding: 12px 16px; border: 0; border-radius: 14px; background: var(--c); color: #14162b; font-weight: 800; font-size: 18px; text-align: left; cursor: pointer; line-height: 1.2; overflow-wrap: anywhere; }
.play-answer b { width: 36px; height: 36px; flex: none; border-radius: 50%; background: #14162b; color: var(--c); display: grid; place-items: center; font: 800 15px var(--display); }
.play-answer:active { transform: scale(.985); }
.play-answer:disabled { opacity: .5; }
.timer-row { display: flex; align-items: center; gap: 14px; }
.timer-row .progress { flex: 1; }
.timer-row strong { font: 600 22px var(--mono); }
.status-card { padding: 20px; border-radius: 16px; background: var(--surface); border: 1.5px solid var(--line); display: grid; gap: 8px; }
.status-card.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.status-card.ok p { color: inherit; }
.phone-scores .score-line .rank { width: 20px; }
.phone-foot { margin-top: auto; text-align: center; color: var(--muted); font-size: 12px; }

#toast { position: fixed; z-index: 100; left: 50%; bottom: max(20px, env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 12px); max-width: min(440px, calc(100vw - 32px)); padding: 12px 18px; border-radius: 12px; background: var(--ink); color: var(--bg); font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast[data-kind=error] { background: var(--danger); color: #fff; }
.loading { min-height: 50vh; display: grid; place-items: center; color: var(--muted); }

@media (max-width: 980px) {
  .landing { grid-template-columns: 1fr; }
  .workbench { grid-template-columns: 1fr; }
  .outline { position: static; max-height: none; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); overflow-x: auto; }
  .outline-add { border-top: 0; border-left: 1.5px solid var(--line); padding: 0 0 0 10px; margin: 0; min-width: 230px; align-items: center; }
  .cols { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .steps { grid-template-columns: 1fr; }
  .topbar { gap: 10px; }
  .nav { margin-left: 0; order: 3; width: 100%; }
  .userbox .name { display: none; }
  .share { grid-template-columns: 1fr; justify-items: start; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; }
  .table tr { padding: 12px 0; border-top: 1.5px solid var(--line); }
  .table td { border: 0; padding: 4px 0; }
  .option-row { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { * { transition-duration: .01ms !important; animation-duration: .01ms !important; } }
