:root {
  --page: #111936;
  --shell: #141c3f;
  --shell-deep: #0c1431;
  --surface: rgba(255, 255, 255, 0.09);
  --surface-strong: rgba(255, 255, 255, 0.15);
  --panel: rgba(18, 27, 58, 0.72);
  --panel-warm: rgba(116, 89, 255, 0.14);
  --ink: #f7f9ff;
  --muted: #aebce8;
  --soft: rgba(255, 255, 255, 0.08);
  --line: rgba(181, 203, 255, 0.16);
  --line-strong: rgba(181, 203, 255, 0.3);
  --aurora-blue: #63d8ff;
  --aurora-purple: #8b5cf6;
  --aurora-pink: #d8b4fe;
  --accent: var(--aurora-blue);
  --accent-strong: #4f8dff;
  --accent-soft: rgba(99, 216, 255, 0.16);
  --warm: var(--aurora-pink);
  --warm-soft: rgba(216, 180, 254, 0.14);
  --mint: #77e4c6;
  --control: rgba(255, 255, 255, 0.09);
  --radius: 28px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(99, 216, 255, 0.28), transparent 28%),
    radial-gradient(circle at 76% 4%, rgba(139, 92, 246, 0.32), transparent 30%),
    radial-gradient(circle at 82% 86%, rgba(216, 180, 254, 0.2), transparent 28%),
    linear-gradient(135deg, #0f1b3d 0%, #161342 46%, #0b1835 100%);
  font-family:
    Inter, Poppins, "Helvetica Neue", Helvetica, Arial, "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

button:disabled,
.disabled {
  opacity: 0.48;
  pointer-events: none;
}

[hidden] {
  display: none !important;
}

.app {
  position: relative;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  grid-template-rows: 74px minmax(0, 1fr);
  grid-template-areas:
    "nav top"
    "nav main";
  width: min(1680px, calc(100vw - 32px));
  min-height: calc(100vh - 48px);
  margin: 24px auto;
  overflow: hidden;
  border: 1px solid rgba(181, 203, 255, 0.2);
  border-radius: 34px;
  background:
    radial-gradient(circle at 18% 0%, rgba(99, 216, 255, 0.14), transparent 34%),
    radial-gradient(circle at 85% 8%, rgba(139, 92, 246, 0.17), transparent 30%),
    linear-gradient(145deg, rgba(22, 35, 76, 0.92), rgba(14, 20, 48, 0.96) 48%, rgba(25, 21, 63, 0.93)),
    var(--shell);
  box-shadow: 0 30px 90px rgba(0, 9, 32, 0.38);
  backdrop-filter: blur(24px);
}

.nav-rail {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 24px 18px;
  background: rgba(8, 15, 38, 0.44);
  backdrop-filter: blur(18px);
}

.nav-rail {
  grid-area: nav;
  border-right: 1px solid var(--line);
}

.rail-brand {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.rail-brand strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.1;
}

.rail-brand span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  line-height: 1.2;
}

.rail-menu {
  display: grid;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
}

.rail-logo,
.rail-btn,
.avatar-dot,
.mini-orb {
  display: grid;
  place-items: center;
}

.rail-logo {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  color: #0f2035;
  background: linear-gradient(135deg, var(--aurora-blue), var(--aurora-purple) 58%, var(--warm));
  box-shadow: 0 18px 36px rgba(99, 216, 255, 0.2);
}

.rail-btn {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  width: 100%;
  min-height: 46px;
  gap: 10px;
  align-items: center;
  justify-content: start;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 16px;
  color: var(--muted);
  background: transparent;
  text-decoration: none;
  font-size: 13px;
  font-weight: 820;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease;
}

.rail-btn.active,
.rail-btn:hover,
.rail-btn.add {
  color: var(--ink);
  border-color: rgba(99, 216, 255, 0.26);
  background: linear-gradient(135deg, rgba(99, 216, 255, 0.16), rgba(139, 92, 246, 0.18));
  transform: translateY(-1px);
}

.new-video-btn {
  width: 100%;
  min-height: 52px;
  margin: 12px 0 8px;
  border-radius: 18px;
}

.rail-stack {
  display: grid;
  gap: 12px;
  padding: 10px 0;
}

.rail-stack.compact {
  margin-top: 26px;
  padding: 12px 0;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.06);
}

.avatar-dot,
.mini-orb {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 17px;
  color: #0f2035;
  background: linear-gradient(135deg, rgba(135, 216, 255, 0.95), rgba(232, 191, 216, 0.95));
  font-size: 13px;
  font-weight: 900;
}

.avatar-dot.active::after {
  content: "";
  position: absolute;
  right: 3px;
  top: 3px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--shell-deep);
  border-radius: 50%;
  background: #8fffd2;
}

.mini-orb {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.1);
}

.topbar {
  grid-area: top;
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(0, auto);
  gap: 18px;
  align-items: center;
  min-height: 74px;
  padding: 12px 22px;
  border-bottom: 1px solid rgba(181, 203, 255, 0.14);
  background: rgba(12, 19, 46, 0.7);
  backdrop-filter: blur(18px);
}

.brand,
.welcome-copy,
.top-actions,
.status-pill,
.ghost-btn,
.primary-btn,
.pipe-step {
  display: inline-flex;
  align-items: center;
}

.welcome-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.welcome-copy > span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.welcome-copy h1 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.1;
  white-space: nowrap;
}

.welcome-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand {
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  flex: 0 0 48px;
  border-radius: 18px;
  color: #0f2035;
  background: linear-gradient(135deg, var(--accent), var(--warm));
}

.brand h1 {
  margin: 0;
  color: var(--ink);
  font-size: 23px;
  font-weight: 850;
  line-height: 1;
}

.brand p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.top-actions {
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: nowrap;
  min-width: 0;
}

.topbar .status-pill {
  display: none;
}

.search-shell {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: min(390px, 32vw);
  min-height: 44px;
  padding: 0 10px 0 16px;
  border: 1px solid transparent;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(16, 26, 62, 0.92), rgba(30, 28, 78, 0.84)) padding-box,
    linear-gradient(135deg, rgba(99, 216, 255, 0.42), rgba(139, 92, 246, 0.34), rgba(216, 180, 254, 0.26)) border-box;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 16px 34px rgba(0, 10, 32, 0.18);
  transition:
    box-shadow 0.16s ease,
    transform 0.16s ease,
    border-color 0.16s ease;
}

.search-shell:focus-within {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 0 0 4px rgba(99, 216, 255, 0.11),
    0 18px 38px rgba(0, 10, 32, 0.26);
}

.search-shell svg {
  color: var(--accent);
}

.search-shell input {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--ink);
  background: transparent;
}

.search-hint {
  display: inline-grid;
  min-width: 34px;
  min-height: 28px;
  place-items: center;
  border: 1px solid rgba(99, 216, 255, 0.24);
  border-radius: 11px;
  color: #0f2035;
  background: linear-gradient(135deg, var(--aurora-blue), var(--warm));
  font-size: 11px;
  font-weight: 900;
}

.icon-btn,
.user-avatar {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
}

.user-avatar {
  padding: 0;
  color: #0f2035;
  font-size: 13px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--aurora-blue), var(--warm));
}

.user-menu {
  position: relative;
  display: inline-grid;
  place-items: center;
}

.user-menu .user-avatar {
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.user-menu:hover .user-avatar,
.user-menu:focus-within .user-avatar {
  transform: translateY(-1px);
  border-color: rgba(135, 216, 255, 0.6);
  box-shadow: 0 12px 26px rgba(99, 216, 255, 0.18);
}

.user-popover {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 50;
  display: grid;
  gap: 10px;
  width: min(260px, calc(100vw - 32px));
  padding: 14px;
  border: 1px solid rgba(181, 203, 255, 0.22);
  border-radius: 20px;
  color: var(--ink);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.035)),
    rgba(18, 27, 58, 0.9);
  box-shadow: 0 22px 50px rgba(0, 10, 32, 0.34);
  backdrop-filter: blur(22px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  visibility: hidden;
  transition:
    opacity 160ms ease,
    transform 160ms ease,
    visibility 160ms ease;
}

.user-menu:hover .user-popover,
.user-menu:focus-within .user-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  visibility: visible;
}

.user-popover::before {
  position: absolute;
  top: -6px;
  right: 18px;
  width: 10px;
  height: 10px;
  border-top: 1px solid rgba(181, 203, 255, 0.22);
  border-left: 1px solid rgba(181, 203, 255, 0.22);
  background: rgba(34, 43, 82, 0.96);
  content: "";
  transform: rotate(45deg);
}

.user-popover-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.user-popover-copy strong {
  font-size: 14px;
  line-height: 1.15;
}

.user-popover-copy span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-popover .ghost-btn {
  width: fit-content;
  min-height: 32px;
  padding: 0 11px;
  border-radius: 12px;
}

.status-pill {
  min-height: 40px;
  gap: 7px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  font-size: 12px;
  font-weight: 780;
}

.status-pill.ok {
  color: var(--accent);
  border-color: rgba(135, 216, 255, 0.34);
  background: var(--accent-soft);
}

.workspace {
  grid-area: main;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  grid-template-areas:
    "hero hero"
    "tools tools"
    "planner pipeline"
    "plans stage"
    "spec stage";
  gap: 14px;
  padding: 18px;
  align-items: start;
}

.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035)),
    var(--panel);
  box-shadow: 0 22px 44px rgba(0, 10, 32, 0.18);
  backdrop-filter: blur(18px);
}

.panel,
.render-card,
.tool-card,
.project-row {
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.panel:hover,
.render-card:hover,
.project-row:hover {
  border-color: rgba(99, 216, 255, 0.28);
}

.input-panel {
  grid-area: plans;
  align-self: start;
  position: static;
  max-height: none;
  overflow: auto;
  padding: 18px;
}

.input-panel::-webkit-scrollbar {
  width: 8px;
}

.input-panel::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.24);
}

form {
  display: grid;
  gap: 12px;
}

.render-card {
  display: grid;
  gap: 12px;
  scroll-margin: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(135, 216, 255, 0.07), rgba(232, 191, 216, 0.06)),
    rgba(255, 255, 255, 0.045);
}

.render-card:target {
  border-color: rgba(135, 216, 255, 0.58);
  background:
    linear-gradient(135deg, rgba(135, 216, 255, 0.13), rgba(232, 191, 216, 0.1)),
    rgba(255, 255, 255, 0.07);
}

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

.render-card-head > i {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 14px;
  color: #0e1a2c;
  background: linear-gradient(135deg, var(--accent), var(--warm));
}

.render-card-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 860;
  line-height: 1.1;
}

.render-card-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  line-height: 1.25;
}

.section-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.section-title h2 {
  margin: 0;
  max-width: 100%;
  color: var(--ink);
  font-size: 18px;
  font-weight: 850;
  line-height: 1.1;
}

.section-title span {
  align-self: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.2;
}

.section-title .ai-status {
  color: var(--accent);
}

label {
  display: grid;
  gap: 7px;
}

label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--ink);
  background: var(--control);
  outline: 0;
}

input,
select {
  padding: 0 13px;
}

textarea {
  min-height: 112px;
  resize: vertical;
  padding: 12px 13px;
  line-height: 1.55;
}

input::placeholder,
textarea::placeholder {
  color: rgba(206, 216, 242, 0.62);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(135, 216, 255, 0.72);
  background: rgba(255, 255, 255, 0.13);
}

input[type="file"] {
  display: flex;
  align-items: center;
  padding: 8px;
  color: var(--muted);
}

#audiencePreset {
  border-color: rgba(135, 216, 255, 0.48);
  color: var(--ink);
  background: linear-gradient(135deg, rgba(135, 216, 255, 0.22), rgba(232, 191, 216, 0.13));
  font-weight: 760;
}

.dropzone {
  display: grid;
  place-items: start;
  gap: 9px;
  min-height: 142px;
  padding: 18px;
  border: 1px dashed rgba(206, 216, 242, 0.36);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.07);
}

.dropzone input {
  display: none;
}

.dropzone.dragging {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dropzone strong {
  color: var(--ink);
  font-size: 17px;
  font-weight: 850;
}

.dropzone span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

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

.material-count {
  justify-self: end;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.render-output-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.8fr);
  gap: 12px;
  align-items: stretch;
}

.small-btn {
  min-height: 34px;
  padding: 0 11px;
  font-size: 12px;
}

.small-btn.danger,
.ghost-btn.danger {
  color: var(--warm);
}

.file-list,
.log-list {
  display: grid;
  gap: 8px;
}

.audio-file-row,
.recording-panel,
.file-item,
.log-item,
.empty {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

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

.file-item b {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
  font-weight: 850;
}

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

.remove-file-btn {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--warm);
  background: var(--surface);
}

.recording-panel {
  display: grid;
  gap: 9px;
}

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

.voice-clone-actions {
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  align-items: center;
}

.recording-status,
.voice-clone-actions span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  overflow-wrap: anywhere;
}

.recording-status.recording {
  color: var(--warm);
}

#recordedVoicePreview {
  width: 100%;
  min-width: 0;
}

.voice-settings {
  display: grid;
  gap: 10px;
}

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

.primary-btn,
.ghost-btn {
  min-height: 42px;
  gap: 7px;
  justify-content: center;
  border-radius: 15px;
  font-weight: 820;
  text-decoration: none;
  transition:
    background 0.14s ease,
    color 0.14s ease,
    border-color 0.14s ease,
    transform 0.14s ease;
}

.primary-btn {
  border: 1px solid rgba(135, 216, 255, 0.38);
  color: #0e1a2c;
  background: linear-gradient(135deg, var(--accent), var(--warm));
  padding: 0 15px;
}

.ghost-btn {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface);
  padding: 0 13px;
}

.primary-btn:hover,
.ghost-btn:hover {
  transform: translateY(-1px);
  color: #0e1a2c;
  border-color: rgba(135, 216, 255, 0.62);
  background: linear-gradient(135deg, var(--accent), var(--warm));
}

.main-stage {
  min-width: 0;
  display: contents;
}

.dashboard-hero {
  grid-area: hero;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  gap: 24px;
  min-height: 246px;
  padding: 28px;
  border: 1px solid rgba(99, 216, 255, 0.22);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 78% 24%, rgba(99, 216, 255, 0.24), transparent 30%),
    radial-gradient(circle at 46% 110%, rgba(139, 92, 246, 0.24), transparent 36%),
    linear-gradient(135deg, rgba(33, 57, 122, 0.88), rgba(25, 22, 76, 0.88));
  box-shadow: 0 24px 56px rgba(0, 10, 32, 0.2);
  overflow: hidden;
  backdrop-filter: blur(18px);
}

.hero-content {
  display: grid;
  align-content: center;
  gap: 14px;
  min-width: 0;
}

.hero-kicker {
  width: fit-content;
  padding: 7px 11px;
  border: 1px solid rgba(99, 216, 255, 0.28);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(99, 216, 255, 0.1);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.dashboard-hero h2 {
  margin: 0;
  max-width: 760px;
  color: var(--ink);
  font-size: clamp(34px, 5vw, 64px);
  font-weight: 930;
  line-height: 0.95;
}

.dashboard-hero p {
  max-width: 680px;
  margin: 0;
  color: #d4ddff;
  font-size: 15px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.hero-actions .primary-btn,
.hero-actions .ghost-btn {
  min-height: 48px;
  padding: 0 18px;
}

.hero-preview {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 190px;
  border: 1px solid rgba(181, 203, 255, 0.18);
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.035)),
    rgba(5, 12, 32, 0.28);
  overflow: hidden;
}

.hero-preview::before {
  content: "";
  position: absolute;
  inset: 28px;
  border-radius: 50%;
  background: conic-gradient(from 120deg, var(--aurora-blue), var(--aurora-purple), var(--warm), var(--aurora-blue));
  filter: blur(4px);
  opacity: 0.82;
}

.hero-orbit,
.hero-metric {
  position: relative;
  z-index: 1;
}

.hero-orbit {
  display: grid;
  width: 96px;
  height: 96px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 34px;
  color: #0f2035;
  background: linear-gradient(135deg, var(--aurora-blue), var(--warm));
  box-shadow: 0 22px 56px rgba(99, 216, 255, 0.26);
}

.hero-orbit svg {
  width: 34px;
  height: 34px;
}

.hero-metric {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: rgba(11, 18, 43, 0.72);
  backdrop-filter: blur(14px);
}

.hero-metric strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.hero-metric span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.tool-card-grid {
  grid-area: tools;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.tool-card {
  display: grid;
  gap: 10px;
  min-height: 138px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  color: var(--ink);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04)),
    rgba(18, 27, 58, 0.7);
  text-decoration: none;
  box-shadow: 0 18px 36px rgba(0, 10, 32, 0.14);
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 216, 255, 0.34);
  background:
    linear-gradient(135deg, rgba(99, 216, 255, 0.16), rgba(139, 92, 246, 0.16)),
    rgba(18, 27, 58, 0.78);
}

.tool-card svg {
  width: 34px;
  height: 34px;
  padding: 8px;
  border-radius: 14px;
  color: #0f2035;
  background: linear-gradient(135deg, var(--aurora-blue), var(--warm));
}

.tool-card span {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.planner-panel {
  grid-area: planner;
  align-self: start;
  min-height: 360px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(135, 216, 255, 0.11), rgba(232, 191, 216, 0.1)),
    var(--panel);
}

.plan-results-panel {
  grid-area: pipeline;
  align-self: start;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: var(--planner-panel-height, auto);
  min-height: 360px;
  padding: 14px;
  max-height: none;
  overflow: hidden;
}

.planner-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.planner-actions {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.ai-status.not-ready,
.ghost-btn.not-ready {
  color: var(--accent);
}

.account-ai-panel {
  display: grid;
  gap: 10px;
  margin-top: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.07);
}

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

.manual-ai-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 850;
}

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

.account-input-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.account-video-field {
  display: grid;
  gap: 7px;
}

.account-video-field > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.account-video-dropzone {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "icon title"
    "icon hint";
  align-items: center;
  gap: 3px 12px;
  min-height: 82px;
  padding: 16px;
  border: 1px dashed rgba(140, 207, 247, 0.5);
  border-radius: 18px;
  color: var(--ink);
  background: linear-gradient(135deg, rgba(140, 207, 247, 0.1), rgba(232, 196, 225, 0.08));
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    transform 0.16s ease;
}

.account-video-dropzone input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.account-video-dropzone svg {
  grid-area: icon;
  width: 24px;
  height: 24px;
  color: var(--accent);
}

.account-video-dropzone strong {
  grid-area: title;
  font-size: 14px;
  font-weight: 900;
}

.account-video-dropzone small {
  grid-area: hint;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.account-video-dropzone.dragging {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(140, 207, 247, 0.22), rgba(232, 196, 225, 0.16));
  transform: translateY(-1px);
}

.account-video-dropzone.has-file {
  border-style: solid;
  border-color: rgba(119, 228, 198, 0.42);
}

.voice-audio-field {
  display: grid;
  gap: 7px;
}

.voice-audio-field > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.voice-audio-dropzone {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "icon title"
    "icon hint";
  align-items: center;
  gap: 4px 12px;
  min-height: 78px;
  padding: 16px;
  border: 1px dashed rgba(140, 207, 247, 0.52);
  border-radius: 18px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(135, 216, 255, 0.12), rgba(232, 191, 216, 0.09)),
    rgba(255, 255, 255, 0.055);
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    transform 0.16s ease;
}

.voice-audio-dropzone input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.voice-audio-dropzone svg {
  grid-area: icon;
  width: 25px;
  height: 25px;
  color: var(--accent);
}

.voice-audio-dropzone strong {
  grid-area: title;
  font-size: 14px;
  font-weight: 900;
}

.voice-audio-dropzone small {
  grid-area: hint;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.voice-audio-dropzone.dragging {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(135, 216, 255, 0.23), rgba(232, 191, 216, 0.16));
  transform: translateY(-1px);
}

.voice-audio-dropzone.has-file {
  border-style: solid;
  border-color: rgba(119, 228, 198, 0.42);
}

.single-video-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.single-video-actions span {
  overflow-wrap: anywhere;
}

.account-extra-field textarea {
  min-height: 78px;
}

.extension-bind-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.extension-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid rgba(119, 228, 198, 0.35);
  border-radius: 999px;
  color: var(--mint);
  background: rgba(119, 228, 198, 0.12);
  font-weight: 800;
  white-space: nowrap;
}

.extension-pill.not-ready {
  border-color: rgba(255, 199, 119, 0.35);
  color: var(--accent);
  background: rgba(255, 199, 119, 0.12);
}

.collection-status {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  font-size: 12px;
  line-height: 1.45;
}

.collection-status b {
  color: var(--accent);
}

.account-diagnosis {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 14px;
  border: 1px solid rgba(135, 216, 255, 0.3);
  border-radius: 20px;
  background: var(--accent-soft);
}

.account-diagnosis h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 850;
}

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

.diagnosis-item {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
}

.diagnosis-item b {
  display: block;
  margin-bottom: 5px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
}

.diagnosis-item span {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.plan-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 0;
  min-height: 0;
  overflow-y: auto;
  padding-right: 3px;
  scroll-snap-type: y proximity;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.plan-card,
.script-preview {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.07);
}

.plan-card {
  display: grid;
  gap: 10px;
  min-height: 186px;
  padding: 14px;
  scroll-snap-align: start;
}

.plan-card.active {
  border-color: rgba(135, 216, 255, 0.46);
  background: linear-gradient(135deg, rgba(135, 216, 255, 0.18), rgba(232, 191, 216, 0.09));
}

.plan-card-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.plan-card h3,
.script-preview h3 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 850;
  line-height: 1.16;
}

.plan-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid rgba(135, 216, 255, 0.34);
  border-radius: 999px;
  color: var(--ink);
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 850;
}

.hook-line,
.plan-card p,
.script-preview p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.hook-line {
  color: var(--ink);
  font-weight: 760;
}

.plan-card .hook-line,
.plan-card p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
}

.plan-card .hook-line {
  -webkit-line-clamp: 2;
}

.plan-card p {
  -webkit-line-clamp: 4;
}

.card-actions,
.download-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  align-self: end;
}

.script-preview {
  align-self: start;
  display: grid;
  gap: 12px;
  padding: 14px;
  scroll-snap-align: start;
}

.detail-panel .script-preview {
  max-height: min(62vh, 560px);
  overflow-y: auto;
}

.script-preview h4 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.shooting-brief {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(140, 207, 247, 0.42);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(140, 207, 247, 0.12), rgba(232, 196, 225, 0.1));
}

.shooting-brief b {
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.shooting-brief span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.script-refine-panel {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
}

.script-refine-panel textarea {
  min-height: 76px;
  font-size: 12px;
}

.script-refine-panel .ghost-btn {
  justify-self: start;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 14%, rgba(135, 216, 255, 0.36), transparent 28%),
    radial-gradient(circle at 78% 82%, rgba(232, 191, 216, 0.3), transparent 30%),
    linear-gradient(135deg, #dceaff 0%, #e9e5ff 52%, #d7efff 100%);
}

.login-card {
  width: min(480px, 100%);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 30px;
  background:
    linear-gradient(145deg, rgba(38, 52, 88, 0.94), rgba(18, 26, 45, 0.98) 54%, rgba(37, 31, 57, 0.96)),
    var(--shell);
  box-shadow: 0 28px 70px rgba(45, 58, 95, 0.26);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.login-brand h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1;
}

.login-brand p,
.login-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.login-mode-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
}

.login-mode-toggle button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--muted);
  background: transparent;
  font-weight: 820;
}

.login-mode-toggle button.active {
  color: #0e1a2c;
  border-color: rgba(135, 216, 255, 0.38);
  background: linear-gradient(135deg, var(--accent), var(--warm));
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form .primary-btn {
  width: 100%;
  min-height: 52px;
  margin-top: 4px;
  font-size: 16px;
}

.login-status {
  min-height: 22px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.login-status[data-tone="ok"] {
  color: var(--accent);
}

.login-status[data-tone="error"] {
  color: #ffc9d6;
}

.shot-detail-grid {
  display: grid;
  gap: 10px;
}

.shot-detail-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
}

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

.shot-detail-head b {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.shot-detail-head span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.shot-detail-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.shot-detail-list div {
  display: grid;
  gap: 3px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.shot-detail-list dt {
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
}

.shot-detail-list dd {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.script-lines,
.shot-lines {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.script-lines li,
.shot-lines li {
  display: grid;
  gap: 4px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.script-lines b,
.shot-lines b {
  color: var(--ink);
  font-size: 11px;
  font-weight: 850;
}

.compact-lines li {
  padding: 8px 10px;
}

.pipeline {
  grid-area: pipeline;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.pipe-step {
  min-height: 48px;
  justify-content: flex-start;
  gap: 6px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  font-size: 12px;
  font-weight: 820;
}

.pipe-step.active {
  color: #0e1a2c;
  border-color: rgba(135, 216, 255, 0.5);
  background: linear-gradient(135deg, var(--accent), var(--warm));
}

.stage-grid {
  grid-area: stage;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.detail-panel,
.preview-panel,
.progress-panel,
.spec-panel {
  padding: 18px;
}

.preview-panel {
  display: grid;
  gap: 12px;
  border-right: 0;
}

.render-output-grid .preview-panel {
  padding: 14px;
}

.phone-frame {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 9 / 16;
  max-height: 420px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(160deg, rgba(135, 216, 255, 0.12), rgba(232, 191, 216, 0.08)),
    var(--shell-deep);
  overflow: hidden;
}

.render-output-grid .phone-frame {
  max-height: 280px;
}

.phone-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000000;
}

.phone-frame:not(.has-video) video {
  display: none;
}

.placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 20px;
  color: var(--muted);
  text-align: left;
}

.phone-frame.has-video .placeholder {
  display: none;
}

.progress-shell {
  height: 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--warm));
  transition: width 0.2s ease;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 9px 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.progress-meta strong {
  color: var(--ink);
}

.spec-panel,
.recent-projects {
  grid-area: spec;
}

.recent-projects {
  display: grid;
  gap: 12px;
}

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

.project-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  min-height: 78px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
}

.project-row:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.09);
}

.project-row b {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.project-row span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.project-row time {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

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

.spec-grid div {
  display: grid;
  gap: 6px;
  min-height: 104px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
}

.spec-grid b {
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
}

.spec-grid span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: 16px;
  color: #0e1a2c;
  background: linear-gradient(135deg, var(--accent), var(--warm));
  font-size: 13px;
  font-weight: 820;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
}

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

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

.brand-mark svg,
.placeholder svg,
.dropzone svg {
  width: 26px;
  height: 26px;
}

@media (max-width: 1120px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    grid-template-areas:
      "top"
      "main";
  }

  .nav-rail {
    display: none;
  }

  .workspace,
  .stage-grid,
  .spec-grid,
  .plan-layout,
  .diagnosis-grid,
  .planner-form,
  .dashboard-hero,
  .tool-card-grid {
    grid-template-columns: 1fr;
  }

  .workspace {
    grid-template-areas:
      "hero"
      "tools"
      "planner"
      "pipeline"
      "plans"
      "stage"
      "spec";
  }

  .input-panel {
    position: static;
    max-height: none;
  }

  .script-preview {
    position: static;
  }

  .plan-results-panel {
    height: auto;
    min-height: auto;
    overflow: visible;
  }

  .plan-layout {
    overflow: visible;
    padding-right: 0;
  }

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

  .preview-panel {
    border-right: 0;
  }

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

  .pipe-step {
    justify-content: center;
    padding: 0 8px;
  }
}

@media (max-width: 680px) {
  body {
    background: var(--shell-deep);
  }

  .app {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .topbar {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .top-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .search-shell {
    width: 100%;
    order: -1;
  }

  .brand h1,
  .welcome-copy h1 {
    font-size: 18px;
  }

  .workspace {
    display: grid;
    grid-template-areas:
      "hero"
      "tools"
      "planner"
      "pipeline"
      "detail"
      "plans"
      "stage"
      "spec";
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
  }

  .stage-grid {
    display: contents;
  }

  .detail-panel {
    grid-area: detail;
  }

  .progress-panel {
    grid-area: stage;
  }

  .input-panel,
  .dashboard-hero,
  .planner-panel,
  .plan-results-panel,
  .detail-panel,
  .preview-panel,
  .progress-panel,
  .spec-panel {
    padding: 14px;
  }

  .panel,
  .pipeline {
    border-radius: 20px;
  }

  .grid-2,
  .download-row,
  .material-toolbar,
  .recording-actions,
  .voice-clone-actions,
  .planner-actions,
  .card-actions,
  .project-row {
    grid-template-columns: 1fr;
  }

  .dashboard-hero h2 {
    font-size: 36px;
  }

  .hero-preview {
    min-height: 160px;
  }

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

  .plan-card {
    min-height: auto;
  }

  .pipeline {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    padding: 12px;
  }

  .pipe-step {
    min-height: 46px;
    font-size: 11px;
  }

  .pipe-step svg {
    display: none;
  }

  .section-title {
    grid-template-columns: 1fr;
  }
}
