/* no-birth-time.css — Chart ohne Geburtszeit */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Farben der Zeitleisten: gedämpft, indem sie in die Kartenfarbe gemischt werden. Reihenfolge fest,
   damit benachbarte Abschnitte auch bei Farbsehschwäche unterscheidbar bleiben. */
:root {
  --tl-1: #2a78d6; --tl-2: #eb6834; --tl-3: #1baf7a; --tl-4: #eda100;
  --tl-5: #e87ba4; --tl-6: #008300; --tl-7: #6250d6; --tl-8: #e34948;
}
:root[data-theme="dark"] {
  --tl-1: #3987e5; --tl-2: #d95926; --tl-3: #199e70; --tl-4: #c98500;
  --tl-5: #d55181; --tl-6: #0ca30c; --tl-7: #9085e9; --tl-8: #e66767;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: color-mix(in srgb, var(--border) 20%, var(--surface));
  color: var(--text);
  min-height: 100vh;
}

[hidden] { display: none !important; }

main { max-width: 900px; margin: 0 auto; padding: 2rem 1.5rem; }

a { color: var(--blue); }

.card {
  background: var(--surface);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 8px rgba(0,0,0,0.04);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  min-width: 0;
  overflow-wrap: break-word;
}

.card-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

h2 { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.9rem; }
h3 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  font-weight: 600;
  margin: 1.4rem 0 0.6rem;
}
h2 + h3 { margin-top: 0; }

.intro, .hint { font-size: 0.86rem; color: var(--text-dim); line-height: 1.5; margin-bottom: 1.1rem; }

/* ── Formular ── */
.form-row { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); gap: 1rem; }

.field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 0.35rem;
}

input[type="date"], input[type="text"] {
  width: 100%;
  height: 2.4rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--surface);
}
input[type="date"]:focus, input[type="text"]:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(74,111,165,0.14);
}
input::placeholder { color: var(--text-dim); }
:root[data-theme="dark"] input { color-scheme: dark; }

.city-autocomplete { position: relative; }
#cityDropdown {
  display: none;
  position: absolute;
  top: 100%; left: 0; right: 0;
  max-height: 280px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0 0 5px 5px;
  box-shadow: var(--shadow-md);
  z-index: 100;
}
.city-item { padding: 0.5rem 0.75rem; cursor: pointer; }
.city-item:hover, .city-item.active { background: color-mix(in srgb, var(--blue) 12%, var(--surface)); }
.city-main { font-size: 0.88rem; font-weight: 500; }
.city-sub  { font-size: 0.75rem; color: var(--text-dim); margin-top: 0.1rem; }
#cityInfo  { font-size: 0.75rem; color: var(--blue); margin-top: 0.3rem; min-height: 1em; }

.check-label { display: flex; align-items: center; gap: 0.4rem; font-size: 0.82rem; color: var(--text-dim); margin-top: 0.75rem; cursor: pointer; }

.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem; margin-top: 1rem; }

#calcBtn {
  background: var(--gold);
  color: white;
  border: none;
  padding: 0.6rem 1.5rem;
  border-radius: 5px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}
#calcBtn:disabled { opacity: 0.55; cursor: default; }

#status { font-size: 0.84rem; color: var(--text-dim); }
#status.error { color: var(--red); }
:root[data-theme="dark"] #status.error { color: #ef8a80; }

/* ── Ergebnis ── */
.result-head { font-size: 0.86rem; color: var(--text-dim); margin-bottom: 0.9rem; }

.facts > div {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, var(--surface));
  font-size: 0.9rem;
}
.facts dt { color: var(--text-dim); }
.facts dd { font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; }
.chips li {
  font-size: 0.82rem;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
}

/* ── Bodygraph-Bilder ── */
.overview { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 360px); gap: 1.75rem; align-items: start; }
.overview > * { min-width: 0; }
/* Ohne Grafik (Ladefehler) nimmt die Liste die volle Breite */
.overview:has(.day-graph[hidden]) { grid-template-columns: minmax(0, 1fr); }
.overview .facts > div { grid-template-columns: 7rem minmax(0, 1fr); }

/* Immer helle Kachel, auch im dunklen Design: Die Grafik hat schwarze Umrisse */
.graph-tile { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 0.5rem; }
.graph-tile svg { display: block; width: 100%; height: auto; }

.legend { list-style: none; margin: 0.8rem 0 0.6rem; font-size: 0.78rem; line-height: 1.35; }
.legend li { display: flex; align-items: center; gap: 0.5rem; padding: 0.15rem 0; }
.day-graph .hint { font-size: 0.78rem; margin-bottom: 0; }
/* Die Legendenfarben entsprechen den Füllungen in no-birth-time-graph.js und stehen auf Weiß wie dort */
.key { flex: none; width: 1.1rem; height: 1.1rem; border: 1px solid #777; border-radius: 3px; background: #fff; }
.key-p     { background: #1a1a2e; }
.key-d     { background: #8b0000; }
.key-both  { background: repeating-linear-gradient(45deg, #1a1a2e 0 3px, #8b0000 3px 6px); }
.key-mixed { background: repeating-linear-gradient(45deg, #1a1a2e 0 3px, #e8b9b9 3px 6px); }
.key-part  { background: linear-gradient(135deg, #c3c3cf 50%, #e8b9b9 50%); border: 1px dashed #333; }
.key-center      { background: #b0622e; }
.key-center-part { background: repeating-linear-gradient(45deg, #b0622e 0 3px, #fff 3px 6px); }

.type-graph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1rem; }
.type-graph { min-width: 0; }
.type-graph figcaption { display: flex; flex-direction: column; gap: 0.15rem; margin-top: 0.4rem; font-size: 0.82rem; }
.type-graph .time { white-space: normal; }
.graph-moment { font-size: 0.72rem; color: var(--text-dim); }

@media (max-width: 720px) {
  .overview { grid-template-columns: minmax(0, 1fr); }
  .day-graph { width: 100%; max-width: 400px; justify-self: center; }
}

/* ── Zeitleisten ── */
.timeline { margin-bottom: 1.4rem; }
.timeline-name { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.35rem; }

.bar {
  position: relative;
  height: 1.1rem;
  border-radius: 4px;
  overflow: hidden;
  background: var(--surface);
}
/* Trennfuge in Kartenfarbe als innerer Schatten - ein Rand würde die Breiten verfälschen */
.seg { position: absolute; top: 0; bottom: 0; box-shadow: inset -2px 0 0 var(--surface); }
.seg:last-child { box-shadow: none; }

.c1  { background: color-mix(in srgb, var(--tl-1) 72%, var(--surface)); }
.c2  { background: color-mix(in srgb, var(--tl-2) 72%, var(--surface)); }
.c3  { background: color-mix(in srgb, var(--tl-3) 72%, var(--surface)); }
.c4  { background: color-mix(in srgb, var(--tl-4) 72%, var(--surface)); }
.c5  { background: color-mix(in srgb, var(--tl-5) 72%, var(--surface)); }
.c6  { background: color-mix(in srgb, var(--tl-6) 72%, var(--surface)); }
.c7  { background: color-mix(in srgb, var(--tl-7) 72%, var(--surface)); }
.c8  { background: color-mix(in srgb, var(--tl-8) 72%, var(--surface)); }
.on  { background: color-mix(in srgb, var(--tl-1) 72%, var(--surface)); }
.off { background: color-mix(in srgb, var(--text-dim) 25%, var(--surface)); }

.axis { position: relative; height: 1.25rem; font-size: 0.68rem; color: var(--text-dim); }
.axis span { position: absolute; top: 0.3rem; transform: translateX(-50%); font-variant-numeric: tabular-nums; }
.axis span::before {
  content: '';
  position: absolute;
  top: -0.3rem; left: 50%;
  width: 1px; height: 0.25rem;
  background: var(--text-dim);
}
/* Randmarken nicht über die Karte hinausragen lassen */
.axis span:first-child { transform: none; }
.axis span:first-child::before { left: 0; }
.axis span:last-child { transform: translateX(-100%); }
.axis span:last-child::before { left: calc(100% - 1px); }

.seg-list { list-style: none; margin-top: 0.3rem; font-size: 0.84rem; }
.seg-list li { display: flex; align-items: baseline; gap: 0.5rem; padding: 0.1rem 0; }
.swatch { flex: none; width: 0.65rem; height: 0.65rem; border-radius: 2px; }
.time { flex: none; font-variant-numeric: tabular-nums; color: var(--text-dim); white-space: nowrap; }

/* ── Planeten ── */
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
thead th {
  text-align: left;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  padding: 0.45rem 0.5rem;
}
tbody th, tbody td {
  text-align: left;
  vertical-align: top;
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, var(--surface));
  font-variant-numeric: tabular-nums;
}
tbody th { font-weight: 500; }
summary { cursor: pointer; color: var(--blue); white-space: nowrap; }
details ul { list-style: none; margin-top: 0.35rem; font-size: 0.8rem; }
details li { display: flex; column-gap: 0.5rem; padding: 0.15rem 0; white-space: nowrap; }

/* ── Erklärung ── */
.explain p, .explain li { font-size: 0.9rem; line-height: 1.6; }
.explain p { margin-bottom: 0.8rem; }
.explain ul { padding-left: 1.2rem; margin-bottom: 1rem; }
.explain li { margin-bottom: 0.35rem; }
.explain h2:not(:first-child) { margin-top: 1.6rem; }

/* ── Gast-Hinweis (wie auf chart.html) ── */
#guestLimitModal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 1010; align-items: center; justify-content: center; }
#guestLimitModal.open { display: flex; }
.modal-box {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 2rem 2rem 1.5rem;
  max-width: 320px;
  width: 90%;
  text-align: center;
}
.modal-box h3 { font-size: 1rem; text-transform: none; letter-spacing: normal; color: var(--text); margin: 0 0 0.55rem; }
.modal-box p { font-size: 0.84rem; color: var(--text-dim); margin-bottom: 1.4rem; line-height: 1.5; }
.modal-btns { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.modal-btns a { display: block; padding: 0.6rem 1.25rem; border-radius: 5px; font-size: 0.86rem; font-weight: 500; text-decoration: none; }
.modal-btn-primary   { background: var(--navy); color: white; }
.modal-btn-secondary { background: color-mix(in srgb, var(--border) 40%, var(--surface)); color: var(--text); }
.modal-close { background: none; border: none; font-size: 0.8rem; color: var(--text-dim); cursor: pointer; padding: 0.25rem 0.5rem; }

@media (max-width: 560px) {
  main { padding: 1.25rem 1rem; }
  .card { padding: 1.15rem 1rem; }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .facts > div, .overview .facts > div { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; }
  table { font-size: 0.8rem; }
  thead th { letter-spacing: 0; }
  thead th, tbody th, tbody td { padding-left: 0.2rem; padding-right: 0.2rem; }
  summary { white-space: normal; }
}
