:root {
  --bg: #0b1020;
  --bg-2: #101730;
  --panel: rgba(255, 255, 255, 0.03);
  --border: rgba(255, 255, 255, 0.09);
  --ink: #e8e6e1;
  --ink-dim: #9a97b0;
  --gold: #c9a86a;
  --gold-2: #e4c98f;
  --serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

/* The `hidden` attribute must always win. Without this, any rule with a
   class/ID selector (e.g. `.preview-wrap img { display: block }`) out-
   specifies the UA's `[hidden] { display: none }`, so a hidden element
   paints anyway. That is how the empty #preview <img> (no src) showed its
   alt text "Your star map preview" above the example poster until the
   first selection (Joel, 2026-09-27). */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: radial-gradient(1200px 700px at 75% -10%, #1a2440 0%, var(--bg) 55%) fixed, var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.page { max-width: 1150px; margin: 0 auto; padding: 28px 24px 60px; }

.masthead {
  display: flex; align-items: center; gap: 14px; padding: 6px 2px 26px;
  border-bottom: 1px solid var(--border);
}
.brand {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--serif); font-size: 30px; letter-spacing: 0.35em;
  color: var(--gold-2); text-decoration: none;
}
/* mark: rim --gold, sparkle --gold-2 (see templates/_brandmark.html) */
.brand-mark { color: var(--gold); display: block; }
.brand .brand-mark { width: 32px; height: 32px; flex: none; }
.brand-word { margin-right: -0.35em; }  /* trim the tracking's trailing space */
.tagline { color: var(--ink-dim); font-size: 13px; letter-spacing: 0.08em; }
/* Phones: the 10-letter wordmark leaves no room beside it, so the tagline
   drops to its own line instead of squeezing into a one-word column. */
@media (max-width: 600px) {
  .masthead { flex-wrap: wrap; row-gap: 8px; }
  .brand { font-size: 24px; letter-spacing: 0.22em; }
  .brand-word { margin-right: -0.22em; }
  .tagline { flex-basis: 100%; }
}

.columns {
  display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 26px;
  margin-top: 28px; align-items: start;
}
@media (max-width: 900px) { .columns { grid-template-columns: 1fr; } }
/* DOS-30: grid items default to min-width:auto, so a rendered preview forces the
   column wider than a 390px viewport (scrollWidth 400 > clientWidth 390). */
.columns > * { min-width: 0; }

.panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 24px;
}

.form-panel h1 { font-family: var(--serif); font-size: 24px; font-weight: 500; margin: 0 0 20px; }

.field { display: block; margin-bottom: 18px; }
.field .label { display: block; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-dim); margin-bottom: 7px; }
.field .label em { text-transform: none; letter-spacing: 0; opacity: 0.7; }

input[type="text"], input[type="email"], input[type="date"], input[type="time"] {
  width: 100%; padding: 10px 12px; border-radius: 9px;
  border: 1px solid var(--border); background: rgba(10, 14, 30, 0.6); color: var(--ink);
  font-size: 15px; outline: none;
}
input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 168, 106, 0.15); }

.row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; }
/* DOS-30 (cont.): the same default bites this nested grid. The date/time tracks
   are sized by the inputs' ~20-character intrinsic width, so at a 360px
   viewport the row measured 327px inside a 264px panel and pushed the page to
   scrollWidth 376 vs clientWidth 360 — the columns fix alone did not reach it. */
.row > * { min-width: 0; }
/* Native date/time editors clip their inner segments even when the grid fits.
   Give phone controls a full row so AM/PM stays visible beside the clock. */
@media (max-width: 480px) {
  .row { grid-template-columns: 1fr; gap: 0; }
}

.results {
  margin-top: 6px; border: 1px solid var(--border); border-radius: 9px; overflow: hidden;
  background: #0d1326;
}
.results button {
  display: block; width: 100%; text-align: left; padding: 9px 12px;
  background: none; border: none; color: var(--ink); font-size: 13.5px; cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.results button:last-child { border-bottom: none; }
.results button:hover { background: rgba(201, 168, 106, 0.12); }
.results .tz { color: var(--ink-dim); font-size: 11px; margin-left: 6px; }

.hint { font-size: 12px; color: var(--ink-dim); margin-top: 7px; }

.style-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.style-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 4px;
  background: rgba(10, 14, 30, 0.5); border: 1px solid var(--border); border-radius: 10px;
  color: var(--ink); cursor: pointer; font-size: 12.5px;
}
.style-card.active { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(201, 168, 106, 0.25); }
.swatch { width: 100%; height: 52px; border-radius: 7px; display: block; }
.swatch-night { background: radial-gradient(circle at 40% 30%, #3d5a9e 0%, #0d1526 60%), #0d1526; }
.swatch-gold { background: radial-gradient(circle at 60% 40%, #2a3b6e 0%, #0a0f1f 60%), #0a0f1f; box-shadow: inset 0 0 0 1px rgba(201, 168, 106, 0.5); }
.swatch-vellum { background: radial-gradient(circle at 50% 30%, #e9dfc4 0%, #cfc2a2 70%), #cfc2a2; }

/* ── toggles ──────────────────────────────────────────── */
.toggles { display: flex; gap: 18px; flex-wrap: wrap; }
.toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; color: var(--ink); user-select: none; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-track {
  width: 34px; height: 19px; border-radius: 20px; background: rgba(255, 255, 255, 0.12);
  position: relative; transition: background 0.18s; flex: none;
}
.toggle-track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px;
  border-radius: 50%; background: #c9c7c4; transition: transform 0.18s, background 0.18s;
}
.toggle input:checked + .toggle-track { background: rgba(201, 168, 106, 0.45); }
.toggle input:checked + .toggle-track::after { transform: translateX(15px); background: var(--gold-2); }
.toggle input:focus-visible + .toggle-track { box-shadow: 0 0 0 3px rgba(201, 168, 106, 0.25); }
.toggle-label { letter-spacing: 0.02em; }

.actions { display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.ghost, .primary {
  padding: 11px 16px; border-radius: 9px; font-size: 14px; cursor: pointer; border: 1px solid var(--border);
}
.ghost { background: none; color: var(--ink-dim); }
.ghost:hover { color: var(--ink); border-color: var(--gold); }
/* .secondary — a real alternative, not a disabled-looking one. The digital
   button uses it only when framed prints are available as the primary CTA. */
.secondary {
  background: rgba(255, 255, 255, 0.04); color: var(--ink);
  border: 1px solid var(--border);
}
.secondary:hover { border-color: var(--gold); color: var(--gold-2); }
.primary {
  background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #131a10;
  font-weight: 600; border: none; margin-left: auto;
}
.primary:hover { filter: brightness(1.06); }
.primary:disabled { opacity: 0.4; cursor: wait; }

.fineprint { font-size: 12px; color: var(--ink-dim); margin-top: 18px; }

.preview-panel { position: sticky; top: 20px; padding: 12px; }
.preview-wrap {
  border-radius: 10px; overflow: hidden; background: #070b16; min-height: 420px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.preview-wrap img { width: 100%; height: auto; display: block; }

/* In-flight render state (DOS-10): the preview takes seconds to paint, so
   without this a style tap looks like nothing happened. Shown by wizard.js
   only when the request outlives the fast-cache window. */
.preview-wrap #preview { transition: opacity .18s ease; }
.preview-wrap.is-loading #preview { opacity: .5; }
.preview-loading {
  position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; gap: 10px; background: rgba(7, 11, 22, .45);
  color: var(--ink-dim); font-family: system-ui; font-size: 13px;
  letter-spacing: .02em;
}
.preview-loading .spinner {
  width: 15px; height: 15px; border-radius: 50%; flex: none;
  border: 2px solid rgba(201, 168, 106, .25); border-top-color: var(--gold-2);
  animation: preview-spin .85s linear infinite;
}
@keyframes preview-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .preview-loading .spinner { animation-duration: 2.4s; }
}
.preview-empty { text-align: center; color: var(--ink-dim); width: 100%; font-family: var(--serif); font-size: 17px; }
.preview-empty .preview-filler { width: 100%; height: auto; display: block; opacity: 0.9; }
.preview-empty .filler-note { font-family: system-ui; font-size: 12px; max-width: 380px; margin: 12px auto 0; padding: 0 16px; line-height: 1.5; }
.preview-empty .hint { font-family: system-ui; font-size: 12px; max-width: 340px; margin: 8px auto 18px; padding: 0 16px; line-height: 1.5; }

.sun-note {
  margin-top: 10px; padding: 9px 12px; border-radius: 9px; font-size: 12.5px;
  background: rgba(201, 168, 106, 0.08); border: 1px solid rgba(201, 168, 106, 0.25); color: var(--gold-2);
}

.foot { margin-top: 44px; text-align: center; color: var(--ink-dim); font-size: 12px; letter-spacing: 0.1em; }
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin-bottom: 8px; letter-spacing: 0.04em; }
.foot-links a { color: var(--ink-dim); text-decoration: none; }
.foot-links a:hover { color: var(--ink); }
/* ── buy / checkout ── */
.buy { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.buy button { width: 100%; padding: 13px 18px; font-size: .95rem; }
/* Frozen prints are a teaser, not a purchase in flight. Keep the qualification
   readable without the gold primary treatment or its busy disabled cursor. */
.buy .print-teaser {
  background: rgba(255, 255, 255, 0.04); color: var(--ink-dim);
  border: 1px solid var(--border); border-radius: 9px; cursor: not-allowed;
}
.buy-error {
  color: #f0a4a4; font-size: .86rem; margin: 4px 0 0; line-height: 1.5;
}
.buy-policy { color: var(--ink-dim); font-size: .8rem; line-height: 1.55; margin: 2px 0 0; }
.buy-policy a { color: var(--gold-2); }
.fineprint { color: var(--ink-dim); font-size: .8rem; line-height: 1.6; margin-top: 14px; }

/* ── place search: richer hints + geolocation ── */
.hint-more {
  color: var(--ink-dim);
  font-size: .82rem;
  line-height: 1.6;
  margin-top: 8px;
}
.hint-more strong { color: var(--ink); font-weight: 500; }
.geo-btn {
  margin-top: 10px;
  background: none;
  border: 1px solid var(--border);
  color: var(--ink-dim);
  border-radius: 8px;
  padding: 8px 13px;
  font: inherit;
  font-size: .84rem;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.geo-btn:hover { border-color: var(--gold); color: var(--gold-2); }

/* ── currency switch (DOS-43) ────────────────────────────────────────
   Same component as the landing page (see site.css), sized to the wizard's
   buy column. A Canadian on Starlink was billed USD off a bad geolocation;
   this is the override, and the server remembers it in a cookie. */
.cur-row { text-align: center; margin: 0 0 4px; }
.currency-switch {
  display: inline-flex; align-items: center; gap: 2px;
  border: 1px solid var(--border); border-radius: 999px;
  padding: 2px 3px 2px 11px; font-size: .8rem;
}
.currency-switch .cur-label {
  color: var(--ink-dim); font-size: .68rem; letter-spacing: .1em;
  text-transform: uppercase; margin-right: 6px;
}
.currency-switch .cur-opt {
  color: var(--ink-dim); text-decoration: none; padding: 3px 9px;
  border-radius: 999px;
}
.currency-switch .cur-opt:hover { color: var(--ink); }
.currency-switch .cur-opt.cur-on {
  background: var(--gold); color: #0a0f1e; font-weight: 600;
}
