:root {
  --in-oklab: ;
  --in-oklch: ;
  --bg-deep: #060b16;
  --glass-bg: rgba(255, 255, 255, 0.068);
  --glass-bg-strong: rgba(255, 255, 255, 0.105);
  --glass-bg-inset: rgba(9, 16, 32, 0.56);
  --glass-border: rgba(255, 255, 255, 0.16);
  --glass-border-strong: rgba(255, 255, 255, 0.28);
  --glass-specular: rgba(255, 255, 255, 0.34);
  --text: #f8fafc;
  --text-soft: #dce6f4;
  --muted: #a9bad0;
  --gold: #f8d470;
  --gold-deep: #e2a93b;
  --cyan: #5ed0ff;
  --cyan-deep: #0ea5e9;
  --emerald: #4ade80;
  --danger: #fb7185;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 13px;
  --radius-sm: 10px;
  --spring: cubic-bezier(0.22, 1, 0.36, 1);
  --target-size: 24px;
}

@media (pointer: coarse) {
  :root {
    --target-size: 44px;
  }
}

@supports (background: linear-gradient(in oklab, white, black)) {
  :root {
    --in-oklab: in oklab;
    --in-oklch: in oklch;
  }
}

* { box-sizing: border-box; }

html {
  font-size: 16px;
  color-scheme: dark;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg-deep);
  color: var(--text);
  font-family: "SF Pro Display", "SF Pro Text", "PingFang SC", "Segoe UI Variable", "Segoe UI", "Microsoft YaHei UI", system-ui, sans-serif;
  font-size: 0.9375rem;
  line-height: 1.55;
  text-align: start;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

img, video { max-inline-size: 100%; block-size: auto; }
:where(a, code) { overflow-wrap: anywhere; }
:where(button, select, textarea, input:not([type="checkbox"], [type="radio"]), [role="button"], nav a) {
  min-block-size: var(--target-size);
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.30); background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

.hidden { display: none !important; }
.svg-ico {
  width: 1.05em;
  height: 1.05em;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: -0.16em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.svg-ico-lg {
  width: 1.85rem;
  height: 1.85rem;
  stroke-width: 1.6;
  color: var(--cyan);
}
.heading-with-ico {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.visually-hidden {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.mt-10 { margin-top: 0.625rem; }
.mt-12 { margin-top: 0.75rem; }
.mt-14 { margin-top: 0.875rem; }
.mt-16 { margin-top: 1rem; }
.mt-18 { margin-top: 1.25rem; }
.tabular { font-variant-numeric: tabular-nums; }

code {
  font-family: "Cascadia Code", "SF Mono", Consolas, monospace;
  font-size: 0.85em;
  padding: 0.12em 0.42em;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e0f2fe;
}

/* ==================== LIQUID GLASS AMBIENT BACKDROP ==================== */
.liquid-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 15% 10%, rgba(14, 165, 233, 0.24), transparent 60%),
    radial-gradient(ellipse 70% 60% at 85% 18%, rgba(139, 92, 246, 0.20), transparent 62%),
    radial-gradient(ellipse 65% 55% at 55% 92%, rgba(248, 212, 112, 0.15), transparent 65%),
    linear-gradient(155deg var(--in-oklab), #070d1b 0%, #091326 48%, #070c17 100%);
}

.liquid-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(82px);
  opacity: 0.52;
  will-change: transform;
}

.orb-1 {
  width: 34rem; height: 34rem;
  top: -8rem; left: 8%;
  background: radial-gradient(circle, rgba(94, 208, 255, 0.58) 0%, rgba(14, 165, 233, 0.0) 70%);
}
.orb-2 {
  width: 30rem; height: 30rem;
  top: 18%; right: -6rem;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.48) 0%, rgba(99, 102, 241, 0.0) 70%);
}
.orb-3 {
  width: 28rem; height: 28rem;
  bottom: -9rem; left: 40%;
  background: radial-gradient(circle, rgba(248, 212, 112, 0.40) 0%, rgba(226, 169, 59, 0.0) 70%);
}

.liquid-mesh {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 0);
  background-size: 28px 28px;
  opacity: 0.55;
}

/* ==================== TWO-COLUMN APP SHELL ==================== */
.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 17.5rem minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  padding: 1rem;
  gap: 1rem;
}

/* Mobile Topbar & Bottom Tab Bar hidden on desktop */
.mobile-topbar,
.mobile-bottom-nav {
  display: none;
}

/* ==================== NATIVE SWIPE NAVIGATION DRAWER ==================== */
.Drawer {
  --drawer-width: min(20rem, 82dvw, 100dvw - 24px);
  --drawer-backdrop: 0;
  inset: 0;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  overflow: visible;
  color: var(--text);
}
.Drawer::backdrop {
  background: #020612;
  opacity: calc(var(--drawer-backdrop) * 0.68);
}
.Drawer-scroller {
  position: relative;
  display: grid;
  grid-template-columns: var(--drawer-width) 100%;
  overflow-x: scroll;
  overscroll-behavior: none;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
}
.Drawer-scroller::-webkit-scrollbar { display: none; }
.Drawer-scroller::after {
  content: "";
  scroll-snap-align: end;
  scroll-initial-target: nearest;
}
.Drawer-sheet {
  display: flex;
  flex-direction: column;
  height: 100svh;
  padding:
    max(1rem, env(safe-area-inset-top, 0px))
    0.9rem
    max(1rem, env(safe-area-inset-bottom, 0px))
    max(0.9rem, env(safe-area-inset-left, 0px));
  background: linear-gradient(165deg var(--in-oklab), rgba(14, 24, 46, 0.96) 0%, rgba(7, 13, 27, 0.98) 100%);
  backdrop-filter: blur(26px) saturate(180%);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  border-inline-end: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 12px 0 40px rgba(0, 0, 0, 0.55);
  overflow-y: auto;
  scroll-snap-align: start;
  scrollbar-width: none;
}
.Drawer-sheet::-webkit-scrollbar { display: none; }
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.drawer-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-top: 0.85rem;
}
.drawer-footer {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

@supports (animation-timeline: scroll()) {
  .Drawer {
    timeline-scope: --drawer-fade;
    animation: fade-drawer-backdrop linear both;
    animation-timeline: --drawer-fade;
  }
  .Drawer-scroller {
    scroll-timeline: --drawer-fade x;
  }
  @property --drawer-backdrop {
    syntax: "<number>";
    inherits: true;
    initial-value: 0;
  }
  @keyframes fade-drawer-backdrop {
    0% { --drawer-backdrop: 1; }
    100% { --drawer-backdrop: 0; }
  }
}

.mobile-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}
.mobile-brand-logo {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
  border-radius: 10px;
  padding: 0.18rem;
  background: rgba(255, 255, 255, 0.94);
  flex-shrink: 0;
}
.mobile-brand-title {
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #ffffff;
  white-space: nowrap;
}
.mobile-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  min-width: 44px;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  cursor: pointer;
  flex-shrink: 0;
}
.mobile-icon-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.mobile-icon-gold {
  background: rgba(248, 212, 112, 0.18);
  border-color: rgba(248, 212, 112, 0.45);
  color: var(--gold);
}

/* ==================== LEFT COLUMN: GLASS MENU SIDEBAR ==================== */
.glass-sidebar {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: 1.125rem 0.875rem 0.875rem;
  border-radius: var(--radius-xl);
  background: linear-gradient(165deg var(--in-oklab), rgba(255, 255, 255, 0.105) 0%, rgba(255, 255, 255, 0.045) 100%);
  backdrop-filter: blur(26px) saturate(185%);
  -webkit-backdrop-filter: blur(26px) saturate(185%);
  border: 1px solid var(--glass-border);
  box-shadow:
    inset 0 1px 0 var(--glass-specular),
    inset 0 -1px 0 rgba(255, 255, 255, 0.06),
    0 20px 50px rgba(0, 0, 0, 0.42),
    0 2px 10px rgba(0, 0, 0, 0.25);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem 0.5rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
}

.brand-gem {
  width: 2.65rem;
  height: 2.65rem;
  min-width: 2.65rem;
  padding: 0.24rem;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg var(--in-oklab), rgba(255, 255, 255, 0.96), rgba(226, 238, 255, 0.86));
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.95),
    0 8px 22px rgba(94, 208, 255, 0.26);
  overflow: hidden;
}
.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.brand-title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #ffffff;
  line-height: 1.2;
}
.brand-sub {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.125rem;
}

.menu-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.875rem;
}

.menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.68rem 0.875rem;
  min-block-size: 2.75rem;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-soft);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  text-align: start;
}
.menu-item:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}
.menu-item.active {
  background: linear-gradient(135deg var(--in-oklab), rgba(255, 255, 255, 0.18) 0%, rgba(94, 208, 255, 0.16) 100%);
  border-color: rgba(255, 255, 255, 0.32);
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 8px 20px rgba(0, 0, 0, 0.22);
}
.menu-item:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.menu-ico { font-size: 1.05rem; line-height: 1; }

.sidebar-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-top: 1rem;
  padding-top: 0.875rem;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
}
.sidebar-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.375rem 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.btn-glass-mini {
  border: 1px solid rgba(248, 212, 112, 0.42);
  background: rgba(248, 212, 112, 0.15);
  color: var(--gold);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  min-block-size: 1.75rem;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.btn-glass-mini:hover { background: rgba(248, 212, 112, 0.25); }
.btn-glass-mini:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.project-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding-inline-end: 0.2rem;
}

.proj-item {
  width: 100%;
  text-align: start;
  color: var(--text);
  font-family: inherit;
  padding: 0.65rem 0.75rem;
  border-radius: 13px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
}
.proj-item:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.22);
}
.proj-item.active {
  background: linear-gradient(135deg var(--in-oklab), rgba(248, 212, 112, 0.18), rgba(255, 255, 255, 0.08));
  border-color: rgba(248, 212, 112, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.proj-item:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.proj-item-name {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.2rem;
  overflow-wrap: break-word;
}
.proj-item-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.sidebar-footer {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.status-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.glass-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  min-block-size: 1.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-soft);
}
.pill-ok { border-color: rgba(74, 222, 128, 0.45); color: #86efac; background: rgba(74, 222, 128, 0.12); }
.pill-warn { border-color: rgba(251, 113, 133, 0.45); color: #fda4af; background: rgba(251, 113, 133, 0.12); }
.pill-cyan { border-color: rgba(94, 208, 255, 0.45); color: #bae6fd; background: rgba(94, 208, 255, 0.14); }
.pill-muted { color: var(--muted); }

.btn-motion-toggle {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  border-radius: 10px;
  padding: 0.35rem 0.6rem;
  min-block-size: 2rem;
  font-family: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}
.btn-motion-toggle:hover { background: rgba(255, 255, 255, 0.10); color: var(--text); }
.btn-motion-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ==================== RIGHT COLUMN: GLASS WORKSPACE ==================== */
.glass-main {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  border-radius: var(--radius-xl);
  padding: 1.5rem 1.75rem 3rem;
  background: linear-gradient(160deg var(--in-oklab), rgba(255, 255, 255, 0.058) 0%, rgba(10, 18, 35, 0.46) 100%);
  backdrop-filter: blur(22px) saturate(170%);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 24px 60px rgba(0, 0, 0, 0.38);
}

.view { display: none; }
.view.active { display: block; }

.view-container {
  max-width: 72rem;
  margin: 0 auto;
}

/* ==================== LIQUID GLASS TYPOGRAPHY ==================== */
.glass-kicker {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.85rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--gold);
  background: rgba(248, 212, 112, 0.12);
  border: 1px solid rgba(248, 212, 112, 0.35);
  margin-bottom: 0.75rem;
}

.hero-title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.5rem, 1.15rem + 1.1vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
  text-wrap: balance;
  color: #ffffff;
}

.page-title {
  margin: 0 0 0.4rem;
  font-size: clamp(1.3rem, 1.1rem + 0.6vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  text-wrap: balance;
  color: #ffffff;
}

.page-sub {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: 1.65;
  max-width: 68ch;
  text-wrap: pretty;
}

.section-title {
  margin: 0 0 0.45rem;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.35;
  color: #ffffff;
}
.section-title:focus { outline: none; }
.section-title:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; border-radius: 6px; }

.sub-title {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  font-weight: 700;
  color: #f1f5f9;
}

.muted {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

/* ==================== LIQUID GLASS SURFACES ==================== */
.glass-card {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.5rem;
  background: linear-gradient(155deg var(--in-oklab), rgba(255, 255, 255, 0.095) 0%, rgba(255, 255, 255, 0.04) 100%);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05),
    0 14px 36px rgba(0, 0, 0, 0.28),
    0 2px 8px rgba(0, 0, 0, 0.16);
}

.glass-inset {
  border-radius: var(--radius-md);
  padding: 1rem 1.125rem;
  background: var(--glass-bg-inset);
  border: 1px solid rgba(255, 255, 255, 0.11);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

.empty-hero {
  max-width: 46rem;
  margin: 7vh auto 0;
  text-align: center;
  padding: 2.75rem 2.25rem;
}
.empty-hero .page-sub { margin-inline: auto; }
.empty-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.75rem; }

.card-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.ws-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.ws-title-group { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.title-input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-family: inherit;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  padding: 0.42rem 0.85rem;
  border-radius: 12px;
  min-width: 15rem;
}
.title-input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.10);
}

/* ==================== LIQUID GLASS STEPPER ==================== */
.stepper-nav { width: 100%; }
.stepper-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
.stepper-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .stepper-3 { grid-template-columns: 1fr; } }

.stepper-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.72rem 1rem;
  min-block-size: 3rem;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(16px);
  color: var(--muted);
  font-family: inherit;
  text-align: start;
  cursor: pointer;
}
.stepper-btn:hover {
  background: rgba(255, 255, 255, 0.095);
  border-color: rgba(255, 255, 255, 0.26);
  color: var(--text);
}
.stepper-btn.active {
  background: linear-gradient(135deg var(--in-oklab), rgba(248, 212, 112, 0.20) 0%, rgba(94, 208, 255, 0.14) 100%);
  border-color: rgba(248, 212, 112, 0.56);
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.36),
    0 10px 26px rgba(0, 0, 0, 0.24);
}
.stepper-btn.done {
  border-color: rgba(74, 222, 128, 0.45);
  color: var(--text-soft);
}
.stepper-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.stepper-num {
  width: 1.9rem;
  height: 1.9rem;
  min-width: 1.9rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.875rem;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--muted);
}
.stepper-btn.active .stepper-num {
  background: linear-gradient(135deg var(--in-oklab), var(--gold), var(--gold-deep));
  border-color: transparent;
  color: #0b1322;
}
.stepper-btn.done .stepper-num {
  background: rgba(74, 222, 128, 0.22);
  border-color: var(--emerald);
  color: #86efac;
}
.stepper-text { display: flex; flex-direction: column; min-width: 0; }
.stepper-title { font-size: 0.92rem; font-weight: 700; }
.stepper-desc { font-size: 0.76rem; color: var(--muted); }

.wizard-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.11);
}

/* ==================== BUTTONS (LIQUID GLASS SPECULAR) ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.62rem 1.2rem;
  min-block-size: 2.6rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.btn-sm { padding: 0.44rem 0.95rem; min-block-size: 2.15rem; font-size: 0.835rem; }

.btn-liquid-gold {
  background: linear-gradient(135deg var(--in-oklab), #fde68a 0%, #f5c34f 55%, #e2a22a 100%);
  color: #0b1322;
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.72),
    0 10px 26px rgba(245, 195, 79, 0.28);
}
.btn-liquid-gold:hover:not(:disabled) { filter: brightness(1.06); box-shadow: inset 0 1px 1px rgba(255,255,255,0.85), 0 14px 32px rgba(245, 195, 79, 0.38); }

.btn-liquid-primary {
  background: linear-gradient(135deg var(--in-oklab), #67d4ff 0%, #259df4 55%, #0284c7 100%);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.38);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.55),
    0 10px 26px rgba(14, 165, 233, 0.30);
}
.btn-liquid-primary:hover:not(:disabled) { filter: brightness(1.08); }

.btn-glass {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.20);
  color: #f8fafc;
  backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn-glass:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.34);
}

.btn-danger {
  background: rgba(251, 113, 133, 0.14);
  border-color: rgba(251, 113, 133, 0.38);
  color: #fecdd3;
}
.btn-danger:hover:not(:disabled) { background: rgba(251, 113, 133, 0.24); }

/* ==================== FORMS & CONTROLS ==================== */
.form-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.85rem; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.85rem; }
@media (max-width: 820px) { .form-grid-3, .form-grid-2 { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field label, .small-lbl {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-soft);
}
.field input, .field select, .field textarea {
  width: 100%;
  background: rgba(8, 15, 30, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  color: #ffffff;
  padding: 0.62rem 0.85rem;
  min-block-size: 2.65rem;
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.5;
}
.field textarea { min-block-size: 5rem; resize: vertical; }
.field select option { background: #0c172c; color: #f8fafc; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-color: var(--gold);
  background: rgba(12, 22, 44, 0.82);
}
.field input:user-invalid { border-color: var(--danger); }

.inline-form-row { display: flex; gap: 0.6rem; align-items: center; }
.inline-form-row input {
  flex: 1;
  background: rgba(8, 15, 30, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: #ffffff;
  padding: 0.52rem 0.95rem;
  min-block-size: 2.4rem;
  font-family: inherit;
  font-size: 0.9rem;
}
.inline-form-row input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.row-actions { display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap; }

/* Dropzones */
.upload-actions-row {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 0.85rem;
}
@media (max-width: 780px) { .upload-actions-row { grid-template-columns: 1fr; } }

.glass-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.35rem;
  padding: 1.4rem 1.15rem;
  border-radius: 16px;
  cursor: pointer;
  background: linear-gradient(155deg var(--in-oklab), rgba(94, 208, 255, 0.10), rgba(255, 255, 255, 0.04));
  border: 1.5px dashed rgba(94, 208, 255, 0.45);
}
.glass-dropzone:hover {
  background: linear-gradient(155deg var(--in-oklab), rgba(94, 208, 255, 0.18), rgba(255, 255, 255, 0.08));
  border-color: var(--cyan);
}
.glass-dropzone:focus-within { outline: 2px solid var(--gold); outline-offset: 3px; }
.dropzone-icon { font-size: 1.75rem; line-height: 1; }
.dropzone-title { font-weight: 700; font-size: 0.9375rem; color: #e0f2fe; }
.dropzone-sub { font-size: 0.8rem; color: var(--muted); }

/* Uploaded Assets Grid */
.assets-grid { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.asset-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.78rem;
  border-radius: 12px;
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-soft);
}
.asset-chip.wm-hit {
  border-color: rgba(248, 212, 112, 0.52);
  background: rgba(248, 212, 112, 0.12);
  color: #fef08a;
}
.asset-del-btn {
  border: 0;
  background: rgba(251, 113, 133, 0.22);
  color: #fecdd3;
  border-radius: 999px;
  padding: 0.15rem 0.48rem;
  font-size: 0.74rem;
  cursor: pointer;
}
.asset-del-btn:hover { background: rgba(251, 113, 133, 0.38); }

.ai-auto-note {
  padding: 0.65rem 0.95rem;
  border-radius: 12px;
  font-size: 0.83rem;
  color: #bae6fd;
  background: rgba(94, 208, 255, 0.09);
  border: 1px solid rgba(94, 208, 255, 0.24);
}

/* Watermark Auto-Detection Card & Native Switch */
.watermark-glass-card {
  padding: 1rem 1.15rem;
  border-radius: 15px;
  background: linear-gradient(135deg var(--in-oklab), rgba(94, 208, 255, 0.10), rgba(248, 212, 112, 0.07));
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.watermark-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.6rem; }
.watermark-title { font-weight: 700; font-size: 0.95rem; color: #ffffff; }
.watermark-toggle-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.72rem 0.9rem;
  border-radius: 12px;
  background: rgba(7, 13, 27, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.11);
}

/* Collapsible Advanced Controls & Multi-Brand Switcher */
.advanced-panel {
  border-radius: 15px;
  padding: 0.85rem 1.1rem;
  background: rgba(7, 13, 27, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.advanced-summary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
  color: #e2e8f0;
  list-style: none;
  user-select: none;
}
.advanced-summary::-webkit-details-marker { display: none; }
.advanced-summary::after {
  content: "▾";
  font-size: 0.85rem;
  color: var(--muted);
  margin-left: 0.25rem;
}
.advanced-panel[open] .advanced-summary::after { transform: rotate(180deg); }
.adv-toggles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 0.65rem;
}
.adv-toggle-chip {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.8rem;
  border-radius: 12px;
  background: rgba(7, 13, 27, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.86rem;
  color: #f1f5f9;
  cursor: pointer;
}
.brand-switcher-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.9rem;
  flex-wrap: wrap;
}
.theme-val-row {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.theme-swatches {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
}
.theme-swatches i {
  display: inline-block;
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.45);
}
.switch-label { display: flex; flex-direction: column; gap: 0.12rem; cursor: pointer; font-size: 0.9rem; color: #ffffff; }

input[type="checkbox"].native-switch {
  accent-color: var(--gold);
  width: 2.85rem;
  height: 1.6rem;
  min-width: 2.85rem;
  margin: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  position: relative;
}
input[type="checkbox"].native-switch::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.42);
}
input[type="checkbox"].native-switch:checked {
  background: linear-gradient(135deg var(--in-oklab), var(--gold), var(--gold-deep));
  border-color: rgba(255, 255, 255, 0.5);
}
input[type="checkbox"].native-switch:checked::before {
  transform: translateX(1.22rem);
  background: #0b1322;
}
input[type="checkbox"].native-switch:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* ==================== STEP 2 SPLIT (VOICEOVER CARDS + EXCLUSIVE PREVIEW) ==================== */
.step2-split {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) 23.5rem;
  gap: 1.1rem;
  align-items: start;
}
@media (max-width: 1180px) { .step2-split { grid-template-columns: 1fr; } }

.scenes-container { display: flex; flex-direction: column; gap: 0.85rem; }
.scene-card {
  padding: 1rem 1.1rem;
  border-radius: 15px;
  background: rgba(9, 17, 34, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.scene-card:hover { border-color: rgba(255, 255, 255, 0.24); background: rgba(12, 22, 44, 0.68); }
.scene-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
}
.scene-id-pill {
  font-weight: 800;
  font-size: 0.8rem;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  background: rgba(248, 212, 112, 0.18);
  color: var(--gold);
  border: 1px solid rgba(248, 212, 112, 0.45);
}
.scene-kind-tag {
  font-size: 0.78rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-soft);
}
.scene-ai-hint {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-soft);
}

.sticky-preview { position: sticky; top: 0; }
.preview-controls { display: flex; gap: 0.5rem; align-items: center; }
.preview-controls select {
  flex: 1;
  background: rgba(8, 15, 30, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border-radius: 10px;
  padding: 0.45rem 0.65rem;
  font-family: inherit;
  font-size: 0.85rem;
}
.preview-stage {
  background: rgba(4, 8, 18, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  min-height: 22rem;
  max-height: 36rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.preview-stage img { max-width: 100%; max-height: 35rem; object-fit: contain; display: none; }
.preview-placeholder { padding: 1.5rem; text-align: center; color: var(--muted); font-size: 0.86rem; line-height: 1.65; }

/* ==================== STEP 3 FINAL RENDER ==================== */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
  gap: 0.7rem;
}
.summary-tile {
  padding: 0.8rem 0.95rem;
  border-radius: 13px;
  background: rgba(9, 17, 34, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.summary-tile-label { font-size: 0.76rem; color: var(--muted); }
.summary-tile-val { font-size: 0.95rem; font-weight: 700; color: #ffffff; margin-top: 0.25rem; overflow-wrap: break-word; }

.render-action-bar { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.step3-media-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 1rem; align-items: start; }
@media (max-width: 1020px) { .step3-media-grid { grid-template-columns: 1fr; } }
.output-video-wrap {
  background: #02050c;
  border-radius: 13px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  min-height: 17rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.output-video-wrap video { width: 100%; max-height: 30rem; }
.output-links { display: flex; gap: 0.65rem; flex-wrap: wrap; }

.qa-list { display: flex; flex-direction: column; gap: 0.45rem; max-height: 26rem; overflow-y: auto; }
.qa-row { font-size: 0.83rem; padding: 0.5rem 0.75rem; border-radius: 9px; background: rgba(255, 255, 255, 0.05); line-height: 1.5; }
.qa-pass { border-left: 3px solid var(--emerald); }
.qa-warn { border-left: 3px solid var(--gold); }
.qa-fail { border-left: 3px solid var(--danger); }

/* ==================== COMPANY LOGO & MARKDOWN DOCS ==================== */
.ob-logo-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: rgba(9, 17, 34, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.logo-thumb-stage {
  width: 8rem;
  height: 4.5rem;
  border-radius: 11px;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0.35rem;
}
.logo-thumb-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 6px;
  padding: 4px 6px;
}

.logo-preview-stage {
  height: 9.5rem;
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  background: repeating-conic-gradient(rgba(255, 255, 255, 0.05) 0% 25%, rgba(255, 255, 255, 0.015) 0% 50%) 50% / 18px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem;
  overflow: hidden;
}
.logo-preview-stage img {
  max-width: 100%;
  max-height: 7.5rem;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.95);
  padding: 0.5rem 0.9rem;
  border-radius: 10px;
}

.docs-list { display: flex; flex-direction: column; gap: 0.6rem; }
.doc-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.78rem 0.95rem;
  border-radius: 13px;
  background: rgba(9, 17, 34, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.13);
}
.doc-item-name { font-weight: 700; font-size: 0.88rem; color: #ffffff; overflow-wrap: break-word; }
.doc-item-meta { font-size: 0.76rem; color: var(--cyan); margin-top: 0.18rem; }
.doc-item-excerpt { font-size: 0.8rem; color: var(--muted); margin-top: 0.32rem; line-height: 1.5; }

/* ==================== JOB PROGRESS & SETTINGS EXTRAS ==================== */
.job-panel {
  border-color: rgba(94, 208, 255, 0.42);
  background: linear-gradient(155deg var(--in-oklab), rgba(14, 165, 233, 0.16), rgba(9, 17, 34, 0.68));
}
.job-header { display: flex; justify-content: space-between; font-weight: 700; font-size: 0.9rem; margin-bottom: 0.5rem; }
.progress-track { height: 0.5rem; background: rgba(255, 255, 255, 0.12); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg var(--in-oklab), var(--cyan), var(--gold)); }
.job-logs {
  margin: 0.6rem 0 0;
  max-height: 7.5rem;
  overflow-y: auto;
  font-size: 0.78rem;
  color: var(--text-soft);
  background: rgba(3, 8, 18, 0.55);
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  white-space: pre-wrap;
}

.preset-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: flex-end;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: rgba(94, 208, 255, 0.08);
  border: 1px solid rgba(94, 208, 255, 0.24);
}
.fetched-models {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.8rem;
  border-radius: 12px;
  background: rgba(5, 10, 22, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.fetched-models-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.model-search-input {
  flex: 1;
  min-width: 200px;
  background: rgba(9, 17, 34, 0.72);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 0.42rem 0.9rem;
  font-family: inherit;
  font-size: 0.84rem;
}
.model-search-input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.fetched-models-count {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}
.fetched-models-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-height: 18rem;
  overflow-y: auto;
  padding-right: 0.25rem;
}
.model-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.55rem;
  border-radius: 8px;
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.model-chip-btn {
  border: 1px solid rgba(248, 212, 112, 0.4);
  background: rgba(248, 212, 112, 0.14);
  color: var(--gold);
  border-radius: 6px;
  padding: 0.14rem 0.45rem;
  font-size: 0.74rem;
  cursor: pointer;
}
.model-chip-btn.cyan { border-color: rgba(94, 208, 255, 0.4); background: rgba(94, 208, 255, 0.14); color: #bae6fd; }

.checkbox-row { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: center; }
.check-item { display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; font-size: 0.9rem; }
.check-item input[type="checkbox"] { width: 1.1rem; height: 1.1rem; accent-color: var(--gold); cursor: pointer; }

/* ==================== NATIVE LIQUID GLASS DIALOGS ==================== */
dialog.glass-modal {
  background: linear-gradient(155deg var(--in-oklab), rgba(18, 32, 58, 0.92), rgba(9, 17, 34, 0.95));
  backdrop-filter: blur(28px) saturate(185%);
  -webkit-backdrop-filter: blur(28px) saturate(185%);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 22px;
  padding: 1.5rem 1.65rem;
  width: min(38rem, 92vw);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    0 28px 70px rgba(0, 0, 0, 0.65);
}
dialog.glass-modal-lg { width: min(50rem, 94vw); }
dialog.glass-modal:modal { overscroll-behavior: contain; }
dialog.glass-modal::backdrop {
  background: rgba(4, 8, 18, 0.68);
  backdrop-filter: blur(8px);
  overflow: hidden;
  overscroll-behavior: contain;
}
.modal-title { margin: 0 0 0.45rem; font-size: 1.2rem; font-weight: 700; color: #ffffff; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1.15rem; }
.modal-divider { border: 0; border-top: 1px solid rgba(255, 255, 255, 0.12); margin: 1.1rem 0 0.85rem; }

.md-preview-body {
  max-height: 60vh;
  overflow-y: auto;
  background: rgba(4, 9, 20, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 14px;
  padding: 1rem 1.15rem;
  font-family: "Cascadia Code", "Microsoft YaHei UI", monospace;
  font-size: 0.84rem;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  color: var(--text-soft);
}

/* ==================== TOAST ==================== */
.glass-toast {
  position: fixed;
  inset: auto 1.75rem 1.5rem auto;
  margin: 0;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: min(34rem, calc(100vw - 2.5rem));
  padding: 0.72rem 1.2rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.88rem;
  color: #ffffff;
  background: linear-gradient(135deg var(--in-oklab), rgba(16, 36, 66, 0.94), rgba(10, 22, 42, 0.94));
  backdrop-filter: blur(20px);
  border: 1px solid rgba(248, 212, 112, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.30),
    0 14px 36px rgba(0, 0, 0, 0.50);
}
.glass-toast[popover]:not(:popover-open) {
  display: none;
}
.glass-toast.toast-ok { border-color: rgba(74, 222, 128, 0.6); }
.glass-toast.toast-err { border-color: rgba(251, 113, 133, 0.65); }
.glass-toast.toast-warn { border-color: rgba(248, 212, 112, 0.65); }

/* ==================== MOBILE ADAPTATION (<= 900px & PHONES) ==================== */
@media (max-width: 900px) {
  .liquid-orb {
    filter: blur(56px);
    opacity: 0.36;
  }
  .glass-sidebar {
    display: none;
  }
  .mobile-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding:
      max(0.5rem, env(safe-area-inset-top, 0px))
      max(0.75rem, env(safe-area-inset-right, 0px))
      0.5rem
      max(0.75rem, env(safe-area-inset-left, 0px));
    background: rgba(8, 15, 30, 0.86);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  }
  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
    padding:
      0.42rem
      max(0.65rem, env(safe-area-inset-right, 0px))
      max(0.5rem, env(safe-area-inset-bottom, 0px))
      max(0.65rem, env(safe-area-inset-left, 0px));
    background: rgba(8, 15, 30, 0.90);
    backdrop-filter: blur(24px) saturate(185%);
    -webkit-backdrop-filter: blur(24px) saturate(185%);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.35);
  }
  .mobile-bottom-nav .mobile-tab {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.2rem;
    padding: 0.38rem 0.25rem;
    min-block-size: 3.1rem;
    border-radius: 12px;
    font-size: 0.76rem;
    font-weight: 600;
    text-align: center;
  }
  .mobile-bottom-nav .mobile-tab:hover {
    transform: none;
  }
  .mobile-bottom-nav .mobile-tab .svg-ico {
    width: 1.25rem;
    height: 1.25rem;
  }

  .app-shell {
    grid-template-columns: 1fr;
    padding: 0;
    gap: 0;
  }
  .glass-main {
    border-radius: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding:
      calc(4.4rem + env(safe-area-inset-top, 0px))
      max(0.85rem, env(safe-area-inset-right, 0px))
      calc(5.5rem + env(safe-area-inset-bottom, 0px))
      max(0.85rem, env(safe-area-inset-left, 0px));
    scroll-padding-top: calc(4.8rem + env(safe-area-inset-top, 0px));
    scroll-padding-bottom: calc(5.8rem + env(safe-area-inset-bottom, 0px));
    -webkit-overflow-scrolling: touch;
  }
  .glass-card {
    padding: 1.05rem 1rem;
    border-radius: 16px;
  }
  .empty-hero {
    margin-top: 1.5rem;
    padding: 1.75rem 1.15rem;
  }
  .ws-header {
    align-items: stretch;
  }
  .ws-title-group {
    flex: 1;
    min-width: 0;
  }
  .title-input {
    min-width: 0;
    width: 100%;
    font-size: 1.05rem;
  }
  .sticky-preview {
    position: static;
  }
  .preview-stage {
    min-height: 15rem;
    max-height: 28rem;
  }
  .glass-toast {
    inset: auto 0.85rem calc(4.9rem + env(safe-area-inset-bottom, 0px)) 0.85rem;
    max-width: none;
    justify-content: center;
    text-align: center;
    border-radius: 14px;
    padding: 0.68rem 1rem;
  }
}

@media (max-width: 760px) {
  /* Keep 3-step wizard compact in a single horizontal row on phones */
  .stepper-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.42rem;
  }
  .stepper-btn {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.32rem;
    padding: 0.55rem 0.35rem;
    min-block-size: 3.4rem;
    border-radius: 12px;
  }
  .stepper-num {
    width: 1.55rem;
    height: 1.55rem;
    min-width: 1.55rem;
    font-size: 0.78rem;
  }
  .stepper-title {
    font-size: 0.78rem;
    line-height: 1.2;
  }
  .stepper-desc {
    display: none;
  }
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  /* Prevent iOS Safari auto-zoom on form field focus (font-size >= 16px) */
  .field input,
  .field select,
  .field textarea,
  .inline-form-row input,
  .model-search-input,
  .preview-controls select {
    font-size: 1rem;
  }
  .inline-form-row {
    flex-wrap: wrap;
  }
  .inline-form-row input {
    min-width: 0;
    width: 100%;
  }
  .doc-item {
    flex-direction: column;
    align-items: stretch;
  }
  .brand-switcher-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .brand-switcher-bar .field {
    min-width: 0;
    width: 100%;
  }
  .brand-switcher-bar .row-actions {
    align-self: stretch;
  }
  .brand-switcher-bar .row-actions .btn {
    flex: 1;
  }
  .model-search-input {
    min-width: 0;
    width: 100%;
  }
  .preset-bar .field {
    min-width: 0 !important;
    width: 100%;
  }
  .adv-toggles-grid {
    grid-template-columns: 1fr;
  }
  .asset-chip {
    max-width: 100%;
    flex-wrap: wrap;
  }
}

@media (max-width: 560px) {
  .wizard-footer {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .wizard-footer > .btn,
  .wizard-footer > .row-actions {
    width: 100%;
  }
  .wizard-footer > .row-actions .btn {
    flex: 1;
  }
  .render-action-bar .btn,
  .empty-actions .btn {
    flex: 1 1 100%;
  }
  dialog.glass-modal,
  dialog.glass-modal-lg {
    width: calc(100dvw - 1.25rem);
    max-height: 88dvh;
    overflow-y: auto;
    padding: 1.15rem 1rem;
    border-radius: 18px;
  }
  .modal-actions {
    flex-wrap: wrap;
  }
  .modal-actions .btn {
    flex: 1;
  }
  .preview-controls {
    flex-wrap: wrap;
  }
  .preview-controls select {
    min-width: 0;
    width: 100%;
  }
  .preview-controls .btn {
    width: 100%;
  }
}


/* ==================== MULTI-USER EMAIL OTP LOGIN GATE & ACCOUNT BAR ==================== */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  overflow-y: auto;
}

.auth-card {
  width: min(100%, 440px);
  padding: 1.85rem 1.75rem;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.auth-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.auth-sub {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.auth-inline-row {
  display: flex;
  gap: 0.55rem;
  align-items: stretch;
}

.auth-inline-row input {
  flex: 1;
  min-width: 0;
}

.auth-send-btn {
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 108px;
  justify-content: center;
}

.auth-hint {
  margin: 0 0 0.4rem;
  font-size: 0.82rem;
}

.otp-single-input {
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  font-size: 1.25rem !important;
  letter-spacing: 0.42em;
  text-align: center;
  min-height: 48px;
}

.auth-status-msg {
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  line-height: 1.45;
  background: rgba(94, 208, 255, 0.12);
  border: 1px solid rgba(94, 208, 255, 0.28);
  color: #e0f2fe;
}

.auth-status-msg.is-err {
  background: rgba(251, 113, 133, 0.14);
  border-color: rgba(251, 113, 133, 0.35);
  color: #ffe4e6;
}

.auth-submit-btn {
  width: 100%;
  justify-content: center;
  min-height: 46px;
  font-size: 0.95rem;
}

.auth-foot-note {
  margin-bottom: 0;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

.user-account-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.48rem 0.65rem;
  margin-bottom: 0.6rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.user-account-info {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  flex: 1;
  color: var(--text-soft);
  font-size: 0.8rem;
}

.user-email-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* ==================== SECONDS QUOTA METER & WECHAT PAY RECHARGE UI ==================== */
.quota-meter-card {
  padding: 0.65rem 0.72rem;
  margin-bottom: 0.6rem;
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(248, 212, 112, 0.12), rgba(94, 208, 255, 0.08));
  border: 1px solid rgba(248, 212, 112, 0.30);
}
.quota-meter-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem;
}
.quota-meter-label {
  font-size: 0.78rem;
  color: var(--text-soft);
}
.quota-meter-val {
  font-size: 1.05rem;
  color: var(--gold);
  font-weight: 700;
}
.quota-meter-sub {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 2px;
}
.quota-meter-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
}
.btn-xs {
  padding: 0.25rem 0.52rem;
  font-size: 0.76rem;
  min-block-size: 28px;
}

.rc-tab.active {
  background: rgba(94, 208, 255, 0.22);
  border-color: rgba(94, 208, 255, 0.48);
  color: #fff;
}

.rc-preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 0.6rem;
}
.rc-preset-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 0.5rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text);
  cursor: pointer;
}
.rc-preset-btn:hover {
  border-color: rgba(248, 212, 112, 0.55);
  background: rgba(248, 212, 112, 0.10);
}
.rc-preset-btn.selected {
  border-color: var(--gold);
  background: rgba(248, 212, 112, 0.18);
  box-shadow: 0 0 0 1px rgba(248, 212, 112, 0.35);
}
.rc-preset-yuan {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
}
.rc-preset-sec {
  font-size: 0.76rem;
  color: var(--cyan);
  margin-top: 2px;
}

.rc-preview-box {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.32);
  color: #86efac;
  font-weight: 700;
  font-size: 1rem;
}

.rc-qr-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.rc-qr-box {
  padding: 0.75rem;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}
.rc-qr-img {
  width: 210px;
  height: 210px;
  display: block;
}
.rc-qr-amount {
  margin-top: 0.85rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
}
.rc-qr-seconds {
  margin-top: 0.2rem;
  font-size: 0.9rem;
  color: #86efac;
  font-weight: 600;
}
.rc-qr-status {
  font-size: 0.84rem;
  color: var(--cyan);
}

.rc-records-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 210px;
  overflow-y: auto;
}
.rc-record-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.58rem 0.78rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
  font-size: 0.82rem;
}
.rc-record-right {
  text-align: right;
  flex-shrink: 0;
}


/* ==================== ENGINE STATUS LIGHTS ==================== */
.status-lights-bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.status-light {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  padding: 0.34rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #94a3b8;
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.22);
}
.status-light.is-ok .status-dot {
  background: #4ade80;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.85), 0 0 0 2px rgba(74, 222, 128, 0.22);
}
.status-light.is-warn .status-dot {
  background: #fbbf24;
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.85), 0 0 0 2px rgba(251, 191, 36, 0.22);
}
.status-light.is-err .status-dot {
  background: #fb7185;
  box-shadow: 0 0 8px rgba(251, 113, 133, 0.85), 0 0 0 2px rgba(251, 113, 133, 0.22);
}
.status-light.is-loading .status-dot {
  background: #5ed0ff;
  box-shadow: 0 0 6px rgba(94, 208, 255, 0.65);
}


/* ==================== STUDIO PROJECT CARDS VIEW ==================== */
.sidebar-spacer {
  flex: 1 1 auto;
}
.drawer-nav-stack {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.studio-retention-banner {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.68rem 0.95rem;
  border-radius: var(--radius-md);
  background: rgba(248, 212, 112, 0.10);
  border: 1px solid rgba(248, 212, 112, 0.30);
  color: #fef3c7;
  font-size: 0.84rem;
  line-height: 1.5;
}
.studio-retention-banner .svg-ico {
  color: var(--gold);
}

.project-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(22px);
  overflow: hidden;
}
.project-card:hover {
  border-color: rgba(248, 212, 112, 0.42);
  box-shadow: 0 14px 32px rgba(2, 6, 18, 0.36);
}

.project-card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #030712;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}
.project-card-media video,
.project-card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #030712;
  display: block;
}
.project-card-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.82rem;
  padding: 1rem;
  text-align: center;
}
.project-card-status {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 2;
  padding: 0.16rem 0.58rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  pointer-events: none;
}
.project-card-status.is-done {
  background: rgba(16, 185, 129, 0.86);
  color: #ffffff;
}
.project-card-status.is-wip {
  background: rgba(15, 23, 42, 0.84);
  color: var(--cyan);
  border: 1px solid rgba(94, 208, 255, 0.35);
}

.project-card-body {
  padding: 0.9rem 1rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
}
.project-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}
.project-card-time {
  font-size: 0.74rem;
  color: var(--muted);
}
.project-card-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 0.35rem;
}
