/* DarkStudio — dashboard + auth */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #08080b;
  --bg-elevated: #111114;
  --surface: rgba(255, 255, 255, 0.032);
  --surface-hover: rgba(255, 255, 255, 0.055);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #ececef;
  --muted: #8b8b93;
  --faint: #5c5c64;
  --accent: #d4d4d8;
  --accent-line: #f4f4f5;
  --green: #34d399;
  --red: #f87171;
  --amber: #fbbf24;
  --focus: #93c5fd;
  --btn-bg: #f4f4f5;
  --btn-fg: #111113;
  --btn-hover: #ffffff;
  --input-bg: rgba(255, 255, 255, 0.04);
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  --glass: rgba(16, 16, 20, 0.82);
  --glass-strong: rgba(20, 20, 24, 0.92);
  --glass-border: rgba(255, 255, 255, 0.07);
  --glass-shine: rgba(255, 255, 255, 0.04);
  --glass-sheen: rgba(255, 255, 255, 0.06);
  --glass-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  --glass-blur: 8px;
  --sidebar-w: 232px;
  --sidebar-offset: var(--sidebar-w);
  --workspace: 1040px;
  --workspace-wide: 1120px;
  --radius: 14px;
  --radius-sm: 10px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --theme-duration: 0.55s;
  --lp-theme-track: rgba(255, 255, 255, 0.06);
  --lp-theme-border: rgba(148, 163, 184, 0.16);
  --lp-theme-glow-lamp: rgba(251, 191, 36, 0.35);
  --lp-theme-glow-moon: rgba(147, 197, 253, 0.28);
  --lp-theme-icon: #94a3b8;
  --lp-theme-icon-active-lamp: #fbbf24;
  --lp-theme-icon-active-moon: #93c5fd;
  --lp-theme-duration: 0.55s;
  --lp-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f3f0;
  --bg-elevated: #ffffff;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-hover: #ffffff;
  --border: rgba(20, 20, 24, 0.08);
  --border-strong: rgba(20, 20, 24, 0.16);
  --text: #141418;
  --muted: #5c5c66;
  --faint: #8a8a94;
  --accent: #3f3f46;
  --accent-line: #18181b;
  --green: #059669;
  --red: #dc2626;
  --amber: #d97706;
  --focus: #2563eb;
  --btn-bg: #141418;
  --btn-fg: #fafafa;
  --btn-hover: #27272a;
  --input-bg: rgba(255, 255, 255, 0.92);
  --shadow: 0 12px 32px rgba(20, 20, 24, 0.06);
  --glass: rgba(255, 255, 255, 0.88);
  --glass-strong: rgba(255, 255, 255, 0.96);
  --glass-border: rgba(20, 20, 24, 0.07);
  --glass-shine: rgba(255, 255, 255, 0.35);
  --glass-sheen: rgba(255, 255, 255, 0.2);
  --glass-shadow: 0 6px 20px rgba(20, 20, 24, 0.04);
  --glass-blur: 10px;
  --lp-theme-track: rgba(15, 23, 42, 0.05);
  --lp-theme-border: rgba(15, 23, 42, 0.1);
  --lp-theme-glow-lamp: rgba(251, 191, 36, 0.45);
  --lp-theme-glow-moon: rgba(99, 102, 241, 0.22);
  --lp-theme-icon: #94a3b8;
  --lp-theme-icon-active-lamp: #d97706;
  --lp-theme-icon-active-moon: #6366f1;
}

html {
  background: var(--bg);
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  transition:
    background-color var(--theme-duration) var(--ease),
    color var(--theme-duration) var(--ease);
}

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--text); }

.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }

.brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; color: var(--text); }
.brand-logo-link { text-decoration: none; }
.auth-logo-img {
  display: block;
  height: 34px;
  width: auto;
  max-width: 190px;
  object-fit: contain;
}

.dash-icon { width: 1.05rem; height: 1.05rem; flex-shrink: 0; display: block; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.7rem 1.25rem; border-radius: var(--radius-sm); font-weight: 600; font-size: 0.875rem;
  border: none; cursor: pointer; transition: background 0.2s var(--ease), transform 0.15s var(--ease);
  text-decoration: none; font-family: inherit;
}
.btn-primary { background: var(--btn-bg); color: var(--btn-fg); }
.btn-primary:hover { background: var(--btn-hover); color: var(--btn-fg); }
.btn-secondary {
  background: transparent; color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--border-strong); background: var(--surface-hover); color: var(--text); }
.btn-sm { padding: 0.45rem 0.85rem; font-size: 0.78rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Cards / surfaces */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.45rem;
}
.card-hover { transition: border-color 0.2s var(--ease), background 0.2s var(--ease); }
.card-hover:hover { border-color: var(--border-strong); background: var(--surface-hover); }

/* Forms */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: 0.82rem; color: var(--muted); margin-bottom: 0.4rem; }
.input, select.input, textarea.input {
  width: 100%; padding: 0.7rem 0.95rem; border-radius: var(--radius-sm);
  background: var(--input-bg); border: 1px solid var(--border);
  color: var(--text); font-size: 0.9rem; outline: none; font-family: inherit;
  transition: border-color 0.2s var(--ease);
}
.input:focus { border-color: var(--border-strong); }
textarea.input { min-height: 100px; resize: vertical; }
select.input option { background: var(--bg-elevated); color: var(--text); }

.alert { padding: 0.75rem 1rem; border-radius: var(--radius-sm); font-size: 0.85rem; margin-bottom: 1rem; }
.alert-error { background: color-mix(in srgb, var(--red) 10%, transparent); border: 1px solid color-mix(in srgb, var(--red) 22%, transparent); color: var(--red); }
.alert-success { background: color-mix(in srgb, var(--green) 10%, transparent); border: 1px solid color-mix(in srgb, var(--green) 22%, transparent); color: var(--green); }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.25rem; }
.feature-icon {
  width: 36px; height: 36px; border-radius: 9px;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
}
.feature-icon .dash-icon { width: 1.1rem; height: 1.1rem; }

.text-muted { color: var(--muted); }
.text-ok { color: var(--green); }

/* Auth */
.auth-page-body {
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    radial-gradient(980px 520px at 8% -10%, var(--dash-wash-a, rgba(196, 204, 220, 0.07)), transparent 58%),
    radial-gradient(720px 420px at 100% 0%, var(--dash-wash-b, rgba(168, 176, 196, 0.05)), transparent 55%);
  background-attachment: fixed;
  color: var(--text);
}
.auth-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.4rem;
}
.auth-brand { display: block; line-height: 0; }
.auth-brand .auth-logo-img {
  height: 30px;
  max-width: 150px;
}
.auth-top-tools {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5.5rem 1.25rem 2.5rem;
}
.auth-box { width: 100%; max-width: 400px; }
.auth-head { margin-bottom: 1.35rem; }
.auth-kicker {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.45rem;
}
.auth-head h1 {
  font-size: 1.7rem;
  font-weight: 620;
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin-bottom: 0.4rem;
}
.auth-sub {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}
.auth-panel {
  padding: 1.35rem 1.4rem 1.4rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
}
.auth-field {
  display: block;
  margin-bottom: 1rem;
}
.auth-field span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.auth-field .input {
  padding: 0.82rem 0.95rem;
  font-size: 0.95rem;
}
.auth-field .input.is-invalid { border-color: var(--red); }
.auth-hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.74rem;
  font-style: normal;
  color: var(--faint);
}
.auth-submit { margin-top: 0.25rem; }
.auth-switch {
  text-align: center;
  margin-top: 1.15rem;
  font-size: 0.86rem;
  color: var(--muted);
}
.auth-switch a {
  color: var(--text);
  text-underline-offset: 3px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
}
.auth-legal-links {
  text-align: center;
  margin-top: 0.7rem;
  font-size: 0.76rem;
  color: var(--muted);
}
.auth-legal-links a { color: var(--muted); text-underline-offset: 2px; }
.auth-legal-links a:hover { color: var(--text); }

.auth-progress {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1rem;
}
.auth-register .auth-progress {
  justify-content: center;
}
.auth-dot {
  width: 18px;
  height: 3px;
  border-radius: 99px;
  background: var(--border-strong);
  opacity: 0.45;
}
.auth-dot.is-on {
  width: 28px;
  background: var(--text);
  opacity: 1;
}
.auth-ask {
  min-height: 2.6rem;
  font-size: 1.28rem;
  font-weight: 580;
  letter-spacing: -0.035em;
  line-height: 1.3;
  margin-bottom: 1.15rem;
}
.auth-register .auth-ask {
  text-align: center;
}
.auth-cursor {
  display: inline-block;
  width: 2px;
  height: 0.95em;
  margin-left: 2px;
  background: var(--text);
  vertical-align: -2px;
  opacity: 0;
}
.auth-cursor.is-on { animation: authCaret 0.9s steps(1) infinite; }
@keyframes authCaret {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
.auth-step { animation: authStepIn 0.32s var(--ease); }
@keyframes authStepIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.auth-back {
  display: block;
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.35rem;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}
.auth-back:hover { color: var(--text); }
.auth-page-body:not(.is-auth-ready) .auth-ask,
.auth-page-body:not(.is-auth-ready) .auth-progress,
.auth-page-body:not(.is-auth-ready) [data-auth-next],
.auth-page-body:not(.is-auth-ready) [data-auth-back] { display: none; }
.auth-page-body:not(.is-auth-ready) .auth-step { display: block !important; }

@media (prefers-reduced-motion: reduce) {
  .auth-step { animation: none; }
  .auth-cursor.is-on { animation: none; opacity: 1; }
}

/* ── Dashboard shell ── */
.dashboard-body {
  background-color: var(--bg);
  background-image:
    radial-gradient(980px 520px at 6% -8%, var(--dash-wash-a), transparent 58%),
    radial-gradient(820px 460px at 98% 4%, var(--dash-wash-b), transparent 56%),
    radial-gradient(640px 380px at 72% 108%, var(--dash-wash-c), transparent 52%);
  background-attachment: fixed;
}
:root,
[data-theme="dark"] {
  --dash-wash-a: rgba(196, 204, 220, 0.07);
  --dash-wash-b: rgba(168, 176, 196, 0.05);
  --dash-wash-c: rgba(120, 128, 148, 0.04);
}
[data-theme="light"] {
  --dash-wash-a: rgba(186, 196, 214, 0.38);
  --dash-wash-b: rgba(228, 214, 196, 0.32);
  --dash-wash-c: rgba(170, 184, 204, 0.22);
}
.dashboard-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  background: var(--bg);
  border-right: 1px solid var(--border);
  transition: transform 0.32s var(--ease);
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  margin: 1.35rem 1rem 0.85rem 1.25rem;
}
.sidebar-brand {
  position: relative;
  display: block;
  height: 28px;
  min-width: 0;
  flex: 1;
  margin: 0;
}
.sidebar-toggle {
  display: none;
}
.sidebar-edge-toggle {
  position: fixed;
  top: 1.35rem;
  left: calc(var(--sidebar-w) - 1rem - 30px);
  z-index: 500;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition:
    left 0.32s var(--ease),
    color 0.2s var(--ease),
    background 0.2s var(--ease),
    border-color 0.2s var(--ease),
    transform 0.2s var(--ease);
}
.sidebar-edge-toggle:hover {
  color: var(--text);
  background: var(--surface-hover);
  border-color: var(--border-strong);
}
.sidebar-edge-toggle:active { transform: scale(0.96); }
.sidebar-edge-toggle .dash-icon {
  width: 16px;
  height: 16px;
  transition: transform 0.32s var(--ease);
}
.sidebar-edge-toggle.is-collapsed {
  left: 1.25rem;
}
.sidebar-edge-toggle.is-collapsed .dash-icon {
  transform: rotate(180deg);
}

.sidebar-reveal {
  display: none !important;
}

html.ds-sidebar-collapsed,
.dashboard-layout.is-sidebar-collapsed {
  --sidebar-offset: 0px;
}
html.ds-sidebar-collapsed .sidebar,
.dashboard-layout.is-sidebar-collapsed .sidebar {
  transform: translateX(calc(-1 * var(--sidebar-w)));
}
html.ds-sidebar-collapsed .main-content,
.dashboard-layout.is-sidebar-collapsed .main-content {
  margin-left: 0;
  width: 100%;
}
.sidebar-logo-img {
  display: block;
  height: 28px;
  width: auto;
  max-width: 148px;
  object-fit: contain;
}
.lp-logo-theme {
  transition: opacity var(--theme-duration) var(--ease), transform var(--theme-duration) var(--ease);
}
[data-theme="light"] .lp-logo-dark,
[data-theme="dark"] .lp-logo-light {
  position: absolute;
  opacity: 0;
  transform: scale(0.96);
  pointer-events: none;
  visibility: hidden;
}
[data-theme="light"] .lp-logo-light,
[data-theme="dark"] .lp-logo-dark {
  opacity: 1;
  transform: scale(1);
  visibility: visible;
}

.sidebar-nav {
  flex: 1;
  padding: 0.35rem 0.85rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  overflow-y: auto;
}
.nav-group {
  margin: 1.05rem 0.8rem 0.35rem;
  font-size: 0.64rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.nav-group:first-of-type { margin-top: 0.85rem; }
.sidebar-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.56rem 0.8rem;
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition:
    color 0.2s var(--ease),
    background 0.2s var(--ease),
    transform 0.18s var(--ease);
}
.sidebar-nav a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 1.5px;
  height: 0;
  border-radius: 2px;
  background: var(--accent-line);
  transform: translateY(-50%);
  transition: height 0.22s var(--ease);
}
.sidebar-nav a:hover {
  color: var(--text);
  background: var(--surface);
  transform: translateX(2px);
}
.sidebar-nav a.active {
  color: var(--text);
  background: var(--surface);
}
.sidebar-nav a.active::before { height: 16px; }
.sidebar-nav a:active { transform: translateX(1px) scale(0.99); }

.sidebar-footer { padding: 0.85rem 1rem 1.15rem; }
.sidebar-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.9rem;
}

.dash-theme-corner {
  position: fixed;
  top: 1.25rem;
  right: 2rem;
  z-index: 180;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.2rem;
  border-radius: 999px;
  background: var(--lp-theme-track);
  border: 1px solid var(--border);
}
.dash-lang-switch { width: 100%; justify-content: center; }
.lang-switch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.25rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  transition: color 0.2s, background 0.2s;
}
.lang-switch-btn:hover { color: var(--text); }
.lang-switch-btn.active {
  color: var(--text);
  background: var(--surface-hover);
}

.credits-box {
  padding: 0.65rem 0.15rem 0.75rem;
  margin-bottom: 0.65rem;
  border-top: 1px solid var(--border);
}
.credits-box small { color: var(--muted); font-size: 0.68rem; letter-spacing: 0.04em; text-transform: uppercase; }
.credits-box strong { display: block; font-size: 1.35rem; font-weight: 650; letter-spacing: -0.03em; color: var(--text); }

.user-box { display: flex; align-items: center; gap: 0.55rem; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 650; font-size: 0.75rem; color: var(--text);
}
.user-name { flex: 1; font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-link {
  color: var(--muted);
  padding: 0.3rem;
  border-radius: 7px;
  transition: color 0.2s, background 0.2s;
}
.logout-link:hover { color: var(--text); background: var(--surface); }

/* Theme toggle — shared with landing */
.lp-theme-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.2rem;
  border-radius: 999px;
  background: var(--lp-theme-track);
  border: 1px solid var(--lp-theme-border);
  transition:
    background var(--lp-theme-duration) var(--lp-ease),
    border-color var(--lp-theme-duration) var(--lp-ease);
}
.lp-theme-glow {
  position: absolute;
  top: 0.2rem;
  left: 0.2rem;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--lp-theme-glow-lamp);
  box-shadow: 0 0 18px var(--lp-theme-glow-lamp);
  transform: translateX(0);
  transition:
    transform 0.5s var(--lp-ease),
    background 0.5s var(--lp-ease),
    box-shadow 0.5s var(--lp-ease);
  pointer-events: none;
  z-index: 0;
}
[data-theme="dark"] .lp-theme-glow {
  transform: translateX(calc(2rem + 0.15rem));
  background: var(--lp-theme-glow-moon);
  box-shadow: 0 0 16px var(--lp-theme-glow-moon);
}
.lp-theme-btn {
  position: relative;
  z-index: 1;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--lp-theme-icon);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    color 0.35s var(--lp-ease),
    transform 0.25s var(--lp-ease),
    filter 0.35s var(--lp-ease);
}
.lp-theme-btn svg {
  width: 1.05rem;
  height: 1.05rem;
  transition: transform 0.45s var(--lp-ease), filter 0.45s var(--lp-ease);
}
.lp-theme-btn:hover { transform: scale(1.06); }
.lp-theme-btn:active { transform: scale(0.94); }
.lp-theme-btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.lp-theme-lamp.is-active { color: var(--lp-theme-icon-active-lamp); }
.lp-theme-lamp.is-active svg { filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.65)); }
.lp-theme-lamp.is-active .lamp-rays { opacity: 1; transform: scale(1); }
.lp-theme-lamp .lamp-rays {
  opacity: 0;
  transform: scale(0.85);
  transform-origin: center;
  transition: opacity 0.45s var(--lp-ease), transform 0.45s var(--lp-ease);
}
.lp-theme-lamp.is-active .lamp-bulb { fill: rgba(251, 191, 36, 0.15); }
.lp-theme-moon.is-active { color: var(--lp-theme-icon-active-moon); }
.lp-theme-moon.is-active svg {
  filter: drop-shadow(0 0 6px rgba(147, 197, 253, 0.55));
  transform: rotate(-8deg) scale(1.05);
}

/* Main workspace — fill remaining width, center content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-offset);
  width: calc(100% - var(--sidebar-offset));
  min-height: 100vh;
  padding: 2.25rem 2.5rem 3.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: margin-left 0.32s var(--ease), width 0.32s var(--ease);
}
.workspace {
  width: 100%;
  max-width: var(--workspace);
}
.wizard-long-page .workspace,
.wizard-short-page .workspace,
.wizard-music-page .workspace,
.project-preview-page .workspace {
  max-width: var(--workspace-wide);
}
.mobile-header { display: none; }
.sidebar-overlay { display: none; }

.dash-top-chrome { display: contents; }

.mobile-header-brand {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1;
  text-decoration: none;
}
.mobile-header-logo {
  display: block;
  height: 24px;
  width: auto;
  max-width: min(148px, 44vw);
  object-fit: contain;
}

.dash-home-page .main-content {
  justify-content: center;
}
@media (max-width: 768px) {
  .dash-home-page .main-content {
    justify-content: flex-start;
  }
}
.dash-home-page .workspace {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
}
.home-welcome {
  width: 100%;
  max-width: 420px;
  text-align: center;
  animation: homeWelcomeIn 0.55s var(--ease);
}
.home-mascot {
  display: flex;
  justify-content: center;
  margin-bottom: 1.15rem;
}
.home-mascot img {
  width: 92px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.1));
  animation: loMascotListen 2.8s var(--ease) infinite;
}
.home-welcome h1 {
  font-size: 1.85rem;
  font-weight: 620;
  letter-spacing: -0.035em;
  line-height: 1.2;
}
.home-welcome p {
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 1rem;
  letter-spacing: -0.015em;
}
.home-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin-top: 1.75rem;
}
.home-action {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 1rem 1.05rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: inherit;
  text-align: left;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
}
.home-action:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
  transform: translateY(-2px);
}
.home-action-kicker {
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  color: var(--faint);
}
.home-action strong {
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.home-quiet-link {
  display: inline-block;
  margin-top: 1.35rem;
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
}
.home-quiet-link:hover { color: var(--text); }
@keyframes homeWelcomeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-header { margin-bottom: 1.75rem; }
.page-header h1 {
  font-size: 1.65rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.page-header p { color: var(--muted); font-size: 0.9rem; margin-top: 0.3rem; }
.studio-meta {
  margin-top: 0.7rem !important;
  font-size: 0.78rem !important;
  color: var(--faint) !important;
  letter-spacing: 0.01em;
}
.page-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
}
.page-actions { display: flex; gap: 0.5rem; }

/* ── Projects page ── */
.projects-page .main-content {
  padding-top: 2rem;
}
@media (max-width: 768px) {
  .projects-page .main-content {
    padding-top: 0;
  }
}
.projects-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.15rem;
  margin-bottom: 1.75rem;
  max-width: 100%;
}
.projects-head-copy h1 {
  font-size: 1.65rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.projects-head-copy p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.3rem;
}
.projects-head-toolbar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
  width: 100%;
}
.projects-create-group,
.projects-filter-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}
.projects-create-link,
.projects-filter-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  min-width: 7.5rem;
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: inherit;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
  transition:
    border-color 0.2s var(--ease),
    background 0.2s var(--ease),
    transform 0.2s var(--ease);
}
.projects-create-link:hover,
.projects-filter-btn:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
  transform: translateY(-1px);
}
.projects-create-link.is-primary,
.projects-filter-btn.is-active {
  border-color: color-mix(in srgb, var(--text) 22%, var(--border));
  background: var(--btn-bg);
  color: var(--btn-fg);
}
.projects-create-link.is-primary:hover,
.projects-filter-btn.is-active:hover {
  background: var(--btn-hover);
  border-color: color-mix(in srgb, var(--text) 30%, var(--border));
}
.projects-create-kicker,
.projects-filter-kicker {
  font-size: 0.64rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.72;
}
.projects-create-link strong,
.projects-filter-btn strong {
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.projects-filter-create {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  font-size: 0.78rem;
}
.projects-filter-create-link {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.projects-filter-create-link:hover {
  color: var(--text);
}
.projects-filter-create-sep {
  color: var(--faint);
  user-select: none;
}
.projects-filter-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
}
.projects-empty {
  padding: 2rem 1.5rem;
  text-align: center;
  max-width: 420px;
  margin: 0 auto;
}
.projects-empty h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.projects-empty p {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 1.1rem;
}
.projects-grid {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  width: 100%;
}
.project-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 0.95rem 1.1rem;
  text-decoration: none;
  color: inherit;
}
.project-card-ratio {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1.5px solid var(--border-strong);
  border-radius: 8px;
  background: color-mix(in srgb, var(--text) 4%, transparent);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 650;
  letter-spacing: 0.03em;
}
.project-card-ratio.is-landscape {
  width: 46px;
  height: 28px;
}
.project-card-ratio.is-portrait {
  width: 24px;
  height: 40px;
}
.project-card-ratio.is-square {
  width: 34px;
  height: 34px;
}
.project-card-body {
  min-width: 0;
}
.project-card-title {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-card-meta {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-card-status {
  flex-shrink: 0;
  white-space: nowrap;
}

/* ── Project detail page ── */
.project-detail-page .main-content {
  padding-top: 1.5rem;
  max-width: var(--workspace-wide);
}
.pd-shell {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
}
.pd-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}
.pd-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.pd-back svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}
.pd-back:hover { color: var(--text); }
.pd-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  max-width: 100%;
}
.pd-hero {
  padding: 1.15rem;
  overflow: hidden;
}
.pd-hero-grid {
  display: grid;
  grid-template-columns: minmax(200px, 280px) minmax(0, 1fr);
  gap: 1.35rem;
  align-items: start;
}
.pd-preview-wrap { min-width: 0; }
.pd-preview-frame {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: color-mix(in srgb, var(--text) 4%, var(--bg-elevated));
  aspect-ratio: 16 / 9;
}
.pd-preview-frame.ratio-916 { aspect-ratio: 9 / 16; max-width: 220px; margin: 0 auto; }
.pd-preview-frame img,
.pd-preview-frame video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pd-preview-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  height: 100%;
  min-height: 140px;
  padding: 1.25rem;
  text-align: center;
}
.pd-preview-empty p {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
  max-width: 16rem;
}
.pd-preview-ratio {
  position: absolute;
  top: 0.55rem;
  left: 0.55rem;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  font-size: 0.62rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border: 1px solid var(--border);
  color: var(--muted);
}
.pd-summary { min-width: 0; }
.pd-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.pd-title {
  font-size: clamp(1.15rem, 2.2vw, 1.55rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.pd-meta {
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.86rem;
}
.pd-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 1.1rem;
}
.pd-stat {
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--text) 2.5%, transparent);
}
.pd-stat-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
.pd-stat-value {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.02em;
}
.pd-progress-block {
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.pd-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.pd-progress-head strong {
  color: var(--text);
  font-size: 0.88rem;
}
.pd-progress-bar {
  height: 6px;
  margin-bottom: 0.85rem;
}
.pd-pipeline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.65rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.pd-pipeline-step {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.76rem;
  color: var(--muted);
}
.pd-pipeline-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border-strong);
  flex-shrink: 0;
}
.pd-pipeline-step.is-done {
  color: var(--text);
}
.pd-pipeline-step.is-done .pd-pipeline-dot {
  background: var(--accent-line);
}
.pd-pipeline-step.is-active {
  color: var(--text);
  font-weight: 600;
}
.pd-pipeline-step.is-active .pd-pipeline-dot {
  background: var(--accent-line);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-line) 28%, transparent);
  animation: pd-pulse 1.4s ease-in-out infinite;
}
@keyframes pd-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.pd-section {
  padding: 1.15rem 1.15rem 1.25rem;
}
.pd-section-head {
  margin-bottom: 1rem;
}
.pd-section-head h2 {
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.pd-section-head p {
  margin-top: 0.25rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.pd-audio-player {
  width: 100%;
  margin-bottom: 0.75rem;
}
.pd-audio-download { margin-top: 0; }
.pd-scene-grid {
  margin-top: 0;
}
.pd-scene-card {
  padding: 0.65rem !important;
  overflow: hidden;
}
.pd-scene-body {
  padding: 0.55rem 0.15rem 0.1rem;
}
.pd-scene-narration {
  margin-top: 0.45rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pd-scene-download {
  display: inline-block;
  margin-top: 0.45rem;
  font-size: 0.74rem;
  color: var(--muted);
  text-decoration: none;
}
.pd-scene-download:hover { color: var(--text); }
.pd-danger-zone {
  display: flex;
  justify-content: flex-start;
  padding-top: 0.25rem;
  padding-bottom: 1rem;
}
.pd-delete-btn {
  color: var(--red) !important;
  border-color: color-mix(in srgb, var(--red) 35%, var(--border)) !important;
}
.pd-delete-btn:hover {
  background: color-mix(in srgb, var(--red) 8%, var(--surface-hover)) !important;
  border-color: color-mix(in srgb, var(--red) 50%, var(--border)) !important;
}
.pd-error { margin-top: 0; }

@media (max-width: 768px) {
  .project-detail-page .main-content { padding-top: 0; }
  .pd-hero-grid {
    grid-template-columns: 1fr;
  }
  .pd-preview-frame.ratio-916 { max-width: 160px; }
  .pd-toolbar-actions {
    width: 100%;
  }
  .pd-toolbar-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
  .pd-stats {
    grid-template-columns: 1fr;
  }
}

.dashboard-body .projects-create-link,
.dashboard-body .projects-filter-btn,
.dashboard-body .project-card {
  background-color: var(--glass);
  border-color: var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}
.dashboard-body .projects-create-link.is-primary,
.dashboard-body .projects-filter-btn.is-active {
  background: var(--btn-bg);
  color: var(--btn-fg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.section-title {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 0.85rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 2rem;
}
.stat-card { padding: 1.05rem 1.15rem; }
.stat-card .stat-label { font-size: 0.72rem; color: var(--muted); letter-spacing: 0.03em; text-transform: uppercase; }
.stat-card .stat-value {
  font-size: 1.55rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  margin-top: 0.2rem;
  color: var(--text);
}

.studio-windows,
.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  margin-bottom: 2.25rem;
}
.tool-card {
  display: flex;
  gap: 0.95rem;
  align-items: flex-start;
  color: inherit;
  padding: 1.2rem 1.25rem;
}
.tool-card strong { display: block; font-size: 0.95rem; letter-spacing: -0.02em; }
.tool-card p { color: var(--muted); font-size: 0.82rem; margin-top: 0.2rem; }

.type-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.6rem;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 0.65rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.project-list { display: flex; flex-direction: column; gap: 0.45rem; }
.project-item {
  display: flex; align-items: center; gap: 0.9rem;
  padding: 0.95rem 1.15rem;
  text-decoration: none; color: inherit;
}
.project-item:hover { color: inherit; }

.status-badge {
  display: inline-block; padding: 0.18rem 0.55rem; border-radius: 999px;
  font-size: 0.68rem; font-weight: 550; border: 1px solid;
}
.status-green { color: var(--green); background: color-mix(in srgb, var(--green) 10%, transparent); border-color: color-mix(in srgb, var(--green) 22%, transparent); }
.status-amber { color: var(--amber); background: color-mix(in srgb, var(--amber) 10%, transparent); border-color: color-mix(in srgb, var(--amber) 22%, transparent); }
.status-red { color: var(--red); background: color-mix(in srgb, var(--red) 10%, transparent); border-color: color-mix(in srgb, var(--red) 22%, transparent); }
.status-violet { color: var(--text); background: var(--surface); border-color: var(--border-strong); }
.status-gray { color: var(--muted); background: var(--surface); border-color: var(--border); }

.back-link { color: var(--muted); font-size: 0.82rem; display: inline-block; margin-bottom: 1.25rem; }
.back-link:hover { color: var(--text); }

.empty-state { text-align: center; padding: 3rem 1.5rem; }
.empty-state h3 { font-size: 1.1rem; letter-spacing: -0.02em; margin-bottom: 0.4rem; }
.empty-state p { color: var(--muted); margin: 0.4rem 0 1.25rem; }

.dash-credits-page .workspace {
  display: flex;
  justify-content: center;
}
.plan-board {
  width: 100%;
  max-width: 440px;
  padding: 0.5rem 0 2rem;
}
.plan-board-head {
  margin-bottom: 1.5rem;
}
.plan-kicker {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.45rem;
}
.plan-board-head h1 {
  font-size: 2rem;
  font-weight: 620;
  letter-spacing: -0.04em;
  line-height: 1.15;
}
.plan-cycle {
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 0.92rem;
}
.plan-balance {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 1rem 0 1.25rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.plan-balance span {
  font-size: 0.82rem;
  color: var(--muted);
}
.plan-balance strong {
  font-size: 2rem;
  font-weight: 620;
  letter-spacing: -0.04em;
}
.plan-timer {
  padding: 1.35rem 0 0.4rem;
}
.plan-timer-label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.plan-timer-digits {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.45rem;
}
.plan-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.7rem 0.2rem;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}
.plan-unit strong {
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.plan-unit small {
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--faint);
}
.plan-timer-date {
  margin-top: 0.7rem;
  font-size: 0.78rem;
  color: var(--faint);
}
.plan-cancel-form { margin-top: 1.15rem; }
.plan-cancel-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}
.plan-cancel-btn:hover { color: var(--red); }
.plan-canceled-note {
  margin-top: 1.15rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.plan-history {
  margin-top: 2rem;
}
.plan-history h2 {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.85rem;
}
.plan-history ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.plan-history li {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}
.plan-history li strong {
  display: block;
  font-size: 0.84rem;
  font-weight: 550;
}
.plan-history li span {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  color: var(--faint);
}
.plan-history em {
  font-style: normal;
  font-size: 0.85rem;
  font-weight: 650;
}

.balance-card { display: flex; align-items: baseline; gap: 1.25rem; margin-bottom: 1.75rem; }
.balance-card small { color: var(--muted); font-size: 0.75rem; }
.balance-value { font-size: 2.4rem; font-weight: 650; letter-spacing: -0.04em; line-height: 1; }
.plan-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; margin-bottom: 2rem; }
.plan-card.is-current { border-color: var(--border-strong); }
.plan-card .plan-price { font-size: 1.35rem; font-weight: 650; letter-spacing: -0.03em; margin: 0.4rem 0; }
.plan-card .plan-credits { color: var(--muted); font-size: 0.85rem; }
.tx-row { padding: 0.75rem 1rem; margin-bottom: 0.4rem; display: flex; justify-content: space-between; align-items: center; }
.tx-plus { color: var(--green); font-weight: 650; }
.tx-minus { color: var(--red); font-weight: 650; }

.dash-settings-page .workspace {
  display: flex;
  justify-content: center;
}
.account-board {
  width: 100%;
  max-width: 440px;
  padding: 0.5rem 0 2rem;
}
.account-board-head { margin-bottom: 1.5rem; }
.account-board-head h1 {
  font-size: 1.85rem;
  font-weight: 620;
  letter-spacing: -0.035em;
  line-height: 1.2;
  word-break: break-word;
}
.account-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.35rem 0 1.5rem;
  border-top: 1px solid var(--border);
}
.account-form h2 {
  font-size: 0.92rem;
  font-weight: 620;
  letter-spacing: -0.015em;
}
.account-form .field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.account-form .field span {
  font-size: 0.78rem;
  color: var(--muted);
}
.account-form .btn {
  align-self: flex-start;
  min-width: 8.5rem;
}
.terms-check {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  cursor: pointer;
  user-select: none;
}
.terms-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.terms-box {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 5px;
  border: 1px solid var(--border-strong);
  background: var(--input-bg);
  position: relative;
}
.terms-box::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(45deg, transparent 42%, var(--text) 42%, var(--text) 58%, transparent 58%),
    linear-gradient(-45deg, transparent 42%, var(--text) 42%, var(--text) 58%, transparent 58%);
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.15s var(--ease), transform 0.15s var(--ease);
}
.terms-check input:checked + .terms-box {
  background: var(--bg-elevated);
  border-color: var(--text);
}
.terms-check input:checked + .terms-box::after { opacity: 1; transform: scale(1); }
.terms-check input:focus-visible + .terms-box { box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 35%, transparent); }
.terms-text {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}
.terms-text a { color: var(--text); text-underline-offset: 2px; }
.auth-box .terms-check { margin: 0.15rem 0 1.15rem; }
.settings-legal-links {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.85rem;
  margin-top: 0.85rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.settings-legal-links a { color: var(--text); text-underline-offset: 2px; }
.terms-doc p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 0.9rem;
}
.terms-doc p:last-child { margin-bottom: 0; }

.settings-row {
  display: flex; justify-content: space-between; padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}
.settings-row:last-child { border-bottom: none; }
.settings-window {
  padding: 1.4rem 1.5rem 1.2rem;
}
.settings-window section + section {
  margin-top: 1.35rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--border);
}

.niche-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0.5rem; }
.niche-custom-wrap,
.lo-niche-custom {
  margin-top: 0.85rem;
  text-align: left;
}
.niche-custom-wrap .field,
.lo-niche-custom-field {
  margin: 0;
}
.niche-custom-wrap .field span,
.lo-niche-custom-field span {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.niche-btn {
  padding: 0.75rem 0.85rem; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: transparent; color: var(--muted); cursor: pointer; font-size: 0.84rem; text-align: left;
  font-family: inherit; transition: border-color 0.18s, color 0.18s, background 0.18s;
}
.niche-btn.active, .niche-btn:hover {
  background: var(--surface-hover); border-color: var(--border-strong); color: var(--text);
}

.style-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 0.45rem;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 0.25rem;
}
.style-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem;
  padding: 0.7rem 0.4rem; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: transparent; color: var(--muted); cursor: pointer; font-size: 0.7rem;
  text-align: center; line-height: 1.2; min-height: 56px; font-family: inherit;
  transition: border-color 0.18s, color 0.18s, background 0.18s;
}
.style-btn .style-emoji { display: none; }
.style-btn .style-label { font-weight: 550; }
.style-btn.active, .style-btn:hover {
  background: var(--surface-hover); border-color: var(--border-strong); color: var(--text);
}

.character-upload { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.character-preview {
  display: flex; align-items: center; gap: 0.75rem; margin-top: 0.5rem;
  padding: 0.5rem; border-radius: var(--radius-sm); border: 1px solid var(--border); width: 100%;
}
.character-preview img { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; }
.character-preview span { font-size: 0.8rem; color: var(--muted); }

.steps { display: flex; gap: 0.35rem; overflow-x: auto; padding-bottom: 0.35rem; margin-bottom: 1.35rem; }
.step-pill {
  padding: 0.4rem 0.75rem; border-radius: 999px; font-size: 0.74rem; font-weight: 550;
  border: 1px solid transparent; color: var(--faint); white-space: nowrap;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.step-pill.active { background: var(--surface); color: var(--text); border-color: var(--border); }
.step-pill.done { color: var(--muted); }

.scene-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.85rem; }
.scene-grid.wide { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.scene-card img { width: 100%; border-radius: 8px; object-fit: cover; margin-bottom: 0.5rem; }
.scene-card .ratio-916 { aspect-ratio: 9/16; }
.scene-card .ratio-169 { aspect-ratio: 16/9; }
.scene-placeholder {
  background: var(--surface); border-radius: 8px;
  display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 0.8rem;
}
.scene-card-caption { font-size: 0.75rem; color: var(--muted); margin-top: 0.5rem; }

.footer { text-align: center; padding: 2rem; color: var(--faint); font-size: 0.85rem; border-top: 1px solid var(--border); }

.hidden { display: none !important; }
.auth-page-body:not(.is-auth-ready) .auth-register .auth-step {
  display: block !important;
}
.loading { opacity: 0.6; pointer-events: none; }

.credit-hint { font-size: 0.75rem; color: var(--muted); margin-bottom: 1rem; }
.progress {
  margin-top: 0.75rem; height: 4px; border-radius: 999px;
  background: var(--surface); overflow: hidden;
}
.progress-bar {
  height: 100%; width: 0; border-radius: 999px;
  background: var(--accent-line);
  transition: width 0.3s var(--ease);
}
.scene-card video { width: 100%; border-radius: 8px; object-fit: cover; display: block; margin-bottom: 0.5rem; }

/* ── Wizards ── */
.long-wizard, .short-wizard { display: flex; flex-direction: column; gap: 1.35rem; position: relative; }

.script-gen-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.script-gen-overlay.is-error {
  background: color-mix(in srgb, var(--red) 12%, var(--bg) 88%);
}
.script-gen-overlay.is-error .script-gen-label {
  color: var(--red);
  max-width: 28rem;
  line-height: 1.45;
}
.script-gen-overlay.is-error .script-gen-ring {
  display: none;
}
.script-gen-overlay.is-error .script-gen-bar {
  display: none;
}
.script-gen-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.15rem;
  width: min(100%, 300px);
  text-align: center;
}
.script-gen-ring {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 3px solid color-mix(in srgb, var(--border-strong) 55%, transparent);
  border-top-color: var(--accent-line);
  border-right-color: color-mix(in srgb, var(--accent-line) 45%, transparent);
  animation: script-gen-spin 0.85s linear infinite;
}
.script-gen-bar {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: var(--surface);
  overflow: hidden;
}
.script-gen-bar span {
  display: block;
  height: 100%;
  width: 42%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--accent-line), transparent);
  animation: script-gen-bar 1.35s ease-in-out infinite;
}
.script-gen-label {
  font-size: 0.95rem;
  font-weight: 580;
  color: var(--text);
  letter-spacing: -0.01em;
  animation: script-gen-pulse 1.6s ease-in-out infinite;
}
@keyframes script-gen-spin {
  to { transform: rotate(360deg); }
}
@keyframes script-gen-bar {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}
@keyframes script-gen-pulse {
  0%, 100% { opacity: 0.72; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .script-gen-ring,
  .script-gen-bar span,
  .script-gen-label {
    animation: none;
  }
  .script-gen-label { opacity: 1; }
}

.lw-hero {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.15rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--border);
}
.lw-format-badge {
  display: inline-flex; align-items: center; gap: 0.55rem;
  margin-bottom: 0.7rem;
  color: var(--muted);
}
.lw-format-badge strong { display: block; font-size: 0.78rem; color: var(--text); font-weight: 600; }
.lw-format-badge span { font-size: 0.72rem; color: var(--muted); }
.lw-format-badge-sm { margin-bottom: 0; }
.lw-format-icon { color: var(--muted); }
.lw-format-icon .dash-icon { width: 1rem; height: 1rem; }
.lw-title { font-size: 1.55rem; font-weight: 650; letter-spacing: -0.03em; line-height: 1.15; }
.lw-subtitle { color: var(--muted); font-size: 0.9rem; margin-top: 0.35rem; max-width: 520px; }
.lw-credit-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; align-self: center; }
.lw-chip {
  padding: 0.3rem 0.65rem; border-radius: 999px; font-size: 0.72rem; color: var(--muted);
  border: 1px solid var(--border);
}
.lw-chip strong { color: var(--text); font-weight: 650; }

.lw-steps {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.25rem;
}
.lw-step {
  display: flex; align-items: center; gap: 0.55rem; padding: 0.55rem 0.35rem !important;
  border-radius: 0 !important; border: none !important; border-bottom: 1px solid var(--border) !important;
  cursor: default; background: transparent !important;
}
.lw-step-num {
  font-size: 0.68rem; font-weight: 650; color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.lw-step-label { font-size: 0.78rem; font-weight: 550; }
.lw-step.active { color: var(--text) !important; border-bottom-color: var(--accent-line) !important; }
.lw-step.active .lw-step-num { color: var(--text); }
.lw-step.done { color: var(--muted) !important; border-bottom-color: var(--border-strong) !important; }
.lw-step.done .lw-step-num { color: var(--muted); }

.lw-setup-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.15rem; align-items: start;
}
.lw-setup-single { grid-template-columns: 1fr; }
.lw-main-col, .lw-sidebar-col { display: flex; flex-direction: column; gap: 0.85rem; }
.lw-sidebar-col { position: sticky; top: 1.5rem; }

.lw-panel {
  padding: 1.2rem 1.3rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
}
.lw-panel-compact { padding: 1rem 1.1rem; }
.lw-panel-head { display: flex; gap: 0.7rem; margin-bottom: 1rem; }
.lw-panel-head-sm { margin-bottom: 0.75rem; }
.lw-panel-head h2 { font-size: 0.92rem; font-weight: 650; letter-spacing: -0.02em; margin-bottom: 0.12rem; }
.lw-panel-head p { font-size: 0.78rem; color: var(--muted); line-height: 1.45; }
.lw-panel-icon { display: none; }
.lw-form-group { margin-bottom: 0 !important; }
.lw-form-group label { font-weight: 500; color: var(--muted); }

.lw-topic-input { min-height: 88px; resize: vertical; line-height: 1.5; }

.lw-niche-grid { grid-template-columns: repeat(3, 1fr); }
.lw-niche-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0;
  padding: 0.7rem 0.8rem !important; min-height: 0;
}
.lw-niche-emoji { display: none; }

.lw-style-groups { display: flex; flex-direction: column; gap: 1rem; }
.lw-style-group-label {
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--faint); margin-bottom: 0.5rem;
}
.lw-style-grid {
  max-height: none; overflow: visible; padding-right: 0;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
}
.lw-style-btn { min-height: 48px; border-radius: 8px; }

.lw-preview-card {
  padding: 1rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
}
.lw-preview-frame {
  border-radius: 8px; overflow: hidden; margin-bottom: 0.85rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}
.lw-preview-inner {
  aspect-ratio: 16/9; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 0.2rem;
  color: var(--text); font-weight: 650; font-size: 1rem; letter-spacing: -0.02em;
}
.lw-preview-inner small { font-size: 0.72rem; color: var(--muted); font-weight: 500; }
.lw-preview-list {
  list-style: none; display: flex; flex-direction: column; gap: 0.4rem;
}
.lw-preview-list li {
  font-size: 0.78rem; color: var(--muted); padding-left: 0.85rem; position: relative;
}
.lw-preview-list li::before {
  content: ''; position: absolute; left: 0; top: 0.55em;
  width: 4px; height: 4px; border-radius: 50%; background: var(--faint);
}

.lw-field-hint, .lw-field-note {
  font-size: 0.78rem; color: var(--muted); line-height: 1.45; margin-bottom: 0.75rem;
}
.lw-field-note {
  margin: 0.5rem 0 0; padding: 0.5rem 0.65rem; border-radius: 8px;
  background: transparent; border: 1px dashed var(--border);
}

.duration-panel { margin-bottom: 0; }
.duration-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.duration-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.2rem;
  padding: 0.7rem 0.8rem; border-radius: var(--radius-sm); text-align: left;
  border: 1px solid var(--border); background: transparent;
  color: var(--muted); cursor: pointer; transition: border-color 0.18s, background 0.18s;
  font-family: inherit;
}
.duration-btn-label { font-size: 0.92rem; font-weight: 650; color: var(--text); letter-spacing: -0.02em; }
.duration-btn-desc { font-size: 0.72rem; line-height: 1.35; color: var(--muted); }
.duration-btn:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.duration-btn.active {
  border-color: var(--border-strong); background: var(--surface-hover);
}
.duration-plan-summary {
  font-size: 0.8rem; color: var(--muted); line-height: 1.45;
  padding: 0.6rem 0.7rem; border-radius: 8px;
  border: 1px solid var(--border);
}
.lw-optional-tag {
  display: inline-block; margin-left: 0.3rem; padding: 0.08rem 0.4rem;
  border-radius: 999px; font-size: 0.6rem; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--faint); border: 1px solid var(--border); vertical-align: middle;
}

.lw-character-upload { flex-direction: column; align-items: stretch; }
.lw-upload-btn { width: 100%; justify-content: center; }
.lw-character-preview { margin-top: 0 !important; }

.lw-submit-card {
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}
.lw-credit-hint { margin-bottom: 0.85rem !important; line-height: 1.5; }
.lw-submit-btn { padding: 0.85rem 1.15rem; font-size: 0.9rem; }

.lw-script-header {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1rem;
  margin-bottom: 1rem;
}
.lw-script-badge {
  display: inline-block; font-size: 0.66rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 0.3rem;
}
.lw-script-header h2 { font-size: 1.25rem; font-weight: 650; letter-spacing: -0.03em; }
.lw-script-meta { color: var(--muted); font-size: 0.85rem; margin-top: 0.25rem; }
.lw-script-stats { display: flex; gap: 0.35rem; }
.lw-stat-pill {
  padding: 0.25rem 0.55rem; border-radius: 999px; font-size: 0.7rem; font-weight: 550;
  border: 1px solid var(--border); color: var(--muted);
}

.lw-scene-list { display: flex; flex-direction: column; gap: 0.65rem; margin-bottom: 1.15rem; }
.lw-scene-item { border-left: 2px solid var(--border-strong) !important; }
.lw-scene-item-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.lw-scene-duration { font-size: 0.75rem; color: var(--muted); }

.lw-progress-panel { margin-bottom: 1rem; }
.lw-progress-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 0.75rem; }
.lw-progress-head h2 { font-size: 1.05rem; font-weight: 650; }
.lw-progress-text { color: var(--muted); font-size: 0.85rem; margin-top: 0.2rem; }
.lw-progress { margin-top: 0 !important; height: 4px; }
.lw-image-grid { margin-bottom: 1.15rem; }
.lw-image-grid .scene-card {
  padding: 0.65rem !important; border-radius: 12px;
  border: 1px solid var(--border); overflow: hidden;
}
.lw-image-grid .scene-card:hover { border-color: var(--border-strong); }
.lw-image-grid .scene-card img,
.lw-image-grid .scene-card .scene-placeholder { border-radius: 8px; margin-bottom: 0.65rem; }

.lw-action-btn { padding: 0.85rem 1.15rem; font-size: 0.9rem; margin-top: 0.25rem; }

.lw-done-card {
  text-align: center; padding: 2.5rem 2rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
}
.lw-done-icon { display: none; }
.lw-done-card h2 { font-size: 1.35rem; font-weight: 650; letter-spacing: -0.03em; margin-bottom: 0.35rem; }
.lw-done-sub { color: var(--muted); margin-bottom: 1.25rem; }
.lw-done-audio { max-width: 480px; margin: 0 auto 1.5rem; }
.lw-done-link { min-width: 200px; }

/* ── Video editor ── */
.video-editor {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.2rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}
.video-editor-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.video-editor-badge {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.video-editor-head h2 { font-size: 1.2rem; font-weight: 650; letter-spacing: -0.03em; }
.video-editor-meta { font-size: 0.8rem; color: var(--muted); margin-top: 0.25rem; }

.video-editor-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 220px;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border);
}
.video-editor-stage.ratio-169 { aspect-ratio: 16 / 9; }
.preview-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.45s ease;
  transform: scale(1);
}
.preview-slide.is-visible {
  opacity: 1;
  animation: previewKenBurns 12s ease-out forwards;
}
@keyframes previewKenBurns {
  from { transform: scale(1); }
  to { transform: scale(1.07); }
}
.video-editor-scene-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 2;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
}
.video-editor-gradient {
  position: absolute;
  inset: auto 0 0 0;
  height: 45%;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  pointer-events: none;
  z-index: 1;
}
.video-editor-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  margin: 0;
  padding: 1.25rem 1rem 1rem;
  font-size: 0.85rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
  max-height: 38%;
  overflow: hidden;
}

.video-editor-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.video-editor-play {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 0.85rem;
  cursor: pointer;
  flex-shrink: 0;
}
.video-editor-time {
  font-size: 0.78rem;
  color: var(--muted);
  min-width: 88px;
  font-variant-numeric: tabular-nums;
}
.video-editor-seek {
  flex: 1;
  accent-color: var(--accent-line);
  height: 6px;
}

.video-editor-timeline-wrap { margin-top: 0.25rem; }
.video-editor-timeline-label {
  font-size: 0.7rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.video-editor-timeline {
  display: flex;
  gap: 2px;
  height: 52px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
}
.timeline-scene {
  position: relative;
  padding: 0;
  border: none;
  cursor: pointer;
  overflow: hidden;
  min-width: 28px;
  opacity: 0.7;
  transition: opacity 0.2s, box-shadow 0.2s;
}
.timeline-scene img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.timeline-scene span {
  position: absolute;
  bottom: 2px;
  right: 3px;
  font-size: 0.6rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px #000;
}
.timeline-scene:hover { opacity: 1; }
.timeline-scene.active {
  opacity: 1;
  box-shadow: inset 0 0 0 2px var(--accent-line);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.video-editor-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.project-scenes-details {
  margin-top: 1rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}
.project-scenes-details summary {
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  list-style: none;
}
.project-scenes-details summary::-webkit-details-marker { display: none; }
.project-scenes-details summary::before {
  content: '▸ ';
  color: var(--muted);
}
.project-scenes-details[open] summary::before { content: '▾ '; }

.action-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }

@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 960px) {
  .lw-setup-grid { grid-template-columns: 1fr; }
  .lw-sidebar-col { position: static; }
  .lw-niche-grid { grid-template-columns: repeat(2, 1fr); }
  .lw-steps { grid-template-columns: repeat(2, 1fr); }
  .studio-windows, .tool-grid, .plan-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.3s var(--ease); }
  .sidebar.open { transform: translateX(0); }
  html.ds-sidebar-collapsed .sidebar,
  .dashboard-layout.is-sidebar-collapsed .sidebar {
    transform: translateX(-100%);
  }
  .sidebar-toggle,
  .sidebar-edge-toggle,
  .sidebar-reveal { display: none !important; }
  .sidebar-overlay.open {
    display: block; position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.5); z-index: 150;
  }
  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 0 1.15rem 2.5rem;
    align-items: stretch;
  }
  .dash-top-chrome {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: sticky;
    top: 0;
    z-index: 170;
    width: auto;
    box-sizing: border-box;
    min-height: calc(44px + 0.75rem + max(0.65rem, env(safe-area-inset-top, 0px)));
    margin: 0 -1.15rem 0.75rem;
    padding:
      max(0.65rem, env(safe-area-inset-top, 0px))
      max(0.85rem, env(safe-area-inset-right, 0px))
      0.75rem
      max(0.65rem, env(safe-area-inset-left, 0px));
    border-bottom: 1px solid var(--border);
    background: var(--glass);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
  }
  .mobile-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
    min-height: 44px;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .dash-theme-corner {
    position: static;
    top: auto;
    right: auto;
    flex-shrink: 0;
    z-index: auto;
    display: flex;
    align-items: center;
  }
  .dash-theme-corner .lp-theme-switch {
    min-height: 44px;
    padding: 0.25rem;
  }
  .dash-theme-corner .lp-theme-btn {
    width: 2.75rem;
    height: 2.75rem;
    min-width: 44px;
    min-height: 44px;
  }
  .dash-theme-corner .lp-theme-glow {
    top: 0.25rem;
    left: 0.25rem;
    width: 2.75rem;
    height: 2.75rem;
  }
  [data-theme="dark"] .dash-theme-corner .lp-theme-glow {
    transform: translateX(calc(2.75rem + 0.15rem));
  }
  .menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    flex-shrink: 0;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition:
      background 0.2s var(--ease),
      border-color 0.2s var(--ease),
      transform 0.15s var(--ease);
  }
  .menu-btn:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
  }
  .menu-btn:active { transform: scale(0.96); }
  .menu-btn .dash-icon {
    width: 20px;
    height: 20px;
  }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Long video onboarding (mascot) ── */
.lo-toolbar {
  width: 100%;
  max-width: var(--workspace-wide);
  margin: 0 auto 0.35rem;
  display: flex;
  justify-content: flex-end;
}
.lo-toolbar.hidden { display: none; }
.lo-restart-btn {
  font-size: 0.78rem;
  color: var(--muted);
}
.lo-restart-btn:hover { color: var(--text); }
.lo-shell {
  width: min(100%, 680px);
  max-width: 680px;
  min-height: calc(100vh - 6.5rem);
  margin-inline: auto;
  padding: 1.5rem 0 2rem;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  align-self: center;
}
.lo-card {
  width: 100%;
  padding: 1.75rem 1.7rem 1.45rem;
  border-radius: 26px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.07);
}
.lo-dialogue {
  display: flex;
  align-items: flex-end;
  gap: 0.95rem;
  margin-bottom: 1.35rem;
}
.lo-mascot {
  flex: 0 0 108px;
  width: 108px;
  align-self: flex-end;
  transform-origin: 50% 90%;
}
.lo-mascot img {
  display: block;
  width: 108px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.12));
}
.lo-mascot.is-speaking img {
  animation: loMascotTalk 0.42s var(--ease) infinite;
}
.lo-mascot.is-listen img {
  animation: loMascotListen 2.4s var(--ease) infinite;
}
.lo-mascot img.lo-mascot-pop {
  animation: loMascotPop 0.5s var(--ease);
}
@keyframes loMascotPop {
  0% { transform: translateY(8px) scale(0.9); opacity: 0.4; }
  55% { transform: translateY(-4px) scale(1.06); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes loMascotTalk {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-3px) rotate(2deg); }
}
@keyframes loMascotListen {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.lo-bubble {
  position: relative;
  flex: 1;
  min-width: 0;
  padding: 1.05rem 1.15rem 1rem;
  border-radius: 18px 18px 18px 6px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.lo-bubble::before {
  content: '';
  position: absolute;
  left: -7px;
  bottom: 14px;
  width: 12px;
  height: 12px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transform: rotate(45deg);
}
.lo-question {
  font-size: 1.12rem;
  font-weight: 580;
  letter-spacing: -0.02em;
  line-height: 1.45;
  min-height: 3.2rem;
  margin: 0;
}
.lo-reply {
  padding-left: 0;
}
.lo-cursor {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 2px;
  background: var(--text);
  vertical-align: -0.12em;
  opacity: 0;
}
.lo-cursor.is-blink {
  opacity: 1;
  animation: loBlink 0.9s step-end infinite;
}
@keyframes loBlink {
  50% { opacity: 0; }
}
.lo-answer { min-height: 128px; }
.lo-step.hidden { display: none; }
.lo-topic {
  min-height: 120px;
  resize: none;
  border-radius: 16px;
  padding: 1rem 1.1rem;
  font-size: 0.98rem;
}
.lo-prompt {
  min-height: 200px;
}
.lo-audio-title {
  margin-bottom: 0.65rem;
  border-radius: 14px;
}
.lo-audio-upload {
  display: block;
  margin-bottom: 0.5rem;
}
.lo-audio-pick {
  display: block;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lo-format-picker {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.2s var(--ease),
    background 0.2s var(--ease),
    transform 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}
.lo-format-picker:hover {
  border-color: color-mix(in srgb, var(--text) 18%, var(--border));
  background: var(--surface-hover);
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.06);
}
.lo-format-picker-visual {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--text) 5%, transparent);
  border: 1px solid var(--border);
}
.lo-format-picker-visual .lo-format-frame {
  opacity: 1;
  transform: scale(1.15);
}
.lo-format-picker-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.lo-format-picker-copy strong {
  font-size: 0.96rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}
.lo-format-picker-copy span {
  font-size: 0.76rem;
  color: var(--muted);
}
.lo-format-picker-action {
  flex: 0 0 auto;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.lo-format-modal {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.32s var(--ease), visibility 0.32s var(--ease);
}
.lo-format-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.lo-format-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 14, 0.22);
}
[data-theme="light"] .lo-format-modal-backdrop {
  background: rgba(20, 20, 24, 0.16);
}
.lo-format-modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  max-height: min(88vh, 640px);
  overflow: auto;
  padding: 1.25rem 1.2rem 1.1rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  box-shadow: 0 24px 56px rgba(8, 10, 14, 0.16);
  transform: translateY(10px) scale(0.985);
  opacity: 0;
  transition:
    transform 0.34s var(--ease),
    opacity 0.34s var(--ease);
}
.lo-format-modal.is-open .lo-format-modal-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.lo-format-modal-head h2 {
  font-size: 1.08rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  margin: 0 0 0.35rem;
}
.lo-format-modal-head p {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
  margin-bottom: 0.95rem;
}
.lo-format-modal-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
body.lo-format-modal-open {
  overflow: hidden;
}

.lo-format-grid,
.lo-format-modal-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.lo-format {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.78rem 0.9rem;
  width: 100%;
  text-align: left;
}
.lo-format.is-active {
  border-color: var(--border-strong);
  background: var(--surface-hover);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 8%, transparent);
}
.lo-format-frame {
  flex: 0 0 auto;
  border: 1.5px solid currentColor;
  border-radius: 3px;
  opacity: 0.72;
  background: color-mix(in srgb, var(--text) 6%, transparent);
}
.lo-format-frame.is-landscape { width: 34px; height: 20px; }
.lo-format-frame.is-portrait { width: 16px; height: 28px; }
.lo-format-frame.is-square { width: 22px; height: 22px; }
.lo-format.is-active .lo-format-frame { opacity: 1; }
.lo-format-copy {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}
.lo-format-copy strong {
  font-size: 0.9rem;
  color: var(--text);
}
.lo-format-copy span {
  font-size: 0.74rem;
  color: var(--muted);
}
.lo-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}
.lo-mode {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 1rem 1.05rem;
  text-align: left;
}
.lo-mode strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
}
.lo-mode span {
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.45;
}
.lo-hint {
  margin-top: 0.65rem;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
}
.lo-duration-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  width: 100%;
}
.lo-duration-wrap::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: calc(84px - 1.15rem);
  height: 2.3rem;
  border-top: 1px solid color-mix(in srgb, var(--accent-line) 45%, var(--border));
  border-bottom: 1px solid color-mix(in srgb, var(--accent-line) 45%, var(--border));
  pointer-events: none;
  z-index: 2;
}
.lo-duration-wheel {
  width: 100%;
  max-width: 100%;
  height: 168px;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  mask-image: linear-gradient(180deg, transparent, #000 18%, #000 82%, transparent);
  -webkit-overflow-scrolling: touch;
  scroll-padding-block: calc(50% - 1.15rem);
}
.lo-wheel-inner { padding: calc(50% - 1.15rem) 0; }
.lo-wheel-item {
  display: block;
  width: 100%;
  padding: 0.65rem 1rem;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 550;
  font-family: inherit;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition: color 0.2s, background 0.2s;
  border-radius: 8px;
}
.lo-wheel-item:hover {
  color: var(--text);
  background: var(--surface-hover);
}
.lo-wheel-item.is-active {
  color: var(--text);
  font-weight: 700;
  background: color-mix(in srgb, var(--accent-line) 14%, var(--surface-hover));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-line) 40%, var(--border-strong));
}
.lo-scene-slider input[type="range"] {
  width: 100%;
  accent-color: var(--accent-line);
}
.lo-scene-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 0.55rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.lo-niche-grid,
.lo-style-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.45rem;
}
.lo-choice {
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.18s, color 0.18s, background 0.18s, box-shadow 0.18s;
}
.lo-choice.is-active {
  border-color: var(--border-strong);
  background: var(--surface-hover);
  color: var(--text);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-line) 35%, transparent);
}
.lo-choice:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
  color: var(--text);
}
.lo-voice-tone { margin-top: 0.55rem; }
.lo-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.95rem;
}
.lo-back { flex: 0 0 auto; }
.lo-next { flex: 1; }
.lo-progress-wrap {
  margin: 0 0 1.1rem;
}
.lo-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
}
.lo-progress-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.lo-progress {
  height: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border-strong) 72%, transparent);
  overflow: hidden;
}
.lo-progress span {
  display: block;
  height: 100%;
  width: 0;
  min-width: 0;
  border-radius: inherit;
  background: var(--text);
  transition: width 0.35s var(--ease);
}
.long-wizard-shell.lo-from-onboarding .lw-hero,
.long-wizard-shell.lo-from-onboarding .lw-steps,
.long-wizard-shell.lo-from-onboarding #step-setup,
.short-wizard-shell.lo-from-onboarding .lw-hero,
.short-wizard-shell.lo-from-onboarding .lw-steps,
.short-wizard-shell.lo-from-onboarding #step-setup {
  display: none !important;
}
.long-wizard-shell.lo-from-onboarding #wizardError:not(.hidden),
.short-wizard-shell.lo-from-onboarding #wizardError:not(.hidden) {
  display: block;
  margin: 0 auto;
  max-width: 680px;
  width: 100%;
}
.wizard-long-page .main-content,
.wizard-short-page .main-content,
.wizard-music-page .main-content {
  align-items: center;
}
.wizard-long-page .workspace:has(#wizardOnboarding:not(.hidden)),
.wizard-short-page .workspace:has(#wizardOnboarding:not(.hidden)),
.wizard-music-page .workspace:has(#wizardOnboarding:not(.hidden)),
.workspace:has(> .lo-shell:not(.hidden)) {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  flex: 1;
  width: 100%;
}
.lo-preset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}
.lo-preset {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  text-align: left;
  padding: 0.85rem 0.9rem;
}
.lo-preset-label {
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.lo-preset-desc {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.35;
}
.lo-preset.is-active .lo-preset-label {
  color: var(--text);
}

@media (max-width: 640px) {
  .lo-shell {
    max-width: 100%;
    min-height: calc(100vh - 5.5rem);
  }
  .lo-card { padding: 1.25rem 1.1rem 1.1rem; }
  .lo-mascot,
  .lo-mascot img { width: 78px; flex-basis: 78px; }
  .lo-bubble { padding: 0.9rem 0.95rem; }
  .lo-question { font-size: 1.02rem; }
}

/* ── Admin panel (/painel) ── */
.workspace-wide-admin {
  max-width: var(--workspace-wide);
}
.admin-stats-grid {
  margin-bottom: 1.5rem;
}
.admin-stats-grid .stat-sub {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}
.admin-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.admin-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.admin-kpi {
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.admin-kpi strong {
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}
.admin-panel-card {
  padding: 1.15rem 1.25rem 1.25rem;
  margin-bottom: 1rem;
}
.admin-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}
.admin-panel-head .section-title { margin-bottom: 0; }
.admin-table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}
.admin-table th,
.admin-table td {
  padding: 0.65rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.admin-table th {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-cell-sub {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.1rem;
}
.admin-link {
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.admin-link:hover { opacity: 0.85; }
.admin-empty { padding: 0.5rem 0; font-size: 0.85rem; }
.admin-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.admin-search {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.admin-search .input { min-width: 220px; }
.admin-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--surface-hover);
  border: 1px solid var(--border);
}
.admin-pagination {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.admin-page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
}
.admin-page-link.active,
.admin-page-link:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface-hover);
}
.admin-user-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.admin-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.75rem;
}
.admin-form-wide { max-width: 520px; }
.admin-form .field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.admin-form .field span {
  font-size: 0.75rem;
  color: var(--muted);
}
.admin-subsection {
  margin-top: 1.25rem;
  font-size: 0.82rem;
}
.admin-balance {
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}
.admin-back {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.admin-back:hover { color: var(--text); }
.admin-settings-note {
  font-size: 0.82rem;
  margin-bottom: 0.85rem;
}
.admin-api-status { margin-bottom: 1rem; }
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

@media (max-width: 900px) {
  .admin-two-col,
  .admin-user-grid,
  .admin-kpi-row {
    grid-template-columns: 1fr;
  }
}

/* ── Darkly Editor ── */
.editor-page.dashboard-body {
  overflow: hidden;
}
@media (min-width: 769px) {
  .editor-page .main-content {
    align-items: stretch;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    padding: 1rem 1.25rem 1rem;
  }
}
@media (max-width: 768px) {
  .editor-page .main-content {
    align-items: stretch;
    height: auto;
    max-height: none;
    overflow: visible;
    padding: 0 1.15rem 2.5rem;
  }
}
.editor-page .workspace {
  max-width: none;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.de-continue-card { max-width: 440px; }
.de-continue-check { margin: 0.35rem 0 0.85rem; }

.de-root {
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
}
.de-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  flex-shrink: 0;
  margin-bottom: 0;
}
.de-top h1 {
  font-size: 1.45rem;
  font-weight: 620;
  letter-spacing: -0.03em;
}
.de-top-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.de-top-corner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.editor-page .de-top {
  align-items: center;
  padding-top: 0.15rem;
}
.de-save-state {
  font-size: 0.75rem;
  color: var(--muted);
  min-width: 4rem;
}

/* Idle hub — empty / import picker */
.de-root--idle {
  justify-content: center;
}
.de-root--idle .de-top-brand h1,
.de-root--idle .de-top-brand .plan-kicker {
  visibility: hidden;
  height: 0;
  margin: 0;
  overflow: hidden;
}
.de-root--idle .de-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: 0;
  pointer-events: none;
}
.de-root--idle .de-top-actions {
  pointer-events: auto;
  margin-left: auto;
}
.editor-page .workspace:has(.de-root--idle) {
  align-items: center;
  justify-content: center;
}
.de-idle-hub {
  flex: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem 0 2rem;
  animation: deIdleIn 0.65s var(--ease) both;
}
.de-idle-visual {
  position: relative;
  width: min(100%, 380px);
  margin-bottom: 1.75rem;
}
.de-idle-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(48px);
  opacity: 0.45;
  pointer-events: none;
  animation: deIdleGlow 6s ease-in-out infinite;
}
.de-idle-glow--a {
  width: 140px;
  height: 140px;
  top: -20px;
  left: 10%;
  background: color-mix(in srgb, var(--focus) 55%, transparent);
}
.de-idle-glow--b {
  width: 120px;
  height: 120px;
  bottom: 0;
  right: 8%;
  background: color-mix(in srgb, var(--amber) 45%, transparent);
  animation-delay: -3s;
}
.de-idle-mock {
  position: relative;
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  box-shadow: var(--glass-shadow), 0 24px 48px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}
.de-idle-preview {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}
.de-idle-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0a0a0c;
}
.de-idle-scene {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: deIdleScene 9s ease-in-out infinite;
}
.de-idle-scene--a {
  background:
    radial-gradient(circle at 30% 40%, rgba(147, 197, 253, 0.35), transparent 55%),
    linear-gradient(145deg, #14141a 0%, #08080b 100%);
  animation-delay: 0s;
}
.de-idle-scene--b {
  background:
    radial-gradient(circle at 70% 35%, rgba(251, 191, 36, 0.28), transparent 50%),
    linear-gradient(160deg, #121018 0%, #060608 100%);
  animation-delay: -3s;
}
.de-idle-scene--c {
  background:
    radial-gradient(circle at 50% 60%, rgba(52, 211, 153, 0.22), transparent 52%),
    linear-gradient(135deg, #101014 0%, #070709 100%);
  animation-delay: -6s;
}
.de-idle-caption {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 10%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  animation: deIdleCaption 3.2s ease-in-out infinite;
}
.de-idle-transport {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.65rem;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
}
.de-idle-play-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  position: relative;
  flex-shrink: 0;
  animation: deIdlePlayPulse 2.4s ease-in-out infinite;
}
.de-idle-play-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 52%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 4px 0 4px 7px;
  border-color: transparent transparent transparent var(--text);
}
.de-idle-seek {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.de-idle-seek-fill {
  display: block;
  height: 100%;
  width: 35%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--focus), color-mix(in srgb, var(--focus) 60%, var(--text)));
  animation: deIdleSeek 4s linear infinite;
}
.de-idle-timeline {
  position: relative;
  margin-top: 0.75rem;
  padding: 0.55rem 0.65rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
  overflow: hidden;
}
.de-idle-track {
  display: flex;
  gap: 4px;
  min-height: 18px;
  margin-bottom: 5px;
}
.de-idle-track--audio {
  align-items: flex-end;
  gap: 3px;
  min-height: 22px;
  margin-bottom: 0;
}
.de-idle-clip {
  flex: 1;
  height: 16px;
  border-radius: 4px;
  opacity: 0.85;
  animation: deIdleClipPulse 2.8s ease-in-out infinite;
}
.de-idle-clip--1 {
  background: color-mix(in srgb, var(--text) 18%, var(--surface));
  animation-delay: 0s;
}
.de-idle-clip--2 {
  background: color-mix(in srgb, var(--focus) 28%, var(--surface));
  flex: 1.15;
  animation-delay: -0.6s;
}
.de-idle-clip--3 {
  background: color-mix(in srgb, var(--amber) 24%, var(--surface));
  flex: 0.85;
  animation-delay: -1.2s;
}
.de-idle-wave {
  flex: 1;
  min-width: 4px;
  max-width: 14px;
  border-radius: 2px 2px 1px 1px;
  background: color-mix(in srgb, var(--green) 35%, var(--surface));
  animation: deIdleWave 1.1s ease-in-out infinite;
}
.de-idle-wave:nth-child(1) { height: 8px; animation-delay: 0s; }
.de-idle-wave:nth-child(2) { height: 14px; animation-delay: -0.1s; }
.de-idle-wave:nth-child(3) { height: 10px; animation-delay: -0.2s; }
.de-idle-wave:nth-child(4) { height: 18px; animation-delay: -0.3s; }
.de-idle-wave:nth-child(5) { height: 12px; animation-delay: -0.4s; }
.de-idle-wave:nth-child(6) { height: 16px; animation-delay: -0.5s; }
.de-idle-wave:nth-child(7) { height: 9px; animation-delay: -0.6s; }
.de-idle-wave:nth-child(8) { height: 13px; animation-delay: -0.7s; }
.de-idle-playhead {
  position: absolute;
  top: 0.35rem;
  bottom: 0.35rem;
  width: 2px;
  border-radius: 1px;
  background: var(--red);
  box-shadow: 0 0 8px color-mix(in srgb, var(--red) 50%, transparent);
  left: 12%;
  animation: deIdlePlayhead 4s linear infinite;
  pointer-events: none;
}
.de-idle-copy {
  width: 100%;
  max-width: 480px;
}
.de-idle-title {
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  font-weight: 620;
  letter-spacing: -0.035em;
  line-height: 1.2;
}
.de-idle-lead {
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
  letter-spacing: -0.01em;
}
.de-idle-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin-top: 1.65rem;
}
.de-idle-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 1rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--glass);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
}
.de-idle-action:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
  transform: translateY(-2px);
}
.de-idle-action-kicker {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
}
.de-idle-action strong {
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.de-idle-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 1.25rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.de-idle-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  opacity: 0.85;
  transition: opacity 0.2s var(--ease);
}
.de-idle-link:hover { opacity: 1; text-decoration: underline; }

@keyframes deIdleIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes deIdleGlow {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.35; }
  50% { transform: translate(8px, -6px) scale(1.08); opacity: 0.55; }
}
@keyframes deIdleScene {
  0%, 28% { opacity: 1; }
  33%, 100% { opacity: 0; }
}
@keyframes deIdleCaption {
  0%, 100% { opacity: 0.35; transform: scaleX(0.92); }
  50% { opacity: 0.75; transform: scaleX(1); }
}
@keyframes deIdlePlayPulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--focus) 0%, transparent); }
  50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 18%, transparent); }
}
@keyframes deIdleSeek {
  0% { transform: translateX(-100%); width: 28%; }
  100% { transform: translateX(320%); width: 28%; }
}
@keyframes deIdleClipPulse {
  0%, 100% { opacity: 0.7; filter: brightness(0.95); }
  50% { opacity: 1; filter: brightness(1.08); }
}
@keyframes deIdleWave {
  0%, 100% { transform: scaleY(0.55); opacity: 0.55; }
  50% { transform: scaleY(1); opacity: 1; }
}
@keyframes deIdlePlayhead {
  0% { left: 8%; }
  100% { left: 88%; }
}

/* Import overlay when editing */
.de-root:not(.de-root--idle) .de-idle-hub:not(.hidden) {
  position: absolute;
  inset: 3.5rem 0 0;
  z-index: 5;
  max-width: none;
  padding: 1.5rem;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.de-root:not(.de-root--idle) .de-idle-visual {
  display: none;
}
.de-root:not(.de-root--idle) .de-idle-hub:not(.hidden) .de-idle-copy {
  max-width: 520px;
  margin: 0 auto;
}

.de-import-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-width: 520px;
  width: 100%;
  margin: 1.15rem auto 0;
  text-align: left;
}
.de-import-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  text-align: left;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: inherit;
  cursor: pointer;
  font: inherit;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
}
.de-import-item:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
  transform: translateX(3px);
}
.de-import-item strong { display: block; font-size: 0.88rem; }
.de-import-item small { display: block; margin-top: 0.15rem; color: var(--muted); font-size: 0.72rem; }
.de-import-arrow {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.9rem;
  transition: transform 0.2s var(--ease), color 0.2s var(--ease);
}
.de-import-item:hover .de-import-arrow {
  transform: translateX(3px);
  color: var(--text);
}
.de-workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  grid-template-rows: minmax(200px, 42%) minmax(220px, 1fr);
  gap: 0.75rem;
}
.de-stage-wrap {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.de-inspector {
  grid-column: 2;
  grid-row: 1;
  min-height: 0;
  overflow: auto;
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}
.de-inspector strong { display: block; margin: 0.4rem 0 0.85rem; }
.de-insp-fields { display: flex; flex-direction: column; gap: 0.7rem; }
.de-insp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
}
.de-danger:hover { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, var(--border)); }
.de-stage {
  position: relative;
  flex: 0 1 auto;
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #050506;
  aspect-ratio: 16 / 9;
  container-type: size;
  container-name: destage;
}
.de-stage.is-landscape {
  aspect-ratio: 16 / 9;
  width: 100%;
  height: auto;
}
.de-stage.is-short {
  aspect-ratio: 9 / 16;
  height: min(100%, 520px);
  width: auto;
  max-width: 100%;
  margin-inline: auto;
}
.de-stage.is-square {
  aspect-ratio: 1 / 1;
  width: min(100%, 420px);
  height: auto;
  max-height: 100%;
  margin-inline: auto;
}
.de-stage-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  pointer-events: none;
}
.de-media-rack,
#deMasterAudio {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}
.de-layer,
.de-layer-image,
.de-layer-video {
  position: absolute !important;
  inset: 0 !important;
  left: 0 !important;
  top: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  display: block;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
}
.de-layer-text {
  inset: auto 10% 12% !important;
  left: 10% !important;
  top: auto !important;
  width: 80% !important;
  height: auto !important;
  margin: 0;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
}

/* ─── Editor: painel de legendas ─── */
.de-captions-panel {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding-bottom: 0.95rem;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}
.de-captions-lead {
  font-size: 0.76rem;
  color: var(--muted);
  margin: 0.2rem 0 0;
  line-height: 1.4;
}
.de-insp-kicker { margin-top: 0.25rem; }
.de-cap-section {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.de-cap-section-label {
  font-size: 0.65rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.de-cap-styles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.de-cap-style {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 0.22rem 0.58rem;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
}
.de-cap-style.is-on,
.de-cap-pos-btn.is-on {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}
.de-cap-pos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.3rem;
}
.de-cap-pos-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 0.38rem 0.2rem;
  font-size: 0.68rem;
  font-weight: 650;
  cursor: pointer;
  min-height: 32px;
}
.de-cap-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 0.6rem;
}
.de-cap-field { margin-bottom: 0; }
.de-cap-field span { font-size: 0.72rem; }
.de-cap-range { width: 100%; accent-color: var(--accent); }
.de-cap-check { margin: 0.15rem 0 0; }
.de-cap-meta {
  font-size: 0.72rem;
  color: var(--muted);
  margin: 0;
}
.de-cap-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem;
}
.de-cap-actions .btn { min-height: 34px; }
.de-cap-lines {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  max-height: 168px;
  overflow: auto;
}
.de-cap-line-input {
  font-size: 0.75rem !important;
  min-height: 34px !important;
  padding: 0.35rem 0.55rem !important;
}
.de-clip-cap {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-right: 0.28rem;
  opacity: 0.7;
}

/* ─── Legendas no stage (safe area por proporção) ─── */
.de-stage .de-caption-wrap {
  position: absolute !important;
  inset: auto !important;
  left: 50% !important;
  right: auto !important;
  width: 86% !important;
  max-width: 86% !important;
  height: auto !important;
  max-height: none !important;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.2rem;
  pointer-events: none;
  z-index: 12;
  --de-cap-scale: 1;
  transform: translateX(-50%) scale(var(--de-cap-scale));
  transform-origin: center bottom;
}
.de-stage .de-caption-wrap.de-caption-pos-bottom {
  top: auto !important;
  bottom: 7.5% !important;
  transform-origin: center bottom;
}
.de-stage .de-caption-wrap.de-caption-pos-center {
  top: 50% !important;
  bottom: auto !important;
  transform: translate(-50%, -50%) scale(var(--de-cap-scale));
  transform-origin: center center;
}
.de-stage .de-caption-wrap.de-caption-pos-top {
  top: 7.5% !important;
  bottom: auto !important;
  transform: translateX(-50%) scale(var(--de-cap-scale));
  transform-origin: center top;
}
.de-stage.is-short .de-caption-wrap {
  width: 82% !important;
  max-width: 82% !important;
}
.de-stage.is-short .de-caption-wrap.de-caption-pos-bottom {
  bottom: 16% !important;
}
.de-stage.is-short .de-caption-wrap.de-caption-pos-top {
  top: 11% !important;
}
.de-stage.is-square .de-caption-wrap {
  width: 84% !important;
  max-width: 84% !important;
}
.de-stage.is-square .de-caption-wrap.de-caption-pos-bottom {
  bottom: 10% !important;
}
.de-stage.is-landscape .de-caption-wrap.de-caption-pos-bottom {
  bottom: 8.5% !important;
}
.de-caption-mascot { display: none !important; }
.de-caption-line {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.22em 0.34em;
  max-width: 100%;
  line-height: 1.12;
  text-wrap: balance;
}
.de-caption-word {
  display: inline-block;
  transition: transform 0.12s ease, color 0.12s ease, background 0.12s ease, opacity 0.12s ease;
  transform-origin: center bottom;
}

/* Viral — branco bold + contorno, palavra ativa amarela */
.de-caption-viral .de-caption-line {
  font-size: clamp(0.92rem, 5.8cqi, 1.85rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}
.de-caption-viral .de-caption-word {
  color: #fff;
  -webkit-text-stroke: 2px #000;
  paint-order: stroke fill;
  text-shadow: 0 3px 0 #000, 0 5px 16px rgba(0, 0, 0, 0.55);
}
.de-caption-viral .de-caption-word.is-active {
  color: #ffe566;
  transform: scale(1.14) translateY(-2px);
  -webkit-text-stroke: 2px #000;
}

/* Hormozi — highlight amarelo na palavra ativa */
.de-caption-hormozi .de-caption-line {
  font-size: clamp(0.88rem, 5.4cqi, 1.65rem);
  font-weight: 800;
  text-transform: uppercase;
}
.de-caption-hormozi .de-caption-word {
  color: #fff;
  padding: 0.06em 0.14em;
  border-radius: 0.12em;
}
.de-caption-hormozi .de-caption-word.is-active {
  background: #facc15;
  color: #111;
  transform: scale(1.08);
  box-shadow: 0 4px 18px rgba(250, 204, 21, 0.35);
}

/* TikTok — verde neon na palavra ativa */
.de-caption-tiktok .de-caption-line {
  font-size: clamp(0.9rem, 5.6cqi, 1.75rem);
  font-weight: 850;
  text-transform: uppercase;
}
.de-caption-tiktok .de-caption-word {
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.65);
}
.de-caption-tiktok .de-caption-word.is-active {
  color: #39ff14;
  transform: scale(1.16) rotate(-2deg);
  text-shadow: 0 0 18px rgba(57, 255, 20, 0.45);
}

/* Dark — vermelho sangue, estilo canal dark */
.de-caption-dark .de-caption-line {
  font-size: clamp(0.88rem, 5.2cqi, 1.6rem);
  font-weight: 800;
  text-transform: uppercase;
}
.de-caption-dark .de-caption-word {
  color: #e4e4e7;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
}
.de-caption-dark .de-caption-word.is-active {
  color: #ff3b3b;
  transform: scale(1.12);
  text-shadow: 0 0 16px rgba(255, 59, 59, 0.55);
}

/* Karaoke — preenche palavra progressivamente */
.de-caption-karaoke .de-caption-line {
  font-size: clamp(0.88rem, 5.4cqi, 1.7rem);
  font-weight: 800;
}
.de-caption-karaoke .de-caption-word {
  color: rgba(255, 255, 255, 0.45);
}
.de-caption-karaoke .de-caption-word.is-past,
.de-caption-karaoke .de-caption-word.is-active {
  color: #fff;
}
.de-caption-karaoke .de-caption-word.is-active {
  transform: scale(1.1);
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.35);
}

/* Minimal */
.de-caption-minimal .de-caption-line {
  font-size: clamp(0.84rem, 4.6cqi, 1.35rem);
  font-weight: 650;
}
.de-caption-minimal .de-caption-word {
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
}
.de-caption-minimal .de-caption-word.is-active {
  color: #fff;
  font-weight: 800;
  transform: scale(1.05);
}
.de-stage.is-short .de-caption-viral .de-caption-line,
.de-stage.is-short .de-caption-tiktok .de-caption-line {
  font-size: clamp(0.95rem, 7.2cqi, 1.7rem);
}
.de-stage.is-short .de-caption-hormozi .de-caption-line,
.de-stage.is-short .de-caption-dark .de-caption-line,
.de-stage.is-short .de-caption-karaoke .de-caption-line {
  font-size: clamp(0.9rem, 6.6cqi, 1.55rem);
}
.de-stage.is-landscape .de-caption-viral .de-caption-line,
.de-stage.is-landscape .de-caption-tiktok .de-caption-line {
  font-size: clamp(0.9rem, 4.4cqi, 1.7rem);
}
.de-transport {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  margin-top: 0.55rem;
}
.de-time { font-size: 0.78rem; color: var(--muted); min-width: 5.5rem; font-variant-numeric: tabular-nums; }
.de-timeline-wrap {
  grid-column: 1 / -1;
  grid-row: 2;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-elevated);
  overflow: hidden;
}
.de-tracks { flex: 1; min-height: 0; overflow: auto; }
.de-track-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--border);
}
.de-ruler {
  margin-left: 92px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.de-ruler-inner {
  position: relative;
  height: 22px;
}
.de-mark {
  position: absolute;
  top: 0;
  height: 100%;
  border-left: 1px solid var(--border);
  padding-left: 4px;
  font-size: 0.6rem;
  color: var(--faint);
}
.de-mark.is-major { color: var(--muted); }
.de-tracks { overflow: auto; }
.de-track {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  border-bottom: 1px solid var(--border);
  min-height: 56px;
}
.de-track-label {
  display: flex;
  align-items: center;
  padding: 0 0.7rem;
  font-size: 0.72rem;
  color: var(--muted);
  border-right: 1px solid var(--border);
  background: var(--surface);
}
.de-track-lane {
  position: relative;
  min-height: 56px;
}
.de-clip {
  position: absolute;
  top: 8px;
  height: 40px;
  border: none;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0 0.4rem;
  color: var(--text);
  font: inherit;
  font-size: 0.68rem;
  cursor: pointer;
  text-align: left;
}
.de-clip img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  background: #050506;
  border-radius: 4px;
  flex-shrink: 0;
}
.de-clip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.de-clip-image { background: color-mix(in srgb, var(--text) 12%, var(--surface)); }
.de-clip-audio { background: color-mix(in srgb, var(--green) 18%, var(--surface)); }
.de-clip-video { background: color-mix(in srgb, var(--focus) 16%, var(--surface)); }
.de-clip-text { background: color-mix(in srgb, var(--amber) 16%, var(--surface)); }
.de-clip.is-on { outline: 1px solid var(--text); }
.de-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--red);
  pointer-events: none;
  z-index: 2;
}
@media (max-width: 900px) {
  .editor-page.dashboard-body,
  .editor-page .main-content { overflow: auto; height: auto; max-height: none; }
  .de-workspace {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(220px, 36vh) auto minmax(220px, 1fr);
  }
  .de-inspector { grid-column: 1; grid-row: 2; }
  .de-timeline-wrap { grid-row: 3; min-height: 220px; }
}

/* ── Dashboard surfaces (clean, light glass) ── */
.dashboard-body .ds-glass,
.dashboard-body .sidebar,
.dashboard-body .sidebar-edge-toggle,
.dashboard-body .sidebar-toggle,
.dashboard-body .sidebar-reveal,
.dashboard-body .card,
.dashboard-body .home-action,
.dashboard-body .lo-card,
.dashboard-body .lw-panel,
.dashboard-body .lw-preview-card,
.dashboard-body .lw-submit-card,
.dashboard-body .de-inspector,
.dashboard-body .de-timeline-wrap,
.dashboard-body .de-import-item,
.dashboard-body .de-idle-mock,
.dashboard-body .de-idle-action,
.dashboard-body .plan-unit,
.dashboard-body .dash-top-chrome,
.dashboard-body .lp-theme-switch,
.dashboard-body .lang-switch {
  background-color: var(--glass);
  border-color: var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

.dashboard-body .sidebar {
  background-color: var(--glass-strong);
  border-right-color: var(--border);
}

.dashboard-body .sidebar-nav a.active,
.dashboard-body .sidebar-nav a:hover {
  background: var(--surface-hover);
  box-shadow: none;
}

.dashboard-body .home-action,
.dashboard-body .de-import-item {
  position: relative;
  overflow: hidden;
}

.dashboard-body .home-action::after,
.dashboard-body .de-import-item::after {
  display: none;
}

.dashboard-body .lo-choice {
  background-color: var(--bg-elevated);
  border-color: var(--border);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.dashboard-body .lo-choice.is-active {
  background-color: var(--surface-hover);
  border-color: var(--border-strong);
  box-shadow: var(--glass-shadow);
}

.dashboard-body .input,
.dashboard-body select.input,
.dashboard-body textarea.input {
  background: var(--input-bg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}

.dashboard-body .btn-secondary {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}

.dashboard-body .dash-theme-corner .lp-theme-switch {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.dashboard-body .de-stage {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

@keyframes dsGlassSheen {
  from { transform: translateX(-55%); opacity: 0.15; }
  to { transform: translateX(45%); opacity: 0; }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .dashboard-body .sidebar,
  .dashboard-body .card,
  .dashboard-body .home-action,
  .dashboard-body .lo-card,
  .dashboard-body .lw-panel,
  .dashboard-body .de-inspector,
  .dashboard-body .de-timeline-wrap {
    background: var(--glass-strong);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dashboard-body .home-action:hover::after,
  .dashboard-body .de-import-item:hover::after {
    animation: none;
    opacity: 0;
  }
  .de-idle-hub,
  .de-idle-glow,
  .de-idle-scene,
  .de-idle-caption,
  .de-idle-play-btn,
  .de-idle-seek-fill,
  .de-idle-clip,
  .de-idle-wave,
  .de-idle-playhead {
    animation: none !important;
  }
  .de-idle-scene--a { opacity: 1; }
  .de-idle-scene--b,
  .de-idle-scene--c { opacity: 0; }
  .de-idle-playhead { left: 35%; }
  .lo-format-modal,
  .lo-format-modal-card {
    transition: none !important;
  }
  .lo-format-modal.is-open {
    opacity: 1;
    visibility: visible;
  }
  .lo-format-modal.is-open .lo-format-modal-card {
    transform: none;
    opacity: 1;
  }
}

.legal-page-body {
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    radial-gradient(980px 520px at 6% -8%, var(--dash-wash-a, rgba(196, 204, 220, 0.07)), transparent 58%),
    radial-gradient(820px 460px at 98% 4%, var(--dash-wash-b, rgba(168, 176, 196, 0.05)), transparent 56%);
  background-attachment: fixed;
  color: var(--text);
}
.legal-wrap {
  width: min(760px, calc(100% - 2.4rem));
  margin: 0 auto;
  padding: 1.6rem 0 3.5rem;
}
.legal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.8rem;
}
.legal-brand {
  display: block;
  line-height: 0;
  position: relative;
}
.legal-brand .legal-logo-img {
  display: block;
  height: 42px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}
.legal-head h1 {
  font-size: clamp(1.7rem, 3vw, 2.15rem);
  font-weight: 620;
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin-bottom: 0.4rem;
}
.legal-meta {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 1rem;
}
.legal-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.35rem;
}
.legal-switch a {
  display: inline-flex;
  align-items: center;
  padding: 0.38rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 560;
  text-decoration: none;
}
.legal-switch a:hover { color: var(--text); border-color: var(--border-strong); }
.legal-switch a.is-on {
  color: var(--text);
  background: var(--surface-hover);
  border-color: var(--border-strong);
}
.legal-doc {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
}
.legal-doc h2 {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 620;
  letter-spacing: -0.02em;
  margin: 1.65rem 0 0.55rem;
}
.legal-doc p { margin-bottom: 0.85rem; }
.legal-doc ul {
  margin: 0 0 0.9rem 1.15rem;
  padding: 0;
}
.legal-doc li { margin-bottom: 0.35rem; }
.legal-doc a { color: var(--text); text-underline-offset: 2px; }
.legal-foot { margin-top: 2.25rem; }
.legal-foot .back-link { color: var(--muted); }

.dm-modal {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}
.dm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 14, 0.48);
}
.dm-card {
  position: relative;
  z-index: 1;
  width: min(100%, 440px);
  max-height: min(92vh, 720px);
  overflow: auto;
  padding: 1.35rem 1.35rem 1.2rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  box-shadow: 0 24px 60px rgba(8, 10, 14, 0.22);
}
.dm-head h2 {
  font-size: 1.2rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  margin: 0.15rem 0 0.45rem;
}
.dm-lead {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
  margin-bottom: 0.65rem;
}
.dm-lock {
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--text);
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--text) 6%, transparent);
  margin-bottom: 1rem;
}
.dm-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.dm-form .field span {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.dm-form textarea.input { min-height: 72px; }
.dm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.35rem;
}
.lo-style[data-style="DARKLY_MODEL"].has-darkly-char::after,
.style-btn[data-style="DARKLY_MODEL"].has-darkly-char::after {
  content: '';
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-left: 0.35rem;
  border-radius: 999px;
  background: var(--text);
  opacity: 0.55;
}

/* ── Mobile / responsive (dashboard + auth + wizard + editor) ── */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: clip;
  max-width: 100%;
}

body {
  overflow-x: clip;
  max-width: 100%;
}

.dashboard-body,
.auth-page-body,
.landing-page {
  overflow-x: clip;
  max-width: 100%;
}

.dashboard-body .main-content,
.dashboard-body .workspace {
  min-width: 0;
  max-width: 100%;
}

.dashboard-body .main-content > .page-header-row,
.dashboard-body .projects-head,
.project-detail-page .pd-toolbar {
  padding-right: 5.25rem;
}
@media (max-width: 768px) {
  .dashboard-body .main-content > .page-header-row,
  .dashboard-body .projects-head,
  .project-detail-page .pd-toolbar {
    padding-right: 0;
    padding-top: 0;
  }
}

@media (max-width: 768px) {
  .auth-page {
    padding: 4.75rem 1rem 2rem;
    padding-top: max(4.75rem, calc(3.5rem + env(safe-area-inset-top, 0px)));
  }
  .auth-top {
    padding: 0.85rem 1rem;
    padding-top: max(0.85rem, env(safe-area-inset-top, 0px));
  }
  .auth-panel { padding: 1.15rem 1.1rem 1.2rem; }
  .auth-ask { font-size: 1.12rem; min-height: 2.2rem; }

  .home-actions { grid-template-columns: 1fr; }
  .home-welcome h1 { font-size: clamp(1.45rem, 6vw, 1.85rem); }

  .stats-grid { grid-template-columns: 1fr; }

  .lw-hero { flex-direction: column; align-items: flex-start; }
  .lw-title { font-size: clamp(1.35rem, 5.5vw, 1.75rem); }
  .lw-steps { grid-template-columns: 1fr 1fr; gap: 0.45rem; }
  .lw-step-label { font-size: 0.68rem; }
  .lw-niche-grid,
  .lw-style-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lw-panel { padding: 1rem 1.05rem; }
  .lw-setup-grid { gap: 1rem; }
  .lw-submit-card { position: static; }
  .niche-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .style-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .duration-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .lo-shell {
    min-height: auto;
    padding: 0.75rem 0 1.5rem;
  }
  .lo-card { padding: 1.1rem 1rem; border-radius: 20px; }
  .lo-dialogue {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .lo-mascot,
  .lo-mascot img { width: 72px; flex-basis: 72px; }
  .lo-bubble { width: 100%; text-align: center; }
  .lo-question { font-size: 1rem; }
  .lo-preset-grid,
  .lo-style-grid,
  .lo-niche-grid,
  .lo-format-grid,
  .lo-mode-grid { grid-template-columns: 1fr; }
  .lo-actions {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .lo-actions .btn { flex: 1 1 auto; min-width: 0; }

  .wizard-long-page .main-content,
  .wizard-short-page .main-content,
  .wizard-music-page .main-content {
    padding-bottom: max(2rem, env(safe-area-inset-bottom, 0px));
  }

  .video-editor-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }
  .video-editor-head-actions { width: 100%; }
  .video-editor-head-actions .btn { width: 100%; }
  .video-editor-timeline-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .video-editor-timeline { min-width: min-content; overflow-x: auto; }

  .action-row { flex-direction: column; }
  .action-row .btn { width: 100%; }

  .page-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
  }
  .page-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
  }
  .page-actions .btn { flex: 1 1 auto; min-width: 0; }

  .projects-create-group,
  .projects-filter-group {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .projects-create-link,
  .projects-filter-btn {
    min-width: 0;
    width: 100%;
  }
  .project-card {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 0.65rem 0.85rem;
  }
  .project-card-status {
    grid-column: 2;
    justify-self: start;
  }
  .project-card-title {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .project-card-meta {
    white-space: normal;
  }

  .project-item {
    flex-wrap: wrap;
    gap: 0.55rem;
  }
  .project-item strong {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
  }

  .admin-page-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .admin-search { width: 100%; }
  .admin-search .input { min-width: 0; width: 100%; }

  .de-top {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }
  .de-top h1 { font-size: 1.2rem; }
  .de-idle-actions { grid-template-columns: 1fr; }
  .de-idle-visual { width: min(100%, 320px); margin-bottom: 1.35rem; }
  .de-idle-hub { padding: 0.5rem 0 1.5rem; }
  .de-top-actions {
    justify-content: space-between;
    width: 100%;
    gap: 0.45rem;
  }
  .de-top-actions .btn { flex: 1 1 auto; min-width: 0; padding-left: 0.55rem; padding-right: 0.55rem; font-size: 0.78rem; }
  .de-save-state { width: 100%; text-align: center; order: 3; }
  .de-track-tools {
    flex-wrap: wrap;
    gap: 0.35rem;
  }
  .de-track-tools .btn { flex: 1 1 calc(50% - 0.2rem); min-width: 0; font-size: 0.75rem; }
  .de-track-label { width: 72px; font-size: 0.68rem; }
  .de-ruler { margin-left: 72px; }
  .de-track { grid-template-columns: 72px 1fr; }

  .dm-card {
    width: min(440px, calc(100% - 2rem));
    max-width: calc(100% - 2rem);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
  }
  .dm-actions { flex-direction: column-reverse; }
  .dm-actions .btn { width: 100%; }

  .scene-grid,
  .scene-grid.wide {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.65rem;
  }

  .card { overflow: hidden; }
  .table-wrap,
  .admin-table-wrap { -webkit-overflow-scrolling: touch; }
}

@media (max-width: 480px) {
  .main-content { padding: 0 0.85rem 2rem; }
  .dash-top-chrome {
    margin-inline: -0.85rem;
    gap: 0.35rem;
    min-height: calc(44px + 0.75rem + max(0.65rem, env(safe-area-inset-top, 0px)));
  }
  .mobile-header-logo { max-width: min(128px, 40vw); }

  .lw-steps { grid-template-columns: 1fr; }
  .lw-niche-grid,
  .lw-style-grid,
  .niche-grid,
  .style-grid { grid-template-columns: 1fr; }
  .step-pill { font-size: 0.72rem; }

  .plan-timer-digits { grid-template-columns: repeat(2, 1fr); }

  .de-stage.is-landscape,
  .de-stage.is-short,
  .de-stage.is-square {
    min-height: 180px;
    max-height: 42vh;
  }
  .de-inspector { max-height: none; }
  .de-timeline-wrap { min-height: 180px; }

  .auth-head h1 { font-size: 1.45rem; }
  .btn-block { min-height: 44px; }
  .input,
  .btn,
  .menu-btn,
  .lp-nav-toggle { min-height: 44px; }
}

@media (max-width: 768px) {
  .dashboard-body,
  .auth-page-body {
    background-attachment: scroll;
  }
}
