/* variables.css — Variablen-Seite. Farben ausschließlich über die Tokens aus nav.css,
   damit Hell- und Dunkelmodus ohne eigene Regeln stimmen. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

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;
}

/* ── Header (wie auf den anderen Analyse-Seiten) ── */
header {
  background: var(--navy);
  color: white;
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.header-left { display: flex; align-items: center; gap: 1rem; }
.back-btn {
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}
.back-btn:hover { color: white; }
header h1 { font-size: 1.2rem; font-weight: 600; letter-spacing: 0.02em; }
.header-auth { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; font-size: 0.82rem; }
.header-auth-email {
  color: rgba(255,255,255,0.7);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.header-auth a, .header-auth button {
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
  text-decoration: none;
  cursor: pointer;
}
.header-auth a:hover, .header-auth button:hover { background: rgba(255,255,255,0.22); }

/* ── Layout: Leseseite, darum schmaler als die Chart-Seiten ── */
main {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: grid;
  gap: 1.25rem;
}
#varResults { display: grid; gap: 1.25rem; }

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 1.75rem;
}
.card-title {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 1rem;
  font-weight: 600;
}

select {
  width: 100%;
  max-width: 420px;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
}
select:focus { outline: 2px solid var(--blue); outline-offset: 1px; }

/* ── Fließtext ── */
/* align-content: start - sonst streckt das Raster die Absätze auf die Höhe der Nachbarspalte */
.var-text { display: grid; gap: 0.7rem; align-content: start; }
.var-text p, .var-intro p {
  font-size: 0.95rem;
  line-height: 1.65;
  max-width: 68ch;          /* angenehme Zeilenlänge zum Lesen */
}
.var-text h3 {
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--text);
  margin-top: 0.4rem;
}
/* In Textkarten liegt schon die Rasterlücke unter dem Titel - eigener Abstand nur noch klein */
.var-text > .card-title { margin-bottom: 0.25rem; }
.var-dim { color: var(--text-dim); font-size: 0.88rem; line-height: 1.55; margin-top: 1rem; }
#varStatus { color: var(--text-dim); font-size: 0.92rem; }
#varStatus:empty { display: none; }
#varStatus a { color: var(--blue); }

/* ── Einführung (aufklappbar) ── */
.var-intro summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
}
.var-intro summary::-webkit-details-marker { display: none; }
.var-intro summary::after { content: "▾"; color: var(--text-dim); transition: transform 0.15s; }
.var-intro:not([open]) summary::after { transform: rotate(-90deg); }
.var-intro[open] summary { margin-bottom: 0.8rem; }
.var-intro p + p { margin-top: 0.65rem; }

/* ── Hinweis zu Ernährung und Umgebung: sichtbar, aber nicht alarmierend ── */
.var-disclaimer {
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--text);
  background: color-mix(in srgb, var(--gold) 10%, var(--surface));
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 0.8rem 1rem;
}

/* ── Sperrhinweis ── */
.var-lock { text-align: center; }
.var-lock-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; }
.var-lock p { font-size: 0.92rem; line-height: 1.6; color: var(--text-dim); max-width: 56ch; margin: 0 auto 1.2rem; }
.var-lock-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; }
.var-btn {
  display: inline-block;
  background: #2e7d32;
  color: white;
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}
.var-btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.var-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ── Pfeilfarben wie im Bodygraph: Design rot, Persönlichkeit dunkel (im Dunkelmodus hell) ── */
.var-d { --arrow: var(--red); }
.var-p { --arrow: var(--text); }
.var-arrow-svg { width: 1.6rem; height: 1.35rem; flex-shrink: 0; color: var(--arrow); }

/* ── Übersicht ── */
.var-code {
  font-family: 'SF Mono', 'Consolas', 'Menlo', monospace;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 1rem;
}
.var-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.var-cell {
  display: grid;
  gap: 0.2rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--arrow);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s;
}
.var-cell:hover { background: color-mix(in srgb, var(--arrow) 6%, var(--surface)); }
.var-cell:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.var-cell-head { display: flex; align-items: center; gap: 0.5rem; }
.var-cell-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--text-dim);
}
.var-cell-name { font-weight: 650; font-size: 0.98rem; }
.var-cell-meta, .var-meta { font-size: 0.78rem; color: var(--text-dim); font-variant-numeric: tabular-nums; }
/* Kognition als eigene Zeile unter den vier Pfeilen: im Chart steht sie gleichrangig daneben */
.var-cog-line { margin: -0.5rem 0 1.25rem; font-size: 0.95rem; display: flex; gap: 0.5rem; align-items: baseline; flex-wrap: wrap; }
.var-cog-line a { color: var(--blue); font-weight: 650; }
.var-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

/* ── Abschnitt je Pfeil ── */
.var-arrow { border-top: 4px solid var(--arrow); scroll-margin-top: 1rem; }
.var-kicker {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 0.6rem;
}
.var-name { font-size: 1.5rem; font-weight: 700; line-height: 1.25; text-wrap: balance; }
.var-pole {
  display: inline-block;
  vertical-align: middle;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--arrow);
  color: var(--arrow);
  margin-left: 0.3rem;
}
.var-sub { color: var(--text-dim); font-size: 0.98rem; margin-top: 0.2rem; }
.var-meta { margin: 0.35rem 0 1.1rem; }
/* Was der Pfeil allgemein bedeutet: abgesetzt, damit die persönliche Deutung darunter im Vordergrund steht */
.var-about {
  background: color-mix(in srgb, var(--border) 25%, var(--surface));
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  margin-bottom: 1.1rem;
}
.var-about p { font-size: 0.88rem; color: var(--text); }
.var-block { display: grid; gap: 0.7rem; scroll-margin-top: 1rem; }
.var-boundary {
  border-left: 3px solid var(--blue);
  background: color-mix(in srgb, var(--blue) 8%, var(--surface));
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 0.7rem 0.9rem;
  margin-bottom: 1.1rem;
  font-size: 0.88rem;
  display: grid;
  gap: 0.35rem;
}
.var-boundary p { line-height: 1.5; }

/* ── Responsive ── */
@media (max-width: 900px) {
  header { padding: 0.9rem 1.25rem; }
  .header-auth-email { display: none; }
}
@media (max-width: 600px) {
  header { padding: 0.7rem 1rem; }
  main { padding: 1.25rem max(16px, env(safe-area-inset-left, 0px)); }
  .card { padding: 1.2rem; }
  .var-pair { grid-template-columns: 1fr; }
  .var-name { font-size: 1.3rem; }
}
/* Übersicht bleibt auch auf dem Handy zweispaltig: links Design, rechts Persönlichkeit wie im Bodygraph */
@media (max-width: 420px) {
  .var-grid { gap: 0.5rem; }
  .var-cell { padding: 0.6rem 0.65rem; }
  .var-cell-name { font-size: 0.9rem; }
}
@media (prefers-reduced-motion: reduce) {
  .var-cell, .var-intro summary::after { transition: none; }
}
