/* urban – Bright (Handy) und Büro (Browser). Keine Fremdschriften, keine Bilder außer icon.svg. */
:root {
  --bg: #f4f6f8; --karte: #ffffff; --text: #1b2733; --leise: #5b6b7a; --linie: #d6dde4;
  --akzent: #15556e; --akzent-text: #ffffff; --akzent-hell: #e1eff4;
  --neu: #b45309; --neu-bg: #fef0d9; --pruefung: #6d28d9; --pruefung-bg: #ede7fb;
  --ok: #166534; --ok-bg: #dcf3e3; --warn: #92400e; --warn-bg: #fdecc8; --rot: #991b1b; --rot-bg: #fbdcdc;
  --grau-bg: #eceff2; --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11181f; --karte: #1a232c; --text: #e8eef3; --leise: #9aabba; --linie: #2f3d4a;
    --akzent: #5ab4d3; --akzent-text: #07222d; --akzent-hell: #1c3340;
    --neu: #f5b25b; --neu-bg: #3b2a10; --pruefung: #c4b0f5; --pruefung-bg: #2c2350;
    --ok: #7ad69a; --ok-bg: #14301f; --warn: #f2c26b; --warn-bg: #38290e; --rot: #f4a1a1; --rot-bg: #3b1818;
    --grau-bg: #222d37;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
h1 { font-size: 1.35rem; margin: 0 0 .5rem; }
h2 { font-size: 1.15rem; margin: 0 0 .5rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
p { margin: .35rem 0; }
a { color: var(--akzent); }
.versteckt { display: none !important; }

/* Kopfleiste */
.leiste { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: .75rem; padding: .6rem 1rem;
  padding-top: calc(.6rem + env(safe-area-inset-top)); background: var(--akzent); color: var(--akzent-text); }
.marke { font-weight: 700; font-size: 1.2rem; color: inherit; text-decoration: none; letter-spacing: .02em; }
.leiste-rest { margin-left: auto; display: flex; align-items: center; gap: .75rem; font-size: .95rem; }
.leiste .knopf-leise { color: inherit; border-color: currentColor; min-height: 40px; }

.inhalt { max-width: 640px; margin: 0 auto; padding: 1rem; padding-bottom: calc(5rem + env(safe-area-inset-bottom)); }
body.rolle-buero .inhalt { max-width: 1280px; }

/* Karten */
.karte { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); padding: 1rem; margin: 0 0 .9rem; }
.karte-mittig { margin-top: 3rem; }
.karte.zustand-neu { border-left: 6px solid var(--neu); }
.karte.zustand-pruefung { border-left: 6px solid var(--pruefung); }
.karte.zustand-erledigt { border-left: 6px solid var(--ok); }
.karte-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.karte-titel { font-weight: 700; font-size: 1.1rem; }
.karte-link { display: block; color: inherit; text-decoration: none; }
.zeile { color: var(--leise); }
.zeile b, .zeile strong { color: var(--text); }
.schluessel { margin-top: .5rem; padding: .5rem .7rem; background: var(--akzent-hell); border-radius: 10px; }
.hinweis { color: var(--leise); }
.fehler { color: var(--rot); background: var(--rot-bg); padding: .6rem .8rem; border-radius: 10px; }
.leer { text-align: center; color: var(--leise); padding: 2rem 1rem; }

/* Kennzeichen */
.marke-klein { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .85rem; font-weight: 700; white-space: nowrap; }
.m-neu { color: var(--neu); background: var(--neu-bg); }
.m-pruefung { color: var(--pruefung); background: var(--pruefung-bg); }
.m-erledigt, .m-gruen { color: var(--ok); background: var(--ok-bg); }
.m-gelb { color: var(--warn); background: var(--warn-bg); }
.m-rot, .m-ueberfaellig { color: var(--rot); background: var(--rot-bg); }
.m-grau { color: var(--leise); background: var(--grau-bg); }

.nachtraege { margin-top: .6rem; border-top: 1px dashed var(--linie); padding-top: .5rem; }
.nachtrag { margin: .35rem 0; padding: .45rem .7rem; background: var(--grau-bg); border-radius: 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.nachtrag .zeit { display: block; font-size: .85rem; color: var(--leise); }

/* Reiter */
.reiter { display: flex; gap: .4rem; margin: 0 0 1rem; overflow-x: auto; }
.reiter button { flex: 1 0 auto; min-height: 48px; padding: .5rem 1rem; border: 1px solid var(--linie); border-radius: 12px;
  background: var(--karte); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.reiter button[aria-selected="true"] { background: var(--akzent); color: var(--akzent-text); border-color: var(--akzent); }

/* Eingaben und Knöpfe */
label { display: block; font-weight: 600; margin: .7rem 0 .25rem; }
input, select, textarea { width: 100%; min-height: 48px; padding: .6rem .75rem; border: 1px solid var(--linie); border-radius: 10px;
  background: var(--karte); color: var(--text); font: inherit; }
textarea { min-height: 96px; resize: vertical; }
.knopf { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: .6rem 1.1rem; border: 0;
  border-radius: 12px; background: var(--akzent); color: var(--akzent-text); font: inherit; font-weight: 700; cursor: pointer;
  text-decoration: none; text-align: center; }
.knopf:disabled, .knopf[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.knopf-breit { display: flex; width: 100%; margin-top: .6rem; }
.knopf-leise { background: transparent; color: var(--akzent); border: 2px solid var(--akzent); }
.knopf-gefahr { background: var(--rot); color: #fff; }
.knopf-klein { min-height: 40px; padding: .3rem .8rem; font-size: .95rem; }
.knopf-reihe { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.knopf-reihe .knopf { flex: 1 1 auto; }
:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: .4rem 0; }
.chip { min-height: 48px; padding: .4rem 1rem; border: 2px solid var(--linie); border-radius: 999px; background: var(--karte);
  color: var(--text); font: inherit; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--akzent); border-color: var(--akzent); color: var(--akzent-text); font-weight: 700; }
.block { border-top: 1px solid var(--linie); margin-top: 1rem; padding-top: .8rem; }
.zeit-link-gross { font-size: 1.25rem; font-weight: 700; margin: .5rem 0 .3rem; }
.zurueck { display: inline-block; margin: 0 0 .8rem; padding: .5rem 0; font-weight: 600; }

.toast { position: fixed; left: 1rem; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto;
  padding: .8rem 1rem; border-radius: 12px; background: var(--text); color: var(--bg); font-weight: 600; z-index: 20; display: none; }
.toast.sichtbar { display: block; }
.toast.fehler-toast { background: var(--rot); color: #fff; }

/* Büro */
.kopfzaehler { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; }
.zaehler { min-width: 120px; padding: .5rem .8rem; background: var(--karte); border: 1px solid var(--linie); border-radius: 12px; text-align: left;
  font: inherit; color: var(--text); }
button.zaehler { cursor: pointer; }
.zaehler .zahl { display: block; font-size: 1.5rem; font-weight: 800; }
.zaehler .name { display: block; font-size: .8rem; color: var(--leise); }
.zaehler.null .zahl { color: var(--leise); font-weight: 600; }
.zaehler.hat-rot .zahl { color: var(--rot); }
.zaehler.hat-gelb .zahl { color: var(--warn); }
.zaehler.hat-neu .zahl { color: var(--neu); }
.filter { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .6rem; align-items: end; margin-bottom: 1rem; }
.filter label { margin: 0 0 .2rem; font-size: .9rem; }
.tabelle-huelle { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--karte); border: 1px solid var(--linie); }
th, td { padding: .5rem .7rem; text-align: left; border-bottom: 1px solid var(--linie); vertical-align: top; font-size: .95rem; }
th { background: var(--grau-bg); font-size: .85rem; color: var(--leise); }
tbody tr.klickbar { cursor: pointer; }
tbody tr.klickbar:hover { background: var(--akzent-hell); }
table.altbestand { color: var(--leise); background: var(--grau-bg); }
.panel { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); padding: 1rem 1.2rem; margin: 0 0 1rem; }
.raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
dl.daten { display: grid; grid-template-columns: max-content 1fr; gap: .2rem 1rem; margin: .4rem 0; }
dl.daten dt { color: var(--leise); }
dl.daten dd { margin: 0; overflow-wrap: anywhere; }
.reihe { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; }
.reihe > * { flex: 1 1 180px; }
.reihe > .knopf { flex: 0 0 auto; }
.link-box { word-break: break-all; font-family: ui-monospace, monospace; }

@media (max-width: 640px) {
  body.rolle-buero .inhalt { padding: .6rem; }
  dl.daten { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: no-preference) {
  .knopf, .chip, .reiter button { transition: background-color .12s; }
}
