:root {
  --bg: #f4f1eb;
  --ink: #1c2430;
  --muted: #667085;
  --line: #d8d2c8;
  --panel: #fffdf8;
  --accent: #0c7c72;
  --accent-dark: #075c55;
  --warm: #d56b35;
  --shadow: 0 20px 60px rgba(26, 31, 44, 0.12);
}

* {
  box-sizing: border-box;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: #fff;
  background: #20242d;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(12, 124, 114, 0.12), transparent 32%),
    linear-gradient(315deg, rgba(213, 107, 53, 0.12), transparent 28%),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

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

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 34px;
  line-height: 1.08;
}

.topbar p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
}

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

.account-button {
  min-height: 38px;
  border: 1px solid var(--ink);
  border-radius: 7px;
  background: var(--ink);
  color: white;
  padding: 0 13px;
  cursor: pointer;
  font-weight: 800;
}

.admin-button {
  min-height: 38px;
}

.status-pill {
  border: 1px solid rgba(12, 124, 114, 0.24);
  color: var(--accent-dark);
  background: rgba(255, 255, 255, 0.54);
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.workspace {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 18px;
  align-items: stretch;
}

.panel {
  border: 1px solid rgba(87, 76, 60, 0.18);
  background: rgba(255, 253, 248, 0.88);
  box-shadow: var(--shadow);
  border-radius: 8px;
}

.input-panel,
.progress-panel,
.transcript-panel,
.history-panel,
.admin-panel {
  padding: 18px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ece6da;
}

.tab,
button,
select,
input {
  font: inherit;
}

.tab {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #5c6470;
  cursor: pointer;
  font-weight: 750;
}

.tab.active {
  color: white;
  background: var(--ink);
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.field span {
  font-size: 13px;
  color: #48505d;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fffefa;
  color: var(--ink);
  padding: 0 12px;
  outline: 2px solid transparent;
  outline-offset: 2px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(12, 124, 114, 0.14);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline-color: rgba(49, 91, 214, 0.7);
}

textarea {
  min-height: 132px;
  padding: 12px;
  resize: vertical;
  line-height: 1.55;
}

.hidden {
  display: none !important;
}

button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}

.primary,
.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 7px;
  border: 1px solid transparent;
  padding: 0 14px;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
}

.primary {
  width: 100%;
  color: white;
  background: var(--accent);
}

.primary:hover {
  background: var(--accent-dark);
}

.primary:disabled,
.secondary:disabled,
.secondary.disabled {
  opacity: 0.46;
  pointer-events: none;
}

.secondary {
  color: var(--ink);
  background: #fffefa;
  border-color: var(--line);
}

.note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.batch-queue {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  max-height: 260px;
  overflow: auto;
}

.batch-queue.hidden {
  display: none;
}

.batch-item button {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 2px 10px;
  width: 100%;
  min-height: 58px;
  border: 1px solid rgba(102, 112, 133, 0.18);
  border-radius: 8px;
  background: rgba(255, 254, 250, 0.78);
  padding: 9px 10px;
  text-align: left;
  cursor: pointer;
}

.batch-item button:disabled {
  cursor: default;
}

.batch-item span {
  grid-row: span 2;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 999px;
  background: rgba(102, 112, 133, 0.12);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.batch-item strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-item em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.batch-item.running span,
.batch-item.queued span,
.batch-item.submitting span {
  background: rgba(12, 124, 114, 0.1);
  color: var(--accent-dark);
}

.batch-item.complete span {
  background: rgba(12, 124, 114, 0.16);
  color: var(--accent-dark);
}

.batch-item.failed span {
  background: rgba(213, 107, 53, 0.14);
  color: #9b431d;
}

.service-plan {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 12px;
  margin: 4px 0 14px;
  padding: 12px;
  border: 1px solid rgba(12, 124, 114, 0.22);
  border-radius: 8px;
  background: rgba(12, 124, 114, 0.06);
}

.service-plan span,
.service-plan strong {
  font-size: 13px;
}

.service-plan strong {
  color: var(--accent-dark);
  text-align: right;
}

.service-plan p {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.auth-dialog {
  width: min(420px, calc(100% - 28px));
  padding: 0;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
}

.auth-dialog::backdrop {
  background: rgba(17, 23, 34, 0.52);
}

.auth-form {
  padding: 20px;
}

.auth-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.auth-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.dialog-close {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fffefa;
  color: var(--ink);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 16px;
  padding: 4px;
  border-radius: 8px;
  background: #ece6da;
}

.auth-tab {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.auth-tab.active {
  background: var(--ink);
  color: white;
}

.auth-message {
  min-height: 22px;
  margin: -2px 0 10px;
  color: #a33f20;
  font-size: 13px;
  line-height: 1.45;
}

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

.account-balance {
  border: 1px solid rgba(12, 124, 114, 0.22);
  border-radius: 8px;
  background: rgba(12, 124, 114, 0.06);
  padding: 11px 12px;
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 850;
}

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

.package-grid article {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
  padding: 10px 8px;
}

.package-grid article.recommended {
  border-color: rgba(12, 124, 114, 0.45);
  box-shadow: inset 0 3px 0 var(--accent);
}

.package-grid strong {
  font-size: 13px;
}

.package-grid span {
  color: #a84921;
  font-size: 17px;
  font-weight: 900;
}

.package-grid em,
.recharge-note {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.4;
}

.package-pay {
  min-height: 34px;
  margin-top: 4px;
  border: 0;
  border-radius: 6px;
  background: #1677ff;
  color: white;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

.package-pay:hover {
  background: #0f63db;
}

.package-pay:disabled {
  cursor: wait;
  opacity: 0.58;
}

.redeem-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
}

.redeem-form input {
  min-width: 0;
  text-transform: uppercase;
}

.redeem-form .primary {
  width: auto;
  min-height: 42px;
  padding: 0 14px;
}

.logout-button {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fffefa;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.ai-settings {
  margin: 4px 0 14px;
  border: 1px solid rgba(102, 112, 133, 0.2);
  border-radius: 8px;
  background: rgba(255, 254, 250, 0.62);
}

.ai-settings summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 0 12px;
  cursor: pointer;
  list-style: none;
}

.ai-settings summary::-webkit-details-marker {
  display: none;
}

.ai-settings summary span {
  color: #48505d;
  font-size: 13px;
  font-weight: 800;
}

.ai-settings summary em,
.ai-actions span {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.ai-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 10px;
  padding: 0 12px 2px;
}

.ai-key-field {
  grid-column: 1 / -1;
}

.ai-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px 12px;
}

.ai-actions .secondary {
  min-height: 36px;
}

.admin-panel {
  margin-bottom: 18px;
}

#adminPanel.hidden {
  display: none;
}

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

.section-head.compact {
  margin-bottom: 10px;
}

.section-head h3 {
  margin: 0;
  font-size: 15px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.admin-stat {
  display: grid;
  gap: 6px;
  min-height: 70px;
  border: 1px solid rgba(12, 124, 114, 0.18);
  border-radius: 8px;
  background: rgba(12, 124, 114, 0.05);
  padding: 12px;
}

.admin-stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.admin-stat strong {
  color: var(--ink);
  font-size: 20px;
  line-height: 1.1;
}

.admin-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 12px;
}

.admin-block {
  min-width: 0;
  border: 1px solid rgba(102, 112, 133, 0.18);
  border-radius: 8px;
  background: rgba(255, 254, 250, 0.7);
  padding: 14px;
}

.admin-block.wide {
  grid-column: 1 / -1;
}

.admin-block input,
.admin-block select {
  min-height: 36px;
  width: auto;
  min-width: 160px;
  font-size: 13px;
}

.admin-credit-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-credit-form input {
  flex: 1 1 140px;
}

.admin-credit-form .primary {
  width: auto;
  flex: 0 0 96px;
  min-height: 36px;
}

.admin-message {
  min-height: 20px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(102, 112, 133, 0.16);
  border-radius: 8px;
}

.admin-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid rgba(102, 112, 133, 0.16);
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
  line-height: 1.45;
}

.admin-table th {
  color: #48505d;
  background: rgba(236, 230, 218, 0.55);
  font-weight: 820;
}

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

.admin-table small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  word-break: break-all;
}

.admin-link {
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  padding: 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 820;
  text-align: left;
}

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

h2 {
  font-size: 18px;
}

.section-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.transcript-tools {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.transcript-tools select {
  min-height: 34px;
  width: auto;
  min-width: 112px;
  padding: 0 9px;
  font-size: 13px;
  font-weight: 750;
}

.transcript-tools em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.transcript-search {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.transcript-search input {
  min-height: 34px;
  width: 146px;
  padding: 0 64px 0 9px;
  font-size: 13px;
}

.transcript-search span {
  position: absolute;
  right: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
}

.meter {
  height: 13px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6ded1;
}

#meterFill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--warm));
  transition: width 0.28s ease;
}

.stage-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 16px;
}

.stage-row strong {
  font-size: 15px;
}

.stage-row span {
  color: var(--accent-dark);
  font-weight: 850;
}

.source-row,
.diagnostic-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: -4px 0 16px;
  padding: 10px 12px;
  border: 1px solid rgba(12, 124, 114, 0.18);
  border-radius: 7px;
  background: rgba(12, 124, 114, 0.06);
}

.diagnostic-row {
  margin-top: -8px;
  background: rgba(213, 107, 53, 0.06);
}

.source-row span,
.diagnostic-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.source-row strong,
.diagnostic-row strong {
  color: var(--accent-dark);
  font-size: 13px;
  text-align: right;
}

.helper-panel {
  margin-top: 18px;
  padding: 18px;
}

.helper-panel p {
  color: #313947;
  font-size: 14px;
  line-height: 1.7;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.log {
  min-height: 126px;
  max-height: 220px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border-radius: 7px;
  border: 1px solid #292f38;
  background: #111722;
  color: #d7e7de;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.transcript-panel {
  margin-top: 18px;
}

.history-panel {
  margin-top: 18px;
}

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

.qa-panel .section-head {
  margin-bottom: 0;
}

.question-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.question-form .primary {
  width: auto;
  min-width: 92px;
}

.question-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.qa-history {
  display: grid;
  gap: 10px;
}

.qa-entry {
  border-left: 3px solid var(--accent);
  background: rgba(12, 124, 114, 0.045);
  padding: 11px 12px;
}

.qa-entry strong {
  font-size: 14px;
}

.qa-entry p {
  margin-top: 7px;
  color: #313947;
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-line;
}

.qa-reference {
  display: block;
  max-width: 100%;
  overflow: hidden;
  margin-top: 8px;
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.history-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  width: 100%;
  min-height: 58px;
  border: 1px solid rgba(102, 112, 133, 0.18);
  border-radius: 8px;
  background: rgba(255, 254, 250, 0.78);
  padding: 10px 12px;
  text-align: left;
}

.history-item:hover {
  border-color: rgba(12, 124, 114, 0.35);
  background: rgba(12, 124, 114, 0.05);
}

.history-item span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.history-item strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item b {
  color: var(--accent-dark);
  font-size: 13px;
  text-align: right;
}

.history-item em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.analysis-grid {
  display: grid;
  grid-template-columns: 1fr 0.65fr;
  gap: 12px;
}

.analysis-card {
  border: 1px solid rgba(102, 112, 133, 0.18);
  border-radius: 8px;
  background: rgba(255, 254, 250, 0.72);
  padding: 14px;
}

.analysis-card.wide {
  grid-column: span 1;
}

.analysis-card h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.template-output {
  background: rgba(12, 124, 114, 0.05);
}

.template-sections {
  display: grid;
  gap: 10px;
}

.template-sections article {
  display: grid;
  gap: 7px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(102, 112, 133, 0.14);
}

.template-sections article:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.template-sections strong {
  color: var(--accent-dark);
  font-size: 13px;
}

.template-sections p {
  white-space: pre-line;
}

.analysis-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.analysis-card li,
.analysis-card p {
  color: #313947;
  font-size: 14px;
  line-height: 1.65;
}

.segment mark {
  border-radius: 2px;
  background: #f7d97a;
  color: inherit;
  padding: 0 1px;
}

.keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.keywords span {
  border: 1px solid rgba(12, 124, 114, 0.2);
  border-radius: 999px;
  background: rgba(12, 124, 114, 0.08);
  color: var(--accent-dark);
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 760;
}

.chapters {
  display: grid;
  gap: 12px;
  max-height: 320px;
  overflow: auto;
}

.chapter-badge {
  display: inline-flex;
  width: fit-content;
  margin: -2px 0 10px;
  border: 1px solid rgba(213, 107, 53, 0.22);
  border-radius: 999px;
  background: rgba(213, 107, 53, 0.08);
  color: #9b431d;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
}

.chapters article {
  display: grid;
  gap: 4px;
  padding-bottom: 11px;
  border-bottom: 1px solid rgba(102, 112, 133, 0.16);
}

.chapters time {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 820;
}

.chapters strong {
  font-size: 14px;
}

.transcript {
  display: grid;
  gap: 10px;
  max-height: 52vh;
  overflow: auto;
  padding-right: 4px;
}

.transcript-chapter {
  display: grid;
  gap: 2px;
  padding: 0 0 12px;
  border-bottom: 1px solid rgba(102, 112, 133, 0.2);
}

.transcript-chapter header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(12, 124, 114, 0.18);
  background: var(--panel);
}

.transcript-chapter header time {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 850;
}

.transcript-chapter header strong {
  color: var(--ink);
  font-size: 15px;
}

.segment {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(102, 112, 133, 0.18);
  border-radius: 8px;
  scroll-margin-block: 120px;
  transition: background-color 180ms ease, box-shadow 180ms ease;
}

.segment.reference-highlight {
  background: rgba(49, 91, 214, 0.09);
  box-shadow: 0 0 0 6px rgba(49, 91, 214, 0.09);
}

.segment time {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
}

.segment p {
  font-size: 15px;
  line-height: 1.65;
  white-space: pre-line;
}

.empty {
  min-height: 140px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.empty.small {
  min-height: 72px;
}

.helper-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  color: var(--muted);
  flex-wrap: wrap;
}

.helper-download {
  display: inline-flex;
  text-decoration: none;
}

.turnstile-slot {
  min-height: 65px;
  margin: 4px 0 10px;
}

.payment-orders {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.payment-order-list {
  display: grid;
  gap: 8px;
}

.payment-order {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
}

.payment-order div {
  display: grid;
  gap: 2px;
}

.payment-order div:last-child {
  text-align: right;
}

.payment-order span,
.payment-order em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 4px 36px;
  color: var(--muted);
  font-size: 13px;
}

.site-footer nav {
  display: flex;
  gap: 16px;
}

.site-footer a {
  color: inherit;
}

@media (max-width: 820px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
  }

  .account-button {
    flex: 1;
  }

  .admin-button {
    flex: 0 0 auto;
  }

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

  .admin-stats,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-block input,
  .admin-block select {
    width: 100%;
  }

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

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

  h1 {
    font-size: 28px;
  }

  .segment {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .transcript-chapter header {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .history-item {
    grid-template-columns: 1fr;
  }

  .history-item b {
    text-align: left;
  }

  .transcript-panel .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .transcript-tools {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }

  .transcript-search {
    grid-column: 1 / -1;
    width: 100%;
  }

  .transcript-search input {
    width: 100%;
  }

  .transcript-tools em {
    align-self: center;
  }

  .site-footer {
    flex-direction: column;
  }
}

/* Collapsible workspace chrome */
.studio-sidebar,
.shell,
.site-footer {
  transition: width 180ms ease, margin-left 180ms ease, padding 180ms ease;
}

.sidebar-collapse-button {
  position: absolute;
  z-index: 4;
  top: 38px;
  right: -15px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  padding: 0;
  border: 1px solid #d9dee8;
  border-radius: 50%;
  color: #647087;
  background: #fff;
  box-shadow: 0 5px 16px rgba(28, 39, 65, 0.1);
}

.sidebar-collapse-button:hover {
  color: #315bd6;
  border-color: #aebff2;
}

.sidebar-collapse-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  transition: transform 180ms ease;
}

body.sidebar-collapsed .studio-sidebar {
  width: 84px;
  padding: 28px 18px 24px;
}

body.sidebar-collapsed .shell,
body.sidebar-collapsed .site-footer {
  margin-left: 84px;
}

body.sidebar-collapsed .sidebar-collapse-button svg {
  transform: rotate(180deg);
}

body.sidebar-collapsed .studio-brand {
  justify-content: center;
}

body.sidebar-collapsed .studio-brand > span:last-child,
body.sidebar-collapsed .studio-new-button span,
body.sidebar-collapsed .studio-nav button span,
body.sidebar-collapsed .sidebar-history {
  display: none;
}

body.sidebar-collapsed .studio-brand-mark {
  width: 44px;
  height: 44px;
}

body.sidebar-collapsed .studio-new-button {
  width: 48px;
  min-height: 48px;
  margin: 30px auto 22px;
  padding: 0;
  justify-content: center;
}

body.sidebar-collapsed .studio-nav button {
  width: 48px;
  padding: 0;
  justify-content: center;
}

@media (max-width: 820px) {
  .sidebar-collapse-button {
    display: none;
  }

  body.sidebar-collapsed .studio-sidebar {
    width: auto;
    padding: 14px 16px;
  }

  body.sidebar-collapsed .shell,
  body.sidebar-collapsed .site-footer {
    margin-left: 0;
  }

  body.sidebar-collapsed .studio-brand > span:last-child,
  body.sidebar-collapsed .studio-new-button span,
  body.sidebar-collapsed .studio-nav button span {
    display: initial;
  }

  body.sidebar-collapsed .sidebar-history {
    display: block;
  }

  body.sidebar-collapsed .studio-new-button,
  body.sidebar-collapsed .studio-nav button {
    width: auto;
  }
}

/* Conversion and first-use clarity */
.hero-outcomes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.hero-outcomes li {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #d9e1f7;
  border-radius: 999px;
  color: #47536a;
  background: #f7f9ff;
  font-size: 12px;
  font-weight: 700;
}

.hero-outcomes li::before {
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: #315bd6;
  content: "";
}

.field > label {
  color: #394255;
  font-size: 13px;
  font-weight: 750;
}

.url-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.paste-url-button {
  min-width: 68px;
  min-height: 44px;
  border: 1px solid #cfd8ef;
  border-radius: 8px;
  color: #315bd6;
  background: #f5f7ff;
  cursor: pointer;
  font-weight: 750;
}

.paste-url-button:hover {
  border-color: #315bd6;
  background: #edf2ff;
}

.paste-url-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

#urlInputHint {
  color: #7a8496;
  font-size: 12px;
  line-height: 1.4;
}

.workflow-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 14px 0 28px;
  overflow: hidden;
  border: 1px solid #dfe3ea;
  border-radius: 14px;
  background: #dfe3ea;
}

.workflow-strip article {
  display: flex;
  min-width: 0;
  gap: 12px;
  padding: 16px 18px;
  background: #fff;
}

.workflow-strip article > span {
  color: #315bd6;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.workflow-strip strong {
  display: block;
  margin-bottom: 2px;
  color: #20242d;
  font-size: 14px;
}

.workflow-strip p {
  color: #687182;
  font-size: 12px;
  line-height: 1.5;
}

.result-tab-bar {
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.result-tab-bar::-webkit-scrollbar {
  display: none;
}

.result-tab-bar button {
  scroll-snap-align: start;
}

@media (max-width: 820px) {
  .studio-sidebar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
  }

  .studio-new-button {
    width: auto;
    min-height: 44px;
    margin: 0;
    padding: 0 14px;
  }

  .studio-nav {
    grid-column: 1 / -1;
  }

  .hero-outcomes {
    margin-top: 14px;
  }

  .workflow-strip {
    grid-template-columns: 1fr;
    margin-top: 12px;
  }

  .workflow-strip article {
    padding: 13px 15px;
  }

  .result-tab-bar {
    overscroll-behavior-inline: contain;
  }
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid rgba(49, 91, 214, 0.42);
  outline-offset: 3px;
}

/* Public links are reading views, not a second copy of the customer dashboard. */
body.shared-view .studio-sidebar,
body.shared-view #jobForm,
body.shared-view .workbench-tools,
body.shared-view .workflow-strip,
body.shared-view [data-result-tab="chat"],
body.shared-view [data-result-tab="creator"] {
  display: none;
}

body.shared-view .topbar-actions > :not(.shared-home-link) {
  display: none;
}

body.shared-view .shared-home-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 0 17px;
  border: 1px solid #d8deea;
  border-radius: 8px;
  color: #29344a;
  background: #fff;
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
}

body.shared-view .shared-home-link:hover {
  border-color: #315bd6;
  color: #315bd6;
}

body.shared-view .topbar {
  align-items: flex-end;
  padding-top: 30px;
}

body.shared-view .topbar h1 {
  max-width: 920px;
  font-size: clamp(34px, 4.8vw, 64px);
  text-wrap: balance;
}

body.shared-view .topbar p {
  max-width: 780px;
}

body.shared-view .shell,
body.shared-view .site-footer {
  width: min(1480px, calc(100% - 48px));
  margin-right: auto;
  margin-left: auto;
}

body.shared-view .workspace {
  grid-template-columns: 1fr;
}

body.shared-view .content-workbench {
  grid-template-columns: 240px minmax(0, 1fr);
}

body.shared-view .task-status {
  min-height: auto;
}

@media (max-width: 1040px) {
  body.shared-view .content-workbench {
    grid-template-columns: 1fr;
  }
}

/* Knowledge library, learning views and visual assets. */
.sidebar-library {
  display: grid;
  gap: 10px;
  min-height: 0;
  padding-top: 14px;
  border-top: 1px solid #e4e7ed;
}

body.sidebar-collapsed .sidebar-library {
  display: none;
}

.library-summary {
  margin: 0;
  color: #747e91;
  font-size: 12px;
  line-height: 1.55;
}

.sidebar-library input,
.sidebar-library select,
.library-item input {
  width: 100%;
  min-width: 0;
  border: 1px solid #dfe3ea;
  border-radius: 9px;
  color: #283246;
  background: #fff;
  font: inherit;
}

.sidebar-library > input,
.sidebar-library > select {
  min-height: 36px;
  padding: 0 10px;
  font-size: 13px;
}

.library-list {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 2px;
}

.library-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 6px;
  padding: 9px;
  border: 1px solid #e2e6ed;
  border-radius: 10px;
  background: #fff;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.library-item:hover {
  border-color: #c7d3f7;
  box-shadow: 0 7px 18px rgba(35, 60, 120, 0.08);
  transform: translateY(-1px);
}

.library-open,
.library-favorite {
  border: 0;
  color: #273248;
  background: transparent;
  cursor: pointer;
}

.library-open {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 0;
  text-align: left;
}

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

.library-open strong {
  font-size: 13px;
}

.library-open span {
  color: #768095;
  font-size: 11px;
}

.library-open em {
  color: #9aa2b1;
  font-size: 10px;
  font-style: normal;
}

.library-favorite {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 20px;
}

.library-favorite:hover,
.library-favorite:focus-visible {
  background: #fff8e8;
}

.library-favorite.active {
  color: #e5a11a;
}

.library-item input {
  grid-column: 1 / -1;
  height: 30px;
  padding: 0 8px;
  font-size: 12px;
}

.result-tab-bar {
  overflow-x: auto;
  scrollbar-width: thin;
}

.result-tab-bar button {
  flex: 0 0 auto;
}

.study-workspace {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
}

.study-guide-card,
.mind-map-card {
  min-width: 0;
  padding: 22px;
  border: 1px solid #e0e4eb;
  border-radius: 14px;
  background: #fff;
}

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

.study-card-head h3 {
  margin: 0;
  font-size: 19px;
  white-space: nowrap;
}

.study-card-head > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.study-create-button {
  min-height: 34px;
  padding: 0 11px;
  font-size: 12px;
}

#studyGuide {
  display: grid;
  gap: 18px;
}

#studyGuide section {
  display: grid;
  gap: 8px;
}

#studyGuide ul,
#studyGuide ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  color: #4f5b70;
  line-height: 1.6;
}

#studyGuide ol li {
  padding-left: 4px;
}

#studyGuide time {
  margin-right: 8px;
  color: #315bd6;
  font-weight: 750;
}

.mind-map,
.mind-map-canvas {
  display: grid;
  gap: 0;
  position: relative;
}

.mind-map-root {
  position: relative;
  justify-self: center;
  max-width: 82%;
  padding: 13px 18px;
  border-radius: 12px;
  color: #fff;
  background: #294ba8;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 10px 24px rgba(49, 91, 214, 0.18);
}

.mind-map-root::after {
  position: absolute;
  bottom: -33px;
  left: 50%;
  width: 2px;
  height: 33px;
  background: #c9d5f5;
  content: "";
  transform: translateX(-50%);
}

.mind-map-branches {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  align-items: start;
  padding-top: 32px;
}

.mind-map-branches::before {
  position: absolute;
  top: 22px;
  right: 7%;
  left: 7%;
  height: 2px;
  background: #c9d5f5;
  content: "";
}

.mind-map-branches article {
  position: relative;
  display: flex;
  gap: 10px;
  min-height: 92px;
  padding: 13px;
  border: 1px solid #dfe5f4;
  border-radius: 11px;
  background: #f7f9fe;
}

.mind-map-branches article::before {
  position: absolute;
  top: -11px;
  left: 50%;
  width: 2px;
  height: 10px;
  background: #c9d5f5;
  content: "";
  transform: translateX(-50%);
}

.mind-map-branches article > span {
  flex: 0 0 auto;
  color: #315bd6;
  font-size: 12px;
  font-weight: 800;
}

.mind-map-branches article > div {
  min-width: 0;
}

.mind-map-branches p {
  margin-top: 5px;
  color: #68748a;
  font-size: 12px;
  line-height: 1.5;
}

.mind-map-branches ul {
  margin: 10px 0 0;
  padding: 10px 0 0 18px;
  border-top: 1px solid #e4e9f5;
  color: #5f6c83;
  font-size: 12px;
  line-height: 1.55;
}

.mind-map-branches li + li {
  margin-top: 6px;
}

.study-generated {
  display: grid;
  gap: 12px;
}

.study-generated h4 {
  margin: 4px 0 0;
  color: #182235;
  font-size: 15px;
}

.study-generated p,
.study-generated ul {
  margin: 0;
  color: #59677d;
  line-height: 1.7;
}

.study-loading {
  display: grid;
  min-height: 260px;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: #5f6c83;
  text-align: center;
}

.study-loading span {
  width: 28px;
  height: 28px;
  border: 3px solid #dfe5f4;
  border-top-color: #315bd6;
  border-radius: 50%;
  animation: study-spin 0.8s linear infinite;
}

.study-loading p {
  margin: 0;
  color: #8a94a6;
  font-size: 12px;
}

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

@media (max-width: 1450px) {
  .study-workspace {
    grid-template-columns: 1fr;
  }

  .mind-map-card {
    order: -1;
  }
}

.chapter-actions {
  display: grid;
  gap: 7px;
  justify-items: end;
}

.chapter-refine {
  border: 0;
  color: #315bd6;
  background: transparent;
  font-weight: 750;
  cursor: pointer;
}

.creator-quality-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.creator-quality-controls label {
  display: grid;
  gap: 6px;
  color: #5d687c;
  font-size: 12px;
  font-weight: 700;
}

.creator-quality-controls select {
  min-height: 40px;
  border: 1px solid #dce1e9;
  border-radius: 9px;
  padding: 0 10px;
  color: #293348;
  background: #fff;
}

.creator-quality-controls .quality-check {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
}

.quality-check input {
  width: 16px;
  height: 16px;
}

.creation-quality {
  margin: 10px 0 14px;
  padding: 10px 12px;
  border-radius: 9px;
  color: #667188;
  background: #f5f7fa;
  font-size: 12px;
}

.creation-quality[data-state="ok"] {
  color: #126b53;
  background: #edf8f3;
}

.creation-quality[data-state="warning"] {
  color: #965a10;
  background: #fff6e8;
}

.visual-status {
  margin: -6px 0 18px;
  color: #6d7789;
  font-size: 13px;
}

.visual-panel .section-head {
  align-items: flex-start;
}

.visual-panel .section-head > div {
  max-width: 620px;
}

#extractFramesButton {
  width: auto;
  flex: 0 0 auto;
  padding-inline: 18px;
  white-space: nowrap;
}

#extractFramesButton.hidden {
  display: none;
}

.visual-frame-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.visual-frame-grid article {
  overflow: hidden;
  border: 1px solid #dfe3ea;
  border-radius: 12px;
  background: #fff;
}

.visual-frame-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #151b26;
}

.visual-frame-grid article div {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
}

.visual-frame-grid time {
  color: #48546a;
  font-weight: 750;
}

.visual-frame-grid a {
  color: #315bd6;
  font-weight: 750;
  text-decoration: none;
}

.demo-frame-card {
  box-shadow: 0 8px 24px rgba(38, 53, 92, 0.07);
}

.demo-frame-preview {
  position: relative;
  display: grid;
  aspect-ratio: 16 / 9;
  align-content: center;
  overflow: hidden;
  padding: 18px;
  color: #fff;
  background: linear-gradient(135deg, #18264f, #315bd6);
}

.demo-frame-preview::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 24px 24px;
  content: "";
  mask-image: linear-gradient(to bottom, #000, transparent);
}

.demo-frame-kicker {
  position: absolute;
  z-index: 1;
  top: 12px;
  left: 14px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.demo-frame-window {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 7px 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  background: rgba(8, 17, 45, 0.6);
  box-shadow: 0 16px 32px rgba(4, 10, 29, 0.25);
}

.demo-frame-window > span {
  grid-column: 1 / -1;
  display: flex;
  gap: 4px;
}

.demo-frame-window > span i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
}

.demo-frame-window b {
  color: #b9cbff;
  font-size: 11px;
}

.demo-frame-window p {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
}

.demo-frame-chapters {
  background: linear-gradient(135deg, #26335a, #4266c7);
}

.demo-frame-nodes {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 8px;
}

.demo-frame-nodes strong {
  padding: 8px 18px;
  border-radius: 8px;
  color: #27438f;
  background: #fff;
  font-size: 12px;
}

.demo-frame-nodes > span {
  width: 1px;
  height: 12px;
  background: rgba(255, 255, 255, 0.55);
}

.demo-frame-nodes > div {
  position: relative;
  display: flex;
  gap: 8px;
}

.demo-frame-nodes > div::before {
  position: absolute;
  top: -7px;
  right: 14%;
  left: 14%;
  height: 1px;
  background: rgba(255, 255, 255, 0.55);
  content: "";
}

.demo-frame-nodes i {
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 10px;
  font-style: normal;
}

.demo-frame-outputs {
  background: linear-gradient(135deg, #17254b, #314a94);
}

.demo-frame-output-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.demo-frame-output-grid i {
  padding: 10px 8px;
  border: 1px solid rgba(255, 255, 255, 0.19);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.11);
  font-size: 10px;
  font-style: normal;
  text-align: center;
}

.visual-frame-grid .demo-frame-caption {
  align-items: center;
  gap: 12px;
  padding: 12px 14px 14px;
}

.demo-frame-caption > span {
  display: grid;
  min-width: 0;
}

.demo-frame-caption time {
  color: #315bd6;
  font-size: 11px;
}

.demo-frame-caption strong {
  color: #252d3b;
  font-size: 13px;
}

.demo-frame-caption small {
  overflow: hidden;
  color: #758095;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.demo-frame-caption em {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 999px;
  color: #66738d;
  background: #f0f3f9;
  font-size: 10px;
  font-style: normal;
}

@media (max-width: 820px) {
  .study-workspace,
  .visual-frame-grid,
  .creator-quality-controls {
    grid-template-columns: 1fr;
  }

  .study-card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .mind-map-root {
    justify-self: stretch;
    max-width: none;
    text-align: left;
  }

  .mind-map-root::after {
    bottom: -24px;
    left: 18px;
    height: 24px;
    transform: none;
  }

  .mind-map-branches {
    grid-template-columns: 1fr;
    gap: 10px;
    padding-top: 18px;
    padding-left: 24px;
  }

  .mind-map-branches::before {
    top: 0;
    right: auto;
    bottom: 24px;
    left: 17px;
    width: 2px;
    height: auto;
  }

  .mind-map-branches article::before {
    top: 24px;
    left: -8px;
    width: 8px;
    height: 2px;
    transform: none;
  }
}

@media (max-width: 820px) {
  body.shared-view .shell,
  body.shared-view .site-footer {
    width: calc(100% - 28px);
  }
}

/* Delivery and creator polish: compact navigation, dependable export actions. */
.result-tab-bar {
  scrollbar-width: none;
}

.result-tab-bar::-webkit-scrollbar {
  display: none;
}

.creator-output-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.creator-output-actions button {
  min-height: 38px;
}

.creator-result-heading {
  display: grid;
  gap: 2px;
}

.creator-result-heading span {
  color: #7a8393;
  font-size: 12px;
}

.creator-export-menu {
  position: relative;
}

.creator-export-menu summary {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  list-style: none;
}

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

.creator-export-options {
  position: absolute;
  z-index: 20;
  top: calc(100% + 7px);
  right: 0;
  display: grid;
  width: 142px;
  gap: 4px;
  padding: 6px;
  border: 1px solid #dfe3ea;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(31, 38, 51, 0.14);
}

.creator-export-options button {
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  color: #273047;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.creator-export-options button:hover {
  color: #244cc9;
  background: #f1f4ff;
}

.generated-copy[contenteditable="true"] {
  margin: 12px -10px -10px;
  padding: 10px;
  border-radius: 9px;
  outline: 2px solid rgba(49, 91, 214, 0.22);
  background: #fff;
}

@media (max-width: 820px) {
  .creator-output-actions {
    width: 100%;
  }

  .creator-output-actions > button,
  .creator-export-menu summary {
    min-height: 44px;
  }
}

@media (max-width: 1440px) {
  .content-workbench .creator-layout {
    grid-template-columns: 1fr;
  }
}

/* Dedicated content library: navigation stays compact, saved work gets the canvas. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

body.library-view .shell > :not(.topbar):not(.library-page) {
  display: none !important;
}

body.library-view .topbar {
  justify-content: flex-end;
  min-height: 44px;
  margin-bottom: 14px;
}

body.library-view .topbar > div:first-child {
  display: none;
}

.library-page {
  display: grid;
  gap: 22px;
  width: min(1180px, 100%);
  margin: 0 auto;
}

.library-page.hidden {
  display: none !important;
}

.library-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding: 8px 2px 2px;
}

.library-page-head > div {
  min-width: 0;
  flex: 1 1 auto;
}

.library-page-head h1 {
  margin: 5px 0 8px;
  color: #20242d;
  font-size: clamp(30px, 3.4vw, 46px);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.library-page-head p {
  max-width: 720px;
  margin: 0;
  color: #626c7e;
  font-size: 15px;
  line-height: 1.7;
}

.library-page-head .primary {
  width: auto;
  flex: 0 0 auto;
  min-height: 46px;
  padding-inline: 22px;
  white-space: nowrap;
}

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

.library-overview article {
  display: grid;
  gap: 8px;
  min-height: 106px;
  padding: 20px 22px;
  border: 1px solid #dfe4ec;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(31, 38, 51, 0.04);
}

.library-overview span {
  color: #697386;
  font-size: 13px;
}

.library-overview strong {
  color: #20242d;
  font-size: 30px;
  line-height: 1;
}

.library-surface {
  padding: 22px;
  border: 1px solid #dfe4ec;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(31, 38, 51, 0.05);
}

.library-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 180px 160px;
  gap: 10px;
  margin-bottom: 22px;
}

.library-search-field {
  position: relative;
}

.library-search-field svg {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: #7b8495;
  stroke-width: 1.8;
  transform: translateY(-50%);
  pointer-events: none;
}

.library-toolbar input,
.library-toolbar select,
.library-card-actions input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d9dee7;
  border-radius: 10px;
  color: #273042;
  background: #fff;
  font: inherit;
}

.library-toolbar input {
  padding: 0 14px 0 43px;
}

.library-toolbar select {
  padding: 0 12px;
}

.library-toolbar input:focus,
.library-toolbar select:focus,
.library-card-actions input:focus {
  border-color: #315bd6;
  outline: 3px solid rgba(49, 91, 214, 0.12);
}

.library-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 0 2px;
}

.library-result-head strong {
  color: #252b35;
  font-size: 17px;
}

.library-result-head span {
  color: #737d8f;
  font-size: 13px;
}

.library-page .library-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-height: none;
  overflow: visible;
  padding: 0;
}

.library-page .library-item {
  display: flex;
  min-height: 260px;
  flex-direction: column;
  gap: 13px;
  padding: 20px;
  border: 1px solid #dfe4ec;
  border-radius: 14px;
  background: #fbfcfe;
}

.library-page .library-item:hover {
  border-color: #bdcaf0;
  box-shadow: 0 12px 28px rgba(35, 60, 120, 0.09);
  transform: translateY(-2px);
}

.library-card-head,
.library-card-actions,
.library-card-meta,
.library-tag-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.library-card-head {
  justify-content: space-between;
}

.library-source {
  overflow: hidden;
  color: #315bd6;
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-page .library-favorite {
  width: auto;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #e1e5ec;
  border-radius: 9px;
  color: #616b7c;
  background: #fff;
  font-size: 12px;
  white-space: nowrap;
}

.library-page .library-favorite.active {
  border-color: #f0d38e;
  color: #9a6500;
  background: #fff8e8;
}

.library-page .library-item h3 {
  display: -webkit-box;
  overflow: hidden;
  min-height: 48px;
  margin: 0;
  color: #222833;
  font-size: 18px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.library-page .library-item > p {
  display: -webkit-box;
  overflow: hidden;
  min-height: 50px;
  margin: 0;
  color: #697386;
  font-size: 13px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.library-card-meta {
  flex-wrap: wrap;
  color: #7a8495;
  font-size: 12px;
}

.library-card-meta span:not(:last-child)::after {
  margin-left: 8px;
  color: #c0c6d0;
  content: "·";
}

.library-tag-row {
  min-height: 28px;
  flex-wrap: wrap;
}

.library-tag-row button {
  min-height: 27px;
  border: 0;
  border-radius: 7px;
  padding: 0 9px;
  color: #315bd6;
  background: #edf2ff;
  font-size: 12px;
  cursor: pointer;
}

.library-card-actions {
  margin-top: auto;
}

.library-card-actions input {
  min-width: 0;
  padding: 0 11px;
  font-size: 13px;
}

.library-card-actions .secondary {
  flex: 0 0 auto;
  min-height: 44px;
  white-space: nowrap;
}

.library-empty {
  grid-column: 1 / -1;
  display: grid;
  justify-items: center;
  gap: 10px;
  min-height: 300px;
  align-content: center;
  border: 1px dashed #ccd3de;
  border-radius: 14px;
  background: #fafbfd;
}

.library-empty strong {
  color: #2a303b;
  font-size: 19px;
}

.library-empty p {
  max-width: 480px;
  margin: 0;
  color: #717b8e;
  line-height: 1.65;
  text-align: center;
}

.library-empty .primary {
  min-height: 42px;
  margin-top: 4px;
  padding-inline: 20px;
}

.library-page > .library-summary {
  margin: -6px 2px 0;
  color: #7a8495;
  font-size: 12px;
  line-height: 1.6;
}

@media (max-width: 900px) {
  .library-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .library-search-field {
    grid-column: 1 / -1;
  }

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

@media (max-width: 560px) {
  body.library-view .topbar {
    min-height: 38px;
  }

  .library-page {
    gap: 16px;
  }

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

  .library-page-head h1 {
    font-size: 32px;
  }

  .library-overview {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .library-overview article {
    min-height: 88px;
    padding: 14px 12px;
  }

  .library-overview strong {
    font-size: 24px;
  }

  .library-surface {
    padding: 14px;
  }

  .library-toolbar {
    grid-template-columns: 1fr;
  }

  .library-search-field {
    grid-column: auto;
  }

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

/* Collapsed navigation rail: compact, aligned and self-explanatory. */
@media (min-width: 821px) {
  body.sidebar-collapsed .studio-sidebar {
    width: 72px;
    padding: 22px 14px 24px;
    overflow: visible;
  }

  body.sidebar-collapsed .shell,
  body.sidebar-collapsed .site-footer {
    margin-left: 72px;
  }

  body.sidebar-collapsed .studio-brand {
    width: 44px;
    height: 44px;
    margin: 0 auto;
    justify-content: center;
  }

  body.sidebar-collapsed .studio-brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }

  body.sidebar-collapsed .sidebar-collapse-button {
    top: 74px;
    right: -15px;
    width: 28px;
    height: 28px;
    background: #fff;
  }

  body.sidebar-collapsed .studio-new-button {
    width: 44px;
    min-height: 44px;
    height: 44px;
    margin: 26px auto 14px;
    padding: 0;
    border-radius: 11px;
  }

  body.sidebar-collapsed .studio-nav {
    align-items: center;
    gap: 8px;
  }

  body.sidebar-collapsed .studio-nav button {
    width: 44px;
    min-height: 44px;
    height: 44px;
    margin: 0 auto;
    padding: 0;
    border-radius: 11px;
    justify-content: center;
  }

  body.sidebar-collapsed .studio-new-button svg,
  body.sidebar-collapsed .studio-nav .nav-icon {
    width: 20px;
    height: 20px;
    flex-basis: 20px;
  }

  body.sidebar-collapsed [data-tooltip] {
    position: relative;
  }

  body.sidebar-collapsed [data-tooltip]::after {
    position: absolute;
    z-index: 120;
    top: 50%;
    left: calc(100% + 12px);
    padding: 7px 10px;
    border: 1px solid #3b414d;
    border-radius: 8px;
    background: #252a34;
    box-shadow: 0 8px 24px rgb(20 25 35 / 18%);
    color: #fff;
    content: attr(data-tooltip);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translate(6px, -50%);
    visibility: hidden;
    transition:
      opacity 150ms ease,
      transform 150ms ease,
      visibility 150ms ease;
  }

  body.sidebar-collapsed [data-tooltip]:hover::after,
  body.sidebar-collapsed [data-tooltip]:focus-visible::after,
  body.sidebar-collapsed [data-tooltip]:focus-within::after {
    opacity: 1;
    transform: translate(0, -50%);
    visibility: visible;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.sidebar-collapsed [data-tooltip]::after {
    transition: none;
  }
}

/* Local upload: replace the browser-native file row with a deliberate picker. */
.file-drop-zone {
  position: relative;
  display: grid;
  min-height: 126px;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 22px;
  border: 1.5px dashed #bfc8dc;
  border-radius: 13px;
  color: #465168;
  background: #fafbfe;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.file-drop-zone:hover,
.file-drop-zone:focus-visible,
.file-drop-zone.dragging {
  border-color: #315bd6;
  background: #f3f6ff;
  box-shadow: 0 0 0 4px rgba(49, 91, 214, 0.08);
}

.file-drop-zone.dragging {
  border-style: solid;
}

.file-drop-zone.invalid {
  border-color: #c85a5a;
  background: #fff8f7;
}

.file-drop-zone.has-file {
  min-height: 82px;
  border-color: #a9b9e7;
  background: #f6f8ff;
}

.file-input-native {
  display: none;
}

.file-drop-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 12px;
  color: #315bd6;
  background: #e9efff;
}

.file-drop-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.file-drop-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.file-drop-copy strong {
  color: #283246;
  font-size: 15px;
}

.file-drop-copy strong span {
  margin-left: 4px;
  color: #315bd6;
}

.file-drop-copy small {
  color: #778196;
  font-size: 12px;
  line-height: 1.55;
}

.selected-file {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) max-content;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 11px 12px;
  border: 1px solid #dce3f3;
  border-radius: 11px;
  background: #fff;
}

.selected-file.hidden {
  display: none;
}

.selected-file-kind {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 9px;
  color: #315bd6;
  background: #edf2ff;
  font-size: 10px;
  font-weight: 800;
}

.selected-file-copy {
  display: grid;
  min-width: 0;
}

.selected-file-copy strong {
  overflow: hidden;
  color: #293348;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-file-copy small {
  color: #7a8497;
  font-size: 11px;
}

.selected-file button {
  min-height: 36px;
  border: 0;
  padding: 0 10px;
  border-radius: 8px;
  color: #667188;
  background: #f3f5f8;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.selected-file button:hover {
  color: #b44646;
  background: #fff0ef;
}

.upload-status {
  min-height: 20px;
  margin: 7px 2px 0;
  color: #7b8597;
  font-size: 11px;
}

@media (max-width: 560px) {
  .file-drop-zone {
    min-height: 116px;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 12px;
    padding: 17px;
  }

  .file-drop-icon {
    width: 40px;
    height: 40px;
  }

  .selected-file {
    grid-template-columns: 38px minmax(0, 1fr) max-content;
  }

  .selected-file-kind {
    width: 38px;
    height: 38px;
  }
}

/* Keep every result view aligned to the same editorial content edge. */
.study-panel,
.visual-panel {
  padding: 24px;
}

.study-panel > .section-head,
.visual-panel > .section-head {
  margin-bottom: 22px;
}

@media (max-width: 560px) {
  .study-panel,
  .visual-panel {
    padding: 18px;
  }
}

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

/* Focused first-screen state and consistent line icons */
.content-workbench.workspace-empty {
  display: none;
}

.secondary.hidden,
.studio-result-action.hidden,
.admin-button.hidden {
  display: none;
}

.topbar h1 > span {
  position: relative;
  display: inline-block;
  margin-left: 0.16em;
  color: #315bd6;
  white-space: nowrap;
}

.topbar h1 > span::after {
  position: absolute;
  z-index: -1;
  right: -0.04em;
  bottom: 0.08em;
  left: -0.04em;
  height: 0.22em;
  border-radius: 999px;
  background: #dfe7ff;
  content: "";
}

/* A concrete product preview: show the transformation before asking users to commit. */
.video-preview-placeholder {
  align-items: center;
  justify-items: center;
  place-content: normal;
}

.video-preview-placeholder .preview-demo-visual {
  width: min(620px, calc(100vw - 80px));
}

.video-preview,
.video-preview iframe {
  min-height: 320px;
  height: 320px;
}

.preview-demo-window {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: rgba(11, 16, 27, 0.76);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(14px);
}

.preview-demo-window-head {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.video-preview-placeholder .preview-demo-window-head .preview-demo-label {
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  color: #dce4ff;
  background: transparent;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.preview-demo-window-head > em {
  color: rgba(255, 255, 255, 0.48);
  font-size: 11px;
  font-style: normal;
}

.preview-demo-transcript {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px 12px;
  padding: 14px 15px 13px;
  text-align: left;
}

.video-preview-placeholder .preview-demo-time {
  display: block;
  width: auto;
  height: auto;
  margin: 1px 0 0;
  color: #8ca5ff;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}

.preview-demo-transcript p {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  line-height: 1.45;
}

.preview-demo-output {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 15px;
  background: rgba(255, 255, 255, 0.065);
  text-align: left;
}

.video-preview-placeholder .preview-demo-output > span {
  display: block;
  width: auto;
  height: auto;
  margin: 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 10px;
  white-space: nowrap;
}

.preview-demo-output > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.preview-demo-output b {
  padding: 4px 7px;
  border-radius: 999px;
  color: #dce4ff;
  background: rgba(103, 132, 255, 0.16);
  font-size: 10px;
  font-weight: 650;
}

.preview-demo-action {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 13px;
}

.preview-demo-visual .preview-demo-action button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 5px;
  margin: 0;
  padding: 0 15px;
  border-radius: 9px;
  box-shadow: 0 8px 22px rgba(49, 91, 214, 0.28);
}

.preview-demo-action button svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.video-preview-placeholder .preview-demo-action > span {
  display: block;
  width: auto;
  height: auto;
  margin: 0;
  color: rgba(255, 255, 255, 0.48);
  font-size: 11px;
}

@media (max-width: 620px) {
  .video-preview-placeholder .preview-demo-visual {
    width: calc(100vw - 64px);
  }

  .video-preview,
  .video-preview iframe {
    min-height: 340px;
    height: 340px;
  }

  .preview-demo-output {
    align-items: flex-start;
    flex-direction: column;
  }

  .preview-demo-output > div {
    justify-content: flex-start;
  }

  .preview-demo-transcript p {
    font-size: 11px;
  }
}

.task-technical-details {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e5e7eb;
}

#jobId:empty,
.task-status.hidden {
  display: none;
}

.task-technical-details.hidden {
  display: none;
}

.task-technical-details summary {
  color: #b42318;
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
}

.task-technical-details .diagnostic-row {
  margin-top: 10px;
}

.task-technical-details .processing-log {
  margin-top: 10px;
  padding-top: 0;
  border-top: 0;
}

.content-workbench:not(.workspace-empty) {
  animation: workbench-reveal 240ms ease-out both;
}

.studio-new-button svg,
.nav-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.studio-new-button svg {
  width: 21px;
  height: 21px;
  stroke-width: 2;
}

.studio-nav button .nav-icon {
  color: #7c8799;
}

.studio-nav button:hover .nav-icon,
.studio-nav button.active .nav-icon {
  color: #315bd6;
}

@keyframes workbench-reveal {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .content-workbench:not(.workspace-empty) {
    animation: none;
  }
}

/* Readable editorial workspace — final visual pass */
:root {
  --product-blue: #315bd6;
  --product-blue-soft: #edf2ff;
  --product-border: #dfe3ea;
  --product-text: #20242d;
  --product-muted: #687182;
}

html {
  background: #f5f6f8;
}

body {
  min-width: 320px;
  color: var(--product-text);
  background: #f5f6f8;
  font-size: 15px;
  line-height: 1.6;
}

.studio-sidebar {
  width: 264px;
  padding: 28px 20px 24px;
  color: var(--product-text);
  border-right: 1px solid var(--product-border);
  background: #fff;
}

.studio-brand {
  gap: 13px;
}

.studio-brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  color: #fff;
  background: var(--product-blue);
  font-size: 22px;
}

.studio-brand strong {
  font-size: 18px;
  line-height: 1.25;
}

.studio-brand em {
  margin-top: 4px;
  color: #727b8c;
  font-size: 12px;
  line-height: 1.4;
}

.studio-new-button {
  min-height: 52px;
  margin: 30px 0 22px;
  border-radius: 12px;
  font-size: 16px;
}

.studio-nav {
  gap: 6px;
}

.studio-nav button {
  min-height: 48px;
  gap: 12px;
  padding: 0 14px;
  border-radius: 10px;
  color: #596273;
  font-size: 15px;
}

.studio-nav button span {
  width: 20px;
  color: #7c8799;
  font-size: 18px;
}

.sidebar-history {
  margin-top: 26px;
  padding-top: 20px;
}

.sidebar-history-head {
  margin-bottom: 10px;
  padding: 0 9px;
}

.sidebar-history-head strong {
  font-size: 14px;
}

.sidebar-history-head span {
  color: #727b8c;
  font-size: 12px;
}

.sidebar-history .history-list {
  max-height: calc(100vh - 430px);
  gap: 4px;
}

.sidebar-history .history-item {
  padding: 11px 9px;
}

.sidebar-history .history-item strong {
  color: #414958;
  font-size: 14px;
  line-height: 1.45;
}

.sidebar-history .history-item em {
  margin-top: 5px;
  color: #727b8c;
  font-size: 12px;
}

.sidebar-history .empty {
  padding: 16px 10px;
  color: #727b8c;
  font-size: 13px;
  line-height: 1.6;
}

.shell {
  width: auto;
  max-width: none;
  margin-left: 264px;
  padding: 32px clamp(24px, 2.5vw, 48px) 64px;
}

.topbar {
  margin-bottom: 24px;
}

.topbar h1 {
  margin-top: 5px;
  font-size: clamp(32px, 2.5vw, 42px);
  line-height: 1.16;
}

.eyebrow {
  color: #667085;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.topbar p {
  margin-top: 9px;
  color: #596273;
  font-size: 15px;
}

.topbar-actions button {
  min-height: 42px;
  padding-inline: 16px;
  font-size: 14px;
}

.workspace {
  grid-template-columns: minmax(360px, 0.82fr) minmax(540px, 1.18fr);
  gap: 20px;
}

.panel {
  border: 1px solid var(--product-border);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(31, 38, 51, 0.055);
}

.input-panel,
.progress-panel,
.transcript-panel,
.admin-panel,
.creator-panel {
  padding: 24px;
}

.field > span,
.supported-inputs > span,
.service-plan span,
.source-row span,
.diagnostic-row span {
  font-size: 13px;
}

.field input,
.field select,
.field textarea,
.transcript-search input,
.tab,
.primary,
.secondary,
.account-button {
  font-size: 14px;
}

.content-workbench {
  grid-template-columns: 252px minmax(0, 1fr) 252px;
  gap: 18px;
  margin-top: 28px;
}

.workbench-media,
.workbench-tools {
  gap: 14px;
}

.workbench-source-cover,
.workbench-outline,
.workbench-tools > section {
  border-radius: 13px;
}

.workbench-source-cover {
  min-height: 188px;
  padding: 20px;
}

.workbench-source-cover > span {
  font-size: 12px;
}

.workbench-source-cover strong {
  margin-top: 44px;
  font-size: 18px;
  line-height: 1.5;
}

.workbench-source-cover em {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  line-height: 1.55;
}

.workbench-aside-head {
  min-height: 54px;
  padding: 14px 16px;
}

.workbench-aside-head strong {
  font-size: 15px;
}

.workbench-aside-head span {
  color: #697386;
  font-size: 12px;
}

#workbenchOutline button {
  grid-template-columns: 50px minmax(0, 1fr);
  min-height: 58px;
  gap: 10px;
  padding: 13px 14px;
}

#workbenchOutline time {
  font-size: 12px;
}

#workbenchOutline span {
  font-size: 14px;
  line-height: 1.5;
}

.result-tab-bar {
  gap: 4px;
  min-height: 66px;
  margin-bottom: 14px;
  padding: 8px;
  border-radius: 13px;
}

.result-tab-bar > div {
  min-width: 150px;
}

.result-tab-bar > div .eyebrow {
  font-size: 11px;
}

.result-tab-bar > div strong {
  font-size: 19px;
}

.result-tab-bar button {
  min-height: 44px;
  padding: 0 13px;
  border-radius: 9px;
  font-size: 14px;
  white-space: nowrap;
}

.result-panel {
  min-height: 380px;
}

.section-head h2 {
  font-size: 22px;
}

.section-head > span,
.result-head-actions span {
  color: #687182;
  font-size: 13px;
}

.analysis-grid > .empty {
  min-height: 220px;
  font-size: 16px;
  line-height: 1.7;
}

.workbench-tool {
  width: calc(100% - 20px);
  min-height: 72px;
  margin: 10px 10px 0;
  gap: 6px;
  padding: 13px;
  border-radius: 9px;
}

.workbench-tool strong {
  font-size: 15px;
}

.workbench-tool span {
  color: #687182;
  font-size: 13px;
  line-height: 1.45;
}

.workbench-tool.active {
  border-color: #9db2f3;
  background: #f2f5ff;
  box-shadow: inset 3px 0 0 #315bd6;
}

.workbench-tool.active strong {
  color: #2349b9;
}

.generated-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.generated-type {
  padding: 5px 9px;
  border: 1px solid #d9e2ff;
  border-radius: 999px;
  color: #315bd6;
  background: #f5f7ff;
  font-size: 12px;
  font-weight: 700;
}

.workbench-export {
  width: calc(100% - 20px);
  min-height: 48px;
  margin: 10px;
  font-size: 14px;
}

.site-footer {
  width: auto;
  margin-left: 264px;
  padding: 26px clamp(24px, 2.5vw, 48px);
  color: #687182;
  font-size: 13px;
}

@media (max-width: 1440px) {
  .content-workbench {
    grid-template-columns: 224px minmax(0, 1fr);
  }

  .workbench-tools {
    position: static;
    grid-column: 1 / -1;
    grid-template-columns: 1fr 0.72fr;
  }
}

@media (max-width: 1040px) {
  .studio-sidebar {
    width: 228px;
  }

  .shell,
  .site-footer {
    margin-left: 228px;
  }

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

  .workbench-media {
    position: static;
    grid-template-columns: 0.8fr 1.2fr;
  }
}

@media (max-width: 820px) {
  body {
    font-size: 16px;
  }

  .studio-sidebar {
    position: relative;
    width: auto;
    padding: 14px 16px;
  }

  .shell,
  .site-footer {
    margin-left: 0;
  }

  .studio-nav button {
    min-height: 44px;
    font-size: 14px;
  }

  .studio-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
  }

  .studio-nav button {
    min-width: 0;
    gap: 7px;
    justify-content: center;
    padding-inline: 6px;
    white-space: nowrap;
  }

  .topbar h1 {
    font-size: 30px;
  }

  .content-workbench,
  .workbench-media,
  .workbench-tools {
    grid-template-columns: 1fr;
  }

  .result-tab-bar button,
  .field input,
  .field select,
  .field textarea {
    font-size: 16px;
  }
}

/* Final responsive overrides: keep the mobile header balanced and secondary copy readable. */
#urlInputHint,
.workflow-strip p {
  font-size: 13px;
}

.workflow-strip strong {
  font-size: 15px;
}

@media (max-width: 820px) {
  .studio-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
  }

  .studio-brand {
    width: auto !important;
    justify-self: start !important;
  }

  .studio-new-button {
    width: auto !important;
    min-height: 44px;
    margin: 0 !important;
    padding: 0 14px;
    justify-self: end !important;
  }

  .studio-nav {
    width: 100% !important;
    grid-column: 1 / -1 !important;
  }
}

/* Keep the customer navigation complete and scrollbar-free on phones. */
@media (max-width: 820px) {
  body .studio-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
  }

  body .studio-nav button {
    width: auto;
    min-width: 0;
    gap: 7px;
    justify-content: center;
    padding-inline: 5px;
    white-space: nowrap;
  }
}

/* A compact editorial flow avoids empty grid rows when chapters are much longer. */
.analysis-grid {
  display: block;
  column-count: 2;
  column-gap: 14px;
  align-items: start;
}

.analysis-grid .analysis-card {
  width: 100%;
  margin: 0 0 14px;
  break-inside: avoid;
}

.creation-history {
  display: flex;
  gap: 7px;
  margin: 0 0 12px;
  padding-bottom: 10px;
  overflow-x: auto;
  border-bottom: 1px solid #e5e8ee;
  scrollbar-width: thin;
}

.creation-history button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid #d9dee8;
  border-radius: 8px;
  color: #596273;
  background: #f8f9fb;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

.creation-history button:hover,
.creation-history button.active {
  border-color: #315bd6;
  color: #315bd6;
  background: #edf2ff;
}

@media (max-width: 720px) {
  .analysis-grid {
    column-count: 1;
  }
}

/* Restrained product theme */
:root {
  --product-blue: #3156d3;
  --product-blue-soft: #eef2ff;
  --product-border: #e3e6eb;
  --product-text: #20242d;
  --product-muted: #697180;
  --product-surface: #ffffff;
}

body {
  color: var(--product-text);
  background: #f5f6f8;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.studio-sidebar {
  color: var(--product-text);
  border-right: 1px solid var(--product-border);
  background: #fff;
  box-shadow: none;
}

.studio-brand {
  color: var(--product-text);
}

.studio-brand-mark {
  border-radius: 10px;
  color: #fff;
  background: var(--product-blue);
  box-shadow: none;
  font-family: inherit;
  transform: none;
}

.studio-brand strong {
  font-family: inherit;
  letter-spacing: 0;
}

.studio-brand em {
  color: #8a919e;
  font-size: 10px;
  letter-spacing: 0;
}

.studio-new-button {
  color: #fff;
  background: var(--product-blue);
  box-shadow: none;
}

.studio-new-button:hover {
  background: #2848b7;
}

.studio-nav button {
  color: #5f6673;
}

.studio-nav button span {
  color: #8d96a5;
}

.studio-nav button:hover,
.studio-nav button.active {
  color: var(--product-blue);
  background: var(--product-blue-soft);
}

.studio-nav button.active span {
  color: var(--product-blue);
}

.studio-sidebar-card {
  border-color: var(--product-border);
  background: #f7f8fa;
}

.studio-sidebar-card span {
  color: var(--product-blue);
  font-size: 10px;
  letter-spacing: 0;
}

.studio-sidebar-card strong {
  font-family: inherit;
  font-size: 17px;
}

.studio-sidebar-card p,
.studio-sidebar-foot {
  color: #7a8290;
}

.live-dot {
  background: #27a66c;
  box-shadow: none;
}

.topbar h1 {
  margin-top: 7px;
  font-family: inherit;
  font-size: clamp(28px, 2.7vw, 38px);
  letter-spacing: -0.02em;
}

.eyebrow {
  color: #7b8391;
  font-size: 11px;
  letter-spacing: 0;
}

.topbar p {
  color: var(--product-muted);
}

.panel {
  border-color: var(--product-border);
  border-radius: 12px;
  background: var(--product-surface);
  box-shadow: 0 4px 18px rgba(25, 32, 46, 0.045);
  backdrop-filter: none;
}

.tabs {
  border: 1px solid var(--product-border);
  background: #f4f5f7;
}

.tab.active {
  background: #252a34;
}

.primary {
  background: var(--product-blue);
}

.primary:hover {
  background: #2848b7;
}

.account-button {
  border-color: #252a34;
  background: #252a34;
}

.studio-result-action {
  border-color: var(--product-border);
  background: #fff;
}

.supported-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: -3px 0 16px;
  color: var(--product-muted);
  font-size: 11px;
}

.supported-inputs span {
  margin-right: 3px;
  font-weight: 700;
}

.supported-inputs em {
  padding: 4px 7px;
  border-radius: 5px;
  color: #606875;
  background: #f1f3f6;
  font-style: normal;
}

.service-plan {
  border-color: #dce2f5;
  background: #f7f9ff;
}

.video-preview {
  background: #171b24;
}

.video-preview-placeholder span {
  color: #fff;
}

.result-tab-bar {
  border-color: var(--product-border);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 4px 16px rgba(25, 32, 46, 0.06);
}

.result-tab-bar > div strong,
.analysis-card h3,
.chapter-copy h3,
.creator-hero h2,
.custom-prompt-result article h3 {
  font-family: inherit;
}

.result-tab-bar button:hover,
.result-tab-bar button.active {
  background: var(--product-blue);
}

.analysis-card,
.custom-prompt-form,
.custom-prompt-output {
  border-color: var(--product-border);
  background: #fafbfc;
}

.chapter-index {
  border-color: #fff;
  color: #fff;
  background: var(--product-blue);
}

.chapter-jump {
  border-color: var(--product-border);
  color: var(--product-blue);
}

.creator-badge {
  color: #4f5d75;
  background: #eef1f5;
}

.prompt-presets button:hover,
.prompt-presets button.active {
  border-color: var(--product-blue);
  background: var(--product-blue);
}

.custom-prompt-output {
  background: #fff;
}

.creator-loading span {
  border-top-color: var(--product-blue);
}

.delivery-panel {
  padding: 24px;
}

.delivery-head {
  align-items: flex-start;
}

.delivery-head h2 {
  margin-top: 5px;
}

.delivery-head p {
  margin-top: 7px;
  color: var(--product-muted);
  font-size: 13px;
}

#deliveryStatus[data-state="error"] {
  color: #b42318;
  font-weight: 700;
}

.delivery-layout {
  display: grid;
  grid-template-columns: minmax(430px, 1fr) 320px;
  gap: 18px;
  margin-top: 22px;
}

.delivery-files {
  display: grid;
  gap: 10px;
}

.delivery-file {
  display: grid;
  min-height: 78px;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 13px 15px;
  border: 1px solid var(--product-border);
  border-radius: 10px;
  color: var(--product-text);
  background: #fff;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
}

.delivery-file:hover {
  border-color: #b8c4ed;
  background: #fbfcff;
}

.delivery-file.disabled {
  cursor: default;
  opacity: 0.48;
  pointer-events: none;
}

.file-kind {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 9px;
  color: var(--product-blue);
  background: var(--product-blue-soft);
  font-size: 11px;
  font-weight: 800;
}

.delivery-file strong,
.delivery-file em {
  display: block;
}

.delivery-file strong {
  font-size: 14px;
}

.delivery-file em {
  margin-top: 5px;
  color: var(--product-muted);
  font-size: 11px;
  font-style: normal;
}

.delivery-file b {
  color: var(--product-blue);
  font-size: 12px;
}

.delivery-summary {
  padding: 18px;
  border: 1px solid var(--product-border);
  border-radius: 10px;
  background: #f8f9fb;
}

.delivery-summary h3 {
  margin: 0 0 12px;
}

.delivery-summary dl {
  margin: 0;
}

.delivery-summary dl div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 0;
  border-bottom: 1px solid #e8eaee;
  font-size: 12px;
}

.delivery-summary dt {
  color: var(--product-muted);
}

.delivery-summary dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}

.delivery-extension {
  margin-top: 18px;
  padding: 14px;
  border-radius: 9px;
  background: #fff;
}

.delivery-extension p {
  margin: 7px 0 11px;
  color: var(--product-muted);
  font-size: 11px;
  line-height: 1.6;
}

.delivery-extension a {
  color: var(--product-blue);
  font-size: 12px;
  font-weight: 700;
}

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

@media (max-width: 820px) {
  .studio-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--product-border);
  }

  .delivery-panel {
    padding: 18px;
  }

  .delivery-layout {
    display: block;
  }

  .delivery-summary {
    margin-top: 14px;
  }

  .delivery-file {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    padding: 11px;
  }

  .file-kind {
    width: 42px;
    height: 42px;
  }
}

/* Paid studio redesign */
:root {
  --studio-ink: #151923;
  --studio-paper: #f6f3ec;
  --studio-coral: #ff6b4a;
  --studio-lime: #d9ff72;
  --studio-blue: #6c8cff;
}

body {
  background:
    radial-gradient(circle at 92% 7%, rgba(108, 140, 255, 0.13), transparent 28%),
    linear-gradient(120deg, #f7f3eb 0%, #f3f4f0 55%, #edf2ee 100%);
}

.studio-sidebar {
  position: fixed;
  z-index: 40;
  inset: 0 auto 0 0;
  display: flex;
  width: 236px;
  padding: 24px 18px 18px;
  overflow-y: auto;
  flex-direction: column;
  color: #fff;
  background:
    radial-gradient(circle at 20% 5%, rgba(217, 255, 114, 0.16), transparent 28%),
    var(--studio-ink);
  box-shadow: 12px 0 40px rgba(21, 25, 35, 0.1);
}

.studio-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.studio-brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  color: var(--studio-ink);
  background: var(--studio-lime);
  font: 900 20px/1 "Songti SC", serif;
  transform: rotate(-4deg);
}

.studio-brand strong,
.studio-brand em {
  display: block;
}

.studio-brand strong {
  font: 800 17px/1.1 "Songti SC", "STSong", serif;
  letter-spacing: 0.08em;
}

.studio-brand em {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 8px;
  font-style: normal;
  letter-spacing: 0.15em;
}

.studio-new-button {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 30px 0 20px;
  border: 0;
  border-radius: 12px;
  color: var(--studio-ink);
  background: var(--studio-lime);
  cursor: pointer;
  font-weight: 900;
  box-shadow: 0 8px 24px rgba(217, 255, 114, 0.14);
}

.studio-new-button span {
  font-size: 21px;
  line-height: 1;
}

.studio-nav {
  display: grid;
  gap: 5px;
}

.studio-nav button {
  display: flex;
  min-height: 43px;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.62);
  background: transparent;
  cursor: pointer;
  padding: 0 13px;
  text-align: left;
  font-weight: 700;
}

.studio-nav button span {
  width: 20px;
  color: rgba(217, 255, 114, 0.7);
  font-size: 17px;
}

.studio-nav button:hover,
.studio-nav button.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
}

.studio-sidebar-card {
  margin-top: auto;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(108, 140, 255, 0.24), rgba(255, 107, 74, 0.1));
}

.studio-sidebar-card span {
  color: var(--studio-lime);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.studio-sidebar-card strong {
  display: block;
  margin-top: 10px;
  font: 800 19px/1.35 "Songti SC", "STSong", serif;
}

.studio-sidebar-card p {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  line-height: 1.65;
}

.studio-sidebar-foot {
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.42);
  font-size: 11px;
  text-align: center;
}

.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--studio-lime);
  box-shadow: 0 0 0 4px rgba(217, 255, 114, 0.1);
}

.shell {
  width: auto;
  max-width: 1540px;
  margin: 0 0 0 236px;
  padding: 28px clamp(20px, 3vw, 48px) 60px;
}

.topbar {
  position: relative;
  align-items: center;
  margin-bottom: 28px;
}

.topbar h1 {
  max-width: 760px;
  margin-top: 4px;
  font: 900 clamp(30px, 3vw, 48px)/1.05 "Songti SC", "STSong", serif;
  letter-spacing: -0.04em;
}

.eyebrow {
  color: #777d8d;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.topbar p {
  max-width: 700px;
  font-size: 14px;
}

.studio-result-action {
  min-height: 38px;
  border-color: rgba(21, 25, 35, 0.12);
  background: rgba(255, 255, 255, 0.62);
}

.workspace {
  grid-template-columns: minmax(330px, 0.72fr) minmax(520px, 1.28fr);
  gap: 20px;
}

.panel {
  border-color: rgba(21, 25, 35, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 60px rgba(28, 32, 40, 0.08);
  backdrop-filter: blur(16px);
}

.input-panel,
.progress-panel,
.transcript-panel,
.history-panel,
.admin-panel,
.creator-panel {
  padding: 22px;
}

.tabs {
  border: 0;
  border-radius: 12px;
  background: #eeebe3;
}

.tab {
  border-radius: 9px;
}

.field input,
.field select,
.field textarea,
.transcript-search input {
  border-color: rgba(21, 25, 35, 0.13);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
}

.primary {
  border-radius: 10px;
  background: var(--studio-ink);
}

.primary:hover {
  background: #2a3140;
}

.service-plan {
  border-radius: 13px;
  border-color: rgba(108, 140, 255, 0.25);
  background: linear-gradient(120deg, rgba(108, 140, 255, 0.08), rgba(217, 255, 114, 0.12));
}

.video-preview {
  position: relative;
  min-height: 285px;
  margin-bottom: 18px;
  overflow: hidden;
  border-radius: 14px;
  background:
    radial-gradient(circle at 75% 15%, rgba(108, 140, 255, 0.34), transparent 30%),
    radial-gradient(circle at 25% 80%, rgba(255, 107, 74, 0.24), transparent 34%),
    #111722;
}

.video-preview iframe {
  display: block;
  width: 100%;
  height: 285px;
  border: 0;
}

.video-preview-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  color: white;
  text-align: center;
}

.video-preview-placeholder span {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  margin: 0 auto 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  color: var(--studio-lime);
  background: rgba(255, 255, 255, 0.08);
}

.video-preview-placeholder strong,
.video-preview-placeholder em {
  display: block;
}

.video-preview-placeholder em {
  margin-top: 7px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 11px;
  font-style: normal;
}

.progress-panel .log {
  max-height: 150px;
  border-radius: 12px;
  opacity: 0.88;
}

.helper-panel {
  margin-top: 20px;
  border-style: dashed;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.46);
}

.history-panel {
  margin-top: 20px;
}

.result-tab-bar {
  position: sticky;
  z-index: 20;
  top: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 22px 0 14px;
  padding: 8px;
  overflow-x: auto;
  border: 1px solid rgba(21, 25, 35, 0.1);
  border-radius: 15px;
  background: rgba(250, 249, 245, 0.9);
  box-shadow: 0 12px 30px rgba(28, 32, 40, 0.09);
  backdrop-filter: blur(18px);
}

.result-tab-bar > div {
  display: grid;
  min-width: 160px;
  margin-right: auto;
  padding: 2px 10px;
}

.result-tab-bar > div strong {
  margin-top: 2px;
  font: 800 18px/1.1 "Songti SC", "STSong", serif;
}

.result-tab-bar button {
  flex: 0 0 auto;
  min-height: 39px;
  padding: 0 15px;
  border: 0;
  border-radius: 9px;
  color: #666c79;
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}

.result-tab-bar button:hover,
.result-tab-bar button.active {
  color: white;
  background: var(--studio-ink);
}

.result-panel {
  min-height: 330px;
}

.result-panel.hidden,
.video-preview iframe.hidden,
.video-preview-placeholder.hidden {
  display: none;
}

.analysis-grid {
  gap: 14px;
}

.analysis-card {
  border-color: rgba(21, 25, 35, 0.09);
  border-radius: 14px;
  background: rgba(250, 249, 245, 0.72);
}

.analysis-card h3 {
  font-family: "Songti SC", "STSong", serif;
  font-size: 19px;
}

.chapter-studio {
  position: relative;
  display: grid;
  padding: 12px 0 4px 22px;
}

.chapter-studio::before {
  position: absolute;
  top: 24px;
  bottom: 28px;
  left: 45px;
  width: 1px;
  background: rgba(21, 25, 35, 0.12);
  content: "";
}

.chapter-studio-item {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 18px 4px;
  border-bottom: 1px solid rgba(21, 25, 35, 0.09);
}

.chapter-index {
  z-index: 1;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 5px solid #faf9f5;
  border-radius: 50%;
  color: var(--studio-ink);
  background: var(--studio-lime);
  font-weight: 900;
}

.chapter-copy time {
  color: #727987;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.chapter-copy h3 {
  margin: 5px 0 6px;
  font: 800 20px/1.3 "Songti SC", "STSong", serif;
}

.chapter-copy p {
  color: var(--muted);
  line-height: 1.65;
}

.chapter-jump {
  padding: 9px 12px;
  border: 1px solid rgba(21, 25, 35, 0.12);
  border-radius: 9px;
  color: var(--studio-ink);
  background: white;
  cursor: pointer;
  font-weight: 800;
}

.creator-panel {
  overflow: hidden;
}

.creator-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 4px 24px;
}

.creator-hero h2 {
  margin: 6px 0 8px;
  font: 900 clamp(26px, 3vw, 40px)/1.1 "Songti SC", "STSong", serif;
}

.creator-hero p {
  max-width: 650px;
  color: var(--muted);
  line-height: 1.7;
}

.creator-badge {
  padding: 8px 11px;
  border-radius: 999px;
  color: #58621e;
  background: rgba(217, 255, 114, 0.58);
  font-size: 11px;
  font-weight: 900;
}

.creator-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(400px, 1.15fr);
  gap: 16px;
}

.custom-prompt-form,
.custom-prompt-output {
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(21, 25, 35, 0.1);
  border-radius: 15px;
  background: rgba(250, 249, 245, 0.75);
}

.prompt-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 18px;
}

.prompt-presets button,
.saved-prompts button {
  padding: 8px 11px;
  border: 1px solid rgba(21, 25, 35, 0.12);
  border-radius: 999px;
  color: #555c69;
  background: white;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.prompt-presets button:hover,
.prompt-presets button.active {
  border-color: var(--studio-ink);
  color: white;
  background: var(--studio-ink);
}

.creator-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.creator-actions button {
  min-height: 42px;
}

.saved-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 14px;
  color: var(--muted);
  font-size: 11px;
}

.custom-prompt-output {
  min-height: 430px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.82)),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(21, 25, 35, 0.06) 31px 32px);
}

.custom-prompt-result article h3 {
  margin: 8px 0 18px;
  font: 800 25px/1.3 "Songti SC", "STSong", serif;
}

.generated-copy {
  color: #303642;
  font-size: 15px;
  line-height: 2;
}

.generated-references {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 22px;
}

.generated-references strong {
  width: 100%;
  font-size: 12px;
}

.generated-references button {
  border: 0;
  border-radius: 7px;
  color: #40537c;
  background: rgba(108, 140, 255, 0.12);
  cursor: pointer;
  padding: 7px 9px;
  text-align: left;
}

.creator-loading {
  display: grid;
  min-height: 290px;
  place-items: center;
  align-content: center;
  gap: 14px;
  color: var(--muted);
}

.creator-loading span {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(21, 25, 35, 0.12);
  border-top-color: var(--studio-coral);
  border-radius: 50%;
  animation: studio-spin 0.8s linear infinite;
}

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

.site-footer {
  width: auto;
  margin-left: 236px;
  padding-right: clamp(20px, 3vw, 48px);
  padding-left: clamp(20px, 3vw, 48px);
}

@media (max-width: 1100px) {
  .workspace,
  .creator-layout {
    grid-template-columns: 1fr;
  }

  .video-preview,
  .video-preview iframe {
    height: 360px;
  }
}

@media (max-width: 820px) {
  .studio-sidebar {
    position: relative;
    width: auto;
    min-height: auto;
    padding: 14px 16px;
  }

  .studio-brand-mark {
    width: 36px;
    height: 36px;
  }

  .studio-new-button {
    position: absolute;
    top: 10px;
    right: 14px;
    min-height: 40px;
    margin: 0;
    padding: 0 14px;
  }

  .studio-nav {
    display: flex;
    gap: 4px;
    margin-top: 14px;
    overflow-x: auto;
  }

  .studio-nav button {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0 10px;
    font-size: 12px;
  }

  .studio-nav button span,
  .studio-sidebar-card,
  .studio-sidebar-foot {
    display: none;
  }

  .shell {
    margin: 0;
    padding: 20px 14px 40px;
  }

  .topbar-actions {
    overflow-x: auto;
  }

  .studio-result-action {
    flex: 0 0 auto;
  }

  .video-preview,
  .video-preview iframe {
    min-height: 220px;
    height: 220px;
  }

  .result-tab-bar {
    top: 5px;
    align-items: stretch;
  }

  .result-tab-bar > div {
    display: none;
  }

  .result-tab-bar button {
    min-height: 36px;
    padding: 0 12px;
    font-size: 12px;
  }

  .chapter-studio {
    padding-left: 0;
  }

  .chapter-studio::before {
    left: 23px;
  }

  .chapter-studio-item {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 12px;
  }

  .chapter-jump {
    grid-column: 2;
    justify-self: start;
  }

  .creator-hero {
    display: block;
  }

  .creator-badge {
    display: inline-block;
    margin-top: 12px;
  }

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

  .site-footer {
    margin-left: 0;
  }
}

/* Restrained product theme — final cascade */
body {
  color: var(--product-text);
  background: #f5f6f8;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.studio-sidebar {
  color: var(--product-text);
  border-right: 1px solid var(--product-border);
  background: #fff;
  box-shadow: none;
}

.studio-brand {
  color: var(--product-text);
}

.studio-brand-mark {
  border-radius: 10px;
  color: #fff;
  background: var(--product-blue);
  box-shadow: none;
  font-family: inherit;
  transform: none;
}

.studio-brand strong {
  font-family: inherit;
  letter-spacing: 0;
}

.studio-brand em {
  color: #8a919e;
  font-size: 10px;
  letter-spacing: 0;
}

.studio-new-button {
  color: #fff;
  background: var(--product-blue);
  box-shadow: none;
}

.studio-nav button {
  color: #5f6673;
}

.studio-nav button span {
  color: #8d96a5;
}

.studio-nav button:hover,
.studio-nav button.active {
  color: var(--product-blue);
  background: var(--product-blue-soft);
}

.studio-sidebar-card {
  border-color: var(--product-border);
  background: #f7f8fa;
}

.studio-sidebar-card span {
  color: var(--product-blue);
  letter-spacing: 0;
}

.studio-sidebar-card strong {
  font-family: inherit;
  font-size: 17px;
}

.studio-sidebar-card p,
.studio-sidebar-foot {
  color: #7a8290;
}

.live-dot {
  background: #27a66c;
  box-shadow: none;
}

.topbar h1 {
  font-family: inherit;
  font-size: clamp(28px, 2.7vw, 38px);
  letter-spacing: -0.02em;
}

.eyebrow {
  color: #7b8391;
  font-size: 11px;
  letter-spacing: 0;
}

.panel {
  border-color: var(--product-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 18px rgba(25, 32, 46, 0.045);
  backdrop-filter: none;
}

.tabs {
  border: 1px solid var(--product-border);
  background: #f4f5f7;
}

.tab.active,
.account-button {
  background: #252a34;
}

.primary,
.studio-new-button {
  background: var(--product-blue);
}

.primary:hover,
.studio-new-button:hover {
  background: #2848b7;
}

.studio-result-action {
  border-color: var(--product-border);
  background: #fff;
}

.service-plan {
  border-color: #dce2f5;
  background: #f7f9ff;
}

.video-preview {
  background: #171b24;
}

.result-tab-bar {
  border-color: var(--product-border);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 4px 16px rgba(25, 32, 46, 0.06);
}

.result-tab-bar > div strong,
.analysis-card h3,
.chapter-copy h3,
.creator-hero h2,
.custom-prompt-result article h3 {
  font-family: inherit;
}

.result-tab-bar button:hover,
.result-tab-bar button.active {
  background: var(--product-blue);
}

.analysis-card,
.custom-prompt-form {
  border-color: var(--product-border);
  background: #fafbfc;
}

.custom-prompt-output {
  border-color: var(--product-border);
  background: #fff;
}

.chapter-index {
  border-color: #fff;
  color: #fff;
  background: var(--product-blue);
}

.chapter-jump {
  border-color: var(--product-border);
  color: var(--product-blue);
}

.creator-badge {
  color: #4f5d75;
  background: #eef1f5;
}

.prompt-presets button:hover,
.prompt-presets button.active {
  border-color: var(--product-blue);
  background: var(--product-blue);
}

@media (max-width: 820px) {
  .studio-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--product-border);
  }
}

/* Three-pane result workbench and interactive preview */
.video-preview-placeholder .preview-demo-visual {
  width: 420px;
  max-width: calc(100% - 36px);
  color: #fff;
  text-align: left;
}

.video-preview-placeholder .preview-demo-label {
  display: inline-flex;
  width: auto;
  height: auto;
  margin: 0 0 12px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  color: #c9d5ff;
  background: rgba(255, 255, 255, 0.06);
  font-size: 10px;
  font-weight: 700;
}

.preview-demo-visual > strong {
  display: block;
  max-width: 320px;
  font-size: 23px;
  line-height: 1.3;
}

.preview-demo-lines {
  display: grid;
  gap: 7px;
  margin: 17px 0 14px;
}

.preview-demo-lines i {
  width: var(--demo-width);
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.preview-demo-lines i:first-child {
  background: rgba(128, 155, 255, 0.75);
}

.preview-demo-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.preview-demo-tags em {
  padding: 5px 7px;
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.08);
  font-size: 10px;
  font-style: normal;
}

.preview-demo-visual button {
  min-height: 40px;
  margin-top: 18px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--product-blue);
  cursor: pointer;
  font-weight: 700;
  transition: background 180ms ease, transform 180ms ease;
}

.preview-demo-visual button:hover {
  background: #4267e4;
  transform: translateY(-1px);
}

.content-workbench {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 210px;
  gap: 12px;
  align-items: start;
  margin-top: 22px;
}

.workbench-main {
  min-width: 0;
}

.content-workbench .result-tab-bar {
  top: 10px;
  margin: 0 0 12px;
}

.workbench-media,
.workbench-tools {
  position: sticky;
  top: 10px;
  display: grid;
  gap: 12px;
}

.workbench-source-cover,
.workbench-outline,
.workbench-tools > section {
  overflow: hidden;
  border: 1px solid var(--product-border);
  border-radius: 11px;
  background: #fff;
}

.workbench-source-cover {
  min-height: 150px;
  padding: 16px;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(49, 86, 211, 0.92), rgba(33, 43, 74, 0.96)),
    #25355e;
}

.workbench-source-cover > span {
  font-size: 10px;
  opacity: 0.72;
}

.workbench-source-cover strong,
.workbench-source-cover em {
  display: block;
}

.workbench-source-cover strong {
  margin-top: 35px;
  font-size: 15px;
  line-height: 1.5;
}

.workbench-source-cover em {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 10px;
  font-style: normal;
  line-height: 1.5;
}

.workbench-aside-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--product-border);
}

.workbench-aside-head strong {
  font-size: 13px;
}

.workbench-aside-head span {
  color: var(--product-muted);
  font-size: 9px;
}

#workbenchOutline {
  display: grid;
  max-height: 360px;
  overflow-y: auto;
}

#workbenchOutline button {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
  min-height: 48px;
  align-items: start;
  padding: 11px 12px;
  border: 0;
  border-bottom: 1px solid #eef0f3;
  color: var(--product-text);
  background: #fff;
  cursor: pointer;
  text-align: left;
}

#workbenchOutline button:hover:not(:disabled) {
  background: #f6f8ff;
}

#workbenchOutline button:disabled {
  cursor: default;
  opacity: 0.58;
}

#workbenchOutline time {
  color: var(--product-blue);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

#workbenchOutline span {
  font-size: 11px;
  line-height: 1.45;
}

.workbench-tools > section {
  padding-bottom: 8px;
}

.workbench-tool {
  display: grid;
  width: calc(100% - 16px);
  gap: 4px;
  min-height: 56px;
  margin: 8px 8px 0;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--product-text);
  background: #f7f8fa;
  cursor: pointer;
  text-align: left;
  transition: border-color 180ms ease, background 180ms ease;
}

.workbench-tool:hover {
  border-color: #cbd5f4;
  background: #f4f7ff;
}

.workbench-tool strong {
  font-size: 12px;
}

.workbench-tool span {
  color: var(--product-muted);
  font-size: 9px;
}

.workbench-export {
  width: calc(100% - 16px);
  min-height: 40px;
  margin: 8px;
  border: 1px solid #cbd5f4;
  border-radius: 8px;
  color: var(--product-blue);
  background: #f6f8ff;
  cursor: pointer;
  font-weight: 700;
}

.workbench-tools .workbench-tip {
  padding: 14px;
  color: #596273;
  background: #f7f8fa;
}

.workbench-tip strong {
  font-size: 11px;
}

.workbench-tip p {
  margin-top: 6px;
  font-size: 10px;
  line-height: 1.55;
}

.content-workbench.demo-active .workbench-source-cover::after {
  display: inline-block;
  margin-top: 12px;
  padding: 4px 6px;
  border-radius: 4px;
  color: #d9e1ff;
  background: rgba(255, 255, 255, 0.1);
  content: "示例内容";
  font-size: 9px;
}

@media (max-width: 1280px) {
  .content-workbench {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .workbench-tools {
    position: static;
    grid-column: 1 / -1;
    grid-template-columns: 1.3fr 1fr 0.8fr;
  }
}

@media (max-width: 940px) {
  .content-workbench {
    grid-template-columns: 1fr;
  }

  .workbench-media,
  .workbench-tools {
    position: static;
    grid-column: auto;
  }

  .workbench-media {
    grid-template-columns: 0.8fr 1.2fr;
  }

  .workbench-tools {
    grid-template-columns: 1fr;
  }

  .workbench-source-cover {
    min-height: 140px;
  }
}

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

  .preview-demo-visual > strong {
    font-size: 19px;
  }

  .preview-demo-tags em:last-child {
    display: none;
  }
}

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

/* Simplified navigation and progressive disclosure */
.sidebar-history {
  min-height: 0;
  margin-top: 22px;
  overflow: hidden;
  border-top: 1px solid var(--product-border);
  padding-top: 16px;
}

.sidebar-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding: 0 7px;
}

.sidebar-history-head strong {
  font-size: 12px;
}

.sidebar-history-head span {
  color: var(--product-muted);
  font-size: 9px;
}

.sidebar-history .history-list {
  display: grid;
  max-height: 260px;
  gap: 3px;
  overflow-y: auto;
}

.sidebar-history .history-item {
  display: block;
  min-height: auto;
  padding: 9px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  text-align: left;
}

.sidebar-history .history-item:hover {
  background: #f4f6fb;
  transform: none;
}

.sidebar-history .history-item > span {
  display: block;
  min-width: 0;
}

.sidebar-history .history-item > span:last-child {
  display: none;
}

.sidebar-history .history-item strong {
  display: block;
  overflow: hidden;
  color: #454c59;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-history .history-item em {
  display: block;
  margin-top: 3px;
  color: #8a919e;
  font-size: 9px;
  font-style: normal;
}

.sidebar-history .empty {
  padding: 12px 8px;
  color: #9198a4;
  font-size: 10px;
  text-align: left;
}

.sidebar-assistant-link {
  display: grid;
  gap: 4px;
  margin-top: auto;
  padding: 11px 12px;
  border: 1px solid var(--product-border);
  border-radius: 9px;
  color: var(--product-text);
  background: #f8f9fb;
  text-decoration: none;
}

.sidebar-assistant-link:hover {
  border-color: #cbd5f4;
  background: #f4f7ff;
}

.sidebar-assistant-link strong {
  font-size: 11px;
}

.sidebar-assistant-link span {
  color: var(--product-muted);
  font-size: 9px;
}

.sidebar-assistant-link em {
  color: var(--product-blue);
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
}

.processing-log {
  margin-top: 12px;
  border-top: 1px solid var(--product-border);
  padding-top: 10px;
}

.processing-log summary {
  color: var(--product-muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
}

.processing-log[open] summary {
  margin-bottom: 9px;
}

.processing-log .log {
  margin: 0;
}

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

.result-head-actions .secondary {
  min-height: 34px;
  padding: 0 10px;
  font-size: 11px;
}

@media (max-width: 820px) {
  .sidebar-history {
    display: none;
  }

  .sidebar-assistant-link {
    display: none;
  }

  .result-head-actions {
    width: 100%;
    justify-content: space-between;
  }
}

/* Final readable desktop cascade */
body {
  min-width: 320px;
  color: #20242d;
  background: #f5f6f8;
  font-size: 15px;
  line-height: 1.6;
}

.studio-sidebar {
  width: 264px;
  padding: 28px 20px 24px;
  overflow-x: hidden;
  color: #20242d;
  border-right: 1px solid #dfe3ea;
  background: #fff;
  box-shadow: none;
}

.sidebar-collapse-button {
  right: 8px;
}

@media (min-width: 821px) {
  body.sidebar-collapsed .sidebar-collapse-button {
    right: 8px;
  }
}

.studio-brand {
  gap: 13px;
  color: #20242d;
}

.studio-brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  color: #fff;
  background: #315bd6;
  font: 800 22px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
  transform: none;
}

.studio-brand strong {
  font: 700 18px/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
  letter-spacing: 0;
}

.studio-brand em {
  margin-top: 4px;
  color: #727b8c;
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0;
}

.studio-new-button {
  min-height: 52px;
  margin: 30px 0 22px;
  border-radius: 12px;
  color: #fff;
  background: #315bd6;
  font-size: 16px;
  box-shadow: none;
}

.studio-nav {
  gap: 6px;
}

.studio-nav button {
  min-height: 48px;
  gap: 12px;
  padding: 0 14px;
  border-radius: 10px;
  color: #596273;
  font-size: 15px;
}

.studio-nav button span {
  width: 20px;
  color: #7c8799;
  font-size: 18px;
}

.studio-nav button:hover,
.studio-nav button.active {
  color: #315bd6;
  background: #edf2ff;
}

.sidebar-history {
  margin-top: 26px;
  padding-top: 20px;
}

.sidebar-history-head {
  margin-bottom: 10px;
  padding: 0 9px;
}

.sidebar-history-head strong {
  font-size: 14px;
}

.sidebar-history-head span {
  color: #727b8c;
  font-size: 12px;
}

.sidebar-history .history-list {
  max-height: calc(100vh - 430px);
  gap: 4px;
}

.sidebar-history .history-item {
  padding: 11px 9px;
}

.sidebar-history .history-item strong {
  color: #414958;
  font-size: 14px;
  line-height: 1.45;
}

.sidebar-history .history-item em {
  margin-top: 5px;
  color: #727b8c;
  font-size: 12px;
}

.sidebar-history .empty {
  padding: 16px 10px;
  color: #727b8c;
  font-size: 13px;
  line-height: 1.6;
}

.shell {
  width: auto;
  max-width: none;
  margin-left: 264px;
  padding: 32px clamp(24px, 2.5vw, 48px) 64px;
}

.topbar {
  margin-bottom: 24px;
}

.topbar h1 {
  margin-top: 5px;
  font: 750 clamp(32px, 2.5vw, 42px)/1.16 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
  letter-spacing: -0.025em;
}

.eyebrow {
  color: #667085;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.topbar p {
  margin-top: 9px;
  color: #596273;
  font-size: 15px;
}

.topbar-actions button {
  min-height: 42px;
  padding-inline: 16px;
  font-size: 14px;
}

.workspace {
  grid-template-columns: minmax(360px, 0.82fr) minmax(540px, 1.18fr);
  gap: 20px;
}

.panel {
  border: 1px solid #dfe3ea;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(31, 38, 51, 0.055);
  backdrop-filter: none;
}

.input-panel,
.progress-panel,
.transcript-panel,
.admin-panel,
.creator-panel {
  padding: 24px;
}

.field > span,
.supported-inputs > span,
.service-plan span,
.source-row span,
.diagnostic-row span {
  font-size: 13px;
}

.field input,
.field select,
.field textarea,
.transcript-search input,
.tab,
.primary,
.secondary,
.account-button {
  font-size: 14px;
}

.content-workbench {
  grid-template-columns: 252px minmax(0, 1fr) 252px;
  gap: 18px;
  margin-top: 28px;
}

.workbench-media,
.workbench-tools {
  gap: 14px;
}

.workbench-source-cover,
.workbench-outline,
.workbench-tools > section {
  border-radius: 13px;
}

.workbench-source-cover {
  min-height: 188px;
  padding: 20px;
}

.workbench-source-cover > span {
  font-size: 12px;
}

.workbench-source-cover strong {
  margin-top: 44px;
  font-size: 18px;
  line-height: 1.5;
}

.workbench-source-cover em {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  line-height: 1.55;
}

.workbench-aside-head {
  min-height: 54px;
  padding: 14px 16px;
}

.workbench-aside-head strong {
  font-size: 15px;
}

.workbench-aside-head span {
  color: #697386;
  font-size: 12px;
}

#workbenchOutline button {
  grid-template-columns: 50px minmax(0, 1fr);
  min-height: 58px;
  gap: 10px;
  padding: 13px 14px;
}

#workbenchOutline time {
  font-size: 12px;
}

#workbenchOutline span {
  font-size: 14px;
  line-height: 1.5;
}

.result-tab-bar {
  gap: 4px;
  min-height: 66px;
  margin-bottom: 14px;
  padding: 8px;
  border-radius: 13px;
  background: #fff;
}

.result-tab-bar > div {
  min-width: 150px;
}

.result-tab-bar > div .eyebrow {
  font-size: 11px;
}

.result-tab-bar > div strong {
  font: 750 19px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
}

.result-tab-bar button {
  min-height: 44px;
  padding: 0 13px;
  border-radius: 9px;
  font-size: 14px;
  white-space: nowrap;
}

.result-tab-bar button:hover,
.result-tab-bar button.active {
  color: #fff;
  background: #315bd6;
}

.result-panel {
  min-height: 380px;
}

.section-head h2 {
  font-size: 22px;
}

.section-head > span,
.result-head-actions span {
  color: #687182;
  font-size: 13px;
}

.analysis-grid > .empty {
  min-height: 220px;
  font-size: 16px;
  line-height: 1.7;
}

.workbench-tool {
  width: calc(100% - 20px);
  min-height: 72px;
  margin: 10px 10px 0;
  gap: 6px;
  padding: 13px;
  border-radius: 9px;
}

.workbench-tool strong {
  font-size: 15px;
}

.workbench-tool span {
  color: #687182;
  font-size: 13px;
  line-height: 1.45;
}

.workbench-export {
  width: calc(100% - 20px);
  min-height: 48px;
  margin: 10px;
  font-size: 14px;
}

.site-footer {
  width: auto;
  margin-left: 264px;
  padding: 26px clamp(24px, 2.5vw, 48px);
  color: #687182;
  font-size: 13px;
}

@media (max-width: 1440px) {
  .content-workbench {
    grid-template-columns: 224px minmax(0, 1fr);
  }

  .workbench-tools {
    position: static;
    grid-column: 1 / -1;
    grid-template-columns: 1fr 0.72fr;
  }
}

@media (max-width: 1040px) {
  .studio-sidebar {
    width: 228px;
  }

  .shell,
  .site-footer {
    margin-left: 228px;
  }

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

  .workbench-media {
    position: static;
    grid-template-columns: 0.8fr 1.2fr;
  }
}

@media (max-width: 820px) {
  body {
    font-size: 16px;
  }

  .studio-sidebar {
    position: relative;
    width: auto;
    padding: 14px 16px;
  }

  .shell,
  .site-footer {
    margin-left: 0;
  }

  .studio-nav button {
    min-height: 44px;
    font-size: 14px;
  }

  .topbar h1 {
    font-size: 30px;
  }

  .content-workbench,
  .workbench-media,
  .workbench-tools {
    grid-template-columns: 1fr;
  }

  .result-tab-bar button,
  .field input,
  .field select,
  .field textarea {
    font-size: 16px;
  }
}

/* Definitive sidebar label correction. */
.studio-nav .nav-label {
  display: inline;
  width: auto;
  min-width: 0;
  flex: 1;
  color: inherit;
  font-size: 15px;
  line-height: 1.35;
  white-space: nowrap;
  writing-mode: horizontal-tb;
}

/* Horizontal utility rail: the result canvas owns the released width. */
.content-workbench,
.workbench-tools {
  transition: grid-template-columns 180ms ease, width 180ms ease;
}

.workbench-tools {
  position: sticky;
}

.workbench-tools-collapse {
  position: absolute;
  z-index: 3;
  top: 16px;
  left: -13px;
  display: grid;
  width: 28px;
  height: 34px;
  place-items: center;
  padding: 0;
  border: 1px solid #d9dee8;
  border-radius: 9px;
  color: #667188;
  background: #fff;
  box-shadow: 0 5px 14px rgba(28, 39, 65, 0.1);
}

.workbench-tools-collapse:hover {
  color: #315bd6;
  border-color: #aebff2;
}

.workbench-tools-collapse svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.workbench-tools-collapse span {
  display: none;
}

.content-workbench.tools-collapsed {
  grid-template-columns: 250px minmax(0, 1fr) 54px;
}

.content-workbench.tools-collapsed .workbench-tools {
  display: block;
  width: 54px;
  min-height: 176px;
  align-self: start;
  overflow: hidden;
  border: 1px solid #dde2eb;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 9px 24px rgba(29, 39, 63, 0.06);
}

.content-workbench.tools-collapsed .workbench-tools > section {
  display: none;
}

.content-workbench.tools-collapsed .workbench-tools-collapse {
  position: static;
  display: flex;
  width: 100%;
  height: 176px;
  flex-direction: column;
  justify-content: flex-start;
  gap: 12px;
  padding: 17px 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.content-workbench.tools-collapsed .workbench-tools-collapse svg {
  transform: rotate(180deg);
}

.content-workbench.tools-collapsed .workbench-tools-collapse span {
  display: inline;
  color: #657087;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  writing-mode: vertical-rl;
}

@media (max-width: 1440px) {
  .workbench-tools-collapse,
  .content-workbench.tools-collapsed .workbench-tools-collapse {
    display: none;
  }

  .content-workbench.tools-collapsed {
    grid-template-columns: 224px minmax(0, 1fr);
  }

  .content-workbench.tools-collapsed .workbench-tools {
    display: grid;
    width: auto;
    min-height: 0;
    grid-column: 1 / -1;
    grid-template-columns: 1fr 0.72fr;
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .content-workbench.tools-collapsed .workbench-tools > section {
    display: block;
  }
}

@media (max-width: 1040px) {
  .content-workbench.tools-collapsed {
    grid-template-columns: 1fr;
  }

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

/* Final creator action sizing. */
.creator-actions {
  display: grid;
  grid-template-columns: max-content max-content minmax(140px, 1fr);
  align-items: stretch;
  gap: 8px;
}

.creator-actions button {
  min-width: 0;
  white-space: nowrap;
}

@media (max-width: 560px) {
  .creator-actions {
    grid-template-columns: 1fr 1fr;
  }

  .creator-actions .primary {
    grid-column: 1 / -1;
  }
}

.task-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.task-actions button {
  min-height: 38px;
  padding: 0 16px;
}

.study-card-head > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.phone-verification {
  display: grid;
  gap: 12px;
}

.phone-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: end;
  gap: 10px;
}

.phone-code-row button {
  min-height: 46px;
  white-space: nowrap;
}

.site-footer button {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.site-footer button:hover {
  color: var(--primary);
}

.feedback-dialog .auth-form {
  width: min(520px, calc(100vw - 32px));
}

@media (max-width: 560px) {
  .phone-code-row {
    grid-template-columns: 1fr;
  }
}

/* Laptop layout: remove the duplicate video rail and give real output the canvas. */
@media (max-width: 1440px) {
  .content-workbench,
  .content-workbench.tools-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }

  .workbench-media {
    display: none;
  }

  .workbench-tools,
  .content-workbench.tools-collapsed .workbench-tools {
    grid-column: 1;
  }
}
