/* ==========================================================================
   MaeliOS Kobold   -   usr/lib/hub.css
   --------------------------------------------------------------------------
   Die Startansicht "Hub" (usr/lib/hub.js) und die Buehne im Hub.

   Alles haengt an #desktop[data-ansicht="hub"], gesetzt von
   MaeliOS.desk.ansichtSetzen (usr/lib/desk.js). Im klassischen Desktop
   (data-ansicht="classic") greift keine dieser Regeln; dort bleibt alles wie
   in usr/lib/desk.css.

   Farben, Radien und Schriften kommen ausschliesslich aus --ui-* (gesetzt von
   usr/share/themes/themes.js auf #desktop). Ein Themenwechsel faerbt den Hub
   damit sofort mit.

   Zwei Achsen, zwei Werkzeuge:
     - Der INHALT (Spalten, Bilder, Abschnitte) hoert auf die Breite des
       Containers: #hub ist @container hub. Das Fenster entscheidet, nicht
       der Viewport (AGENTS.md).
     - Die NAVIGATION ist Sache der Shell: data-shell auf #desktop (gesetzt
       von usr/lib/shell.js, ARCHITEKTUR_ENTSCHEIDUNG.md 6.5). kompakt =
       Bodenleiste 64 px, mittel/erweitert = Schiene 72 px, gross = Sidebar
       220 px (einklappbar auf 72 px). Es sind DIESELBEN Knoten (.hubboden =
       .slot-nav), nur per CSS umgeordnet - kein zweiter Aufbau, kein
       Reparenting. Die Leiste ist fixed (wie mobil schon), damit sie der
       Tastatur weicht und nicht mit dem Inhalt scrollt; #hub bleibt die
       volle Buehne (inset:0) und bekommt links Platz fuer die Schiene.

   Ebenen (Reihenfolge: usr/lib/theme.css):
     shells      Rahmen, Raster, Kopf, Navigation — das Layout der Ansicht
     components  Kacheln, Leute, Filter, Sheets, Install-Muster — die Bausteine
   ========================================================================== */

@layer shells{
/* ------------------------------------------------------ An und aus */
#desktop[data-ansicht="hub"] #hub{ display:block; }
#desktop[data-ansicht="classic"] #hub{ display:none; }
#hub[hidden]{ display:none; }

/* Eigene Masse des Hubs. Farben kommen aus --ui-*; nur die Schatten sind
   eigene Werte und stehen deshalb hier als Variable. */
#desktop[data-ansicht="hub"]{
  --hub-schatten: rgba(0,0,0,.35);
  --hub-schatten-schwach: rgba(0,0,0,.12);
  --hub-kontakt: rgba(15,18,24,.12);
  --hub-schatten-blatt: rgba(0,0,0,.38);
  --hub-schleier: rgba(8,10,14,.62);
  /* Breite der Navigation je Klasse; die Schiene ist intern ein Grid. */
  --hub-rand: clamp(14px, 3vw, 34px);
  --hub-schiene: 72px;
  --hub-sidebar: 220px;
}

/* Im Hub gibt es kein Icon-Raster und keine Leiste: der Hub ist die Leiste. */
#desktop[data-ansicht="hub"] #deskicons,
#desktop[data-ansicht="hub"] #panel,
#desktop[data-ansicht="hub"] #online{ display:none; }

/* ------------------------------------------------------------ Rahmen */
#hub{
  position:absolute; inset:0; overflow-y:auto; overflow-x:hidden;
  padding:18px var(--hub-rand) 88px;
  box-sizing:border-box;
  color:var(--ui-text); font-family:var(--ui-font);
  container-type:inline-size; container-name:hub;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:thin;
  /* Anker-Spruenge landen nicht unter der Bodenleiste (64 px + Luft). */
  scroll-padding-bottom:84px;
  scroll-padding-top:64px;
}

/* Der Kopf klebt am Rand: EINE Zeile, <= 60 px (REQ-1.1/1.2). Titel,
   Online-Zaehler und genau ein Aktionsknopf (⋯). Deckende warme Flaeche
   statt Weichzeichner (ARCHITEKTUR.md: kein backdrop-filter). */
.hubkopf{
  position:sticky; top:-18px; z-index:3;
  display:flex; align-items:center; gap:10px; flex-wrap:nowrap;
  min-height:56px; box-sizing:border-box;
  margin:0 calc(-1 * var(--hub-rand)) 18px;
  padding:3px var(--hub-rand);
  background:var(--ui-body);
  border-bottom:1px solid var(--ui-border-color);
}

.hubmarke-box{
  display:flex; align-items:center; gap:10px; min-width:0; min-height:48px;
  padding:2px 6px 2px 2px; flex:0 1 auto;
  background:transparent; border:0; border-radius:var(--ui-radius);
  color:inherit; font:inherit; text-align:left; cursor:pointer;
}
.hubmarke-box:hover{ background:var(--ui-face); }
.hubmarke-box:focus-visible{ outline:2px solid var(--ui-accent); outline-offset:2px; }
.hublogo{ width:36px; height:36px; display:block; flex:0 0 auto; }
.hublogo svg{ width:36px; height:36px; display:block; }
.hubname{ display:flex; flex-direction:column; line-height:1.05; min-width:0; }
.hubname b{ font-size:16px; letter-spacing:.02em; white-space:nowrap; }
.hubname span{ font-size:var(--fs-label); color:var(--ui-dim); letter-spacing:.01em; white-space:nowrap; }

.hubknoepfe{ display:flex; align-items:center; gap:8px; margin-left:auto; flex:0 0 auto; }

.hubkomfort{
  min-width:48px; min-height:48px; padding:0 12px; cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center;
  font:700 16px/1 var(--ui-font); color:var(--ui-text);
  background:var(--ui-face); border:1px solid var(--ui-border-color);
  border-radius:999px; box-sizing:border-box; flex:0 0 auto;
}
.hubkomfort:hover{ background:var(--ui-face-2); }
.hubkomfort:focus-visible{ outline:2px solid var(--ui-accent); outline-offset:2px; }

/* Online-Zaehler: Pille >= 48 px (KPI 3). Das Wort "online" faellt auf sehr
   schmalem Container weg, Punkt und Zahl bleiben (immer noch >= 48 px). */
.hubonline{
  display:inline-flex; align-items:center; gap:7px;
  min-height:48px; min-width:48px; padding:0 14px; cursor:pointer;
  font:inherit; font-size:var(--fs-label); color:var(--ui-panel-fg);
  background:var(--ui-panel); border:1px solid var(--ui-border-color);
  border-radius:999px; box-sizing:border-box;
}
.hubonline b{ font-weight:700; }
.hubonline .hubpunkt{ width:8px; height:8px; border-radius:50%; background:var(--ui-accent); flex:0 0 auto; }
.hubonline.allein .hubpunkt{ background:var(--ui-dim); }
.hubonline-wort{ white-space:nowrap; }

/* Der eine Aktionsknopf (⋯): >= 48 x 48 (REQ-1.1, KPI 3). */
.hubmehrd{
  min-width:48px; min-height:48px; padding:0; cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center;
  font:600 20px/1 var(--ui-font); color:var(--ui-text);
  background:var(--ui-face); border:1px solid var(--ui-border-color);
  border-radius:999px; box-sizing:border-box; flex:0 0 auto;
}
.hubmehrd:hover{ background:var(--ui-face-2); }

/* Knopf im ⋯-Sheet (Offline-Paket, klassischer Desktop): >= 48 px. */
.hubknopf{
  min-height:48px; padding:0 16px; cursor:pointer;
  font:inherit; font-size:var(--fs-text); color:var(--ui-text);
  background:var(--ui-face); border:1px solid var(--ui-border-color);
  border-radius:var(--ui-radius); box-sizing:border-box;
  display:inline-flex; align-items:center; gap:10px;
}
.hubknopf:hover{ background:var(--ui-face-2); }
.hubonline:focus-visible, .hubknopf:focus-visible, .hubmehrd:focus-visible{
  outline:2px solid var(--ui-accent); outline-offset:2px; }
.hubknopf[hidden]{ display:none; }
.hubdesk{ border-color:var(--ui-accent); }

/* Offline-Paket: Symbol und Wort. Den Zustand traegt allein die Farbe des
   Symbols (voll / alt / teil), gesetzt von usr/lib/desk.js. */
.hubpaket{ color:var(--paket-fehl, var(--tinte-leise)); }
.hubpaket.voll{ color:var(--paket-voll, var(--erfolg)); }
.hubpaket.alt{ color:var(--paket-alt, var(--warnung)); }
.hubpaketbild, .hubpaketbild svg{ display:block; width:18px; height:18px; flex:0 0 auto; }
.hubpakettext{ white-space:nowrap; }

/* Der Inhaltsrahmen traegt die Abschnitte. */
.hubinhalt{ display:flex; flex-direction:column; gap:clamp(10px, 1.8vw, 18px); max-width:1120px; margin:0 auto; }

/* Raster und Reihe: Spaltenzahl nach Containerbreite. Mobil ZWEI Spalten
   (REQ-7.2), bei 200 % Zoom (< 16em / ~256 px) 1 Spalte gegen harte Wortbrueche
   (REQ-7.4), ab 37.5em drei, ab 60em vier; Katalog max. 1120 px (SPEC 3.3). */
.hubraster{ display:grid; gap:var(--abstand-s); grid-template-columns:repeat(2, minmax(0, 1fr)); }
.hubreihe{ display:grid; gap:var(--abstand-s); grid-template-columns:repeat(auto-fill, minmax(108px, 1fr)); }
@container hub (max-width: 16em){ .hubraster{ grid-template-columns:minmax(0, 1fr); } }
@container hub (min-width: 37.5em){ .hubraster{ grid-template-columns:repeat(3, minmax(0, 1fr)); } }
@container hub (min-width: 60em){ .hubraster{ grid-template-columns:repeat(4, minmax(0, 1fr)); } }

/* ==========================================================================
   Navigation — EIN Modell, vier Klassen (REQ-8.1). Dieselben Knoten
   (.hubboden = .slot-nav), nur CSS-Umordnung. Die Form folgt data-shell
   (usr/lib/shell.js), nicht dem Viewport: die Shell misst den Desktop und
   setzt die Klasse; hier steht nur die Umordnung.
   ========================================================================== */
.hubboden{ display:none; }

/* kompakt (< 37.5em): Bodenleiste 64 px, vier Ziele nebeneinander. */
#desktop[data-ansicht="hub"][data-shell="kompakt"] .hubboden{
  position:fixed; left:0; right:0; bottom:0; z-index:8;
  display:grid; grid-template-columns:repeat(4, 1fr);
  gap:4px; box-sizing:content-box;
  height:64px; padding:0 6px env(safe-area-inset-bottom, 0px);
  background:var(--ui-panel);
  box-shadow:0 -1px 0 var(--ui-border-color);
  transform:translateY(calc(-1 * var(--kb-inset, 0px)));
  transition:transform .16s ease;
}
#desktop[data-ansicht="hub"][data-shell="kompakt"] #hub{
  padding:8px 10px calc(64px + 18px + env(safe-area-inset-bottom, 0px));
}
#desktop[data-ansicht="hub"][data-shell="kompakt"] .hubkopf{
  top:-8px; margin:0 -10px 8px; padding:3px 10px;
}

/* mittel (37.5–52.49em) und erweitert (52.5–79.99em): Schiene 72 px links.
   Icon ueber Label (eine Spalte): 72 px sind zu schmal fuer Icon + Wort
   nebeneinander, die vier Ziele stehen untereinander. */
#desktop[data-ansicht="hub"][data-shell="mittel"] .hubboden,
#desktop[data-ansicht="hub"][data-shell="erweitert"] .hubboden{
  position:fixed; left:0; top:0; bottom:0; z-index:8;
  width:var(--hub-schiene); box-sizing:border-box;
  display:flex; flex-direction:column; align-items:center; gap:6px;
  padding:12px 0 calc(12px + env(safe-area-inset-bottom, 0px));
  background:var(--ui-panel);
  box-shadow:1px 0 0 var(--ui-border-color);
}

/* gross (>= 80em): Sidebar 220 px, Icon + Label waagerecht (eine Zeile je
   Ziel). Einklappbar auf 72 px (data-nav="ein", Knopf .hubbodenein).
   Den linken Platz reserviert shell.css direkt auf #desktop (wie rechts das
   Chat-Pane), damit kein Fenster ueber die Sidebar rutscht. */
#desktop[data-ansicht="hub"][data-shell="gross"] .hubboden{
  position:fixed; left:0; top:0; bottom:0; z-index:8;
  width:var(--hub-sidebar); box-sizing:border-box;
  display:flex; flex-direction:column; align-items:stretch; gap:6px;
  padding:12px 8px calc(12px + env(safe-area-inset-bottom, 0px));
  background:var(--ui-panel);
  box-shadow:1px 0 0 var(--ui-border-color);
}
#desktop[data-ansicht="hub"][data-shell="gross"][data-nav="ein"] .hubboden{
  width:var(--hub-schiene); align-items:center; padding:12px 0 calc(12px + env(safe-area-inset-bottom, 0px));
}

/* Chat-Pane (Stufe 2d-ii): in `erweitert` und `gross` ist das Pane
   angedockt. Dort bekommt die Bühne kein Polster mehr, sondern #desktop ist
   selbst nur so breit wie die Bühne (shell.css, "Pane-Spalte freihalten");
   #hub erbt diese Breite über inset:0. Ein Polster zusätzlich wäre die zweite
   Reservierung derselben 360 px. In `mittel` legt sich die Schublade über die
   Bühne — dort bleibt das Polster, damit keine Kachel darunter liegt. */
#desktop[data-ansicht="hub"][data-shell="mittel"][data-chat="an"]:not([data-chatfenster="ja"]) #hub{
  padding-right:340px;
}

/* Schmaler Inhalt: eine Kachelspalte mehr Luft, kleinere Bilder. Die
   Schwelle hoert auf den Container (Inhalt), nicht auf die Shell-Klasse. */
@container hub (max-width: 37.5em){
  .hubname span{ display:none; }
  .hubreihe{ grid-template-columns:repeat(auto-fill, minmax(94px, 1fr)); gap:10px; }
}
@container hub (max-width: 380px){
  .hubreihe{ grid-template-columns:repeat(auto-fill, minmax(82px, 1fr)); }
  /* Sehr schmal: das Wort "online" faellt, Punkt + Zahl bleiben >= 48 px. */
  .hubonline-wort{ display:none; }
  .hubonline{ padding:0 12px; }
}
}

@layer components{
/* ---------------------------------------------------------- Inhalt */
.hubabschnitt{
  padding:14px 16px 16px;
  background:color-mix(in srgb, var(--ui-body) 96%, transparent);
  border:1px solid var(--ui-border-color);
  border-radius:var(--ui-radius);
  box-shadow:0 2px 10px var(--hub-schatten-schwach);
}
.hubabschnitt[hidden]{ display:none; }
.hubabschnitt h2{ margin:0 0 10px; font-size:var(--fs-text); font-weight:650; letter-spacing:.02em; }
.hubabschnitt-kopf{ display:flex; align-items:baseline; gap:12px; flex-wrap:wrap; margin-bottom:10px; }
.hubabschnitt-kopf h2{ margin:0; }
.hubabschnitt-hinweis{ margin:0; font-size:var(--fs-label); color:var(--tinte-leise); font-variant-numeric:tabular-nums; }

/* "Zuletzt gespielt" (REQ-4.1): 148 px, hoechstens vier Kacheln; am Handy
   42% Breite, damit die dritte Karte leicht hereinspitzelt (Peek). */
#hubzuletzt .hubleiste{
  display:grid; grid-auto-flow:column; grid-auto-columns:minmax(9.2rem, 42%);
  gap:var(--abstand-s); height:148px; overflow-x:auto; overflow-y:hidden;
  scroll-snap-type:x proximity; scroll-padding-inline:16px;
  scrollbar-width:thin; padding-bottom:var(--abstand-xs);
}
@container hub (min-width: 37.5em){
  #hubzuletzt .hubleiste{ grid-auto-columns:minmax(9.5rem, 13.5rem); }
}
#hubzuletzt .hubleiste .hubkachel{ height:100%; scroll-snap-align:start; }
#hubzuletzt .hubbild, #hubzuletzt .hubbild svg{ width:44px; height:44px; }

/* Kuratierte Gruppen (REQ-4.3). */
.hubgruppe + .hubgruppe{ margin-top:var(--abstand-l); }
.hubgruppe-kopf{ display:flex; align-items:baseline; gap:var(--abstand-s); margin:0 0 var(--abstand-s); }
.hubgruppe-kopf h3{ margin:0; font-size:var(--fs-label); font-weight:650; letter-spacing:.02em; color:var(--tinte-leise); }
.hubgruppe-zahl{ font-size:var(--fs-label); color:var(--tinte-leise); font-variant-numeric:tabular-nums; }

/* Filter: fuenf Chips, umbrechend (REQ-4.2/4.4). Trefferflaeche >= 48 px
   (KPI 3): der Baustein steht auf 44 px, der Hub hebt seine Chips auf 48. */
.hubpills{
  display:flex; flex-wrap:wrap; gap:var(--abstand-s);
  padding-bottom:var(--abstand-xs); margin-bottom:var(--abstand-m);
  scroll-padding-inline:16px;
}
.hubpills .bst-chip{ min-height:var(--groesse-tipp); }
/* Die Praesenzleiste bleibt 48 px (REQ-3.1); ihre Chips (einladen, +N)
   werden ebenfalls 48 px und fuellen die Zeile genau. */
.hublive .bst-chip{ min-height:var(--groesse-tipp); }

.hubleer{ margin:14px 0 0; font-size:var(--fs-label); color:var(--ui-dim); }
.hubleer[hidden]{ display:none; }

/* ==========================================================================
   Ziele der Navigation (alle Klassen). Grundregel: Icon ueber Label.
   Die Sidebar (gross, aufgeklappt) stellt Icon + Label waagerecht.
   ========================================================================== */
.hubbodenknopf{
  position:relative;
  min-width:64px; min-height:48px; padding:4px 2px; cursor:pointer;
  font:inherit; font-size:var(--fs-label); color:var(--ui-panel-fg);
  background:none; border:0; border-radius:12px; box-sizing:border-box;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px;
  touch-action:manipulation;
}
.hubbodensym{ display:block; height:24px; }
.hubbodensym svg{ display:block; }
.hubbodenwort{ font-size:var(--fs-label); line-height:1; }
.hubbodenknopf:active{ background:var(--ui-panel-hover); }
.hubbodenknopf:focus-visible{ outline:2px solid var(--ui-accent); outline-offset:-1px; }
.hubbodenknopf[aria-current="page"]{ background:var(--ui-accent); color:var(--ui-sel-fg); }
.hubbodenknopf[aria-current="page"] .hubbodenwort{ font-weight:700; }
.hubbodenzahl{
  position:absolute; top:2px; right:calc(50% - 26px);
  min-width:20px; height:20px; padding:0 4px; border-radius:999px;
  font-size:var(--fs-label); font-weight:700; line-height:20px; text-align:center;
  background:var(--ui-accent); color:var(--ui-sel-fg);
  box-shadow:0 0 0 2px var(--ui-panel); box-sizing:border-box;
}
.hubbodenzahl[hidden]{ display:none; }
.hubbodenknopf[aria-current="page"] .hubbodenzahl{ background:var(--ui-sel-fg); color:var(--ui-accent); }

/* Schiene (72 px): Ziele fuellen die Breite, Icon ueber Label, >= 48 px. */
#desktop[data-shell="mittel"] .hubbodenknopf,
#desktop[data-shell="erweitert"] .hubbodenknopf,
#desktop[data-shell="gross"][data-nav="ein"] .hubbodenknopf{
  width:64px; min-width:0; min-height:64px;
}

/* Sidebar (220 px): Icon + Label waagerecht, eine Zeile je Ziel >= 52 px. */
#desktop[data-shell="gross"]:not([data-nav="ein"]) .hubbodenknopf{
  flex-direction:row; justify-content:flex-start; align-items:center;
  width:100%; min-width:0; min-height:52px; gap:12px; padding:0 14px;
  text-align:left;
}
#desktop[data-shell="gross"]:not([data-nav="ein"]) .hubbodenwort{ flex:1 1 auto; }
#desktop[data-shell="gross"]:not([data-nav="ein"]) .hubbodenzahl{
  position:static; transform:none; margin-left:auto;
}

/* Einklappen der Sidebar: nur gross sichtbar, >= 48 x 48, ans Ende gesetzt. */
.hubbodenein{
  display:none; margin-top:auto; cursor:pointer;
  min-width:48px; min-height:48px; padding:0; box-sizing:border-box;
  align-items:center; justify-content:center;
  font:600 22px/1 var(--ui-font); color:var(--ui-panel-fg);
  background:none; border:1px solid var(--ui-border-color); border-radius:12px;
}
#desktop[data-shell="gross"] .hubbodenein{ display:inline-flex; }
#desktop[data-shell="gross"]:not([data-nav="ein"]) .hubbodenein{ width:100%; }
.hubbodenein:hover{ background:var(--ui-panel-hover); }
.hubbodenein:focus-visible{ outline:2px solid var(--ui-accent); outline-offset:-2px; }

/* Schmaler Inhalt — Baustein-Antworten (Container, nicht Shell). */
@container hub (max-width: 37.5em){
  .hubbild:not(.hubcover), .hubbild:not(.hubcover) svg{ width:46px; height:46px; }
  .hubkachel .hubcover{ max-height:90px; width:min(100%, 120px); margin:0 auto; }
  .hubabschnitt{ padding:10px var(--abstand-s); }
  .hubabschnitt-kopf{ margin-bottom:6px; }
  .hubpills{ gap:6px; margin-bottom:8px; }
}
@container hub (max-width: 380px){
  .hubbild:not(.hubcover), .hubbild:not(.hubcover) svg{ width:42px; height:42px; }
  .hubraster{ gap:var(--abstand-xs); }
}

/* ==========================================================================
   Ich-Sheet
   ========================================================================== */
.hubich{
  margin:auto auto 0; width:min(440px, 100vw); max-width:100%;
  padding:0 0 calc(12px + env(safe-area-inset-bottom, 0px));
  border:1px solid var(--ui-border-color); border-top-left-radius:18px;
  border-top-right-radius:18px; border-bottom:0;
  background:var(--ui-body); color:var(--ui-text);
  font-family:var(--ui-font); font-size:var(--fs-text);
  box-shadow:0 -18px 50px var(--hub-schatten-blatt);
}
.hubich::backdrop{ background:var(--hub-schleier); }
.hubich-kopf{ display:flex; align-items:center; gap:10px; padding:14px 14px 8px 18px; }
.hubich-kopf h2{ margin:0; flex:1; font-size:18px; font-weight:700; }
.hubich-name{ margin:0 18px 10px; font-size:var(--fs-label); color:var(--ui-dim); }
.hubich-liste{ display:flex; flex-direction:column; gap:8px; padding:0 14px 6px; }
.hubich-knopf{
  min-height:52px; padding:0 16px; cursor:pointer; text-align:left;
  font:inherit; font-size:var(--fs-text); color:var(--ui-text);
  background:var(--ui-face); border:1px solid var(--ui-border-color);
  border-radius:12px;
}
.hubich-knopf:hover{ background:var(--ui-face-2); }
.hubich-knopf:focus-visible{ outline:2px solid var(--ui-accent); outline-offset:2px; }
.hubich-knopf[hidden]{ display:none; }
/* Der Primaer-CTA der Ansicht: "Als App speichern" >= 56 px (KPI 3). */
.hubich-knopf.hubich-app, .hubich-liste .bst-knopf-wichtig{ min-height:56px; }
.hubich-app{ border-color:var(--ui-accent); }
.hubich-gefuehl{ display:flex; flex-direction:column; gap:8px; padding-top:6px; border-top:1px solid var(--linie); }
.hubich-schalter[aria-pressed="true"]{ border-color:var(--akzent); }

/* ==========================================================================
   ⋯-Sheet (Aktionen): Suche, Offline-Paket, klassischer Desktop.
   ========================================================================== */
.hubaktionen{
  margin:auto auto 0; width:min(440px, 100vw); max-width:100%;
  padding:0 0 calc(12px + env(safe-area-inset-bottom, 0px));
  border:1px solid var(--ui-border-color); border-top-left-radius:18px;
  border-top-right-radius:18px; border-bottom:0;
  background:var(--ui-body); color:var(--ui-text);
  font-family:var(--ui-font); font-size:var(--fs-text);
  box-shadow:0 -18px 50px var(--hub-schatten-blatt);
}
.hubaktionen::backdrop{ background:var(--hub-schleier); }
.hubaktionen .hubsuche{ padding:0 14px 10px; }
.hubfeld{
  width:100%; box-sizing:border-box;
  padding:12px 14px; min-height:48px;
  /* 16 px: darunter zoomt Safari beim Tippen in das Feld hinein. */
  font:inherit; font-size:16px; color:var(--ui-text);
  background:var(--ui-face-2); border:1px solid var(--ui-border-color);
  border-radius:var(--ui-radius); appearance:none;
}
.hubfeld::placeholder{ color:var(--ui-dim); }
.hubfeld:focus-visible{ outline:2px solid var(--ui-accent); outline-offset:1px; }
.hubaktionen-liste{ display:flex; flex-direction:column; gap:8px; padding:0 14px 6px; }
.hubaktionen-liste .hubknopf{ width:100%; justify-content:flex-start; }
/* Der klassische Schreibtisch ist am Handy nicht erreichbar (REQ-8.2):
   kompakt und grober Zeiger aus — im ⋯-Sheet wie im Ich-Blatt. */
#desktop[data-shell="kompakt"] .hubdesk,
#desktop[data-shell="kompakt"] .hubich-klassik{ display:none; }
@media (pointer: coarse){ .hubdesk, .hubich-klassik{ display:none; } }

/* ==========================================================================
   Install-Muster (REQ-6.2). Ruhige Inline-Karte am Feed-Ende und der
   Post-Engagement-Hinweis. Beide nur bei offenem Gate (installieren.js),
   im Standalone aus (REQ-6.3). Farben aus --ui-*, Trefferflaechen >= 48 px.
   ========================================================================== */
.hubinstall{
  display:flex; align-items:center; gap:var(--abstand-m);
  padding:var(--abstand-m) var(--abstand-m);
  background:color-mix(in srgb, var(--ui-body) 96%, transparent);
  border:1px solid var(--ui-border-color); border-radius:var(--ui-radius);
  box-shadow:0 2px 10px var(--hub-schatten-schwach);
}
@media (prefers-reduced-transparency: reduce){
  .hubabschnitt, .hubinstall{ background:var(--ui-body); }
}
.hubich-namezeile{
  display:flex; align-items:center; justify-content:space-between; gap:var(--abstand-s);
  flex-wrap:wrap; margin:0 18px 10px;
}
.hubich-namezeile .hubich-name{ margin:0; }
.hubich-nameaktionen{ display:flex; flex-wrap:wrap; gap:var(--abstand-xs); }
.hubich-nameedit{
  min-height:var(--groesse-tipp); padding:0 var(--abstand-m); flex:0 0 auto;
  font-size:var(--fs-label);
}
.hubwahl-chip{ border-color:var(--ui-accent); font-weight:700; }

/* Komfort-, Wahl- & Album-Sheets */
.hubkomfort-gruppe + .hubkomfort-gruppe{ margin-top:var(--abstand-l); }
.hubkomfort-gruppe h3, .hubalbum-abschnitt{
  margin:0 0 var(--abstand-s); font-size:var(--fs-label); font-weight:700; color:var(--tinte-leise);
}
.hubkomfort-reihe, .hubalbum-zubliste{
  display:flex; flex-wrap:wrap; gap:var(--abstand-s);
}
.hubkomfort-reihe .bst-chip, .hubalbum-zubliste .bst-chip{
  min-height:var(--groesse-tipp);
}
.hubkomfort-reihe .bst-chip[aria-pressed="true"],
.hubalbum-zubliste .bst-chip[aria-pressed="true"]{
  background:var(--ui-accent); color:var(--auswahl-tinte); border-color:var(--ui-accent); font-weight:700;
}
.hubkomfort-spalte{ display:flex; flex-direction:column; gap:var(--abstand-s); }
.hubwahl-ergebnis{
  display:flex; align-items:center; gap:var(--abstand-m);
  margin:var(--abstand-l) 0 var(--abstand-m); padding:var(--abstand-m);
  background:var(--flaeche-hoch); border:1px solid var(--linie); border-radius:var(--karte-radius);
}
.hubwahl-schaf, .hubwahl-schaf svg{ width:64px; height:64px; flex:0 0 auto; display:block; }
.hubwahl-info{ min-width:0; flex:1 1 auto; }
.hubwahl-titel{ display:block; font-size:var(--fs-kartentitel); }
.hubwahl-text{ margin:4px 0 0; font-size:var(--fs-label); color:var(--tinte-leise); }
.hubalbum-kopf{
  display:flex; align-items:center; gap:var(--abstand-m);
  margin-bottom:var(--abstand-m); padding:var(--abstand-m);
  background:var(--flaeche-hoch); border:1px solid var(--linie); border-radius:var(--karte-radius);
}
.hubalbum-figur, .hubalbum-figur svg{ width:68px; height:68px; flex:0 0 auto; display:block; }
.hubalbum-unter{ margin:0; font-size:var(--fs-label); color:var(--tinte-leise); }
.hubalbum-stand{ margin:4px 0 0; font-weight:700; font-size:var(--fs-text); }
.hubalbum-abschnitt{ margin-top:var(--abstand-l); }
.hubalbum-karten{ display:grid; grid-template-columns:1fr; gap:var(--abstand-s); }
.hubalbum-karte{
  display:flex; align-items:center; gap:var(--abstand-s); padding:var(--abstand-s) var(--abstand-m);
  background:var(--flaeche); border:1px solid var(--linie); border-radius:var(--karte-radius);
}
.hubalbum-karte.offen{ opacity:.68; }
.hubalbum-sym, .hubalbum-sym svg{ width:44px; height:44px; flex:0 0 auto; display:block; }
.hubalbum-text b{ display:block; font-size:var(--fs-label); }
.hubalbum-text p{ margin:2px 0 0; font-size:var(--fs-label); color:var(--tinte-leise); }

/* Semantischer Footer mit Hobby-Hinweis & Rechtlichem */
.hubfuss{
  padding:var(--abstand-l) var(--abstand-m) var(--abstand-s);
  text-align:center; color:var(--tinte-leise); font-size:var(--fs-label);
}
.hubfuss-hinweis{ margin:0 0 var(--abstand-s); }
.hubfuss-links{ display:flex; flex-wrap:wrap; justify-content:center; gap:var(--abstand-s) var(--abstand-l); }
.hubfuss-links a, .hubfuss-kontakt{
  min-height:var(--groesse-tipp); padding:0 var(--abstand-xs);
  display:inline-flex; align-items:center;
  color:var(--tinte); text-decoration:underline;
  background:transparent; border:0; font:inherit; cursor:pointer;
}
.hubich-nameform{
  display:flex; flex-wrap:wrap; gap:var(--abstand-s); align-items:center;
  margin:0 14px 12px; padding:var(--abstand-s);
  background:var(--flaeche); border:1px solid var(--linie); border-radius:var(--karte-radius);
}
.hubich-nameform[hidden]{ display:none; }
.hubich-nameform .hubfeld{ flex:1 1 11rem; min-width:0; }
.hubich-nameform .bst-knopf{ flex:0 0 auto; }
.hubeinladen-text, .hubcode-text{
  margin:0 0 var(--abstand-m); font-size:var(--fs-label); line-height:1.45; color:var(--tinte-leise);
}
.hubeinladen-linkbox{
  padding:var(--abstand-s) var(--abstand-m); margin-bottom:var(--abstand-s);
  font-family:ui-monospace, 'SFMono-Regular', 'Menlo', monospace; font-size:var(--fs-label);
  color:var(--tinte); background:var(--flaeche-hoch); border:1px solid var(--linie);
  border-radius:var(--karte-radius); overflow-wrap:anywhere;
}
.hubeinladen-qr{
  width:132px; height:132px; margin:var(--abstand-s) auto var(--abstand-m);
  padding:6px; box-sizing:border-box;
  color:var(--tinte); background:var(--flaeche-hoch);
  border:1px solid var(--linie); border-radius:var(--karte-radius);
}
.hubeinladen-qr svg{ width:100%; height:100%; display:block; }
.hubeinladen-aktionen, .hubpraesenz-aktionen{
  display:flex; flex-direction:column; gap:var(--abstand-s); margin-bottom:var(--abstand-m);
}
.hubpraesenz-kopf{ margin:0 0 var(--abstand-s); font-size:var(--fs-label); color:var(--tinte-leise); }
.hubpraesenz-liste{
  list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:var(--abstand-xs);
}
.hubpraesenz-zeile{
  display:flex; align-items:center; gap:var(--abstand-s); min-height:var(--groesse-tipp);
  padding:var(--abstand-xs) var(--abstand-s);
  background:var(--flaeche); border:1px solid var(--linie); border-radius:var(--karte-radius);
}
.hubpraesenz-name{ flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:var(--fs-text); }
.hubpraesenz-hallo{ min-height:var(--groesse-tipp); padding:0 var(--abstand-m); font-size:var(--fs-label); }
.hubcode-form{ display:flex; flex-direction:column; gap:var(--abstand-s); }
.hubcode-label{ font-size:var(--fs-label); font-weight:650; color:var(--tinte); }
.hubcode-eingabe{
  text-transform:uppercase; letter-spacing:.14em; font-weight:700;
  font-family:ui-monospace, 'SFMono-Regular', 'Menlo', monospace;
}
.hubcode-eingabe::placeholder{
  text-transform:none; letter-spacing:normal; font-weight:400;
}
.hubcode-fehler{ margin:0; min-height:1.2em; font-size:var(--fs-label); color:var(--gefahr); }
.hubcode-fehler[hidden]{ display:none; }
.hubcode-btn{ min-height:56px; width:100%; }
.hubinstall[hidden]{ display:none; }
/* Das Bild traegt den Kobold; er liegt im SVG nicht mittig, der Ausschnitt
   zentriert ihn (sonst schaut nur die Zipfelmütze heraus). */
.hubinstall-bild{ width:44px; height:44px; flex:0 0 auto; display:block; overflow:hidden; }
.hubinstall-bild svg{ width:44px; height:44px; display:block; }
.hubinstall-text{ flex:1 1 auto; min-width:0; }
.hubinstall-titel{ margin:0; font-size:var(--fs-text); font-weight:650; }
.hubinstall-satz{ margin:2px 0 0; font-size:var(--fs-label); color:var(--tinte-leise); overflow-wrap:anywhere; }
.hubinstall-aktionen{ display:flex; align-items:center; gap:var(--abstand-s); flex:0 0 auto; }
.hubinstall-los{ min-height:56px; }
.hubinstall-weg{
  min-width:48px; min-height:48px; padding:0; cursor:pointer;
  font:inherit; font-size:22px; line-height:1; color:var(--ui-dim);
  background:none; border:0; border-radius:var(--ui-radius);
}
.hubinstall-weg:hover{ background:var(--ui-face-2); }
.hubinstall-weg:focus-visible{ outline:2px solid var(--ui-accent); outline-offset:2px; }
@container hub (max-width: 37.5em){
  .hubinstall{ flex-wrap:wrap; }
  .hubinstall-aktionen{ width:100%; }
  .hubinstall-los{ flex:1 1 auto; }
}

/* Post-Engagement-Hinweis: role="status", steht UEBER der Bodenleiste,
   verdeckt kein Navigationsziel (REQ-6.1). 15 s, Schliessen >= 48 px. */
.install-nach{
  position:fixed; left:50%; transform:translateX(-50%); z-index:8000;
  bottom:calc(64px + 18px + env(safe-area-inset-bottom, 0px));
  width:min(440px, calc(100vw - 24px)); box-sizing:border-box;
  display:flex; flex-direction:column; gap:var(--abstand-s);
  padding:var(--abstand-m);
  background:var(--ui-auf-tief); color:var(--ui-auf-text);
  border:1px solid var(--ui-border-color); border-left:3px solid var(--ui-accent);
  border-radius:var(--ui-radius); box-shadow:0 12px 34px var(--hub-schatten);
  font-family:var(--ui-font);
}
#desktop:not([data-shell="kompakt"]) .install-nach{ bottom:calc(18px + env(safe-area-inset-bottom, 0px)); }
.install-nach-satz{ margin:0; font-size:var(--fs-label); line-height:1.4; overflow-wrap:anywhere; }
.install-nach-aktionen{ display:flex; align-items:center; gap:var(--abstand-s); }
.install-nach-los{ min-height:56px; flex:1 1 auto; }
.install-nach-zu{
  min-width:48px; min-height:48px; padding:0; cursor:pointer;
  font:inherit; font-size:22px; line-height:1; color:var(--ui-auf-text);
  background:none; border:0; border-radius:var(--ui-radius);
}
.install-nach-zu:hover{ background:color-mix(in srgb, var(--ui-auf-tief) 88%, var(--ui-auf-text)); }
.install-nach-zu:focus-visible{ outline:2px solid var(--ui-accent); outline-offset:2px; }

/* Zwangsfarben: Grenzen als border, damit die Flaechen nicht als Schatten
   verschwinden. */
@media (forced-colors: active){
  .hubich, .hubich-knopf, .hubaktionen, .hubinstall, .install-nach{ border:1px solid CanvasText; }
  .hubich, .hubaktionen, .hubinstall, .install-nach{ box-shadow:none; }
  .hubich-knopf:focus-visible, .hubmehrd:focus-visible{ outline:2px solid Highlight; }
}
}
