:root {
  color-scheme: dark;
  --bg: #071015;
  --bg-elevated: #0b151b;
  --surface: #101b23;
  --surface-soft: #14212a;
  --surface-strong: #1a2b35;
  --ink: #f3f8fa;
  --muted: #b1c0c8;
  --faint: #81919b;
  --line: #263a45;
  --line-strong: #38515d;
  --brand: #16d4ce;
  --brand-strong: #2aa8ff;
  --brand-weak: rgba(22, 212, 206, 0.12);
  --gold: #f3b943;
  --gold-soft: rgba(243, 185, 67, 0.14);
  --danger: #ff6369;
  --success: #42dc8a;
  --warn: #f4b74a;
  --info: #6b8cff;
  --shadow: 0 6px 8px rgba(0, 0, 0, 0.2);
  --radius: 14px;
  --radius-sm: 10px;
  --topbar-h: 72px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    linear-gradient(180deg, #071015 0%, #0a141a 48%, #111821 100%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

body {
  min-width: 320px;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell {
  min-height: 100vh;
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--topbar-h);
  padding: calc(12px + env(safe-area-inset-top)) clamp(14px, 4vw, 28px) 12px;
  background: rgba(7, 16, 21, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
}

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

.brand-home {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.brand-home:focus-visible,
.btn:focus-visible,
.link-button:focus-visible,
.nav-item:focus-visible,
.prompt-copy:focus-visible,
.prompt-chip:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

.brand-mark,
.icon-box,
.profile-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(22, 212, 206, 0.22), rgba(42, 168, 255, 0.16));
  color: var(--brand);
}

.brand-mark svg {
  fill: rgba(22, 212, 206, 0.22);
}

.brand-title {
  margin: 0;
  font-size: 21px;
  line-height: 1.15;
  font-weight: 850;
}

.brand-subtitle {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

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

.screen {
  min-height: calc(100vh - var(--topbar-h));
  padding: 22px clamp(14px, 4vw, 28px) calc(96px + env(safe-area-inset-bottom));
}

.screen.auth {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 480px);
  align-items: center;
  gap: 26px;
  max-width: 1120px;
  min-height: 100vh;
  margin: 0 auto;
  padding-top: calc(26px + env(safe-area-inset-top));
}

.auth-showcase {
  display: grid;
  gap: 18px;
}

.auth-logo {
  color: var(--brand);
  font-size: 56px;
  line-height: 1;
  font-weight: 900;
}

.auth-tagline {
  max-width: 22ch;
  margin: 0;
  color: var(--muted);
  font-size: 22px;
  line-height: 1.35;
}

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

.auth-preview-card {
  display: grid;
  gap: 8px;
  min-height: 138px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.auth-preview-card.wide {
  grid-row: span 2;
}

.auth-preview-card span,
.auth-preview-card small {
  color: var(--muted);
  font-size: 13px;
}

.auth-preview-card strong {
  color: var(--ink);
  font-size: 36px;
  line-height: 1;
}

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

.timeline-mini b {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--brand);
}

.timeline-mini p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
}

.timeline-mini em {
  color: var(--success);
  font-size: 12px;
  font-style: normal;
}

.auth-card {
  display: grid;
  gap: 15px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-brand .brand-subtitle {
  color: var(--muted);
}

.auth-trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.auth-trust-row span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.auth-trust-row svg {
  width: 15px;
  height: 15px;
}

.page-title {
  margin: 0;
  font-size: 32px;
  line-height: 1.2;
  font-weight: 850;
  text-wrap: balance;
}

.dashboard-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  max-width: 1500px;
  margin: 0 auto 18px;
}

.dashboard-title .muted {
  max-width: 60ch;
  margin: 6px 0 0;
}

.dashboard-kpis,
.task-summary-bar,
.progress-stats,
.upload-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dashboard-kpis span,
.task-summary-bar span,
.progress-stats span,
.upload-meta-row span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.dashboard-kpis strong,
.task-summary-bar strong,
.progress-stats strong {
  color: var(--ink);
  font-size: 15px;
}

.task-summary-bar {
  justify-content: space-between;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.task-summary-bar .active {
  color: var(--brand);
  border-color: rgba(22, 212, 206, 0.5);
  background: var(--brand-weak);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(420px, 1.45fr) minmax(280px, 0.95fr);
  gap: 14px;
  max-width: 1500px;
  margin: 0 auto;
}

.dashboard-left,
.dashboard-center,
.dashboard-right,
.page-shell,
.stack {
  display: grid;
  gap: 14px;
  align-content: start;
}

.page-shell {
  max-width: 980px;
  margin: 0 auto;
}

.card,
.compact-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.card {
  padding: 18px;
  box-shadow: var(--shadow);
}

.compact-card {
  padding: 14px;
}

.card-head,
.panel-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-head {
  justify-content: flex-start;
}

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

.section-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 800;
}

.muted {
  color: var(--muted);
}

.meta {
  color: var(--faint);
  font-size: 12px;
}

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

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

.field span {
  color: var(--muted);
  font-size: 13px;
}

.input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: #0c171e;
  color: var(--ink);
}

.input::placeholder {
  color: #9badb6;
}

.input:focus {
  outline: 2px solid rgba(22, 212, 206, 0.28);
  border-color: var(--brand);
}

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

.btn,
.link-button {
  min-height: 44px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line-strong);
  padding: 0 14px;
  background: #0e1a22;
  color: var(--ink);
}

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

.btn.primary {
  border-color: transparent;
  background: linear-gradient(90deg, #16d4ce, #2aa8ff);
  color: #061015;
  font-weight: 800;
}

.btn.reward {
  border-color: rgba(243, 185, 67, 0.7);
  background: var(--gold-soft);
  color: #ffd67a;
}

.btn.danger {
  border-color: rgba(255, 99, 105, 0.46);
  background: rgba(255, 99, 105, 0.08);
  color: #ff9da1;
}

.btn.primary:active {
  transform: translateY(1px);
}

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

.btn.full {
  width: 100%;
}

.btn.compact {
  min-height: 36px;
  padding: 0 10px;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--brand);
  padding: 0 4px;
  font-weight: 750;
}

.link-button.danger {
  color: #ff9da1;
}

.link-button:disabled {
  cursor: not-allowed;
  color: var(--faint);
  opacity: 0.68;
}

.notice {
  max-width: 1500px;
  margin: 0 auto 12px;
  border: 1px solid rgba(22, 212, 206, 0.35);
  background: rgba(22, 212, 206, 0.1);
  color: #d8ffff;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}

.upload-card,
.quota-card,
.progress-card,
.result-card,
.recent-card,
.task-state-card,
.reward-hero-card,
.ad-action-card {
  display: grid;
  gap: 14px;
}

.file-box {
  position: relative;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 14px;
  background: #0b171e;
}

.file-box.locked {
  background: #10171d;
}

.file-box.dragging {
  border-color: var(--brand);
  background: var(--brand-weak);
}

.file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  min-height: 100%;
}

.file-input:disabled {
  cursor: not-allowed;
}

.upload-drop {
  display: grid;
  place-items: center;
  min-height: 168px;
  gap: 8px;
  color: var(--brand);
  text-align: center;
}

.upload-drop svg {
  width: 42px;
  height: 42px;
}

.upload-drop strong {
  max-width: 100%;
  color: var(--ink);
  font-size: 17px;
  overflow-wrap: anywhere;
}

.upload-drop span,
.upload-meta-row span {
  color: var(--muted);
  font-size: 13px;
}

.upload-meta-row svg {
  width: 15px;
  height: 15px;
}

.quota-count {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.quota-count strong,
.reward-big-number strong {
  color: var(--brand);
  font-size: 42px;
  line-height: 1;
}

.reward-big-number {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.quota-line,
.progress {
  width: 100%;
  height: 9px;
  overflow: hidden;
  background: #21313b;
  border-radius: 999px;
}

.quota-line span,
.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--brand), var(--brand-strong));
}

.progress.slim {
  height: 6px;
}

.quota-slots {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.slot {
  display: block;
  min-height: 12px;
  border-radius: 999px;
  background: #263641;
}

.slot.available {
  background: rgba(22, 212, 206, 0.52);
}

.slot.used {
  background: var(--gold);
}

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

.metric {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  padding: 11px;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

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

.step {
  display: grid;
  justify-items: center;
  gap: 6px;
  color: var(--faint);
  font-size: 12px;
  text-align: center;
}

.step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #22333e;
  color: var(--muted);
  font-weight: 800;
}

.step.active span {
  background: rgba(243, 185, 67, 0.2);
  color: var(--gold);
}

.step.completed span {
  background: rgba(66, 220, 138, 0.16);
  color: var(--success);
}

.step.active,
.step.completed {
  color: var(--ink);
}

.preview-window {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #0b171e;
}

.preview-media {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 190px;
  background:
    linear-gradient(135deg, rgba(22, 212, 206, 0.2), rgba(107, 140, 255, 0.08)),
    #101b23;
  color: var(--brand);
}

.preview-media span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: rgba(7, 16, 21, 0.72);
}

.preview-media svg {
  width: 34px;
  height: 34px;
  fill: currentColor;
  stroke-width: 0;
}

.preview-bars {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: flex;
  align-items: end;
  gap: 5px;
}

.preview-bars i {
  display: block;
  width: 8px;
  border-radius: 999px;
  background: rgba(22, 212, 206, 0.52);
}

.preview-bars i:nth-child(1) { height: 22px; }
.preview-bars i:nth-child(2) { height: 38px; }
.preview-bars i:nth-child(3) { height: 28px; background: rgba(243, 185, 67, 0.65); }
.preview-bars i:nth-child(4) { height: 46px; }

.preview-content {
  padding: 14px;
}

.result-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px;
  background: #0b171e;
}

.result-content,
.structured-result,
.shot-result,
.shot-toolbar,
.shot-detail-lines,
.shot-modal-prompts {
  display: grid;
  gap: 12px;
}

.result-content.compact {
  max-height: 280px;
  overflow: hidden;
}

.structured-result.compact {
  gap: 10px;
}

.video-info-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  background: var(--surface-soft);
}

.video-info-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.video-info-head strong,
.shot-toolbar strong {
  font-size: 16px;
}

.video-info-head span,
.video-info-more,
.shot-toolbar span,
.shot-toolbar p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.video-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  align-items: stretch;
  gap: 10px;
}

.video-info-item {
  display: grid;
  grid-template-rows: auto auto 1fr;
  align-content: stretch;
  gap: 4px;
  height: 100%;
  min-height: 122px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #0d1820;
}

.video-info-item span {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.video-info-item strong {
  align-self: start;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.video-info-item p,
.result-line,
.shot-card p,
.shot-modal-head p,
.shot-detail-lines p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.video-info-item p {
  align-self: end;
}

.result-line {
  color: var(--ink);
  font-size: 14px;
}

.result-section-title {
  margin-top: 4px;
  font-weight: 750;
}

.prompt-copy {
  display: grid;
  width: 100%;
  min-height: 44px;
  gap: 5px;
  padding: 10px;
  border: 1px solid rgba(22, 212, 206, 0.38);
  border-radius: var(--radius-sm);
  background: var(--brand-weak);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.prompt-copy-label,
.prompt-chip-label {
  font-size: 12px;
  font-weight: 750;
  color: var(--brand);
}

.prompt-copy-text {
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.prompt-copy-hint {
  justify-self: end;
  font-size: 12px;
  color: var(--muted);
}

.shot-toolbar div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.shot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-items: stretch;
  gap: 10px;
}

.shot-result.compact .shot-grid {
  grid-template-columns: 1fr;
}

.shot-result.compact .shot-card {
  grid-template-rows: auto auto auto auto;
  min-height: 0;
}

.shot-result.compact .shot-card h3 {
  min-height: 0;
}

.shot-card {
  display: grid;
  grid-template-rows: auto minmax(4.35em, auto) 1fr auto;
  gap: 8px;
  align-content: stretch;
  height: 100%;
  min-height: 184px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px;
  background: #0d1820;
}

.shot-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 26px;
}

.shot-index {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--brand-weak);
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.shot-time {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.shot-card h3 {
  margin: 0;
  min-height: 4.35em;
  font-size: 14px;
  line-height: 1.45;
  text-wrap: pretty;
}

.shot-card p {
  align-self: start;
  min-height: 1.6em;
}

.shot-prompt-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.prompt-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  max-width: 100%;
  gap: 6px;
  border: 1px solid rgba(22, 212, 206, 0.34);
  border-radius: 999px;
  padding: 0 9px;
  background: var(--brand-weak);
  color: var(--brand);
  cursor: pointer;
}

.prompt-chip-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.shot-open {
  align-self: end;
  justify-self: start;
  margin-top: auto;
}

.voiceover-panel {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(22, 212, 206, 0.34);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: rgba(22, 212, 206, 0.07);
}

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

.voiceover-head h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
}

.voiceover-head p,
.voiceover-variant p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.voiceover-script {
  max-height: 220px;
  overflow: auto;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px;
  background: #0b171e;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.voiceover-checks,
.voiceover-variants {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.voiceover-checks span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(66, 220, 138, 0.3);
  border-radius: 999px;
  padding: 0 9px;
  background: rgba(66, 220, 138, 0.08);
  color: #bdf8d5;
  font-size: 12px;
  font-weight: 750;
}

.voiceover-variant {
  flex: 1 1 220px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px;
  background: #0d1820;
}

.voiceover-variant strong {
  font-size: 13px;
}

.shot-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.58);
}

.shot-modal-panel {
  display: grid;
  width: min(760px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.shot-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.shot-modal-head h2 {
  margin: 8px 0 4px;
  font-size: 18px;
  line-height: 1.35;
}

.shot-modal-body {
  display: grid;
  gap: 14px;
  overflow: auto;
  padding: 16px;
}

.detail-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.detail-hero .muted {
  margin: 6px 0 0;
  max-width: 62ch;
}

.detail-actions,
.detail-action-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.detail-actions {
  flex: 0 0 auto;
}

.detail-result-card {
  display: grid;
  gap: 12px;
}

.detail-result-head {
  align-items: center;
}

.detail-action-bar {
  padding-top: 2px;
}

.pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
}

.empty-state {
  display: grid;
  gap: 5px;
  padding: 12px;
  color: var(--muted);
}

.empty-state strong {
  color: var(--ink);
}

.empty-state p {
  margin: 0;
}

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

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

.task-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.task-row:last-child {
  border-bottom: 0;
}

.thumb {
  display: grid;
  place-items: center;
  width: 58px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(22, 212, 206, 0.24), rgba(107, 140, 255, 0.12));
  color: var(--brand);
}

.thumb svg {
  fill: currentColor;
  stroke-width: 0;
}

.task-main {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.task-title,
.task-id {
  overflow-wrap: anywhere;
}

.task-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-id {
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.task-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.task-side {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.task-state-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.task-state-card .progress,
.task-state-card .grid-2,
.task-state-card .meta {
  grid-column: 1 / -1;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(22, 212, 206, 0.12);
  color: var(--brand);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.status.completed {
  color: var(--success);
  background: rgba(66, 220, 138, 0.12);
}

.status.failed {
  color: var(--danger);
  background: rgba(255, 99, 105, 0.13);
}

.status.analyzing,
.status.queued,
.status.pending {
  color: var(--warn);
  background: rgba(244, 183, 74, 0.13);
}

.ad-box {
  display: grid;
  place-items: center;
  min-height: 150px;
  border: 1px solid rgba(243, 185, 67, 0.42);
  border-radius: var(--radius);
  background: var(--gold-soft);
  text-align: center;
}

.ad-box p {
  margin-bottom: 0;
}

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

.profile-card p {
  margin: 6px 0 0;
}

.error {
  color: var(--danger);
}

.success {
  color: var(--success);
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(7, 16, 21, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.nav-item {
  display: grid;
  place-items: center;
  gap: 3px;
  min-height: 44px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.nav-item.active {
  color: var(--brand);
  background: var(--brand-weak);
  font-weight: 800;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

@media (max-width: 1180px) {
  .dashboard-grid {
    grid-template-columns: minmax(260px, 0.9fr) minmax(380px, 1.3fr);
  }

  .dashboard-right {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .screen.auth {
    grid-template-columns: 1fr;
    align-content: start;
  }

  .auth-showcase {
    display: none;
  }
}

@media (max-width: 760px) {
  :root {
    --topbar-h: 74px;
  }

  .top-bar {
    min-height: var(--topbar-h);
    padding: calc(12px + env(safe-area-inset-top)) 14px 12px;
  }

  .brand-title {
    font-size: 22px;
  }

  .auth-actions {
    gap: 4px;
  }

  .screen {
    padding: 18px 14px calc(118px + env(safe-area-inset-bottom));
  }

  .page-title {
    font-size: 30px;
  }

  .dashboard-title {
    display: grid;
    margin-bottom: 18px;
  }

  .dashboard-grid,
  .dashboard-left,
  .dashboard-center,
  .dashboard-right {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .dashboard-left {
    order: 2;
  }

  .dashboard-center {
    order: 4;
  }

  .dashboard-right {
    order: 1;
    display: contents;
  }

  .quota-card {
    order: 1;
  }

  .upload-card {
    order: 2;
    margin-bottom: 18px;
  }

  .progress-card,
  .result-card {
    display: none;
  }

  .recent-card {
    order: 3;
  }

  .upload-drop {
    min-height: 144px;
  }

  .task-row,
  .task-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .task-side {
    grid-column: 2;
    justify-items: start;
    display: flex;
    align-items: center;
  }

  .bottom-nav {
    display: grid;
  }

  .detail-hero {
    display: grid;
    gap: 12px;
  }

  .detail-actions,
  .detail-action-bar,
  .detail-result-head .panel-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .detail-actions .btn,
  .detail-action-bar .btn,
  .detail-result-head .btn {
    width: 100%;
  }

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

  .voiceover-head {
    display: grid;
  }

  .voiceover-head .panel-actions,
  .voiceover-head .btn {
    width: 100%;
  }

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

  .video-info-item,
  .shot-card,
  .shot-card h3 {
    min-height: 0;
  }

  .shot-card {
    grid-template-rows: auto auto auto auto;
    height: auto;
  }

  .shot-card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .shot-modal {
    align-items: end;
    padding: 0;
  }

  .shot-modal-panel {
    width: 100%;
    max-height: calc(92vh - env(safe-area-inset-bottom));
    border-radius: 14px 14px 0 0;
  }

  .shot-modal-head {
    display: grid;
  }

  .shot-modal-head .btn {
    width: 100%;
  }

  .shot-modal-body {
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 374px) {
  .screen {
    padding-left: 12px;
    padding-right: 12px;
  }

  .grid-2,
  .stepper,
  .auth-preview-grid {
    grid-template-columns: 1fr;
  }

  .auth-actions .btn {
    padding: 0 10px;
  }
}
