/* MUNOS — chair app styles */

:root {
  --bg: #f3f5f8;
  --panel: #ffffff;
  --panel-2: #f1f4f8;
  --line: #dde3eb;
  --line-strong: #c7d0db;
  --text: #15202d;
  --muted: #5f6d7e;
  --accent: #0b72c9;
  --accent-soft: #e3effa;
  --accent-ink: #ffffff;
  --ok: #17864a;
  --ok-soft: #e1f3e8;
  --bad: #c43636;
  --bad-soft: #fbe5e5;
  --warn: #b86e00;
  --warn-soft: #fcf0dc;
  --mod: #6a45c9;
  --mod-soft: #eee8fb;
  --unmod: #0c857c;
  --unmod-soft: #dff3f1;
  --shadow: 0 1px 2px rgba(20, 32, 45, .06), 0 4px 16px rgba(20, 32, 45, .05);
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d131a; --panel: #151d27; --panel-2: #1b2531; --line: #253140; --line-strong: #334255;
    --text: #e6edf5; --muted: #8e9cad; --accent: #3d9df0; --accent-soft: #15314b; --accent-ink: #06121e;
    --ok: #3fc07a; --ok-soft: #12301f; --bad: #f06a6a; --bad-soft: #3a1818; --warn: #f0a93d; --warn-soft: #3a2a10;
    --mod: #a58cf5; --mod-soft: #271f44; --unmod: #3cc9bc; --unmod-soft: #0f302d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d131a; --panel: #151d27; --panel-2: #1b2531; --line: #253140; --line-strong: #334255;
  --text: #e6edf5; --muted: #8e9cad; --accent: #3d9df0; --accent-soft: #15314b; --accent-ink: #06121e;
  --ok: #3fc07a; --ok-soft: #12301f; --bad: #f06a6a; --bad-soft: #3a1818; --warn: #f0a93d; --warn-soft: #3a2a10;
  --mod: #a58cf5; --mod-soft: #271f44; --unmod: #3cc9bc; --unmod-soft: #0f302d;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text); font: 14px/1.45 var(--font);
  display: grid; grid-template-columns: 168px minmax(0, 1fr); grid-template-rows: auto 1fr;
  grid-template-areas: "top top" "nav main"; min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; line-height: 1.25; }
h2 { font-size: 15px; font-weight: 650; }
button, input, select, textarea { font: inherit; color: inherit; }
kbd {
  font: 600 10.5px/1 var(--mono); padding: 2px 5px; border-radius: 4px; border: 1px solid var(--line-strong);
  border-bottom-width: 2px; background: var(--panel-2); color: var(--muted); vertical-align: 1px;
}
.btn kbd { margin-left: 6px; background: transparent; border-color: currentColor; color: inherit; opacity: .6; }

/* ---------- top bar ---------- */
.topbar {
  grid-area: top; position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px;
  padding: 10px 18px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: .06em; font-size: 15px; }
.committee { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.committee b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.committee span { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42ch; }
.status { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.tools { display: flex; gap: 6px; align-items: center; }
.now { font: 600 13px var(--mono); color: var(--muted); margin-right: 6px; }
.mode-pill, .q-pill {
  font-size: 12px; font-weight: 650; padding: 4px 10px; border-radius: 99px; border: 1px solid transparent; white-space: nowrap;
  background: var(--accent-soft); color: var(--accent);
}
.mode-pill.m-mod { background: var(--mod-soft); color: var(--mod); }
.mode-pill.m-unmod { background: var(--unmod-soft); color: var(--unmod); }
.mode-pill.m-suspended, .mode-pill.m-adjourned { background: var(--warn-soft); color: var(--warn); }
.mode-pill.m-voting { background: var(--bad-soft); color: var(--bad); }
.q-pill { cursor: pointer; background: var(--panel-2); color: var(--muted); border-color: var(--line); }
.q-pill.ok { color: var(--ok); }
.q-pill.no { color: var(--bad); background: var(--bad-soft); }
.cloud-pill {
  font-size: 12px; font-weight: 650; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); white-space: nowrap;
  background: var(--panel-2); color: var(--muted); cursor: pointer; max-width: 260px; overflow: hidden; text-overflow: ellipsis;
}
.cloud-pill.ok { color: var(--ok); }
.cloud-pill.dirty, .cloud-pill.busy { color: var(--warn); }
.cloud-pill.err { color: var(--bad); background: var(--bad-soft); border-color: transparent; }
#cloud-card .check { margin-top: 10px; }
.mini-clock {
  display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); background: var(--panel-2); border-radius: 99px;
  padding: 3px 10px; cursor: pointer; font-size: 12px; max-width: 240px;
}
.mini-clock span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.mini-clock b { font: 700 13px var(--mono); font-variant-numeric: tabular-nums; }
.mini-clock b.running { color: var(--ok); }
.mini-clock b.warn { color: var(--warn); }
.mini-clock b.over { color: var(--bad); }

/* ---------- nav ---------- */
.nav {
  grid-area: nav; position: sticky; top: 57px; align-self: start; display: flex; flex-direction: column; gap: 2px;
  padding: 14px 10px; height: calc(100vh - 57px);
}
.nav-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-radius: 8px;
  border: 0; background: none; cursor: pointer; text-align: left; color: var(--muted); font-weight: 550;
}
.nav-item:hover { background: var(--panel-2); color: var(--text); }
.nav-item.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.nav-badge { font-size: 11px; font-weight: 700; background: var(--panel-2); color: var(--muted); padding: 1px 7px; border-radius: 99px; }
.nav-item.on .nav-badge { background: var(--accent-soft); color: var(--accent); }
.nav-badge.live { color: var(--bad); background: var(--bad-soft); }

.view { grid-area: main; padding: 18px 22px 60px; min-width: 0; }

/* ---------- primitives ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.count { font-size: 12px; font-weight: 700; color: var(--muted); background: var(--panel-2); border-radius: 99px; padding: 1px 8px; margin-left: 4px; vertical-align: 1px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.accent { color: var(--accent); }
.ok-text { color: var(--ok); }
.bad-text { color: var(--bad); }
.row { display: flex; align-items: center; }
.row.wrap, .wrap { flex-wrap: wrap; }
.gap { gap: 12px; } .gap-s { gap: 6px; }
.row.end { justify-content: flex-end; margin-top: 8px; }
.row.center, .controls.center { justify-content: center; }
.grow { flex: 1 1 auto; min-width: 0; }
.spacer { flex: 1 1 auto; }
p { margin: 6px 0 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 7px 12px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: var(--panel); cursor: pointer; font-weight: 600; white-space: nowrap;
  transition: background .12s, border-color .12s, transform .05s;
}
.btn:hover:not(:disabled) { background: var(--panel-2); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover:not(:disabled) { background: var(--accent); filter: brightness(1.08); }
.btn.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.btn.bad, .btn.danger { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.btn.warnbtn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover:not(:disabled) { color: var(--text); }
.btn.lg { padding: 11px 18px; font-size: 15px; border-radius: 10px; }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.xs { padding: 3px 9px; font-size: 12px; border-radius: 6px; }
.icon {
  border: 0; background: none; cursor: pointer; color: var(--muted); width: 28px; height: 28px; border-radius: 6px;
  display: inline-grid; place-items: center; font-size: 14px; flex: none;
}
.icon:hover:not(:disabled) { background: var(--panel-2); color: var(--text); }
.icon:disabled { opacity: .3; cursor: default; }
.link { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; font-weight: 600; text-decoration: underline; }

.input, .select {
  border: 1px solid var(--line-strong); background: var(--panel); border-radius: 8px; padding: 7px 10px; min-width: 0;
  outline: none; transition: border-color .12s, box-shadow .12s;
}
.input:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.sm, .select.sm { padding: 5px 8px; font-size: 13px; }
.input.xs, .select.xs { padding: 3px 6px; font-size: 12px; border-radius: 6px; }
.input.lg { padding: 10px 12px; font-size: 22px; font-weight: 700; }
.input.num { width: 90px; font-variant-numeric: tabular-nums; }
.input.num.xs { width: 64px; }
.input.num.lg { width: 100%; }
textarea.input { width: 100%; resize: vertical; }
.select { padding-right: 26px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { font-size: 12px; font-weight: 600; color: var(--muted); }
.field .input, .field .select { width: 100%; }
.with-unit { display: flex; align-items: center; gap: 6px; }
.with-unit .input { width: 100%; }
.with-unit i { font-style: normal; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.inline-field { display: inline-flex; align-items: center; gap: 4px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.span-2 { grid-column: span 2; }
.form-foot { margin-top: 10px; }

.pill { display: inline-block; font-size: 11.5px; font-weight: 650; padding: 2px 8px; border-radius: 99px; background: var(--panel-2); color: var(--muted); text-transform: capitalize; white-space: nowrap; }
.st-passed, .b-yes, .att-present, .att-pv { background: var(--ok-soft); color: var(--ok); }
.st-failed, .st-ruled_out, .b-no { background: var(--bad-soft); color: var(--bad); }
.st-withdrawn, .st-lapsed, .att-absent { background: var(--panel-2); color: var(--muted); }
.st-introduced, .st-approved, .kind-dr { background: var(--accent-soft); color: var(--accent); }
.b-abstain, .st-submitted { background: var(--warn-soft); color: var(--warn); }
.kind-wp { background: var(--unmod-soft); color: var(--unmod); }
.kind-am { background: var(--mod-soft); color: var(--mod); }

.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; flex: none; }
.seg button { border: 0; background: var(--panel); padding: 5px 10px; cursor: pointer; font-weight: 600; font-size: 12.5px; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.seg.wide { display: flex; }
.seg.wide button { flex: 1; padding: 8px; }
.seg .seg-absent.on { background: var(--muted); }
.seg .seg-present.on { background: var(--ok); }

.banner { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; font-weight: 550; }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.voting { background: var(--bad-soft); color: var(--bad); }
.banner .link { color: inherit; }

.empty { max-width: 520px; margin: 8vh auto; text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }
.empty h3 { font-size: 20px; margin-bottom: 8px; }
.empty .row { justify-content: center; margin-top: 16px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.grid-2.tight { gap: 20px; }

/* ---------- avatars ---------- */
.av {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; flex: none;
  background: var(--panel-2); border: 1px solid var(--line); font-size: 11px; font-weight: 750; color: var(--muted); letter-spacing: .02em;
}
.av.flag { font-size: 20px; background: none; border-color: transparent; }
.av.xs { width: 18px; height: 18px; font-size: 9px; border-radius: 4px; vertical-align: -4px; }
.av.xs.flag { font-size: 14px; }
.av.sm { width: 24px; height: 24px; font-size: 10px; }
.av.sm.flag { font-size: 18px; }
.av.xl { width: 64px; height: 64px; font-size: 22px; border-radius: 14px; }
.av.xl.flag { font-size: 52px; }
.av.ghost { color: var(--line-strong); font-size: 26px; }

/* ---------- floor ---------- */
.floor { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(330px, 1fr); gap: 16px; align-items: start; }
.stage { border-top: 4px solid var(--accent); padding: 18px 22px 20px; }
.stage.is-mod { border-top-color: var(--mod); }
.stage.is-unmod { border-top-color: var(--unmod); }
.stage.is-paused { border-top-color: var(--warn); }
.stage.is-voting { border-top-color: var(--bad); }
.stage-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 14px; flex-wrap: wrap; }
.stage-topic { font-size: 17px; font-weight: 650; margin-top: 6px; }
.mode-tag { display: inline-block; font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .07em; padding: 3px 8px; border-radius: 5px; background: var(--accent-soft); color: var(--accent); }
.mode-tag.mod { background: var(--mod-soft); color: var(--mod); }
.mode-tag.unmod { background: var(--unmod-soft); color: var(--unmod); }
.mode-tag.paused { background: var(--warn-soft); color: var(--warn); }
.mode-tag.voting { background: var(--bad-soft); color: var(--bad); }
.caucus-clock { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 200px; }
.caucus-clock .bar { width: 100%; }

.speaker { display: flex; align-items: center; gap: 16px; padding: 10px 0 4px; }
.speaker-name { font-size: 28px; font-weight: 750; letter-spacing: -.01em; line-height: 1.15; }
.paused-msg { font-size: 26px; font-weight: 700; padding: 24px 0 8px; }

.clock {
  font-family: var(--font); font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.03em; line-height: 1;
  color: var(--text); transition: color .2s;
}
.clock.sm { font-size: 30px; }
.clock.xl { font-size: clamp(72px, 10vw, 148px); margin: 14px 0 12px; }
.clock.xxl { font-size: clamp(96px, 15vw, 220px); margin: 10px 0 14px; text-align: center; }
.clock:not(.running) { color: var(--muted); }
.clock.warn { color: var(--warn); }
.clock.over { color: var(--bad); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }

.bar { height: 8px; background: var(--panel-2); border-radius: 99px; overflow: hidden; }
.bar.thin { height: 5px; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .2s linear; }
.is-mod .bar i { background: var(--mod); }
.is-unmod .bar i { background: var(--unmod); }
.bar i.over { background: var(--bad); }

.controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.yield-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }

/* queue */
.q-list { list-style: none; margin: 0; padding: 0; max-height: 340px; overflow: auto; }
.q-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; border: 1px solid transparent; cursor: grab;
}
.q-item:hover { background: var(--panel-2); }
.q-item:first-child { background: var(--accent-soft); }
.is-mod-queue .q-item:first-child { background: var(--mod-soft); }
.q-item.dragging { opacity: .4; }
.q-item.drop-target { border-color: var(--accent); }
.q-pos { width: 18px; text-align: right; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.q-name { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.25; }
.q-name span { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-name small { font-size: 11.5px; }
.q-actions { display: flex; opacity: .35; transition: opacity .12s; }
.q-item:hover .q-actions, .q-item:focus-within .q-actions { opacity: 1; }
.q-empty { padding: 14px 8px; }
.picker { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.suggest { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 10px; background: var(--accent-soft); border-radius: 8px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; max-height: 220px; overflow: auto; }
.chips.tight { margin-top: 8px; }
.chips.scroll { max-height: 180px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: var(--panel); border-radius: 99px;
  padding: 3px 10px 3px 8px; font-size: 12.5px; font-weight: 550; cursor: pointer; white-space: nowrap;
}
.chip:hover { border-color: var(--accent); }
.chip b { font-size: 11px; color: var(--muted); background: var(--panel-2); border-radius: 99px; padding: 0 6px; font-variant-numeric: tabular-nums; }
.chip.fresh { border-color: var(--ok); background: var(--ok-soft); }
.chip.fresh b { background: transparent; color: var(--ok); }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip.on b { background: rgba(255, 255, 255, .2); color: inherit; }
.chip.dim { opacity: .45; }
.chip-flag { font-size: 15px; line-height: 1; }

/* points */
.point-form { display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--panel-2); border-radius: 10px; margin-bottom: 10px; }
.mini-log { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.mini-log li { padding: 4px 0; border-top: 1px solid var(--line); }
.mini-log li:first-child { border-top: 0; }

/* motions */
.motion-form.compact .form-grid { gap: 8px; }
.motion-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.motions-card .motion-list { margin-top: 12px; }
.motion { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--panel); }
.motion:first-child { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.m-head { display: flex; gap: 4px; align-items: flex-start; }
.m-title { font-weight: 650; }
.m-detail { font-size: 13px; }
.m-vote { display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

.history { list-style: none; padding: 0; margin: 0; max-height: 520px; overflow: auto; }
.history li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-top: 1px solid var(--line); }
.history li:first-child { border-top: 0; }

/* stats */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.stat span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.stat b { font-size: 26px; font-weight: 750; font-variant-numeric: tabular-nums; }
.stat b small { font-size: 13px; color: var(--muted); font-weight: 600; margin-left: 3px; }
.stat.good b { color: var(--ok); }
.stat.badstat b { color: var(--bad); }
.stat.warnstat b { color: var(--warn); }

/* roll call */
.roll-stepper { text-align: center; border-top: 4px solid var(--ok); }
.roll-now { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 14px 0; flex-direction: column; }
.roll-now.done { font-weight: 650; color: var(--ok); }
.roll-stepper .bar { margin-top: 14px; }
.roll-stepper .bar i { background: var(--ok); }
.att-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 6px; }
.att-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); }
.att-row.att-absent { opacity: .7; }
.att-row.is-current { border-color: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); opacity: 1; }
.att-row .pill { font-size: 10px; }
.att-row .seg button { padding: 4px 9px; }

/* voting */
.vote-subject { font-size: 19px; margin-top: 6px; }
.outcome { margin: 14px 0; padding: 12px 14px; border-radius: 10px; }
.outcome.pass { background: var(--ok-soft); }
.outcome.fail { background: var(--bad-soft); }
.tally { display: flex; gap: 18px; flex-wrap: wrap; }
.tally b { font-size: 24px; font-variant-numeric: tabular-nums; }
.placard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.ballots { list-style: none; padding: 0; margin: 0; max-height: 520px; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 4px 12px; }
.ballot-row { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; }
.ballot-row.is-current { background: var(--accent-soft); }
.ballot-row .select { width: 84px; flex: none; }
.ballot-row .pill { flex: none; }
.vote-item details { margin-top: 4px; }
.vote-item summary { cursor: pointer; color: var(--accent); }
.ballot-summary p { margin: 4px 0; font-size: 12.5px; }

/* delegates table */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar > .input:first-child { min-width: 220px; }
.table-wrap { overflow-x: auto; }
.dtable { width: 100%; border-collapse: collapse; font-size: 13px; }
.dtable th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.dtable td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.dtable td.num { white-space: nowrap; }
.dtable tr.is-absent td { opacity: .5; }
.dtable tr.is-silent td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.silent-tag { font-size: 11.5px; font-weight: 650; color: var(--warn); }
.minibar { width: 70px; height: 5px; background: var(--panel-2); border-radius: 99px; overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 6px; }
.minibar i { display: block; height: 100%; background: var(--accent); }
.stars { display: inline-flex; }
.stars button { border: 0; background: none; cursor: pointer; font-size: 15px; color: var(--line-strong); padding: 0 1px; }
.stars button.on { color: #e6a700; }
.notes-cell { min-width: 180px; }
.input.note { padding: 4px 7px; font-size: 12.5px; min-height: 28px; }

/* documents */
.doc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.doc { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.doc-head { display: flex; align-items: center; gap: 8px; }
.doc-code { font-variant-numeric: tabular-nums; white-space: nowrap; }
.doc-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-text { margin: 2px 0; font-size: 13px; white-space: pre-wrap; background: var(--panel-2); padding: 6px 8px; border-radius: 6px; }
.doc-actions { margin-top: 4px; }
.st-select { width: auto; }

/* log */
.log { list-style: none; margin: 12px 0 0; padding: 0; }
.log li { display: flex; gap: 12px; padding: 7px 4px; border-top: 1px solid var(--line); align-items: baseline; }
.log time { font: 600 12px var(--mono); color: var(--muted); flex: none; min-width: 64px; white-space: nowrap; }
.log-type { flex: none; width: 104px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.lt-motion .log-type { color: var(--accent); }
.lt-vote .log-type { color: var(--bad); }
.lt-mod .log-type { color: var(--mod); }
.lt-unmod .log-type { color: var(--unmod); }
.lt-point .log-type { color: var(--warn); }
.lt-note .log-type { color: var(--text); }

/* setup */
.checks { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--accent); }
.check span { display: flex; flex-direction: column; }
.check b { font-weight: 600; }
.check.tiny { font-size: 12px; align-items: center; gap: 4px; color: var(--muted); }
.check.tiny input { margin: 0; }
.add-country { margin-top: 12px; }
.add-country .input { width: 100%; }
.bulk { margin: 12px 0; }
.bulk summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.dlg-list { list-style: none; margin: 12px 0 0; padding: 0; max-height: 520px; overflow: auto; border-top: 1px solid var(--line); }
.dlg-list li { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.dlg-list .input.code { width: 48px; text-transform: uppercase; text-align: center; }

/* modal & toasts */
.modal { position: fixed; inset: 0; background: rgba(8, 14, 22, .5); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal[hidden] { display: none; }
.modal-card { position: relative; background: var(--panel); border-radius: 16px; padding: 24px; width: min(760px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.modal-card h2 { font-size: 18px; margin-bottom: 14px; }
.modal-x { position: absolute; top: 14px; right: 14px; }
.keys { width: 100%; border-collapse: collapse; font-size: 13px; }
.keys th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 0 4px; }
.keys td { padding: 4px 0; }
.keys td:first-child { width: 110px; }
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 60; align-items: center; pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 9px 16px; border-radius: 10px; font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); animation: rise .18s ease-out; transition: opacity .3s, transform .3s; }
.toast.ok { background: var(--ok); color: #fff; }
.toast.bad { background: var(--bad); color: #fff; }
.toast.warn { background: var(--warn); color: #fff; }
.toast.out { opacity: 0; transform: translateY(6px); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .floor { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 980px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  body { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "nav" "main"; }
  .nav { position: sticky; top: 0; z-index: 15; flex-direction: row; height: auto; overflow-x: auto; padding: 8px 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
  .nav-item { flex: none; }
  .topbar { position: static; flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .status { margin-left: 0; order: 3; width: 100%; }
  .tools { margin-left: auto; }
  .now { display: none; }
  .view { padding: 14px 16px 60px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .speaker-name { font-size: 22px; }
  .caucus-clock { align-items: flex-start; text-align: left; min-width: 0; width: 100%; }
}

/* ---------- delegate phones ---------- */
.requests { background: var(--ok-soft); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 6px; }
.request { display: flex; align-items: center; gap: 8px; background: var(--panel); border-radius: 8px; padding: 5px 6px 5px 8px; }
.live-row { display: flex; gap: 14px; align-items: center; }
.qr-btn { border: 0; padding: 6px; background: #fff; border-radius: 8px; cursor: pointer; flex: none; line-height: 0; }
.qr-btn .qr { width: 84px; height: 84px; }
.qr path, .qr rect { shape-rendering: crispEdges; }
.join-code { font: 800 22px/1.1 var(--mono); letter-spacing: .14em; }
.join-code.big { font-size: 34px; }
.live-card .check { margin-top: 12px; }
.live-panel { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; }
.qr-big { background: #fff; padding: 12px; border-radius: 12px; line-height: 0; }
.qr-big .qr { width: 220px; height: 220px; }
.sub-h { font-size: 14px; margin: 18px 0 8px; }
.claim-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 12px; }
.claim-list li { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.device-progress { display: flex; align-items: baseline; gap: 8px; }
.device-progress b { font-size: 40px; font-variant-numeric: tabular-nums; }
.roll-now .bar { width: min(420px, 100%); }
.seg.wide { flex-wrap: wrap; }
@media (max-width: 860px) { .live-panel { grid-template-columns: 1fr; justify-items: center; } }
