/* WohnWertMiete - Gestaltung nach dem Corporate-Design-Handbuch der AWG "Rennsteig" eG (Fassung 1.0, Kapitel 03, 04, 06, 08)
   Zurückhaltende Fassung: weißer Grund, Tannengrün nur für Kopfzeile, Überschriften und die eine Hauptschaltfläche,
   Salbei nur als feine Linie, Leinen/Sandstein als leise Flächen. Lime kommt in der Anwendung nicht vor.
   Schrift: Calibri, im Web Carlito (lokal eingebunden). Kanten bleiben scharf (Radius 0), keine Schatten, keine Verläufe. */

@font-face { font-family: "Carlito"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/Carlito-Regular.woff2") format("woff2"); }
@font-face { font-family: "Carlito"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/Carlito-Bold.woff2") format("woff2"); }
@font-face { font-family: "Carlito"; font-style: italic; font-weight: 400; font-display: swap; src: url("/fonts/Carlito-Italic.woff2") format("woff2"); }
@font-face { font-family: "Carlito"; font-style: italic; font-weight: 700; font-display: swap; src: url("/fonts/Carlito-BoldItalic.woff2") format("woff2"); }

:root {
  --gruen: #002E08; --salbei: #BDC884; --leinen: #F1F2E4; --sandstein: #ECE5D0;
  --text: #1C1C18; --hover: #4B6A2A; --weiss: #FFFFFF; --rot: #8A1C1C;
  --leise: #5A5E4F;                       /* Nebentext, neutral: 6,5 : 1 auf Weiß, 5,8 : 1 auf Leinen */
  --linie: #D9DDC2;                       /* feine Trennlinie (Salbei, aufgehellt) */
  --schrift: "Carlito", "Calibri", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--weiss); color: var(--text); font: 17px/1.6 var(--schrift); }
main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 28px 24px 48px; }
body.breit main, body.breit .kopf-innen, body.breit .fuss-innen { max-width: 1480px; }   /* Administration: breite Tabellen */
.sprung { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--weiss); color: var(--gruen); font-weight: 700; padding: 8px 16px; }
.sprung:focus { left: 8px; top: 8px; }
.nur-lesen { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- Überschriften */
h1, h2, h3 { margin: 0 0 6px; color: var(--gruen); font-style: italic; font-weight: 700; line-height: 1.2; }
h1 { font-size: 2rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.1rem; }
.label-klein { margin: 0 0 2px; color: var(--leise); font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
p { margin: 0 0 12px; }
.hinweis, .leise { color: var(--leise); }
.klein { font-size: .875rem; }
a { color: var(--gruen); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--hover); }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85em; }

/* ---------- Kopf, Fuß */
.kopf { background: var(--gruen); color: var(--weiss); }
.kopf-innen { max-width: 1200px; margin: 0 auto; padding: 10px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 32px; }
.marke { display: flex; align-items: center; gap: 12px; }
.marke img { display: block; width: 48px; height: 48px; }
.marke-text { display: flex; flex-direction: column; line-height: 1.15; }
.marke-name { font-size: 1.4rem; font-weight: 700; font-style: italic; }
.marke-sub { color: var(--salbei); font-size: .85rem; }
#nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
#nav button { min-height: 44px; padding: 0 14px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--weiss); font-size: 1rem; font-weight: 400; }
#nav button:hover { background: rgba(255, 255, 255, .12); }
#nav button[aria-current="page"] { border-bottom-color: var(--weiss); font-weight: 700; }
.nutzer { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: .9rem; }
.fuss { background: var(--leinen); color: var(--leise); font-size: .875rem; }
.fuss-innen { max-width: 1200px; margin: 0 auto; padding: 14px 24px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 24px; }
.slogan { color: var(--gruen); font-weight: 700; font-style: italic; }

/* ---------- Kacheln */
.kachel, .karte { background: var(--weiss); border: 1px solid var(--linie); padding: 20px 24px; margin-bottom: 20px; }
.kachel-kopf { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px; }
.kachel-kopf h2 { margin: 0; }
.kachel-kopf p.hinweis { margin: 2px 0 0; }
.aktualisieren { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; max-width: 24rem; text-align: right; }
.aktualisieren .fehler { font-size: .9rem; }
.summe { text-align: right; color: var(--gruen); font-size: .9rem; white-space: nowrap; }
.summe strong { font-size: 1.6rem; line-height: 1; }
.info { background: var(--leinen); padding: 14px 18px; margin: 0 0 16px; }
.info p:last-child { margin-bottom: 0; }
.warn { background: var(--sandstein); border-left: 3px solid var(--gruen); padding: 12px 16px; margin: 0 0 20px; }
.warn ul { margin: 4px 0 0 20px; padding: 0; }
.fehler { color: var(--rot); font-weight: 700; } .ok { color: var(--gruen); font-weight: 700; }
.fehler::before { content: "! "; } .ok::before { content: "✓ "; }
.paar { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.zeile { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.zeile + .zeile { margin-top: 16px; }
.spalte { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.aktionen { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; margin-top: 24px; }
.tag { display: inline-block; padding: 0 8px; border: 1px solid var(--linie); background: var(--leinen); color: var(--text); font-size: .875rem; }
.tag.neu { border-color: var(--rot); color: var(--rot); }

/* ---------- Eingabe: Auswahl der Nutzungseinheit */
.dreier { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px 24px; }
.kombi { position: relative; }
.kombi input { width: 100%; }
.kombi ul { position: absolute; z-index: 20; left: 0; top: 100%; min-width: 100%; width: max-content; max-width: min(42rem, 92vw); max-height: 18rem; overflow: auto; margin: 0; padding: 0; list-style: none; background: var(--weiss); border: 1px solid var(--gruen); }
.kombi li { padding: 10px 12px; border-bottom: 1px solid var(--leinen); border-left: 3px solid transparent; cursor: pointer; }
.kombi li[aria-selected="true"] { background: var(--leinen); border-left-color: var(--gruen); }
.kombi li.aktuell { font-weight: 700; }
.kombi li.hinweis { cursor: default; color: var(--leise); }

/* ---------- Formularelemente, Schaltflächen (Touch-Ziel mind. 44 px, Kontrast nach CD Kapitel 08) */
label { display: flex; flex-direction: column; gap: 4px; color: var(--text); font-size: .9rem; font-weight: 700; }
input, select, textarea, button { font: inherit; color: var(--text); border-radius: 0; }
input, select, textarea { min-height: 44px; min-width: 0; padding: 6px 12px; background: var(--weiss); border: 1px solid #8C917C; font-size: 1rem; }
input:hover, select:hover, textarea:hover { border-color: var(--gruen); }
input[type="checkbox"] { min-height: 0; width: 24px; height: 24px; padding: 0; accent-color: var(--gruen); }
:focus-visible { outline: 2px solid var(--gruen); outline-offset: 2px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gruen); outline-offset: 0; border-color: var(--gruen); }
.kopf :focus-visible { outline-color: var(--weiss); }
button { min-height: 44px; padding: 0 18px; border: 1px solid var(--gruen); background: var(--weiss); color: var(--gruen); font-weight: 700; cursor: pointer; }
button:hover { background: var(--leinen); }
button.primaer { background: var(--gruen); color: var(--weiss); }
button.primaer:hover { background: var(--hover); border-color: var(--hover); }
button.sekundaer.auf-gruen { background: transparent; color: var(--weiss); border-color: rgba(255, 255, 255, .7); font-weight: 400; }
button.sekundaer.auf-gruen:hover { background: var(--weiss); color: var(--gruen); }
button.gefahr { color: var(--rot); border-color: var(--rot); }
button:disabled { color: var(--leise); border-color: var(--linie); background: var(--leinen); cursor: not-allowed; }
button.primaer:disabled { color: var(--leise); }
td input, td select { width: 100%; }
td input.schmal { width: 4.5rem; text-align: right; }
td select { min-width: 7rem; }
td input.name { min-width: 9rem; }
td input.feldname { min-width: 16rem; }

/* ---------- Ergebnis */
.ne-kopf h2 { font-size: 1.5rem; margin-bottom: 2px; }
.ne-adresse { color: var(--text); font-size: 1.1rem; font-weight: 400; font-style: normal; }
.meta { display: flex; flex-wrap: wrap; gap: 2px 28px; margin: 10px 0 0; font-size: .9rem; }
.meta div { display: flex; gap: 6px; }
.meta dt { color: var(--leise); } .meta dd { margin: 0; font-weight: 700; }
.kz-raster { display: grid; grid-template-columns: 1.35fr 1fr 1.15fr; gap: 20px; margin-bottom: 20px; }
.kzk { background: var(--leinen); padding: 20px 24px; display: flex; flex-direction: column; gap: 2px; }
.kzk-haupt { border-left: 4px solid var(--gruen); }
.kzk .gross { color: var(--gruen); font-size: 2.5rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kzk .klein { color: var(--leise); }
.kzk-punkte { flex-direction: row; align-items: center; gap: 18px; }
.kzk-punkte > div:last-child { display: flex; flex-direction: column; gap: 2px; }
.hex { position: relative; flex: none; width: 96px; height: 83px; }
.hex svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.hex-form { fill: var(--weiss); stroke: var(--gruen); stroke-width: 3; stroke-linejoin: round; }
.hex-zahl { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--gruen); font-size: 1.9rem; font-weight: 700; }
.skala { padding-top: 16px; padding-bottom: 16px; }
.skala-bahn { position: relative; height: 10px; margin: 10px 0 8px; background: var(--leinen); border: 1px solid var(--linie); }
.skala-fuell { height: 100%; width: var(--pos, 0%); background: var(--gruen); }
.skala-ends { display: flex; justify-content: space-between; gap: 16px; font-size: .875rem; color: var(--leise); }
.skala-titel { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; align-items: baseline; }

/* ---------- Tabellen: leicht, ohne Farbband und ohne Zebra */
.tabellenrahmen { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 1rem; }
th { padding: 4px 10px 6px; color: var(--leise); font-weight: 700; text-align: left; font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; border-bottom: 2px solid var(--gruen); }
td { padding: 7px 10px; border-bottom: 1px solid var(--linie); vertical-align: middle; }
td.zahl, th.zahl { text-align: right; font-variant-numeric: tabular-nums; }
tr.geaendert td { background: var(--sandstein); }
tr.geaendert td:first-child { border-left: 3px solid var(--gruen); }

/* Merkmale in der Berechnung: Wert schmal */
table.merkmale th { padding: 4px 8px 6px; }
table.merkmale td { padding: 5px 8px; }
table.merkmale td.name { width: auto; }
table.merkmale td.name .nr { display: inline-block; min-width: 2.4em; color: var(--leise); font-size: .85rem; font-variant-numeric: tabular-nums; }
table.merkmale td.name .neu-text { display: none; margin-left: 8px; padding: 0 6px; border: 1px solid var(--gruen); color: var(--gruen); font-size: .75rem; font-weight: 700; }
table.merkmale tr.geaendert td.name .neu-text { display: inline-block; }
table.merkmale td.wert { width: 9.5rem; } table.merkmale td.wert.auswahl { width: 24rem; }
table.merkmale td.wert input { text-align: right; }
table.merkmale td.zahl { width: 5rem; }
table.merkmale td.punkte { color: var(--gruen); font-weight: 700; }

/* ---------- Administration */
.tabs { display: flex; flex-wrap: wrap; gap: 0 4px; margin-bottom: 20px; border-bottom: 1px solid var(--linie); }
.tabs button { min-height: 44px; padding: 0 16px; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; background: transparent; color: var(--text); font-weight: 400; }
.tabs button:hover { background: var(--leinen); }
.tabs button[aria-current="page"] { color: var(--gruen); font-weight: 700; border-bottom-color: var(--gruen); }
.leiste { position: sticky; bottom: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 12px 16px; background: var(--weiss); border: 1px solid var(--gruen); }
.leiste input { flex: 1; min-width: 14rem; }
.kennzahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 16px 0; }
.kz { background: var(--leinen); padding: 12px 16px; }
.kz .gross { color: var(--gruen); font-size: 1.8rem; font-weight: 700; line-height: 1.15; }
.kz .klein { color: var(--leise); }
.spalte button { height: auto; min-height: 44px; padding: 6px 12px; text-align: left; line-height: 1.3; font-weight: 400; }
dialog { width: min(760px, 94vw); max-height: 88vh; overflow: auto; padding: 24px; border: 1px solid var(--gruen); border-radius: 0; background: var(--weiss); color: var(--text); }
dialog::backdrop { background: rgba(28, 28, 24, .5); }
dialog textarea { display: block; width: 100%; min-height: 12rem; line-height: 1.5; resize: vertical; }

/* ---------- Kein Zugriff / Fehlerseiten */
.seite-mitte { max-width: 640px; margin: 48px auto; padding: 0 24px; }

/* ---------- Hinweise zu den Merkmalen */
.i-knopf { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; margin: -10px 0 -10px 2px; padding: 0; border: 0; background: transparent; vertical-align: middle; }
.i-knopf:hover { background: transparent; }
.i-kreis { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: 1px solid var(--gruen); color: var(--gruen); font-family: Georgia, "Times New Roman", serif; font-size: .95rem; font-style: italic; font-weight: 700; line-height: 1; }
.i-knopf:hover .i-kreis { background: var(--leinen); }
.i-knopf[aria-expanded="true"] .i-kreis { background: var(--gruen); color: var(--weiss); }
tr.hinweis-zeile td { padding: 12px 16px 14px 3.4em; background: var(--leinen); border-bottom: 1px solid var(--linie); font-weight: 400; }
.hinweis-box { max-width: 62rem; font-size: .95rem; }
.hinweis-box p { margin: 0 0 6px; }
.hinweis-box ul { margin: 0 0 6px; padding-left: 1.2em; }
.hinweis-box li { margin: 1px 0; }
.hinweis-box > :last-child { margin-bottom: 0; }
.text-knopf { display: block; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--gruen); font-size: .9rem; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.text-knopf:hover { background: transparent; color: var(--hover); }

/* ---------- Fixierte Kurzleiste: bleibt oben stehen, sobald die großen Kennzahlen aus dem Bild sind (Höhe 0, kein Springen) */
.kz-fix { position: sticky; top: 0; z-index: 10; height: 0; }
.kz-kompakt { display: none; position: absolute; left: 0; right: 0; top: 0; align-items: center; gap: 6px 28px; min-height: 52px; padding: 6px 16px; background: var(--leinen); border: 1px solid var(--linie); border-left: 4px solid var(--gruen); }
.kz-fix.sichtbar .kz-kompakt { display: flex; }
.kk { display: flex; align-items: baseline; gap: 8px; }
.kk-label { color: var(--leise); font-size: .85rem; }
.kk-wert { color: var(--gruen); font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.kk-ve { color: var(--gruen); font-weight: 700; font-style: italic; }
.kk-test { margin-left: auto; padding: 0 8px; border: 1px solid var(--gruen); color: var(--gruen); font-size: .8rem; font-weight: 700; }

/* ---------- Tablet */
@media (max-width: 1000px) {
  .kz-raster { grid-template-columns: 1fr 1fr; }
  .kz-raster .kzk-punkte { grid-column: 1 / -1; }
  .paar { grid-template-columns: 1fr; }
}
/* ---------- Schmale Fenster: Merkmale als Karten (die Auswahlfelder brauchen Breite) */
@media (max-width: 900px) {
  /* Merkmale: jede Zeile wird zur kleinen Karte */
  table.merkmale thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.merkmale, table.merkmale tbody { display: block; }
  table.merkmale tr { display: grid; grid-template-columns: 1fr auto auto; grid-template-areas: "name name name" "wert gew punkte"; gap: 6px 16px; align-items: center; padding: 10px 8px; border-bottom: 1px solid var(--linie); }
  table.merkmale tr.auswahl { grid-template-areas: "name name name" "wert wert wert" "gew gew punkte"; }
  table.merkmale td { display: block; padding: 0; border: 0; width: auto; }
  table.merkmale td.name { grid-area: name; font-weight: 700; }
  table.merkmale td.wert, table.merkmale td.wert.auswahl { grid-area: wert; width: auto; }
  table.merkmale td.gew { grid-area: gew; } table.merkmale td.punkte { grid-area: punkte; }
  table.merkmale td.gew::before { content: "Gewicht "; color: var(--leise); font-size: .8rem; }
  table.merkmale td.punkte::before { content: "Punkte "; color: var(--leise); font-size: .8rem; font-weight: 400; }
  table.merkmale td.leer::before { content: none; }
  table.merkmale td.zahl { text-align: left; }
  table.merkmale tr.geaendert td:first-child { border-left: 0; }
  table.merkmale tr.geaendert { background: var(--sandstein); border-left: 3px solid var(--gruen); }
  table.merkmale tr.hinweis-zeile { display: block; padding: 0; background: var(--leinen); }
  table.merkmale tr.hinweis-zeile td { padding: 10px 12px 12px; }
  .aktualisieren { align-items: stretch; max-width: none; width: 100%; text-align: left; }
}
/* ---------- Handy */
@media (max-width: 640px) {
  body { font-size: 16px; }
  main { padding: 16px 16px 32px; }
  .kopf-innen, .fuss-innen { padding-left: 16px; padding-right: 16px; }
  .marke img { width: 40px; height: 40px; }
  .marke-name { font-size: 1.25rem; }
  #nav { order: 3; flex-basis: 100%; }
  .kachel, .karte { padding: 16px; margin-bottom: 16px; }
  .kz-raster { grid-template-columns: 1fr; gap: 12px; }
  .kzk { padding: 14px 16px; } .kzk .gross { font-size: 2.2rem; }
  .kzk-punkte { gap: 14px; } .hex { width: 84px; height: 73px; } .hex-zahl { font-size: 1.6rem; }
  .ne-kopf h2 { font-size: 1.3rem; }
  .summe { text-align: left; }
  .leiste input { min-width: 0; flex-basis: 100%; }
  .kz-kompakt { display: none; grid-template-columns: repeat(3, 1fr); gap: 2px 8px; padding: 6px 10px; min-height: 0; }
  .kz-fix.sichtbar .kz-kompakt { display: grid; }
  .kk { flex-direction: column; align-items: flex-start; gap: 0; }
  .kk-label { font-size: .75rem; } .kk-wert { font-size: 1.05rem; }
  .kk-ve { display: none; }
  .kk-test { grid-column: 1 / -1; margin-left: 0; justify-self: start; }
  tr.hinweis-zeile td { padding-left: 12px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
.kachel .zeile + .tabellenrahmen { margin-top: 16px; }
.tabellenrahmen + .zeile { margin-top: 20px; }
.kachel .info + .zeile { margin-top: 0; }

/* ---------- Portal: Startseite mit Programm-Kacheln, Rechteverwaltung */
#nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; color: var(--salbei); font-weight: 400; text-decoration: none; }
#nav a:hover { color: var(--weiss); text-decoration: underline; }
.programme { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 20px; margin: 0 0 20px; }
a.programm { display: flex; flex-direction: column; gap: 6px; padding: 20px 24px; background: var(--weiss); border: 1px solid var(--linie); border-top: 4px solid var(--gruen); color: var(--text); font-weight: 400; text-decoration: none; }
a.programm:hover, a.programm:focus-visible { background: var(--leinen); }
a.programm h2 { margin: 0; }
a.programm p { margin: 0; color: var(--leise); }
a.programm .programm-fuss { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 12px; }
a.programm .oeffnen { color: var(--gruen); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.rechte-tabelle select { min-width: 9rem; }
.rechte-tabelle td.mail small { display: block; color: var(--leise); }
.rechte-tabelle + h3, .tabellenrahmen + h3 { margin-top: 28px; }
