/* MultiView · Mockup – Stile
   Aufbau: Farben (hell/dunkel) → Grundlagen → Gerüst (Navigation, Kopf) → Feed (Werkzeugleiste,
   Karten, Ansichten) → Lesefenster → Bibliothek → Konten → Breiten (Handy / Tablet / Rechner).
   Breiten: Handy < 700 px, Tablet 700–1099 px, Rechner ab 1100 px. */

/* ---------- Farben: hell (Standard) ---------- */
:root {
  color-scheme: light;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #eef0f3;
  --surface-3: #e4e7ec;
  --border: #dde1e7;
  --border-strong: #c3c9d2;
  --text: #15181d;
  --text-2: #464d59;
  --text-3: #596170;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --on-accent: #ffffff;
  --accent-soft: #ecebfd;
  --on-accent-soft: #3730a3;
  --ok: #166534;
  --ok-soft: #e3f4e8;
  --warn: #92400e;
  --warn-soft: #fdf0dc;
  --muted-soft: #eceef1;
  --focus: #4f46e5;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .18);
  --scrim: rgba(15, 18, 24, .42);
  --pv-l: 62%;
  --pv-l2: 46%;
  --radius: 14px;
  --radius-sm: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Farben: dunkel (System), außer wenn ausdrücklich hell gewählt ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e1013;
    --surface: #171a1f;
    --surface-2: #1f232a;
    --surface-3: #292e37;
    --border: #2a2f37;
    --border-strong: #3c434e;
    --text: #e9ebef;
    --text-2: #b9bfc9;
    --text-3: #a0a7b3;
    --accent: #5b54e8;
    --accent-hover: #6a64ee;
    --on-accent: #ffffff;
    --accent-soft: #262950;
    --on-accent-soft: #c9c8ff;
    --ok: #6fdc8c;
    --ok-soft: #173322;
    --warn: #f5c26b;
    --warn-soft: #3a2a12;
    --muted-soft: #252a32;
    --focus: #9d98ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, .55);
    --scrim: rgba(0, 0, 0, .6);
    --pv-l: 48%;
    --pv-l2: 34%;
  }
}
/* ---------- Farben: dunkel (ausdrücklich gewählt) ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1013;
  --surface: #171a1f;
  --surface-2: #1f232a;
  --surface-3: #292e37;
  --border: #2a2f37;
  --border-strong: #3c434e;
  --text: #e9ebef;
  --text-2: #b9bfc9;
  --text-3: #a0a7b3;
  --accent: #5b54e8;
  --accent-hover: #6a64ee;
  --on-accent: #ffffff;
  --accent-soft: #262950;
  --on-accent-soft: #c9c8ff;
  --ok: #6fdc8c;
  --ok-soft: #173322;
  --warn: #f5c26b;
  --warn-soft: #3a2a12;
  --muted-soft: #252a32;
  --focus: #9d98ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, .55);
  --scrim: rgba(0, 0, 0, .6);
  --pv-l: 48%;
  --pv-l2: 34%;
}

/* ---------- Grundlagen ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 20px; height: 20px; flex: none; }
.sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
:focus:not(:focus-visible) { outline: none; }

.skip {
  position: fixed; left: 12px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--on-accent); padding: 10px 14px; border-radius: 10px;
  text-decoration: none; font-weight: 600;
}
.skip:focus { top: 12px; }

/* ---------- Gerüst ---------- */
.shell { min-height: 100vh; min-height: 100dvh; }
.main { outline: none; }

.brand { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.wordmark { font-weight: 750; font-size: 19px; letter-spacing: -.01em; }
.mock-label { font-size: 11.5px; color: var(--text-3); margin-top: 3px; white-space: nowrap; }

/* Navigation (Grundform; Lage je Breite weiter unten) */
.nav { background: var(--surface); }
.nav-list { display: flex; gap: 4px; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 12px;
  min-height: 44px; padding: 0 12px; border-radius: 10px;
  text-decoration: none; color: var(--text-2); font-weight: 550;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link[aria-current="page"] { background: var(--accent-soft); color: var(--on-accent-soft); }
.nav-warn {
  width: 8px; height: 8px; border-radius: 50%; background: var(--warn);
  box-shadow: 0 0 0 2px var(--surface);
}

.follow-title {
  font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-3); padding: 0 12px; margin: 20px 0 6px;
}
.follow-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 40px; padding: 4px 10px; border: 0; border-radius: 10px;
  background: transparent; color: var(--text-2); text-align: left;
}
.follow-btn:hover { background: var(--surface-2); color: var(--text); }
.follow-btn[aria-pressed="true"] { background: var(--accent-soft); color: var(--on-accent-soft); }
.follow-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.count-pill {
  min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--accent); color: var(--on-accent);
  font-size: 12px; font-weight: 650; line-height: 20px; text-align: center;
}

/* Kopfzeile */
.topbar { display: flex; align-items: center; gap: 12px; }
.screen-title { font-size: 22px; font-weight: 700; letter-spacing: -.01em; outline: none; }
.theme-switch {
  display: flex; margin-left: auto; padding: 3px; gap: 2px;
  background: var(--surface-2); border-radius: 12px;
}
.theme-btn {
  display: grid; place-items: center; width: 40px; height: 36px;
  border: 0; border-radius: 9px; background: transparent; color: var(--text-2);
}
.theme-btn:hover { color: var(--text); }
.theme-btn[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ---------- Werkzeugleiste ---------- */
.toolbar { display: flex; flex-direction: column; gap: 10px; }
.tb-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.search {
  position: relative; display: flex; align-items: center; flex: 1 1 220px; min-width: 0;
}
.search .ico { position: absolute; left: 12px; color: var(--text-3); pointer-events: none; }
.search input {
  width: 100%; height: 40px; padding: 0 12px 0 40px;
  border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface);
  font-size: 16px; /* ab 16 px zoomt iOS beim Antippen nicht */
}
.search input::placeholder { color: var(--text-3); opacity: 1; }
.search input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

.seg {
  display: flex; padding: 3px; gap: 2px; border-radius: 12px;
  background: var(--surface-2); flex: none;
}
.seg-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 36px; height: 34px; padding: 0 12px;
  border: 0; border-radius: 9px; background: transparent; color: var(--text-2);
  font-size: 14px; font-weight: 550; white-space: nowrap;
}
.seg-btn .ico { width: 18px; height: 18px; }
.seg-btn:hover { color: var(--text); }
.seg-btn[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.filter-toggle {
  display: none; align-items: center; justify-content: center; gap: 6px;
  height: 44px; padding: 0 12px; border: 1px solid var(--border-strong);
  border-radius: 10px; background: var(--surface); font-weight: 550; font-size: 14px;
}
.filter-toggle[aria-expanded="true"] { background: var(--accent-soft); color: var(--on-accent-soft); border-color: transparent; }
.filter-count {
  min-width: 20px; height: 20px; border-radius: 10px; padding: 0 5px;
  background: var(--accent); color: var(--on-accent); font-size: 12px; line-height: 20px; text-align: center;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px 0 6px;
  border: 1px solid var(--border-strong); border-radius: 18px;
  background: var(--surface); color: var(--text-2); font-size: 14px; font-weight: 550;
}
.chip[aria-pressed="true"] { border-color: var(--text-2); color: var(--text); }
.chip[aria-pressed="false"] { background: transparent; border-style: dashed; }
.chip[aria-pressed="false"] .badge { background: var(--surface-3); color: var(--text-2); }
.chip-count { color: var(--text-3); font-variant-numeric: tabular-nums; }

.switches { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-left: auto; }
.switch {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 4px;
  border: 0; background: transparent; color: var(--text-2); font-size: 14px; font-weight: 550;
}
.switch-track {
  position: relative; width: 34px; height: 20px; border-radius: 10px; flex: none;
  background: var(--border-strong); transition: background .15s;
}
.switch-track::after {
  content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: #ffffff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .15s;
}
.switch[aria-checked="true"] { color: var(--text); }
.switch[aria-checked="true"] .switch-track { background: var(--accent); }
.switch[aria-checked="true"] .switch-track::after { transform: translateX(14px); }

.creator-select { display: none; }
.creator-select select {
  width: 100%; height: 44px; padding: 0 10px; border: 1px solid var(--border-strong);
  border-radius: 10px; background: var(--surface); font-size: 16px;
}
.creator-select-label { font-size: 13px; color: var(--text-2); font-weight: 550; }

/* Hinweise über dem Feed */
.notice {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; border-radius: 12px; background: var(--warn-soft); color: var(--text);
  font-size: 14px;
}
.notice .ico { color: var(--warn); }
.notice a { color: var(--text); font-weight: 650; text-underline-offset: 3px; margin-left: auto; padding: 4px 0; }
.active-filter { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--text-2); }
.filter-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 4px 0 12px;
  border-radius: 18px; background: var(--accent-soft); color: var(--on-accent-soft); font-weight: 600; border: 0;
}
.filter-pill .ico { width: 18px; height: 18px; }
.result-count { font-size: 13px; color: var(--text-3); }

/* ---------- Abzeichen und Avatare ---------- */
.badge {
  display: inline-grid; place-items: center; flex: none;
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--q, #555); color: #ffffff; font-size: 12px; font-weight: 750; line-height: 1;
}
.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--av, #555); color: #ffffff; font-size: 10.5px; font-weight: 700; letter-spacing: .02em;
}
.avatar--lg { width: 32px; height: 32px; font-size: 12px; }

/* ---------- Vorschaubilder (nur CSS-Verläufe und Formen) ---------- */
.pv {
  position: relative; overflow: hidden; border-radius: var(--radius-sm);
  background: var(--surface-3); isolation: isolate;
}
.pv-img { position: absolute; inset: 0; }
.pv-ico {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(10, 12, 16, .45); color: #ffffff;
}
.pv-ico .ico { width: 18px; height: 18px; }
.m-kreise .pv-img {
  background:
    radial-gradient(circle at 28% 38%, hsl(var(--h2) 75% 82%) 0 16%, transparent 16.5%),
    radial-gradient(circle at 72% 66%, hsl(var(--h2) 60% 70% / .85) 0 24%, transparent 24.5%),
    radial-gradient(circle at 60% 22%, hsl(var(--h1) 70% 85% / .6) 0 9%, transparent 9.5%),
    linear-gradient(135deg, hsl(var(--h1) 55% var(--pv-l)), hsl(var(--h2) 50% var(--pv-l2)));
}
.m-berge .pv-img {
  background:
    radial-gradient(circle at 74% 30%, hsl(var(--h2) 85% 86%) 0 9%, transparent 9.5%),
    linear-gradient(160deg, transparent 58%, hsl(var(--h1) 35% calc(var(--pv-l2) - 8%)) 58.4%),
    linear-gradient(205deg, transparent 52%, hsl(var(--h1) 40% var(--pv-l2)) 52.4%),
    linear-gradient(180deg, hsl(var(--h2) 60% calc(var(--pv-l) + 14%)), hsl(var(--h1) 45% var(--pv-l)));
}
.m-raster .pv-img {
  background:
    linear-gradient(90deg, rgba(255,255,255,.22) 1px, transparent 1px) 0 0 / 14px 14px,
    linear-gradient(rgba(255,255,255,.22) 1px, transparent 1px) 0 0 / 14px 14px,
    linear-gradient(120deg, hsl(var(--h1) 50% var(--pv-l)), hsl(var(--h2) 55% var(--pv-l2)));
}
.m-streifen .pv-img {
  background:
    linear-gradient(90deg, hsl(var(--h2) 60% 70% / .0) 0 60%, hsl(var(--h2) 60% 75% / .55) 60% 72%, transparent 72%),
    repeating-linear-gradient(-45deg, hsl(var(--h1) 48% var(--pv-l)) 0 12px, hsl(var(--h1) 48% calc(var(--pv-l) - 7%)) 12px 24px);
}
.m-zeilen .pv-img {
  background:
    linear-gradient(90deg, transparent 0 12%, hsl(var(--h1) 30% 50% / .0) 12%),
    repeating-linear-gradient(180deg, transparent 0 13px, hsl(var(--h1) 25% calc(var(--pv-l) + 6%)) 13px 15px),
    linear-gradient(180deg, hsl(var(--h1) 30% calc(var(--pv-l) + 24%)), hsl(var(--h2) 30% calc(var(--pv-l) + 16%)));
}
.m-welle .pv-img {
  background:
    repeating-linear-gradient(90deg, hsl(var(--h2) 70% 82% / .7) 0 3px, transparent 3px 8px),
    linear-gradient(180deg, transparent 0 32%, hsl(var(--h1) 55% var(--pv-l2) / .0) 32%),
    linear-gradient(135deg, hsl(var(--h1) 55% var(--pv-l2)), hsl(var(--h2) 55% var(--pv-l)));
  -webkit-mask: none;
}
/* Gesperrt: nur die Vorschau unscharf und gedimmt, nie der Text */
.is-locked .pv-img { filter: blur(7px) saturate(.5) brightness(.75); transform: scale(1.15); }
.is-locked .pv-ico { background: rgba(10, 12, 16, .62); }

/* ---------- Karten ---------- */
.card {
  position: relative; display: flex; gap: 14px;
  padding: 12px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow);
}
.card:hover { border-color: var(--border-strong); }
.card.is-active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.card:has(.card-open:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.card .pv { flex: none; width: 132px; aspect-ratio: 4 / 3; }
.card-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; padding-right: 36px; }
.card-top { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; color: var(--text-2); }
.card-top .avatar { margin-left: 4px; }
.src-name { font-weight: 600; color: var(--text-2); white-space: nowrap; }
.src-name::after { content: "·"; margin-left: 6px; color: var(--text-3); }
.creator { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-title { font-size: 15.5px; font-weight: 650; line-height: 1.3; }
.card-open {
  padding: 0; border: 0; background: none; text-align: left; font-weight: inherit; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  overflow-wrap: anywhere;
}
.card-open:focus-visible { outline: none; }
/* Ganze Karte klickbar, ohne Knöpfe zu verschachteln */
.card-open::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.is-read .card-open { font-weight: 550; color: var(--text-2); }
.card-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; color: var(--text-2); }
.time { color: var(--text-3); white-space: nowrap; }
.new-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; }
.tag { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.tag .ico { width: 15px; height: 15px; }
.tag--lock { color: var(--warn); font-weight: 600; }
.tag--bought { color: var(--ok); font-weight: 600; }
.card-save {
  position: absolute; z-index: 1; top: 6px; right: 6px;
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 0; border-radius: 10px; background: transparent; color: var(--text-3);
}
.card-save:hover { background: var(--surface-2); color: var(--text); }
.card-save[aria-pressed="true"] { color: var(--accent); }

/* Zeitleiste */
.feed-out { outline: none; }
.v-zeitleiste { display: flex; flex-direction: column; gap: 10px; max-width: 780px; }
.day-label { font-size: 12.5px; font-weight: 650; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; margin: 8px 2px 0; }
.day-label:first-child { margin-top: 0; }

/* Raster */
.v-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(208px, 1fr)); gap: 14px; }
.v-raster .card { flex-direction: column; gap: 10px; padding: 10px; }
.v-raster .card .pv { width: 100%; aspect-ratio: 16 / 10; }
.v-raster .card-body { padding-right: 0; }
.v-raster .card-save { top: 14px; right: 14px; background: var(--surface); box-shadow: var(--shadow); }
.v-raster .card-save:hover { background: var(--surface-2); }
.v-raster .src-name, .v-spalten .src-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Spalten: eine Spalte je Quelle, Reihe waagerecht scroll- und einrastbar */
.v-spalten {
  --n: 3; --gap: 12px;
  display: grid; grid-auto-flow: column; gap: var(--gap);
  grid-auto-columns: max(260px, calc((100% - (var(--n) - 1) * var(--gap)) / var(--n)));
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding: 0;
  padding-bottom: 6px;
}
.col {
  scroll-snap-align: start; display: flex; flex-direction: column; min-width: 0; min-height: 0;
  background: var(--surface-2); border-radius: var(--radius); border: 1px solid var(--border);
}
.col-head {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; min-height: 48px;
  border-bottom: 1px solid var(--border); font-weight: 650;
}
.col-head .col-meta { margin-left: auto; font-size: 13px; font-weight: 500; color: var(--text-3); white-space: nowrap; }
.col-list { display: flex; flex-direction: column; gap: 8px; padding: 8px; overflow-y: auto; min-height: 0; flex: 1; }
.v-spalten .card { padding: 10px; gap: 10px; box-shadow: none; }
.v-spalten .card .pv { width: 72px; aspect-ratio: 1; }
.v-spalten .card .pv-ico { width: 28px; height: 28px; }
.v-spalten .card .pv-ico .ico { width: 15px; height: 15px; }
.v-spalten .card-title { font-size: 14.5px; }
.v-spalten .card-tags { font-size: 12.5px; gap: 4px 8px; }
.v-spalten .card-top .avatar { margin-left: 0; }
.col-empty { padding: 16px 8px; font-size: 14px; color: var(--text-3); text-align: center; }

.col-tabs { display: none; }

/* Leerer Zustand */
.empty {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  padding: 28px 20px; border: 1px dashed var(--border-strong); border-radius: var(--radius);
  color: var(--text-2); max-width: 780px;
}
.empty strong { color: var(--text); font-size: 16px; }

/* ---------- Schaltflächen ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-size: 14px; font-weight: 600; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn .ico { width: 18px; height: 18px; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-hover); }
.btn[aria-pressed="true"] { background: var(--accent-soft); color: var(--on-accent-soft); border-color: transparent; }
.btn:disabled { color: var(--text-3); cursor: default; background: var(--surface-2); }
.icon-btn {
  display: grid; place-items: center; width: 44px; height: 44px; flex: none;
  border: 0; border-radius: 10px; background: transparent; color: var(--text-2);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.hint { font-size: 13px; color: var(--text-2); min-height: 0; flex-basis: 100%; }
.hint:empty { display: none; }

/* ---------- Lesefenster ---------- */
.reader { display: flex; flex-direction: column; background: var(--surface); min-width: 0; }
.reader-head {
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px;
  border-bottom: 1px solid var(--border); min-height: 60px;
}
.reader-src { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--text-2); min-width: 0; flex: 1; }
.reader-head .icon-btn { margin-left: auto; }
.reader-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; overscroll-behavior: contain; }
.pv--lg { width: 100%; aspect-ratio: 16 / 9; flex: none; }
.pv--lg .pv-ico { width: 52px; height: 52px; }
.pv--lg .pv-ico .ico { width: 24px; height: 24px; }
.reader-title { font-size: 21px; line-height: 1.25; font-weight: 700; outline: none; overflow-wrap: anywhere; }
.reader-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 14px; color: var(--text-2); }
.reader-meta .who { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; }
.lock-note {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px;
  background: var(--warn-soft); color: var(--text); font-size: 14px;
}
.lock-note .ico { color: var(--warn); margin-top: 1px; }
.reader-text { display: flex; flex-direction: column; gap: 10px; color: var(--text); font-size: 15.5px; line-height: 1.6; max-width: 62ch; }
.reader-sub { font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin-top: 4px; }
.files { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.files li {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; min-height: 48px; font-size: 14px;
}
.files li + li { border-top: 1px solid var(--border); }
.files .ico { color: var(--text-3); }
.file-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.file-size { color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.files-empty { color: var(--text-3); }
.reader-actions {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px;
  border-top: 1px solid var(--border); background: var(--surface);
}
.reader-actions .btn--primary { flex: 1 1 100%; }
.reader-actions .btn:not(.btn--primary) { flex: 1 1 0; }

.backdrop { position: fixed; inset: 0; z-index: 40; background: var(--scrim); }

@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes side-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Bibliothek ---------- */
.screen-intro { color: var(--text-2); font-size: 14.5px; max-width: 70ch; }
.lib-summary { display: flex; flex-wrap: wrap; gap: 8px; }
.stat {
  display: inline-flex; align-items: baseline; gap: 6px; padding: 8px 12px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border); font-size: 14px; color: var(--text-2);
}
.stat b { font-size: 16px; color: var(--text); font-variant-numeric: tabular-nums; }
.lib-list {
  display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; max-width: 980px;
}
.lib-item { display: grid; grid-template-columns: 22px minmax(0, 1fr) 90px 190px; align-items: center; gap: 14px; padding: 12px 16px; min-height: 64px; }
.lib-item + .lib-item { border-top: 1px solid var(--border); }
.lib-main { min-width: 0; }
.lib-title { font-weight: 620; overflow-wrap: anywhere; }
.lib-sub { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; color: var(--text-3); margin-top: 2px; }
.lib-sub .tag--bought { font-size: 13px; }
.lib-size { font-size: 14px; color: var(--text-2); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lib-status { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; }
.status {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 14px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
}
.status .ico { width: 16px; height: 16px; }
.status--ok { background: var(--ok-soft); color: var(--ok); }
.status--warn { background: var(--warn-soft); color: var(--warn); }
.status--muted { background: var(--muted-soft); color: var(--text-2); }
.status--accent { background: var(--accent-soft); color: var(--on-accent-soft); }
.progress { display: flex; align-items: center; gap: 8px; width: 100%; }
.progress-bar { flex: 1; height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; min-width: 60px; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 4px; transition: width .4s ease; }
.progress-text { font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }

/* ---------- Konten ---------- */
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; max-width: 1100px; }
.acc {
  display: flex; flex-direction: column; gap: 14px; padding: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.acc.is-expired { border-color: var(--warn); }
.acc-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.acc-head .badge { width: 30px; height: 30px; font-size: 15px; border-radius: 8px; }
.acc-name { font-size: 17px; font-weight: 700; }
.acc-head .status { margin-left: auto; }
.acc dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.acc dt { color: var(--text-3); }
.acc dd { margin: 0; color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.acc .btn { align-self: stretch; }
.acc-note { font-size: 13.5px; color: var(--text-2); }

/* =================================================================
   Breiten
   ================================================================= */

/* ---------- Rechner (ab 1100 px): Seitenleiste + Inhalt + Seitenfenster ---------- */
@media (min-width: 1100px) {
  .shell {
    display: grid; grid-template-columns: 240px minmax(0, 1fr);
    height: 100vh; height: 100dvh; overflow: hidden;
  }
  .shell.reader-docked { grid-template-columns: 240px minmax(0, 1fr) minmax(360px, 420px); }
  .nav {
    display: flex; flex-direction: column; padding: 18px 12px; overflow-y: auto;
    border-right: 1px solid var(--border);
  }
  .brand--nav { padding: 2px 12px 18px; }
  .brand--top { display: none; }
  .nav-list { flex-direction: column; }
  .nav-warn { margin-left: auto; }
  .reader { border-left: 1px solid var(--border); height: 100%; animation: side-in .18s ease-out; }
  .reader-close-hint { display: none; }
}

/* ---------- Tablet und Rechner: Inhalt scrollt in sich ---------- */
@media (min-width: 700px) {
  .main-wrap { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100vh; height: 100dvh; }
  .topbar { padding: 14px 24px; border-bottom: 1px solid var(--border); background: var(--bg); min-height: 68px; }
  .main { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 24px 32px; display: flex; flex-direction: column; }
  .screen { display: flex; flex-direction: column; gap: 14px; }
  /* Spalten-Ansicht füllt die Höhe; jede Spalte scrollt für sich */
  .is-spalten .screen--feed { flex: 1; min-height: 0; }
  .is-spalten .feed-out { flex: 1; min-height: 340px; }
  .is-spalten .v-spalten { height: 100%; }
}

/* ---------- Tablet (700–1099 px): schmale Symbolleiste ---------- */
@media (min-width: 700px) and (max-width: 1099px) {
  .shell { display: grid; grid-template-columns: 76px minmax(0, 1fr); height: 100vh; height: 100dvh; overflow: hidden; }
  .nav {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 14px 0; border-right: 1px solid var(--border); overflow-y: auto;
  }
  .brand--nav { display: none; }
  .brand--top .mock-label { margin-top: 2px; }
  .topbar .brand--top { padding-right: 16px; margin-right: 4px; border-right: 1px solid var(--border); }
  .nav-list { flex-direction: column; gap: 6px; }
  .nav-link { width: 56px; height: 52px; padding: 0; justify-content: center; flex-direction: column; gap: 2px; font-size: 11px; }
  .nav-link .nav-text { font-size: 11px; font-weight: 600; }
  .nav-warn { position: absolute; top: 6px; right: 10px; }
  .follow { display: flex; flex-direction: column; align-items: center; border-top: 1px solid var(--border); margin-top: 10px; padding-top: 10px; }
  .follow-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .follow-list { display: flex; flex-direction: column; gap: 4px; }
  .follow-btn { position: relative; width: 52px; height: 48px; justify-content: center; padding: 0; }
  .follow-btn .follow-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .follow-btn .avatar { width: 34px; height: 34px; font-size: 12px; }
  .follow-btn .count-pill { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; line-height: 18px; font-size: 11px; padding: 0 4px; box-shadow: 0 0 0 2px var(--surface); }
  .follow-btn[aria-pressed="true"] .avatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
  /* Lesefenster als Blatt von rechts über dem Inhalt */
  .reader {
    position: fixed; z-index: 50; top: 0; right: 0; bottom: 0; width: min(460px, 88vw);
    box-shadow: var(--shadow-lg); animation: side-in .18s ease-out;
  }
  .backdrop { animation: fade-in .18s ease-out; }
  .switches { margin-left: 0; }
}

/* ---------- Handy (unter 700 px): untere Leiste, Blatt von unten ---------- */
@media (max-width: 699px) {
  body { font-size: 15px; }
  .shell { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .nav {
    position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
  }
  .brand--nav, .follow { display: none; }
  .nav-list { justify-content: space-around; }
  .nav-list li { flex: 1; }
  .nav-link { flex-direction: column; gap: 2px; height: 52px; padding: 0; justify-content: center; font-size: 12px; }
  .nav-link .nav-text { font-size: 12px; font-weight: 600; }
  .nav-warn { position: absolute; top: 6px; left: calc(50% + 8px); }

  .topbar { flex-wrap: wrap; padding: 12px 16px 4px; row-gap: 10px; }
  .topbar .brand--top { order: 1; }
  .theme-switch { order: 2; }
  .theme-btn { width: 44px; height: 44px; }
  .screen-title { order: 3; flex-basis: 100%; font-size: 24px; }
  .main { padding: 8px 16px 24px; }
  .screen { display: flex; flex-direction: column; gap: 12px; }

  .tb-row--top { gap: 8px; }
  .search { flex: 1 1 100%; }
  .search input { height: 44px; }
  .seg { flex: 1 1 auto; }
  #view-seg .seg-btn { flex: 1; height: 38px; padding: 0 6px; }
  #view-seg .seg-btn .ico { display: none; }
  #view-seg { height: 44px; }
  .seg-btn { height: 38px; }
  .seg--cols { display: none !important; }
  .filter-toggle { display: inline-flex; }
  .tb-row--filters { display: none; flex-direction: column; align-items: stretch; gap: 12px; padding: 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
  .tb-row--filters.is-open { display: flex; }
  .chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .chip { height: 44px; border-radius: 12px; padding: 0 10px 0 8px; }
  .chip-count { margin-left: auto; }
  .switches { flex-direction: column; margin-left: 0; gap: 0; }
  .switch { min-height: 44px; width: 100%; justify-content: flex-start; }
  .creator-select { display: flex; flex-direction: column; gap: 4px; }
  .filter-pill { height: 44px; }
  .notice a { min-height: 44px; display: inline-flex; align-items: center; }

  .card { gap: 12px; padding: 10px; }
  .card .pv { width: 92px; aspect-ratio: 1; }
  .card-save { width: 44px; height: 44px; top: 4px; right: 4px; }
  .card-body { padding-right: 34px; gap: 5px; }
  .card-title { font-size: 15px; }
  .src-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .v-raster { grid-template-columns: 1fr 1fr; gap: 10px; }
  .v-raster .card { padding: 8px; gap: 8px; }
  .v-raster .card .pv { width: 100%; aspect-ratio: 4 / 3; }
  .v-raster .card-save { top: 12px; right: 12px; }
  .v-raster .card-top .creator { font-size: 12.5px; }
  .v-raster .card-top .avatar { display: none; }
  .v-raster .card-tags .tag--art span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .v-raster .card-title { font-size: 14.5px; }

  /* Spalten auf dem Handy: eine Spalte je Wisch, Reiter oben */
  .col-tabs {
    display: flex; gap: 4px; position: sticky; top: 0; z-index: 5;
    margin: 0 -16px; padding: 6px 16px; background: var(--bg);
  }
  .col-tab {
    flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 6px;
    height: 44px; padding: 0 4px; border: 1px solid var(--border); border-radius: 10px;
    background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 600;
  }
  .col-tab span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .col-tab[aria-current="true"] { border-color: var(--text-2); color: var(--text); background: var(--surface); box-shadow: inset 0 -3px 0 var(--accent); }
  .v-spalten { grid-auto-columns: calc(100% - 28px); margin: 0 -16px; padding: 0 16px 6px; scroll-padding: 0 16px; }
  .col { scroll-snap-stop: always; }

  .btn { min-height: 44px; }
  .reader {
    position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; max-height: 92dvh; max-height: 92vh;
    border-radius: 18px 18px 0 0; box-shadow: var(--shadow-lg); animation: sheet-in .2s ease-out;
  }
  @supports (height: 1dvh) { .reader { max-height: 92dvh; } }
  .reader-head::before {
    content: ""; position: absolute; left: 50%; top: 6px; width: 40px; height: 4px; margin-left: -20px;
    border-radius: 2px; background: var(--border-strong);
  }
  .reader-head { position: relative; padding-top: 12px; }
  .reader-actions { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .reader-actions .btn { font-size: 13.5px; padding: 0 10px; }
  .backdrop { animation: fade-in .2s ease-out; }

  .lib-item { grid-template-columns: 22px minmax(0, 1fr) auto; grid-template-areas: "b m s" "b st st"; gap: 8px 12px; padding: 12px; }
  .lib-item > .badge { grid-area: b; align-self: start; margin-top: 1px; }
  .lib-main { grid-area: m; }
  .lib-size { grid-area: s; align-self: start; }
  .lib-status { grid-area: st; justify-content: flex-start; }
  .lib-status .btn { min-height: 44px; }
  .acc-grid { grid-template-columns: 1fr; }
}

/* Sehr schmale Handys: Marke kürzen statt quetschen */
@media (max-width: 359px) {
  .mock-label { white-space: normal; }
}

/* Weniger Bewegung, wenn gewünscht */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
