:root {
  color-scheme: dark;
  --bg: #070908;
  --panel: #101513;
  --panel-strong: #151d1a;
  --text: #f4f7f5;
  --muted: #9ca9a2;
  --line: #26332e;
  --accent: #10b981;
  --accent-strong: #047857;
  --danger: #f87171;
}

* {
  box-sizing: border-box;
}

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

a {
  color: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0;
}

.app-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0;
}

.lab-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.brand-mark img {
  width: 32px;
  height: 32px;
}

.brand-text {
  display: grid;
  gap: 1px;
  line-height: 1;
}

.brand-text span:first-child {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0;
}

.brand-text span:last-child {
  font-size: 1.14rem;
  font-weight: 850;
}

.app-nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.nav-group {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.nav-group + .nav-group {
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--text);
}

.user-menu {
  position: relative;
}

.user-menu summary {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 999px;
  background: var(--accent-strong);
  color: white;
  font-size: 0.86rem;
  font-weight: 850;
  cursor: pointer;
  list-style: none;
}

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

.user-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  width: 240px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b0f0d;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.user-menu-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.user-menu-header p {
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-meta {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  color: var(--text);
  font-size: 0.76rem;
}

.user-meta span {
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.1);
  padding: 3px 8px;
}

.user-menu-panel a,
.user-menu-panel button {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: #d9e3de;
  padding: 12px 16px;
  font: inherit;
  font-size: 0.9rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.user-menu-panel a:hover,
.user-menu-panel button:hover,
.user-menu-panel a:focus-visible,
.user-menu-panel button:focus-visible {
  background: var(--panel-strong);
  color: var(--text);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
}

.brand img {
  width: 34px;
  height: 34px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 0.95rem;
}

.nav-links a {
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  padding: 8px 12px;
  font: inherit;
  cursor: pointer;
}

.nav-button:hover {
  border-color: var(--accent);
}

.shell {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 80px;
}

.hero {
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

h1 {
  max-width: 680px;
  font-size: clamp(2.3rem, 6vw, 4.7rem);
}

h2 {
  font-size: 1.35rem;
}

.muted,
.help-text {
  color: var(--muted);
}

.hero .muted {
  max-width: 680px;
  font-size: 1.08rem;
}

.home-shell {
  width: min(1120px, calc(100% - 32px));
  padding-top: 26px;
}

.home-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-top: 4px;
  margin-bottom: 14px;
}

.home-header h1 {
  font-size: clamp(1.8rem, 3vw, 2.7rem);
}

.home-header .muted {
  max-width: 720px;
  margin-bottom: 0;
}

.quick-action-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

.source-action-bar {
  grid-template-columns: repeat(3, minmax(0, 1fr)) repeat(2, minmax(230px, 1.2fr));
}

.quick-action.featured-quick-action {
  justify-content: flex-start;
  border-color: rgba(16, 185, 129, 0.48);
  background:
    linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(14, 165, 233, 0.1)),
    var(--panel);
  padding-inline: 22px;
}

.quick-action.featured-quick-action .quick-action-icon {
  border-color: rgba(14, 165, 233, 0.38);
  background: rgba(14, 165, 233, 0.12);
  color: #7dd3fc;
}

.quick-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  padding: 10px 12px;
  font-weight: 850;
  text-decoration: none;
}

.quick-action span:last-child {
  min-width: 0;
  line-height: 1.2;
}

.quick-action:hover,
.quick-action:focus-visible {
  border-color: var(--accent);
  background: var(--panel-strong);
}

.quick-action-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: 1px solid rgba(16, 185, 129, 0.28);
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 900;
}

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

.home-documents-heading h2 {
  font-size: 1.7rem;
}

.home-document-list {
  gap: 12px;
}

.home-document-card {
  background: var(--panel);
}

.home-document-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.home-document-stats span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090d0b;
  color: var(--muted);
  padding: 8px 10px;
  font-size: 0.86rem;
}

.home-document-stats strong {
  color: var(--text);
}

.home-document-stat-link {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090d0b;
  color: var(--muted);
  padding: 8px 10px;
  font-size: 0.86rem;
  text-decoration: none;
}

.home-document-stat-link:hover,
.home-document-stat-link:focus-visible {
  border-color: rgba(16, 185, 129, 0.55);
  color: var(--text);
}

.home-document-stat-link strong {
  color: var(--text);
}

.home-document-stat-link.is-disabled {
  pointer-events: none;
  opacity: 0.55;
}

.workspace-section,
.ai-tools-section {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

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

.workspace-column {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
}

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

.workspace-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090d0b;
  color: var(--text);
  padding: 12px;
  text-decoration: none;
}

.workspace-item:hover,
.workspace-item:focus-visible {
  border-color: rgba(16, 185, 129, 0.55);
}

.workspace-item span:first-child {
  min-width: 0;
}

.workspace-item strong,
.workspace-item small {
  display: block;
}

.workspace-item strong {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-item small {
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-empty {
  align-items: flex-start;
  flex-direction: column;
}

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

.ai-tool-link {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  padding: 14px;
  text-decoration: none;
}

.ai-tool-link:hover,
.ai-tool-link:focus-visible {
  border-color: var(--accent);
  background: var(--panel-strong);
}

.ai-tool-link span:last-child {
  min-width: 0;
}

.ai-tool-link strong,
.ai-tool-link small {
  display: block;
}

.ai-tool-link small {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.35;
}

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

.tool-card {
  display: flex;
  flex-direction: column;
  min-height: 230px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 24px;
  text-decoration: none;
}

.tool-card:hover {
  border-color: var(--accent);
  background: var(--panel-strong);
}

.tool-kicker {
  margin-bottom: 18px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.tool-card h2 {
  margin-bottom: 12px;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.pricing-shell {
  width: min(1120px, calc(100% - 32px));
}

.pricing-heading {
  max-width: 760px;
}

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

.pricing-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  min-height: 340px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 20px;
}

.pricing-card.is-current {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.28);
}

.pricing-card h2 {
  font-size: 1.25rem;
}

.price-label {
  margin: 10px 0 0;
  color: var(--text);
  font-size: 1.9rem;
  font-weight: 900;
  line-height: 1;
}

.plan-feature-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.92rem;
  list-style: none;
}

.plan-feature-list li::before {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 9px;
  border-radius: 999px;
  background: var(--accent);
  content: "";
  vertical-align: 1px;
}

.current-plan-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090d0b;
  color: var(--muted);
  font-weight: 850;
}

.pricing-alert {
  margin-bottom: 20px;
}

.credit-cost-panel {
  max-width: 760px;
  margin: 0 auto;
}

.credit-cost-panel h2 {
  margin-bottom: 16px;
}

.pricing-action-error {
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 0.84rem;
  text-align: center;
}

.account-shell {
  width: min(1120px, calc(100% - 32px));
}

.account-heading {
  max-width: 760px;
}

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

.billing-panel {
  grid-column: 1 / -1;
}

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

.billing-summary div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090d0b;
  padding: 14px;
}

.billing-summary span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.billing-summary strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--text);
}

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

.api-key-panel {
  grid-column: 1 / -1;
}

.api-key-panel:focus {
  outline: none;
}

.api-key-panel.is-anchor-target {
  border-color: rgba(16, 185, 129, 0.7);
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.35);
}

.api-key-list {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.api-key-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090d0b;
  padding: 12px;
}

.api-key-row strong,
.api-key-row span,
.api-key-row small {
  display: block;
}

.api-key-row strong {
  color: var(--text);
}

.api-key-row span {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.api-key-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.api-key-form {
  display: grid;
  grid-template-columns: minmax(150px, 0.65fr) minmax(180px, 1fr) minmax(240px, 1.4fr);
  gap: 14px;
  align-items: end;
}

.api-key-form .help-text,
.api-key-form .button {
  grid-column: 1 / -1;
}

.byok-key-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(0, 0, 0, 0.72);
}

.byok-key-modal {
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #050806;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.44);
  padding: 18px;
}

.byok-key-modal-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.byok-key-modal-heading h2 {
  margin: 0;
  font-size: 1.12rem;
}

.byok-key-modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.alert {
  margin-bottom: 16px;
  border-left: 3px solid var(--danger);
  border-radius: 6px;
  background: rgba(248, 113, 113, 0.1);
  color: #fecaca;
  padding: 12px 14px;
}

.alert.success {
  border-left-color: var(--accent);
  background: rgba(16, 185, 129, 0.1);
  color: #bbf7d0;
}

.branch-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.branch-notice span {
  min-width: 0;
}

.branch-notice .button {
  flex: 0 0 auto;
  border-color: rgba(254, 202, 202, 0.35);
  color: #fee2e2;
}

.narrow-shell {
  width: min(820px, calc(100% - 32px));
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.section-heading h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.3rem);
}

.section-heading p {
  margin: 8px 0 0;
  color: var(--muted);
}

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

.job-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.job-item a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090d0b;
  padding: 16px;
  text-decoration: none;
}

.job-item a:hover,
.job-item a:focus-visible {
  border-color: var(--accent);
  background: var(--panel-strong);
}

.job-item span {
  min-width: 0;
}

.job-item strong,
.job-item small {
  display: block;
}

.job-item strong {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-item small {
  margin-top: 5px;
  color: var(--muted);
}

.job-item b {
  color: var(--accent);
}

.empty-state {
  padding: 42px 18px;
  text-align: center;
}

.empty-icon {
  margin: 0 auto 16px;
  width: fit-content;
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent);
  padding: 5px 12px;
  font-size: 0.76rem;
  font-weight: 900;
}

.empty-title {
  margin: 0 0 6px;
  color: var(--text);
  font-weight: 850;
}

.empty-state p {
  color: var(--muted);
}

.empty-state a {
  color: var(--accent);
  font-weight: 800;
}

.credential-box {
  display: grid;
  gap: 5px;
  margin-top: 12px;
}

.credential-box span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.credential-box code {
  display: block;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090d0b;
  color: var(--text);
  padding: 10px 12px;
}

.credit-line {
  margin-top: 0;
  color: var(--muted);
}

.label-note {
  color: var(--muted);
  font-weight: 500;
}

.monitor-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  color: var(--muted);
}

.status-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 850;
}

.status-pill.is-active {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.12);
  color: #bbf7d0;
}

.status-pill.is-paused {
  color: var(--muted);
}

.monitor-event-list {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.monitor-event {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090d0b;
  padding: 16px;
}

.monitor-event-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.monitor-event-top span {
  color: var(--muted);
  font-size: 0.84rem;
}

.monitor-summary {
  margin-top: 10px;
  color: #d9e3de;
  line-height: 1.55;
}

.monitor-summary p {
  margin: 0 0 8px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 24px;
}

.field {
  display: grid;
  gap: 9px;
  margin-bottom: 20px;
}

label {
  font-weight: 750;
}

textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090d0b;
  color: var(--text);
  padding: 13px 14px;
  font: inherit;
}

input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090d0b;
  color: var(--text);
  padding: 0 14px;
  font: inherit;
}

select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090d0b;
  color: var(--text);
  padding: 0 14px;
  font: inherit;
}

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

.segmented label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
}

.segmented label.is-active {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(16, 185, 129, 0.12);
}

.segmented input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.inline-field-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

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

.auth-actions,
.result-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 18px;
}

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

.auth-link-button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 800;
  cursor: pointer;
  padding: 10px;
}

.auth-switch {
  margin-top: 18px;
  color: var(--muted);
  text-align: center;
}

.auth-switch a,
.auth-link-button:hover {
  color: var(--text);
}

.single-panel {
  display: grid;
  place-items: center;
  min-height: 100vh;
}

.confirm-panel {
  max-width: 480px;
  border-left: 1px solid var(--line);
}

.share-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  margin: 18px 0;
  padding: 14px;
}

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

.usage-summary div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090d0b;
  padding: 12px;
}

.usage-summary span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.usage-summary strong {
  display: block;
  overflow-wrap: anywhere;
}

.usage-summary p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.share-box > span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.share-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.share-row code {
  overflow: hidden;
  border-radius: 6px;
  background: #090d0b;
  color: var(--muted);
  padding: 11px 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-work-panel {
  margin-top: 22px;
}

.recent-documents-panel {
  margin-top: 22px;
}

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

.recent-work-groups {
  display: grid;
  gap: 18px;
}

.recent-work-group {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.recent-work-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.recent-work-group-heading h3 {
  margin: 0;
  font-size: 1rem;
}

.recent-work-group-heading a {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.92rem;
  text-decoration: none;
}

.recent-work-group-heading a:hover,
.recent-work-group-heading a:focus-visible {
  color: var(--accent);
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 14px;
  text-decoration: none;
}

.history-item:hover {
  border-color: rgba(16, 185, 129, 0.55);
}

.history-item-with-actions {
  padding: 0;
}

.history-main-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  flex: 1;
  gap: 16px;
  color: inherit;
  padding: 14px;
  text-decoration: none;
}

.history-main-link > span:first-child {
  min-width: 0;
}

.history-main-link strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-delete-button {
  align-self: stretch;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: #fecaca;
  padding: 0 14px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
}

.history-delete-button:hover,
.history-delete-button:focus-visible {
  background: rgba(248, 113, 113, 0.1);
  color: #fee2e2;
}

.history-delete-button:disabled {
  cursor: progress;
  opacity: 0.65;
}

.history-item strong,
.history-item small {
  display: block;
}

.history-item small,
.history-date {
  color: var(--muted);
}

.empty-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 14px;
}

.empty-inline a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.document-library {
  display: grid;
  gap: 18px;
}

.document-list {
  display: grid;
  gap: 16px;
}

.thought-list {
  display: grid;
  gap: 14px;
}

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

.dashboard-project-list {
  max-width: 860px;
}

.video-project-source-group {
  display: grid;
  gap: 12px;
  min-width: 0;
  border-left: 2px solid rgba(16, 185, 129, 0.5);
  padding-left: 14px;
}

.video-project-source-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  padding: 4px 0 2px;
}

.video-project-source-head > div:first-child {
  min-width: 0;
}

.video-project-source-head h2,
.video-project-source-head h3 {
  margin: 2px 0 0;
  font-size: 1.05rem;
  line-height: 1.25;
}

.video-project-source-head h2 a,
.video-project-source-head h3 a {
  color: var(--text);
  text-decoration: none;
}

.video-project-source-head h2 a:hover,
.video-project-source-head h2 a:focus-visible,
.video-project-source-head h3 a:hover,
.video-project-source-head h3 a:focus-visible {
  color: var(--accent);
}

.video-project-source-head p {
  margin: 7px 0 0;
  color: var(--text-soft);
  line-height: 1.45;
}

.video-project-source-actions {
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.video-project-source-actions > span {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  padding: 4px 9px;
  font-size: 0.82rem;
  font-weight: 800;
}

.video-project-source-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.video-project-source-list .thought-card {
  background: #0b120f;
}

.thought-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
}

.thought-card-main {
  min-width: 0;
}

.thought-card h2 {
  font-size: 1.24rem;
}

.thought-card h2 a {
  color: var(--text);
  text-decoration: none;
}

.thought-card h2 a:hover,
.thought-card h2 a:focus-visible {
  color: var(--accent);
}

.thought-card p {
  margin: 10px 0 0;
  color: #d9e3de;
  line-height: 1.55;
}

.video-library-card .document-type {
  color: var(--accent);
}

.thought-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.thought-tag-list span {
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.08);
  color: #bae6fd;
  padding: 4px 9px;
  font-size: 0.78rem;
  font-weight: 800;
}

.thought-editor {
  min-height: 300px;
  line-height: 1.55;
}

.thought-view-panel {
  display: grid;
  gap: 18px;
}

.thought-body {
  white-space: pre-wrap;
  color: #e5ece8;
  font-size: 1.02rem;
  line-height: 1.7;
}

.thought-view-actions {
  margin-top: 8px;
}

.thought-detail-shell,
.thought-branch-shell {
  width: min(1040px, calc(100% - 32px));
}

.video-project-story-shell,
.video-chapter-shell,
.video-script-shell {
  width: min(1460px, calc(100% - 48px));
}

.video-project-story-shell .top-heading,
.video-chapter-shell .top-heading,
.video-script-shell .top-heading {
  align-items: flex-end;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.video-project-story-shell .section-heading h1,
.video-chapter-shell .section-heading h1,
.video-script-shell .section-heading h1 {
  font-size: clamp(2rem, 4vw, 2.9rem);
}

.thought-detail-top,
.branch-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.branch-create-panel,
.branch-list-section {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.current-directions-panel {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.branch-section-heading h2 {
  margin-top: 4px;
}

.branch-type-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.branch-type-button {
  min-height: 44px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090d0b;
  color: var(--muted);
  padding: 8px 10px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 850;
  cursor: pointer;
}

.branch-type-button:hover,
.branch-type-button:focus-visible,
.branch-type-button.is-selected {
  border-color: rgba(16, 185, 129, 0.7);
  background: rgba(16, 185, 129, 0.12);
  color: var(--text);
}

.branch-type-button:disabled {
  opacity: 0.72;
  cursor: wait;
}

.video-project-workflow-picker {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid rgba(139, 179, 161, 0.18);
  border-radius: 8px;
  background: rgba(139, 179, 161, 0.04);
  margin: 0 0 18px;
  padding: 12px;
}

.video-project-workflow-picker legend {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.video-project-workflow-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.video-project-workflow-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  min-width: 0;
  border: 1px solid rgba(139, 179, 161, 0.22);
  border-radius: 8px;
  background: #070b09;
  color: var(--muted);
  cursor: pointer;
  padding: 10px;
}

.video-project-workflow-option input {
  margin-top: 2px;
}

.video-project-workflow-option span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.video-project-workflow-option strong {
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.2;
}

.video-project-workflow-option small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
}

.video-project-workflow-option:hover,
.video-project-workflow-option:focus-within,
.video-project-workflow-option.is-selected {
  border-color: rgba(16, 185, 129, 0.58);
  background: rgba(16, 185, 129, 0.09);
}

.video-project-workflow-option.is-disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.child-branch-panel {
  display: grid;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.child-branch-type-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

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

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

.child-branch-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090d0b;
  padding: 12px;
}

.child-branch-card span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.child-branch-card strong,
.child-branch-card small {
  min-width: 0;
}

.child-branch-card strong {
  overflow-wrap: anywhere;
}

.child-branch-card strong a {
  color: var(--text);
  text-decoration: none;
}

.child-branch-card strong a:hover,
.child-branch-card strong a:focus-visible {
  color: var(--accent);
}

.child-branch-card small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.child-branch-card p {
  margin: 0;
  color: #d9e3de;
  line-height: 1.45;
}

.child-branch-batch {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.child-branch-batch summary {
  color: var(--accent);
  cursor: pointer;
  font-weight: 850;
}

.child-branch-batch form {
  margin-top: 12px;
}

.child-branch-empty {
  justify-content: flex-start;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  color: var(--muted);
  font-weight: 650;
}

.checkbox-row input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--accent);
}

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

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

.current-direction-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090d0b;
  color: var(--text);
  padding: 14px;
  text-decoration: none;
}

.current-direction-card:hover,
.current-direction-card:focus-visible {
  border-color: rgba(16, 185, 129, 0.65);
  background: rgba(16, 185, 129, 0.09);
}

.current-direction-card h3 {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-size: 1rem;
}

.current-direction-card p {
  margin: 8px 0 0;
  color: #d9e3de;
  display: -webkit-box;
  font-size: 0.9rem;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.45;
  overflow: hidden;
}

.current-direction-meta {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: 48%;
}

.current-direction-meta span {
  border: 1px solid rgba(186, 230, 253, 0.18);
  border-radius: 999px;
  color: var(--muted);
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.branch-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
}

.branch-card-main {
  min-width: 0;
}

.branch-card h3 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 1.18rem;
}

.branch-card h3 a {
  color: var(--text);
  text-decoration: none;
}

.branch-card h3 a:hover,
.branch-card h3 a:focus-visible {
  color: var(--accent);
}

.branch-card p {
  margin: 10px 0 0;
  color: #d9e3de;
  line-height: 1.55;
}

.branch-conversation-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.45fr);
  gap: 18px;
  align-items: start;
}

.video-project-layout {
  display: grid;
  gap: 18px;
}

.video-project-story-layout {
  grid-template-columns: minmax(220px, 264px) minmax(0, 1fr);
  align-items: start;
}

.video-chapter-layout,
.video-script-layout {
  display: grid;
  grid-template-columns: minmax(220px, 264px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.video-chapter-sidebar,
.video-script-sidebar {
  display: grid;
  gap: 14px;
  position: sticky;
  top: 16px;
}

.video-chapter-sidebar details,
.video-script-sidebar details,
.video-chapter-main,
.video-script-main {
  min-width: 0;
}

.video-chapter-sidebar summary,
.video-script-sidebar summary {
  color: var(--accent);
  font-weight: 850;
  cursor: pointer;
}

.video-chapter-main,
.video-script-main {
  display: grid;
  gap: 16px;
}

.video-chapter-main .child-branch-panel {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.video-chapter-brief {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090d0b;
  color: #e5ece8;
  padding: 14px;
  white-space: pre-wrap;
  line-height: 1.62;
}

.video-chapter-layout .video-project-chat,
.video-chapter-layout .video-project-support-grid,
.video-script-layout .video-project-chat,
.video-script-layout .video-project-support-grid {
  grid-column: 1 / -1;
}

.video-script-layout .video-project-chat {
  grid-column: 2;
}

.video-script-main .video-output-preview-body {
  max-height: min(58vh, 680px);
}

.video-script-refinement {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(139, 179, 161, 0.22);
  border-radius: 8px;
  background: #050807;
  padding: 12px;
}

.video-script-refinement .field {
  margin-bottom: 0;
}

.video-story-sidebar {
  display: grid;
  gap: 14px;
  position: sticky;
  top: 16px;
}

.video-story-source-card,
.video-story-progress-card {
  display: grid;
  gap: 12px;
}

.video-project-cost-card {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.video-story-source-body {
  max-height: 280px;
  overflow: auto;
  white-space: pre-wrap;
  color: #d9e3de;
  font-size: 0.9rem;
  line-height: 1.55;
}

.video-story-source-inline {
  border: 1px solid rgba(139, 179, 161, 0.22);
  border-radius: 8px;
  background: #050807;
  padding: 12px;
}

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

.video-project-tree-card,
.video-tree-preview,
.video-design-sheet-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.video-project-tree-identity {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 11px;
}

.video-project-tree-copy {
  display: grid;
  min-width: 0;
}

.video-project-tree-copy .document-type {
  margin-bottom: 4px;
}

.video-project-tree-copy strong,
.video-project-tree-copy a {
  overflow: hidden;
  color: var(--text);
  font-size: 1rem;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-project-tree-copy a:hover,
.video-project-tree-copy a:focus-visible {
  color: var(--accent);
}

.video-project-cost-summary {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.video-project-cost-summary span,
.video-project-cost-summary em {
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 800;
  line-height: 1.25;
}

.video-project-cost-summary strong {
  color: var(--text);
  font-size: 1.24rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}

.video-project-cost-summary.has-cost strong {
  color: var(--accent);
}

.video-project-cost-summary small {
  overflow-wrap: anywhere;
  color: var(--text-soft);
  font-size: 0.74rem;
  font-weight: 750;
  line-height: 1.25;
}

.video-project-cost-lines {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.video-project-fal-balance {
  display: block;
  margin-top: 2px;
  color: var(--text-soft);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 800;
  line-height: 1.25;
}

.video-project-fal-balance.is-hidden {
  display: none;
}

.video-project-budget {
  display: grid;
  gap: 5px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(139, 179, 161, 0.16);
}

.video-project-budget.is-hidden {
  display: none;
}

.video-project-budget-heading,
.video-project-budget-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.video-project-budget-heading span,
.video-project-budget-line span {
  overflow-wrap: anywhere;
}

.video-project-budget-heading strong,
.video-project-cost-summary.has-cost .video-project-budget-heading strong {
  color: var(--accent);
  font-size: 0.95rem;
  line-height: 1.15;
}

.video-project-budget-lines {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.video-project-budget-line strong,
.video-project-cost-summary.has-cost .video-project-budget-line strong {
  color: var(--text);
  font-size: 0.78rem;
  line-height: 1.2;
}

.video-project-budget small {
  color: var(--text-soft);
}

.video-project-budget em {
  color: var(--muted);
  font-size: 0.7rem;
}

.video-project-card-workflow {
  display: grid;
  gap: 5px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(139, 179, 161, 0.16);
}

.video-project-card-workflow label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.video-project-card-workflow label span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.video-project-card-workflow select {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(139, 179, 161, 0.28);
  border-radius: 6px;
  background: #050806;
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 7px 8px;
}

.video-project-card-workflow small,
.video-project-card-workflow em {
  color: var(--muted);
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 750;
  line-height: 1.25;
}

.video-project-card-workflow em {
  color: var(--accent);
}

.video-project-cost-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.video-project-cost-line span {
  overflow-wrap: anywhere;
  color: var(--text-soft);
  font-size: 0.74rem;
}

.video-project-cost-line strong,
.video-project-cost-summary.has-cost .video-project-cost-line strong {
  color: var(--text);
  font-size: 0.78rem;
  line-height: 1.2;
}

.video-story-progress-identity {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090d0b;
}

.video-rail-icon {
  position: relative;
  display: block;
  width: 34px;
  height: 28px;
  overflow: hidden;
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 7px;
  background:
    linear-gradient(90deg, rgba(16, 185, 129, 0.24) 0 4px, transparent 4px calc(100% - 4px), rgba(16, 185, 129, 0.24) calc(100% - 4px)),
    #050807;
}

.video-rail-icon::before,
.video-rail-icon::after {
  position: absolute;
  left: 6px;
  right: 6px;
  height: 3px;
  background: repeating-linear-gradient(90deg, rgba(244, 247, 245, 0.56) 0 3px, transparent 3px 7px);
  content: "";
}

.video-rail-icon::before {
  top: 5px;
}

.video-rail-icon::after {
  bottom: 5px;
}

.video-project-tree-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.video-project-tree-head .document-type {
  margin-bottom: 0;
}

.video-project-tree-head [data-video-tree-count],
.video-project-tree-head > span:last-child {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
}

.video-project-tree-list {
  position: relative;
  gap: 3px;
  max-height: calc(100vh - 300px);
  overflow: auto;
  padding-right: 2px;
}

.video-project-tree-list li {
  min-width: 0;
}

.video-project-tree-phase {
  position: relative;
  margin: 7px 0 1px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.video-project-tree-phase:first-child {
  margin-top: 0;
}

.video-project-tree-phase span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.video-project-tree-phase span::before {
  width: 18px;
  height: 1px;
  background: rgba(139, 179, 161, 0.35);
  content: "";
}

.video-project-tree-item {
  width: 100%;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  min-height: 38px;
  border: 1px solid transparent;
  color: var(--muted);
  font: inherit;
  text-align: left;
  cursor: pointer;
  padding: 7px 9px;
}

.video-project-tree-item::after {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  justify-self: center;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  content: "";
}

.video-project-tree-item:hover,
.video-project-tree-item:focus-visible {
  border-color: rgba(16, 185, 129, 0.65);
  color: var(--text);
}

.video-project-tree-item[data-video-tree-state="done"]::after {
  background: #38bdf8;
}

.video-project-tree-item[data-video-tree-state="current"]::after {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.14);
}

.video-project-tree-item[data-video-tree-state="ready"]::after {
  background: #facc15;
}

.video-project-tree-item[data-video-tree-state="loading"]::after {
  background: transparent;
  border: 1px solid var(--accent);
}

.video-project-tree-item[data-video-tree-state="blocked"]::after,
.video-project-tree-item[data-video-tree-state="waiting"]::after {
  background: #3f5149;
}

.video-project-tree-item:disabled {
  cursor: default;
}

.video-tree-preview {
  border: 1px solid rgba(139, 179, 161, 0.22);
  border-radius: 8px;
  background: #050807;
  padding: 10px;
}

.video-tree-preview .video-output-preview-body {
  max-height: min(24vh, 260px);
  font-size: 0.88rem;
}

.video-design-sheet-panel {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.video-workflow-stack {
  display: grid;
  gap: 14px;
}

.video-workflow-section {
  display: grid;
  gap: 10px;
  min-width: 0;
  scroll-margin-top: 18px;
  border: 1px solid rgba(139, 179, 161, 0.22);
  border-radius: 8px;
  background: #050807;
  padding: 14px;
}

.video-workflow-section h3 {
  margin: 0;
  font-size: 1.08rem;
}

.video-workflow-section-collapsible {
  gap: 0;
  overflow: hidden;
  padding: 0;
}

.video-workflow-section-collapsible:not([open]) {
  background: #070b09;
}

.video-workflow-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  cursor: pointer;
  list-style: none;
  padding: 12px 14px;
}

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

.video-workflow-summary:hover,
.video-workflow-summary:focus-visible {
  background: rgba(16, 185, 129, 0.06);
}

.video-workflow-summary-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.video-workflow-summary-title {
  overflow: hidden;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-workflow-summary-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: max-content;
}

.video-workflow-summary-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  min-width: 54px;
  border: 1px solid rgba(139, 179, 161, 0.28);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.video-workflow-section-collapsible[open] .video-workflow-summary-toggle {
  border-color: rgba(16, 185, 129, 0.45);
  color: var(--accent);
}

.video-workflow-summary-toggle-open,
.video-workflow-section-collapsible[open] .video-workflow-summary-toggle-closed {
  display: none;
}

.video-workflow-section-collapsible[open] .video-workflow-summary-toggle-open {
  display: inline;
}

.video-workflow-collapsible-body {
  display: grid;
  gap: 10px;
  min-width: 0;
  border-top: 1px solid rgba(139, 179, 161, 0.16);
  padding: 12px 14px 14px;
}

.video-workflow-cost {
  width: fit-content;
  max-width: 100%;
  border: 1px solid rgba(139, 179, 161, 0.22);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(139, 179, 161, 0.06);
  padding: 4px 9px;
  font-size: 0.82rem;
  font-weight: 800;
}

.video-workflow-status {
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.08);
  color: #bbf7d0;
  padding: 10px 12px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.video-workflow-status.is-error {
  border-left-color: var(--danger);
  background: rgba(248, 113, 113, 0.1);
  color: #fecaca;
}

.video-workflow-loading {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.video-workflow-loading-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid var(--accent);
  border-right-color: transparent;
  border-radius: 999px;
  animation: videoWorkflowSpin 0.75s linear infinite;
}

.video-workflow-loading p {
  margin: 6px 0 0;
}

.video-workflow-loading [data-video-story-loading-elapsed] {
  color: var(--muted);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.video-story-loaded-content {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.video-workflow-content {
  min-width: 0;
}

.video-workflow-body {
  max-height: 520px;
  overflow: auto;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.65;
  white-space: pre-wrap;
}

.video-workflow-copy-preview {
  display: grid;
  gap: 5px;
  width: 100%;
  border: 1px solid rgba(139, 179, 161, 0.24);
  border-radius: 8px;
  background: rgba(139, 179, 161, 0.05);
  color: var(--text);
  cursor: pointer;
  padding: 10px 12px;
  text-align: left;
}

.video-workflow-copy-preview span {
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 850;
}

.video-workflow-copy-preview small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-workflow-copy-preview:hover,
.video-workflow-copy-preview:focus-visible {
  border-color: rgba(16, 185, 129, 0.48);
  background: rgba(16, 185, 129, 0.08);
  outline: none;
}

.video-workflow-empty {
  color: var(--muted);
  font-size: 0.92rem;
}

.video-workflow-details {
  display: grid;
  gap: 10px;
}

.video-workflow-details:not([open]) > :not(summary) {
  display: none;
}

.video-workflow-details summary {
  width: fit-content;
  border: 1px solid rgba(139, 179, 161, 0.28);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 800;
  padding: 5px 10px;
}

.video-workflow-details summary:hover,
.video-workflow-details summary:focus-visible {
  border-color: rgba(16, 185, 129, 0.45);
  color: var(--text);
}

.video-workflow-details[open] summary {
  color: var(--accent);
}

.video-workflow-image,
.video-workflow-video,
.video-workflow-audio {
  display: grid;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  margin: 4px 0 0;
}

.video-workflow-image img {
  display: block;
  width: min(100%, 640px);
  max-width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #050806;
  cursor: zoom-in;
}

.video-workflow-image img:hover,
.video-workflow-image img:focus-visible {
  border-color: rgba(16, 185, 129, 0.65);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
  outline: none;
}

.video-workflow-video video {
  display: block;
  width: min(100%, 720px);
  max-width: 100%;
  max-height: 420px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #050806;
}

.video-workflow-audio audio {
  display: block;
  width: min(100%, 720px);
  max-width: 100%;
}

.video-workflow-image figcaption,
.video-workflow-video figcaption,
.video-workflow-audio figcaption {
  color: var(--muted);
  font-size: 0.88rem;
}

.video-workflow-lightbox {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  background: rgba(1, 6, 4, 0.94);
  padding: 18px;
}

.video-workflow-lightbox-close {
  justify-self: end;
  min-height: 36px;
  border: 1px solid rgba(139, 179, 161, 0.34);
  border-radius: 999px;
  background: #07110d;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  padding: 7px 13px;
}

.video-workflow-lightbox-close:hover,
.video-workflow-lightbox-close:focus-visible {
  border-color: rgba(16, 185, 129, 0.65);
  background: rgba(16, 185, 129, 0.12);
  outline: none;
}

.video-workflow-lightbox figure {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  min-width: 0;
  min-height: 0;
  margin: 0;
}

.video-workflow-lightbox img {
  align-self: center;
  justify-self: center;
  max-width: 100%;
  max-height: calc(100vh - 104px);
  width: auto;
  height: auto;
  object-fit: contain;
  border: 1px solid rgba(139, 179, 161, 0.28);
  border-radius: 8px;
  background: #050806;
}

.video-workflow-lightbox figcaption {
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.video-workflow-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}

.video-workflow-actions .video-workflow-action-small {
  min-height: 34px;
  padding: 7px 11px;
  font-size: 0.86rem;
}

.video-workflow-actions .video-workflow-action-quiet {
  color: var(--muted);
  background: transparent;
  border-color: rgba(139, 179, 161, 0.28);
}

.video-workflow-actions .video-workflow-action-quiet:hover,
.video-workflow-actions .video-workflow-action-quiet:focus-visible {
  color: var(--text);
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.08);
}

.video-workflow-actions .video-workflow-action-subtle {
  opacity: 0.72;
}

.video-workflow-actions .video-workflow-action-selected {
  border-color: rgba(16, 185, 129, 0.58);
  background: rgba(16, 185, 129, 0.12);
  color: var(--text);
}

button.is-busy,
.video-workflow-actions .is-busy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

button.is-busy:disabled,
.video-workflow-actions .is-busy:disabled {
  opacity: 1;
  cursor: wait;
}

button.is-busy::before,
.video-workflow-actions .is-busy::before {
  content: "";
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: videoWorkflowSpin 0.7s linear infinite;
}

.video-workflow-actions [data-video-workflow-pending-label] {
  font-variant-numeric: tabular-nums;
}

button.is-busy {
  font-variant-numeric: tabular-nums;
}

.video-project-layout.is-video-long-action-locked,
.video-script-layout.is-video-long-action-locked,
.video-chapter-layout.is-video-long-action-locked {
  position: relative;
  isolation: isolate;
}

.video-project-layout.is-video-long-action-locked::after,
.video-script-layout.is-video-long-action-locked::after,
.video-chapter-layout.is-video-long-action-locked::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(1, 6, 4, 0.66);
  cursor: wait;
}

.video-long-action-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
  pointer-events: none;
}

.video-long-action-dialog {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  width: min(440px, calc(100vw - 40px));
  border: 1px solid rgba(16, 185, 129, 0.34);
  border-radius: 8px;
  background: #07110d;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  padding: 18px;
  color: var(--text);
}

.video-long-action-dialog strong {
  display: block;
  font-size: 0.98rem;
  line-height: 1.3;
}

.video-long-action-dialog p {
  margin: 4px 0 8px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.video-long-action-dialog span {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.is-video-long-action-active-region {
  position: relative;
  z-index: 90;
}

.is-video-long-action-locked [aria-disabled="true"] {
  cursor: wait;
  pointer-events: none;
}

.video-script-layout.is-video-long-action-locked .video-story-sidebar,
.video-script-layout.is-video-long-action-locked .video-output-preview,
.video-script-layout.is-video-long-action-locked .video-script-refinement,
.video-script-layout.is-video-long-action-locked .video-chapter-map-editor,
.video-project-layout.is-video-long-action-locked .video-story-sidebar,
.video-project-layout.is-video-long-action-locked .video-story-source-card,
.video-project-layout.is-video-long-action-locked .video-output-preview,
.video-project-layout.is-video-long-action-locked .video-story-revision,
.video-project-layout.is-video-long-action-locked .video-project-restart,
.video-chapter-layout.is-video-long-action-locked .video-chapter-sidebar,
.video-chapter-layout.is-video-long-action-locked .video-workflow-section {
  opacity: 0.42;
  filter: grayscale(0.35);
}

.video-script-layout.is-video-long-action-locked .is-video-long-action-active-region,
.video-project-layout.is-video-long-action-locked .video-story-approval {
  opacity: 1;
  filter: none;
}

.video-chapter-layout.is-video-long-action-locked .video-workflow-section:has(.is-busy) {
  opacity: 1;
  filter: none;
}

.video-project-layout.is-video-long-action-locked textarea,
.video-project-layout.is-video-long-action-locked input,
.video-project-layout.is-video-long-action-locked select,
.video-chapter-layout.is-video-long-action-locked textarea,
.video-chapter-layout.is-video-long-action-locked input,
.video-chapter-layout.is-video-long-action-locked select {
  cursor: wait;
}

.video-stage-card button.is-busy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.video-stage-card button.is-busy:disabled {
  opacity: 1;
  cursor: wait;
}

.video-stage-card button.is-busy::before {
  content: "";
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: videoWorkflowSpin 0.7s linear infinite;
}

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

.video-design-image-upload,
.video-storyboard-image-upload {
  display: grid;
  gap: 12px;
}

.video-design-image-preview,
.video-storyboard-image-preview {
  display: grid;
  gap: 8px;
}

.video-design-image-preview img,
.video-storyboard-image-preview img {
  display: block;
  width: min(100%, 520px);
  max-height: 360px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #050806;
}

.video-design-image-preview span,
.video-storyboard-image-preview span {
  color: var(--muted);
  font-size: 0.88rem;
}

.video-design-upload-actions,
.video-storyboard-upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.video-story-progress-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090d0b;
  color: var(--muted);
  padding: 10px;
  width: 100%;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.video-story-progress-item.is-active {
  border-color: rgba(16, 185, 129, 0.68);
  background: rgba(16, 185, 129, 0.11);
  color: var(--text);
}

.video-story-progress-item.is-complete {
  border-color: rgba(56, 189, 248, 0.5);
  color: var(--text);
}

.video-story-progress-item.is-locked {
  opacity: 0.62;
}

.video-story-progress-item:disabled {
  cursor: default;
}

.video-story-progress-item:not(:disabled):hover,
.video-story-progress-item:not(:disabled):focus-visible {
  border-color: rgba(16, 185, 129, 0.65);
  color: var(--text);
}

.video-story-progress-number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 900;
}

.video-story-progress-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.video-story-progress-copy strong {
  color: var(--text);
  font-size: 0.92rem;
}

.video-story-progress-copy small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.video-project-tree-item.video-story-progress-item {
  grid-template-columns: 22px minmax(0, 1fr) 8px;
  gap: 8px;
  min-height: 40px;
  border-color: rgba(139, 179, 161, 0.18);
  padding: 6px 8px;
}

.video-project-tree-item .video-story-progress-number {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #050807;
  font-size: 0.68rem;
}

.video-project-tree-item .video-story-progress-copy {
  gap: 0;
}

.video-project-tree-item .video-story-progress-copy strong {
  overflow: hidden;
  font-size: 0.84rem;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-project-tree-item .video-story-progress-copy small {
  margin-top: 1px;
  font-size: 0.66rem;
  line-height: 1.15;
}

.video-project-tree-item::after {
  grid-column: 3;
  grid-row: 1;
  align-self: center;
  justify-self: center;
}

.video-project-tree-item[data-video-tree-state="done"] .video-story-progress-number {
  border-color: rgba(56, 189, 248, 0.58);
  color: #7dd3fc;
}

.video-project-tree-item[data-video-tree-state="current"] .video-story-progress-number,
.video-project-tree-item.is-active .video-story-progress-number {
  border-color: rgba(16, 185, 129, 0.78);
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent);
}

.video-project-tree-item[data-video-tree-state="ready"] .video-story-progress-number {
  border-color: rgba(250, 204, 21, 0.52);
  color: #fde68a;
}

.video-project-tree-item[data-video-tree-state="waiting"] .video-story-progress-number,
.video-project-tree-item[data-video-tree-state="blocked"] .video-story-progress-number {
  border-color: rgba(139, 179, 161, 0.2);
  color: #6f8078;
}

.video-story-main {
  min-width: 0;
}

.video-story-main .video-production-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 20px;
}

.video-story-main .video-output-preview-body {
  max-height: min(52vh, 620px);
}

.video-project-layout > .child-branch-panel,
.video-project-context-panel {
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 20px;
}

.video-project-layout > .child-branch-panel {
  padding-top: 20px;
}

.video-project-layout .child-branch-type-grid {
  margin-bottom: 6px;
}

.video-project-chat {
  scroll-margin-top: 18px;
}

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

.video-project-story-layout .video-project-context-panel {
  grid-template-columns: 1fr;
}

.video-project-context-panel details,
.video-parent-link {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090d0b;
  padding: 14px;
}

.video-project-context-panel summary {
  color: var(--accent);
  font-weight: 850;
  cursor: pointer;
}

.video-parent-link a {
  display: block;
  overflow-wrap: anywhere;
  color: var(--text);
  font-weight: 850;
  text-decoration: none;
}

.video-parent-link a:hover,
.video-parent-link a:focus-visible {
  color: var(--accent);
}

.video-project-support-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

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

.branch-context-panel summary {
  color: var(--accent);
  font-weight: 850;
  cursor: pointer;
}

.branch-context-body {
  max-height: 340px;
  overflow: auto;
  margin-top: 12px;
  white-space: pre-wrap;
  color: #d9e3de;
  line-height: 1.62;
}

.branch-goal-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090d0b;
  padding: 14px;
}

.branch-goal-box p {
  margin: 0;
  color: #d9e3de;
  line-height: 1.55;
  white-space: pre-wrap;
}

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

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

.branch-empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090d0b;
}

.branch-message {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: 8px;
  background: #090d0b;
  padding: 14px;
}

.branch-message.is-user {
  border-left-color: var(--accent);
}

.branch-message.is-assistant {
  border-left-color: #38bdf8;
}

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

.branch-message-meta strong {
  color: var(--text);
}

.branch-message-body {
  white-space: pre-wrap;
  color: #e5ece8;
  line-height: 1.65;
}

.first-response-actions {
  margin: 0;
}

.branch-chat-form {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.video-production-panel {
  display: grid;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

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

.video-stage-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090d0b;
  padding: 14px;
}

.video-stage-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(17, 185, 129, 0.45);
  border-radius: 50%;
  background: rgba(17, 185, 129, 0.12);
  color: var(--accent);
  font-weight: 900;
}

.video-stage-body {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.video-stage-body h3 {
  margin: 0;
  font-size: 1.05rem;
}

.video-stage-body .field {
  margin-bottom: 0;
}

.video-story-direction-controls {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(139, 179, 161, 0.22);
  border-radius: 8px;
  background: #050807;
  padding: 12px;
}

.video-story-direction-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.video-story-option-field {
  display: grid;
  gap: 7px;
  min-width: 0;
  margin: 0;
}

.video-story-option-field-wide {
  grid-column: 1 / -1;
}

.video-story-option-field span,
.video-story-emphasis legend {
  color: #d9e3de;
  font-size: 0.86rem;
  font-weight: 800;
}

.video-story-option-field input,
.video-story-option-field select {
  min-height: 42px;
}

.video-story-emphasis {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.video-story-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.video-story-checkbox-grid .checkbox-row {
  min-width: 0;
  min-height: 38px;
  margin: 0;
  border: 1px solid rgba(139, 179, 161, 0.18);
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.04);
  padding: 8px 10px;
}

.video-story-checkbox-grid .checkbox-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.video-story-direction-notes textarea {
  min-height: 92px;
}

.video-stage-actions {
  margin: 4px 0 0;
}

.video-output-preview {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid rgba(139, 179, 161, 0.22);
  border-radius: 8px;
  background: #050807;
  padding: 12px;
}

.video-output-preview-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.video-output-preview-head > :first-child {
  min-width: 0;
  margin-right: auto;
}

.video-output-preview-meta {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  padding: 3px 8px;
  text-transform: none;
}

.video-workflow-approved {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(16, 185, 129, 0.45);
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.1);
  color: #6ee7b7;
  padding: 3px 8px;
  text-transform: none;
}

.video-workflow-approved::before {
  content: "✓";
  font-weight: 950;
}

.video-duration-note {
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
  padding: 2px 0 2px 10px;
}

.video-output-preview-body {
  max-height: 320px;
  overflow: auto;
  color: var(--text);
  font-size: 0.96rem;
  line-height: 1.65;
  white-space: pre-wrap;
}

.video-copyable-prompt {
  cursor: copy;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.video-copyable-prompt:hover,
.video-copyable-prompt:focus {
  border-color: rgba(16, 185, 129, 0.75);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.14);
  outline: none;
}

.video-story-revision,
.video-story-approval {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.video-story-revision {
  border: 1px solid rgba(139, 179, 161, 0.22);
  border-radius: 8px;
  background: #050807;
  padding: 12px;
}

.video-story-refinement-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.video-story-revision-toggle {
  justify-self: start;
  min-height: 30px;
}

.video-story-revision-fields {
  display: grid;
  gap: 10px;
}

.video-chapter-map-editor {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.video-chapter-map-editor .branch-section-heading {
  align-items: center;
  margin-bottom: 2px;
}

.video-map-note {
  margin: 0;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  padding: 2px 0 2px 10px;
}

.video-map-fields,
.video-map-intro,
.video-map-chapters,
.video-map-scenes {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.video-map-readonly,
.video-map-readonly-overview,
.video-map-readonly-chapters,
.video-map-readonly-scenes {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.video-map-readonly-chapter,
.video-map-readonly-scene {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid rgba(139, 179, 161, 0.22);
  border-radius: 6px;
  background: #070b09;
  padding: 12px;
}

.video-map-readonly-chapter {
  background: #090d0b;
}

.video-map-readonly-scene {
  margin-left: 10px;
}

.video-map-readonly-title {
  display: grid;
  gap: 4px;
}

.video-map-readonly-title h4,
.video-map-readonly-title h5 {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
}

.video-map-readonly-title h5 {
  font-size: 0.95rem;
}

.video-map-readonly-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.video-map-readonly-value {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.video-map-readonly-value p {
  margin: 0;
  color: #d9e3de;
  font-size: 0.92rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.video-map-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.video-map-fields label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: #d9e3de;
  font-size: 0.86rem;
  font-weight: 650;
}

.video-map-fields input,
.video-map-fields textarea {
  min-height: 36px;
  border-radius: 6px;
  padding: 8px 10px;
  color: #d9e3de;
  font-size: 0.9rem;
  font-weight: 450;
  line-height: 1.42;
}

.video-map-fields textarea {
  min-height: 70px;
}

.video-map-chapter,
.video-map-scene {
  display: grid;
  gap: 9px;
  min-width: 0;
  border: 1px solid rgba(139, 179, 161, 0.22);
  border-radius: 6px;
  background: #070b09;
  padding: 12px;
}

.video-map-chapter {
  background: #090d0b;
}

.video-map-scene {
  margin-left: 10px;
}

.video-map-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.button.text-button {
  min-height: 34px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 0 8px;
}

.button.text-button:hover,
.button.text-button:focus-visible {
  border-color: var(--line);
  color: var(--text);
}

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

.video-character-preview {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #050807;
}

.video-character-preview img,
.related-item-image {
  display: block;
  width: 100%;
  height: auto;
}

.related-item-image {
  max-height: 280px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #050807;
  margin-top: 10px;
}

.workspace-shell {
  width: min(1080px, calc(100% - 32px));
}

.workspace-tabs,
.branch-detail-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.workspace-tabs a,
.branch-detail-tabs a {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  padding: 9px 12px;
  font-weight: 850;
  text-decoration: none;
}

.workspace-tabs a:hover,
.workspace-tabs a:focus-visible,
.workspace-tabs a.is-active,
.branch-detail-tabs a:hover,
.branch-detail-tabs a:focus-visible,
.branch-detail-tabs a.is-active {
  border-color: rgba(16, 185, 129, 0.55);
  background: rgba(16, 185, 129, 0.1);
  color: var(--text);
}

.workspace-count-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.workspace-count-tile {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
  text-decoration: none;
}

.workspace-count-tile strong,
.workspace-count-tile span {
  display: block;
}

.workspace-count-tile strong {
  color: var(--text);
  font-size: 1.2rem;
}

.workspace-count-tile span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.workspace-library-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
  align-items: start;
}

.workspace-form-panel,
.workspace-object-form {
  display: grid;
  gap: 12px;
}

.workspace-form-panel h2 {
  margin-bottom: 4px;
}

.workspace-library-list,
.workspace-search-results {
  display: grid;
  gap: 12px;
}

.workspace-library-card,
.workspace-search-result,
.related-item-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
}

.workspace-library-card h2,
.workspace-search-result strong,
.related-item-card strong {
  overflow-wrap: anywhere;
}

.workspace-library-card p,
.workspace-search-result p,
.related-item-card p {
  margin: 8px 0 0;
  color: #d9e3de;
  line-height: 1.55;
}

.workspace-search-group {
  display: grid;
  gap: 10px;
}

.workspace-search-group h2 {
  margin-top: 12px;
}

.related-items-panel {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

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

.related-item-card span,
.related-item-content {
  min-width: 0;
}

.related-item-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.related-item-content {
  flex: 1;
}

.related-item-actions {
  display: flex;
  flex-wrap: wrap;
  flex-shrink: 0;
  justify-content: flex-end;
  gap: 8px;
}

.related-item-full-text {
  margin-top: 10px;
}

.related-item-full-text summary {
  color: var(--accent);
  cursor: pointer;
  font-weight: 800;
}

.related-item-full-text pre {
  overflow: auto;
  max-height: 360px;
  margin: 10px 0 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #050807;
  color: #d9e3de;
  padding: 12px;
  white-space: pre-wrap;
  line-height: 1.55;
}

.related-item-form {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.related-item-form-grid {
  display: grid;
  grid-template-columns: 1fr 0.65fr 1fr;
  gap: 10px;
}

.related-new-asset-fields {
  display: grid;
  grid-template-columns: minmax(180px, 0.75fr) minmax(0, 1.5fr);
  gap: 10px;
}

.workspace-markdown-preview,
.guidance-markdown-preview pre {
  overflow: auto;
  max-height: 280px;
  margin: 12px 0 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #050807;
  color: #d9e3de;
  padding: 12px;
  white-space: pre-wrap;
  line-height: 1.55;
}

.workflow-builder-card {
  gap: 16px;
}

.workflow-steps-panel,
.branch-guidance-panel,
.guidance-workflow-card {
  display: grid;
  gap: 12px;
}

.workflow-step-list,
.guidance-list {
  display: grid;
  gap: 10px;
}

.workflow-step-row,
.guidance-chip-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #050807;
  padding: 12px;
}

.workflow-step-row span,
.guidance-chip-card span {
  min-width: 0;
}

.workflow-step-row small,
.guidance-chip-card small,
.guidance-step-list small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.workflow-step-order {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  font-weight: 850;
}

.workflow-step-form,
.guidance-attach-form,
.guidance-step-form {
  display: grid;
  gap: 10px;
}

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

.guidance-step-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 22px;
}

.guidance-step-list li {
  color: #d9e3de;
}

.guidance-step-list li.is-current {
  color: var(--accent);
  font-weight: 850;
}

.document-card {
  display: grid;
  gap: 18px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090d0b;
  padding: 18px;
}

.document-card-top,
.document-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.document-title-block {
  min-width: 0;
}

.document-type {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.document-title-block h2 {
  overflow-wrap: anywhere;
  font-size: 1.2rem;
}

.source-url-line {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
}

.source-url-line:hover,
.source-url-line:focus-visible {
  color: var(--accent);
}

.document-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.84rem;
}

.document-meta-row span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
}

.document-item strong,
.document-item small,
.document-job-item strong,
.document-job-item small {
  display: block;
}

.document-item strong {
  color: var(--text);
}

.document-item small {
  margin-top: 5px;
  color: var(--muted);
}

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

.button.danger {
  border-color: rgba(248, 113, 113, 0.35);
  color: #fecaca;
}

.button.danger:hover,
.button.danger:focus-visible {
  border-color: var(--danger);
}

.document-usage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.document-usage-grid.single-column {
  grid-template-columns: 1fr;
}

.document-job-group {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}

.document-job-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.document-job-heading h3 {
  margin: 0;
  font-size: 0.94rem;
}

.document-job-heading span {
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent);
  padding: 2px 8px;
  font-size: 0.74rem;
  font-weight: 850;
}

.document-job-list {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.document-job-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 12px;
  text-decoration: none;
}

.document-job-item:hover,
.document-job-item:focus-visible {
  border-color: rgba(16, 185, 129, 0.55);
}

.document-job-item strong {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.document-job-item small {
  margin-top: 4px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.document-job-item > span:first-child {
  min-width: 0;
}

.document-job-item .history-date {
  flex-shrink: 0;
  white-space: nowrap;
}

.document-lock-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.document-work-panel {
  display: grid;
  gap: 12px;
}

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

.document-work-item {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090d0b;
  padding: 16px;
}

.document-work-item a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--text);
  text-decoration: none;
}

.document-work-item a:hover strong,
.document-work-item a:focus-visible strong {
  color: var(--accent);
}

.document-work-item span {
  min-width: 0;
}

.document-work-item strong,
.document-work-item small {
  display: block;
}

.document-work-item strong {
  overflow-wrap: anywhere;
}

.document-work-item small {
  margin-top: 5px;
  color: var(--muted);
}

.document-work-item b {
  color: var(--accent);
}

.document-work-item p {
  margin: 0;
  color: #d9e3de;
  line-height: 1.55;
}

.document-work-instructions {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 10px 12px;
}

.document-work-instructions span {
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.document-work-instructions p {
  color: var(--muted);
}

.saved-document-locked {
  border: 1px solid rgba(16, 185, 129, 0.32);
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.08);
  padding: 14px;
}

.saved-document-locked select:disabled {
  opacity: 1;
  border-color: rgba(16, 185, 129, 0.24);
  color: var(--text);
}

.pwa-notice {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(420px, calc(100vw - 36px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #121712;
  color: var(--text);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  padding: 12px 14px;
}

.pwa-notice[hidden] {
  display: none;
}

.pwa-notice button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--accent);
  font-weight: 800;
  padding: 8px 10px;
  cursor: pointer;
}

.offline-body {
  min-height: 100vh;
  background: var(--bg);
}

.offline-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.offline-card {
  max-width: 520px;
  text-align: center;
}

.field-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.field-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  cursor: pointer;
}

.field-chip.is-selected {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(16, 185, 129, 0.14);
}

.stream-feed {
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090d0b;
  margin-bottom: 16px;
  padding: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.feed-done {
  color: var(--accent);
}

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

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

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

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

th {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.markdown-result {
  margin-top: 24px;
  color: #d9e3de;
  line-height: 1.62;
}

.markdown-result h2,
.markdown-result h3 {
  margin-top: 28px;
  margin-bottom: 10px;
}

.sources {
  margin-top: 28px;
}

.sources a {
  color: var(--accent);
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  min-height: 100vh;
}

.auth-visual {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 100vh;
  overflow: hidden;
  padding: 48px;
}

.auth-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.68;
}

.auth-visual::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, rgba(7, 9, 8, 0.1), rgba(7, 9, 8, 0.92));
}

.auth-visual-copy {
  position: relative;
  z-index: 1;
  max-width: 680px;
}

.auth-visual-copy span {
  display: block;
  margin-bottom: 14px;
  color: var(--accent);
  font-weight: 850;
  text-transform: uppercase;
}

.auth-visual-copy h1 {
  font-size: clamp(2.2rem, 5vw, 4.4rem);
}

.auth-visual-copy p {
  max-width: 560px;
  color: #d4ded9;
  font-size: 1.1rem;
}

.auth-panel {
  display: flex;
  justify-content: center;
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: var(--bg);
  padding: 48px;
}

.auth-brand {
  display: inline-grid;
  grid-template-columns: 42px auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 12px;
  width: max-content;
  margin-bottom: 42px;
  text-decoration: none;
}

.auth-brand img {
  grid-row: span 2;
  width: 42px;
  height: 42px;
}

.auth-brand span {
  color: var(--muted);
  font-size: 0.8rem;
}

.auth-brand strong {
  font-size: 1.1rem;
}

.auth-heading {
  margin-bottom: 28px;
}

.auth-heading h2 {
  font-size: 2rem;
}

.upload-box {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 112px;
  border: 1px dashed #3f5149;
  border-radius: 8px;
  background: var(--panel-strong);
  padding: 18px;
  cursor: pointer;
}

.upload-box:hover,
.upload-box.is-dragging {
  border-color: var(--accent);
}

.upload-box input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

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

.image-upload-box {
  align-items: stretch;
}

.reference-upload-box {
  min-height: 86px;
}

.image-preview {
  flex: 0 0 112px;
  width: 112px;
  min-height: 84px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090d0b;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

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

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

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

.full-button {
  width: 100%;
}

.form-error {
  margin-bottom: 16px;
  border-left: 3px solid var(--danger);
  border-radius: 6px;
  background: rgba(248, 113, 113, 0.1);
  color: #fecaca;
  padding: 12px 14px;
}

.form-error.success {
  border-left-color: var(--accent);
  background: rgba(16, 185, 129, 0.1);
  color: #bbf7d0;
}

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

.is-hidden {
  display: none !important;
}

.result-card {
  margin-top: 20px;
}

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

pre {
  margin: 0;
  white-space: pre-wrap;
  color: #d9e3de;
  font: inherit;
  line-height: 1.55;
}

@media (max-width: 700px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-visual {
    min-height: 34vh;
    padding: 24px;
  }

  .auth-panel {
    border-left: 0;
    padding: 28px 18px 60px;
  }

  .topbar,
  .app-nav,
  .section-heading,
  .result-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links,
  .app-nav-actions {
    width: 100%;
    overflow-x: auto;
  }

  .app-nav-actions {
    align-items: center;
    gap: 12px;
    padding-bottom: 4px;
  }

  .nav-group {
    flex: 0 0 auto;
  }

  .nav-group + .nav-group {
    padding-left: 12px;
  }

  .user-menu {
    margin-left: auto;
  }

  .user-menu-panel {
    position: fixed;
    top: 84px;
    right: 16px;
    left: 16px;
    width: auto;
  }

  .segmented,
  .inline-field-action,
  .branch-type-grid,
  .child-branch-type-grid,
  .video-project-workflow-options,
  .video-project-story-layout,
  .video-chapter-layout,
  .video-script-layout,
  .video-map-readonly-grid,
  .video-map-grid,
  .video-stage-card,
  .video-image-options,
  .video-project-context-panel,
  .video-project-support-grid,
  .workspace-count-grid,
  .workspace-library-layout,
  .related-item-form-grid,
  .related-new-asset-fields,
  .branch-guidance-grid,
  .share-row {
    grid-template-columns: 1fr;
  }

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

  .home-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .quick-action-bar {
    grid-template-columns: 1fr;
  }

  .quick-action {
    justify-content: flex-start;
  }

  .featured-quick-action {
    grid-column: auto;
  }

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

  .workspace-grid,
  .ai-tool-grid,
  .current-direction-list {
    grid-template-columns: 1fr;
  }

  .workspace-item,
  .thought-card,
  .video-project-source-head,
  .branch-card,
  .current-direction-card,
  .child-branch-card,
  .workspace-library-card,
  .workspace-search-result,
  .related-item-card,
  .workflow-step-row,
  .guidance-chip-card,
  .thought-detail-top,
  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .video-project-source-actions {
    justify-content: flex-start;
  }

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

  .current-direction-meta {
    justify-content: flex-start;
    max-width: none;
  }

  .image-upload-box {
    align-items: stretch;
    flex-direction: column;
  }

  .image-preview {
    flex-basis: auto;
    width: 100%;
    aspect-ratio: 4 / 3;
  }

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

  .account-grid,
  .api-key-form,
  .billing-summary,
  .usage-summary {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 18px;
  }

  .video-project-story-shell,
  .video-chapter-shell,
  .video-script-shell {
    width: min(1040px, calc(100% - 32px));
  }

  .video-project-story-shell .top-heading,
  .video-chapter-shell .top-heading,
  .video-script-shell .top-heading {
    align-items: flex-start;
  }

  .video-story-sidebar,
  .video-chapter-sidebar,
  .video-script-sidebar {
    position: static;
  }

  .video-script-layout .video-project-chat {
    grid-column: 1;
  }

  .video-map-scene {
    margin-left: 0;
  }

  .document-card-top,
  .document-item,
  .history-item-with-actions,
  .history-main-link,
  .empty-inline {
    align-items: flex-start;
    flex-direction: column;
  }

  .history-main-link {
    width: 100%;
  }

  .history-delete-button {
    width: 100%;
    min-height: 42px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .document-usage-grid {
    grid-template-columns: 1fr;
  }

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

  .branch-message-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .document-job-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .document-job-item .history-date {
    white-space: normal;
  }

  .document-actions {
    width: 100%;
    justify-content: stretch;
  }

  .document-actions .button {
    flex: 1;
  }

  .related-item-actions {
    width: 100%;
    justify-content: stretch;
  }

  .related-item-actions .button {
    flex: 1;
  }
}
