/* Chorus: Gipsmodell am Tag. Tokens und Begründung in DESIGN.md. */
@font-face {
  font-family: "Archivo"; src: url("schriften/archivo.woff2") format("woff2");
  font-weight: 100 900; font-stretch: 62% 125%; font-display: swap;
}
:root {
  --luft: #E4E7EA; --gips: #F3F4F4; --tinte: #15171B; --matt: #565C66;
  --problem: #C2412A; --loesung: #0F6F78; --linie: rgba(21,23,27,.14);
  --leiste-h: 4.75rem; --rand: clamp(1rem, 4vw, 3rem); --breit: 72rem;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--gips); color: var(--tinte);
  font: 420 1rem/1.55 "Archivo", system-ui, sans-serif; font-stretch: 100%;
  padding-bottom: var(--leiste-h);
}
/* Englisch: unsichtbar bis übersetzt, spätestens nach 2 s trotzdem zeigen (falls das Skript nie kommt). */
.uebersetzen body { visibility: hidden; animation: zeigen 0s 2s forwards; }
@keyframes zeigen { to { visibility: visible; } }
h1, h2, h3 { margin: 0; font-stretch: 125%; line-height: 1; letter-spacing: -.015em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--tinte); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Kopf */
.kopf {
  position: absolute; inset: 0 0 auto; z-index: 3; display: flex; justify-content: space-between; align-items: baseline;
  padding: 1.1rem var(--rand); pointer-events: none;
}
.kopf a { pointer-events: auto; }
.marke { font-weight: 800; font-stretch: 125%; font-size: 1.15rem; letter-spacing: -.01em; text-decoration: none; }
.kopf__link { font-size: .92rem; color: var(--matt); }
.kopf__link:hover { color: var(--tinte); }

/* Bühne: Frage oben, Themen-Wolken in der Mitte, das Modell unten */
.buehne {
  position: relative; height: calc(100svh - var(--leiste-h)); min-height: 38rem; overflow: hidden;
  background: linear-gradient(180deg, var(--luft) 0%, #EDEFF0 55%, var(--gips) 100%);
  display: grid; grid-template-rows: auto 1fr; padding: 4.2rem var(--rand) 1rem;
}
.relief { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .8s ease; }
.relief-an .relief { opacity: 1; }
.buehne__text { position: relative; z-index: 2; max-width: 34rem; }
.buehne h1 { font-weight: 820; font-size: clamp(2.5rem, 4.6vw, 4.6rem); line-height: .94; }
.buehne__text > p { margin-top: .9rem; color: var(--matt); max-width: 33ch; font-size: 1.02rem; }
.buehne__legende { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; font-size: .86rem; }
.buehne__legende .punkt + span { margin-right: .4rem; color: var(--tinte); }
.buehne__hinweis { color: var(--matt); }
.punkt { width: .62rem; height: .62rem; border-radius: 50%; display: inline-block; }
.punkt--problem { background: var(--problem); }
.punkt--loesung { background: var(--loesung); }

/* Schilder: die Namen der Themen. Mit 3D schweben sie über ihren Wolken, ohne 3D sind sie eine Wortwolke. */
.schilder {
  position: relative; z-index: 2; display: flex; flex-wrap: wrap; justify-content: center; align-content: center;
  gap: .4rem 1.4rem; padding: 2rem 0;
}
/* Ein Schild ist eine Textzeile, die frei umbricht: Rang, Name, Zahl. */
.schild {
  --g: .5; border: 0; background: none; padding: .15rem .1rem; cursor: pointer; text-align: center;
  display: inline-block; max-width: 12em; line-height: 1.08; text-wrap: balance;
  font-size: calc(.74rem + var(--g) * .82rem); font-weight: 760; font-stretch: 116%; color: var(--tinte);
  transition: opacity .25s ease;
}
.schild__rang, .schild__zahl { font-size: .66em; font-weight: 680; color: var(--matt); font-variant-numeric: tabular-nums; }
.schild__rang { margin-right: .3em; }
.schild__zahl { margin-left: .3em; white-space: nowrap; }
.schild:hover .schild__name, .schild[aria-pressed="true"] .schild__name { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .18em; }
.relief-an .schilder { position: absolute; inset: 0; display: block; padding: 0; pointer-events: none; }
.relief-an .schild { position: absolute; left: 0; top: 0; pointer-events: auto; translate: -50% -100%; will-change: transform; }
.relief-an .schilder.waehlt .schild:not([aria-pressed="true"]) { opacity: .35; }
.orte { display: none; }
.relief-an .orte { display: block; position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.ort { position: absolute; left: 0; top: 0; translate: -50% .45rem; font-size: .7rem; font-weight: 520; color: var(--matt); white-space: nowrap; }

/* Rangliste */
.rang, .fair { max-width: var(--breit); margin: 0 auto; padding: clamp(3rem, 8vw, 6rem) var(--rand) 0; }
.rang__kopf { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 1rem 2rem; }
.rang h2, .fair h2 { font-weight: 800; font-size: clamp(1.9rem, 3.6vw, 3rem); }
.reiter { display: flex; gap: 1.4rem; }
.reiter button {
  border: 0; background: none; padding: .55rem 0; min-height: 44px; cursor: pointer; color: var(--matt);
  font-weight: 620; font-stretch: 110%; border-bottom: 2px solid transparent;
}
.reiter button[aria-selected="true"] { color: var(--tinte); border-bottom-color: var(--tinte); }
.rang__erkl { margin-top: 1rem; color: var(--matt); max-width: 60ch; }
.rang__liste { list-style: none; margin: 2rem 0 0; padding: 0; }
.rang__liste li { border-top: 1px solid var(--linie); view-transition-name: var(--vt); }
.rang__liste li:last-child { border-bottom: 1px solid var(--linie); }
.zeile {
  width: 100%; border: 0; background: none; cursor: pointer; text-align: left; padding: 1.15rem 0;
  display: grid; align-items: center; gap: .3rem 1.4rem;
  grid-template-columns: 3.4rem minmax(0, 1fr) 5.5rem 8rem 8.5rem 10.5rem;
}
.zeile:hover .zeile__name { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .18em; }
.zeile__rang { font-size: 2.2rem; font-weight: 800; font-stretch: 112%; font-variant-numeric: tabular-nums; line-height: 1; }
.zeile__name { font-size: clamp(1.15rem, 2vw, 1.55rem); font-weight: 760; font-stretch: 118%; line-height: 1.1; }
.zeile__zahl { font-size: 1.45rem; font-weight: 720; font-stretch: 112%; font-variant-numeric: tabular-nums; text-align: right; line-height: 1; }
.zeile__zahl small { display: block; font-size: .72rem; font-weight: 450; font-stretch: 100%; color: var(--matt); margin-top: .2rem; }
.balken { display: block; height: .42rem; background: rgba(21,23,27,.07); }
.balken i {
  display: block; height: 100%; width: calc(var(--w) * 100%);
  background: linear-gradient(90deg, var(--problem) 0 calc(var(--p) * 100%), var(--loesung) 0);
}
.zeile__orte, .zeile__status { font-size: .86rem; color: var(--matt); line-height: 1.3; }
.zeile__orte b { color: var(--tinte); font-weight: 680; font-variant-numeric: tabular-nums; }
.status { display: inline-flex; align-items: center; gap: .45rem; }
.status::before { content: ""; width: .55rem; height: .55rem; background: currentColor; flex: none; }
.status--beantwortet { color: var(--loesung); }
.status--in-pruefung { color: var(--tinte); }
.status--ausstehend { color: var(--problem); }
.rang__rest { margin-top: 1rem; color: var(--matt); font-size: .92rem; }
.rang__rest button { border: 0; background: none; padding: .5rem 0; min-height: 44px; cursor: pointer; text-decoration: underline; text-underline-offset: .2em; color: var(--tinte); }
::view-transition-group(*) { animation-duration: .45s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }

/* Fair */
.fair__raster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.2rem 4rem; margin-top: 2.2rem; }
.fair h3 { font-size: 1.15rem; font-weight: 740; font-stretch: 115%; margin-bottom: .55rem; }
.fair p { color: var(--matt); max-width: 52ch; }

.fuss { max-width: var(--breit); margin: 0 auto; padding: 4rem var(--rand) 3rem; color: var(--matt); font-size: .88rem; display: grid; gap: .5rem; }

/* Feste Leiste unten: die Hauptaktion */
.leiste {
  position: fixed; inset: auto 0 0; z-index: 10; background: var(--gips); border-top: 1px solid var(--linie);
  display: grid; align-items: center; gap: .55rem 1rem;
  grid-template-columns: auto minmax(0, 1fr) 11rem auto; grid-template-areas: "art text ort senden" "meldung meldung meldung meldung";
  padding: .7rem max(var(--rand), calc((100% - var(--breit)) / 2 + var(--rand))) calc(.7rem + env(safe-area-inset-bottom));
  margin: 0;
}
.leiste__art { grid-area: art; display: flex; border: 0; margin: 0; padding: 0; }
.leiste__art label { position: relative; cursor: pointer; }
.leiste__art input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.leiste__art span {
  display: grid; place-items: center; min-height: 44px; padding: 0 1rem; border: 1px solid var(--linie);
  font-weight: 650; font-stretch: 108%; font-size: .95rem; transition: background-color .2s ease, color .2s ease;
}
.leiste__art label + label span { border-left: 0; }
.leiste__art input:checked + span { color: #fff; border-color: transparent; }
.leiste__art input[value="problem"]:checked + span { background: var(--problem); }
.leiste__art input[value="loesung"]:checked + span { background: var(--loesung); }
.leiste__art input:focus-visible + span { outline: 2px solid var(--tinte); outline-offset: 2px; }
.leiste__text, .leiste__ort {
  border: 0; border-bottom: 1px solid var(--tinte); background: transparent; border-radius: 0; min-height: 44px; padding: .55rem .1rem;
}
.leiste__text { grid-area: text; resize: none; field-sizing: content; max-height: 7rem; line-height: 1.35; }
.leiste__ort { grid-area: ort; cursor: pointer; }
.leiste__text:focus-visible, .leiste__ort:focus-visible { outline: none; border-bottom: 2px solid var(--tinte); padding-bottom: calc(.55rem - 1px); }
.leiste__text::placeholder { color: var(--matt); }
.leiste__senden {
  grid-area: senden; min-height: 44px; padding: 0 1.5rem; border: 0; border-radius: 2px; cursor: pointer;
  background: var(--tinte); color: var(--gips); font-weight: 720; font-stretch: 112%;
}
.leiste__senden:disabled { opacity: .55; cursor: progress; }
.leiste__meldung { grid-area: meldung; font-size: .88rem; color: var(--matt); }
.leiste__meldung:empty { display: none; }
.leiste__meldung.fehler { color: var(--problem); }

/* Dialog: ein Thema mit allem, was dahinter steht */
.thema {
  margin: 0 0 0 auto; height: 100dvh; max-height: none; width: min(44rem, 100%); max-width: 100%;
  border: 0; padding: 0; background: var(--gips); color: var(--tinte); overflow: auto;
  transition: translate .35s cubic-bezier(.2, .8, .2, 1), opacity .35s ease, overlay .35s allow-discrete, display .35s allow-discrete;
  translate: 0 0; opacity: 1;
}
@starting-style { .thema[open] { translate: 2rem 0; opacity: 0; } }
.thema::backdrop { background: rgba(21,23,27,.32); }
.thema__innen { padding: 1.4rem clamp(1.2rem, 4vw, 2.6rem) 4rem; display: grid; gap: 1.6rem; }
.thema__zu {
  position: sticky; float: right; top: 0; width: 44px; height: 44px; border: 0; background: var(--gips);
  font-size: 1.8rem; line-height: 1; cursor: pointer; margin: -.4rem -.6rem 0 0;
}
.thema form { display: contents; }
.thema__platz { color: var(--matt); font-size: .92rem; margin-bottom: -.9rem; }
.thema h2 { font-weight: 820; font-size: clamp(1.9rem, 4.4vw, 2.8rem); }
.thema__kurz { font-size: 1.15rem; line-height: 1.5; }
.thema__quelle { color: var(--matt); font-size: .84rem; margin-top: -1rem; }
.thema h3 { font-size: 1rem; font-weight: 740; font-stretch: 112%; margin-bottom: .7rem; }
.thema__antwort { border-top: 1px solid var(--linie); border-bottom: 1px solid var(--linie); padding: 1.1rem 0; display: grid; gap: .5rem; }
.thema__antwort:empty { display: none; }
.thema__antwort p:last-child { color: var(--tinte); }
.thema__spalten { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.6rem; }
.thema ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.thema__spalten li { padding-left: 1.1rem; position: relative; }
.thema__spalten li::before { content: ""; position: absolute; left: 0; top: .55em; width: .5rem; height: .5rem; background: var(--c); }
.t-problem { color: var(--problem); } .t-loesung { color: var(--loesung); }
.orte-balken li { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr) 2rem; align-items: center; gap: .8rem; font-size: .9rem; }
.orte-balken .balken { height: .5rem; }
.orte-balken b { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }
.original li { display: grid; grid-template-columns: .5rem minmax(0, 1fr); gap: .3rem .8rem; padding: .7rem 0; border-top: 1px solid var(--linie); }
.original li::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--c); margin-top: .5em; }
.original small { grid-column: 2; color: var(--matt); font-size: .8rem; }
.original .neu small { color: var(--tinte); font-weight: 650; }

@media (max-width: 60rem) {
  .zeile { grid-template-columns: 2.6rem minmax(0, 1fr) 4.2rem; }
  .zeile__balken, .zeile__orte, .zeile__status { grid-column: 2 / 4; }
  .zeile__balken { margin-top: .4rem; }
  .zeile__rang { font-size: 1.7rem; grid-row: 1 / 5; align-self: start; }
}
@media (max-width: 40rem) {
  :root { --leiste-h: 8.4rem; }
  .leiste { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "art ort ort" "text text senden" "meldung meldung meldung"; padding-top: .6rem; }
  .leiste__ort { justify-self: end; width: 100%; max-width: 11rem; }
  .fair__raster, .thema__spalten { grid-template-columns: 1fr; }
  .buehne { padding-top: 3.6rem; min-height: 44rem; }
  .buehne h1 { font-size: clamp(2.2rem, 10vw, 3rem); }
  .buehne__text > p { font-size: .92rem; line-height: 1.45; margin-top: .6rem; }
  .buehne__legende { font-size: .8rem; gap: .3rem .45rem; }
  .schild { font-size: calc(.7rem + var(--g) * .5rem); max-width: 10em; }
  /* Im Hochformat tragen nur die ersten drei Wolken einen Namen, die anderen ihre Nummer. Die Liste darunter hat alle. */
  .relief-an .schild[data-rang]:not([data-rang="1"]):not([data-rang="2"]):not([data-rang="3"]) :is(.schild__name, .schild__zahl) { display: none; }
  .relief-an .schild[data-rang]:not([data-rang="1"]):not([data-rang="2"]):not([data-rang="3"]) .schild__rang { font-size: 1em; color: var(--tinte); margin: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, ::view-transition-group(*) { transition: none !important; animation-duration: 0s !important; }
}

/* Bericht für die Gemeinde: ruhige Lese- und Druckseite */
body.bericht { padding-bottom: 0; background: #fff; }
.bericht__kopf { display: flex; justify-content: space-between; align-items: center; max-width: 52rem; margin: 0 auto; padding: 1.1rem var(--rand); }
.bericht__druck { border: 1px solid var(--tinte); background: none; border-radius: 2px; min-height: 44px; padding: 0 1rem; cursor: pointer; font-weight: 650; font-stretch: 108%; }
.bericht__seite { max-width: 52rem; margin: 0 auto; padding: 1.5rem var(--rand) 5rem; }
.bericht h1 { font-weight: 820; font-size: clamp(2.2rem, 5vw, 3.4rem); }
.bericht__stand { margin-top: 1rem; font-size: 1.1rem; }
.bericht__hinweis { margin-top: .4rem; color: var(--matt); font-size: .9rem; }
.bericht__teil { margin-top: 3.2rem; display: grid; gap: .8rem; }
.bericht__teil h2 { font-weight: 800; font-size: 1.7rem; padding-bottom: .6rem; border-bottom: 1px solid var(--tinte); }
.bericht__teil h3 { font-size: .98rem; font-weight: 740; font-stretch: 110%; margin-top: .8rem; }
.bericht .matt { color: var(--matt); }
.bericht__tabelle { width: 100%; border-collapse: collapse; font-size: .94rem; }
.bericht__tabelle th, .bericht__tabelle td { text-align: left; padding: .6rem .5rem .6rem 0; border-bottom: 1px solid var(--linie); vertical-align: baseline; }
.bericht__tabelle thead th { font-size: .8rem; color: var(--matt); font-weight: 600; }
.bericht__tabelle tbody th { font-weight: 680; font-stretch: 108%; }
.bericht__tabelle a { text-decoration: none; }
.bericht__tabelle .zahl { text-align: right; font-variant-numeric: tabular-nums; }
.bericht__notiz { color: var(--matt); font-size: .84rem; }
.bericht__zahlen { color: var(--matt); }
.bericht__antwort { border-top: 1px solid var(--linie); border-bottom: 1px solid var(--linie); padding: .4rem 0 .9rem; }
.bericht__spalten { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2rem; }
.bericht ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.punkte li { padding-left: 1.1rem; position: relative; }
.punkte li::before { content: ""; position: absolute; left: 0; top: .55em; width: .5rem; height: .5rem; background: var(--c); }
.bericht .orte-balken li { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr) 2rem; align-items: center; gap: .8rem; font-size: .88rem; }
.bericht .orte-balken b { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }
.orte-balken--grau .balken i { background: var(--tinte); }
.bericht .original { gap: 0; columns: 2; column-gap: 2rem; display: block; }
.original--eng li { break-inside: avoid; display: grid; grid-template-columns: .5rem minmax(0, 1fr); gap: .1rem .7rem; padding: .45rem 0; border-top: 1px solid var(--linie); font-size: .86rem; line-height: 1.4; }
.original--eng li::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: var(--c); margin-top: .45em; }
.original--eng small { grid-column: 2; color: var(--matt); font-size: .76rem; }
@media (max-width: 40rem) { .bericht__spalten { grid-template-columns: 1fr; } .bericht .original { columns: 1; } }
@media print {
  @page { size: A4; margin: 16mm 14mm; }
  body.bericht { font-size: 10pt; }
  .bericht__druck { display: none; }
  .bericht__kopf, .bericht__seite { padding-left: 0; padding-right: 0; max-width: none; }
  .bericht__thema { break-before: page; }
  .bericht__teil h2, .bericht__teil h3 { break-after: avoid; }
  .bericht a { text-decoration: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
