:root {
  color-scheme: dark;
  --ink: #0a0a1f;
  --midnight: #15162c;
  --twilight: #1e1f3a;
  --dusk: #2a2b4a;
  --gold: #d4b062;
  --gold-bright: #e8c878;
  --gold-dim: #8a7440;
  --gold-faint: rgba(212, 176, 98, 0.16);
  --gold-ghost: rgba(212, 176, 98, 0.06);
  --silver: #c4c8da;
  --thread: #6f7590;
  --mist: #4a4e68;
  --rust: #b34b4b;
  --moss: #7a9b6e;
  --lapis: #6f86b8;
  --line: rgba(255, 255, 255, 0.065);
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-ui: Montserrat, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html, body, #app {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(ellipse at 50% 10%, rgba(212, 176, 98, 0.08), transparent 36%),
    radial-gradient(ellipse at center, #15162c 0%, #0a0a1f 72%, #05050f 100%);
  color: var(--silver);
  font: 14px/1.45 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button, input, textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app {
  width: min(100%, 560px);
  min-height: 100vh;
  margin: 0 auto;
  position: relative;
  background:
    radial-gradient(ellipse at 50% 18%, rgba(212, 176, 98, 0.045), transparent 44%),
    radial-gradient(ellipse at center, var(--midnight) 0%, var(--ink) 72%, #05050f 100%);
  box-shadow: 0 0 0 1px rgba(212, 176, 98, 0.08), 0 30px 90px rgba(0,0,0,0.36);
}

.boot {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 22px;
  padding: 34px;
  text-align: center;
  color: var(--gold);
  font: 11px var(--font-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background:
    radial-gradient(ellipse at 50% 32%, rgba(212, 176, 98, 0.075), transparent 38%),
    radial-gradient(ellipse at center, var(--midnight) 0%, var(--ink) 72%, #05050f 100%);
}

.boot-mark {
  position: relative;
  width: min(62vw, 190px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.boot-mark::before,
.boot-mark::after {
  content: "";
  position: absolute;
  inset: 8%;
  border: 1px solid rgba(212, 176, 98, 0.48);
  border-top-color: rgba(232, 200, 120, 0.95);
  border-radius: 50%;
  box-shadow: 0 0 44px rgba(212, 176, 98, 0.16);
  animation: lum-spin 4.2s linear infinite;
}

.boot-mark::after {
  inset: 20%;
  border-color: rgba(232, 200, 120, 0.18);
  border-left-color: rgba(232, 200, 120, 0.7);
  transform: rotate(-18deg) scaleX(1.4);
  animation: lum-spin-rev 6.8s linear infinite;
}

.boot img {
  width: 82px;
  height: 82px;
  object-fit: cover;
  border-radius: 22px;
  border: 1px solid rgba(212, 176, 98, 0.38);
  box-shadow: 0 0 42px rgba(212, 176, 98, 0.22);
  z-index: 1;
  animation: lum-breathe 3.4s ease-in-out infinite;
}

.boot-copy {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.boot-copy::before {
  content: "";
  display: block;
  width: min(48vw, 150px);
  height: 1px;
  margin-bottom: 7px;
  background: linear-gradient(90deg, transparent, rgba(212, 176, 98, 0.82), transparent);
  opacity: 0.86;
}

.boot-copy strong {
  display: block;
  color: var(--gold);
  font: 500 18px/1 var(--font-display);
  letter-spacing: 0.18em;
}

.boot-copy span {
  display: block;
  color: var(--gold);
  font: 11px var(--font-mono);
  letter-spacing: 0.18em;
}

.boot-copy span::after {
  content: "_";
  margin-left: 2px;
  animation: lum-blink 1.05s steps(1) infinite;
}

.boot-copy em {
  display: block;
  color: var(--mist);
  font: 10px var(--font-mono);
  font-style: normal;
  letter-spacing: 0.04em;
}

@keyframes lum-spin {
  to { transform: rotate(360deg); }
}

@keyframes lum-spin-rev {
  from { transform: rotate(0deg) scaleX(1.4); }
  to { transform: rotate(-360deg) scaleX(1.4); }
}

@keyframes lum-breathe {
  0%, 100% {
    box-shadow: 0 0 22px rgba(212,176,98,0.18);
    filter: brightness(0.96);
  }
  50% {
    box-shadow: 0 0 44px rgba(212,176,98,0.42);
    filter: brightness(1.08);
  }
}

@keyframes lum-blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 56px;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 12px 8px;
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  gap: 8px;
  background: rgba(10, 10, 31, 0.88);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--line);
}

.icon-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--gold-faint);
  border-radius: 10px;
  background: rgba(255,255,255,0.035);
  color: var(--gold);
  display: grid;
  place-items: center;
}

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

.brand-head img {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  border: 1px solid rgba(212, 176, 98, 0.28);
}

.brand-title {
  color: var(--gold);
  font: 500 14px/1 var(--font-display);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.brand-sub {
  margin-top: 3px;
  color: var(--mist);
  font: 9px var(--font-mono);
  letter-spacing: 0.08em;
}

.screen {
  padding: 18px 16px 96px;
}

.hero {
  text-align: center;
  padding: 18px 6px 24px;
  border-bottom: 1px solid var(--line);
}

.hero img {
  width: min(320px, 94%);
  max-height: 120px;
  object-fit: contain;
  filter: drop-shadow(0 0 30px rgba(212, 176, 98, 0.22));
}

.hero p {
  margin: 10px 0 0;
  color: var(--thread);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.home-hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 32px 20px 28px;
  border-bottom: 1px solid var(--line);
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 60%, rgba(212,176,98,0.08), transparent 70%);
  pointer-events: none;
}

.home-hero img {
  position: relative;
  display: block;
  width: 108%;
  max-width: none;
  height: auto;
  margin: 0 -4% -10px;
  filter: drop-shadow(0 0 32px rgba(212,176,98,0.28));
}

.home-hero p {
  position: relative;
  margin: 10px 0 0;
  color: var(--thread);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1.6;
}

.home-hero p span {
  display: block;
  margin-top: 4px;
  opacity: 0.62;
  font-size: 11px;
}

.home-stats-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  padding: 14px 16px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}

.home-stat {
  min-width: 0;
  padding: 8px 4px;
  text-align: center;
  background: var(--ink);
}

.home-stat strong {
  display: block;
  color: var(--gold);
  font: 500 22px/1.1 var(--font-display);
}

.home-stat span {
  display: block;
  margin-top: 4px;
  color: var(--thread);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.home-screen {
  padding-top: 20px;
}

.home-section {
  margin-top: 24px;
}

.home-section:first-child {
  margin-top: 0;
}

.section-heading-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.home-section-meta {
  color: var(--thread);
  font: 10.5px var(--font-mono);
  letter-spacing: 0.04em;
}

.home-action-card {
  width: 100%;
  margin-top: 14px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--gold-faint);
  border-radius: 10px;
  background: var(--midnight);
  color: inherit;
  text-align: left;
  box-shadow: 0 8px 24px rgba(0,0,0,0.28), inset 0 1px 0 rgba(212,176,98,0.05);
}

.home-action-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(212,176,98,0.4);
  border-radius: 999px;
  background: rgba(212,176,98,0.04);
  color: var(--gold);
  font-size: 20px;
  box-shadow: 0 0 18px rgba(212,176,98,0.08);
}

.home-action-copy {
  min-width: 0;
  flex: 1;
}

.home-action-copy strong {
  display: block;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.home-action-copy span {
  display: block;
  margin-top: 2px;
  color: var(--thread);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.home-action-chev {
  color: var(--mist);
  font-size: 22px;
}

.bot-strip-wrap {
  padding-bottom: 16px;
}

.bot-strip {
  width: 100%;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--gold-faint);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(30,31,58,0.7), rgba(21,22,44,0.7));
  color: inherit;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(212,176,98,0.05);
}

.bot-strip-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(111,134,184,0.12);
  font-size: 18px;
}

.bot-strip-copy {
  min-width: 0;
}

.bot-strip-copy strong {
  display: block;
  color: var(--silver);
  font-size: 12px;
  font-weight: 650;
}

.bot-strip-copy small {
  display: block;
  margin-top: 2px;
  color: var(--mist);
  font: 10.5px var(--font-mono);
}

.empty-card {
  color: var(--thread);
  font: 11.5px var(--font-mono);
  letter-spacing: 0.06em;
  text-align: center;
  border-style: dashed;
}

.eyebrow {
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.h1 {
  margin: 6px 0 0;
  color: #fff;
  font: 500 29px/1.08 var(--font-display);
  letter-spacing: 0.01em;
}

.sub {
  margin-top: 8px;
  color: var(--thread);
  font-size: 11px;
  letter-spacing: 0.11em;
  text-transform: lowercase;
}

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

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

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

.section {
  margin-top: 22px;
}

.card, .tile, .run-card {
  border: 1px solid var(--gold-faint);
  border-radius: 10px;
  background: var(--midnight);
  box-shadow: 0 8px 24px rgba(0,0,0,0.28), inset 0 1px 0 rgba(212,176,98,0.05);
}

.card {
  padding: 14px;
}

.tile {
  min-height: 132px;
  padding: 14px;
  text-align: left;
  color: inherit;
  position: relative;
  overflow: hidden;
}

.tile.active, .run-card.active, .model-card.active, .choice.active {
  border-color: var(--gold);
  background: rgba(212,176,98,0.08);
}

.tile-emoji {
  font-size: 20px;
}

.tile-title {
  margin-top: 22px;
  color: #fff;
  font-weight: 750;
  line-height: 1.25;
}

.tile-sub {
  margin-top: 5px;
  color: var(--thread);
  font-size: 10.5px;
  line-height: 1.4;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  padding: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.stat {
  background: rgba(10,10,31,0.75);
  padding: 10px 6px;
  text-align: center;
}

.stat strong {
  color: var(--gold);
  font: 500 22px/1 var(--font-display);
}

.stat span {
  display: block;
  margin-top: 6px;
  color: var(--thread);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.run-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.run-card {
  width: 100%;
  padding: 13px;
  text-align: left;
  color: inherit;
}

.run-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.run-id, .mono {
  font-family: var(--font-mono);
  color: var(--mist);
  font-size: 10px;
}

.run-title {
  margin-top: 6px;
  color: #fff;
  font-weight: 750;
  line-height: 1.25;
}

.run-meta {
  margin-top: 7px;
  color: var(--thread);
  font-size: 11px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--gold-faint);
  border-radius: 999px;
  padding: 3px 7px;
  color: var(--gold);
  background: var(--gold-ghost);
  font: 9.5px var(--font-mono);
  letter-spacing: 0.04em;
}

.progress {
  height: 3px;
  margin-top: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--twilight);
}

.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  box-shadow: 0 0 8px rgba(212,176,98,0.5);
}

.pill {
  border: 1px solid var(--gold-faint);
  border-radius: 999px;
  padding: 11px 16px;
  background: transparent;
  color: var(--gold);
  font-weight: 750;
}

.pill.gold {
  border-color: transparent;
  background: var(--gold);
  color: var(--ink);
  box-shadow: 0 4px 22px rgba(212,176,98,0.17);
}

.pill.danger {
  border-color: rgba(179,75,75,0.38);
  color: var(--rust);
}

.full { width: 100%; }

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 30;
  width: min(100%, 560px);
  transform: translateX(-50%);
  padding: 8px 6px calc(env(safe-area-inset-bottom, 0px) + 8px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: rgba(10,10,31,0.94);
  backdrop-filter: blur(24px);
  border-top: 1px solid var(--line);
}

.nav-btn {
  border: 0;
  background: transparent;
  color: var(--thread);
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 7px 0;
}

.nav-btn.active {
  color: var(--gold);
}

.nav-btn span:first-child {
  font-size: 17px;
}

.nav-btn span:last-child {
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.wizard {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin: 14px 0 16px;
}

.wizard i {
  display: block;
  height: 3px;
  border-radius: 2px;
  background: var(--twilight);
}

.wizard i.done {
  background: var(--gold);
  box-shadow: 0 0 8px rgba(212,176,98,0.35);
}

.field, .textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--twilight);
  color: #fff;
  padding: 13px 14px;
  outline: none;
}

.textarea {
  min-height: 128px;
  resize: vertical;
}

.choice {
  min-height: 76px;
  border: 1px solid var(--gold-faint);
  border-radius: 10px;
  background: var(--midnight);
  color: #fff;
  display: grid;
  place-content: center;
  gap: 5px;
}

.choice strong {
  color: var(--gold);
  font: 500 26px/1 var(--font-display);
}

.choice span {
  color: var(--thread);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.model-card {
  width: 100%;
  border: 1px solid var(--gold-faint);
  border-radius: 10px;
  background: var(--midnight);
  color: inherit;
  padding: 13px;
  text-align: left;
}

.model-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.model-name {
  color: #fff;
  font: 500 20px/1 var(--font-display);
}

.model-note {
  margin-top: 9px;
  color: var(--thread);
  font-size: 11px;
  line-height: 1.45;
}

.summary {
  margin-top: 14px;
  border: 1px dashed rgba(212,176,98,0.25);
  border-radius: 10px;
  padding: 12px;
  background: rgba(212,176,98,0.045);
  color: var(--thread);
  font-size: 11px;
}

.summary strong {
  display: block;
  color: #fff;
  margin-bottom: 4px;
  font-size: 12.5px;
}

.cost-row, .qa-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.cost-row:last-child, .qa-row:last-child {
  border-bottom: 0;
}

.cost-row span, .qa-row span {
  color: var(--thread);
}

.cost-row strong, .qa-row strong {
  color: #fff;
  font: 11px var(--font-mono);
  text-align: right;
}

.preview-frame {
  width: min(260px, 82vw);
  aspect-ratio: 9 / 16;
  margin: 0 auto;
  border: 1px solid var(--gold-faint);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  background:
    repeating-linear-gradient(135deg, #2a1e34 0 7px, #171633 7px 14px),
    var(--ink);
  box-shadow: 0 24px 64px rgba(0,0,0,0.42), 0 0 80px rgba(212,176,98,0.09);
}

.preview-frame video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.preview-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--gold);
  font-size: 42px;
  background: radial-gradient(circle, transparent 20%, rgba(10,10,31,0.28) 100%);
}

.subtitle-band {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 74px;
  color: #fff;
  text-align: center;
  font-weight: 850;
  line-height: 1.2;
  text-shadow: 0 2px 10px rgba(0,0,0,0.9);
}

.orbit {
  position: absolute;
  left: 50%;
  bottom: 26px;
  width: 146px;
  height: 22px;
  transform: translateX(-50%);
  border-top: 1px solid var(--gold);
  border-radius: 50%;
  opacity: 0.8;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 86px;
  z-index: 50;
  transform: translateX(-50%);
  max-width: min(420px, 86vw);
  padding: 10px 16px;
  border: 1px solid rgba(212,176,98,0.34);
  border-radius: 999px;
  background: rgba(10,10,31,0.94);
  color: #fff;
  box-shadow: 0 14px 40px rgba(0,0,0,0.42);
  font-size: 12px;
  text-align: center;
}

.hidden { display: none !important; }

.empty {
  min-height: 55vh;
  display: grid;
  place-content: center;
  gap: 10px;
  text-align: center;
  color: var(--thread);
}

.empty h2 {
  margin: 0;
  color: #fff;
  font: 500 28px/1.1 var(--font-display);
}

@media (min-width: 780px) {
  .app {
    min-height: calc(100vh - 28px);
    margin-top: 14px;
    margin-bottom: 14px;
    border-radius: 28px;
    overflow: clip;
  }
}
