/* Sonnenhang Dach & Holz (erfundener Betrieb): Richtpreis-Rechner.
   Farben und Maße nur über die Variablen unten; Schrift Archivo (lokal, OFL). */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("schriften/archivo-latin-wght-normal.woff2") format("woff2");
}

:root {
  --primaer: #b4452a;
  --primaer-dunkel: #8f3219;
  --primaer-hell: #f7e6df;
  --primaer-mittel: #e8b9a8;
  --akzent: #d9a15e;
  --akzent-hell: #fbf0dc;
  --akzent-text: #6b4200;
  --grund: #f6f1e9;
  --flaeche: #ffffff;
  --text: #22262a;
  --leise: #555a5f;
  --gedimmt: #666b70;
  --linie: #ddd5c8;
  --linie-stark: #a79c8b;
  --fehler: #b3261e;
  --fehler-hell: #fdecea;
  --ok: #1b6b43;
  --ok-hell: #e3f4ea;
  --radius: 10px;
  --radius-klein: 7px;
  --schatten: 0 1px 2px rgb(34 38 42 / 0.06), 0 10px 28px -12px rgb(34 38 42 / 0.22);
  --fokus: 0 0 0 3px var(--flaeche), 0 0 0 6px var(--primaer);
  --schrift: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 1rem;
}

body {
  margin: 0;
  font-family: var(--schrift);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--grund);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  outline: none;
}

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 0.6rem;
  font-weight: 720;
  text-wrap: balance;
}

h1 {
  font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.5rem);
  letter-spacing: -0.025em;
}

h2 {
  font-size: clamp(1.3rem, 1.1rem + 0.9vw, 1.6rem);
}

h3 {
  font-size: 1.125rem;
}

h1,
h2,
h3,
p,
li,
dd {
  overflow-wrap: break-word;
}

p {
  margin: 0 0 0.8rem;
}

a {
  color: var(--primaer-dunkel);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--primaer);
}

:focus-visible {
  outline: 3px solid var(--primaer);
  outline-offset: 3px;
  border-radius: 4px;
}

h1:focus,
main:focus {
  outline: none;
}

.rahmen {
  width: min(100% - 2rem, 70rem);
  margin-inline: auto;
}

.nur-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.sprunglink {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 50;
  background: var(--primaer-dunkel);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-klein);
  transition: top 0.15s;
}

.sprunglink:focus {
  top: 0.75rem;
}

/* Hinweisleiste --------------------------------------------------------------- */

.beispiel-leiste {
  background: var(--akzent-hell);
  color: var(--akzent-text);
  border-bottom: 1px solid #ecd49c;
  font-size: 0.875rem;
  line-height: 1.4;
}

.beispiel-leiste .rahmen {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  justify-content: space-between;
  align-items: baseline;
  padding-block: 0.55rem;
}

.beispiel-leiste p {
  margin: 0;
}

.beispiel-leiste a {
  color: var(--akzent-text);
  font-weight: 650;
}

/* Kopf ------------------------------------------------------------------------ */

.kopf {
  background: var(--flaeche);
  border-bottom: 1px solid var(--linie);
}

.kopf-innen {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-block: 0.75rem;
}

.marke {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  text-decoration: none;
}

.marke img {
  border-radius: 10px;
  display: block;
}

.marke-text {
  display: grid;
  line-height: 1.1;
}

.marke-text strong {
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.marke-text span {
  font-size: 0.8125rem;
  color: var(--leise);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ansichten {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  background: var(--grund);
  border: 1px solid var(--linie);
  border-radius: 999px;
}

.ansichten a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 1.1rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 620;
  color: var(--leise);
  font-size: 0.9375rem;
}

.ansichten a:hover {
  color: var(--text);
}

.ansichten a[aria-current="page"] {
  background: var(--primaer);
  color: #fff;
}

@media (max-width: 26rem) {
  .ansichten {
    width: 100%;
  }

  .ansichten a {
    flex: 1;
    justify-content: center;
    padding-inline: 0.5rem;
  }
}

/* Seitenaufbau ---------------------------------------------------------------- */

.seite {
  display: grid;
  gap: 1.5rem;
  padding-block: 1.75rem 3rem;
}

.seite > * {
  min-width: 0;
}

@media (min-width: 62rem) {
  .seite {
    grid-template-columns: minmax(0, 1fr) 21rem;
    align-items: start;
    gap: 2rem;
  }

  .seitenleiste {
    position: sticky;
    top: 1rem;
  }
}

.kopfzeile {
  margin-bottom: 1.25rem;
}

.untertitel {
  color: var(--leise);
  font-size: 1.125rem;
  max-width: 40rem;
}

.karte {
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  padding: clamp(1rem, 0.5rem + 2.4vw, 1.75rem);
}

.karte + .karte {
  margin-top: 1rem;
}

.karte h2 {
  margin-bottom: 0.9rem;
}

.karte-leise {
  background: transparent;
  box-shadow: none;
  border-style: dashed;
  border-color: var(--linie-stark);
}

/* Schritte -------------------------------------------------------------------- */

.schritte {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  counter-reset: schritt;
}

.schritte li {
  display: grid;
  gap: 0.35rem;
  counter-increment: schritt;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--leise);
  border-top: 4px solid var(--linie);
  padding-top: 0.5rem;
  line-height: 1.25;
}

.schritte li::before {
  content: counter(schritt);
  display: inline-grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--linie);
  color: var(--text);
  font-size: 0.8125rem;
}

.schritte li[data-stand="fertig"] {
  border-top-color: var(--primaer);
  color: var(--text);
}

.schritte li[data-stand="fertig"]::before {
  background: var(--primaer);
  color: #fff;
}

.schritte li[aria-current="step"] {
  border-top-color: var(--primaer);
  color: var(--primaer-dunkel);
}

.schritte li[aria-current="step"]::before {
  background: var(--primaer-dunkel);
  color: #fff;
}

.schritt-kurz {
  display: none;
  margin: -0.75rem 0 1.25rem;
  font-weight: 650;
  color: var(--primaer-dunkel);
}

@media (max-width: 34rem) {
  .schritte {
    margin-bottom: 0.9rem;
  }

  .schritte li {
    justify-items: center;
  }

  .schritte li > span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .schritt-kurz {
    display: block;
  }

  .aktionen {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .aktionen .knopf {
    width: 100%;
  }

  .aktionen .zurueck {
    margin-right: 0;
  }
}

/* Formulare ------------------------------------------------------------------- */

fieldset {
  border: 0;
  margin: 0 0 1.5rem;
  padding: 0;
  min-width: 0;
}

legend {
  padding: 0;
  margin-bottom: 0.6rem;
  font-weight: 700;
  font-size: 1.125rem;
}

.feld {
  display: grid;
  gap: 0.3rem;
  margin-bottom: 1.1rem;
}

.feld label,
.feld .feld-label {
  font-weight: 650;
}

.feld .pflicht {
  color: var(--fehler);
  font-weight: 700;
}

.feld .hinweis {
  color: var(--leise);
  font-size: 0.9375rem;
  margin: 0;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
select,
textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--flaeche);
  border: 1.5px solid var(--linie-stark);
  border-radius: var(--radius-klein);
  padding: 0.7rem 0.85rem;
  min-height: 3rem;
}

textarea {
  min-height: 7rem;
  resize: vertical;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--primaer);
  outline-offset: 1px;
  border-color: var(--primaer);
}

[aria-invalid="true"] {
  border-color: var(--fehler) !important;
  background: var(--fehler-hell);
}

.fehlertext {
  color: var(--fehler);
  font-weight: 600;
  font-size: 0.9375rem;
  margin: 0;
}

.zeile2 {
  display: grid;
  gap: 0 1rem;
}

@media (min-width: 40rem) {
  .zeile2 {
    grid-template-columns: 1fr 1fr;
  }
}

/* Auswahlkarten (Radio) */

.optionen {
  display: grid;
  gap: 0.65rem;
}

@media (min-width: 40rem) {
  .optionen.zwei {
    grid-template-columns: 1fr 1fr;
  }
}

.option {
  position: relative;
}

.option input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}

.option label {
  min-width: 0;
  overflow-wrap: anywhere;
  display: grid;
  grid-template-columns: 1.4rem minmax(0, 1fr) auto;
  gap: 0.15rem 0.8rem;
  align-items: start;
  padding: 0.95rem 1rem;
  background: var(--flaeche);
  border: 1.5px solid var(--linie-stark);
  border-radius: var(--radius-klein);
  cursor: pointer;
  transition: border-color 0.12s, background-color 0.12s;
}

.option label::before {
  content: "";
  width: 1.3rem;
  height: 1.3rem;
  margin-top: 0.12rem;
  border-radius: 50%;
  border: 2px solid var(--linie-stark);
  background: var(--flaeche);
  grid-row: 1 / span 3;
}

.option input[type="checkbox"] + label::before {
  border-radius: 5px;
}

.option input:checked + label {
  border-color: var(--primaer);
  background: var(--primaer-hell);
}

.option input:checked + label::before {
  border-color: var(--primaer);
  background: radial-gradient(circle, var(--primaer) 0 45%, var(--flaeche) 50%);
}

.option input[type="checkbox"]:checked + label::before {
  background: var(--primaer) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") center / 80% no-repeat;
}

.option input:focus-visible + label {
  outline: 3px solid var(--primaer);
  outline-offset: 2px;
}

.option input:hover + label {
  border-color: var(--primaer);
}

.option .titel {
  font-weight: 680;
  grid-column: 2;
}

.option .dauer {
  grid-column: 3;
  grid-row: 1;
  font-size: 0.875rem;
  font-weight: 650;
  color: var(--primaer-dunkel);
  background: var(--primaer-hell);
  border-radius: 999px;
  padding: 0.05rem 0.6rem;
  justify-self: end;
}

@media (max-width: 30rem) {
  .option label {
    grid-template-columns: 1.4rem minmax(0, 1fr);
  }

  .option .dauer {
    grid-column: 2;
    grid-row: auto;
    justify-self: start;
  }

  .marke-text strong {
    font-size: 1.1rem;
  }
}

.option input:checked + label .dauer {
  background: var(--flaeche);
}

.option .beschreibung {
  grid-column: 2 / -1;
  color: var(--leise);
  font-size: 0.9375rem;
  line-height: 1.4;
}

.option .marker {
  grid-column: 2 / -1;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--akzent-text);
}

.option.egal label .titel {
  font-weight: 650;
}

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

.knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 3rem;
  padding: 0.6rem 1.35rem;
  border-radius: 999px;
  border: 2px solid var(--primaer);
  background: var(--primaer);
  color: #fff;
  font: inherit;
  font-weight: 680;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.12s, border-color 0.12s;
}

.knopf:hover {
  background: var(--primaer-dunkel);
  border-color: var(--primaer-dunkel);
  color: #fff;
}

.knopf .icon {
  width: 1.15rem;
  height: 1.15rem;
}

.knopf-zweit {
  background: var(--flaeche);
  color: var(--primaer-dunkel);
}

.knopf-zweit:hover {
  background: var(--primaer-hell);
  color: var(--primaer-dunkel);
}

.knopf-leise {
  background: transparent;
  border-color: var(--linie-stark);
  color: var(--text);
}

.knopf-leise:hover {
  background: var(--flaeche);
  border-color: var(--primaer);
  color: var(--text);
}

.knopf-gefahr {
  background: var(--flaeche);
  border-color: var(--fehler);
  color: var(--fehler);
}

.knopf-gefahr:hover {
  background: var(--fehler);
  border-color: var(--fehler);
  color: #fff;
}

.knopf-klein {
  min-height: 2.75rem;
  padding: 0.35rem 1rem;
  font-size: 0.9375rem;
}

.knopf[disabled],
.knopf[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

.icon {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.aktionen {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.5rem;
}

.aktionen .zurueck {
  margin-right: auto;
}

/* Meldungen ------------------------------------------------------------------- */

.meldung {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-klein);
  border: 1px solid var(--linie);
  background: var(--primaer-hell);
  margin-bottom: 1rem;
}

.meldung > .icon {
  flex: none;
  margin-top: 0.15rem;
}

.meldung > div,
.meldung > p {
  min-width: 0;
}

.meldung p:last-child {
  margin-bottom: 0;
}

.meldung-fehler {
  background: var(--fehler-hell);
  border-color: #f0b8b3;
  color: #7d1812;
}

.meldung-fehler a {
  color: #7d1812;
  font-weight: 650;
}

.meldung-warnung {
  background: var(--akzent-hell);
  border-color: #ecd49c;
  color: var(--akzent-text);
}

.meldung-ok {
  background: var(--ok-hell);
  border-color: #a8d5bb;
  color: #0f4d2e;
}

.meldung strong {
  display: block;
}

.fehlerliste {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
}

/* Zusammenfassung ------------------------------------------------------------- */

.auswahl {
  display: grid;
  gap: 0.75rem;
  margin: 0;
}

.auswahl dt {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 650;
  color: var(--leise);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.auswahl dt .icon {
  width: 1.1rem;
  height: 1.1rem;
  color: var(--primaer);
}

.auswahl dd {
  margin: 0.1rem 0 0 1.6rem;
  font-weight: 620;
  overflow-wrap: anywhere;
}

.auswahl dd.leer {
  color: var(--gedimmt);
  font-weight: 450;
}

.auswahl-kurz span,
.option .titel,
.option .beschreibung,
.option .marker,
.person-kopf h2,
.kennzahl .name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.auswahl-kurz {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  align-items: center;
  padding: 0.6rem 0.9rem;
  margin-bottom: 1.25rem;
  background: var(--primaer-hell);
  border-radius: var(--radius-klein);
  font-weight: 620;
  font-size: 0.9375rem;
}

.pruefen-liste {
  margin: 0 0 1rem;
  display: grid;
  gap: 0;
}

.pruefen-liste > div {
  display: grid;
  gap: 0.15rem 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--linie);
}

@media (min-width: 40rem) {
  .pruefen-liste > div {
    grid-template-columns: 11rem minmax(0, 1fr) auto;
    align-items: baseline;
  }
}

.pruefen-liste dt {
  color: var(--leise);
  font-weight: 600;
}

.pruefen-liste dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.pruefen-liste dd.lang {
  white-space: pre-line;
}

.textlink {
  font: inherit;
  font-weight: 600;
  color: var(--primaer-dunkel);
  background: none;
  border: 0;
  padding: 0.3rem 0;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

/* Seitenleiste ---------------------------------------------------------------- */

.seitenleiste h2 {
  font-size: 1.125rem;
}

.praxis-info {
  margin: 0;
  display: grid;
  gap: 0.6rem;
  font-size: 0.9375rem;
}

.praxis-info dt {
  font-weight: 650;
}

.praxis-info dd {
  margin: 0;
  color: var(--leise);
}

.tipps {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.9375rem;
}

.tipps li {
  margin-bottom: 0.4rem;
}

/* Bestätigung ----------------------------------------------------------------- */

.fertig-kopf {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.fertig-haken {
  flex: none;
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  background: var(--ok);
  color: #fff;
}

.fertig-haken .icon {
  width: 1.7rem;
  height: 1.7rem;
  stroke-width: 3;
}

.buchungs-nr {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
  font-weight: 700;
  background: var(--primaer-hell);
  border-radius: 6px;
  padding: 0.05rem 0.5rem;
}

.mail-vorschau {
  margin: 0.75rem 0 0;
  padding: 1rem;
  background: var(--grund);
  border: 1px solid var(--linie);
  border-radius: var(--radius-klein);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.875rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

details.aufklapp {
  border: 1px solid var(--linie);
  border-radius: var(--radius-klein);
  padding: 0 1rem;
  margin: 1rem 0 0.75rem;
  background: var(--flaeche);
}

details.aufklapp summary {
  min-height: 3rem;
  display: flex;
  align-items: center;
  font-weight: 650;
  cursor: pointer;
  list-style-position: outside;
}

details.aufklapp[open] {
  padding-bottom: 1rem;
}

.bestaetigung {
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--fehler);
  border-radius: var(--radius-klein);
  background: var(--fehler-hell);
  margin-top: 1rem;
}

/* Fuß ------------------------------------------------------------------------- */

.fuss {
  border-top: 1px solid var(--linie);
  background: var(--flaeche);
  color: var(--leise);
  font-size: 0.9375rem;
  padding-block: 1.5rem;
}

.fuss p {
  max-width: 50rem;
}

.fuss-datenschutz {
  overflow-wrap: anywhere;
}

.fuss-werkzeuge {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 0;
}

.laden {
  padding-block: 2rem;
  color: var(--leise);
}

.fehlt-unten {
  margin-top: 0.3rem;
}

/* Bewegung und Kontraste ------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (forced-colors: active) {
  .tag[aria-pressed="true"],
  .zeit input:checked + label,
  .option input:checked + label {
    outline: 3px solid Highlight;
  }

  .balken::before,
  .band i {
    background: Highlight;
  }
}

/* Druck: nur die Tagesliste --------------------------------------------------- */

@media print {
  .beispiel-leiste,
  .kopf,
  .fuss,
  .werkzeuge,
  .woche,
  .sprunglink,
  .termin select,
  .seitenleiste {
    display: none !important;
  }

  body {
    background: #fff;
    font-size: 11pt;
  }

  .karte,
  .termin,
  .kennzahl {
    box-shadow: none;
  }

  .termin {
    break-inside: avoid;
  }

  .druck-status {
    display: inline !important;
  }
}

.druck-status {
  display: none;
}

.seite-breit {
  padding-block: 1.75rem 3rem;
}

.werkzeuge .werkzeuge {
  margin-bottom: 0;
}


/* Kopf im Rechner: dunkel, handwerklich ------------------------------------- */

.kopf {
  background: #22262a;
  border-bottom: 4px solid var(--primaer);
  color: #f3ece0;
}

.kopf .marke {
  color: #f3ece0;
}

.kopf .marke-text span {
  color: #d3cab9;
}

.kopf-innen {
  flex-wrap: nowrap;
}

.kopf-zeile {
  margin: 0;
  color: #d3cab9;
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: right;
}

@media (max-width: 34rem) {
  .kopf-zeile {
    display: none;
  }
}

.marke img {
  border-radius: 8px;
}

/* Einstieg mit Foto ---------------------------------------------------------- */

.intro {
  display: grid;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.intro-bild {
  display: block;
  width: 100%;
  height: 9rem;
  object-fit: cover;
  border-radius: var(--radius);
}

@media (min-width: 62rem) {
  .intro {
    grid-template-columns: minmax(0, 1fr) 15rem;
    align-items: center;
  }

  .intro-bild {
    height: 10rem;
  }

  .intro .kopfzeile {
    margin-bottom: 0;
  }
}

/* Leistungen ----------------------------------------------------------------- */

.gewerk + .gewerk {
  margin-top: 1.75rem;
}

.gewerk h2 {
  margin-bottom: 0.15rem;
}

.gewerk-text {
  color: var(--leise);
  margin-bottom: 0.9rem;
}

.positionen {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.65rem;
}

.position {
  background: var(--flaeche);
  border: 1.5px solid var(--linie-stark);
  border-radius: var(--radius-klein);
  transition: border-color 0.12s, background-color 0.12s;
}

.position[data-aktiv="ja"] {
  border-color: var(--primaer);
  background: #fffaf7;
}

.pos-kopf {
  position: relative;
}

.pos-kopf input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.pos-kopf label {
  display: grid;
  grid-template-columns: 1.4rem 2rem minmax(0, 1fr);
  gap: 0 0.8rem;
  align-items: center;
  padding: 0.9rem 1rem;
  cursor: pointer;
  border-radius: var(--radius-klein);
}

.pos-kopf label::before {
  content: "";
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 5px;
  border: 2px solid var(--linie-stark);
  background: var(--flaeche);
}

.pos-kopf input:checked + label::before {
  border-color: var(--primaer);
  background: var(--primaer) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") center / 80% no-repeat;
}

.pos-kopf input:focus-visible + label {
  outline: 3px solid var(--primaer);
  outline-offset: 2px;
}

.pos-kopf input:hover + label {
  background: var(--primaer-hell);
}

.icon-gross {
  width: 2rem;
  height: 2rem;
  color: var(--primaer);
  stroke-width: 1.6;
}

.pos-text {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.pos-name {
  font-weight: 720;
  font-size: 1.0625rem;
  overflow-wrap: anywhere;
}

.pos-kurz {
  color: var(--leise);
  font-size: 0.9375rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.pos-felder {
  align-items: start;
  display: grid;
  gap: 0.25rem 1.25rem;
  padding: 0.25rem 1rem 1rem 1rem;
  border-top: 1px dashed var(--linie);
  margin-inline: 1rem;
  padding-inline: 0;
  padding-top: 1rem;
}

.pos-felder[hidden] {
  display: none;
}

.pos-felder .feld {
  margin-bottom: 0.5rem;
}

@media (min-width: 40rem) {
  .pos-felder {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pos-felder > .hinweis:last-child {
    grid-column: 1 / -1;
  }
}

.menge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.menge input {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.menge .icon-knopf {
  flex: none;
}

.icon-knopf {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 1.5px solid var(--linie-stark);
  background: var(--flaeche);
  color: var(--text);
  cursor: pointer;
  padding: 0;
}

.icon-knopf:hover:not([disabled]) {
  border-color: var(--primaer);
  background: var(--primaer-hell);
}

/* Zusammenfassung (dunkle Karte) --------------------------------------------- */

.zusammenfassung {
  background: #22262a;
  color: #f3ece0;
  border-color: #22262a;
}

.zusammenfassung h2 {
  font-size: 1.125rem;
  color: #d3cab9;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.zf-spanne {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.5rem;
  font-size: 1.05rem;
  line-height: 1.25;
}

.zf-spanne strong {
  font-size: clamp(1.6rem, 1.3rem + 0.8vw, 1.9rem);
  letter-spacing: -0.02em;
  color: #f0b27f;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.zf-ca {
  color: #d3cab9;
}

.zf-klein {
  color: #d3cab9;
  font-size: 0.875rem;
  margin: 0.25rem 0 1rem;
}

.zf-leer {
  margin: 0;
  color: #d3cab9;
}

.zf-liste {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
  font-size: 0.9375rem;
}

.zf-liste li {
  display: grid;
  gap: 0.1rem;
  padding-top: 0.5rem;
  border-top: 1px solid #4a4f55;
}

.zf-liste li span:last-child {
  font-variant-numeric: tabular-nums;
  color: #f3ece0;
  font-weight: 650;
}

.zf-liste li span:first-child {
  color: #d3cab9;
}

.zf-fehler {
  display: flex;
  gap: 0.5rem;
  margin: 0.9rem 0 0;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-klein);
  background: #4a2a22;
  color: #ffd8cb;
  font-size: 0.9375rem;
}

.zf-fehler .icon {
  margin-top: 0.15rem;
}

.leiste-unten {
  position: sticky;
  bottom: 0;
  z-index: 20;
  margin-inline: -1rem;
  padding: 0.7rem 1rem;
  background: #22262a;
  color: #f3ece0;
  text-align: center;
  border-top: 3px solid var(--primaer);
}

.leiste-unten p {
  margin: 0;
}

.leiste-unten strong {
  color: #f0b27f;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 61.99rem) {
  html {
    scroll-padding-bottom: 5rem;
  }
}

@media (min-width: 62rem) {
  .leiste-unten {
    display: none;
  }
}

@media (max-width: 61.99rem) {
  .seitenleiste {
    order: 2;
  }
}

/* Richtwert ------------------------------------------------------------------ */

.ergebnis {
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.25rem 1rem;
  background: var(--primaer-hell);
  border-left: 6px solid var(--primaer);
  border-radius: var(--radius-klein);
}

.ergebnis-label {
  margin: 0 0 0.25rem;
  font-weight: 650;
  color: var(--primaer-dunkel);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.8125rem;
}

.ergebnis-zahl {
  margin: 0 0 0.4rem;
  font-size: 1.25rem;
  line-height: 1.15;
}

.ergebnis-zahl strong {
  display: block;
  font-size: clamp(1.7rem, 1.1rem + 2.4vw, 3rem);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.aufstellung {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}

.aufstellung li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1.25rem;
  justify-content: space-between;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--linie);
}

.az-name {
  flex: 1 1 14rem;
  min-width: 0;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.az-detail {
  display: block;
  font-weight: 450;
  color: var(--leise);
  font-size: 0.9375rem;
}

.az-betrag {
  flex: 0 1 auto;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
  overflow-wrap: anywhere;
}

.az-zusatz .az-name {
  font-weight: 560;
}

.az-summe {
  border-bottom: 0;
  border-top: 3px double var(--text);
  margin-top: 0.4rem;
  font-size: 1.125rem;
}

.weiter-liste {
  counter-reset: w;
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: grid;
  gap: 0.9rem;
}

.weiter-liste li {
  counter-increment: w;
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: 0.1rem 0.8rem;
}

.weiter-liste li::before {
  content: counter(w);
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--primaer);
  color: #fff;
  font-weight: 700;
}

.weiter-liste li span {
  color: var(--leise);
}

.link-feld {
  margin-top: 0.4rem;
}

.auswahl-kurz {
  justify-content: space-between;
}

@media print {
  .leiste-unten,
  .aktionen {
    display: none !important;
  }
}

.seite-einspaltig {
  grid-template-columns: minmax(0, 1fr);
  max-width: 50rem;
  margin-inline: auto;
}

/* Schmale Fläche, auch bei großer Schrift (rem wächst mit der Schrift) --------- */

.positionen > li,
.pos-felder > *,
.feld {
  min-width: 0;
}

.pos-felder {
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 40rem) {
  .pos-felder {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 15rem) {
  .pos-kopf label {
    grid-template-columns: 1.4rem minmax(0, 1fr);
  }

  .pos-kopf .icon-gross {
    display: none;
  }
}

label,
legend,
.hinweis,
.fehlertext {
  overflow-wrap: anywhere;
}

.menge {
  flex-wrap: wrap;
}

.menge input {
  flex: 1 1 4rem;
}

/* Das Attribut hidden gewinnt immer, auch gegen display:flex/grid anderer Regeln (z. B. .meldung). */
[hidden] {
  display: none !important;
}
