@font-face {
  font-family: "Geist";
  src: url("./assets/geist.woff2") format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 100 900;
}

@font-face {
  font-family: "Geist Mono";
  src: url("./assets/geist-mono.woff2") format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 100 900;
}

:root {
  color-scheme: dark;
  --bar-height: 68px;
  --bg: #0b0d0d;
  --surface: #101313;
  --surface-2: #151919;
  --surface-3: #1b2020;
  --surface-glass: rgba(18, 22, 22, 0.86);
  --line: rgba(240, 247, 244, 0.1);
  --line-strong: rgba(240, 247, 244, 0.18);
  --text: #f3f6f4;
  --muted: #adb5b1;
  --quiet: #929b97;
  --accent: #c8f56f;
  --accent-ink: #142005;
  --cyan: #6ccfd5;
  --green: #61daa1;
  --amber: #f4bd67;
  --coral: #ff7d72;
  --blue: #7aa9ff;
  --focus: #d7ff8a;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  --radius-sm: 6px;
  --radius: 8px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
}

body[data-theme="ink"] {
  --bg: #080d12;
  --surface: #0d141a;
  --surface-2: #121b22;
  --surface-3: #19242c;
  --surface-glass: rgba(13, 20, 26, 0.88);
  --accent: #7ed9e8;
  --accent-ink: #061c20;
  --focus: #a5edfa;
  --cyan: #8edeea;
}

body[data-theme="paper"] {
  color-scheme: light;
  --bg: #edeee9;
  --surface: #fafbf7;
  --surface-2: #f1f2ed;
  --surface-3: #e7e9e3;
  --surface-glass: rgba(250, 251, 247, 0.9);
  --line: rgba(17, 27, 23, 0.12);
  --line-strong: rgba(17, 27, 23, 0.22);
  --text: #151a18;
  --muted: #59645f;
  --quiet: #59645f;
  --accent: #365e2b;
  --accent-ink: #ffffff;
  --cyan: #167c86;
  --green: #18734d;
  --amber: #9b6210;
  --coral: #bb433b;
  --blue: #315da8;
  --focus: #47763a;
  --shadow: 0 18px 50px rgba(30, 40, 35, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Geist", "Noto Sans", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  transition: background-color 180ms ease, color 180ms ease;
}

button,
input,
textarea,
select {
  color: inherit;
  font: inherit;
  letter-spacing: 0;
}

button,
label,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

button:not(:disabled),
label[for],
select,
summary {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.54;
}

svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  stroke-width: 1.8;
}

[hidden] {
  display: none !important;
}

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

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

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 10px;
  background: var(--line-strong);
  background-clip: padding-box;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  transform: translateY(-140%);
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 14px;
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.command-bar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: minmax(250px, 1fr) auto minmax(250px, 1fr);
  align-items: center;
  height: var(--bar-height);
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-glass);
  box-shadow: 0 1px rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(22px) saturate(125%);
}

.product {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 44px;
  color: var(--text);
  text-decoration: none;
}

.product-mark {
  display: grid;
  grid-template-columns: repeat(3, 4px);
  align-items: end;
  gap: 3px;
  width: 27px;
  height: 27px;
  margin-right: 10px;
  padding: 5px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface-3);
}

.product-mark i {
  display: block;
  border-radius: 1px;
  background: var(--accent);
}

.product-mark i:nth-child(1) { height: 8px; }
.product-mark i:nth-child(2) { height: 15px; }
.product-mark i:nth-child(3) { height: 11px; }

.product-name {
  font-size: 17px;
  font-weight: 730;
}

.product-edition {
  margin-left: 8px;
  color: var(--muted);
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.workflow-tabs {
  align-self: stretch;
  display: flex;
  align-items: center;
  gap: 2px;
}

.workflow-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 124px;
  min-height: 48px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-weight: 620;
  transition: color 140ms ease, background-color 140ms ease;
}

.workflow-tab::after {
  position: absolute;
  right: 14px;
  bottom: -10px;
  left: 14px;
  height: 2px;
  background: transparent;
  content: "";
}

.workflow-tab:hover {
  background: var(--surface-2);
  color: var(--text);
}

.workflow-tab.is-active {
  color: var(--text);
}

.workflow-tab.is-active::after {
  background: var(--accent);
}

.command-actions {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.engine-state {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  margin-right: 4px;
  padding-right: 14px;
  border-right: 1px solid var(--line);
}

.state-pulse,
.live-label i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 14%, transparent);
}

.engine-copy {
  display: flex;
  flex-direction: column;
}

.engine-copy b {
  font-size: 12px;
  font-weight: 650;
}

.engine-copy small {
  color: var(--quiet);
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  text-transform: uppercase;
}

.icon-button,
.avatar-button {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--muted);
  transition: border-color 140ms ease, color 140ms ease, background-color 140ms ease;
}

.icon-button:hover,
.avatar-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-3);
  color: var(--text);
}

.icon-button.quiet {
  border-color: transparent;
  background: transparent;
}

.avatar-button {
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: "Geist Mono", monospace;
  font-size: 11px;
  font-weight: 750;
}

.theme-control {
  position: relative;
}

.theme-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 80;
  width: 176px;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.theme-option {
  display: grid;
  grid-template-columns: 18px 1fr 16px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.theme-option:hover {
  background: var(--surface-2);
  color: var(--text);
}

.theme-option > svg {
  width: 15px;
  visibility: hidden;
}

.theme-option.is-active > svg {
  visibility: visible;
}

.theme-swatch {
  display: block;
  width: 14px;
  height: 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
}

.swatch-carbon { background: #101313; }
.swatch-ink { background: #122635; }
.swatch-paper { background: #f4f4ef; }

main {
  min-height: 0;
}

.workspace {
  display: none;
  grid-template-columns: 336px minmax(540px, 1fr) 376px;
  height: calc(100dvh - var(--bar-height));
  background: var(--bg);
}

.workspace.is-active {
  display: grid;
}

.workspace-panel {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--surface);
}

.workspace-panel + .workspace-panel {
  border-left: 1px solid var(--line);
}

.create-panel,
.activity-panel,
.registry-panel,
.inspector-panel {
  position: relative;
  display: flex;
  flex-direction: column;
}

.panel-scroll,
.review-scroll {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.panel-scroll {
  padding: 24px;
}

.review-scroll {
  height: 100%;
  padding: 28px clamp(24px, 3vw, 48px) 48px;
}

.panel-heading,
.activity-heading,
.story-heading,
.section-heading,
.library-heading,
.field-label-row,
.dialog-heading,
.dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading {
  margin-bottom: 24px;
}

.panel-heading h1,
.activity-heading h2,
.story-heading h2,
.section-heading h3,
.library-heading h3,
.approval-band h3,
.dialog-heading h2 {
  margin: 0;
  letter-spacing: 0;
}

.panel-heading h1 {
  margin-top: 2px;
  font-size: 23px;
  font-weight: 680;
  line-height: 1.2;
}

.eyebrow {
  margin: 0;
  color: var(--quiet);
  font-family: "Geist Mono", monospace;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.4;
  text-transform: uppercase;
}

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

.script-section {
  padding-top: 0;
  border-top: 0;
}

.field-label {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
}

.field-label span {
  margin-left: 5px;
  color: var(--quiet);
  font-weight: 450;
}

.field-label-row .field-label {
  margin: 0;
}

.field-meta {
  color: var(--quiet);
  font-family: "Geist Mono", monospace;
  font-size: 11px;
}

.script-editor {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.script-editor:focus-within {
  border-color: color-mix(in srgb, var(--accent) 68%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

.script-editor textarea {
  display: block;
  width: 100%;
  min-height: 194px;
  resize: vertical;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 14px 14px 12px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.65;
}

.script-editor textarea::placeholder,
input::placeholder {
  color: var(--quiet);
}

.editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 0 10px 0 12px;
  border-top: 1px solid var(--line);
}

.text-action,
.inline-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 620;
  text-decoration: none;
}

.text-action:hover,
.inline-button:hover {
  color: var(--text);
}

.text-action svg {
  width: 15px;
}

.file-state {
  color: var(--quiet);
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  text-transform: uppercase;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.segmented-control label {
  position: relative;
}

.segmented-control input,
.format-option input,
.language-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.segmented-control span {
  display: grid;
  place-items: center;
  min-height: 38px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 620;
}

.segmented-control input:checked + span {
  background: var(--surface-3);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  color: var(--text);
}

.segmented-control input:focus-visible + span,
.format-option input:focus-visible ~ span,
.language-option input:focus-visible ~ span {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.context-line {
  margin: 9px 0 0;
  color: var(--quiet);
  font-size: 11px;
  line-height: 1.45;
}

.format-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.format-option {
  position: relative;
  display: grid;
  grid-template-columns: 38px 1fr 16px;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  transition: border-color 140ms ease, background-color 140ms ease;
}

.format-option:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent) 62%, var(--line));
  background: color-mix(in srgb, var(--accent) 5%, var(--surface-2));
}

.format-visual {
  display: grid;
  place-items: center;
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
}

.format-visual.landscape { width: 38px; }
.format-visual.portrait { width: 24px; margin-left: 7px; }
.format-visual i { width: 45%; height: 2px; background: var(--accent); }

.format-option b,
.language-option b {
  display: block;
  font-size: 11px;
  font-weight: 650;
}

.format-option small,
.language-option small {
  display: block;
  margin-top: 1px;
  color: var(--quiet);
  font-size: 10px;
}

.format-option .check-icon {
  width: 14px;
  color: var(--accent);
  opacity: 0;
}

.format-option:has(input:checked) .check-icon {
  opacity: 1;
}

.language-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 10px;
}

.language-option {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 9px;
  min-height: 54px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.language-option:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
}

.language-code {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--muted);
  font-family: "Geist Mono", monospace;
  font-size: 9px;
  font-weight: 750;
}

.language-option:has(input:checked) .language-code {
  background: var(--accent);
  color: var(--accent-ink);
}

.language-option > svg {
  width: 14px;
  color: var(--accent);
  opacity: 0;
}

.language-option:has(input:checked) > svg {
  opacity: 1;
}

.compact-fields {
  padding-bottom: 20px;
}

.select-wrap {
  position: relative;
}

.select-wrap select,
.input-with-icon input,
.search-field input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: 0;
  background: var(--surface-2);
  color: var(--text);
}

.select-wrap select {
  appearance: none;
  padding: 0 40px 0 12px;
}

.select-wrap > svg {
  position: absolute;
  top: 14px;
  right: 12px;
  width: 16px;
  pointer-events: none;
  color: var(--quiet);
}

.select-wrap select:focus,
.input-with-icon input:focus,
.search-field input:focus {
  border-color: color-mix(in srgb, var(--accent) 65%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 11%, transparent);
}

.advanced-section {
  border-top: 1px solid var(--line);
}

.advanced-section summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 620;
  list-style: none;
}

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

.advanced-section summary span {
  display: flex;
  align-items: center;
  gap: 9px;
}

.advanced-section summary svg {
  width: 16px;
}

.advanced-section[open] summary > svg {
  transform: rotate(180deg);
}

.advanced-body {
  padding-bottom: 8px;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  border-top: 1px solid var(--line);
}

.switch-row span b,
.switch-row span small {
  display: block;
}

.switch-row span b {
  font-size: 11px;
}

.switch-row span small {
  margin-top: 2px;
  color: var(--quiet);
  font-size: 10px;
}

.switch-row input {
  position: absolute;
  opacity: 0;
}

.switch-row > i {
  position: relative;
  width: 36px;
  height: 20px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: var(--surface-3);
}

.switch-row > i::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--muted);
  content: "";
  transition: transform 140ms ease, background-color 140ms ease;
}

.switch-row input:checked + i {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 22%, var(--surface-3));
}

.switch-row input:checked + i::after {
  transform: translateX(16px);
  background: var(--accent);
}

.production-footer {
  position: relative;
  z-index: 3;
  padding: 14px 24px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-glass);
  backdrop-filter: blur(18px);
}

.production-summary {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--quiet);
  font-size: 11px;
}

.production-summary b {
  color: var(--muted);
  font-family: "Geist Mono", monospace;
  font-weight: 550;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 680;
  transition: transform 140ms ease, filter 140ms ease, border-color 140ms ease, background-color 140ms ease;
}

.primary-button {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 16%, transparent);
}

.primary-button:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.primary-button:active {
  transform: translateY(0);
}

.production-footer > .primary-button {
  width: 100%;
}

.primary-button kbd {
  margin-left: auto;
  border: 0;
  border-radius: 4px;
  background: color-mix(in srgb, var(--accent-ink) 12%, transparent);
  padding: 3px 6px;
  color: inherit;
  font-family: "Geist Mono", monospace;
  font-size: 8px;
  font-weight: 650;
}

.primary-button.compact {
  min-height: 42px;
}

.secondary-button {
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
}

.secondary-button:hover {
  border-color: color-mix(in srgb, var(--text) 30%, var(--line));
  background: var(--surface-3);
}

.story-heading {
  align-items: flex-start;
  margin-bottom: 24px;
}

.story-title-wrap {
  min-width: 0;
}

.story-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--quiet);
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  font-weight: 600;
}

.status-badge,
.row-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-family: "Geist", sans-serif;
  font-size: 10px;
  font-style: normal;
  font-weight: 680;
  white-space: nowrap;
}

.status-badge svg {
  width: 12px;
}

.status-badge.review,
.row-status.review {
  background: color-mix(in srgb, var(--amber) 13%, transparent);
  color: var(--amber);
}

.status-badge.ready,
.row-status.ready {
  background: color-mix(in srgb, var(--green) 13%, transparent);
  color: var(--green);
}

.status-badge.published,
.row-status.published {
  background: color-mix(in srgb, var(--blue) 13%, transparent);
  color: var(--blue);
}

.story-heading h2 {
  max-width: 780px;
  font-size: clamp(21px, 2vw, 29px);
  font-weight: 650;
  line-height: 1.18;
}

.story-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
  color: var(--muted);
  font-family: "Geist Mono", monospace;
  font-size: 10px;
}

.story-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.story-meta svg {
  width: 14px;
}

.video-shell {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #050606;
  box-shadow: var(--shadow);
}

.video-canvas {
  position: relative;
  aspect-ratio: 16 / 9;
  min-height: 260px;
  overflow: hidden;
  background: #050606;
}

.video-canvas > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms ease, filter 240ms ease;
}

.video-canvas.is-playing > img {
  transform: scale(1.015);
  filter: brightness(0.93);
}

.video-topline {
  position: absolute;
  top: 18px;
  right: 18px;
  left: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #ffffff;
  font-family: "Geist Mono", monospace;
  font-size: 9px;
  font-weight: 700;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}

.demo-brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.demo-brand i {
  width: 7px;
  height: 15px;
  background: var(--accent);
}

.language-cue {
  padding: 5px 7px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(8px);
}

.video-lower-third {
  position: absolute;
  bottom: 50px;
  left: 22px;
  display: flex;
  max-width: min(72%, 620px);
  flex-direction: column;
  align-items: flex-start;
  color: #ffffff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.9);
}

.video-lower-third span {
  margin-bottom: 4px;
  padding: 4px 7px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: "Geist Mono", monospace;
  font-size: 8px;
  font-weight: 750;
}

.video-lower-third b {
  font-family: "Noto Sans Tamil", "Noto Sans", sans-serif;
  font-size: clamp(15px, 2vw, 25px);
  line-height: 1.25;
}

.play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(7, 9, 9, 0.62);
  color: #ffffff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
  transition: transform 140ms ease, background-color 140ms ease;
}

.play-button:hover {
  transform: translate(-50%, -50%) scale(1.06);
  background: rgba(7, 9, 9, 0.76);
}

.play-button svg {
  width: 22px;
  height: 22px;
  margin-left: 2px;
  fill: currentColor;
}

.video-canvas.is-playing .play-button {
  opacity: 0;
  pointer-events: none;
}

.video-controls {
  position: absolute;
  right: 12px;
  bottom: 8px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: rgba(7, 9, 9, 0.76);
  color: #ffffff;
  backdrop-filter: blur(12px);
}

.video-controls button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 4px;
  background: transparent;
  color: #ffffff;
}

.video-controls button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.video-controls svg {
  width: 15px;
}

.video-time {
  white-space: nowrap;
  font-family: "Geist Mono", monospace;
  font-size: 8px;
}

.video-scrubber {
  flex: 1;
  height: 3px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.24);
}

.video-scrubber i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 1s linear;
}

.video-shell figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 0 12px;
  background: var(--surface-2);
}

.language-switcher,
.dialog-tabs,
.registry-filters,
.fix-language-bar {
  display: flex;
  align-items: center;
  gap: 2px;
}

.language-switcher button,
.dialog-tabs button,
.registry-filters button,
.fix-language-bar button {
  min-height: 36px;
  padding: 0 11px;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 620;
}

.language-switcher button:hover,
.language-switcher button.is-active,
.dialog-tabs button.is-active,
.registry-filters button.is-active,
.fix-language-bar button.is-active {
  background: var(--surface-3);
  color: var(--text);
}

.stage-track {
  display: grid;
  grid-template-columns: 48px 1fr 64px 1fr 52px 1fr 48px 1fr 52px;
  align-items: start;
  margin: 24px 4px;
}

.stage-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  text-align: center;
}

.stage-step > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--quiet);
}

.stage-step > span svg {
  width: 13px;
}

.stage-step.is-done > span {
  border-color: color-mix(in srgb, var(--green) 42%, var(--line));
  background: color-mix(in srgb, var(--green) 10%, var(--surface-2));
  color: var(--green);
}

.stage-step.is-current > span {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.stage-step b {
  margin-top: 7px;
  font-size: 10px;
  font-weight: 620;
}

.stage-step small {
  margin-top: 1px;
  color: var(--quiet);
  font-family: "Geist Mono", monospace;
  font-size: 9px;
}

.stage-line {
  height: 1px;
  margin-top: 14px;
  background: var(--line-strong);
}

.stage-line.is-done {
  background: color-mix(in srgb, var(--green) 52%, var(--line));
}

.approval-band {
  display: grid;
  grid-template-columns: 42px minmax(180px, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--green) 30%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--green) 5%, var(--surface-2));
}

.approval-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--green) 13%, transparent);
  color: var(--green);
}

.approval-band h3,
.section-heading h3,
.library-heading h3 {
  font-size: 14px;
  font-weight: 650;
}

.approval-band p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.approval-actions {
  display: flex;
  gap: 8px;
}

.artifact-panel {
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.section-heading .eyebrow {
  margin-bottom: 3px;
}

.artifact-table {
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.artifact-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  border-bottom: 1px solid var(--line);
}

.artifact-row > span:nth-child(2) b,
.artifact-row > span:nth-child(2) small {
  display: block;
}

.artifact-row > span:nth-child(2) b {
  font-size: 11px;
}

.artifact-row > span:nth-child(2) small {
  margin-top: 2px;
  color: var(--quiet);
  font-size: 9px;
}

.artifact-row > div {
  display: flex;
  gap: 2px;
}

.artifact-row .icon-button {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
}

.library-panel {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.library-heading h3 span {
  margin-left: 6px;
  color: var(--quiet);
  font-family: "Geist Mono", monospace;
  font-size: 9px;
  font-weight: 500;
}

.library-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-field,
.input-with-icon {
  position: relative;
  display: block;
}

.search-field > svg,
.input-with-icon > svg {
  position: absolute;
  top: 13px;
  left: 12px;
  z-index: 2;
  width: 16px;
  color: var(--quiet);
}

.search-field input,
.input-with-icon input {
  padding: 0 12px 0 38px;
}

.library-tools .search-field {
  width: min(220px, 25vw);
}

.library-table {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.library-table-head,
.library-row {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) 0.6fr 0.72fr 0.6fr 0.65fr;
  align-items: center;
  gap: 12px;
  min-width: 680px;
}

.library-table-head {
  min-height: 38px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--quiet);
  font-family: "Geist Mono", monospace;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
}

.library-row {
  width: 100%;
  min-height: 72px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  text-align: left;
  transition: background-color 140ms ease;
}

.library-row:last-of-type {
  border-bottom: 0;
}

.library-row:hover {
  background: var(--surface-2);
}

.library-row > span:not(.video-title-cell):not(.language-stack):not(.row-end) {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
}

.library-row > span > svg {
  width: 14px;
}

.video-title-cell {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.video-title-cell > span {
  min-width: 0;
}

.video-title-cell b,
.video-title-cell small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-title-cell b {
  color: var(--text);
  font-size: 11px;
  font-weight: 620;
}

.video-title-cell small {
  margin-top: 3px;
  color: var(--quiet);
  font-family: "Geist Mono", monospace;
  font-size: 9px;
}

.thumb,
.registry-thumb,
.segment-image {
  display: block;
  overflow: hidden;
  background-image: url("./assets/clean-energy-park.webp");
  background-position: center;
  background-size: cover;
}

.thumb {
  width: 62px;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
}

.thumb-two { background-image: url("./assets/isro-docking.webp"); background-position: center; }
.thumb-three { background-image: url("./assets/repo-rate.webp"); background-position: center; }
.thumb-four { background-image: url("./assets/monsoon-city.webp"); background-position: center; }

.language-stack {
  display: flex;
  align-items: center;
  padding-left: 5px;
}

.language-stack i {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  margin-left: -5px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--muted);
  font-family: "Geist Mono", monospace;
  font-size: 7px;
  font-style: normal;
  font-weight: 700;
}

.row-end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.row-end > svg {
  width: 14px;
  color: var(--quiet);
}

.library-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--quiet);
}

.library-empty svg {
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
}

.library-empty b {
  color: var(--muted);
  font-size: 12px;
}

.library-empty span {
  margin-top: 3px;
  font-size: 10px;
}

.activity-panel .panel-scroll {
  padding-bottom: 52px;
}

.activity-heading {
  margin-bottom: 20px;
}

.activity-heading h2 {
  margin-top: 2px;
  font-size: 18px;
  font-weight: 650;
}

.live-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid color-mix(in srgb, var(--green) 25%, var(--line));
  border-radius: 999px;
  color: var(--green);
  font-family: "Geist Mono", monospace;
  font-size: 8px;
  font-weight: 650;
  text-transform: uppercase;
}

.live-label i {
  width: 6px;
  height: 6px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.42; }
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.metric-strip div {
  min-width: 0;
  padding: 13px 12px;
  border-right: 1px solid var(--line);
}

.metric-strip div:last-child {
  border-right: 0;
}

.metric-strip b,
.metric-strip span {
  display: block;
}

.metric-strip b {
  font-family: "Geist Mono", monospace;
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
}

.metric-strip span {
  margin-top: 6px;
  color: var(--quiet);
  font-size: 10px;
}

.pipeline-group {
  margin-top: 24px;
}

.pipeline-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
  margin-bottom: 8px;
}

.pipeline-group-title h3 {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.pipeline-group-title > span:not(.slot-state) {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--quiet);
  font-family: "Geist Mono", monospace;
  font-size: 8px;
}

.pipeline-job {
  position: relative;
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: stretch;
  min-height: 116px;
  margin-bottom: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 13px 13px 11px 15px;
  color: var(--muted);
  text-align: left;
  transition: border-color 140ms ease, background-color 140ms ease, transform 140ms ease;
}

.pipeline-job:hover,
.pipeline-job.is-selected {
  border-color: var(--line-strong);
  background: var(--surface-3);
}

.pipeline-job:hover {
  transform: translateY(-1px);
}

.job-rail {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 3px;
  border-radius: 0 2px 2px 0;
}

.rail-cyan { background: var(--cyan); }
.rail-amber { background: var(--amber); }
.rail-green { background: var(--green); }
.rail-coral { background: var(--coral); }

.job-top,
.job-stage,
.job-foot {
  display: flex;
  align-items: center;
}

.job-top {
  justify-content: space-between;
  gap: 8px;
}

.job-top b {
  overflow: hidden;
  color: var(--text);
  font-size: 11px;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-top em {
  color: var(--muted);
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  font-style: normal;
}

.job-stage {
  gap: 6px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
}

.job-stage svg {
  width: 13px;
}

.progress-track {
  height: 3px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--line);
}

.progress-track i {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: var(--cyan);
}

.progress-track.amber i { background: var(--amber); }
.progress-track.green i { background: var(--green); }
.progress-track.coral i { background: var(--coral); }

.job-foot {
  justify-content: space-between;
  margin-top: 9px;
  color: var(--quiet);
  font-family: "Geist Mono", monospace;
  font-size: 9px;
}

.job-foot small {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.job-foot svg {
  width: 11px;
}

.queue-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 60px;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.queue-row:hover {
  color: var(--text);
}

.queue-index {
  color: var(--quiet);
  font-family: "Geist Mono", monospace;
  font-size: 9px;
}

.queue-row b,
.queue-row small {
  display: block;
}

.queue-row b {
  color: var(--text);
  font-size: 11px;
  font-weight: 580;
}

.queue-row small {
  margin-top: 2px;
  color: var(--quiet);
  font-size: 9px;
}

.queue-row > svg {
  width: 14px;
  color: var(--quiet);
}

.fix-slot {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.slot-state {
  color: var(--quiet);
  font-family: "Geist Mono", monospace;
  font-size: 9px;
  font-weight: 500;
}

.connection-status {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 0 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-glass);
  color: var(--quiet);
  backdrop-filter: blur(18px);
  font-family: "Geist Mono", monospace;
  font-size: 9px;
}

.connection-status > svg {
  width: 13px;
  margin-right: 7px;
  color: var(--green);
}

.connection-status button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-left: auto;
  border-radius: 5px;
  background: transparent;
  color: var(--quiet);
}

.connection-status button:hover {
  background: var(--surface-3);
  color: var(--text);
}

.connection-status button svg {
  width: 14px;
}

.fix-workspace {
  grid-template-columns: 320px minmax(560px, 1fr) 360px;
}

.registry-total {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 26px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  font-family: "Geist Mono", monospace;
  font-size: 9px;
}

.registry-search {
  margin-bottom: 12px;
}

.registry-filters {
  width: 100%;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.registry-filters button {
  min-height: 34px;
  flex: 1;
  padding: 0 8px;
  font-size: 9px;
}

.registry-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 70px;
  margin-bottom: 6px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  padding: 7px;
  color: var(--muted);
  text-align: left;
}

.registry-row:hover,
.registry-row.is-selected {
  border-color: var(--line);
  background: var(--surface-2);
}

.registry-row.is-selected {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}

.registry-thumb {
  width: 58px;
  aspect-ratio: 16 / 9;
  border-radius: 4px;
}

.registry-row b,
.registry-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.registry-row b {
  color: var(--text);
  font-size: 11px;
  font-weight: 620;
}

.registry-row small {
  margin-top: 3px;
  color: var(--quiet);
  font-size: 9px;
}

.registry-row > svg {
  width: 14px;
  color: var(--quiet);
}

.fix-story-heading {
  align-items: center;
}

.fix-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fix-language-bar {
  margin-bottom: 16px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.fix-language-bar button {
  position: relative;
  flex: 0 0 auto;
  min-height: 42px;
  border-radius: 0;
  background: transparent !important;
}

.fix-language-bar button.is-active::after {
  position: absolute;
  right: 8px;
  bottom: 0;
  left: 8px;
  height: 2px;
  background: var(--accent);
  content: "";
}

.fix-video-shell {
  box-shadow: none;
}

.segment-indicator {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.55);
  color: #ffffff;
  backdrop-filter: blur(10px);
  font-family: "Geist Mono", monospace;
  font-size: 8px;
}

.segment-indicator span {
  color: var(--accent);
  font-weight: 700;
}

.segment-indicator b {
  font-weight: 500;
}

.segment-strip {
  margin-top: 24px;
}

.timeline-zoom {
  display: flex;
  align-items: center;
  color: var(--quiet);
  font-family: "Geist Mono", monospace;
  font-size: 8px;
}

.timeline-zoom .icon-button {
  width: 44px;
  height: 44px;
  flex-basis: 44px;
}

.timeline-zoom svg {
  width: 13px;
}

.segment-filmstrip {
  display: grid;
  grid-auto-columns: minmax(128px, 1fr);
  grid-auto-flow: column;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  padding: 3px 3px 12px;
  scroll-snap-type: x proximity;
}

.fix-workspace.inspector-closed {
  grid-template-columns: 320px minmax(560px, 1fr);
}

.fix-workspace.inspector-closed .inspector-panel {
  display: none;
}

.segment-filmstrip button {
  min-width: 128px;
  overflow: hidden;
  scroll-snap-align: start;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--muted);
  text-align: left;
  transition: border-color 140ms ease, transform 140ms ease;
}

.segment-filmstrip button:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.segment-filmstrip button.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 12%, transparent);
}

.segment-image {
  width: 100%;
  aspect-ratio: 16 / 9;
}

.seg-two { background-position: 10% center; }
.seg-three { background-position: 32% center; filter: saturate(0.7); }
.seg-four { background-position: 48% center; }
.seg-five { background-position: 65% center; filter: brightness(0.85); }
.seg-six { background-position: 80% center; filter: saturate(0.65); }
.seg-seven { background-position: center 75%; }
.seg-eight { background-position: 100% center; filter: sepia(0.18); }

.segment-filmstrip button > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 0 8px;
}

.segment-filmstrip button b {
  color: var(--text);
  font-family: "Geist Mono", monospace;
  font-size: 9px;
}

.segment-filmstrip button small {
  color: var(--quiet);
  font-family: "Geist Mono", monospace;
  font-size: 7px;
}

.inspector-panel .panel-scroll {
  padding-bottom: 40px;
}

.inspector-section {
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

.current-image {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.current-image img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.current-image div {
  padding: 10px 11px;
}

.current-image span,
.current-image b {
  display: block;
}

.current-image span {
  color: var(--quiet);
  font-family: "Geist Mono", monospace;
  font-size: 8px;
  text-transform: uppercase;
}

.current-image b {
  margin-top: 3px;
  overflow: hidden;
  font-size: 10px;
  font-weight: 560;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drop-zone {
  display: flex;
  min-height: 128px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--muted);
  transition: border-color 140ms ease, background-color 140ms ease;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 5%, var(--surface-2));
}

.drop-zone > svg {
  width: 24px;
  height: 24px;
  margin-bottom: 9px;
  color: var(--accent);
}

.drop-zone b {
  color: var(--text);
  font-size: 11px;
}

.drop-zone span {
  margin-top: 3px;
  color: var(--quiet);
  font-size: 9px;
}

.replacement-preview {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 7px;
  border: 1px solid color-mix(in srgb, var(--green) 35%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--green) 5%, var(--surface-2));
}

.replacement-preview img {
  width: 58px;
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  object-fit: cover;
}

.replacement-preview span {
  min-width: 0;
}

.replacement-preview b,
.replacement-preview small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.replacement-preview b {
  font-size: 9px;
}

.replacement-preview small {
  margin-top: 2px;
  color: var(--green);
  font-size: 8px;
}

.replacement-preview .icon-button {
  width: 36px;
  height: 36px;
  flex-basis: 36px;
}

.scope-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 4px;
  padding: 12px;
  border-left: 2px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 5%, var(--surface-2));
}

.scope-note > svg {
  width: 16px;
  margin-top: 1px;
  color: var(--accent);
}

.scope-note b,
.scope-note span {
  display: block;
}

.scope-note b {
  font-size: 10px;
}

.scope-note span {
  margin-top: 2px;
  color: var(--quiet);
  font-size: 9px;
}

.render-button {
  width: 100%;
  margin-top: 16px;
}

.version-list {
  margin-top: 24px;
}

.version-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  border-top: 1px solid var(--line);
  color: var(--quiet);
}

.version-row > svg {
  width: 15px;
}

.version-row b,
.version-row small {
  display: block;
}

.version-row b {
  color: var(--muted);
  font-size: 10px;
}

.version-row small {
  margin-top: 2px;
  font-size: 9px;
}

.version-row em,
.version-row button {
  color: var(--quiet);
  font-size: 8px;
  font-style: normal;
}

.version-row button {
  min-height: 44px;
  border-radius: 5px;
  background: transparent;
}

.version-row button:hover {
  color: var(--text);
}

.script-dialog {
  width: min(640px, calc(100vw - 32px));
  max-height: min(760px, calc(100dvh - 32px));
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0;
  color: var(--text);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.44);
}

.script-dialog::backdrop {
  background: rgba(2, 4, 4, 0.72);
  backdrop-filter: blur(5px);
}

.dialog-heading {
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.dialog-heading h2 {
  margin-top: 3px;
  font-size: 17px;
}

.dialog-tabs {
  padding: 8px 18px;
  border-bottom: 1px solid var(--line);
}

.script-copy {
  max-height: 420px;
  overflow-y: auto;
  padding: 24px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.script-copy p {
  margin: 0 0 16px;
}

.dialog-footer {
  justify-content: flex-end;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 150;
  display: flex;
  width: min(360px, calc(100vw - 32px));
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: 20px 1fr 28px;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 9px 9px 9px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-glass);
  color: var(--text);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  pointer-events: auto;
  animation: toast-in 220ms ease both;
}

.toast > svg {
  color: var(--green);
}

.toast b,
.toast small {
  display: block;
}

.toast b {
  font-size: 11px;
}

.toast small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.toast button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: transparent;
  color: var(--quiet);
}

.toast button:hover {
  background: var(--surface-3);
  color: var(--text);
}

.toast button svg {
  width: 13px;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.mobile-nav {
  display: none;
}

.mobile-back-registry {
  display: none;
}

@media (max-width: 1380px) {
  .workspace {
    grid-template-columns: 304px minmax(500px, 1fr) 336px;
  }

  .fix-workspace {
    grid-template-columns: 300px minmax(520px, 1fr) 336px;
  }

  .panel-scroll {
    padding: 20px;
  }

  .production-footer {
    padding-right: 20px;
    padding-left: 20px;
  }

  .review-scroll {
    padding-right: 28px;
    padding-left: 28px;
  }

  .approval-band {
    grid-template-columns: 42px minmax(160px, 1fr);
  }

  .approval-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

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

@media (max-width: 1180px) {
  :root {
    --bar-height: 64px;
  }

  body {
    overflow: auto;
    padding-bottom: 72px;
  }

  .command-bar {
    grid-template-columns: minmax(160px, 1fr) auto minmax(100px, 1fr);
    padding: 0 14px;
  }

  .engine-state {
    display: none;
  }

  .workspace,
  .workspace.is-active {
    display: block;
    height: auto;
    min-height: calc(100dvh - var(--bar-height) - 72px);
  }

  .generate-workspace .mobile-route {
    display: none;
    min-height: calc(100dvh - var(--bar-height) - 72px);
    border-left: 0;
  }

  .generate-workspace .mobile-route.is-mobile-active {
    display: flex;
  }

  .generate-workspace .review-panel.is-mobile-active {
    display: block;
  }

  .panel-scroll,
  .review-scroll {
    width: 100%;
    height: auto;
    overflow: visible;
  }

  .create-panel .panel-scroll,
  .activity-panel .panel-scroll {
    max-width: 760px;
    margin: 0 auto;
    padding: 28px 24px;
  }

  .production-footer {
    position: fixed;
    right: 0;
    bottom: 72px;
    left: 0;
    width: 100%;
  }

  .create-panel.is-mobile-active {
    padding-bottom: 156px;
  }

  .review-scroll {
    max-width: 980px;
    margin: 0 auto;
    padding: 28px 24px 48px;
  }

  .activity-panel .connection-status {
    position: static;
  }

  .fix-workspace.is-active {
    display: block;
  }

  .fix-workspace:not(.fix-editor-active) .segment-panel,
  .fix-workspace:not(.fix-editor-active) .inspector-panel {
    display: none;
  }

  .fix-workspace.fix-editor-active .registry-panel {
    display: none;
  }

  .fix-workspace.fix-editor-active.inspector-closed .inspector-panel {
    display: none;
  }

  .mobile-back-registry {
    display: inline-flex;
    margin-bottom: 18px;
  }

  .fix-workspace .workspace-panel {
    min-height: auto;
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }

  .registry-panel .panel-scroll,
  .inspector-panel .panel-scroll {
    max-width: 760px;
    margin: 0 auto;
    overflow: visible;
  }

  .registry-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .mobile-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    min-height: 72px;
    padding: 6px max(8px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    border-top: 1px solid var(--line-strong);
    background: var(--surface-glass);
    box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.16);
    backdrop-filter: blur(22px);
  }

  .mobile-nav button {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 56px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--quiet);
    font-size: 10px;
    font-weight: 620;
  }

  .mobile-nav button.is-active {
    color: var(--accent);
  }

  .mobile-nav svg {
    width: 19px;
    height: 19px;
  }

  .mobile-nav em {
    position: absolute;
    top: 4px;
    left: calc(50% + 8px);
    display: grid;
    place-items: center;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border: 2px solid var(--surface);
    border-radius: 999px;
    background: var(--coral);
    color: #ffffff;
    font-family: "Geist Mono", monospace;
    font-size: 7px;
    font-style: normal;
  }

  .toast-region {
    bottom: 88px;
  }

  body[data-mobile-view="create"] .toast-region {
    bottom: 184px;
  }
}

@media (max-width: 700px) {
  .command-bar {
    grid-template-columns: 1fr auto;
  }

  .workflow-tabs {
    display: none;
  }

  .product-edition {
    display: none;
  }

  .command-actions {
    gap: 6px;
  }

  .avatar-button,
  .command-actions .icon-button {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .panel-scroll,
  .create-panel .panel-scroll,
  .activity-panel .panel-scroll,
  .review-scroll {
    padding: 22px 16px 40px;
  }

  .production-footer {
    padding: 12px 16px 16px;
  }

  .story-heading {
    gap: 10px;
  }

  .story-heading h2 {
    font-size: 22px;
  }

  .story-meta {
    gap: 10px;
  }

  .video-canvas {
    min-height: 0;
  }

  .video-topline {
    top: 11px;
    right: 11px;
    left: 11px;
  }

  .video-lower-third {
    bottom: 48px;
    left: 12px;
    max-width: 82%;
  }

  .video-controls {
    right: 6px;
    bottom: 5px;
    left: 6px;
  }

  .video-controls button:nth-last-child(2) {
    display: none;
  }

  .video-time {
    display: none;
  }

  .play-button {
    width: 50px;
    height: 50px;
  }

  .video-shell figcaption {
    overflow-x: auto;
  }

  .stage-track {
    grid-template-columns: 42px 1fr 52px 1fr 42px 1fr 42px 1fr 44px;
    margin-right: -4px;
    margin-left: -4px;
  }

  .stage-step small {
    display: none;
  }

  .approval-band {
    grid-template-columns: 38px 1fr;
    padding: 13px;
  }

  .approval-icon {
    width: 38px;
    height: 38px;
  }

  .approval-actions {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    width: 100%;
  }

  .approval-actions button {
    min-width: 0;
    padding: 0 10px;
  }

  .library-heading {
    align-items: flex-end;
  }

  .library-tools .search-field {
    width: min(180px, 43vw);
  }

  .library-tools .icon-button {
    display: none;
  }

  .library-table-head {
    display: none;
  }

  .library-table {
    overflow: visible;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .library-row {
    grid-template-columns: minmax(0, 1fr) auto;
    min-width: 0;
    min-height: 78px;
    padding-right: 4px;
    padding-left: 4px;
  }

  .library-row > span:nth-child(2),
  .library-row > span:nth-child(3),
  .library-row > span:nth-child(4) {
    display: none !important;
  }

  .row-end > svg {
    display: none;
  }

  .artifact-row {
    grid-template-columns: 30px minmax(0, 1fr);
    padding: 8px 0;
  }

  .artifact-row > div {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .registry-list {
    display: block;
  }

  .fix-story-heading {
    align-items: flex-start;
  }

  .fix-story-heading > .secondary-button {
    width: 44px;
    padding: 0;
    font-size: 0;
  }

  .fix-header-actions .secondary-button {
    width: 44px;
    padding: 0;
    font-size: 0;
  }

  .segment-filmstrip {
    grid-auto-columns: 120px;
  }
}

@media (max-width: 480px) {
  .format-picker,
  .language-grid {
    grid-template-columns: 1fr;
  }

  .format-option {
    min-height: 58px;
  }

  .language-option {
    min-height: 48px;
  }

  .story-heading h2 {
    font-size: 20px;
  }

  .story-meta span:nth-child(3) {
    display: none;
  }

  .video-lower-third b {
    font-size: 13px;
  }

  .video-topline,
  .video-lower-third span {
    font-size: 7px;
  }

  .stage-track {
    grid-template-columns: 36px 1fr 44px 1fr 36px 1fr 36px 1fr 40px;
  }

  .stage-step b {
    font-size: 9px;
  }

  .library-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .library-tools,
  .library-tools .search-field {
    width: 100%;
  }

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

  .script-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
