/* ===========================================================================
   Dateien per Mail verschicken — Auswahl in der Akte (mailauswahl.js)
   Haken vorn in der Zeile und Leiste wie im Scanzentrum (.sz-haken, .sz-leiste); Farben nur über die Variablen
   aus stil.css, damit der Dunkelmodus von selbst stimmt.
   =========================================================================== */

.ma-ic { width: 18px; height: 18px; flex: none; }

/* ------------------------------------------------------------ Zeilen der Dateiliste */
.dateiliste__zeile.ma-zeile { grid-template-columns: 28px 52px minmax(140px, 2fr) minmax(0, 1.4fr) auto auto; }
.dateiliste__zeile.ma-zeile--an { border-color: var(--gold); box-shadow: inset 3px 0 0 var(--gold); }

.ma-haken { position: relative; width: 28px; height: 28px; min-height: 0; min-width: 0; padding: 0; border-radius: 8px;
  background: var(--flaeche); border: 1.5px solid var(--leise); display: grid; place-items: center; color: var(--gold-tief); cursor: pointer; }
.ma-haken::before { content: ""; position: absolute; inset: -8px; }              /* Trefferfläche 44 px */
.ma-haken:hover { border-color: var(--gold); }
.ma-haken:active { transform: scale(.94); }
.ma-haken:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.ma-haken[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); }
.ma-haken[aria-pressed="true"]::after { content: ""; width: 12px; height: 7px; border-left: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor;
  transform: translateY(-2px) rotate(-45deg); }

.ma-zeilenknopf { padding: 0; min-width: 44px; min-height: 44px; color: var(--leise); }
.ma-zeilenknopf:hover { color: var(--ziegel); }
.ma-zeilenknopf:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }

/* ------------------------------------------------------------ Leiste „n gewählt“ */
.ma-leiste { position: sticky; top: calc(var(--hub-hoehe, 56px) + 8px); z-index: 5; display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  margin: 0 0 10px; padding: 9px 12px; border-radius: 8px; background: var(--sz-dunkel, var(--kohle)); color: var(--creme);
  box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.ma-leiste[hidden] { display: none; }
.ma-leiste b { font-size: 14px; font-variant-numeric: tabular-nums; margin-right: 4px; }
.ma-leiste__luft { flex: 1; }
.ma-leiste button { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 5px 11px; font-size: 13px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.22); color: var(--creme); }
.ma-leiste button:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.32); }
.ma-leiste button:active { background: rgba(255,255,255,.04); transform: scale(.98); }
.ma-leiste .ma-leiste__haupt { background: var(--ziegel); border-color: var(--ziegel); color: #fff; font-weight: 700; }
.ma-leiste .ma-leiste__haupt:hover { background: var(--ziegel-hell); border-color: var(--ziegel-hell); }
.ma-leiste .ma-leiste__haupt:active { background: var(--ziegel-tief); }

/* Knöpfe im Stapel der Bild-Reiter und im Viewer: wie ihre Nachbarn (.gz-knopf), nur das Symbol */
.ma-knopf { display: inline-flex; align-items: center; gap: 6px; }

@media (max-width: 640px) {
  /* Mit Haken und Mail-Knopf wäre der Name zu schmal: Name in der ersten Zeile, Knöpfe darunter */
  .dateiliste__zeile.ma-zeile { grid-template-columns: 28px 44px minmax(0, 1fr); }
  .dateiliste__zeile.ma-zeile .hilfe, .dateiliste__zeile.ma-zeile .haken-zeile { grid-column: 3 / -1; }
  .dateiliste__zeile.ma-zeile .dateiliste__aktionen { grid-column: 3 / -1; grid-row: auto; justify-self: start; }
  .ma-leiste { position: fixed; left: 8px; right: 8px; top: auto; bottom: calc(80px + env(safe-area-inset-bottom)); margin: 0; }
  .ma-leiste button { min-height: 44px; }
}
@media (pointer: coarse) {
  .ma-leiste button { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .ma-haken:active, .ma-leiste button:active { transform: none; }
}
