/* Depotsteuer – Grundlayout: Schrift, Kopfzeile, Navigation, Seite, Fußzeile. */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--a5);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--papier);
  color: var(--tinte);
  font-family: var(--schrift);
  font-size: var(--t-text);
  line-height: var(--zh-text);
  font-variant-numeric: lining-nums;
  overflow-wrap: break-word;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  line-height: var(--zh-titel);
  text-wrap: balance;
}
h1 { font-size: var(--t-seite); letter-spacing: -0.012em; }
h2 { font-size: var(--t-titel); letter-spacing: -0.006em; }
h3 { font-size: var(--t-gross); }
h4 { font-size: var(--t-text); }

p, ul, ol, dl, figure, table, pre { margin: 0; }
p + p { margin-top: var(--a3); }

a {
  color: var(--handlung);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { color: var(--handlung-tief); text-decoration-thickness: 2px; }

:focus { outline: none; }
:focus-visible {
  outline: var(--fokus);
  outline-offset: 2px;
  border-radius: var(--radius);
}

strong, b { font-weight: 600; }
small { font-size: var(--t-klein); }

code, kbd {
  font-family: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  font-size: 0.875em;
  background: var(--papier-tief);
  padding: 0.05em 0.3em;
  border-radius: var(--radius);
}

h1 code, h2 code, h3 code { font-size: 0.62em; font-weight: 400; vertical-align: 0.1em; }

hr {
  border: 0;
  border-top: 1px solid var(--linie);
  margin: var(--a6) 0;
}

svg.icon {
  width: 1em;
  height: 1em;
  flex: none;
  vertical-align: -0.125em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---- Hilfsklassen --------------------------------------------------- */
.nurleser {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.sprung {
  position: absolute;
  left: var(--rand);
  top: -4rem;
  z-index: 20;
  padding: var(--a2) var(--a3);
  background: var(--tinte);
  color: var(--papier);
}
.sprung:focus { top: var(--a2); color: var(--papier); }

.zahl, .betrag {
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  white-space: nowrap;
}
.zahl { text-align: right; }
.minus { color: var(--rot); }
.nebentext { color: var(--tinte-2); }
.fein { font-size: var(--t-fein); line-height: var(--zh-eng); color: var(--tinte-3); }
.klein { font-size: var(--t-klein); }
.nowrap { white-space: nowrap; }
.nur-druck { display: none; }

/* Kleine Dinge nebeneinander (Marken, Verweise); bricht um */
.reihe { display: flex; flex-wrap: wrap; align-items: center; gap: var(--a2); }

/* Abstand zwischen aufeinanderfolgenden Blöcken einer Seite */
.stapel > * + * { margin-top: var(--a4); }
.stapel-gross > * + * { margin-top: var(--a6); }

/* ---- Kopfzeile ------------------------------------------------------ */
.kopf {
  border-bottom: 1px solid var(--tinte);
  background: var(--papier);
}
.kopf__innen {
  max-width: var(--seitenbreite);
  margin: 0 auto;
  padding: 0 var(--rand) 0 calc(var(--rand) + var(--steg));
}
.kopf__zeile {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--a2) var(--a5);
  padding: var(--a3) 0 var(--a2);
}

.wortmarke {
  display: inline-flex;
  align-items: center;
  gap: var(--a2);
  color: var(--tinte);
  font-size: var(--t-gross);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.wortmarke:hover { color: var(--tinte); text-decoration: underline; text-decoration-thickness: 2px; }
.wortmarke svg { width: 1.5rem; height: 1.5rem; flex: none; }

/* Steuerjahr: steht wie auf dem Vordruck groß im Kopf */
.jahrwahl {
  display: flex;
  align-items: center;
  gap: var(--a2);
  margin: 0;
}
.jahrwahl label { font-size: var(--t-klein); color: var(--tinte-2); }
.jahrwahl select {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  font-size: var(--t-gross);
  font-weight: 600;
  font-variant-numeric: tabular-nums lining-nums;
  line-height: 1.2;
  color: var(--tinte);
  background: var(--feld) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.5 6 6l4.5-4.5' fill='none' stroke='%2315222B' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 0.55rem center / 0.7rem;
  border: 1px solid var(--feld-rand);
  border-radius: var(--radius);
  padding: 0.2rem 1.75rem 0.2rem 0.55rem;
  cursor: pointer;
}
.jahrwahl select:hover { border-color: var(--tinte); }
.js .jahrwahl__knopf { display: none; }

.kopf__konto {
  display: flex;
  align-items: center;
  gap: var(--a3);
  margin-left: auto;
  font-size: var(--t-klein);
  color: var(--tinte-2);
}
.kopf__konto form { margin: 0; }
.kopf__name { max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Navigation ----------------------------------------------------- */
.nav {
  margin: 0 calc(-1 * var(--rand)) 0 calc(-1 * var(--a2));
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav ul {
  display: flex;
  gap: var(--a1);
  list-style: none;
  margin: 0;
  padding: 0 var(--rand) 0 0;
  width: max-content;
}
.nav__eintrag {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  padding: 0 var(--a2);
  color: var(--tinte-2);
  font-size: 0.9375rem;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
}
a.nav__eintrag:hover { color: var(--tinte); border-bottom-color: var(--linie); text-decoration: none; }
.nav__eintrag[aria-current="page"] {
  color: var(--tinte);
  font-weight: 600;
  border-bottom-color: var(--tinte);
}
.nav__eintrag:focus-visible { outline-offset: -3px; }
.nav__zaehler {
  /* Bezugsrahmen für den Screenreader-Text „offen“: Ohne ihn hängt das absolut
     positionierte Element am Fenster statt an der scrollenden Navigation und
     macht die Seite auf schmalen Geräten waagerecht scrollbar. */
  position: relative;
  min-width: 1.25rem;
  padding: 0 0.3rem;
  border-radius: 0.625rem;
  background: var(--tinte);
  color: var(--papier);
  font-family: var(--schrift-eng);
  font-size: var(--t-fein);
  font-weight: 500;
  font-variant-numeric: tabular-nums lining-nums;
  line-height: 1.25rem;
  text-align: center;
}

/* ---- Seite ---------------------------------------------------------- */
.seite {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--seitenbreite);
  margin: 0 auto;
  padding: var(--a6) var(--rand) var(--a8) calc(var(--rand) + var(--steg));
}
/* Lesespalte: alles bleibt schmal und linksbündig, außer es bricht bewusst aus. */
.seite > * { max-width: var(--lesespalte); }
.seite > .breit { max-width: none; }
.seite > * + * { margin-top: var(--a5); }
.seite > h2 { margin-top: var(--a7); }
.seite > h3 { margin-top: var(--a6); }
.seite > h2 + *, .seite > h3 + * { margin-top: var(--a3); }
/* Ein einzelner Aktionsknopf (Formular mit margin: 0) auf oberster Ebene hält denselben Abstand. */
.seite > * + .aktionsform { margin-top: var(--a5); }

.seitenkopf { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--a3) var(--a5); }
.seitenkopf__text { flex: 1 1 18rem; min-width: 0; }
.seitenkopf__text > p { margin-top: var(--a2); color: var(--tinte-2); font-size: var(--t-gross); line-height: 1.4; }
.seitenkopf__aktionen { display: flex; flex-wrap: wrap; gap: var(--a2); }

/* ---- Meldungen (Flash) ----------------------------------------------- */
.meldungen { display: grid; gap: var(--a2); }
.meldungen:empty { display: none; }
.seite > .meldungen + * { margin-top: var(--a5); }

/* ---- Fußzeile -------------------------------------------------------- */
.fuss {
  flex: none;
  border-top: 1px solid var(--linie);
  color: var(--tinte-2);
  font-size: var(--t-klein);
  line-height: var(--zh-eng);
}
.fuss__innen {
  max-width: var(--seitenbreite);
  margin: 0 auto;
  padding: var(--a4) var(--rand) var(--a5) calc(var(--rand) + var(--steg));
}
.fuss__innen > p { max-width: var(--lesespalte); }
.fuss strong { color: var(--tinte); }

/* ---- Anmeldung ------------------------------------------------------- */
.anmeldung { max-width: 22rem; }
.anmeldung > * + * { margin-top: var(--a4); }
.anmeldung h1 + p { margin-top: var(--a2); color: var(--tinte-2); }
.anmeldung form { display: grid; gap: var(--a4); margin-top: var(--a5); }
.anmeldung .feld__eingabe { max-width: none; }

/* ---- Schmal ---------------------------------------------------------- */
@media (max-width: 47.99rem) {
  .kopf__zeile { gap: var(--a2) var(--a3); }
  .jahrwahl label { display: none; }
  .kopf__name { display: none; }
  .seite { padding-top: var(--a5); padding-bottom: var(--a7); }
}
