/* ═══════════════════════════════════════════════════════════════════════════
   IMBISS · Ergänzungen zu biss.css
   Nur was das Bildarchiv neu braucht: Bildraster, Bild-Akte, Upload, Login,
   Mandanten-Menü. Ausschließlich Tokens aus biss.css. Radius 0, 2px-Rahmen,
   Offset-Schatten, Archivo.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Mandanten-Umschalter: Menü unter dem Kopf-Knopf ─── */
.tenant-wrap {
  margin-left: auto;
  position: relative;
  min-width: 0;
  padding-left: 8px;
}
.tenant-wrap .tenant {
  margin-left: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.tenant-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 248px;
  background: var(--surface);
  border: 2px solid var(--line);
  box-shadow: var(--shadow);
  z-index: 30;
  color: var(--ink);
}
.tenant-menu a {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  border-bottom: 1.5px solid var(--green-soft);
  color: var(--ink);
}
.tenant-menu a:last-child {
  border-bottom: 0;
}
.tenant-menu a small {
  color: var(--muted);
  font-weight: 500;
  font-size: 11.5px;
}
.tenant-menu a:hover {
  background: var(--bg);
}
.tenant-menu a.on {
  background: var(--green);
  color: #fff;
}
.tenant-menu a.on small {
  color: var(--green-soft);
}

/* ─── Kopf: Wortmarke als SVG (Pixelblock, IM ausgestanzt); Höhe statt Schriftgrad.
   Die Kopfspalte ist 264px (232 innen): Marke 21px = 95px, längster Knopf
   „ALLE FIRMEN ▾" 123px in Archivo (Firmen ohne Code-Präfix), dazwischen 8px.
   Längere Beschriftungen werden im Knopf mit Ellipse gekürzt statt umzubrechen. ─── */
.mark {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.mark img {
  display: block;
  height: 21px;
}

/* ─── Kopf: Abmelden-Link im Cluster wie ein Knopf. Mobil wandert er in den
       Fuß des Drawers (Regel im 899er-Block), am Desktop bleibt er oben. ─── */
.cluster a.n {
  text-decoration: none;
}
aside .foot .n {
  display: none;
}

/* ─── Bildraster (Zeilen in voller Breite, Höhe aus dem Seitenverhältnis) ─── */
.gridwrap {
  padding: var(--gap);
}
.pics,
.picrows {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.picrow {
  display: flex;
  gap: 12px;
  overflow: hidden;
}
.pic {
  position: relative;
  display: block;
  flex: none;
  border: 2px solid var(--line);
  background-color: var(--green-soft);
  background-size: cover;
  background-position: center;
  overflow: hidden;
  box-shadow: 3px 3px 0 #c9d8cc;
  text-decoration: none;
  color: #fff;
}
.pic img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pic:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 #c9d8cc;
}
.pic[aria-current] {
  outline: 3px solid var(--gold);
  outline-offset: 0;
}
.pic .cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 6px 10px;
  background: rgba(34, 53, 42, 0.86);
  border-top: 2px solid var(--band-edge);
  display: flex;
  flex-direction: column;
  gap: 1px;
  opacity: 0;
  transition: opacity 0.12s ease;
  font-size: 12px;
  line-height: 1.3;
}
.pic .cap b {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pic .cap small {
  color: var(--band-edge);
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.pic:hover .cap,
.pic:focus-visible .cap,
.pic[aria-current] .cap {
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .pic .cap {
    transition: none;
  }
}
.more {
  min-height: 24px;
  display: flex;
  justify-content: center;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

/* ─── Start: Kachelreihe. Drei Kacheln füllen die Breite, danach Blockabstand ─── */
@media screen and (min-width: 1200px) {
  .tiles.three {
    grid-template-columns: repeat(3, 1fr);
  }
}
.tiles + .block {
  margin-top: var(--sec);
}

/* ─── Suchzeile auf der Bilder-Seite ─── */
.searchrow {
  display: grid;
  grid-template-columns: 1fr 180px auto;
  gap: 12px;
  padding: 16px;
}
.searchrow input[type="text"],
.searchrow select {
  font: inherit;
  padding: 8px 10px;
  border: 2px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  min-width: 0;
}
.searchrow input:hover,
.searchrow select:hover {
  background: #fbf6e0;
}
.filters.tagchips {
  padding: 0 16px 16px;
  flex-wrap: wrap;
}
.filters a.f {
  text-decoration: none;
}

/* ─── Formularfelder: biss.css kennt nur type="text"; E-Mail, Passwort,
       Zahl und URL bekommen dieselbe Regel ─── */
.form input[type="email"],
.form input[type="password"],
.form input[type="number"],
.form input[type="url"] {
  font:
    600 13px "Archivo",
    sans-serif;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--line-soft);
  padding: 6px 9px;
  width: 100%;
}

/* ─── Knöpfe (biss.css stylt button in .ahead .act; hier für Formulare) ─── */
.actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 12px;
  margin-top: 8px;
}
.actions button,
.searchrow button,
.pfoot button.btn,
a.btn {
  font: 800 12.5px "Archivo", sans-serif;
  padding: 8px 14px;
  border: 2px solid var(--line);
  background: var(--green);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.actions button:hover,
.searchrow button:hover,
.pfoot button.btn:hover,
a.btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 #c9d8cc;
}
.actions button:disabled,
.pfoot button.btn:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
  box-shadow: none;
}
.actions button.ghost,
button.ghost {
  background: var(--surface);
  color: var(--green);
  border: 2px solid var(--line);
  font-weight: 800;
  cursor: pointer;
}
.actions button.danger {
  background: var(--alert);
  border-color: var(--alert);
  color: #fff;
}
button.ghost.small {
  font-size: 11px;
  padding: 3px 8px;
}
button.linkbtn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--green);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
/* Freigabe-Liste: Zeile je Firma, Kopfzeile „Alle Firmen" im Bandgelb. */
.form .tlist {
  grid-column: 1 / -1;
  border: 2px solid var(--line-soft);
  margin-top: 12px;
}
.tlist button {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 10px;
  font: 600 13px "Archivo", sans-serif;
  color: var(--ink);
  text-align: left;
  background: #fff;
  border: 0;
  border-bottom: 1.5px solid var(--green-soft);
  cursor: pointer;
}
.tlist button:last-child {
  border-bottom: 0;
}
.tlist button:hover {
  background: #f6f9f6;
}
.tlist button code {
  font: 800 11px "Archivo", sans-serif;
  color: var(--muted);
  letter-spacing: 0.05em;
}
.tlist button .st {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border: 2px solid var(--line-soft);
  color: var(--muted);
  min-width: 74px;
  text-align: center;
}
.tlist button[aria-pressed="true"] {
  background: #f2f7f3;
}
.tlist button[aria-pressed="true"] .st {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.tlist button.all {
  background: var(--band);
  color: var(--band-ink);
  font-weight: 800;
  border-bottom: 2px solid var(--band-edge);
}
.tlist button.all code {
  color: var(--band-ink);
}
.tlist button.all[aria-pressed="true"] .st {
  background: var(--band-ink);
  border-color: var(--band-ink);
  color: var(--band);
}
.tlist.allon button:not(.all) {
  color: var(--muted);
  cursor: default;
}
.tlist.allon button:not(.all) .st {
  background: var(--green-soft);
  border-color: var(--green-soft);
  color: var(--muted);
}
.tlist button:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: -3px;
}
.form-error {
  grid-column: 1 / -1;
  color: var(--alert);
  font-weight: 700;
  font-size: 12.5px;
}
.inline-form {
  display: flex;
  gap: 6px;
  align-items: center;
}
.inline-form input {
  font: inherit;
  padding: 3px 8px;
  border: 2px solid var(--line-soft);
  width: 180px;
}

/* ─── Bild-Akte (Panel und Vollseite) ─── */
.ellipsis {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.phead .chips .chip {
  max-width: 100%;
}
/* Bildbox = Bild: Breite ist das Kleinere aus voller Breite und
   Maximalhöhe × Seitenverhältnis (--aspect als Inline-Style vom Asset),
   die Höhe folgt aus dem Verhältnis. Kein Passepartout oben und unten,
   und die Fläche steht schon vor dem Laden fest. */
.sheet-img {
  --sheet-max: 60vh;
  display: block;
  border: 2px solid var(--line);
  background: var(--green-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Crect width='8' height='8' fill='%23d8e4da'/%3E%3Crect x='8' y='8' width='8' height='8' fill='%23d8e4da'/%3E%3Crect x='8' width='8' height='8' fill='%23eff4ef'/%3E%3Crect y='8' width='8' height='8' fill='%23eff4ef'/%3E%3C/svg%3E");
  margin-bottom: 18px;
}
.sheet-img .imgbox {
  display: block;
  position: relative;
  width: min(100%, calc(var(--sheet-max) * var(--aspect, 1.5)));
  aspect-ratio: var(--aspect, 1.5);
  margin: 0 auto;
}
/* Thumbnail-Unterlage und Vorschau liegen übereinander in der Box */
.sheet-img img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.sheet-img.page {
  --sheet-max: 70vh;
  margin: 16px;
}
.pbody .form {
  padding: 0;
  grid-template-columns: 110px 1fr;
}
/* ─── Herunterladen: meistgenutzte Aktion (download-knopf Runde 1, Hybrid
       A + B). Im Akte-Fuß ein grüner Balken über die ganze Breite mit Format,
       Maßen, Größe und F9; im Kopf der Vollansicht derselbe Knopf in Gold. ─── */
.dl {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 16px;
  background: var(--band-edge);
  color: var(--band-ink);
  border: 2px solid var(--line);
  box-shadow: 3px 3px 0 #c9d8cc;
  font: 800 13.5px "Archivo", sans-serif;
  text-decoration: none;
  white-space: nowrap;
}
.dl:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 #c9d8cc;
}
.dl[aria-disabled="true"] {
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}
.dl small {
  margin-left: auto;
  font: 700 11px "Archivo", sans-serif;
  letter-spacing: 0.04em;
  opacity: 0.85;
}
.dl kbd {
  font: 700 10.5px/1 "Archivo", sans-serif;
  color: var(--band-ink);
  background: transparent;
  border: 1.5px solid var(--band-ink);
  padding: 2px 5px;
  box-shadow: none;
}
.pfoot {
  flex-wrap: wrap;
  gap: 10px 16px;
}
/* Im Akte-Blatt grün (Entscheidung 22.09.2026), Gold nur im Kopf der Vollansicht. */
.pfoot .dl {
  width: 100%;
  min-height: 44px;
  margin-left: 0;
  background: var(--green);
  color: #fff;
}
.pfoot .dl:hover {
  background: var(--green-mid);
}
.pfoot .dl small {
  color: var(--green-soft);
  opacity: 1;
}
.pfoot .dl kbd {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.55);
}
/* Kopf der Vollansicht: zwei Knopfhöhen sind eine zu viel. „← Bilder" ist ein
   Ghost-Knopf, Herunterladen der Goldknopf, beide 36px, gleiche Schrift. */
.ahead .customer a.ghost {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  font: 800 12.5px "Archivo", sans-serif;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}
.ahead .customer a.ghost:hover {
  border-color: #fff;
}
.ahead .act .dl {
  min-height: 36px;
  padding: 0 14px;
  font-size: 12.5px;
  box-shadow: none;
}
.ahead .act .dl:hover {
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.25);
}
.sect.inblock {
  margin: 0 16px 10px;
}
.padded {
  padding: 0 16px 16px;
}
.padded.top {
  padding-top: 14px;
}
.thumbrow {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
/* Hintergrund: Thumbhash schemenhaft (Inline-Style), bis das Thumbnail dekodiert ist */
.thumbrow a {
  display: block;
  border: 1.5px solid var(--line-soft);
  background: var(--green-soft);
  background-size: cover;
  background-position: center;
}
.thumbrow a:hover {
  border-color: var(--line);
}
.thumbrow a[aria-current] {
  outline: 3px solid var(--gold);
}
.thumbrow img {
  display: block;
  width: 84px;
  height: 63px;
  object-fit: cover;
}
.empty.small {
  padding: 4px 0 0;
  font-size: 12.5px;
}
.warn-strip {
  margin-bottom: var(--sec);
  padding: 10px 14px;
  border: 2px solid var(--alert);
  border-left-width: 6px;
  background: var(--surface);
  color: var(--alert);
  font-weight: 600;
}
.ahead.compact h1.ellipsis {
  flex: 1;
}

/* ─── Skelett der Akte: gleiche Struktur, Werte schimmern. .sk ist ein
       Inline-Block in Zeilenhöhe, damit Zeilen so hoch bleiben wie mit Text. ─── */
@keyframes sk-shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}
/* .form input[type="text"] und .tlist button .st aus biss.css sind
   spezifisch; die Skelett-Selektoren müssen mindestens gleichziehen. */
.sk,
.skthumb,
.skeleton .form input,
.skeleton .form select,
.skeleton .tlist .st {
  background: linear-gradient(90deg, var(--green-soft) 25%, var(--bg) 50%, var(--green-soft) 75%);
  background-size: 200% 100%;
  animation: sk-shimmer 1.4s linear infinite;
}
.sk {
  display: inline-block;
  height: 0.8em;
  max-width: 100%;
  vertical-align: -0.05em;
}
.phead .sk {
  background-image: linear-gradient(90deg, rgba(255, 255, 255, 0.28) 25%, rgba(255, 255, 255, 0.45) 50%, rgba(255, 255, 255, 0.28) 75%);
}
.thumbrow .skthumb {
  display: block;
  box-sizing: content-box;
  width: 84px;
  height: 63px;
  border: 1.5px solid var(--line-soft);
}
.skeleton .form input,
.skeleton .form select,
.skeleton .tlist .st {
  color: transparent;
}
.skeleton .form input::placeholder {
  color: transparent;
}
.skeleton a {
  opacity: 0.45;
}
@media (prefers-reduced-motion: reduce) {
  .sk,
  .skthumb,
  .skeleton .form input,
  .skeleton .form select,
  .skeleton .tlist .st {
    animation: none;
  }
}

/* ─── Upload ─── */
.drop {
  margin: 16px;
  padding: 36px 16px;
  border: 2px dashed var(--line-soft);
  background: var(--surface);
  text-align: center;
  font-weight: 600;
  color: var(--muted);
}
.drop.over {
  border-color: var(--gold);
  border-style: solid;
  background: #fbf6e0;
  color: var(--ink);
}
.table td.subject small {
  color: var(--muted);
  font-weight: 500;
}
.uptable .upsimilar {
  margin-top: 8px;
}
.uptable .upsimilar .thumbrow img {
  width: 64px;
  height: 48px;
}

/* Schließen-Knopf im Blattkopf bleibt einzeilig, der Titel kürzt mit Ellipse. */
.phead .x {
  flex: none;
  white-space: nowrap;
}
.phead .row1 h2 {
  min-width: 0;
}

/* ─── Upload überall: Schleier beim Ziehen, Upload-Blatt im Panel ─── */
.dropveil {
  position: fixed;
  inset: 62px 0 0 0;
  z-index: 30;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(34, 53, 42, 0.32);
  pointer-events: none;
}
.dropveil.on {
  display: flex;
}
.dropveil-box {
  padding: 26px 44px;
  border: 3px dashed var(--gold);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 19px;
  font-weight: 800;
  color: var(--ink);
  text-align: center;
}
.dropveil-box small {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.pwrap {
  display: contents;
}
.pwrap[hidden] {
  display: none;
}
.upthumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}
.upthumbs img {
  width: 84px;
  height: 63px;
  object-fit: cover;
  border: 1.5px solid var(--line-soft);
  background: var(--green-soft);
}
.upthumbs img.fertig {
  border-color: var(--green);
  outline: 2px solid var(--green);
}
.upthumbs img.doppelt {
  border-color: var(--alert);
  outline: 2px solid var(--alert);
}
.upthumbs img.fehler {
  opacity: 0.5;
}
.pbody .uptable {
  margin: 0 0 6px;
}

/* ─── Bild als Suche: Suchfeld nimmt Dateien an, Suchbild auf der Bilder-Seite ─── */
.search.over {
  border-color: var(--gold);
  background: #fbf6e0;
  color: var(--ink);
}
/* Wie das kbd „Strg K" daneben: gleiche Höhe, Rand, Grün. */
.search .picbtn {
  flex: none;
  display: flex;
  align-items: center;
  padding: 2px 6px;
  border: 1.5px solid var(--green);
  background: #fff;
  color: var(--green);
  line-height: 1;
  cursor: pointer;
}
.search .picbtn svg {
  width: 13px;
  height: 13px;
}
.search .picbtn:hover,
.search .picbtn:focus-visible {
  background: var(--green);
  color: #fff;
  outline: 0;
}
.search .picbtn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Ladeanzeige: Pixel-Welle unter dem Feld, Scanstrich über dem Knopf */
.search {
  position: relative;
}
.search .pix {
  position: absolute;
  left: -2px;
  right: -2px;
  bottom: -2px;
  height: 4px;
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  pointer-events: none;
}
.search .pix i {
  display: block;
  opacity: 0.18;
  animation: pix-wave 1.2s ease-in-out infinite;
}
@keyframes pix-wave {
  0%,
  100% {
    opacity: 0.18;
  }
  30% {
    opacity: 1;
  }
}
.search .picbtn {
  position: relative;
  overflow: hidden;
}
.search .picbtn .scan {
  display: none;
  position: absolute;
  top: 0;
  bottom: 0;
  left: -4px;
  width: 4px;
  background: linear-gradient(180deg, #e84681, #e8a944, #d6e73c, #5eeb6d, #4ddfe9, #39ace6);
  box-shadow: 0 0 5px 1px rgba(255, 255, 255, 0.9);
  animation: pix-scan 0.8s linear infinite;
}
.search.reading .picbtn,
.search.reading .picbtn:disabled {
  opacity: 1;
  border-color: var(--gold);
}
.search.reading .picbtn .scan {
  display: block;
}
@keyframes pix-scan {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(32px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .search .pix i {
    animation: none;
    opacity: 1;
  }
  .search .picbtn .scan {
    animation: none;
    left: 50%;
  }
}
.querypic {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 16px 16px 0;
  padding: 10px 12px;
  border: 2px solid var(--line);
  background: var(--surface);
}
.querypic img {
  flex: none;
  width: 84px;
  height: 63px;
  object-fit: cover;
  border: 1.5px solid var(--line-soft);
  background: var(--green-soft);
}
.querypic span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.querypic small {
  color: var(--muted);
  font-weight: 500;
}
.querypic a {
  margin-left: auto;
  white-space: nowrap;
}
a.flag {
  text-decoration: none;
}

/* ─── Anmeldung und Fehlerseiten: ohne Shell, ein Block in der Mitte.
       Maße 1:1 aus BISS Web (iccis.bissportal.de, #/anmeldung). ─── */
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--sec);
  background: var(--bg);
}
.auth-wrap {
  width: min(100%, 460px);
}
/* Marke + „Cloud": Cloud sitzt klein auf der Grundlinie neben dem Goldpunkt
   (login-marke Runde 2, Variante F2 in Ink). */
.auth-brand {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: var(--sec);
}
.auth-brand .mark {
  order: 0; /* biss.css sortiert .mark im mobilen Kopf um; hier nicht */
  margin-right: 0;
}
.auth-brand .mark img {
  display: block;
  height: 44px;
}
.auth-brand h1 {
  margin: 0 0 3px;
  font: 700 18px/1 "Archivo", sans-serif;
  color: var(--ink);
}
.auth-body {
  padding: var(--sec);
}
.auth-body > p {
  margin: 0 0 var(--gap);
  color: var(--muted);
  font-size: 13px;
}
.auth-form {
  display: grid;
  gap: var(--gap);
}
.field-group {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  min-width: 0;
}
.field-group input,
.field-group select {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 7px 9px;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line-soft);
  font: 600 13px "Archivo", sans-serif;
}
.field-group input:hover,
.field-group select:hover {
  border-color: var(--green-mid);
}
.action {
  min-height: 36px;
  padding: 7px 12px;
  border: 2px solid var(--line);
  color: var(--green);
  background: var(--surface);
  font: 800 12.5px "Archivo", sans-serif;
  box-shadow: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.action:hover {
  box-shadow: var(--shadow);
}
.action.primary {
  color: var(--surface);
  background: var(--green);
}
.inline-state {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}
.inline-state.error {
  color: var(--alert);
  font-weight: 700;
}

/* ─── Strg+K: die Liste hängt im grünen Kopf und darf dessen Weiß nicht erben ─── */
.pal {
  color: var(--ink);
  font-weight: 400;
}
/* ─── Strg+K: Bild-Treffer als Zeilen mit großem Thumbnail ─── */
.pal.wide {
  width: min(760px, calc(100vw - var(--sb) - 2 * var(--pad)));
  max-height: calc(100vh - 80px);
  overflow: auto;
}
.pr.big {
  align-items: flex-start;
  padding: 8px 16px;
}
.pr .th {
  flex: none;
  width: 120px;
  height: 84px;
  object-fit: cover;
  border: 2px solid var(--line);
  background: var(--green-soft);
}
.pr .tx {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.pr .tx b {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pr .tx small {
  display: block;
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pr.big .go {
  align-self: center;
}

@media (max-width: 1199px) {
  .searchrow {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 899px) {
  /* Der Firmen-Knopf steckt in .tenant-wrap; biss.css sortiert nur .tenant
     (order 5). Ohne diese Regel stünde der Wrapper mit margin-left:auto an
     erster Stelle und schöbe Burger und Marke nach rechts.
     Basis 0: der Kopf bricht Zeilen nach der Wunschbreite um, nicht nach der
     geschrumpften. Mit Inhaltsbreite als Basis rutschte der Knopf bei 430px
     in eine zweite Zeile und ragte aus dem 60px-Kopf. So wächst er nur bis
     zur eigenen Breite und kürzt bei Platznot mit Ellipse. */
  .tenant-wrap {
    order: 5;
    margin-left: 0;
    padding-left: 0;
    flex: 1 1 0;
    max-width: max-content;
    min-width: 0;
  }
  /* Akte-Kopf umgebrochen: Zeile 1 Maße + Titel, Zeile 2 „← Bilder" links
     und Herunterladen rechts, Zeile 3 die Chips über die volle Breite. */
  .ahead.compact h1.ellipsis {
    flex: 1 0 calc(100% - 120px);
  }
  .ahead .customer {
    order: 1;
    margin-left: 0;
  }
  .ahead .act,
  .ahead .customer ~ .act {
    order: 2;
    margin-left: auto;
  }
  .ahead .chips {
    order: 3;
    flex: 1 1 100%;
    flex-wrap: wrap;
    min-width: 0;
    margin-left: 0;
  }
  .ahead .chip {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  /* Kein Block darf das Seitenraster breiter machen als den Bildschirm:
     das Bildraster rechnet vor der ersten Messung mit 1100px, und Dateiname
     wie Nachweis-Link in der Datei-Liste sind ein einziges Wort, das die
     1fr-Spalte sonst auf Wortbreite aufzieht. */
  .cols > .block {
    min-width: 0;
  }
  dl.kv dd {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  /* Strg+K-Liste: .pal.wide ist spezifischer als die mobile .pal-Regel aus
     biss.css (links/rechts 0) und rechnete mit der Desktop-Sidebar. */
  .pal.wide {
    width: auto;
    max-height: calc(100dvh - var(--headh) - 2px);
  }
  /* Abmelden: aus dem Kopf in den Fuß des Drawers, rechts neben Name. */
  .cluster .n {
    display: none;
  }
  aside .foot .n {
    display: inline-flex;
    margin-left: auto;
    padding: 5px 9px;
    background: var(--band-edge);
    color: var(--band-ink);
    font-weight: 800;
    text-decoration: none;
  }
  .pr .th {
    width: 88px;
    height: 62px;
  }
  .gridwrap {
    padding: 10px;
  }
  /* Tastaturhinweis ohne Tastatur weg, Datei-Info darf umbrechen */
  .dl kbd {
    display: none;
  }
  .pfoot .dl {
    white-space: normal;
  }
}

/* ─── Desktop: Kopf und Sidebar bleiben beim Scrollen stehen. Der Schleier
       des Akte-Blatts liegt über allem, auch über dem Kopf: Klick daneben
       schließt, egal wohin. Nur ab 900px, darunter gilt der Drawer-Block
       aus biss.css. Kopf ist 60px hoch, Rahmen inklusive (border-box). ─── */
@media (min-width: 900px) {
  header {
    position: sticky;
    top: 0;
    z-index: 12;
  }
  #sidebar {
    position: sticky;
    top: 60px;
    height: calc(100vh - 60px);
    overflow-y: auto;
  }
  .scrim {
    inset: 0;
    z-index: 13;
  }
  .panel {
    z-index: 14;
  }
}

/* ─── Rückmeldung: Meldungen mit Schwere, Läuft-Zustand, Fortschritt ─── */
/* Fehler in der Statuszeile: Alarmrot statt Bandgelb. */
.hints .msg.error {
  color: #fff;
  background: var(--alert);
  border-left-color: #6e2414;
}
/* Ein laufender Knopf schimmert wie das Skelett und sperrt den Zeiger. */
button[aria-busy="true"],
.action[aria-busy="true"] {
  cursor: progress;
  background-image: linear-gradient(90deg, rgba(255, 255, 255, 0) 25%, rgba(255, 255, 255, 0.35) 50%, rgba(255, 255, 255, 0) 75%);
  background-size: 200% 100%;
  animation: sk-shimmer 1.4s linear infinite;
}
.actions button:disabled[aria-busy="true"],
.pfoot button.btn:disabled[aria-busy="true"] {
  opacity: 0.85;
}
/* Laufende Upload-Stufe (prüft, lädt, verarbeitet) pulsiert leicht. */
@keyframes flag-pulse {
  50% {
    opacity: 0.45;
  }
}
.flag.busy {
  animation: flag-pulse 1.2s ease-in-out infinite;
}
/* Scharfer Knopf (Nachfrage) auch außerhalb von .actions, etwa in Tabellen */
button.danger {
  background: var(--alert);
  border-color: var(--alert);
  color: #fff;
}
/* Hinweis neben den Knöpfen: „Nicht gespeichert" */
.actions .inline-state {
  align-self: center;
}
/* Fortschrittsbalken am oberen Rand: blendet erst nach 120 ms ein, damit
   schnelle Wechsel nicht flackern, und läuft unbestimmt. */
@keyframes navprogress-run {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}
.navprogress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 40;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
}
.navprogress::before {
  content: "";
  display: block;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, var(--band-edge), var(--gold), var(--band-edge));
}
.navprogress.on {
  opacity: 1;
  transition: opacity 0.15s 0.12s;
}
.navprogress.on::before {
  animation: navprogress-run 1.1s ease-in-out infinite;
}
/* Sidebar-Link: Ladepunkt neben dem Namen (Abstand über gap), sichtbar nur
   solange die Route lädt. Der Zähler bleibt rechts bündig. */
.crow .link-hint {
  flex: none;
  width: 7px;
  height: 7px;
  background: currentColor;
  opacity: 0;
  visibility: hidden;
}
.crow .link-hint.is-pending {
  visibility: visible;
  animation: link-hint-in 0.2s ease 0.1s forwards, flag-pulse 1s ease-in-out 0.1s infinite;
}
@keyframes link-hint-in {
  to {
    opacity: 0.6;
  }
}
/* Mobil: die Statuszeile liegt hinter dem Blatt, der Vorlese-Zwilling wird
   zum Toast am unteren Rand (über Blatt, Schleier und Drawer). */
@media (max-width: 899px) {
  .sr-live:not(:empty) {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    height: auto;
    margin: 0;
    padding: 8px 12px;
    overflow: visible;
    clip-path: none;
    white-space: normal;
    z-index: 40;
    font: 800 12.5px "Archivo", sans-serif;
    color: var(--band-ink);
    background: var(--band);
    border-left: 4px solid var(--band-edge);
    box-shadow: var(--shadow);
  }
  .sr-live.error:not(:empty) {
    color: #fff;
    background: var(--alert);
    border-left-color: #6e2414;
  }
}
@media (prefers-reduced-motion: reduce) {
  button[aria-busy="true"],
  .action[aria-busy="true"],
  .flag.busy,
  .navprogress.on::before,
  .crow .link-hint.is-pending {
    animation: none;
  }
  .navprogress.on::before {
    width: 100%;
  }
  .crow .link-hint.is-pending {
    opacity: 0.6;
  }
}
