@font-face {
  font-family: Golos;
  src: url('/fonts/golos-text-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Golos;
  src: url('/fonts/golos-text-600.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: Unbounded;
  src: url('/fonts/unbounded-600.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: Plex;
  src: url('/fonts/plex-mono-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
/* Tokens of the site's direction A "Vakhta" (packages/site/src/theme.mjs): near-black
   surfaces, amber only as light (active state, instrument values, edge), Golos Text for
   text, Unbounded for headings and the scoreboard, IBM Plex Mono for code.
   Type scale: 13 caption / 14 secondary / 15 controls and tables / 16 body / 18 card /
   22 section / 30 page title; spacing 4 / 8 / 12 / 16 / 24 / 32 / 48 / 64. */
:root {
  --void: #0d0a07;
  --bg: #0f0d0b;
  --win: #1c1a17;
  --win2: #15130f;
  --sheet: #14120f;
  --line: rgba(245, 235, 220, 0.1);
  --line2: rgba(245, 235, 220, 0.17);
  --t1: rgba(242, 236, 226, 0.92);
  --t2: rgba(242, 236, 226, 0.62);
  --t3: rgba(242, 236, 226, 0.4);
  --body: rgba(242, 236, 226, 0.86);
  --title: #f4eee4;
  --amber: #eeb968;
  --hi: #ffdf9f;
  --acc: 238, 185, 104;
  --ok: #9fd3a0;
  --warn: #dd8b78;
  --code: #f0dfbf;
  --fb: Golos, sans-serif;
  --fd: Unbounded, sans-serif;
  --fm: Plex, monospace;
  --r: 6px;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
html {
  min-height: 100%;
  scroll-behavior: smooth;
  /* the bar stays on top: scrolled-to and focused things land below it */
  scroll-padding-top: 72px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--void);
  color: var(--t1);
  font: 400 16px/1.55 var(--fb);
  /* Counters and dates change width with every refresh: fixed-width digits keep the layout still. */
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
::selection {
  background: rgba(var(--acc), 0.32);
  color: #fff;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
textarea,
select,
summary {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
a {
  color: var(--amber);
  text-decoration-color: rgba(var(--acc), 0.4);
  text-underline-offset: 3px;
}
a:hover {
  text-decoration-color: var(--amber);
}
:focus-visible {
  outline: 1px solid var(--amber);
  outline-offset: 2px;
}
.i {
  flex: none;
}
/* ===== buttons: outlined by default, amber fill only for the one main action ===== */
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line2);
  border-radius: var(--r);
  background: rgba(13, 10, 7, 0.55);
  color: var(--t1);
  font: 600 15px/1.2 var(--fb);
  cursor: pointer;
  transition:
    border-color 0.12s,
    background-color 0.12s,
    color 0.12s;
}
button .i {
  color: var(--amber);
}
button:hover:enabled {
  border-color: rgba(var(--acc), 0.5);
  background: rgba(var(--acc), 0.1);
}
button:disabled {
  cursor: default;
  opacity: 0.45;
}
button.primary {
  background: var(--amber);
  border-color: var(--amber);
  color: #171310;
}
button.primary .i {
  color: currentColor;
}
button.primary:hover:enabled {
  background: var(--hi);
  border-color: var(--hi);
}
button.quiet {
  min-height: 36px;
  padding: 0 10px;
  border-color: transparent;
  background: transparent;
  color: var(--t2);
  font-size: 14px;
}
button.quiet .i {
  color: var(--t3);
}
button.quiet:hover:enabled {
  border-color: transparent;
  background: rgba(var(--acc), 0.08);
  color: var(--t1);
}
button.quiet:hover:enabled .i {
  color: var(--amber);
}
button.text-button {
  min-height: 32px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--amber);
  text-align: left;
}
button.text-button .i {
  color: currentColor;
}
button.text-button:hover:enabled {
  background: none;
  color: var(--hi);
}
.icon-button {
  width: 44px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: var(--t2);
}
.icon-button .i {
  color: currentColor;
}
.icon-button:hover:enabled {
  border-color: transparent;
  background: rgba(var(--acc), 0.08);
  color: var(--t1);
}
.danger-text,
button.quiet.danger-text .i {
  color: var(--warn) !important;
}
/* ===== type ===== */
h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}
h1,
h2,
h3,
h4 {
  line-height: 1.25;
  color: var(--title);
}
h1 {
  font: 600 clamp(26px, 2.2vw, 30px) / 1.2 var(--fd);
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}
h2 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 16px;
}
h3 {
  font-size: 18px;
}
h1[tabindex]:focus,
h2[tabindex]:focus {
  outline: none;
}
p {
  margin-bottom: 16px;
}
small,
.small {
  font-size: 14px;
  line-height: 1.5;
}
.muted {
  color: var(--t2);
}
.mono,
code,
pre {
  font-family: var(--fm);
}
.eyebrow {
  margin-bottom: 12px;
  font: 600 13px/1.3 var(--fb);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t3);
}
/* ===== badges and filters ===== */
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 10px;
  border: 1px solid var(--line2);
  border-radius: 12px;
  font: 400 13px/1.3 var(--fb);
  color: var(--t2);
}
.badge.amber {
  color: var(--amber);
  border-color: rgba(var(--acc), 0.5);
}
.badge.danger {
  color: var(--warn);
  border-color: rgba(221, 139, 120, 0.45);
}
.badge.ok {
  color: var(--ok);
  border-color: rgba(159, 211, 160, 0.4);
}
/* not yet anyone's: the site's dashed "not open yet" frame */
.badge.unknown {
  color: var(--t3);
  border-style: dashed;
}
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.filter-tabs button {
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  background: none;
  color: var(--t2);
  font-weight: 400;
}
.filter-tabs button:hover:enabled {
  background: rgba(var(--acc), 0.07);
  color: var(--t1);
}
.filter-tabs button.selected {
  color: var(--t1);
  border-radius: var(--r) var(--r) 0 0;
  box-shadow: inset 0 -2px 0 var(--amber);
}
.filter-tabs .count {
  display: inline-block;
  min-width: 2ch;
  color: var(--t3);
}
.filter-tabs .selected .count {
  color: var(--amber);
}
.filter-rule {
  width: 1px;
  height: 20px;
  margin: 0 8px;
  background: var(--line2);
}
.filter-tabs .filter-toggle {
  border: 1px dashed var(--line2);
}
.filter-tabs .filter-toggle .i {
  color: var(--t3);
}
.filter-tabs .filter-toggle.selected {
  border: 1px solid rgba(var(--acc), 0.5);
  border-radius: var(--r);
  background: rgba(var(--acc), 0.08);
  box-shadow: none;
}
.filter-tabs .filter-toggle.selected .i {
  color: var(--amber);
}
/* ===== admission strips ===== */
.bot-strip {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}
.bot-strip h2 {
  margin: 0 0 8px;
  font-size: 18px;
}
.bot-strip p {
  margin: 4px 0 0;
  font-size: 15px;
  color: var(--body);
}
.bot-strip > button,
.bot-strip > .row-actions {
  flex: none;
}
.bot-strip + .bot-strip {
  margin-top: 12px;
}
td.reason {
  max-width: 340px;
  overflow-wrap: anywhere;
}
.import-errors {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 14px;
}
td.repository {
  min-width: 200px;
  overflow-wrap: anywhere;
}
tr.unknown td {
  color: var(--t2);
}
/* ===== page frame ===== */
.skip {
  position: fixed;
  left: 12px;
  top: -80px;
  z-index: 200;
  padding: 12px 16px;
  border: 1px solid var(--amber);
  border-radius: var(--r);
  background: var(--win);
  color: var(--t1);
}
.skip:focus {
  top: 12px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
[hidden] {
  display: none !important;
}
.boot {
  max-width: 600px;
  margin: 10vh auto;
  padding: 32px;
}
.loading {
  padding: 48px 0;
  color: var(--t2);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--t1);
}
.mark {
  display: block;
  flex: none;
}
.brand strong {
  display: block;
  font: 600 16px/1 var(--fd);
  letter-spacing: 0.18em;
  color: var(--amber);
}
.brand small {
  display: block;
  margin-top: 6px;
  font: 600 13px/1.2 var(--fb);
  letter-spacing: 0.06em;
  color: var(--t3);
}
/* a lamp: amber as light, never as a surface */
.signal-dot {
  display: inline-block;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow:
    0 0 0 4px rgba(var(--acc), 0.14),
    0 0 12px rgba(var(--acc), 0.6);
}
.updates {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 40px;
  border-bottom: 1px solid rgba(var(--acc), 0.3);
  background: rgba(var(--acc), 0.08);
  color: var(--t1);
  font-size: 15px;
}
.updates[hidden] {
  display: none;
}
/* ===== sign-in ===== */
.access {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(420px, 1.1fr);
}
.access-story {
  display: flex;
  flex-direction: column;
  padding: 48px 64px;
  border-right: 1px solid var(--line);
  background: var(--bg);
}
.access-story .brand {
  margin-bottom: auto;
}
.access-copy {
  margin-top: 160px;
  max-width: 440px;
}
.access-copy h2 {
  margin: 0 0 24px;
  font: 600 clamp(40px, 4.4vw, 64px) / 1.12 var(--fd);
  letter-spacing: -0.02em;
}
.access-copy p:last-child {
  max-width: 340px;
  font-size: 18px;
  color: var(--t2);
}
.access-copy .eyebrow {
  color: var(--amber);
}
.access-story footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 64px;
  font-size: 14px;
  color: var(--t2);
}
.access-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px clamp(32px, 8vw, 128px);
}
.access-tabs {
  display: flex;
  gap: 24px;
  margin-bottom: 48px;
  border-bottom: 1px solid var(--line);
}
.access-tabs button {
  min-height: 0;
  padding: 0 0 12px;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--t2);
  font-size: 16px;
}
.access-tabs button:hover:enabled {
  background: none;
  color: var(--t1);
}
.access-tabs .selected {
  color: var(--t1);
  box-shadow: inset 0 -2px 0 var(--amber);
}
.access-form h1 {
  font-size: 28px;
}
.access-form .primary {
  width: 100%;
  margin-top: 8px;
}
.access-form .text-button {
  margin-top: 16px;
}
.access-footer {
  padding-top: 40px;
  font-size: 14px;
  color: var(--t2);
}
/* ===== forms ===== */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 16px;
}
.field > span {
  font: 600 14px/1.3 var(--fb);
  color: var(--t2);
}
.field input,
.field textarea,
.field select,
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line2);
  border-radius: var(--r);
  background: var(--win);
  color: var(--t1);
  font-size: 16px;
}
.field textarea {
  resize: vertical;
  min-height: 132px;
  line-height: 1.6;
}
.field input:focus,
.field textarea:focus,
select:focus {
  border-color: rgba(var(--acc), 0.7);
}
input::placeholder,
textarea::placeholder {
  color: var(--t3);
}
.hint {
  display: block;
  margin: -8px 0 16px;
  color: var(--t3);
}
.form-error {
  padding: 12px 16px;
  border-left: 2px solid var(--warn);
  border-radius: 0 var(--r) var(--r) 0;
  background: rgba(221, 139, 120, 0.08);
  color: var(--warn);
  font-size: 15px;
}
.notice {
  padding: 12px 16px;
  border-left: 2px solid var(--amber);
  border-radius: 0 var(--r) var(--r) 0;
  background: rgba(var(--acc), 0.06);
  color: var(--body);
  font-size: 15px;
}
.form-stack {
  display: flex;
  flex-direction: column;
}
.form-stack > .primary {
  align-self: flex-start;
}
.form-stack .field:last-of-type {
  margin-bottom: 24px;
}
.two-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  cursor: pointer;
}
.check input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  accent-color: var(--amber);
}
.check > span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.check small {
  color: var(--t3);
}
/* ===== workspace: rail on the left, bar on top ===== */
.workspace {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 24px 0 16px;
  border-right: 1px solid var(--line);
  background: var(--bg);
}
.sheet-head,
.scrim,
.nav-toggle {
  display: none;
}
.sidebar .brand {
  padding: 0 24px;
}
.rail-caption {
  margin: 32px 24px 8px;
  font: 600 13px/1.3 var(--fb);
  letter-spacing: 0.08em;
  color: var(--t3);
}
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px;
}
.sidebar nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px 0 16px;
  border-radius: var(--r);
  color: var(--t2);
  font-size: 15px;
  line-height: 1.3;
  text-decoration: none;
  transition:
    color 0.12s,
    background-color 0.12s;
}
.sidebar nav a .i {
  color: var(--t3);
}
.sidebar nav a:hover {
  background: rgba(var(--acc), 0.06);
  color: var(--t1);
}
.sidebar nav a.current {
  background: var(--win);
  color: var(--t1);
}
.sidebar nav a.current::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 2px;
  border-radius: 1px;
  background: var(--amber);
  box-shadow: 0 0 8px rgba(var(--acc), 0.8);
}
.sidebar nav a.current .i {
  color: var(--amber);
}
.nav-count {
  min-width: 24px;
  margin-left: auto;
  padding: 2px 8px;
  border: 1px solid rgba(var(--acc), 0.5);
  border-radius: 12px;
  color: var(--amber);
  font: 600 13px/1.2 var(--fb);
  text-align: center;
}
.rail-footer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: auto;
  padding: 16px 24px 0;
  border-top: 1px solid var(--line);
  font-size: 15px;
  overflow-wrap: anywhere;
}
.rail-footer .muted {
  color: var(--t3);
  font-size: 14px;
}
.rail-logout {
  align-self: flex-start;
  min-height: 36px;
  margin: 8px 0 0 -10px;
  padding: 0 10px;
  border-color: transparent;
  background: transparent;
  color: var(--t2);
  font-size: 14px;
}
.rail-logout .i {
  color: var(--t3);
}
.rail-logout:hover:enabled {
  border-color: transparent;
  background: rgba(var(--acc), 0.08);
  color: var(--t1);
}
.workspace-body {
  min-width: 0;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 56px;
  padding: 0 40px;
  border-bottom: 1px solid var(--line);
  background: var(--void);
}
.topbar-lead {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.topbar-lead .mark,
.topbar-section {
  display: none;
}
.topbar-context {
  font: 600 13px/1 var(--fb);
  letter-spacing: 0.08em;
  color: var(--t3);
}
.topbar-tail {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.connection {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--t2);
  font-size: 14px;
  white-space: nowrap;
}
.connection .signal-dot {
  background: var(--ok);
  box-shadow: 0 0 8px rgba(159, 211, 160, 0.6);
}
/* without the lamp the status says the link is down */
.connection:not(:has(.signal-dot)) {
  color: var(--warn);
}
.main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 40px 40px 80px;
}
/* ===== page parts ===== */
.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}
.page-heading > div {
  min-width: 0;
}
.page-heading > button {
  flex: none;
  margin-top: 32px;
}
.lead {
  max-width: 46em;
  margin: 0;
  color: var(--t2);
  font-size: 17px;
}
.metric-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: 32px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg);
}
.metric-strip > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 24px;
  border-left: 1px solid var(--line);
}
.metric-strip > div:first-child {
  border-left: 0;
}
/* instrument values: the one place amber glows */
.metric-strip strong {
  font: 600 34px/1.15 var(--fd);
  color: var(--hi);
  text-shadow: 0 0 18px rgba(var(--acc), 0.35);
}
.metric-strip span {
  color: var(--t2);
  font-size: 14px;
}
.section {
  margin-top: 40px;
}
.section-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 16px;
}
.section-label h2 {
  margin: 0;
}
.panel,
.paper {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--win2);
}
.panel > h2:first-child {
  margin-bottom: 16px;
}
.two-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 24px;
}
.narrow {
  max-width: 640px;
}
.home-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 32px;
}
.dispatch {
  padding: 24px 32px;
  border: 1px solid rgba(var(--acc), 0.35);
  border-radius: var(--r);
  background: var(--win2);
  box-shadow: var(--shadow);
}
.dispatch-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.dispatch-heading .eyebrow {
  margin: 0;
}
.dispatch h2 {
  max-width: 420px;
  font-size: 26px;
  line-height: 1.3;
}
.dispatch .primary {
  margin: 12px 0 24px;
}
.dispatch .small {
  margin-bottom: 0;
}
.task-excerpt {
  color: var(--t2);
  line-height: 1.75;
}
.inbox-preview {
  padding-top: 8px;
}
.preview-row {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 16px 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: none;
  font-weight: 400;
  text-align: left;
}
.preview-row:hover:enabled {
  background: none;
}
.preview-row > span {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.preview-row small {
  color: var(--t3);
  font-size: 13px;
}
.preview-row strong {
  font-size: 16px;
}
.news-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.paper .eyebrow {
  font-size: 13px;
}
.paper h2 {
  font-size: 24px;
  line-height: 1.3;
}
.prose {
  overflow-wrap: anywhere;
  color: var(--body);
  line-height: 1.7;
  font-variant-numeric: normal;
}
.prose p:last-child,
.prose ul:last-child,
.prose ol:last-child {
  margin-bottom: 0;
}
.prose h3 {
  margin: 24px 0 12px;
}
.prose h4 {
  margin: 24px 0 8px;
}
.prose ul,
.prose ol {
  margin-top: 0;
  padding-left: 24px;
}
.prose li {
  padding: 4px 0;
}
.prose li::marker {
  color: var(--t3);
}
.prose .table-scroll {
  margin: 0 0 16px;
}
.prose .table-scroll:last-child {
  margin-bottom: 0;
}
/* A table cell stays on one line where it can (issue #408's own live-review pass: "P2-01" was
   splitting into "P2" / "-0" / "1"): `.prose`'s own `overflow-wrap: anywhere` is inherited into
   every cell, and the base `table` rule's `width: 100%` compresses a narrow column (ID) hard
   enough that even a short token no longer fits - anywhere then breaks it mid-word rather than
   leaving it whole. `min-width: 100%` (not `width`) keeps a table that fits the container filling
   it, but lets one that does not grow past it instead of shrinking its columns below their
   content - the `.table-scroll` wrapper's own `overflow: auto` is what actually catches the
   overflow at that point, on any screen width, not a forced break. */
.prose table {
  width: auto;
  min-width: 100%;
}
.prose th,
.prose td {
  overflow-wrap: normal;
  word-break: normal;
}
/* `overflow-wrap: normal` above only cancels a FORCED mid-word break; the browser's own line-
   breaking algorithm still treats the "-" in a plain (non-`code`) token like "P2-01" as an
   ordinary break opportunity, and a squeezed column takes it. ui.js's own markdown() marks a cell
   with no whitespace at all this way (`th` is already nowrap site-wide - see the base rule above);
   a cell with a real space (ordinary prose) is untouched and keeps wrapping between its words. */
.prose td.nowrap {
  white-space: nowrap;
}
pre {
  max-width: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #141210;
  color: #e8dfcf;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
code {
  font-size: 0.88em;
}
p code,
li code {
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--win);
  color: var(--code);
}
pre code {
  font-size: inherit;
}
.api-response {
  min-height: 120px;
  margin-bottom: 0;
}
.code-input {
  font-family: var(--fm);
  font-size: 14px;
}
.steps {
  padding-left: 24px;
  color: var(--t2);
}
.steps li {
  padding: 4px 0;
}
.stage-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  align-items: start;
  gap: 24px;
}
/* `minmax(0, 1fr)` on the track above only stops the GRID from growing past its own container;
   without `min-width: 0` on the ITEM itself, a grid item's automatic minimum size still defaults
   to its content's min-content width, and a wide-enough table (a `.table-scroll` with a nowrap
   cell, issue #408's own live-review pass) grows `.stage-detail` itself past the 343px the track
   already resolved to - overflow: visible then carries that all the way to <html>, and the PAGE
   gains the horizontal scrollbar `.table-scroll`'s own `overflow: auto` was supposed to catch. */
.stage-detail {
  min-width: 0;
}
.stage-rail {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 16px;
  border-left: 1px solid var(--line);
}
.stage-rail button {
  display: block;
  padding: 16px;
  border-color: transparent;
  background: none;
  font-weight: 400;
  text-align: left;
}
.stage-rail button.selected {
  border-color: var(--line);
  background: var(--win);
  box-shadow: inset 2px 0 var(--amber);
}
.stage-rail button > span {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stage-rail .mono {
  color: var(--t3);
  font-size: 13px;
}
.stage-rail strong {
  font-size: 15px;
  line-height: 1.5;
}
.stage-rail small {
  color: var(--t3);
}
.stage-detail .paper {
  border-color: rgba(var(--acc), 0.35);
}
.stage-receipt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 24px 0;
}
.stage-receipt p {
  margin: 0;
}
.inbox-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 24px;
}
/* Same grid-item minimum-size fix as .stage-detail above: an inbox message's own body goes
   through the same markdown() a wide table could come from too. */
.message-detail {
  min-width: 0;
}
.message-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.message-row {
  display: block;
  padding: 16px;
  border-color: var(--line);
  background: transparent;
  font-weight: 400;
  text-align: left;
}
.message-row.selected {
  border-left: 2px solid var(--amber);
  background: var(--win);
}
.message-row > span {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.message-row small {
  color: var(--t3);
  font-size: 13px;
}
.message-row strong {
  line-height: 1.5;
}
.message-row .badge {
  align-self: flex-start;
}
.message-detail > .primary {
  margin-top: 24px;
}
.empty {
  padding: 48px 24px;
  border: 1px dashed var(--line2);
  border-radius: var(--r);
  color: var(--t2);
  text-align: center;
}
.empty h2 {
  margin: 16px 0 8px;
  font-size: 18px;
}
.empty p {
  max-width: 460px;
  margin: 0 auto;
  font-size: 15px;
}
.empty-mark {
  color: var(--t3);
  font-size: 28px;
}
.dispatch .empty {
  padding: 16px 0;
  border: 0;
}
.footnote {
  max-width: 800px;
  margin-top: 24px;
  color: var(--t3);
  font-size: 14px;
}
/* ===== tables ===== */
.table-scroll {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg);
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 15px;
}
th {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line2);
  background: var(--win2);
  color: var(--t2);
  font: 600 13px/1.3 var(--fb);
  white-space: nowrap;
}
td {
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  color: var(--body);
  line-height: 1.5;
  vertical-align: top;
}
tbody tr:first-child td {
  border-top: 0;
}
tbody tr:hover td {
  background: rgba(var(--acc), 0.03);
}
td strong {
  color: var(--t1);
  font-size: 15px;
}
td small {
  display: block;
  margin-top: 4px;
  color: var(--t3);
  font-size: 13px;
}
.row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
/* the 36 px action buttons sit on the text line of the row, not below it */
td > .row-actions,
td > button.quiet {
  margin: -7px 0 -7px -10px;
}
.row-actions button {
  white-space: nowrap;
}
.digest {
  display: block;
  max-width: 420px;
  font-size: 13px;
  word-break: break-all;
}
.audit-target {
  color: var(--t2);
  font-size: 13px;
  overflow-wrap: anywhere;
}
/* ===== overview ===== */
.organizer-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.organizer-action {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 20px;
  border: 1px solid var(--line);
  background: var(--win2);
  font-weight: 400;
  text-align: left;
}
.organizer-action:hover:enabled {
  border-color: rgba(var(--acc), 0.45);
  background: #1a1714;
}
.organizer-action > span {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 16px;
}
.organizer-action .mono {
  color: var(--t3);
  font-size: 13px;
}
.organizer-action strong {
  grid-column: 1 / -1;
  font-size: 18px;
  line-height: 1.35;
}
.organizer-action span > span:not(.mono) {
  grid-column: 1 / -1;
  color: var(--t2);
  font-size: 15px;
  line-height: 1.6;
}
.organizer-action b {
  grid-column: 2;
  grid-row: 1;
  color: var(--t3);
  transition:
    color 0.12s,
    transform 0.12s;
}
.organizer-action b .i {
  color: currentColor;
}
.organizer-action:hover:enabled b {
  color: var(--amber);
  transform: translateX(2px);
}
/* ===== recipients, submissions, news ===== */
.recipient-field {
  min-width: 0;
  margin: 0 0 24px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.recipient-field legend {
  padding: 0 8px;
  color: var(--t2);
  font-size: 14px;
  font-weight: 600;
}
.recipient-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
  max-height: 240px;
  overflow: auto;
}
.recipient-list .check {
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 15px;
}
.recipient-list small {
  font-size: 13px;
}
.recipient-list:empty:after {
  content: 'Активних учасників ще немає.';
  color: var(--t2);
  font-size: 15px;
}
.submission-choices {
  max-height: 420px;
  overflow: auto;
}
.submission-choices .check {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.submission-choices .digest {
  font-size: 13px;
}
.news-admin-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.news-admin-list .row-actions {
  margin-top: 24px;
}
.secret-box {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(var(--acc), 0.45);
  border-radius: var(--r);
  background: rgba(var(--acc), 0.05);
  overflow-wrap: anywhere;
}
.secret-box p {
  margin: 8px 0;
  color: var(--t2);
  font-size: 15px;
}
.secret-box textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line2);
  border-radius: var(--r);
  background: var(--win);
  color: var(--code);
  font: 14px/1.6 var(--fm);
  resize: none;
}
.secret-box button {
  margin-top: 12px;
}
/* ===== layers: dialog, toast, tooltip ===== */
.modal {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  padding: 24px;
  border: 1px solid var(--line2);
  border-radius: 10px;
  background: var(--sheet);
  color: var(--t1);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
}
.modal::backdrop {
  background: rgba(0, 0, 0, 0.6);
}
.modal > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.modal header h2 {
  margin-bottom: 8px;
}
.modal header p {
  margin: 0;
  color: var(--t2);
  font-size: 15px;
}
.modal header button {
  flex: none;
}
.modal .prose {
  margin-bottom: 24px;
}
.modal details {
  margin-bottom: 24px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.modal summary {
  cursor: pointer;
  font-weight: 600;
}
.modal details[open] summary {
  margin-bottom: 16px;
}
.toast {
  position: fixed;
  z-index: 100;
  bottom: 24px;
  left: 50%;
  max-width: min(600px, calc(100vw - 32px));
  padding: 12px 16px;
  border: 1px solid var(--line2);
  border-left: 2px solid var(--amber);
  border-radius: var(--r);
  background: #25221e;
  color: var(--t1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  font-size: 15px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 20px);
  transition:
    opacity 0.18s,
    transform 0.18s;
}
.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
#tip {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  max-width: 280px;
  padding: 6px 10px;
  border: 1px solid var(--line2);
  border-radius: 6px;
  background: #25221e;
  color: var(--t1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  font: 400 13px/1.35 var(--fb);
  opacity: 0;
  pointer-events: none;
  transform: translateY(2px);
  transition:
    opacity 0.12s,
    transform 0.12s;
}
#tip.on {
  opacity: 1;
  transform: none;
}
/* ===== appeals (scoring rules 14): appeals.js, the standalone /appeals page ===== */
.appeal-page .topbar {
  position: sticky;
}
.appeal-page .main {
  max-width: 1280px;
}
.appeal-topbar .brand strong {
  font-size: 15px;
}
.appeal-topbar .brand small {
  margin-top: 4px;
}
/* Unlike the client's own bar (.topbar-tail is flex: none there), this tail gives way: a long
   display name is cut short with an ellipsis, so "Вийти" stays on a phone's screen. The ellipsis
   needs the name as a block of inline text, not a flex row. */
.appeal-topbar .topbar-tail {
  flex: 0 1 auto;
  min-width: 0;
}
.appeal-topbar .topbar-tail > button {
  flex: none;
}
.appeal-user {
  display: block;
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.appeal-signin {
  max-width: 480px;
  margin: 8vh auto 0;
  padding: 32px;
}
.appeal-signin h1 {
  font-size: 28px;
}
.appeal-signin form .primary {
  width: 100%;
  margin-top: 8px;
}
.appeal-signin .notice {
  margin-bottom: 24px;
}
.appeal-layout {
  align-items: stretch;
}
.appeal-rules-list {
  display: grid;
  gap: 16px;
  margin: 0 0 24px;
}
.appeal-rules-list > div {
  padding-left: 12px;
  border-left: 2px solid var(--line2);
}
.appeal-rules-list dt {
  margin-bottom: 4px;
  color: var(--t1);
  font-weight: 600;
}
.appeal-rules-list dd {
  margin: 0;
  color: var(--body);
  font-size: 15px;
}
.appeal-rules-link a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.appeal-form .field.invalid > span {
  color: var(--warn);
}
.appeal-form [aria-invalid='true'] {
  border-color: var(--warn);
}
.appeal-text-field {
  margin-bottom: 8px;
}
/* the counter's own fixed slot: its digits change on every key, the line under it must not move */
.appeal-field-foot {
  display: flex;
  justify-content: flex-end;
  min-height: 20px;
}
.appeal-count {
  min-width: 11ch;
  color: var(--t3);
  font-size: 13px;
  text-align: right;
}
.appeal-form .form-error {
  margin: 8px 0 16px;
}
.appeal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
  padding-top: 8px;
}
.appeal-clock {
  margin: 4px 0 0;
}
.appeal-list {
  display: grid;
  gap: 12px;
}
.appeal-item {
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--win2);
}
.appeal-item[data-state='open'] {
  border-left: 2px solid rgba(var(--acc), 0.6);
}
.appeal-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.appeal-number {
  min-width: 4ch;
  color: var(--t1);
  font-size: 15px;
}
.appeal-what {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  min-width: 0;
  margin: 0;
}
.appeal-reference {
  color: var(--body);
  overflow-wrap: anywhere;
}
.appeal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 32px;
  margin: 12px 0 0;
  font-size: 14px;
}
.appeal-meta > div {
  display: flex;
  gap: 8px;
}
.appeal-meta dt {
  color: var(--t3);
}
.appeal-meta dd {
  margin: 0;
  color: var(--t2);
}
.appeal-meta time {
  cursor: default;
}
.appeal-body {
  margin: 0;
  color: var(--body);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.appeal-answer {
  margin-top: 16px;
  padding: 12px 16px;
  border-left: 2px solid var(--line2);
  border-radius: 0 var(--r) var(--r) 0;
  background: rgba(245, 235, 220, 0.03);
}
.appeal-item[data-state='upheld'] .appeal-answer {
  border-left-color: rgba(159, 211, 160, 0.6);
}
.appeal-answer .eyebrow {
  margin-bottom: 6px;
}
.appeal-text {
  margin-top: 12px;
}
.appeal-text summary {
  width: max-content;
  color: var(--t2);
  font-size: 14px;
  cursor: pointer;
}
.appeal-text summary:hover {
  color: var(--t1);
}
.appeal-text[open] summary {
  margin-bottom: 8px;
}
@media (max-width: 900px) {
  .appeal-page .topbar {
    padding: 0 8px 0 16px;
  }
  .appeal-user .muted {
    display: none;
  }
  .appeal-signin {
    margin-top: 24px;
    padding: 24px;
  }
}
/* ===== widths ===== */
@media (min-width: 1500px) {
  .main {
    padding: 48px 64px 80px;
  }
  .topbar,
  .updates {
    padding-inline: 64px;
  }
}
@media (max-width: 1150px) {
  .main {
    padding: 32px 24px 64px;
  }
  .topbar,
  .updates {
    padding-inline: 24px;
  }
  .workspace {
    grid-template-columns: 224px minmax(0, 1fr);
  }
  .sidebar .brand {
    padding: 0 16px;
  }
  .rail-caption {
    margin-inline: 16px;
  }
  .sidebar nav {
    padding: 0 8px;
  }
  .rail-footer {
    padding-inline: 16px;
  }
  .home-grid,
  .two-panels {
    grid-template-columns: 1fr;
  }
  .stage-layout {
    grid-template-columns: 200px minmax(0, 1fr);
  }
  .inbox-layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }
  .organizer-actions {
    grid-template-columns: 1fr;
  }
  .access {
    grid-template-columns: 1fr 1.1fr;
  }
  .access-story {
    padding: 40px;
  }
  .access-right {
    padding: 40px;
  }
  .page-heading {
    flex-wrap: wrap;
  }
  .page-heading > button {
    margin: 0;
  }
}
/* Phone and narrow tablet (the site switches at the same width): the rail becomes a sheet of
   sections opened from the bar, actions grow to a 44 px touch target. */
@media (max-width: 900px) {
  .workspace {
    display: block;
  }
  .topbar {
    height: 56px;
    padding: 0 4px 0 16px;
  }
  .updates {
    padding-inline: 16px;
  }
  .topbar-lead .mark {
    display: block;
  }
  .topbar-context {
    display: none;
  }
  .topbar-section {
    display: block;
    overflow: hidden;
    min-width: 0;
    color: var(--t1);
    font: 600 16px/1.2 var(--fb);
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .nav-toggle {
    display: inline-flex;
  }
  .sidebar {
    position: fixed;
    z-index: 70;
    top: 0;
    left: 0;
    right: 0;
    display: none;
    height: auto;
    max-height: calc(100dvh - 32px);
    padding: 0 12px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line2);
    border-radius: 0 0 14px 14px;
    background: var(--sheet);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
    overscroll-behavior: contain;
  }
  body.nav-open {
    overflow: hidden;
  }
  body.nav-open .sidebar {
    display: flex;
  }
  body.nav-open .scrim {
    display: block;
    position: fixed;
    z-index: 65;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
  }
  .sheet-head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: none;
    height: 56px;
    margin: 0 -12px 8px;
    padding: 0 4px 0 16px;
    border-bottom: 1px solid var(--line);
    background: var(--sheet);
  }
  .sheet-head b {
    font: 600 16px/1 var(--fb);
  }
  .sidebar .brand {
    display: none;
  }
  .rail-caption {
    margin: 8px 16px;
  }
  .sidebar nav {
    padding: 0;
  }
  .sidebar nav a {
    min-height: 48px;
    font-size: 16px;
  }
  .rail-footer {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
    margin-top: 12px;
    padding: 12px 16px 0;
  }
  .rail-footer .muted {
    margin-right: auto;
  }
  .rail-logout {
    min-height: 44px;
    margin: 0;
  }
  button.quiet,
  .filter-tabs button {
    min-height: 44px;
  }
  td > .row-actions,
  td > button.quiet {
    margin-block: -11px;
  }
  .main {
    padding: 24px 16px 64px;
  }
  .page-heading {
    margin-bottom: 24px;
  }
  .stage-layout,
  .inbox-layout {
    grid-template-columns: 1fr;
  }
  .stage-rail {
    flex-direction: row;
    overflow: auto;
    padding: 0 0 12px;
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }
  .stage-rail button {
    flex: none;
    min-width: 190px;
    max-width: 240px;
  }
  .message-list {
    max-height: 300px;
    overflow: auto;
  }
  .paper,
  .panel,
  .dispatch {
    padding: 20px 16px;
  }
  .paper h2 {
    font-size: 21px;
  }
  .dispatch h2 {
    font-size: 23px;
  }
  .dispatch-heading,
  .bot-strip {
    flex-wrap: wrap;
  }
  /* the strip's actions drop under its text and wrap there instead of pushing the page wider */
  .bot-strip > .row-actions {
    flex: 1 1 100%;
  }
  .section-label {
    align-items: flex-start;
  }
  .filter-rule {
    display: none;
  }
  .recipient-list {
    grid-template-columns: 1fr;
  }
  .access {
    display: block;
  }
  .access-story {
    padding: 24px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .access-copy {
    margin-top: 40px;
  }
  .access-copy h2 {
    margin-bottom: 16px;
    font-size: 34px;
  }
  .access-copy p:last-child {
    max-width: 380px;
    margin-bottom: 0;
    font-size: 16px;
  }
  .access-story footer {
    margin-top: 24px;
  }
  .access-right {
    padding: 32px 24px;
  }
  .access-tabs {
    margin-bottom: 32px;
  }
  .access-form h1 {
    font-size: 24px;
  }
  .access-footer {
    padding-top: 32px;
  }
  .modal {
    max-height: calc(100dvh - 24px);
    padding: 20px 16px;
  }
  .modal > header {
    gap: 12px;
  }
  .modal header h2 {
    font-size: 20px;
  }
  .organizer-action {
    padding: 16px;
  }
  .page-heading h1 {
    font-size: 25px;
  }
  th,
  td {
    padding: 12px;
  }
  .row-actions {
    min-width: 160px;
  }
}
@media (max-width: 600px) {
  .metric-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .metric-strip > div:nth-child(odd) {
    border-left: 0;
  }
  .metric-strip > div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
  .metric-strip > div {
    padding: 12px 16px;
  }
  .metric-strip strong {
    font-size: 28px;
  }
  /* labels of unequal length would put the two inputs on different lines */
  .two-fields {
    grid-template-columns: 1fr;
    gap: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *:before,
  *:after {
    transition: none !important;
    animation: none !important;
  }
}
