:root {
  color-scheme: light;
  --bg: #f7f8f7;
  --panel: #ffffff;
  --ink: #101614;
  --muted: #66706c;
  --muted-strong: #37443f;
  --line: #e1e7e4;
  --line-strong: #cdd8d2;
  --soft: #f7f9f8;
  --soft-strong: #eff4f1;
  --green: #0b6b4f;
  --green-deep: #0a3e32;
  --green-soft: #e8f5ee;
  --green-line: #b8dccc;
  --blue: #2f6388;
  --blue-soft: #eaf2f8;
  --amber: #a4660b;
  --amber-soft: #fff2d7;
  --red: #b83a3a;
  --red-soft: #fee7e7;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 20px 60px rgba(16, 22, 20, 0.08);
  --shadow-soft: 0 1px 2px rgba(22, 32, 29, 0.04);
  --focus: 0 0 0 4px rgba(15, 113, 83, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -18%, rgba(11, 107, 79, 0.1), transparent 34vw),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 48%, #f0f4f2 100%);
  color: var(--ink);
  font-family: "Noto Sans SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  cursor: pointer;
}

.app-shell {
  width: min(1280px, calc(100% - 32px));
  display: grid;
  grid-template-columns: 212px minmax(0, 1fr);
  gap: 26px;
  margin: 0 auto;
  padding: 18px 0 36px;
}

.sidebar {
  position: sticky;
  top: 18px;
  height: calc(100vh - 36px);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 24px;
  align-items: start;
  padding: 12px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.sidebar-brand {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 0;
  border-bottom: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #101614;
  color: #fff;
  font-weight: 800;
  box-shadow: none;
}

.sidebar-brand strong,
.sidebar-brand small {
  display: block;
}

.sidebar-brand strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.25;
}

.sidebar-brand small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.side-nav {
  display: grid;
  justify-content: stretch;
  gap: 6px;
  align-content: start;
  overflow-x: visible;
  padding: 0;
}

.side-nav-item {
  position: relative;
  min-height: 40px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  white-space: normal;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.side-nav-item span {
  overflow-wrap: anywhere;
}

.side-nav-item.active,
.side-nav-item:hover {
  border-color: var(--line);
  background: #fff;
  color: var(--green);
  box-shadow: var(--shadow-soft);
}

.side-nav-item:hover {
  transform: translateX(1px);
}

.page {
  min-width: 0;
  padding: 0;
}

.feature-page {
  display: grid;
  gap: 14px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: start;
  text-align: left;
  gap: 10px;
  min-height: 104px;
  margin: 18px 0 16px;
  padding: 0;
}

.feature-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  min-height: 76px;
  padding: 13px 6px 0;
  margin-bottom: 0;
}

.feature-frame-shell {
  min-height: calc(100vh - 128px);
  overflow: hidden;
  border: 1px solid rgba(199, 215, 207, 0.96);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}

.feature-frame-shell iframe {
  display: block;
  width: 100%;
  min-height: calc(100vh - 130px);
  border: 0;
  background: #fff;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin: 0 0 9px;
  font-size: clamp(34px, 4.2vw, 52px);
  line-height: 1.06;
  font-weight: 800;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 800;
}

h3 {
  margin-bottom: 8px;
  font-size: 17px;
}

.subtitle {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.service-card,
.panel,
.info-panel {
  border: 1px solid rgba(205, 216, 210, 0.88);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.service-card {
  min-width: 280px;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) 40px;
  gap: 10px;
  align-items: center;
  padding: 12px;
}

.service-card strong,
.service-card small {
  display: block;
}

.service-card small,
small,
.muted {
  color: var(--muted);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--amber);
}

.dot.good {
  background: var(--green);
}

.dot.bad {
  background: var(--red);
}

.dot.pending {
  background: var(--amber);
}

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

.local-icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  font-style: normal;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  width: min(860px, 100%);
  margin: 0;
}

.form-panel {
  min-height: 0;
  padding: 24px;
}

.result-panel {
  min-height: 0;
  padding: 0;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.panel {
  padding: 22px;
}

.form-panel.panel {
  padding: 24px;
}

.result-panel.panel {
  padding: 0;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-height: 40px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.result-panel .panel-head {
  display: none;
}

.panel-head h2 {
  display: flex;
  align-items: center;
  min-height: 40px;
}

.field {
  display: none;
  gap: 8px;
  margin-bottom: 12px;
}

.field.active {
  display: grid;
}

.field span {
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  display: none;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid #d8e4de;
  border-radius: 10px;
  background: #fbfdfc;
  color: var(--ink);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.field input {
  min-height: 46px;
  padding: 0 13px;
}

.field textarea {
  min-height: 150px;
  padding: 16px;
  resize: vertical;
  line-height: 1.65;
}

.share-input {
  min-height: 196px;
  font-size: 15px;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--green);
  background: #fff;
  box-shadow: var(--focus);
}

.empty-state {
  border-radius: var(--radius-sm);
  background: var(--soft);
}

.form-panel .actions {
  margin-top: 14px;
}

.hidden {
  display: none !important;
}

.empty-state .lucide-loader-circle {
  animation: spin 900ms linear infinite;
}

.actions,
.dialog-actions,
.file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.actions {
  align-items: center;
}

.primary-btn,
.ghost-btn,
.icon-btn,
a.ghost-btn,
.mini-btn,
.mini-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.primary-btn {
  flex: 1 1 auto;
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  background: #101614;
  color: #fff;
  box-shadow: 0 14px 32px rgba(16, 22, 20, 0.18);
}

.primary-btn:hover:not(:disabled),
.ghost-btn:hover,
a.ghost-btn:hover,
.mini-btn:hover,
.mini-link:hover,
.icon-btn:hover {
  transform: translateY(-1px);
}

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

.ghost-btn,
a.ghost-btn {
  padding: 0 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.ghost-btn:hover,
a.ghost-btn:hover {
  border-color: var(--line-strong);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.icon-btn {
  width: 40px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.primary-btn:focus-visible,
.ghost-btn:focus-visible,
.icon-btn:focus-visible,
.mini-btn:focus-visible,
.mini-link:focus-visible,
.title-card:focus-visible,
.side-nav-item:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.empty-state {
  min-height: 132px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed transparent;
  background: transparent;
}

.empty-state svg {
  display: none;
}

.empty-state strong {
  color: var(--ink);
  font-size: 15px;
}

.empty-state span {
  font-size: 13px;
}

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

.partial-files {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.partial-files > strong {
  color: var(--ink);
  font-size: 15px;
}

.title-stage,
.final-stage {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid rgba(205, 216, 210, 0.88);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}

.stage-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.stage-head strong,
.stage-head small {
  display: block;
}

.stage-head strong {
  font-size: 18px;
  font-weight: 800;
}

.stage-head small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.5;
}

.title-options {
  display: grid;
  gap: 10px;
}

.title-options.disabled {
  pointer-events: none;
  opacity: 0.72;
}

.title-card {
  width: 100%;
  min-height: 72px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow-soft);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background 160ms ease;
}

.title-card:hover,
.title-card.selected {
  border-color: var(--green);
  background: #fbfffd;
  box-shadow: var(--focus);
}

.title-card:hover {
  transform: translateY(-1px);
}

.title-card span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.title-card.selected span {
  background: var(--green-soft);
  color: var(--green);
}

.title-card strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.45;
}

.title-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.summary-card.compact {
  padding: 12px;
}

.summary-grid {
  display: grid;
  gap: 10px;
}

.summary-grid > div {
  display: grid;
  gap: 6px;
}

.summary-grid strong,
.summary-grid p,
.summary-list strong,
.summary-list span {
  display: block;
  overflow-wrap: anywhere;
}

.summary-grid strong,
.summary-list strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.summary-grid p,
.summary-list span,
.summary-card > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

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

.summary-list li {
  display: grid;
  gap: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.summary-card p {
  margin-top: 8px;
}

.inline-error {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--red-soft);
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
}

.selected-title {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--green-line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #f0faf5, #e9f6ef);
}

.selected-title span {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.selected-title strong {
  overflow-wrap: anywhere;
  font-size: 18px;
  line-height: 1.4;
}

.inline-note-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  min-height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
}

.inline-note-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.inline-note-head span,
.inline-note-head strong {
  display: block;
}

.inline-note-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.inline-note-head strong {
  margin-top: 4px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.inline-note-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.inline-note-preview {
  min-height: 0;
}

.inline-note-content {
  max-height: none;
  min-height: 100%;
  margin: 0;
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}

.empty-state.compact {
  min-height: 180px;
}

.file-card,
.summary-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.compact-files {
  gap: 8px;
}

.compact-files .file-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 10px 12px;
  box-shadow: none;
}

.compact-files .file-main {
  min-width: 0;
}

.compact-files .file-main strong {
  font-size: 13px;
}

.compact-files .status {
  display: none;
}

.compact-files .file-actions {
  justify-content: flex-end;
}

.file-main,
.summary-main {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.file-main strong,
.file-main small,
.summary-main strong,
.summary-main small {
  display: block;
  overflow-wrap: anywhere;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status.success {
  background: var(--green-soft);
  color: var(--green);
}

.status.failed {
  background: var(--red-soft);
  color: var(--red);
}

.mini-btn,
.mini-link {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 13px;
}

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

.info-panel {
  padding: 16px;
}

.info-panel p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.model-panel {
  display: none;
}

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

.model-list article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.model-list span {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.model-list strong,
.model-list p {
  display: block;
}

.model-list p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  line-height: 1.65;
}

dialog {
  width: min(900px, calc(100vw - 28px));
  max-height: min(760px, calc(100vh - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(22, 32, 29, 0.22);
}

dialog::backdrop {
  background: rgba(16, 28, 35, 0.42);
  backdrop-filter: blur(4px);
}

#toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  transition: opacity 180ms ease, transform 180ms ease;
}

#toast.show {
  opacity: 1;
  transform: translateY(0);
}

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

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

  .form-panel,
  .result-panel {
    min-height: auto;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 24px, 1120px);
    grid-template-columns: 1fr;
    gap: 14px;
    padding-top: 16px;
  }

  .sidebar {
    position: static;
    height: auto;
    grid-template-columns: minmax(0, auto) minmax(0, 1fr);
    grid-template-rows: auto;
    align-items: center;
    gap: 14px;
    padding: 0;
  }

  .side-nav {
    display: flex;
    justify-content: flex-end;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .side-nav-item {
    min-width: max-content;
  }

  .hero,
  .feature-header,
  .tool-layout {
    grid-template-columns: 1fr;
    display: grid;
  }

  .service-card {
    min-width: 0;
  }

  .support-grid,
  .model-list {
    grid-template-columns: 1fr;
  }

  .feature-frame-shell,
  .feature-frame-shell iframe {
    min-height: 760px;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 20px, 1120px);
    gap: 14px;
    padding-top: 18px;
  }

  .sidebar {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .side-nav {
    justify-content: flex-start;
    padding: 0;
  }

  .page {
    padding-top: 0;
  }

  .hero {
    min-height: 120px;
    margin: 8px 0 12px;
    padding-top: 4px;
  }

  h1 {
    font-size: 30px;
    line-height: 1.16;
  }

  .subtitle {
    font-size: 14px;
    line-height: 1.65;
  }

  .panel {
    padding: 16px;
  }

  .form-panel.panel {
    padding: 16px;
  }

  .share-input {
    min-height: 156px;
  }

  .panel-head,
  .file-main,
  .summary-main {
    display: grid;
  }

  .panel-head {
    gap: 10px;
  }

  .actions,
  .primary-btn,
  .ghost-btn,
  a.ghost-btn {
    width: 100%;
  }

}

/* Embedded workspace layout */
html,
body {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

body {
  background: #fff;
  color: #111;
  font-family: "Noto Sans SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  display: flex;
  gap: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #fff;
}

.sidebar {
  position: static;
  top: auto;
  width: 80px;
  min-width: 80px;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-right: 1px solid #f1f1f1;
  background: #fff;
  overflow: hidden;
}

.sidebar-brand {
  width: 64px;
  height: 64px;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.sidebar-brand img {
  width: 64px;
  height: 44px;
  object-fit: contain;
  display: block;
}

.brand-mark,
.sidebar-brand > div {
  display: none;
}

.side-nav {
  width: 64px;
  display: grid;
  gap: 6px;
  align-content: start;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0;
}

.side-nav-item {
  width: 64px;
  min-height: 66px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  justify-content: center;
  padding: 6px 4px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #737373;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  box-shadow: none;
}

.side-nav-item span {
  display: block;
  max-width: 56px;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
}

.side-nav-item svg {
  width: 20px;
  height: 20px;
}

.side-nav-item.active,
.side-nav-item:hover {
  border-color: transparent;
  background: #111;
  color: #fff;
  box-shadow: none;
  transform: none;
}

.page {
  flex: 1 1 auto;
  min-width: 0;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  background: #fff;
}

.hero,
.feature-header {
  min-height: auto;
  margin: 0;
  padding: 0;
}

.hero h1,
.feature-header h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: 0;
}

.subtitle {
  max-width: none;
  margin-top: 5px;
  color: #737373;
  font-size: 14px;
  line-height: 1.45;
}

.primary-page,
.tool-layout {
  min-width: 0;
  min-height: 0;
}

.primary-page {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  padding: 14px 18px 16px;
  overflow: hidden;
}

.tool-layout {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 390px);
  gap: 20px;
  align-items: stretch;
  margin: 0;
}

#video-note-page .tool-layout {
  grid-template-columns: minmax(300px, 340px) minmax(0, 1fr);
}

.panel,
.form-panel,
.result-panel {
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.form-panel {
  display: flex;
  min-height: 0;
  flex-direction: column;
  overflow: auto;
  overscroll-behavior: contain;
}

.result-panel {
  display: flex;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border-left: 1px solid #f1f1f1;
  padding-left: 20px;
}

.panel-head,
.result-panel .panel-head {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
}

.panel-head h2 {
  min-height: 0;
  color: #111;
  font-size: 15px;
  line-height: 1.3;
  font-weight: 800;
}

.field {
  margin-bottom: 12px;
}

.field span {
  display: block;
  margin-bottom: 7px;
  color: #525252;
  font-size: 12px;
  font-weight: 700;
}

.field input,
.field textarea {
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  background: #fafafa;
  color: #111;
}

.field input:focus,
.field textarea:focus {
  border-color: #111;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.08);
}

.field textarea {
  min-height: 128px;
  resize: none;
}

.share-input {
  min-height: 228px;
  flex: 0 0 auto;
  font-size: 14px;
}

.actions {
  margin-top: auto;
  padding-top: 12px;
}

.primary-btn,
.ghost-btn,
a.ghost-btn,
.mini-btn,
.mini-link,
.icon-btn {
  border-radius: 12px;
  font-weight: 750;
  box-shadow: none;
}

.primary-btn {
  min-height: 46px;
  background: #111;
  color: #fff;
}

.primary-btn:hover:not(:disabled) {
  background: #000;
}

.ghost-btn,
a.ghost-btn,
.mini-btn,
.mini-link,
.icon-btn {
  border-color: #e5e5e5;
  background: #fff;
  color: #111;
}

.ghost-btn:hover,
a.ghost-btn:hover,
.mini-btn:hover,
.mini-link:hover,
.icon-btn:hover {
  border-color: #d4d4d4;
  background: #fafafa;
  box-shadow: none;
}

#result-area {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.empty-state {
  min-height: 100%;
  border: 1px dashed #e5e5e5;
  border-radius: 16px;
  background: #fafafa;
}

.title-stage,
.final-stage {
  gap: 12px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.final-stage {
  min-height: 100%;
}

.stage-head {
  padding: 0;
  border: 0;
}

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

.stage-head small {
  color: #737373;
}

.title-card,
.file-card,
.summary-card,
.inline-note-card,
.selected-title {
  border-color: #e5e5e5;
  border-radius: 14px;
  background: #fff;
  box-shadow: none;
}

.title-card:hover,
.title-card.selected {
  border-color: #111;
  background: #fafafa;
  box-shadow: none;
}

.title-card span,
.title-card.selected span,
.status.success {
  background: #f5f5f5;
  color: #111;
}

.selected-title {
  background: #fafafa;
}

.selected-title span,
.inline-note-head span {
  color: #111;
}

.inline-note-content {
  border-color: #e5e5e5;
  background: #fff;
}

.feature-page {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.feature-header {
  display: none;
}

.feature-frame-shell {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

.feature-frame-shell iframe {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: #fff;
}

@media (max-width: 980px) {
  .tool-layout {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .result-panel {
    min-height: 420px;
    border-left: 0;
    border-top: 1px solid #f1f1f1;
    padding-left: 0;
    padding-top: 16px;
  }
}

@media (max-width: 720px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  .app-shell {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
  }

  .sidebar {
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 0;
    flex-direction: row;
    justify-content: flex-start;
    border-right: 0;
    border-bottom: 1px solid #f1f1f1;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .sidebar-brand {
    width: 54px;
    min-width: 54px;
    height: 48px;
    min-height: 48px;
  }

  .sidebar-brand img {
    width: 54px;
    height: 36px;
  }

  .side-nav {
    width: auto;
    display: flex;
    gap: 6px;
  }

  .side-nav-item {
    width: 58px;
    min-width: 58px;
    min-height: 58px;
  }

  .page {
    height: calc(100vh - 65px);
    height: calc(100dvh - 65px);
    min-height: 0;
    overflow: hidden;
  }

  .primary-page {
    height: calc(100vh - 65px);
    height: calc(100dvh - 65px);
    min-height: 0;
    padding: 14px;
    overflow: hidden;
  }

  .panel-head,
  .result-panel .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-head h2 {
    white-space: nowrap;
  }

  .feature-page,
  .feature-frame-shell,
  .feature-frame-shell iframe {
    height: calc(100vh - 65px);
    height: calc(100dvh - 65px);
    min-height: 0;
  }

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

  .actions,
  .panel-head .ghost-btn,
  .primary-btn,
  .ghost-btn,
  a.ghost-btn {
    width: 100%;
  }
}

/* Video note workbench aligned with the mature note-creation UI */
:root {
  --xhs-bg: #eef3f8;
  --xhs-panel: #ffffff;
  --xhs-panel-soft: #f9fbff;
  --xhs-soft: #f7f9fc;
  --xhs-line: #d9e3ee;
  --xhs-line-strong: #bdcad9;
  --xhs-text: #0f172a;
  --xhs-muted: #667085;
  --xhs-muted-2: #94a3b8;
  --xhs-accent: #ff2442;
  --xhs-accent-dark: #dc1f3a;
  --xhs-accent-soft: #fff1f4;
  --xhs-focus: 0 0 0 4px rgba(255, 36, 66, 0.16);
  --xhs-shadow: 0 20px 50px rgba(15, 23, 42, 0.085), 0 1px 0 rgba(255, 255, 255, 0.86) inset;
  --xhs-shadow-soft: 0 8px 22px rgba(15, 23, 42, 0.055);
}

.video-workbench-page {
  background:
    linear-gradient(180deg, #fbfcff 0%, var(--xhs-bg) 48%, #eaf0f7 100%);
  color: var(--xhs-text);
}

.video-workbench-page.primary-page {
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: 12px 14px;
}

.video-topbar {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  border: 1px solid rgba(203, 213, 225, 0.68);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.92));
  box-shadow: var(--xhs-shadow-soft);
  backdrop-filter: blur(14px);
}

.video-brand {
  display: flex;
  align-items: center;
  min-width: 0;
}

.video-topbar h1 {
  margin: 0;
  color: var(--xhs-text);
  font-size: 20px;
  line-height: 1.2;
  font-weight: 900;
}

.video-topbar .subtitle {
  margin-top: 4px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
}

.video-new-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 14px;
  border: 1px solid rgba(203, 213, 225, 0.86);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.92));
  color: var(--xhs-text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 1px 2px rgba(15, 23, 42, 0.035);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.video-new-btn:hover {
  border-color: var(--xhs-line-strong);
  background: #fff;
  box-shadow: var(--xhs-shadow-soft);
  transform: translateY(-1px);
}

.video-new-btn:active {
  transform: translateY(0);
}

.video-new-btn:focus-visible {
  outline: 3px solid rgba(255, 36, 66, 0.16);
  outline-offset: 2px;
}

.video-new-btn svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
}

.video-workbench-page .tool-layout {
  grid-template-columns: 348px minmax(0, 1fr);
  gap: 12px;
  padding: 0;
  align-items: stretch;
}

#video-note-page.video-workbench-page .tool-layout {
  grid-template-columns: 348px minmax(0, 1fr);
}

.video-workbench-page .panel,
.video-workbench-page .form-panel,
.video-workbench-page .result-panel {
  min-width: 0;
  min-height: 0;
  padding: 16px;
  border: 1px solid rgba(203, 213, 225, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--xhs-shadow);
}

.video-workbench-page .form-panel,
.video-workbench-page .result-panel {
  display: flex;
  flex-direction: column;
}

.video-workbench-page .result-panel {
  border-left: 1px solid rgba(203, 213, 225, 0.72);
  padding-left: 16px;
}

.video-workbench-page .result-panel.workbench-result-panel {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  overflow: hidden;
}

.video-workbench-page .result-panel.workbench-result-panel > .panel-head {
  display: none;
}

.video-workbench-page .panel-head,
.video-workbench-page .result-panel .panel-head {
  min-height: 44px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 14px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--xhs-line);
}

.video-workbench-page .panel-head h2 {
  display: block;
  margin: 0;
  color: var(--xhs-text);
  font-size: 16px;
  line-height: 1.25;
  font-weight: 900;
}

.video-workbench-page .panel-head span {
  display: block;
  margin-top: 4px;
  color: var(--xhs-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.video-workbench-page .toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.video-workbench-page .toolbar .btn {
  min-width: 142px;
  height: 40px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--xhs-line);
  border-radius: 8px;
  background: #fff;
  color: #4f5968;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  box-shadow: none;
}

.video-workbench-page .toolbar .btn:hover:not(:disabled) {
  border-color: #efabc7;
  background: #fff7fa;
  color: #b92763;
}

.video-workbench-page .toolbar .btn:disabled {
  border-color: #e7e9ed;
  background: #f6f7f8;
  color: #aab0ba;
  cursor: not-allowed;
  opacity: 1;
}

.video-workbench-page .toolbar .btn.primary {
  border-color: var(--xhs-accent);
  background: linear-gradient(135deg, var(--xhs-accent), #e92d4a);
  color: #fff;
  box-shadow: 0 12px 24px rgba(255, 36, 66, 0.18), 0 1px 0 rgba(255, 255, 255, 0.24) inset;
}

.video-workbench-page .toolbar .btn.primary:hover:not(:disabled) {
  border-color: #bd2b67;
  background: #bd2b67;
  color: #fff;
}

.video-workbench-page .toolbar .btn.primary:disabled {
  border-color: #9f4050;
  background: linear-gradient(135deg, #b24a5c, #963848);
  color: rgba(255, 255, 255, 0.86);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 1;
}

.video-workbench-page .field {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  margin: 0;
}

.video-workbench-page .field textarea {
  flex: 1 1 auto;
  min-height: 190px;
  height: auto;
  border: 1px solid var(--xhs-line);
  border-radius: 8px;
  background: var(--xhs-panel-soft);
  color: var(--xhs-text);
  font-size: 14px;
  line-height: 1.7;
  resize: none;
}

.video-workbench-page .field textarea:focus {
  border-color: var(--xhs-accent);
  background: #fff;
  box-shadow: var(--xhs-focus);
}

.video-workbench-page .actions {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  gap: 8px;
}

.video-workbench-page .primary-btn,
.video-workbench-page .ghost-btn,
.video-workbench-page .mini-btn,
.video-workbench-page .mini-link {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.video-workbench-page .primary-btn {
  border: 1px solid var(--xhs-accent);
  background: linear-gradient(135deg, var(--xhs-accent), #e92d4a);
  color: #fff;
  box-shadow: 0 12px 24px rgba(255, 36, 66, 0.22), 0 1px 0 rgba(255, 255, 255, 0.24) inset;
}

.video-workbench-page .primary-btn:hover:not(:disabled) {
  border-color: var(--xhs-accent-dark);
  background: var(--xhs-accent-dark);
  box-shadow: 0 12px 24px rgba(255, 36, 66, 0.22);
}

.video-workbench-page .primary-btn:disabled,
.video-workbench-page .primary-btn:disabled:hover {
  border-color: #9f4050;
  background: linear-gradient(135deg, #b24a5c, #963848);
  color: rgba(255, 255, 255, 0.86);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 1;
  transform: none;
}

.video-workbench-page .ghost-btn,
.video-workbench-page .mini-btn,
.video-workbench-page .mini-link {
  border: 1px solid rgba(203, 213, 225, 0.86);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.92));
  color: var(--xhs-text);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 1px 2px rgba(15, 23, 42, 0.035);
}

.video-workbench-page .ghost-btn:hover,
.video-workbench-page .mini-btn:hover,
.video-workbench-page .mini-link:hover {
  border-color: var(--xhs-line-strong);
  background: #fff;
  box-shadow: var(--xhs-shadow-soft);
}

.video-workbench-page #result-area,
.video-workbench-page #replica-result-area {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  overscroll-behavior: contain;
}

.video-workbench-page .workbench-result-content {
  height: 100%;
  overflow: hidden;
}

.video-workbench-page .workbench-result-shell {
  position: relative;
  height: 100%;
  min-height: 0;
}

.video-workbench-page .video-note-workbench-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.video-workbench-page .workbench-result-fallback {
  position: absolute;
  inset: 14px;
  z-index: 5;
  display: none;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(16px);
}

.video-workbench-page .workbench-result-shell.show-fallback:not(.is-ready) .workbench-result-fallback {
  display: grid;
}

.video-workbench-page .workbench-fallback-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.video-workbench-page .workbench-fallback-head span {
  display: block;
  margin-bottom: 4px;
  color: var(--xhs-muted);
  font-size: 12px;
  font-weight: 800;
}

.video-workbench-page .workbench-fallback-head strong {
  color: var(--xhs-text);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.35;
}

.video-workbench-page .workbench-fallback-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.video-workbench-page .workbench-result-fallback p {
  margin: 0;
  color: var(--xhs-muted);
  font-size: 13px;
  line-height: 1.7;
}

.video-workbench-page .workbench-result-fallback pre {
  min-height: 0;
  margin: 0;
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--xhs-line);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.9);
  color: var(--xhs-text);
  font: 14px/1.8 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  white-space: pre-wrap;
}

.video-workbench-page .empty-state {
  min-height: 100%;
  border: 1px dashed rgba(203, 213, 225, 0.9);
  border-radius: 8px;
  background: var(--xhs-soft);
  color: var(--xhs-muted);
}

.video-workbench-page .empty-state strong {
  color: var(--xhs-text);
}

.video-workbench-page .replica-status-state {
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.video-workbench-page .replica-status-state.is-running {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.video-workbench-page .replica-status-card {
  display: grid;
  justify-items: center;
  gap: 18px;
  width: min(1320px, 100%);
  color: #667085;
  font-size: 16px;
  font-weight: 400;
  line-height: normal;
}

.video-workbench-page .result-state-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  width: min(520px, 100%);
  padding: 28px;
  border: 1px solid rgba(203, 213, 225, 0.82);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
  text-align: center;
}

.video-workbench-page .result-state-card.is-error {
  border-color: rgba(255, 36, 66, 0.2);
  background: #fffafb;
}

.video-workbench-page .result-state-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--xhs-accent-soft);
  color: var(--xhs-accent-dark);
}

.video-workbench-page .result-state-icon svg {
  width: 19px;
  height: 19px;
}

.video-workbench-page .replica-status-card > .result-state-icon {
  justify-self: center;
  margin-bottom: -6px;
}

.video-workbench-page .result-state-copy {
  display: grid;
  gap: 6px;
}

.video-workbench-page .result-state-copy strong {
  color: var(--xhs-text);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.4;
}

.video-workbench-page .result-state-copy span {
  color: var(--xhs-muted);
  font-size: 13px;
  line-height: 1.65;
}

.video-workbench-page .result-state-actions {
  display: flex;
  justify-content: center;
}

.video-workbench-page .result-spinner {
  width: 19px;
  height: 19px;
  border: 2px solid rgba(255, 36, 66, 0.18);
  border-top-color: var(--xhs-accent);
  border-radius: 50%;
  animation: xhsResultSpin 0.82s linear infinite;
}

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

.video-workbench-page .replica-status-copy {
  display: grid;
  gap: 8px;
  width: 100%;
  text-align: center;
  font-size: 16px;
  font-weight: 400;
  line-height: normal;
}

.video-workbench-page .replica-status-copy strong {
  display: block;
  width: 100%;
  color: #0f172a;
  font-size: 18px;
  font-weight: 950;
  line-height: 1.35;
}

.video-workbench-page .replica-status-copy span {
  display: block;
  width: 100%;
  color: #64748b;
  font-size: 13px;
  line-height: 1.65;
}

.video-workbench-page .replica-status-copy small {
  color: var(--xhs-muted);
  font-size: 12px;
  font-weight: 800;
}

.video-workbench-page .replica-status-copy .launch-wait-tip {
  display: inline-block;
  width: min(560px, 100%);
  margin: 0 auto;
  padding: 8px 12px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.92);
  color: #667085;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.45;
}

.video-workbench-page .replica-step-grid {
  display: grid;
  grid-template-columns: repeat(3, 220px);
  gap: 10px;
  width: min(680px, 100%);
  max-width: 100%;
  margin: 0 auto;
  text-align: left;
  font-size: 16px;
  font-weight: 400;
  line-height: normal;
}

.video-workbench-page .replica-step-grid.is-four-step {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  width: min(1040px, 100%);
}

.video-workbench-page .replica-step-grid.is-six-step {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 14px 14px;
  width: min(1320px, 100%);
}

.video-workbench-page .replica-step {
  display: grid;
  gap: 8px;
  align-content: start;
  width: 220px;
  min-height: 0;
  padding: 13px;
  color: #667085;
  border: 1px solid rgba(203, 213, 225, 0.78);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
  font-size: 16px;
  font-weight: 400;
  line-height: normal;
}

.video-workbench-page .replica-step-grid.is-four-step .replica-step {
  width: auto;
}

.video-workbench-page .replica-step-grid.is-six-step .replica-step {
  width: auto;
  min-height: 150px;
}

.video-workbench-page .replica-step b {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--xhs-accent-soft);
  color: var(--xhs-accent-dark);
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
}

.video-workbench-page .replica-step strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 950;
  line-height: 1.35;
}

.video-workbench-page .replica-step span {
  color: #64748b;
  font-size: 12px;
  line-height: 1.55;
}

.video-workbench-page .replica-step.done,
.video-workbench-page .replica-step.active {
  border-color: rgba(255, 36, 66, 0.28);
  background: #fffafb;
}

.video-workbench-page .replica-step.done b {
  background: #eaf8f2;
  color: #0f7a5f;
}

.video-workbench-page .replica-step.active {
  box-shadow: 0 0 0 4px rgba(255, 36, 66, 0.1);
}

.video-workbench-page .waiting-state {
  gap: 10px;
  align-content: center;
  padding: 22px;
}

.video-workbench-page .waiting-state small {
  color: var(--xhs-muted);
  font-size: 12px;
  font-weight: 800;
}

.video-workbench-page .waiting-state ol {
  width: min(320px, 100%);
  display: grid;
  gap: 7px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.video-workbench-page .waiting-state li {
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--xhs-muted);
  font-size: 12px;
  font-weight: 800;
}

.video-workbench-page .waiting-state li::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--xhs-line-strong);
}

.video-workbench-page .waiting-state li.done::before {
  background: #17a36b;
}

.video-workbench-page .waiting-state li.active {
  color: var(--xhs-text);
}

.video-workbench-page .waiting-state li.active::before {
  background: var(--xhs-accent);
  box-shadow: 0 0 0 4px rgba(255, 36, 66, 0.12);
}

.video-workbench-page .title-stage,
.video-workbench-page .final-stage {
  min-height: 100%;
  display: grid;
  align-content: stretch;
  gap: 14px;
  padding: 4px 0 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.video-workbench-page .title-stage {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.video-workbench-page .final-stage {
  align-content: start;
  padding: 0;
}

.video-workbench-page .stage-head {
  padding: 0 0 12px;
  border-bottom: 1px solid var(--xhs-line);
}

.video-workbench-page .stage-head strong {
  color: var(--xhs-text);
  font-size: 16px;
  font-weight: 900;
}

.video-workbench-page .stage-head small {
  color: var(--xhs-muted);
}

.video-workbench-page .status.success {
  background: var(--xhs-accent-soft);
  color: var(--xhs-accent-dark);
}

.video-workbench-page .title-options {
  flex: 1 1 auto;
  align-self: center;
  align-content: center;
  align-items: stretch;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 12px;
  width: 100%;
  min-height: 0;
  margin: 0 auto;
}

.video-workbench-page .title-card {
  position: relative;
  min-height: 148px;
  align-content: start;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 14px 12px;
  border: 1px solid rgba(203, 213, 225, 0.74);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(249, 251, 255, 0.92));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 1px 2px rgba(15, 23, 42, 0.035);
}

.video-workbench-page .title-card:hover,
.video-workbench-page .title-card.selected {
  border-color: rgba(255, 36, 66, 0.36);
  background: var(--xhs-accent-soft);
  box-shadow: 0 10px 26px rgba(255, 36, 66, 0.08);
}

.video-workbench-page .title-card.selected::before {
  content: "";
  position: absolute;
  inset: 12px auto 12px 0;
  width: 3px;
  border-radius: 0 999px 999px 0;
  background: var(--xhs-accent);
}

.video-workbench-page .title-card span {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--xhs-accent-soft);
  color: var(--xhs-accent-dark);
  font-size: 12px;
  font-weight: 900;
}

.video-workbench-page .title-card strong,
.video-workbench-page .title-card small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.video-workbench-page .title-card strong {
  color: var(--xhs-text);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.45;
}

.video-workbench-page .title-card small {
  margin-top: 8px;
  color: var(--xhs-muted);
  font-size: 12px;
  line-height: 1.5;
}

.video-workbench-page .title-actions {
  justify-content: flex-end;
  gap: 8px;
  padding-top: 0;
}

.video-workbench-page .inline-note-card {
  gap: 14px;
  min-height: 100%;
  padding: 0;
  background: transparent;
}

.video-workbench-page .inline-note-head {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--xhs-line);
}

.video-workbench-page .inline-note-head span {
  color: var(--xhs-muted);
}

.video-workbench-page .inline-note-head strong {
  color: var(--xhs-text);
  font-size: 17px;
  font-weight: 900;
}

.video-workbench-page .note-block {
  display: grid;
  gap: 8px;
}

.video-workbench-page .note-block h3 {
  margin: 0;
  color: var(--xhs-text);
  font-size: 14px;
  font-weight: 900;
}

.video-workbench-page .inline-note-content {
  min-height: auto;
  max-height: none;
  padding: 14px;
  border: 1px solid var(--xhs-line);
  border-radius: 8px;
  background: #fff;
  color: var(--xhs-text);
  font-size: 14px;
  line-height: 1.75;
}

.video-workbench-page .tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.video-workbench-page .tag-list span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--xhs-accent-soft);
  color: var(--xhs-accent-dark);
  font-size: 12px;
  font-weight: 800;
}

.video-workbench-page .visual-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.video-workbench-page .visual-list article {
  min-width: 0;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--xhs-line);
  border-radius: 8px;
  background: #fff;
}

.video-workbench-page .visual-list article > span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--xhs-soft);
  color: var(--xhs-muted);
  font-size: 12px;
  font-weight: 900;
}

.video-workbench-page .visual-list strong,
.video-workbench-page .visual-list p,
.video-workbench-page .compact-review p {
  margin: 0;
  overflow-wrap: anywhere;
}

.video-workbench-page .visual-list strong {
  color: var(--xhs-text);
  font-size: 13px;
}

.video-workbench-page .visual-list p,
.video-workbench-page .compact-review p {
  margin-top: 3px;
  color: var(--xhs-muted);
  font-size: 12px;
  line-height: 1.45;
}

.video-workbench-page .embedded-workbench-block {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

.video-workbench-page .embedded-workbench-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--xhs-line);
}

.video-workbench-page .embedded-workbench-head h3 {
  margin: 0;
  color: var(--xhs-text);
  font-size: 14px;
  font-weight: 900;
}

.video-workbench-page .embedded-workbench-head p {
  margin: 4px 0 0;
  color: var(--xhs-muted);
  font-size: 12px;
  line-height: 1.5;
}

.video-workbench-page .embedded-workbench-shell {
  min-height: 720px;
  border: 1px solid var(--xhs-line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--xhs-shadow-soft);
}

.video-workbench-page .embedded-workbench-shell iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 720px;
  border: 0;
  background: #fff;
}

@media (max-width: 760px) {
  .video-workbench-page .tool-layout,
  #video-note-page.video-workbench-page .tool-layout {
    grid-template-columns: 1fr;
    height: auto;
    align-content: start;
    overflow: auto;
  }

  .video-workbench-page .form-panel {
    min-height: 430px;
  }

  .video-workbench-page .result-panel {
    min-height: 520px;
    border-left: 1px solid rgba(203, 213, 225, 0.72);
    padding-left: 16px;
  }

  .video-workbench-page .embedded-workbench-shell,
  .video-workbench-page .embedded-workbench-shell iframe {
    min-height: 640px;
  }
}

@media (max-width: 720px) {
  .video-workbench-page.primary-page {
    padding: 10px;
  }

  .video-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .video-workbench-page .visual-list {
    grid-template-columns: 1fr;
  }

  .video-workbench-page .replica-step-grid {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .video-workbench-page .replica-step {
    width: 100%;
  }
}
