:root {
  --bg: #0a0a0a;
  --card: #161616;
  --line: rgba(255,255,255,.09);
  --line-strong: rgba(255,255,255,.16);
  --txt: #ededed;
  --mut: #8f8f8f;
  --ok:#7dd88f;
  --wait:#e8c268;
  --bad:#e57373;
  --mut2:#8f8f8f;
  --col: 768px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--txt);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.62;
}

.hidden {
  display: none;
}

.login-view {
  min-height: 100vh;
  padding: 24px;
}

.hero {
  min-height: calc(100vh - 48px);
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #f5a623 0%, #2b5dff 100%);
  border-radius: 32px;
}

.card {
  width: min(100%, 420px);
  padding: 40px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: none;
}

h1 {
  margin: 0 0 32px;
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1.05;
}

#view-root h1 {
  margin: 0 0 6px;
  font-size: 26px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -.01em;
}

h2 {
  margin: 0 0 10px;
  font-size: 20px;
  line-height: 1.35;
  font-weight: 600;
}

h3 {
  margin: 0 0 4px;
  font-size: 16px;
  line-height: 1.45;
  font-weight: 600;
}

form {
  display: grid;
  gap: 12px;
}

label {
  color: var(--mut);
  font-size: 14px;
}

input {
  width: 100%;
  height: 40px;
  margin-bottom: 8px;
  padding: 0 12px;
  background: #111;
  color: var(--txt);
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
}

.btn-pill {
  height: 40px;
  padding: 0 22px;
  background: #fff;
  color: #000;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.error {
  min-height: 20px;
  margin: 4px 0 0;
  color: var(--bad);
}

.error button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  margin-top: 8px;
  padding: 0 14px;
  background: transparent;
  color: var(--txt);
  border: 1px solid var(--line);
  border-radius: 9999px;
  box-shadow: none;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
}

.loading {
  padding: 24px 0;
  color: var(--mut);
}

.shell-view {
  min-height: 100vh;
  padding: 32px;
}

#view-root > *:not(.client-workspace):not(.wizard-layout) {
  max-width: var(--col);
}

.client-content,
.wizard-main {
  max-width: var(--col);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.account {
  display: flex;
  align-items: center;
  gap: 16px;
}

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

.banner {
  margin-top: 20px;
  padding: 12px 16px;
  color: rgba(229,115,115,.85);
  background: rgba(229,115,115,.12);
  border: 1px solid rgba(229,115,115,.22);
  border-radius: 16px;
}

.breadcrumb {
  min-height: 20px;
  margin: 24px 0 32px;
  color: var(--mut);
  font-size: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 9999px;
  font-size: 13px;
  line-height: 1.25;
}

.pill--ok {
  background: var(--ok);
  color: #0d1a10;
}

.pill--wait {
  background: var(--wait);
  color: #1c1706;
}

.pill--bad {
  background: var(--bad);
  color: #210c0c;
}

.pill--mut {
  background: transparent;
  color: #b3b3b3;
  border: 1px solid var(--line-strong);
}

.pill--neutral {
  background: rgba(255,255,255,.08);
  color: var(--txt);
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: cabinet-pulse 2s ease infinite;
}

@keyframes cabinet-pulse {
  0%, 100% { opacity: .35; }
  50% { opacity: 1; }
}

.section-kicker,
.section-title {
  margin: 0 0 18px;
}

.section-kicker {
  color: var(--mut);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
}

.section-title {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
}

.clients-section {
  margin-top: 44px;
}

.task-grid,
.clients-grid,
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.task-grid,
.clients-grid {
  grid-template-columns: 1fr;
  gap: 0;
}

.cabinet-card {
  padding: 22px;
  background: #161616;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  box-shadow: none;
}

.metric-card {
  padding: 0;
  padding-bottom: 18px;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.manager-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.task-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.task-row-main {
  min-width: 0;
}

.task-row-main strong {
  font-weight: 650;
}

.task-row-meta {
  margin-top: 3px;
  font-size: 13.5px;
}

.task-row-action {
  flex: 0 0 auto;
}

.client-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.client-row-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.client-row-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.client-row-action {
  flex: 0 0 auto;
}

.theme-task,
.metric-label {
  margin: 0;
}

.ghost-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  background: transparent;
  color: var(--txt);
  border: 1px solid var(--line);
  border-radius: 9999px;
  box-shadow: none;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  text-decoration: none;
}

.ghost-action:hover,
.ghost-action:focus-visible {
  border-color: rgba(255,255,255,.28);
}

.empty-state {
  max-width: 620px;
  margin: 0;
  padding: 16px 0;
  color: var(--mut);
}

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

.client-rail {
  display: flex;
  flex-direction: column;
  width: 200px;
  padding-right: 24px;
  border-right: 1px solid var(--line);
}

.rail-back,
.rail-tab,
.rail-rerelease {
  color: var(--mut);
  text-decoration: none;
}

.rail-back {
  margin-bottom: 28px;
  font-size: 14px;
}

.rail-client {
  margin: 0 0 20px;
  color: var(--txt);
  font-size: 17px;
}

.client-switcher {
  margin: 4px 0 16px;
}

.client-switcher-list,
.client-switcher-results {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.client-switcher-item {
  padding: 6px 8px;
  border-radius: 8px;
  color: var(--mut);
  text-decoration: none;
  font-size: 13.5px;
}

.client-switcher-item:hover {
  color: var(--txt);
}

.client-switcher-item--active {
  background: rgba(255,255,255,.06);
  color: var(--txt);
}

.client-switcher-search {
  width: 100%;
  height: 34px;
  margin-bottom: 6px;
  padding: 0 10px;
  background: #111;
  color: var(--txt);
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 13.5px;
}

.rail-tab,
.rail-rerelease {
  padding: 10px 12px;
  border-radius: 10px;
}

.rail-tab--active {
  background: rgba(255,255,255,.08);
  color: #fff;
}

.client-content {
  min-width: 0;
}

.theme-list,
.release-list,
.release-copies {
  display: grid;
  gap: 12px;
}

.theme-row {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.theme-row:first-child {
  padding-top: 0;
}

.theme-released {
  margin-top: 24px;
}

.theme-released summary {
  color: var(--mut);
  cursor: pointer;
}

.theme-released-row {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.theme-main,
.release-copy-main,
.lead-stage {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.theme-title,
.release-title {
  margin: 0;
  font-size: 19px;
}

.theme-task {
  margin-top: 8px;
  font-size: 15px;
}

.post-editor,
.post-editor-section,
.rerelease-page,
.rerelease-block {
  display: grid;
  gap: 12px;
}

.post-editor-section,
.rerelease-block {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}

.post-waiting,
.post-accept-reason {
  color: var(--mut);
}

.post-gate-reason,
.rerelease-release-error,
.rerelease-approve-error {
  margin-top: 10px;
}

.rerelease-header {
  margin: 18px 0;
}

.rerelease-row .ghost-action {
  margin-top: 12px;
}

.release-group {
  margin-top: 34px;
}

.release-group:first-child {
  margin-top: 0;
}

.release-title {
  margin-bottom: 20px;
}

.release-copy {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.release-copy-main {
  justify-content: flex-start;
}

.video-toggle {
  min-width: 34px;
  padding: 0 9px;
}

.release-video {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 420px;
  margin-top: 14px;
  aspect-ratio: 9 / 16;
  background: #000;
  border-radius: 16px;
}

.metric-value {
  display: block;
  margin-top: 18px;
  font-size: clamp(32px, 6vw, 56px);
  line-height: 1;
}

.lead-stages {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

@media (max-width: 560px) {
  .login-view {
    padding: 0;
  }

  .hero {
    min-height: 100vh;
    padding: 16px;
    border-radius: 0;
  }

  .card {
    padding: 28px 22px;
  }

  .shell-view {
    padding: 24px 18px;
  }

  .topbar,
  .account {
    gap: 12px;
  }

  .breadcrumb {
    margin-bottom: 24px;
  }

}

@media (max-width: 860px) {
  .client-workspace {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .client-rail {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    padding: 0 0 20px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .rail-back,
  .rail-client {
    grid-column: 1 / -1;
  }

  .rail-back {
    margin-bottom: 16px;
  }

  .rail-client {
    margin-bottom: 10px;
  }

  .client-switcher,
  .client-switcher-list,
  .client-switcher-results {
    grid-column: 1 / -1;
  }

  .client-content,
  .wizard-main {
    max-width: none;
  }
}

.topbar-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
}

.nav-pill {
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--mut);
  padding: 8px 14px;
  text-decoration: none;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .topbar {
    flex-wrap: wrap;
    gap: 12px 24px;
  }

  .topbar > strong {
    order: 1;
    flex-grow: 1;
    align-self: center;
  }

  .topbar-nav {
    order: 3;
    flex-basis: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 4px;
  }

  .stuck-pill {
    order: 4;
  }

  .account {
    order: 2;
    align-self: center;
  }

  #user-name {
    display: none;
  }

  .nav-pill {
    padding: 6px 10px;
  }
}

.admin-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 640px;
}

.admin-menu-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--txt);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.admin-menu-hint {
  font-size: 14px;
  line-height: 1.4;
}

.nav-pill--active {
  background: var(--card);
  border-color: var(--line);
  color: var(--txt);
}

.footage-dropzone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 20px;
  transition: border-color .16s ease, background .16s ease;
}

.footage-dropzone p,
.footage-modal-head h2,
.footage-upload-row p,
.footage-drawer p {
  margin: 0;
}

.footage-dropzone p {
  margin-top: 6px;
}

.footage-dropzone--active {
  background: rgba(125,216,143,.08);
  border-color: var(--ok);
}

.footage-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0,0,0,.72);
}

.footage-modal-card {
  display: grid;
  gap: 12px;
  width: min(100%, 560px);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

.footage-modal-head,
.footage-upload-summary,
.footage-upload-row-head,
.footage-drawer-head,
.footage-upload-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.footage-close {
  min-width: 36px;
  padding: 0;
  font-size: 20px;
}

.footage-scope {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.footage-scope-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px;
  background: #111;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--txt);
  cursor: pointer;
}

.footage-scope-option input {
  width: auto;
  height: auto;
  margin: 0;
}

.footage-modal-card select,
.footage-catalog select,
.footage-drawer select,
.footage-drawer textarea,
.cab-select {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  background: #111;
  color: var(--txt);
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
}

.footage-modal-error {
  color: var(--bad);
}

.footage-upload-panel {
  position: sticky;
  bottom: 16px;
  z-index: 30;
  margin: 20px 0;
}

.footage-upload-card {
  max-height: min(54vh, 520px);
  overflow-y: auto;
  box-shadow: 0 18px 48px rgba(0,0,0,.42);
}

.footage-upload-summary {
  position: sticky;
  top: -22px;
  z-index: 1;
  margin: -22px -22px 16px;
  padding: 18px 22px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.footage-upload-actions {
  justify-content: flex-end;
}

.footage-upload-files {
  display: grid;
  gap: 14px;
}

.footage-upload-row {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.footage-upload-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.footage-row-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--bad);
}

.footage-catalog {
  margin-top: 36px;
}

.footage-catalog-toolbar {
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
}

.footage-catalog-toolbar label {
  display: grid;
  gap: 7px;
}

.footage-project-select {
  max-width: 420px;
}

.footage-facets {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(150px, .55fr) minmax(150px, .55fr);
  gap: 10px;
}

.footage-facets input {
  margin: 0;
}

.footage-catalog-notice {
  margin-bottom: 16px;
}

.footage-clip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.footage-clip-card {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 160px;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  cursor: pointer;
  transition: border-color .16s ease, transform .16s ease;
}

.footage-clip-card:hover,
.footage-clip-card:focus-within {
  border-color: rgba(255,255,255,.28);
  transform: translateY(-1px);
}

.footage-clip-id {
  overflow-wrap: anywhere;
  color: var(--txt);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.footage-clip-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.footage-clip-description {
  min-height: 20px;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.footage-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 50;
  display: grid;
  align-content: start;
  gap: 16px;
  width: min(360px, 100vw);
  height: 100vh;
  padding: 24px;
  overflow-y: auto;
  background: var(--card);
  border-left: 1px solid var(--line);
  box-shadow: -24px 0 60px rgba(0,0,0,.45);
}

.footage-drawer-head {
  align-items: flex-start;
}

.footage-drawer-head h2 {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 18px;
}

.footage-drawer textarea {
  min-height: 160px;
  resize: vertical;
}

.footage-drawer .btn-pill {
  justify-self: start;
}

.footage-drawer-field,
.footage-drawer-readonly {
  display: grid;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

@media (max-width: 700px) {
  .footage-dropzone,
  .footage-upload-summary,
  .footage-row-error {
    align-items: flex-start;
    flex-direction: column;
  }

  .footage-scope,
  .footage-facets {
    grid-template-columns: 1fr;
  }

  .footage-upload-actions {
    justify-content: flex-start;
  }
}

.rollout-table-wrap {
  overflow-x: auto;
}

.rollout-table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  background: none;
  border: 0;
  border-radius: 0;
  font-size: 14.5px;
}

.rollout-table th,
.rollout-table td {
  padding: 10px 16px 10px 0;
  text-align: left;
  vertical-align: middle;
}

.rollout-table th {
  color: var(--mut);
  border-bottom: 1px solid var(--line-strong);
  font-weight: 600;
}

.rollout-table td {
  border-bottom: 1px solid var(--line);
}

.rollout-table th:last-child,
.rollout-table td:last-child {
  padding-right: 0;
}

.rollout-table tbody tr:last-child td {
  border-bottom: 0;
}

.rollout-row-actions,
.distance-verdicts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rollout-row-action {
  min-height: 30px;
  padding: 0 11px;
  font-size: 13px;
}

.rollout-text-row td {
  background: rgba(255,255,255,.025);
}

.rollout-lines {
  display: grid;
  gap: 8px;
  max-width: 760px;
}

.rollout-lines p,
.rollout-notice,
.voice-quote-card p,
.voice-limit-failure p,
.build-progress-card p,
.qc-reasons p,
.farm-final-card p {
  margin: 0;
}

.voice-quote-card,
.build-progress-card,
.review-decision,
.reject-form {
  display: grid;
  gap: 16px;
}

.voice-quote-card {
  max-width: 620px;
}

.voice-limit {
  display: grid;
  gap: 9px;
}

.voice-limit-track,
.job-progress-track {
  width: 100%;
  height: 7px;
  overflow: hidden;
  background: rgba(255,255,255,.08);
  border-radius: 9999px;
}

.voice-limit-fill,
.job-progress-fill {
  height: 100%;
  background: var(--ok);
  border-radius: inherit;
}

.voice-limit-fill--wait {
  background: var(--wait);
}

.job-progress-fill--indeterminate {
  width: 38%;
  background: linear-gradient(90deg, transparent, var(--wait), transparent);
  animation: cabinet-indeterminate 1.4s ease-in-out infinite;
}

@keyframes cabinet-indeterminate {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(280%); }
}

.voice-limit-failure,
.build-progress-card {
  max-width: 620px;
}

.preview-card {
  display: grid;
  grid-template-columns: minmax(220px, 360px) minmax(260px, 1fr);
  gap: 28px;
  align-items: start;
}

.trial-video {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 480px;
  aspect-ratio: 9 / 16;
  background: #000;
  border-radius: 16px;
}

.preview-details {
  display: grid;
  gap: 16px;
  align-items: start;
}

.preview-details p,
.build-summary,
.farm-summary,
.review-summary-text {
  margin: 0;
}

.preview-changes {
  display: grid;
  justify-items: start;
}

.build-copy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.build-copy-tile {
  display: grid;
  gap: 14px;
}

.review-columns {
  display: grid;
  grid-template-columns: 240px minmax(260px, 1fr) 300px;
  gap: 20px;
  align-items: start;
}

.review-list {
  display: grid;
  gap: 8px;
}

.review-item {
  display: grid;
  gap: 9px;
  width: 100%;
  padding: 12px;
  background: var(--card);
  color: var(--txt);
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.review-item--active {
  border-color: rgba(255,255,255,.46);
  box-shadow: 0 0 0 1px rgba(255,255,255,.12);
}

.review-profile {
  overflow: hidden;
  font-weight: 650;
  text-overflow: ellipsis;
}

.review-video {
  display: grid;
  place-items: start center;
  min-width: 0;
}

.review-decision {
  min-width: 0;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.qc-reasons {
  display: grid;
  gap: 6px;
}

.reject-form textarea {
  width: 100%;
  min-height: 110px;
  padding: 10px 12px;
  resize: vertical;
  background: #111;
  color: var(--txt);
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
}

.btn-pill:disabled,
.ghost-action:disabled {
  cursor: default;
  opacity: .45;
}

.review-summary {
  justify-content: space-between;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.farm-summary {
  max-width: 720px;
  font-size: 18px;
  line-height: 1.55;
}

.farm-final-card {
  display: grid;
  gap: 16px;
  max-width: 620px;
}

@media (max-width: 920px) {
  .preview-card,
  .review-columns {
    grid-template-columns: 1fr;
  }

  .review-list {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

.themes-toolbar,
.theme-create-actions,
.wizard-actions,
.claim-actions,
.confirm-plaque,
.text-line-display {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.themes-toolbar {
  justify-content: space-between;
  margin-bottom: 20px;
}

.themes-toolbar .section-title {
  margin-bottom: 0;
}

.theme-create-form {
  max-width: 620px;
  margin-bottom: 28px;
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.theme-continue {
  margin-top: 12px;
}

.wizard-stepper-wrap {
  min-width: 0;
}

.wizard-stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 14px;
  color: var(--mut);
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}

.wizard-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  background: none;
  border-radius: 0;
  font-size: inherit;
  line-height: 1.3;
  text-decoration: none;
}

.wizard-pill--passed {
  color: var(--mut);
}

.wizard-pill-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  background: var(--ok);
  border-radius: 50%;
}

.wizard-pill--current {
  padding: 0;
  background: none;
  color: var(--txt);
  font-weight: 600;
}

.wizard-pill--future {
  color: rgba(255,255,255,.35);
}

span.wizard-pill--future {
  cursor: default;
}

.wizard-progress {
  width: 100%;
  height: 2px;
  margin-top: 16px;
  overflow: hidden;
  background: rgba(255,255,255,.08);
  border-radius: 9999px;
}

.wizard-progress-fill {
  height: 100%;
  border-radius: inherit;
}

.wizard-step-content {
  min-width: 0;
  margin-top: 28px;
}

.wizard-layout {
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: stretch;
}

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

.assistant-panel {
  width: auto;
  max-width: var(--col);
  flex: none;
  padding: 0;
  margin-top: 24px;
  overflow: visible;
  background: none;
  border: 0;
  border-top: 1px dashed var(--line-strong);
  border-radius: 0;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.assistant-panel-header,
.assistant-suggestion-actions,
.assistant-thinking,
.text-line-display,
.confirm-plaque {
  display: flex;
  align-items: center;
  gap: 10px;
}

.assistant-panel-header {
  justify-content: space-between;
}

.assistant-panel-header h2,
.assistant-step-note h3,
.assistant-step-note p,
.assistant-thinking p,
.assistant-answer,
.assistant-message,
.assistant-suggestion-text {
  margin: 0;
}

.assistant-panel-header h2 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--mut);
}

.assistant-panel-close {
  display: none;
  width: 38px;
  height: 38px;
  padding: 0;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--txt);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  font: inherit;
  font-size: 24px;
}

.assistant-step-note {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.assistant-step-note h3 {
  margin-bottom: 8px;
}

.assistant-step-note p,
.assistant-message,
.assistant-answer,
.assistant-suggestion-text {
  line-height: 1.5;
}

.assistant-step-note p {
  color: var(--mut);
  font-size: 15px;
}

.assistant-chips,
.assistant-action-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.assistant-chip {
  min-height: 34px;
  padding: 6px 12px;
  background: rgba(107,98,242,.08);
  color: var(--txt);
  border: 1px solid rgba(107,98,242,.35);
  border-radius: 9999px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  text-align: left;
}

.assistant-question-form {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.assistant-question {
  width: 100%;
  min-height: 88px;
  padding: 10px 12px;
  resize: vertical;
  background: #111;
  color: var(--txt);
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
}

.assistant-question-form .btn-pill {
  justify-self: start;
}

.assistant-status,
.assistant-slot {
  margin-top: 12px;
}

.assistant-status:empty,
.assistant-slot:empty {
  margin: 0;
}

.assistant-thinking {
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px 0;
  color: var(--mut);
  font-size: 15px;
}

.text-line,
.assistant-answer,
.assistant-message {
  padding: 2px 0 2px 20px;
  background: none;
  border: 0;
  border-left: 2px solid var(--line-strong);
  border-radius: 0;
}

.assistant-suggestion {
  margin-top: 12px;
  padding: 16px;
  background: rgba(107,98,242,.08);
  border: 1px solid rgba(107,98,242,.45);
  border-radius: 16px;
}

.assistant-suggestion--wait {
  color: var(--wait);
  background: rgba(232,194,104,.08);
  border-color: rgba(232,194,104,.35);
}

.assistant-suggestion-actions {
  flex-wrap: wrap;
  margin-top: 14px;
}

.assistant-help-button {
  min-width: 42px;
  padding: 0 11px;
}

.text-line-help,
.brief-field-help {
  display: flex;
  justify-content: flex-end;
}

.text-line-assistant {
  margin-top: 8px;
}

.assistant-pill {
  display: none !important;
}

@media (min-width: 1200px) {
  .wizard-layout {
    flex-direction: row;
    gap: 28px;
    align-items: flex-start;
  }

  .assistant-panel {
    position: sticky;
    top: 24px;
    width: 350px;
    max-width: none;
    flex: 0 0 350px;
    max-height: calc(100vh - 48px);
    padding: 20px;
    margin-top: 0;
    overflow-y: auto;
    background: rgba(212,212,212,.08);
    border: 1px solid var(--line);
    border-radius: 20px;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
  }

  .assistant-panel-header h2 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: normal;
    text-transform: none;
    color: var(--txt);
  }
}

.brief-completeness {
  margin: 24px 0;
}

.brief-completeness-label {
  margin: 0 0 9px;
  color: var(--mut);
  font-size: 15px;
}

.brief-completeness-track {
  width: 100%;
  height: 3px;
  overflow: hidden;
  background: rgba(255,255,255,.08);
  border-radius: 9999px;
}

.brief-completeness-fill {
  height: 100%;
  background: var(--ok);
  border-radius: inherit;
}

.brief-section {
  margin-bottom: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.brief-section--open {
  border-color: rgba(255,255,255,.18);
}

.brief-section-header {
  width: 100%;
  padding: 18px 20px;
  background: transparent;
  color: var(--txt);
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 650;
  text-align: left;
}

.brief-section-body {
  padding: 0 20px 20px;
}

.brief-field {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.brief-field:first-child {
  margin-top: 0;
}

.brief-field input,
.brief-field textarea,
.text-line textarea,
.claim-bounded-form textarea,
.profile-select {
  width: 100%;
  padding: 10px 12px;
  background: #111;
  color: var(--txt);
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
}

.brief-field textarea,
.text-line textarea,
.claim-bounded-form textarea {
  min-height: 110px;
  resize: vertical;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  background: rgba(255,255,255,.08);
  border-radius: 9999px;
  font-size: 14px;
}

.chip-remove {
  padding: 0;
  background: transparent;
  color: var(--mut);
  border: 0;
  cursor: pointer;
  font: inherit;
}

.chip-input {
  margin-bottom: 0;
}

.wizard-actions {
  margin-top: 22px;
}

.brief-save-status {
  color: var(--ok);
}

.claim-list,
.text-editor,
.text-group-lines {
  display: grid;
  gap: 12px;
}

.claim-card,
.claim-warning-card,
.footage-card,
.confirm-page,
.confirm-plaque {
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.claim-text,
.claim-meta,
.text-line p,
.confirm-page p {
  margin: 0;
}

.claim-meta {
  margin-top: 8px;
  color: var(--mut);
  font-size: 15px;
}

.claim-actions {
  margin-top: 16px;
}

.claim-bounded-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.claim-bounded-form .btn-pill {
  justify-self: start;
}

.claim-warning-card {
  margin-top: 16px;
  border-color: rgba(232,194,104,.35);
}

.footage-card h2 {
  margin: 0 0 16px;
}

.footage-card--ok {
  border-color: rgba(125,216,143,.45);
  background: rgba(125,216,143,.08);
}

.footage-card--bad {
  border-color: rgba(229,115,115,.45);
  background: rgba(229,115,115,.08);
}

.footage-card--neutral {
  background: var(--card);
  border-color: var(--line);
}

.footage-reasons {
  display: grid;
  gap: 4px;
}

.footage-reasons p {
  margin: 0;
}

.text-line--locked {
  border-left-color: rgba(232,194,104,.28);
}

.text-line--locked .muted {
  margin-top: 8px;
  font-size: 15px;
}

.text-line-display {
  justify-content: space-between;
}

.text-line-display p {
  flex: 1 1 320px;
}

.text-line-edit {
  display: grid;
  gap: 12px;
}

.text-line-edit .btn-pill {
  justify-self: start;
}

.text-group + .text-group,
.text-duration {
  margin-top: 22px;
}

.text-profile-choice {
  display: grid;
  gap: 14px;
  max-width: 520px;
}

.text-profile-choice.hidden {
  display: none;
}

.text-profile-choice .btn-pill {
  justify-self: start;
}

.confirm-page {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.confirm-note {
  margin: 22px 0 0;
  color: var(--wait);
  font-weight: 650;
}

.confirm-plaque {
  justify-content: space-between;
  margin-top: 18px;
  border-color: rgba(125,216,143,.35);
  background: rgba(125,216,143,.08);
}

@media (max-width: 560px) {
  .wizard-stepper {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 6px;
  }

  .wizard-pill {
    flex: 0 0 auto;
  }

  .themes-toolbar {
    align-items: flex-start;
  }
}

/* Доска партии (Ф5): строки тем в колонке 768 px, панель помощника справа
   от 1200 px (правила .wizard-layout/.assistant-panel), ниже — под доской. */
.batch-board {
  max-width: var(--col);
}

.batch-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.batch-title {
  margin: 0;
  font-size: 22px;
}

.batch-rows {
  display: grid;
}

.batch-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.batch-light {
  font-size: 16px;
  line-height: 1.4;
}

.batch-light--grey { color: var(--mut); }
.batch-light--yellow { color: var(--wait); }
.batch-light--green { color: var(--ok); }
.batch-light--red { color: var(--bad); }

.batch-row-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  min-width: 0;
}

.batch-row-title {
  color: var(--txt);
  font-weight: 600;
  text-decoration: none;
}

.batch-row-reason {
  flex-basis: 100%;
  margin: 0;
  color: var(--mut);
  font-size: 14px;
}

.batch-strip {
  display: inline-flex;
  gap: 3px;
  padding-top: 5px;
}

.batch-strip--stuck {
  color: var(--bad);
  padding-top: 0;
}

.batch-cell {
  display: inline-block;
  width: 10px;
  height: 14px;
  background: rgba(255,255,255,.1);
  border-radius: 2px;
}

.batch-cell--on {
  background: var(--ok);
}

.batch-actions,
.batch-links,
.batch-policy,
.batch-answer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

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

.batch-question-head,
.batch-question-text,
.batch-after {
  margin: 0 0 10px;
}

.batch-question-text {
  font-size: 17px;
  line-height: 1.45;
}

.batch-own-words {
  flex: 1 1 160px;
  min-width: 0;
}

.batch-apply-all {
  display: block;
  margin-top: 12px;
}

.batch-journal {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.batch-table {
  width: 100%;
  max-width: var(--col);
  border-collapse: collapse;
  margin: 12px 0;
}

.batch-table th,
.batch-table td {
  padding: 8px 10px 8px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.batch-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.batch-total td {
  font-weight: 650;
}

.batch-draft {
  max-height: 320px;
  overflow: auto;
  font-size: 12px;
  white-space: pre-wrap;
}

@media (max-width: 560px) {
  .batch-row {
    grid-template-columns: 20px minmax(0, 1fr);
  }

  .batch-strip {
    grid-column: 2;
  }
}

.insert-card {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.insert-sprites {
  margin: 12px 0 0;
  color: var(--mut);
  font-size: 14px;
}

.insert-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
}

.insert-preview img,
.insert-preview video {
  max-width: 180px;
  height: auto;
  border-radius: 6px;
  background: rgba(255,255,255,.06);
}

.insert-label,
.insert-number,
.insert-fit,
.insert-coverage-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin: 4px 0;
}

.insert-number code,
.insert-coverage-row code {
  color: var(--mut);
  font-variant-numeric: tabular-nums;
}

.insert-number .muted,
.insert-coverage {
  color: var(--mut);
  font-size: 14px;
}

.insert-coverage {
  margin-top: 12px;
}
