:root {
  color-scheme: dark;
  --stage: #303031;
  --app: #0d0d0f;
  --panel: #121214;
  --card: #171719;
  --control: #1d1d20;
  --hover: #252528;
  --pressed: #2c2c30;
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-default: rgba(255, 255, 255, 0.105);
  --border-strong: rgba(255, 255, 255, 0.18);
  --border-focus: rgba(255, 255, 255, 0.48);
  --text-primary: #f1f1f2;
  --text-secondary: #b8b8bb;
  --text-tertiary: #85858a;
  --text-muted: #626268;
  --mint: #68ffcb;
  --green: #37d65c;
  --orange: #ff6a2a;
  --amber: #d59a2f;
  --red: #ff3049;
  --bg: var(--app);
  --surface: var(--panel);
  --surface-raised: var(--card);
  --surface-hover: var(--hover);
  --line: var(--border-default);
  --line-strong: var(--border-strong);
  --text: var(--text-primary);
  --muted: var(--text-tertiary);
  --subtle: var(--text-muted);
  --accent: #aab989;
  --accent-ink: #10130d;
  --cyan: var(--mint);
  --rose: #ef7d91;
  --purple: #b9a0ff;
  --success: var(--green);
  --danger: var(--red);
  --focus: rgba(104, 255, 203, 0.2);
  --height-minor: 48px;
  --height-major: 72px;
  --topbar-height: 72px;
  --radius-shell: 30px;
  --radius-panel: 22px;
  --radius-card: 16px;
  --radius-control: 12px;
  --radius-small: 8px;
  --font-sans: "Geist", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-family: var(--font-sans);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

button,
select,
input[type="file"] + * {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.app-shell {
  min-height: 100vh;
}

body.is-auth-locked {
  overflow: hidden;
}

.auth-gate {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  min-height: 100vh;
  place-items: center;
  background: var(--app);
  padding: 32px;
}

.auth-gate[hidden] {
  display: none;
}

.auth-panel {
  width: min(420px, 100%);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-small);
  background: var(--card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 24px 64px rgba(0, 0, 0, 0.34);
  padding: 28px;
}

.auth-panel-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 20px;
}

.auth-panel-heading .eyebrow {
  margin: 0 0 3px;
  color: #94a477;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0;
}

.auth-panel-heading h1 {
  margin: 0;
  color: var(--text-primary);
  font-size: 26px;
  font-weight: 740;
  letter-spacing: 0;
}

.auth-mark {
  display: inline-flex;
  width: var(--height-minor);
  height: var(--height-minor);
  flex: 0 0 var(--height-minor);
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(104, 255, 203, 0.14);
  border-radius: var(--radius-small);
  background: #17231d;
  color: #b9d8c7;
}

.auth-form {
  margin-top: 22px;
}

.auth-field {
  display: grid;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 680;
}

.auth-input-wrap {
  position: relative;
  display: block;
}

.auth-input-wrap > svg {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 14px;
  width: 17px;
  height: 17px;
  color: var(--text-muted);
  pointer-events: none;
  transform: translateY(-50%);
}

.auth-input-wrap input {
  width: 100%;
  height: var(--height-minor);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-small);
  outline: none;
  background: var(--control);
  color: var(--text-primary);
  padding: 0 14px 0 42px;
}

.auth-input-wrap input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--focus);
}

.auth-input-wrap input:disabled {
  opacity: 0.65;
}

.auth-error {
  min-height: 20px;
  margin: 9px 0;
  color: var(--text-muted);
  font-size: 11px;
}

.auth-error[data-type="error"] {
  color: #ff8d9c;
}

.auth-error[data-type="info"] {
  color: var(--text-secondary);
}

.auth-submit {
  width: 100%;
}

.runtime-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(243, 189, 85, 0.12);
}

.runtime-dot.is-ready {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(105, 216, 138, 0.12);
}

.runtime-dot.is-offline {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(255, 109, 116, 0.12);
}

.workspace {
  min-width: 0;
  margin-left: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 13, 14, 0.94);
  padding: 0 32px;
  backdrop-filter: blur(12px);
}

.stage-navigation {
  display: flex;
  min-width: 420px;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.stage-navigation > svg {
  width: 14px;
  height: 14px;
  color: var(--subtle);
}

.stage-tab {
  display: inline-flex;
  min-width: 94px;
  height: var(--height-minor);
  align-items: center;
  gap: 8px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  cursor: pointer;
}

.stage-tab[data-workspace-link="voice"] {
  min-width: 148px;
}

.project-setup-page[hidden],
.stage-navigation[hidden],
.workspace-page[hidden] {
  display: none;
}

.topbar-run-controls {
  gap: 8px;
}

.topbar-run-controls select {
  width: 126px;
  height: var(--height-minor);
  border-color: var(--border-default);
  border-radius: var(--radius-control);
  background: var(--control);
  padding-right: 30px;
  font-size: 11px;
}

.topbar-run-controls .primary-button {
  min-width: 142px;
  white-space: nowrap;
}

.stage-tab:hover,
.stage-tab:focus-visible {
  background: var(--surface);
  color: var(--text);
  outline: none;
}

.stage-tab.is-active {
  background: var(--surface-hover);
  color: var(--text);
}

.stage-tab .stage-index {
  color: var(--subtle);
  font-size: 9px;
  font-weight: 800;
}

.stage-tab > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.15;
}

.stage-tab strong {
  font-size: 12px;
  white-space: nowrap;
}

.stage-tab small {
  margin-top: 3px;
  color: var(--subtle);
  font-size: 8px;
  white-space: nowrap;
}

.stage-tab[data-state="ready"] .stage-index,
.stage-tab[data-state="ready"] small {
  color: var(--success);
}

.stage-tab[data-state="review"] .stage-index,
.stage-tab[data-state="review"] small {
  color: var(--amber);
}

.project-switcher {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.project-switcher label {
  color: var(--muted);
  font-size: 12px;
}

select,
input[type="text"] {
  height: var(--height-minor);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: none;
  background: #101314;
  color: var(--text);
  padding: 0 12px;
}

select:focus,
input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus);
}

.project-switcher select {
  width: min(320px, 36vw);
  border-color: transparent;
  background: var(--surface);
  font-weight: 650;
}

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

.icon-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: var(--line-strong);
  background: var(--surface-hover);
  color: var(--text);
  outline: none;
}

.icon-button:disabled {
  cursor: wait;
  opacity: 0.5;
}

main {
  width: min(1460px, 100%);
  margin: 0 auto;
  padding: 26px 32px 80px;
}

.workspace-page {
  display: none;
}

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

.workspace-page-heading {
  display: flex;
  min-height: 92px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  border-bottom: 1px solid var(--line);
  padding: 8px 0 22px;
}

.workspace-page-heading > div {
  min-width: 0;
}

.workspace-page-heading h1 {
  margin: 3px 0 0;
  font-size: 28px;
  line-height: 1.2;
}

.workspace-page-heading p {
  width: min(520px, 48%);
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.work-section {
  scroll-margin-top: calc(var(--topbar-height) + 16px);
  border-bottom: 1px solid var(--line);
  padding: 28px 0 34px;
}

.project-section {
  padding-top: 12px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.compact-heading {
  align-items: center;
  margin-bottom: 18px;
}

.section-heading h1,
.section-heading h2,
.project-summary h2 {
  margin: 0;
  overflow-wrap: anywhere;
}

.section-heading h1 {
  font-size: 28px;
  line-height: 1.2;
}

.section-heading h2,
.project-summary h2 {
  font-size: 18px;
  line-height: 1.25;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
}

.section-meta {
  color: var(--muted);
  font-size: 12px;
}

.project-actions {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.project-actions .primary-button {
  min-width: 160px;
  white-space: nowrap;
}

.compact-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.compact-field span,
.field > span,
.style-field legend {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.compact-field select {
  min-width: 142px;
}

.primary-button {
  display: inline-flex;
  min-height: var(--height-minor);
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0 17px;
  font-weight: 800;
  cursor: pointer;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: #c5ff4d;
  outline: 3px solid var(--focus);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.project-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

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

.field {
  display: flex;
  grid-column: span 3;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.source-attestation {
  display: flex;
  grid-column: span 3;
  min-width: 0;
  min-height: var(--height-minor);
  align-self: end;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border-default);
  border-radius: 6px;
  background: var(--control);
  padding: 7px 10px;
  cursor: pointer;
}

.source-attestation input {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  accent-color: #8eaa78;
}

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

.source-attestation strong {
  color: var(--text-secondary);
  font-size: 10px;
}

.source-attestation small {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-attestation.is-disabled {
  cursor: default;
  opacity: 0.45;
}

.field-wide {
  grid-column: span 12;
}

.upload-field {
  position: relative;
  display: flex;
  grid-column: span 6;
  min-width: 0;
  min-height: 96px;
  align-items: center;
  gap: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  background: #101314;
  padding: 16px;
  cursor: pointer;
}

.upload-field:hover,
.upload-field.is-dragging {
  border-color: var(--accent);
  background: #151a12;
}

.upload-field input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--cyan);
}

.upload-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

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

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

.file-action {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.style-field {
  display: grid;
  grid-column: span 6;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 0;
  align-items: flex-end;
  gap: 8px;
  margin: 0;
  border: 0;
  padding: 0;
}

.style-field legend {
  grid-column: 1 / -1;
  width: auto;
  margin-bottom: -1px;
}

.style-option {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 8px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  cursor: pointer;
}

.style-option.is-selected {
  border-color: var(--accent);
  background: #182015;
}

.style-option.is-disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.style-option input {
  position: absolute;
  opacity: 0;
}

.style-option > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.2;
}

.style-option small {
  color: var(--muted);
  font-size: 10px;
}

.style-swatch {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
}

.live-action-swatch {
  background: #50645c;
}

.animation-swatch {
  background: #cf855b;
}

.three-d-swatch {
  background: #7567ab;
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  border-top: 1px solid var(--line);
  padding: 14px 20px;
}

.form-footer p {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.form-footer p svg {
  width: 15px;
  height: 15px;
}

.project-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px 20px;
}

.summary-primary {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 14px;
}

.project-status,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.project-status {
  min-width: 72px;
  min-height: 28px;
}

.status-pill[data-status="succeeded"],
.status-pill[data-status="completed"],
.status-pill[data-status="confirmed"],
.status-pill[data-status="ready"],
.project-status[data-status="completed"],
.project-status[data-status="succeeded"] {
  border-color: rgba(105, 216, 138, 0.45);
  background: rgba(105, 216, 138, 0.1);
  color: var(--success);
}

.status-pill[data-status="running"],
.status-pill[data-status="waiting_external"],
.project-status[data-status="running"] {
  border-color: rgba(85, 215, 209, 0.45);
  background: rgba(85, 215, 209, 0.1);
  color: var(--cyan);
}

.status-pill[data-status="failed"],
.status-pill[data-status="terminal_failed"],
.status-pill[data-status="retryable_failed"],
.project-status[data-status="failed"] {
  border-color: rgba(255, 109, 116, 0.45);
  background: rgba(255, 109, 116, 0.1);
  color: var(--danger);
}

.status-pill[data-status="waiting_review"],
.status-pill[data-status="needs_review"],
.status-pill[data-status="proposed"] {
  border-color: rgba(243, 189, 85, 0.45);
  background: rgba(243, 189, 85, 0.1);
  color: var(--amber);
}

.summary-primary p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.summary-metrics {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 26px;
}

.summary-metric {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.summary-metric strong {
  font-size: 18px;
}

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

.table-shell {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
}

table {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
  table-layout: fixed;
  background: var(--surface);
}

th:nth-child(1) { width: 12%; }
th:nth-child(2) { width: 20%; }
th:nth-child(3) { width: 13%; }
th:nth-child(4) { width: 9%; }
th:nth-child(5) { width: 11%; }
th:nth-child(6) { width: 13%; }
th:nth-child(7) { width: 10%; }
th:nth-child(8) { width: 12%; }

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

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

th {
  background: #111415;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

td {
  font-size: 12px;
  overflow-wrap: anywhere;
}

.identity-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.face-thumb,
.asset-thumb {
  display: grid;
  overflow: hidden;
  place-items: center;
  background: #272d2c;
  color: var(--muted);
}

.face-thumb {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 5px;
}

.face-thumb img,
.asset-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.identity-cell div,
.voice-cell {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.identity-cell small,
.voice-cell small {
  color: var(--muted);
  font-size: 10px;
}

.face-review-control {
  width: 100%;
  height: 28px;
  margin-top: 5px;
  padding: 0 7px;
  font-size: 10px;
}

.audio-control {
  display: inline-flex;
  max-width: 180px;
  align-items: center;
  gap: 7px;
}

.voice-review-control {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.voice-review-control select {
  width: 100%;
  height: 32px;
  padding: 0 9px;
  font-size: 11px;
}

.play-audio {
  display: inline-grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface-raised);
  color: var(--cyan);
  cursor: pointer;
}

.play-audio svg {
  width: 13px;
  height: 13px;
}

.confidence-meter {
  display: flex;
  align-items: center;
  gap: 8px;
}

.confidence-track {
  width: 52px;
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: #303635;
}

.confidence-meter strong {
  white-space: nowrap;
}

.confidence-track span {
  display: block;
  height: 100%;
  background: var(--success);
}

.evidence-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--cyan);
  white-space: nowrap;
}

.evidence-count svg {
  width: 14px;
  height: 14px;
}

.review-state {
  display: grid;
  min-width: 0;
  justify-items: start;
  gap: 7px;
}

.review-state small {
  color: var(--subtle);
  font-size: 9px;
  white-space: nowrap;
}

.review-actions {
  display: flex;
  gap: 6px;
}

.review-icon-button {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface-raised);
  color: var(--muted);
  cursor: pointer;
}

.review-icon-button.is-confirm {
  border-color: rgba(105, 216, 138, 0.48);
  background: rgba(105, 216, 138, 0.09);
  color: var(--success);
}

.review-icon-button:hover:not(:disabled),
.review-icon-button:focus-visible:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}

.review-icon-button:disabled {
  cursor: default;
  opacity: 0.32;
}

.review-icon-button svg {
  width: 14px;
  height: 14px;
}

.identity-row td {
  border-bottom: 0;
  padding-bottom: 8px;
}

.identity-evidence-row td {
  background: #111415;
  padding-top: 0;
  padding-bottom: 12px;
}

.identity-evidence-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  align-items: flex-end;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.clone-sample-state,
.clone-quality-review {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.clone-sample-state small,
.clone-quality-review > small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clone-quality-review {
  grid-column: 1 / -1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
}

.clone-quality-review legend {
  color: var(--muted);
  padding: 0 6px;
  font-size: 10px;
  font-weight: 700;
}

.clone-quality-review label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-right: 12px;
  color: var(--muted);
  font-size: 10px;
}

.clone-quality-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.capability-strip,
.asset-lane-summary {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.capability-item,
.asset-lane-item {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  padding: 7px 9px;
}

.capability-item > svg {
  width: 14px;
  height: 14px;
  color: var(--success);
}

.capability-item[data-available="false"] > svg {
  color: var(--amber);
}

.capability-item > span,
.asset-lane-item {
  min-width: 0;
}

.capability-item strong,
.capability-item small,
.asset-lane-item strong,
.asset-lane-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.capability-item strong,
.asset-lane-item strong {
  font-size: 10px;
}

.capability-item small,
.asset-lane-item small {
  max-width: 230px;
  color: var(--muted);
  font-size: 9px;
}

.asset-lane-item b {
  color: var(--accent);
  font-size: 12px;
}

.evidence-warning-disclosure {
  margin-bottom: 12px;
  border-left: 2px solid var(--amber);
  background: rgba(243, 189, 85, 0.05);
  padding: 8px 12px;
}

.evidence-warning-disclosure summary {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--amber);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.evidence-warning-disclosure p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.understanding-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(380px, 1.2fr);
  gap: 12px;
}

.understanding-player,
.understanding-player video {
  width: 100%;
  aspect-ratio: 16 / 9;
}

.understanding-player {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #080a0b;
  color: var(--muted);
}

.understanding-player video {
  display: block;
  object-fit: contain;
}

.speaking-turn-list {
  display: grid;
  max-height: 420px;
  align-content: start;
  overflow: auto;
  border-top: 1px solid var(--line);
}

.speaking-turn {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  border-bottom: 1px solid var(--line);
  padding: 8px 4px;
  transition: background 160ms ease, border-color 160ms ease;
}

.speaking-turn.is-located {
  border-bottom-color: rgba(104, 255, 203, 0.22);
  background: rgba(104, 255, 203, 0.035);
}

.turn-time,
.turn-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.turn-time strong,
.turn-time span {
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.turn-time span,
.turn-copy small,
.turn-label {
  color: var(--muted);
  font-size: 9px;
}

.turn-copy p {
  margin: 3px 0;
  font-size: 12px;
}

.turn-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.turn-seek-button {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface-raised);
  color: var(--muted);
  cursor: pointer;
}

.turn-seek-button:hover,
.turn-seek-button:focus-visible {
  border-color: rgba(104, 255, 203, 0.35);
  color: var(--mint);
  outline: none;
}

.turn-seek-button svg {
  width: 13px;
  height: 13px;
}

.script-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.script-pane {
  min-width: 0;
  background: var(--surface);
}

.script-pane-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
}

.script-pane-heading div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.script-pane-heading span {
  font-size: 11px;
  font-weight: 800;
}

.script-pane-heading small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.script-pane pre {
  height: 300px;
  margin: 0;
  overflow: auto;
  color: #d8dedb;
  padding: 14px;
  font: 11px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
}

.script-ledger {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.script-ledger h3 {
  margin: 0 0 8px;
  font-size: 11px;
}

.script-ledger p,
.script-ledger dl,
.script-ledger dd,
.script-ledger dt {
  margin: 0;
}

.script-ledger p,
.script-ledger dl div {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  padding: 6px 0;
  color: var(--muted);
  font-size: 10px;
}

.script-ledger svg {
  width: 12px;
  height: 12px;
  margin-top: 1px;
}

.script-ledger dt,
.script-ledger dd {
  min-width: 0;
  flex: 1;
}

.evidence-list {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-wrap: wrap;
  gap: 7px;
}

.evidence-item {
  display: inline-flex;
  min-width: 0;
  max-width: 260px;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  padding: 6px 8px;
}

.evidence-item > svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  color: var(--purple);
}

.evidence-thumb {
  width: 42px;
  height: 30px;
  flex: 0 0 42px;
  border-radius: 3px;
  object-fit: cover;
}

.evidence-item > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

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

.evidence-item strong {
  font-size: 10px;
}

.evidence-item small,
.evidence-empty {
  color: var(--muted);
  font-size: 9px;
}

.evidence-play {
  width: 24px;
  height: 24px;
  flex-basis: 24px;
}

.review-note-field {
  display: grid;
  width: 220px;
  flex: 0 0 220px;
  gap: 4px;
}

.review-note-field span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.review-note-field input {
  width: 100%;
  height: 32px;
  font-size: 11px;
}

.mobile-identity-review {
  display: none;
}

.voice-candidate-form {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) 105px 105px minmax(220px, 1.4fr) auto;
  align-items: end;
  gap: 9px;
  border-top: 1px solid var(--line);
  padding: 10px 0;
}

.voice-candidate-form[hidden] {
  display: none;
}

.voice-candidate-form label {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.voice-candidate-form label > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.voice-candidate-form input {
  width: 100%;
  height: 34px;
  font-size: 11px;
}

.voice-candidate-form .secondary-button {
  min-height: 34px;
  white-space: nowrap;
}

.empty-row td {
  height: 96px;
  color: var(--muted);
  text-align: center;
}

.segmented-control {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #101314;
  padding: 3px;
}

.segmented-control button {
  min-height: 28px;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  padding: 0 11px;
  font-size: 11px;
  cursor: pointer;
}

.segmented-control button.is-active {
  background: var(--surface-hover);
  color: var(--text);
}

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

.asset-item {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.asset-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-bottom: 1px solid var(--line);
}

.asset-thumb.is-audio {
  background: #172322;
  color: var(--cyan);
}

.asset-thumb svg {
  width: 26px;
  height: 26px;
}

.asset-info {
  padding: 10px;
}

.asset-info-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.asset-info h3 {
  min-width: 0;
  flex: 1;
  margin: 0;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-info p {
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-actions {
  display: flex;
  margin-top: 8px;
}

.asset-preview-button {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  padding: 0 9px;
  font-size: 12px;
  cursor: pointer;
}

.asset-preview-button:hover,
.asset-preview-button:focus-visible {
  border-color: var(--line-strong);
  color: var(--text);
  outline: none;
}

.asset-preview-button svg {
  width: 14px;
  height: 14px;
}

.asset-type {
  flex: none;
  color: var(--purple);
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.segment-list {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.segment-row {
  display: grid;
  grid-template-columns: 70px minmax(170px, 0.8fr) minmax(240px, 1.4fr) minmax(180px, 0.8fr) 100px;
  min-height: 76px;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 10px 14px;
}

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

.segment-index {
  display: flex;
  flex-direction: column;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.segment-index small,
.segment-time small,
.segment-prompt small,
.segment-output small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.segment-time,
.segment-prompt,
.segment-output {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.segment-prompt span,
.segment-output span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.segment-action {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

.text-button {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  padding: 0 9px;
  font-size: 11px;
  cursor: pointer;
}

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

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

.final-heading-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.delivery-button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 7px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
}

.delivery-button:hover,
.delivery-button:focus-visible {
  background: #c5ff4d;
  outline: 3px solid var(--focus);
}

.preview-pane {
  min-width: 0;
}

.preview-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.preview-label span {
  font-size: 12px;
  font-weight: 750;
}

.preview-label small {
  color: var(--muted);
  font-size: 10px;
}

.video-placeholder,
.preview-pane video {
  display: grid;
  width: 100%;
  aspect-ratio: 16 / 9;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #050606;
  color: var(--subtle);
  object-fit: contain;
}

.video-placeholder {
  align-content: center;
  justify-items: center;
  gap: 8px;
}

.video-placeholder svg {
  width: 28px;
  height: 28px;
}

.empty-state {
  display: grid;
  grid-column: 1 / -1;
  min-height: 150px;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  color: var(--subtle);
  padding: 24px;
  text-align: center;
}

.empty-state p {
  max-width: 560px;
  margin: 0;
}

.compact-empty {
  width: 100%;
  min-height: 96px;
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  display: grid;
  width: min(380px, calc(100vw - 36px));
  gap: 8px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #202526;
  color: var(--text);
  padding: 12px 14px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
}

.toast.is-error {
  border-color: rgba(255, 109, 116, 0.55);
}

.toast.is-success {
  border-color: rgba(105, 216, 138, 0.55);
}

.toast p {
  margin: 0;
}

.toast small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

.spin {
  animation: spin 900ms linear infinite;
}

[hidden] {
  display: none !important;
}

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

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

  .segment-row {
    grid-template-columns: 60px minmax(140px, 0.7fr) minmax(200px, 1.3fr) 90px;
  }

  .segment-output {
    display: none;
  }

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

  .project-switcher label,
  .stage-tab small {
    display: none;
  }

  .stage-navigation {
    min-width: 350px;
  }

  .stage-tab {
    min-width: 78px;
  }
}

@media (max-width: 860px) {
  :root {
    --topbar-height: 144px;
  }

  .workspace {
    margin-left: 0;
  }

  .topbar {
    height: var(--topbar-height);
    flex-wrap: wrap;
    padding: 0 18px;
  }

  .project-switcher {
    flex: 1;
  }

  .stage-navigation {
    order: 3;
    width: 100%;
    min-width: 0;
    flex: 0 0 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 7px;
  }

  .stage-tab {
    flex: 1 0 auto;
  }

  main {
    padding-right: 18px;
    padding-left: 18px;
  }

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

  .field-wide,
  .upload-field,
  .style-field {
    grid-column: span 6;
  }

  .field {
    grid-column: span 3;
  }

  .source-attestation {
    grid-column: span 3;
  }

  .comparison-view {
    grid-template-columns: 1fr;
  }

  .identity-evidence-panel {
    grid-template-columns: 1fr;
  }

  .understanding-layout {
    grid-template-columns: 1fr;
  }

  .review-note-field {
    width: 100%;
    flex-basis: auto;
  }

  .voice-candidate-form {
    grid-template-columns: minmax(150px, 1fr) 105px 105px;
  }

  .voice-candidate-note {
    grid-column: 1 / 3;
  }
}

@media (max-width: 620px) {
  .topbar {
    gap: 8px;
    padding: 0 12px;
  }

  .project-switcher {
    flex: 1;
  }

  .project-switcher label {
    display: none;
  }

  .project-switcher select {
    width: 100%;
    max-width: none;
  }

  main {
    padding: 18px 12px 60px;
  }

  .workspace-page-heading {
    min-height: 80px;
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
    padding-bottom: 16px;
  }

  .workspace-page-heading h1 {
    font-size: 23px;
  }

  .workspace-page-heading p {
    width: 100%;
    text-align: left;
  }

  .stage-navigation > svg {
    display: none;
  }

  .stage-tab {
    min-width: 86px;
    height: var(--height-minor);
    justify-content: center;
    padding: 0 8px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .compact-heading {
    align-items: flex-start;
  }

  .project-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .compact-field select,
  .project-actions .primary-button {
    width: 100%;
  }

  .form-grid {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .field,
  .field-wide,
  .upload-field,
  .style-field,
  .source-attestation {
    grid-column: 1;
  }

  .upload-field {
    min-height: 86px;
  }

  .file-action {
    display: none;
  }

  .style-field legend {
    grid-column: 1 / -1;
  }

  .style-option {
    min-height: var(--height-major);
    height: auto;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
  }

  .form-footer {
    align-items: stretch;
    flex-direction: column;
    padding: 14px;
  }

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

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

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

  .summary-metrics {
    width: 100%;
    justify-content: space-between;
    gap: 12px;
  }

  .summary-metric {
    align-items: flex-start;
  }

  .segmented-control {
    width: 100%;
    overflow-x: auto;
  }

  .segmented-control button {
    flex: 1 0 auto;
  }

  .mobile-identity-review {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mobile-identity-review small {
    overflow: hidden;
    color: var(--subtle);
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  table {
    min-width: 980px;
  }

  th,
  td {
    padding-right: 8px;
    padding-left: 8px;
  }

  th:nth-child(1) { width: 17%; }
  th:nth-child(2) { width: 22%; }
  th:nth-child(3) { width: 18%; }
  th:nth-child(4) { width: 8%; }
  th:nth-child(5) { width: 12%; }
  th:nth-child(6) { width: 10%; }
  th:nth-child(7) { width: 9%; }
  th:nth-child(8) { width: 13%; }

  .identity-cell {
    gap: 6px;
  }

  .identity-cell strong {
    font-size: 11px;
    white-space: nowrap;
  }

  .face-thumb {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  .voice-candidate-form {
    grid-template-columns: 1fr 1fr;
  }

  .voice-candidate-form > label:first-child,
  .voice-candidate-note,
  .voice-candidate-form .secondary-button {
    grid-column: 1 / -1;
  }

  .voice-candidate-form .secondary-button {
    width: 100%;
  }

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

  .script-columns,
  .script-ledger {
    grid-template-columns: 1fr;
  }

  .script-pane pre {
    height: 240px;
  }

  .segment-row {
    grid-template-columns: 56px minmax(0, 1fr) 72px;
    gap: 8px;
  }

  .segment-time,
  .segment-output {
    display: none;
  }

  .segment-prompt small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .preview-label {
    align-items: flex-start;
    flex-direction: column;
    gap: 1px;
  }
}

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

/* Lumi media-console contract: top workflow navigation, no in-tab sidebar. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.workspace {
  margin-left: 0;
  background: var(--app);
}

.topbar {
  display: grid;
  height: var(--topbar-height);
  grid-template-columns: minmax(300px, 1fr) auto minmax(230px, 1fr);
  gap: 20px;
  border-color: var(--border-subtle);
  background: rgba(13, 13, 15, 0.96);
  padding: 0 clamp(20px, 2.5vw, 48px);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.018);
  backdrop-filter: blur(18px);
}

.project-context,
.topbar-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.topbar-actions {
  justify-content: flex-end;
}

.topbar-back-button {
  display: inline-grid;
  width: var(--height-minor);
  height: var(--height-minor);
  flex: 0 0 var(--height-minor);
  place-items: center;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.topbar-back-button:hover,
.topbar-back-button:focus-visible {
  background: var(--control);
  color: var(--text-primary);
  outline: none;
}

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

.project-switcher select {
  width: min(280px, 24vw);
  height: var(--height-minor);
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-primary);
  padding: 0 30px 0 4px;
  font-size: 15px;
  font-weight: 720;
}

.project-switcher select:hover,
.project-switcher select:focus {
  background: var(--control);
  box-shadow: none;
}

.style-badge {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: #1a1d17;
  color: #a7b88a;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.style-badge svg {
  width: 15px;
  height: 15px;
}

.stage-navigation {
  min-width: 0;
  gap: 6px;
}

.stage-navigation > svg {
  width: 15px;
  height: 15px;
  color: var(--text-muted);
}

.stage-tab {
  min-width: 108px;
  height: var(--height-minor);
  justify-content: center;
  gap: 9px;
  border-radius: 18px;
  color: var(--text-tertiary);
  padding: 0 14px;
}

.stage-tab > svg {
  width: 18px;
  height: 18px;
}

.stage-tab strong {
  font-size: 13px;
  letter-spacing: 0;
}

.stage-tab small {
  display: none;
}

.stage-tab:hover,
.stage-tab:focus-visible {
  background: var(--control);
  color: var(--text-secondary);
}

.stage-tab.is-active {
  border: 1px solid var(--border-subtle);
  background: var(--pressed);
  color: #b9d8c7;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.icon-button,
.new-project-button,
.secondary-button,
.primary-button,
.delivery-button {
  min-height: var(--height-minor);
  border-radius: var(--radius-control);
}

.icon-button {
  width: var(--height-minor);
  height: var(--height-minor);
  border-color: var(--border-default);
  background: var(--control);
}

.new-project-button {
  display: inline-flex;
  min-width: 88px;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(104, 255, 203, 0.12);
  background: #17231d;
  color: #b9d8c7;
  padding: 0 14px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.new-project-button span {
  white-space: nowrap;
}

.new-project-button:hover,
.new-project-button:focus-visible {
  border-color: rgba(104, 255, 203, 0.26);
  background: #1c2a22;
  outline: none;
}

main {
  width: 100%;
  max-width: none;
  padding: 24px clamp(24px, 3.4vw, 64px) 80px;
}

.workspace-page-heading {
  min-height: 96px;
  align-items: flex-start;
  border-color: var(--border-subtle);
  padding: 8px 0 28px;
}

.workspace-page-heading h1 {
  margin-top: 6px;
  font-size: 38px;
  font-weight: 760;
  letter-spacing: 0;
}

.workspace-page-heading p {
  display: none;
}

.eyebrow {
  color: #94a477;
  letter-spacing: 0;
}

.work-section {
  border-color: var(--border-subtle);
  padding: 32px 0 40px;
}

.project-form,
.project-summary,
.script-pane,
.script-ledger,
.table-shell,
.segment-list,
  .preview-pane {
  border-color: var(--border-default);
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 30%), var(--card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.project-form select,
.project-form input[type="text"],
.project-actions select,
.voice-candidate-form input,
.voice-candidate-form select {
  border-color: var(--border-default);
  border-radius: var(--radius-control);
  background: var(--control);
}

.primary-button {
  border: 1px solid rgba(104, 255, 203, 0.14);
  background: #203027;
  color: #c3dfd0;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: #293b31;
  color: var(--text-primary);
}

.secondary-button {
  border: 1px solid var(--border-default);
  background: var(--control);
  color: var(--text-secondary);
}

.secondary-button:hover,
.secondary-button:focus-visible {
  border-color: var(--border-strong);
  background: var(--hover);
  color: var(--text-primary);
  outline: none;
}

.asset-page-heading {
  min-height: var(--height-major);
  border-bottom: 0;
  padding: 0;
}

.asset-library-section {
  padding: 4px 0 40px;
}

.asset-toolbar {
  display: flex;
  min-height: var(--height-major);
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 16px;
}

.asset-toolbar-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.asset-toolbar-meta > span {
  color: var(--text-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums lining-nums;
}

.segmented-control {
  gap: 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.segmented-control button {
  display: inline-flex;
  min-width: 76px;
  min-height: var(--height-minor);
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  padding: 0 14px;
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 700;
}

.segmented-control button b {
  color: var(--text-muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums lining-nums;
}

.segmented-control button:hover,
.segmented-control button:focus-visible {
  background: var(--control);
  color: var(--text-secondary);
  outline: none;
}

.segmented-control button.is-active {
  border-color: var(--border-subtle);
  background: var(--pressed);
  color: var(--text-primary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.segmented-control button.is-active b {
  color: var(--text-secondary);
}

.asset-lane-summary:empty {
  display: none;
}

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

.asset-grid > .empty-state {
  grid-column: 1 / -1;
  min-height: 280px;
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-card);
  background: var(--panel);
}

.asset-item {
  position: relative;
  overflow: hidden;
  border-color: var(--border-default);
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 30%), var(--card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.asset-item:hover {
  border-color: var(--border-strong);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.028), transparent 30%), #19191b;
  transform: translateY(-1px);
}

.asset-thumb {
  position: relative;
  display: grid;
  aspect-ratio: 16 / 9;
  place-items: center;
  overflow: hidden;
  border-bottom-color: var(--border-default);
  background: var(--panel);
  color: var(--text-muted);
}

.asset-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 280ms ease;
}

.asset-item:hover .asset-thumb img {
  transform: scale(1.012);
}

.asset-media-type,
.asset-open-button {
  position: absolute;
  z-index: 1;
  top: 12px;
}

.asset-media-type {
  left: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-small);
  background: rgba(13, 13, 15, 0.76);
  color: var(--text-secondary);
  padding: 4px 8px;
  font-size: 10px;
  backdrop-filter: blur(10px);
}

.asset-open-button {
  right: 12px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-small);
  background: rgba(13, 13, 15, 0.76);
  color: var(--text-secondary);
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 160ms ease, transform 160ms ease, color 160ms ease;
  backdrop-filter: blur(10px);
}

.asset-item:hover .asset-open-button,
.asset-open-button:focus-visible {
  color: var(--text-primary);
  opacity: 1;
  outline: none;
  transform: translateY(0);
}

.asset-open-button svg {
  width: 15px;
  height: 15px;
}

.asset-info {
  padding: 16px;
}

.asset-info-top {
  align-items: center;
  gap: 12px;
}

.asset-info h3 {
  font-size: 14px;
  font-weight: 720;
}

.asset-info-top .status-pill {
  flex: 0 0 auto;
}

.asset-description {
  display: -webkit-box;
  min-height: 54px;
  margin: 10px 0 14px !important;
  overflow: hidden !important;
  color: var(--text-tertiary) !important;
  font-size: 11px !important;
  line-height: 1.65;
  text-overflow: clip !important;
  white-space: normal !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.asset-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
  color: var(--text-muted);
  font-size: 9px;
}

.asset-card-footer code {
  overflow: hidden;
  color: var(--text-muted);
  font-family: var(--font-mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1600px) {
  .topbar {
    grid-template-columns: minmax(300px, 0.8fr) auto minmax(392px, 1.2fr);
    gap: 12px;
  }

  .style-badge {
    display: none;
  }
}

@media (max-width: 1320px) {
  .topbar {
    grid-template-columns: minmax(230px, 0.7fr) auto minmax(390px, 1.3fr);
    gap: 12px;
  }

  .style-badge {
    display: none;
  }

  .stage-tab {
    min-width: 94px;
    padding: 0 11px;
  }

  .stage-tab[data-workspace-link="voice"] {
    min-width: 132px;
  }
}

@media (max-width: 1180px) {
  :root {
    --topbar-height: 144px;
  }

  .topbar {
    height: 144px;
    grid-template-columns: 1fr auto;
    grid-template-rows: var(--height-major) var(--height-major);
  }

  .stage-navigation {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .project-context {
    grid-column: 1;
  }

  .topbar-actions {
    grid-column: 2;
  }
}

@media (max-width: 1080px) {
  .topbar {
    height: 144px;
    grid-template-columns: 1fr auto;
    grid-template-rows: var(--height-major) var(--height-major);
  }

  :root {
    --topbar-height: 144px;
  }

  .stage-navigation {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .project-context {
    grid-column: 1;
  }

  .topbar-actions {
    grid-column: 2;
  }

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

@media (max-width: 760px) {
  .topbar {
    height: 144px;
    padding: 0 12px;
  }

  .project-switcher {
    flex: 1;
  }

  .project-switcher select {
    width: min(34vw, 180px);
  }

  .topbar-run-controls .compact-field {
    display: none;
  }

  .topbar-run-controls .primary-button {
    width: var(--height-minor);
    min-width: var(--height-minor);
    padding: 0;
  }

  .topbar-run-controls .primary-button span {
    display: none;
  }

  .new-project-button {
    width: var(--height-minor);
    min-width: var(--height-minor);
    flex-basis: var(--height-minor);
    justify-content: center;
    padding: 0;
  }

  .new-project-button span {
    display: none;
  }

  .stage-navigation {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: none;
  }

  .stage-navigation::-webkit-scrollbar,
  .stage-navigation > svg {
    display: none;
  }

  .stage-tab {
    min-width: 106px;
    flex: 1 0 auto;
  }

  .stage-tab[data-workspace-link="voice"] {
    min-width: 148px;
  }

  main {
    padding: 24px 16px 60px;
  }

  .workspace-page-heading {
    min-height: 96px;
    padding-top: 4px;
  }

  .workspace-page-heading h1 {
    font-size: 32px;
  }

  .asset-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .asset-toolbar-meta {
    justify-content: space-between;
  }

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

@media (max-width: 520px) {
  .topbar-back-button {
    width: var(--height-minor);
    flex-basis: var(--height-minor);
  }

  .project-switcher select {
    width: min(30vw, 118px);
    font-size: 13px;
  }

  #refreshButton {
    display: none;
  }

  .workspace-page-heading p {
    display: none;
  }

  .workspace-page-heading {
    min-height: 96px;
  }

  .workspace-page-heading h1 {
    font-size: 26px;
  }

  .segmented-control {
    width: 100%;
  }

  .segmented-control button {
    min-width: 0;
    flex: 1 1 25%;
    padding: 0 8px;
  }

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

  .asset-thumb {
    aspect-ratio: 16 / 9;
  }
}

.topbar.is-setup {
  height: var(--height-major);
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: var(--height-major);
}

.topbar.is-setup .project-context {
  grid-column: 1;
  grid-row: 1;
}

.topbar.is-setup .topbar-actions {
  grid-column: 2;
  grid-row: 1;
}

/* Source identity correction controls stay inside the existing voice workspace. */
.speaker-cluster-workbench {
  position: sticky;
  z-index: 2;
  top: 0;
  border-bottom: 1px solid var(--border-default);
  background: rgba(18, 18, 20, 0.97);
  backdrop-filter: blur(14px);
}

.speaker-cluster-workbench > summary {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 8px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 10px;
  font-weight: 720;
  list-style: none;
}

.speaker-cluster-workbench > summary::-webkit-details-marker {
  display: none;
}

.speaker-cluster-workbench > summary > span:first-child {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.speaker-cluster-workbench > summary svg {
  width: 14px;
  height: 14px;
  color: #a7b88a;
}

.speaker-cluster-workbench > summary b {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.cluster-candidate-list {
  display: grid;
  max-height: 124px;
  overflow-y: auto;
  border-top: 1px solid var(--border-subtle);
}

.cluster-candidate-row {
  display: grid;
  min-width: 0;
  min-height: 38px;
  grid-template-columns: 18px minmax(112px, 1fr) auto 28px minmax(48px, auto);
  align-items: center;
  gap: 7px;
  border-bottom: 1px solid var(--border-subtle);
  padding: 4px 8px;
}

.cluster-candidate-row:last-child {
  border-bottom: 0;
}

.cluster-candidate-row input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: #94a477;
}

.cluster-candidate-row input[type="text"],
.cluster-merge-bar select,
.turn-assignment select,
.character-create-form input,
.character-create-form select,
.character-inline-editor input[type="text"] {
  min-width: 0;
  height: 28px;
  border: 1px solid var(--border-default);
  border-radius: 6px;
  outline: none;
  background: var(--control);
  color: var(--text-primary);
  padding: 0 8px;
  font-size: 10px;
}

.cluster-candidate-row input[type="text"]:focus,
.cluster-merge-bar select:focus,
.turn-assignment select:focus,
.character-create-form input:focus,
.character-create-form select:focus,
.character-inline-editor input[type="text"]:focus {
  border-color: rgba(104, 255, 203, 0.32);
  box-shadow: 0 0 0 2px rgba(104, 255, 203, 0.06);
}

.cluster-turn-count {
  color: var(--text-muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cluster-merge-bar {
  display: grid;
  min-height: 42px;
  grid-template-columns: auto minmax(110px, 1fr) auto minmax(52px, auto);
  align-items: center;
  gap: 7px;
  border-top: 1px solid var(--border-subtle);
  padding: 6px 8px;
}

.cluster-merge-bar > span:first-child {
  color: var(--text-tertiary);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.speaker-cluster-empty {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 7px;
  border-bottom: 1px solid var(--border-default);
  color: var(--text-muted);
  padding: 0 8px;
  font-size: 10px;
}

.speaker-cluster-empty svg {
  width: 14px;
  height: 14px;
}

.compact-icon-button,
.compact-command-button {
  display: inline-flex;
  height: 28px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-default);
  border-radius: 6px;
  background: var(--control);
  color: var(--text-secondary);
  cursor: pointer;
}

.compact-icon-button {
  width: 28px;
  padding: 0;
}

.compact-command-button {
  gap: 5px;
  padding: 0 9px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.compact-icon-button:hover:not(:disabled),
.compact-icon-button:focus-visible:not(:disabled),
.compact-command-button:hover:not(:disabled),
.compact-command-button:focus-visible:not(:disabled),
.compact-icon-button.is-active {
  border-color: rgba(104, 255, 203, 0.3);
  background: #1c2a22;
  color: #b9d8c7;
  outline: none;
}

.compact-icon-button:disabled,
.compact-command-button:disabled {
  cursor: default;
  opacity: 0.34;
}

.compact-icon-button svg,
.compact-command-button svg {
  width: 13px;
  height: 13px;
}

.inline-operation-status {
  min-width: 0;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inline-operation-status[data-type="success"] {
  color: #83caa8;
}

.inline-operation-status[data-type="error"] {
  color: #ef7d91;
}

.correction-notice {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  color: #83caa8;
  font-size: 9px;
  font-weight: 650;
  white-space: nowrap;
}

.correction-notice[data-type="error"] {
  color: #ef7d91;
}

.correction-notice svg {
  width: 12px;
  height: 12px;
}

.speaking-turn-list {
  max-height: 520px;
}

.turn-assignment {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(110px, 1fr) auto minmax(42px, auto);
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.turn-assignment select {
  width: 100%;
}

.character-correction-toolbar {
  display: grid;
  gap: 7px;
  border-top: 1px solid var(--border-subtle);
  padding: 10px 0;
}

.character-correction-toolbar[hidden] {
  display: none;
}

.correction-toolbar-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.correction-toolbar-heading strong {
  color: var(--text-tertiary);
  font-size: 9px;
  font-weight: 750;
}

.character-create-form {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(130px, 0.8fr) minmax(150px, 0.9fr) minmax(170px, 1fr) auto minmax(56px, auto);
  align-items: center;
  gap: 7px;
}

.character-create-form input,
.character-create-form select {
  width: 100%;
  height: 32px;
  font-size: 10px;
}

.character-create-form .compact-command-button {
  height: 32px;
}

.identity-profile {
  width: 100%;
}

.identity-profile .character-name-row {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-direction: row;
  gap: 5px;
}

.character-name-row > strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.character-edit-button {
  width: 24px;
  height: 24px;
  margin-left: auto;
  flex: 0 0 24px;
  opacity: 0;
}

.identity-row:hover .character-edit-button,
.character-edit-button:focus-visible,
.character-edit-button.is-active {
  opacity: 1;
}

.character-archive-state {
  flex: 0 0 auto;
  color: #d7ad61;
  font-size: 8px;
  font-weight: 700;
}

.identity-profile .character-inline-editor {
  display: grid;
  min-width: 250px;
  grid-template-columns: minmax(88px, 1fr) minmax(88px, 1fr) auto auto minmax(44px, auto);
  align-items: center;
  gap: 5px;
  margin: 6px 0 2px;
}

.identity-profile .character-inline-editor[hidden] {
  display: none;
}

.character-archive-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-tertiary);
  font-size: 9px;
  white-space: nowrap;
}

.character-archive-toggle input {
  width: 14px;
  height: 14px;
  accent-color: #d59a2f;
}

@media (max-width: 860px) {
  .character-create-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .character-create-form select {
    grid-column: 1 / -1;
  }

  .character-create-form .inline-operation-status {
    align-self: center;
  }
}

@media (max-width: 620px) {
  .cluster-candidate-row {
    grid-template-columns: 18px minmax(0, 1fr) auto 28px;
  }

  .cluster-candidate-row > .inline-operation-status {
    display: none;
  }

  .cluster-merge-bar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .cluster-merge-bar > span:first-child {
    display: none;
  }

  .cluster-merge-bar > .inline-operation-status {
    grid-column: 1 / -1;
  }

  .speaking-turn {
    grid-template-columns: 62px minmax(0, 1fr) auto;
    gap: 7px;
  }

  .turn-assignment {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .turn-assignment .inline-operation-status {
    grid-column: 1 / -1;
  }

  .character-create-form {
    grid-template-columns: 1fr;
  }

  .character-create-form select,
  .character-create-form .inline-operation-status {
    grid-column: 1;
  }

  .character-create-form .compact-command-button {
    width: 100%;
  }

  .identity-profile .character-inline-editor {
    min-width: 220px;
    grid-template-columns: minmax(86px, 1fr) minmax(86px, 1fr) auto;
  }

  .character-inline-editor .compact-command-button,
  .character-inline-editor .inline-operation-status {
    grid-column: span 1;
  }

  .character-edit-button {
    opacity: 1;
  }
}

/* Versioned render controls and final responsive corrections. */
.segment-index {
  min-width: 0;
  overflow: hidden;
}

.segment-index small {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.segment-regenerate-form,
.attempt-history {
  grid-column: 1 / -1;
  border-top: 1px solid var(--border-subtle);
  padding-top: 8px;
}

.segment-regenerate-form[hidden] {
  display: none;
}

.segment-regenerate-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(72px, auto);
  align-items: center;
  gap: 8px;
}

.segment-regenerate-form input {
  width: 100%;
  height: 32px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-small);
  outline: 0;
  background: var(--control);
  color: var(--text-primary);
  padding: 0 10px;
  font-size: 11px;
}

.segment-regenerate-form input:focus {
  border-color: rgba(104, 255, 203, 0.32);
  box-shadow: 0 0 0 2px rgba(104, 255, 203, 0.06);
}

.attempt-history summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 10px;
}

.attempt-history summary small {
  max-width: 60%;
  overflow: hidden;
  color: var(--text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attempt-list {
  display: grid;
  margin-top: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-small);
  overflow: hidden;
}

.attempt-row {
  display: grid;
  min-width: 0;
  min-height: var(--height-minor);
  grid-template-columns: 32px 72px minmax(120px, 1fr) 84px 28px 60px;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  padding: 5px 8px;
}

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

.attempt-version,
.attempt-row > small {
  color: var(--text-muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.attempt-reason {
  min-width: 0;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attempt-selected {
  justify-self: end;
  color: #83caa8;
  font-size: 9px;
  font-weight: 750;
}

@media (max-width: 760px) {
  .stage-navigation {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 14px, #000 calc(100% - 14px), transparent);
    mask-image: linear-gradient(to right, transparent, #000 14px, #000 calc(100% - 14px), transparent);
  }
}

@media (max-width: 620px) {
  .table-shell {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .table-shell table,
  .table-shell tbody {
    display: block;
    width: 100%;
    min-width: 0;
    background: transparent;
  }

  .table-shell thead {
    display: none;
  }

  .identity-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 12px;
    border: 1px solid var(--border-default);
    border-bottom: 0;
    border-radius: var(--radius-card) var(--radius-card) 0 0;
    overflow: hidden;
    background: var(--card);
  }

  .identity-row:first-child {
    margin-top: 0;
  }

  .identity-row td {
    display: none;
    min-width: 0;
    border: 0;
    padding: 12px;
  }

  .identity-row td:first-child,
  .identity-row td:nth-child(2) {
    display: block;
  }

  .identity-row td:nth-child(2) {
    border-left: 1px solid var(--border-subtle);
  }

  .identity-evidence-row {
    display: block;
    border: 1px solid var(--border-default);
    border-top: 1px solid var(--border-subtle);
    border-radius: 0 0 var(--radius-card) var(--radius-card);
    overflow: hidden;
  }

  .identity-evidence-row td {
    display: block;
    width: 100%;
    border: 0;
    padding: 12px;
  }

  .identity-evidence-panel {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    border-top: 0;
    padding-top: 0;
  }

  .review-note-field {
    width: 100%;
  }

  .identity-profile .character-inline-editor {
    min-width: 0;
    grid-template-columns: 1fr;
  }

  .character-inline-editor .compact-command-button,
  .character-inline-editor .inline-operation-status {
    grid-column: 1;
  }

  .character-archive-toggle {
    white-space: normal;
  }

  .speaker-cluster-workbench > summary,
  .cluster-candidate-row input[type="text"],
  .cluster-merge-bar select,
  .turn-assignment select,
  .character-create-form input,
  .character-create-form select,
  .character-inline-editor input[type="text"],
  .face-review-control,
  .voice-review-control select,
  .review-note-field input,
  .voice-candidate-form input,
  .segment-regenerate-form input {
    min-height: var(--height-minor);
  }

  .compact-icon-button,
  .compact-command-button,
  .review-icon-button,
  .turn-seek-button,
  .play-audio {
    min-width: var(--height-minor);
    min-height: var(--height-minor);
  }

  .compact-icon-button,
  .review-icon-button,
  .turn-seek-button,
  .play-audio {
    width: var(--height-minor);
    height: var(--height-minor);
  }

  .cluster-candidate-row {
    min-height: var(--height-major);
    grid-template-columns: 18px minmax(0, 1fr) auto var(--height-minor);
  }

  .cluster-merge-bar {
    min-height: var(--height-major);
  }

  .turn-actions {
    gap: 6px;
  }

  .mobile-identity-review {
    min-height: var(--height-minor);
  }

  .segment-row {
    grid-template-columns: 46px minmax(0, 1fr) 72px;
  }

  .segment-regenerate-form {
    grid-template-columns: 1fr;
  }

  .attempt-row {
    grid-template-columns: 26px 64px minmax(0, 1fr) auto;
    gap: 6px;
  }

  .attempt-row > small,
  .attempt-row > .compact-icon-button {
    display: none;
  }

  .attempt-row > .compact-command-button,
  .attempt-selected {
    grid-column: 4;
  }
}

/* Asset review surface follows the Lumi media-console reference. */
.asset-page-heading {
  align-items: center;
}

.asset-heading-actions,
.asset-toolbar-meta,
.asset-card-actions,
.asset-card-actions > span:last-child {
  display: flex;
  align-items: center;
}

.asset-heading-actions {
  flex: 0 0 auto;
  gap: 12px;
}

.asset-regenerate-form {
  display: grid;
  min-height: var(--height-major);
  grid-template-columns: auto minmax(260px, 1fr) auto var(--height-minor) minmax(80px, auto);
  align-items: center;
  gap: 12px;
  margin: -4px 0 20px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 40%), var(--panel);
  padding: 12px 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.asset-regenerate-form > span:first-child {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.asset-regenerate-form input {
  width: 100%;
  height: var(--height-minor);
  border-color: var(--border-default);
  border-radius: var(--radius-control);
  background: var(--control);
}

.asset-select-control {
  position: absolute;
  z-index: 2;
  top: 8px;
  left: 8px;
  display: grid;
  width: var(--height-minor);
  height: var(--height-minor);
  place-items: center;
  cursor: pointer;
}

.asset-select-control input {
  appearance: none;
  width: 16px;
  height: 16px;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 3px;
  background: rgba(13, 13, 15, 0.72);
  cursor: pointer;
}

.asset-select-control input:checked {
  border-color: #a9bea0;
  background: #a9bea0;
  box-shadow: inset 0 0 0 3px #293127;
}

.asset-select-control input:focus-visible {
  outline: 3px solid rgba(104, 255, 203, 0.2);
  outline-offset: 2px;
}

.asset-media-type {
  left: 56px;
}

.asset-card-actions {
  min-height: 32px;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.asset-card-actions > span:last-child {
  flex: 0 0 auto;
  gap: 6px;
}

.asset-binding-state {
  min-width: 0;
  overflow: hidden;
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-binding-state[data-selected="true"] {
  color: #83caa8;
}

.asset-thumb {
  aspect-ratio: 16 / 9;
}

.asset-thumb::after {
  display: none;
}

.asset-item[data-asset-category="character"] .asset-thumb {
  background: #f0f0ed;
}

.asset-item[data-asset-category="character"] .asset-thumb img {
  object-fit: contain;
}

.golden-slice-console {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(280px, 1fr);
  gap: 16px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  background: var(--card);
  padding: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.golden-slice-console[data-review-state="approved"] {
  border-color: rgba(55, 214, 92, 0.28);
}

.golden-slice-console[data-review-state="rejected"] {
  border-color: rgba(255, 48, 73, 0.28);
}

.golden-slice-media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  gap: 12px;
}

.golden-slice-clip {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-control);
  background: var(--panel);
}

.golden-slice-clip video,
.golden-slice-clip .video-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.golden-slice-clip > span {
  position: absolute;
  top: 8px;
  left: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-small);
  background: rgba(13, 13, 15, 0.76);
  color: var(--text-secondary);
  padding: 3px 7px;
  font-family: var(--font-mono);
  font-size: 9px;
  pointer-events: none;
}

.golden-slice-decision {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 12px;
  border-left: 1px solid var(--border-subtle);
  padding-left: 16px;
}

.script-review-decision {
  margin-top: 16px;
}

.golden-slice-decision > div:first-child {
  display: flex;
  min-height: var(--height-minor);
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.golden-slice-decision > div:first-child strong {
  color: var(--text-secondary);
  font-size: 12px;
  font-variant-numeric: tabular-nums lining-nums;
}

.golden-slice-decision input {
  width: 100%;
  height: var(--height-minor);
  border-color: var(--border-default);
  border-radius: var(--radius-control);
  background: var(--control);
}

.golden-slice-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.reject-button {
  color: #f09aa5;
}

@media (max-width: 1080px) {
  .golden-slice-console {
    grid-template-columns: 1fr;
  }

  .golden-slice-decision {
    border-top: 1px solid var(--border-subtle);
    border-left: 0;
    padding-top: 16px;
    padding-left: 0;
  }
}

@media (max-width: 620px) {
  .golden-slice-media-grid {
    grid-template-columns: 1fr;
  }
}

.asset-thumb > svg {
  width: 28px;
  height: 28px;
}

.asset-item:focus-within {
  border-color: var(--border-strong);
}

@media (max-width: 1080px) {
  .project-section > .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .project-section .project-actions {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(160px, auto);
    align-items: end;
  }

  .project-section .compact-field {
    min-width: 0;
  }

  .project-section .compact-field select {
    width: 100%;
    min-width: 0;
  }

  .asset-page-heading {
    min-height: var(--height-major);
  }

  .asset-regenerate-form {
    grid-template-columns: auto minmax(200px, 1fr) auto var(--height-minor);
  }

  .asset-regenerate-form .inline-operation-status {
    grid-column: 2 / -1;
  }
}

@media (max-width: 760px) {
  .asset-page-heading {
    min-height: 144px;
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 20px;
  }

  .asset-heading-actions {
    width: 100%;
  }

  .asset-toolbar-meta {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .asset-toolbar-meta > span {
    width: 100%;
  }

  .asset-regenerate-form {
    grid-template-columns: 1fr auto;
  }

  .asset-regenerate-form > span:first-child,
  .asset-regenerate-form input,
  .asset-regenerate-form .inline-operation-status {
    grid-column: 1 / -1;
  }

  .asset-open-button {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 620px) {
  .project-section .project-actions {
    display: flex;
    align-items: stretch;
    flex-direction: column;
  }

  .voice-candidate-form .secondary-button {
    min-height: var(--height-minor);
  }
}

@media (max-width: 520px) {
  .topbar-back-button {
    width: var(--height-minor);
    flex-basis: var(--height-minor);
  }

  .asset-page-heading {
    min-height: 144px;
  }

  .asset-heading-actions .primary-button {
    flex: 0 0 auto;
  }

  .asset-toolbar-meta .secondary-button {
    min-width: var(--height-minor);
    flex: 1 1 calc(33.333% - 8px);
    justify-content: center;
    padding: 0 8px;
  }

  .asset-regenerate-form {
    grid-template-columns: 1fr;
  }

  .asset-regenerate-form .primary-button {
    width: 100%;
  }

  .asset-card-actions .compact-icon-button,
  .asset-card-actions .compact-command-button {
    min-width: var(--height-minor);
    min-height: var(--height-minor);
  }
}

/* The identity map is the primary voice workspace; evidence stays one disclosure away. */
.understanding-disclosure > summary {
  margin-bottom: 0;
  cursor: pointer;
  list-style: none;
}

.understanding-disclosure > summary::-webkit-details-marker {
  display: none;
}

.understanding-disclosure[open] > summary {
  margin-bottom: 18px;
}

.understanding-summary-state {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.understanding-summary-state > svg {
  color: var(--text-muted);
  transition: transform 180ms ease;
}

.understanding-disclosure[open] .understanding-summary-state > svg {
  transform: rotate(180deg);
}

.upload-field:focus-within,
.style-option:focus-within {
  border-color: var(--accent);
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.face-thumb[data-face-review-state="not_visible"] {
  background: #1d2420;
  color: #a7b88a;
}

.style-option:hover {
  border-color: var(--border-strong);
  background: var(--hover);
}

.style-option.is-selected:hover {
  border-color: var(--accent);
  background: #182015;
}

/* Per-shot board: one durable card for every source shot and its frozen references. */
.storyboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.storyboard-grid > .empty-state {
  grid-column: 1 / -1;
}

.storyboard-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 32%), var(--card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.storyboard-card:hover,
.storyboard-card:focus-within {
  border-color: var(--border-strong);
}

.storyboard-media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-bottom: 1px solid var(--border-default);
  background: #09090a;
}

.storyboard-media video,
.storyboard-media .video-placeholder {
  width: 100%;
  height: 100%;
}

.storyboard-media video {
  display: block;
  object-fit: contain;
}

.storyboard-shot-number,
.storyboard-media > .status-pill {
  position: absolute;
  z-index: 1;
  top: 10px;
}

.storyboard-shot-number {
  left: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-small);
  background: rgba(13, 13, 15, 0.82);
  color: var(--text-secondary);
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: 10px;
}

.storyboard-media > .status-pill {
  right: 10px;
  background-color: rgba(13, 13, 15, 0.82);
}

.storyboard-card-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.storyboard-card-body > header,
.storyboard-card-body > footer {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.storyboard-card-body > header > span:first-child,
.storyboard-segment-id {
  display: grid;
  min-width: 0;
}

.storyboard-card-body > header strong,
.storyboard-card-body > header code,
.storyboard-card-body > footer code {
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.storyboard-card-body > header strong {
  color: var(--text-secondary);
}

.storyboard-card-body > header small,
.storyboard-card-body > footer,
.storyboard-segment-id small {
  color: var(--text-muted);
  font-size: 9px;
}

.storyboard-segment-id {
  max-width: 44%;
  justify-items: end;
  text-align: right;
}

.storyboard-card-body > p,
.storyboard-card-body > blockquote {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
}

.storyboard-card-body > p {
  min-height: 36px;
  color: var(--text-secondary);
  font-size: 11px;
  -webkit-line-clamp: 2;
}

.storyboard-card-body > blockquote {
  border-left: 2px solid rgba(170, 185, 137, 0.4);
  color: var(--text-tertiary);
  padding-left: 8px;
  font-size: 10px;
  -webkit-line-clamp: 1;
}

.storyboard-binding-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-small);
  background: var(--border-subtle);
}

.storyboard-binding {
  display: flex;
  min-width: 0;
  min-height: var(--height-minor);
  align-items: center;
  gap: 8px;
  background: var(--panel);
  padding: 8px;
}

.storyboard-binding > svg {
  width: 15px;
  height: 15px;
  color: #a7b88a;
}

.storyboard-binding > span {
  display: grid;
  min-width: 0;
}

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

.storyboard-binding strong {
  color: var(--text-secondary);
  font-size: 10px;
}

.storyboard-binding small,
.storyboard-binding-empty {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 8px;
}

.storyboard-binding-empty {
  grid-column: 1 / -1;
  min-height: var(--height-minor);
  background: var(--panel);
  padding: 15px 10px;
  text-align: center;
}

.storyboard-card-body > footer {
  align-items: center;
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
}

.storyboard-card-body > footer code {
  max-width: 54%;
  color: var(--text-muted);
  text-align: right;
}

/* Lumi controls use the 48px interaction unit and 72px row unit. */
#voice-workspace .speaker-cluster-workbench > summary,
#voice-workspace .cluster-candidate-row input[type="text"],
#voice-workspace .cluster-merge-bar select,
#voice-workspace .turn-assignment select,
#voice-workspace .character-create-form input,
#voice-workspace .character-create-form select,
#voice-workspace .character-inline-editor input[type="text"],
#voice-workspace .face-review-control,
#voice-workspace .voice-review-control select,
#voice-workspace .review-note-field input,
#voice-workspace .voice-candidate-form input,
#video-workspace-page .segment-regenerate-form input {
  height: var(--height-minor);
  min-height: var(--height-minor);
}

#voice-workspace .voice-candidate-form .secondary-button,
#voice-workspace .compact-command-button,
#video-workspace-page .compact-command-button {
  height: var(--height-minor);
  min-height: var(--height-minor);
}

#voice-workspace .compact-icon-button,
#voice-workspace .review-icon-button,
#voice-workspace .turn-seek-button,
#voice-workspace .play-audio,
#video-workspace-page .review-icon-button {
  width: var(--height-minor);
  height: var(--height-minor);
  min-width: var(--height-minor);
  min-height: var(--height-minor);
  flex-basis: var(--height-minor);
}

#voice-workspace .cluster-candidate-row,
#voice-workspace .cluster-merge-bar,
#voice-workspace .character-create-form {
  min-height: var(--height-major);
}

#voice-workspace .cluster-candidate-list {
  max-height: 216px;
}

.segment-row {
  min-height: var(--height-major);
}

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

@media (max-width: 620px) {
  .storyboard-grid {
    grid-template-columns: 1fr;
  }

  .storyboard-binding-list {
    grid-template-columns: 1fr 1fr;
  }

  .identity-row td:nth-child(-n + 7) {
    display: block;
  }

  .identity-row td:nth-child(8) {
    display: none;
  }

  .identity-row td::before {
    display: block;
    margin-bottom: 7px;
    color: var(--text-muted);
    content: attr(data-mobile-label);
    font-size: 9px;
    font-weight: 720;
  }

  .identity-row td:nth-child(3) {
    grid-column: 1 / -1;
  }

  .identity-row td:nth-child(n + 3):nth-child(-n + 7) {
    border-top: 1px solid var(--border-subtle);
  }

  .identity-row td:nth-child(2),
  .identity-row td:nth-child(5),
  .identity-row td:nth-child(7) {
    border-left: 1px solid var(--border-subtle);
  }

  .identity-row td:nth-child(4),
  .identity-row td:nth-child(5),
  .identity-row td:nth-child(6),
  .identity-row td:nth-child(7) {
    min-height: var(--height-major);
  }

  .segment-row {
    grid-template-columns: 52px minmax(0, 1fr);
    align-items: start;
    gap: 8px 10px;
    padding: 12px;
  }

  .segment-index {
    grid-column: 1;
    grid-row: 1 / 3;
  }

  .segment-time {
    display: flex;
    grid-column: 2;
    grid-row: 1;
  }

  .segment-prompt {
    grid-column: 2;
    grid-row: 2;
  }

  .segment-output {
    display: none;
  }

  .segment-action {
    grid-column: 1 / -1;
    min-height: var(--height-minor);
    justify-content: flex-end;
    border-top: 1px solid var(--border-subtle);
    padding-top: 10px;
  }

  .segment-action .text-button {
    min-height: var(--height-minor);
    align-items: center;
  }

  .segment-regenerate-form,
  .attempt-history {
    grid-column: 1 / -1;
  }
}
/* P1 v22 keeps all parsed material inside four fixed canvas sections. */
.asset-lane-summary {
  display: grid;
  min-height: var(--height-major);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 20px;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.asset-lane-item {
  display: grid;
  min-width: 0;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 0;
  border-right: 1px solid var(--border-subtle);
  border-radius: 0;
  background: transparent;
  padding: 12px 16px;
}

.asset-lane-item:last-child {
  border-right: 0;
}

.asset-lane-item > svg {
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
}

.asset-lane-item > span {
  min-width: 0;
}

.asset-lane-item strong {
  color: var(--text-secondary);
  font-size: 11px;
}

.asset-lane-item small {
  max-width: none;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 9px;
}

.asset-lane-item b {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 650;
}

.asset-zone-panel {
  min-width: 0;
  outline: none;
}

.asset-zone-panel:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 8px;
}

.asset-zone-heading {
  display: flex;
  min-height: var(--height-major);
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}

.asset-zone-heading h2,
.asset-assembly-section h2 {
  margin: 2px 0 0;
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 720;
}

.asset-zone-heading > p {
  max-width: 620px;
  margin: 0;
  color: var(--text-tertiary);
  font-size: 11px;
  line-height: 1.7;
  text-align: right;
}

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

.reference-item {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  background: var(--card);
  transition: border-color 160ms ease, background 160ms ease;
}

.reference-item:hover,
.reference-item:focus-within {
  border-color: var(--border-strong);
  background: #19191b;
}

.reference-media {
  position: relative;
  aspect-ratio: 16 / 9;
  margin: 0;
  overflow: hidden;
  border-bottom: 1px solid var(--border-default);
  background: var(--panel);
}

.reference-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reference-media a {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-small);
  background: rgba(13, 13, 15, 0.78);
  color: var(--text-secondary);
}

.reference-media a:hover,
.reference-media a:focus-visible {
  color: var(--text-primary);
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

.reference-media a svg {
  width: 15px;
  height: 15px;
}

.reference-content {
  padding: 18px;
}

.reference-content > header {
  min-width: 0;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
}

.reference-content > header > span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #a7b88a;
  font-size: 9px;
  font-weight: 760;
}

.reference-content > header > span svg {
  width: 13px;
  height: 13px;
}

.reference-content h3 {
  margin: 7px 0 0;
  overflow-wrap: anywhere;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 720;
}

.reference-description {
  min-height: 54px;
  margin: 12px 0;
  color: var(--text-tertiary);
  font-size: 11px;
  line-height: 1.65;
}

.reference-required,
.reference-note,
.reference-unlinked {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 10px 0;
  border-left: 2px solid var(--amber);
  padding: 7px 0 7px 10px;
  color: var(--text-tertiary);
  font-size: 10px;
  line-height: 1.55;
}

.reference-required svg,
.reference-note svg,
.reference-unlinked svg {
  width: 13px;
  height: 13px;
  margin-top: 1px;
  color: var(--amber);
}

.reference-required span,
.reference-note span,
.reference-unlinked span {
  min-width: 0;
}

.reference-required strong {
  display: block;
  margin-bottom: 2px;
  color: var(--text-secondary);
}

.reference-note {
  border-left-color: var(--border-strong);
}

.reference-note svg {
  color: var(--text-tertiary);
}

.reference-relation-list,
.asset-assembly-details ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.reference-relation-list {
  border-top: 1px solid var(--border-subtle);
}

.reference-relation-list li {
  display: grid;
  min-height: 34px;
  grid-template-columns: 14px 36px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-tertiary);
  font-size: 10px;
}

.reference-relation-list svg {
  width: 13px;
  height: 13px;
  color: var(--text-muted);
}

.reference-relation-list strong {
  color: var(--text-secondary);
  font-size: 9px;
}

.reference-relation-list span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-source {
  margin-top: 12px;
}

.reference-source summary {
  color: var(--text-muted);
  cursor: pointer;
  font-size: 10px;
}

.reference-source summary:hover,
.reference-source summary:focus-visible {
  color: var(--text-secondary);
  outline: none;
}

.reference-source p {
  max-height: 120px;
  margin: 8px 0 0;
  overflow: auto;
  color: var(--text-tertiary);
  font-size: 10px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.asset-assembly-section {
  margin-top: 32px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 20px;
}

.asset-assembly-section > header {
  display: flex;
  min-height: var(--height-major);
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.asset-assembly-row {
  min-width: 0;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  background: var(--card);
  padding: 16px;
}

.asset-assembly-row > header {
  display: flex;
  min-height: var(--height-minor);
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
}

.asset-assembly-row > header h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 720;
}

.asset-assembly-row > header p {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 9px;
}

.asset-assembly-row > header > svg {
  width: 18px;
  height: 18px;
  color: #a7b88a;
}

.asset-assembly-details {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
}

.asset-assembly-details > div {
  min-width: 0;
  border-right: 1px solid var(--border-subtle);
  padding: 14px;
}

.asset-assembly-details > div:first-child {
  padding-left: 0;
}

.asset-assembly-details > div:last-child {
  border-right: 0;
  padding-right: 0;
}

.asset-assembly-details dt {
  margin-bottom: 9px;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 760;
}

.asset-assembly-details dd {
  margin: 0;
}

.asset-assembly-details li {
  display: grid;
  min-width: 0;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 7px;
  margin-top: 8px;
}

.asset-assembly-details li:first-child {
  margin-top: 0;
}

.asset-assembly-details li > svg {
  width: 13px;
  height: 13px;
  margin-top: 2px;
  color: var(--text-muted);
}

.asset-assembly-details li span {
  min-width: 0;
}

.asset-assembly-details li strong,
.asset-assembly-details li small {
  display: block;
  overflow-wrap: anywhere;
}

.asset-assembly-details li strong {
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 650;
}

.asset-assembly-details li small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 9px;
  line-height: 1.45;
}

.assembly-empty {
  color: var(--text-muted);
  font-size: 9px;
}

@media (max-width: 1080px) {
  .asset-grid.is-reference-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .asset-assembly-details > div:nth-child(2) {
    border-right: 0;
    padding-right: 0;
  }

  .asset-assembly-details > div:nth-child(3) {
    border-top: 1px solid var(--border-subtle);
    padding-left: 0;
  }

  .asset-assembly-details > div:nth-child(4) {
    border-top: 1px solid var(--border-subtle);
  }
}

@media (max-width: 760px) {
  .asset-zone-heading {
    min-height: auto;
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 8px 0;
  }

  .asset-zone-heading > p {
    max-width: none;
    text-align: left;
  }
}

@media (max-width: 620px) {
  .auth-gate {
    align-items: center;
    padding: 18px;
  }

  .auth-panel {
    padding: 22px;
  }

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

  .asset-lane-item:nth-child(2) {
    border-right: 0;
  }

  .asset-lane-item:nth-child(-n + 2) {
    border-bottom: 1px solid var(--border-subtle);
  }

  .asset-grid.is-reference-grid,
  .asset-assembly-details {
    grid-template-columns: 1fr;
  }

  .reference-description {
    min-height: 0;
  }

  .asset-assembly-details > div,
  .asset-assembly-details > div:first-child,
  .asset-assembly-details > div:nth-child(2),
  .asset-assembly-details > div:nth-child(3),
  .asset-assembly-details > div:nth-child(4),
  .asset-assembly-details > div:last-child {
    border-top: 1px solid var(--border-subtle);
    border-right: 0;
    padding: 12px 0;
  }

  .asset-assembly-details > div:first-child {
    border-top: 0;
  }
}

/* Destructive project actions stay quiet until explicitly invoked. */
.project-summary .project-delete-button {
  flex: 0 0 var(--height-minor);
  color: var(--text-muted);
}

.project-summary .project-delete-button:hover,
.project-summary .project-delete-button:focus-visible {
  color: #ff8d9c;
}

@media (max-width: 760px) {
  .project-summary {
    position: relative;
    padding-right: 64px;
  }

  .project-summary .project-delete-button {
    position: absolute;
    top: 12px;
    right: 12px;
  }

}
