/* Designsystem DigitaleHausakte (nach Prototyp). Markenfarben (--brand, --brand-soft) setzt base.html je Betrieb. */

/* Schriften lokal; die 600er-Datei deckt auch 700 ab (Fettschnitt, siehe PR). */
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../fonts/ibm-plex-sans-regular.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("../fonts/ibm-plex-sans-500.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600 700; font-style: normal; font-display: swap;
  src: url("../fonts/ibm-plex-sans-600.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../fonts/ibm-plex-mono-regular.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("../fonts/ibm-plex-mono-500.woff2") format("woff2"); }

/* Hell ist Standard; Dunkel per System oder data-theme (auch auf einzelnen Elementen, z. B. in der Musterseite). */
:root, [data-theme="light"] {
  --bg: #f4f5f6; --surface: #fff; --surface-2: #eef0f2; --line: #dcdfe3;
  --fg: #1d2126; --muted: #5d646d; --brand-ink: #fff;
  --ok: #2f8a3e; --warn: #b86e00; --crit: #c8102e;
  --brand-soft: color-mix(in srgb, var(--brand) 12%, var(--surface));
  --link: var(--brand);
  color-scheme: light;
}
:root {
  --brand: #1f4e79;
  --r: 10px;
  --f-ui: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-data: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14171a; --surface: #1c2024; --surface-2: #252a2f; --line: #343a41;
    --fg: #e8eaed; --muted: #9aa2ab; --ok: #5cbf6a; --warn: #e6a03a; --crit: #ff5a6e;
    --brand-soft: color-mix(in srgb, var(--brand) 22%, var(--surface));
    --link: color-mix(in srgb, var(--brand) 40%, #fff);
    color-scheme: dark;
  }
}
[data-theme="dark"] {
  --bg: #14171a; --surface: #1c2024; --surface-2: #252a2f; --line: #343a41;
  --fg: #e8eaed; --muted: #9aa2ab; --ok: #5cbf6a; --warn: #e6a03a; --crit: #ff5a6e;
  --brand-soft: color-mix(in srgb, var(--brand) 22%, var(--surface));
  --link: color-mix(in srgb, var(--brand) 40%, #fff);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg); font: 1rem/1.5 var(--f-ui);
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right);
  overflow-wrap: anywhere;
}
[x-cloak] { display: none !important; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; font-weight: 600; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
a { color: var(--link); }
img, svg { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.25rem 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.zahl, .daten, td.zahl { font-family: var(--f-data); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.nur-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Kopfleiste (Prototyp: header.top) */
.kopf {
  background: var(--brand); color: var(--brand-ink); padding-block: 12px;
  padding-top: calc(12px + env(safe-area-inset-top));
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.kopf a { color: inherit; }
.brandmark { display: flex; align-items: center; gap: 12px; min-width: 0; text-decoration: none; }
.brandmark .logo { background: #fff; border-radius: 8px; padding: 4px 8px; display: flex; align-items: center; height: 40px; flex: none; }
.brandmark .logo img { height: 30px; width: auto; display: block; }
.brandmark .logo .initiale, .brandmark .logo .kurz { color: var(--brand); font-weight: 600; white-space: nowrap; }
.brandmark .logo .initiale { font-size: 20px; font-weight: 700; margin-right: 6px; }
.brandmark .logo .kurz { font-size: 13px; }
.brandmark .name { font-weight: 600; font-size: 15px; line-height: 1.2; }
.brandmark .name small { display: block; font-weight: 400; opacity: .85; font-size: 12.5px; }
.kopf__rechts { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.seg { display: flex; background: rgba(255, 255, 255, .16); border-radius: 999px; padding: 3px; margin: 0; }
.seg button { border: 0; background: transparent; color: var(--brand-ink); padding: 6px 14px; border-radius: 999px; font-weight: 500; font-size: 13px; cursor: pointer; }
.seg button[aria-pressed=true] { background: #fff; color: #1d2126; }
.kopf .anmelden { color: var(--brand-ink); font-weight: 500; }

/* Benutzermenü */
.benutzer { position: relative; }
.benutzer__knopf {
  width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer; font-weight: 600; font-size: 13px;
  background: rgba(255, 255, 255, .16); color: var(--brand-ink); display: grid; place-items: center;
}
.benutzer__knopf:hover, .benutzer__knopf[aria-expanded=true] { background: rgba(255, 255, 255, .3); }
.menue {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; min-width: 220px; padding: 6px; color: var(--fg);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .22);
}
.menue__kopf { padding: 8px 10px; color: var(--muted); font-size: 12.5px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menue a, .menue button.menue__eintrag {
  display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; border-radius: 8px;
  color: var(--fg); text-decoration: none; font-weight: 500; cursor: pointer;
}
.menue a:hover, .menue button.menue__eintrag:hover { background: var(--surface-2); }
.menue__titel { padding: 8px 10px 4px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.themenwahl { display: flex; background: var(--surface-2); border-radius: 999px; padding: 3px; margin: 0 6px 6px; }
.themenwahl button { flex: 1; border: 0; background: transparent; color: var(--fg); padding: 5px 10px; border-radius: 999px; font-weight: 500; font-size: 13px; cursor: pointer; }
.themenwahl button[aria-pressed=true] { background: var(--brand); color: var(--brand-ink); }
.menue form { margin: 0; }

/* Aufbau (Prototyp: .shell) */
.app { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.shell {
  display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; max-width: 1280px; width: 100%; margin: 0 auto;
  padding: 20px max(16px, env(safe-area-inset-left, 0px)) calc(20px + env(safe-area-inset-bottom));
}
.shell--einspaltig { grid-template-columns: minmax(0, 1fr); }
aside.side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
main.inhalt { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
main.inhalt > .panel > h1:first-child { margin-top: 0; }
.navhome {
  display: flex; gap: 10px; align-items: center; width: 100%; border: 1px solid var(--line); background: var(--surface);
  border-radius: var(--r); padding: 10px 12px; font-weight: 600; text-decoration: none; color: var(--fg);
}
.navhome[aria-current=true] { border-color: var(--brand); background: var(--brand-soft); }
.side .search { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); min-height: 0; }
.sidesuche { margin: 0; }
.sidehead { display: flex; justify-content: space-between; padding: 10px 12px 0; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.objlist { list-style: none; margin: 0; padding: 4px; }
.objlist a { display: grid; gap: 2px; padding: 10px; border-radius: 8px; text-decoration: none; color: var(--fg); }
.objlist a:hover { background: var(--surface-2); }
.objlist a[aria-current=true] { background: var(--brand-soft); }
.objlist .t { font-weight: 600; }
.objlist .a { color: var(--muted); font-size: 12.5px; }
.objlist .leer-zeile { padding: 10px; }
.dots { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; align-items: center; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.objs .btn { margin: 4px 8px 10px; }
.objselect { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  aside.side .objs, aside.side .search { display: none; }
  .objselect { display: block; width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); min-height: 0; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kopf__rechts { margin-left: 0; }
}

/* Aktenkopf */
.ohead { padding: 18px 20px; display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.modal-wurzel { display: contents; }
.ohead h1 { margin: 0; font-size: 22px; }
.ohead .sub { color: var(--muted); margin-top: 2px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mehr { position: relative; }
.mehr .btn { min-width: 40px; }
.mehr .menue { min-width: 200px; }

/* Reiter und Inhalt in einem Panel (Prototyp: .tabs, .tabbody) */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 12px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 12px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; margin-bottom: -1px; }
.tabs a:hover { color: var(--fg); }
.tabs a[aria-selected=true], .tabs a[aria-current=page] { color: var(--fg); border-bottom-color: var(--brand); }
.tabs .zahl { font-size: 11.5px; color: var(--muted); margin-left: 4px; }
.tabbody { padding: 20px; min-width: 0; }
.tabbody h1 { font-size: 18px; margin: 0 0 12px; }
.tabbody .karte { background: none; border: 0; border-radius: 0; padding: 0; margin-bottom: 24px; }
.tabbody a.karte:hover { background: var(--surface-2); }
.tabbody .tabelle-box { border: 1px solid var(--line); border-radius: var(--r); }

/* Kennzahlen, Fotos, Listen (Prototyp) */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); min-width: 0; }
.kpi .v { font-size: 26px; font-weight: 600; font-family: var(--f-data); line-height: 1.3; }
.kpi .l { color: var(--muted); font-size: 12.5px; }
.kpi.hl { border-color: var(--brand); background: var(--brand-soft); }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; }
.grid2 h2, .tabbody h2 { font-size: 15px; margin: 0 0 12px; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.photo { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); display: flex; flex-direction: column; min-width: 0; color: var(--fg); text-decoration: none; }
.photo > a { display: flex; flex-direction: column; color: inherit; text-decoration: none; min-height: 0; }
.photo .img { aspect-ratio: 4/3; position: relative; background: var(--surface-2); }
.photo .img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .img .ficon { position: absolute; inset: 0; margin: auto; }
.stamp { position: absolute; left: 8px; bottom: 8px; background: rgba(0, 0, 0, .62); color: #fff; font-family: var(--f-data); font-size: 11px; padding: 2px 6px; border-radius: 4px; }
.photo .meta { padding: 10px 12px; display: grid; gap: 2px; }
.photo .meta .t { font-weight: 600; }
.photo .meta .s { color: var(--muted); font-size: 12.5px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 180px; }
.list .t { font-weight: 500; }
.list .s { color: var(--muted); font-size: 12.5px; }
.ficon { width: 36px; height: 44px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 10px; font-weight: 700; color: var(--muted); font-family: var(--f-data); flex: none; }
.empty { color: var(--muted); padding: 20px 0; }
.pill { display: inline-flex; align-items: center; font-size: 12px; padding: 2px 8px; border-radius: 999px; font-weight: 500; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.pill.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.pill.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.pill.crit { color: var(--crit); background: color-mix(in srgb, var(--crit) 14%, transparent); }

/* Karten (ältere Bausteine, Werte wie .panel) */
.karte { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 20px; margin: 0 0 16px; min-width: 0; }
.karte__kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.karte__titel { margin: 0; font-size: 15px; }
.karte__meta { color: var(--muted); font-size: 12.5px; }
.karte > :last-child { margin-bottom: 0; }
a.karte { display: block; color: inherit; text-decoration: none; }
a.karte:hover { border-color: var(--brand); }
.raster { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }

/* Tabellen (Prototyp: table.data; auf schmalen Schirmen im eigenen Scroll-Container) */
.tabelle-box { overflow-x: auto; margin-bottom: 16px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; white-space: nowrap; padding: 8px 10px; }
tr:last-child td { border-bottom: 0; }
td.zahl, th.zahl { text-align: right; font-family: var(--f-data); font-variant-numeric: tabular-nums; }

/* Formulare */
.formfeld { margin: 0 0 1rem; }
.formfeld label, .formfeld__label { display: block; font-weight: 500; margin-bottom: .3rem; }
.formfeld__pflicht { color: var(--crit); }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  width: 100%; font: inherit; color: var(--fg); background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: .55rem .7rem; min-height: 44px;
}
textarea { min-height: 6rem; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: 2px solid var(--brand-soft); }
input:disabled, textarea:disabled, select:disabled { background: var(--surface-2); color: var(--muted); }
input[type=checkbox], input[type=radio] { width: 1.1rem; height: 1.1rem; vertical-align: middle; margin-right: .4rem; accent-color: var(--brand); }
.formfeld__hilfe { display: block; color: var(--muted); font-size: .85rem; margin-top: .3rem; }
.formfeld__fehler { color: var(--crit); font-size: .9rem; margin: .3rem 0 0; padding: 0; list-style: none; }
.formfeld--fehler input, .formfeld--fehler select, .formfeld--fehler textarea { border-color: var(--crit); }
.formular-aktionen { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }

/* Buttons (Prototyp: .btn, .btn.primary) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 14px;
  font: inherit; font-weight: 500; text-decoration: none; cursor: pointer; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--fg);
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.primary:hover { background: var(--brand); filter: brightness(1.12); }
.btn--gefahr { background: var(--crit); border-color: var(--crit); color: #fff; }
.btn--gefahr:hover { background: var(--crit); filter: brightness(1.1); }
.btn--klein { min-height: 34px; padding: 4px 10px; font-size: 13px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn--breit { width: 100%; }

/* Leerer Zustand (Prototyp: .empty) */
.leer { color: var(--muted); padding: 20px 0; }
.leer__titel { color: var(--fg); font-weight: 600; margin: 0 0 4px; }
.leer p { margin: 0 0 12px; max-width: 60ch; }
.leer > :last-child { margin-bottom: 0; }

/* Meldungen im Formular/Seite */
.hinweis { padding: .7rem .9rem; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); margin-bottom: 1rem; }
.hinweis--ok { border-color: var(--ok); } .hinweis--warn { border-color: var(--warn); } .hinweis--crit { border-color: var(--crit); }

/* Toasts */
.toasts {
  position: fixed; z-index: 1100; left: 0; right: 0; bottom: calc(.75rem + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: 0 .75rem; pointer-events: none;
}
.toast {
  pointer-events: auto; display: flex; gap: .75rem; align-items: flex-start; width: 100%; max-width: 28rem;
  background: var(--surface); color: var(--fg); border: 1px solid var(--line); border-left: 5px solid var(--muted);
  border-radius: 8px; padding: .7rem .9rem; box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
}
.toast--ok { border-left-color: var(--ok); } .toast--warn { border-left-color: var(--warn); } .toast--crit { border-left-color: var(--crit); }
.toast__text { flex: 1; }
.toast__zu { background: none; border: 0; color: var(--muted); font-size: 1.2rem; line-height: 1; cursor: pointer; padding: 0 .2rem; }

/* Modals */
.modal-hintergrund {
  position: fixed; inset: 0; z-index: 1000; background: rgba(0, 0, 0, .55); display: flex; align-items: flex-end; justify-content: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.modal {
  background: var(--surface); color: var(--fg); width: 100%; max-width: 34rem; max-height: 90vh; max-height: 90dvh; overflow-y: auto;
  border-radius: var(--r) var(--r) 0 0; border: 1px solid var(--line); padding: 1.1rem 1.25rem 1.25rem;
}
.modal__kopf { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .75rem; }
.modal__kopf h2 { margin: 0; }
.modal__zu { background: none; border: 0; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--muted); min-width: 44px; min-height: 44px; }
@media (min-width: 600px) {
  .modal-hintergrund { align-items: center; }
  .modal { border-radius: var(--r); }
}

/* HTMX-Ladeindikator */
.lade-balken { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 1200; background: var(--brand-ink); opacity: 0; pointer-events: none; }
.lade-balken::after { content: ""; display: block; height: 100%; width: 30%; background: var(--brand); animation: lade 1s ease-in-out infinite; }
body.laedt .lade-balken { opacity: 1; }
.htmx-indicator { opacity: 0; transition: opacity .15s; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
@keyframes lade { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
@media (prefers-reduced-motion: reduce) { .lade-balken::after { animation: none; width: 100%; } }

/* Einfaches Layout (Login, Einladung, Fehler) */
.einfach { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1rem; gap: 1rem; min-width: 0; }
.einfach__marke { display: flex; align-items: center; gap: .75rem; background: var(--brand); color: var(--brand-ink); border-radius: var(--r); padding: .6rem 1rem; width: 100%; max-width: 28rem; }
.einfach__marke { text-decoration: none; color: var(--brand-ink); }
.einfach__karte { width: 100%; max-width: 28rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1.25rem; }
.einfach__karte .btn { margin-top: .25rem; }
.einfach__fuss { color: var(--muted); font-size: .85rem; text-align: center; }
.einfach__fuss .themenwahl { margin: 0 auto; width: max-content; }
.fehlercode { font: 600 3rem/1 var(--f-data); color: var(--brand); margin: 0 0 .5rem; }
.qr img, img.qr { background: #fff; padding: .5rem; border-radius: 8px; display: block; margin: 0 auto 1rem; max-width: 220px; }

/* Musterseite */
.muster section { margin-bottom: 2rem; }
.muster-paar { display: grid; gap: 1rem; }
@media (min-width: 900px) { .muster-paar { grid-template-columns: 1fr 1fr; } }
.muster-feld { padding: 1rem; border-radius: var(--r); background: var(--bg); color: var(--fg); border: 1px solid var(--line); }

/* Akten-Unterseiten */
.akte-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin: 0 0 16px; }
.akte-kopf h1 { margin: 0; font-size: 18px; }
.kartenliste { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Akte: Kopfzeile mit Werkzeugen, Abschnitte */
.werkzeuge { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.tagesname { color: var(--muted); font-size: 13px; font-weight: 500; text-transform: none; }

/* Einträge: Fotos als .photos, sonst .list (Prototyp) */
.list li > a.zeile { display: flex; gap: 12px; align-items: center; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.list li > a.zeile:hover .t { text-decoration: underline; }
.abschnitt-kopf { margin: 20px 0 12px; font-size: 15px; }
.abschnitt-kopf:first-child { margin-top: 0; }
.notiz-form, .filter { margin-top: 1rem; }
.filter__felder { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); }

/* Eintragsdetail */
.blaettern { display: flex; justify-content: space-between; margin-bottom: .5rem; }
.eintrag-detail__titel { margin-top: 0; overflow-wrap: anywhere; }
.eintrag-detail__bild { max-width: 100%; height: auto; display: block; margin: 0 auto 1rem; border-radius: 8px; }
.metadaten { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; margin: 0 0 1rem; }
.metadaten dt { color: var(--muted); } .metadaten dd { margin: 0; }
.notiz-text { overflow-wrap: anywhere; }
.bearbeiten { margin: 1rem 0; } .bearbeiten summary { cursor: pointer; font-weight: 500; min-height: 44px; display: flex; align-items: center; }

/* Upload-Dialog */
.ablagefeld { border: 2px dashed var(--line); border-radius: var(--r); padding: 1rem; text-align: center; margin-bottom: 1rem; }
.ablagefeld--aktiv { border-color: var(--brand); background: var(--brand-soft); }
.ablagefeld__text { margin: 0 0 .5rem; font-weight: 500; }
.ablagefeld .formular-aktionen { justify-content: center; margin-top: 0; }
.ablagefeld__hilfe { font-size: .85rem; margin: .75rem 0 0; }
.nur-touch { display: none; }
@media (pointer: coarse) { .nur-touch { display: inline-flex; } }
.uploadliste { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .5rem; }
.uploadzeile { border: 1px solid var(--line); border-radius: 8px; padding: .5rem .7rem; display: grid; gap: .4rem; }
.uploadzeile__kopf { display: flex; justify-content: space-between; gap: .75rem; align-items: baseline; }
.uploadzeile__name { font-weight: 500; overflow-wrap: anywhere; }
.uploadzeile__status { font-size: .85rem; color: var(--muted); text-align: right; }
.uploadzeile--fehler .uploadzeile__status, .uploadzeile--abgebrochen .uploadzeile__status { color: var(--crit); }
.uploadzeile--fertig .uploadzeile__status { color: var(--ok); }
.uploadzeile progress { width: 100%; height: .6rem; accent-color: var(--brand); }
.uploadzeile__aktionen { display: flex; gap: .5rem; flex-wrap: wrap; }
.uploadzeile__aktionen:empty { display: none; }
.uploadfelder { border: 0; padding: 0; margin: 0; }

/* Anlagen, Wartung, QR-Etiketten */
.daten { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
.daten dt { color: var(--muted); }
.daten dd { margin: 0; }
.daten__wert { font-family: var(--f-data); }
.wartungsplan { padding: .6rem 0; border-top: 1px solid var(--line); }
.wartungsplan:first-of-type { border-top: 0; }
.wartungsplan__kopf { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.wartungsplan__historie { margin-top: .5rem; font-size: .9rem; }
.etiketten { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 1rem; }
.etikett { margin: 0; padding: .75rem; border: 1px dashed var(--muted); border-radius: var(--r); background: #fff; color: #000; display: flex; gap: .75rem; align-items: center; break-inside: avoid; }
.etikett__qr { flex: none; width: 32mm; height: 32mm; }
.etikett .qr-svg { width: 100%; height: 100%; display: block; }
.etikett figcaption { display: grid; gap: .2rem; min-width: 0; }
.etikett__betrieb { font-size: .9rem; }
.etikett__url { font-family: var(--f-data); font-size: .75rem; overflow-wrap: anywhere; }
@media print {
  @page { size: A4; margin: 10mm; }
  .kopf, aside.side, .tabs, .ohead, .nicht-drucken, .toast, .lade-balken { display: none !important; }
  .app, .shell, .inhalt, .tabbody, .panel { display: block !important; padding: 0 !important; margin: 0 !important; border: 0 !important; }
  body { background: #fff; }
  .etiketten { grid-template-columns: repeat(2, 90mm); gap: 5mm; }
  .etikett { border: 1px solid #000; height: 50mm; padding: 4mm; }
}

/* Installationshinweis (iOS) */
.ios-hinweis { position: fixed; left: .75rem; right: .75rem; bottom: calc(.75rem + env(safe-area-inset-bottom)); z-index: 60; display: flex; gap: .75rem; align-items: center; justify-content: space-between; padding: .75rem 1rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface, #fff); color: inherit; box-shadow: 0 4px 16px rgb(0 0 0 / .2); }
.ios-hinweis p { margin: 0; }
.ios-hinweis .btn { flex: none; }

/* Kundenansicht */
.kontakte { display: grid; gap: 12px; padding: 0; margin: 0; list-style: none; }
.kontakte li { display: grid; gap: 2px; }
@media print { .ios-hinweis { display: none !important; } }
