:root {
  --navy: #061a2e;
  --navy-2: #0a263f;
  --blue: #18a0fb;
  --blue-soft: #dff2ff;
  --paper: #f3f6f8;
  --white: #ffffff;
  --ink: #10202f;
  --muted: #667788;
  --line: #dce4ea;
  --success: #0d9f6e;
  --warning: #d98a00;
  --danger: #ce3c4b;
  --shadow: 0 16px 45px rgba(6, 26, 46, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.topbar {
  height: 72px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  background: var(--navy);
  border-bottom: 3px solid var(--blue);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.brand-mark img {
  width: 38px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.18));
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  letter-spacing: 0.08em;
}

.brand span {
  margin-top: 2px;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: #a9c8de;
}

.system-status {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: #c8d9e5;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 0 4px rgba(217, 138, 0, 0.14);
}

.system-status.ok .status-dot {
  background: #22d392;
  box-shadow: 0 0 0 4px rgba(34, 211, 146, 0.14);
}

.layout {
  min-height: calc(100vh - 72px);
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  padding: 24px 18px;
  color: white;
  background: var(--navy-2);
}

.sidebar-label {
  margin: 28px 10px 10px;
  color: #7f9bae;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.sidebar-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
}

.sidebar-toggle {
  margin-bottom: 6px;
  padding: 5px 8px;
  color: #7f9bae;
  background: transparent;
  border: 1px solid #345069;
  border-radius: 7px;
  font-size: 10px;
}

.sidebar-toggle.active {
  color: white;
  border-color: var(--blue);
}

.sidebar-empty {
  padding: 16px 10px;
  color: #7f9bae;
  font-size: 11px;
  line-height: 1.5;
}

.project-list {
  display: grid;
  gap: 7px;
}

.project-item {
  width: 100%;
  padding: 13px 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  text-align: left;
  color: #c9d9e4;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
}

.project-item:hover,
.project-item.active {
  color: white;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(24, 160, 251, 0.35);
}

.project-item.archived {
  opacity: 0.66;
}

.project-item i {
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  background: #6f8493;
}

.project-item i.ready {
  background: #22d392;
}

.project-item i.failed {
  background: var(--danger);
}

.project-item span {
  overflow: hidden;
}

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

.project-item b {
  font-size: 13px;
}

.project-item small {
  margin-top: 3px;
  color: #7f9bae;
  font-size: 11px;
}

.workspace {
  min-width: 0;
  padding: 32px;
}

.empty-state {
  max-width: 650px;
  min-height: 70vh;
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.empty-icon {
  width: 80px;
  height: 80px;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
  color: white;
  background: linear-gradient(145deg, var(--blue), #0874bc);
  border-radius: 24px 8px 24px 8px;
  box-shadow: 0 18px 40px rgba(24, 160, 251, 0.25);
}

.empty-state h1 {
  margin: 0;
  max-width: 620px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.07;
  color: var(--navy);
}

.empty-state p {
  max-width: 590px;
  margin: 18px 0 26px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.primary,
.secondary,
.ghost,
.danger-button {
  min-height: 42px;
  padding: 0 18px;
  font-weight: 750;
  border-radius: 9px;
  border: 1px solid transparent;
}

.primary {
  color: white;
  background: var(--blue);
  box-shadow: 0 8px 22px rgba(24, 160, 251, 0.2);
}

.primary:hover {
  background: #0a91ea;
}

.primary:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
}

.secondary {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: #b6def7;
}

.ghost {
  color: var(--muted);
  background: transparent;
  border-color: var(--line);
}

.danger-button {
  color: #a62f3d;
  background: #fff0f2;
  border-color: #f3c7cd;
}

.compact {
  min-height: 32px;
  padding: 0 10px;
  font-size: 11px;
}

.icon-button {
  width: 31px;
  height: 31px;
  color: var(--muted);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.wide {
  width: 100%;
}

.project-view {
  max-width: 1460px;
  margin: auto;
}

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

.project-heading h1 {
  margin: 3px 0 5px;
  color: var(--navy);
  font-size: clamp(28px, 4vw, 42px);
}

.project-title-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.project-tools {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.project-heading p {
  margin: 0;
  color: var(--muted);
}

.eyebrow {
  color: var(--blue);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.16em;
}

.project-progress {
  width: min(280px, 30vw);
  text-align: right;
}

.project-progress span {
  color: var(--navy);
  font-size: 13px;
  font-weight: 800;
}

.progress-track {
  position: relative;
  height: 19px;
  margin-top: 7px;
  overflow: hidden;
  background: #dbe5eb;
  border-radius: 99px;
}

.progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), #5ec0ff);
  transition: width 0.35s ease;
}

.progress-track b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--navy);
  font-size: 10px;
  line-height: 1;
  text-shadow: 0 1px 2px white;
}

.project-progress > small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.alert {
  margin-bottom: 18px;
  padding: 14px 16px;
  color: #8c2430;
  background: #ffeaed;
  border: 1px solid #f7c4ca;
  border-radius: 10px;
}

.steps {
  margin-bottom: 22px;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  background: white;
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: 0 8px 28px rgba(6, 26, 46, 0.04);
}

.steps div {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #94a2ad;
  font-size: 12px;
  font-weight: 700;
}

.steps div:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0;
  width: 1px;
  height: 24px;
  background: var(--line);
}

.steps b {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #edf1f4;
}

.steps .active {
  color: var(--navy);
}

.steps .active b {
  color: white;
  background: var(--blue);
}

.steps .done {
  color: var(--success);
}

.steps .done b {
  color: white;
  background: var(--success);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(330px, 0.75fr);
  gap: 20px;
}

.panel {
  margin-bottom: 20px;
  padding: 22px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(6, 26, 46, 0.045);
}

.panel-heading {
  margin-bottom: 17px;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.panel-heading > div:first-child {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 10px;
  align-items: center;
}

.panel-heading h2 {
  margin: 0;
  color: var(--navy);
  font-size: 19px;
}

.panel-heading p {
  grid-column: 2;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.add-manual-issue {
  grid-column: 2;
  width: max-content;
  margin-top: 10px;
}

.section-number {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.badge {
  padding: 5px 9px;
  color: #536878;
  background: #edf2f5;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.badge.ready {
  color: #087a55;
  background: #dff8ef;
}

.video-container {
  min-height: 280px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #8ba0af;
  background: #071727;
  border-radius: 11px;
}

.video-container video {
  width: 100%;
  max-height: 520px;
  background: #000;
}

.video-placeholder {
  padding: 40px;
  text-align: center;
}

.action-row {
  margin-top: 15px;
  display: flex;
  align-items: center;
  gap: 13px;
}

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

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

.transcript {
  max-height: 470px;
  min-height: 260px;
  padding: 16px;
  overflow: auto;
  color: #344a5c;
  background: #f6f8fa;
  border: 1px solid #e3e9ed;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.75;
}

.transcript-row {
  margin-bottom: 10px;
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  background: white;
  border: 1px solid #e4eaee;
  border-radius: 8px;
}

.transcript-row.needs-review {
  background: #fff9e9;
  border-color: #f1d99b;
}

.transcript-row-meta {
  display: flex;
  align-items: center;
  gap: 5px;
}

.transcript-row time {
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
}

.transcript-row-meta span {
  color: #9c6900;
  font-size: 9px;
  font-weight: 800;
}

.transcript-row textarea {
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
  min-width: 0;
  min-height: 76px;
  padding: 8px;
  resize: vertical;
  color: #344a5c;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.transcript-row > button {
  grid-column: 2;
  grid-row: 1;
  white-space: nowrap;
}

.transcript-review {
  margin-bottom: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #6e4c00;
  background: #fff8e6;
  border: 1px solid #f0dda8;
  border-radius: 9px;
}

.transcript-review b,
.transcript-review small {
  display: block;
}

.transcript-review b {
  font-size: 12px;
}

.transcript-review small {
  margin-top: 3px;
  font-size: 10px;
}

.transcript-filters {
  display: flex;
  flex: none;
  gap: 5px;
}

.transcript-limit,
.transcript-empty {
  padding: 14px;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}

.manual-transcript {
  margin-top: 13px;
  color: var(--muted);
  font-size: 12px;
}

.manual-transcript summary {
  cursor: pointer;
  font-weight: 700;
}

.manual-transcript textarea {
  width: 100%;
  margin: 11px 0;
  padding: 12px;
  resize: vertical;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.issue-heading {
  align-items: center;
}

.platform-picker {
  width: min(760px, 100%);
  display: grid;
  gap: 10px;
}

.platform-picker-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
}

.platform-picker-title span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.platform-picker-title small {
  color: #8b9ca8;
  font-size: 10px;
}

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

.platform-option {
  min-width: 0;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #536878;
  background: #f2f5f7;
  border: 1px solid var(--line);
  border-radius: 9px;
  text-align: left;
}

.platform-option:has(input:checked) {
  color: var(--navy);
  background: var(--blue-soft);
  border-color: #8fcdf5;
}

.platform-option input {
  flex: none;
  accent-color: var(--blue);
}

.platform-option span {
  min-width: 0;
}

.platform-option b,
.platform-option small {
  display: block;
}

.platform-option b {
  font-size: 11px;
}

.platform-option small {
  margin-top: 2px;
  overflow: hidden;
  color: #718493;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.issue-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 14px;
}

.issue-card {
  position: relative;
  padding: 18px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.issue-card.selected {
  border-color: rgba(24, 160, 251, 0.65);
  box-shadow: 0 0 0 3px rgba(24, 160, 251, 0.08);
}

.issue-top {
  display: flex;
  justify-content: space-between;
  gap: 15px;
}

.issue-top-actions {
  display: grid;
  justify-items: end;
  align-content: start;
  gap: 8px;
  flex: none;
}

.issue-expand-toggle {
  min-width: 78px;
  white-space: nowrap;
}

.issue-heading {
  min-width: 0;
  flex: 1;
}

.issue-rank {
  color: #9aa9b4;
  font-size: 11px;
  font-weight: 850;
}

.score {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: none;
  color: var(--navy);
  background: var(--blue-soft);
  border-radius: 50%;
  font-weight: 900;
}

.score.manual {
  color: white;
  background: var(--navy);
}

.issue-title {
  display: grid;
  gap: 5px;
  margin: 7px 0 10px;
}

.issue-title > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.issue-title textarea {
  width: 100%;
  min-height: 58px;
  padding: 8px 10px;
  resize: vertical;
  color: var(--navy);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.35;
}

.title-count {
  color: #8596a3;
  font-size: 10px;
  text-align: right;
}

.title-count.over {
  color: #c0392b;
  font-weight: 800;
}

.issue-card p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.issue-speaker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}

.issue-speaker {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 0;
  color: var(--navy);
  font-size: 12px;
  font-weight: 850;
}

.issue-speaker input {
  min-width: 0;
  padding: 8px 10px;
  color: #294255;
  background: #f5f8fa;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
}

.issue-speaker em {
  margin-left: 3px;
  padding: 2px 5px;
  color: #9c6900;
  background: #fff2c8;
  border-radius: 99px;
  font-size: 8px;
  font-style: normal;
}

.issue-evidence {
  padding: 10px 12px;
  color: #3b5264;
  background: #f5f8fa;
  border-left: 3px solid var(--blue);
  font-size: 11px;
  line-height: 1.55;
}

.manual-field {
  margin-bottom: 11px;
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.manual-field textarea {
  width: 100%;
  padding: 9px 10px;
  resize: vertical;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  text-transform: none;
  letter-spacing: normal;
}

.issue-times {
  margin: 13px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.issue-times label,
.field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.issue-times input,
.field input,
.crop-controls select {
  width: 100%;
  height: 40px;
  padding: 0 11px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.duration-estimate {
  margin: -4px 0 12px;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #0b6b4f;
  background: #edf9f4;
  border: 1px solid #c9eadc;
  border-radius: 8px;
  font-size: 10px;
  line-height: 1.35;
}

.duration-estimate b {
  color: #075f47;
  font-size: 11px;
}

.duration-estimate em {
  margin-left: 5px;
  padding: 2px 6px;
  color: inherit;
  background: rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  font-size: 9px;
  font-style: normal;
  font-weight: 850;
  text-transform: uppercase;
}

.duration-estimate span {
  color: #517869;
  text-align: right;
}

.duration-estimate.ideal {
  color: #0b6b4f;
  background: #edf9f4;
  border-color: #c9eadc;
}

.duration-estimate.flex,
.duration-estimate.short {
  color: #9c6900;
  background: #fff7df;
  border-color: #f0d592;
}

.duration-estimate.long,
.duration-estimate.invalid {
  color: #9c2d26;
  background: #fff0f0;
  border-color: #f2b8b5;
}

.duration-estimate.flex b,
.duration-estimate.flex span,
.duration-estimate.short b,
.duration-estimate.short span {
  color: #8b6200;
}

.duration-estimate.long b,
.duration-estimate.long span,
.duration-estimate.invalid b,
.duration-estimate.invalid span {
  color: #8f2c25;
}

.issue-collapsible.collapsed {
  display: none;
}

.trim-suggestion {
  margin: -3px 0 12px;
  padding: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #365b48;
  background: #eef9f3;
  border: 1px solid #cce9d8;
  border-radius: 8px;
  font-size: 10px;
}

.hook-panel {
  margin-bottom: 12px;
  padding: 12px;
  background: #f7f8fa;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.hook-panel.enabled {
  background: #f1f8ff;
  border-color: #aad6f3;
  box-shadow: inset 3px 0 0 var(--blue);
}

.hook-heading,
.hook-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.hook-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--navy);
  font-size: 12px;
  font-weight: 850;
}

.hook-toggle input {
  accent-color: var(--blue);
}

.hook-source {
  padding: 3px 7px;
  color: #667788;
  background: #e9eef2;
  border-radius: 99px;
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.hook-source.ai {
  color: #087a55;
  background: #dff8ef;
}

.hook-fields {
  margin-top: 8px;
}

.hook-fields.muted {
  opacity: 0.62;
}

.hook-times {
  margin: 8px 0;
}

.hook-text-field {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.hook-text-field textarea {
  width: 100%;
  padding: 9px 10px;
  resize: vertical;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  text-transform: none;
}

.hook-reason {
  margin: 8px 0 !important;
  color: #536878 !important;
  font-size: 10px !important;
}

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

.crop-controls {
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.crop-controls label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.crop-controls select {
  padding: 0 8px;
}

.focus-control input {
  width: 100%;
  accent-color: var(--blue);
}

.enhance-control {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  min-height: 40px;
  background: #f6f8fa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.enhance-control input {
  accent-color: var(--blue);
}

.template-controls {
  margin-bottom: 12px;
  padding: 12px;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 9px;
  background: #fffaf0;
  border: 1px solid #eddcae;
  border-radius: 10px;
}

.template-controls label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.template-controls select,
.template-controls input[type="number"],
.template-controls input[type="text"] {
  width: 100%;
  height: 40px;
  padding: 0 10px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.template-controls .watermark-control {
  min-height: 40px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.template-controls .watermark-control input {
  accent-color: var(--blue);
}

.template-controls .source-credit-field {
  grid-column: 1 / -1;
}

.template-controls small {
  align-self: center;
  color: #7b6c48;
  font-size: 9px;
  line-height: 1.45;
}

.issue-caption {
  min-height: 85px;
  padding: 10px;
  resize: vertical;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
}

.caption-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.caption-field textarea {
  text-transform: none;
}

.subtitle-editor {
  margin-bottom: 12px;
  overflow: hidden;
  background: #f6f8fa;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.subtitle-editor summary {
  padding: 11px 12px;
  cursor: pointer;
  color: var(--navy);
  font-size: 11px;
  font-weight: 850;
}

.subtitle-editor summary span,
.subtitle-editor summary small {
  display: block;
}

.subtitle-editor summary small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
}

.subtitle-editor-list {
  max-height: 360px;
  padding: 0 10px 10px;
  overflow: auto;
}

.subtitle-edit-row {
  margin-top: 7px;
  padding: 8px;
  display: grid;
  grid-template-columns: auto 48px minmax(0, 1fr);
  align-items: start;
  gap: 7px;
  background: white;
  border: 1px solid #e1e7eb;
  border-radius: 8px;
}

.subtitle-edit-row.needs-review {
  background: #fff9e9;
  border-color: #f1d99b;
}

.subtitle-edit-row time {
  padding-top: 7px;
  color: var(--blue);
  font-size: 10px;
  font-weight: 850;
}

.subtitle-edit-row textarea {
  width: 100%;
  min-width: 0;
  min-height: 56px;
  padding: 7px 8px;
  resize: vertical;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 11px;
  line-height: 1.4;
}

.subtitle-edit-row em {
  grid-column: 3;
  color: #9c6900;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}

.subtitle-enable {
  padding-top: 8px;
}

.subtitle-enable input {
  accent-color: var(--blue);
}

.subtitle-editor-empty {
  padding: 14px;
  color: var(--muted);
  text-align: center;
  font-size: 10px;
}

.issue-actions {
  margin-top: auto;
  padding-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
}

.issue-actions button {
  min-width: 0;
  width: 100%;
  white-space: normal;
  line-height: 1.1;
}

.upload-progress {
  margin-top: 14px;
}

.upload-progress small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  text-align: center;
  font-size: 10px;
}

.empty-inline {
  grid-column: 1 / -1;
  padding: 32px;
  color: #8b9ca8;
  text-align: center;
  background: #f7f9fa;
  border: 1px dashed #d1dce3;
  border-radius: 10px;
}

.render-list {
  display: grid;
  gap: 18px;
}

.render-group {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.render-group-header {
  margin-bottom: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.render-group h3 {
  margin: 0;
  color: var(--navy);
  font-size: 16px;
}

.render-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.render-output {
  padding: 10px;
  background: #f4f7f9;
  border-radius: 9px;
}

.render-output video {
  width: 100%;
  max-height: 370px;
  background: #000;
  border-radius: 6px;
}

.render-output footer {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
}

.render-output a {
  color: var(--blue);
  font-weight: 750;
  text-decoration: none;
}

.log-section summary {
  cursor: pointer;
  color: var(--navy);
  font-size: 13px;
  font-weight: 800;
}

.log-list {
  margin-top: 12px;
  color: #506575;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  line-height: 1.8;
}

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

dialog {
  width: min(560px, calc(100vw - 30px));
  padding: 0;
  border: none;
  border-radius: 16px;
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.3);
}

dialog::backdrop {
  background: rgba(1, 13, 24, 0.72);
  backdrop-filter: blur(4px);
}

.dialog-card {
  position: relative;
  padding: 28px;
}

.dialog-card h2 {
  margin: 5px 0 22px;
  color: var(--navy);
  font-size: 27px;
}

.dialog-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 32px;
  height: 32px;
  color: var(--muted);
  background: #f0f3f5;
  border: none;
  border-radius: 50%;
}

.source-tabs {
  margin: 18px 0 14px;
  display: flex;
  gap: 5px;
  padding: 4px;
  background: #eef2f5;
  border-radius: 9px;
}

.source-tabs button {
  flex: 1;
  height: 38px;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 7px;
  font-weight: 750;
}

.source-tabs button.active {
  color: var(--navy);
  background: white;
  box-shadow: 0 3px 10px rgba(6, 26, 46, 0.08);
}

.dropzone {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: #f7fafc;
  border: 2px dashed #bfd0dc;
  border-radius: 11px;
}

.dropzone input {
  display: none;
}

.dropzone b {
  color: var(--navy);
}

.dropzone span {
  margin-top: 5px;
  font-size: 11px;
}

.dialog-actions {
  margin-top: 23px;
  display: flex;
  justify-content: end;
  gap: 9px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  max-width: 380px;
  padding: 13px 16px;
  color: white;
  background: var(--navy);
  border-left: 4px solid var(--blue);
  border-radius: 9px;
  box-shadow: var(--shadow);
  font-size: 13px;
}

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

  .sidebar {
    padding: 14px;
  }

  .sidebar-label {
    display: none;
  }

  .project-list {
    margin-top: 10px;
    display: flex;
    overflow-x: auto;
  }

  .project-item {
    min-width: 200px;
  }

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

@media (max-width: 700px) {
  .topbar {
    padding: 0 16px;
  }

  .system-status span:last-child {
    display: none;
  }

  .workspace {
    padding: 18px 12px;
  }

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

  .project-progress {
    width: 100%;
  }

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

  .panel {
    padding: 16px;
  }

  .panel-heading,
  .issue-heading {
    align-items: start;
    flex-direction: column;
  }

  .platform-options {
    grid-template-columns: 1fr 1fr;
  }

  .platform-picker-title {
    align-items: start;
    flex-direction: column;
  }

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

  .transcript-review,
  .trim-suggestion {
    align-items: stretch;
    flex-direction: column;
  }

  .transcript-row {
    grid-template-columns: 1fr;
  }

  .transcript-row-meta {
    grid-column: 1;
    grid-row: 1;
  }

  .transcript-row > button {
    grid-column: 1;
    grid-row: 3;
  }

  .subtitle-edit-row {
    grid-template-columns: auto 44px minmax(0, 1fr);
  }

  .crop-controls {
    grid-template-columns: 1fr;
  }

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

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