/* MARKET SIGNALS — Designsystem
   Kein Build, keine Fremdquellen: eine Datei, CSS-Variablen, System-Schriften.
   Mobile zuerst — das Ding lebt auf dem iPhone. */

:root {
  --bg: #0a0c10;
  --bg-elevated: #11141b;
  --panel: #151922;
  --panel-hover: #1a1f2a;
  --border: #232a36;
  --border-strong: #303948;

  --text: #e8ecf3;
  --text-muted: #949dad;
  --text-faint: #626b7a;

  --accent: #5b9dff;
  --accent-soft: rgba(91, 157, 255, 0.14);
  --ok: #3fbf7f;
  --ok-soft: rgba(63, 191, 127, 0.14);
  --warn: #f0b429;
  --warn-soft: rgba(240, 180, 41, 0.14);
  --danger: #f2555a;
  --danger-soft: rgba(242, 85, 90, 0.14);

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .5);

  --header-h: 56px;
  --tabbar-h: calc(58px + env(safe-area-inset-bottom));

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui,
          Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

:root[data-theme="light"] {
  --bg: #f6f7f9;
  --bg-elevated: #ffffff;
  --panel: #ffffff;
  --panel-hover: #f2f4f7;
  --border: #e2e6ec;
  --border-strong: #cdd4de;

  --text: #131720;
  --text-muted: #5b6472;
  --text-faint: #8b94a3;

  --accent: #1f6feb;
  --accent-soft: rgba(31, 111, 235, 0.10);
  --ok: #1a7f4b;
  --ok-soft: rgba(26, 127, 75, 0.10);
  --warn: #a86a00;
  --warn-soft: rgba(168, 106, 0, 0.10);
  --danger: #c62f35;
  --danger-soft: rgba(198, 47, 53, 0.10);

  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px -16px rgba(16, 24, 40, .18);
}

* { box-sizing: border-box; }

/* Muss vor allen display-Regeln stehen: Eine Klasse mit `display:` schlägt sonst
   die Browser-Standardregel für [hidden] und das Element bleibt sichtbar. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  padding-bottom: var(--tabbar-h);
  overscroll-behavior-y: none;
}

@media (min-width: 768px) { body { padding-bottom: 2rem; } }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

::selection { background: var(--accent-soft); }

/* ---------------------------------------------------------------- Kopfzeile */

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 0 1rem;
  padding-top: env(safe-area-inset-top);
  height: calc(var(--header-h) + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  font-size: .95rem;
}

.brand-mark {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 6px;
  background: linear-gradient(140deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--ok)));
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.header-spacer { flex: 1; }

.live {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .72rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 var(--ok-soft);
}
.live[data-state="loading"] .live-dot { animation: pulse 1.1s ease-out infinite; }
.live[data-state="error"] .live-dot { background: var(--danger); }

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); }
  100% { box-shadow: 0 0 0 8px transparent; }
}

.icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 9px;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
}
.icon-btn:hover { background: var(--panel-hover); border-color: var(--border-strong); }
.icon-btn:active { transform: scale(.95); }

/* ------------------------------------------------------------------ Grundriss */

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 1rem 2rem;
}

.section-title {
  font-size: .74rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-faint);
  margin: 1.5rem 0 .6rem;
}
.section-title:first-child { margin-top: .25rem; }

/* --------------------------------------------------------------- Kennzahlen */

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .55rem;
}
@media (min-width: 560px) { .stats { grid-template-columns: repeat(4, 1fr); } }

.stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .7rem .85rem;
}
.stat-value {
  font-size: 1.45rem;
  font-weight: 640;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.stat-label {
  font-size: .7rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-top: .1rem;
}

/* ------------------------------------------------------------------- Filter */

.filters {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin: .9rem 0;
}

.search {
  flex: 1 1 190px;
  position: relative;
  display: flex;
  align-items: center;
}
.search svg {
  position: absolute;
  left: .65rem;
  color: var(--text-faint);
  pointer-events: none;
}

input[type="search"], input[type="password"], select {
  width: 100%;
  font: inherit;
  font-size: .88rem;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .5rem .7rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
  appearance: none;
}
input[type="search"] { padding-left: 2.1rem; }
select {
  padding-right: 1.9rem;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 15px) calc(50% + 1px), calc(100% - 10px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  color: var(--text-muted);
  flex: 0 1 auto;
  width: auto;
}
input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* -------------------------------------------------------------------- Karten */

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .85rem .95rem;
  margin-bottom: .55rem;
  transition: border-color .15s, background .15s;
}
.card:hover { border-color: var(--border-strong); }

.card-head {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: .35rem;
}

.card-title {
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: -0.011em;
  line-height: 1.4;
  margin: 0 0 .3rem;
}
.card-title a { border-bottom: 1px solid transparent; }
.card-title a:hover { border-bottom-color: var(--accent); color: var(--accent); }

.card-body {
  font-size: .855rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-foot {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-wrap: wrap;
  margin-top: .5rem;
  font-size: .74rem;
  color: var(--text-faint);
}

/* ------------------------------------------------------------------ Plaketten */

.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .69rem;
  font-weight: 560;
  letter-spacing: .01em;
  padding: .17rem .45rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--bg-elevated);
  white-space: nowrap;
}
.badge-mono { font-family: var(--mono); font-size: .66rem; }
.badge.ok      { color: var(--ok);     background: var(--ok-soft);     border-color: transparent; }
.badge.warn    { color: var(--warn);   background: var(--warn-soft);   border-color: transparent; }
.badge.danger  { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.badge.accent  { color: var(--accent); background: var(--accent-soft); border-color: transparent; }

.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  flex: none;
}

.time { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* --------------------------------------------------------------- Quellenraster */

.source-grid {
  display: grid;
  gap: .55rem;
}
@media (min-width: 640px) { .source-grid { grid-template-columns: repeat(2, 1fr); } }

.source-card { display: flex; flex-direction: column; gap: .5rem; }

.source-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.source-name {
  font-family: var(--mono);
  font-size: .84rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .15rem .7rem;
  font-size: .76rem;
}
.kv dt { color: var(--text-faint); }
.kv dd { margin: 0; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.error-box {
  font-size: .74rem;
  font-family: var(--mono);
  color: var(--danger);
  background: var(--danger-soft);
  border-radius: var(--radius-sm);
  padding: .45rem .6rem;
  word-break: break-word;
  line-height: 1.45;
}

.chips { display: flex; gap: .3rem; flex-wrap: wrap; }

/* ------------------------------------------------------------------- Signale */

.signal-card { border-left: 3px solid var(--border-strong); }
.signal-card[data-action="pruefen"]          { border-left-color: var(--warn); }
.signal-card[data-action="dringend_pruefen"] { border-left-color: var(--danger); }
.signal-card[data-action="beobachten"]       { border-left-color: var(--accent); }

.signal-top {
  display: flex;
  align-items: flex-start;
  gap: .8rem;
  margin-bottom: .45rem;
}

.score {
  flex: none;
  min-width: 3.1rem;
  text-align: center;
  padding: .3rem .35rem .25rem;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}
.score-value {
  font-size: 1.15rem;
  font-weight: 660;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.score-label {
  font-size: .58rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-faint);
}

.signal-meta { flex: 1; min-width: 0; }

.dir {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-weight: 600;
}
.dir.bullish { color: var(--ok); }
.dir.bearish { color: var(--danger); }
.dir.mixed   { color: var(--warn); }

.magnitude { display: inline-flex; gap: 2px; vertical-align: middle; }
.magnitude i {
  width: 4px; height: 11px;
  border-radius: 1px;
  background: var(--border-strong);
  display: block;
}
.magnitude i.on { background: currentColor; }

.next-step {
  margin-top: .6rem;
  padding: .5rem .65rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border-left: 2px solid var(--accent);
  font-size: .8rem;
  line-height: 1.5;
  color: var(--text);
}
.next-step strong {
  display: block;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--accent);
  margin-bottom: .15rem;
}

.reasoning {
  font-size: .85rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: .35rem 0 0;
}

.threshold-note {
  font-size: .72rem;
  color: var(--text-faint);
  margin: .75rem 0 0;
  line-height: 1.5;
}

/* -------------------------------------------------------------- Lagebericht */

.summary-text {
  font-size: .93rem;
  line-height: 1.65;
  margin: .3rem 0 0;
}

.asset-card { border-left: 3px solid var(--border-strong); }
.asset-card[data-direction="bullish"]   { border-left-color: var(--ok); }
.asset-card[data-direction="bearish"]   { border-left-color: var(--danger); }
.asset-card[data-direction="contested"] { border-left-color: var(--warn); }

.asset-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.asset-symbol {
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.asset-name { font-size: .78rem; color: var(--text-faint); }

.asset-dir { text-align: right; flex: none; }
.asset-dir.ok     { color: var(--ok); }
.asset-dir.danger { color: var(--danger); }
.asset-dir.warn   { color: var(--warn); }
.asset-glyph { font-size: 1.35rem; line-height: 1; }
.asset-dir-label { font-size: .74rem; font-weight: 600; }

/* Kräfteverhältnis: beide Seiten sichtbar nebeneinander, nicht verrechnet. */
.balance {
  display: flex;
  height: 7px;
  border-radius: 4px;
  overflow: hidden;
  margin-top: .6rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}
.balance-bull { background: var(--ok); }
.balance-bear { background: var(--danger); }

.reliability {
  margin-top: .65rem;
  padding: .55rem .7rem;
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--border-strong);
  background: var(--bg-elevated);
  font-size: .8rem;
  line-height: 1.5;
}
.reliability.ok      { border-left-color: var(--ok);     background: var(--ok-soft); }
.reliability.warn    { border-left-color: var(--warn);   background: var(--warn-soft); }
.reliability.danger  { border-left-color: var(--danger); background: var(--danger-soft); }
.reliability.unknown { color: var(--text-muted); }
.reliability strong {
  display: block;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .2rem;
  opacity: .85;
}
.reliability-main { display: flex; align-items: baseline; gap: .45rem; }
.reliability-rate {
  font-size: 1.15rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.reliability-verdict { margin-top: .15rem; font-weight: 550; }
.reliability-extra { font-size: .74rem; opacity: .8; margin-top: .15rem; }

.opposing {
  margin-top: .6rem;
  padding: .55rem .7rem;
  border-radius: var(--radius-sm);
  background: var(--warn-soft);
  border-left: 2px solid var(--warn);
}
.opposing strong {
  display: block;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--warn);
  margin-bottom: .1rem;
}

.signal-details { margin-top: .55rem; }
.signal-details summary {
  cursor: pointer;
  font-size: .78rem;
  color: var(--text-faint);
  padding: .2rem 0;
}
.signal-details summary:hover { color: var(--accent); }

/* ------------------------------------------------------------------ Journal */

.headline { text-align: center; padding: 1.3rem 1rem 1.1rem; }
.headline.ok     { border-color: color-mix(in srgb, var(--ok) 45%, var(--border)); }
.headline.danger { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.headline.warn   { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); }

.headline-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-faint);
}
.headline-rate {
  font-size: 3rem;
  font-weight: 660;
  letter-spacing: -0.045em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  margin: .2rem 0 .1rem;
}
.headline-rate.muted { color: var(--text-faint); }
.headline-range { font-size: .78rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.headline .kv { text-align: left; max-width: 22rem; margin-inline: auto; }

.breakdown { display: flex; flex-direction: column; gap: .7rem; margin-top: .3rem; }

.breakdown-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "label value" "bar bar" "range range";
  gap: .25rem .6rem;
  align-items: center;
}
.breakdown-label {
  grid-area: label;
  font-size: .84rem;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.breakdown-value {
  grid-area: value;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.breakdown-n { font-size: .72rem; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.breakdown-range {
  grid-area: range;
  font-size: .7rem;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.bar {
  grid-area: bar;
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  overflow: hidden;
}
.bar-fill { height: 100%; background: var(--text-faint); }
.bar-fill.ok     { background: var(--ok); }
.bar-fill.warn   { background: var(--warn); }
.bar-fill.danger { background: var(--danger); }

/* Der Münzwurf-Strich bei 50 % — ohne ihn fehlt der Maßstab. */
.bar-marker {
  position: absolute;
  top: -2px; bottom: -2px; left: 50%;
  width: 1px;
  background: var(--text-muted);
  opacity: .65;
}

.method-list {
  margin: .4rem 0 0;
  padding-left: 1.1rem;
  font-size: .8rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.method-list li { margin-bottom: .35rem; }

/* ------------------------------------------------------------------ Cluster */

.cluster-card { border-left: 3px solid var(--border-strong); }
.cluster-card[data-open="1"] { border-left-color: var(--danger); }

.cluster-signal {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .28rem 0;
  font-size: .82rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  line-height: 1.4;
}
.cluster-signal:first-child { border-top: 0; }
.cluster-signal a { border-bottom: 1px solid transparent; }
.cluster-signal a:hover { border-bottom-color: var(--accent); color: var(--accent); }
.cluster-signal .time { margin-left: auto; font-size: .72rem; color: var(--text-faint); }

/* ---------------------------------------------------- Skelette & Leerzustände */

.skeleton {
  background: linear-gradient(90deg, var(--panel) 25%, var(--panel-hover) 37%, var(--panel) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.skeleton-card { height: 92px; margin-bottom: .55rem; border-radius: var(--radius); }

.empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-faint);
}
.empty-title { font-size: .95rem; color: var(--text-muted); font-weight: 560; margin-bottom: .3rem; }
.empty p { font-size: .84rem; margin: 0; max-width: 34ch; margin-inline: auto; }

/* ------------------------------------------------------------------- Knöpfe */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  font-size: .87rem;
  font-weight: 560;
  padding: .55rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel);
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s, opacity .15s;
}
.btn:hover { background: var(--panel-hover); border-color: var(--border-strong); }
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  width: 100%;
}
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn-block { width: 100%; }

/* ------------------------------------------------------------- Untere Leiste */

.tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 30;
  display: flex;
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--border);
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: .5rem 0 .45rem;
  font-size: .66rem;
  font-weight: 560;
  color: var(--text-faint);
  background: none;
  border: 0;
  cursor: pointer;
  transition: color .15s;
}
.tab[aria-current="page"] { color: var(--accent); }
.tab:disabled { opacity: .38; cursor: not-allowed; }
.tab svg { width: 19px; height: 19px; }

@media (min-width: 768px) {
  .tabbar {
    position: sticky;
    top: calc(var(--header-h) + env(safe-area-inset-top));
    bottom: auto;
    max-width: 900px;
    margin: 0 auto;
    border-top: 0;
    border-bottom: 1px solid var(--border);
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 0 1rem;
    gap: .25rem;
  }
  .tab {
    flex: 0 0 auto;
    flex-direction: row;
    gap: .4rem;
    padding: .7rem .8rem;
    font-size: .82rem;
    border-bottom: 2px solid transparent;
  }
  .tab[aria-current="page"] { border-bottom-color: var(--accent); }
  .tab svg { width: 16px; height: 16px; }
}

/* -------------------------------------------------------------------- Login */

.login-wrap {
  min-height: 78vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  box-shadow: var(--shadow);
}
.login-card h1 {
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  margin: .9rem 0 .25rem;
}
.login-card .sub {
  font-size: .82rem;
  color: var(--text-muted);
  margin: 0 0 1.2rem;
}
.field { margin-bottom: .85rem; }
.field label {
  display: block;
  font-size: .76rem;
  color: var(--text-muted);
  margin-bottom: .3rem;
}

.notice {
  font-size: .8rem;
  line-height: 1.5;
  border-radius: var(--radius-sm);
  padding: .6rem .7rem;
  margin-bottom: .9rem;
}
.notice.error { color: var(--danger); background: var(--danger-soft); }
.notice.warn  { color: var(--warn);   background: var(--warn-soft); }
.notice code {
  font-family: var(--mono);
  font-size: .95em;
  background: color-mix(in srgb, currentColor 12%, transparent);
  padding: .05rem .25rem;
  border-radius: 4px;
}

/* -------------------------------------------------------------------- Rest */

.footer-note {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: .74rem;
  color: var(--text-faint);
  line-height: 1.6;
}

.load-more { margin-top: .8rem; }

.hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* --------------------------------------------------------- Registry-Editor */

.editor-toolbar {
  display: flex;
  align-items: center;
  gap: .45rem;
  flex-wrap: wrap;
  margin-bottom: .6rem;
}

.yaml-editor {
  width: 100%;
  min-height: 55vh;
  font-family: var(--mono);
  font-size: .78rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .7rem .8rem;
  resize: vertical;
  outline: none;
  /* Tabulatoren sind in YAML verboten — die Breite hilft trotzdem beim Lesen
     eingerückter Blöcke. */
  tab-size: 2;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
  -webkit-appearance: none;
  appearance: none;
}
.yaml-editor:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.notice.ok-notice { color: var(--ok); background: var(--ok-soft); }
.notice:not(.hidden) { margin-top: .7rem; margin-bottom: 0; }

.diff {
  margin: .7rem 0 0;
  padding: .6rem .7rem;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: .72rem;
  line-height: 1.5;
  max-height: 40vh;
  overflow: auto;
  white-space: pre;
}
.diff-line.add  { color: var(--ok); }
.diff-line.del  { color: var(--danger); }
.diff-line.hunk { color: var(--accent); }

/* ------------------------------------------------- Filterwirkung je Quelle */

.filter-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .8rem;
  padding-bottom: .9rem;
  margin-bottom: .3rem;
  border-bottom: 1px solid var(--border);
}

.filter-row { padding: .7rem 0; border-bottom: 1px solid var(--border-soft, var(--border)); }
.filter-row:last-of-type { border-bottom: 0; }

.filter-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: .3rem .7rem;
}
.filter-name { font-weight: 600; font-size: .84rem; }
.filter-figures {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  font-size: .74rem;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.filter-figures .warn-text { color: var(--warn); }

/* Der Balken zeigt den aussortierten Anteil — die Restfläche ist das, was
   Geld gekostet hat. Deshalb die kräftige Farbe auf dem gestoppten Teil. */
.filter-bar {
  position: relative;
  height: 6px;
  margin: .45rem 0 .35rem;
  border-radius: 3px;
  background: var(--warn-soft, var(--bg-elevated));
  overflow: hidden;
}
.filter-bar-stopped {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}

.filter-reasons {
  font-size: .72rem;
  color: var(--text-faint);
  line-height: 1.45;
}

.hint {
  margin: .9rem 0 0;
  font-size: .74rem;
  color: var(--text-faint);
  line-height: 1.5;
}
.hint a { color: var(--accent); }

/* ------------------------------------------------- Klartext und Erstnutzung */

/* Die Aussage ganz oben. Bewusst groß und ohne Zahlen: Wer die App öffnet,
   soll in einem Satz wissen, ob gerade etwas los ist. */
.kopfzeile {
  border-left: 3px solid var(--accent);
}
.kopfzeile-titel {
  margin: 0 0 .45rem;
  font-size: 1.15rem;
  font-weight: 640;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.kopfzeile-text {
  margin: 0;
  font-size: .9rem;
  line-height: 1.6;
  color: var(--text-muted, var(--text));
}

.klartext { margin: .7rem 0 .3rem; }
.klartext-satz {
  margin: 0 0 .4rem;
  font-size: .98rem;
  font-weight: 560;
  line-height: 1.45;
}
.klartext-grund {
  margin: 0 0 .4rem;
  font-size: .86rem;
  line-height: 1.6;
  color: var(--text-muted, var(--text-faint));
}
.klartext-warnung {
  margin: .5rem 0 0;
  padding: .5rem .65rem;
  border-radius: var(--radius-sm);
  background: var(--warn-soft);
  font-size: .84rem;
  line-height: 1.55;
}
.klartext-marker { font-weight: 640; color: var(--warn); }

/* Zahlen sind Beiwerk — wer sie will, klappt sie auf. */
.details-block { margin-top: .6rem; }
.details-block > summary {
  cursor: pointer;
  font-size: .78rem;
  color: var(--text-faint);
  padding: .2rem 0;
  user-select: none;
}
.details-block > summary:hover { color: var(--text); }

.reliability-spanne,
.reliability-bezug {
  margin-top: .35rem;
  font-size: .78rem;
  line-height: 1.55;
  opacity: .85;
}

/* ------------------------------------------------------------- Einrichtung */

.setup-card.blockiert { border-left: 3px solid var(--warn); }
.setup-row {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  padding: .5rem 0;
  border-top: 1px solid var(--border);
}
.setup-mark {
  flex: 0 0 1.1rem;
  font-weight: 700;
  line-height: 1.5;
}
.setup-row.ok .setup-mark { color: var(--ok); }
.setup-row.offen .setup-mark { color: var(--text-faint); }
.setup-titel { font-size: .88rem; font-weight: 560; }
.setup-fehlt {
  margin-top: .2rem;
  font-size: .78rem;
  line-height: 1.55;
  color: var(--text-faint);
}
.setup-fehlt code {
  display: inline-block;
  margin-top: .25rem;
  font-size: .74rem;
}

.sub-fine {
  font-size: .82rem !important;
  line-height: 1.6;
  opacity: .8;
  margin-top: .5rem;
}

/* --------------------------------------------------------------- Weltlage */

.ereignis-karte { border-left: 3px solid var(--border); }
.ereignis-karte.auffaellig { border-left-color: var(--warn); }
.ereignis-karte.ruhig      { border-left-color: var(--ok); }
.ereignis-karte.lernt      { border-left-color: var(--text-faint); }

.ereignis-kopf {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .5rem;
}
.ereignis-marke {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.ereignis-eintrag { padding: .35rem 0; }
.ereignis-eintrag + .ereignis-eintrag {
  border-top: 1px solid var(--border);
  margin-top: .5rem;
  padding-top: .7rem;
}
.ereignis-text {
  margin: 0;
  font-size: .89rem;
  line-height: 1.6;
}

.ereignis-belege { margin-top: .4rem; }
.ereignis-beleg {
  display: flex;
  justify-content: space-between;
  gap: .7rem;
  padding: .25rem 0;
  font-size: .78rem;
}
.ereignis-beleg a { color: var(--accent); }

.attribution {
  margin: .7rem 0 0;
  font-size: .68rem;
  color: var(--text-faint);
  opacity: .75;
}

/* ------------------------------------------------------------- Kurszeile */

.kurs-zeile {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  margin: .55rem 0 .2rem;
  padding: .5rem .65rem;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border-left: 3px solid var(--border);
  font-size: .82rem;
  line-height: 1.5;
}
.kurs-zeile[data-tendenz="auf"] { border-left-color: var(--ok); }
.kurs-zeile[data-tendenz="ab"]  { border-left-color: var(--danger); }
.kurs-quelle {
  font-size: .68rem;
  color: var(--text-faint);
}

/* ---------------------------------------------------------- Presse-Block */

.presse-eintrag {
  padding: .5rem 0;
  border-bottom: 1px solid var(--border);
}
.presse-eintrag:last-of-type { border-bottom: 0; }
.presse-kopf {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  margin-bottom: .15rem;
}
.presse-quelle {
  font-size: .74rem;
  font-weight: 700;
}
.presse-titel {
  display: block;
  font-size: .84rem;
  line-height: 1.45;
  color: var(--accent);
  text-decoration: none;
}
.presse-titel:hover { text-decoration: underline; }
.presse-text {
  margin: .2rem 0 0;
  font-size: .76rem;
  line-height: 1.5;
  color: var(--text-faint);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ------------------------------------------------------ Naturkatastrophen */

.katastrophe-eintrag {
  padding: .5rem 0;
  border-bottom: 1px solid var(--border);
}
.katastrophe-eintrag:last-of-type { border-bottom: 0; }
.katastrophe-kopf {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  margin-bottom: .2rem;
}
.katastrophe-typ { font-size: .78rem; font-weight: 700; }
.katastrophe-text {
  display: block;
  margin: 0;
  font-size: .78rem;
  line-height: 1.5;
  color: var(--text-faint);
  text-decoration: none;
}
a.katastrophe-text:hover { color: var(--text); }

/* -------------------------------------------------------- Rückrechnung */

/* Optisch bewusst anders als alles Gemessene: gestrichelter Rahmen, kein
   voller Kartenhintergrund. Wer flüchtig schaut, soll den Unterschied sehen,
   bevor er die Zahl liest. */
.rueckrechnung {
  border: 1px dashed var(--warn);
  background: transparent;
  margin-top: 1.2rem;
}
.rueck-kopf {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .5rem;
}
.rueck-marke {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--warn);
}
.rueck-frage {
  margin: 0 0 .4rem;
  font-size: .95rem;
  font-weight: 620;
  line-height: 1.4;
}
.rueck-warnung {
  margin: 0 0 .8rem;
  font-size: .76rem;
  line-height: 1.55;
  color: var(--text-faint);
}
.rueck-zeile {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem .8rem;
  align-items: baseline;
  padding: .4rem 0;
  border-bottom: 1px solid var(--border);
}
.rueck-zeile:last-of-type { border-bottom: 0; }
.rueck-kat { font-size: .82rem; font-weight: 600; min-width: 9rem; }
.rueck-zahl { font-size: .8rem; font-variant-numeric: tabular-nums; }
.rueck-detail { font-size: .72rem; color: var(--text-faint); }
.rueck-urteil {
  margin: .8rem 0 0;
  padding: .6rem .7rem;
  border-radius: var(--radius-sm);
  background: var(--warn-soft);
  font-size: .82rem;
  line-height: 1.55;
}

/* --------------------------------------------------------------- Mein Konto */

.konto-liste { display: flex; flex-direction: column; gap: .1rem; margin: .6rem 0 .9rem; }

.konto-zeile {
  padding: .55rem 0;
  border-bottom: 1px solid var(--border);
}
.konto-zeile:last-child { border-bottom: 0; }
/* Abgewählt heißt: sichtbar, aber offensichtlich ohne Wirkung. Ausblenden
   würde die Liste bei jedem Häkchen springen lassen — am Handy unbrauchbar. */
.konto-zeile.aus .konto-regler,
.konto-zeile.aus .konto-person { opacity: .35; pointer-events: none; }

.konto-kopf {
  display: flex;
  align-items: center;
  gap: .6rem;
  cursor: pointer;
  /* Fingerfreundlich: Die ganze Zeile schaltet, nicht nur das kleine Kästchen. */
  min-height: 2.4rem;
}
.konto-kopf input[type="checkbox"] {
  width: 1.15rem; height: 1.15rem;
  accent-color: var(--accent);
  flex: none;
}
.konto-name   { display: block; font-weight: 560; font-size: .9rem; }
.konto-person { display: block; font-size: .78rem; color: var(--text-faint); }

.konto-feld { margin: .2rem 0 1rem; }
.konto-label { display: block; font-weight: 560; font-size: .9rem; margin-bottom: .35rem; }
.konto-hilfe { margin: .35rem 0 0; font-size: .78rem; color: var(--text-faint); line-height: 1.45; }

.konto-regler { display: flex; align-items: center; gap: .7rem; }
.konto-regler input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
  /* Ohne diese Höhe ist der Griff am Handy kaum zu treffen. */
  height: 1.6rem;
}
.konto-wert {
  min-width: 2.6rem;
  text-align: right;
  font-family: var(--mono);
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.konto-select,
.konto-zeit input[type="time"] {
  background: var(--panel-hover);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 4px);
  color: var(--text);
  padding: .5rem .6rem;
  font: inherit;
  font-size: .87rem;
}
.konto-select { width: 100%; }

.konto-zeit {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .5rem;
  flex-wrap: wrap;
}
.konto-zeit label { font-size: .82rem; color: var(--text-faint); }
.konto-zeit.aus { opacity: .35; pointer-events: none; }

.card .notice { margin: .6rem 0; }
.card-body.dim { color: var(--text-faint); font-size: .8rem; }

/* Erklärtexte in „Mein Konto" dürfen nicht abgeschnitten werden: .card-body
   kappt auf drei Zeilen, was bei Signalkarten richtig ist (die Liste bleibt
   überschaubar) und hier falsch — die Erklärung IST der Zweck. */
.konto-text {
  font-size: .855rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 .5rem;
}
.konto-text.dim { color: var(--text-faint); font-size: .8rem; }

/* Verbrauchsanzeige. Ein Balken statt nur Zahlen: „14 von 20" muss man lesen
   und rechnen, einen Balken sieht man. */
.verbrauch-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; }
.verbrauch-balken {
  height: .45rem;
  background: var(--panel-hover);
  border-radius: 99px;
  overflow: hidden;
  margin: .4rem 0 0;
}
.verbrauch-fuellung { height: 100%; background: var(--accent); border-radius: 99px; }
/* Farbe erst, wenn es knapp wird — eine Anzeige, die immer bunt ist, warnt nicht mehr. */
.verbrauch-balken[data-ton="knapp"] .verbrauch-fuellung { background: var(--warn); }
.verbrauch-balken[data-ton="voll"]  .verbrauch-fuellung { background: var(--danger); }
