/* gemeinde.montafon.biz – Nachrichtenseite: Meldungen untereinander, ruhige Seitenleiste; hell/dunkel nach Systemeinstellung */
:root {
  --bg: #f9f8f4; --fg: #1d2420; --muted: #5d6660; --line: #dcd9d0; --card: #ffffff;
  --akzent: #1f6b4f; --akzent-hell: #e3f0ea; --akzent-fg: #ffffff;
  --gem: #234c7a; --gem-hell: #e4ecf6; --kat: #6b5b2e; --kat-hell: #f3ecd8; --thema: #4d4f57; --thema-hell: #ececf0;
  --ok: #2b7a3b; --ok-hell: #dff3e3; --bad: #b3352b; --bad-hell: #f9e1de; --mid: #8a6d1d; --mid-hell: #f7ecc9;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15191a; --fg: #e6e4dd; --muted: #a2a8a3; --line: #2e3536; --card: #1d2324;
    --akzent: #6fc39e; --akzent-hell: #1e3a2e; --akzent-fg: #0f1a15;
    --gem: #9dbdea; --gem-hell: #1f2d40; --kat: #d9c27a; --kat-hell: #3a331c; --thema: #c6c8d2; --thema-hell: #2b2d36;
    --ok: #7bd08d; --ok-hell: #1d3a24; --bad: #f0857a; --bad-hell: #47201c; --mid: #e3c25a; --mid-hell: #3f3517;
  }
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; line-height: 1.5; }
a { color: var(--akzent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
code { font-family: var(--mono); font-size: .9em; background: var(--thema-hell); padding: 1px 5px; border-radius: 4px; }

/* Kopf: Zeitungskopf mit Datumszeile und Suche, darunter Ressort-Leiste und Gemeinde-Zeile */
.kopf { background: var(--card); }
.masthead { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding-top: 16px; padding-bottom: 12px; }
.marke { font-family: var(--serif); font-size: 2.1rem; font-weight: 700; color: var(--fg); letter-spacing: -.015em; line-height: 1; }
.marke:hover { text-decoration: none; }
.marke-m { color: var(--akzent); }
.datumzeile { margin: 8px 0 0; color: var(--muted); font-size: .82rem; }
.datumzeile .trenner { margin: 0 4px; }
.kopf-suche { display: flex; align-items: center; gap: 6px; flex: 0 1 360px; border: 1px solid var(--line); border-radius: 6px; padding: 3px 3px 3px 10px; background: var(--bg); }
.kopf-suche .ico { color: var(--muted); flex: 0 0 auto; }
.kopf-suche input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: .92rem; color: var(--fg); outline: none; }
.kopf-suche button { font: inherit; font-size: .85rem; padding: 6px 12px; border: 0; border-radius: 4px; background: var(--akzent); color: var(--akzent-fg); cursor: pointer; }
.nav.ressorts { border-top: 2px solid var(--fg); border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; flex-wrap: wrap; gap: 0; }
.nav.ressorts a { padding: 9px 11px; color: var(--fg); font-size: .92rem; font-weight: 600; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.nav.ressorts a:first-child { padding-left: 0; }
.nav.ressorts a:hover { color: var(--akzent); text-decoration: none; }
.nav.ressorts a.aktiv { color: var(--akzent); border-bottom-color: var(--akzent); }
.nav.orte { background: var(--bg); border-bottom: 1px solid var(--line); }
.nav.orte .wrap { align-items: center; font-size: .82rem; }
.orte-label { color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; padding: 6px 12px 6px 0; }
.nav.orte a { padding: 6px 8px; color: var(--muted); white-space: nowrap; }
.nav.orte a:hover { color: var(--fg); text-decoration: none; }
.nav.orte a.aktiv { color: var(--fg); font-weight: 700; }

main { padding: 16px 16px 40px; }
h1 { font-size: 1.7rem; margin: 6px 0 14px; letter-spacing: -.01em; line-height: 1.2; }
h2 { font-size: 1.2rem; margin: 28px 0 10px; }
h3 { font-size: 1.05rem; margin: 18px 0 8px; }
.intro { color: var(--muted); max-width: 90ch; }
.hinweis { color: var(--muted); font-size: .88rem; max-width: 100ch; }
.dezent { color: var(--muted); }
.nowrap { white-space: nowrap; }
small { font-size: .85em; }
.ico { width: 24px; height: 24px; }
.ico.klein { width: 16px; height: 16px; }

/* Kicker-Zeile „Gemeinde · Rubrik · Datum“ */
.kicker { margin: 0; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); line-height: 1.5; }
.kicker .gem { font-weight: 700; color: var(--gem); }
.kicker .kat { color: var(--kat); }
.kicker .trenner { margin: 0 6px; }
.kicker a:hover { text-decoration: underline; }
.kat-insolvenz .kicker .kat, .kat-versteigerung .kicker .kat { color: var(--bad); }

/* Meldungen (Startseite, Listen, Suche): Überschrift, Teaser, Aktionen – untereinander mit viel Luft */
.seiten-titel { font-family: inherit; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 4px 0 0; padding-bottom: 8px; border-bottom: 2px solid var(--fg); }
.meldung { padding: 20px 0 18px; border-bottom: 1px solid var(--line); }
.meldung h2 { margin: 6px 0 8px; font-size: 1.35rem; line-height: 1.3; letter-spacing: -.01em; }
.meldung h2 a { color: var(--fg); }
.meldung h2 a:hover { color: var(--akzent); text-decoration: none; }
.meldung .teaser { margin: 0 0 8px; font-size: .98rem; line-height: 1.55; max-width: 72ch; }
.meldung .aktionen { display: flex; flex-wrap: wrap; gap: 14px; margin: 0; font-size: .86rem; font-weight: 600; }
.meldung .aktionen .dezent { font-weight: 400; }
.mehr-unten { display: flex; align-items: center; gap: 14px; margin-top: 18px; }
.knopf { display: inline-block; padding: 8px 16px; border-radius: 6px; background: var(--akzent); color: var(--akzent-fg); font-weight: 600; }
.knopf:hover { text-decoration: none; filter: brightness(1.05); }

/* Zwei Spalten: Meldungen + Seitenleiste */
.spalten { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; }
.seite .box { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px 12px; margin-bottom: 14px; }
.seite .box h3 { display: flex; align-items: center; gap: 7px; margin: 0 0 8px; font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--fg); }
.seite .box h3 .ico { color: var(--akzent); }
.seite .box h3 small { font-weight: 400; text-transform: none; letter-spacing: 0; font-size: .76rem; margin-left: auto; }
ul.kompakt { list-style: none; margin: 0; padding: 0; }
ul.kompakt li { padding: 7px 0; border-top: 1px solid var(--line); font-size: .9rem; line-height: 1.35; }
ul.kompakt li:first-child { border-top: 0; }
ul.kompakt li a { color: var(--fg); }
ul.kompakt li a:hover { color: var(--akzent); }
ul.kompakt small { display: block; color: var(--muted); font-size: .78rem; margin-top: 2px; }
ul.kompakt small a { color: var(--akzent); }
.box-link { display: inline-block; margin-top: 8px; font-size: .85rem; font-weight: 600; }
ol.rang-liste { margin: 0; padding: 0 0 0 22px; }
ol.rang-liste li { display: flex; justify-content: space-between; padding: 4px 0; border-top: 1px solid var(--line); font-size: .92rem; }
ol.rang-liste li:first-child { border-top: 0; }
ol.rang-liste b { color: var(--akzent); }
ul.zaehler { list-style: none; margin: 0; padding: 0; }
ul.zaehler li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 5px 0; border-top: 1px solid var(--line); font-size: .9rem; }
ul.zaehler li:first-child { border-top: 0; }
ul.zaehler li a { color: var(--fg); }
ul.zaehler li a:hover { color: var(--akzent); }
ul.zaehler b { min-width: 28px; text-align: center; padding: 0 7px; border-radius: 999px; background: var(--gem-hell); color: var(--gem); font-size: .78rem; line-height: 1.6; }
.erg-gewonnen { color: var(--ok); } .erg-verloren { color: var(--bad); } .erg-teilweise, .erg-unklar { color: var(--mid); }

/* Filter (Listenansicht) */
.filter { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; border-bottom: 1px solid var(--line); padding: 0 0 14px; margin-bottom: 10px; }
.filter label { display: flex; flex-direction: column; font-size: .78rem; color: var(--muted); gap: 3px; }
.filter label.check { flex-direction: row; align-items: center; gap: 6px; color: var(--fg); font-size: .9rem; padding-bottom: 8px; }
.filter select, .filter input { font: inherit; font-size: .95rem; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); min-width: 140px; }
.filter .suche { flex: 1 1 260px; flex-direction: row; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 6px; padding: 0 8px; background: var(--bg); }
.filter .suche .ico { color: var(--muted); }
.filter .suche input { width: 100%; border: 0; background: transparent; padding: 7px 0; outline: none; }
.filter button { font: inherit; padding: 8px 16px; border: 0; border-radius: 6px; background: var(--akzent); color: var(--akzent-fg); cursor: pointer; }
.filter .reset { font-size: .9rem; padding-bottom: 8px; }
.treffer { color: var(--muted); font-size: .9rem; margin: 0 0 8px; }
.leer { background: var(--card); border: 1px dashed var(--line); padding: 20px; border-radius: 8px; }


.badge { display: inline-block; font-size: .74rem; padding: 1px 8px; border-radius: 999px; line-height: 1.5; text-decoration: none; }
.badge.t { background: var(--thema-hell); color: var(--thema); }
.badge:hover { text-decoration: none; filter: brightness(.95); }
.badges { display: flex; flex-wrap: wrap; gap: 4px; }

.seiten { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 16px; }
.seiten a, .seiten span { padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); }
.seiten a.aktiv { background: var(--akzent); color: var(--akzent-fg); border-color: var(--akzent); }

/* Detail */
.pfad { font-size: .85rem; color: var(--muted); margin: 0; }
.detail .meta { color: var(--muted); }
.volltext { white-space: pre-wrap; font-family: inherit; font-size: .9rem; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px; max-height: 70vh; overflow: auto; }
.fundstellen li { margin-bottom: 6px; }
.fakten { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.fakten dt { color: var(--muted); font-size: .85rem; }
.fakten dd { margin: 0; }
.zus-lang { background: var(--akzent-hell); border-radius: 8px; padding: 12px 14px; }

/* Tabellen */
table.stat, table.urteile { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; font-size: .92rem; }
table.stat th, table.stat td, table.urteile th, table.urteile td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.stat th, table.urteile th { background: var(--bg); font-weight: 600; font-size: .82rem; color: var(--muted); }
table.urteile th a.sort-aktiv { color: var(--fg); text-decoration: underline; }
.z { text-align: right !important; }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
td.balken { width: 30%; padding-right: 14px; white-space: nowrap; }
.balken .b { display: inline-block; height: 12px; vertical-align: middle; }
.b.ok { background: var(--ok); } .b.bad { background: var(--bad); } .b.mid { background: var(--mid); } .b.light { background: var(--line); }
.st-ok { color: var(--ok); } .st-fehler { color: var(--bad); } .st-leer { color: var(--mid); } .st-laeuft { color: var(--mid); }
table.urteile td.zus { font-size: .88rem; max-width: 40ch; }
tr.erg-gewonnen .erg { color: var(--ok); font-weight: 600; }
tr.erg-verloren .erg { color: var(--bad); font-weight: 600; }
tr.erg-teilweise .erg { color: var(--mid); font-weight: 600; }
dd.erg-gewonnen { color: var(--ok); } dd.erg-verloren { color: var(--bad); } dd.erg-teilweise { color: var(--mid); }
.rolle-aktiv { color: var(--gem); } .rolle-passiv { color: var(--kat); } .rolle-unklar { color: var(--muted); }
table.stat tfoot td { border-top: 2px solid var(--fg); border-bottom: 0; background: var(--bg); }
.kpi .wert.ok { color: var(--ok); } .kpi .wert.bad { color: var(--bad); }

/* Finanzen */
.kpi-reihe { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 12px 0 18px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.kpi .wert { font-size: 1.35rem; font-weight: 700; }
.kpi .label { color: var(--muted); font-size: .8rem; }
.chart-box { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; }
.chart-box h3 { margin-top: 0; }
table.rang tr.rang-1 td:first-child, table.rang tr.rang-2 td:first-child, table.rang tr.rang-3 td:first-child { font-weight: 700; color: var(--akzent); }

/* Fuß */
.fusszeile { border-top: 2px solid var(--fg); color: var(--muted); font-size: .85rem; padding: 18px 0 30px; margin-top: 20px; }

@media (max-width: 900px) {
  .spalten { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  html { font-size: 15px; }
  .masthead { flex-direction: column; align-items: stretch; gap: 10px; padding-top: 12px; }
  .marke { font-size: 1.7rem; }
  .kopf-suche { flex-basis: auto; }
  .nur-breit { display: none; }
  .nav .wrap { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .nav .wrap::-webkit-scrollbar { display: none; }
  .nav.ressorts a { padding: 8px 9px; font-size: .88rem; }
  .meldung { padding: 16px 0 14px; }
  .meldung h2 { font-size: 1.2rem; }

  .fakten { grid-template-columns: 1fr; }
  table.urteile thead { display: none; }
  table.urteile tr { display: block; border-bottom: 2px solid var(--line); padding: 6px 0; }
  table.urteile td { display: block; border: 0; padding: 2px 10px; }
  td.balken { display: none; }
}

/* Diagramme (SVG, serverseitig) */
:root { --viz-1: #2a78d6; --viz-neg: #e34948; --viz-grid: #dcd9d0; --viz-text: #1d2420; --viz-muted: #5d6660; }
@media (prefers-color-scheme: dark) { :root { --viz-1: #3987e5; --viz-neg: #e66767; --viz-grid: #2e3536; --viz-text: #e6e4dd; --viz-muted: #a2a8a3; } }
.chart { display: block; font-family: inherit; }
.chart .lbl { font-size: 13px; fill: var(--viz-text); }
.chart .lbl.strong { font-weight: 600; }
.chart .val { font-size: 12px; fill: var(--viz-muted); }
.chart .tick { font-size: 10px; fill: var(--viz-muted); }
.chart .grid { stroke: var(--viz-grid); stroke-width: 1; }
.chart .bar.pos { fill: var(--viz-1); }
.chart .bar.neg { fill: var(--viz-neg); }
.chart .row:hover .bar { filter: brightness(1.15); }
.chart .line { fill: none; stroke: var(--viz-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--viz-1); stroke: var(--card); stroke-width: 2; }
.charts-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 14px; margin: 14px 0; }
.multiples { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-bottom: 18px; }
.multiples .mini { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 4px; }
table.rang .balken .b.note { background: var(--viz-1); }
.tabelle-scroll { overflow-x: auto; }
table.kennzahlen { font-size: .84rem; white-space: nowrap; }
.legende { font-size: .85rem; color: var(--muted); display: grid; grid-template-columns: max-content 1fr; gap: 3px 12px; margin-top: 12px; }
.legende dt { font-weight: 600; color: var(--fg); }
.legende dd { margin: 0; }

/* Leseseite */
.lese h1 { font-size: 1.5rem; max-width: 60ch; }
.aktionen-leiste { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }
.aktionen-leiste .knopf { display: inline-flex; align-items: center; gap: 6px; }
.knopf.sekundaer { background: var(--card); color: var(--akzent); border: 1px solid var(--akzent); }
.protokoll-verfahren { margin: 28px 0; }
.fundstellen-liste { list-style: none; margin: 0; padding: 0; }
.fundstellen-liste > li { padding: 12px 0; border-top: 1px solid var(--line); }
.fundstellen-liste > li:first-child { border-top: 0; }
.fundstellen-liste blockquote { margin: 6px 0 0; padding: 8px 14px; border-left: 3px solid var(--akzent); background: var(--card); font-size: .92rem; line-height: 1.5; border-radius: 0 6px 6px 0; }
.fundstellen-box { background: var(--akzent-hell); border-radius: 10px; padding: 10px 16px; margin: 16px 0; }
.fundstellen-box h2 { margin-top: 4px; font-size: 1.05rem; }
.fundstellen-box h3 { margin: 10px 0 4px; font-size: .95rem; }
.fundstellen { margin: 0; padding-left: 20px; font-size: .92rem; }
.pdf-ansicht { margin: 16px 0 8px; }
.pdf-ansicht object { display: block; width: 100%; height: min(80vh, 1100px); min-height: 480px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.pdf-ansicht .hinweis { margin: 6px 0 0; font-size: .8rem; }
.lesetext h2 { margin-top: 28px; font-size: 1.05rem; }
.text-inhalt { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 24px 30px; max-width: 80ch; font-size: 1rem; line-height: 1.6; }
.text-inhalt p { margin: 0 0 .9em; overflow-wrap: anywhere; }
.text-inhalt h3 { margin: 1.4em 0 .5em; font-size: 1.08rem; line-height: 1.3; }
.text-inhalt h3:first-child { margin-top: 0; }
.text-inhalt dl.felder { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 3px 18px; margin: 0 0 1em; padding: 10px 14px; background: var(--bg); border-radius: 8px; font-size: .95rem; }
.text-inhalt dl.felder dt { color: var(--muted); }
.text-inhalt dl.felder dd { margin: 0; overflow-wrap: anywhere; }
.text-inhalt ul.punkte { margin: 0 0 1em; padding-left: 22px; }
.text-inhalt ul.punkte li { margin: 0 0 .3em; }
@media (max-width: 720px) { .pdf-ansicht object { display: none; } .text-inhalt { padding: 14px 16px; } .text-inhalt dl.felder { grid-template-columns: 1fr; gap: 0 } .text-inhalt dl.felder dd { margin-bottom: 6px; } }

/* Sortierbare Tabellen */
th.sortier-kopf { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortier-kopf:hover { color: var(--fg); }
th.sortier-kopf::after { content: " ↕"; opacity: .4; font-size: .8em; }
th.sortier-kopf.sort-auf::after { content: " ▲"; opacity: 1; color: var(--akzent); }
th.sortier-kopf.sort-ab::after { content: " ▼"; opacity: 1; color: var(--akzent); }

/* Fragen & Antworten (Startseite, Über-Seite) */
.faq { margin: 36px 0 12px; }
.faq h2 { font-size: 1.3rem; border-top: 2px solid var(--fg); padding-top: 10px; }
.faq-liste details { border-bottom: 1px solid var(--line); padding: 10px 0; margin: 0; max-width: 90ch; }
.faq-liste summary { cursor: pointer; font-weight: 600; list-style: none; position: relative; padding-right: 24px; }
.faq-liste summary::-webkit-details-marker { display: none; }
.faq-liste summary::after { content: "+"; position: absolute; right: 0; top: 0; color: var(--akzent); font-weight: 700; }
.faq-liste details[open] summary::after { content: "–"; }
.faq-liste details p { margin: 8px 0 2px; line-height: 1.55; color: var(--fg); }

/* Über-Seite */
.ueber h2 { margin-top: 28px; font-size: 1.2rem; }
.ueber ul { max-width: 90ch; line-height: 1.55; }
.gemeinde-liste { list-style: none; padding: 0; }
.gemeinde-liste li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.ueber .fakten { max-width: 100ch; }
