:root {
  color-scheme: dark;
  --bg: #0b0f10;
  --surface: #14191a;
  --surface-soft: #1c2224;
  --surface-sunken: #0e1213;
  --ink: #f2f4f3;
  --muted: #9aa5a3;
  --text-muted: #6d7674;
  --text-disabled: #4a5150;
  --line: #23292b;
  --line-strong: #3a4042;
  --accent: #ef7d4f;
  --accent-strong: #d9663a;
  --accent-soft: #3a231b;
  --accent-text-on-soft: #f0997b;
  --danger: #e5605a;
  --danger-strong: #c94842;
  --danger-soft: #3a1d1c;
  --danger-border: #6b302d;
  --ok: #4caf7d;
  --ok-soft: #1e3324;
  --ok-border: #2c5d3c;
  --warn: #f2a93b;
  --warn-soft: #3a2d14;
  --warn-border: #5c4a1f;
  --font-sans: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-video: 10px;
  --radius-pill: 999px;
  --focus-ring: 0 0 0 3px rgba(239, 125, 79, 0.22);
}

@font-face {
  font-family: "Inter Reel";
  font-style: normal;
  font-weight: 100 900;
  src: url("/renderer-assets/fonts/Inter-Variable.ttf") format("truetype");
}

.sr-only {
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.eyebrow {
  color: var(--accent-text-on-soft);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.preview-editor-head {
  margin-bottom: 12px;
}

.preview-editor-status {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.preview-editor-deck {
  margin-bottom: 18px;
}

.preview-editor-card {
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  padding: 18px;
}

.preview-editor-card[hidden] {
  display: none;
}

.preview-editor-main {
  display: grid;
  gap: 14px;
  justify-items: center;
}

.preview-video-stage {
  aspect-ratio: 9 / 16;
  background: #050707;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius-video);
  max-height: 620px;
  overflow: hidden;
  position: relative;
  width: min(100%, 348px);
}

.preview-video-overlay,
.preview-static-image {
  display: block;
  height: 100%;
  inset: 0;
  object-fit: contain;
  position: absolute;
  width: 100%;
}

.preview-video-overlay {
  pointer-events: none;
  z-index: 2;
}

.preview-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--muted);
}

.preview-editor-caption {
  display: grid;
  gap: 8px;
  max-width: 560px;
  width: 100%;
}

.preview-editor-caption strong {
  line-height: 1.45;
}

.preview-editor-caption small {
  color: var(--muted);
}

.preview-editor-secondary-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
}

.preview-editor-secondary-actions button {
  width: 100%;
}

.preview-style-panel {
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 12px;
}

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

.preview-style-form[hidden],
.preview-editor-secondary-actions form[hidden],
.preview-style-unavailable[hidden] {
  display: none;
}

.preview-style-column {
  border: 0;
  margin: 0;
  min-width: 0;
  padding: 0;
}

.preview-style-column legend {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 9px;
  text-transform: uppercase;
}

.preview-font-options,
.preview-color-options {
  display: grid;
  gap: 9px;
  width: 100%;
}

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

.preview-color-options {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.preview-font-option,
.preview-color-option {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  height: 48px;
  justify-content: center;
  position: relative;
  transition: border-color 120ms ease-out, background-color 120ms ease-out;
}

.preview-font-option:hover,
.preview-color-option:hover {
  border-color: var(--line-strong);
}

.preview-font-option:has(input:checked),
.preview-color-option:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.preview-font-option:has(input:focus-visible),
.preview-color-option:has(input:focus-visible) {
  box-shadow: var(--focus-ring);
}

.preview-font-option input,
.preview-color-option input {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.preview-font-option {
  align-items: center;
  gap: 12px;
  height: auto;
  justify-content: flex-start;
  min-height: 72px;
  padding: 10px;
}

.preview-font-sample {
  color: var(--ink);
  flex: 0 0 auto;
  font-size: 24px;
  line-height: 1;
  padding-top: 2px;
}

.preview-font-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.preview-font-copy strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.25;
}

.preview-font-copy small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.preview-font-scale-column {
  grid-column: 1 / -1;
}

.preview-font-scale-column legend output {
  color: var(--ink);
  margin-left: 4px;
}

.preview-font-scale {
  accent-color: var(--accent);
  cursor: pointer;
  margin: 4px 0 0;
  width: 100%;
}

.preview-color-option > span:first-of-type {
  background: var(--swatch-color);
  border: 2px solid var(--swatch-outline);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line-strong);
  height: 22px;
  width: 22px;
}

.preview-style-scope {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
  grid-column: 1 / -1;
  padding-top: 12px;
}

.preview-style-scope small,
.preview-style-unavailable {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.preview-editor-footer {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  width: 100%;
}

.preview-editor-navigation {
  display: flex;
  gap: 8px;
}

@media (max-width: 480px) {
  .preview-font-options {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  .preview-editor-card {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .preview-editor-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .preview-editor-footer form,
  .preview-editor-footer form button {
    width: 100%;
  }
}

@font-face {
  font-family: "Poppins Reel";
  font-style: normal;
  font-weight: 700;
  src: url("/renderer-assets/fonts/Poppins-Bold.ttf") format("truetype");
}

@font-face {
  font-family: "Oswald Reel";
  font-style: normal;
  font-weight: 200 700;
  src: url("/renderer-assets/fonts/Oswald-Variable.ttf") format("truetype");
}

@font-face {
  font-family: "Playfair Reel";
  font-style: normal;
  font-weight: 400 900;
  src: url("/renderer-assets/fonts/PlayfairDisplay-Variable.ttf") format("truetype");
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.55 var(--font-sans);
  margin: 0;
  min-height: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 120ms ease-out, background-color 120ms ease-out, border-color 120ms ease-out;
}

a:hover {
  color: var(--accent-text-on-soft);
}

.mono,
code {
  font-family: var(--font-mono);
}

code {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  padding: 2px 5px;
}

.topbar {
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 56px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-left {
  align-items: center;
  display: flex;
  gap: 18px;
}

.brand {
  align-items: center;
  color: var(--ink);
  display: inline-flex;
  font-size: 15px;
  font-weight: 600;
  gap: 10px;
}

.brand:hover {
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  background: var(--accent);
  border-radius: 6px;
  display: inline-block;
  height: 20px;
  position: relative;
  width: 20px;
}

.brand-mark::before {
  border-bottom: 2.2px solid #241503;
  border-left: 2.2px solid #241503;
  content: "";
  height: 5px;
  left: 5px;
  position: absolute;
  top: 6px;
  transform: rotate(-45deg);
  width: 10px;
}

.brand-mark::after {
  content: none;
}

.nav,
.actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.nav form,
.actions form {
  display: inline;
}

.topnav {
  color: var(--muted);
  font-size: 13px;
}

.system-dot {
  background: var(--ok);
  border-radius: var(--radius-pill);
  height: 8px;
  width: 8px;
}

.user-chip {
  color: var(--ink);
  font-weight: 500;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-frame {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: calc(100vh - 56px);
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  padding: 26px 16px;
  position: sticky;
  top: 56px;
}

.workspace-switcher {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 10px;
  margin: -2px 0 10px;
  padding: 0 0 14px;
}

.workspace-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  padding-left: 12px;
}

.workspace-menu {
  min-width: 0;
}

.workspace-menu summary {
  align-items: center;
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 38px;
  padding: 8px 10px;
}

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

.workspace-menu summary span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-options {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: grid;
  gap: 4px;
  margin-top: 6px;
  max-height: 260px;
  overflow-y: auto;
  padding: 6px;
}

.workspace-options form {
  display: block;
}

.workspace-option {
  background: transparent;
  color: var(--muted);
  display: grid;
  gap: 2px;
  justify-items: start;
  min-height: 0;
  padding: 8px;
  text-align: left;
  width: 100%;
}

.workspace-option:hover,
.workspace-option.active {
  background: var(--surface-soft);
  color: var(--ink);
}

.workspace-option small,
.workspace-empty {
  color: var(--text-muted);
  font-size: 11px;
}

.workspace-option small {
  font-family: var(--font-mono);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-empty {
  padding: 8px;
}

.sidebar a,
.sidebar .link-button {
  align-items: center;
  border-radius: var(--radius-md);
  color: var(--muted);
  display: flex;
  font-weight: 500;
  gap: 10px;
  justify-content: flex-start;
  min-height: 38px;
  padding: 9px 11px;
  width: 100%;
}

.sidebar a:hover,
.sidebar .link-button:hover {
  background: var(--surface-soft);
  color: var(--ink);
  text-decoration: none;
}

.sidebar a.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.workspace-manage {
  border: 1px solid var(--line);
}

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

.shell {
  margin: 0 auto;
  max-width: 1280px;
  padding: 24px 28px 48px;
  width: 100%;
}

.auth-shell {
  max-width: 520px;
}

.auth-shell.register-auth-shell {
  max-width: 1180px;
}

.workspace-shell {
  margin-left: 0;
  margin-right: 0;
  max-width: none;
  padding: 36px 32px 48px;
}

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

h1,
h2,
h3,
p {
  letter-spacing: 0;
  margin: 0;
}

h1 {
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
}

h2 {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
}

h3 {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
}

.page-head p,
.modal-head p,
.helper,
.quota {
  color: var(--muted);
}

.panel-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.auth-panel,
.status-panel,
.panel,
.render-modal,
.bento-tile,
.video-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  min-width: 0;
}

.auth-panel,
.status-panel,
.panel,
.render-modal {
  padding: 16px;
}

.auth-panel,
.status-panel {
  margin: 64px auto;
}

.status-panel {
  display: grid;
  gap: 16px;
}

.pending-confirmation-copy {
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
}

.pending-confirmation-copy p {
  color: var(--muted);
  max-width: 420px;
}

.resend-verification-form {
  display: flex;
  justify-content: center;
}

.section-panel {
  margin-top: 12px;
}

.grid-two {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  margin-bottom: 12px;
}

.grid-two > * {
  min-width: 0;
}

.bento-grid,
.metric-strip {
  display: grid;
  gap: 12px;
  grid-template-columns: 1.4fr 1fr 1fr;
  margin-bottom: 12px;
}

.bento-tile,
.metric {
  color: var(--ink);
  display: grid;
  gap: 4px;
  padding: 16px;
}

a.bento-tile:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  text-decoration: none;
}

.bento-tile span,
.metric span,
.quota {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.bento-tile strong,
.metric strong {
  color: var(--ink);
  font-size: 32px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  line-height: 1.2;
}

.bento-tile small,
.metric small {
  color: var(--muted);
  font-size: 12px;
}

.bento-tile.hero {
  min-height: 142px;
}

.tile-action {
  align-self: end;
  font-weight: 500;
  margin-top: 8px;
}

.billing-summary-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1.2fr 1fr 1fr;
  margin-bottom: 12px;
}

.billing-status-panel p,
.billing-current-plan span,
.billing-plan-card p {
  color: var(--muted);
}

.billing-current-plan {
  display: grid;
  gap: 6px;
}

.billing-current-plan strong {
  color: var(--ink);
  font-size: 24px;
  font-weight: 650;
}

.billing-facts div {
  grid-template-columns: 170px minmax(0, 1fr);
}

.billing-facts dd {
  overflow-wrap: anywhere;
}

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

.billing-plan-card {
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px;
}

.billing-plan-card.active {
  border-color: var(--accent);
}

.billing-plan-card h3 {
  font-size: 18px;
}

.billing-plan-card strong {
  color: var(--ink);
  font-size: 26px;
  font-weight: 650;
}

.billing-plan-card form {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.billing-cancel-form {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 14px;
}

.form-stack {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.auth-secondary-action {
  color: var(--muted);
  font-size: 13px;
  margin-top: 14px;
  text-align: center;
}

.register-shell {
  display: grid;
  gap: 16px;
  margin: 32px auto 56px;
  max-width: 1180px;
}

.register-head {
  display: grid;
  gap: 8px;
  max-width: 760px;
}

.register-head h1 {
  font-size: clamp(32px, 5vw, 46px);
  line-height: 1.05;
}

.register-head p,
.register-section small {
  color: var(--muted);
}

.register-form {
  display: grid;
  gap: 14px;
}

.register-section {
  display: grid;
  gap: 14px;
}

.register-section:has(.register-plan-grid) {
  padding: 20px;
}

.register-plan-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.register-plan-card {
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--muted);
  cursor: pointer;
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 16px;
}

.register-plan-card:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.register-plan-card input {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.register-plan-card strong {
  color: var(--ink);
  font-size: 28px;
  font-weight: 650;
  white-space: nowrap;
}

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

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

.payment-method-grid.compact {
  gap: 8px;
}

.payment-method-card {
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--muted);
  cursor: pointer;
  display: grid;
  gap: 4px;
  grid-template-columns: auto minmax(0, 1fr);
  min-width: 0;
  padding: 11px;
}

.payment-method-card:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.payment-method-card input {
  margin: 4px 2px 0 0;
}

.payment-method-card span,
.payment-method-card small {
  min-width: 0;
}

.payment-method-card span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}

.payment-method-card small {
  color: var(--muted);
  font-size: 11px;
  grid-column: 2;
}

.password-feedback {
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: grid;
  gap: 10px;
  padding: 12px;
}

.password-requirement-list {
  display: grid;
  gap: 7px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.password-requirement-list li,
.password-match-message {
  align-items: center;
  color: var(--muted);
  display: flex;
  gap: 8px;
  margin: 0;
}

.password-requirement-list li::before,
.password-match-message::before {
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  content: "";
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 10px;
  height: 16px;
  justify-content: center;
  line-height: 1;
  width: 16px;
}

.password-requirement-list li.met,
.password-match-message.met {
  color: var(--ok);
}

.password-requirement-list li.met::before,
.password-match-message.met::before {
  background: var(--ok-soft);
  border-color: var(--ok-border);
  color: var(--ok);
  content: "";
}

.password-requirement-list li.unmet,
.password-match-message.unmet {
  color: var(--danger);
}

.password-requirement-list li.unmet::before,
.password-match-message.unmet::before {
  background: var(--danger-soft);
  border-color: var(--danger-border);
}

.register-submit-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.register-submit-row button {
  min-height: 46px;
  padding-inline: 20px;
}

.field-error {
  color: var(--danger);
}

label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 500;
  gap: 7px;
}

input[type="email"],
input[type="password"],
input[type="tel"],
input[type="text"],
input[type="file"],
textarea,
select {
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--ink);
  font: inherit;
  min-height: 40px;
  padding: 9px 10px;
  transition: border-color 120ms ease-out, box-shadow 120ms ease-out;
}

.password-input-wrap {
  display: grid;
  position: relative;
}

.password-input-wrap input {
  padding-right: 46px;
  width: 100%;
}

.password-toggle {
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--muted);
  min-height: 32px;
  padding: 7px;
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
}

.password-toggle:hover,
.password-toggle[aria-pressed="true"] {
  background: var(--surface-soft);
  color: var(--ink);
}

.password-toggle:focus-visible {
  box-shadow: var(--focus-ring);
  outline: 0;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

input[type="email"]:focus,
input[type="password"]:focus,
input[type="tel"]:focus,
input[type="text"]:focus,
input[type="file"]:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
  outline: 0;
}

textarea {
  resize: vertical;
}

select[multiple] {
  min-height: 260px;
}

button,
.button-link {
  align-items: center;
  background: var(--accent);
  border: 0;
  border-radius: var(--radius-md);
  color: #241503;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 500;
  justify-content: center;
  min-height: 38px;
  padding: 9px 14px;
  transition: background-color 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out, opacity 120ms ease-out;
}

button:hover,
.button-link:hover {
  background: var(--accent-strong);
  color: #241503;
  text-decoration: none;
}

button:focus-visible,
.button-link:focus-visible,
a:focus-visible {
  box-shadow: var(--focus-ring);
  outline: 0;
}

button:disabled,
input:disabled {
  color: var(--text-disabled);
  cursor: not-allowed;
  opacity: 0.5;
}

button.danger {
  background: var(--danger);
  color: #2a0d0b;
}

button.danger:hover {
  background: var(--danger-strong);
  color: #2a0d0b;
}

button.secondary,
.secondary-link {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ink);
}

button.secondary:hover,
.secondary-link:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.link-button {
  background: transparent;
  color: var(--accent);
  min-height: auto;
  padding: 0;
}

.link-button:hover {
  background: transparent;
  color: var(--accent-text-on-soft);
  text-decoration: none;
}

.workspace-page-head {
  margin-bottom: 48px;
  max-width: 1144px;
}

.workspace-new-button {
  gap: 10px;
  min-height: 42px;
  padding: 10px 18px;
}

.button-icon {
  fill: none;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
  width: 18px;
}

.workspace-card-grid {
  align-items: stretch;
  display: grid;
  gap: 20px 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 1144px;
}

.workspace-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: grid;
  gap: 13px;
  min-height: 258px;
  min-width: 0;
  padding: 18px;
}

.workspace-card.active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.workspace-card:has(.workspace-edit-drawer[open]) {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  grid-column: 1 / -1;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  min-height: 336px;
}

.workspace-card:has(.workspace-edit-drawer[open]) .workspace-card-head,
.workspace-card:has(.workspace-edit-drawer[open]) h2,
.workspace-card:has(.workspace-edit-drawer[open]) .workspace-plan-chip,
.workspace-card:has(.workspace-edit-drawer[open]) .workspace-industry-chip,
.workspace-card:has(.workspace-edit-drawer[open]) .workspace-context-preview,
.workspace-card:has(.workspace-edit-drawer[open]) .workspace-card-meta {
  grid-column: 1;
}

.workspace-card-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.workspace-kicker {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.workspace-current-pill {
  background: var(--accent-soft);
  border-radius: var(--radius-pill);
  color: var(--accent-text-on-soft);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  padding: 4px 12px;
}

.workspace-card h2 {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.25;
  margin-top: -2px;
}

.workspace-plan-chip {
  align-items: center;
  background: var(--surface-soft);
  border-radius: var(--radius-pill);
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  font-weight: 500;
  gap: 9px;
  justify-self: start;
  line-height: 1.3;
  padding: 5px 14px;
}

.workspace-plan-chip span,
.workspace-active-state span {
  background: var(--accent);
  border-radius: var(--radius-pill);
  flex: 0 0 auto;
  height: 7px;
  width: 7px;
}

.workspace-industry-chip {
  background: var(--accent-soft);
  border-radius: var(--radius-pill);
  color: var(--accent-text-on-soft);
  font-size: 12px;
  font-weight: 500;
  justify-self: start;
  line-height: 1.3;
  padding: 5px 14px;
}

.workspace-context-preview {
  color: var(--muted);
  display: -webkit-box;
  font-size: 13px;
  line-height: 1.45;
  min-height: 38px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.workspace-card-meta {
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  font-size: 12px;
  gap: 12px;
  justify-content: space-between;
  padding-top: 13px;
}

.workspace-card-meta code {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-size: 11px;
  padding: 0;
}

.workspace-card-footer {
  align-items: center;
  display: grid;
  gap: 14px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  margin-top: auto;
  min-height: 34px;
}

.workspace-card:has(.workspace-edit-drawer[open]) .workspace-card-footer {
  display: contents;
}

.workspace-edit-drawer {
  display: contents;
}

.workspace-edit-drawer summary {
  color: var(--accent);
  cursor: pointer;
  font-weight: 500;
  list-style: none;
}

.workspace-edit-drawer summary::-webkit-details-marker {
  display: none;
}

.workspace-edit-drawer summary:hover {
  color: var(--accent-text-on-soft);
}

.workspace-card:has(.workspace-edit-drawer[open]) .workspace-edit-drawer summary {
  align-self: end;
  grid-column: 1;
  grid-row: 6;
}

.workspace-edit-form {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  margin-top: 4px;
  padding-top: 14px;
}

.workspace-card:has(.workspace-edit-drawer[open]) .workspace-edit-form {
  align-self: stretch;
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  gap: 16px;
  grid-column: 2;
  grid-row: 1 / span 6;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
  margin: 0;
  padding: 18px;
}

.workspace-edit-form .workspace-context-field,
.workspace-edit-form .actions {
  grid-column: 1 / -1;
}

.workspace-context-field textarea {
  min-height: 108px;
}

.workspace-card:has(.workspace-edit-drawer[open]) .workspace-context-field textarea {
  min-height: 172px;
}

.workspace-card:has(.workspace-edit-drawer[open]) .workspace-edit-form .actions {
  align-self: end;
  justify-content: flex-end;
}

.workspace-enter-form {
  grid-column: 3;
}

.workspace-card:has(.workspace-edit-drawer[open]) .workspace-enter-form {
  align-self: end;
  grid-column: 1;
  grid-row: 6;
  justify-self: end;
}

.workspace-enter-form button {
  min-height: 34px;
  padding: 7px 14px;
  white-space: nowrap;
}

.workspace-active-state {
  align-items: center;
  color: var(--ok);
  display: inline-flex;
  font-weight: 500;
  gap: 9px;
  grid-column: 3;
  white-space: nowrap;
}

.workspace-card:has(.workspace-edit-drawer[open]) .workspace-active-state {
  align-self: end;
  grid-column: 1;
  grid-row: 6;
  justify-self: end;
}

.workspace-active-state span {
  background: var(--ok);
}

.workspace-new-card {
  background: transparent;
  border: 1.5px dashed var(--line-strong);
  padding: 0;
}

.workspace-new-card[open] {
  background: var(--surface);
  border-style: solid;
}

.workspace-new-card summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: center;
  list-style: none;
  min-height: 256px;
  padding: 24px;
  text-align: center;
}

.workspace-new-card summary::-webkit-details-marker {
  display: none;
}

.workspace-new-card summary strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
}

.workspace-new-card summary span:last-child {
  color: var(--muted);
  font-size: 12px;
}

.workspace-new-plus {
  align-items: center;
  background: var(--accent-soft);
  border-radius: var(--radius-pill);
  color: var(--accent);
  display: inline-flex;
  height: 48px;
  justify-content: center;
  width: 48px;
}

.workspace-new-plus svg {
  fill: none;
  height: 24px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2.4;
  width: 24px;
}

.workspace-new-form {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 14px;
  padding: 18px;
}

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

.plan-seed {
  align-items: flex-start;
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 12px;
}

.plan-seed:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.plan-seed input {
  margin-top: 3px;
}

.plan-seed span {
  display: grid;
  gap: 2px;
}

.plan-seed small {
  color: var(--muted);
  font-size: 12px;
}

.upload-row {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 16px;
}

.upload-zone {
  background: var(--surface-sunken);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.upload-copy {
  display: grid;
  gap: 2px;
  grid-column: 1 / -1;
}

.upload-copy strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
}

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

.upload-feedback {
  color: var(--muted);
  font-size: 12px;
  grid-column: 1 / -1;
  margin: -4px 0 0;
}

.upload-feedback.error {
  color: var(--danger);
}

.upload-file-list {
  display: grid;
  gap: 8px;
  grid-column: 1 / -1;
  list-style: none;
  margin: 0;
  padding: 0;
}

.upload-file-item {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 8px 10px;
}

.upload-file-item.blocked {
  background: var(--danger-soft);
  border-color: var(--danger-border);
}

.upload-file-item.needs-trim {
  background: var(--warn-soft);
  border-color: var(--warn-border);
}

.upload-file-name {
  color: var(--ink);
  font-size: 12px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-file-meta {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.upload-file-item.blocked .upload-file-meta {
  color: var(--danger);
}

.upload-file-item.needs-trim .upload-file-meta {
  color: var(--warn);
}

.upload-file-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.upload-file-trim,
.upload-file-remove {
  min-height: 30px;
  padding: 5px 9px;
}

.upload-progress-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: grid;
  gap: 10px;
  grid-column: 1 / -1;
  padding: 12px;
}

.upload-progress-panel[hidden] {
  display: none;
}

.upload-progress-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.upload-progress-head strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}

.upload-progress-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
}

.upload-progress-track,
.upload-progress-meter {
  background: var(--surface-sunken);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.upload-progress-track {
  height: 8px;
}

.upload-progress-track div,
.upload-progress-meter span {
  background: var(--accent);
  display: block;
  height: 100%;
  transition: width 180ms ease-out;
  width: 0;
}

.upload-progress-list {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.upload-progress-item {
  align-items: center;
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: grid;
  gap: 10px;
  grid-template-columns: 28px minmax(0, 1fr);
  padding: 9px 10px;
}

.upload-progress-item.done {
  border-color: var(--ok-border);
}

.upload-progress-item.error {
  background: var(--danger-soft);
  border-color: var(--danger-border);
}

.upload-progress-order {
  align-items: center;
  background: var(--surface-soft);
  border-radius: var(--radius-pill);
  color: var(--muted);
  display: inline-flex;
  font-size: 11px;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.upload-progress-item.done .upload-progress-order {
  background: var(--ok-soft);
  color: var(--ok);
}

.upload-progress-item.error .upload-progress-order {
  background: var(--danger-soft);
  color: var(--danger);
}

.upload-progress-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.upload-progress-copy strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-progress-copy small {
  color: var(--muted);
  font-size: 11px;
}

.upload-progress-item.done .upload-progress-copy small {
  color: var(--ok);
}

.upload-progress-item.error .upload-progress-copy small {
  color: var(--danger);
}

.upload-progress-meter {
  height: 5px;
}

.processing-upload-grid {
  display: grid;
  gap: 10px;
  grid-column: 1 / -1;
  margin-bottom: 16px;
}

.processing-upload-card {
  align-items: center;
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: grid;
  gap: 12px;
  grid-template-columns: 28px minmax(0, 1fr);
  padding: 11px 12px;
}

.processing-spinner {
  border: 2px solid rgba(239, 125, 79, 0.22);
  border-radius: var(--radius-pill);
  border-top-color: var(--accent);
  height: 22px;
  width: 22px;
  animation: spin 850ms linear infinite;
}

.processing-upload-card strong,
.processing-upload-card small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.processing-upload-card strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
}

.processing-upload-card small {
  color: var(--muted);
  font-size: 11px;
}

.bulk-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

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

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

th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

tbody tr:hover {
  background: var(--surface-soft);
}

.admin-panel {
  display: grid;
  gap: 14px;
}

.admin-search {
  max-width: 420px;
}

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

.admin-user-card {
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.admin-user-card[hidden] {
  display: none;
}

.admin-user-summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  list-style: none;
  padding: 14px;
}

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

.admin-user-summary:hover {
  background: var(--surface-soft);
}

.admin-user-summary strong {
  color: var(--ink);
  display: block;
}

.admin-user-summary small,
.admin-plan-form small {
  color: var(--muted);
  display: block;
  margin-top: 3px;
}

.admin-user-meta,
.admin-account-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.admin-user-meta span:not(.badge) {
  color: var(--muted);
  font-size: 12px;
}

.admin-user-body {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  padding: 14px;
}

.admin-workspaces {
  display: grid;
  gap: 10px;
}

.admin-workspace-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: grid;
  gap: 12px;
  padding: 12px;
}

.admin-workspace-head {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.admin-workspace-head strong {
  color: var(--ink);
  display: block;
}

.admin-billing-facts {
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px;
}

.admin-billing-facts div {
  grid-template-columns: 120px minmax(0, 1fr);
}

.admin-billing-facts dd {
  overflow-wrap: anywhere;
}

.admin-plan-form {
  align-items: end;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(180px, 1.2fr) minmax(150px, 0.8fr) minmax(180px, 1fr) auto;
  padding-top: 10px;
}

.admin-billing-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.base-table th:first-child,
.base-table td:first-child {
  width: 42px;
}

.base-library-table th:nth-child(2),
.base-library-table td:nth-child(2) {
  width: 138px;
}

.base-library-table th:nth-child(4),
.base-library-table td:nth-child(4) {
  width: 92px;
}

.base-table th:last-child,
.base-table td:last-child {
  width: 72px;
}

.panel-foot {
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: center;
  margin: 12px -16px -16px;
  padding: 12px 16px;
}

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

.library-grid {
  align-items: start;
}

.video-card {
  overflow: hidden;
}

.video-card:hover {
  border-color: var(--line-strong);
}

.video-card-media {
  aspect-ratio: 9 / 16;
  background: var(--surface-soft);
  display: block;
  overflow: hidden;
  position: relative;
}

.video-card-media video,
.video-thumb,
.list-thumb video {
  background: var(--surface-soft);
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.play-mark {
  align-items: center;
  background: rgba(11, 15, 16, 0.62);
  border: 1px solid rgba(242, 244, 243, 0.18);
  border-radius: var(--radius-pill);
  color: var(--ink);
  display: flex;
  height: 44px;
  justify-content: center;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
}

.play-mark::before {
  border-bottom: 9px solid transparent;
  border-left: 14px solid currentColor;
  border-top: 9px solid transparent;
  content: "";
  margin-left: 3px;
}

.video-card-body {
  display: grid;
  gap: 6px;
  padding: 12px;
}

.video-card-body h3 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-card-body p,
.video-card-actions {
  color: var(--muted);
  font-size: 12px;
}

.video-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.inline-delete-form {
  display: inline;
  margin: 0;
}

.video-card-actions .link-button {
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  min-height: auto;
  padding: 0;
}

.video-card-actions .link-button:hover {
  text-decoration: underline;
}

.danger-link {
  color: var(--danger);
}

.video-more {
  align-items: center;
  aspect-ratio: 9 / 16;
  background: var(--surface);
  border-style: dashed;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 16px;
  text-align: center;
}

.video-more:hover {
  color: var(--ink);
  text-decoration: none;
}

.video-more strong {
  color: var(--ink);
  font-size: 32px;
  font-variant-numeric: tabular-nums;
}

.video-thumb {
  aspect-ratio: 9 / 16;
  border: 1px solid var(--line);
  border-radius: var(--radius-video);
  max-width: 116px;
}

.thumb-link {
  align-items: start;
  display: inline-grid;
  gap: 6px;
  justify-items: start;
}

.thumb-link:hover {
  text-decoration: none;
}

.list-stack {
  display: grid;
}

.list-row {
  align-items: center;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: 44px minmax(0, 1fr) auto auto;
  padding: 12px 0;
}

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

.list-row:last-child {
  padding-bottom: 0;
}

.list-row:hover {
  background: var(--surface-soft);
  margin-left: -8px;
  margin-right: -8px;
  padding-left: 8px;
  padding-right: 8px;
}

.list-thumb {
  aspect-ratio: 9 / 16;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.list-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.list-main strong,
.list-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-main strong {
  color: var(--ink);
  font-weight: 500;
}

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

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

.progress-inline {
  align-items: center;
  display: grid;
  gap: 7px;
  grid-template-columns: 38px 72px;
  max-width: 120px;
}

.mini-progress,
.progress-track,
.quota-track {
  background: var(--surface-soft);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.mini-progress {
  display: block;
  height: 6px;
}

.mini-progress span,
.progress-bar {
  background: var(--accent);
  display: block;
  height: 100%;
}

.progress-track {
  height: 14px;
  margin-top: 8px;
}

.progress-bar {
  transition: width 240ms ease;
}

.quota-track {
  height: 8px;
  margin-bottom: 16px;
}

.quota-bar {
  background: var(--ok);
  height: 100%;
}

.badge {
  border-radius: var(--radius-pill);
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  padding: 4px 10px;
  white-space: nowrap;
}

.badge.success,
.badge.approved,
.badge.active,
.badge.manual {
  background: var(--ok-soft);
  color: var(--ok);
}

.badge.running,
.badge.queued,
.badge.pending,
.badge.incomplete,
.badge.grace_period {
  background: var(--warn-soft);
  color: var(--warn);
}

.badge.failed,
.badge.rejected,
.badge.disabled,
.badge.past_due,
.badge.blocked,
.badge.canceled {
  background: var(--danger-soft);
  color: var(--danger);
}

.alert {
  background: var(--danger-soft);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-md);
  color: var(--ink);
  margin: 0 0 16px;
  padding: 11px 13px;
}

.success {
  background: var(--ok-soft);
  border: 1px solid var(--ok-border);
  border-radius: var(--radius-md);
  color: var(--ink);
  margin: 0 0 16px;
  padding: 11px 13px;
}

.upload-notice {
  background: var(--ok-soft);
  border-color: var(--ok-border);
}

.empty,
.empty-state {
  color: var(--muted);
  text-align: center;
}

.empty {
  padding: 24px 12px;
}

.empty-state {
  align-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  display: grid;
  gap: 8px;
  min-height: 160px;
  padding: 24px;
}

.empty-state strong {
  color: var(--muted);
  font-weight: 500;
}

.facts {
  display: grid;
  gap: 10px;
}

.facts div {
  display: grid;
  grid-template-columns: 100px 1fr;
}

.facts dt {
  color: var(--muted);
  font-weight: 500;
}

.facts dd {
  margin: 0;
}

.progress-meta {
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.render-modal {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.32);
  margin: 0 auto;
  max-width: none;
  width: 100%;
}

.modal-head {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.production-quota {
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: grid;
  gap: 3px;
  min-width: 190px;
  padding: 10px 12px;
}

.production-quota span,
.production-quota small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.production-quota strong {
  color: var(--ink);
  font-size: 22px;
  font-weight: 650;
  line-height: 1;
}

.render-mode-tabs {
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 22px;
  padding: 8px;
}

.render-mode-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  gap: 12px;
  min-height: 50px;
  min-width: 0;
  padding: 12px 16px;
}

.render-mode-tab:hover {
  background: rgba(239, 125, 79, 0.08);
  border-color: var(--line-strong);
  color: var(--accent-text-on-soft);
}

.render-mode-tab.active {
  background: var(--accent-soft);
  border-color: rgba(239, 125, 79, 0.42);
  color: var(--accent);
}

.render-mode-tab .button-icon {
  height: 20px;
  width: 20px;
}

.render-workflow {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.render-mode-panel,
.render-options-column {
  min-width: 0;
}

.render-mode-panel[hidden] {
  display: none;
}

.render-panel-copy {
  display: grid;
  gap: 10px;
}

.render-panel-copy {
  gap: 4px;
}

.render-panel-copy p {
  color: var(--muted);
  font-size: 12px;
}

.ai-context-note {
  align-items: center;
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 12px;
}

.ai-context-note p {
  color: var(--muted);
}

.ai-context-note.missing {
  background: var(--danger-soft);
  border-color: var(--danger-border);
}

.ai-context-note.missing p {
  color: var(--ink);
}

.ai-context-note .button-link {
  min-height: 34px;
  padding: 7px 12px;
  white-space: nowrap;
}

.ai-generate-actions {
  justify-content: flex-end;
}

.render-context-column .form-stack,
.render-options-form {
  margin-top: 0;
}

.render-context-column textarea {
  min-height: 260px;
  resize: vertical;
}

.render-options-column {
  display: grid;
  gap: 12px;
  margin-top: 0;
}

.render-column-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.render-head-actions,
.render-head-actions form,
.option-actions {
  align-items: center;
  display: flex;
  gap: 8px;
}

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

.danger-secondary {
  border-color: var(--danger-border);
  color: var(--danger);
}

.render-options-empty {
  margin-top: 0;
}

.idea-playbook {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  gap: 3px;
  margin-top: 6px;
}

.idea-playbook p {
  line-height: 1.4;
}

.idea-playbook strong {
  color: var(--ink);
  font-weight: 500;
}

.ideas-stage {
  align-items: center;
  background: var(--surface-sunken);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  display: grid;
  min-height: 180px;
}

.ideas-loading {
  align-items: center;
  background: var(--warn-soft);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius-pill);
  color: var(--warn);
  display: inline-flex;
  font-size: 12px;
  font-weight: 500;
  gap: 8px;
  min-height: 34px;
  padding: 6px 12px;
  white-space: nowrap;
}

.ideas-loading[hidden] {
  display: none;
}

.loading-spinner {
  border: 2px solid rgba(242, 169, 59, 0.28);
  border-top-color: var(--warn);
  border-radius: var(--radius-pill);
  height: 16px;
  width: 16px;
  animation: spin 800ms linear infinite;
}

.render-options-column.is-generating .ideas-stage,
.render-options-column.is-generating .idea-deck {
  opacity: 0.58;
}

.idea-deck {
  align-items: stretch;
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: grid;
  min-height: 360px;
  padding: 14px;
}

.idea-card {
  align-self: stretch;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  display: grid;
  gap: 18px;
  grid-template-rows: auto minmax(132px, 1fr) auto;
  min-height: 330px;
  padding: 18px;
}

.idea-card[hidden] {
  display: none;
}

.idea-card-meta {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 11px;
  font-weight: 500;
  gap: 12px;
  justify-content: space-between;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.idea-card-text {
  align-self: center;
  color: var(--ink);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.idea-card-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.idea-card-actions button {
  gap: 8px;
  min-width: 0;
  padding-left: 10px;
  padding-right: 10px;
}

.select-secondary {
  border-color: var(--ok-border);
  color: var(--ok);
}

.select-secondary:hover {
  background: var(--ok-soft);
  color: var(--ok);
}

.deck-complete {
  align-self: center;
  color: var(--muted);
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
}

.deck-complete[hidden] {
  display: none;
}

.deck-complete strong {
  color: var(--ink);
  font-weight: 500;
}

.production-queue-block {
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: grid;
  gap: 12px;
  padding: 14px;
}

.production-queue-head {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.production-queue-head h3 {
  color: var(--ink);
}

.queue-head-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.queue-count {
  background: var(--surface-soft);
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  padding: 4px 10px;
  white-space: nowrap;
}

.quota-warning {
  background: rgba(239, 125, 79, 0.1);
  border: 1px solid rgba(239, 125, 79, 0.28);
  border-radius: var(--radius-md);
  color: var(--accent);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
  padding: 10px 12px;
}

.production-queue {
  display: grid;
  gap: 10px;
}

.queue-add-actions {
  justify-content: flex-start;
}

.queue-item {
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: grid;
  gap: 10px;
  padding: 12px;
}

.queue-item-meta {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.queue-item label {
  gap: 8px;
}

.queue-item textarea {
  min-height: 84px;
}

.queue-item-text {
  color: var(--ink);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

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

.queue-remove:hover {
  color: var(--danger);
}

.queue-clear {
  color: var(--muted);
  font-size: 12px;
}

.queue-clear:hover:not(:disabled) {
  color: var(--danger);
}

.render-final-actions {
  justify-content: flex-end;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.option-divider {
  border-top: 1px solid var(--line);
  margin: 20px 0;
}

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

.option-row {
  align-items: start;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.option-fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  margin: 0;
  padding: 12px;
}

.option-fieldset legend {
  color: var(--muted);
  font-weight: 500;
  padding: 0 6px;
}

.alternative-choices {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.option-choice {
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 10px;
}

.option-choice:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.option-choice input {
  margin-top: 3px;
}

.feedback-widget {
  bottom: 20px;
  display: grid;
  gap: 10px;
  justify-items: end;
  position: fixed;
  right: 20px;
  z-index: 90;
}

.feedback-trigger {
  border-radius: var(--radius-pill);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  height: 46px;
  padding: 0;
  width: 46px;
}

.feedback-trigger .button-icon {
  height: 21px;
  width: 21px;
}

.feedback-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.36);
  max-width: calc(100vw - 32px);
  padding: 12px;
  width: 320px;
}

.feedback-panel[hidden] {
  display: none;
}

.feedback-form {
  display: grid;
  gap: 10px;
}

.feedback-form textarea {
  min-height: 126px;
  resize: vertical;
}

.feedback-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: 38px minmax(0, 1fr);
}

.feedback-actions button {
  min-width: 0;
}

.feedback-status {
  color: var(--muted);
  font-size: 12px;
  min-height: 18px;
}

.modal-open {
  overflow: hidden;
}

.video-modal[hidden] {
  display: none;
}

.video-modal {
  inset: 0;
  position: fixed;
  z-index: 100;
}

.video-modal-backdrop {
  background: rgba(0, 0, 0, 0.72);
  inset: 0;
  position: absolute;
}

.video-modal-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.32);
  display: grid;
  gap: 12px;
  left: 50%;
  max-height: calc(100vh - 48px);
  max-width: min(92vw, 560px);
  padding: 14px;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 440px);
}

.video-modal-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.video-modal-head h2 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  min-height: 34px;
  padding: 7px 11px;
}

.video-modal-player {
  aspect-ratio: 9 / 16;
  background: #050809;
  border-radius: var(--radius-video);
  display: block;
  max-height: calc(100vh - 132px);
  object-fit: contain;
  outline: 0;
  width: 100%;
}

.trim-modal-panel {
  max-width: min(94vw, 620px);
  width: min(94vw, 520px);
}

.trim-modal-player {
  max-height: min(58vh, 560px);
}

.trim-timeline-shell {
  display: grid;
  gap: 8px;
}

.trim-timeline-meta {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  gap: 12px;
  justify-content: space-between;
}

.trim-timeline-meta span:first-child {
  color: var(--ink);
  font-weight: 500;
}

.trim-timeline {
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  height: 74px;
  overflow: hidden;
  position: relative;
}

.trim-timeline-frames {
  display: flex;
  flex-wrap: nowrap;
  height: 100%;
  overflow: hidden;
  width: 100%;
}

.trim-timeline-frames img,
.trim-frame-fallback {
  border-right: 1px solid rgba(0, 0, 0, 0.5);
  flex: 1 1 0;
  height: 100%;
  min-width: 0;
  object-fit: cover;
}

.trim-frame-fallback {
  background: linear-gradient(135deg, var(--surface-soft), var(--surface-sunken));
}

.trim-frame-loading {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  justify-content: center;
  width: 100%;
}

.trim-timeline {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.trim-selection-window {
  border: 3px solid var(--warn);
  border-left-width: 14px;
  border-right-width: 14px;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.45);
  box-sizing: border-box;
  cursor: grab;
  height: 100%;
  left: 0;
  min-width: 34px;
  position: absolute;
  top: 0;
  touch-action: none;
  width: 30%;
  z-index: 3;
}

.trim-selection-window.dragging {
  cursor: grabbing;
}

.trim-selection-window:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.trim-handle {
  border-left: 2.5px solid rgba(0, 0, 0, 0.72);
  border-radius: 2px;
  height: 16px;
  pointer-events: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.trim-handle-left {
  left: -9px;
}

.trim-handle-right {
  right: -6.5px;
}

.trim-playhead {
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.55);
  height: 100%;
  pointer-events: none;
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  width: 3px;
  z-index: 4;
}

.trim-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

@media (max-width: 980px) {
  .app-frame {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-bottom: 1px solid var(--line);
    border-right: 0;
    flex-direction: row;
    height: auto;
    overflow-x: auto;
    overflow-y: visible;
    padding: 10px 16px;
    position: static;
    top: auto;
  }

  .workspace-switcher {
    border-bottom: 0;
    border-right: 1px solid var(--line);
    flex: 0 0 260px;
    margin: 0 8px 0 0;
    padding: 0 12px 0 0;
  }

  .sidebar a,
  .sidebar .link-button {
    white-space: nowrap;
    width: auto;
  }

  .bento-grid,
  .metric-strip,
  .billing-summary-grid,
  .grid-two {
    grid-template-columns: 1fr;
  }

  .workspace-edit-form {
    grid-template-columns: 1fr;
  }

  .workspace-card:has(.workspace-edit-drawer[open]) {
    grid-template-columns: 1fr;
  }

  .workspace-card:has(.workspace-edit-drawer[open]) .workspace-edit-form {
    grid-column: 1;
    grid-row: auto;
    grid-template-columns: 1fr;
  }

  .workspace-card:has(.workspace-edit-drawer[open]) .workspace-edit-drawer summary,
  .workspace-card:has(.workspace-edit-drawer[open]) .workspace-enter-form,
  .workspace-card:has(.workspace-edit-drawer[open]) .workspace-active-state {
    grid-row: auto;
  }

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

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

  .billing-plan-grid {
    grid-template-columns: 1fr;
  }

  .register-plan-grid,
  .register-field-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 14px 18px;
    position: static;
  }

  .topnav {
    width: 100%;
  }

  .sidebar {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .workspace-switcher {
    border-bottom: 1px solid var(--line);
    border-right: 0;
    flex: 1 1 100%;
    margin: 0 0 2px;
    padding: 0 0 12px;
  }

  .sidebar > a,
  .sidebar > form {
    flex: 1 1 calc(50% - 8px);
    min-width: 150px;
  }

  .sidebar form .link-button {
    width: 100%;
  }

  .shell {
    padding: 20px 16px 36px;
  }

  .page-head,
  .modal-head,
  .progress-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .workspace-page-head {
    margin-bottom: 28px;
  }

  .workspace-new-button {
    width: 100%;
  }

  .workspace-card-grid {
    grid-template-columns: 1fr;
  }

  .workspace-card-footer {
    grid-template-columns: 1fr;
  }

  .workspace-enter-form,
  .workspace-active-state {
    grid-column: 1;
    justify-self: start;
  }

  .workspace-enter-form button {
    white-space: normal;
  }

  .upload-row,
  .upload-file-item,
  .list-row {
    grid-template-columns: 1fr;
  }

  .upload-file-actions,
  .trim-modal-actions {
    justify-content: stretch;
  }

  .upload-progress-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .upload-file-actions button,
  .trim-modal-actions button {
    width: 100%;
  }

  .trim-modal-panel {
    max-height: calc(100vh - 28px);
    width: min(94vw, 420px);
  }

  .trim-timeline {
    height: 64px;
  }

  .render-mode-tabs {
    grid-template-columns: 1fr;
  }

  .admin-user-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-user-meta,
  .admin-account-actions {
    justify-content: flex-start;
  }

  .admin-plan-form {
    grid-template-columns: 1fr;
  }

  .admin-workspace-head {
    flex-direction: column;
  }

  .admin-billing-facts div {
    grid-template-columns: 1fr;
  }

  .ai-context-note {
    align-items: stretch;
    flex-direction: column;
  }

  .production-quota {
    width: 100%;
  }

  .queue-add-actions,
  .render-final-actions {
    justify-content: stretch;
  }

  .queue-add-actions button,
  .render-final-actions button {
    width: 100%;
  }

  .idea-card {
    min-height: 300px;
  }

  .idea-card-text {
    font-size: 19px;
  }

  .idea-card-actions {
    grid-template-columns: 1fr;
  }

  .production-queue-head {
    flex-direction: column;
  }

  .feedback-widget {
    bottom: 14px;
    right: 14px;
  }

  .feedback-panel {
    width: calc(100vw - 28px);
  }

  .billing-facts div {
    grid-template-columns: 1fr;
  }

  .list-thumb {
    width: 44px;
  }

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

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}
