:root {
  color-scheme: dark;
  --bg: #090909;
  --panel: #141414;
  --panel-soft: #101010;
  --field: #0d0d0d;
  --line: rgba(163, 163, 163, .16);
  --text: #f2f0ed;
  --muted: #a8a29e;
  --faint: #78716c;
  --accent: #e7e5e4;
  --accent-2: #a8a29e;
  --ok: #34d399;
  --wait: #fbbf24;
  --bad: #fb7185;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.shell {
  width: min(1240px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 20px 0 56px;
}

body:has(.app-pages) .shell,
body:has(.admin-side-panel) .shell {
  padding-left: 76px;
}

.shell.compact {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 0;
}

.topbar {
  margin-bottom: 24px;
}

.brandbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  width: fit-content;
  max-width: 100%;
  padding: 0;
  background: transparent;
  border: 0;
}

.brand,
.topnav,
.userbar,
.brandbar-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  font-weight: 900;
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: #1c1c1c;
  border: 1px solid var(--line);
  color: var(--text);
}

.brand-sticker {
  display: grid;
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  place-items: center;
  overflow: visible;
}

.brand-sticker tgs-player {
  width: 76px;
  height: 76px;
}

.brand-copy {
  display: grid;
  min-width: 0;
  line-height: 1.15;
}

.brand-copy strong,
.brand-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy strong {
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
}

.brand-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.topnav {
  gap: 6px;
}

.topnav a,
.side-nav a,
.side-nav-button {
  color: var(--muted);
  text-decoration: none;
  border-radius: 8px;
}

.topnav a {
  padding: 8px 10px;
}

.topnav a:hover,
.side-nav a:hover,
.side-nav-button:hover {
  background: rgba(231, 229, 228, .08);
  color: var(--text);
}

.userbar {
  justify-content: flex-end;
  gap: 12px;
  color: var(--muted);
}

.brandbar-actions {
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  color: var(--muted);
}

.brandbar-actions > span {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brandbar-actions form {
  margin: 0;
}

.app-hero,
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
}

.app-hero.slim {
  margin-bottom: 16px;
}

h1 {
  font-size: 34px;
}

h2 {
  font-size: 22px;
}

p {
  color: var(--muted);
  margin: 10px 0 0;
}

.eyebrow {
  color: var(--accent);
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
}

.hero-status {
  min-width: 260px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(52, 211, 153, .24);
  border-radius: 8px;
  background: rgba(52, 211, 153, .08);
}

.hero-status strong,
.hero-status span {
  display: block;
}

.hero-status span:last-child {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ok);
}

.notice {
  margin-bottom: 14px;
  padding: 11px 14px;
  border: 1px solid rgba(52, 211, 153, .24);
  border-radius: 8px;
  background: rgba(52, 211, 153, .08);
  color: #bbf7d0;
  font-weight: 700;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}

.metric-grid.compact {
  margin: 18px 0 0;
}

.metric-card,
.panel,
.auth-panel,
.auth-card {
  background: rgba(20, 20, 20, .9);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric-card {
  min-height: 132px;
  padding: 22px;
}

.metric-card span,
.metric-card small {
  display: block;
  color: var(--muted);
}

.metric-card strong {
  display: block;
  margin: 10px 0 2px;
  font-size: 34px;
  line-height: 1;
}

.metric-card.compact {
  min-height: 104px;
  padding: 16px;
}

.metric-card.compact strong {
  font-size: 28px;
}

.source-analytics {
  margin-bottom: 20px;
  overflow: hidden;
}

.source-analytics.loading {
  cursor: progress;
}

.analytics-head {
  align-items: end;
}

.analytics-source-filter,
.analytics-step-filter {
  display: grid;
  gap: 6px;
  min-width: 220px;
  color: var(--muted);
  font-size: 12px;
}

.analytics-source-filter select,
.analytics-step-filter select,
.analytics-custom-range input {
  width: 100%;
}

.analytics-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
}

.analytics-presets {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
}

button.analytics-preset {
  min-height: 36px;
  padding: 7px 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

button.analytics-preset:hover,
button.analytics-preset.active {
  background: rgba(231, 229, 228, .1);
  color: var(--text);
}

.analytics-step-filter {
  min-width: 170px;
}

.analytics-custom-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.analytics-custom-range label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.analytics-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 22px 0 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.analytics-summary > div {
  min-width: 0;
  padding: 16px;
  background: var(--panel-soft);
}

.analytics-summary span,
.analytics-summary strong {
  display: block;
}

.analytics-summary span {
  color: var(--muted);
  font-size: 13px;
}

.analytics-summary strong {
  margin-top: 5px;
  font-size: 25px;
  line-height: 1.1;
}

.analytics-chart-shell {
  position: relative;
  min-width: 0;
  padding: 18px 18px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
}

.analytics-chart-head,
.analytics-subhead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.analytics-chart-head > div,
.analytics-chart-head strong,
.analytics-chart-head span,
.analytics-subhead span {
  display: block;
}

.analytics-chart-head span,
.analytics-subhead span {
  color: var(--muted);
  font-size: 12px;
}

.analytics-chart-value {
  min-height: 24px;
  color: var(--text) !important;
  font-weight: 800;
}

.analytics-chart {
  display: block;
  width: 100%;
  height: 250px;
  margin-top: 10px;
  overflow: visible;
}

.analytics-grid-line {
  stroke: rgba(163, 163, 163, .12);
  stroke-width: 1;
}

.analytics-grid-label {
  fill: var(--faint);
  font-size: 10px;
}

.analytics-area {
  fill: url(#analyticsAreaGradient);
  pointer-events: none;
}

.analytics-line {
  fill: none;
  stroke: #d6d3d1;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.analytics-dot {
  fill: var(--field);
  stroke: #f5f5f4;
  stroke-width: 2;
  opacity: .5;
  transition: r .15s ease, opacity .15s ease;
  pointer-events: none;
}

.analytics-dot.active {
  r: 5;
  opacity: 1;
}

.analytics-scrubber {
  fill: transparent;
  cursor: crosshair;
  outline: none;
  touch-action: none;
}

.analytics-guide {
  stroke: rgba(245, 245, 244, .32);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.analytics-axis {
  display: flex;
  justify-content: space-between;
  padding-left: 48px;
  color: var(--faint);
  font-size: 11px;
}

.analytics-empty,
.analytics-list-empty {
  padding: 34px 14px;
  color: var(--muted);
  text-align: center;
}

.analytics-lower-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 18px;
  margin-top: 18px;
}

.analytics-quality,
.analytics-source-list {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.analytics-subhead {
  margin-bottom: 18px;
}

.quality-row {
  display: grid;
  grid-template-columns: 90px minmax(80px, 1fr) 44px;
  align-items: center;
  gap: 10px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 13px;
}

.quality-row > div {
  height: 7px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(163, 163, 163, .12);
}

.quality-row i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent-2);
  transition: width .65s cubic-bezier(.2, .8, .2, 1);
}

.quality-row.bad i {
  background: var(--bad);
}

.quality-row strong {
  color: var(--text);
  text-align: right;
}

.analytics-invalid-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 11px;
}

.analytics-source-list > div:last-child {
  display: grid;
  gap: 5px;
}

.analytics-source-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 55px;
  padding: 9px 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.analytics-source-row:hover,
.analytics-source-row.active {
  border-color: var(--line);
  background: rgba(231, 229, 228, .06);
}

.analytics-source-row > span,
.analytics-source-row strong,
.analytics-source-row small {
  display: block;
  min-width: 0;
}

.analytics-source-row > span:first-child strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-source-row > span:last-child {
  text-align: right;
}

.analytics-source-row small {
  color: var(--muted);
  font-size: 11px;
}

.analytics-error {
  margin-top: 14px;
  color: var(--bad);
}

@media (prefers-reduced-motion: reduce) {
  .quality-row i {
    transition: none;
  }
}

@media (max-width: 760px) {
  .analytics-head,
  .analytics-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .analytics-source-filter,
  .analytics-step-filter {
    min-width: 0;
  }

  .analytics-presets {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-custom-range,
  .analytics-summary,
  .analytics-lower-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .analytics-chart-shell {
    padding-inline: 10px;
  }

  .analytics-chart {
    height: 220px;
  }

  .analytics-axis {
    padding-left: 42px;
    font-size: 10px;
  }
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: start;
}

.workspace-grid.two-cols {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.side-panel,
.right-panel {
  display: grid;
  gap: 14px;
}

.side-panel {
  position: fixed;
  left: 18px;
  top: 50%;
  z-index: 30;
  transform: translateY(-50%);
  display: block;
  width: 64px;
  transition: width .18s ease;
}

.side-panel:hover {
  width: 220px;
}

.profile-card,
.panel {
  padding: 24px;
}

.profile-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 18, 18, .94);
}

.profile-card {
  display: flex;
  gap: 12px;
  align-items: center;
}

.profile-card h2 {
  margin-bottom: 8px;
}

.avatar {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: #1c1c1c;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
}

.side-nav {
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(18, 18, 18, .94);
  backdrop-filter: blur(12px);
  overflow: hidden;
}

.side-nav a,
.side-nav-button {
  position: relative;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  width: 46px;
  height: 46px;
  padding: 0;
  font-weight: 800;
  overflow: hidden;
  transition: width .18s ease, background-color .15s ease, color .15s ease;
}

.side-panel:hover .side-nav a,
.side-panel:hover .side-nav-button {
  width: 202px;
}

.side-nav a .icon,
.side-nav-button .icon {
  justify-self: center;
}

.side-nav a span,
.side-nav-button span {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity .14s ease, transform .14s ease;
}

.side-panel:hover .side-nav a span,
.side-panel:hover .side-nav-button span {
  opacity: 1;
  transform: translateX(0);
}

.side-nav a:focus-visible,
.side-nav-button:focus-visible {
  outline: 2px solid rgba(231, 229, 228, .5);
  outline-offset: 2px;
}

.side-nav a.active {
  background: rgba(231, 229, 228, .1);
  color: var(--text);
  border: 1px solid rgba(231, 229, 228, .2);
}

.side-nav-form {
  margin: 0;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.side-nav-button {
  background: transparent;
  border: 0;
  color: var(--muted);
  font: inherit;
  font-weight: 800;
}

.content-stack {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.page-section {
  display: grid;
  gap: 20px;
}

.page-section.is-hidden {
  display: none;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.inline-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.summary-grid div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, .22);
}

.summary-grid span,
.summary-grid strong {
  display: block;
}

.summary-grid span {
  color: var(--muted);
  font-size: 12px;
}

.summary-grid strong {
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.form-section {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.form-section h3 {
  font-size: 14px;
  color: var(--text);
}

.auth-method-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 0;
  margin: 0;
  border: 0;
}

.auth-method-picker legend {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  color: var(--muted);
}

.auth-method-card {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 104px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .025);
  cursor: pointer;
}

.auth-method-card input {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 100%;
  opacity: 0;
  cursor: pointer;
}

.auth-method-card:has(input:checked) {
  border-color: rgba(231, 229, 228, .34);
  background: rgba(231, 229, 228, .08);
}

.auth-method-card:focus-within {
  outline: 2px solid rgba(231, 229, 228, .5);
  outline-offset: 2px;
}

.auth-method-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
  color: var(--text);
}

.auth-method-card strong,
.auth-method-card small {
  display: block;
}

.auth-method-card strong {
  color: var(--text);
}

.auth-method-card small {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.35;
}

.narrow-panel {
  max-width: 760px;
}

.auth-panel {
  width: min(420px, calc(100vw - 32px));
  padding: 22px;
}

.auth-card {
  width: min(480px, calc(100vw - 32px));
  padding: 28px;
}

.auth-copy {
  display: grid;
  gap: 8px;
}

.auth-copy h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.05;
}

.auth-copy p {
  margin: 0;
  color: var(--muted);
}

.auth-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.auth-form {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.auth-sticker {
  display: grid;
  width: 156px;
  height: 156px;
  place-items: center;
  margin: 20px auto 4px;
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity .16s ease, transform .16s ease;
}

.auth-sticker.compact {
  width: 112px;
  height: 112px;
  margin-top: 18px;
}

.auth-sticker:empty {
  display: none;
}

.auth-sticker tgs-player {
  width: 100%;
  height: 100%;
}

.inline-sticker {
  display: grid;
  width: 96px;
  height: 96px;
  place-items: center;
  margin: 0 auto 4px;
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity .16s ease, transform .16s ease;
}

.auth-sticker.is-changing,
.inline-sticker.is-changing {
  opacity: 0;
  transform: translateY(3px) scale(.98);
}

.inline-sticker.small {
  width: 72px;
  height: 72px;
  margin-bottom: 6px;
}

.settings-sticker {
  margin: 0;
  justify-self: end;
}

.inline-sticker:empty {
  display: none;
}

.inline-sticker tgs-player {
  width: 100%;
  height: 100%;
}

.grid {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.form-grid.single {
  grid-template-columns: minmax(0, 1fr);
}

.settings-form {
  gap: 16px;
}

.settings-group {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .025);
}

.settings-group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.settings-group-head h3 {
  font-size: 16px;
}

.settings-group-head span {
  max-width: 420px;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.target-category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.target-category-option {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .02);
  cursor: pointer;
}

.target-category-option:has(input:checked) {
  border-color: rgba(231, 229, 228, .34);
  background: rgba(231, 229, 228, .06);
}

.target-category-option input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
  padding: 0;
}

.target-category-option strong,
.target-category-option small {
  display: block;
  overflow-wrap: anywhere;
}

.admin-history-hero p {
  margin: 8px 0 0;
  color: var(--muted);
}

.history-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 20px;
}

.history-pagination span {
  color: var(--muted);
  font-size: 13px;
}

.history-target-categories {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.target-skips {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.target-skips > summary {
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.target-skip-groups {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.target-skip-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.target-skip-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 9px 12px;
  color: var(--text);
  cursor: pointer;
}

.target-skip-group > summary strong {
  min-width: 28px;
  color: var(--muted);
  text-align: right;
}

.target-skip-group .target-skip-list {
  margin-top: 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
}

.broadcast-settings-list {
  display: grid;
  gap: 0;
  margin: 0;
}

.broadcast-settings-list > div {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(0, 1.2fr);
  gap: 16px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
}

.broadcast-settings-list dt,
.broadcast-settings-list dd {
  margin: 0;
}

.broadcast-settings-list dt {
  color: var(--muted);
}

.broadcast-settings-list dd {
  overflow-wrap: anywhere;
  text-align: right;
}

@media (max-width: 620px) {
  .broadcast-settings-list > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .broadcast-settings-list dd {
    text-align: left;
  }
}

.target-skip-list {
  display: grid;
  gap: 0;
  margin-top: 10px;
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.target-skip-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, .45fr);
  gap: 14px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.target-skip-row:last-child {
  border-bottom: 0;
}

.target-skip-row strong,
.target-skip-row small {
  display: block;
  overflow-wrap: anywhere;
}

.target-skip-row small,
.target-skip-row > span,
.target-skip-row > div:last-child span {
  color: var(--muted);
  font-size: 12px;
}

.delivery-technical {
  margin-top: 5px;
}

.delivery-technical summary {
  width: fit-content;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.delivery-technical small {
  margin-top: 4px;
  color: var(--muted);
}

.target-category-option strong {
  color: var(--text);
  font-size: 14px;
}

.target-category-option small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.settings-save-status {
  display: none;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.settings-save-status.is-error {
  display: inline-flex;
  color: var(--bad);
  border-color: rgba(251, 113, 133, .28);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

input,
select {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
}

.password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  align-items: stretch;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  overflow: hidden;
}

.password-field input {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.password-toggle {
  display: grid;
  place-items: center;
  min-height: auto;
  width: 48px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  border-left: 1px solid var(--line);
}

.password-toggle:hover {
  background: rgba(231, 229, 228, .08);
}

.password-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password-toggle svg circle {
  fill: currentColor;
  stroke: none;
}

.password-toggle .eye-closed {
  display: none;
}

.password-toggle[aria-pressed="true"] .eye-open {
  display: none;
}

.password-toggle[aria-pressed="true"] .eye-closed {
  display: block;
}

select {
  appearance: none;
}

button,
.button {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #111111;
  font-weight: 800;
  min-height: 46px;
  padding: 12px 18px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.icon-only {
  width: 44px;
  min-width: 44px;
  padding: 0;
}

button.small.icon-only,
.button.small.icon-only {
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
}

button.secondary {
  background: rgba(148, 163, 184, .14);
  color: var(--text);
  border: 1px solid var(--line);
}

button.ghost,
.button.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

button.small {
  padding: 7px 10px;
  font-size: 12px;
}

button.danger {
  background: rgba(251, 113, 133, .15);
  color: #fecdd3;
  border: 1px solid rgba(251, 113, 133, .35);
}

button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.side-nav-button {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  width: 46px;
  height: 46px;
  min-height: 46px;
  padding: 0;
  justify-content: initial;
  background: transparent;
  border: 0;
  color: var(--muted);
  font: inherit;
  font-weight: 800;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  align-items: center;
}

.wide {
  grid-column: 1 / -1;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(148, 163, 184, .06);
}

.toggle-row input {
  width: 18px;
  min-height: 18px;
}

.field-title,
.toggle-row span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.help-tip {
  position: relative;
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  border-radius: 999px;
  background: rgba(148, 163, 184, .14);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 12px;
  line-height: 1;
}

.help-tip::after {
  content: attr(aria-label);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 9px);
  z-index: 30;
  width: min(280px, 70vw);
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0a0a0a;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity .15s ease, transform .15s ease;
}

.help-tip:hover::after,
.help-tip:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.dropzone {
  display: grid;
  gap: 8px;
  min-height: 170px;
  place-items: center;
  text-align: center;
  border: 1px dashed rgba(231, 229, 228, .34);
  border-radius: 8px;
  background: #151515;
  cursor: pointer;
  padding: 24px;
}

.dropzone strong {
  font-size: 22px;
}

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

.dropzone.drag-over,
.dropzone.has-file {
  border-color: var(--ok);
  background: #10251f;
}

.progress-card {
  margin-top: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, .28);
}

.broadcast-job-list {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.broadcast-job-list:empty {
  display: none;
}

.broadcast-job-list .progress-card {
  margin-top: 0;
}

.broadcast-job-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
}

.broadcast-job-meta span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.broadcast-job-dismiss {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.progress-track {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, .14);
}

.progress-track div {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width .25s ease;
}

.progress-card[data-state="completed"] .progress-track div {
  background: var(--ok);
}

.progress-card[data-state="warning"] .progress-track div,
.progress-card[data-state="waiting"] .progress-track div {
  background: var(--wait);
}

.progress-card[data-state="failed"] .progress-track div {
  background: var(--bad);
}

.progress-details {
  display: grid;
  gap: 12px;
  min-height: 24px;
  margin: 14px 0 0;
  color: var(--muted);
}

.progress-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  color: var(--text);
  font-weight: 700;
}

.progress-status .icon {
  color: var(--accent);
}

.progress-status.danger .icon {
  color: var(--bad);
}

.progress-failure {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 4px 0;
}

.progress-failure-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--bad);
  background: rgba(251, 113, 133, .1);
  border-radius: 50%;
}

.progress-failure-icon .icon {
  width: 20px;
  height: 20px;
}

.progress-failure strong {
  color: var(--text);
  font-size: 16px;
}

.progress-failure p {
  margin: 4px 0 0;
  color: var(--muted);
}

@media (max-width: 640px) {
  .progress-failure {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .progress-failure button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

.progress-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
}

.progress-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.progress-item {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 10px 12px;
  border-top: 1px solid rgba(148, 163, 184, .16);
  background: rgba(148, 163, 184, .05);
}

.progress-item span {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.progress-item strong {
  min-width: 0;
  color: var(--text);
  font-size: 18px;
  overflow-wrap: anywhere;
}

.progress-item.ok .icon,
.progress-item.ok strong {
  color: var(--ok);
}

.progress-item.wait .icon,
.progress-item.wait strong {
  color: var(--wait);
}

.progress-item.danger .icon,
.progress-item.danger strong {
  color: var(--bad);
}

.qr-box {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .04);
}

.qr-box img {
  width: 220px;
  height: 220px;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.qr-box span {
  color: var(--muted);
}

.step-box {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, .22);
}

.step-box.is-done {
  border-color: rgba(52, 211, 153, .35);
}

.is-disabled {
  opacity: .48;
}

.step-box button {
  justify-self: start;
}

.muted-link {
  display: inline-block;
  margin-top: 16px;
  color: var(--muted);
}

.error {
  margin-top: 14px;
  color: #fecdd3;
  background: rgba(251, 113, 133, .1);
  border: 1px solid rgba(251, 113, 133, .25);
  padding: 10px;
  border-radius: 8px;
}

.details {
  display: grid;
  gap: 12px;
  margin: 0;
}

.details div {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.compact-details div {
  grid-template-columns: 1fr;
  gap: 4px;
}

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

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

.badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 9px;
  font-weight: 800;
  font-size: 12px;
}

.badge.ok {
  background: rgba(52, 211, 153, .12);
  color: var(--ok);
}

.badge.wait {
  background: rgba(251, 191, 36, .12);
  color: var(--wait);
}

.badge.bad {
  background: rgba(251, 113, 133, .12);
  color: var(--bad);
}

#bulkPanel {
  display: grid;
  gap: 20px;
}

#autoflowPanel {
  display: grid;
  gap: 20px;
}

.autoflow-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
  gap: 20px;
  align-items: start;
}

.autoflow-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.autoflow-form .wide {
  grid-column: 1 / -1;
}

.autoflow-channel-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.autoflow-channel-group > strong {
  grid-column: 1 / -1;
}

.autoflow-state {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mode-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mode-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 4px 0 20px;
}

.mode-status-grid-compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mode-status-grid > div {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: 8px;
  background: var(--panel-soft);
}

.mode-status-grid > div.ok {
  border-left-color: var(--ok);
}

.mode-status-grid > div.wait {
  border-left-color: var(--wait);
}

.mode-status-grid > div.bad {
  border-left-color: var(--bad);
}

.mode-status-grid span,
.mode-status-grid small {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.mode-status-grid strong {
  overflow-wrap: anywhere;
}

.autoflow-alert {
  padding: 12px 14px;
  margin-bottom: 16px;
  border-left: 3px solid var(--bad);
  background: rgba(248, 113, 113, .08);
  color: #fecdd3;
  overflow-wrap: anywhere;
}

.autoflow-connection-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 4px 0 16px;
}

.autoflow-connection-grid > div {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.autoflow-status-tile.ok {
  border-left: 3px solid var(--ok);
}

.autoflow-status-tile.wait {
  border-left: 3px solid var(--wait);
}

.autoflow-status-tile.bad {
  border-left: 3px solid var(--bad);
}

.autoflow-connection-grid span,
.autoflow-connection-grid small {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.autoflow-connection-grid strong {
  overflow-wrap: anywhere;
}

.autoflow-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.autoflow-controls form {
  margin: 0;
}

.autoflow-last-check {
  margin-right: auto;
  color: var(--muted);
  font-size: 13px;
}

.app-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.app-dialog::backdrop {
  background: rgba(0, 0, 0, .72);
}

.app-dialog-shell {
  max-height: calc(100vh - 34px);
  padding: 24px;
  overflow-y: auto;
}

.app-dialog-shell > .section-head {
  margin-bottom: 22px;
}

.dialog-section-head {
  display: grid;
  gap: 3px;
  margin: 28px 0 16px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.dialog-section-head h3 {
  margin: 0;
}

.dialog-section-head span {
  color: var(--muted);
  font-size: 13px;
}

.autoflow-events {
  display: grid;
  gap: 0;
}

.autoflow-event {
  display: grid;
  gap: 5px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.autoflow-event:last-child {
  border-bottom: 0;
}

.autoflow-event span {
  color: var(--muted);
  font-size: 12px;
}

.autoflow-event strong {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.autoflow-event.error strong {
  color: #fecdd3;
}

#autoflow-sources .bulk-row-controls input {
  width: 88px;
}

#autoflow-sources,
#autoflow-live {
  scroll-margin-top: 92px;
}

.bulk-head {
  align-items: flex-start;
}

#bulk-top,
#bulk-sources,
#bulk-tasks {
  scroll-margin-top: 92px;
}

.bulk-head-actions,
.bulk-row-controls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.bulk-head-actions form,
.bulk-row-controls form {
  margin: 0;
}

.bulk-tools {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
  gap: 20px;
  align-items: stretch;
}

.bulk-source-form,
.bulk-upload-form {
  display: grid;
  gap: 16px;
}

.bulk-source-form {
  grid-template-columns: minmax(0, 1fr) 150px auto;
  align-items: end;
}

.bulk-list {
  display: grid;
  gap: 12px;
}

.bulk-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.bulk-row-main {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.bulk-link {
  min-width: 0;
  color: var(--text);
  font-weight: 800;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.bulk-row-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.bulk-subline {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.bulk-error {
  color: #fecdd3;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.bulk-delete-status {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.bulk-delete-status .icon {
  width: 15px;
  height: 15px;
}

.bulk-delete-status.ok {
  background: rgba(52, 211, 153, .1);
  color: var(--ok);
}

.bulk-delete-status.wait {
  background: rgba(251, 191, 36, .1);
  color: var(--wait);
}

.bulk-delete-status.bad {
  background: rgba(251, 113, 133, .1);
  color: var(--bad);
}

.bulk-task-progress {
  display: grid;
  gap: 8px;
  margin-top: 2px;
}

.bulk-task-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.bulk-task-progress-head strong {
  color: var(--text);
  font-size: 13px;
}

.bulk-task-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, .14);
}

.bulk-task-track div {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width .28s ease;
}

.bulk-task-progress.running .bulk-task-track div,
.bulk-task-progress.starting .bulk-task-track div {
  background: var(--accent);
}

.bulk-task-progress.completed .bulk-task-track div {
  background: var(--ok);
}

.bulk-task-progress.queued .bulk-task-track div,
.bulk-task-progress.stopped .bulk-task-track div {
  background: var(--wait);
}

.bulk-task-progress.failed .bulk-task-track div {
  background: var(--bad);
}

.bulk-task-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.bulk-task-stats span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.bulk-task-stats .icon {
  width: 14px;
  height: 14px;
}

.bulk-task-stats .ok {
  color: var(--ok);
}

.bulk-task-stats .bad {
  color: var(--bad);
}

.bulk-task-stats .wait {
  color: var(--wait);
}

.bulk-row-controls button,
.bulk-head-actions button,
.bulk-head-actions .button {
  white-space: nowrap;
}

.bulk-dropzone {
  min-height: 168px;
}

.bulk-dropzone strong {
  font-size: 20px;
}

.table-wrap {
  width: 100%;
  overflow-x: visible;
  margin-top: 16px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 0;
  table-layout: fixed;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.data-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.data-table td small,
.muted-row {
  display: block;
  color: var(--muted);
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.row-actions form {
  margin: 0;
}

.inline-edit {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.inline-edit input {
  width: 72px;
  min-height: 36px;
  padding: 7px 9px;
}

.source-table th:nth-child(1),
.source-table td:nth-child(1) {
  width: 38%;
}

.source-table th:nth-child(2),
.source-table td:nth-child(2) {
  width: 16%;
}

.source-table th:nth-child(3),
.source-table td:nth-child(3) {
  width: 16%;
}

.source-table th:nth-child(4),
.source-table td:nth-child(4) {
  width: 12%;
}

.source-table th:nth-child(5),
.source-table td:nth-child(5) {
  width: 18%;
}

.task-table th:nth-child(1),
.task-table td:nth-child(1) {
  width: 18%;
}

.task-table th:nth-child(2),
.task-table td:nth-child(2) {
  width: 16%;
}

.task-table th:nth-child(3),
.task-table td:nth-child(3) {
  width: 28%;
}

.task-table th:nth-child(4),
.task-table td:nth-child(4) {
  width: 12%;
}

.task-table th:nth-child(5),
.task-table td:nth-child(5) {
  width: 12%;
}

.task-table th:nth-child(6),
.task-table td:nth-child(6) {
  width: 14%;
}

.admin-user-table th:nth-child(1),
.admin-user-table td:nth-child(1) {
  width: 24%;
}

.admin-user-table th:nth-child(2),
.admin-user-table td:nth-child(2) {
  width: 12%;
}

.admin-user-table th:nth-child(3),
.admin-user-table td:nth-child(3) {
  width: 17%;
}

.admin-user-table th:nth-child(4),
.admin-user-table td:nth-child(4) {
  width: 9%;
}

.admin-user-table th:nth-child(5),
.admin-user-table td:nth-child(5) {
  width: 13%;
}

.admin-user-table th:nth-child(6),
.admin-user-table td:nth-child(6) {
  width: 14%;
}

.admin-user-table th:nth-child(7),
.admin-user-table td:nth-child(7) {
  width: 11%;
}

.admin-user-table td {
  vertical-align: top;
}

.admin-actions {
  min-width: 88px;
  gap: 6px;
  justify-content: flex-start;
  align-items: flex-start;
  flex-wrap: nowrap;
}

.admin-actions button.small.icon-only,
.admin-actions .button.small.icon-only {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
}

.admin-actions button,
.admin-actions .muted-row {
  white-space: nowrap;
}

.admin-actions form {
  flex: 0 0 auto;
}

.admin-actions .muted-row {
  align-self: center;
}

.admin-actions .admin-action-disabled:disabled {
  opacity: .38;
  cursor: not-allowed;
  color: var(--muted);
}

.admin-result-cell span,
.admin-result-cell small {
  display: block;
}

.wrap-anywhere {
  overflow-wrap: anywhere;
}

.bad-text {
  color: #fecdd3 !important;
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-row {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, .22);
  overflow: hidden;
}

.history-row[open] {
  background: rgba(24, 24, 24, .66);
}

.history-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px auto;
  align-items: center;
  gap: 18px;
  padding: 16px;
  cursor: pointer;
  list-style: none;
}

.history-summary::-webkit-details-marker {
  display: none;
}

.history-summary strong,
.history-summary span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.history-summary span {
  color: var(--muted);
}

.history-details {
  display: grid;
  gap: 14px;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--line-soft);
}

.history-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.history-detail-grid > div {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(0, 0, 0, .2);
  min-width: 0;
}

.history-detail-grid span,
.history-detail-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.history-detail-grid strong,
.history-detail-list dd {
  overflow-wrap: anywhere;
}

.history-detail-list {
  display: grid;
  gap: 0;
  margin: 0;
}

.history-detail-list div {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
}

.history-detail-list div:first-child {
  border-top: 0;
}

.history-detail-list dd {
  margin: 0;
}

.history-metrics {
  display: grid;
  gap: 10px;
}

.history-metrics > strong {
  font-size: 16px;
}

.history-inline-error {
  padding: 10px 12px;
  border: 1px solid rgba(248, 113, 113, .24);
  border-radius: 8px;
  background: rgba(127, 29, 29, .16);
  color: #fecdd3;
  overflow-wrap: anywhere;
}

.empty-state {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.empty-state-illustrated {
  justify-items: center;
  text-align: center;
  padding: 24px 18px;
}

.empty-state strong {
  color: var(--text);
}

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

th,
td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
}

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

.actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.actions form button {
  margin: 0;
  width: auto;
}

@media (max-width: 1180px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .brandbar {
    width: 100%;
    min-width: 0;
  }

  .app-hero,
  .hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-grid,
  .workspace-grid.two-cols,
  .bulk-tools,
  .autoflow-grid,
  .autoflow-form,
  .autoflow-channel-group,
  .autoflow-connection-grid,
  .mode-status-grid,
  .bulk-source-form,
  .bulk-row,
  .right-panel,
  .form-grid,
  .grid.two,
  .auth-method-picker,
  .target-category-grid,
  .target-skip-row {
    grid-template-columns: 1fr;
  }

  .autoflow-controls {
    align-items: stretch;
  }

  .autoflow-last-check {
    flex-basis: 100%;
  }

  .bulk-head-actions,
  .bulk-row-controls {
    justify-content: flex-start;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100% !important;
  }

  .data-table thead {
    display: none;
  }

  .data-table tr {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }

  .data-table td {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 10px;
    border-bottom: 0;
    padding: 7px 0;
  }

  .data-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
  }

  .data-table .row-actions {
    justify-content: flex-start;
  }

  .admin-user-table .admin-actions {
    align-items: center;
    justify-content: flex-start;
  }

  body:has(.app-pages) .shell,
  body:has(.admin-side-panel) .shell {
    padding-left: 0;
    padding-bottom: 86px;
  }

  .side-panel {
    position: fixed;
    left: 50%;
    top: auto;
    bottom: 14px;
    transform: translateX(-50%);
    width: auto;
  }

  .side-panel:hover {
    width: auto;
  }

  .side-nav {
    grid-auto-flow: column;
    grid-auto-columns: 46px;
  }

  .side-nav a,
  .side-nav-button,
  .side-panel:hover .side-nav a,
  .side-panel:hover .side-nav-button {
    width: 46px;
  }

  .side-nav a span,
  .side-nav-button span,
  .side-panel:hover .side-nav a span,
  .side-panel:hover .side-nav-button span {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    clip: rect(0, 0, 0, 0);
  }

  .side-nav-form {
    padding-top: 0;
    padding-left: 8px;
    border-top: 0;
    border-left: 1px solid var(--line);
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100vw - 20px, 1180px);
    padding-top: 10px;
  }

  h1 {
    font-size: 30px;
  }

  .brandbar {
    border-radius: 18px;
  }

  .brand-copy small {
    display: none;
  }

  .brandbar-actions > span {
    max-width: 96px;
  }

  .settings-group-head {
    display: grid;
    gap: 4px;
  }

  .settings-group-head span {
    max-width: none;
    text-align: left;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .history-summary {
    grid-template-columns: 1fr;
  }

  .history-detail-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions button {
    width: 100%;
  }

  .details div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  table {
    min-width: 760px;
  }

  .table-panel {
    overflow-x: auto;
  }
}
