/* Knast-Rechner — dunkles, technisches Design */

:root {
  --bg: #05070a;
  --bg-2: #090d12;
  --panel: #0d1319;
  --panel-2: #101820;
  --line: #1b2733;
  --line-2: #263645;
  --text: #dde7f0;
  --muted: #8395a7;
  --faint: #5b6b7c;
  --amber: #ffb454;
  --amber-2: #ff9f1c;
  --teal: #56e1e9;
  --danger: #ff7a7a;
  --ok: #8ce99a;
  --radius: 16px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: ui-sans-serif, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  font-family: var(--sans);
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(255, 159, 28, .07), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(86, 225, 233, .05), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.vignette {
  pointer-events: none;
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.014) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.014) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(1000px 700px at 50% 0%, #000 30%, transparent 90%);
  z-index: 0;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 28px;
  background: rgba(5, 7, 10, .82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-dot {
  width: 12px; height: 12px; border-radius: 3px;
  background: var(--amber-2);
  box-shadow: 0 0 14px rgba(255, 159, 28, .8);
}
.brand-name { font-weight: 800; letter-spacing: .18em; font-size: 15px; }
.brand-sub { color: var(--muted); font-size: 12px; font-family: var(--mono); }
.header-chip {
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
  border: 1px solid var(--line-2); color: var(--amber);
  padding: 6px 12px; border-radius: 999px; white-space: nowrap;
  background: rgba(255, 159, 28, .06);
}

/* ---------- Grundlayout ---------- */
main { position: relative; z-index: 1; max-width: 1280px; margin: 0 auto; padding: 40px 28px 64px; }

.hero h1 {
  font-size: clamp(28px, 4.2vw, 46px);
  line-height: 1.12; margin: 0 0 14px; letter-spacing: -.02em;
}
.hero-lead { color: var(--muted); max-width: 880px; font-size: 15.5px; margin: 0 0 34px; }
.hero-lead strong { color: var(--text); font-weight: 650; }
.cite-inline {
  font-family: var(--mono); font-size: 11.5px; color: var(--teal);
  border: 1px solid rgba(86,225,233,.25); border-radius: 6px;
  padding: 1.5px 6px; margin-left: 4px; white-space: nowrap;
  text-decoration: none; display: inline-block;
}
a.cite-inline:hover { border-color: var(--teal); background: rgba(86,225,233,.08); }

/* verlinkte Fundstellen (Rechenschritte, Hinweise, Info-Karten) */
a.cite { text-decoration: none; display: inline-block; }
a.cite:hover { color: #bff8fd; border-color: var(--teal); background: rgba(86,225,233,.08); }
.warn a.cite { margin-left: 6px; margin-top: 3px; }
.steps .c a.cite { margin-right: 6px; margin-top: 2px; }
.warn .cite, .ic-links .cite {
  font-family: var(--mono); font-size: 10.5px; color: var(--teal);
  border: 1px solid rgba(86,225,233,.25); border-radius: 6px; padding: 1px 6px;
}
.ic-links { margin-top: 12px; }
.ic-links a.cite { margin-right: 8px; }
a.mini { color: var(--teal); text-decoration: none; border-bottom: 1px dotted rgba(86,225,233,.4); }
a.mini:hover { border-bottom-style: solid; }

.layout {
  display: grid; gap: 24px;
  grid-template-columns: minmax(380px, 460px) minmax(0, 1fr);
  align-items: start;
}
@media (max-width: 1020px) { .layout { grid-template-columns: 1fr; } }

.panel {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 24px;
}

.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
h2 { font-size: 15px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; font-weight: 700; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0 0 10px; }

/* ---------- Presets ---------- */
.presets { display: flex; flex-wrap: wrap; gap: 8px; }
.preset {
  font: inherit; font-size: 12px; color: var(--text);
  background: rgba(255,255,255,.03); border: 1px solid var(--line-2);
  border-radius: 999px; padding: 6px 12px; cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
}
.preset:hover { border-color: var(--amber-2); background: rgba(255,159,28,.08); }
.preset:active { transform: scale(.97); }

/* ---------- Felder ---------- */
.field { margin: 0 0 20px; }
.field label, .field legend { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 8px; }
.opt { color: var(--faint); font-weight: 400; font-size: 11.5px; }
.hint { margin: 8px 0 0; color: var(--faint); font-size: 12px; }

.money-row { display: grid; grid-template-columns: 1fr 132px; gap: 14px; align-items: center; }
@media (max-width: 480px) { .money-row { grid-template-columns: 1fr; } }

.money-input { position: relative; }
.money-input input {
  width: 100%; font-family: var(--mono); font-size: 16px; color: var(--text);
  background: #0a1017; border: 1px solid var(--line-2); border-radius: 10px;
  padding: 10px 30px 10px 12px;
}
.money-input.wide { max-width: 220px; }
.money-input span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); font-family: var(--mono); }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button, input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

input:focus-visible, select:focus-visible, button:focus-visible { outline: 2px solid var(--amber-2); outline-offset: 2px; }

/* Slider */
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; border-radius: 4px; cursor: pointer;
  background: linear-gradient(90deg, rgba(255,159,28,.75), rgba(255,159,28,.15));
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: #10161d; border: 2px solid var(--amber-2);
  box-shadow: 0 0 12px rgba(255,159,28,.5);
}
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: #10161d; border: 2px solid var(--amber-2);
  box-shadow: 0 0 12px rgba(255,159,28,.5);
}

/* Segmented radios */
.radio-list { display: flex; flex-direction: column; gap: 8px; }
.radio-list label {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--line-2); border-radius: 12px;
  padding: 10px 12px; cursor: pointer; font-weight: 500; font-size: 13.5px;
  background: rgba(255,255,255,.015); transition: border-color .15s, background .15s;
}
.radio-list label:hover { border-color: var(--faint); }
.radio-list input { accent-color: var(--amber-2); margin-top: 2px; }
.radio-list label.checked { border-color: var(--amber-2); background: rgba(255,159,28,.07); }
.radio-list .rsub { display: block; color: var(--faint); font-size: 11.5px; margin-top: 2px; }

select {
  width: 100%; font: inherit; font-size: 14px; color: var(--text);
  background: #0a1017; border: 1px solid var(--line-2); border-radius: 10px;
  padding: 10px 12px;
}
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 480px) { .two-col { grid-template-columns: 1fr; } }

/* Toggles */
.toggles { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; font-weight: 500; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.switch {
  flex: 0 0 38px; width: 38px; height: 22px; border-radius: 999px;
  background: #131c25; border: 1px solid var(--line-2); position: relative; transition: background .15s, border-color .15s;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--faint); transition: transform .18s, background .18s;
}
.toggle input:checked + .switch { background: rgba(255,159,28,.16); border-color: var(--amber-2); }
.toggle input:checked + .switch::after { transform: translateX(16px); background: var(--amber-2); }
.toggle input:focus-visible + .switch { outline: 2px solid var(--amber-2); outline-offset: 2px; }

/* ---------- Ergebnis ---------- */
.results { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.hero-result {
  background:
    radial-gradient(600px 200px at 20% 0%, rgba(255,159,28,.10), transparent 70%),
    linear-gradient(180deg, #121a22, #0c1218);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 26px 28px 24px;
}
.hero-kicker { font-family: var(--mono); font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--amber); }
.hero-number {
  font-family: var(--mono); font-weight: 800;
  font-size: clamp(52px, 9vw, 104px);
  line-height: 1.02; letter-spacing: -.03em;
  margin: 8px 0 6px; color: var(--text);
  text-shadow: 0 0 34px rgba(255,159,28,.28);
  word-break: break-word;
}
.hero-number .unit { font-size: .42em; color: var(--amber); letter-spacing: 0; margin-left: 10px; }
.hero-sub { color: var(--muted); font-size: 14px; }
.hero-sub b { color: var(--text); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.card {
  background: linear-gradient(180deg, #0f161e, #0b1117);
  border: 1px solid var(--line); border-radius: 14px; padding: 16px 16px 14px;
}
.card .k { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.card .v { font-family: var(--mono); font-size: 26px; font-weight: 700; margin: 8px 0 4px; letter-spacing: -.01em; }
.card .s { color: var(--muted); font-size: 12px; }
.card.accent .v { color: var(--amber); }
.card.teal .v { color: var(--teal); }

/* Info-Karte (keine Geldstrafe) */
.info-card {
  border: 1px solid rgba(255,122,122,.4);
  background: linear-gradient(180deg, rgba(255,122,122,.08), rgba(255,122,122,.02));
  border-radius: var(--radius); padding: 20px 22px;
}
.info-card .ic-k { font-family: var(--mono); font-size: 12px; color: var(--danger); letter-spacing: .12em; }
.info-card h3 { color: var(--text); text-transform: none; letter-spacing: 0; font-size: 19px; margin: 6px 0 4px; }
.info-card .ic-rahmen { font-family: var(--mono); font-size: 14px; color: var(--danger); margin-bottom: 10px; }
.info-card p { color: var(--muted); font-size: 13.5px; margin: 8px 0 0; }

/* Warnungen */
.warns { display: flex; flex-direction: column; gap: 10px; }
.warn {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px;
  font-size: 13px; color: var(--text); background: rgba(255,255,255,.02);
}
.warn .wdot { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: var(--teal); }
.warn.warn-level { border-color: rgba(255,180,84,.4); background: rgba(255,180,84,.06); }
.warn.warn-level .wdot { background: var(--amber); }

/* Aufschlüsselung */
.breakdown .steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.steps li {
  display: grid; grid-template-columns: 26px 190px 1fr auto; gap: 12px; align-items: baseline;
  padding: 12px 4px; border-bottom: 1px solid var(--line);
}
.steps li:last-child { border-bottom: none; }
.steps .nr { font-family: var(--mono); color: var(--faint); font-size: 13px; }
.steps .t { font-weight: 600; font-size: 13.5px; }
.steps .d { color: var(--muted); font-size: 12.5px; }
.steps .v { font-family: var(--mono); font-size: 14px; color: var(--amber); white-space: nowrap; }
.steps .c { grid-column: 3 / span 2; margin-top: 4px; }
.steps .c .cite {
  font-family: var(--mono); font-size: 10.5px; color: var(--teal);
  border: 1px solid rgba(86,225,233,.25); border-radius: 6px; padding: 1px 6px;
}
@media (max-width: 700px) {
  .steps li { grid-template-columns: 22px 1fr auto; }
  .steps .d { grid-column: 2 / -1; }
}

/* Balkenvergleich */
.bars { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 130px; gap: 12px; align-items: center; }
.bar-label { color: var(--muted); font-size: 12px; }
.bar { height: 14px; border-radius: 999px; background: #0a1017; border: 1px solid var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; }
.bar i.h { background: linear-gradient(90deg, var(--amber-2), var(--amber)); }
.bar i.a { background: linear-gradient(90deg, #1f8f97, var(--teal)); }
.bar-val { font-family: var(--mono); font-size: 12.5px; color: var(--text); text-align: right; }
@media (max-width: 700px) { .bar-row { grid-template-columns: 1fr; } .bar-val { text-align: left; } }

/* ---------- Über ---------- */
.about { margin-top: 34px; }
.about-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; }
@media (max-width: 900px) { .about-grid { grid-template-columns: 1fr; } }
.method-list, .source-list { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.method-list li { margin-bottom: 8px; }
.method-list strong, .method-list em { color: var(--text); font-style: normal; }
.source-list li { margin-bottom: 4px; }
.source-list a { color: var(--teal); text-decoration: none; border-bottom: 1px dotted rgba(86,225,233,.4); }
.source-list a:hover { border-bottom-style: solid; }
.disclaimer {
  margin-top: 14px; font-size: 12px; color: var(--faint);
  border-left: 2px solid var(--amber-2); padding-left: 10px;
}

footer {
  position: relative; z-index: 1;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 20px 28px 34px; color: var(--faint); font-size: 12px; font-family: var(--mono);
  border-top: 1px solid var(--line); max-width: 1280px; margin: 0 auto;
}

.loading { opacity: .55; transition: opacity .15s; }
