/* BC Update-Server Portal — Stahl-Control Corporate Identity.
 *
 * Palette: dasselbe Blau wie der Stahl-Control ExchangeHub (--accent #2563eb,
 * --accent-2 #1e40af), damit alle Stahl-Control-Oberflaechen gleich aussehen.
 * Flaeche und Karten sind dunkles Navy statt eines neutralen Graus.
 *
 * WICHTIG: Die Passwort-Seite der Freigaben (/d/<token>) kann diese Datei NICHT
 * laden — die download.*-Adresse reicht ausschliesslich /d/ durch, /style.css
 * ist dort 404. Ihre Farben stehen deshalb bewusst dupliziert in
 * internal/api/sharegate.go (gateCSS). Wer hier die CI-Werte aendert, muss sie
 * dort mitziehen, sonst sehen Kunden eine Seite in Fremdfarben — und niemand im
 * Haus merkt es, weil nur Kunden diese Seite oeffnen.
 *
 * SKALA STATT EINZELWERTEN: Abstaende kommen aus --sp-*, Radien aus --r-*,
 * Schatten aus --sh-*. Frei gestreute Werte (6px 14px, 8px 10px, border-radius
 * 6/7/8/9/10/12/16/18px) waren der eigentliche Grund, warum die Oberflaeche
 * unruhig wirkte, obwohl jede Einzelregel fuer sich plausibel war. Ausnahmen
 * bleiben: 1-px-Rahmen, Bauteil-Eigenmasse (Logo-Kachel, Balkenhoehen) und
 * Media-Query-Grenzen.
 */
:root {
  /* --- Farben: UNVERAENDERT (siehe Kopf + internal/api/sharegate.go) ------ */
  /* Flaechen */
  --bg: #0f1b34;
  --card: #14244a;
  --card-2: #1b2f5c;
  --border: #24406f;

  /* Schrift */
  --fg: #e8eeff;
  --muted: #93a6cc;

  /* CI-Akzent */
  --accent: #2563eb;
  --accent-2: #1e40af;

  /* Zustaende — aufgehellt, damit sie auf dem dunklen Navy lesbar bleiben */
  --danger: #f87171;
  --success: #34d399;
  --warning: #fbbf24;

  --monospace: "JetBrains Mono", "Cascadia Mono", "Consolas", monospace;

  /* Abstaende: einzige erlaubte Quelle fuer padding/margin/gap */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-7: 32px; --sp-8: 40px;

  /* Radien / Schatten / Rahmen */
  --r-sm: 8px; --r-md: 12px; --r-lg: 18px; --r-pill: 999px;
  --sh-1: 0 1px 2px rgba(4, 10, 24, .30);
  --sh-2: 0 8px 20px rgba(4, 10, 24, .40);
  --sh-3: 0 22px 48px rgba(4, 10, 24, .60);
  --ring: 0 0 0 3px rgba(37, 99, 235, .35);

  /* Schrift */
  --fs-xs: 11px; --fs-sm: 12px; --fs-md: 13px; --fs-lg: 15px;
  --fs-h2: 16px; --fs-h1: 21px;

  /* Bewegung */
  --t-fast: .12s; --t-med: .22s; --t-slow: .35s;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; background: var(--bg); color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 14px; line-height: 1.5; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); color: var(--muted); }
.mono { font-family: var(--monospace); font-size: var(--fs-sm); }

/* Sichtbarer Tastaturfokus. Ohne den ist die Oberflaeche mit Tastatur
   unbedienbar — und der Mail-Dialog wird ausschliesslich getippt. */
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-sm); }

/* --- Icons ---------------------------------------------------------------- */
/* Inline-SVG-Sprite aus index.html. Keine Icon-Font, kein CDN: ein einziges
   <script src="https://…"> macht das Portal in einem Kundennetz ohne
   Internetzugang unbenutzbar. */
/* Das Sprite selbst darf nichts einnehmen. Das hidden-Attribut allein reicht
   bei einem <svg> NICHT — die Browser-Vorgabe fuer [hidden] greift dort nicht,
   das Element blieb inline und schob einen 150 px hohen leeren Streifen ueber
   die ganze Oberflaeche. Auf <use href="#ic-…"> hat display:none keinen
   Einfluss; genau so wird ein Inline-Sprite ueblicherweise eingebunden. */
.sprite { display: none; }
.ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.ic-lg { width: 22px; height: 22px; }
.ic-xl { width: 34px; height: 34px; stroke-width: 1.5; }

/* --- Marke ---------------------------------------------------------------- */
/* Das Logo hat einen HELLEN eigenen Hintergrund. Auf einer dunklen Kachel wirkt
   es wie ein eingerahmtes Bildchen — die Kachel ist bewusst hell, genau wie im
   Stahl-Control ExchangeHub. Der blaue Schein stellt den CI-Bezug her.
   Die Kachelmasse sind Eigenmasse des Bauteils, keine Abstaende. */
.logo-tile { display: grid; place-items: center; border-radius: var(--r-lg);
  background: linear-gradient(180deg, #ffffff 0%, #eef4ff 100%);
  border: 1px solid #dbeafe; box-shadow: 0 12px 28px rgba(37, 99, 235, .30); }
.logo-tile img { display: block; width: 100%; height: 100%; object-fit: contain; }
.logo-tile.lg { width: 84px; height: 84px; padding: 14px; margin: 0 auto var(--sp-5); }
.logo-tile.sm { width: 34px; height: 34px; padding: 5px; border-radius: var(--r-sm); box-shadow: none; }

/* --- Splashscreen --------------------------------------------------------- */
/* Zweck: Bei F5 stand vorher kurz das Anmeldefenster auf dem Schirm, bevor der
   gespeicherte Key geprueft war — es sah jedes Mal nach "abgemeldet" aus.
   Logik und Mindestanzeigedauer bleiben unveraendert. */
.splash { position: fixed; inset: 0; z-index: 4000; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: var(--sp-5);
  background:
    radial-gradient(circle at 16% 20%, rgba(37, 99, 235, .30) 0%, rgba(37, 99, 235, .03) 38%, transparent 55%),
    radial-gradient(circle at 86% 82%, rgba(30, 64, 175, .28) 0%, rgba(30, 64, 175, .03) 42%, transparent 58%),
    linear-gradient(160deg, #14244a 0%, #0f1b34 55%, #0a1226 100%),
    var(--bg);
  transition: opacity var(--t-med) var(--ease); }
.splash.fade { opacity: 0; pointer-events: none; }
.splash .title { font-size: 19px; font-weight: 600; letter-spacing: .2px; }
.splash .sub { color: var(--muted); font-size: var(--fs-md); margin-top: -10px; }
.spinner { width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid rgba(147, 166, 204, .25); border-top-color: var(--accent);
  animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Kleiner Spinner IM Knopf: jeder Knopf, der etwas zum Server schickt, wird
   fuer die Dauer gesperrt und zeigt ihn — sonst entstehen Doppelanlagen. */
.spin-sm { display: inline-block; width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid rgba(232, 238, 255, .3); border-top-color: currentColor;
  animation: spin .7s linear infinite; vertical-align: -2px; }

/* --- Login ---------------------------------------------------------------- */
.login { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: var(--sp-4);
  background:
    radial-gradient(circle at 14% 18%, rgba(37, 99, 235, .22) 0%, rgba(37, 99, 235, .02) 36%, transparent 50%),
    radial-gradient(circle at 88% 84%, rgba(30, 64, 175, .20) 0%, rgba(30, 64, 175, .02) 40%, transparent 55%); }
.login .card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: var(--sp-7); max-width: 430px; width: 100%; box-shadow: var(--sh-3);
  text-align: center; }
.login h1 { margin: 0 0 var(--sp-1); font-size: var(--fs-h1); color: var(--fg); font-weight: 600; }
.login .company { color: var(--accent); font-size: var(--fs-sm); font-weight: 600;
  letter-spacing: 1.4px; text-transform: uppercase; margin: 0 0 var(--sp-3); }
.login .hint { color: var(--muted); margin: 0 0 var(--sp-5); font-size: var(--fs-md); text-align: left; }
.login .keyline { display: flex; gap: var(--sp-2); align-items: center; margin-bottom: var(--sp-3); }
.login .keyline input { flex: 1; min-width: 0; }
.login input { width: 100%; padding: var(--sp-3); background: var(--card-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--fg); font-family: var(--monospace); font-size: var(--fs-md); }
.login .keyline button { flex: none; }
.login .go { width: 100%; padding: var(--sp-3); font-size: 14px; justify-content: center; }
.login .foot { color: var(--muted); font-size: var(--fs-xs); margin-top: var(--sp-4); font-family: var(--monospace); }

/* Fehler als Hinweisstreifen statt einer roten Zeile — eine Zeile Rot uebersieht man. */
.err { color: var(--danger); margin-top: var(--sp-2); font-size: var(--fs-md); min-height: 18px; }
.notice { display: flex; gap: var(--sp-2); align-items: flex-start; text-align: left;
  padding: var(--sp-3); border-radius: var(--r-sm); font-size: var(--fs-md);
  background: rgba(37, 99, 235, .10); border: 1px solid var(--accent); color: var(--fg); }
.notice > .ic { margin-top: 2px; color: var(--accent); }
.notice.warn { background: rgba(251, 191, 36, .09); border-color: var(--warning); }
.notice.warn > .ic { color: var(--warning); }
.notice.err { background: rgba(248, 113, 113, .09); border-color: var(--danger); }
.notice.err > .ic { color: var(--danger); }
.notice b { color: var(--warning); }

/* --- Buttons -------------------------------------------------------------- */
button { display: inline-flex; align-items: center; gap: var(--sp-2);
  background: var(--card-2); color: var(--fg); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: var(--sp-2) var(--sp-3); cursor: pointer;
  font-size: var(--fs-md); font-family: inherit;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease); }
button:hover { background: var(--border); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 500; }
button.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
button.ghost { background: transparent; }
button.ghost:hover { background: var(--card-2); border-color: var(--accent); }
button.danger { color: var(--danger); border-color: var(--danger); background: transparent; }
button.danger:hover { background: var(--danger); color: var(--card); }
button.danger-solid { background: var(--danger); border-color: var(--danger); color: var(--card); font-weight: 500; }
button.danger-solid:hover { filter: brightness(1.08); }
button.icon-only { padding: var(--sp-2); }
button:disabled { opacity: .45; cursor: not-allowed; }
button:disabled:hover { background: var(--card-2); }
button.ghost:disabled:hover { background: transparent; border-color: var(--border); }
button.right { margin-left: auto; }

/* --- App-Layout ----------------------------------------------------------- */
.app { display: flex; flex-direction: column; min-height: 100vh; }

/* Kopfbereich (Marke, Zustand, Speicher, Warnstreifen, Reiter) bleibt beim
   Scrollen stehen. Eine gemeinsame Huelle statt drei einzelner sticky-Elemente:
   die Gesamthoehe aendert sich zur Laufzeit (Warnstreifen erscheint, Topbar
   bricht auf schmalen Fenstern um), und drei aufeinander abgestimmte top-Werte
   waeren nur so lange richtig, bis sich einer davon aendert.
   Der z-index liegt ueber den klebenden Tabellen-Kopfzeilen (2) und unter
   Popover (6000), Toasts (7000) und Dialogen (eigene Ebene des Browsers). */
.appbar { position: sticky; top: 0; z-index: 100; background: var(--bg); }

.topbar { display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-2) var(--sp-6);
  background: linear-gradient(100deg, #16264c 0%, #14244a 60%, #172c58 100%);
  border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: var(--sp-3); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: 600; font-size: 14px; color: var(--fg); }
.brand-company { font-size: 10px; color: var(--accent); letter-spacing: 1.2px;
  text-transform: uppercase; font-weight: 600; }
.health { font-size: var(--fs-sm); padding: var(--sp-1) var(--sp-3); background: rgba(9, 18, 38, .55);
  border: 1px solid var(--border); border-radius: var(--r-pill);
  color: var(--muted); font-family: var(--monospace); white-space: nowrap; }
.health.warn { color: var(--warning); border-color: var(--warning); }
.health.crit { color: var(--danger); border-color: var(--danger); }

/* Sitzungsanzeige (Einmal-Link). Bauart bewusst wie .health: es ist dieselbe
   Art Auskunft an derselben Stelle — nur eine, die abläuft. Unter 5 Minuten
   wechselt sie in die Warnfarbe, damit die Restzeit auffaellt, BEVOR jemand
   mitten in einer Eingabe herausfliegt. */
.session-pill { display: inline-flex; align-items: center; gap: var(--sp-2);
  font-size: var(--fs-sm); padding: var(--sp-1) var(--sp-3);
  background: rgba(37, 99, 235, .16); border: 1px solid var(--accent);
  border-radius: var(--r-pill); color: #9dc0ff; white-space: nowrap; }
.session-pill .ic { width: 14px; height: 14px; }
.session-pill.warn { background: rgba(251, 191, 36, .14);
  border-color: var(--warning); color: var(--warning); font-weight: 600; }
.spacer { flex: 1; }

/* Speicheranzeige mit Aufklapp-Karte */
.storage { position: relative; display: flex; align-items: center; gap: var(--sp-2); min-width: 220px; }
.storage-bar { flex: 1; height: 8px; background: rgba(9, 18, 38, .6); border: 1px solid var(--border);
  border-radius: var(--r-pill); overflow: hidden; }
.storage-bar > span { display: block; height: 100%; width: 0%; background: var(--success);
  transition: width var(--t-slow) var(--ease); }
.storage.warn .storage-bar > span { background: var(--warning); }
.storage.crit .storage-bar > span { background: var(--danger); }
.storage-text { font-size: var(--fs-sm); color: var(--muted); font-family: var(--monospace); white-space: nowrap; }
.storage.warn .storage-text { color: var(--warning); }
.storage.crit .storage-text { color: var(--danger); font-weight: 600; }
.storage-pop { position: absolute; top: calc(100% + var(--sp-2)); right: 0; z-index: 60;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--sh-2); padding: var(--sp-3); min-width: 240px; display: none; }
.storage:hover .storage-pop, .storage:focus-within .storage-pop { display: block; }
.storage-pop dl { margin: 0; display: grid; grid-template-columns: 1fr auto;
  gap: var(--sp-1) var(--sp-3); font-size: var(--fs-sm); }
.storage-pop dt { color: var(--muted); }
.storage-pop dd { margin: 0; font-family: var(--monospace); font-variant-numeric: tabular-nums; text-align: right; }

/* Durchgehender Warnstreifen unter der Topbar — rote Textfarbe allein reicht
   fuer "die Platte laeuft voll" nicht. */
.lowspace { display: flex; align-items: center; justify-content: center; gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4); background: rgba(248, 113, 113, .12);
  border-bottom: 1px solid var(--danger); color: var(--danger); font-size: var(--fs-md); font-weight: 500; }

/* --- Reiter --------------------------------------------------------------- */
.tabs { position: relative; display: flex; gap: var(--sp-1); padding: 0 var(--sp-6);
  background: var(--card); border-bottom: 1px solid var(--border); }
.tab { background: transparent; border: none; border-radius: 0;
  padding: var(--sp-3) var(--sp-4); color: var(--muted); }
.tab:hover { color: var(--fg); background: transparent; }
.tab.active { color: var(--accent); font-weight: 500; }
.tab .count { font-size: var(--fs-xs); background: var(--card-2); border: 1px solid var(--border);
  border-radius: var(--r-pill); padding: 0 var(--sp-2); font-variant-numeric: tabular-nums; }
.tab.active .count { border-color: var(--accent); color: var(--accent); }
/* Gleitender Unterstrich per transform — border-color je Reiter zu setzen
   springt, transform gleitet. */
.tab-underline { position: absolute; bottom: -1px; left: 0; height: 2px; width: 0;
  background: var(--accent); transition: transform var(--t-med) var(--ease), width var(--t-med) var(--ease); }

/* --- Inhalt --------------------------------------------------------------- */
.content { flex: 1; padding: var(--sp-6); max-width: 1400px; width: 100%; margin: 0 auto; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* --- Panel-Karte: gibt allen vier Reitern dieselbe Silhouette -------------- */
.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--sh-1); margin-bottom: var(--sp-5); overflow: visible; }
.panel-head { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap;
  padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border); }
.panel-head .titles { min-width: 200px; flex: 1; }
.panel-head h2 { margin: 0; font-size: var(--fs-h2); font-weight: 600; color: var(--fg);
  display: flex; align-items: center; gap: var(--sp-2); }
.panel-head h2 > .ic { color: var(--accent); }
.panel-head p { margin: var(--sp-1) 0 0; color: var(--muted); font-size: var(--fs-sm); }
.panel-head .acts { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.panel-body { padding: var(--sp-4) var(--sp-5); }
.panel-body.flush { padding: 0; }

/* --- Formulare ------------------------------------------------------------ */
.toolbar { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
input[type=text], input[type=number], input[type=password], input[type=datetime-local],
input[type=search], select, textarea {
  padding: var(--sp-2) var(--sp-3); background: var(--card-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--fg); font-size: var(--fs-md); font-family: inherit; }
textarea { resize: vertical; line-height: 1.45; font-family: var(--monospace); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .75; }
.checkbox { display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--muted); cursor: pointer; }
.field { display: flex; flex-direction: column; gap: var(--sp-1); color: var(--muted); font-size: var(--fs-md); }
.field > input, .field > textarea, .field > select { color: var(--fg); }
.field-hint { color: var(--muted); font-size: var(--fs-sm); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--sp-3); }
.form-col { display: flex; flex-direction: column; gap: var(--sp-3); }
.row { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }

/* Suchfeld mit Lupe und Loeschkreuz */
.search { position: relative; display: inline-flex; align-items: center; }
.search > .ic { position: absolute; left: var(--sp-2); color: var(--muted); pointer-events: none; }
.search input { padding-left: var(--sp-7); padding-right: var(--sp-7); min-width: 240px; }
.search .clear { position: absolute; right: var(--sp-1); background: transparent; border: none;
  color: var(--muted); padding: var(--sp-1); }
.search .clear:hover { color: var(--fg); background: transparent; }

/* --- Chips ---------------------------------------------------------------- */
.chips { display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: var(--sp-1);
  padding: var(--sp-1) var(--sp-3); border-radius: var(--r-pill);
  border: 1px solid var(--border); background: var(--card-2); color: var(--muted);
  font-size: var(--fs-sm); cursor: pointer;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease); }
.chip:hover { border-color: var(--accent); color: var(--fg); }
.chip[aria-pressed="true"], .chip.on { background: var(--accent); border-color: var(--accent);
  color: #fff; font-weight: 500; }
.chip.static, .chip.static:hover { cursor: default; border-color: var(--border); color: var(--muted); }
.chip .x { display: inline-flex; background: transparent; border: none; padding: 0; color: inherit; opacity: .75; }
.chip .x:hover { opacity: 1; background: transparent; }
.chip.mono { font-family: var(--monospace); font-size: var(--fs-xs); }

/* --- Brotkrumen ----------------------------------------------------------- */
.crumbs { display: flex; align-items: center; gap: var(--sp-1); flex-wrap: wrap;
  font-size: var(--fs-sm); color: var(--muted); }
.crumbs button { background: transparent; border: none; padding: var(--sp-1) var(--sp-2);
  color: var(--accent); font-size: var(--fs-sm); }
.crumbs button:hover { background: var(--card-2); }
.crumbs .sep { opacity: .5; }

/* --- Tabellen ------------------------------------------------------------- */
/* KEIN overflow hier. Ein overflow-x: auto macht diesen Kasten zum
   Scroll-Container, und dann bezieht sich das sticky der Kopfzeile auf IHN
   statt auf das Fenster — die Kopfzeile klebt dann nirgends und scrollt
   stillschweigend mit weg. (overflow-y: visible hilft nicht: sobald eine Achse
   nicht visible ist, wird die andere zu auto.)
   Waagerecht laeuft trotzdem nichts ueber: die Spalten kuerzen mit Ellipse
   (.ell), und unter 900 px werden die Tabellen ohnehin zu Karten. */
.table-wrap { width: 100%; }
table.data { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
/* Die Kopfzeile klebt UNTER dem Kopfbereich, nicht an der Fensteroberkante —
   sonst verschwindet sie beim Scrollen hinter Topbar und Reitern. --appbar-h
   setzt app.js aus der gemessenen Hoehe; der Rueckfallwert 0 sorgt dafuer, dass
   die Kopfzeile auch dann klebt, wenn das JavaScript nicht dazu kommt. */
table.data th { text-align: left; padding: var(--sp-2) var(--sp-3); color: var(--muted);
  border-bottom: 1px solid var(--border); font-weight: 500; font-size: var(--fs-sm);
  text-transform: uppercase; letter-spacing: .5px; white-space: nowrap;
  position: sticky; top: var(--appbar-h, 0px); z-index: 2; background: var(--card); }
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { color: var(--fg); }
table.data th .ic { width: 12px; height: 12px; opacity: .8; }
table.data td { padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tbody tr:hover { background: var(--card-2); }
table.data .num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
table.data .nowrap { white-space: nowrap; }
table.data .ell { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.two-line { display: flex; flex-direction: column; line-height: 1.25; }
.two-line .sub { font-size: var(--fs-xs); color: var(--muted); }
.file-cell { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.file-cell > .ic { color: var(--muted); }
.row-acts { display: flex; gap: var(--sp-1); align-items: center; justify-content: flex-end; }

/* Restlaufzeit-Balken in der Ablauf-Spalte */
.ttl-bar { height: 3px; border-radius: var(--r-pill); background: rgba(9, 18, 38, .6);
  margin-top: var(--sp-1); overflow: hidden; }
.ttl-bar > span { display: block; height: 100%; background: var(--success); }
.ttl-bar.warn > span { background: var(--warning); }
.ttl-bar.err > span { background: var(--danger); }

/* --- Zustaende (Laden / Leer / Fehler) ------------------------------------ */
.sk { display: block; height: 11px; border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--card-2) 25%, var(--border) 37%, var(--card-2) 63%);
  background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.state { display: flex; flex-direction: column; align-items: center; gap: var(--sp-2);
  padding: var(--sp-8) var(--sp-4); text-align: center; }
.state-ic { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
  background: var(--card-2); border: 1px solid var(--border); color: var(--muted); }
.state-ic .ic { width: 26px; height: 26px; }
.state-title { font-size: var(--fs-lg); font-weight: 600; }
.state-text { color: var(--muted); font-size: var(--fs-md); max-width: 46ch; }
.state-act { margin-top: var(--sp-2); }
.state-err .state-ic { color: var(--danger); border-color: var(--danger); }
tr.state-row:hover { background: transparent; }

/* --- Abzeichen ------------------------------------------------------------ */
.badge { display: inline-flex; align-items: center; gap: var(--sp-1);
  padding: 2px var(--sp-2); border-radius: var(--r-pill); font-size: var(--fs-xs);
  font-weight: 500; white-space: nowrap; }
.badge .ic { width: 12px; height: 12px; }
.badge.ok { background: rgba(52, 211, 153, .15); color: var(--success); }
.badge.warn { background: rgba(251, 191, 36, .15); color: var(--warning); }
.badge.err { background: rgba(248, 113, 113, .15); color: var(--danger); }
.badge.accent { background: rgba(37, 99, 235, .20); color: #9dc0ff; }
.badge.plain { background: transparent; color: var(--muted); }

/* --- Angabe/Wert-Liste (Reiter Updates) ----------------------------------
   Fuer Aussagen, die keine Tabelle sind: "Aufbewahrung Kundenpakete: 30 Tage
   (Standard)". Ein zweispaltiges Gitter statt einer Tabelle, damit auf schmalen
   Fenstern die Beschriftung ueber dem Wert steht statt neben einem 8-px-Rest.
   Die Herkunft-Angabe darunter darf mehrere Saetze lang sein — sie ist die
   wertvollste Information des Reiters, wenn die Antwort "nicht eingerichtet"
   lautet. */
.kv { display: grid; grid-template-columns: minmax(12em, max-content) 1fr;
  gap: var(--sp-2) var(--sp-5); align-items: baseline; }
.kv > dt, .kv > .k { color: var(--muted); font-size: var(--fs-sm); }
.kv > dd, .kv > .v { margin: 0; }
.kv .sub { display: block; color: var(--muted); font-size: var(--fs-xs); }
@media (max-width: 640px) { .kv { grid-template-columns: 1fr; gap: var(--sp-1); }
  .kv > .v { margin-bottom: var(--sp-2); } }

/* --- Angelegte Update-Pipeline (Reiter Updates, updsrv-48) ----------------
   Eine Karte je Produkt. Sie steht ueber der Release-Tabelle und beantwortet
   "ist fuer dieses Produkt ein Weg hinterlegt, und wie sieht er aus". Bewusst
   ruhig gehalten: sie ist Beschreibung, nicht Zustandsanzeige — die Farbe
   gehoert der Stimmigkeitsspalte. */
.pl-karte { background: var(--card-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: var(--sp-4); margin-bottom: var(--sp-3); }
.pl-karte:last-child { margin-bottom: 0; }
.pl-kopf { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap;
  margin-bottom: var(--sp-3); }
.pl-weg { margin: 0; padding-left: var(--sp-5); }
.pl-weg li { margin-bottom: var(--sp-1); }
.pl-weg li:last-child { margin-bottom: 0; }

/* Zeile im Kanal-Editor: Produkt, Kanal, Praefix, Loeschen. Auf schmalen
   Fenstern untereinander — fuenf Felder nebeneinander sind dort unbedienbar. */
.regrow { display: grid; grid-template-columns: 1fr 1fr 1.4fr auto; gap: var(--sp-2);
  align-items: center; margin-bottom: var(--sp-2); }
.regrow input { min-width: 0; }
@media (max-width: 720px) { .regrow { grid-template-columns: 1fr auto; } }

/* Status-Pillen im Zugriffslog: die reine Textfarbe war zu leise. */
.pill { display: inline-block; padding: 1px var(--sp-2); border-radius: var(--r-pill);
  font-family: var(--monospace); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.pill.status-2 { background: rgba(52, 211, 153, .15); color: var(--success); }
.pill.status-4 { background: rgba(251, 191, 36, .15); color: var(--warning); }
.pill.status-5 { background: rgba(248, 113, 113, .15); color: var(--danger); }
.pill.method { background: var(--card-2); color: var(--muted); border: 1px solid var(--border); }
/* Mikro-Balken fuer die Dauer: macht Ausreisser ohne Sortierung sichtbar. */
.ms-cell { display: flex; align-items: center; gap: var(--sp-2); justify-content: flex-end; }
.ms-bar { width: 46px; height: 4px; border-radius: var(--r-pill); background: rgba(9, 18, 38, .6); overflow: hidden; }
.ms-bar > span { display: block; height: 100%; background: var(--accent); }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--success);
  animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* --- Kopierzeile ---------------------------------------------------------- */
.copy-row { display: flex; gap: var(--sp-2); align-items: center; }
.copy-row input { flex: 1; min-width: 0; font-family: var(--monospace); font-size: var(--fs-sm); }
.copy-row.big input { font-size: var(--fs-lg); padding: var(--sp-3); letter-spacing: .5px; }

/* --- Toasts --------------------------------------------------------------- */
/* Vorher standen hier Material-Gruen (#4caf50) und ein Fremdrot hart im JS —
   in einer CI-Blau-Oberflaeche. Jetzt kommen die Farben aus den Tokens. */
.toasts { position: fixed; left: 50%; bottom: var(--sp-6); transform: translateX(-50%);
  z-index: 7000; display: flex; flex-direction: column; gap: var(--sp-2); align-items: center;
  pointer-events: none; max-width: min(560px, calc(100vw - var(--sp-6))); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3); border-radius: var(--r-sm); box-shadow: var(--sh-2);
  background: var(--card); border: 1px solid var(--border); color: var(--fg);
  font-size: var(--fs-md); animation: toast-in var(--t-med) var(--ease); }
.toast.out { opacity: 0; transition: opacity var(--t-fast) var(--ease); }
.toast.ok { border-color: var(--success); } .toast.ok > .ic { color: var(--success); }
.toast.err { border-color: var(--danger); } .toast.err > .ic { color: var(--danger); }
.toast.warn { border-color: var(--warning); } .toast.warn > .ic { color: var(--warning); }
.toast.info { border-color: var(--accent); } .toast.info > .ic { color: var(--accent); }
.toast-text { flex: 1; }
.toast-x { background: transparent; border: none; color: var(--muted); padding: 0 var(--sp-1); }
.toast-x:hover { background: transparent; color: var(--fg); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* --- Dialoge -------------------------------------------------------------- */
/* Natives <dialog> mit showModal(): Fokusfalle, Esc und Hintergrund-Sperre
   bringt der Browser mit. ::backdrop ist ein EIGENES Pseudo-Element — die
   Abdunklung gehoert dorthin, nicht an das dialog selbst. */
dialog.dlg { padding: 0; border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--card); color: var(--fg); box-shadow: var(--sh-3);
  width: min(560px, calc(100vw - var(--sp-6))); max-height: calc(100vh - var(--sp-8));
  overflow: hidden; flex-direction: column; animation: dlg-in var(--t-med) var(--ease); }
dialog.dlg[open] { display: flex; }
dialog.dlg-sm { width: min(430px, calc(100vw - var(--sp-6))); }
dialog.dlg-lg { width: min(680px, calc(100vw - var(--sp-6))); }
dialog.dlg::backdrop { background: rgba(4, 10, 24, .66); backdrop-filter: blur(2px); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
.dlg-head { display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border); }
.dlg-titles { flex: 1; min-width: 0; }
.dlg-title { margin: 0; font-size: var(--fs-h2); font-weight: 600; }
.dlg-sub { margin: var(--sp-1) 0 0; color: var(--muted); font-size: var(--fs-sm); }
.dlg-head-extra { display: flex; align-items: center; gap: var(--sp-2); }
.dlg-x { background: transparent; border: none; color: var(--muted); padding: var(--sp-1); }
.dlg-x:hover { background: var(--card-2); color: var(--fg); }
.dlg-body { padding: var(--sp-5); overflow: auto; flex: 1; }
.dlg-foot { display: flex; gap: var(--sp-2); align-items: center; justify-content: flex-end;
  padding: var(--sp-3) var(--sp-5); border-top: 1px solid var(--border);
  background: rgba(9, 18, 38, .35); flex-wrap: wrap; }
.confirm-body p { margin: 0 0 var(--sp-2); }
.confirm-body p:last-child { margin-bottom: 0; }

/* Schrittanzeige im Dialogkopf */
.steps { display: flex; align-items: center; gap: var(--sp-1); }
.steps button { background: transparent; border: none; color: var(--muted);
  padding: var(--sp-1) var(--sp-2); font-size: var(--fs-sm); border-radius: var(--r-pill); }
.steps button .n { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  border: 1px solid var(--border); font-size: 10px; font-variant-numeric: tabular-nums; }
.steps button[aria-current="step"] { color: var(--accent); }
.steps button[aria-current="step"] .n { border-color: var(--accent); background: var(--accent); color: #fff; }
.steps button.done { color: var(--success); }
.steps button.done .n { border-color: var(--success); }
.steps button:disabled { opacity: .55; cursor: default; }
.steps .sep { color: var(--muted); opacity: .5; }

/* --- Popover-Menue -------------------------------------------------------- */
/* position: fixed und ein z-index ueber dem ::backdrop — sonst liegt das Menue
   innerhalb eines Dialogs unter der Abdunklung. */
.popmenu { position: fixed; z-index: 6000; min-width: 210px; padding: var(--sp-1);
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-sm);
  box-shadow: var(--sh-2); display: flex; flex-direction: column; }
.popmenu button { justify-content: flex-start; width: 100%; background: transparent;
  border: none; padding: var(--sp-2) var(--sp-3); }
.popmenu button:hover { background: var(--card-2); }
.popmenu button.danger { color: var(--danger); }
.popmenu button.danger:hover { background: rgba(248, 113, 113, .12); color: var(--danger); }
.popmenu hr { border: none; border-top: 1px solid var(--border); margin: var(--sp-1) 0; width: 100%; }

/* --- Ablageflaeche (Drag & Drop) ------------------------------------------ */
.dropzone { display: flex; flex-direction: column; align-items: center; gap: var(--sp-2);
  padding: var(--sp-7) var(--sp-4); border: 2px dashed var(--border); border-radius: var(--r-md);
  background: rgba(9, 18, 38, .25); text-align: center; cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease); }
.dropzone:hover { border-color: var(--accent); }
.dropzone.over { border-color: var(--accent); background: rgba(37, 99, 235, .08); }
.dropzone > .ic { color: var(--accent); }
.dropzone .dz-title { font-size: var(--fs-lg); font-weight: 500; }
.dropzone .dz-sub { color: var(--muted); font-size: var(--fs-sm); }

/* Dateikarte nach der Auswahl */
.filecard { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3);
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--card-2); }
.filecard .fc-ic { display: grid; place-items: center; width: 38px; height: 38px; flex: none;
  border-radius: var(--r-sm); background: rgba(37, 99, 235, .15); color: var(--accent); }
.filecard .fc-body { flex: 1; min-width: 0; }
.filecard .fc-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filecard .fc-meta { color: var(--muted); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.filecard .fc-acts { display: flex; gap: var(--sp-1); flex: none; }

/* Auswahl-Kacheln (Radio) fuer den Schutz */
/* Umschalter mit genau zwei Wegen (Dauerhafter Zugang / Einmal-Link).
   Bewusst KEINE zwei Chips: ein Chip-Paar sieht nach Mehrfachauswahl aus, hier
   ist genau eines von beidem gemeint. Die zusammenhaengende Flaeche mit einem
   wandernden hellen Feld sagt das ohne Beschriftung. */
.segmented { display: inline-flex; background: var(--card-2);
  border: 1px solid var(--border); border-radius: var(--r-sm); padding: 3px; gap: 3px; }
.segmented .seg { background: transparent; border: 1px solid transparent;
  color: var(--muted); border-radius: calc(var(--r-sm) - 2px);
  padding: var(--sp-2) var(--sp-4); font-size: var(--fs-md); }
.segmented .seg:hover { color: var(--fg); background: rgba(37, 99, 235, .10); }
.segmented .seg.active { background: var(--accent); border-color: var(--accent);
  color: #fff; font-weight: 500; }
.segmented .seg.active:hover { background: var(--accent-2); }
@media (max-width: 560px) { .segmented { width: 100%; } .segmented .seg { flex: 1; justify-content: center; } }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--sp-3); }
.tile { position: relative; display: block; padding: var(--sp-3); border: 1px solid var(--border);
  border-radius: var(--r-md); background: var(--card-2); cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease); }
.tile:hover { border-color: var(--accent); }
.tile input { position: absolute; opacity: 0; width: 0; height: 0; }
.tile .t-title { display: flex; align-items: center; gap: var(--sp-2); font-weight: 500; }
.tile .t-text { color: var(--muted); font-size: var(--fs-sm); margin-top: var(--sp-1); }
.tile.sel { border-color: var(--accent); background: rgba(37, 99, 235, .12); }
.tile.sel .t-title > .ic { color: var(--accent); }
.tile:focus-within { box-shadow: var(--ring); }

/* Passwortfeld mit Auge-Umschalter */
.pw-line { display: flex; gap: var(--sp-2); align-items: center; }
.pw-input { position: relative; flex: 1; display: flex; align-items: center; min-width: 0; }
.pw-input input { width: 100%; padding-right: var(--sp-8); font-family: var(--monospace); }
.pw-input .eye { position: absolute; right: var(--sp-1); background: transparent; border: none;
  color: var(--muted); padding: var(--sp-1); }
.pw-input .eye:hover { color: var(--fg); background: transparent; }
.pw-strength { display: flex; gap: var(--sp-2); align-items: center; margin-top: var(--sp-2);
  font-size: var(--fs-sm); color: var(--muted); }
.pw-strength .segs { display: flex; gap: 3px; }
.pw-strength .seg { width: 26px; height: 4px; border-radius: var(--r-pill); background: var(--border); }
.pw-strength.s1 .seg:nth-child(1) { background: var(--warning); }
.pw-strength.s2 .seg:nth-child(-n+2) { background: var(--accent); }
.pw-strength.s3 .seg { background: var(--success); }

/* Ergebnis-Karten */
.result-card { border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--card-2); padding: var(--sp-4); }
.result-card + .result-card { margin-top: var(--sp-3); }
.result-card.secret { background: rgba(251, 191, 36, .08); border-color: var(--warning); }
.result-card h3 { margin: 0 0 var(--sp-2); font-size: var(--fs-md); color: var(--muted);
  font-weight: 500; display: flex; align-items: center; gap: var(--sp-2); }
.result-card.secret h3 { color: var(--warning); }
.done-head { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.done-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: rgba(52, 211, 153, .15); color: var(--success); flex: none; }
/* Einmaliger Haekchen-Strich, <= 400 ms. Kein Konfetti — das ist ein Werkzeug. */
.done-ic .ic { stroke-dasharray: 26; stroke-dashoffset: 26; animation: draw .4s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* Monospace-Block fuer kopierbare Befehle (curl-Hinweis) */
.codeblock { font-family: var(--monospace); font-size: var(--fs-sm); background: rgba(9, 18, 38, .55);
  border: 1px solid var(--border); border-radius: var(--r-sm); padding: var(--sp-3);
  white-space: pre-wrap; word-break: break-all; margin: var(--sp-2) 0; }

/* --- Fortschritt ---------------------------------------------------------- */
.pg { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--card-2);
  padding: var(--sp-4); }
.pg-head { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.pg-ic { display: inline-flex; color: var(--accent); }
.pg-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 500; }
.pg-pct { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--accent); }
.pg-track { position: relative; height: 10px; border-radius: var(--r-pill); overflow: hidden;
  background: rgba(9, 18, 38, .6); border: 1px solid var(--border); }
.pg-bar { display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: width var(--t-med) var(--ease); }
.pg-sub { margin-top: var(--sp-2); color: var(--muted); font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums; }
/* Phase 2: alle Bytes sind draussen, der Server rechnet (SHA256 ueber die ganze
   Datei, danach ggf. PBKDF2 mit 100.000 Iterationen). Der Balken bleibt auf
   100 %, wird aber UNBESTIMMT — ein stummes 100 % ist der Grund fuer die
   Fehlmeldung "Portal haengt beim Upload". */
.pg-processing .pg-bar { width: 100%;
  background-image:
    linear-gradient(115deg, rgba(255, 255, 255, 0) 25%, rgba(255, 255, 255, .22) 37%, rgba(255, 255, 255, 0) 63%),
    linear-gradient(90deg, var(--accent-2), var(--accent));
  background-size: 300% 100%, 100% 100%; animation: sweep 1.2s linear infinite; }
.pg-processing .pg-pct { color: var(--muted); }
@keyframes sweep { 0% { background-position: 100% 0, 0 0; } 100% { background-position: -100% 0, 0 0; } }
.pg-done .pg-bar { background: var(--success); }
.pg-done .pg-pct { color: var(--success); }
.pg-failed .pg-bar { background: var(--danger); width: 100%; }
.pg-failed .pg-pct { color: var(--danger); }
/* Angehalten (updsrv-50): der Balken bleibt stehen, wo er ist — er wird nur
   gelb. Rate und Restzeit verschwinden im JS, nicht hier: eine Restzeit ohne
   laufende Uebertragung waere eine Luege. */
.pg-paused .pg-bar { background: var(--warning); animation: none; }
.pg-paused .pg-pct { color: var(--warning); }
/* Zweite Zeile fuer "Verbindung unterbrochen — Versuch 2 von 3 in 4 s". Ohne
   sie sieht ein Wiederholversuch wie ein Stillstand aus. */
.pg-note { margin-top: var(--sp-1); color: var(--warning); font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums; }
.pg-queue { margin-bottom: var(--sp-2); color: var(--muted); font-size: var(--fs-sm); }

/* Die Dateiliste selbst ist eine Ablegeflaeche (updsrv-50, D2). Der Rahmen
   erscheint nur, waehrend eine DATEI darueber haengt — ein markierter
   Textschnipsel aus einer anderen Anwendung ist kein Upload. */
.panel.over { outline: 2px dashed var(--accent); outline-offset: -4px;
  background: rgba(37, 99, 235, .06); }

/* --- Ordnerauswahl (updsrv-50) -------------------------------------------- */
/* Der Ordner, in dem man gerade STEHT, ist das Ziel — es gibt bewusst keinen
   zusaetzlichen "Diesen Ordner nehmen"-Knopf. Ein Bestaetigungsklick, der nur
   den Zustand wiederholt, wird uebersehen. */
.fp { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--card-2);
  max-height: 260px; overflow-y: auto; }
.fp-row { display: flex; align-items: center; gap: var(--sp-2); width: 100%;
  padding: var(--sp-2) var(--sp-3); background: transparent; border: none;
  border-bottom: 1px solid var(--border); color: var(--fg); text-align: left;
  cursor: pointer; font-size: var(--fs-md); }
.fp-row:last-child { border-bottom: none; }
.fp-row:hover { background: rgba(37, 99, 235, .1); }
.fp-row:focus-visible { outline: none; box-shadow: var(--ring); }
.fp-row > .ic { color: var(--accent); flex: none; }
.fp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-hint { color: var(--muted); font-size: var(--fs-xs); }
.fp-chev { color: var(--muted); flex: none; }
.fp-empty { padding: var(--sp-3); color: var(--muted); font-size: var(--fs-sm); }
.fp-new { display: flex; gap: var(--sp-2); align-items: flex-start; margin-top: var(--sp-2); }
.fp-new input { flex: 1; min-width: 0; }
/* Der Ablageort ist das ERGEBNIS dieses Schritts und jederzeit sichtbar. Ihn
   erst im Erfolgsdialog zu zeigen ist eine Sekunde zu spaet. */
.up-target { margin-top: var(--sp-3); padding: var(--sp-3); border-radius: var(--r-sm);
  background: rgba(9, 18, 38, .55); border: 1px solid var(--border); }
.up-target .lbl { color: var(--muted); font-size: var(--fs-xs); text-transform: uppercase;
  letter-spacing: .5px; }
.up-target .val { font-family: var(--monospace); font-size: var(--fs-sm); word-break: break-all; }

/* Hinweisstreifen fuer unterbrochene Uploads (updsrv-50, D8). Er steht UEBER
   der Tabelle, weil er eine Handlung anbietet und keine Meldung ist. */
.resume-bar { display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4); background: rgba(251, 191, 36, .09);
  border-bottom: 1px solid var(--warning); }
.resume-bar .ic { color: var(--warning); flex: none; margin-top: 2px; }
.resume-bar .rb-body { flex: 1; min-width: 0; }
.resume-bar .rb-title { font-weight: 500; }
.resume-bar .rb-text { color: var(--muted); font-size: var(--fs-sm); }
.resume-bar .rb-acts { display: flex; gap: var(--sp-2); flex: none; }
@media (max-width: 900px) {
  .resume-bar { flex-wrap: wrap; }
  .resume-bar .rb-acts { width: 100%; }
}

/* --- ALTBESTAND ----------------------------------------------------------- */
/* Diese Regeln bedienen Markup, das noch nicht umgebaut ist. Sie verschwinden
   Zug um Zug mit den folgenden Tranchen (Assistent, Freigaben-Liste, Dateien /
   Logs / Keys). Sie stehen hier bewusst zusammen und nicht verstreut, damit
   beim Aufraeumen nichts uebersehen wird. */
h2 { margin: var(--sp-6) 0 var(--sp-3); font-size: var(--fs-h2); font-weight: 600; color: var(--fg); }
h2:first-child { margin-top: 0; }
.form-grid label { display: flex; flex-direction: column; gap: var(--sp-1);
  color: var(--muted); font-size: var(--fs-md); }
.meta { color: var(--muted); margin-top: var(--sp-2); font-size: var(--fs-sm); }
table.data .sha { font-family: var(--monospace); font-size: var(--fs-xs); color: var(--muted);
  max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-2 { color: var(--success); font-family: var(--monospace); }
.status-4 { color: var(--warning); font-family: var(--monospace); }
.status-5 { color: var(--danger); font-family: var(--monospace); }

/* --- Meldungen ------------------------------------------------------------ */
.msg { color: var(--muted); padding: var(--sp-2) 0; font-size: var(--fs-md); }
.msg.success { color: var(--success); }
.msg.error { color: var(--danger); }

/* --- Bewegung reduzieren -------------------------------------------------- */
/* Der BESTIMMTE Fortschrittsbalken bleibt: er ist Information, keine Zierde.
   Alles Zierende (Shimmer, Sweep, Einflug, Haekchen-Strich) entfaellt. */
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2.4s; }
  .spin-sm { animation-duration: 2.4s; }
  .sk { animation: none; background: var(--card-2); }
  .pg-processing .pg-bar { animation: none;
    background-image: repeating-linear-gradient(115deg, var(--accent) 0 12px, var(--accent-2) 12px 24px); }
  .pg-bar { transition: none; }
  .toast { animation: none; }
  dialog.dlg { animation: none; }
  .done-ic .ic { animation: none; stroke-dashoffset: 0; }
  .live-dot { animation: none; }
  .tab-underline { transition: none; }
}

/* --- Schmale Fenster ------------------------------------------------------ */
/* Ab 900 px werden Tabellen zu Karten: sieben Spalten passen auf einem
   1366-px-Laptop nicht mehr nebeneinander, und eine waagerechte Scrollleiste
   ueber die ganze Seite findet niemand. */
@media (max-width: 900px) {
  .content { padding: var(--sp-4); }
  .topbar { flex-wrap: wrap; gap: var(--sp-2); padding: var(--sp-2) var(--sp-4); }
  .storage { min-width: 100%; order: 5; }
  .tabs { padding: 0 var(--sp-2); overflow-x: auto; }
  .panel-head, .panel-body { padding: var(--sp-3) var(--sp-4); }

  table.data thead { display: none; }
  table.data, table.data tbody, table.data tr, table.data td { display: block; width: 100%; }
  table.data tr { border: 1px solid var(--border); border-radius: var(--r-md);
    margin-bottom: var(--sp-3); padding: var(--sp-2); background: var(--card-2); }
  table.data td { border: none; padding: var(--sp-1) var(--sp-2); display: flex;
    justify-content: space-between; gap: var(--sp-3); align-items: center; }
  table.data td::before { content: attr(data-label); color: var(--muted);
    font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .5px; flex: none; }
  table.data .num, table.data .ell { text-align: left; max-width: none; }
  table.data tr.state-row { border: none; background: transparent; padding: 0; }
  table.data tr.state-row td { display: block; }
  table.data tr.state-row td::before { content: none; }

  dialog.dlg, dialog.dlg-sm, dialog.dlg-lg { width: 100vw; max-width: 100vw;
    height: 100dvh; max-height: 100dvh; border-radius: 0; border: none; }
}

@media (max-width: 480px) {
  .search, .search input { width: 100%; min-width: 0; }
  .dlg-foot button { flex: 1; justify-content: center; }
  .dlg-foot button.right { margin-left: 0; }
}
