/* Scanner-Dashboard — app-spezifische Overrides
   Basis: /almas-design.css */

.quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.filter-chip {
  white-space: nowrap;
}
.filter-chip.active {
  background: var(--almas-red);
  color: var(--text-inverse);
  border-color: var(--almas-red);
}

.search-row {
  margin-bottom: 12px;
}

.almas-table tr.clickable {
  cursor: pointer;
}
.almas-table tr.clickable:hover {
  background: var(--bg-tertiary);
}

.row-actions {
  white-space: nowrap;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}
@media (max-width: 640px) {
  .detail-grid { grid-template-columns: 1fr; }
}

.scanner-detail-modal .almas-modal-body {
  padding: 16px;
}
.scanner-detail-split {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(420px, 1.4fr);
  gap: 16px;
  align-items: stretch;
  min-height: 70vh;
}
.scanner-detail-left {
  overflow-y: auto;
  max-height: 78vh;
  padding-right: 4px;
}
.scanner-detail-right {
  display: flex;
}
.pdf-preview-frame {
  width: 100%;
  height: 78vh;
  min-height: 480px;
  border: 0;
  border-radius: 10px;
  background: #1e1e1e;
}
@media (max-width: 900px) {
  .scanner-detail-split { grid-template-columns: 1fr; }
  .scanner-detail-left { max-height: none; }
  .pdf-preview-frame { height: 60vh; min-height: 360px; }
}
.detail-row {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-secondary);
}
.detail-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-tertiary);
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}
.detail-value {
  font-size: 14px;
  color: var(--text-primary);
  word-break: break-word;
}

.audit-list {
  list-style: none;
  margin: 8px 0 0 0;
  padding: 0;
}
.audit-list li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border-secondary);
  font-size: 13px;
  color: var(--text-secondary);
}
.audit-list li:last-child { border-bottom: none; }

/* Sofort-Card pulsiert wenn Count > 0 */
.almas-stat.pulse {
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); }
  50%      { box-shadow: 0 0 0 8px rgba(255, 59, 48, 0.15); }
}

/* Statistik-Balken */
.bar-row {
  display: grid;
  grid-template-columns: 200px 1fr 60px;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}
.bar-label {
  font-size: 13px;
  color: var(--text-primary);
}
.bar-track {
  background: var(--bg-tertiary);
  border-radius: 4px;
  height: 16px;
  overflow: hidden;
}
.bar-fill {
  background: var(--almas-red);
  height: 100%;
  border-radius: 4px;
  transition: width 250ms ease;
}
.bar-count {
  text-align: right;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.hidden { display: none !important; }
.loading-cell { padding: 40px !important; }
.text-center { text-align: center; }
.text-secondary { color: var(--text-secondary); }
.amount { text-align: right; font-variant-numeric: tabular-nums; }

/* Stand und Hinweise der alten Ansichten */
.alt-stand { color: var(--text-secondary); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.alt-veraltet, .alt-scan-hinweis { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 14px; padding: 10px 14px; margin-bottom: 12px; border-radius: 10px; font-size: 14px; }
.alt-veraltet { background: #FFF0F0; color: #8C0A14; box-shadow: inset 0 0 0 1px rgba(216, 16, 32, .22); }
.alt-scan-hinweis { background: #FFF8E8; color: #6E4400; box-shadow: inset 0 0 0 1px rgba(178, 106, 0, .18); }
.alt-scan-hinweis.alt-scan-gestoert { background: #FFF0F0; color: #8C0A14; box-shadow: inset 0 0 0 1px rgba(216, 16, 32, .22); }
.alt-veraltet .almas-btn, .alt-scan-hinweis .almas-btn { flex: none; }
.alt-gedimmt { opacity: .62; transition: opacity .2s ease; }
body.alt-zaehler-veraltet .nav-badge { opacity: .55; }

/* Viewport-fit=cover gilt für die ganze Seite, also auch hier: Nichts liegt unter Notch und Home-Indikator. */
.almas-sidebar-logo { padding-top: calc(var(--space-lg) + env(safe-area-inset-top)); }
.almas-sidebar-footer { padding-bottom: calc(var(--space-md) + env(safe-area-inset-bottom)); }
.almas-sidebar { padding-left: env(safe-area-inset-left); }
@media (max-width: 768px) {
  .almas-menu-toggle { top: calc(14px + env(safe-area-inset-top)); left: calc(14px + env(safe-area-inset-left)); }
  .almas-header { padding-top: env(safe-area-inset-top); height: calc(var(--header-height) + env(safe-area-inset-top)); }
  .almas-content { padding-bottom: calc(var(--space-md) + env(safe-area-inset-bottom)); }
  .almas-toast-container { bottom: calc(var(--space-lg) + env(safe-area-inset-bottom)); }
  /* Liegt auf dem Weg aus der Prüfliste ins Menü. */
  .almas-sidebar-user .logout { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; margin-top: 0; }
  /* Neben Menüknopf, Titel und Aktualisieren ist kaum Platz: Zwei Zeilen statt Seitenüberlauf. */
  .alt-stand { font-size: 11px; line-height: 1.15; white-space: normal; width: 44px; text-align: right; }
  .almas-header h1 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .almas-header .header-actions { flex: none; }
}

/* ═══ Prüfliste: ALMAS-Webdesign v2, fest hell. Alles hängt an .pl oder body.pl-aktiv, die übrigen Ansichten bleiben unberührt. ═══ */
.almas-main, .almas-content { min-width: 0; }
.app-version { margin-top: 8px; font-size: 11px; color: var(--almas-gray); }

.pl, .pl-nav, .pl-sheet-huelle, .pl-zoom, body.pl-aktiv {
  --rot: #FF2325;
  --rot-tief: #D81020;
  --rot-tint: rgba(255, 35, 37, .07);
  --ink: #15161A;
  --grau-text: #5C5F66;
  --linie: #E9E9ED;
  --bg-1: #FFFFFF;
  --bg-2: #F6F6F8;
  --bg-3: #F1F1F4;
  --amber: #B26A00;
  --blau: #0057B8;
  --gruen: #147A3D;
  --lila: #592041;
  --sh-1: 0 1px 2px rgba(21, 22, 26, .05), 0 2px 6px rgba(21, 22, 26, .04);
  --sh-2: 0 2px 4px rgba(21, 22, 26, .05), 0 8px 20px rgba(21, 22, 26, .07);
  --sh-3: 0 4px 8px rgba(21, 22, 26, .06), 0 18px 44px rgba(21, 22, 26, .12);
  --sh-rot: 0 6px 18px rgba(255, 35, 37, .26);
  --schrift: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color-scheme: light;
  font-family: var(--schrift);
}

/* Rahmen der App, solange die Prüfliste offen ist */
body.pl-aktiv { background: var(--bg-2); color: var(--ink); }
body.pl-aktiv .almas-sidebar { background: #fff; border-right: 1px solid var(--linie); box-shadow: var(--sh-1); }
body.pl-aktiv .almas-sidebar-logo { border-bottom-color: var(--linie); }
body.pl-aktiv .almas-sidebar-logo img { filter: none; }
body.pl-aktiv .almas-sidebar-logo .app-name, body.pl-aktiv .app-version { color: var(--grau-text); }
body.pl-aktiv .almas-sidebar nav a { color: var(--grau-text); position: relative; }
body.pl-aktiv .almas-sidebar nav a:hover { background: var(--bg-3); color: var(--ink); }
body.pl-aktiv .almas-sidebar nav a.active { background: var(--rot-tint); color: var(--rot-tief); font-weight: 600; }
body.pl-aktiv .almas-sidebar nav a.active::before { content: ""; position: absolute; left: -8px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--rot); }
body.pl-aktiv .almas-sidebar-footer { border-top-color: var(--linie); }
body.pl-aktiv .almas-sidebar-user { color: var(--grau-text); }
body.pl-aktiv .almas-sidebar-user .name { color: var(--ink); }
body.pl-aktiv .almas-sidebar-user .logout { color: var(--rot-tief); }
body.pl-aktiv .almas-header { background: rgba(255, 255, 255, .78); border-bottom-color: var(--linie); }
body.pl-aktiv .almas-header h1 { display: flex; align-items: center; gap: 10px; color: var(--ink); }
/* Volle Form statt der feinen Strichgrafik baer.png: Die löst sich auf 44 px zu blassem Rosa auf. */
body.pl-aktiv .almas-header h1::before { content: ""; width: 40px; height: 28px; flex: none; background: url("./assets/logos/baer-voll.svg") center / contain no-repeat; }
body.pl-aktiv .almas-header .almas-btn { min-height: 36px; border-radius: 10px; }
body.pl-aktiv .almas-content { max-width: none; padding: 20px 24px 28px; }
.pl button, .pl select, .pl textarea, .pl-sheet button, .pl-sheet select, .pl-sheet textarea, .pl-nav button, .pl-zoom button { font-family: inherit; }
.pl *, .pl-sheet *, .pl-nav * { min-width: 0; }
.pl :focus-visible, .pl-nav :focus-visible, .pl-sheet :focus-visible, .pl-zoom :focus-visible { outline: 2px solid var(--rot-tief); outline-offset: 2px; }
.pl-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.nav-badge.pl-pop { animation: pl-pop .28s cubic-bezier(.2, .8, .2, 1); }

/* Hinweise */
.pl-hinweis { display: flex; align-items: center; gap: 10px; padding: 11px 16px; margin-bottom: 14px; border-radius: 14px; background: linear-gradient(135deg, #FFF8E8, #FFF3D6); color: #6E4400; font-weight: 600; font-size: 14px; box-shadow: var(--sh-1), inset 0 0 0 1px rgba(178, 106, 0, .18); animation: pl-ein .32s ease both; }
.pl-punkt { width: 9px; height: 9px; border-radius: 50%; background: var(--amber); flex: none; }
.pl-veraltet { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 14px; padding: 10px 14px; margin-bottom: 14px; border-radius: 14px; background: #FFF0F0; color: #8C0A14; font-size: 14px; box-shadow: inset 0 0 0 1px rgba(216, 16, 32, .22); }
/* Nur die Liste: Im Dokument stehen die rettenden Knöpfe, die dürfen nicht gesperrt aussehen. */
.pl-ist-veraltet .pl-liste { opacity: .62; transition: opacity .2s ease; }
.pl-lage { padding: 11px 16px; margin-bottom: 14px; border-radius: 14px; background: #FFF8E8; color: #6E4400; font-size: 14px; box-shadow: inset 0 0 0 1px rgba(178, 106, 0, .18); }
.pl-lage-rot { background: #FFF0F0; color: #8C0A14; box-shadow: inset 0 0 0 1px rgba(216, 16, 32, .22); }
.pl-lage strong { display: block; margin-bottom: 2px; }
.pl-lage p { margin: 2px 0 0; }
.pl-lage-mehr { margin-top: 6px; font-size: 13px; }
.pl-lage-mehr summary { cursor: pointer; font-weight: 600; min-height: 28px; }
.pl-lage-mehr ul { margin: 4px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; max-height: 240px; overflow-y: auto; }
.pl-lage-mehr li { overflow-wrap: anywhere; }

/* Schalter */
.pl-kopf { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.pl-schalter { display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--bg-3); box-shadow: inset 0 1px 3px rgba(21, 22, 26, .10); }
.pl-schalter button { display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px; min-height: 36px; border: 0; border-radius: 999px; background: transparent; color: var(--grau-text); font-size: 14px; font-weight: 500; cursor: pointer; transition: background .18s ease, color .18s ease, box-shadow .18s ease, transform .1s ease; }
.pl-schalter button:hover { color: var(--ink); }
.pl-schalter button:active { transform: scale(.97); }
.pl-schalter button[aria-selected="true"] { background: #fff; color: var(--ink); font-weight: 600; box-shadow: var(--sh-1); }
.pl-zahl { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 999px; font-size: 12px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.pl-zahl-pruefen { background: rgba(178, 106, 0, .13); color: #7A4800; }
.pl-zahl-vorschlag { background: rgba(0, 87, 184, .10); color: var(--blau); }
.pl-zahl-entschieden { background: rgba(20, 122, 61, .10); color: #0E5F2F; }
.pl-stand { color: var(--grau-text); font-size: 13px; font-variant-numeric: tabular-nums; }

/* Raster */
.pl-raster { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.pl-liste, .pl-detail { min-width: 0; }
.pl-detail { position: sticky; top: 72px; max-height: var(--pl-detail-max, calc(100vh - 92px)); overflow-y: auto; background: #fff; border-radius: 22px; box-shadow: var(--sh-2); padding: 20px 22px; }
.pl-detail:empty { display: none; }
.pl-raster:has(.pl-detail:empty) { grid-template-columns: minmax(0, 1fr); }
.pl-kappung { margin: 0 0 10px; padding: 9px 14px; border-radius: 12px; background: var(--bg-3); color: var(--grau-text); font-size: 13px; }
.pl-fuss { margin: 16px 2px 0; color: var(--grau-text); font-size: 12px; }

/* Tabelle */
.pl-tabelle-rahmen { background: #fff; border-radius: 22px; box-shadow: var(--sh-2); overflow: hidden; }
.pl-tabelle { width: 100%; border-collapse: collapse; font-size: 14px; table-layout: fixed; }
.pl-tabelle th { padding: 12px 14px; text-align: left; font-size: 12px; font-weight: 600; color: var(--grau-text); background: var(--bg-2); border-bottom: 1px solid var(--linie); }
.pl-tabelle th:nth-child(1) { width: 42%; }
.pl-tabelle th:nth-child(3) { width: 62px; }
.pl-tabelle th:nth-child(4) { width: 96px; }
.pl-tabelle td { padding: 10px 14px; border-bottom: 1px solid var(--linie); vertical-align: top; overflow-wrap: anywhere; }
.pl-zeile { cursor: pointer; transition: background .15s ease; }
.pl-zeile:last-child td { border-bottom: 0; }
.pl-zeile:hover { background: var(--bg-2); }
.pl-zeile.pl-gewaehlt { background: var(--rot-tint); box-shadow: inset 3px 0 0 var(--rot); }
.pl-zeile-knopf { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; width: 100%; padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; font-size: 14px; }
.pl-zeile-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.pl-zeile-titel { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.pl-zeile-nr { color: var(--grau-text); font-size: 13px; overflow-wrap: anywhere; }
.pl-zeile-grund { color: #33353A; }
.pl-zeile-datum { color: var(--grau-text); font-size: 12px; }
.pl-zahlspalte { text-align: right; font-variant-numeric: tabular-nums; }

/* Badges */
.pl-badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.pl-badge-art { background: var(--bg-3); color: var(--ink); }
.pl-badge-amber { background: rgba(178, 106, 0, .13); color: #8A5200; }
.pl-badge-blau { background: rgba(0, 87, 184, .10); color: var(--blau); }
.pl-badge-gruen { background: rgba(20, 122, 61, .11); color: var(--gruen); }
.pl-badge-grau { background: var(--bg-3); color: var(--grau-text); }
.pl-badge-lila { background: rgba(89, 32, 65, .11); color: var(--lila); }

/* Knöpfe */
.pl-knopf { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 9px 16px; border: 1px solid var(--linie); border-radius: 12px; background: #fff; color: var(--ink); font-size: 14px; font-weight: 600; cursor: pointer; box-shadow: var(--sh-1); transition: transform .12s ease, box-shadow .18s ease, background .18s ease; }
.pl-knopf:hover:not(:disabled) { box-shadow: var(--sh-2); transform: translateY(-1px); }
.pl-knopf:active:not(:disabled) { transform: scale(.97); }
.pl-knopf:disabled { opacity: .5; cursor: default; }
.pl-knopf-haupt { background: var(--rot-tief); border-color: var(--rot-tief); color: #fff; box-shadow: var(--sh-rot); }
.pl-knopf-haupt:hover:not(:disabled) { background: #BE0D1B; box-shadow: var(--sh-rot), var(--sh-2); }
.pl-knopf-leise { background: transparent; box-shadow: none; color: var(--rot-tief); border-color: transparent; }
.pl-knopf-leise:hover:not(:disabled) { background: var(--rot-tint); box-shadow: none; }
.pl-knopf-klein { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.pl-knopf.pl-arbeitet { opacity: .75; cursor: progress; }
.pl-knopf.pl-arbeitet::after { content: ''; flex: none; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: pl-dreht .8s linear infinite; }
.pl-link { border: 0; background: none; padding: 0; color: var(--rot-tief); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }

/* Zustände */
.pl-leer { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 46px 22px; text-align: center; background: #fff; border-radius: 22px; box-shadow: var(--sh-2); animation: pl-ein .32s ease both; }
.pl-leer h2 { margin: 6px 0 0; font-size: 19px; font-weight: 700; color: var(--ink); }
.pl-leer p { margin: 0 0 8px; max-width: 42ch; color: var(--grau-text); font-size: 14px; }
.pl-d-leer { box-shadow: none; padding: 40px 10px; }
.pl-fehler h2 { color: #8C0A14; }
.pl-skelett { display: grid; gap: 9px; padding: 16px; margin-bottom: 10px; background: #fff; border-radius: 18px; box-shadow: var(--sh-1); }
.pl-skelett span, .pl-d-laedt span, .pl-d-laedt-seiten i, .pl-seite-laedt { display: block; border-radius: 8px; background: linear-gradient(100deg, var(--bg-3) 30%, #FAFAFB 50%, var(--bg-3) 70%); background-size: 220% 100%; animation: pl-schimmer 1.3s linear infinite; }
.pl-skelett span { height: 13px; }
.pl-skelett span:nth-child(1) { width: 34%; }
.pl-skelett span:nth-child(2) { width: 72%; }
.pl-skelett span:nth-child(3) { width: 55%; }
.pl-d-laedt { display: grid; gap: 12px; }
.pl-d-laedt span { height: 18px; }
.pl-d-laedt span:first-child { width: 45%; }
.pl-d-laedt-seiten { display: flex; gap: 14px; margin-top: 6px; }
.pl-d-laedt-seiten i { width: 170px; height: 240px; max-width: 45%; }

/* Dokument */
.pl-d-kopf { margin-bottom: 12px; }
.pl-d-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.pl-d-titel { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.01em; color: var(--ink); overflow-wrap: anywhere; outline: none; }
.pl-d-felder { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px 16px; margin: 0 0 14px; }
.pl-d-felder dt { font-size: 12px; color: var(--grau-text); }
.pl-d-felder dd { margin: 1px 0 0; font-size: 14px; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.pl-d-vermerk { margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; background: var(--bg-2); font-size: 14px; overflow-wrap: anywhere; }
.pl-d-befunde { margin-bottom: 16px; padding: 12px 14px; border-radius: 14px; background: #FFF9EC; box-shadow: inset 0 0 0 1px rgba(178, 106, 0, .16); }
.pl-d-befunde h3, .pl-d-seiten h3 { margin: 0 0 7px; font-size: 13px; font-weight: 700; color: var(--ink); }
.pl-d-befunde ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.pl-d-befunde li { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: #4A3200; }
.pl-d-befunde li svg { flex: none; margin-top: 2px; color: var(--amber); }
.pl-d-sauber { display: flex; gap: 8px; margin: 0; font-size: 14px; color: var(--gruen); }
.pl-d-sauber svg { flex: none; }
.pl-d-befunde:has(.pl-d-sauber) { background: rgba(20, 122, 61, .06); box-shadow: inset 0 0 0 1px rgba(20, 122, 61, .14); }
.pl-d-verdeckt { display: flex; gap: 12px; margin-bottom: 16px; padding: 16px; border-radius: 16px; background: rgba(89, 32, 65, .06); box-shadow: inset 0 0 0 1px rgba(89, 32, 65, .16); color: var(--lila); }
.pl-d-verdeckt svg { flex: none; }
.pl-d-verdeckt p { margin: 4px 0 10px; color: #4A3242; font-size: 14px; }
.pl-d-verlauf { margin-top: 16px; font-size: 13px; color: var(--grau-text); }
.pl-d-verlauf summary { cursor: pointer; font-weight: 600; min-height: 28px; }
.pl-d-verlauf ul { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.pl-d-verlauf li { overflow-wrap: anywhere; }

/* Vorschaubilder */
.pl-d-seiten { margin-bottom: 16px; }
.pl-seiten { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px 6px; }
.pl-seite { margin: 0; width: 170px; animation: pl-ein .28s ease both; }
.pl-seite-bild { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 200px; padding: 0; border: 1px solid var(--linie); border-radius: 12px; background: var(--bg-2); overflow: hidden; cursor: zoom-in; box-shadow: var(--sh-1); transition: box-shadow .18s ease, transform .18s ease; }
.pl-seite-bild:hover { box-shadow: var(--sh-3); transform: translateY(-2px); }
.pl-seite-laedt { width: 100%; height: 220px; border-radius: 0; }
.pl-seite-text { padding: 14px; color: var(--grau-text); font-size: 13px; }
.pl-canvas { display: block; width: 100%; height: auto; animation: pl-blende .24s ease both; }
.pl-seite figcaption { margin-top: 5px; font-size: 12px; color: var(--grau-text); text-align: center; overflow-wrap: anywhere; }
.pl-schnitt { flex: none; align-self: center; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 44px; margin-bottom: 20px; padding: 0; border: 1px dashed #C9CAD1; border-radius: 10px; background: #fff; color: var(--grau-text); cursor: pointer; transition: color .15s ease, border-color .15s ease, background .15s ease, transform .12s ease; }
.pl-schnitt:hover:not(:disabled) { color: var(--rot-tief); border-color: var(--rot-tief); background: var(--rot-tint); transform: scale(1.06); }
.pl-schnitt:disabled { opacity: .45; cursor: default; }
.pl-schnitt.pl-arbeitet { opacity: 1; color: var(--rot-tief); border-color: var(--rot-tief); cursor: progress; }

/* Aktionen und Formulare */
.pl-aktionen { display: flex; flex-wrap: wrap; gap: 8px; }
.pl-form { display: grid; gap: 9px; margin-bottom: 12px; padding: 14px; border-radius: 16px; background: var(--bg-2); animation: pl-ein .2s ease both; }
.pl-form label, .pl-form-titel { margin: 0; font-size: 13px; font-weight: 700; color: var(--ink); }
.pl-form select, .pl-form textarea { width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid #D5D6DC; border-radius: 12px; background: #fff; color: var(--ink); font-size: 15px; }
.pl-form select:focus, .pl-form textarea:focus { outline: 2px solid var(--rot-tief); outline-offset: 1px; }
.pl-form-hilfe { margin: 0; font-size: 13px; color: var(--grau-text); }
.pl-form-zeile { display: flex; flex-wrap: wrap; gap: 8px; }
.pl-form-spalte { display: grid; gap: 8px; }
.pl-form-spalte .pl-knopf { white-space: normal; text-align: left; justify-content: flex-start; }
.pl-kreuz { display: flex !important; gap: 9px; align-items: flex-start; font-weight: 500 !important; }
.pl-kreuz input { width: 20px; height: 20px; flex: none; margin: 1px 0 0; accent-color: var(--rot-tief); }

/* Groß ansehen */
.pl-zoom { position: fixed; inset: 0; z-index: 500; display: flex; flex-direction: column; background: rgba(21, 22, 26, .88); padding-bottom: env(safe-area-inset-bottom); animation: pl-blende .18s ease both; }
.pl-zoom[hidden] { display: none; }
.pl-zoom-leiste { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 14px 10px; background: #fff; color: var(--ink); font-size: 14px; font-weight: 600; box-shadow: var(--sh-2); }
.pl-zoom-leiste > div { display: flex; flex-wrap: wrap; gap: 6px; }
.pl-zoom-bild { flex: 1; min-height: 0; overflow: auto; padding: 16px; display: flex; justify-content: center; align-items: flex-start; }
.pl-zoom-bild .pl-canvas { width: min(100%, 1000px); border-radius: 6px; box-shadow: var(--sh-3); background: #fff; }
.pl-zoom-bild .pl-seite-laedt { width: min(100%, 700px); height: 80vh; }
.pl-zoom-bild .pl-seite-text { color: #fff; }

/* Bottom-Sheet und Bottom-Nav gibt es nur auf dem Handy */
.pl-nav { display: none; }
.pl-sheet-huelle[hidden] { display: none; }

@media (max-width: 768px) {
  html.pl-gesperrt, html.pl-gesperrt body { overflow: hidden; }
  body.pl-aktiv .almas-menu-toggle { display: none; }
  body.pl-aktiv .almas-header { padding-left: 16px; padding-right: 12px; padding-top: env(safe-area-inset-top); height: calc(var(--header-height) + env(safe-area-inset-top)); }
  body.pl-aktiv .almas-header .almas-btn { min-height: 44px; }
  body.pl-aktiv .almas-content { padding: 12px 16px calc(88px + env(safe-area-inset-bottom)); }
  /* Oben statt unten: Unten liegen auf dem Handy Bottom-Nav und Bestätigen. */
  body.pl-aktiv .almas-toast-container { z-index: 600; top: calc(10px + env(safe-area-inset-top)); bottom: auto; }
  body.pl-aktiv .almas-toast { pointer-events: none; }
  .pl-kopf { margin-bottom: 8px; }
  .pl-schalter { display: none; }
  .pl-raster { display: block; }
  .pl-detail { display: none; }
  .pl-hinweis { font-size: 14px; }

  .pl-karten { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
  .pl-karte { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; width: 100%; min-height: 44px; padding: 14px 16px; border: 0; border-radius: 18px; background: #fff; color: var(--ink); text-align: left; font-size: 15px; box-shadow: var(--sh-1); cursor: pointer; transition: transform .12s ease, box-shadow .18s ease; -webkit-tap-highlight-color: transparent; }
  .pl-karte:active { transform: scale(.985); box-shadow: var(--sh-2); }
  .pl-karte-kopf { display: flex; flex-wrap: wrap; gap: 6px; }
  .pl-karte-titel { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
  .pl-karte-meta { color: var(--grau-text); font-size: 14px; overflow-wrap: anywhere; }
  .pl-karte-grund { color: #4A3200; font-size: 14px; overflow-wrap: anywhere; }
  .pl-karte-fuss { display: flex; justify-content: space-between; gap: 10px; width: 100%; color: var(--grau-text); font-size: 13px; }

  body.pl-aktiv .pl-nav {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 150;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .92);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-top: 1px solid var(--linie); box-shadow: 0 -6px 22px rgba(21, 22, 26, .07);
  }
  .pl-nav button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; padding: 4px 2px; border: 0; border-radius: 12px; background: none; color: var(--grau-text); font-size: 11px; font-weight: 600; cursor: pointer; transition: color .15s ease, background .15s ease, transform .1s ease; }
  .pl-nav button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .pl-nav button:active { transform: scale(.95); }
  .pl-nav button[aria-current="page"] { color: var(--rot-tief); background: var(--rot-tint); }
  .pl-nav-zahl { position: absolute; top: 2px; left: calc(50% + 8px); min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--rot-tief); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }

  .pl-sheet-huelle { position: fixed; inset: 0; z-index: 400; }
  .pl-sheet-grund { position: absolute; inset: 0; background: rgba(21, 22, 26, .42); opacity: 0; transition: opacity .24s ease; }
  .pl-sheet { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; max-height: calc(100dvh - 40px - env(safe-area-inset-top)); background: #fff; border-radius: 22px 22px 0 0; box-shadow: var(--sh-3); transform: translateY(100%); transition: transform .26s cubic-bezier(.2, .8, .2, 1); outline: none; }
  .pl-sheet.pl-zieht { transition: none; }
  .pl-sheet-huelle.pl-offen .pl-sheet-grund { opacity: 1; }
  .pl-sheet-huelle.pl-offen .pl-sheet { transform: translateY(0); }
  .pl-griff { flex: none; display: flex; align-items: center; justify-content: center; width: 100%; height: 44px; margin-bottom: -10px; padding: 0; border: 0; background: none; cursor: grab; touch-action: none; }
  .pl-griff span { width: 44px; height: 5px; border-radius: 5px; background: #D2D3D9; }
  .pl-sheet-inhalt { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 2px 16px calc(14px + env(safe-area-inset-bottom)); }

  .pl-seiten { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; gap: 6px; margin: 0 -16px; padding: 4px 16px 10px; scrollbar-width: none; overscroll-behavior-x: contain; }
  .pl-seiten::-webkit-scrollbar { display: none; }
  .pl-seite { flex: none; width: min(78vw, 340px); scroll-snap-align: center; }
  .pl-seite-bild { min-height: 280px; }
  .pl-seite-laedt { height: 340px; }
  .pl-schnitt { width: 44px; height: 88px; }
  .pl-seite figcaption .pl-link { min-height: 44px; }

  .pl-knopf { min-height: 44px; }
  /* Die Hülle klebt, nicht die Knopfreihe: Sticky wirkt nur innerhalb des Elternelements. So bleibt Bestätigen immer erreichbar. */
  #plAktionen { position: sticky; bottom: calc(-14px - env(safe-area-inset-bottom)); z-index: 2; margin: 12px -16px 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .95); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-top: 1px solid var(--linie); }
  #plAktionen:empty { display: none; }
  .pl-aktionen .pl-knopf { flex: 1 1 auto; padding: 8px 6px; font-size: 13px; white-space: nowrap; }
  .pl-aktionen .pl-knopf-haupt { flex: 1 0 100%; font-size: 15px; }
  #plAktionen .pl-form { margin-bottom: 0; }
  .pl-d-verlauf summary { min-height: 44px; display: flex; align-items: center; }
  .pl-kreuz { min-height: 44px; }
  .pl-kreuz input { width: 24px; height: 24px; }
  .pl-form select, .pl-form textarea { font-size: 16px; min-height: 44px; }
  .pl-d-felder { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pl-d-titel { font-size: 19px; }
  .pl-zoom-leiste .pl-knopf { min-height: 44px; }
}

@media (min-width: 769px) and (max-width: 1180px) {
  .pl-raster { grid-template-columns: minmax(0, 1fr); }
  .pl-detail { position: static; max-height: none; overflow: visible; scroll-margin-top: 72px; }
}

/* Am Rechner wie am Handy: Die Hauptaktionen bleiben im Bild, wie lang das Dokument auch ist. Die Hülle klebt, nicht die Knopfreihe. */
@media (min-width: 769px) {
  #plAktionen { position: sticky; bottom: -20px; z-index: 2; margin: 14px -22px 0; padding: 12px 22px 16px; background: rgba(255, 255, 255, .95); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-top: 1px solid var(--linie); }
  #plAktionen:empty { display: none; }
  #plAktionen .pl-form { margin-bottom: 0; }
}
@media (min-width: 769px) and (max-width: 1180px) {
  #plAktionen { bottom: 0; }
}
@media (min-width: 769px) and (max-height: 500px) {
  #plAktionen { position: static; }
}

/* Handy quer: Rechner-Layout mit wenig Höhe. Logo und Fuß schrumpfen, sonst schneidet der Fuß die Menüpunkte an. */
@media (min-width: 769px) and (max-height: 500px) {
  body.pl-aktiv .almas-sidebar-logo { padding: 8px 16px; }
  body.pl-aktiv .almas-sidebar-logo img { height: 24px; }
  body.pl-aktiv .almas-sidebar-logo .app-name { margin-top: 2px; }
  body.pl-aktiv .almas-sidebar-footer { padding: 6px 16px; }
  body.pl-aktiv .almas-sidebar nav a { padding-top: 5px; padding-bottom: 5px; }
  .pl-detail { max-height: none; position: static; scroll-margin-top: 72px; }
}

.pl-ein { animation: pl-ein .3s ease both; animation-delay: calc(var(--i, 0) * 35ms); }
@keyframes pl-ein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pl-blende { from { opacity: 0; } to { opacity: 1; } }
@keyframes pl-schimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@keyframes pl-pop { from { transform: scale(.8); } to { transform: none; } }
@keyframes pl-dreht { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .pl *, .pl-nav *, .pl-sheet-huelle, .pl-sheet-huelle *, .pl-zoom, .pl-zoom *, .nav-badge.pl-pop, .pl-ein {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  /* Die Sammelregel trifft keine Pseudo-Elemente. Der Knopf zeigt die Arbeit dann mit einem ruhenden Ring. */
  .pl-knopf.pl-arbeitet::after { animation: none !important; border-right-color: currentColor; opacity: .55; }
}
