:root {
  color-scheme: dark;
  --bg: #061428;
  --bg-2: #0a1e44;
  --panel: rgba(10, 32, 72, 0.88);
  --text: #f4f8ff;
  --muted: #9bb4d4;
  --accent: #2ec5ff;
  --accent-ink: #041018;
  --line: rgba(46, 197, 255, 0.18);
  --danger: #ffb36b;
  --ok: #5ee0c0;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 50% -8%, rgba(46, 197, 255, 0.18), transparent 42%),
    linear-gradient(180deg, #0b2a62 0%, var(--bg) 46%);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

body {
  padding-bottom: env(safe-area-inset-bottom);
}

.app {
  width: min(440px, 100%);
  margin: 0 auto;
  padding: 20px 16px 108px;
}

.hidden { display: none !important; }

h1, h2, h3, p { margin: 0; }
h1 { font-size: 26px; }
h2 { font-size: 22px; margin-bottom: 14px; }
h3 { font-size: 16px; }

.hero, .brand, .section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  justify-content: flex-start;
  font-weight: 800;
}

.brand img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.brand span, .muted, .badge, .stat span, label {
  color: var(--muted);
}

.brand span, .stat span {
  display: block;
  font-size: 12px;
  font-weight: 600;
}

.brand #placeLine {
  font-weight: 500;
  line-height: 1.35;
  margin-top: 2px;
}

.badge {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(46, 197, 255, 0.12);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.card, .model-card, .sheet, .wizard {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(160deg, var(--panel), rgba(4, 16, 40, 0.86));
}

.quiet { margin-top: 18px; }
.active-card { border-color: rgba(46, 197, 255, 0.4); }

.model-list { display: grid; gap: 14px; margin-top: 16px; }

.model-card {
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.model-card img {
  display: block;
  width: 100%;
  height: 168px;
  object-fit: contain;
  background: #f7f9fc;
}

.model-body { padding: 16px; }
.model-body p { margin-top: 6px; font-size: 14px; line-height: 1.45; }

.meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.chip {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(4, 16, 40, 0.5);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

button, .primary, .ghost {
  border: 0;
  font: inherit;
  color: inherit;
}

.primary, .ghost {
  cursor: pointer;
  border-radius: 999px;
  font-weight: 800;
}

.primary {
  width: 100%;
  padding: 14px 16px;
  background: linear-gradient(135deg, #5ad4ff, var(--accent));
  color: var(--accent-ink);
}

.ghost {
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: rgba(46, 197, 255, 0.08);
  color: var(--accent);
}

.primary:disabled, .ghost:disabled { opacity: 0.5; }

.steps {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.text-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--accent);
  font-weight: 700;
}

.tab-page { display: none; }
.tab-page.active { display: block; }

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

.trip {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(4, 16, 40, 0.5);
}

.trip strong { font-size: 16px; }

.form { display: grid; gap: 12px; }
label { display: grid; gap: 6px; font-size: 12px; font-weight: 800; }
input, select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(4, 16, 40, 0.72);
  color: var(--text);
  font: inherit;
}

.pill-grid, .slot-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill, .slot {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(4, 16, 40, 0.4);
  cursor: pointer;
  font-weight: 800;
}

#placePills {
  display: grid;
  gap: 8px;
}

#placePills .pill {
  display: grid;
  gap: 2px;
  width: 100%;
  text-align: left;
  border-radius: 16px;
  font-weight: 700;
}

#placePills .pill strong {
  color: var(--text);
  font-size: 14px;
}

#placePills .pill .muted {
  font-size: 12px;
  font-weight: 500;
}

.pill.active, .slot.active {
  border-color: rgba(46, 197, 255, 0.5);
  background: rgba(46, 197, 255, 0.16);
  color: var(--accent);
}

.slot:disabled, .pill:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(440px, calc(100% - 24px));
  margin: 0 auto 12px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(5, 16, 40, 0.94);
  backdrop-filter: blur(16px);
}

.nav-item {
  min-height: 46px;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.nav-item.active {
  background: rgba(46, 197, 255, 0.14);
  color: var(--accent);
}

.wizard {
  position: fixed;
  inset: 0 0 72px;
  z-index: 5;
  width: min(440px, 100%);
  margin: 0 auto;
  overflow: auto;
  border-radius: 0 0 24px 24px;
}

.wizard .text-link {
  display: inline-block;
  margin-top: 12px;
}

.gate {
  text-align: center;
  padding: 48px 12px;
}

.gate img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 28px;
}

.gate h1 { margin: 18px 0 8px; }

.toast {
  position: fixed;
  right: 20px;
  bottom: 92px;
  left: 20px;
  display: none;
  max-width: 400px;
  margin: 0 auto;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
  text-align: center;
}

.toast.show { display: block; }
.toast.error { background: var(--danger); color: #2a1400; }
