:root, html[data-theme="light"] {
  --pico-font-size: 100%;
  --akzent: #1f5f8b;
  --akzent-hell: #e8f1f7;
  --pico-primary: var(--akzent);
  --pico-primary-background: var(--akzent);
  --pico-primary-border: var(--akzent);
  --pico-primary-hover-background: #174a6d;
  --pico-form-element-spacing-vertical: .45rem;
}
body { background: #fafbfc; }
.kopf { background: var(--akzent); color: #fff; margin-bottom: 1.5rem; }
.kopf-innen { display: flex; align-items: center; gap: 1.5rem; padding: .8rem 1rem; flex-wrap: wrap; }
.logo { color: #fff; font-weight: 700; font-size: 1.35rem; text-decoration: none; letter-spacing: -.02em; }
.logo span { color: #9fd0f0; }
.kopf nav { display: flex; gap: 1.4rem; flex: 1; flex-wrap: wrap; justify-content: flex-start; }
.kopf nav a, .sprache { color: #dbe9f3; text-decoration: none; }
.kopf nav a[aria-current="page"] { color: #fff; border-bottom: 2px solid #9fd0f0; }
.sprache { font-size: .85rem; border: 1px solid #9fd0f0; padding: .1rem .5rem; border-radius: 4px; }

h1 { font-size: 1.6rem; margin-bottom: .4rem; }
.raster { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 2rem; align-items: start; }
@media (max-width: 900px) {
  .raster { grid-template-columns: 1fr; }
  #ergebnis { order: -1; }              /* Ergebnis oben, aktualisiert sich beim Tippen */
  .ergebnis { position: static; }
}
@media (max-width: 520px) {
  .kopf-innen { gap: .4rem 1rem; }
  .kopf nav { order: 3; flex-basis: 100%; gap: 1rem; font-size: .9rem; }
  .sprache { margin-left: auto; }
}

form fieldset { border: 1px solid #dde3e8; border-radius: 6px; padding: .8rem 1rem .2rem; margin-bottom: 1rem; background: #fff; }
form legend { font-weight: 600; padding: 0 .3rem; font-size: .95rem; }
.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 520px) { .zwei { grid-template-columns: 1fr; } }
label { font-size: .9rem; }
input[inputmode="decimal"] { text-align: right; font-variant-numeric: tabular-nums; }
.klein { font-size: .8rem; color: #667; }

.ergebnis { position: sticky; top: 1rem; background: #fff; border: 1px solid #dde3e8; border-radius: 6px; padding: 1rem 1.2rem; }
.ergebnis table { margin: 0; font-variant-numeric: tabular-nums; }
.ergebnis td:last-child, .ergebnis th:last-child, .vergleich td { text-align: right; }
.ergebnis tr.summe td { font-weight: 700; border-top: 2px solid #333; }
.ergebnis tr.zwischensumme td { font-weight: 600; }
.ergebnis tr.unter td:first-child { padding-left: 1.4rem; color: #556; }
.gross { font-size: 1.9rem; font-weight: 700; color: var(--akzent); margin: .2rem 0 .8rem; font-variant-numeric: tabular-nums; }
.hinweis { background: #fff7e0; border-left: 3px solid #e0a800; padding: .4rem .7rem; font-size: .85rem; margin: .6rem 0 0; }
.fehler { background: #fdecec; border-left: 3px solid #c0392b; padding: .5rem .8rem; }
.badge { font-size: .7rem; background: #e0a800; color: #fff; border-radius: 3px; padding: 0 .3rem; vertical-align: middle; }
.leer { color: #889; }

.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.kacheln a { display: block; background: #fff; border: 1px solid #dde3e8; border-radius: 6px; padding: 1.2rem; text-decoration: none; }
.kacheln a:hover { border-color: var(--akzent); }
.kacheln strong { display: block; font-size: 1.1rem; margin-bottom: .3rem; }

.fuss { font-size: .8rem; color: #667; margin-top: 3rem; padding-bottom: 2rem; }
.htmx-request .ergebnis { opacity: .6; }
