:root {
  --slate-950: #0a0f1a;
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-100: #f1f5f9;
  --white: #ffffff;
  --red-500: #ef4444;
  --line: rgba(255, 255, 255, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--slate-950);
  color: var(--slate-300);
  line-height: 1.55;
}
h1, h2, h3 {
  font-family: 'Space Grotesk', sans-serif;
  color: var(--white);
  line-height: 1.2;
  font-weight: 650;
}
a { color: #93c5fd; }
a:hover { color: var(--white); }

nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(10, 15, 26, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.nav-inner, .footer-inner, main { max-width: 1080px; margin: 0 auto; }
.nav-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  padding: 0.9rem 1.25rem;
}
.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
  font-size: 1.2rem;
}
.logo span { color: var(--red-500); }
.nav-links { display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; align-items: center; }
.nav-links a { color: var(--slate-300); text-decoration: none; font-size: 0.92rem; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--white); }
.lang-switch { margin-left: auto; color: var(--slate-400); font-size: 0.92rem; }
.lang-switch a { color: var(--slate-300); text-decoration: none; }
.lang-switch .is-active { color: var(--white); }

main { padding: 2rem 1.25rem 4rem; }
.kicker { color: var(--slate-400); font-size: 0.92rem; margin: 0 0 0.4rem; }
h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin: 0 0 0.75rem; }
.lead { font-size: 1.05rem; max-width: 42rem; }
.as-of {
  display: inline-block;
  margin: 0 0 1.25rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--slate-100);
  font-size: 0.85rem;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 0 0 1rem;
  padding: 1rem 1rem 0.9rem;
  background: var(--slate-900);
}
legend { color: var(--white); font-family: 'Space Grotesk', sans-serif; padding: 0 0.3rem; }
.hint { color: var(--slate-400); font-size: 0.92rem; margin: 0.35rem 0 0; }
.choice-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.choice-row label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--slate-700);
  border-radius: 8px;
  background: var(--slate-800);
  color: var(--slate-100);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.5rem 0 1rem;
}
.choice {
  flex: 1 1 16rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--slate-700);
  background: var(--slate-800);
  color: var(--slate-100);
  text-decoration: none;
  text-align: center;
  font-weight: 650;
}
.choice:hover { background: #273549; color: var(--white); }
body:has(#spar-police:checked) #go-konto,
body:has(#spar-konto:checked) #go-police { display: none; }
.direct { display: inline-block; margin-top: 0.25rem; }

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 1rem;
}
label.field { display: flex; flex-direction: column; gap: 0.35rem; color: var(--slate-100); font-size: 0.95rem; }
input[type="number"], input[type="text"] {
  width: 100%;
  background: var(--slate-950);
  color: var(--white);
  border: 1px solid var(--slate-700);
  border-radius: 8px;
  padding: 0.65rem 0.7rem;
  font: inherit;
}
input[type="range"] { width: 100%; accent-color: #94a3b8; }
.pair { display: flex; gap: 0.6rem; align-items: center; }
.pair input[type="number"] { max-width: 7.5rem; }
.equity { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.equity label {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--slate-700);
  border-radius: 8px;
  background: var(--slate-800);
}

.note, .bounds, .low-label, .result-disclaimer, .sources {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  background: var(--slate-900);
}
.bounds, .low-label { margin: 0.75rem 0; }
.note[hidden] { display: none; }
#account-note[hidden] { display: none; }

.calc-submit {
  margin: 0.35rem 0 0.2rem;
  padding: 0.9rem 1.25rem;
  border: 0;
  border-radius: 10px;
  background: var(--slate-100);
  color: var(--slate-950);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.calc-submit:hover { background: var(--white); }
.calc-result[hidden] { display: none; }
.stale-notice {
  margin: 1rem 0 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
  font-weight: 650;
}
.stale-notice[hidden] { display: none; }
.calc-result.is-stale .result-body {
  opacity: 0.45;
  filter: grayscale(1);
}
.result-head { margin: 0.75rem 0; }
.pair-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1rem 0;
}
.chart {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem;
  background: var(--slate-900);
}
.chart h3 { margin: 0 0 0.75rem; font-size: 1rem; }
.bar-row { display: grid; grid-template-columns: 6.5rem 1fr auto; gap: 0.5rem; align-items: center; margin: 0.35rem 0; }
.bar-label, .bar-num { font-size: 0.85rem; color: var(--slate-100); }
.bar-track { height: 0.7rem; background: var(--slate-950); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: #cbd5e1; border-radius: 999px; }

.table-wrap { overflow-x: auto; margin: 0.5rem 0 1rem; }
table { width: 100%; border-collapse: collapse; min-width: 40rem; }
th, td { text-align: right; padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
th:first-child, td:first-child { text-align: left; }
thead th { color: var(--white); font-weight: 650; }
.rate { display: block; color: var(--slate-400); font-weight: 450; font-size: 0.78rem; }

.result-disclaimer { margin: 1rem 0; }
details.sources summary { cursor: pointer; color: var(--white); }
details.sources p, .prose p, .prose li { max-width: 46rem; }
.prose h2 { margin: 1.6rem 0 0.5rem; font-size: 1.25rem; }
.prose ul { padding-left: 1.2rem; }

footer { border-top: 1px solid var(--line); padding: 1.5rem 1.25rem 2.5rem; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; align-items: center; justify-content: space-between; }
.footer-brand { color: var(--white); text-decoration: none; font-family: 'Space Grotesk', sans-serif; font-weight: 700; }
.footer-brand span { color: var(--red-500); }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; }
.footer-links a { color: var(--slate-300); }

@media (max-width: 760px) {
  .grid, .pair-charts { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 5.5rem 1fr; }
  .bar-num { grid-column: 2; }
}
