/* Losdemokratie Videosammlung – helles Design nach losdemokratie.de, keine externen Abhängigkeiten */
@font-face { font-family: Oxygen; font-weight: 400; font-display: swap; src: url("/fonts/oxygen-400.woff2") format("woff2"); }
@font-face { font-family: Oxygen; font-weight: 700; font-display: swap; src: url("/fonts/oxygen-700.woff2") format("woff2"); }
:root {
  /* Farben nach losdemokratie.de: Petrol, Gold, dunkles Petrol als Schrift, helle Flächen */
  --bg: #f3f6f6;
  --surface: #ffffff;
  --surface-2: #eaf1f2;
  --border: #d3dfe1;
  --text: #0c2428;
  --muted: #5a6e72;
  --accent: #266e7a;
  --accent-hover: #1d5862;
  --accent-soft: rgba(38, 110, 122, 0.14);
  --gold: #e0a800;
  --gold-soft: rgba(255, 187, 0, 0.32);
  --blue: #1f5d68;
  --danger: #c0392b;
  --on-dark: #f3f6f6;
  --radius: 10px;
  --font: Oxygen, Verdana, ui-sans-serif, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
kbd {
  font: 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px;
  padding: 3px 6px; background: var(--surface-2); color: var(--text);
}
mark {
  background: var(--gold-soft);
  color: inherit;
  border-radius: 3px;
  padding: 0 2px;
}

/* ---------- Kopfzeile ---------- */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px;
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--accent); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b { font-size: 21px; font-weight: 700; letter-spacing: -0.01em; }
.brand-text small { font-size: 13px; color: var(--accent); opacity: .85; }
.brand:hover { text-decoration: none; }
.search { flex: 1 1 360px; display: flex; gap: 8px; min-width: 240px; }
.search input {
  flex: 1; min-width: 0;
  font: inherit; font-size: 17px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.options { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.admin-link { color: var(--muted); font-size: 13px; }

.btn {
  font: inherit; font-size: 14px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 14px; cursor: pointer; transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover:not(:disabled) { border-color: #b8c9cc; background: #e3eced; }
.btn:disabled { opacity: .35; cursor: default; }
.btn.primary { background: var(--accent); color: #ffffff; border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { background: transparent; }
.btn.icon { width: 40px; height: 40px; padding: 0; font-size: 22px; line-height: 1; border-radius: 50%; }
.btn.icon.small { width: 34px; height: 34px; font-size: 15px; }
.btn.small { padding: 4px 9px; font-size: 13px; }

.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.seg button {
  font: inherit; font-size: 13px; color: var(--muted); background: none; border: 0;
  padding: 6px 11px; border-radius: 7px; cursor: pointer; white-space: nowrap;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface-2); color: var(--text); box-shadow: 0 0 0 1px var(--border); }

.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; user-select: none; }
.toggle input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }
.toggle.disabled { opacity: .45; cursor: not-allowed; }
.toggle.small { font-size: 12px; }

/* ---------- Hauptbereich ---------- */
main { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: 24px; }
.stage { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.player-wrap {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  background: #000; border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .45);
}
.player-wrap iframe, .player-wrap #player { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center;
  gap: 6px; padding: 24px; text-align: center; color: rgba(243, 246, 246, .75);
  background: radial-gradient(ellipse at center, #1d3f45 0%, #0c2428 75%);
}
.placeholder p { margin: 0; max-width: 46ch; }
.placeholder .keys { font-size: 13px; margin-top: 10px; }
.unmute {
  position: absolute; right: 12px; bottom: 56px; z-index: 2;
  font: inherit; font-size: 13px; color: var(--on-dark); background: rgba(0, 0, 0, .75);
  border: 1px solid rgba(255, 255, 255, .25); border-radius: 999px; padding: 7px 13px; cursor: pointer;
}

.clip-panel { display: flex; flex-direction: column; gap: 12px; }
.subtitle {
  min-height: 2.6em; margin: 6px 0 0; text-align: center;
  font-size: clamp(22px, 3.4vw, 34px); line-height: 1.35; font-weight: 600; letter-spacing: -0.01em;
  text-wrap: balance;
}
.subtitle.long { font-size: clamp(17px, 2.1vw, 21px); font-weight: 500; line-height: 1.55; text-align: left; }
.subtitle.xlong {
  font-size: 16px; font-weight: 400; line-height: 1.6; text-align: left; color: var(--text);
  max-height: 11.5em; overflow-y: auto; padding-right: 6px;
}
.subtitle.empty { color: var(--muted); font-weight: 400; font-size: 18px; }

.clip-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; justify-content: space-between; }
.nav { display: flex; align-items: center; gap: 8px; }
.counter { min-width: 72px; text-align: center; font-variant-numeric: tabular-nums; font-size: 18px; font-weight: 600; }
.meta { flex: 1 1 260px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 13px; color: var(--muted); min-width: 0; }
.meta .title { color: var(--text); max-width: 34ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta .time { font-variant-numeric: tabular-nums; }
.meta .yt { margin-left: 4px; }
.dot { opacity: .5; }
.actions { display: flex; align-items: center; gap: 12px; }
.badge {
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted); margin-left: 4px;
}
.badge.keyword { color: var(--accent); border-color: rgba(224, 168, 0, .35); }
.badge.semantic { color: var(--blue); border-color: rgba(31, 93, 104, .35); }
.badge.hybrid { color: #6a4fb3; border-color: rgba(106, 79, 179, .35); }

.progress { height: 3px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.progress > div { height: 100%; width: 0; background: var(--accent); transition: width .15s linear; }
.reason { margin: 0; font-size: 14px; color: #3d5458; font-style: italic; }
.reason::before { content: "Begründung: "; font-style: normal; color: var(--muted); }

/* ---------- Kontext ---------- */
.context { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.context header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.context h2 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.context ol { position: relative; list-style: none; margin: 0; padding: 0; max-height: 300px; overflow-y: auto; }
.context li { display: flex; gap: 12px; padding: 5px 8px; border-radius: 7px; cursor: pointer; font-size: 15px; }
.context li:hover { background: var(--surface-2); }
.context li.in-clip { color: var(--text); background: rgba(224, 168, 0, .06); }
.context li:not(.in-clip) { color: #3d5458; }
.context li.now { box-shadow: inset 3px 0 0 var(--accent); color: var(--text); }
.context .time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; padding-top: 2px; }
.muted { color: var(--muted); cursor: default !important; }
.error { color: var(--danger) !important; }

/* ---------- Liste ---------- */
.list-panel { display: none; min-width: 0; }
.results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.results li {
  display: flex; gap: 12px; padding: 12px 14px; border-radius: var(--radius); cursor: pointer;
  background: var(--surface); border: 1px solid transparent; transition: border-color .15s, background .15s;
}
.results li:hover { border-color: var(--border); background: var(--surface-2); }
.results li.active { border-color: rgba(224, 168, 0, .5); background: #fff8e0; }
.results li:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.results .time {
  flex: none; align-self: flex-start; font: 600 13px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--accent); background: var(--accent-soft); border: 0; border-radius: 6px; padding: 6px 8px; cursor: pointer;
}
.results .body { min-width: 0; }
.results .src { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.results .src .title { color: #3d5458; }
.results .text { margin: 4px 0 4px; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.results .reason { font-size: 13px; margin-bottom: 4px; }
.results .yt { font-size: 12px; }

/* Listen-Modus: Player links (mitlaufend), Liste rechts */
main.view-list { max-width: 1400px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, 1fr); gap: 24px; align-items: start; }
main.view-list .stage { position: sticky; top: 92px; }
main.view-list .list-panel { display: block; max-height: calc(100vh - 140px); overflow-y: auto; padding-right: 4px; }
main.view-list .subtitle { font-size: 18px; font-weight: 500; text-align: left; min-height: 0; }

/* ---------- Fusszeile ---------- */
.status {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 24px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--border);
}
body.loading .status #msg::before {
  content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px; vertical-align: -1px;
  border: 2px solid var(--muted); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.status-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 420px; }
.expansions { font-size: 12px; color: var(--muted); }
.expansions summary { cursor: pointer; width: fit-content; list-style: none; opacity: .85; }
.expansions summary::-webkit-details-marker { display: none; }
.expansions summary::before { content: "▸ "; }
.expansions[open] summary::before { content: "▾ "; }
.expansions summary:hover { color: var(--text); }
.expansions ul { margin: 4px 0 0; padding-left: 18px; max-width: 820px; }
.expand-skipped { font-size: 12px; color: var(--muted); opacity: .85; }
.expansions li { margin: 2px 0; font-style: italic; line-height: 1.4; }

/* ---------- Responsiv ---------- */
@media (max-width: 900px) {
  main.view-list { display: block; }
  main.view-list .stage { position: static; }
  main.view-list .list-panel { max-height: none; overflow: visible; margin-top: 20px; }
}
@media (max-width: 600px) {
  .top { padding: 10px 14px; position: static; }
  main { padding: 14px; }
  .search .btn { display: none; }
  .options { width: 100%; justify-content: space-between; }
  .seg button { padding: 6px 8px; }
  .clip-bar { justify-content: center; }
  .meta { justify-content: center; }
}

/* ---------- Player-Umschaltung (YouTube | <video> | Fallback-Karte) ---------- */
/* Alle drei Elemente bleiben im DOM; nur eines ist sichtbar → kein Flackern beim Wechsel. */
.player-slot { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; visibility: hidden; }
.player-wrap[data-kind="yt"] #yt-slot,
.player-wrap[data-kind="video"] #video,
.player-wrap[data-kind="card"] #player-card { visibility: visible; }
#video { background: #000; object-fit: contain; }
.local-badge {
  position: absolute; left: 12px; top: 12px; z-index: 2; display: none;
  font-size: 12px; letter-spacing: .02em; color: var(--on-dark);
  background: rgba(0, 0, 0, .65); border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px; padding: 3px 9px;
  pointer-events: none;
}
.player-wrap[data-kind="video"] .local-badge { display: inline-block; }
.player-card {
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 10px;
  padding: 24px 32px; text-align: center; color: rgba(243, 246, 246, .7);
  background: radial-gradient(ellipse at center, #1d3f45 0%, #0c2428 80%);
}
.player-card p { margin: 0; }
.player-card .card-title { color: var(--on-dark); font-size: 20px; font-weight: 600; }
.player-card .card-meta { font-size: 13px; }
.player-card .card-text {
  margin: 4px 0; max-width: 60ch; max-height: 7.5em; overflow: hidden; color: #dfe8e9;
  font-size: 16px; line-height: 1.5; font-style: italic;
}
.player-card .card-link { text-decoration: none; }
.player-card .card-hint { font-size: 12px; min-height: 1.2em; }

/* Konfidenz-Gate (Ticket fusion) und Karten-Titel im Listen-Modus */
.low-confidence { margin: 8px 12px; padding: 8px 12px; border-radius: 6px; font-size: 13px;
  background: rgba(255, 196, 0, .12); border: 1px solid rgba(255, 196, 0, .45); color: var(--text); }
.results .card-title { margin: 2px 0 2px; font-size: 14px; font-weight: 600; color: var(--text); }

/* ---------- Standbilder in der Suche (Ticket topics-ui) ---------- */
.results .still {
  flex: none; width: 96px; aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); align-self: flex-start;
}

/* Vorschau-Leiste (Clip-Modus): Streifen der Standbilder der Treffer-Szenen */
.strip {
  display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 6px;
  scrollbar-width: thin;
}
main.view-list .strip { display: none; }
.strip .thumb {
  position: relative; flex: none; width: 128px; padding: 0; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
  transition: border-color .15s;
}
.strip .thumb:hover { border-color: #b8c9cc; }
.strip .thumb.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.strip .thumb img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.strip .thumb-time {
  position: absolute; left: 4px; bottom: 4px;
  font: 600 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--on-dark);
  background: rgba(0, 0, 0, .7); border-radius: 5px; padding: 2px 5px; pointer-events: none;
}

/* ---------- Navigationsleiste der Unterseiten (wie Admin) ---------- */
.nav-links { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.nav-links a { color: var(--muted); font-size: 14px; padding: 6px 12px; border-radius: 7px; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a.on { background: var(--surface-2); color: var(--text); box-shadow: 0 0 0 1px var(--border); }
.top-right { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.muted-text { color: var(--muted); font-size: 13px; }
.page-main { flex: 1; width: 100%; max-width: 1400px; margin: 0 auto; padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.page-msg { margin: 0; color: var(--muted); font-size: 15px; }
.page-msg.error { color: var(--danger); }
.badge.sec { margin-left: 0; margin-top: 6px; width: fit-content; color: var(--blue); border-color: rgba(31, 93, 104, .35); }

/* ---------- /themen: Cluster mit Video-Kacheln ---------- */
.clusters { display: flex; flex-direction: column; gap: 22px; }
.cluster { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.cluster-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.cluster-head h2 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.cluster-count { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.cluster-summary { margin: 6px 0 0; font-size: 14px; line-height: 1.55; color: #3d5458; max-width: 90ch; }
.cluster-keywords { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.tiles { margin-top: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.tile {
  display: flex; gap: 10px; padding: 10px; border-radius: 10px; color: inherit;
  background: var(--surface-2); border: 1px solid transparent; transition: border-color .15s, background .15s;
}
.tile:hover { text-decoration: none; border-color: var(--border); background: #e3eced; }
.tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tile-thumb {
  flex: none; width: 120px; aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: 7px; background: #000; border: 1px solid var(--border);
}
.tile-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tile-title {
  margin: 0; font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tile-meta { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.tile-meta .time { font-variant-numeric: tabular-nums; }
.tile-desc {
  margin: 2px 0 0; font-size: 12.5px; line-height: 1.45; color: #3d5458;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---------- /video/<id>: Kopfbereich, Kapitelliste, Kapitel-Leiste ---------- */
#video-head h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.v-meta { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; font-size: 13px; color: var(--muted); margin-top: 4px; }
.v-meta .time { font-variant-numeric: tabular-nums; }
.v-desc { margin: 8px 0 0; font-size: 14px; line-height: 1.55; color: #3d5458; max-width: 90ch; }
.v-topics { margin: 8px 0 0; font-size: 13px; color: var(--blue); }
.chapters-head { margin: 4px 0 0; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.chapters { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.chapters li {
  display: flex; gap: 12px; padding: 10px 14px; border-radius: var(--radius); cursor: pointer;
  background: var(--surface); border: 1px solid transparent; transition: border-color .15s, background .15s;
}
.chapters li:hover { border-color: var(--border); background: var(--surface-2); }
.chapters li.active { border-color: rgba(224, 168, 0, .5); background: #fff8e0; }
.chapters li:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chapters .still {
  flex: none; width: 128px; aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); align-self: flex-start;
}
.chapters .body { min-width: 0; flex: 1; }
.chapters .card-title { margin: 1px 0 2px; font-size: 14px; font-weight: 600; color: var(--text); }
.chapters .text { margin: 0; font-size: 13.5px; line-height: 1.5; color: #3d5458; overflow-wrap: anywhere; }
.chapters .badge { margin-left: 0; }
.chapters > li > .time {
  flex: none; align-self: flex-start; font: 600 13px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 6px 8px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.chapter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.chapter-now { font-size: 13px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 240px; }
.chapter-progress { flex: 1 1 160px; }
.badge.block { color: #6a4fb3; border-color: rgba(106, 79, 179, .35); }

@media (max-width: 600px) {
  .page-main { padding: 14px; }
  .tiles { grid-template-columns: 1fr; }
  .results .still, .chapters .still { width: 84px; }
  .top-right { margin-left: 0; width: 100%; justify-content: space-between; }
}

/* ---------- Startseite (body.home: noch keine Suche) ---------- */
.home-main { display: none; }
body.home .home-main {
  display: flex; flex-direction: column; gap: 40px;
  flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 48px 24px 56px;
}
body.home #main, body.home .top .search, body.home .top .options .seg,
body.home .top .options .toggle, body.home footer.status { display: none !important; }
body.home .top .options { margin-left: auto; }

.hero { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.hero h1 { margin: 0; font-size: 38px; letter-spacing: -0.02em; font-weight: 700; }
.hero-sub { margin: 0; color: var(--muted); font-size: 16px; }
.hero-search { width: 100%; max-width: 720px; flex: none; margin-top: 14px; }
.hero-search input { font-size: 19px; padding: 14px 18px; border-radius: 14px; }
.hero-search .btn { padding: 0 22px; border-radius: 14px; font-size: 16px; }

.home-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.home-head h2, .suggest h2 { margin: 0; font-size: 22px; letter-spacing: -0.01em; }
.home-all { margin-left: auto; font-size: 14px; }
.topic-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.topic-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px;
}
.topic-card h3 { margin: 0; font-size: 17px; line-height: 1.3; }
.topic-card h3 a { color: var(--text); }
.topic-card .cluster-count { margin-left: 6px; white-space: nowrap; }
.topic-card p { margin: 0; font-size: 14px; line-height: 1.5; color: #3d5458;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.topic-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 2px; }
.topic-thumbs a { display: block; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: var(--surface-2); }
.topic-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .15s; }
.topic-thumbs a:hover img { opacity: .8; }
.topic-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.kw-chip {
  font: inherit; font-size: 12px; color: var(--muted); cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px;
}
.kw-chip:hover { color: var(--text); border-color: var(--accent); }

.suggest {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; display: flex; flex-direction: column; gap: 8px;
}
.suggest p { margin: 0; }
.suggest-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.suggest-form .field {
  font: inherit; font-size: 15px; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 12px; outline: none; flex: 2 1 300px; min-width: 0;
}
.suggest-form .field + .field { flex: 1 1 220px; }
.suggest-form .field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.suggest .form-msg { margin: 4px 0 0; font-size: 14px; color: var(--muted); min-height: 1.2em; }
.suggest .form-msg.ok { color: #2e7d32; }
.suggest .form-msg.error { color: var(--danger); }

@media (max-width: 720px) {
  body.home .home-main { padding: 28px 14px 40px; gap: 28px; }
  .hero h1 { font-size: 28px; }
  .topic-cards { grid-template-columns: 1fr; }
}

/* ---------- Videodetail: Player bleibt beim Scrollen der Kapitel sichtbar ---------- */
.video-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.video-stage { position: sticky; top: 78px; display: flex; flex-direction: column; gap: 10px; z-index: 2; }
.video-layout #chapters-sec { min-width: 0; }
.v-placeholder { background: var(--surface) center / cover no-repeat; box-shadow: inset 0 0 0 2000px rgba(12, 36, 40, .55); color: var(--on-dark); }
@media (max-width: 980px) {
  .video-layout { grid-template-columns: 1fr; }
  .video-stage { top: 0; background: var(--bg); padding-bottom: 8px; }
}

/* ---------- Sammeln-Knopf (Suche, Videodetail) ---------- */
.collect {
  font: inherit; font-size: 12px; color: var(--muted); cursor: pointer; white-space: nowrap;
  background: transparent; border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px;
}
.collect:hover { color: var(--text); border-color: var(--accent); }
.collect.on { color: var(--accent); border-color: rgba(224, 168, 0, .5); background: var(--accent-soft); }
.hit-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.meta .collect { margin-left: 6px; }
.chapters .collect { margin-left: 8px; }
.collect-count:not(:empty) {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 2px; border-radius: 999px;
  background: var(--accent); color: #ffffff; font-size: 11px; font-weight: 700; text-align: center; line-height: 18px;
}

/* ---------- Sammlung ---------- */
.sammlung-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.sammlung-bar h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.sammlung-bar .spacer { flex: 1; }
.sammlung-bar .export { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sammlung-empty {
  margin: 20px 0; padding: 28px; text-align: center; color: var(--muted);
  border: 1px dashed var(--border); border-radius: var(--radius);
}
.scenes .src { font-size: 12.5px; color: var(--muted); margin-bottom: 2px; }
.scenes .src .title { color: #3d5458; }
.scene-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; font-size: 13px; }
.scene-actions .btn.small { padding: 2px 8px; }
/* lange Seiten: Kopfzeile bleibt oben, Player klebt direkt darunter */
body.page-video, body.page-sammlung { height: auto; }
.file-btn { cursor: pointer; }

/* ---------- Gespeicherte / öffentliche Sammlungen ---------- */
.s-head { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.s-desc { margin: 2px 0 0; color: #3d5458; font-size: 14px; max-width: 80ch; }
.s-editing { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.linkish { font: inherit; color: var(--blue); background: none; border: 0; padding: 0; cursor: pointer; }
.linkish:hover { text-decoration: underline; }
.saved-sec { display: flex; flex-direction: column; gap: 8px; }
.saved-sec h2 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.saved { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.saved li {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px;
}
.saved li.current { border-color: rgba(224, 168, 0, .5); }
.saved-main { flex: 1 1 320px; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.saved-main p { flex-basis: 100%; margin: 0; }
.saved-act { display: flex; flex-wrap: wrap; gap: 6px; }
.saved .badge { font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; }
.saved .badge.pub { color: #2e7d32; border-color: rgba(46, 125, 50, .4); }
.save-dlg {
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; width: min(520px, 92vw);
}
.save-dlg::backdrop { background: rgba(12, 36, 40, .45); }
.save-dlg h3 { margin: 0 0 12px; }
.save-dlg form { display: flex; flex-direction: column; gap: 12px; }
.save-dlg label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.save-dlg label.toggle { flex-direction: row; align-items: flex-start; gap: 8px; color: var(--text); font-size: 14px; }
.save-dlg .field {
  font: inherit; font-size: 15px; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 9px; padding: 8px 11px; outline: none; resize: vertical;
}
.save-dlg .field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.save-dlg .form-msg { margin: 0; min-height: 0; font-size: 14px; color: var(--danger); }
.dlg-bar { display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- Sammlungen-Übersicht ---------- */
.mine {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--gold);
  border-radius: var(--radius); padding: 18px 22px;
}
.mine h1 { margin: 0 0 4px; font-size: 22px; color: var(--accent); }
.mine p { margin: 0; }
.suggest-dlg p.muted-text { margin: -4px 0 0; }
/* Überschriften in Petrol wie auf losdemokratie.de */
h1, h2, .cluster-head h2, .topic-card h3 a { color: var(--accent); }

/* ---------- Zuschneiden (Clip-Sammlung) ---------- */
.trim { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.trim-head { display: flex; align-items: baseline; gap: 10px; }
.trim-head h2 { margin: 0; font-size: 15px; }
.trim-head .muted-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trim-track { position: relative; height: 56px; border-radius: 8px; overflow: hidden; background: #0c2428; cursor: pointer; touch-action: none; user-select: none; }
.trim-tiles { position: absolute; inset: 0; display: flex; }
.trim-tiles img { flex: 1 1 0; min-width: 0; height: 100%; object-fit: cover; opacity: .9; pointer-events: none; }
.trim-shade { position: absolute; top: 0; bottom: 0; background: rgba(12, 36, 40, .62); pointer-events: none; }
#trim-shade-l { left: 0; }
#trim-shade-r { right: 0; }
.trim-sel { position: absolute; top: 0; bottom: 0; border: 3px solid var(--gold); border-radius: 6px; cursor: grab; box-sizing: border-box; }
.trim-sel:active { cursor: grabbing; }
.trim-handle { position: absolute; top: -3px; bottom: -3px; width: 14px; background: var(--gold); cursor: ew-resize; }
.trim-handle::after { content: ""; position: absolute; left: 5px; top: 35%; bottom: 35%; width: 2px; border-radius: 1px; background: #5c4500; }
.trim-handle.start { left: -9px; border-radius: 6px 0 0 6px; }
.trim-handle.end { right: -9px; border-radius: 0 6px 6px 0; }
.trim-handle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.trim-playhead { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 4px rgba(0, 0, 0, .6); pointer-events: none; }
.trim-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: -4px; }
.trim-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.trim-edge { display: flex; align-items: center; gap: 4px; }
.trim-edge .btn.small { padding: 2px 7px; min-width: 30px; }
.trim-time { font-variant-numeric: tabular-nums; min-width: 4.6em; text-align: center; color: var(--text); }
.trim-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.trim-actions .spacer { flex: 1; }
.trim-hint { margin: 0; font-size: 12px; }
.trim-text { list-style: none; margin: 0; padding: 0; max-height: 180px; overflow-y: auto; font-size: 13.5px; line-height: 1.45; border-top: 1px solid var(--border); }
.trim-text li { padding: 4px 6px; color: var(--muted); cursor: pointer; border-radius: 4px; }
.trim-text li:hover { background: var(--surface-2); }
.trim-text li.in { color: var(--text); background: var(--gold-soft); }
.trim-seg-t { font: 600 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); margin-right: 4px; }
/* Clip-Sammlung: Player-Spalte samt Zuschneiden bleibt im Bild, scrollt bei Bedarf selbst */
.page-sammlung .video-stage { max-height: calc(100vh - 90px); overflow-y: auto; }

/* ---------- Konto ---------- */
.account-link { font-size: 13px; font-weight: 700; color: var(--accent); white-space: nowrap; max-width: 22ch; overflow: hidden; text-overflow: ellipsis; }
.account-link.signed-in { font-weight: 400; }
.konto { max-width: 980px; }
.auth-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; align-items: start; }
.auth-card { display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px; }
.auth-card h1, .auth-card h2 { margin: 0; font-size: 21px; }
.auth-card label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.auth-card .field { font: inherit; font-size: 15px; color: var(--text); background: var(--bg); border: 1px solid var(--border);
  border-radius: 9px; padding: 9px 11px; outline: none; }
.auth-card .field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-card .btn { align-self: flex-start; }
.auth-card p { margin: 0; }
.form-msg { margin: 0; font-size: 14px; color: var(--muted); }
.form-msg:empty { display: none; }
.form-msg.ok { color: #2e7d32; }
.form-msg.error { color: var(--danger); }
.local-hint { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0; padding: 12px 16px;
  background: var(--gold-soft); border-radius: var(--radius); }
#signed-in { display: flex; flex-direction: column; gap: 20px; }
#signed-in[hidden] { display: none; }
.pw-change summary { cursor: pointer; color: var(--accent); font-size: 14px; }
.pw-change .auth-card { margin-top: 10px; max-width: 420px; }
.badge-community, .badge-official, .badge-public, .badge-private { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  border-radius: 999px; padding: 1px 7px; margin-left: 6px; vertical-align: middle; }
.badge-official { color: var(--accent); border: 1px solid rgba(38, 110, 122, .45); }
.badge-community { color: #6a4fb3; border: 1px solid rgba(106, 79, 179, .4); }
.badge-public { color: #2e7d32; border: 1px solid rgba(46, 125, 50, .4); }
.badge-private { color: var(--muted); border: 1px solid var(--border); }
.page-sammlungen .page-main { gap: 30px; }
.page-sammlungen .home-head { margin-bottom: 10px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.clipboard-card { border: 2px dashed var(--gold); background: #fffdf5; grid-column: span 2; }
@media (max-width: 760px) { .clipboard-card { grid-column: auto; } }
.clip-empty { margin: 0; padding: 14px 16px; border: 2px dashed var(--border); border-radius: var(--radius); }
.topic-card.just-saved { box-shadow: 0 0 0 3px var(--gold-soft); border-color: var(--gold); }

/* ---------- Wer sagt es? / Sie meinten ---------- */
.person-bar { width: 100%; max-width: 1400px; margin: 14px auto 0; padding: 0 24px; display: flex; flex-direction: column; gap: 8px; }
body.home .person-bar { display: none; }
.person-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.person-label { font-size: 14px; font-weight: 700; color: var(--accent); }
.person-seg button { font-size: 13.5px; }
.person-seg button.on { background: var(--accent); color: #fff; box-shadow: none; }
.hero-person { justify-content: center; margin-top: 14px; }
.did-you-mean { margin: 0; font-size: 15px; color: var(--text); background: var(--gold-soft); border-radius: var(--radius);
  padding: 8px 14px; width: fit-content; max-width: 100%; }
.did-you-mean .dym-sep { color: var(--muted); margin: 0 4px; }
.did-you-mean .linkish { font-size: 15px; }
.people { color: var(--muted); max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people.block { display: block; font-size: 13px; margin-top: 2px; }
.people .person-match { color: var(--accent); font-weight: 700; }
@media (max-width: 720px) { .person-bar { padding: 0 14px; } .person-seg { flex-wrap: wrap; } }

/* ---------- Gefundene Videos (Facette in der Suche) ---------- */
.facet { width: 100%; max-width: 1400px; margin: 14px auto 0; padding: 0 24px; display: flex; flex-direction: column; gap: 8px; }
body.home .facet { display: none !important; }
.facet-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.facet-head .btn { white-space: nowrap; }
.facet-head .spacer { flex: 1; }
.facet-toggle { font: inherit; font-size: 14px; color: var(--text); background: none; border: 0; padding: 2px 0; cursor: pointer; text-align: left; }
.facet-toggle #facet-summary { font-weight: 700; color: var(--accent); }
.facet-hint { font-size: 13px; color: var(--muted); }
.facet.collapsed .facet-list, .facet.collapsed [data-facet], .facet.collapsed .facet-hint { display: none; }
.facet-list { list-style: none; margin: 0; padding: 2px; display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px;
  max-height: 340px; overflow-y: auto; }
.facet-list label { display: flex; flex-direction: column; gap: 6px; cursor: pointer; height: 100%;
  background: var(--surface); border: 2px solid var(--accent); border-radius: 10px; padding: 6px; font-size: 12.5px; line-height: 1.3; }
.facet-list label:hover { box-shadow: 0 0 0 3px var(--accent-soft); }
.facet-thumb { position: relative; display: block; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: var(--surface-2); }
.facet-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.facet-thumb input { position: absolute; top: 6px; left: 6px; width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.facet-count { position: absolute; right: 6px; bottom: 6px; font-size: 11px; font-weight: 700; color: #fff; background: var(--accent);
  border-radius: 999px; padding: 1px 7px; }
.facet-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 600; }
.facet-list li.off label { background: var(--bg); border: 2px dashed var(--border); color: var(--muted); }
.facet-list li.off img { filter: grayscale(1); opacity: .45; }
.facet-list li.off .facet-count { color: var(--muted); background: var(--surface-2); }
@media (max-width: 720px) { .facet { padding: 0 14px; } .facet-list { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
  .facet-toggle { white-space: nowrap; } .facet-hint { order: 9; flex-basis: 100%; } }

/* ---------- In Claude nutzen ---------- */
.claude-page { max-width: 1100px; gap: 34px; }
.claude-page h2 { margin: 0 0 12px; font-size: 22px; }
.claude-hero h1 { margin: 6px 0 10px; font-size: clamp(26px, 3.4vw, 36px); }
.claude-hero .hero-sub { max-width: 72ch; margin: 0 0 16px; color: var(--muted); font-size: 17px; line-height: 1.55; }
.copy-row { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.copy-code { font: 15px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 12px; margin: 0; overflow-x: auto; max-width: 100%; user-select: all; color: var(--text); }
.copy-code.small { font-size: 12.5px; flex: 1 1 260px; white-space: pre-wrap; overflow-wrap: anywhere; }
.claude-steps .topic-card ol { margin: 0; padding-left: 20px; font-size: 14.5px; line-height: 1.6; }
.claude-steps .topic-card p { -webkit-line-clamp: unset; display: block; }
.claude-steps details summary { cursor: pointer; color: var(--accent); font-size: 14px; margin-bottom: 8px; }
.ask-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 15.5px; }
.tool-list { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0 0 12px; font-size: 15px; }
.tool-list dt { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; color: var(--accent); }
.tool-list dd { margin: 0; }
.hero-claude { margin: 12px 0 0; font-size: 14.5px; }
@media (max-width: 720px) { .tool-list { grid-template-columns: 1fr; } .tool-list dd { margin-bottom: 6px; } }
