/* Lumira Konfigurator — Marke nach ADR-006/ADR-009 (launch/brand.md).
   Die Seite ist der Instrumententisch, das Poster ist der Gegenstand darauf:
   alle Flaechen bleiben still, damit die Karte die einzige helle Sache bleibt. */

:root {
  --ink:        #0D0D1A;   /* Midnight — Grund */
  --deep:       #141B31;   /* Panelflaeche */
  --navy:       #1A2340;   /* Deep Navy — Felder */
  --gold:       #C9A84C;   /* Stellar Gold — aktiv, Linien */
  --champagne:  #E8D5A3;
  --pale:       #F2EEE8;   /* Pale Celestial — Text */
  --rose:       #D4A5A5;   /* nur der Mond */

  --dim:   rgba(242, 238, 232, 0.52);
  --hair:  rgba(201, 168, 76, 0.22);
  --sunk:  rgba(0, 0, 0, 0.28);

  --rail: 310px;
  --serif: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
  --sans:  'DM Sans', -apple-system, 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--ink);
  color: var(--pale);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Ein einziges Kleinkapitel-Muster fuer alle Instrumentenbeschriftungen. */
.label {
  margin: 0 0 .85rem;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .22em;
  color: var(--gold);
}

.note {
  margin: .55rem 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--dim);
}

/* ── Kopf ─────────────────────────────────────────────────── */
.top {
  display: flex;
  align-items: baseline;
  gap: 1.4rem;
  padding: 1.9rem 2.4rem 1.5rem;
  border-bottom: 1px solid var(--hair);
}

.wordmark {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 30px;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--pale);
}

.tagline {
  margin: 0;
  font-size: 13px;
  color: var(--dim);
  font-style: italic;
  font-family: var(--serif);
  letter-spacing: .02em;
}

/* ── Buehne ───────────────────────────────────────────────── */
.stage {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  align-items: start;
  min-height: calc(100vh - 84px - 92px);
}

.rail {
  padding: 2rem 2rem 3rem;
  border-right: 1px solid var(--hair);
}

.group { margin-bottom: 2.3rem; }
.group:last-child { margin-bottom: 0; }

/* ── Felder ───────────────────────────────────────────────── */
.field, .coords label {
  display: block;
  margin-bottom: .8rem;
}

.field > span, .coords span {
  display: block;
  margin-bottom: .3rem;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dim);
}

input[type="text"], input[type="number"], input[type="date"],
input[type="time"], input[type="password"], select {
  width: 100%;
  padding: .5rem .65rem;
  border: 1px solid rgba(242, 238, 232, 0.14);
  border-radius: 2px;
  background: var(--sunk);
  color: var(--pale);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 14px;
  transition: border-color .15s ease;
}

input:hover, select:hover { border-color: rgba(242, 238, 232, 0.28); }

input:focus-visible, select:focus-visible, button:focus-visible,
.band:focus-visible, .swatch:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 2px;
  border-color: transparent;
}

::placeholder { color: rgba(242, 238, 232, 0.3); }

.coords {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6rem;
}

.check {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-bottom: .5rem;
  font-size: 13.5px;
  cursor: pointer;
}

.check input { accent-color: var(--gold); width: 14px; height: 14px; }

/* ── Ortssuche ────────────────────────────────────────────── */
.search { position: relative; margin-bottom: .8rem; }

.hits {
  position: absolute;
  z-index: 20;
  top: calc(100% + 3px);
  left: 0; right: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 260px;
  overflow-y: auto;
  background: var(--deep);
  border: 1px solid var(--hair);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .5);
}

.hits li {
  padding: .5rem .65rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(242, 238, 232, .06);
}

.hits li:last-child { border-bottom: 0; }
.hits li:hover, .hits li[aria-selected="true"] { background: var(--navy); }
.hits strong { font-weight: 400; font-size: 13.5px; }
.hits em { display: block; font-style: normal; font-size: 11.5px; color: var(--dim); }

/* ── Farbstile ────────────────────────────────────────────── */
.swatches { display: flex; gap: .55rem; margin-bottom: 1rem; }

.swatch {
  width: 30px; height: 30px;
  padding: 0;
  border: 1px solid rgba(242, 238, 232, .2);
  border-radius: 50%;
  cursor: pointer;
  transition: box-shadow .15s ease, border-color .15s ease;
}

.swatch[aria-checked="true"] {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, .18);
}

.asterisms { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .9rem; }

.chip {
  padding: .3rem .7rem;
  border: 1px solid rgba(242, 238, 232, .18);
  border-radius: 999px;
  background: transparent;
  color: var(--dim);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 300;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}

.chip[aria-pressed="true"] {
  color: var(--ink);
  background: var(--champagne);
  border-color: var(--champagne);
}

/* ── Poster ───────────────────────────────────────────────── */
.canvas {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6rem;
  padding: 1.8rem 2.4rem 2.2rem;
}

.poster {
  position: relative;
  margin: 0;
  line-height: 0;
}

/* Hoehe fuehrt, damit Karte und Zeitband zusammen auf einen Bildschirm passen
   — das Band ist Teil der Karte, nicht etwas, wozu man scrollen muss. */
.poster img {
  display: block;
  width: auto;
  max-width: min(420px, 76vw);
  max-height: calc(100vh - 340px);
  min-height: 340px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .62), 0 0 0 1px rgba(242, 238, 232, .07);
}

/* Rechenanzeige: eine wandernde Goldlinie an der Oberkante, kein Spinner. */
.working {
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  transition: opacity .2s ease;
}

.working.on { opacity: 1; }

.working::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 38%;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  animation: sweep 1.1s linear infinite;
}

@keyframes sweep {
  from { transform: translateX(-100%); }
  to   { transform: translateX(365%); }
}

/* ── Zeitband: die Nacht ──────────────────────────────────── */
.night { width: min(620px, 100%); }

.nighthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .7rem;
}

.nighthead .label, .nighthead .note { margin: 0; }

.band {
  display: block;
  width: 100%;
  height: 78px;
  border: 1px solid var(--hair);
  cursor: ew-resize;
  touch-action: none;
}

.hours {
  display: flex;
  justify-content: space-between;
  margin-top: .45rem;
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--dim);
}

/* ── Exportleiste ─────────────────────────────────────────── */
.bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  padding: 1.3rem 2.4rem 1.6rem;
  border-top: 1px solid var(--hair);
  background: var(--deep);
}

.barright {
  display: flex;
  align-items: flex-end;
  gap: .8rem;
  flex-wrap: wrap;
}

.field.inline { margin: 0; min-width: 132px; }

button#download {
  padding: .58rem 1.5rem;
  border: 1px solid var(--gold);
  border-radius: 2px;
  background: transparent;
  color: var(--gold);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}

button#download:hover:not(:disabled) { background: var(--gold); color: var(--ink); }
button#download:disabled { opacity: .4; cursor: not-allowed; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 6.5rem;
  transform: translateX(-50%);
  margin: 0;
  padding: .6rem 1.1rem;
  background: var(--navy);
  border: 1px solid var(--hair);
  color: var(--pale);
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}

.toast.bad { border-color: var(--rose); color: var(--rose); }

/* ── Schmale Fenster ──────────────────────────────────────── */
@media (max-width: 900px) {
  .stage { grid-template-columns: 1fr; }
  .rail { order: 2; border-right: 0; border-top: 1px solid var(--hair); }
  .canvas { order: 1; padding: 1.6rem 1.2rem 2rem; }
  .top { padding: 1.4rem 1.2rem 1.1rem; flex-wrap: wrap; gap: .5rem; }
  .bar { padding: 1.1rem 1.2rem 1.3rem; }
  .barright { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .working::after { animation: none; width: 100%; opacity: .5; }
  * { transition-duration: .01ms !important; }
}
