/* Hub - Websites-Favoriten (FEATURES2.md Abschnitt D). Nur seitenbezogene Regeln (Praefix ws-, Farben wc-*);
   Bausteine (.h-panel, .h-btn, .h-badge, .h-empty, .h-skel, .ifield, .input) und das Raster (.g-*) kommen aus theme.css.
   iOS 12: kein gap in Flexbox (Abstaende per margin), Grid-gap immer auch als grid-gap, sticky mit -webkit-sticky,
   backdrop-filter mit -webkit- und deckendem Rueckfall. Animationen schaltet theme.css bei reduced motion ab. */

/* ------------------------------------------------------------- Farben ---- */
/* Palette der Daten: Verlauf --wc1 -> --wc2, Leuchtfarbe --wcg (r,g,b) */
.wc-cyan   { --wc1: #5eead4; --wc2: #0e7490; --wcg: 45,212,191; }
.wc-violet { --wc1: #a78bfa; --wc2: #6d28d9; --wcg: 167,139,250; }
.wc-coral  { --wc1: #ff8f6b; --wc2: #c2410c; --wcg: 255,143,107; }
.wc-pink   { --wc1: #f472b6; --wc2: #be185d; --wcg: 244,114,182; }
.wc-amber  { --wc1: #fbbf24; --wc2: #b45309; --wcg: 251,191,36; }
.wc-green  { --wc1: #34d399; --wc2: #047857; --wcg: 52,211,153; }
.wc-blue   { --wc1: #60a5fa; --wc2: #1d4ed8; --wcg: 96,165,250; }
.wc-slate  { --wc1: #94a3b8; --wc2: #334155; --wcg: 148,163,184; }

/* --------------------------------------------------------------- Kopf ---- */
.ws-head { position: relative; margin: 4px 0 8px; }
.page h2.ws-title {
  display: block; margin: 0; font-size: 32px; font-weight: 700; line-height: 1.15;
  letter-spacing: -.02em; text-transform: none; color: var(--t1);
}
.page h2.ws-title::before { content: none; display: none; }
.ws-lead { display: flex; align-items: center; margin: 8px 0 0; font-size: 15px; color: var(--t2); font-variant-numeric: tabular-nums; }
.ws-lead svg { flex: 0 0 auto; width: 17px; height: 17px; margin-right: 9px; color: #fbbf24; filter: drop-shadow(0 0 6px rgba(251,191,36,.55)); }

/* --------------------------------------------- Werkzeugleiste (klebt beim Bearbeiten) */
.ws-page { position: relative; }       /* Bezug fuer die Speicher-Pille neben dem Titel */
.ws-bar {
  display: flex; align-items: center; flex-wrap: wrap;
  margin: 0 0 6px; padding: 10px 0 0; border: 1px solid transparent; border-radius: 20px;
}
.ws-search { flex: 0 1 340px; min-width: 220px; margin: 0 12px 12px 0; }
.ws-search .input { min-height: 44px; padding-top: 9px; padding-bottom: 9px; padding-right: 44px; border-radius: 999px; }
.ws-search .input::-webkit-search-cancel-button, .ws-search .input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.ws-clear {
  position: absolute; top: 50%; right: 6px; width: 34px; height: 34px; margin-top: -17px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: rgba(255,255,255,.08); color: var(--t2); cursor: pointer;
}
.ws-clear[hidden] { display: none; }
.ws-clear:active { background: rgba(255,255,255,.16); }
.ws-tools { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; margin: 0 0 12px auto; }
.ws-tools > .h-btn { margin-left: 10px; }
.ws-tools > .h-btn:first-child { margin-left: 0; }
.ws-bs { display: none; }
.ws-page.ws-isempty .ws-bar, .ws-page.ws-failed .ws-search, .ws-page.ws-failed .ws-tools, .ws-page.ws-loading .ws-search { display: none; }

/* Hinweis (nur beim Bearbeiten) - Aufbau wie die Leiste "Startseite anpassen" */
.ws-hint { display: none; align-items: center; flex: 1 1 auto; min-width: 0; }
.ws-hint-ico {
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 40px; height: 40px; margin-right: 12px; border-radius: 13px;
  color: #5eead4; background: rgba(94,234,212,.1);
  box-shadow: inset 0 0 0 1px rgba(94,234,212,.36), 0 0 20px -6px rgba(94,234,212,.65);
}
.ws-hint-txt { display: flex; flex-direction: column; flex: 0 1 auto; min-width: 0; }
.ws-hint-txt b { font-size: 15px; font-weight: 700; line-height: 1.3; color: var(--t1); white-space: nowrap; }
.ws-hint-txt span { font-size: 13px; line-height: 1.35; color: var(--t2); }
.ws-hint-t { display: none; }

/* Speicherstand: ausserhalb des Bearbeitens eine Pille rechts in der Titelzeile (Seite: 24 px Innenabstand + 4 px Rand,
   Titel 32 px x 1.15 - mittig), beim Bearbeiten Text in der Leiste */
.ws-save {
  position: absolute; top: 31px; right: 24px; z-index: 2;
  display: none; align-items: center; height: 30px; padding: 0 12px; border-radius: 999px; white-space: nowrap;
  background: rgba(10,14,26,.9); border: 1px solid var(--edge); color: var(--t2); font-size: 13px; font-weight: 600;
  box-shadow: 0 10px 24px -14px rgba(0,0,0,.9);
  transition: opacity .8s;
}
.ws-save.busy, .ws-save.ok, .ws-save.err { display: inline-flex; }
.ws-save.ok { color: #6ee7b7; border-color: rgba(52,211,153,.4); }
.ws-save.ok.fade { opacity: 0; pointer-events: none; }
.ws-save.err { color: #fda4af; border-color: rgba(251,113,133,.45); }
.ws-save > svg { flex: 0 0 auto; width: 16px; height: 16px; margin-right: 6px; }
.ws-spin {
  flex: 0 0 auto; width: 13px; height: 13px; margin-right: 8px; border-radius: 50%;
  border: 2px solid rgba(94,234,212,.25); border-top-color: #5eead4;
  animation: ws-spin .8s linear infinite;
}
.ws-retry {
  min-height: 30px; margin: 0 -6px 0 10px; padding: 3px 10px; border-radius: 999px; border: 1px solid rgba(251,113,133,.45);
  background: rgba(251,113,133,.12); color: #fecdd3; font: inherit; font-size: 12.5px; cursor: pointer;
}

/* Bearbeitungsmodus: schwebende Leiste klebt unter der Kopfzeile (wie auf der Startseite) */
.ws-editing .ws-bar {
  position: -webkit-sticky; position: sticky; top: 74px; top: calc(var(--topbar-h) + env(safe-area-inset-top) + 10px); z-index: 25;
  flex-wrap: nowrap; margin: 0 0 18px; padding: 8px 8px 8px 12px;
  background: rgba(9,13,24,.95); border-color: rgba(94,234,212,.34);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 20px 44px -18px rgba(0,0,0,.95), 0 0 34px -12px rgba(94,234,212,.45);
  animation: h-pop .32s cubic-bezier(.2,.8,.2,1) both;
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .ws-editing .ws-bar { background: rgba(9,13,24,.76); -webkit-backdrop-filter: blur(18px) saturate(150%); backdrop-filter: blur(18px) saturate(150%); }
}
.ws-editing .ws-search { display: none; }
.ws-editing .ws-hint { display: flex; }
.ws-editing .ws-save {
  position: static; flex: 0 0 auto; height: auto; margin: 0 12px; padding: 0; border: 0; border-radius: 0;
  background: none; box-shadow: none; transition: opacity .5s;
}
.ws-editing .ws-save > svg { width: 15px; height: 15px; }
.ws-editing .ws-tools { flex-wrap: nowrap; margin: 0 0 0 auto; }

/* ------------------------------------------------------- Kategorien ------ */
.ws-list { position: relative; }
.ws-cat { z-index: 1; margin-top: 18px; padding: 16px 18px 18px; }
/* Farbe der Kategorie: Punkt am Titel, Leuchtkante oben und ein Hauch Licht in der Ecke oben links */
.ws-cat.h-panel { background: radial-gradient(70% 140% at 0% 0%, rgba(var(--wcg),.075), rgba(var(--wcg),0) 70%), var(--panel); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .ws-cat.h-panel { background: radial-gradient(70% 140% at 0% 0%, rgba(var(--wcg),.075), rgba(var(--wcg),0) 70%), var(--glass-solid); }
}
/* Ziel-Kategorie beim Ziehen (enthaelt die gezogene Kachel): ueber den Nachbarn, unter Leisten/Kopfzeile */
.ws-cat.g-drop { z-index: 2; }
.ws-list > .ws-cat:first-child { margin-top: 6px; }
.ws-cat[hidden] { display: none; }
.ws-cat::before {
  background: linear-gradient(90deg, rgba(94,234,212,0), rgba(94,234,212,.5), rgba(167,139,250,.5), rgba(167,139,250,0));
  background: linear-gradient(90deg, rgba(var(--wcg),0), rgba(var(--wcg),.65), rgba(167,139,250,.4), rgba(167,139,250,0));
}
.ws-cat-head { display: flex; align-items: center; min-height: 36px; margin: -4px 0 12px; }
.page h2.ws-cat-title { flex: 0 1 auto; flex-wrap: nowrap; min-width: 0; }
.page h2.ws-cat-title::before { background: #5eead4; background: var(--wc1); box-shadow: 0 0 8px rgba(var(--wcg),.9), 0 0 2px var(--wc1); }
.ws-cat-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-cat-n { flex: 0 0 auto; margin-left: 10px; font-variant-numeric: tabular-nums; }
.ws-cat-tools { display: flex; align-items: center; flex: 0 0 auto; margin-left: auto; padding-left: 10px; }
.ws-cbtn {
  -webkit-appearance: none; appearance: none; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 36px; height: 36px; margin-left: 6px; padding: 0; border-radius: 11px;
  border: 1px solid var(--edge); background: var(--glass-2); color: var(--t2); cursor: pointer;
  transition: color .16s, background-color .16s, border-color .16s, opacity .16s;
}
.ws-cbtn:disabled { opacity: .3; cursor: default; }
.ws-cbtn.del { color: #fda4af; }
.ws-cbtn:active:not(:disabled) { background: var(--glass-3); }
.ws-c-ed, .ws-grip { display: none; }
.ws-editing .ws-c-ed { display: inline-flex; }
.ws-editing .ws-c-add { display: none; }
.ws-grip {
  -webkit-appearance: none; appearance: none; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 34px; height: 40px; margin: 0 6px 0 -8px; padding: 0; border: 0; border-radius: 10px;
  background: transparent; color: #99f6e4; cursor: grab; touch-action: none;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.ws-grip .g-grip { color: #99f6e4; opacity: 1; }
.ws-editing .ws-grip { display: inline-flex; }

/* Leere Kategorie: Hinweis (ausserhalb des Bearbeitungsmodus); beim Bearbeiten zeigt das Raster die Ablagezeile */
.ws-cat-empty { display: none; }
.ws-cat.is-empty .ws-cat-empty { display: flex; align-items: center; flex-wrap: wrap; color: var(--t3); font-size: 14px; }
.ws-cat-empty > span { margin: 6px 16px 6px 0; }
.ws-c-first.h-btn { min-height: 40px; padding: 7px 14px; font-size: 14px; }
.ws-c-first.h-btn > svg { width: 18px; height: 18px; margin-right: 7px; }
.ws-editing .ws-cat.is-empty .ws-cat-empty { display: none; }
.ws-grid { --g-radius: 16px; }
.ws-drop { display: none; }
.ws-grid.g-edit.g-empty > .ws-drop {
  position: absolute; top: 0; left: 0; right: 0; height: 64px; pointer-events: none;
  display: flex; align-items: center; justify-content: center; color: var(--t3); font-size: 13.5px;
}
.ws-drop svg { flex: 0 0 auto; width: 16px; height: 16px; margin-right: 8px; }
.ws-grid.g-edit.g-empty.g-active > .ws-drop { color: #99f6e4; }

/* Kategorien sortieren: alle klappen auf die Kopfzeile zusammen, die anderen weichen aus */
.ws-sorting .ws-cat-body, .ws-sorting .ws-cat-tools { display: none; }
.ws-sorting .ws-cat { padding-top: 12px; padding-bottom: 12px; transition: transform .2s var(--ease); }
.ws-sorting .ws-cat-head { margin: 0; }
.ws-sorting .ws-cat.ws-lift {
  z-index: 24; transition: none; cursor: grabbing;
  background: rgba(16,22,40,.97); border-color: rgba(94,234,212,.6);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.95), 0 0 0 1px rgba(94,234,212,.5), 0 0 40px -10px rgba(94,234,212,.55);
}
.ws-settle .ws-cat { transition: none !important; }
html.ws-busy, html.ws-busy * { cursor: grabbing !important; -webkit-user-select: none !important; user-select: none !important; }

/* ---------------------------------------------------------- Kacheln ------ */
.ws-tile {
  position: relative; display: flex; align-items: center; width: 100%; height: 100%; min-width: 0;
  padding: 10px 12px; overflow: hidden; border-radius: 16px;
  background: rgba(255,255,255,.05);
  background: radial-gradient(130% 160% at 0% 0%, rgba(var(--wcg),.16), rgba(var(--wcg),0) 58%),
    linear-gradient(180deg, rgba(255,255,255,.065), rgba(255,255,255,.028)), rgba(4,7,15,.35);
  border: 1px solid var(--edge); box-shadow: inset 0 1px 0 var(--edge-hi);
  color: var(--t1); text-decoration: none;
  transition: transform .2s var(--ease), border-color .2s, box-shadow .2s;
}
.ws-ico {
  position: relative; display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 38px; height: 38px; margin-right: 11px; border-radius: 12px; overflow: hidden; color: #fff;
  background: #6d28d9; background: linear-gradient(140deg, var(--wc1) 0%, var(--wc2) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 8px 20px -10px rgba(var(--wcg),.85);
}
.ws-ico::after {              /* Glanz oben */
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 50%; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,0));
}
.ws-ico > svg { position: relative; z-index: 1; width: 22px; height: 22px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.ws-mono {
  position: relative; z-index: 1; font-size: 16px; font-weight: 800; line-height: 1; letter-spacing: .01em;
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
}
.ws-txt { display: flex; flex-direction: column; justify-content: center; flex: 1 1 auto; min-width: 0; }
.ws-name {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 14px; font-weight: 650; line-height: 1.25; letter-spacing: -.005em;
}
.ws-host { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; font-size: 12.5px; line-height: 1.3; color: var(--t3); }
.ws-desc { display: none; }
.ws-go {
  position: absolute; top: 8px; right: 8px; display: flex; color: var(--t3); pointer-events: none;
  opacity: 0; transition: opacity .2s, transform .2s var(--ease);
}
.ws-go svg { width: 14px; height: 14px; }
.ws-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ws-bad { cursor: default; opacity: .6; }

/* 1 Zeile, schmal (unter 150 px: Desktop mit 8 Spalten, Tablet hochkant): Symbol kleiner, Text dichter */
.ws-r1.ws-tiny > .ws-tile { padding: 8px 7px 8px 8px; }
.ws-r1.ws-tiny .ws-ico { width: 28px; height: 28px; margin-right: 7px; border-radius: 9px; }
.ws-r1.ws-tiny .ws-ico > svg { width: 16px; height: 16px; }
.ws-r1.ws-tiny .ws-mono { font-size: 12px; }
.ws-r1.ws-tiny .ws-name { font-size: 13.5px; }
.ws-r1.ws-tiny .ws-host { font-size: 11.5px; }
/* Name passt nicht in eine Zeile (gemessen, websites.js): zweizeilig, die Domain weicht */
.ws-r1.ws-wrap .ws-host { display: none; }
.ws-r1.ws-wrap .ws-name {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal;
  font-size: 13.5px; line-height: 1.22; word-wrap: break-word; overflow-wrap: break-word;
}
.ws-r1.ws-tiny.ws-wrap .ws-name { font-size: 13px; }
/* ab 2 Zeilen: Symbol oben, Name und Domain unten */
.ws-r2 > .ws-tile { flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 14px; }
.ws-r2 .ws-ico { width: 46px; height: 46px; margin: 0; border-radius: 14px; }
.ws-r2 .ws-ico > svg { width: 24px; height: 24px; }
.ws-r2 .ws-mono { font-size: 18px; }
.ws-r2 .ws-txt { flex: 0 0 auto; width: 100%; }
.ws-r2 .ws-name {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal;
  font-size: 15px; word-wrap: break-word; overflow-wrap: break-word;
}
.ws-r3 .ws-ico { width: 56px; height: 56px; border-radius: 16px; }
.ws-r3 .ws-ico > svg { width: 28px; height: 28px; }
.ws-r3 .ws-mono { font-size: 22px; }
/* ab 2 x 2 mit Beschreibung: Symbol links, rechts Name, Domain und Beschreibung */
.ws-r2.ws-wide.ws-hasdesc > .ws-tile { flex-direction: row; justify-content: flex-start; }
.ws-r2.ws-wide.ws-hasdesc .ws-ico { margin-right: 14px; }
.ws-r2.ws-wide.ws-hasdesc .ws-txt { flex: 1 1 auto; width: auto; justify-content: flex-start; }
.ws-r2.ws-wide.ws-hasdesc .ws-name { display: block; white-space: nowrap; }
.ws-r2.ws-wide .ws-desc {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
  margin-top: 7px; font-size: 13px; line-height: 1.4; color: var(--t2); word-wrap: break-word; overflow-wrap: break-word;
}
.ws-r3.ws-wide .ws-desc { -webkit-line-clamp: 6; }

a.ws-tile:active { transform: scale(.98); }
a.ws-tile:focus { outline: none; }
a.ws-tile:focus-visible { outline: 2px solid #5eead4; outline-offset: 2px; }
@media (hover: hover) {
  .ws-page:not(.ws-editing) a.ws-tile:hover {
    transform: translateY(-2px); border-color: rgba(var(--wcg),.45);
    box-shadow: inset 0 1px 0 var(--edge-hi), 0 16px 34px -20px rgba(0,0,0,.9), 0 0 26px -10px rgba(var(--wcg),.6);
  }
  .ws-page:not(.ws-editing) a.ws-tile:hover .ws-go { opacity: 1; transform: translate(1px, -1px); }
  .ws-cbtn:hover:not(:disabled) { color: var(--t1); background: var(--glass-3); border-color: var(--edge-2); }
  .ws-cbtn.del:hover:not(:disabled) { color: #fecdd3; background: rgba(251,113,133,.16); border-color: rgba(251,113,133,.5); }
  .ws-grip:hover { background: rgba(94,234,212,.1); }
  .ws-clear:hover { background: rgba(255,255,255,.14); color: var(--t1); }
  .ws-act:hover { background: rgba(94,234,212,.2); border-color: rgba(94,234,212,.6); color: #fff; }
  .ws-act.del:hover { background: rgba(251,113,133,.24); border-color: rgba(251,113,133,.6); color: #fecdd3; }
  .ws-alt:hover { color: var(--t1); background: rgba(255,255,255,.06); }
  .ws-ib:hover { color: var(--t1); border-color: var(--edge-2); background: rgba(255,255,255,.08); }
}

/* Bearbeitungsmodus: die Kachel ist Ziehflaeche, Tipp/Klick = bearbeiten. Die Kachel behaelt Name und Domain.
   Maus: Stift + Papierkorb erscheinen oben rechts beim Zeigen bzw. wenn die Kachel den Tastaturfokus hat.
   Touch: keine eigenen Knoepfe (zu klein neben dem Groessengriff) - Tippen oeffnet den Dialog mit "Löschen". */
.ws-acts { display: none; }
.ws-editing .ws-acts { position: absolute; z-index: 6; top: 5px; right: 5px; display: flex; }
.ws-editing .g-dragging .ws-acts, .ws-editing .g-resizing .ws-acts { display: none; }
.ws-editing .ws-tile { cursor: inherit; }
.ws-editing .ws-txt { padding-right: 14px; }                 /* Platz fuer den Groessengriff unten rechts */
.ws-act {
  -webkit-appearance: none; appearance: none; position: relative; display: flex; align-items: center; justify-content: center;
  width: 28px; height: 26px; padding: 0; border-radius: 8px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.16); background: rgba(9,13,24,.92); color: #ccfbf1;
  box-shadow: 0 6px 14px -6px rgba(0,0,0,.95);
  transition: background-color .16s, border-color .16s, color .16s, transform .16s var(--ease), opacity .14s;
}
.ws-act + .ws-act { margin-left: 4px; }
.ws-act > svg { width: 14px; height: 14px; }
.ws-act.del { color: #fda4af; border-color: rgba(251,113,133,.32); }
.ws-act:active { transform: scale(.92); }
@media (hover: hover) and (pointer: fine) {
  .ws-editing .ws-acts { opacity: 0; visibility: hidden; transition: opacity .14s, visibility 0s linear .14s; }
  .ws-editing .g-item:hover .ws-acts, .ws-editing .g-item:focus .ws-acts { opacity: 1; visibility: visible; transition: opacity .14s, visibility 0s; }
  /* eigene Regel: kennt ein Browser :focus-within nicht, faellt nur sie weg (nicht auch das Zeigen) */
  .ws-editing .g-item:focus-within .ws-acts { opacity: 1; visibility: visible; transition: opacity .14s, visibility 0s; }
}
@media (hover: none), (pointer: coarse) {
  .ws-editing .ws-acts { display: none; }
  /* Groessengriff kleiner Kacheln: sichtbar 24 px, Trefferflaeche 44 px */
  .ws-grid.g-edit > .g-item.g-small > .g-resize::before { top: -17px; left: -17px; right: -3px; bottom: -3px; }
}
/* Touch und Handy: Knoepfe mit 44 px Trefferflaeche (DESIGN 9 / BRIEF: Bedienziele >= 44 px) */
@media (max-width: 699.98px), (pointer: coarse) {
  .ws-cbtn { width: 44px; height: 44px; border-radius: 13px; }
  .ws-grip { height: 44px; }
  .ws-clear::before { content: ""; position: absolute; top: -6px; bottom: -6px; left: -4px; right: -4px; }
}

/* frisch angelegt / verschoben: kurzes Aufleuchten */
.ws-cat.ws-flash::after, .g-body.ws-flash::after {
  content: ""; position: absolute; top: -1px; left: -1px; right: -1px; bottom: -1px; z-index: 7; pointer-events: none;
  border-radius: 24px; animation: ws-flash 1.6s var(--ease) both;
}
.g-body.ws-flash::after { top: 0; left: 0; right: 0; bottom: 0; border-radius: 16px; }

/* ------------------------------------------------------ Suche: nichts ---- */
.ws-none { margin-top: 6px; }
.ws-none .h-btn { margin-top: 14px; }

/* ------------------------------------------------ Laden / Fehler / leer -- */
.ws-skel { margin-top: 6px; }
.ws-skel + .ws-skel { margin-top: 18px; }
.ws-skel .ws-cat-head { margin-bottom: 16px; }
.ws-sk-t { width: 160px; }
.ws-sk-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); grid-gap: 14px; gap: 14px; }
.ws-sk-tile { height: 64px; border-radius: 16px; }
.ws-sk-tile:first-child { grid-column: span 2; }
.ws-err { margin-top: 6px; }
.ws-err .h-btn { margin-top: 14px; }

.ws-empty { display: flex; flex-direction: column; align-items: center; margin-top: 6px; padding: 44px 24px 40px; text-align: center; }
.ws-empty-art { position: relative; width: 176px; height: 132px; margin-bottom: 20px; }
.ws-orb {
  position: absolute; left: 50%; top: 50%; width: 92px; height: 92px; margin: -46px 0 0 -46px;
  display: flex; align-items: center; justify-content: center; border-radius: 28px; color: #fff;
  background: #22d3ee; background: linear-gradient(140deg, #5eead4 0%, #22d3ee 45%, #a78bfa 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 18px 40px -16px rgba(34,211,238,.85), 0 0 60px -12px rgba(167,139,250,.6);
  animation: ws-float 5s ease-in-out infinite alternate;
}
.ws-orb > svg { width: 44px; height: 44px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.3)); }
.ws-sat {
  position: absolute; display: flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  border-radius: 12px; color: #fff; background: linear-gradient(140deg, var(--wc1), var(--wc2));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 10px 24px -12px rgba(var(--wcg),.95);
}
.ws-sat > svg { width: 18px; height: 18px; }
.ws-sat.s1 { left: 0; top: 12px; transform: rotate(-10deg); }
.ws-sat.s2 { right: 2px; top: 0; transform: rotate(9deg); }
.ws-sat.s3 { left: 14px; bottom: 0; transform: rotate(7deg); }
.ws-sat.s4 { right: 12px; bottom: 8px; transform: rotate(-8deg); }
.ws-empty-t { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.01em; color: var(--t1); }
.ws-empty-p { max-width: 540px; margin: 10px 0 0; font-size: 15px; line-height: 1.55; color: var(--t2); }
.ws-steps { display: flex; flex-wrap: wrap; justify-content: center; margin: 20px 0 24px; padding: 0; list-style: none; }
.ws-steps li { display: flex; align-items: center; margin: 5px 12px; font-size: 14px; color: var(--t2); }
.ws-steps b {
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 26px; height: 26px; margin-right: 9px;
  border-radius: 50%; background: rgba(94,234,212,.12); border: 1px solid rgba(94,234,212,.42); color: #99f6e4;
  font-size: 13px; font-weight: 700;
}
.ws-first.h-btn { min-height: 48px; padding: 12px 22px; }
.ws-alt {
  -webkit-appearance: none; appearance: none; min-height: 40px; margin-top: 10px; padding: 8px 14px; border: 0; border-radius: 12px;
  background: transparent; color: var(--t2); font: inherit; font-size: 14px; text-decoration: underline;
  text-decoration-color: rgba(180,189,214,.4); text-underline-offset: 3px; cursor: pointer;
}

/* ------------------------------------------------------------ Dialoge ---- */
.dialog.ws-dialog { max-width: 640px; }
.ws-dialog > .dbtns { display: none; }
.ws-form .field { margin-bottom: 14px; }
.ws-flabel {
  display: block; margin-bottom: 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--t2);
}
.ws-opt { margin-left: 6px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--t3); }
.ws-prev {
  display: flex; justify-content: center; margin: 2px 0 18px; padding: 18px 14px; border-radius: 18px;
  background: rgba(255,255,255,.02); border: 1px dashed rgba(255,255,255,.1);
}
.ws-prevtile.ws-tile { width: 280px; max-width: 100%; height: 66px; }
.ws-ferr { margin-top: 7px; font-size: 13.5px; line-height: 1.4; color: #fda4af; }
.ws-ferr:empty { display: none; }
.ws-form .input.bad { border-color: rgba(251,113,133,.75); box-shadow: 0 0 0 3px rgba(251,113,133,.14); }
.ws-f2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-gap: 0 14px; gap: 0 14px; }
.ws-f2 > .field[hidden] { display: none; }
.ws-sel { position: relative; }
.ws-sel > .select { padding-right: 42px; cursor: pointer; }
.ws-sel > svg { position: absolute; right: 13px; top: 50%; width: 18px; height: 18px; margin-top: -9px; color: var(--t3); pointer-events: none; }
.ws-icons {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); grid-gap: 6px; gap: 6px;
  max-height: 198px; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 3px; margin: -3px;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.16) transparent;
}
.ws-ib {
  -webkit-appearance: none; appearance: none; display: flex; align-items: center; justify-content: center;
  height: 42px; padding: 0; border-radius: 12px; border: 1px solid var(--edge); background: rgba(255,255,255,.035);
  color: var(--t2); cursor: pointer; transition: color .14s, background-color .14s, border-color .14s, box-shadow .14s;
}
.ws-ib > svg { width: 20px; height: 20px; }
.ws-ib .ws-mono { font-size: 13px; text-shadow: none; }
.ws-ib[aria-checked="true"] {
  color: #fff; background: rgba(94,234,212,.15); border-color: rgba(94,234,212,.75);
  box-shadow: 0 0 0 1px rgba(94,234,212,.45), 0 0 18px -6px rgba(94,234,212,.75);
}
.ws-colors { display: flex; flex-wrap: wrap; margin: -4px; }
.ws-sw {
  -webkit-appearance: none; appearance: none; display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; margin: 4px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 2px solid rgba(255,255,255,.14); color: #fff;
  background: #6d28d9; background: linear-gradient(140deg, var(--wc1) 0%, var(--wc2) 100%);
  box-shadow: 0 6px 16px -8px rgba(var(--wcg),.9);
  transition: border-color .14s, box-shadow .14s, transform .14s var(--ease);
}
.ws-sw > svg { width: 17px; height: 17px; opacity: 0; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.ws-sw[aria-checked="true"] { border-color: #fff; box-shadow: 0 0 0 3px rgba(var(--wcg),.45), 0 0 18px rgba(var(--wcg),.65); }
.ws-sw[aria-checked="true"] > svg { opacity: 1; }
.ws-sw:active { transform: scale(.92); }
/* Fuss mit Fehlermeldung und Knoepfen klebt unten im Dialog (lange Formulare, Handy): immer erreichbar.
   Der Dialog selbst hat dafuer unten keinen Innenabstand - "sticky" rechnet ab dem Innenabstand, der Fuss laege sonst
   um diesen Abstand ueber dem Rand und darunter schaute Inhalt hervor. */
.dialog.ws-dialog { padding-bottom: 0; }
.ws-dbtns {
  position: -webkit-sticky; position: sticky; bottom: 0; z-index: 3;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end;
  margin: 10px -22px 0; padding: 10px 22px 18px;
  background: #0b0f1c; border-top: 1px solid rgba(255,255,255,.07);
}
.ws-dbtns > .form-error { flex: 1 1 100%; min-height: 0; margin: 2px 0 4px; font-size: 14px; line-height: 1.45; }
.ws-dbtns > .form-error:empty { display: none; }
.ws-dbtns > .btn { margin: 4px 0 4px 10px; }
.ws-dbtns > .ws-dl { margin-left: 0; margin-right: auto; }
.ws-dl > svg { width: 18px; height: 18px; margin-right: 7px; }
.ws-dbtns > .btn.busy { opacity: .75; cursor: progress; }
.ws-dbtns > .btn.busy::before {
  content: ""; width: 13px; height: 13px; margin-right: 8px; border-radius: 50%;
  border: 2px solid rgba(5,7,13,.25); border-top-color: #05070d; animation: ws-spin .8s linear infinite;
}

/* ---------------------------------------------------------- Animation ---- */
@keyframes ws-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes ws-float { 0% { transform: translate3d(0, 3px, 0); } 100% { transform: translate3d(0, -5px, 0); } }
@keyframes ws-flash {
  0% { box-shadow: 0 0 0 2px rgba(94,234,212,.95), 0 0 36px rgba(94,234,212,.65); }
  100% { box-shadow: 0 0 0 2px rgba(94,234,212,0), 0 0 36px rgba(94,234,212,0); }
}

/* ------------------------------------------------------------ Groessen ---- */
/* Tablet und kleine Desktops: kurze Beschriftungen, damit Suche und Knoepfe in eine Zeile passen */
@media (max-width: 1239.98px) {
  .ws-bl { display: none; }
  .ws-bs { display: inline; }
}
@media (max-width: 1099.98px) {
  .ws-sk-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); grid-gap: 12px; gap: 12px; }
}
/* Touch-Geraete: der Hinweis spricht vom Festhalten */
@media (hover: none), (pointer: coarse) {
  .ws-hint-m { display: none; }
  .ws-hint-t { display: inline; }
}
/* Handy: Suche ueber die ganze Breite, darunter drei gleich breite Knoepfe mit Beschriftung unter dem Symbol */
@media (max-width: 699.98px) {
  .page h2.ws-title { font-size: 28px; }
  .ws-lead { font-size: 14px; }
  .ws-save { top: 19px; right: 14px; }
  .ws-save.err .ws-save-t { display: none; }           /* Symbol + "Erneut versuchen" reichen, der Titel bleibt frei */
  .ws-retry { margin-left: 4px; padding: 3px 9px; font-size: 12px; }
  .ws-search { flex: 1 1 100%; min-width: 0; margin-right: 0; }
  .ws-tools { flex: 1 1 100%; flex-wrap: nowrap; margin-left: 0; }
  .ws-tools > .h-btn {
    flex: 1 1 0; flex-direction: column; min-width: 0; min-height: 56px; margin-left: 8px; padding: 7px 4px 6px;
    font-size: 12.5px; border-radius: 14px;
  }
  .ws-tools > .h-btn > svg { margin: 0 0 4px; }
  .ws-tools > .h-btn > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  /* Bearbeiten: Leiste zweizeilig - oben Hinweis + Speicherstand, unten drei gleich breite Knoepfe (wie die Startseite) */
  .ws-editing .ws-bar {
    flex-wrap: wrap; margin-bottom: 14px; padding: 8px; border-radius: 18px;
    top: 64px; top: calc(var(--topbar-h) + env(safe-area-inset-top) + 8px);
  }
  /* Grundbreite 40 %: Hinweis + Speicherstand teilen sich Zeile 1, die Knoepfe (100 %) brechen sicher in Zeile 2 um */
  .ws-hint { flex: 1 1 40%; }
  .ws-hint-ico { display: none; }
  .ws-hint-txt { padding: 0 4px; }
  .ws-hint-txt b { display: none; }
  .ws-hint-txt span { font-size: 12.5px; }
  .ws-editing .ws-save { margin: 0 4px 0 8px; font-size: 12.5px; }
  .ws-editing .ws-tools { flex: 1 1 100%; margin: 8px 0 0; }
  .ws-editing .ws-tools > .h-btn { flex: 1 1 auto; flex-direction: row; min-height: 44px; padding: 8px 7px; font-size: 13.5px; }
  .ws-editing .ws-tools > .h-btn > svg { width: 18px; height: 18px; margin: 0 5px 0 0; }
  .ws-cat { margin-top: 14px; padding: 14px 14px 16px; }
  .ws-cat-head { margin-bottom: 10px; }
  /* Bearbeiten: die Knoepfe der Kategorie bekommen eine eigene Zeile - der Name bleibt lesbar */
  .ws-editing .ws-cat-head { flex-wrap: wrap; }
  .ws-editing .ws-cat-tools { flex: 1 1 100%; justify-content: flex-end; margin: 6px 0 0; padding-left: 0; }
  .ws-cbtn { margin-left: 6px; }
  .ws-grip { margin-left: -6px; margin-right: 2px; }
  .ws-sk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-gap: 10px; gap: 10px; }
  .ws-sk-tile:nth-child(n+5) { display: none; }
  .ws-empty { padding: 32px 18px 28px; }
  .ws-steps { flex-direction: column; align-items: flex-start; margin: 16px 0 22px; }   /* Ziffern untereinander */
  .ws-steps li { margin: 5px 0; }
  .ws-empty-t { font-size: 20px; }
  .ws-empty-p { font-size: 14.5px; }
  .ws-f2 { grid-template-columns: minmax(0, 1fr); }
  .ws-dbtns {
    margin: 10px -18px 0;
    padding: 10px 18px 14px; padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }
  .ws-dbtns > .btn { flex: 1 1 0; margin-left: 10px; }
  .ws-dbtns > .form-error + .btn { margin-left: 0; }
  .ws-dbtns > .ws-dl { flex: 0 0 auto; margin-right: 0; }
  .ws-dbtns > .ws-dl > span { display: none; }
  .ws-dbtns > .ws-dl > svg { margin-right: 0; }
  .ws-icons { grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); max-height: 146px; }
  .ws-ib { height: 40px; }
}
@media (max-width: 359.98px) {
  .ws-cat { padding-left: 12px; padding-right: 12px; }
  .ws-editing .ws-tools > .h-btn > svg { display: none; }
}
