@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "PT Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/pt-serif-cyrillic-400-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "PT Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/pt-serif-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "PT Serif";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/pt-serif-cyrillic-700-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "PT Serif";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/pt-serif-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
.nav-mark {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: none;
}
.nav-mark::before, .nav-mark::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
}

.mark-overview::before, .mark-overview::after {
  top: 2px;
  width: 7px;
  height: 14px;
  border: 1.5px solid;
  border-radius: 2px;
  background: linear-gradient(currentColor, currentColor) center 4px/100% 1.5px no-repeat;
}
.mark-overview::before {
  left: 1px;
}
.mark-overview::after {
  right: 1px;
  background-position-y: 7px;
}

.mark-generate::before, .mark-generate::after {
  background: currentColor;
  clip-path: polygon(50% 0, 64% 36%, 100% 50%, 64% 64%, 50% 100%, 36% 64%, 0 50%, 36% 36%);
}
.mark-generate::before {
  inset: 1px 3px 2px 0;
}
.mark-generate::after {
  width: 6px;
  height: 6px;
  right: 0;
  top: 0;
}

.mark-videos::before {
  inset: 3px 0;
  border: 1.5px solid;
  border-radius: 3px;
}
.mark-videos::after {
  top: 6px;
  left: 7px;
  border-left: 5px solid;
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
}

.mark-channels::before {
  inset: 1px 5px auto;
  height: 8px;
  border: 1.5px solid;
  border-radius: 50%;
}
.mark-channels::after {
  inset: 10px 1px 1px;
  border: 1.5px solid;
  border-radius: 8px 8px 2px 2px;
}

.mark-consumables::before {
  inset: 1px 3px;
  border: 1.5px solid;
  border-radius: 2px;
}
.mark-consumables::after {
  inset: 6px 6px auto;
  height: 1.5px;
  background: currentColor;
  box-shadow: 0 4px currentColor;
}

.mark-settings {
  background: linear-gradient(currentColor, currentColor) center 5px/16px 1.5px no-repeat, linear-gradient(currentColor, currentColor) center 12px/16px 1.5px no-repeat;
}
.mark-settings::before, .mark-settings::after {
  width: 6px;
  height: 6px;
  border: 1.5px solid;
  border-radius: 50%;
  background: var(--surface);
}
.mark-settings::before {
  top: 3px;
  left: 4px;
}
.mark-settings::after {
  top: 10px;
  right: 4px;
}

:root {
  color-scheme: light;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'PT Serif', Georgia, 'Times New Roman', serif;
  --sans: var(--font-ui);
  --serif: var(--font-display);
  --canvas: #e5e3df;
  --page: #fff;
  --surface: #fff;
  --sidebar: #f7f6f3;
  --surface-2: #f5f4f1;
  --selection: #eae8e3;
  --ink: #22221f;
  --ink-2: #51524e;
  --muted: #696b65;
  --hairline: #e7e6e1;
  --axis: #b3b5ad;
  --border: #deded7;
  --control-border: #cfcec7;
  --accent: #2849db;
  --accent-ink: #fff;
  --accent-hover: #203ab6;
  --accent-soft: #eef1ff;
  --good: #239464;
  --good-text: #24734c;
  --warning: #c88a1e;
  --serious: #91570f;
  --critical: #c94543;
  --critical-text: #ab3638;
  --series-1: #3050e2;
  --series-2: #d15c35;
  --series-3: #168568;
  --series-4: #a87a17;
  --series-5: #af5691;
  --series-6: #568338;
  --series-7: #7951b6;
  --series-8: #ca485f;
  --shadow: 0 2px 5px rgb(35 32 23 / 5%), 0 16px 36px rgb(35 32 23 / 9%);
  --radius: 12px;
  --frame-inset: clamp(12px, 1.65vw, 30px);
  --content-inset: clamp(20px, 2.2vw, 40px);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --canvas: #151614;
    --page: #20211f;
    --surface: #242522;
    --sidebar: #1c1d1b;
    --surface-2: #2b2c29;
    --selection: #343530;
    --ink: #f3f2eb;
    --ink-2: #c9c9c0;
    --muted: #aeafa4;
    --hairline: #393a35;
    --axis: #575a51;
    --border: #40423c;
    --control-border: #595b53;
    --accent: #9caaff;
    --accent-ink: #141a38;
    --accent-hover: #b6bfff;
    --accent-soft: #30354c;
    --good: #61c793;
    --good-text: #8dd6ac;
    --warning: #e5b050;
    --serious: #e9bb7a;
    --critical: #ee7974;
    --critical-text: #ff9f9b;
    --series-1: #91a4ff;
    --series-2: #ff9b7a;
    --series-3: #5dd4aa;
    --series-4: #eac86d;
    --series-5: #eb9cd0;
    --series-6: #a0c47c;
    --series-7: #b99bef;
    --series-8: #f48d9f;
    --shadow: 0 3px 8px rgb(0 0 0 / 15%), 0 16px 36px rgb(0 0 0 / 20%);
  }
}
* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 400 14px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p {
  margin: 0;
}

h1 {
  font: 400 clamp(29px, 2.5vw, 40px)/1.14 var(--font-display);
  letter-spacing: -0.043em;
  overflow-wrap: anywhere;
}

h2, h3 {
  font-size: 16px;
  font-weight: 630;
  line-height: 1.35;
  letter-spacing: -0.025em;
}

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 0.2em;
}
a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

::selection {
  background: var(--accent-soft);
  color: var(--ink);
}

.muted {
  color: var(--muted);
}

.secondary {
  color: var(--ink-2);
}

.small {
  font-size: 13px;
}

.nowrap {
  white-space: nowrap;
}

.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.grow {
  flex: 1 1 auto;
  min-width: 0;
}

.hidden {
  display: none !important;
}

.error {
  color: var(--critical-text);
}

/* Shell and navigation */
.shell {
  display: grid;
  grid-template-columns: clamp(190px, 15.1vw, 248px) minmax(0, 1fr);
  max-width: 1740px;
  min-height: calc(100vh - var(--frame-inset) * 2);
  min-height: calc(100svh - var(--frame-inset) * 2);
  margin: var(--frame-inset) max(var(--frame-inset), (100% - 1740px) / 2);
  padding: 9px 9px 9px 0;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--sidebar);
}

.side {
  position: sticky;
  top: 10px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
  height: calc(100vh - var(--frame-inset) * 2 - 20px);
  height: calc(100svh - var(--frame-inset) * 2 - 20px);
  overflow-y: auto;
  padding: 13px 12px 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 3px 8px;
  color: var(--ink);
  font: 700 20px/1.2 var(--font-display);
  letter-spacing: -0.045em;
}
.brand:hover {
  text-decoration: none;
}
.brand img {
  display: block;
  width: 28px;
  height: 28px;
  flex: none;
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-group-label {
  margin: 19px 10px 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 610;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.nav-group-label:first-child {
  margin-top: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 7px 10px;
  border-radius: 7px;
  color: var(--ink-2);
  font-weight: 470;
}
.nav-item:hover {
  background: var(--surface-2);
  color: var(--ink);
  text-decoration: none;
}
.nav-item.active, .nav-item[aria-current=page] {
  color: var(--ink);
  background: var(--selection);
  font-weight: 570;
}
.nav-item .nav-mark {
  flex: none;
  color: var(--muted);
}
.nav-item.active .nav-mark, .nav-item[aria-current=page] .nav-mark {
  color: var(--ink);
}

.nav-count {
  margin-left: auto;
  min-width: 19px;
  padding: 1px 5px;
  border-radius: 5px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 640;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.side-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 9px;
}
.side-foot .who {
  overflow-wrap: anywhere;
}

.workspace {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--page);
}

.topbar {
  min-height: 60px;
  padding: 10px var(--content-inset);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--hairline);
}

.topbar-path {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  min-width: 0;
  gap: 8px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.topbar-section, .topbar-separator {
  color: var(--muted);
}

.topbar-title {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-weight: 560;
}

.topbar-action {
  flex: none;
}

.main {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
  width: 100%;
  padding: var(--content-inset) var(--content-inset) clamp(36px, 5vw, 72px);
}
.main > * {
  min-width: 0;
}

.page-head, .section-head, .row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.page-head, .section-head {
  justify-content: space-between;
}

.page-head {
  gap: 14px;
}
.page-head > div {
  min-width: 0;
}
.page-head p {
  margin-top: 6px;
  line-height: 1.5;
}

.section-head > a {
  font-size: 13px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

@media (max-width: 850px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    min-height: 100vh;
    min-height: 100svh;
    grid-template-rows: auto 1fr;
  }
  .side {
    position: static;
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    grid-template-areas: "brand account" "nav nav";
    align-items: center;
    height: auto;
    gap: 6px 12px;
    padding: 9px 16px 7px;
    overflow: visible;
    border-bottom: 1px solid var(--border);
  }
  .side > .brand {
    grid-area: brand;
    width: max-content;
    max-width: 100%;
    padding: 3px 2px;
  }
  .nav-links {
    grid-area: nav;
    flex-direction: row;
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--axis) transparent;
    padding: 3px 2px;
    gap: 2px;
  }
  .nav-item {
    flex: none;
    min-height: 36px;
    padding: 6px 10px;
  }
  .nav-group-label {
    display: none;
  }
  .side-foot {
    grid-area: account;
    min-width: 0;
    justify-content: flex-end;
    flex-wrap: nowrap;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }
  .side-foot .who {
    min-width: 0;
    max-width: 16ch;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .side-foot button {
    flex: none;
  }
  .workspace {
    border: 0;
    border-radius: 0;
  }
  .topbar {
    min-height: 50px;
  }
}
@media (max-width: 600px) {
  :root {
    --content-inset: 15px;
  }
  .side {
    padding-inline: 13px;
  }
  .main {
    gap: 20px;
  }
  .topbar {
    gap: 10px;
  }
  .nav-item {
    gap: 7px;
  }
  .topbar-path {
    font-size: 12px;
    gap: 5px;
  }
}
/* Controls */
button, input, select, textarea {
  font: inherit;
  color: inherit;
}

input[type=checkbox] {
  accent-color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  max-width: 100%;
  padding: 7px 13px;
  border: 1px solid var(--control-border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 540;
  line-height: 1.35;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.btn:hover:not(:disabled) {
  background: var(--surface-2);
  text-decoration: none;
}
.btn:disabled {
  opacity: 0.48;
  cursor: default;
}
.btn.primary {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-ink);
}
.btn.primary:hover:not(:disabled) {
  background: var(--accent-hover);
}
.btn.danger {
  color: var(--critical-text);
}
.btn.small {
  padding: 4px 10px;
  min-height: 31px;
  font-size: 12px;
}
.btn.ghost {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.field > span {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
}

.input {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--control-border);
  border-radius: 7px;
  background: var(--surface);
  line-height: 1.4;
}
.input::placeholder {
  color: var(--muted);
  opacity: 1;
}
.input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  outline-offset: 1px;
}
.input:disabled {
  background: var(--surface-2);
  color: var(--muted);
}

textarea.input {
  resize: vertical;
  min-height: 84px;
}

.seg {
  display: inline-flex;
  max-width: 100%;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  border-radius: 8px;
  background: var(--surface-2);
}
.seg button {
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-2);
  font-weight: 500;
  font-size: 12px;
  cursor: pointer;
}
.seg button[aria-pressed=true] {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--hairline);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Surfaces */
.card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(16px, 1.55vw, 24px);
}
.card.flush {
  padding: 0;
  overflow: hidden;
}
.card.table-wrap {
  overflow-x: auto;
}

.notice {
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.notice.warn {
  border-inline-start: 3px solid var(--warning);
}
.notice.bad {
  border-inline-start: 3px solid var(--critical);
}
.notice.ok {
  border-inline-start: 3px solid var(--good);
}

.empty {
  padding: 27px 16px;
  text-align: center;
  color: var(--muted);
}

/* Figures */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 172px), 1fr));
  gap: 12px;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tile .label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
}
.tile .value {
  color: var(--ink);
  font: 400 clamp(27px, 2.8vw, 41px)/1.15 var(--font-display);
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: -0.05em;
  overflow-wrap: anywhere;
}
.tile .value small {
  margin-inline-start: 0.15em;
  font: 500 13px/1.4 var(--font-ui);
  color: var(--muted);
  letter-spacing: normal;
}
.tile .sub {
  min-height: 18px;
  font-size: 12px;
  color: var(--ink-2);
}

.delta {
  white-space: nowrap;
}

.delta.up {
  color: var(--good-text);
}

.delta.down {
  color: var(--critical-text);
}

.meter {
  --fill: var(--accent);
  height: 6px;
  margin: 6px 0 2px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--fill) 17%, var(--surface));
  overflow: hidden;
}
.meter > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--fill);
}
.meter.warn {
  --fill: var(--warning);
}
.meter.bad {
  --fill: var(--critical);
}

/* Tables */
.table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--hairline);
  vertical-align: middle;
}

th {
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 570;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  white-space: nowrap;
}

tr:last-child > td {
  border-bottom: 0;
}

th.num, td.num {
  text-align: right;
}

th button {
  all: unset;
  cursor: pointer;
}
th button:hover {
  color: var(--ink);
}
th button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

td .sub {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.cell-title {
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The label names the state; the indicator adds a visual cue. */
.status, .proxy-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 2px 7px;
  border: 1px solid var(--hairline);
  border-radius: 5px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 540;
  white-space: nowrap;
}
.status::before, .proxy-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.status.running, .status.compressing {
  color: var(--accent);
}
.status.done {
  color: var(--good-text);
}
.status.failed {
  color: var(--critical-text);
}
.status.queued {
  color: var(--serious);
}

/* --- generation --- */
.job-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.job-row {
  display: grid;
  grid-template-columns: minmax(140px, 2.2fr) minmax(100px, 1fr) minmax(100px, 1fr) minmax(125px, 1.6fr) auto;
  gap: 10px;
  align-items: end;
}

@media (max-width: 980px) {
  .job-row {
    grid-template-columns: 1fr 1fr;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--hairline);
  }
  .job-row .field.topic {
    grid-column: 1/-1;
  }
}
.job {
  border-bottom: 1px solid var(--hairline);
}

.job:last-child {
  border-bottom: 0;
}

.job-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  flex-wrap: wrap;
}

.job-head .topic {
  font-weight: 550;
  overflow-wrap: anywhere;
}

.job-error {
  margin: 0 18px 12px;
}

.log {
  margin: 0 18px 14px;
  padding: 10px 12px;
  max-height: 320px;
  overflow: auto;
  border-radius: 8px;
  background: var(--surface-2);
  font: 12.5px/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace;
}

.log div {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.log .t {
  color: var(--muted);
  margin-right: 8px;
}

.log .k-tool {
  color: var(--ink-2);
}

.log .k-panel,
.log .k-result {
  font-weight: 600;
}

.log .k-err {
  color: var(--critical-text);
}

/* --- videos --- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
}

.video-card {
  all: unset;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  border-radius: var(--radius);
}

.video-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.poster {
  position: relative;
  aspect-ratio: 9/16;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.poster .badge {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.66);
  color: #fff;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.poster .badge.left {
  left: 6px;
  right: auto;
}

.video-card:hover .poster {
  box-shadow: var(--shadow);
}

.video-card .title {
  font-weight: 550;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

dialog {
  width: min(920px, 100vw - 24px);
  max-height: calc(100vh - 24px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.profile-dialog {
  width: min(540px, 100vw - 24px);
  padding: 20px;
}

.phone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 12px;
}

.phone-card h3,
.phone-card p {
  margin: 0;
}

.phone-address {
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.phone-proxy {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.proxy-status.ok {
  color: var(--good-text);
}

.proxy-status.down {
  color: var(--critical-text);
}

.proxy-status.error,
.proxy-status.not_configured {
  color: var(--serious);
}

.expenses-layout {
  display: grid;
  align-items: start;
  gap: 20px;
}
@media (min-width: 1280px) {
  .expenses-layout {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 28%);
  }
}

.expense-ledger {
  min-width: 0;
}

.expense-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 18px;
}
.expense-summary > :first-child {
  flex-basis: 100%;
}

.expense-amount {
  font: 400 clamp(34px, 3vw, 46px)/1.15 var(--font-display);
  letter-spacing: -0.035em;
}

.consumables-fields {
  display: grid;
  gap: 12px;
}

.consumables-table {
  min-width: 600px;
}

.consumable-name,
.consumable-note {
  overflow-wrap: anywhere;
  max-width: 420px;
}

.consumable-note {
  white-space: pre-wrap;
}

@media (max-width: 600px) {
  .consumables-table {
    min-width: 0;
  }
  .consumables-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .consumables-table tbody {
    display: block;
  }
  .consumables-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "name price" "note note" "actions actions";
    align-items: baseline;
    gap: 6px 12px;
    padding: 14px;
  }
  .consumables-table tr + tr {
    border-top: 1px solid var(--hairline);
  }
  .consumables-table td {
    padding: 0;
    border: 0;
  }
  .consumables-table .consumable-name {
    grid-area: name;
    font-weight: 570;
  }
  .consumables-table .consumable-note {
    grid-area: note;
    font-size: 13px;
  }
  .consumables-table .num {
    grid-area: price;
  }
  .consumables-table td:last-child {
    grid-area: actions;
    margin-top: 3px;
  }
}
@media (min-width: 721px) and (max-width: 1279px) {
  .consumables-fields {
    grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
  }
}
.player {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 20px;
  padding: 20px;
}

.player video {
  width: 100%;
  aspect-ratio: 9/16;
  border-radius: 10px;
  background: #000;
}

@media (max-width: 720px) {
  .player {
    grid-template-columns: 1fr;
  }
  .player video {
    max-height: 60vh;
  }
}
.kv {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  gap: 4px 14px;
  font-size: 13.5px;
}

.kv dt {
  color: var(--ink-2);
}

.kv dd {
  margin: 0;
  overflow-wrap: anywhere;
}

details > summary {
  cursor: pointer;
  color: var(--ink-2);
}

.script-lines {
  margin: 8px 0 0;
  padding-left: 20px;
  color: var(--ink-2);
}

.progress {
  height: 4px;
  border-radius: 2px;
  background: var(--surface-2);
  overflow: hidden;
}

.progress > i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
}

/* --- channels --- */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--ink-2);
  font-weight: 650;
  overflow: hidden;
  position: relative;
}

.avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.channel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.channel-nums {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.channel-nums .value {
  font: 400 25px/1.2 var(--font-display);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.035em;
}

.swatch {
  display: inline-block;
  width: 14px;
  height: 0;
  border-top: 2px solid var(--muted);
  border-radius: 1px;
  vertical-align: middle;
  margin-right: 8px;
}

/* --- charts --- */
.chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.chart-head p {
  font-size: 13px;
  color: var(--ink-2);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 13px;
  color: var(--ink-2);
}

.legend span {
  display: inline-flex;
  align-items: center;
}

.plot {
  position: relative;
}

.plot svg {
  display: block;
  width: 100%;
  overflow: visible;
  outline-offset: 4px;
}

.plot .grid-line {
  stroke: var(--hairline);
  stroke-width: 1;
}

.plot .axis-line {
  stroke: var(--axis);
  stroke-width: 1;
}

.plot .tick {
  fill: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.plot .end-label {
  fill: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
}

.plot .line {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.plot .area {
  stroke: none;
  opacity: 0.1;
}

.plot .dot {
  stroke: var(--surface);
  stroke-width: 2;
}

.plot .crosshair {
  stroke: var(--axis);
  stroke-width: 1;
}

.s1 {
  stroke: var(--series-1);
  border-color: var(--series-1);
}

.f1 {
  fill: var(--series-1);
}

.s2 {
  stroke: var(--series-2);
  border-color: var(--series-2);
}

.f2 {
  fill: var(--series-2);
}

.s3 {
  stroke: var(--series-3);
  border-color: var(--series-3);
}

.f3 {
  fill: var(--series-3);
}

.s4 {
  stroke: var(--series-4);
  border-color: var(--series-4);
}

.f4 {
  fill: var(--series-4);
}

.s5 {
  stroke: var(--series-5);
  border-color: var(--series-5);
}

.f5 {
  fill: var(--series-5);
}

.s6 {
  stroke: var(--series-6);
  border-color: var(--series-6);
}

.f6 {
  fill: var(--series-6);
}

.s7 {
  stroke: var(--series-7);
  border-color: var(--series-7);
}

.f7 {
  fill: var(--series-7);
}

.s8 {
  stroke: var(--series-8);
  border-color: var(--series-8);
}

.f8 {
  fill: var(--series-8);
}

.tooltip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  min-width: 150px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 13px;
}

.tooltip .when {
  color: var(--ink-2);
  margin-bottom: 4px;
}

.tooltip .line-row {
  display: flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
}

.tooltip b {
  font-weight: 650;
  margin-right: 8px;
  font-variant-numeric: tabular-nums;
}

.tooltip .name {
  color: var(--ink-2);
}

.data-table {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--hairline);
  border-radius: 8px;
}

.data-table th {
  position: sticky;
  top: 0;
  background: var(--surface);
}

.data-table th,
.data-table td {
  padding: 6px 12px;
  font-size: 13px;
}

.bar-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.bar-cell i {
  display: block;
  height: 8px;
  min-width: 2px;
  border-radius: 0 4px 4px 0;
  background: var(--series-1);
}

.bar-track {
  flex: 0 0 90px;
  display: flex;
}

/* --- login --- */
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}

.login .card {
  width: min(400px, 100%);
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.login .token {
  font: 18px/1.3 ui-monospace, "Cascadia Mono", Consolas, monospace;
  letter-spacing: 0.04em;
  text-align: center;
  padding: 10px;
}

.token-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--surface-2);
  font: 17px/1.3 ui-monospace, "Cascadia Mono", Consolas, monospace;
  letter-spacing: 0.04em;
}

@media (prefers-reduced-motion: no-preference) {
  .nav-item, .btn, .seg button {
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
  }
}
/* --- toasts --- */
.toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(420px, 100vw - 32px);
}

.toast {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--good);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.toast.bad {
  border-left-color: var(--critical);
}

@media (max-width: 600px) {
  .job-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .job-row .field.topic {
    grid-column: auto;
  }
  .job-row > .btn {
    justify-self: start;
  }
  .input {
    font-size: 16px;
  }
  .kv {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
  .kv dd + dt {
    margin-top: 8px;
  }
  .btn.small {
    min-height: 34px;
  }
}
.main.overview-page {
  max-width: none;
  padding: 0;
}

.overview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(240px, 23%, 320px);
  min-width: 0;
  min-height: 100%;
}

.overview-content {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 24px;
  padding: clamp(20px, 2.25vw, 38px);
}
.overview-content > .stack {
  min-width: 0;
}
.overview-content > .stack > .empty {
  padding: 18px;
  text-align: left;
}
.overview-content .table-wrap {
  overflow-x: auto;
}

.overview-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.overview-kpi {
  padding: 0;
  overflow: hidden;
}
.overview-kpi h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--hairline);
  font: 600 0.96rem/1.35 var(--font-ui);
}
.overview-kpi .kpi-body {
  padding: 15px 18px 19px;
}
.overview-kpi .kpi-value {
  margin-bottom: 8px;
  font: 400 clamp(2.45rem, 3.2vw, 3.6rem)/1.05 var(--font-display);
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: -0.045em;
}
.overview-kpi .kpi-value small {
  color: var(--ink-2);
  font: 450 0.95rem/1.3 var(--font-ui);
  letter-spacing: 0;
}

.kpi-icon {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  flex: none;
  border-radius: 5px;
}
.kpi-icon::before {
  content: "";
  display: block;
}

.kpi-videos .kpi-icon {
  background: color-mix(in srgb, var(--good-text) 13%, var(--surface));
  color: var(--good-text);
}
.kpi-videos .kpi-icon::before {
  border: solid transparent;
  border-width: 4px 0 4px 6px;
  border-left-color: currentColor;
  margin-left: 1px;
}

.kpi-jobs .kpi-icon {
  background: var(--accent-soft);
  color: var(--accent);
}
.kpi-jobs .kpi-icon::before {
  width: 8px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 -3px currentColor, 0 3px currentColor;
}

.activity-card .section-head {
  align-items: flex-start;
}
.activity-card .section-head p {
  margin-top: 3px;
}
.activity-card .section-head .row {
  gap: 6px;
}
.activity-card .section-head select {
  width: auto;
  padding-block: 5px;
  font-size: 0.8rem;
}
.activity-card button[aria-pressed=true] {
  color: var(--accent);
  background: var(--accent-soft);
}
.activity-card .activity-body {
  margin-top: 18px;
}
.activity-card .data-table {
  max-height: 212px;
}

.activity-plot {
  display: grid;
  grid-template: minmax(132px, 10vw) auto/auto minmax(0, 1fr);
  gap: 7px 10px;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}

.activity-scale, .activity-dates {
  display: flex;
  justify-content: space-between;
}

.activity-scale {
  flex-direction: column;
  align-items: flex-end;
}

.activity-dates {
  grid-column: 2;
}

.overview-start {
  padding: 0;
  overflow: hidden;
}
.overview-start h2 {
  padding: 15px 18px;
}
.overview-start .table-wrap {
  padding-inline: 8px;
}
.overview-start td, .overview-start th {
  padding: 10px;
}
.overview-start tbody th {
  font-weight: 550;
  color: var(--ink);
}
.overview-start tr:last-child th[scope=row] {
  border-bottom: 0;
}

.activity-bars {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: clamp(2px, 0.28vw, 5px);
}

.activity-column {
  display: flex;
  align-items: end;
  justify-self: center;
  width: min(100%, 22px);
  background: var(--surface-2);
  mask-image: linear-gradient(to top, #000 calc(100% - 3px), transparent 0);
  mask-size: 100% 10%;
  border-radius: 2px;
}
.activity-column i {
  display: block;
  width: 100%;
  background: var(--accent);
}

.overview-rail {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  gap: 22px;
  min-width: 0;
  border-inline-start: 1px solid var(--hairline);
  padding: clamp(20px, 2.25vw, 38px) clamp(17px, 1.7vw, 28px);
}
.overview-rail .overview-rail-title {
  font: 500 1.55rem/1.2 var(--font-display);
  letter-spacing: -0.035em;
}
.overview-rail .rail-section {
  display: grid;
  align-content: start;
  gap: 10px;
}
.overview-rail .rail-section + .rail-section {
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
}
.overview-rail .rail-section h3 {
  font: 600 0.94rem/1.4 var(--font-ui);
}
.overview-rail .rail-link {
  justify-self: start;
  font-size: 0.82rem;
}
.overview-rail .disk-free {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}
.overview-rail .disk-free strong {
  font: 400 clamp(1.75rem, 2.2vw, 2.25rem)/1.1 var(--font-display);
  letter-spacing: -0.04em;
}
.overview-rail .disk-meter {
  appearance: none;
  width: 100%;
  height: 6px;
  overflow: hidden;
  border: 0;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--accent);
}
.overview-rail .disk-meter.critical {
  color: var(--critical);
}
.overview-rail .disk-meter::-webkit-progress-bar {
  background: var(--surface-2);
}
.overview-rail .disk-meter::-webkit-progress-value {
  background: currentColor;
  border-radius: 5px;
}
.overview-rail .disk-meter::-moz-progress-bar {
  background: currentColor;
  border-radius: 5px;
}

.resource-list {
  display: grid;
  gap: 9px;
  margin: 0;
}
.resource-list .resource-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2px 6px;
  font-size: 0.82rem;
}
.resource-list dt {
  color: var(--ink-2);
}
.resource-list dd {
  margin: 0;
}
.resource-list.compression {
  padding-top: 3px;
}
.resource-list .resource-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.resource-list .resource-state::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--serious);
}
.resource-list .resource-state.configured::before {
  background: var(--good);
}

@media (max-width: 1120px) {
  .overview-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .overview-rail {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 175px), 1fr));
    align-items: start;
    border-inline-start: 0;
    border-top: 1px solid var(--hairline);
  }
  .overview-rail .overview-rail-title {
    grid-column: 1/-1;
  }
  .overview-rail .rail-section + .rail-section {
    border-top: 0;
    padding-top: 0;
  }
}
@media (max-width: 600px) {
  .overview-content, .overview-rail {
    padding: 20px 14px;
    gap: 18px;
  }
  .overview-kpis {
    gap: 8px;
  }
  .overview-kpi h2 {
    font-size: 0.8rem;
    padding: 10px;
    gap: 6px;
  }
  .overview-kpi .kpi-body {
    padding: 12px 10px;
  }
  .overview-kpi .kpi-value {
    font-size: 2.3rem;
  }
  .activity-card .section-head .row {
    margin-left: auto;
  }
  .overview-rail {
    grid-template-columns: minmax(0, 1fr);
  }
  .overview-rail .rail-section + .rail-section {
    border-top: 1px solid var(--hairline);
    padding-top: 16px;
  }
}
