:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-soft: #eef2f4;
  --surface-strong: #101820;
  --ink: #101820;
  --muted: #687481;
  --line: #dde3ea;
  --line-strong: #c6d0da;
  --primary: #0f766e;
  --primary-strong: #0b5d56;
  --accent: #c2410c;
  --accent-soft: #fff1e8;
  --teal-soft: #e7f7f4;
  --gold: #b7791f;
  --danger: #b42318;
  --shadow: 0 20px 50px rgba(16, 24, 32, 0.08);
  --radius: 8px;
  --sidebar-width: 292px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #10151b;
  --surface: #17202a;
  --surface-soft: #202b36;
  --surface-strong: #f4f7f9;
  --ink: #f4f7f9;
  --muted: #a6b1bc;
  --line: #2d3a47;
  --line-strong: #415160;
  --primary: #35b8a8;
  --primary-strong: #8fe0d6;
  --accent: #f08a4b;
  --accent-soft: #35251c;
  --teal-soft: #17332f;
  --gold: #e8b75e;
  --danger: #ff8a80;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 14% 18%, rgba(15, 118, 110, 0.07), transparent 28rem),
    linear-gradient(135deg, var(--bg), #eef3f7 52%, var(--bg));
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

body[data-theme="dark"] {
  background:
    radial-gradient(circle at 14% 18%, rgba(53, 184, 168, 0.08), transparent 28rem),
    linear-gradient(135deg, var(--bg), #131b22 52%, var(--bg));
}

[hidden] {
  display: none !important;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.82);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(16px);
  overflow-y: auto;
  z-index: 20;
}

[data-theme="dark"] .sidebar {
  background: rgba(23, 32, 42, 0.86);
}

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

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: var(--surface-strong);
  color: var(--surface);
  border-radius: var(--radius);
  flex: 0 0 auto;
}

.brand-mark svg,
.icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.brand p,
.brand span,
.eyebrow,
.panel-title span,
.usage-card p,
.status-strip span,
.field span,
.slider-block span,
.preview-footer,
.output-grid span,
.recent-list small,
.voice-summary span,
#voiceNote,
#renderHint {
  margin: 0;
}

.brand p {
  font-size: 1rem;
  font-weight: 800;
}

.brand span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 650;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.sidebar-tool-link {
  display: none;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-weight: 760;
  text-align: left;
}

.nav-item:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.nav-item.is-active {
  background: var(--teal-soft);
  border-color: rgba(15, 118, 110, 0.25);
  color: var(--primary-strong);
}

.icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.icon.large {
  width: 42px;
  height: 42px;
}

.usage-card,
.recent-panel,
.panel,
.status-strip {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.usage-card {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.usage-card div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.usage-card p,
.status-strip span,
.field span,
.slider-block span,
.output-grid span,
.recent-list small,
.voice-summary span,
#voiceNote,
.preview-footer,
#renderHint {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.usage-card strong {
  color: var(--primary-strong);
  font-size: 0.95rem;
}

.meter,
.progress-track {
  height: 8px;
  border-radius: 99px;
  background: var(--surface-soft);
  overflow: hidden;
}

.meter span,
.progress-track span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: inherit;
  transition: width 260ms ease;
}

.recent-panel {
  padding: 14px;
  flex: 1 1 auto;
  min-height: 180px;
}

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

.panel-title span,
.eyebrow {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

.recent-list li {
  padding: 10px;
  background: var(--surface-soft);
  border-radius: var(--radius);
  display: grid;
  gap: 2px;
}

.recent-list strong {
  font-size: 0.84rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.4rem);
  line-height: 1.05;
}

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

.menu-button {
  display: none;
}

.icon-button,
.primary,
.secondary,
.render-button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.icon-button {
  width: 42px;
  padding: 0;
  background: var(--surface);
  color: var(--ink);
}

.icon-button:hover,
.secondary:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.primary,
.secondary {
  padding: 0 16px;
  font-weight: 850;
}

.primary {
  color: #ffffff;
  background: var(--primary);
  border-color: var(--primary);
}

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

.primary.small {
  min-height: 42px;
}

.secondary {
  color: var(--ink);
  background: var(--surface);
}

.secondary.tiny {
  min-height: 34px;
  padding: 0 11px;
  font-size: 0.75rem;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-bottom: 20px;
  padding: 0;
}

.status-strip div {
  min-height: 74px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 14px 16px;
  background: var(--surface);
}

.status-strip strong {
  font-size: 1rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.studio-grid {
  display: grid;
  grid-template-columns: minmax(340px, 0.94fr) minmax(420px, 1.06fr);
  gap: 20px;
  align-items: start;
}

.preview-column,
.controls-column {
  display: grid;
  gap: 20px;
}

.panel {
  padding: 18px;
}

.preview-panel {
  overflow: hidden;
}

.segmented {
  display: flex;
  align-items: center;
  padding: 3px;
  background: var(--surface-soft);
  border-radius: var(--radius);
  gap: 2px;
}

.segment {
  min-width: 48px;
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 850;
}

.segment.is-selected {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 2px 10px rgba(16, 24, 32, 0.08);
}

.device-frame {
  position: relative;
  width: min(100%, 420px);
  margin: 0 auto;
  background: #0b1015;
  border: 1px solid #1e2b34;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 22px 50px rgba(16, 24, 32, 0.2);
  transition: aspect-ratio 180ms ease, max-width 180ms ease;
}

.device-frame.ratio-9-16 {
  max-width: 310px;
  aspect-ratio: 9 / 16;
}

.device-frame.ratio-16-9 {
  max-width: 680px;
  aspect-ratio: 16 / 9;
}

.device-frame.ratio-1-1 {
  max-width: 430px;
  aspect-ratio: 1 / 1;
}

.device-frame.ratio-4-3 {
  max-width: 540px;
  aspect-ratio: 4 / 3;
}

#videoPreview {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #070b0f;
  display: none;
}

.poster {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #dbe9ef;
}

.poster-grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(135deg, rgba(15, 118, 110, 0.45), rgba(194, 65, 12, 0.18) 48%, rgba(16, 24, 32, 0.15));
  background-size: 38px 38px, 38px 38px, 100% 100%;
}

.poster-card {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 20px;
  text-align: center;
}

.poster-card p {
  margin: 0;
  font-weight: 850;
}

.timeline-bars {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 18px;
  display: grid;
  grid-template-columns: 1.2fr 0.7fr 1fr 0.45fr;
  gap: 7px;
  z-index: 1;
}

.timeline-bars span {
  height: 7px;
  background: rgba(255, 255, 255, 0.62);
  border-radius: 99px;
}

.logo-preview {
  position: absolute;
  width: 58px;
  height: 58px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 6px;
  padding: 6px;
  display: none;
  z-index: 3;
}

.logo-top-right {
  top: 14px;
  right: 14px;
}

.logo-top-left {
  top: 14px;
  left: 14px;
}

.logo-bottom-right {
  right: 14px;
  bottom: 14px;
}

.logo-bottom-left {
  left: 14px;
  bottom: 14px;
}

.blur-mask {
  position: absolute;
  left: 50%;
  right: auto;
  top: 48%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 13%;
  display: grid;
  place-items: center;
  z-index: 2;
  color: #ffffff;
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(15, 118, 110, 0.42);
  backdrop-filter: blur(9px);
  border-block: 1px solid rgba(255, 255, 255, 0.34);
}

.subtitle-overlay {
  position: absolute;
  left: 50%;
  z-index: 4;
  width: min(86%, 720px);
  transform: translateX(-50%);
  padding: 8px 12px;
  border-radius: 7px;
  background: rgba(7, 12, 18, 0.62);
  color: #ffffff;
  font-weight: 900;
  line-height: 1.18;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.78);
  overflow-wrap: anywhere;
  pointer-events: none;
}

.subtitle-top {
  top: 12%;
}

.subtitle-middle {
  top: 50%;
  transform: translate(-50%, -50%);
}

.subtitle-bottom {
  bottom: 12%;
}

.clip-overlay {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 72px;
  z-index: 5;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(242, 184, 75, 0.32);
  border-radius: var(--radius);
  background: rgba(11, 18, 24, 0.82);
  color: #ffffff;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
}

.clip-overlay-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.clip-overlay-head span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.clip-overlay-head strong {
  color: #f2b84b;
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.clip-overlay-track {
  position: relative;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  cursor: ew-resize;
  touch-action: none;
}

.clip-overlay-track::before {
  content: "";
  position: absolute;
  inset: 7px 0;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.28);
}

.clip-overlay-fill {
  position: absolute;
  top: 4px;
  bottom: 4px;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f7b67, #f2b84b);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.clip-overlay-handle {
  position: absolute;
  top: 50%;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: #0f7b67;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.34);
  transform: translate(-50%, -50%);
}

.clip-overlay-handle::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: inherit;
  background: #f2b84b;
}

.clip-overlay.is-dragging .clip-overlay-handle,
.clip-overlay-handle:focus-visible {
  outline: 0;
  box-shadow:
    0 0 0 4px rgba(242, 184, 75, 0.26),
    0 8px 18px rgba(0, 0, 0, 0.38);
}

.preview-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.clip-selector {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(245, 158, 11, 0.08));
  display: grid;
  gap: 10px;
}

.clip-selector[hidden] {
  display: none;
}

.clip-selector.is-disabled {
  opacity: 0.74;
}

.clip-selector-head,
.clip-time-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.clip-selector-head span,
.clip-time-row span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.clip-selector-head strong {
  color: var(--primary-strong);
  font-size: 1rem;
}

.clip-selector input[type="range"] {
  width: 100%;
}

.result-panel {
  border-color: rgba(15, 118, 110, 0.32);
}

.result-header,
.result-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.result-header h2 {
  margin: 4px 0 0;
}

.result-panel p:not(.eyebrow) {
  margin: 10px 0 18px;
  color: var(--muted);
}

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

.setup-upload-grid {
  grid-template-columns: 1fr;
}

.setup-video-card {
  display: none;
}

.upload-card {
  min-height: 136px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 8px;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--ink);
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.upload-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-card strong {
  font-size: 0.95rem;
}

.upload-card small {
  width: 100%;
  color: var(--muted);
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-card:hover,
.upload-card.is-dragging {
  border-color: var(--primary);
  background: var(--teal-soft);
  transform: translateY(-1px);
}

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

.upload-card.soft:hover,
.upload-card.soft.is-dragging {
  border-color: var(--gold);
}

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

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

.field {
  display: grid;
  gap: 7px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--ink);
  outline: none;
}

.field textarea {
  min-height: 142px;
  padding: 12px;
  resize: vertical;
  line-height: 1.6;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
}

.voice-panel {
  display: grid;
  gap: 14px;
}

.voice-panel .panel-title {
  margin-bottom: 0;
}

.mini-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
}

.mini-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

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

.voice-summary div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--teal-soft);
  border: 1px solid rgba(15, 118, 110, 0.15);
}

.voice-summary strong {
  color: var(--primary-strong);
}

.speech-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(15, 123, 103, 0.2);
  border-radius: var(--radius);
  background: rgba(15, 123, 103, 0.07);
}

.speech-card div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.speech-card span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.speech-card strong {
  color: var(--primary-strong);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.speech-card button {
  flex: 0 0 auto;
}

.transcript-field textarea {
  min-height: 104px;
  font-size: 0.88rem;
}

.voice-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

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

.online-voice-player {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(15, 118, 110, 0.2);
  border-radius: var(--radius);
  background: rgba(15, 118, 110, 0.07);
}

.online-voice-player[hidden] {
  display: none;
}

.online-voice-player span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.online-voice-player audio {
  width: 100%;
}

#voiceNote {
  text-align: center;
}

.output-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.output-grid div {
  padding: 13px;
  border-radius: var(--radius);
  background: var(--surface-soft);
  display: grid;
  gap: 4px;
}

.output-grid strong {
  color: var(--primary-strong);
}

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

.settings-panel .panel-title {
  margin-bottom: 0;
}

.slider-block {
  display: grid;
  gap: 9px;
}

.slider-block div {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

input[type="range"] {
  accent-color: var(--primary);
}

.toggles {
  display: grid;
  gap: 8px;
}

.toggle-row {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.toggle-row span {
  display: grid;
  gap: 2px;
}

.toggle-row strong {
  font-size: 0.9rem;
}

.toggle-row small {
  color: var(--muted);
  font-weight: 650;
}

.toggle-row input,
.effect-chip input {
  width: 19px;
  height: 19px;
  accent-color: var(--primary);
  flex: 0 0 auto;
}

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

.effect-chip {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  font-weight: 800;
}

.editor-groups {
  display: grid;
  gap: 10px;
}

.editor-group {
  display: grid;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

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

.editor-group-title strong {
  font-size: 0.82rem;
}

.editor-group-title small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
}

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

.compact-grid .field {
  min-width: 0;
}

.render-card {
  position: static;
  display: grid;
  gap: 12px;
  padding: 14px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.topbar .menu-button {
  display: none;
}

.progress-wrap {
  display: grid;
  gap: 8px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.render-button {
  width: 100%;
  min-height: 58px;
  color: #ffffff;
  background: var(--surface-strong);
  border-color: var(--surface-strong);
  font-weight: 900;
  text-transform: uppercase;
}

.render-button:not(:disabled):hover {
  transform: translateY(-1px);
  background: var(--primary);
  border-color: var(--primary);
}

.render-button:disabled {
  color: rgba(255, 255, 255, 0.58);
  background: #87919c;
  border-color: #87919c;
}

#renderHint {
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translate(-50%, 20px);
  min-width: min(380px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--surface);
  box-shadow: var(--shadow);
  font-weight: 780;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
  z-index: 50;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.is-rendering .render-button {
  background: var(--primary);
  border-color: var(--primary);
}

.effect-bw #videoPreview,
.effect-bw .poster {
  filter: grayscale(1);
}

.effect-mirror #videoPreview,
.effect-mirror .poster {
  transform: scaleX(-1);
}

.effect-zoom #videoPreview,
.effect-zoom .poster-grid {
  animation: slowZoom 7s ease-in-out infinite alternate;
}

@keyframes slowZoom {
  from {
    scale: 1;
  }
  to {
    scale: 1.07;
  }
}

@media (max-width: 1180px) {
  .studio-grid {
    grid-template-columns: 1fr;
  }
  .device-frame.ratio-16-9,
  .device-frame.ratio-4-3 {
    max-width: 760px;
  }
}

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

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(var(--sidebar-width), calc(100vw - 48px));
    transform: translateX(-105%);
    transition: transform 200ms ease;
  }

  .app-shell[data-sidebar-open="true"] .sidebar {
    transform: translateX(0);
  }

  .workspace {
    padding: 16px;
  }

  .menu-button {
    display: inline-flex;
  }

  .topbar .menu-button {
    display: inline-flex;
  }

  .status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar-actions {
    margin-left: auto;
  }

  .primary.small {
    width: 42px;
    padding: 0;
    font-size: 0;
  }

  .primary.small .icon {
    margin: 0;
  }
}

@media (max-width: 620px) {
  .topbar {
    gap: 10px;
  }

  .topbar h1 {
    font-size: 1.45rem;
  }

  .status-strip {
    grid-template-columns: 1fr;
  }

  .upload-grid,
  .two-col,
  .voice-controls,
  .output-grid,
.voice-summary,
.voice-actions,
  .effect-grid {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 14px;
  }

  .panel-title {
    align-items: flex-start;
  }

  .segmented {
    width: 100%;
    justify-content: space-between;
  }

  .segment {
    min-width: 0;
    flex: 1;
  }

  .result-actions,
  .preview-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .clip-selector-head,
  .clip-time-row {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .speech-card button {
    width: 100%;
  }

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

/* StoryCut MM identity */
:root {
  --bg: #f3f7f2;
  --surface: #ffffff;
  --surface-soft: #edf3ef;
  --surface-strong: #14222c;
  --ink: #14222c;
  --muted: #62706d;
  --line: #d8e2dc;
  --line-strong: #b9c8c0;
  --primary: #0f7b67;
  --primary-strong: #075f4f;
  --accent: #c55428;
  --accent-soft: #fff0e8;
  --teal-soft: #e3f5ee;
  --gold: #b98219;
  --shadow: 0 18px 40px rgba(20, 34, 44, 0.1);
}

body {
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(20, 34, 44, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 34, 44, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
}

.sidebar {
  background: #14222c;
  color: #f6fbf7;
  border-right: 0;
  box-shadow: 12px 0 38px rgba(20, 34, 44, 0.18);
}

.brand-mark {
  background: #f2b84b;
  color: #14222c;
}

.brand p {
  color: #ffffff;
}

.brand span,
.sidebar .panel-title span,
.sidebar .usage-card p,
.sidebar .recent-list small {
  color: rgba(246, 251, 247, 0.68);
}

.nav-item {
  color: rgba(246, 251, 247, 0.68);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.nav-item.is-active {
  background: #e7f7ef;
  border-color: #e7f7ef;
  color: #075f4f;
}

.sidebar .usage-card,
.sidebar .recent-panel {
  background: #1c303c;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.sidebar .recent-list li {
  background: rgba(255, 255, 255, 0.08);
}

.sidebar .recent-list strong,
.sidebar .usage-card strong {
  color: #f2b84b;
}

.topbar {
  min-height: 86px;
  padding: 18px;
  background: #14222c;
  color: #ffffff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.topbar h1 {
  color: #ffffff;
}

.topbar .eyebrow {
  color: #8bd9c5;
}

.topbar .icon-button {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.topbar .primary {
  background: #f2b84b;
  border-color: #f2b84b;
  color: #14222c;
}

.status-strip {
  display: grid;
  gap: 10px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.status-strip div {
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
}

.status-strip div:nth-child(2) {
  border-left-color: var(--accent);
}

.status-strip div:nth-child(3) {
  border-left-color: var(--gold);
}

.status-strip div:nth-child(4) {
  border-left-color: #2f6f9f;
}

.panel {
  border-color: rgba(20, 34, 44, 0.12);
}

.preview-panel {
  border-top: 5px solid #14222c;
}

.device-frame {
  border: 4px solid #14222c;
  box-shadow: 0 20px 44px rgba(20, 34, 44, 0.22);
}

.segmented {
  background: #e5ece8;
}

.segment.is-selected {
  background: #14222c;
  color: #ffffff;
}

.upload-card {
  background: #f7faf8;
}

.upload-card.accent {
  background: #fff8f4;
}

.upload-card.soft {
  background: #fffbed;
}

.voice-panel {
  border-color: rgba(15, 123, 103, 0.34);
  background:
    linear-gradient(180deg, rgba(227, 245, 238, 0.72), rgba(255, 255, 255, 0.96) 38%),
    #ffffff;
}

.voice-summary div {
  background: #edf8f2;
}

.voice-summary div:nth-child(2) {
  background: #fff5ea;
  border-color: rgba(197, 84, 40, 0.18);
}

.voice-summary div:nth-child(3) {
  background: #eef4fb;
  border-color: rgba(47, 111, 159, 0.18);
}

.render-card {
  background: #14222c;
  border-color: #14222c;
  color: #ffffff;
}

.render-card #renderHint,
.render-card .progress-header {
  color: rgba(255, 255, 255, 0.72);
}

.render-button {
  background: #f2b84b;
  border-color: #f2b84b;
  color: #14222c;
}

.render-button:not(:disabled):hover {
  background: #0f7b67;
  border-color: #0f7b67;
  color: #ffffff;
}

.render-button:disabled {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] body,
body[data-theme="dark"] {
  background-color: #101820;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
}

[data-theme="dark"] .topbar,
[data-theme="dark"] .sidebar,
[data-theme="dark"] .render-card {
  background: #0c141b;
}

@media (max-width: 620px) {
  .voice-summary {
    grid-template-columns: 1fr;
  }

  .topbar {
    min-height: 74px;
    padding: 14px;
  }
}

/* Cinematic recap studio upgrade */
:root {
  --bg: #eef3f1;
  --surface: #fbfcfb;
  --surface-soft: #edf2f0;
  --surface-strong: #12171d;
  --ink: #12171d;
  --muted: #65706d;
  --line: #d7dfda;
  --line-strong: #aebbb4;
  --primary: #087f6b;
  --primary-strong: #075f51;
  --accent: #d24f25;
  --accent-soft: #fff0e8;
  --gold: #d49a21;
  --teal-soft: #e0f4ed;
  --shadow: 0 18px 44px rgba(18, 23, 29, 0.12);
}

body {
  background:
    linear-gradient(rgba(18, 23, 29, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 23, 29, 0.035) 1px, transparent 1px),
    linear-gradient(135deg, #eef3f1 0%, #f8faf7 46%, #edf2f6 100%);
  background-size: 30px 30px, 30px 30px, 100% 100%;
}

[data-theme="dark"] body,
body[data-theme="dark"] {
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(135deg, #0f151b 0%, #111c20 48%, #15171c 100%);
}

.topbar {
  position: relative;
  overflow: hidden;
  min-height: 104px;
  background:
    linear-gradient(115deg, rgba(18, 23, 29, 0.98), rgba(14, 48, 47, 0.96) 58%, rgba(82, 30, 22, 0.94));
}

.topbar::after {
  content: "";
  position: absolute;
  inset: auto 18px 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--gold), var(--accent));
}

.topbar > * {
  position: relative;
  z-index: 1;
}

.topbar h1 {
  font-size: clamp(1.7rem, 3.4vw, 3rem);
}

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

.workflow-step {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(251, 252, 251, 0.84);
  box-shadow: 0 10px 24px rgba(18, 23, 29, 0.06);
}

.workflow-step strong {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-strong);
  color: #ffffff;
  font-size: 0.82rem;
}

.workflow-step span {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 850;
}

.workflow-step.is-active {
  border-color: rgba(8, 127, 107, 0.42);
  background: linear-gradient(135deg, #e1f5ee, #fff7ea);
}

.studio-grid {
  grid-template-columns: minmax(420px, 1.12fr) minmax(380px, 0.88fr);
}

.preview-panel {
  background:
    linear-gradient(180deg, rgba(18, 23, 29, 0.035), rgba(255, 255, 255, 0) 32%),
    var(--surface);
}

.device-frame {
  width: min(100%, 520px);
  border: 6px solid #111820;
  background: #05080b;
}

.device-frame.ratio-9-16 {
  max-width: 360px;
}

.device-frame.ratio-16-9 {
  max-width: 820px;
}

.poster-grid {
  background:
    linear-gradient(rgba(255, 255, 255, 0.065) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.065) 1px, transparent 1px),
    linear-gradient(145deg, rgba(8, 127, 107, 0.55), rgba(210, 79, 37, 0.28) 54%, rgba(7, 11, 15, 0.58));
  background-size: 34px 34px, 34px 34px, 100% 100%;
}

.poster-card {
  max-width: 260px;
}

.poster-card small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  font-weight: 720;
  line-height: 1.45;
}

.poster-upload-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
  padding: 0 18px;
  border: 1px solid #f2b84b;
  border-radius: var(--radius);
  background: #f2b84b;
  color: #111820;
  font-size: 0.84rem;
  font-weight: 900;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.poster-upload-button:hover {
  transform: translateY(-1px);
  background: #ffffff;
  border-color: #ffffff;
}

.upload-card {
  min-height: 122px;
}

.voice-panel {
  border-top: 5px solid var(--primary);
}

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

.script-map span {
  min-height: 34px;
  display: grid;
  place-items: center;
  padding: 0 8px;
  border: 1px solid rgba(8, 127, 107, 0.18);
  border-radius: var(--radius);
  background: #eef8f4;
  color: var(--primary-strong);
  font-size: 0.72rem;
  font-weight: 880;
  text-align: center;
}

.script-map button {
  min-height: 34px;
  display: grid;
  place-items: center;
  padding: 0 8px;
  border: 1px solid rgba(8, 127, 107, 0.18);
  border-radius: var(--radius);
  background: #eef8f4;
  color: var(--primary-strong);
  font-size: 0.72rem;
  font-weight: 880;
  text-align: center;
  cursor: pointer;
}

.script-map button:hover,
.script-map button:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.export-panel {
  display: grid;
  gap: 13px;
  background:
    linear-gradient(135deg, rgba(18, 23, 29, 0.96), rgba(20, 45, 45, 0.96));
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.08);
}

.export-panel .panel-title {
  margin-bottom: 0;
}

.export-panel .panel-title span,
.export-panel #renderHint,
.export-panel .progress-header {
  color: rgba(255, 255, 255, 0.72);
}

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

.export-target {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.82);
  font-weight: 850;
}

.export-target.is-selected {
  background: #f2b84b;
  border-color: #f2b84b;
  color: #111820;
}

.export-panel .render-button {
  min-height: 56px;
  background: #f2b84b;
  border-color: #f2b84b;
  color: #111820;
}

.export-panel .render-button:not(:disabled):hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.export-panel .secondary.tiny {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.export-panel .progress-track {
  background: rgba(255, 255, 255, 0.14);
}

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

@media (max-width: 620px) {
  .workflow-strip,
  .script-map,
  .export-targets {
    grid-template-columns: 1fr;
  }

  .topbar {
    min-height: 88px;
  }
}

/* Reference editor layout */
:root {
  --editor-bg: #070c13;
  --editor-panel: #111923;
  --editor-panel-soft: #172231;
  --editor-line: rgba(122, 146, 172, 0.22);
  --editor-text: #e9f2ff;
  --editor-muted: #8ea0b5;
  --editor-blue: #2e8cff;
  --editor-gold: #bf8d28;
}

body {
  background:
    linear-gradient(135deg, rgba(33, 119, 255, 0.08), transparent 34%),
    radial-gradient(circle at 72% 10%, rgba(50, 119, 255, 0.18), transparent 26rem),
    var(--editor-bg);
  color: var(--editor-text);
}

.app-shell {
  grid-template-columns: 104px minmax(0, 1fr);
}

.sidebar {
  padding: 18px 10px;
  gap: 16px;
  background: #0b121b;
  border-right: 1px solid var(--editor-line);
  box-shadow: none;
}

.brand {
  gap: 7px;
  min-height: 36px;
}

.brand-mark {
  width: 22px;
  height: 22px;
  background: transparent;
  color: #f2c15d;
  border: 1px solid rgba(242, 193, 93, 0.6);
}

.brand p {
  font-size: 0.78rem;
}

.brand span,
.usage-card,
.recent-panel {
  display: none;
}

.nav-list {
  gap: 3px;
}

.nav-item {
  min-height: 28px;
  gap: 7px;
  padding: 0 2px;
  border-radius: 4px;
  color: #a9b9ca;
  font-size: 0.67rem;
  font-weight: 650;
}

.nav-item .icon {
  width: 13px;
  height: 13px;
}

.nav-item.is-active {
  background: rgba(46, 140, 255, 0.13);
  border-color: rgba(46, 140, 255, 0.28);
  color: #ffffff;
}

.workspace {
  padding: 22px 18px 18px;
}

.topbar {
  min-height: 54px;
  padding: 0;
  margin-bottom: 10px;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}

.topbar::after {
  display: none;
}

.topbar h1 {
  margin-bottom: 4px;
  color: var(--editor-text);
  font-size: 1.05rem;
  line-height: 1.1;
}

.topbar .eyebrow {
  display: none;
}

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--editor-muted);
  font-size: 0.62rem;
  font-weight: 700;
}

.breadcrumb span::after {
  content: ">";
  margin-left: 6px;
  color: #516274;
}

.breadcrumb strong {
  color: #ffffff;
}

.topbar-actions {
  align-self: flex-start;
}

.topbar .icon-button {
  width: 30px;
  min-height: 30px;
  background: var(--editor-panel);
  border-color: var(--editor-line);
  color: #b6c7da;
}

.topbar .primary.small {
  min-height: 30px;
  padding: 0 11px;
  background: #1d83ff;
  border-color: #1d83ff;
  color: #ffffff;
  font-size: 0.7rem;
}

.workflow-strip,
.status-strip {
  display: none;
}

.studio-grid {
  grid-template-columns: minmax(560px, 1fr) minmax(400px, 420px);
  gap: 10px;
  align-items: start;
}

.preview-column,
.controls-column {
  gap: 10px;
}

.media-dropbar {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px dashed rgba(92, 119, 148, 0.42);
  border-radius: 7px;
  background: rgba(9, 16, 26, 0.72);
  color: #c8d6e7;
  font-size: 0.82rem;
  font-weight: 850;
}

.media-dropbar .icon {
  width: 28px;
  height: 28px;
  color: #91a1b4;
}

.media-dropbar label {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  background: var(--editor-blue);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

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

.quick-steps div {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--editor-line);
  border-radius: 7px;
  background: rgba(16, 25, 36, 0.72);
}

.quick-steps strong {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--editor-blue);
  color: #ffffff;
  font-size: 0.72rem;
}

.quick-steps span {
  color: #eaf3ff;
  font-size: 0.74rem;
  font-weight: 850;
}

.panel {
  padding: 10px;
  border-radius: 7px;
  background: rgba(16, 25, 36, 0.88);
  border-color: var(--editor-line);
  box-shadow: none;
}

.panel-title {
  min-height: 22px;
  margin-bottom: 9px;
  gap: 8px;
}

.panel-title span,
.eyebrow {
  color: #f0f5fb;
  font-size: 0.7rem;
  letter-spacing: 0;
  text-transform: none;
}

.panel-title::before {
  content: "";
  width: 10px;
  height: 10px;
  border: 1px solid #6f8398;
  border-radius: 50%;
}

.preview-panel {
  padding: 9px;
  border: 1px solid rgba(46, 140, 255, 0.56);
  background: rgba(11, 18, 29, 0.92);
  box-shadow:
    0 0 0 1px rgba(46, 140, 255, 0.22),
    0 0 22px rgba(46, 140, 255, 0.28);
}

.preview-panel .panel-title {
  display: none;
}

.device-frame {
  width: 100%;
  max-width: none;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 4px;
  background: #03070c;
  box-shadow: none;
}

.device-frame.ratio-9-16,
.device-frame.ratio-16-9,
.device-frame.ratio-1-1,
.device-frame.ratio-4-3 {
  max-width: none;
  aspect-ratio: 16 / 9;
}

.poster-grid {
  background:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(145deg, rgba(32, 94, 172, 0.64), rgba(8, 14, 24, 0.84));
  background-size: 28px 28px, 28px 28px, 100% 100%;
}

.poster-upload-button {
  min-height: 28px;
  padding: 0 12px;
  border-color: var(--editor-blue);
  background: var(--editor-blue);
  color: #ffffff;
  font-size: 0.68rem;
}

.preview-footer {
  margin-top: 8px;
  color: var(--editor-muted);
}

.clip-selector {
  margin-top: 8px;
  padding: 9px;
  border-color: var(--editor-line);
  background: #101927;
}

.controls-column {
  max-height: calc(100vh - 90px);
  overflow-y: auto;
  padding-right: 2px;
}

.upload-panel {
  order: 1;
}

.voice-panel {
  order: 2;
}

.sync-panel {
  order: 3;
}

.export-panel {
  order: 4;
}

.upload-panel .panel-title span {
  font-size: 0;
}

.upload-panel .panel-title span::after {
  content: "Project Setup";
  font-size: 0.7rem;
}

.upload-grid {
  grid-template-columns: 1fr;
  gap: 8px;
}

.upload-card {
  min-height: 50px;
  grid-template-columns: auto 1fr;
  align-content: center;
  justify-items: start;
  padding: 10px;
  border-style: solid;
  border-color: var(--editor-line);
  background: var(--editor-panel-soft);
}

.upload-card.accent,
.upload-card.soft {
  background: var(--editor-panel-soft);
}

.upload-card.accent:hover,
.upload-card.accent.is-dragging,
.upload-card.soft:hover,
.upload-card.soft.is-dragging {
  background: #1a2838;
}

.upload-card .icon {
  grid-row: span 2;
}

.upload-card strong {
  color: var(--editor-text);
  font-size: 0.72rem;
}

.upload-card small {
  color: var(--editor-muted);
  font-size: 0.64rem;
}

.voice-panel {
  border-top: 1px solid var(--editor-line);
  background: rgba(16, 25, 36, 0.88);
}

.voice-panel .panel-title span {
  font-size: 0;
}

.voice-panel .panel-title span::after {
  content: "AI Assistant";
  font-size: 0.7rem;
}

.voice-summary {
  grid-template-columns: 1fr 1fr 1fr;
}

.voice-summary div,
.output-grid div {
  padding: 8px;
  background: #0d1522;
  border: 1px solid var(--editor-line);
}

.voice-summary span,
.output-grid span,
#voiceNote,
#renderHint,
.field span {
  color: var(--editor-muted);
  font-size: 0.62rem;
}

.voice-summary strong,
.output-grid strong {
  color: #ffffff;
  font-size: 0.72rem;
}

.speech-card {
  padding: 9px;
  background: #0d1522;
  border-color: var(--editor-line);
}

.speech-card span {
  color: var(--editor-muted);
  font-size: 0.62rem;
  letter-spacing: 0;
  text-transform: none;
}

.speech-card strong {
  color: #ffffff;
  font-size: 0.7rem;
}

.field input,
.field select,
.field textarea {
  min-height: 34px;
  border-color: var(--editor-line);
  border-radius: 5px;
  background: #0c1420;
  color: #e8f1ff;
  font-size: 0.72rem;
}

.field textarea {
  min-height: 132px;
  line-height: 1.45;
}

.secondary,
.primary {
  min-height: 34px;
  border-radius: 5px;
  font-size: 0.7rem;
}

.secondary {
  background: #172232;
  border-color: var(--editor-line);
  color: #d8e6f7;
}

.primary {
  background: var(--editor-blue);
  border-color: var(--editor-blue);
}

#transcribeVideoBtn {
  background: var(--editor-blue);
  border-color: var(--editor-blue);
  color: #ffffff;
}

.script-map span {
  min-height: 26px;
  border-color: var(--editor-line);
  background: #0d1522;
  color: #c8d6e7;
  font-size: 0.62rem;
}

.script-map button {
  min-height: 26px;
  border-color: var(--editor-line);
  background: #0d1522;
  color: #c8d6e7;
  font-size: 0.62rem;
}

.script-map button:hover,
.script-map button:focus-visible {
  border-color: var(--editor-blue);
  background: #14243a;
}

.sync-panel .panel-title span {
  font-size: 0;
}

.sync-panel .panel-title span::after {
  content: "Elements";
  font-size: 0.7rem;
}

.export-panel {
  gap: 10px;
  background: rgba(16, 25, 36, 0.88);
  border-color: var(--editor-line);
}

.export-panel .panel-title {
  display: none;
}

.export-targets {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.export-target {
  min-height: 34px;
  border-color: var(--editor-line);
  background: #0d1522;
  color: #d8e6f7;
  font-size: 0.68rem;
}

.export-target.is-selected {
  background: linear-gradient(135deg, #9f55f1, #257bff);
  border-color: #4d93ff;
  color: #ffffff;
}

.editor-group {
  background: #0d1522;
  border-color: var(--editor-line);
}

.editor-group-title strong {
  color: #ffffff;
}

.editor-group-title small {
  color: var(--editor-muted);
}

.compact-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.export-panel .render-button {
  min-height: 38px;
  background: linear-gradient(90deg, #a87825, #d1a236);
  border-color: #d1a236;
  color: #120e06;
  font-size: 0.72rem;
}

.export-panel #renderHint {
  margin: 0;
}

.result-panel {
  background: rgba(16, 25, 36, 0.88);
}

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

  .sidebar {
    display: none;
  }

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

  .controls-column {
    max-height: none;
  }
}

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

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

html,
body,
.app-shell {
  height: 100%;
}

body {
  overflow: hidden;
}

.workspace {
  height: 100vh;
  overflow: hidden;
}

.preview-column {
  min-height: 0;
}

.preview-panel {
  min-height: 0;
}

.toast {
  top: 82px;
  bottom: auto;
  max-width: min(720px, calc(100vw - 48px));
  transform: translate(-50%, -18px);
  text-align: center;
}

.toast.is-visible {
  transform: translate(-50%, 0);
}

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

/* Professional polish */
:root {
  --pro-bg: #080d14;
  --pro-surface: #101824;
  --pro-surface-2: #131f2e;
  --pro-line: rgba(157, 176, 198, 0.18);
  --pro-line-strong: rgba(80, 143, 220, 0.34);
  --pro-text: #edf5ff;
  --pro-muted: #95a8bc;
  --pro-blue: #2487ff;
  --pro-teal: #25c7a2;
  --pro-gold: #d1a033;
}

body {
  background:
    linear-gradient(180deg, rgba(15, 28, 45, 0.92), rgba(8, 13, 20, 0.98) 34%),
    var(--pro-bg);
}

.workspace {
  padding: 20px 18px 18px;
}

.topbar {
  min-height: 52px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--pro-line);
}

.topbar h1 {
  font-size: 1.14rem;
  font-weight: 850;
}

.breadcrumb {
  color: var(--pro-muted);
  font-size: 0.64rem;
}

.sidebar {
  width: 100%;
  padding-top: 22px;
  background: #080d14;
}

.brand {
  justify-content: center;
}

.brand p {
  color: #ffffff;
  line-height: 1.15;
}

.nav-item {
  justify-content: center;
  min-height: 34px;
  border: 1px solid transparent;
}

.nav-item span:last-child {
  display: none;
}

.nav-item.is-active,
.nav-item:hover {
  background: rgba(36, 135, 255, 0.15);
  border-color: rgba(36, 135, 255, 0.32);
}

.studio-grid {
  grid-template-columns: minmax(620px, 1fr) minmax(390px, 430px);
  gap: 12px;
}

.preview-column,
.controls-column {
  gap: 12px;
}

.media-dropbar {
  min-height: 58px;
  border-color: rgba(126, 151, 179, 0.34);
  background: rgba(9, 16, 25, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.media-dropbar label,
.poster-upload-button,
.topbar .primary.small,
.primary,
#transcribeVideoBtn {
  background: var(--pro-blue);
  border-color: var(--pro-blue);
}

.media-dropbar label:hover,
.poster-upload-button:hover,
.topbar .primary.small:hover,
.primary:not(:disabled):hover,
#transcribeVideoBtn:not(:disabled):hover {
  background: #1678ee;
  border-color: #1678ee;
}

.quick-steps {
  gap: 10px;
}

.quick-steps div {
  min-height: 38px;
  background: rgba(14, 22, 33, 0.7);
  border-color: var(--pro-line);
}

.quick-steps strong {
  width: 22px;
  height: 22px;
  background: rgba(36, 135, 255, 0.16);
  border: 1px solid rgba(36, 135, 255, 0.44);
  color: #bcd9ff;
}

.quick-steps span {
  font-size: 0.72rem;
}

.panel {
  border-radius: 8px;
  background: rgba(16, 24, 36, 0.9);
  border-color: var(--pro-line);
}

.panel-title {
  min-height: 24px;
}

.panel-title::before {
  width: 4px;
  height: 16px;
  border: 0;
  border-radius: 999px;
  background: var(--pro-teal);
}

.panel-title span,
.eyebrow {
  color: var(--pro-text);
  font-size: 0.72rem;
  font-weight: 850;
}

.preview-panel {
  border-color: var(--pro-line-strong);
  background: rgba(8, 13, 20, 0.92);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
}

.device-frame {
  border-radius: 6px;
  background: #02050a;
}

.preview-footer {
  padding: 0 2px;
}

.upload-panel .panel-title .icon-button {
  display: none;
}

.upload-card {
  min-height: 54px;
  border-radius: 8px;
  background: rgba(19, 31, 46, 0.92);
}

.upload-card:hover,
.upload-card.is-dragging {
  border-color: rgba(36, 135, 255, 0.42);
  background: rgba(22, 38, 58, 0.96);
}

.upload-card .icon {
  color: #89a8c7;
}

.voice-panel,
.sync-panel,
.export-panel {
  background: rgba(16, 24, 36, 0.92);
}

.voice-summary {
  gap: 8px;
}

.voice-summary div,
.output-grid div,
.speech-card {
  border-radius: 8px;
  background: #0b1320;
  border-color: var(--pro-line);
}

.voice-summary div:nth-child(2) {
  background: rgba(209, 160, 51, 0.1);
  border-color: rgba(209, 160, 51, 0.28);
}

.voice-summary div:nth-child(3) {
  background: rgba(36, 135, 255, 0.1);
  border-color: rgba(36, 135, 255, 0.28);
}

.field input,
.field select,
.field textarea {
  border-radius: 7px;
  background: #09111d;
  border-color: rgba(146, 169, 194, 0.2);
}

.field textarea:focus,
.field input:focus,
.field select:focus {
  border-color: rgba(37, 199, 162, 0.62);
  box-shadow: 0 0 0 3px rgba(37, 199, 162, 0.1);
}

.script-map {
  gap: 8px;
}

.script-map button,
.export-target,
.secondary {
  border-radius: 7px;
  background: #0c1522;
  border-color: var(--pro-line);
}

.script-map button:hover,
.script-map button:focus-visible,
.secondary:not(:disabled):hover,
.export-target:hover {
  border-color: rgba(36, 135, 255, 0.45);
  background: #122238;
}

.export-target.is-selected {
  background: var(--pro-blue);
  border-color: var(--pro-blue);
}

.export-panel .render-button {
  min-height: 42px;
  border-radius: 7px;
  background: var(--pro-gold);
  border-color: var(--pro-gold);
  color: #100c04;
}

.export-panel .render-button:not(:disabled):hover {
  background: #bd8e28;
  border-color: #bd8e28;
  color: #100c04;
}

.online-voice-player {
  border-radius: 8px;
  background: rgba(12, 21, 34, 0.92);
  border-color: rgba(37, 199, 162, 0.22);
}

.toast {
  left: auto;
  right: 24px;
  top: auto;
  bottom: 22px;
  width: min(420px, calc(100vw - 32px));
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: 8px;
  text-align: left;
  background: rgba(9, 14, 21, 0.96);
  border: 1px solid rgba(157, 176, 198, 0.22);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.34);
  transform: translate(18px, 18px);
}

.toast.is-visible {
  transform: translate(0, 0);
}

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

  .controls-column {
    max-height: none;
  }
}

/* Creator dashboard layout */
:root {
  --dash-bg: #06101d;
  --dash-panel: #0e1a2a;
  --dash-panel-2: #101f32;
  --dash-line: rgba(143, 166, 194, 0.18);
  --dash-line-strong: rgba(139, 99, 255, 0.35);
  --dash-text: #f5f8ff;
  --dash-muted: #97a7bb;
  --dash-blue: #2f7dff;
  --dash-purple: #8d4dff;
}

body {
  background:
    radial-gradient(circle at 22% 0%, rgba(75, 95, 255, 0.16), transparent 32rem),
    linear-gradient(135deg, #07111f 0%, #030915 100%);
}

.app-shell {
  grid-template-columns: 240px minmax(0, 1fr);
}

.sidebar {
  width: auto;
  padding: 28px 14px 18px;
  gap: 28px;
  background: linear-gradient(180deg, rgba(11, 22, 37, 0.98), rgba(5, 13, 24, 0.98));
  border-right: 1px solid var(--dash-line);
}

.brand {
  justify-content: flex-start;
  gap: 12px;
  padding: 0 14px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #24d1ff, #8f49ff);
  color: #06101d;
}

.brand p {
  font-size: 1rem;
  font-weight: 900;
}

.brand span {
  display: block;
  color: var(--dash-muted);
  font-size: 0.72rem;
}

.nav-list {
  gap: 10px;
}

.sidebar-tool-link {
  display: flex;
}

.nav-item {
  justify-content: flex-start;
  min-height: 52px;
  padding: 0 16px;
  gap: 14px;
  border-radius: 8px;
  color: #c7d2e3;
  font-size: 0.88rem;
}

.nav-item span:last-child {
  display: inline;
}

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

.nav-item.is-active {
  background: linear-gradient(135deg, rgba(124, 79, 255, 0.55), rgba(44, 74, 160, 0.55));
  border-color: rgba(147, 112, 255, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.usage-card {
  display: grid;
  padding: 18px;
  border-radius: 14px;
  background: rgba(17, 31, 49, 0.82);
  border: 1px solid rgba(143, 166, 194, 0.12);
}

.usage-card p {
  color: var(--dash-text);
  font-size: 0.86rem;
}

.usage-card strong {
  color: var(--dash-muted);
  font-size: 0.84rem;
}

.usage-card .meter {
  height: 7px;
  background: rgba(255, 255, 255, 0.11);
}

.usage-card .meter span {
  width: 42%;
  background: linear-gradient(90deg, var(--dash-purple), #507bff);
}

.user-profile-card,
.sidebar-settings-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(143, 166, 194, 0.12);
  border-radius: 14px;
  background: rgba(17, 31, 49, 0.82);
}

.user-profile-card {
  padding: 12px;
  border: 1px solid rgba(143, 166, 194, 0.12);
  border-radius: 14px;
  background: rgba(17, 31, 49, 0.82);
}

.user-profile-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--dash-text);
  text-align: left;
}

.profile-menu-arrow {
  color: var(--dash-muted);
  font-size: 1.35rem;
  line-height: 1;
  transition: transform 160ms ease;
}

.user-profile-trigger[aria-expanded="true"] .profile-menu-arrow {
  transform: rotate(90deg);
}

.profile-menu {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(143, 166, 194, 0.16);
}

.profile-menu[hidden] {
  display: none !important;
}

.sidebar-section-title {
  color: var(--dash-muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.user-profile-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.user-profile-row div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.user-profile-row strong {
  color: var(--dash-text);
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-profile-row small {
  color: var(--dash-muted);
  font-size: 0.72rem;
}

.google-signin-button,
.profile-upgrade-button,
.profile-menu-item,
.subscription-actions button,
.sidebar-settings-card button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(143, 166, 194, 0.2);
  border-radius: 9px;
  background: rgba(8, 16, 28, 0.82);
  color: var(--dash-text);
  font-size: 0.76rem;
  font-weight: 850;
}

.profile-menu-item {
  width: 100%;
  padding: 0 12px;
  justify-content: flex-start;
}

.profile-menu-item .icon {
  width: 18px;
  height: 18px;
}

.google-signin-button span {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ffffff;
  color: #1a73e8;
  font-weight: 950;
}

.profile-upgrade-button {
  justify-content: center;
  border-color: transparent;
  background: linear-gradient(135deg, var(--dash-purple), var(--dash-blue));
  color: #ffffff;
  font-weight: 900;
}

.auth-actions {
  display: grid;
  gap: 8px;
}

.auth-actions-visible {
  margin-top: 10px;
}

.auth-actions-visible .google-signin-button,
.auth-actions-visible #signOutBtn {
  width: 100%;
  justify-content: center;
}

#googleSignInMount[hidden] {
  display: none;
}

.auth-status-note {
  color: var(--dash-muted);
  font-size: 0.7rem;
  line-height: 1.4;
}

.subscription-card {
  gap: 10px;
}

.subscription-card > div:first-child {
  display: block;
}

.subscription-card p {
  margin: 0;
  color: var(--dash-muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.subscription-card button {
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--dash-purple), var(--dash-blue));
  color: #ffffff;
  font-weight: 900;
}

.sidebar-settings-card {
  gap: 8px;
}

.sidebar-settings-card .sidebar-section-title {
  margin-bottom: 4px;
}

.sidebar-settings-card button {
  justify-content: flex-start;
  padding: 0 10px;
}

.recent-panel {
  display: block;
  flex: initial;
  min-height: 0;
  padding: 16px 14px;
  border-top: 1px solid rgba(143, 166, 194, 0.14);
  background: rgba(17, 31, 49, 0.82);
  border: 1px solid rgba(143, 166, 194, 0.12);
  border-radius: 14px;
}

.support-panel {
  display: grid;
  padding: 10px 14px 14px;
}

.recent-panel .panel-title {
  margin: 0;
}

.recent-panel .panel-title::before {
  display: none;
}

.support-button {
  min-height: 44px;
  border: 1px solid rgba(143, 166, 194, 0.2);
  border-radius: 9px;
  background: rgba(8, 16, 28, 0.82);
  color: var(--dash-text);
  font-weight: 850;
}

.workspace {
  padding: 28px 28px 18px;
}

.topbar {
  min-height: 58px;
  margin-bottom: 22px;
  padding-bottom: 0;
  border-bottom: 0;
}

.topbar h1 {
  font-size: 1.42rem;
}

.breadcrumb {
  font-size: 0.84rem;
  font-weight: 500;
}

.breadcrumb span::after {
  content: "";
  margin: 0;
}

.topbar-actions {
  align-items: center;
  gap: 12px;
}

.topbar .icon-button {
  width: 34px;
  min-height: 34px;
  border-radius: 50%;
  background: transparent;
}

.topbar .primary.small {
  display: none;
}

.profile-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 8px;
  border: 1px solid var(--dash-line);
  border-radius: 10px;
  background: rgba(12, 23, 38, 0.78);
  color: var(--dash-text);
}

.profile-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #b7d8ff, #d4b7ff);
  color: #08111d;
  font-size: 0.72rem;
  font-weight: 900;
}

.profile-button span:last-child {
  display: grid;
  text-align: left;
}

.profile-button small {
  color: var(--dash-muted);
  font-size: 0.72rem;
}

.workflow-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 16px;
  padding: 20px;
  border: 1px solid var(--dash-line);
  border-radius: 14px;
  background: rgba(14, 26, 42, 0.86);
}

.workflow-step {
  min-height: 44px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
}

.workflow-step.is-active {
  background: transparent;
  border-color: transparent;
}

.workflow-step strong {
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid rgba(155, 174, 199, 0.45);
  color: #ccd8e8;
}

.workflow-step.is-active strong {
  border: 0;
  background: linear-gradient(135deg, var(--dash-blue), var(--dash-purple));
  color: #fff;
}

.workflow-step span {
  color: var(--dash-text);
  font-size: 0.84rem;
}

.workflow-step span::after {
  content: attr(data-subtitle);
}

.studio-grid {
  grid-template-columns: minmax(640px, 1fr) minmax(380px, 450px);
  gap: 18px;
}

.media-dropbar {
  min-height: 108px;
  justify-content: space-between;
  padding: 18px 24px;
  border-radius: 12px;
  background: rgba(11, 22, 36, 0.78);
}

.media-dropbar > .icon {
  width: 60px;
  height: 60px;
  padding: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--dash-blue), var(--dash-purple));
  color: #fff;
}

.media-dropbar > span {
  display: grid;
  gap: 6px;
  margin-right: auto;
}

.media-dropbar strong {
  color: var(--dash-text);
  font-size: 1.05rem;
}

.media-dropbar small {
  color: var(--dash-muted);
  font-size: 0.82rem;
}

.media-dropbar label {
  min-height: 44px;
  padding: 0 22px;
  border-radius: 8px;
  background: rgba(14, 26, 42, 0.95);
  border-color: rgba(157, 178, 204, 0.28);
}

.quick-steps {
  display: none;
}

.preview-panel {
  padding: 16px;
  border-radius: 14px;
  border-color: var(--dash-line);
  background: rgba(11, 22, 36, 0.82);
  box-shadow: none;
}

.device-frame,
.device-frame.ratio-9-16,
.device-frame.ratio-16-9,
.device-frame.ratio-1-1,
.device-frame.ratio-4-3 {
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
}

.preview-footer {
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(143, 166, 194, 0.13);
  border-radius: 10px;
  background: rgba(12, 23, 38, 0.72);
}

.controls-column {
  max-height: calc(100vh - 58px);
  gap: 14px;
}

.workspace {
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.preview-column {
  padding-bottom: 48px;
}

.upload-panel,
.voice-panel,
.sync-panel,
.export-panel {
  padding: 16px;
  border-radius: 14px;
  background: rgba(14, 26, 42, 0.9);
  border-color: var(--dash-line);
}

.panel-title {
  margin-bottom: 14px;
}

.panel-title::before {
  background: var(--dash-purple);
}

.upload-grid {
  gap: 12px;
}

.upload-card {
  min-height: 64px;
  padding: 14px 16px;
  border-radius: 10px;
  grid-template-columns: auto 1fr auto;
  background: rgba(13, 25, 40, 0.88);
}

.upload-card strong {
  font-size: 0.82rem;
}

.upload-card small {
  font-size: 0.72rem;
}

.setup-style-card {
  cursor: default;
}

.voice-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.voice-summary div {
  min-height: 66px;
}

.speech-card {
  grid-template-columns: 1fr auto;
}

.transcript-field textarea {
  min-height: 92px;
}

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

.voice-controls .field:first-child {
  display: none;
}

.field textarea {
  min-height: 150px;
}

.script-map {
  display: none;
}

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

.voice-actions .primary,
.voice-actions .secondary {
  min-height: 42px;
}

.sync-panel,
.export-panel {
  margin-top: 0;
}

.export-panel .render-button {
  min-height: 54px;
  background: linear-gradient(135deg, var(--dash-purple), var(--dash-blue));
  border: 0;
  color: #fff;
}

.export-panel .render-button:not(:disabled):hover {
  background: linear-gradient(135deg, #7c39ef, #206df0);
  color: #fff;
}

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

  .sidebar {
    display: none;
  }

  .workspace {
    padding: 18px;
  }
}

/* CapCut-style editor controls */
.editor-timeline {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(143, 166, 194, 0.18);
  border-radius: 10px;
  background: rgba(7, 13, 22, 0.72);
}

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

.timeline-toolbar strong,
.timeline-toolbar small {
  display: block;
}

.timeline-toolbar small {
  margin-top: 3px;
  color: var(--dash-muted);
  font-size: 0.72rem;
}

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

.timeline-track {
  position: relative;
  height: 54px;
  border: 1px solid rgba(143, 166, 194, 0.18);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    rgba(5, 10, 18, 0.92);
  background-size: 56px 100%;
}

.timeline-segment {
  position: absolute;
  top: 8px;
  bottom: 8px;
  min-width: 20px;
  padding: 0 8px;
  border: 1px solid rgba(45, 135, 255, 0.6);
  border-radius: 6px;
  background: linear-gradient(90deg, #195b9d, #19a38e);
  color: #ffffff;
  overflow: hidden;
}

.timeline-segment span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.7rem;
  font-weight: 850;
}

.timeline-segment.is-selected {
  outline: 2px solid #ffd25a;
  outline-offset: 1px;
}

.timeline-segment.is-deleted {
  border-color: rgba(255, 110, 110, 0.5);
  background: repeating-linear-gradient(135deg, rgba(118, 33, 33, 0.9), rgba(118, 33, 33, 0.9) 8px, rgba(55, 19, 25, 0.9) 8px, rgba(55, 19, 25, 0.9) 16px);
  opacity: 0.55;
}

.logo-free {
  right: auto;
  bottom: auto;
  transform: translate(-50%, -50%);
  cursor: grab;
}

.logo-preview,
.subtitle-overlay {
  touch-action: none;
}

.subtitle-overlay {
  cursor: grab;
}

.subtitle-free {
  bottom: auto;
  transform: translate(-50%, -50%);
}

.render-button {
  text-transform: none;
}

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

.preview-panel > .panel-title,
.preview-panel > .preview-footer,
.preview-panel > .editor-timeline,
.preview-panel > .clip-selector {
  grid-column: 1 / -1;
}

.original-compare-card {
  grid-column: 1;
  grid-row: 2 / span 2;
}

.recap-title {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.recap-download-button {
  min-height: 32px;
  padding: 0 10px;
  text-transform: none;
  letter-spacing: 0;
}

.recap-download-button .icon {
  width: 15px;
  height: 15px;
}

.preview-panel > #deviceFrame {
  grid-column: 2;
  grid-row: 3;
}

.original-compare-card .device-frame,
.preview-panel > #deviceFrame {
  width: 100%;
  max-width: none;
  margin: 0;
}

.compare-title {
  margin: 0 0 8px;
  color: var(--dash-muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

#originalPreview {
  width: 100%;
  height: 100%;
  display: none;
  object-fit: contain;
  background: #070b0f;
}

.original-poster {
  display: grid;
}

.blur-mask {
  cursor: grab;
  pointer-events: auto;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 10px;
  border-block: 2px solid rgba(255, 255, 255, 0.72);
}

.blur-mask span {
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(4, 10, 18, 0.64);
}

.subtitle-overlay {
  pointer-events: auto;
}

@media (max-width: 1180px) {
  .original-compare-card,
  .preview-panel > #deviceFrame,
  .recap-title {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .original-compare-card {
    margin-bottom: 12px;
  }
}

/* Subscription plans */
.business-plans,
.subscription-dashboard {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--dash-line);
  border-radius: 14px;
  background: rgba(14, 26, 42, 0.86);
}

.subscription-dashboard[hidden] {
  display: none;
}

.app-page[hidden] {
  display: none;
}

.app-page {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--dash-line);
  border-radius: 14px;
  background: rgba(14, 26, 42, 0.86);
}

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

.dashboard-card,
.settings-grid article,
.template-grid article,
.page-empty-state {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid rgba(143, 166, 194, 0.16);
  border-radius: 12px;
  background: rgba(10, 20, 34, 0.86);
}

.dashboard-card span,
.template-grid span,
.page-empty-state p,
.settings-grid p {
  color: var(--dash-muted);
}

.dashboard-card span {
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-card strong {
  color: #ffffff;
  font-size: 1.5rem;
}

.dashboard-card p,
.settings-grid p,
.page-empty-state p {
  margin: 0;
  line-height: 1.45;
}

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

.settings-grid h2,
.page-empty-state h2 {
  margin: 0;
}

.settings-grid article button,
.page-empty-state button {
  width: fit-content;
}

.settings-profile-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid rgba(143, 166, 194, 0.14);
  border-radius: 10px;
  background: rgba(8, 16, 28, 0.64);
}

.settings-profile-row div {
  display: grid;
  gap: 2px;
}

.settings-profile-row strong {
  color: var(--dash-text);
}

.settings-profile-row small {
  color: var(--dash-muted);
}

.template-grid article strong {
  color: var(--dash-text);
  font-size: 1rem;
}

.page-empty-state {
  place-items: center;
  min-height: 320px;
  text-align: center;
}

.business-plans-head,
.subscription-dashboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.business-plans h2,
.subscription-dashboard h2,
.credit-rules-card h3 {
  margin: 0;
  color: var(--dash-text);
}

.business-plans h2,
.subscription-dashboard h2 {
  margin-top: 5px;
  font-size: 1.12rem;
}

.subscription-dashboard-head > div > span {
  display: block;
  margin-top: 6px;
  color: var(--dash-muted);
  font-size: 0.86rem;
}

.payment-panel,
.payment-request-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(37, 199, 162, 0.22);
  border-radius: 12px;
  background: rgba(37, 199, 162, 0.07);
}

.payment-panel h3,
.payment-request-panel h3 {
  margin: 4px 0 0;
  color: var(--dash-text);
}

.payment-panel span,
.payment-panel small,
.payment-request-panel p {
  color: var(--dash-muted);
  line-height: 1.45;
}

.payment-method-grid,
.payment-request-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.payment-method-grid article {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(143, 166, 194, 0.16);
  border-radius: 10px;
  background: rgba(8, 16, 28, 0.62);
}

.payment-method-grid strong {
  color: #ffffff;
}

.credit-rules-card dd button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(36, 135, 255, 0.35);
  border-radius: 7px;
  background: rgba(36, 135, 255, 0.12);
  color: #eaf1ff;
  font-weight: 900;
}

.payment-request-panel[hidden] {
  display: none;
}

.credit-pill {
  min-width: 160px;
  display: grid;
  gap: 2px;
  padding: 11px 14px;
  border: 1px solid rgba(37, 199, 162, 0.32);
  border-radius: 10px;
  background: rgba(37, 199, 162, 0.1);
  text-align: right;
}

.credit-pill strong {
  color: #d7fff5;
  font-size: 1rem;
}

.credit-pill span,
.plan-card small,
.plan-card p,
.plan-card li,
.credit-rules-card dt,
.credit-rules-card dd {
  color: var(--dash-muted);
  font-size: 0.78rem;
}

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

.plan-card,
.credit-rules-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(143, 166, 194, 0.16);
  border-radius: 12px;
  background: rgba(10, 20, 34, 0.86);
}

.plan-card.is-featured {
  border-color: rgba(143, 99, 255, 0.58);
  background: linear-gradient(180deg, rgba(74, 51, 136, 0.48), rgba(10, 20, 34, 0.9));
}

.plan-name,
.plan-badge {
  width: fit-content;
  padding: 5px 8px;
  border-radius: 999px;
  color: #cfe0f6;
  background: rgba(143, 166, 194, 0.13);
  font-size: 0.7rem;
  font-weight: 900;
}

.plan-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--dash-purple), var(--dash-blue));
}

.plan-card strong {
  color: #ffffff;
  font-size: 1.45rem;
  line-height: 1;
}

.plan-card p {
  min-height: 40px;
  margin: 0;
  line-height: 1.45;
}

.plan-card ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.plan-card button {
  min-height: 40px;
  margin-top: 4px;
  border: 1px solid rgba(143, 166, 194, 0.22);
  border-radius: 8px;
  background: rgba(8, 16, 28, 0.82);
  color: var(--dash-text);
  font-weight: 900;
}

.plan-card.is-featured button {
  border-color: transparent;
  background: linear-gradient(135deg, var(--dash-purple), var(--dash-blue));
}

.plan-card li {
  position: relative;
  padding-left: 18px;
}

.plan-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dash-blue);
}

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

.credit-rules-card h3 {
  font-size: 0.94rem;
}

.credit-rules-card dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.credit-rules-card dl div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(143, 166, 194, 0.11);
}

.credit-rules-card dl div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.credit-rules-card dt,
.credit-rules-card dd {
  margin: 0;
}

.credit-rules-card dd {
  color: #eaf1ff;
  font-weight: 850;
  text-align: right;
}

@media (max-width: 1180px) {
  .plan-grid,
  .credit-rules-grid,
  .dashboard-grid,
  .settings-grid,
  .template-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .business-plans-head {
    align-items: stretch;
    flex-direction: column;
  }

  .credit-pill {
    text-align: left;
  }

  .plan-grid,
  .credit-rules-grid,
  .dashboard-grid,
  .settings-grid,
  .template-grid,
  .payment-method-grid,
  .payment-request-actions {
    grid-template-columns: 1fr;
  }
}
