/* ImBol Digital – Stylesheet. Ohne Build-Schritt.
   Gestaltung «Hausnummer, ruhig» (November 2026): sachlich und ruhig.
   - Blaue Seitenleiste (Kopfzeile auf dem Handy, Login), Inhalt auf hellgrauer Fläche in weissen Karten
   - Karten mit feinem Rahmen, kleinen Ecken und kaum Schatten; Farbe nur für Knöpfe, Links, aktive Navigation
   - Kleine Labels (Versalien) über Kennzahlen, Zustände als Pillen. Schrift: Inter (lokal, static/fonts/);
     Archivo schmal nur noch für die Zahl im Hausnummernschild
   Farben und Abstände als Variablen in :root – hier zentral anpassen.
   Dunkelmodus: jede Farbe als light-dark(hell, dunkel) in :root, umgeschaltet über color-scheme. */

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin.260c81a4759b.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
/* Nur für das Hausnummernschild (schmale Ziffern wie auf dem Emailschild) */
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-latin.c5a01ed02269.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  /* Farben: light-dark(hell, dunkel). Welche gilt, entscheidet color-scheme (unten) */
  --brand-blue: #1486ae;      /* Logofarbe – Linien, Balken, Schild; nicht für kleinen Text (Kontrast 4.2:1) */
  --accent: #0e6688;          /* Blau für Flächen mit weisser Schrift, Buttons (Kontrast 6.4:1) */
  --accent-dark: #0a4f6a;
  --accent-light: light-dark(#ebf4f8, #16313d);       /* zarte Fläche: Hover, Schnellwahl */
  --chart-light: light-dark(#a9cfdf, #2f5868);       /* Balken «Vorjahr» bzw. «bisher» (Gaszähler) */
  --accent-text: light-dark(#0e6688, #7cc8e6);       /* Links und Text in Akzentfarbe */
  --accent-text-hover: light-dark(#0a4f6a, #a9dcf0);
  --blue-surface: light-dark(#0c4a62, #0b3446);      /* Seitenleiste, Kopfzeile (Handy), Login – tiefes Petrol, ruhiger als das Logo-Blau */
  --on-blue: #fff;                                   /* Schrift, Icons, Linien auf Petrol und Akzent (Seitenleiste, Knöpfe, Schild) */
  --on-blue-muted: rgb(255 255 255 / .7);            /* leise Schrift auf Petrol («Demnächst») */
  --on-blue-hover: rgb(255 255 255 / .12);           /* Hover auf Petrol */
  --on-blue-line: rgb(255 255 255 / .18);            /* Trennlinien und Zahlen-Hintergrund auf Petrol */
  --nav-active: rgb(255 255 255 / .16);              /* aktiver Eintrag in der Seitenleiste: hell hinterlegt */
  --background: light-dark(#e8edef, #101618);             /* Seitenhintergrund: hellgrau, Karten darauf weiss */
  --surface: light-dark(#ffffff, #182125);             /* Karten, Felder, Tab-Leiste */
  --text: light-dark(#1a2226, #e4eaed);
  --text-muted: light-dark(#56646b, #9cadb4);        /* Kontrast ≥ 4.5:1, auch auf der grauen Fläche */
  --line: light-dark(#e2e7ea, #263237);
  --line-strong: light-dark(#c5cfd4, #3e4c52);
  --warning-background: light-dark(#fbefe2, #3b2a18);
  --warning-text: light-dark(#6b330e, #f2c89c);
  --signal: light-dark(#a34e15, #f0a368);            /* «Wichtig» */
  --success: light-dark(#1d6b3a, #79d29b);
  --error: light-dark(#a83a2c, #f19284);
  --error-background: light-dark(#f6e1dd, #3d211d);

  /* Schriftgrössen: nur diese Stufen (Ausnahmen: Schild, Kalenderblatt, Ring, Diagramm) */
  --fs-2xs: .72rem;   /* Labels in Versalien, Zahlen in der Navigation */
  --fs-xs: .8rem;
  --fs-sm: .85rem;
  --fs-md: .9rem;     /* leise Zeilen, Metadaten */
  --fs-ui: .95rem;    /* Knöpfe, Feldnamen, Reiter, Tabellen */
  --fs-base: 1rem;
  --fs-lg: 1.1rem;    /* Abschnittstitel (h2) */
  --fs-xl: 1.25rem;
  --fs-2xl: 1.6rem;   /* Kennzahlen, Titel auf dem Handy */
  --fs-3xl: 1.75rem;  /* Seitentitel */

  /* Form */
  --radius: 10px;
  --radius-small: 8px;
  --radius-card: 12px;
  --shadow: 0 1px 2px rgb(16 24 32 / .05);
  --sidebar: 240px;
  --tabbar: 64px;

  font-size: 16px;  /* 23. November 2026 von 18 auf 16 px: ruhiger und sachlicher, gut lesbar */
}

/* Hell/Dunkel: folgt dem Gerät, ausser der Benutzer hat im Profil etwas gewählt (data-theme in base.html) */
:root { color-scheme: light dark; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
@media print { :root, :root[data-theme="dark"] { color-scheme: light; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }  /* Rückmeldung über :hover/.active */
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "cv11", "ss03";  /* einstöckiges a, ruhigere Formen */
  color: var(--text);
  background: var(--background);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-text); text-underline-offset: .18em; }
a:hover { color: var(--accent-text-hover); }
h1 { font-size: var(--fs-3xl); font-weight: 650; letter-spacing: -.025em; line-height: 1.15; margin: 0 0 1.25rem; }
h2 { font-size: var(--fs-lg); font-weight: 600; letter-spacing: -.011em; margin: 0 0 .75rem; }
h3 { font-size: var(--fs-base); font-weight: 650; }
/* Lange Wörter (Gemeinschaftsraumreservation) trennen statt überlaufen; Zeilen ausgeglichen */
h1, h2, h3 { overflow-wrap: break-word; hyphens: auto; text-wrap: balance; }
.icon { flex-shrink: 0; vertical-align: middle; }
:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 3px; border-radius: 4px; }
/* Sprunglink für die Tastatur: erst beim Fokus sichtbar (base.html) */
.skip-link { position: absolute; left: 1rem; top: -10rem; z-index: 50; padding: .7rem 1.1rem; border-radius: var(--radius-small); background: var(--surface); color: var(--accent-text); font-weight: 650; }
.skip-link:focus { top: calc(1rem + env(safe-area-inset-top)); }

/* ---------- Grundgerüst ---------------------------------------------------- */
.shell { display: flex; min-height: 100vh; }
.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { width: 100%; max-width: 1240px; padding: 2rem 2.5rem 3.5rem; }

/* Seitenleiste: blaue Fläche mit weissem Logo */
.sidebar {
  width: var(--sidebar); flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--blue-surface); color: var(--on-blue);
  padding: 1.4rem .75rem 1rem; display: flex; flex-direction: column; gap: 1.6rem;
}
.sidebar :focus-visible, .topbar :focus-visible, .entrance-brand :focus-visible { outline-color: var(--on-blue); }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 0 .75rem; }
.brand { display: flex; align-items: center; text-decoration: none; }
.brand-logo { display: block; width: 150px; height: auto; }
.brand-signet { display: block; height: 30px; width: auto; filter: brightness(0) invert(1); }  /* weiss auf Blau */
.main-nav { display: flex; flex-direction: column; gap: .9rem; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group-title { font-size: var(--fs-2xs); font-weight: 600; letter-spacing: .07em; text-transform: uppercase; opacity: .7; padding: 0 .75rem .3rem; }
.nav-divider { border-top: 1px solid var(--on-blue-line); padding-top: .9rem; }
.nav-link {
  display: flex; align-items: center; gap: .7rem; min-height: 38px; padding: 0 .75rem;
  border-radius: 7px; color: color-mix(in srgb, var(--on-blue) 88%, transparent); text-decoration: none; font-size: var(--fs-ui); font-weight: 500;
}
a.nav-link:hover { background: var(--on-blue-hover); color: var(--on-blue); }
.nav-link.active, a.nav-link.active:hover { background: var(--nav-active); color: var(--on-blue); font-weight: 600; }
.nav-link .title { flex: 1; min-width: 0; overflow-wrap: break-word; hyphens: auto; }
.nav-link .nav-count { margin: 0 -.35rem 0 -.4rem; }  /* Platz für «Reservationen» mit Zahl, ohne Trennung */
.nav-link.soon { color: var(--on-blue-muted); min-height: 34px; font-weight: 400; }
.nav-upcoming { margin: 0; border-top: 1px solid var(--on-blue-line); padding-top: 1rem; display: flex; flex-direction: column; gap: 2px; }
.nav-upcoming summary {
  display: flex; align-items: center; gap: .5rem; min-height: 40px; margin: 0; padding: 0 .75rem; border-radius: 8px;
  font-size: var(--fs-md); font-weight: 600; color: var(--on-blue); list-style: none; cursor: pointer;
}
.nav-upcoming summary::-webkit-details-marker { display: none; }
.nav-upcoming summary:hover { background: var(--on-blue-hover); }
.nav-upcoming summary small { font-size: var(--fs-2xs); font-weight: 600; border: 1px solid color-mix(in srgb, var(--on-blue) 55%, transparent); border-radius: 99px; padding: 0 .45rem; }
.nav-upcoming summary::after { content: ""; margin-left: auto; width: .45rem; height: .45rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s ease; }
.nav-upcoming[open] summary::after { transform: rotate(45deg); }
/* Module mit Unterbereichen: auf dem Handy im «Mehr»-Menü aufklappbar (_nav_link.html), auf dem Desktop ein Link */
.phone-nav, .module-here { display: none; }
.nav-sub { margin: 0; }
.nav-sub[open] { flex-direction: column; gap: 4px; }  /* «display: flex» nur auf dem Handy (unten), sonst erschiene es auf dem Desktop */
.nav-sub summary { list-style: none; cursor: pointer; }
.nav-sub summary::-webkit-details-marker { display: none; }
.nav-sub summary::after { content: ""; flex-shrink: 0; width: .45rem; height: .45rem; margin: 0 .2rem 0 .1rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s ease; }
.nav-sub[open] summary::after { transform: rotate(45deg); }
.nav-sublink { min-height: 40px; padding-left: 2.9rem; font-size: var(--fs-ui); }
.nav-sublink.active { background: var(--nav-active); color: var(--on-blue); }
@media (prefers-reduced-motion: reduce) { .nav-upcoming summary::after, .nav-sub summary::after, .back .icon { transition: none; } }

/* Konto unten in der Seitenleiste */
.account { margin-top: auto; display: flex; flex-direction: column; gap: 2px; padding-top: .75rem; border-top: 1px solid var(--on-blue-line); }
.account form { margin: 0; }
.account-name { display: flex; align-items: center; gap: .7rem; min-height: 50px; padding: .35rem .75rem; border-radius: 7px; color: var(--on-blue); text-decoration: none; font-weight: 600; line-height: 1.25; }
.account-text { min-width: 0; display: grid; }
.account-text > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-text small { font-weight: 400; font-size: var(--fs-sm); opacity: .9; }
.account-name:hover { background: var(--on-blue-hover); color: var(--on-blue); }
.account-name[aria-current] { background: var(--nav-active); color: var(--on-blue); }
.account-name .sign-small { box-shadow: inset 0 0 0 2px var(--accent), inset 0 0 0 3.5px var(--on-blue); }
button.account-logout { width: 100%; justify-content: flex-start; text-align: left; background: transparent; padding: 0 .75rem; font-weight: 500; }
button.account-logout:hover { background: var(--on-blue-hover); }
/* Zahl in der Navigation: am Kalender, wenn Antworten fehlen; an den Mitteilungen die ungelesenen */
.nav-count { min-width: 1.6em; padding: 0 .4em; border-radius: 99px; font-size: var(--fs-xs); background: var(--on-blue-line); font-weight: 800; font-variant-numeric: tabular-nums; text-align: center; }
.nav-link.active .nav-count { background: color-mix(in srgb, var(--on-blue) 22%, transparent); }
.sidebar .icon-button, .sidebar button.icon-button, .topbar .icon-button, .topbar button.icon-button { color: var(--on-blue); }
.sidebar .icon-button:hover, .sidebar button.icon-button:hover, .topbar button.icon-button:hover { background: var(--on-blue-hover); color: var(--on-blue); }

/* Kopfzeile: nur auf dem Handy (und ohne Navigation, solange die 2FA fehlt) */
.topbar {
  display: none; align-items: center; justify-content: space-between; gap: 1rem; background: var(--blue-surface); color: var(--on-blue);
  /* Als installierte App (viewport-fit=cover): nicht unter Statusleiste/Notch, im Querformat nicht unter die Kamera */
  padding: calc(.55rem + env(safe-area-inset-top)) calc(1.1rem + env(safe-area-inset-right)) .55rem calc(1.1rem + env(safe-area-inset-left));
}
.without-nav .topbar { display: flex; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .35rem; }
.topbar form { margin: 0; }
.profile-link { display: flex; align-items: center; gap: .6rem; min-height: 44px; min-width: 0; color: var(--on-blue); font-weight: 700; text-decoration: none; }
.profile-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 9rem; }
.icon-button {
  width: 44px; height: 44px; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: var(--radius-small); background: transparent; color: var(--text); cursor: pointer;
}
.icon-button:hover { background: var(--accent-light); color: var(--text); }

.mobile-only { display: none !important; }
.phone-only { display: none; }
.tabbar { display: none; }

/* ---------- Hausnummernschild (templates/_sign.html) ---------------------- */
.sign {
  display: inline-grid; justify-items: center; flex-shrink: 0; min-width: 5.4rem; padding: .55rem .9rem .5rem; border-radius: 7px;
  background: var(--brand-blue); color: var(--on-blue); line-height: 1;
  box-shadow: inset 0 0 0 3px var(--brand-blue), inset 0 0 0 5px var(--on-blue);  /* weisse Randlinie wie beim Emailschild */
}
.sign small { font-size: .68rem; font-weight: 600; letter-spacing: .02em; }
.sign strong { font-family: "Archivo", system-ui, sans-serif; font-size: 2.5rem; font-weight: 800; font-stretch: 72%; margin-top: .1rem; }
.sign-small { min-width: 2.6rem; padding: .4rem .7rem .35rem; border-radius: 5px; background: var(--accent); box-shadow: inset 0 0 0 2px var(--accent), inset 0 0 0 3.5px var(--on-blue); }
.sign-small small { display: none; }
.sign-small strong { font-size: 1.4rem; margin: 0; }

/* ---------- Seiteninhalt ---------------------------------------------------- */
.page-head, .card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.page-head { align-items: baseline; margin-bottom: 1.5rem; }  /* Titel steht gleich hoch, ob rechts ein Knopf ist oder nicht */
.page-head h1 { margin: 0; }
.subtitle { margin: .35rem 0 0; color: var(--text-muted); }
.content > h1 + .subtitle { margin: -.85rem 0 1.75rem; }  /* direkt unter dem Seitentitel, mit Abstand zum Inhalt */
.section { margin-top: 2rem; }

/* Zurück-Link oben auf Detail- und Formularseiten (templates/_back.html) */
.back { display: inline-flex; align-items: center; gap: .4rem; min-height: 36px; margin-bottom: .75rem; color: var(--text-muted); font-size: var(--fs-md); font-weight: 500; text-decoration: none; }
.back:hover { color: var(--accent-text); }
.back .icon { transition: transform .15s ease; }
.back:hover .icon { transform: translateX(-3px); }

/* Karte: weisse Fläche mit feinem Rahmen, kleinen Ecken und kaum Schatten */
.card { margin-bottom: 1.5rem; padding: 1.25rem 1.4rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow); }
.card > :last-child { margin-bottom: 0; }
.card > h2:first-child { margin-bottom: .9rem; }
.card-head { margin-bottom: .6rem; }
.card-head h2 { margin: 0; }
.card-head a { font-size: var(--fs-md); font-weight: 500; text-decoration: none; }
.card-head a:hover { text-decoration: underline; }
.card-head + :not(.item):not(.event):not(ul) { margin-top: .9rem; }
/* Letzte Zeile einer Liste in der Karte ohne Linie – der Rahmen schliesst ab */
.card > .item:last-child, .card > .event:last-child, .card > .comment:last-of-type, .card .cw-list li:last-child,
.card > .residents-list li:last-child, .card .room-log li:last-child { border-bottom: 0; }
.card .people thead th { background: var(--surface); }
/* Kleines Label in Versalien (über Kennzahlen, als Vorspann) */
.label { display: block; margin: 0 0 .35rem; font-size: var(--fs-2xs); font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--text-muted); }
/* Pille für Zustände: Neu, Wichtig, Erledigt … */
.pill { display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .55rem; border-radius: 99px; font-size: var(--fs-2xs); font-weight: 600; line-height: 1.5; white-space: nowrap; background: var(--accent-light); color: var(--accent-text); vertical-align: middle; }
.pill-signal { background: var(--warning-background); color: var(--warning-text); }
.pill-success { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }
.pill-muted { background: color-mix(in srgb, var(--text-muted) 12%, transparent); color: var(--text-muted); }
.pills { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 .5rem; }
/* Alle Seiten gleich breit (Entscheid Roger 23.11.2026); in Formularen bleiben nur die Felder lesbar schmal */
:is(form.card, .card form, .content > form):not(.task-quick):not(.decision-quick):not(.project-filters):not(.search-row):not(.owner-form) > :not(.actions):not(button) { max-width: 46rem; }
.details-list { margin: 0 0 1rem; padding-left: 1.1rem; }

/* Sätze «das betrifft dich» (Startseite im Schild, Vorstands-Übersicht auf Weiss) */
.concerns { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; font-size: var(--fs-base); line-height: 1.4; }
.concerns li { border-bottom: 1px solid var(--line); }
.concerns li:last-child { border-bottom: 0; }
.concerns a { display: flex; align-items: center; gap: .75rem; padding: .7rem 0; color: var(--text); text-decoration: none; text-wrap: pretty; }
.concerns a .icon { margin-left: auto; color: var(--text-muted); }
.concerns a:hover { color: var(--accent-text); }
.concerns a:hover .icon { color: var(--accent-text); }
.concerns-calm { margin: 0; color: var(--text-muted); }

/* ---------- Startseite: Kennzahlen und Karten ------------------------------ */
.dash-head { align-items: center; }
.dash-greeting { display: flex; align-items: center; gap: 1rem; }
.dash-greeting h1 { margin: 0; }
.dash-greeting .subtitle { margin: .15rem 0 0; }
/* Kennzahlen: Label, grosse Zahl, leise Zeile darunter */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat { display: block; margin: 0; padding: 1rem 1.2rem; color: var(--text); text-decoration: none; }
a.stat:hover { border-color: var(--line-strong); color: var(--text); }
.stat strong { display: block; font-size: var(--fs-2xl); font-weight: 650; letter-spacing: -.025em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat strong small { font-size: var(--fs-base); font-weight: 600; color: var(--text-muted); }
.stat > small { display: block; margin-top: .2rem; color: var(--text-muted); font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-alert strong { color: var(--signal); }
.dash-grid { display: grid; gap: 0 1.5rem; align-items: start; }
@media (min-width: 1100px) { .dash-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }
/* Wichtige Mitteilung: Balken links in der Signalfarbe */
.card-important { border-left: 4px solid var(--signal); border-color: color-mix(in srgb, var(--signal) 28%, var(--line)); border-left-color: var(--signal); background: color-mix(in srgb, var(--signal) 7%, var(--surface)); }
/* Startseite: wichtige Mitteilung als Banner über den Kennzahlen */
.notice-banner { display: flex; align-items: center; gap: .75rem 1.5rem; }
.notice-banner-text { flex: 1; min-width: 0; }
.notice-banner-head { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; margin: 0 0 .35rem; font-size: var(--fs-xl); font-weight: 650; line-height: 1.3; }
.notice-banner-head a { color: var(--text); text-decoration: none; }
.notice-banner-head a:hover { color: var(--accent-text); }
.notice-banner .excerpt-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; margin-bottom: .3rem; }
.notice-banner .meta { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; margin: 0; }
.notice-banner-link { display: inline-flex; align-items: center; gap: .3rem; flex: none; color: var(--accent-text); font-weight: 650; text-decoration: none; white-space: nowrap; }
.notice-banner-link:hover { text-decoration: underline; }
@media (max-width: 860px) { .notice-banner { flex-direction: column; align-items: flex-start; } }
.card-important h2 { font-size: var(--fs-xl); line-height: 1.25; margin-bottom: .4rem; }
.card-important h2 a, .notice-card h2 a, .news h3 a { color: var(--text); text-decoration: none; }
.card-important h2 a:hover, .notice-card h2 a:hover, .news h3 a:hover { color: var(--accent-text); }
.next-label { margin-top: 0; }
.dash-next { padding-bottom: .4rem; margin-bottom: .4rem; border-bottom: 1px solid var(--line); }
.dash-next .event { border-bottom: 0; }
.card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; margin: 1rem 0 0; }
.excerpt-text { margin: 0 0 .5rem; color: var(--text); }
/* Mitteilungen auf der Startseite: kurze Einträge untereinander */
.news { padding: .85rem 0; border-bottom: 1px solid var(--line); }
.news:first-of-type { padding-top: .2rem; }
.news:last-of-type { border-bottom: 0; padding-bottom: 0; }
.news h3 { margin: 0 0 .25rem; font-size: var(--fs-base); font-weight: 650; line-height: 1.35; }
.news p { margin: 0; }

/* ---------- Mitteilungen: die jüngsten als Karten, ältere als Liste ---------- */
.notice-grid { display: grid; gap: 1rem; margin-bottom: 1.5rem; }
@media (min-width: 861px) { .notice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.notice-card { display: flex; flex-direction: column; margin: 0; }
.notice-card h2 { font-size: var(--fs-lg); line-height: 1.3; margin: 0 0 .4rem; }
.notice-card .card-actions { margin-top: auto; padding-top: .75rem; }
.notice-card.card-important h2 { font-size: var(--fs-xl); }
.notice-empty { color: var(--text-muted); }
.poster h1 { font-size: var(--fs-2xl); margin-bottom: .3rem; }
.poster .text { margin-top: 1.1rem; }
.in-calendar { display: flex; align-items: center; gap: .4rem; margin: .75rem 0 .25rem; color: var(--text-muted); font-size: var(--fs-md); font-weight: 500; }
.bar { height: 12px; border-radius: 99px; background: var(--accent-light); overflow: hidden; }
.bar span { display: block; height: 100%; min-width: 12px; border-radius: 99px; background: var(--brand-blue); }
.bar-text { margin: .6rem 0 0; color: var(--text-muted); }
.bar-text strong { color: var(--text); font-weight: 700; }
/* Gemeinsam: was die ganze Siedlung geleistet hat (frondienst/_siedlung.html) */
.shared { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.shared-title { margin: 0 0 .55rem; font-weight: 650; }
.bar-thin { height: 6px; }
.bar-thin span { min-width: 6px; background: var(--accent-text); }

/* Hinweise */
.notice-bar { display: flex; gap: .8rem; align-items: center; padding: .8rem 1rem; border: 1px solid color-mix(in srgb, var(--signal) 25%, transparent); margin-bottom: 1.5rem; border-radius: var(--radius-small); background: var(--warning-background); color: var(--warning-text); text-decoration: none; }
.notice-bar strong { font-weight: 700; }
.hint-error { background: var(--error-background); color: var(--error); }
.meta-inline { font-size: var(--fs-md); color: var(--text-muted); }
.meta { display: block; color: var(--text-muted); font-size: var(--fs-md); margin-top: .15rem; }

/* Listenzeilen (Mitteilungen) */
.item { display: block; padding: .75rem 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--text); }
.item strong { display: block; font-size: var(--fs-base); font-weight: 600; overflow-wrap: break-word; hyphens: auto; }
.item small { display: block; color: var(--text-muted); font-size: var(--fs-md); }
.item small b { color: var(--signal); font-weight: 700; }
.unread { color: var(--accent-text); font-weight: 600; }  /* Mitteilung noch nicht geöffnet (in Listen als Text, sonst .pill) */
.item:hover strong, .event-link:hover .event-title { color: var(--accent-text); }
.empty { color: var(--text-muted); margin: 1rem 0 0; }
.comment { padding: .9rem 0; border-bottom: 1px solid var(--line); }
.comment + form, .comment ~ form { margin-top: 1.5rem; }
/* Projektliste als Tabelle (.people): Verantwortliche leise unter dem Titel, Hinweise in Signalfarbe */
.content > form.project-filters { flex-wrap: wrap; max-width: none; }
.people.projects-table th { overflow-wrap: break-word; }  /* Titel nicht mitten im Wort trennen */
.search-row.project-filters input { flex: 1 1 12rem; }
.project-filters select { flex: 0 0 auto; width: auto; }
.people.projects-table .projects-stage { color: var(--text); overflow-wrap: normal; white-space: nowrap; }
.projects-more { margin-top: 1rem; }
/* Projekte & Pendenzen: Handy und mittel untereinander (Pendenzen zuerst), breit nebeneinander (Projekte links) */
/* Schnellwahl: links «Alle | Meine», rechts der Stand – eine gemeinsame Linie */
.projects-switch { display: flex; flex-wrap: wrap; justify-content: space-between; column-gap: 2.5rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.projects-switch .tabs { margin-bottom: 0; border-bottom: 0; }
.projects-columns { display: grid; gap: 0 3rem; align-items: start; }
.task-group { margin: 1.25rem 0 .25rem; font-size: var(--fs-ui); font-weight: 650; color: var(--text-muted); }
.task-group.overdue { color: var(--signal); }
.projects-tasks { order: -1; }
@media (min-width: 1280px) {
  .projects-columns { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  .projects-tasks { order: 0; }
}
@media (max-width: 860px) {
  .search-row.project-filters input { flex-basis: 100%; }
  /* Handy: Titel, darunter «Laufend, 15.11.2026», darunter der nächste Schritt */
  .people.projects-table tbody tr { display: flex; flex-wrap: wrap; }
  .people.projects-table tbody th { flex-basis: 100%; margin-bottom: .2rem; }
  .people.projects-table td { display: inline; font-size: var(--fs-md); }
  .people.projects-table td.people-date::before { content: ", "; }
  .people.projects-table td.projects-next { order: 1; flex-basis: 100%; margin-top: .15rem; }
  .people.projects-table td.projects-next:empty { display: none; }
}
/* Projekt: Dokumente (Zeilen wie im Modul Dokumente); Auswahl beim Verknüpfen = ganze Zeile als Knopf */
.card-links { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; }
.icon-link { display: inline-flex; align-items: center; gap: .25rem; }  /* Textlink mit Strich-Icon, z. B. «+ Hochladen» */
button.doc-pick { width: 100%; margin: 0; justify-content: flex-start; border-radius: 0; background: none; color: var(--text); font-weight: 400; text-align: left; }
button.doc-pick:hover { background: var(--accent-light); color: var(--text); }
.doc-pick strong { font-weight: 650; }
.doc-pick small, #documents .doc-row small { margin-left: auto; color: var(--text-muted); font-size: var(--fs-sm); white-space: nowrap; }
/* Verlauf als Zeitleiste: Notizen normal, automatische Zeilen (Standwechsel) klein und leise */
.timeline { list-style: none; margin: 1.5rem 0 0; padding: 0 0 0 1.1rem; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: .55rem 0 .9rem; }
.timeline li::before { content: ""; position: absolute; left: calc(-1.1rem - 6px); top: 1rem; width: 10px; height: 10px; border-radius: 50%; background: var(--brand-blue); }
.timeline .timeline-auto { padding: .2rem 0 .6rem; font-size: var(--fs-md); color: var(--text-muted); }
.timeline .timeline-auto::before { top: .6rem; left: calc(-1.1rem - 4px); width: 6px; height: 6px; background: var(--line-strong); }
/* Antworten eingerückt unter der Notiz (eine Ebene), ohne eigenen Punkt; «Antworten» und «Bearbeiten» leise */
.timeline .replies { list-style: none; margin: .75rem 0 0; padding: 0 0 0 1rem; border-left: 2px solid var(--line); }
.timeline .replies li { padding: .35rem 0 .6rem; }
.timeline .replies li::before { display: none; }
.note-action { margin-left: .75rem; font-size: var(--fs-md); }
.reply-form { margin-top: .5rem; }
.reply-form summary { cursor: pointer; font-size: var(--fs-md); color: var(--accent-text); }
.reply-form form { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; margin-top: .5rem; }
.reply-form textarea { width: 100%; }
.note-edit { margin: .25rem 0; }
/* Vorstand: Titel mit Hinweis daneben; feste Höhe (wie mit Knopf), damit die Reiter beim Wechseln nicht springen */
.board-head { align-items: center; min-height: 3.25rem; }
.board-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 1.25rem; }
.board-title h1, .board-title .subtitle { margin: 0; }
/* Schmal: Knopf und Hinweis rutschen unter die Reiter, sonst schieben sie sie je nach Seite nach unten */
@media (max-width: 860px) {
  .board-top { display: flex; flex-direction: column; }
  .board-head, .board-title { display: contents; }
  .board-title h1 { order: 1; margin-bottom: 1.25rem; }
  .board-top .tabs, .board-top .module-here { order: 2; }
  .board-title .subtitle { order: 3; margin-bottom: 1.75rem; }
  .board-head .button { order: 3; align-self: flex-start; margin-bottom: 1.75rem; }
  .board-head .actions { order: 3; flex-direction: row; margin: 0 0 1.75rem; }
  .board-head .actions .button { margin-bottom: 0; }
}
/* Vorstand: Sätze «das steht an» direkt unter den Reitern, darunter die Abschnitte */
.board-due { margin: 0 0 1.5rem; }
.item .excerpt { display: block; margin-top: .3rem; }
/* Pendenz: überfällig in Signalfarbe (Detail), erledigt leise (Liste) */
.done-tasks { margin-top: 1rem; }
/* Projekt: Stand als Auswahl in den Angaben, Pendenz in einer Zeile erfassen, Fazit über der Beschreibung */
.status-form { display: inline-flex; gap: .5rem; margin: 0; }
.status-form select { width: auto; padding-top: .25rem; padding-bottom: .25rem; }
.card form.task-quick { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; max-width: none; }
.task-quick input[type="text"] { flex: 1 1 14rem; min-width: 0; }
.task-quick select, .task-quick input[type="date"] { flex: 0 0 auto; width: auto; }
.conclusion { margin: 1.5rem 0; padding-left: 1rem; border-left: 3px solid var(--brand-blue); }
.conclusion h2 { margin: 0 0 .5rem; font-size: var(--fs-lg); }
/* Sitzungen: Traktanden nummeriert, im Formular eine Zeile pro Traktandum; Beschluss direkt an der Sitzung */
.agenda { margin: 0; padding-left: 1.5rem; }
.agenda li { padding: .35rem 0; }
.agenda .meta-inline { margin-left: .5rem; }
.agenda-items { border: 0; padding: 0; margin: 1.5rem 0; }
.agenda-items legend { font-weight: 650; margin-bottom: .5rem; padding: 0; }
.agenda-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.agenda-row input[type="text"] { flex: 1 1 14rem; min-width: 0; }
.agenda-row select { flex: 0 1 14rem; width: auto; }
.agenda-number { width: 1.5rem; color: var(--text-muted); }
.agenda-delete { display: inline-flex; gap: .3rem; align-items: center; font-size: var(--fs-md); color: var(--text-muted); }
.agenda-row .errorlist { flex-basis: 100%; }
/* Beiträge: Positionen der Rechnung, «Bezahlt» direkt in der Liste */
.fee-line-row input[type="number"] { flex: 0 0 8rem; width: 8rem; }
.fee-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: 1rem; }
.fee-actions form { margin: 0; }
.fee-paid { display: flex; gap: .4rem; align-items: center; margin: 0; }
.fee-paid input[type="date"] { width: auto; }
.people.rows-link td form { position: relative; z-index: 1; }
.fee-lines tfoot th, .fee-lines tfoot td { border-top: 2px solid var(--line-strong); }
.card form.decision-quick { display: flex; flex-direction: column; gap: .5rem; margin-top: 1.25rem; max-width: none; }
.decision-quick-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.decision-quick-row select { flex: 0 1 18rem; width: auto; }
.decision-text { font-size: var(--fs-lg); }
.people.decisions-table th { overflow-wrap: break-word; font-weight: 500; }
/* Anliegen des Haushalts: frische Antwort in Akzentfarbe, Stand darf umbrechen */
.people .accent { color: var(--accent-text); font-weight: 650; }
.household-concerns td:last-child { min-width: 10rem; }
.concerns-intro { margin-bottom: 2rem; }
/* Handy: unter dem Titel eine Zeile «Anna, 22.11.2026, Eingegangen» */
@media (max-width: 860px) {
  .people.household-concerns tbody tr { display: flex; flex-wrap: wrap; }
  .people.household-concerns tbody th { flex-basis: 100%; margin-bottom: .2rem; }
  .people.household-concerns td { display: inline; font-size: var(--fs-md); }
  .people.household-concerns td + td::before { content: ", "; color: var(--text-muted); font-weight: 400; }
}
/* Tabellen in mehreren Abschnitten (Anliegen: Neu/In Arbeit/Erledigt, Sitzungen: Kommende/Vergangene):
   feste Spaltenbreiten, damit die Spalten über die Abschnitte untereinander stehen. Handy: Zeilenblöcke wie immer. */
@media (min-width: 861px) {
  .people.concerns-table, .people.meetings-table { table-layout: fixed; }
  .people.concerns-table th, .people.meetings-table th { overflow-wrap: break-word; }
  .concerns-table thead th:nth-child(2) { width: 9.5rem; }
  .concerns-table thead th:nth-child(3) { width: 11rem; }
  .concerns-table thead th:nth-child(4) { width: 10rem; }
  .concerns-table thead th:nth-child(5) { width: 8rem; }
  .meetings-table thead th:nth-child(1) { width: 14rem; }
  .meetings-table thead th:nth-child(3), .meetings-table thead th:nth-child(4) { width: 7.5rem; }
  .meetings-table thead th:nth-child(5) { width: 8rem; }
}
.done-tasks summary { cursor: pointer; color: var(--text-muted); }
.overdue { color: var(--signal); }
.item.done strong { color: var(--text-muted); font-weight: 500; }
/* Dokumente: Ordnerbaum links, Inhalt des gewählten Ordners rechts (schmal: untereinander) */
.doc-columns { display: grid; gap: 2rem 2.5rem; align-items: start; }
/* Ordnerbaum und Inhalt zusammen in einer Karte, getrennt durch eine feine Linie */
.doc-columns { padding: 1.1rem 1.4rem 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow); }
@media (min-width: 861px) {
  .doc-columns { grid-template-columns: 16.5rem minmax(0, 1fr); gap: 0; padding-left: .75rem; }
  .doc-tree-column { align-self: stretch; padding-right: .75rem; margin-right: 1.5rem; border-right: 1px solid var(--line); }
}
@media (max-width: 860px) { .doc-columns { padding: .9rem 1rem 1rem; } }
/* Schmal (Handy): ohne Baum – man geht Ordner für Ordner hinein, der Pfad oben führt zurück */
@media (max-width: 860px) {
  .doc-tree-column { display: none; }
  .doc-row { flex-wrap: wrap; row-gap: .1rem; padding: .7rem 0; }
  .doc-row small { flex-basis: 100%; padding-left: calc(32px + .7rem); }
  .doc-row.doc-folder { flex-wrap: nowrap; }
  .doc-row.doc-folder small { flex-basis: auto; padding-left: 0; }
}
.doc-tree, .doc-tree ul { list-style: none; margin: 0; padding: 0; }
.doc-tree ul { padding-left: 1rem; }
.doc-tree a { display: flex; align-items: center; gap: .45rem; min-height: 2.15rem; padding: 0 .5rem; border-radius: 6px; color: var(--text); text-decoration: none; font-size: var(--fs-ui); }
.doc-tree a:hover, .doc-tree a.active { background: var(--accent-light); }
.doc-tree a.active { font-weight: 700; }
.doc-tree .arrow { flex-shrink: 0; width: .4rem; height: .4rem; margin-right: .2rem; border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted); transform: rotate(-45deg); }
.doc-tree .open > a .arrow { transform: rotate(45deg) translate(-1px, -1px); }
.doc-tree .arrow.without { border-color: transparent; }
.doc-tree small { margin-left: auto; color: var(--text-muted); font-size: var(--fs-xs); font-weight: 400; }
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: .9rem; }
.doc-head .subtitle { margin: .2rem 0 0; font-size: var(--fs-md); }
.doc-path { margin: 0; min-height: 2.4rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0 .35rem; color: var(--text-muted); }
.doc-path a { color: inherit; }
.doc-path [aria-current] { color: var(--text); font-weight: 600; }
/* Werkzeuge in Dokumente als kleine Icons (Entscheid Roger); Bedeutung über title/aria-label */
.doc-tools { display: flex; gap: .25rem; margin: 0; }
.doc-tools a { display: inline-flex; align-items: center; justify-content: center; width: 2.2rem; height: 2.2rem; border-radius: 8px; color: var(--text-muted); }
.doc-tools a:hover { background: var(--accent-light); color: var(--text); }
.doc-tools a.main { color: var(--accent-text); }
.doc-row { display: flex; align-items: center; gap: .7rem; padding: .55rem 0; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.doc-row:first-of-type { border-top: 1px solid var(--line); }
.doc-row .icon { flex-shrink: 0; width: 32px; color: var(--text-muted); }
/* Datei-Icons nach Art (templatetag datei_icon): Farbe wie von den Programmen gewohnt */
:root {
  --file-pdf: light-dark(#b3261e, #f2857d);
  --file-doc: light-dark(#1d5fb4, #8ab4f0);
  --file-xls: light-dark(#1b7a43, #7fd0a0);
  --file-ppt: light-dark(#b8510d, #f0a36b);
}
.doc-row .file-pdf { color: var(--file-pdf); }
.doc-row .file-doc { color: var(--file-doc); }
.doc-row .file-xls { color: var(--file-xls); }
.doc-row .file-ppt { color: var(--file-ppt); }
.doc-row strong { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.doc-row small { flex-shrink: 0; color: var(--text-muted); font-size: var(--fs-sm); }
.doc-recent-title { margin: 2rem 0 .3rem; font-size: var(--fs-sm); font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--text-muted); }
.doc-recent .doc-row:last-child { border-bottom: 0; }
.doc-row:hover strong { text-decoration: underline; text-decoration-color: var(--brand-blue); text-decoration-thickness: 2px; text-underline-offset: .18em; }
/* Dokumente: Kopf mit Suche rechts, Liste in Spalten (Name, Art, Grösse, Geändert) – schmal zweizeilig */
.doc-page-head .search-row { margin: 0; flex: 0 1 24rem; }
.doc-page-head .search-row input { width: 100%; }
.doc-list .doc-row, .doc-column-head { display: grid; grid-template-columns: 32px minmax(0, 1fr) 5rem 6.5rem 5.5rem; column-gap: 1rem; align-items: center; }
.doc-list .doc-row > span { color: var(--text-muted); font-size: var(--fs-sm); }
.doc-list .doc-size { text-align: right; font-variant-numeric: tabular-nums; }
.doc-hint { color: var(--text-muted); font-size: var(--fs-sm); font-weight: 400; }
.doc-column-head { padding: 0 0 .4rem; border-bottom: 1px solid var(--line-strong); font-size: var(--fs-2xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.doc-column-head.with-delete { padding-right: 2.8rem; }
.doc-column-head a { color: var(--text-muted); text-decoration: none; }
.doc-column-head a:nth-of-type(3) { text-align: right; }
.doc-column-head a:hover, .doc-column-head a.active { color: var(--text); }
.doc-column-head a.active { font-weight: 600; }
.doc-column-head + .doc-list .doc-item:first-of-type .doc-row { border-top: 0; }
.doc-hits-title { margin: 0 0 .5rem; color: var(--text-muted); font-size: var(--fs-md); }
.doc-elsewhere { margin: 1rem 0 0; font-size: var(--fs-md); }
@media (max-width: 860px) {
  .doc-page-head .search-row { flex-basis: 100%; }
  .doc-page-head.in-folder h1 { display: none; }  /* im Ordner genügt der Pfad */
  .doc-column-head { display: none; }
  .doc-list .doc-row { grid-template-columns: 32px auto auto 1fr; column-gap: .6rem; row-gap: .1rem; }
  .doc-list .doc-row .icon { grid-row: 1 / 3; }
  .doc-list .doc-row strong { grid-column: 2 / -1; }
  .doc-list .doc-folder .doc-kind { display: none; }
  .doc-list .doc-size { text-align: left; }
}
/* Drag & Drop (static/js/documents.js): Ordnerinhalt als Ablage, beim Ziehen blau umrandet */
.doc-content[data-drop] { border-radius: 8px; }
.doc-content.drop-active { outline: 2px dashed var(--brand-blue); outline-offset: .6rem; }
.doc-drop-hint { margin: 1rem 0 0; color: var(--text-muted); font-size: var(--fs-sm); }
@media (hover: none) { .doc-drop-hint { display: none; } }
.doc-drop-status p { margin: .5rem 0 0; font-size: var(--fs-md); }
.doc-drop-status p.error { color: var(--error); }
.doc-drop-status button { margin-top: .75rem; }
/* Papierkorb in der Ordnerliste (nur Vorstand); mit Maus erst beim Überfahren der Zeile sichtbar */
.doc-item { position: relative; }
.doc-item .doc-row { border-top: 0; }
.doc-item:first-of-type .doc-row { border-top: 1px solid var(--line); }
.doc-item:has(.doc-delete) .doc-row, .doc-list.with-delete .doc-row { padding-right: 2.8rem; }  /* Spalten bleiben bündig */
.doc-delete { position: absolute; right: 0; top: 50%; translate: 0 -50%; margin: 0; }
.doc-delete button { width: 2.3rem; height: 2.3rem; padding: 0; justify-content: center; color: var(--text-muted); }
.doc-delete button:hover { color: var(--error); }
@media (hover: hover) {
  .doc-delete button { opacity: 0; }
  .doc-item:hover .doc-delete button, .doc-delete button:focus-visible { opacity: 1; }
}
/* Dokument-Seite: oben über die ganze Breite Titel, Knöpfe, Angaben; darunter die Vorschau.
   Breit das PDF im iframe, schmal die Seiten als Bilder (Browser auf dem Handy zeigen eingebettete PDFs schlecht) */
/* Dokument-Seite als eine Karte; die Fassungen darin ohne eigenen Rahmen (keine Karte in der Karte) */
.doc-detail { padding: 1.25rem 1.4rem 1.4rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow); }
.doc-detail .card { margin: 1.5rem 0 0; padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none; }
.doc-detail .doc-preview-pdf { min-height: 28rem; }
@media (max-width: 860px) { .doc-detail { padding: 1rem; } }
.doc-detail-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1rem 2rem; margin-bottom: 1rem; }
.doc-title-row { display: flex; align-items: flex-start; gap: .8rem; min-width: 0; flex: 1 1 20rem; }
.doc-title-row .icon { flex-shrink: 0; margin-top: .15rem; color: var(--text-muted); }
.doc-title-row .file-pdf { color: var(--file-pdf); }
.doc-title-row .file-doc { color: var(--file-doc); }
.doc-title-row .file-xls { color: var(--file-xls); }
.doc-title-row .file-ppt { color: var(--file-ppt); }
.doc-title-row h1 { margin: 0; overflow-wrap: anywhere; }
.doc-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.doc-buttons .doc-tools { display: inline-flex; gap: .15rem; margin: 0 0 0 .25rem; }
.doc-tools button.icon-button { width: 2.4rem; height: 2.4rem; padding: 0; border-radius: 8px; color: var(--text-muted); }
.doc-tools button.danger:hover { color: var(--error); }
.doc-details { display: flex; flex-wrap: wrap; gap: .3rem 2.25rem; margin: 0 0 1rem; font-size: var(--fs-ui); }
.doc-details div { display: flex; gap: .5rem; }
.doc-details dt { color: var(--text-muted); }
.doc-details dd { margin: 0; }
.doc-description { margin-bottom: 1rem; }
.doc-description p:first-child { margin-top: 0; }
.doc-versions { margin: 1.5rem 0 0; }
.doc-versions .doc-row small { flex-shrink: 1; }
.doc-versions .doc-item:first-of-type .doc-row { border-top: 0; }  /* die Überschrift hat schon ihre Linie */
.doc-preview { display: block; width: 100%; margin-top: 1.5rem; border-radius: 10px; background: var(--accent-light); }
.doc-preview-pdf { height: calc(100dvh - 4rem); min-height: 32rem; border: 0; box-shadow: 0 0 0 1px var(--line); }
.doc-pages { display: none; padding: .6rem; }
.doc-pages a { display: block; }
.doc-pages img { display: block; width: 100%; height: auto; margin-bottom: .6rem; border-radius: 3px; background: #fff; box-shadow: 0 1px 4px rgb(0 0 0 / .15); }
.doc-pages .empty { margin: .4rem .2rem .2rem; font-size: var(--fs-md); }
.doc-preview-image { padding: 1rem; text-align: center; }
.doc-preview-image img { max-width: 100%; height: auto; max-height: calc(100dvh - 6rem); object-fit: contain; border-radius: 4px; }
@media (max-width: 860px) {
  .doc-preview-pdf { display: none; }
  .doc-pages { display: block; }
  .doc-buttons { width: 100%; }
  .doc-buttons > .button { flex: 1 1 9rem; }
  .doc-preview-image { padding: .5rem; }
}
/* Live-Suche: Treffer ersetzen den Ordnerinhalt; Suchwort markiert, darunter ein Ausschnitt als Vorschau */
:root { --highlighted: light-dark(#fde9a6, #5a4a14); }
.doc-content:has(#doc-hits > *) .doc-folder-content { display: none; }
.doc-row.with-excerpt { flex-wrap: wrap; row-gap: .15rem; }
.doc-excerpt { flex-basis: 100%; padding-left: calc(32px + .7rem); color: var(--text-muted); font-size: var(--fs-md); line-height: 1.45; }
.doc-row mark { background: var(--highlighted); color: inherit; border-radius: 2px; padding: 0 .1em; }
/* Suchfeld über einer Liste (Firmen & Kontakte) */
.search-row { display: flex; gap: .75rem; margin-bottom: 1.5rem; }
/* Beiträge (Vorstand): Ansätze als Kacheln im Kopf des Laufs (wie .stat, aber ohne eigene Karte) */
.fee-rates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.35fr); gap: .75rem; margin: 1rem 0; }
@media (max-width: 900px) {  /* schmal: je Ansatz eine Zeile – Name und Hinweis links, Betrag rechts; Konto darunter */
  .fee-rates { grid-template-columns: 1fr; gap: .5rem; }
  .fee-rate:not(.fee-account) { display: grid; grid-template-columns: 1fr auto; column-gap: 1rem; align-items: baseline; padding: .6rem .9rem; }
  .fee-rate:not(.fee-account) strong { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .fee-rate:not(.fee-account) .label, .fee-rate:not(.fee-account) > small { grid-column: 1; margin: 0; }
}
.fee-rate { padding: .8rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--background); }
.fee-rate .label { margin-bottom: .25rem; }
.fee-rate strong { display: block; font-size: var(--fs-xl); font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.fee-rate strong small { font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); }
.fee-rate > small { display: block; margin-top: .15rem; color: var(--text-muted); font-size: var(--fs-sm); line-height: 1.4; }
.fee-iban { display: block; font-weight: 600; font-variant-numeric: tabular-nums; }  /* bricht nur an den Leerzeichen */
/* Beiträge (Vorstand): Reiter «Alle | Offen | Bezahlt» und Live-Suche in einer Zeile über der Tabelle */
.fee-list-head, .list-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin-bottom: 1rem; }
.fee-list-head .tabs, .list-head .tabs { margin: 0; }
.fee-search, .list-head .search-row { flex: 0 1 22rem; margin: 0; }
@media (max-width: 700px) { .fee-search, .list-head .search-row { flex-basis: 100%; } }
.search-row input { flex: 1; min-width: 0; }
.pager { display: flex; gap: 1rem; justify-content: center; align-items: center; margin-top: 1.5rem; }
.text { line-height: 1.6; max-width: 40em; }

/* ---------- Kalender -------------------------------------------------------- */
/* Umschalter als Reiter mit Linie */
.tabs { display: flex; max-width: 100%; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; gap: 1.5rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.tabs::-webkit-scrollbar { display: none; }
/* Reiter breiter als der Platz: Rand blendet aus, wo es weitergeht (nur wenn der Browser scroll-gesteuerte Animationen kennt) */
@property --fade-start { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --fade-end { syntax: "<length>"; inherits: false; initial-value: 0px; }
@supports (animation-timeline: scroll()) {
  .tabs {
    mask-image: linear-gradient(to right, transparent, #000 var(--fade-start), #000 calc(100% - var(--fade-end)), transparent);  /* Maske: nur Deckkraft, keine Farbe */
    animation: tabs-fade linear both; animation-timeline: scroll(self inline);
  }
  @keyframes tabs-fade { 0% { --fade-start: 0px; --fade-end: 2.5rem; } 10% { --fade-start: 2.5rem; } 90% { --fade-end: 2.5rem; } 100% { --fade-start: 2.5rem; --fade-end: 0px; } }
}
/* Reiter eines Moduls (nur Desktop): bei wenig Platz umbrechen statt seitlich schieben – ohne Balken */
.module-tabs { flex-wrap: wrap; column-gap: 1.75rem; row-gap: 0; overflow: visible; }
.tabs a { min-height: 40px; font-size: var(--fs-ui); display: inline-flex; align-items: center; flex-shrink: 0; white-space: nowrap; color: var(--text-muted); text-decoration: none; font-weight: 500; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--text); font-weight: 600; border-bottom: 2px solid var(--accent); }
.list-filter { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.list-filter > .tabs { flex: 1; }

/* Terminzeile als Agenda: grosser Tag, farbiger Balken für die Art, Zustand als Text */
.event { display: flex; align-items: flex-start; gap: .5rem; padding: .75rem 0 .75rem .9rem; border-bottom: 1px solid var(--line); position: relative; }
.event::before { content: ""; position: absolute; left: 0; top: .8rem; bottom: .8rem; width: 3px; border-radius: 2px; background: var(--kind-text, var(--brand-blue)); }
.event-link { flex: 1; min-width: 0; display: grid; grid-template-columns: 3.8rem minmax(0, 1fr) auto; gap: 0 1rem; align-items: start; color: var(--text); text-decoration: none; }
.event-date { line-height: 1; }
.event-date strong { display: block; font-size: 1.45rem; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.event-date small { display: block; margin-top: .25rem; font-size: var(--fs-xs); color: var(--text-muted); }
.event-text { min-width: 0; }
.event-link .event-title { display: block; font-size: var(--fs-base); font-weight: 600; overflow-wrap: break-word; hyphens: auto; }
.event-text small { display: block; color: var(--text-muted); font-size: var(--fs-md); }
.event-tags { display: flex; flex-direction: column; align-items: flex-end; gap: .15rem; padding-top: .15rem; }
.content .kind-tag { background: none; padding: 0; border-radius: 0; font-size: var(--fs-xs); }  /* in der App Text statt Pille (Verwaltung: kind-colors.css) */
.internal-tag { display: inline-flex; align-items: center; gap: .25rem; flex-shrink: 0; font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); }
.event-ics { flex-shrink: 0; width: 40px; height: 40px; color: var(--accent-text); }
.status { display: flex; align-items: center; gap: .3rem; margin-top: .3rem; font-size: var(--fs-md); font-weight: 600; }
.status-open { color: var(--text-muted); font-weight: 500; }  /* nur Frist; handeln über den Knopf «Antworten» */
.status-registered { color: var(--success); }
.status-cancelled { color: var(--text-muted); }
.event-text .involved { margin-top: .15rem; font-size: var(--fs-sm); }
.status-event-cancelled { color: var(--error); }
/* Knopf in der Terminzeile, nur wo die Antwort fehlt */
.button.small { min-height: 32px; margin-top: .45rem; padding: .2rem .8rem; font-size: var(--fs-sm); }
.event-link:hover .button.small { background: var(--accent-dark); }
/* Kalender: Satz unter dem Titel und «Als Nächstes» – dieselbe Agenda-Zeile, grösser */
.calendar-summary { margin: -1rem 0 2rem; }
.next-event { margin-bottom: 2.25rem; }
.next-event .event { border-bottom: 0; padding-bottom: 0; }
.next-event .event-link { grid-template-columns: 4.6rem minmax(0, 1fr) auto; }
.next-event .event-date strong { font-size: 2.3rem; }
.next-event .event-date small { font-size: var(--fs-md); }
.next-event .event-link .event-title { font-size: var(--fs-xl); font-weight: 650; letter-spacing: -.01em; line-height: 1.15; }
.event-list .event-date small { font-size: var(--fs-sm); }
/* Mitteilung mit Datum: ruhige Zeile zwischen den Terminen */
.event.event-notice::before { background: var(--line-strong); }
.event-notice .event-date strong { color: var(--text-muted); }
.status-notice { color: var(--text-muted); font-weight: 500; }
.event-list .event-link { grid-template-columns: 5.2rem minmax(0, 1fr) auto; }  /* Platz für «Donnerstag» */
.event-cancelled .event-title { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--text-muted); }
.event.event-cancelled .event-date { opacity: .5; }

/* Monatsüberschriften in der Kalenderliste */
.month { font-size: var(--fs-2xs); font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--text-muted); }
.event-list .month { margin: 2rem 0 0; padding-bottom: .5rem; border-bottom: 1px solid var(--line-strong); }
.event-list .month:first-child { margin-top: 0; }
.event-list .event:has(+ .month) { border-bottom: 0; }

/* Kalenderblatt (events/_event.html): Monat als Band in der Farbe der Termin-Art, darunter der Tag; ersetzt den Farbstreifen */
.event:not(.event-subtle) { padding-left: 0; }
.event:not(.event-subtle)::before { display: none; }
.event-date:has(.cal) { display: flex; flex-direction: column; align-items: flex-start; }
.cal { display: block; width: 3.2rem; overflow: hidden; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-small); }
.cal-month {
  --kind: light-dark(var(--kind-text, #0e6688), color-mix(in srgb, var(--kind-text, #1486ae) 55%, #fff));
  display: block; padding: .12rem 0; font-size: .66rem; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; line-height: 1.4;
  background: color-mix(in srgb, var(--kind) 14%, transparent); color: var(--kind);
}
.event-date .cal strong { display: block; padding: .12rem 0 .22rem; font-size: 1.3rem; font-weight: 650; line-height: 1.2; letter-spacing: -.02em; }
.event-date .cal-day { display: block; width: 3.2rem; margin-top: .3rem; text-align: center; font-size: var(--fs-2xs); color: var(--text-muted); }
.event-list .event-date .cal-day, .next-event .event-date .cal-day { width: auto; min-width: 3.2rem; }
.cal-muted .cal-month { --kind: var(--text-muted); }
/* Termin-Detail: grosses Kalenderblatt neben Titel und Zeit */
.event-head { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.5rem; }
.event-head .event-title { margin: .3rem 0 .2rem; }
.event-head .subtitle { margin: 0; }
.cal-big { width: 4.2rem; flex-shrink: 0; }
.cal-big strong { display: block; padding: .15rem 0 .3rem; font-size: 1.9rem; font-weight: 650; line-height: 1.15; letter-spacing: -.02em; }
.event-cancelled .cal-month { --kind: var(--text-muted); }
.next-event .cal, .dash-next .cal { width: 3.8rem; }
.next-event .event-date .cal strong, .dash-next .event-date .cal strong { font-size: 1.6rem; }
.next-event .event-date .cal-day, .dash-next .event-date .cal-day { width: 3.8rem; }

/* Unauffällige Termine (Art mit «Unauffällig darstellen», z. B. Abfuhr): eine kleine Zeile */
.event-subtle { padding: .5rem 0 .5rem .9rem; border-bottom: 0; align-items: center; }
.event-subtle::before { top: .55rem; bottom: .55rem; width: 3px; }
.event-subtle .event-link { grid-template-columns: 4.4rem minmax(0, 1fr); align-items: baseline; }
.event-subtle .event-date { display: flex; align-items: baseline; gap: .3rem; color: var(--text-muted); }
.event-subtle .event-date strong { display: inline; font-size: var(--fs-md); font-weight: 600; letter-spacing: 0; }
.event-subtle .event-date small { display: inline; margin: 0; }
.event-subtle .event-text { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .5rem; }
.event-subtle .event-link .event-title { font-size: var(--fs-md); font-weight: 500; color: var(--text-muted); }
.event-subtle .event-text small { font-size: var(--fs-xs); }
.event-subtle .status { margin-top: 0; font-size: var(--fs-xs); }
.event-subtle .event-tags { display: none; }
.event-subtle .event-ics { width: 30px; height: 30px; }
.event-subtle .event-ics .icon { width: 15px; height: 15px; }

/* Termin-Detail */
.event-facts { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 1rem 0; }
.event-facts dt { display: flex; align-items: center; gap: .4rem; color: var(--text-muted); }
.event-facts dd { margin: 0; }
.registered { color: var(--success); font-weight: 600; display: flex; align-items: center; gap: .4rem; }
/* Nach «Ich komme»: Häkchen im Kreis springt auf, die Zeile leuchtet kurz grün nach */
.check-circle { display: inline-grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: color-mix(in srgb, var(--success) 14%, transparent); }
.registered.even { animation: nachleuchten 1.6s ease-out both; border-radius: var(--radius-small); }
.registered.even .check-circle { animation: aufspringen .55s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes aufspringen { from { transform: scale(.3); opacity: 0; } }
@keyframes nachleuchten { from { background: color-mix(in srgb, var(--success) 16%, transparent); box-shadow: 0 0 0 .5rem color-mix(in srgb, var(--success) 16%, transparent); } }
@media (prefers-reduced-motion: reduce) { .registered.even, .registered.even .check-circle { animation: none; } }
.cancelled { color: var(--text-muted); font-weight: 600; display: flex; align-items: center; gap: .4rem; }
.cancellation-form { margin-top: 1rem; }
.cancellation-form summary { color: var(--error); }
.head-actions { margin-top: 0; }
.link-field { display: flex; gap: .5rem; }
.link-field input { flex: 1; min-width: 0; font-size: var(--fs-md); }
.guide h3 { margin: 1.1rem 0 .3rem; }
.guide ol { margin: 0; padding-left: 1.25rem; }
.guide li { margin-bottom: .2rem; }
.actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; }
.actions-right { justify-content: flex-end; }
:is(form.card, .card form, .content > form) > .actions-right { max-width: 46rem; }  /* Knopf bündig mit den Feldern */
details { margin: 0 0 1.1rem; }
summary { cursor: pointer; color: var(--accent-text); font-weight: 600; margin-bottom: .6rem; }

/* Zwei-Faktor-Anmeldung (templates/mfa/index.html): eine Karte pro Verfahren, Stand als Pille, Knöpfe unten */
.mfa-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1rem; align-items: stretch; }
.mfa-grid .card { margin: 0; }
.mfa-method { display: flex; flex-direction: column; }
.mfa-method .card-head { align-items: center; }
.mfa-method .actions { margin-top: auto; padding-top: .5rem; align-items: center; }
.quiet-link { color: var(--text-muted); font-size: var(--fs-sm); }
.quiet-link:hover { color: var(--accent-text); }
/* Mein Profil: Sicherheit als Liste mit Stand und Link, E-Mail nur zum Lesen, Schalter ohne Rahmen */
.settings-list li { flex-wrap: nowrap; }
.settings-list .residents-name small { display: block; margin-top: .1rem; color: var(--text-muted); font-size: var(--fs-sm); font-weight: 400; }
.settings-list li > a { margin-left: auto; white-space: nowrap; }
.field-label { display: block; font-size: var(--fs-ui); font-weight: 600; margin-bottom: .3rem; }  /* wie label */
.readonly-value { display: flex; gap: .75rem; align-items: baseline; flex-wrap: wrap; }
.plain-fieldset { border: 0; margin: 0; padding: 0; }
/* Mein Haus / Meine Wohnung: Bewohner und offene Einladungen */
@media (min-width: 1100px) { .household-grid.single { grid-template-columns: minmax(0, 1fr); } }  /* nur eine Spalte belegt */
.household-grid > div:empty { display: none; }
.invite { margin: 1rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line); }
.invite summary { display: inline-flex; align-items: center; gap: .3rem; margin-bottom: 0; }
.invite[open] summary { margin-bottom: .8rem; }
.pdf-link { display: inline-flex; padding: .2rem; border-radius: var(--radius-small); }  /* Rechnung als PDF: nur das Datei-Icon */
.pdf-link:hover { background: var(--accent-light); }
.pdf-link .file-pdf { color: var(--file-pdf); }
.household-settings { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
/* Bewohner-Verzeichnis des Vorstands: Tabelle, schmal eine Person pro Block */
/* Tabellen: ein Grundstil für .people (Personen, auf dem Handy als Zeilenblöcke) und .gas-years (Zahlen, bleibt Tabelle) */
.people, .gas-years { width: 100%; border-collapse: collapse; }
.people, .gas-years { font-size: var(--fs-ui); }
.people a[href^="tel:"] { white-space: nowrap; }
.people th, .people td, .gas-years th, .gas-years td { padding: .6rem 1rem .6rem 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.people th, .people td { overflow-wrap: anywhere; }
.people thead th, .gas-years thead th { padding-top: 0; padding-bottom: .4rem; border-bottom-color: var(--line-strong); font-size: var(--fs-2xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); white-space: nowrap; }
.people thead a { color: var(--text-muted); text-decoration: none; }
.people thead a:hover, .people thead a.active { color: var(--text); }
.people thead a.active { font-weight: 600; }
.people tbody th, .gas-years tbody th { font-weight: 600; }
.people tbody th a { color: var(--text); text-decoration: none; }
.people tbody th a:hover { text-decoration: underline; text-decoration-color: var(--brand-blue); text-decoration-thickness: 2px; text-underline-offset: .18em; }
.people td, .gas-years td { color: var(--text); font-size: var(--fs-md); }
/* Leise: Nebensachen in einer Zelle und die Zeile unter dem Titel */
.people td small, .people .quiet, .gas-years td small { color: var(--text-muted); }
.people tbody th small { display: block; margin-top: .1rem; font-size: var(--fs-sm); font-weight: 400; color: var(--text-muted); }
.people tbody th small b, .people td b { color: var(--signal); font-weight: 700; }
/* Schmale Spalten (Datum, Stand, Zahl, Haus): so breit wie der Inhalt, einzeilig */
.people .col-fit { width: 1%; white-space: nowrap; overflow-wrap: normal; }
.people .col-num { width: 1%; white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
/* Sortierbarer Kopf: Pfeil leise beim Zeigen, kräftig bei der aktiven Spalte */
.people thead a::after { content: "↓"; margin-left: .25em; opacity: 0; }
.people thead a:hover::after { opacity: .45; }
.people thead a.active::after { opacity: 1; }
.people-date { white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Desktop: Kopf bleibt beim Scrollen stehen; `.rows-link` = ganze Zeile führt zum Link im Titel (andere Links bleiben klickbar) */
@media (min-width: 861px) {
  .people thead th { position: sticky; top: 0; z-index: 2; background: var(--background); }
  .people.rows-link tbody tr { position: relative; }
  .people.rows-link tbody tr:hover { background: var(--accent-light); }
  .people.rows-link tbody th a::after { content: ""; position: absolute; inset: 0; }
  .people.rows-link td a { position: relative; z-index: 1; }
  .people.rows-link th:first-child, .people.rows-link td:first-child { padding-left: .6rem; }
  .people.rows-link th:last-child, .people.rows-link td:last-child { padding-right: .6rem; }
}
.people-nobody { font-weight: 400; color: var(--text-muted); }
@media (max-width: 860px) {
  .people thead th:nth-child(n+4) { display: none; }
  .people thead:not(:has(a)), .people thead th:not(:has(a)) { display: none; }  /* Zeilenblöcke: Kopf nur noch zum Sortieren */
  .people thead tr { display: flex; gap: 1.2rem; border-bottom: 1px solid var(--line-strong); }
  .people thead th { border: 0; padding-right: 0; }
  .people tbody tr { display: block; padding: .8rem 0; border-bottom: 1px solid var(--line); }
  .people tbody th, .people td { display: block; padding: 0; border: 0; }
  .people tbody th:not([colspan]), .people td.people-first { display: inline; color: var(--text); font-size: var(--fs-base); font-weight: 650; }
  .people td { color: var(--text-muted); }
  .people .col-fit, .people .col-num { width: auto; text-align: left; }  /* Zeilenblöcke: keine Spaltenbreiten */
  .people td:empty { display: none; }
}
.residents-list { list-style: none; margin: 0; padding: 0; }
.residents-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem 1rem; padding: .85rem 0; border-bottom: 1px solid var(--line); }
.residents-name { flex: 1 1 14rem; font-weight: 650; }
.residents-name .meta-inline { font-weight: normal; }
.residents-roles { color: var(--text-muted); font-size: var(--fs-md); }
.actions-inline { display: inline-flex; gap: 1rem; }
.actions-inline form { margin: 0; }

/* Rückfrage als Popup (base.html, imbol.js) */
form.inline-form { display: inline; margin: 0; }
.confirm { width: min(26rem, calc(100vw - 2rem)); padding: 1.5rem; border: 0; border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: 0 18px 50px rgb(0 0 0 / .28); }
.confirm::backdrop { background: rgb(10 25 32 / .45); }
.confirm form { margin: 0; }
.confirm-question { margin: 0 0 .5rem; font-size: var(--fs-lg); font-weight: 650; overflow-wrap: anywhere; }
.confirm-hint { margin: 0; color: var(--text-muted); }
.confirm .actions { margin-top: 1.5rem; justify-content: flex-end; }
@media (max-width: 560px) { .confirm .actions button { flex: 1; } }

/* ---------- Formulare ------------------------------------------------------- */
form p { margin: 0 0 1.1rem; }
label { display: block; font-size: var(--fs-ui); font-weight: 600; margin-bottom: .3rem; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number],
input[type=search], input[type=date], input[type=time], input[type=datetime-local], input[type=url], textarea, select {
  width: 100%; min-height: 40px; padding: .5rem .75rem; font: inherit; color: var(--text);
  border: 1px solid var(--line-strong); border-radius: var(--radius-small); background: var(--surface);
}
input[type=date], input[type=time], input[type=datetime-local], input[type=number] { height: 40px; }
textarea { min-height: 8rem; }
input[type=checkbox], input[type=radio] { width: 1.1rem; height: 1.1rem; vertical-align: middle; accent-color: var(--accent); }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--brand-blue); outline-offset: 1px; border-color: var(--accent); }
.helptext, form span.helptext { display: block; color: var(--text-muted); font-size: var(--fs-sm); margin-top: .25rem; }
/* Fehler als Text unter dem Feld (templates/django/forms/p.html), Feld mit rotem Rand */
.errorlist { list-style: none; margin: .35rem 0 0; padding: 0; color: var(--error); font-size: var(--fs-md); font-weight: 600; }
.errorlist.nonfield, .form-error .errorlist { margin: 0 0 1.25rem; padding: .8rem 1.1rem; border-radius: var(--radius-small); background: var(--error-background); }
input[aria-invalid=true], textarea[aria-invalid=true], select[aria-invalid=true] { border-color: var(--error); }
.field { margin: 0 0 1.25rem; }
.field-checkmark { display: flex; align-items: flex-start; gap: .7rem; }
.field-checkmark > input { margin: .1rem 0 0; flex-shrink: 0; }
.field-checkmark label { margin: 0; font-weight: 500; }
/* Mehrere Häkchen in einem Feld (z. B. Zuständige einer Pendenz): Häkchen vor dem Namen, eine Zeile pro Person */
.field div:has(> div > label > input[type=checkbox]) { display: grid; gap: .55rem; margin: .35rem 0 .5rem; }
.field div > div > label:has(> input[type=checkbox]) { display: flex; align-items: center; gap: .7rem; margin: 0; font-weight: 500; }
.field-row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0 1rem; }
.field-row.field-row-2 { grid-template-columns: 1fr 1fr; }
.field-row.field-row-street { grid-template-columns: 3fr 1fr; }  /* Strasse | Nr., Haus | Bezeichnung */
.field-row.field-row-city { grid-template-columns: 1fr 3fr; }    /* PLZ | Ort */
/* Eigentümerpartei (Ansicht): Haus und Pillen unter dem Namen, Parkplätze als Nummern-Kärtchen, Spalten gleich breit */
.owner-subtitle { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; margin-bottom: 1.5rem; }
@media (min-width: 1100px) { .owner-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.parking-list { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; margin: 0 0 .5rem; padding: 0; }
.parking-list li { display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .7rem; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--background); }
.parking-number { font-weight: 650; font-variant-numeric: tabular-nums; }
/* Haus (Vorstand, board/resident_unit.html): pro Eigentümer-Partei ein Block mit Name, Pillen und Kontakt */
.unit-owner + .unit-owner { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.unit-owner-head { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; }
.unit-owner .event-facts { margin: .6rem 0 0; }
/* Eigentümerpartei bearbeiten: breit zwei Spalten (Person/Kontakt | Haus/Parkplätze/Genossenschaft), Felder je Spalte begrenzt */
.owner-form > * { max-width: 46rem; }
.owner-form > .owner-columns { max-width: none; display: grid; gap: 0 2.5rem; }
@media (min-width: 1100px) { .owner-columns { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.owner-form legend label { display: inline; margin: 0; font: inherit; }
.field-row.registration-fields { grid-template-columns: 13rem 1fr; }  /* Anzahl mit − und +, Bemerkung breit */
.stepper { display: flex; gap: .4rem; }
.stepper input[type=number] { text-align: center; font-weight: 700; min-width: 0; appearance: textfield; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper button { flex: none; width: 40px; min-height: 40px; padding: 0; font-size: 1.4rem; line-height: 1; }
.section-field { border: 0; border-top: 1px solid var(--line); padding: 1rem 0 .25rem; margin: 0 0 1.25rem; }
.section-field legend { font-weight: 700; padding: 0 .75rem 0 0; }
p.checkbox { display: flex; align-items: center; gap: .6rem; margin-bottom: .25rem; }
p.checkbox label { margin: 0; font-weight: 500; }

button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 38px;
  background: var(--accent); color: var(--on-blue); border: 0; border-radius: var(--radius-small);
  padding: .45rem 1rem; font: inherit; font-size: var(--fs-ui); font-weight: 600; cursor: pointer; text-decoration: none;
}
button:hover, .button:hover { background: var(--accent-dark); color: var(--on-blue); }
.button.secondary, button.secondary { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.button.secondary:hover, button.secondary:hover { background: var(--accent-light); color: var(--text); }
.button-danger { background: var(--error); color: var(--on-blue); }  /* z. B. Authenticator-App deaktivieren (allauth) */
.button-danger:hover { background: color-mix(in srgb, var(--error) 85%, black); color: var(--on-blue); }
button.icon-button, button.icon-button:hover { min-height: 0; }
button.icon-button { background: transparent; color: var(--text); }
button.icon-button:hover { background: var(--accent-light); }
.linklike, button.linklike { display: inline; min-height: 0; background: none; border: 0; padding: 0; color: var(--accent-text); text-decoration: underline; text-underline-offset: .18em; font-weight: normal; cursor: pointer; }
.linklike:hover, button.linklike:hover { background: none; color: var(--accent-text-hover); }
/* Beim Absenden (static/js/imbol.js): Knopf gesperrt, kleiner Ring dreht sich */
button.sending { cursor: progress; opacity: .8; }
button.sending::after { content: ""; width: .9em; height: .9em; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: drehen .7s linear infinite; }
@keyframes drehen { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { button.sending::after { animation: none; border-right-color: currentColor; opacity: .5; } }

/* ---------- Meldungen ------------------------------------------------------- */
.messages { margin-bottom: 1.5rem; }
.msg { padding: .7rem 1rem; border: 1px solid color-mix(in srgb, var(--brand-blue) 20%, transparent); border-radius: var(--radius-small); background: var(--accent-light); color: var(--accent-text-hover); font-weight: 500; margin-bottom: .5rem; }
.msg-error { background: var(--error-background); color: var(--error); }
.msg-warning { background: var(--warning-background); color: var(--warning-text); }

/* ---------- Login-Seiten: blaue Fläche, weisses Logo ------------------------- */
.entrance { min-height: 100vh; display: flex; flex-direction: column; align-items: center; gap: 1.75rem; padding: 3.5rem 1.25rem 2rem; background: var(--blue-surface); }
.entrance-aside, .entrance-inner { width: 100%; max-width: 440px; }
.entrance-inner { display: flex; flex-direction: column; gap: 1.75rem; }
.entrance-tagline, .site-drawing { display: none; }  /* Handy: nur Marke und Karte */
@media (min-width: 861px) {
  /* Desktop: links Marke und Siedlungsplan, rechts die Karte */
  .entrance { display: grid; grid-template-columns: minmax(0, 30rem) minmax(0, 440px); justify-content: center; align-content: center; gap: 2rem 6rem; padding: 3rem 2.5rem; }
  .entrance-aside { max-width: none; display: flex; flex-direction: column; gap: 2.5rem; }
  .entrance .entrance-title { font-size: var(--fs-2xl); font-weight: 650; letter-spacing: -.02em; }
  .entrance-tagline { display: block; margin: 0; max-width: 24rem; color: var(--on-blue-muted); }
  .site-drawing { display: block; width: 100%; height: auto; max-height: 52vh;
    mask-image: radial-gradient(closest-side, #000 60%, transparent); }  /* Ränder weich ausblenden (Maske: nur Deckkraft) */
}
/* Siedlungsplan als Zeichnung (apps/estate/drawing.py): Häuser hell umrandet, Wege und Nachbarn leise */
.site-drawing * { vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.sd-area { fill: color-mix(in srgb, var(--on-blue) 5%, transparent); }
.sd-neighbor { fill: none; stroke: var(--on-blue-line); stroke-width: 1px; }
.sd-road { fill: none; stroke: color-mix(in srgb, var(--on-blue) 14%, transparent); stroke-width: 5px; }
.sd-footpath { fill: none; stroke: var(--on-blue-line); stroke-width: 1px; stroke-dasharray: 3 4; }
.sd-house { fill: color-mix(in srgb, var(--on-blue) 10%, transparent); stroke: var(--on-blue-muted); stroke-width: 1.25px; }
.entrance-brand { display: flex; flex-direction: column; align-items: flex-start; gap: .8rem; }
.entrance .entrance-logo { display: block; margin: 0; width: 280px; max-width: 100%; height: auto; }
.entrance-title { margin: 0; font-size: var(--fs-base); font-weight: 600; color: var(--on-blue); }
.entrance-card { background: var(--surface); border-radius: var(--radius-card); padding: 1.75rem; box-shadow: 0 10px 30px rgb(0 0 0 / .18); }
.entrance h1 { font-size: var(--fs-2xl); margin-bottom: .5rem; }
.entrance-card > p:first-of-type, .entrance-card h1 + p { color: var(--text-muted); }
.entrance button[type=submit], .entrance form button { width: 100%; margin-top: .25rem; }
.entrance .linklike, .entrance form button.linklike { width: auto; }
.entrance-hint { display: flex; gap: .75rem; align-items: flex-start; color: var(--on-blue); font-size: var(--fs-md); padding: 0 .25rem; }
.entrance-hint .icon { margin-top: .1rem; }
.entrance-hint p { margin: 0; }
.choice .button { display: flex; width: 100%; margin-top: .5rem; }
.entrance hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
.entrance #passkey_login { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.entrance #passkey_login:hover { background: var(--accent-light); }
.hint { color: var(--text-muted); font-size: var(--fs-md); }
.entrance-card img { display: block; margin: 1rem auto; max-width: 220px; }

/* --- Frondienst ------------------------------------------------------------ */
.progress { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.ring {
  --share: 0; position: relative; width: 84px; height: 84px; flex-shrink: 0;
  display: grid; place-content: center; text-align: center;
}
/* Schmaler Ring (6 px wie .bar-thin), innen durchsichtig – passt auf jede Karte, hell und dunkel */
.ring::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(var(--brand-blue) calc(var(--share) * 1%), var(--accent-light) 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5.5px));
}
.ring > * { position: relative; }
.ring strong { font-size: 1.25rem; font-weight: 600; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }  /* zählt hoch, ohne zu zappeln */
.ring small { color: var(--text-muted); font-size: var(--fs-xs); margin-top: .15rem; }

/* Der eine Moment Bewegung: Der Ring füllt sich beim Öffnen von 0 und nach dem Erfassen vom alten Stand
   auf den neuen, die Zahl zählt mit – gesteuert von static/js/imbol.js (ohne Skript: sofort der Endstand). */
.progress-text { flex: 1 1 14rem; }
.progress-text p { margin: .2rem 0; }
.progress-title { font-size: var(--fs-lg); font-weight: 650; letter-spacing: -.005em; display: flex; align-items: center; gap: .4rem; }
.quick-pick { display: flex; gap: .4rem; margin-top: .4rem; flex-wrap: wrap; }
.chip { min-height: 32px; padding: 0 .85rem; border-radius: var(--radius-small); background: var(--accent-light); color: var(--accent-text); border: 0; font-weight: 650; font-size: var(--fs-md); cursor: pointer; }
.chip:hover { background: var(--accent); color: var(--on-blue); }
.category-choice { border: 0; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.category-choice legend { font-weight: 600; margin-bottom: .4rem; padding: 0; }
.category-button { position: relative; margin: 0; }
.category-button input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.category-button span {
  display: inline-flex; align-items: center; min-height: 38px; padding: 0 .9rem; border-radius: var(--radius-small);
  box-shadow: inset 0 0 0 1px var(--line-strong); background: var(--surface); font-weight: 500; cursor: pointer;
}
.category-button input:checked + span { background: var(--accent); box-shadow: none; color: var(--on-blue); font-weight: 650; }
.category-button input:focus-visible + span { outline: 3px solid var(--brand-blue); outline-offset: 3px; }
/* Anliegen (Bewohner): Ablauf in drei Schritten, Antwort des Vorstands mit Akzentstrich */
.steps { margin: 0 0 1rem; padding-left: 1.2rem; display: grid; gap: .5rem; }
.steps li { padding-left: .2rem; }
.concern-answer { border-left: 4px solid var(--accent); }
.concern-message .meta { margin-top: 0; }
/* Zwei gleiche Spalten ab 1100 px (Vorstand-Übersicht, Schadenmeldung, Termin): <div class="dash-grid split"> */
@media (min-width: 1100px) { .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.page-head-status { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; margin: -.5rem 0 1.5rem; }
/* Frondienst-Seite: breit links Erfassen und Einträge, rechts der Stand (wie beim Gaszähler); schmal der Stand zuerst
   (Reihenfolge im HTML), darum am Desktop mit order getauscht. Stunden nach Kategorie, Total unter den Einträgen */
@media (min-width: 1100px) { .cw-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .cw-grid > :last-child { order: -1; } }
.cw-grid .shared { margin: 0; padding: 0; border: 0; }
.cw-categories { list-style: none; margin: 1rem 0 0; padding: 1rem 0 0; border-top: 1px solid var(--line); display: grid; gap: .35rem; }
.cw-categories li, .cw-total { display: flex; justify-content: space-between; gap: 1rem; font-size: var(--fs-md); }
.cw-categories span { color: var(--text-muted); }
.cw-categories b, .cw-total b { font-weight: 650; font-variant-numeric: tabular-nums; }
.cw-total { margin: 0; padding-top: .75rem; border-top: 1px solid var(--line-strong); font-weight: 600; }
.cw-list { list-style: none; margin: 0; padding: 0; }
.cw-list li { display: flex; align-items: center; gap: .5rem 1rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.cw-date { width: 5.5rem; flex-shrink: 0; color: var(--text-muted); font-size: var(--fs-md); font-variant-numeric: tabular-nums; }
.cw-what { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cw-what strong { font-weight: 650; }
.cw-what small { color: var(--text-muted); font-size: var(--fs-md); }
.cw-what .cw-comment { color: var(--error); }
.cw-hours { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cw-edit { color: var(--text-muted); }
.cw-edit:hover { color: var(--accent-text); }
.cw-list li.rejected strong, .cw-list li.rejected .cw-hours { text-decoration: line-through; color: var(--text-muted); }
.cw-list li.empty { border-bottom: 0; }

/* ---------- Gaszähler (templates/gas_meter/, Diagramme aus apps/gas_meter/chart.py) ---------- */
.chart { display: block; width: 100%; height: auto; margin-top: 1rem; overflow: visible; }
/* Gaszähler-Seite: links Erfassen und Ablesungen, rechts Diagramme und Jahre; Erfassen in einer Zeile */
@media (min-width: 1100px) { .gas-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.gas-entry { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 0 .75rem; align-items: end; }
.gas-entry p { margin: 0; }
.gas-entry button { margin-bottom: 0; }
@media (max-width: 520px) { .gas-entry { grid-template-columns: 1fr 1fr; } .gas-entry button { grid-column: 1 / -1; margin-top: .75rem; } }
.gas-end summary { margin: 0; color: var(--text-muted); font-weight: 600; }
.gas-end[open] summary { margin-bottom: .8rem; }
.chart-bar { fill: var(--brand-blue); }
.chart-bar-light { fill: var(--chart-light); }
.chart-axis { stroke: var(--line-strong); stroke-width: 1; }
.chart-value { fill: var(--text); font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-label { fill: var(--text-muted); font-size: 17px; }
.chart-legend { display: flex; align-items: center; gap: .4rem; margin: .6rem 0 0; color: var(--text-muted); font-size: var(--fs-md); }
.chart-key { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; background: var(--brand-blue); }
.chart-key:not(:first-child) { margin-left: .8rem; }
.chart-key-light { background: var(--chart-light); }
.gas-years { font-variant-numeric: tabular-nums; }
.gas-years tbody th, .gas-years td { white-space: nowrap; }
.gas-years td:nth-child(3) { color: var(--text); font-weight: 650; }
.gas-missing { color: var(--signal); font-weight: 650; }
@media (max-width: 560px) {
  /* SVG wird auf dem Handy rund halb so breit gezeichnet: Schrift im Diagramm entsprechend grösser */
  .chart-value { font-size: 27px; }
  .chart-label { font-size: 25px; }
  .gas-years th, .gas-years td { padding-right: .5rem; }
}

/* ---------- Siedlungsplan (templates/estate/plan.html, static/js/site_plan.js) ---------- */
.plan {
  --plan-background: light-dark(#f6f5f1, #161e21);
  --plan-neighbor: light-dark(#dcd8d0, #2b3438);
  --plan-street: light-dark(#ffffff, #2a353a);
  --plan-street-edge: light-dark(#cfcbc2, #3d4a50);
  --plan-way: light-dark(#ada596, #66747a);
  --plan-green: light-dark(#e4eedd, #1e3125);
  --plan-green-edge: light-dark(#c9dcc0, #2f4a37);
  --plan-green-text: light-dark(#5e7a52, #9cc28d);
  --plan-size: light-dark(#f6e7c8, #3b2a18);
  --plan-text-muted: light-dark(#8a8478, #8d9a9f);
  display: grid; grid-template-columns: minmax(0, 1fr) 19rem; gap: 2.5rem; align-items: start;
}
.pz-1 { --zf: light-dark(#c96f1c, #eaa45e); }
.pz-2 { --zf: light-dark(#c63a6e, #ef8fb3); }
.pz-3 { --zf: light-dark(#6c4fc0, #b6a2f0); }
.pz-4 { --zf: light-dark(#2f8a4c, #7fcf98); }
.pz-5 { --zf: light-dark(#a07a0c, #e3c35a); }

.plan-card {
  position: relative; height: min(74vh, 760px); min-height: 420px; overflow: hidden;
  background: var(--plan-background); border: 1px solid var(--line); border-radius: var(--radius-card); touch-action: none; cursor: grab;
}
.plan-card.drag { cursor: grabbing; }
#plan-svg { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-select: none; }
.plan-tools {
  position: absolute; top: .75rem; right: .75rem; display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--radius-small); box-shadow: 0 0 0 1px var(--line);
}
.plan-tools .icon-button + .icon-button { border-top: 1px solid var(--line); border-radius: 0; }

/* Zeichnung: Linien in Bildschirm-Pixeln (vector-effect), Strassen in Metern */
.pf-playground, .pf-meadow { fill: var(--plan-green); stroke: var(--plan-green-edge); stroke-width: 1; vector-effect: non-scaling-stroke; }
.pf-water { fill: light-dark(#d6ecf3, #18343f); }
.pf-parking { fill: light-dark(#ecebe6, #222b2f); }
.pt-surface { font-size: 2.6px; fill: var(--plan-green-text); text-anchor: middle; }
.pt-building { font-size: 2.4px; font-weight: 600; fill: var(--plan-text-muted); text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.p-facility path { fill: var(--plan-size); stroke: var(--signal); stroke-width: 1; vector-effect: non-scaling-stroke; }
.pt-facility { font-size: 1.6px; font-weight: 650; fill: var(--warning-text); text-anchor: middle; pointer-events: none; }
.pw-street-edge, .pw-street, .pw-driveway-edge, .pw-driveway { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.pw-street-edge { stroke: var(--plan-street-edge); stroke-width: 7.6; }
.pw-street { stroke: var(--plan-street); stroke-width: 6.4; }
.pw-driveway-edge { stroke: var(--plan-street-edge); stroke-width: 4.6; }
.pw-driveway { stroke: var(--plan-street); stroke-width: 3.6; }
.pw-footpath { fill: none; stroke: var(--plan-way); stroke-width: 1.5; stroke-dasharray: 5 4; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.pt-street { font-size: 3px; font-style: italic; fill: var(--plan-text-muted); }
.p-neighbor { fill: var(--plan-neighbor); stroke: none; }

.p-zone { fill: var(--zf); fill-opacity: .18; stroke: var(--zf); stroke-width: 2; vector-effect: non-scaling-stroke; cursor: pointer; }
.p-zone:hover, .p-zone.active { fill-opacity: .36; }
.p-zone-line { fill: none; stroke: var(--zf); stroke-width: 4; stroke-dasharray: 2 5; stroke-linecap: round; vector-effect: non-scaling-stroke; pointer-events: none; }
.pt-zone { font-size: 4.4px; font-weight: 750; fill: var(--zf); text-anchor: middle; dominant-baseline: central; pointer-events: none;
  paint-order: stroke; stroke: var(--plan-background); stroke-width: 1.1px; stroke-linejoin: round; }
#plan-svg.without-zones :is(.p-zone, .p-zone-line, .pt-zone) { display: none; }

.p-house { fill: var(--accent-light); stroke: var(--brand-blue); stroke-width: 1.4; vector-effect: non-scaling-stroke; cursor: pointer; }
.p-house:hover { fill: light-dark(#cfe6f0, #1d4252); }
.p-house.mine { stroke-width: 3.5; }
.p-house.hits { fill: var(--warning-background); stroke: var(--signal); }
.p-house.active { fill: var(--accent); stroke: var(--accent-dark); stroke-width: 2.5; }
.pt-house { font-family: "Archivo", system-ui, sans-serif; font-size: 3.1px; font-weight: 750; font-stretch: 80%; fill: var(--accent-text); text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.pt-house.active { fill: var(--on-blue); }
.p-special { fill: var(--plan-size); stroke: var(--signal); stroke-width: 1.4; vector-effect: non-scaling-stroke; cursor: pointer; }
.p-special.active { fill: var(--signal); }
.pt-special { font-size: 1.7px; font-weight: 650; fill: var(--warning-text); text-anchor: middle; pointer-events: none; }
.pt-special.active { fill: var(--on-blue); }
.p-location circle { fill: var(--surface); stroke: var(--signal); stroke-width: .5; }
.p-location text { font-size: 2.4px; font-weight: 700; fill: var(--signal); text-anchor: middle; dominant-baseline: central; }
.plan-fix { fill: var(--text-muted); }
.plan-fix text { font-weight: 650; text-anchor: middle; }
:is(.p-house, .p-zone, .p-special):focus-visible { outline: none; stroke: var(--text); stroke-width: 3; }

/* Seite rechts: Suche, Angaben, Nummern, Zonen */
.plan-head { align-items: center; }
.plan-head .plan-search { flex: 0 1 19rem; margin: 0; }
@media (max-width: 700px) { .plan-head .plan-search { flex-basis: 100%; } }
@media (min-width: 1100px) { .plan-card { position: sticky; top: 1.5rem; } }  /* Plan bleibt stehen, rechts scrollt */
/* Reiter in der Karte rechts (Knöpfe statt Links, sonst wie .tabs) */
.plan-tabs { margin: -.25rem 0 1rem; gap: 1.25rem; }
.plan-tabs button { min-height: 40px; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--text-muted); font-size: var(--fs-ui); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.plan-tabs button:hover { background: none; color: var(--text); }
.plan-tabs button.active { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }
/* Legende: gleiche Farben wie im Plan */
.plan-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.plan-legend li { display: flex; align-items: center; gap: .7rem; }
.plan-legend-house, .plan-legend-special { width: 1.4rem; height: 1rem; border-radius: 3px; border: 2px solid var(--brand-blue); background: color-mix(in srgb, var(--brand-blue) 25%, transparent); }
.plan-legend-house.mine { background: var(--accent); }
.plan-legend-special, .plan-legend-facility { border-color: var(--signal); background: var(--plan-size); }
.plan-legend-facility { width: 1.4rem; height: 1rem; border-radius: 3px; border: 1.5px solid var(--signal); }
.plan-legend-place { display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: 50%; border: 1.5px solid var(--signal); background: var(--surface); color: var(--signal); font-size: var(--fs-xs); font-weight: 700; }
.plan-search {
  display: flex; align-items: center; gap: .5rem; height: 40px; margin-bottom: 1.5rem; padding: 0 .75rem;
  border-radius: var(--radius-small); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--text-muted);
}
.plan-search:focus-within { box-shadow: inset 0 0 0 2px var(--brand-blue); }
.plan-search input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 0; background: transparent; font: inherit; color: var(--text); box-shadow: none; }
.plan-page .card { margin-bottom: 2.25rem; }
.plan-info-head { display: flex; align-items: center; gap: 1rem; padding-bottom: .7rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.plan-info-head h2 { margin: 0; }
.plan-info-head p { margin: .15rem 0 0; color: var(--text-muted); }
.plan-info-head .sign strong { font-size: 2rem; }
.plan-facts { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; margin: 0; }
.plan-facts dt { color: var(--text-muted); }
.plan-facts dd { margin: 0; }
.plan-open { color: var(--text-muted); font-style: italic; }
/* Bewohner im Info-Bereich: Name, darunter E-Mail und Telefon als Links (falls freigegeben) */
.plan-apartment { margin: 1.25rem 0 .35rem; font-size: var(--fs-ui); }
.plan-apartment.empty { display: flex; justify-content: space-between; gap: 1rem; margin: 0; padding: .45rem 0; border-bottom: 1px solid var(--line); font-weight: 600; }
.plan-apartment.empty span { color: var(--text-muted); font-weight: 400; font-style: italic; font-size: var(--fs-md); }
.plan-facts + .plan-apartment.empty { margin-top: 1rem; }
.plan-residents { list-style: none; margin: 0; padding: 0; }
.plan-residents li { padding: .5rem 0; border-bottom: 1px solid var(--line); }
.plan-residents li:last-child { border-bottom: 0; }
.plan-residents strong { display: block; font-weight: 650; }
.plan-residents span { display: flex; flex-direction: column; font-size: var(--fs-md); }
.plan-residents a { overflow-wrap: anywhere; }
.plan-zone-color { display: inline-block; width: .8rem; height: .8rem; margin-right: .5rem; border-radius: 3px; background: var(--zf); }

.plan-numbers { display: grid; grid-template-columns: repeat(auto-fill, minmax(3rem, 1fr)); gap: .4rem; }
.plan-numbers button, .plan-size-button, .plan-zone-button {
  min-height: 38px; padding: 0 .5rem; border-radius: var(--radius-small); font-weight: 600; font-variant-numeric: tabular-nums;
  background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong);
}
.plan-numbers button:hover, .plan-size-button:hover, .plan-zone-button:hover { background: var(--accent-light); color: var(--text); }
.plan-numbers button.mine { box-shadow: inset 0 0 0 2.5px var(--brand-blue); }
.plan-numbers button.active, .plan-zone-button.active { background: var(--accent); color: var(--on-blue); box-shadow: inset 0 0 0 2px var(--accent), inset 0 0 0 3.5px var(--on-blue); }
.plan-size-button { width: 100%; margin-top: .75rem; }
.plan-size-button.active { background: var(--signal); color: var(--on-blue); box-shadow: none; }
.plan-zones { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(5.4rem, 1fr)); gap: .4rem; }
.plan-zone-button { width: 100%; display: flex; align-items: center; justify-content: center; gap: .45rem; white-space: nowrap; padding-left: .4rem; padding-right: .4rem; }
.plan-zone-button i { width: .75rem; height: .75rem; border-radius: 3px; background: var(--zf); }
.plan-zone-button.active i { box-shadow: 0 0 0 1.5px var(--on-blue); }
.plan-source { font-size: var(--fs-xs); color: var(--text-muted); }

@media (max-width: 1099px) {
  .plan { grid-template-columns: minmax(0, 1fr); gap: 1.75rem; }
  .plan-card { height: 62vh; min-height: 360px; }
}
@media print {
  .plan { grid-template-columns: 1fr; }
  .plan-tools, .plan-search, .plan-page .card:not(#plan-info) { display: none; }
  .plan-card { height: 90vh; }
}

/* ---------- Schmale Bildschirme --------------------------------------------- */
@media (max-width: 560px) {
  .field-row { grid-template-columns: 1fr 1fr; }
  .field-row p:first-child { grid-column: 1 / -1; }
  .field-row.registration-fields, .field-row.field-row-2 { grid-template-columns: 1fr; }
  .field-row.field-row-2 p:first-child { grid-column: auto; }
  .event-link { grid-template-columns: 3.6rem minmax(0, 1fr); }
  .event-subtle .event-link { grid-template-columns: 3.6rem minmax(0, 1fr); }
  .event .kind-tag { display: none; }
  .event-tags { grid-column: 2; align-items: flex-start; }
  .event-tags:not(:has(.internal-tag)) { display: none; }
  .event-facts { grid-template-columns: 1fr; gap: .1rem; }
  .event-facts dd { margin-bottom: .5rem; }
  /* Frondienst-Einträge: Datum als kleine Zeile oben, darunter Text | Stunden | Bearbeiten */
  .cw-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: .1rem .6rem; }
  .cw-date { grid-column: 1 / -1; width: auto; font-size: var(--fs-xs); }
}

/* ---------- Handy: blaue Kopfzeile, Tab-Leiste unten -------------------------- */
@media (max-width: 860px) {
  .mobile-only { display: flex !important; }
  .phone-only { display: block; }
  .desktop-nav, .module-tabs { display: none; }
  .phone-nav { display: block; }
  .phone-nav[open] { display: flex; }
  .module-here { display: block; margin: -.25rem 0 1.5rem; font-size: var(--fs-lg); font-weight: 650; color: var(--text-muted); }
  /* Tippflächen auf dem Handy mindestens 44 px: Schnellwahl Stunden, Papierkorb in der Dokumentliste */
  .chip { min-height: 40px; }
  .doc-delete button { width: 2.75rem; height: 2.75rem; }
  .doc-item:has(.doc-delete) .doc-row, .doc-list.with-delete .doc-row { padding-right: 3.1rem; }
  /* Reiterzeile: enger, damit mehr Reiter Platz haben; der Rest lässt sich seitlich schieben (ohne Balken) */
  .tabs { gap: 1.25rem; }

  /* Angesprungenes (Anker, Tab-Taste) nicht unter Kopfzeile oder Tab-Leiste */
  html {
    scroll-padding-top: calc(4.5rem + env(safe-area-inset-top));
    scroll-padding-bottom: calc(var(--tabbar) + 1rem + env(safe-area-inset-bottom));
  }
  .topbar { display: flex; position: sticky; top: 0; z-index: 10; }
  .content {
    padding: 1.25rem calc(1rem + env(safe-area-inset-right)) calc(var(--tabbar) + 2.5rem + env(safe-area-inset-bottom)) calc(1.1rem + env(safe-area-inset-left));
  }
  h1 { font-size: var(--fs-2xl); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1rem; }
  .stats .stat { margin: 0; padding: .85rem 1rem; }
  .stats .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }  /* ungerade Anzahl: letzte Kachel über die ganze Breite */
  /* genau drei Kennzahlen: in einer Reihe; Label, Zahl und Zeile stehen über alle drei auf gleicher Höhe (subgrid) */
  .stats:has(> .stat:nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, auto); gap: 0 .5rem; }
  .stats:has(> .stat:nth-child(3):last-child) > .stat { grid-column: auto; grid-row: span 3; display: grid; grid-template-rows: subgrid; padding: .75rem .8rem; }
  .stats:has(> .stat:nth-child(3):last-child) .label { align-self: end; margin-bottom: .25rem; letter-spacing: .04em; }
  .stats:has(> .stat:nth-child(3):last-child) .stat strong { font-size: var(--fs-xl); }
  .stats:has(> .stat:nth-child(3):last-child) .stat > small { font-size: var(--fs-xs); white-space: normal; hyphens: auto; overflow-wrap: anywhere; }  /* umbrechen statt «…» */
  .dash-greeting .sign { display: none; }  /* das Schild steht auf dem Handy schon in der Kopfzeile */
  .stat strong { font-size: var(--fs-2xl); }
  .card { padding: 1.1rem 1.1rem; margin-bottom: 1rem; }
  .next-event .event-link { grid-template-columns: 4rem minmax(0, 1fr); }
  .next-event .event-date strong { font-size: 2rem; }
  .next-event .event-link .event-title { font-size: var(--fs-lg); }
  .stepper { max-width: 14rem; }
  .page-head { margin-bottom: 1.25rem; }

  /* Seitenleiste wird zum Vollbild-Menü, geöffnet über «Mehr» (#menu) */
  .sidebar { display: none; }
  .sidebar:target {
    display: flex; position: fixed; inset: 0; z-index: 30; width: auto; height: auto;
    padding: calc(1.75rem + env(safe-area-inset-top)) calc(1rem + env(safe-area-inset-right))
      calc(var(--tabbar) + 1.5rem + env(safe-area-inset-bottom)) calc(1rem + env(safe-area-inset-left));
    overscroll-behavior: contain;  /* Wischen im Menü scrollt nicht die Seite darunter */
  }
  .sidebar:target .nav-link { min-height: 46px; font-size: var(--fs-base); }

  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    height: calc(var(--tabbar) + env(safe-area-inset-bottom));
    padding: 0 calc(.25rem + env(safe-area-inset-right)) env(safe-area-inset-bottom) calc(.25rem + env(safe-area-inset-left));
    background: var(--surface); border-top: 1px solid var(--line);
  }
  .tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem;
    min-width: 0; color: var(--text-muted); font-size: var(--fs-2xs); font-weight: 600; text-decoration: none;
  }
  .tab span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .tab.active { color: var(--accent-text); }
  .tab .tab-icon { position: relative; display: block; height: 24px; overflow: visible; }
  .tab .nav-count { position: absolute; left: 100%; top: -5px; min-width: 0; margin-left: 1px; padding: 0; background: none; color: var(--signal); font-size: var(--fs-xs); overflow: visible; }
  .shell.without-nav .content { padding-bottom: 2rem; }
}
.card p > .button + .button { margin-left: .5rem; }

/* ---------- Dunkelmodus: Farben der Termin-Arten (kind-colors.css) aufhellen ---- */
.content .kind-tag { color: light-dark(var(--kind-text, #4a544f), color-mix(in srgb, var(--kind-text, #4a544f) 40%, #fff)); }
.event::before { background: light-dark(var(--kind-text, #1486ae), color-mix(in srgb, var(--kind-text, #1486ae) 55%, #fff)); }

/* Darstellung wählen im Profil: Knöpfe wie bei der Frondienst-Kategorie */
.theme-choice { border: 0; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Reservationen: Monatsraster (apps/reservations) ---------------------
   Belegung als Balken unter der Zahl: halb = teilweise, ganz = ganzer Tag. Fremde Reservationen ohne Namen. */
/* Kalender: breit Agenda links (3/5), rechts «Als Nächstes» und Monatsblatt; im HTML steht die rechte Spalte zuerst */
.cal-grid { grid-template-columns: minmax(0, 1fr); }  /* Reiterzeile (overflow) darf die Spalte nicht aufdrücken */
@media (min-width: 1100px) { .cal-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } .cal-grid > :last-child { order: -1; } }
@media (max-width: 700px) { .month-sheet { display: none; } }
/* Vergangene: Kalenderblätter grau, Archiv-Jahre als Liste mit Anzahl */
.event-list-past .cal-month { --kind: var(--text-muted); }
.event-list-past .event-title { color: var(--text-muted); }
.archive-years { list-style: none; margin: 0; padding: 0; }
.archive-years a { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .55rem .6rem; border-radius: var(--radius-small); color: var(--text); text-decoration: none; }
.archive-years a:hover { background: var(--accent-light); }
.archive-years a.active { background: var(--accent-light); font-weight: 650; }
.archive-years small { color: var(--text-muted); font-size: var(--fs-sm); }  /* Handy: Agenda zuerst, das Monatsblatt wäre nur im Weg */
.month-sheet .room-day a, .month-sheet .room-day span { min-height: 36px; }
.month-sheet .room-day span { color: var(--text-muted); }
.room-month-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; }
.room-month-head h2 { margin: 0; font-size: var(--fs-lg); }
.room-next .icon { transform: scaleX(-1); }
.room-month { width: 100%; border-collapse: collapse; table-layout: fixed; font-variant-numeric: tabular-nums; }
.room-month th { padding: .35rem 0; font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); }
.room-day { padding: 2px; text-align: center; }
.room-day a, .room-day span {
  position: relative; display: grid; place-items: center; min-height: 42px; border-radius: var(--radius-small);
  color: var(--text); text-decoration: none; font-weight: 600;
}
.room-day a:hover { background: var(--accent-light); }
.room-day span { color: var(--text-muted); font-weight: 400; }
.room-day a::after, .room-day span::after {
  content: ""; position: absolute; left: 22%; bottom: 7px; height: 4px; border-radius: 2px; width: 0;
}
.room-teilweise a::after, .room-teilweise span::after { width: 28%; background: var(--brand-blue); }
.room-belegt a::after, .room-belegt span::after { width: 56%; background: var(--brand-blue); }
/* Tage mit Reservation leicht hinterlegt (ganzer Tag etwas kräftiger), dazu der Balken */
.room-teilweise a, .room-teilweise span { background: var(--accent-light); }
.room-belegt a, .room-belegt span { background: color-mix(in srgb, var(--brand-blue) 22%, transparent); }
.room-teilweise a:hover { background: color-mix(in srgb, var(--brand-blue) 22%, transparent); }
.room-outside span { visibility: hidden; }
/* Vergangene Tage: blass, Belegung nur noch angedeutet; heute mit Rahmen */
.room-past span { opacity: .35; }
.room-past span::after { background: var(--line-strong); }
.room-today a, .room-today span { box-shadow: inset 0 0 0 2px var(--brand-blue); font-weight: 700; color: var(--text); }
.room-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: .5rem 0 0; }
.room-key { display: inline-block; height: 4px; border-radius: 2px; background: var(--brand-blue); margin-left: .6rem; }
.room-key:first-child { margin-left: 0; }
.room-key-teilweise { width: 12px; }
.room-key-belegt { width: 24px; }
.room-slots { list-style: none; margin: 0; padding: 0; }
.room-slots li { display: grid; grid-template-columns: 5.5rem 7.5rem minmax(0, 1fr); gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.room-slots li:last-child { border-bottom: 0; }
.room-slot-date { font-weight: 600; }
.room-slot-time { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.room-slot-angefragt .room-slot-what { color: var(--text-muted); font-style: italic; }
.room-when { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); }
.room-when p { margin-bottom: 0; }
.room-when-hint { margin: .35rem 0 1.25rem; }
.room-rates td { font-variant-numeric: tabular-nums; }
.room-block { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.room-block form { margin: 0; }
@media (max-width: 560px) {
  .room-slots li { grid-template-columns: 4.2rem 6.6rem minmax(0, 1fr); gap: .5rem; font-size: var(--fs-ui); }
  .room-when { grid-template-columns: 1fr 1fr; row-gap: 1rem; }
  .room-when p:first-child { grid-column: 1 / -1; }
}
.room-message { margin: 1rem 0; padding-left: .9rem; border-left: 3px solid var(--brand-blue); }
.room-message .meta { margin: 0 0 .25rem; }
.room-message p:last-child { margin-bottom: 0; }
.room-log { list-style: none; margin: 0; padding: 0; }
.room-log li { padding: .45rem 0; border-bottom: 1px solid var(--line); }
.room-billing-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; margin-bottom: 1rem; }
.room-years { display: flex; gap: 1rem; }
.room-years a { color: var(--text-muted); text-decoration: none; font-weight: 500; }
.room-years a.active { color: var(--text); font-weight: 700; text-decoration: underline; text-decoration-color: var(--brand-blue); text-decoration-thickness: 3px; text-underline-offset: .35em; }
.room-sums { margin: 0 0 1.5rem; }
.room-open { color: var(--signal); font-weight: 700; }
.room-amount { font-variant-numeric: tabular-nums; white-space: nowrap; }
.room-amount small { display: block; white-space: normal; color: var(--text-muted); font-size: var(--fs-sm); }
.room-stats td { font-variant-numeric: tabular-nums; }
.room-stats-total th, .room-stats-total td { font-weight: 700; border-top: 2px solid var(--line-strong); }
.tabs-saved { display: flex; align-items: center; gap: .4rem; margin: 0 0 .75rem; color: var(--success); font-weight: 650; }

/* Schadenmeldungen: Zeile mit Vorschaubild, Fotos auf der Detailseite, Status als Text */
.damage-row { display: flex; gap: .9rem; align-items: flex-start; }
.damage-row > span { min-width: 0; }
.damage-thumb { flex: none; width: 64px; height: 64px; border-radius: var(--radius-small); object-fit: cover; background: var(--line); }
.damage-thumb-empty { display: block; }
.damage-row.done .damage-thumb { opacity: .6; }
.damage-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: .6rem; margin: 1.25rem 0; }
.damage-photos img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-small); }
/* Status als Pille: Farbe nach Stand (offen = Signal, in Arbeit = Akzent, erledigt = Grün, sonst leise) */
.status-line { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; }
.pill:is(.damage-status-reported, .room-status-requested, .concern-status-new, .project-status-deferred) { background: var(--warning-background); color: var(--warning-text); }
.pill:is(.damage-status-done, .room-status-confirmed, .concern-status-answered, .concern-status-done, .project-status-closed) { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }
.pill:is(.damage-status-no_action, .damage-status-withdrawn, .room-status-rejected, .room-status-withdrawn, .room-status-closed, .project-status-idea, .project-status-rejected) { background: color-mix(in srgb, var(--text-muted) 12%, transparent); color: var(--text-muted); }
.item small.status-line { margin-top: .25rem; }
/* Stand eines Anliegens kann ein ganzer Satz sein («Wird an der Vorstandssitzung … besprochen»): darf umbrechen */
.pill[class*="concern-status"] { white-space: normal; border-radius: 10px; }
