/* Traffic Pirates — operator console.
   Monochrome by design: colour appears only where it carries meaning (state). */

@font-face { font-family: "Plex Sans"; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-sans-latin-400.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Sans"; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-sans-latin-500.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Sans"; font-weight: 600; font-display: swap; src: url(fonts/ibm-plex-sans-latin-600.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Sans"; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-sans-cyrillic-400.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Plex Sans"; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-sans-cyrillic-500.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Plex Sans"; font-weight: 600; font-display: swap; src: url(fonts/ibm-plex-sans-cyrillic-600.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Plex Mono"; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-mono-latin-400.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+2190-2199, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Mono"; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-mono-latin-500.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+2190-2199, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Mono"; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-mono-cyrillic-400.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Plex Mono"; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-mono-cyrillic-500.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

:root {
  --bg: #0b0c0e;
  --bg-raised: #111214;
  --bg-hover: #17181b;
  --bg-sunken: #08090a;
  --line: #1e2024;
  --line-strong: #2b2e33;
  --text: #ecebe8;
  --text-2: #a3a4a8;
  --text-3: #6e7076;
  --brand: #ff5a2b;
  --ok: #4cc38a;
  --warn: #e3b341;
  --bad: #f2555a;
  --focus: rgb(236 235 232 / 0.22);
  --shadow: 0 24px 64px rgb(0 0 0 / 0.55);
  --radius: 8px;
  --radius-sm: 6px;
  --sans: "Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f5f3;
    --bg-raised: #ffffff;
    --bg-hover: #f0f0ed;
    --bg-sunken: #f7f7f5;
    --line: #e5e4e0;
    --line-strong: #d3d2cd;
    --text: #151515;
    --text-2: #5c5e62;
    --text-3: #8c8e93;
    --brand: #e9461a;
    --ok: #18864f;
    --warn: #a86f00;
    --bad: #cf2f33;
    --focus: rgb(21 21 21 / 0.16);
    --shadow: 0 24px 64px rgb(0 0 0 / 0.14);
    color-scheme: light;
  }
}

/* ---- base ------------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.5 var(--sans);
  font-feature-settings: "ss02";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: color-mix(in srgb, var(--brand) 32%, transparent); }
a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 22px; line-height: 1.25; }
h2 { font-size: 14px; }
p { margin: 0; }
b, strong { font-weight: 600; }
img, video { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--text-2); outline-offset: 2px; border-radius: 4px; }

.mono { font-family: var(--mono); font-size: 0.93em; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.muted { color: var(--text-3); }
.hint { color: var(--text-3); font-size: 12.5px; }
.is-bad { color: var(--bad); }
.is-warn { color: var(--warn); }
.break { overflow-wrap: anywhere; }
.truncate { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon { flex: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
kbd {
  font: 500 11px/1 var(--mono); color: var(--text-3);
  border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; padding: 3px 5px;
}

/* ---- top bar ------------------------------------------------------------------ */

.topbar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 92%, transparent); border-bottom: 1px solid var(--line); backdrop-filter: saturate(1.2) blur(8px); }
.topbar-inner { max-width: 1280px; height: 52px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; letter-spacing: -0.015em; text-decoration: none; }
.brand-mark { width: 20px; height: 20px; color: var(--text); }
.nav { display: flex; gap: 4px; height: 100%; }
.nav a { display: flex; align-items: center; padding: 0 10px; color: var(--text-2); text-decoration: none; font-weight: 500; box-shadow: inset 0 -2px 0 transparent; }
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--text); }
.topbar-end { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.slots { display: inline-flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 12.5px; }
.slots-dots { display: inline-flex; gap: 3px; }
.slot { width: 6px; height: 14px; border-radius: 2px; background: var(--line-strong); }
.slot-busy { background: var(--brand); }

/* ---- page ------------------------------------------------------------------- */

.page { max-width: 1280px; margin: 0 auto; padding: 28px 24px 96px; }
.page-full { max-width: none; padding: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; margin-bottom: 14px; color: var(--text-3); font-size: 13px; }
.crumbs a { color: var(--text-2); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.notices:empty { display: none; }
.notices { display: grid; gap: 8px; margin-bottom: 20px; }

/* ---- buttons & inputs ------------------------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--bg-raised); color: var(--text);
  font: 500 13px/1 var(--sans); white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: background-color 0.12s, border-color 0.12s, opacity 0.12s;
}
.btn:hover { background: var(--bg-hover); border-color: color-mix(in srgb, var(--line-strong) 60%, var(--text-3)); }
.btn:active { transform: translateY(0.5px); }
.btn .icon { color: var(--text-2); }
.btn-primary { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn-primary .icon { color: inherit; }
.btn-primary:hover { background: var(--text); border-color: var(--text); opacity: 0.88; }
.btn-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); background: transparent; }
.btn-danger .icon { color: inherit; }
.btn-danger:hover { background: color-mix(in srgb, var(--bad) 10%, transparent); border-color: var(--bad); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-hover); border-color: transparent; color: var(--text); }
.btn-ghost.is-bad, .btn-ghost.is-bad .icon { color: var(--bad); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none;
  border: 1px solid transparent; border-radius: var(--radius-sm); background: none; color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }

.input {
  width: 100%; min-height: 36px; padding: 7px 10px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--bg-sunken); color: var(--text); font: inherit;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.input::placeholder { color: var(--text-3); }
.input:hover { border-color: color-mix(in srgb, var(--line-strong) 55%, var(--text-3)); }
.input:focus { outline: none; border-color: var(--text-2); box-shadow: 0 0 0 3px var(--focus); }
.input[readonly] { color: var(--text-2); }
textarea.input { resize: vertical; line-height: 1.5; }
.input.mono { font-family: var(--mono); font-size: 13px; letter-spacing: -0.01em; }
.field { display: grid; gap: 6px; min-width: 0; }
.field-label { display: flex; justify-content: space-between; gap: 12px; color: var(--text-2); font-size: 12.5px; font-weight: 500; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form { display: grid; gap: 14px; justify-items: start; }
.form > .field, .form > .field-row, .form > p, .form > textarea { justify-self: stretch; }
.counter { color: var(--text-3); font-weight: 400; }
.counter.is-over { color: var(--bad); }

/* ---- status ----------------------------------------------------------------- */

.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--text-3); }
.dot-ok { background: var(--ok); }
.dot-warn { background: var(--warn); }
.dot-bad { background: var(--bad); }
.dot-muted { background: transparent; box-shadow: inset 0 0 0 1.5px var(--text-3); }
.dot-live { background: var(--brand); box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 55%, transparent); animation: pulse 1.6s ease-out infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.status { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.status-live { color: var(--brand); font-weight: 500; }
.tag {
  display: inline-block; padding: 1px 5px; border: 1px solid var(--line-strong); border-radius: 4px;
  color: var(--text-2); font: 500 11px/1.45 var(--mono); letter-spacing: 0.02em; vertical-align: 1px;
}
.sub { display: block; margin-top: 1px; color: var(--text-3); font-size: 12.5px; }

.notice {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--bg-raised); line-height: 1.45;
}
.notice > .icon { margin-top: 2px; color: var(--text-2); }
.notice > span { flex: 1; }
.notice a { text-decoration-color: currentColor; }
.notice-ok { border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }
.notice-ok > .icon { color: var(--ok); }
.notice-warn { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); background: color-mix(in srgb, var(--warn) 6%, var(--bg-raised)); }
.notice-warn > .icon { color: var(--warn); }
.notice-bad { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); background: color-mix(in srgb, var(--bad) 6%, var(--bg-raised)); }
.notice-bad > .icon { color: var(--bad); }
.notice-close { margin: -4px -6px -4px 0; padding: 4px; border: 0; border-radius: 4px; background: none; color: var(--text-3); cursor: pointer; }
.notice-close:hover { color: var(--text); background: var(--bg-hover); }

/* ---- accounts list ------------------------------------------------------------ */

.stats {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin-bottom: 16px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raised); overflow: hidden;
}
.stat {
  display: grid; gap: 4px; padding: 14px 16px; text-align: left;
  border: 0; border-left: 1px solid var(--line); background: none; color: inherit; font: inherit;
}
.stat:first-child { border-left: 0; }
button.stat { cursor: pointer; }
button.stat:hover { background: var(--bg-hover); }
button.stat[aria-pressed="true"] { background: var(--bg-hover); box-shadow: inset 0 -2px 0 var(--text); }
.stat-label { display: flex; align-items: center; gap: 7px; color: var(--text-2); font-size: 12.5px; }
.stat-value { font: 500 24px/1.15 var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.stat-value.is-bad { color: var(--bad); }
.stat-value small { font: 500 12.5px var(--mono); letter-spacing: 0; }

.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.search { position: relative; display: flex; align-items: center; width: min(360px, 100%); }
.search > .icon { position: absolute; left: 10px; color: var(--text-3); pointer-events: none; }
.search .input { padding-left: 32px; padding-right: 34px; }
.search kbd { position: absolute; right: 9px; }
.search .input:focus ~ kbd { display: none; }
.search input::-webkit-search-cancel-button { display: none; }
.toolbar-note { color: var(--text-3); font-size: 12.5px; }

.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raised); overflow: hidden; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  padding: 9px 14px; text-align: left; white-space: nowrap;
  color: var(--text-3); font-size: 12px; font-weight: 500; background: var(--bg-raised);
  border-bottom: 1px solid var(--line);
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr[data-href] { cursor: pointer; }
.table tbody tr:hover td { background: var(--bg-hover); }
.account-link { font-weight: 600; text-decoration: none; }
.account-link:hover { text-decoration: underline; }
.table-empty { padding: 28px 16px; text-align: center; color: var(--text-3); }

.empty { max-width: 520px; margin: 12vh auto 0; text-align: center; display: grid; gap: 12px; justify-items: center; }
.empty h2 { font-size: 18px; }
.empty p { color: var(--text-2); }

/* ---- dialog ------------------------------------------------------------------ */

.modal {
  width: min(560px, calc(100% - 32px)); padding: 0; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--bg-raised); color: var(--text); box-shadow: var(--shadow);
}
.modal::backdrop { background: rgb(0 0 0 / 0.55); }
.modal[open] { animation: rise 0.16s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 0 18px; }
.modal-head h2 { font-size: 16px; }
.modal-body { display: grid; gap: 10px; padding: 14px 18px 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }

/* ---- account page ------------------------------------------------------------- */

.account-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.account-title { display: flex; align-items: center; gap: 6px; min-width: 0; }
.account-title h1 { font-size: 26px; overflow-wrap: anywhere; }
.head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.facts { display: flex; flex-wrap: wrap; gap: 8px 36px; margin: 16px 0 24px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts div { display: grid; gap: 3px; min-width: 0; }
.facts dt { color: var(--text-3); font-size: 12px; }
.facts dd { margin: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.facts + .notice { margin-bottom: 20px; }

.guide { margin-bottom: 24px; padding: 16px 18px; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.guide h2 { margin-bottom: 10px; }
.guide ol { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 7px; }
.guide li { counter-increment: step; display: flex; gap: 10px; color: var(--text-2); }
.guide li::before { content: counter(step); flex: none; width: 20px; height: 20px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--text); font: 500 11px/1 var(--mono); margin-top: 1px; }
.guide b { color: var(--text); }

.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.split-main, .split-side { display: grid; gap: 20px; min-width: 0; }

.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raised); min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.panel-body { padding: 14px 16px 16px; }
.panel-body > p + p, .panel-body > p + form { margin-top: 10px; }

.uploader { display: grid; gap: 14px; padding: 16px; border-bottom: 1px solid var(--line); }
.drop {
  display: block; padding: 18px; border: 1px dashed var(--line-strong); border-radius: var(--radius);
  background: var(--bg-sunken); cursor: pointer; transition: border-color 0.12s, background-color 0.12s;
}
.drop:hover, .drop.is-over { border-color: var(--text-3); background: var(--bg-hover); }
.drop:focus-within { border-color: var(--text-2); box-shadow: 0 0 0 3px var(--focus); }
.drop-empty { display: grid; justify-items: center; gap: 6px; padding: 10px 0; text-align: center; color: var(--text-2); }
.drop-empty .icon { color: var(--text-3); }
.drop-empty b { color: var(--text); }
.drop-chosen { display: flex; gap: 16px; align-items: flex-start; }
.drop-chosen video { width: 72px; aspect-ratio: 9 / 16; object-fit: cover; flex: none; border-radius: 4px; background: #000; }
.drop-info { display: grid; gap: 4px; min-width: 0; }
.drop-name { font-weight: 500; overflow-wrap: anywhere; }
.drop-facts { color: var(--text-2); }
.drop-warnings { display: grid; gap: 2px; color: var(--warn); font-size: 12.5px; }
.uploader-foot { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.upload-error { color: var(--bad); font-size: 13px; }
.upload-error:empty { display: none; }
.progress { flex: 1; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.progress-bar { display: block; height: 100%; width: 0; background: var(--text); transition: width 0.2s; }

.posts { margin: 0; padding: 0; list-style: none; }
.posts li + li { border-top: 1px solid var(--line); }
.post-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; text-decoration: none; }
.post-row:hover { background: var(--bg-hover); }
.thumb { width: 36px; aspect-ratio: 9 / 16; flex: none; display: grid; place-items: center; overflow: hidden; border-radius: 4px; background: var(--bg-sunken); border: 1px solid var(--line); color: var(--text-3); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-main { display: grid; gap: 3px; min-width: 0; flex: 1; }
.post-caption { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.post-meta { color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-side { display: grid; justify-items: end; gap: 2px; flex: none; text-align: right; }

.log { margin: 0; padding: 6px 0; list-style: none; max-height: 340px; overflow: auto; }
.log li { display: grid; grid-template-columns: 84px 1fr; gap: 10px; padding: 5px 16px; font-size: 13px; }
.log time { color: var(--text-3); font: 12px/1.6 var(--mono); white-space: nowrap; }

.danger-zone { padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); }
.danger-zone summary { cursor: pointer; color: var(--text-2); font-size: 13px; }
.danger-zone summary:hover { color: var(--bad); }
.danger-zone[open] summary { color: var(--bad); margin-bottom: 12px; }

/* ---- post page ------------------------------------------------------------------ */

.post-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 32px; align-items: start; }
.post-media { position: sticky; top: 76px; display: grid; gap: 14px; }
.player { aspect-ratio: 9 / 16; border-radius: var(--radius); background: #000; overflow: hidden; border: 1px solid var(--line); }
.player video { width: 100%; height: 100%; object-fit: contain; }
.specs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 0; font-size: 12.5px; }
.specs div { display: grid; gap: 1px; }
.specs dt { color: var(--text-3); font-family: var(--sans); }
.specs dd { margin: 0; }
.warnings { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; color: var(--warn); font-size: 13px; }
.warnings li { display: flex; gap: 8px; align-items: flex-start; }
.warnings .icon { margin-top: 3px; }

.post-body { display: grid; gap: 18px; min-width: 0; }
.post-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.post-head h1 { font-size: 20px; }
.post-head h1 .status { gap: 10px; }
.post-head h1 .dot { width: 9px; height: 9px; }

.run { padding: 14px 16px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raised); }
.run-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; font-size: 13px; font-weight: 500; }
.run-now { margin-top: 12px; color: var(--text-2); font-size: 13px; }
.stepper { display: flex; margin: 0; padding: 0; list-style: none; }
.stepper li { flex: 1; display: grid; justify-items: start; gap: 7px; position: relative; min-width: 0; }
.stepper li:not(:last-child)::after {
  content: ""; position: absolute; top: 10px; left: 26px; right: 6px; height: 1px; background: var(--line-strong);
}
.stepper li[data-status="done"]:not(:last-child)::after { background: var(--text-3); }
.step-mark {
  position: relative; z-index: 1; width: 21px; height: 21px; display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: 50%; background: var(--bg-raised); color: var(--text-3); font-size: 10.5px;
}
.step-mark .icon { display: none; }
.step-label { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.stepper [data-status="done"] .step-mark { border-color: var(--text-2); color: var(--text); }
.stepper [data-status="done"] .step-mark .icon { display: block; }
.stepper [data-status="done"] .step-mark .mono { display: none; }
.stepper [data-status="done"] .step-label { color: var(--text-2); }
.stepper [data-status="active"] .step-mark { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.stepper [data-status="active"] .step-label { color: var(--text); font-weight: 500; }
.stepper [data-status="failed"] .step-mark { border-color: var(--bad); color: var(--bad); }
.stepper [data-status="failed"] .step-label { color: var(--bad); }
.stepper [data-status="unknown"] .step-mark { border-color: var(--warn); color: var(--warn); }
.stepper [data-status="unknown"] .step-label { color: var(--warn); }

.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions + .hint { margin-top: -10px; }
.shot { display: block; padding: 12px; }
.shot img { border-radius: var(--radius-sm); border: 1px solid var(--line); }
.meta-line { font-size: 12.5px; }

/* ---- browser ------------------------------------------------------------------- */

.browser-bar {
  position: sticky; top: 52px; z-index: 5; display: flex; align-items: center; gap: 14px;
  padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--bg);
}
.browser-title { display: flex; align-items: center; gap: 12px; min-width: 0; margin-right: auto; }
.paste { display: flex; gap: 6px; width: min(380px, 40vw); }
.paste .input { min-height: 28px; padding: 4px 9px; font-size: 13px; }
.screen { background: #000; overflow: hidden; }
.screen-full { height: calc(100vh - 52px - 53px); }
.screen-compact { height: 460px; border: 1px solid var(--line); border-radius: var(--radius); }

/* ---- login --------------------------------------------------------------------- */

.login-body {
  min-height: 100vh; display: grid;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: center;
}
.login { display: grid; place-items: center; padding: 24px; }
.login .notices { width: min(360px, 100%); }
.login-card {
  width: min(360px, 100%); display: grid; gap: 18px; padding: 24px;
  border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg-raised); box-shadow: var(--shadow);
}
.login-brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; letter-spacing: -0.015em; }
.login-brand .brand-mark { width: 24px; height: 24px; }


/* ---- avatars, deltas, tabs ------------------------------------------------------------ */

.avatar {
  display: inline-grid; place-items: center; flex: none; overflow: hidden; border-radius: 50%;
  background: var(--bg-hover); border: 1px solid var(--line-strong); color: var(--text-2); font-weight: 600;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 28px; height: 28px; font-size: 12px; }
.avatar-md { width: 36px; height: 36px; font-size: 14px; }
.avatar-lg { width: 52px; height: 52px; font-size: 20px; }
.avatar-xl { width: 72px; height: 72px; font-size: 26px; }
.account-cell { display: flex; align-items: center; gap: 10px; }
.account-head .account-title { gap: 14px; }
.account-name { display: grid; gap: 2px; min-width: 0; }
.account-name-row { display: flex; align-items: center; gap: 4px; }
.account-sub { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; color: var(--text-2); font-size: 13px; }
.account-sub > span:first-child:not(.mono) { margin-right: 6px; }

.metric { white-space: nowrap; }
.unit { margin-left: 0.22em; font-family: var(--sans); font-size: 0.72em; font-weight: 400; letter-spacing: 0; opacity: 0.72; }
.delta { font-family: var(--mono); font-size: 0.92em; font-variant-numeric: tabular-nums; color: var(--text-2); white-space: nowrap; }
.delta.is-up { color: var(--ok); }
.delta.is-down { color: var(--bad); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: -4px; }
.tabs a {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 12px; margin-bottom: -1px;
  color: var(--text-2); font-weight: 500; text-decoration: none; border-bottom: 2px solid transparent;
}
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--text); }

.list-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 8px; border-top: 1px solid var(--line); }
.list-head h2 { font-size: 13px; color: var(--text-2); font-weight: 500; }
.list-head + .posts li:first-child { border-top: 1px solid var(--line); }
.list-empty { padding: 28px 16px; color: var(--text-3); text-align: center; }
.more summary { padding: 11px 16px; border-top: 1px solid var(--line); color: var(--text-2); cursor: pointer; font-size: 13px; }
.more summary:hover { color: var(--text); background: var(--bg-hover); }
.more[open] summary { border-bottom: 1px solid var(--line); }
.tag-ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); margin-left: 6px; }

/* ---- statistics ----------------------------------------------------------------- */

.stats-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 28px; }
.stats-bar p { font-size: 13px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raised); overflow: hidden; }
.kpi { display: grid; gap: 5px; padding: 14px 16px; border-left: 1px solid var(--line); min-width: 0; }
.kpi:first-child { border-left: 0; }
.kpi-label { color: var(--text-2); font-size: 12.5px; }
.kpi-value { font: 500 26px/1.1 var(--mono); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 4px; align-items: baseline; }
.empty-inline { margin: 24px auto; }

.segmented { display: inline-flex; padding: 2px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--bg-sunken); }
.segmented a { padding: 3px 9px; border-radius: 4px; color: var(--text-2); font-size: 12.5px; text-decoration: none; }
.segmented a:hover { color: var(--text); }
.segmented a[aria-current="true"] { background: var(--bg-hover); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }

.chart { margin: 0; padding-left: 52px; }
.chart-plot { position: relative; height: 200px; }
.chart-grid { position: absolute; inset: 0; pointer-events: none; }
.chart-gridline { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.chart-ylabel { position: absolute; right: calc(100% + 10px); top: 0; transform: translateY(-50%); color: var(--text-3); font-size: 11px; white-space: nowrap; }
.chart svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.chart-area { fill: color-mix(in srgb, var(--text) 7%, transparent); }
.chart-stroke { fill: none; stroke: var(--text); stroke-width: 2px; stroke-linejoin: round; stroke-linecap: round; }
.chart-cursor { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px solid var(--text-3); pointer-events: none; }
.chart-marker {
  position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%;
  background: var(--text); box-shadow: 0 0 0 2px var(--bg-raised); pointer-events: none;
}
.chart-tip {
  position: absolute; z-index: 2; padding: 7px 9px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--bg); box-shadow: var(--shadow); font-size: 12px; line-height: 1.4; pointer-events: none; white-space: nowrap;
  max-width: 260px;
}
.chart-tip strong { display: block; font: 500 14px var(--mono); }
.chart-tip span { color: var(--text-2); display: block; overflow: hidden; text-overflow: ellipsis; }
.chart-xaxis { position: relative; height: 22px; margin-top: 6px; }
.chart-xaxis time { position: absolute; top: 0; transform: translateX(-50%); color: var(--text-3); font-size: 11px; white-space: nowrap; }
.chart-xaxis time:first-child { transform: none; }
.chart-xaxis time:last-child { transform: translateX(-100%); }
.chart-plot[data-chart-line] { cursor: crosshair; }
.bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
.bar { flex: 1; height: 100%; display: flex; align-items: flex-end; min-width: 0; }
.bar span { width: 100%; height: var(--h); min-height: 2px; border-radius: 4px 4px 0 0; background: var(--text-3); transition: background-color 0.12s; }
.bar:hover span, .bar:focus-visible span { background: var(--text); }

.table-scroll { overflow-x: auto; }
.table .num { text-align: right; white-space: nowrap; }
.table-videos td { vertical-align: middle; }
.video-cell { display: flex; align-items: center; gap: 12px; min-width: 240px; text-decoration: none; }
.video-cell:hover .post-caption { text-decoration: underline; }
.video-text { display: grid; gap: 2px; min-width: 0; }
.col-audience { white-space: nowrap; }

/* ---- profile ---------------------------------------------------------------------- */

.profile-now { display: flex; gap: 18px; align-items: flex-start; padding: 18px; }
.profile-now-text { display: grid; gap: 4px; min-width: 0; }
.profile-now-text strong { font-size: 17px; }
.profile-bio { white-space: pre-line; color: var(--text-2); overflow-wrap: anywhere; }
.avatar-pick { display: flex; align-items: center; gap: 16px; }
.avatar-pick-text { display: grid; gap: 6px; justify-items: start; }
.avatar-pick .btn { position: relative; }
.form-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.edits { margin: 0; padding: 0; list-style: none; }
.edits li { display: grid; gap: 8px; padding: 14px 16px; }
.edits li + li { border-top: 1px solid var(--line); }
.edit-main { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.edit-fields { display: grid; gap: 4px; margin: 0; font-size: 13px; }
.edit-fields div { display: grid; grid-template-columns: 84px 1fr; gap: 10px; }
.edit-fields dt { color: var(--text-3); }
.edit-fields dd { margin: 0; overflow-wrap: anywhere; }

/* ---- schedule & queue -------------------------------------------------------------- */

.schedule { padding: 14px 16px; display: grid; gap: 10px; }
.schedule-form { display: grid; gap: 12px; }
.schedule-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.schedule-fields { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.schedule-status { display: flex; gap: 6px; flex-wrap: wrap; align-items: baseline; font-size: 13px; }
.schedule-hint { margin-top: -4px; }
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13px; color: var(--text-2); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; width: 30px; height: 18px; border-radius: 9px; background: var(--line-strong); transition: background-color 0.15s; }
.switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--text); transition: transform 0.15s; }
.switch input:checked + .switch-track { background: var(--ok); }
.switch input:checked + .switch-track::after { transform: translateX(12px); background: #fff; }
.switch input:checked ~ span:last-child { color: var(--text); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--text-2); outline-offset: 2px; }
.post-item { display: flex; align-items: center; }
.post-item .post-row { flex: 1; min-width: 0; }
.queue-controls { display: flex; align-items: center; gap: 0; padding-left: 10px; }
.queue-place { width: 20px; text-align: center; color: var(--text-3); font-size: 12px; }
.icon-btn-sm { width: 24px; height: 24px; }
.icon-btn[disabled] { opacity: 0.3; pointer-events: none; }

/* ---- post title ------------------------------------------------------------------- */

.post-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.post-title-text { display: grid; gap: 8px; min-width: 0; }
.post-title h1 { font-size: 20px; line-height: 1.35; overflow-wrap: anywhere; }

/* ---- small screens ------------------------------------------------------------------ */

@media (max-width: 1000px) {
  .split { grid-template-columns: 1fr; }
  .post-grid { grid-template-columns: 1fr; }
  .post-media { position: static; grid-template-columns: 200px 1fr; align-items: start; }
  .post-media .warnings { grid-column: 1 / -1; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat:nth-child(4) { border-left: 0; }
  .stat:nth-child(n + 4) { border-top: 1px solid var(--line); }
  .col-tz, .col-audience { display: none; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi:nth-child(3) { border-left: 0; }
  .kpi:nth-child(n + 3) { border-top: 1px solid var(--line); }
}
@media (max-width: 680px) {
  .topbar-inner { padding: 0 16px; gap: 16px; }
  .slots-label, .slots-dots { display: none; }
  .page { padding: 20px 16px 72px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(n) { border-left: 0; border-top: 1px solid var(--line); }
  .stat:nth-child(even) { border-left: 1px solid var(--line); }
  .stat:nth-child(-n + 2) { border-top: 0; }
  .col-posts, .col-activity { display: none; }
  .table td, .table th { padding-left: 12px; padding-right: 12px; }
  .post-media { grid-template-columns: 132px 1fr; }
  .post-media .specs { grid-template-columns: 1fr; gap: 6px; }
  .field-row { grid-template-columns: 1fr; }
  .schedule-fields { grid-template-columns: 1fr 1fr; }
  .schedule-fields .btn { grid-column: 1 / -1; justify-self: start; }
  .stepper { flex-direction: column; gap: 10px; }
  .stepper li { grid-auto-flow: column; justify-content: start; align-items: center; }
  .stepper li:not(:last-child)::after { display: none; }
  .browser-bar { flex-wrap: wrap; }
  .paste { width: 100%; order: 3; }
  .post-side .sub { display: none; }
  .table[data-accounts] thead { display: none; }
  .table[data-accounts], .table[data-accounts] tbody, .table[data-accounts] tr { display: block; }
  .table[data-accounts] tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px; border-bottom: 1px solid var(--line); }
  .table[data-accounts] tbody tr:last-child { border-bottom: 0; }
  .table[data-accounts] td { display: block; padding: 0; border: 0; }
  .table[data-accounts] td:nth-child(2) { text-align: right; }
  .table[data-accounts] td:nth-child(2) .sub { display: none; }
  .table[data-accounts] td:nth-child(3) { grid-column: 1 / -1; padding-left: 38px; font-size: 13px; }
  .table[data-accounts] tr:hover td { background: none; }
  .table[data-accounts] tr:hover { background: var(--bg-hover); }
  .col-wide { display: none; }
  .chart { padding-left: 40px; }
  .post-title { flex-direction: column; }
  .profile-now { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
