:root {
  color-scheme: light;
  --brand: #3867f4;
  --ink: #172033;
  --muted: #667085;
  --line: #d9e0ea;
  --line-soft: #e8edf4;
  --soft: #f5f7fb;
  --panel: #ffffff;
  --panel-warm: #fbfcff;
  --field: #ffffff;
  --topbar: #101827;
  --accent: #159b70;
  --warning: #b5472f;
  --shadow: 0 18px 44px rgba(16, 24, 40, 0.16);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: auto;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% -15%, color-mix(in srgb, var(--brand) 20%, transparent), transparent 36%),
    linear-gradient(180deg, #eef3fa 0%, #e7ecf4 100%);
}

body.advanced-mode {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select,
summary {
  cursor: pointer;
}

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

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

h1 {
  margin-bottom: 4px;
  font-size: 1.02rem;
  line-height: 1.25;
}

h2 {
  margin-bottom: 2px;
  font-size: 0.98rem;
  line-height: 1.25;
}

h3 {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.25;
}

.app-frame {
  height: 100vh;
  display: grid;
  grid-template-rows: 52px 1fr;
}

.app-topbar {
  min-height: 52px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 260px) auto auto;
  align-items: center;
  gap: 10px;
  padding: 0 max(14px, calc((100vw - 1360px) / 2));
  color: #fff;
  background: rgba(12, 18, 31, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 840;
}

.brand-symbol {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 88%, #fff 12%), #1a2750);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.2);
  font-size: 0.72rem;
}

.brand-text {
  white-space: nowrap;
}

.brand-mark small {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.76rem;
  font-weight: 680;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.top-project-select span,
label span,
.field-label span,
.quick-capture small,
.source-grid span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 720;
}

.top-project-select span {
  color: rgba(255, 255, 255, 0.62);
}

input,
select,
textarea,
.top-project-select select,
.samples-menu summary,
.mode-badge,
.top-button {
  min-height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--ink);
  outline: none;
}

input,
select,
textarea {
  width: 100%;
  padding: 8px 10px;
}

textarea {
  resize: vertical;
  line-height: 1.52;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent);
}

.top-project-select select,
.samples-menu summary,
.mode-badge,
.top-button {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.mode-badge {
  display: inline-flex;
  align-items: center;
  width: auto;
  padding: 0 10px;
  color: #ccf7e4;
  font-size: 0.76rem;
  font-weight: 780;
  white-space: nowrap;
}

.top-actions {
  display: inline-flex;
  justify-content: flex-end;
  align-items: center;
  gap: 7px;
}

.top-button {
  width: auto;
  padding: 0 10px;
  font-weight: 760;
}

.samples-menu {
  position: relative;
}

.samples-menu summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  width: auto;
  padding: 0 12px;
  font-size: 0.82rem;
  font-weight: 760;
}

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

.samples-menu .menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 40;
  min-width: 196px;
  display: grid;
  gap: 4px;
  padding: 8px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.menu-section-label {
  padding: 3px 10px 1px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 860;
  text-transform: uppercase;
}

.samples-menu button {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  padding: 0 10px;
  font-weight: 720;
}

.samples-menu button:hover {
  background: var(--soft);
}

.samples-menu hr {
  width: 100%;
  height: 1px;
  border: 0;
  background: var(--line-soft);
  margin: 3px 0;
}

.workbench {
  width: min(100%, 1360px);
  min-height: 0;
  margin: 0 auto;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(380px, 0.92fr);
  gap: 14px;
  overflow: hidden;
}

.quick-panel {
  min-height: calc(100vh - 52px);
  overflow: auto;
  padding: clamp(12px, 3vw, 28px);
}

.quick-clip-root {
  width: min(100%, 1040px);
  margin: 0 auto;
}

.quick-clip-shell {
  display: grid;
  gap: 14px;
}

.quick-preview-actions,
.quick-media-actions,
.quick-export-result .export-result-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.quick-upload-stage,
.quick-compose-stage,
.quick-preview-stage {
  display: grid;
  gap: 14px;
  padding: clamp(14px, 3vw, 24px);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 38px rgba(16, 24, 40, 0.08);
}

.quick-upload-stage {
  min-height: min(620px, calc(100vh - 160px));
  place-content: center;
  justify-items: center;
  text-align: center;
}

.quick-upload-copy {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.quick-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid color-mix(in srgb, var(--brand) 28%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 8%, #fff);
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 860;
}

.quick-upload-copy h2 {
  margin: 0;
  max-width: 560px;
  font-size: clamp(1.35rem, 2.4vw, 1.95rem);
  letter-spacing: 0;
}

.quick-upload-copy p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.quick-start-steps {
  width: min(100%, 650px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0 2px;
  padding: 0;
  list-style: none;
}

.quick-start-steps li {
  min-width: 0;
  display: grid;
  gap: 5px;
  justify-items: center;
  padding: 12px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel-warm);
}

.quick-start-steps span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 12%, #fff);
  color: var(--brand);
  font-size: 0.76rem;
  font-weight: 880;
}

.quick-start-steps strong {
  font-size: 0.86rem;
  font-weight: 850;
}

.quick-start-steps small {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.32;
}

.quick-upload-button {
  position: relative;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 178px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--brand);
  color: #fff;
  font-weight: 820;
  box-shadow: 0 1px 0 color-mix(in srgb, #fff 22%, transparent) inset;
  overflow: hidden;
}

.quick-upload-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.quick-upload-button span {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 820;
}

.quick-media-card {
  width: min(100%, 620px);
  display: grid;
  grid-template-columns: minmax(90px, 140px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}

.quick-media-card img,
.quick-media-card video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: #101827;
}

.quick-media-card strong,
.quick-media-card span {
  display: block;
  min-width: 0;
}

.quick-media-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.98rem;
}

.quick-media-card span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.38;
}

.quick-media-actions .quick-upload-button {
  min-width: 92px;
  min-height: 36px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
  box-shadow: none;
}

.quick-media-actions .quick-upload-button span {
  color: var(--ink);
  font-size: 0.84rem;
}

.quick-notes-field {
  gap: 8px;
}

.quick-notes-field span {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 850;
}

.quick-notes-field textarea {
  min-height: 156px;
  border-radius: 12px;
  border-color: #cfd8e6;
  padding: 15px;
  font-size: 1rem;
  line-height: 1.55;
}

.quick-intent-row {
  display: grid;
  gap: 8px;
}

.quick-intent-row > span,
.quick-caption-head span,
.quick-export-result > span,
.quick-basic-grid span,
.quick-caption-editor label span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 820;
}

.quick-intent-row > div {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.quick-intent-row button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #344054;
  padding: 0 12px;
  font-weight: 760;
}

.quick-intent-row button.is-active {
  border-color: color-mix(in srgb, var(--brand) 70%, var(--line));
  background: color-mix(in srgb, var(--brand) 10%, #fff);
  color: var(--brand);
}

.quick-cta-row {
  position: sticky;
  bottom: 12px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
}

.quick-cta-row .primary-button,
.quick-preview-actions .primary-button {
  min-height: 46px;
  padding: 0 18px;
  font-size: 0.98rem;
}

.quick-status {
  margin: 0;
  color: #475467;
  font-size: 0.86rem;
  font-weight: 740;
}

.quick-preview-stage {
  grid-template-columns: minmax(280px, 420px);
  align-items: start;
  justify-content: center;
}

.quick-preview-stage.is-customizing {
  grid-template-columns: minmax(280px, 380px) minmax(280px, 1fr);
  justify-content: stretch;
}

.quick-preview-main {
  display: grid;
  gap: 12px;
  justify-items: center;
}

.quick-ready-status {
  display: grid;
  gap: 3px;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 720;
  line-height: 1.35;
  text-align: center;
}

.quick-ready-status strong {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 880;
}

.quick-preview-frame-wrap {
  width: min(100%, 360px);
}

.quick-preview-frame-wrap .export-preview-frame {
  width: min(100%, 360px);
  border-radius: 18px;
}

.quick-preview-tip {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 720;
  line-height: 1.35;
  text-align: center;
}

.quick-text-style-bar {
  width: min(100%, 360px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255,255,255,0.78);
}

.quick-text-style-bar > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 820;
}

.quick-style-presets {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: #fff;
}

.quick-style-presets button {
  min-height: 28px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--soft);
  color: #344054;
  padding: 0 9px;
  font-size: 0.72rem;
  font-weight: 820;
}

.quick-style-presets button:hover,
.quick-style-presets button:focus-visible {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
  color: var(--brand);
}

.quick-style-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: #fff;
}

.quick-style-group button,
.quick-style-group input[type="color"] {
  min-height: 26px;
  width: 28px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #344054;
  font-size: 0.72rem;
  font-weight: 820;
  padding: 0;
}

.quick-style-group button.is-active {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
  background: color-mix(in srgb, var(--brand) 9%, #fff);
  color: var(--brand);
}

.quick-style-group .quick-align-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.quick-align-icon {
  width: 15px;
  display: grid;
  gap: 3px;
}

.quick-align-icon span {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.quick-align-icon span:nth-child(1),
.quick-align-icon span:nth-child(3) {
  width: 11px;
}

.quick-align-icon span:nth-child(2) {
  width: 15px;
}

.quick-align-icon-left span {
  justify-self: start;
}

.quick-align-icon-center span {
  justify-self: center;
}

.quick-color-swatch {
  position: relative;
}

.quick-color-swatch::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 999px;
  background: var(--swatch);
  border: 1px solid rgba(16,24,40,0.2);
}

.quick-style-group input[type="color"] {
  overflow: hidden;
}

.quick-caption-compact {
  width: min(100%, 360px);
  display: grid;
  place-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255,255,255,0.82);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 760;
}

.quick-caption-compact span {
  min-width: 0;
  text-align: center;
}

.quick-caption-summary,
.quick-caption-chips-panel,
.quick-customize-panel,
.quick-export-result {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel-warm);
}

.export-result-card {
  grid-template-columns: minmax(160px, 240px) minmax(0, 1fr);
  align-items: center;
  padding: 10px;
}

.export-result-video {
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 340px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: #111827;
  object-fit: cover;
}

.export-result-body {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.export-result-body > span,
.quick-caption-head,
.quick-customize-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.quick-caption-head > div {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.quick-caption-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.quick-caption-chips label {
  min-width: min(100%, 190px);
  flex: 1 1 190px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border: 1px solid color-mix(in srgb, var(--brand) 26%, var(--line-soft));
  border-radius: 999px;
  background: #fff;
}

.quick-caption-chips label span {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 10%, #fff);
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 850;
}

.quick-caption-chips input {
  min-height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 740;
}

.quick-caption-chips input:focus {
  box-shadow: none;
}

.export-result-body > span {
  color: var(--ink);
  font-weight: 840;
}

.export-result-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.export-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.quick-caption-summary li {
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: #fff;
  color: #263244;
  line-height: 1.42;
}

.quick-caption-summary li button {
  width: 100%;
  min-height: 0;
  padding: 9px 10px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  line-height: inherit;
}

.quick-caption-summary li button:hover,
.quick-caption-summary li button:focus-visible {
  color: var(--brand);
}

.quick-caption-summary li.is-active {
  border-color: color-mix(in srgb, var(--brand) 46%, var(--line-soft));
  background: color-mix(in srgb, var(--brand) 7%, #fff);
  box-shadow: inset 3px 0 0 var(--brand);
}

.quick-caption-summary li.is-active button {
  color: var(--ink);
  font-weight: 760;
}

.quick-caption-summary p,
.quick-customize-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.quick-customize-panel {
  grid-column: auto;
  grid-row: 1;
}

.quick-customize-head h2 {
  margin-bottom: 3px;
}

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

.quick-caption-editor {
  display: grid;
  gap: 8px;
}

.quick-caption-editor label {
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
}

.quick-caption-editor input {
  min-height: 36px;
}

.quick-export-result small,
.export-result-body small {
  color: var(--muted);
  font-size: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.quick-mode .mobile-tabs,
body.quick-mode .mobile-action-bar {
  display: none;
}

body.quick-mode .top-project-select,
body.quick-mode .mode-badge,
body.quick-mode .brand-mark small {
  display: none;
}

body.quick-mode .advanced-menu-item {
  display: none;
}

body.advanced-mode .quick-menu-item {
  display: none;
}

body.quick-mode .app-topbar {
  grid-template-columns: minmax(0, 1fr) auto;
}

.workbench-panel {
  min-height: 0;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.source-panel,
.drafts-panel {
  padding: 14px;
}

.source-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.drafts-panel {
  display: grid;
  grid-template-rows: auto auto;
  align-content: start;
}

.drafts-panel:not(.has-drafts) {
  align-self: start;
}

.drafts-panel.has-drafts {
  align-self: start;
}

.history-panel {
  display: none;
}

.section-head,
.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.source-head p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.38;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--brand);
  font-size: 0.7rem;
  text-transform: none;
  font-weight: 820;
}

.project-meta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.brand-preview {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: none;
  display: inline-block;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent);
}

.badge {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: #f2f5fb;
  color: #475467;
  border: 1px solid var(--line-soft);
  font-size: 0.74rem;
  font-weight: 720;
  white-space: nowrap;
}

.small-button,
.primary-button,
.secondary-button,
.ghost-button,
.icon-button {
  min-height: 36px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  padding: 0 13px;
  font-weight: 780;
}

.primary-button {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 1px 0 color-mix(in srgb, #fff 22%, transparent) inset;
}

.secondary-button,
.small-button {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

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

.icon-button {
  background: #111827;
  color: #fff;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.field-label,
label {
  display: grid;
  gap: 6px;
}

.entry-form,
.project-form {
  display: grid;
  gap: 10px;
}

.control-row {
  display: grid;
  grid-template-columns: minmax(120px, 150px) minmax(160px, 220px) auto;
  gap: 8px;
  align-items: end;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.control-row label span {
  font-size: 0.7rem;
}

.control-row select {
  min-height: 32px;
  padding: 6px 9px;
}

.checkbox-field {
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--brand) 20%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 5%, #fff);
}

.checkbox-field input {
  width: 15px;
  min-height: 15px;
  padding: 0;
}

.quick-capture span {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 820;
}

.quick-capture textarea {
  min-height: 220px;
  height: 244px;
  max-height: 360px;
  border-color: #cfd8e6;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  padding: 16px;
  font-size: 1rem;
  line-height: 1.58;
  overflow: auto;
  box-shadow: inset 0 1px 2px rgba(16, 24, 40, 0.04);
}

.quick-capture textarea::placeholder {
  color: #98a2b3;
}

.example-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: -4px;
}

.example-chips button {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #475467;
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 720;
}

.example-chips button:hover {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
  color: var(--brand);
}

.structured-details,
.media-details {
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: var(--panel-warm);
  padding: 9px 10px;
}

.structured-details summary,
.media-details summary {
  color: #344054;
  font-size: 0.86rem;
  font-weight: 780;
}

.structured-details[open] summary,
.media-details[open] summary {
  margin-bottom: 10px;
}

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

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

.media-row input {
  padding: 7px;
}

.media-source {
  display: grid;
  gap: 10px;
}

.media-preview {
  min-height: 38px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
}

.media-preview img {
  width: 92px;
  height: 58px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line-soft);
}

.media-preview video {
  width: 160px;
  max-height: 92px;
  border-radius: 8px;
  border: 1px solid var(--line-soft);
  background: #111827;
}

.media-analysis-status {
  min-height: 18px;
  color: var(--muted);
  font-size: 0.8rem;
}

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

.source-actions {
  position: sticky;
  bottom: -14px;
  margin: 0 -14px -14px;
  padding: 10px 14px;
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
}

.draft-grid {
  min-height: 0;
  display: grid;
  gap: 10px;
}

.draft-card {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: #fff;
}

.draft-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 11px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--panel-warm);
}

.draft-header p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 680;
}

.draft-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.draft-actions select {
  width: 138px;
  min-height: 34px;
  padding: 6px 9px;
}

.draft-actions select[data-remix-select] {
  width: 112px;
}

pre {
  margin: 0;
  min-height: 148px;
  max-height: min(430px, calc(100vh - 238px));
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 16px;
  color: #1d2738;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.62;
}

.video-export-panel {
  display: grid;
  gap: 12px;
  padding: 11px;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: var(--panel-warm);
}

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

.video-export-panel h3 {
  margin: 0;
}

.video-export-status {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 720;
}

.video-export-meta {
  margin: 3px 0 0;
  color: #667085;
  font-size: 0.78rem;
  font-weight: 720;
}

.video-export-summary {
  margin: -3px 0 0;
  color: #475467;
  font-size: 0.76rem;
  font-weight: 760;
  line-height: 1.35;
}

.render-readiness-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, auto);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: #fff;
}

.render-readiness-card span {
  display: block;
  color: #344054;
  font-size: 0.82rem;
  font-weight: 860;
}

.render-readiness-card p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.36;
}

.render-readiness-card ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #475467;
  font-size: 0.72rem;
  font-weight: 760;
  line-height: 1.3;
}

.render-readiness-card li {
  position: relative;
  padding-left: 12px;
}

.render-readiness-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.52em;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--muted);
}

.render-readiness-card.is-ready {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line-soft));
  background: color-mix(in srgb, var(--accent) 5%, #fff);
}

.render-readiness-card.is-ready li::before {
  background: var(--accent);
}

.render-readiness-card.is-checking {
  border-color: color-mix(in srgb, var(--brand) 22%, var(--line-soft));
  background: color-mix(in srgb, var(--brand) 4%, #fff);
}

.render-readiness-card.is-checking li::before {
  background: var(--brand);
}

.render-readiness-card.is-blocked {
  border-color: color-mix(in srgb, var(--warning) 34%, var(--line-soft));
  background: color-mix(in srgb, var(--warning) 5%, #fff);
}

.render-readiness-card.is-blocked li::before {
  background: var(--warning);
}

.render-progress-slot {
  width: 100%;
}

.render-progress-card {
  display: grid;
  gap: 7px;
  width: 100%;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--line-soft));
  border-radius: 11px;
  background: color-mix(in srgb, var(--brand) 5%, #fff);
}

.quick-preview-main .render-progress-card {
  width: min(100%, 360px);
}

.render-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #344054;
  font-size: 0.8rem;
  font-weight: 820;
}

.render-progress-head strong {
  color: var(--brand);
  font-size: 0.78rem;
}

.render-progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5eaf3;
}

.render-progress-track span {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--accent) 82%, var(--brand)));
  transition: width 180ms ease;
}

.render-progress-card small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 720;
}

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

.export-preview {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(180px, 1fr);
  align-items: center;
  gap: 12px;
  padding: 9px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: rgba(255,255,255,0.58);
}

.export-preview-frame {
  position: relative;
  width: min(100%, 240px);
  margin: 0 auto;
  overflow: hidden;
  border-radius: 12px;
  background: #0f172a;
  color: #fff;
  box-shadow: 0 15px 38px rgba(15, 23, 42, 0.18);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif;
}

.export-preview-frame.preview-vertical {
  aspect-ratio: 9 / 16;
}

.export-preview-frame.preview-square {
  aspect-ratio: 1;
}

.export-preview-frame.preview-landscape {
  aspect-ratio: 16 / 9;
  width: min(100%, 260px);
}

.export-preview-media-bg {
  position: absolute;
  inset: -8%;
  width: 116%;
  height: 116%;
  object-fit: cover;
  filter: blur(var(--preview-blur)) saturate(1.08);
  opacity: 0.72;
}

.export-preview-media-shell {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 8%;
  background: rgba(15, 23, 42, 0.18);
}

.export-preview-frame.fit-contain .export-preview-media-shell {
  background: #0f172a;
}

.export-preview-frame.fit-cover .export-preview-media-shell {
  padding: 0;
}

.export-preview-media-main {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--preview-radius);
  transform: translate(var(--preview-media-x), var(--preview-media-y)) scale(var(--preview-media-scale));
  background: #0f172a;
  box-shadow: 0 12px 28px rgba(0,0,0,0.28);
}

.export-preview-frame.fit-cover .export-preview-media-main {
  object-fit: cover;
  border-radius: 0;
  box-shadow: none;
}

.export-preview-empty {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 14px;
  border: 1px dashed rgba(255,255,255,0.24);
  border-radius: var(--preview-radius);
  color: rgba(255,255,255,0.76);
  text-align: center;
  font-size: 0.72rem;
  font-weight: 760;
  line-height: 1.35;
}

.export-preview-dim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(15,23,42,0.44), rgba(15,23,42,0.08) 33%, rgba(15,23,42,0.2) 58%, rgba(15,23,42,0.64)),
    rgba(15,23,42,var(--preview-dim));
  pointer-events: none;
}

.export-preview-top,
.export-preview-footer {
  position: absolute;
  left: 8%;
  right: 8%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.56rem;
  font-weight: 820;
  z-index: 2;
}

.export-preview-top {
  top: 6%;
}

.export-preview-footer {
  bottom: 5%;
  color: rgba(255,255,255,0.78);
}

.export-preview-project,
.export-preview-badge {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 5px;
  max-width: 70%;
  padding: 5px 7px;
  border-radius: 999px;
  background: rgba(15,23,42,0.62);
  backdrop-filter: blur(8px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.export-preview-project i {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 2px;
  background: var(--preview-accent);
}

.export-preview-badge {
  max-width: 45%;
  background: rgba(255,255,255,0.16);
}

.export-preview-caption-wrap {
  position: absolute;
  left: 7%;
  right: 7%;
  z-index: 3;
  display: grid;
  justify-items: center;
  transform: translate(var(--preview-caption-x), var(--preview-caption-y));
}

.export-preview-caption-wrap.caption-top {
  top: 18%;
}

.export-preview-caption-wrap.caption-middle {
  top: 50%;
  transform: translate(var(--preview-caption-x), calc(-50% + var(--preview-caption-y)));
}

.export-preview-caption-wrap.caption-lower {
  bottom: 18%;
}

.export-preview-caption {
  position: relative;
  width: var(--preview-caption-width);
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(15,23,42,var(--preview-caption-opacity));
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: 0 14px 30px rgba(0,0,0,0.28);
  backdrop-filter: blur(10px);
  text-align: var(--preview-caption-align);
}

.export-preview-caption[data-preview-caption-card] {
  cursor: grab;
  outline: 2px solid color-mix(in srgb, var(--preview-accent) 52%, #fff 48%);
  outline-offset: 3px;
  box-shadow: 0 14px 30px rgba(0,0,0,0.28), 0 0 0 5px rgba(255,255,255,0.12);
}

.export-preview-frame.is-moving-caption .export-preview-caption[data-preview-caption-card] {
  cursor: grabbing;
  outline: 1px solid color-mix(in srgb, var(--preview-accent) 70%, #fff 30%);
}

.export-preview-caption-handle {
  position: absolute;
  right: 6px;
  top: -24px;
  min-height: 20px;
  width: auto;
  padding: 0 7px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 999px;
  background: rgba(15,23,42,0.72);
  color: rgba(255,255,255,0.84);
  font-size: 0.5rem;
  font-weight: 850;
  line-height: 1;
  cursor: grab;
}

.export-preview-caption-nav,
.export-preview-undo {
  position: absolute;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(15,23,42,0.74);
  color: rgba(255,255,255,0.88);
  box-shadow: 0 8px 20px rgba(0,0,0,0.22);
  backdrop-filter: blur(10px);
}

.export-preview-caption-nav {
  left: 6px;
  top: -24px;
  min-height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 0.5rem;
  font-weight: 850;
}

.export-preview-caption-nav button,
.export-preview-undo {
  min-height: 18px;
  width: auto;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 0.58rem;
  font-weight: 900;
  line-height: 1;
}

.export-preview-caption-nav button {
  padding: 0 3px;
}

.export-preview-caption-nav button:disabled {
  cursor: default;
  opacity: 0.38;
}

.export-preview-undo {
  right: 6%;
  top: 6%;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
}

.export-preview-undo:disabled {
  opacity: 0;
  pointer-events: none;
}

.export-preview-caption-handle:focus-visible,
.export-preview-caption-nav button:focus-visible,
.export-preview-undo:focus-visible,
.export-preview-caption span[contenteditable="plaintext-only"]:focus {
  outline: 2px solid color-mix(in srgb, var(--preview-accent) 72%, #fff 28%);
  outline-offset: 2px;
}

.export-preview-frame.box-none .export-preview-caption {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.export-preview-frame.box-glass .export-preview-caption {
  background: rgba(15,23,42,var(--preview-caption-opacity));
}

.export-preview-frame.box-solid .export-preview-caption {
  background: rgba(3,7,18,var(--preview-caption-opacity));
}

.export-preview-caption span {
  display: block;
  min-width: 1ch;
  color: var(--preview-caption-color);
  font-size: var(--preview-caption-font);
  line-height: 1.12;
  font-weight: var(--preview-caption-weight);
  text-shadow: 0 2px 8px rgba(0,0,0,0.34);
  cursor: text;
}

.export-preview-mark,
.export-preview-top-cta {
  color: var(--preview-accent);
}

.export-preview-top-cta {
  position: absolute;
  left: 8%;
  top: 13%;
  z-index: 3;
  font-size: 0.62rem;
  font-weight: 900;
}

.export-preview-safe {
  position: absolute;
  inset: 8%;
  z-index: 4;
  pointer-events: none;
  border: 1px dashed rgba(255,255,255,0.58);
  box-shadow: 0 0 0 999px rgba(255,255,255,0.035);
}

.preview-scrub {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 760;
}

.preview-scrub span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
}

.preview-scrub strong {
  color: var(--ink);
}

.export-customizer {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255,255,255,0.52);
}

.export-customizer summary {
  cursor: pointer;
  padding: 8px 10px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 820;
}

.export-preset-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 0 10px 8px;
}

.export-preset-row span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 820;
  text-transform: uppercase;
}

.export-preset-row .ghost-button {
  min-height: 28px;
  padding: 0 8px;
  font-size: 0.72rem;
}

.export-customizer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 8px;
  padding: 0 10px 10px;
}

.export-customizer fieldset {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: rgba(255,255,255,0.64);
}

.export-customizer legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 820;
}

.export-customizer label {
  display: grid;
  grid-template-columns: minmax(72px, auto) minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 700;
}

.export-customizer label:has(input[type="checkbox"]) {
  grid-template-columns: auto 1fr;
}

.export-customizer select,
.export-customizer input[type="file"] {
  min-width: 0;
  min-height: 30px;
  padding: 5px 7px;
  font-size: 0.78rem;
}

.export-customizer input[type="range"] {
  min-width: 0;
}

.export-advanced-layout {
  padding: 0 10px 10px;
}

.export-advanced-layout summary {
  padding: 7px 0;
}

.audio-asset-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 720;
}

.background-audio-preview {
  width: 100%;
  height: 32px;
}

.caption-editor {
  display: grid;
  gap: 7px;
  max-height: 270px;
  overflow: auto;
  padding-right: 2px;
}

.caption-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.caption-editor-head strong {
  font-size: 0.84rem;
}

.caption-editor-head div {
  display: flex;
  gap: 6px;
}

.caption-row {
  display: grid;
  grid-template-columns: 58px 72px 54px 54px minmax(160px, 1fr) auto;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}

.caption-row.is-cta {
  padding: 5px;
  border: 1px solid rgba(47, 125, 246, 0.18);
  border-radius: 8px;
  background: rgba(47, 125, 246, 0.05);
}

.caption-index {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 820;
  text-transform: uppercase;
}

.caption-source {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 820;
}

.caption-row input {
  min-height: 32px;
  padding: 6px 8px;
  font-size: 0.82rem;
}

.caption-row input[data-caption-text] {
  min-width: 0;
}

.caption-row-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

.caption-row-actions .ghost-button {
  min-height: 28px;
  padding: 0 7px;
  font-size: 0.7rem;
}

.media-remove-button {
  width: fit-content;
  min-height: 30px;
  padding: 0 10px;
  font-size: 0.78rem;
}

.video-template-select {
  display: grid;
  grid-template-columns: auto minmax(130px, 160px);
  align-items: center;
  gap: 7px;
}

.video-template-select.compact-video-field {
  grid-template-columns: auto minmax(72px, 92px);
}

.video-template-select span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 720;
}

.video-template-select select,
.video-template-select input {
  min-height: 34px;
  padding: 6px 9px;
}

.video-export-link {
  min-width: 92px;
}

.video-export-result-slot {
  margin-top: 10px;
}

.video-export-path {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 720;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  border: 1px dashed #c8d2e0;
  border-radius: 12px;
  background: var(--panel-warm);
  color: var(--muted);
  padding: 13px;
  line-height: 1.48;
  font-size: 0.88rem;
}

.empty-draft-preview {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background:
    linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}

.preview-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
}

.preview-flow article {
  display: grid;
  gap: 6px;
  align-content: start;
  min-height: 116px;
  padding: 11px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: #fff;
}

.preview-flow span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
}

.preview-flow p {
  margin: 0;
  color: #344054;
  font-size: 0.9rem;
  line-height: 1.48;
}

.flow-arrow {
  align-self: center;
  color: var(--brand);
  font-weight: 850;
}

.empty-steps {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  list-style: none;
}

.empty-steps li {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--soft);
  color: #475467;
  font-size: 0.78rem;
  font-weight: 760;
}

.copy-status {
  margin: 0;
  min-height: 20px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 760;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(2px);
}

.drawer-panel,
.history-panel.is-drawer-open {
  position: fixed;
  top: 52px;
  right: 0;
  bottom: 0;
  z-index: 60;
  width: min(420px, calc(100vw - 24px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: 16px;
  overflow: auto;
  background: #fff;
  border-left: 1px solid var(--line);
  border-radius: 0;
  box-shadow: var(--shadow);
  transform: translateX(102%);
  transition: transform 160ms ease;
}

.drawer-panel.is-drawer-open,
.history-panel.is-drawer-open {
  transform: translateX(0);
}

.drawer-panel {
  display: grid;
}

.settings-panel:not(.is-drawer-open) {
  pointer-events: none;
  visibility: hidden;
}

.history-panel:not(.is-drawer-open) {
  pointer-events: none;
}

.drawer-actions,
.settings-switcher {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
}

.settings-switcher {
  align-items: end;
  margin-bottom: 12px;
}

.settings-switcher .field-label {
  flex: 1;
}

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

.button-row {
  display: flex;
  gap: 8px;
}

.recent-exports-panel {
  display: grid;
  gap: 9px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.history-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.history-section-head h3 {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 820;
}

.history-section-head span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 760;
}

.saved-buildlogs-head {
  margin-top: 2px;
}

.recent-export-list {
  display: grid;
  gap: 8px;
}

.recent-export-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #fff;
}

.recent-export-card video {
  width: 74px;
  aspect-ratio: 9 / 16;
  border-radius: 8px;
  background: #111827;
  object-fit: cover;
}

.recent-export-card strong,
.recent-export-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-export-card strong {
  font-size: 0.84rem;
  font-weight: 820;
}

.recent-export-card span {
  color: var(--muted);
  font-size: 0.74rem;
}

.recent-export-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.clean-media-button {
  min-height: 34px;
  padding: 0 10px;
}

.clean-media-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 720;
}

.entry-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 7px;
  align-content: start;
}

.entry-card {
  width: 100%;
  min-height: 52px;
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.entry-card:hover,
.entry-card.is-active {
  border-color: color-mix(in srgb, var(--brand) 42%, var(--line));
  background: color-mix(in srgb, var(--brand) 5%, #fff);
}

.entry-card span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.86rem;
  font-weight: 760;
}

.entry-card small {
  color: var(--muted);
  font-size: 0.74rem;
}

.selected-entry {
  margin-top: 10px;
}

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

.source-grid {
  display: grid;
  gap: 7px;
}

.source-grid div {
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  padding: 8px;
  background: var(--panel-warm);
}

.source-grid p {
  margin: 4px 0 0;
  color: #344054;
  line-height: 1.44;
  font-size: 0.82rem;
}

.errors {
  display: grid;
  gap: 4px;
  color: var(--warning);
  font-size: 0.84rem;
  font-weight: 720;
}

.errors p {
  margin: 0;
}

.mobile-tabs,
.mobile-action-bar {
  display: none;
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .app-frame {
    min-height: 100vh;
    height: auto;
    grid-template-rows: 52px auto 1fr;
  }

  .app-topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 0 10px;
  }

  .brand-mark small,
  .mode-badge,
  .top-project-select {
    display: none;
  }

  .top-actions {
    gap: 6px;
  }

  .samples-menu summary {
    min-height: 38px;
    padding: 0 13px;
  }

  .samples-menu .menu-panel {
    position: fixed;
    top: 58px;
    right: 10px;
    min-width: min(280px, calc(100vw - 20px));
  }

  .samples-menu button {
    min-height: 40px;
  }

  .top-button {
    min-height: 32px;
    padding: 0 8px;
    font-size: 0.8rem;
  }

  .mobile-tabs {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
    padding: 8px;
    background: rgba(238, 243, 250, 0.92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
  }

  .mobile-tabs button {
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    color: #475467;
    font-weight: 780;
  }

  .mobile-tabs button.is-active {
    border-color: var(--brand);
    color: var(--brand);
  }

  .workbench {
    display: block;
    width: 100%;
    padding: 10px;
    overflow: visible;
  }

  .quick-panel {
    min-height: auto;
    padding: 10px;
  }

  .quick-caption-head,
  .quick-customize-head {
    display: grid;
  }

  .quick-upload-stage,
  .quick-compose-stage,
  .quick-preview-stage {
    padding: 14px;
    border-radius: 14px;
  }

  .quick-upload-stage {
    min-height: calc(100vh - 150px);
    gap: 12px;
  }

  .quick-upload-copy h2 {
    max-width: 320px;
    font-size: 1.28rem;
  }

  .quick-upload-copy p {
    max-width: 310px;
    font-size: 0.93rem;
  }

  .quick-start-steps {
    grid-template-columns: 1fr;
    width: min(100%, 310px);
    gap: 7px;
  }

  .quick-start-steps li {
    grid-template-columns: 28px minmax(0, 1fr);
    justify-items: start;
    text-align: left;
    padding: 9px 10px;
  }

  .quick-start-steps span {
    grid-row: span 2;
  }

  .quick-start-steps small {
    grid-column: 2;
  }

  .quick-media-card {
    grid-template-columns: 82px minmax(0, 1fr);
    width: 100%;
    gap: 9px;
  }

  .quick-media-card img,
  .quick-media-card video {
    max-height: 64px;
  }

  .quick-media-actions {
    grid-column: 1 / -1;
    align-items: stretch;
  }

  .quick-media-actions .quick-upload-button,
  .quick-media-actions button {
    flex: 1;
  }

  .quick-cta-row,
  .quick-preview-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .quick-cta-row {
    bottom: 8px;
    padding: 8px;
    margin: 0 -8px -8px;
    border-top: 1px solid var(--line-soft);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
  }

  .quick-preview-actions {
    position: sticky;
    bottom: 8px;
    z-index: 4;
    padding: 8px;
    margin: 0 -8px -8px;
    border-top: 1px solid var(--line-soft);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
  }

  .quick-preview-stage,
  .quick-basic-grid {
    grid-template-columns: 1fr;
  }

  .quick-preview-stage.is-customizing {
    grid-template-columns: 1fr;
  }

  .quick-customize-panel {
    grid-row: auto;
  }

  .quick-preview-frame-wrap {
    width: min(100%, 300px);
  }

  .quick-preview-frame-wrap .export-preview-frame.preview-vertical {
    width: min(100%, clamp(210px, calc((100svh - 290px) * 9 / 16), 300px));
  }

  .quick-preview-tip {
    max-width: 280px;
    font-size: 0.8rem;
  }

  .quick-text-style-bar {
    width: min(100%, 320px);
    justify-content: flex-start;
  }

  .quick-style-group button,
  .quick-style-group input[type="color"] {
    min-height: 32px;
    width: 34px;
  }

  .quick-style-presets {
    width: 100%;
  }

  .quick-style-presets button {
    flex: 1;
    min-height: 34px;
  }

  .export-result-card {
    grid-template-columns: 1fr;
  }

  .export-result-video {
    max-height: min(62vh, 420px);
    object-fit: contain;
  }

  .export-preview-caption-handle {
    top: -32px;
    min-height: 28px;
    padding: 0 10px;
    font-size: 0.62rem;
  }

  .export-preview-caption-nav {
    top: -32px;
    min-height: 28px;
    padding: 0 7px;
    font-size: 0.62rem;
  }

  .export-preview-caption-nav button {
    min-height: 26px;
    padding: 0 6px;
    font-size: 0.75rem;
  }

  .export-preview-undo {
    min-height: 30px;
    padding: 0 10px;
    font-size: 0.66rem;
  }

  .source-panel,
  .drafts-panel,
  .history-panel {
    display: none;
    margin-bottom: 10px;
  }

  .source-panel.is-mobile-active,
  .drafts-panel.is-mobile-active,
  .history-panel.is-mobile-active {
    display: grid;
  }

  .history-panel.is-mobile-active {
    position: static;
    width: auto;
    transform: none;
    pointer-events: auto;
    visibility: visible;
    padding: 16px;
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    box-shadow: none;
  }

  .close-drawer {
    display: none;
  }

  .source-panel,
  .drafts-panel,
  .history-panel {
    overflow: visible;
  }

  .control-row,
  .structured-grid,
  .media-row,
  .media-context-grid {
    grid-template-columns: 1fr;
  }

  .quick-capture textarea {
    min-height: 220px;
    height: 240px;
    max-height: 340px;
  }

  .preview-flow,
  .empty-steps,
  .video-export-panel {
    grid-template-columns: 1fr;
  }

  .video-export-panel {
    display: grid;
  }

  .render-readiness-card {
    grid-template-columns: 1fr;
  }

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

  .export-preview {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .video-template-select {
    grid-template-columns: 1fr;
  }

  .caption-row {
    grid-template-columns: 46px 62px 48px 48px minmax(0, 1fr);
  }

  .caption-row-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .export-customizer-grid {
    grid-template-columns: 1fr;
  }

  .flow-arrow {
    justify-self: center;
    transform: rotate(90deg);
  }

  .draft-card {
    grid-template-rows: auto auto;
  }

  .draft-header,
  .draft-actions {
    align-items: stretch;
  }

  .draft-header {
    display: grid;
  }

  .draft-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 116px) auto;
  }

  .draft-actions select,
  .draft-actions select[data-remix-select] {
    width: 100%;
  }

  pre {
    min-height: 160px;
    max-height: none;
  }

  .source-actions {
    display: none;
  }

  .mobile-action-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--line);
    box-shadow: 0 -12px 28px rgba(16, 24, 40, 0.12);
    backdrop-filter: blur(10px);
  }

  body {
    padding-bottom: 74px;
  }

  body.quick-mode {
    padding-bottom: 0;
  }
}
