/* ==========================================================================
   Abimon 2 – Oberfläche
   Ein Stylesheet, drei Layouts: Handy (< 768 px), Tablet (768–1199 px), Desktop (ab 1200 px).
   ========================================================================== */

@font-face { font-family: "Plex"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+2215; }
@font-face { font-family: "Plex"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1EFF, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plex"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+2215; }
@font-face { font-family: "Plex"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-ext-500-normal.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1EFF, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plex"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+2215; }
@font-face { font-family: "Plex"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-ext-600-normal.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1EFF, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  /* Grundflächen: Graphit mit leichtem Blaustich */
  --ink:        #15181d;
  --ink-2:      #1a1e24;
  --panel:      #20252c;
  --panel-2:    #272d35;
  --line:       #2f363f;
  --line-2:     #3c444f;

  /* Schrift: warmes Papier */
  --paper:      #ebe6db;
  --paper-2:    #aea89c;
  --paper-3:    #7a756b;

  /* Akzent: Messing – bewusst weit weg von Partei- und Beziehungsfarben */
  --brass:      #c9b48a;
  --brass-2:    #ddcba6;
  --brass-ink:  #1c1912;
  --brass-soft: rgba(201, 180, 138, 0.12);

  /* Beziehungsfarben */
  --feind:      #e0705f;
  --neutral:    #918c82;
  --freund:     #72b884;
  --besonders:  #a798e2;

  /* Haltungen zu Themen (wie im Netz, farbfehlsichtig geprüft) */
  --pro:        #3f97e0;
  --mid:        #a8a398;
  --contra:     #e8664f;

  --info:       #8fb3d9;
  --ok:         var(--freund);
  --danger:     var(--feind);

  --radius-s: 6px;
  --radius:   10px;
  --radius-l: 14px;

  --topbar-h: 56px;
  --tabbar-h: 62px;
  --rail-w:   84px;
  --side-w:   236px;
  --safe-b:   env(safe-area-inset-bottom, 0px);

  --font: "Plex", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font: 400 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 0;
}
img { max-width: 100%; display: block; }
a { color: var(--brass); text-decoration: none; }
a:hover { color: var(--brass-2); }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 12px; }
small, .muted { color: var(--paper-2); }
.faint { color: var(--paper-3); }
.num { font-variant-numeric: tabular-nums; }
.icon { flex-shrink: 0; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
code { font-size: 13px; background: var(--panel-2); padding: 1px 6px; border-radius: 4px; color: var(--paper); }

/* ---------- Rahmen ---------- */

.shell { min-height: 100vh; }
.main { min-width: 0; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px;
  background: rgba(21, 24, 29, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-title { flex: 1; min-width: 0; font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-brand { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--paper); }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: var(--radius);
  color: var(--paper-2); background: none; border: 0; cursor: pointer;
}
.icon-btn:hover { background: var(--panel); color: var(--paper); }

.content { padding: 16px 16px calc(var(--tabbar-h) + var(--safe-b) + 24px); }

/* Seitenleiste (Tablet: schmale Leiste, Desktop: mit Beschriftung) */
.sidenav { display: none; }

.brand-mark { display: inline-flex; align-items: center; gap: 9px; color: var(--paper); font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.brand-mark svg { color: var(--brass); }

.nav-link {
  display: flex; align-items: center; gap: 12px;
  color: var(--paper-2); border-radius: var(--radius);
  padding: 9px 12px; font-weight: 500; font-size: 14px;
}
.nav-link:hover { background: var(--panel); color: var(--paper); }
.nav-link.is-active { background: var(--brass-soft); color: var(--brass-2); }
.nav-button { width: 100%; background: none; border: 0; cursor: pointer; font-family: inherit; }
.nav-link .soon { margin-left: auto; font-size: 11px; color: var(--paper-3); font-weight: 400; }

/* Handy: untere Leiste */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--ink-2);
  border-top: 1px solid var(--line);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--paper-3); font-size: 11px; font-weight: 500;
  background: none; border: 0; font-family: inherit; cursor: pointer;
}
.tab.is-active { color: var(--brass-2); }

/* Blatt „Mehr“ (Handy) */
.sheet { position: fixed; inset: 0; z-index: 60; display: none; }
.sheet.is-open { display: block; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5); }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--ink-2); border-top: 1px solid var(--line-2);
  border-radius: var(--radius-l) var(--radius-l) 0 0;
  padding: 10px 12px calc(16px + var(--safe-b));
  animation: sheet-in .18s ease-out;
}
.sheet-grip { width: 36px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 2px auto 10px; }
@keyframes sheet-in { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet-panel { animation: none; } }

@media (min-width: 768px) {
  .tabbar, .sheet { display: none !important; }
  .shell { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); }
  .sidenav {
    display: flex; flex-direction: column; gap: 4px;
    position: sticky; top: 0; height: 100vh;
    background: var(--ink-2); border-right: 1px solid var(--line);
    padding: 14px 10px;
  }
  .sidenav .brand-mark { justify-content: center; padding: 6px 0 16px; }
  .sidenav .brand-mark span { display: none; }
  .sidenav nav { display: flex; flex-direction: column; gap: 2px; }
  .sidenav .nav-link { flex-direction: column; gap: 4px; padding: 9px 4px; font-size: 11px; text-align: center; }
  .sidenav .nav-button { width: 100%; background: none; border: 0; cursor: pointer; font-family: inherit; }
.nav-link .soon { display: none; }
  .sidenav-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
  .content { padding: 28px 28px 48px; }
  .topbar { display: none; }
}

@media (min-width: 1200px) {
  .shell { grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .sidenav { padding: 18px 14px; }
  .sidenav .brand-mark { justify-content: flex-start; padding: 4px 10px 22px; }
  .sidenav .brand-mark span { display: inline; }
  .sidenav .nav-link { flex-direction: row; gap: 12px; padding: 9px 12px; font-size: 14px; text-align: left; }
  .sidenav .nav-button { width: 100%; background: none; border: 0; cursor: pointer; font-family: inherit; }
.nav-link .soon { display: inline; }
  .nav-section { margin: 14px 12px 4px; font-size: 12px; color: var(--paper-3); }
  .content { padding: 28px 40px 56px; max-width: 1320px; }
}
.nav-section { display: none; }
@media (min-width: 1200px) { .nav-section { display: block; } }

.sidenav-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; color: var(--paper-2); font-size: 13px; }
.sidenav-user .avatar { width: 30px; height: 30px; font-size: 12px; }
@media (max-width: 1199px) { .sidenav-user .who { display: none; } .sidenav-user { justify-content: center; } }

/* ---------- Seitenkopf ---------- */

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin-bottom: 20px; }
.page-head h1 { font-size: 22px; }
.page-head .lead { margin: 4px 0 0; color: var(--paper-2); max-width: 64ch; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (min-width: 768px) { .page-head h1 { font-size: 26px; } }

.subnav { display: flex; gap: 4px; overflow-x: auto; margin: -4px 0 20px; padding-bottom: 2px; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.subnav a { padding: 9px 12px; color: var(--paper-2); font-weight: 500; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.subnav a.is-active { color: var(--paper); border-bottom-color: var(--brass); }

/* ---------- Flächen ---------- */

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-l); }
.panel-body { padding: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 15px; }
.panel + .panel, .stack > * + * { margin-top: 16px; }
@media (min-width: 768px) { .panel-body { padding: 20px; } .panel-head { padding: 16px 20px; } }

.grid-2 { display: grid; gap: 16px; }
.grid-2 > *, .grid-main-side > *, .stack > * { min-width: 0; }
@media (min-width: 1024px) { .grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .grid-2 > .panel + .panel { margin-top: 0; } }
.grid-main-side { display: grid; gap: 16px; }
@media (min-width: 1024px) { .grid-main-side { grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); align-items: start; } .grid-main-side > .panel + .panel { margin-top: 0; } }

/* Kennzahlen */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden; }
.stat { background: var(--panel); padding: 14px 16px; }
.stat b { display: block; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--paper-2); font-size: 13px; }
@media (min-width: 768px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .stats { grid-template-columns: repeat(6, minmax(0, 1fr)); } .stat b { font-size: 28px; } }

/* Listen */
.list { list-style: none; margin: 0; padding: 0; }
.list > li + li { border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: inherit; }
a.row:hover { background: var(--panel-2); color: inherit; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { color: var(--paper-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-end { color: var(--paper-3); font-size: 13px; text-align: right; flex-shrink: 0; }
.only-s { display: none; }
@media (max-width: 599px) { .row-end.hide-s { display: none; } .only-s { display: inline; } }
@media (min-width: 768px) { .row { padding: 12px 20px; } }

/* Tabelle (ab Tablet) */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 500; color: var(--paper-2); font-size: 13px; padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr.is-link { cursor: pointer; }
.table tr.is-link:hover td { background: var(--panel-2); }

/* Avatare */
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-grid; place-items: center; flex-shrink: 0; overflow: hidden;
  background: var(--panel-2); color: var(--paper-2);
  font-size: 13px; font-weight: 600;
  box-shadow: inset 0 0 0 2px var(--party, transparent);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Abzeichen */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--panel-2); color: var(--paper-2); }
.badge-ok { background: rgba(114, 184, 132, .14); color: var(--freund); }
.badge-warn { background: rgba(224, 112, 95, .14); color: var(--feind); }
.badge-brass { background: var(--brass-soft); color: var(--brass-2); }
.tone-feind { --tone: var(--feind); }
.tone-neutral { --tone: var(--neutral); }
.tone-freund { --tone: var(--freund); }
.tone-besonders { --tone: var(--besonders); }
.tone-pro { --tone: var(--pro); }
.tone-mid { --tone: var(--mid); }
.tone-contra { --tone: var(--contra); }
.badge[class*="tone-"] { background: color-mix(in srgb, var(--tone) 15%, transparent); color: var(--tone); }

/* Bewertungsskala: das wiederkehrende Erkennungszeichen */
.scale { position: relative; height: 6px; border-radius: 3px; background: linear-gradient(90deg, rgba(224,112,95,.35) 0 37%, rgba(145,140,130,.28) 37% 63%, rgba(114,184,132,.35) 63% 100%); }
.scale-mark { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--tone, var(--brass)); box-shadow: 0 0 0 3px var(--panel); }

/* ---------- Formulare ---------- */

.form { display: grid; gap: 16px; }
.form-grid { display: grid; gap: 16px; }
@media (min-width: 768px) { .form-grid.cols-2 { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 6px; }
.field > label, .label { font-size: 13px; font-weight: 500; color: var(--paper-2); }
.hint { font-size: 13px; color: var(--paper-3); margin: 0; }
.input, .select, .textarea {
  width: 100%; font: inherit; color: var(--paper);
  background: var(--ink-2); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 10px 12px; min-height: 44px;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brass); box-shadow: 0 0 0 3px var(--brass-soft); }
.input-code { font-size: 26px; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brass); }
.choice { display: grid; gap: 8px; }
.choice label { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--radius); cursor: pointer; }
.choice input { margin-top: 3px; accent-color: var(--brass); }
.choice label:has(input:checked) { border-color: var(--brass); background: var(--brass-soft); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px; border-radius: var(--radius);
  font: 500 14px/1 var(--font); cursor: pointer; white-space: nowrap;
  background: var(--panel-2); color: var(--paper); border: 1px solid var(--line-2);
}
.btn:hover { border-color: var(--paper-3); color: var(--paper); }
.btn-primary { background: var(--brass); color: var(--brass-ink); border-color: var(--brass); font-weight: 600; }
.btn-primary:hover { background: var(--brass-2); border-color: var(--brass-2); color: var(--brass-ink); }
.btn-danger { color: var(--feind); }
.btn-danger:hover { border-color: var(--feind); color: var(--feind); }
.btn-ghost { background: none; border-color: transparent; color: var(--paper-2); }
.btn-block { width: 100%; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Schwebender Knopf (Handy) */
.fab {
  position: fixed; right: 16px; bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px); z-index: 45;
  width: 56px; height: 56px; border-radius: 18px;
  display: grid; place-items: center;
  background: var(--brass); color: var(--brass-ink);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
@media (min-width: 768px) { .fab { display: none; } }

/* ---------- Meldungen & Zustände ---------- */

.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; border: 1px solid transparent; }
.flash-success { background: rgba(114, 184, 132, .1); border-color: rgba(114, 184, 132, .3); }
.flash-error { background: rgba(224, 112, 95, .1); border-color: rgba(224, 112, 95, .35); }
.flash-info { background: rgba(143, 179, 217, .08); border-color: rgba(143, 179, 217, .3); }
.flash-success .icon { color: var(--freund); }
.flash-error .icon { color: var(--feind); }
.flash-info .icon { color: var(--info); }

.empty { text-align: center; padding: 48px 20px; color: var(--paper-2); }
.empty .icon { color: var(--paper-3); margin: 0 auto 12px; }
.empty h2 { color: var(--paper); margin-bottom: 6px; }
.empty p { max-width: 46ch; margin: 0 auto 16px; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; font-size: 14px; }
.kv dt { color: var(--paper-2); }
.kv dd { margin: 0; }
.plain-list { list-style: none; padding: 0; display: grid; gap: 4px; font-size: 14px; }

.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; }
.checklist .ok { color: var(--freund); }
.checklist .bad { color: var(--feind); }

.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; font-size: 14px; color: var(--paper-2); }

.diff { font-size: 13px; color: var(--paper-2); margin-top: 4px; }
.diff del { color: var(--feind); text-decoration: none; }
.diff ins { color: var(--freund); text-decoration: none; }

/* ---------- Ohne Navigation (Anmeldung, Installer) ---------- */

.plain {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(201,180,138,.08), transparent 60%),
    var(--ink);
}
.plain-card { width: 100%; max-width: 420px; }
.plain-card.wide { max-width: 640px; }
.plain-card .brand-mark { margin-bottom: 26px; font-size: 20px; }
.plain-card h1 { font-size: 24px; margin-bottom: 6px; }
.plain-card .lead { color: var(--paper-2); margin-bottom: 22px; }
.steps { display: flex; gap: 6px; margin-bottom: 22px; }
.steps span { flex: 1; height: 4px; border-radius: 2px; background: var(--line-2); }
.steps span.is-done { background: var(--brass); }

.qr { background: #fff; padding: 12px; border-radius: var(--radius); width: max-content; }
.qr svg, .qr img { display: block; width: 184px; height: 184px; }
.secret { font-size: 15px; letter-spacing: .12em; word-break: break-all; }

/* ==========================================================================
   Meilenstein 2: Listen, Detailansichten, Formulare
   ========================================================================== */

/* Liste und Detail nebeneinander (ab 1024 px) */
.split { display: block; }
.split-list { min-width: 0; }
.split-detail { min-width: 0; }
.split.is-index .split-detail { display: none; }
.split.is-detail .split-list { display: none; }
@media (min-width: 1024px) {
  .split { display: grid; grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); gap: 24px; align-items: start; }
  .split.is-index .split-detail, .split.is-detail .split-list { display: block; }
  .split-list { position: sticky; top: 24px; max-height: calc(100vh - 48px); display: flex; flex-direction: column; }
  .split-list .panel { display: flex; flex-direction: column; min-height: 0; }
  .split-list .list-scroll { overflow-y: auto; min-height: 0; }
  .split-list .page-head { margin-bottom: 14px; }
  .split .detail-back { display: none; }
}
@media (min-width: 1200px) { .split { grid-template-columns: minmax(320px, 380px) minmax(0, 1fr); gap: 28px; } }
.split-detail.is-loading { opacity: .55; transition: opacity .15s; }
.detail-empty { padding: 72px 24px; text-align: center; color: var(--paper-3); border: 1px dashed var(--line-2); border-radius: var(--radius-l); }

/* Filterleiste */
.filters { display: grid; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); }
.filters-row { display: flex; gap: 8px; }
.filters-row > * { flex: 1; min-width: 0; }
.search-input { position: relative; }
.search-input .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--paper-3); pointer-events: none; }
.search-input .input { padding-left: 38px; }
.select-sm, .input-sm { min-height: 38px; padding: 7px 10px; font-size: 14px; }
.list-meta { padding: 8px 16px; font-size: 13px; color: var(--paper-3); border-bottom: 1px solid var(--line); }
.row.is-active { background: var(--brass-soft); }
.row.is-active .row-title { color: var(--brass-2); }
.more-row { padding: 12px 16px; text-align: center; }

/* Chips und Schlagworte */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--panel-2); color: var(--paper); font-size: 13px; border: 1px solid var(--line-2); max-width: 100%; }
.chip .avatar { width: 22px; height: 22px; font-size: 10px; }
.chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.chip:hover { border-color: var(--paper-3); color: var(--paper); }
.chip-plain { padding: 4px 10px; }
.chip button { background: none; border: 0; color: var(--paper-3); cursor: pointer; padding: 0 0 0 2px; font-size: 16px; line-height: 1; }
.chip button:hover { color: var(--feind); }
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13px; color: var(--paper-2); }
.seg input:checked + span { border-color: var(--brass); color: var(--brass-2); background: var(--brass-soft); }
.seg input:focus-visible + span { outline: 2px solid var(--brass); outline-offset: 2px; }

/* Dossier-Kopf einer Person oder Gruppe */
.dossier { position: relative; display: flex; gap: 16px; align-items: flex-start; padding: 18px; border-radius: var(--radius-l); background: var(--panel); border: 1px solid var(--line); overflow: hidden; }
.dossier::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--party, var(--line-2)); }
.dossier .avatar { width: 72px; height: 72px; font-size: 22px; }
.dossier-main { flex: 1; min-width: 0; }
.dossier h1 { font-size: 24px; letter-spacing: -0.02em; word-break: break-word; }
.dossier .aka { color: var(--paper-2); font-size: 14px; margin-top: 2px; }
.dossier-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.dossier-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.dossier .logo { width: 72px; height: 72px; border-radius: var(--radius); background: #fff; object-fit: contain; padding: 6px; flex-shrink: 0; }
.dossier .logo-ph { width: 72px; height: 72px; border-radius: var(--radius); display: grid; place-items: center; background: var(--panel-2); color: var(--paper-2); font-weight: 600; font-size: 20px; flex-shrink: 0; }
@media (min-width: 768px) { .dossier { padding: 22px 24px; gap: 20px; } .dossier h1 { font-size: 30px; } .dossier .avatar, .dossier .logo, .dossier .logo-ph { width: 88px; height: 88px; } }
.party-badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; background: color-mix(in srgb, var(--party, #888) 16%, transparent); color: color-mix(in srgb, var(--party, #888) 55%, var(--paper)); }
.party-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--party, #888); }
.tendency { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--paper-2); }
.tendency i { width: 14px; height: 6px; border-radius: 2px; background: var(--line-2); display: inline-block; }
.tendency i.on { background: var(--paper-2); }
.tendency b { font-weight: 500; margin-left: 6px; }

.section { margin-top: 20px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 2px 10px; }
.section-head h2 { font-size: 16px; }
.section-head .count { color: var(--paper-3); font-weight: 400; margin-left: 6px; }
.prose { white-space: pre-line; color: var(--paper); line-height: 1.6; }

/* Beziehungszeile mit Skala */
.rel-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 12px 16px; color: inherit; }
a.rel-row:hover { background: var(--panel-2); color: inherit; }
.rel-row .scale { grid-column: 2 / 4; margin-top: 2px; }
.rel-row .snippet { grid-column: 2 / 4; color: var(--paper-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 768px) { .rel-row { padding: 12px 20px; } }

details.fold { border-top: 1px solid var(--line); }
details.fold:first-child { border-top: 0; }
details.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: ""; width: 8px; height: 8px; border-right: 1.6px solid var(--paper-3); border-bottom: 1.6px solid var(--paper-3); transform: rotate(45deg); margin-left: auto; transition: transform .15s; }
details.fold[open] > summary::after { transform: rotate(-135deg); }
details.fold > .fold-body { padding: 0 16px 14px; }
@media (min-width: 768px) { details.fold > summary { padding: 12px 20px; } details.fold > .fold-body { padding: 0 20px 16px; } }

/* Einträge */
.entry { padding: 14px 16px; }
.entry + .entry { border-top: 1px solid var(--line); }
.entry.is-ended { opacity: .62; }
.entry-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 8px; }
.entry-head .when { color: var(--paper-3); font-size: 13px; margin-left: auto; }
.entry-who { font-weight: 500; margin-bottom: 6px; }
.entry-text { white-space: pre-line; line-height: 1.55; }
.entry-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 13px; color: var(--paper-3); }
.entry-sources { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.entry-sources li { display: flex; gap: 8px; align-items: baseline; }
.entry-sources .kind { color: var(--paper-3); flex-shrink: 0; }
@media (min-width: 768px) { .entry { padding: 16px 20px; } }
.rel-hidden { display: none; }
.badge-rel-gesichert { display: none; }
.badge-rel { border: 1px dashed var(--line-2); background: none; color: var(--paper-2); }

/* Paar-Kopf */
.pair-head { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: center; padding: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-l); }
.pair-person { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; color: var(--paper); font-weight: 600; min-width: 0; }
.pair-person .avatar { width: 56px; height: 56px; font-size: 18px; }
.pair-person span { word-break: break-word; }
.pair-mid { color: var(--paper-3); }
.pair-score { grid-column: 1 / -1; display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.pair-score .scale { height: 8px; }
.pair-score .scale-mark { width: 16px; height: 16px; margin: -8px 0 0 -8px; }
.pair-score-label { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.pair-score-label strong { font-size: 18px; }
.scale-legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--paper-3); }
@media (min-width: 768px) { .pair-head { padding: 24px 28px; } .pair-person .avatar { width: 72px; height: 72px; } }

/* Auswahlfeld mit Suche */
.picker { position: relative; }
.picker-list {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px);
  background: var(--ink-2); border: 1px solid var(--line-2); border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0,0,0,.45); max-height: 320px; overflow-y: auto; padding: 4px;
}
.picker-opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-s); cursor: pointer; }
.picker-opt .avatar { width: 30px; height: 30px; font-size: 11px; }
.picker-opt.is-hl { background: var(--panel-2); }
.picker-opt small { display: block; color: var(--paper-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-opt .t { min-width: 0; }
.picker-opt.new { color: var(--brass-2); }
.picker-head { padding: 6px 10px 2px; font-size: 12px; color: var(--paper-3); }
.picker-empty { padding: 10px; color: var(--paper-3); font-size: 14px; }
.picker-chips { margin-top: 8px; }
.picker-selected { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 8px; min-height: 44px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--ink-2); }
.picker-selected .avatar { width: 30px; height: 30px; font-size: 11px; }
.picker-selected .name { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-selected .is-new { color: var(--brass-2); font-size: 12px; font-weight: 400; }

/* Gewichtung und Vorschau */
.range { width: 100%; accent-color: var(--brass); }
.preview { display: grid; gap: 8px; padding: 14px; border-radius: var(--radius); background: var(--ink-2); border: 1px solid var(--line); }
.preview-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; align-items: center; font-size: 13px; }
.preview-row span:first-child { color: var(--paper-3); }
.preview-label { font-size: 13px; margin-top: 4px; }

/* Quellen-Wiederholer */
.source-item { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--ink-2); }
.source-item + .source-item { margin-top: 8px; }
@media (min-width: 768px) { .source-item { grid-template-columns: 160px 1fr 1fr; } .source-item .span-all { grid-column: 1 / -1; } }

/* Mitgliederliste */
.member-row { display: flex; align-items: center; gap: 10px; padding: 10px 16px; }
.member-row + .member-row { border-top: 1px solid var(--line); }
.member-row .row-main a { color: var(--paper); font-weight: 500; }
.member-actions summary { list-style: none; cursor: pointer; color: var(--paper-3); padding: 6px; border-radius: var(--radius-s); }
.member-actions summary::-webkit-details-marker { display: none; }
.member-actions[open] summary { color: var(--paper); background: var(--panel-2); }
.member-actions .pop { position: absolute; right: 12px; z-index: 20; margin-top: 6px; width: min(320px, calc(100vw - 48px)); padding: 14px; background: var(--ink-2); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0,0,0,.45); }
.member-row { position: relative; }
@media (min-width: 768px) { .member-row { padding: 10px 20px; } }

/* Gruppenkarten in Listen */
.glogo { width: 40px; height: 40px; border-radius: var(--radius-s); background: #fff; object-fit: contain; padding: 3px; flex-shrink: 0; }
.glogo-ph { width: 40px; height: 40px; border-radius: var(--radius-s); display: grid; place-items: center; background: var(--panel-2); color: var(--paper-2); font-size: 12px; font-weight: 600; flex-shrink: 0; }

/* Schnellsuche in der Seitenleiste */
.side-search { position: relative; margin: 0 2px 12px; }
.side-search .input { min-height: 38px; padding: 7px 10px 7px 34px; font-size: 14px; background: var(--panel); }
.side-search .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--paper-3); pointer-events: none; }
@media (max-width: 1199px) { .side-search { display: none; } }
.topbar-search { display: inline-grid; }

/* Startseite: Schnellaktionen */
.quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick a { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: var(--radius-l); background: var(--panel); border: 1px solid var(--line); color: var(--paper); font-weight: 500; }
.quick a .icon { color: var(--brass); }
.quick a:hover { border-color: var(--line-2); color: var(--paper); }
.quick a.primary { background: var(--brass); color: var(--brass-ink); border-color: var(--brass); }
.quick a.primary .icon { color: var(--brass-ink); }
@media (min-width: 768px) { .quick { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.home-search { margin-bottom: 16px; }
.home-search .input { min-height: 50px; font-size: 16px; }
@media (min-width: 1200px) { .home-search { display: none; } }

.split-detail { container-type: inline-size; }
.detail-cols { display: block; }
@container (min-width: 860px) {
  .detail-cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(260px, 1fr); gap: 20px; align-items: start; }
}
.member-row .glogo, .member-row .glogo-ph { width: 34px; height: 34px; }

/* Mitgliederraster: ab breiter Detailspalte zweispaltig */
.member-grid { display: grid; }
.member-grid > .member-row[hidden] { display: none; }
@container (min-width: 700px) {
  .member-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .member-grid > .member-row { border-top: 1px solid var(--line); }
  .member-grid > .member-row:nth-child(-n+2) { border-top: 0; }
}
.member-filter { width: min(240px, 50%); min-height: 34px; }
.chip .faint { color: var(--paper-3); }
/* Mobil führt der Zurück-Pfeil in der Kopfleiste zurück */
@media (max-width: 767px) { .detail-back { display: none; } }

/* ==========================================================================
   Netz (M3): Bühne mit Sigma, Bedienleiste, Karte, Zeitregler und Seitenleiste.
   Handy: Leiste als Blatt von unten. Tablet: Leiste von rechts. Desktop ab 1024: fest rechts.
   ========================================================================== */
body.page-network { overflow: hidden; }
body.page-network .content { padding: 0; max-width: none; height: calc(100vh - var(--topbar-h) - var(--tabbar-h) - var(--safe-b)); height: calc(100dvh - var(--topbar-h) - var(--tabbar-h) - var(--safe-b)); }
body.page-network .content { position: relative; }
body.page-network .content > .flash { position: absolute; z-index: 70; left: 12px; right: 12px; top: 12px; }
@media (min-width: 768px) { body.page-network .content { height: 100vh; height: 100dvh; } }
.net { position: relative; height: 100%; display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) { .net { grid-template-columns: minmax(0, 1fr) 340px; } }
@media (min-width: 1200px) { .net { grid-template-columns: minmax(0, 1fr) 360px; } }

.net-stage { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: radial-gradient(ellipse at 50% 40%, #1c2129 0%, var(--ink) 72%); }
.net-canvas { position: absolute; inset: 0; }
.net.is-pointing .net-canvas { cursor: pointer; }
.net-glass { background: rgba(32, 37, 44, .9); border: 1px solid var(--line-2); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

.net-bar { position: absolute; z-index: 8; top: 12px; left: 12px; right: 12px; display: flex; gap: 8px; align-items: flex-start; pointer-events: none; }
.net-bar > * { pointer-events: auto; }
.net-search { position: relative; flex: 1 1 auto; max-width: 420px; }
.net-search > .icon { position: absolute; left: 12px; top: 13px; color: var(--paper-3); pointer-events: none; z-index: 1; }
.net-search .input { padding-left: 36px; min-height: 42px; background: rgba(32, 37, 44, .92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.net-panel-btn { min-height: 42px; background: rgba(32, 37, 44, .92); flex-shrink: 0; }
@media (max-width: 479px) { .net-panel-btn span { display: none; } }
@media (min-width: 1024px) { .net-panel-btn { display: none; } }

.net-zoom { position: absolute; z-index: 7; right: 12px; top: 64px; display: flex; flex-direction: column; gap: 6px; }
.net-zoom button { width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--radius); background: rgba(32, 37, 44, .92); border: 1px solid var(--line-2); color: var(--paper); cursor: pointer; }
.net-zoom button:hover { border-color: var(--brass); color: var(--brass-2); }

.net-legend { position: absolute; z-index: 6; left: 12px; bottom: 70px; display: flex; flex-wrap: wrap; gap: 6px 12px; max-width: calc(100% - 24px); padding: 6px 10px; border-radius: var(--radius); background: rgba(21, 24, 29, .72); font-size: 12px; color: var(--paper-2); pointer-events: none; }
.net-legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.net-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.net-legend i.ln { width: 16px; height: 3px; border-radius: 2px; }
.net-legend i.sq { border-radius: 2px; background: #b4a37c; }
.net.has-card .net-legend { display: none; }
@media (min-width: 1024px) { .net.has-card .net-legend { display: flex; } }

.net-status { position: absolute; z-index: 9; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 10px 16px; border-radius: var(--radius); background: rgba(32, 37, 44, .95); border: 1px solid var(--line-2); color: var(--paper-2); font-size: 14px; max-width: calc(100% - 32px); text-align: center; }

.net-card { position: absolute; z-index: 9; left: 12px; right: 12px; bottom: 70px; max-height: calc(100% - 150px); overflow-y: auto; padding: 14px 14px 12px; border-radius: var(--radius-l); background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 16px 40px rgba(0, 0, 0, .5); }
@media (min-width: 600px) { .net-card { right: auto; width: 380px; } }
@media (min-width: 1024px) { .net-card { top: 64px; bottom: auto; max-height: calc(100% - 150px); } }
.net-card-x { position: absolute; top: 6px; right: 6px; }
.net-card-head { display: flex; align-items: center; gap: 12px; padding-right: 30px; }
.net-card-head .avatar { flex-shrink: 0; }
.net-card-head .glogo, .net-card-head .glogo-ph { width: 44px; height: 44px; }
.net-card-pair .avatar + .avatar { margin-left: -18px; box-shadow: 0 0 0 2px var(--panel); }
.net-card-title { min-width: 0; }
.net-card-title strong { display: block; font-size: 16px; line-height: 1.3; }
.net-card-title .muted { font-size: 13px; }
.net-card-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; }
.net-card-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; }
.net-card-list button { background: none; border: 0; padding: 2px 0; color: var(--paper); font: inherit; cursor: pointer; text-align: left; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.net-card-list button:hover { color: var(--brass-2); }
.net-card-chips { margin-top: 10px; }
.net-card-chips .chip { cursor: pointer; font: inherit; font-size: 13px; }
.net-card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.net-card .scale { margin-top: 10px; }

.net-time { position: absolute; z-index: 8; left: 12px; right: 12px; bottom: 12px; display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; border-radius: var(--radius-l); background: rgba(32, 37, 44, .92); border: 1px solid var(--line-2); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.net-time .range { flex: 1 1 auto; min-width: 0; }
.net-time output { min-width: 84px; text-align: right; font-size: 14px; color: var(--paper-2); }
.net-time.is-past { border-color: var(--brass); }
.net-time.is-past output { color: var(--brass-2); font-weight: 600; }
.net-time:not(.is-past) [data-net-today] { visibility: hidden; }
@media (min-width: 1024px) { .net-time { left: 50%; right: auto; width: min(640px, calc(100% - 24px)); transform: translateX(-50%); } }

/* Seitenleiste */
.net-panel { background: var(--ink-2); overflow-y: auto; overscroll-behavior: contain; }
.net-panel-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 12px 12px 10px 16px; background: var(--ink-2); border-bottom: 1px solid var(--line); }
.net-tabs { display: flex; gap: 4px; flex: 1; }
.net-tabs button { flex: 1; padding: 8px 6px; border-radius: var(--radius-s); border: 0; background: none; color: var(--paper-2); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
.net-tabs button[aria-selected="true"] { background: var(--panel-2); color: var(--paper); }
.net-sec { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.net-sec h3 { font-size: 13px; font-weight: 600; color: var(--paper-2); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; }
.net-sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.net-sec .check { font-size: 14px; margin-top: 6px; }
.net-sec .hint { font-size: 13px; }
.seg-sm span { padding: 5px 11px; font-size: 13px; }
.net-ego { margin-top: 10px; }
.net-mini { font-size: 12px; color: var(--paper-3); }
.net-mini button { background: none; border: 0; padding: 0; color: var(--brass); font: inherit; cursor: pointer; }
.net-checklist { display: grid; gap: 2px; max-height: 260px; overflow-y: auto; }
.net-checklist .check { margin-top: 4px; }
.net-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-toggle { cursor: pointer; font: inherit; font-size: 13px; padding: 4px 10px; }
.chip-toggle[aria-pressed="false"] { opacity: .45; background: none; }
.chip-toggle[aria-pressed="false"] span { text-decoration: line-through; }
.net-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

.net-path { display: block; width: 100%; text-align: left; margin-top: 8px; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--panel); color: var(--paper); font: inherit; cursor: pointer; }
.net-path.is-active { border-color: var(--brass); background: var(--brass-soft); }
.net-path-head { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; margin-bottom: 6px; }
.net-steps { list-style: none; margin: 0; padding: 0 0 0 12px; border-left: 2px solid var(--line-2); display: grid; gap: 4px; font-size: 14px; }
.net-path.is-active .net-steps { border-left-color: var(--brass); }
.net-steps li { position: relative; }
.net-steps li::before { content: ""; position: absolute; left: -17px; top: .55em; width: 8px; height: 8px; border-radius: 50%; background: var(--paper-3); }
.net-path.is-active .net-steps li::before { background: var(--brass); }
.net-step-via { display: block; margin: 0 0 2px; }
.net-step-via .badge { font-size: 11px; }

.net-rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.net-rank button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 4px; background: none; border: 0; border-radius: var(--radius-s); color: var(--paper); font: inherit; text-align: left; cursor: pointer; }
.net-rank button:hover { background: var(--panel); }
.net-rank button > span:not(.avatar):not(.net-meter) { display: grid; min-width: 0; flex: 1; font-size: 14px; }
.net-rank small { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.net-meter { width: 54px; height: 4px; border-radius: 2px; background: var(--panel-2); flex-shrink: 0; overflow: hidden; }
.net-meter span { display: block; height: 100%; background: var(--brass); }
.net-camp { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 8px 6px; border: 1px solid transparent; border-radius: var(--radius); background: none; color: var(--paper); font: inherit; text-align: left; cursor: pointer; }
.net-camp:hover { background: var(--panel); }
.net-camp.is-active { border-color: var(--brass); background: var(--brass-soft); }
.net-swatch { width: 14px; height: 14px; border-radius: 50%; margin-top: 3px; flex-shrink: 0; }
.net-camp-main { display: grid; min-width: 0; font-size: 14px; }
.net-camp-main small { font-size: 12px; }
.net-conf { color: var(--feind); }
.net-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; }
.net-stats div { padding: 8px 10px; border-radius: var(--radius); background: var(--panel); }
.net-stats dt { font-size: 12px; color: var(--paper-3); }
.net-stats dd { margin: 0; font-size: 17px; font-weight: 600; }

/* Leiste als Blatt (Handy) bzw. Schublade (Tablet) */
.net-backdrop { position: fixed; inset: 0; z-index: 58; background: rgba(0, 0, 0, .45); }
@media (max-width: 1023px) {
  .net-panel { position: fixed; z-index: 60; border: 1px solid var(--line-2); box-shadow: 0 -12px 40px rgba(0, 0, 0, .5); transition: transform .22s ease; }
}
@media (max-width: 767px) {
  .net-panel { left: 0; right: 0; bottom: 0; max-height: 82vh; max-height: 82dvh; border-radius: var(--radius-l) var(--radius-l) 0 0; transform: translateY(105%); padding-bottom: var(--safe-b); }
  .net-panel.is-open { transform: none; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .net-panel { top: 0; right: 0; bottom: 0; width: 360px; transform: translateX(105%); }
  .net-panel.is-open { transform: none; }
}
@media (min-width: 1024px) {
  .net-panel { border-left: 1px solid var(--line); }
  .net-panel-x, .net-backdrop { display: none !important; }
}
.net-sec .field { margin-top: 10px; }
.net-sec > .hint:first-child { margin-bottom: 4px; }

/* ==========================================================================
   M4: Ereignisse, Themen, Zeitachse
   ========================================================================== */
.date-tile { width: 44px; min-height: 46px; padding: 3px 0; flex-shrink: 0; display: grid; place-items: center; align-content: center; gap: 0; border-radius: var(--radius-s); background: var(--panel-2); border: 1px solid var(--line-2); line-height: 1.05; text-align: center; }
.date-tile b { font-size: 17px; font-weight: 600; color: var(--paper); }
.date-tile small { font-size: 10px; color: var(--paper-3); letter-spacing: .02em; white-space: nowrap; }
.date-tile:not(.date-tile-lg) small span { display: block; }
.date-tile.is-future { border-color: var(--brass); }
.date-tile.is-future b { color: var(--brass-2); }
.date-tile.is-empty { color: var(--paper-3); font-size: 18px; }
.date-tile-lg { width: 72px; min-height: 72px; border-radius: var(--radius); }
.date-tile-lg b { font-size: 28px; }
.date-tile-lg small { font-size: 12px; }
@media (min-width: 768px) { .dossier .date-tile-lg { width: 88px; min-height: 88px; } }
a.event-row { color: inherit; }
a.event-row:hover { background: var(--panel-2); }
a.event-row .row-title { color: var(--paper); font-weight: 500; }

.topic-dot { width: 14px; height: 14px; border-radius: 4px; background: var(--topic, var(--brass)); flex-shrink: 0; box-shadow: 0 0 0 3px color-mix(in srgb, var(--topic, var(--brass)) 22%, transparent); }
.topic-dot-lg { width: 56px; height: 56px; border-radius: var(--radius); box-shadow: none; background: linear-gradient(135deg, var(--topic), color-mix(in srgb, var(--topic) 55%, var(--ink))); }
@media (min-width: 768px) { .topic-dot-lg { width: 72px; height: 72px; } }
.row .topic-dot { margin: 0 6px 0 4px; }

.stance-bar { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; }
.stance-track { flex: 1 1 auto; display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--panel-2); min-width: 60px; }
.stance-track span { display: block; height: 100%; }
.stance-track .is-pro { background: var(--pro); }
.stance-track .is-neutral { background: var(--mid); opacity: .55; }
.stance-track .is-contra { background: var(--contra); }
.stance-nums { font-size: 12px; color: var(--paper-3); white-space: nowrap; }
.stance-nums b { font-weight: 600; }
.stance-nums .is-pro { color: var(--pro); }
.stance-nums .is-contra { color: var(--contra); }
.row-sub .stance-bar { margin-top: 4px; max-width: 240px; }

.party-bars { display: grid; gap: 10px; }
.party-bar { display: grid; grid-template-columns: minmax(90px, 160px) minmax(0, 1fr); gap: 12px; align-items: center; font-size: 14px; }
.party-bar-label { display: flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.stance-cols { display: grid; gap: 14px; }
@container (min-width: 1100px) {
  .stance-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
  .stance-cols .member-grid { grid-template-columns: minmax(0, 1fr); }
  .stance-cols .member-grid > .member-row:nth-child(2) { border-top: 1px solid var(--line); }
}
.stance-col .panel-head { padding: 12px 16px; }
.stance-col .panel-head h3 { font-size: 14px; }
.stance-pro .panel-head h3 { color: var(--pro); }
.stance-contra .panel-head h3 { color: var(--contra); }
.stance-row { align-items: flex-start; }
.stance-row .avatar { margin-top: 2px; }
.stance-row .row-sub { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; margin-top: 2px; }
.row-note { font-size: 13px; color: var(--paper-2); margin-top: 4px; }
.row-history { font-size: 12px; color: var(--paper-3); margin-top: 4px; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.stance-badge.is-strong { font-weight: 600; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 45%, transparent); }
.stance-seg .tone-pro, .stance-seg .tone-contra, .stance-seg .tone-mid { color: var(--paper-2); }
.stance-seg input:checked + [class*="tone-"] { border-color: var(--tone); color: var(--tone); background: color-mix(in srgb, var(--tone) 13%, transparent); }
.stance-seg input:checked + .tone-mid { color: var(--paper); }
.seg-link { display: inline-block; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13px; color: var(--paper-2); }
button.seg-link { background: transparent; font: inherit; font-size: 13px; cursor: pointer; }
.seg-link.is-active { border-color: var(--brass); color: var(--brass-2); background: var(--brass-soft); }
.fold-inline summary { cursor: pointer; font-size: 14px; list-style: none; }
.fold-inline summary::-webkit-details-marker { display: none; }
.fold-inline summary::before { content: "+ "; }
.fold-inline[open] summary::before { content: "– "; }

/* Verlaufskurve einer Beziehung */
.curve { display: grid; grid-template-columns: 40px minmax(0, 1fr); grid-template-rows: 170px 24px; }
.curve-y { position: relative; margin-top: 8px; }
.curve-y span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11px; color: var(--paper-3); }
.curve-plot { position: relative; margin: 8px 10px 0 0; }
.curve-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.curve .band { opacity: .09; }
.curve .band-feind { fill: var(--feind); }
.curve .band-neutral { fill: var(--neutral); opacity: .05; }
.curve .band-freund { fill: var(--freund); }
.curve .band-besonders { fill: var(--besonders); }
.curve .zero { stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 3 4; }
.curve .line { fill: none; stroke: var(--paper-2); stroke-width: 2; stroke-linejoin: round; }
.curve-pt { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--tone, var(--brass)); box-shadow: 0 0 0 2px var(--panel); }
.curve-pt::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; }
.curve-pt.is-last { width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px; }
.curve-pt:hover { box-shadow: 0 0 0 2px var(--paper); }
.curve-pt.is-end { background: var(--panel); box-shadow: inset 0 0 0 2px var(--paper-2); }
.curve-val { position: absolute; right: 16px; transform: translateY(-130%); font-size: 13px; font-weight: 600; color: var(--paper); }
.curve-x { grid-column: 2; display: flex; justify-content: space-between; align-items: flex-end; padding-right: 10px; font-size: 11px; color: var(--paper-3); }

/* Zeitachse */
.timeline { display: grid; gap: 22px; max-width: 900px; }
.tl-year-head { font-size: 15px; color: var(--paper-2); margin-bottom: 8px; position: sticky; top: 0; }
.tl-list { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); display: grid; gap: 4px; }
.tl-item { position: relative; display: grid; grid-template-columns: 1fr; gap: 2px 14px; padding: 10px 14px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
@media (min-width: 768px) { .tl-item { grid-template-columns: 112px minmax(0, 1fr); } }
.tl-dot { position: absolute; left: -26px; top: 16px; width: 12px; height: 12px; border-radius: 50%; background: var(--tone, var(--paper-3)); box-shadow: 0 0 0 3px var(--ink); }
.tl-item.tone-brass { --tone: var(--brass); }
.tl-item.tone-info { --tone: var(--info); }
.tl-when { font-size: 13px; color: var(--paper-2); padding-top: 1px; }
.tl-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.tl-head a { color: var(--paper); font-weight: 500; }
.tl-kind { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--paper-3); }
.tl-text { font-size: 14px; color: var(--paper-2); margin-top: 4px; }
.tl-sub { font-size: 13px; margin-top: 2px; }
.tl-entry_end, .tl-member_end { background: transparent; }

/* ==========================================================================
   M5: Import & Export, Druck
   ========================================================================== */
.map-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.map-col { display: grid; gap: 6px; min-width: 0; }
.map-col label { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-summary { margin-bottom: 14px; }
.import-row { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 6px 12px; padding: 12px 16px; align-items: start; }
.import-row + .import-row { border-top: 1px solid var(--line); }
.import-row[hidden] { display: none; }
.import-line { font-size: 12px; padding-top: 3px; text-align: right; }
.import-row .row-title { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.import-row .row-note .icon { vertical-align: -2px; color: var(--feind); }
.import-decision { grid-column: 2; }
.import-decision .select { min-height: 38px; width: 100%; max-width: 320px; }
@media (min-width: 760px) {
  .import-row { grid-template-columns: 40px minmax(0, 1fr) 260px; }
  .import-decision { grid-column: 3; }
}
.sticky-actions { position: sticky; bottom: calc(var(--tabbar-h) + 8px); z-index: 5; margin-top: 16px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .35); flex-wrap: wrap; align-items: center; }
@media (min-width: 768px) { .sticky-actions { bottom: 12px; } }

/* ==========================================================================
   M6: App (PWA)
   ========================================================================== */
.offline-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + 10px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  display: flex; gap: 8px; align-items: center; max-width: min(560px, calc(100vw - 24px)); padding: 10px 14px; border-radius: var(--radius);
  background: #2a2417; border: 1px solid var(--brass); color: var(--paper); font-size: 13px; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); }
.offline-bar .icon { color: var(--brass-2); flex-shrink: 0; }
.offline-bar[hidden] { display: none; }
@media (min-width: 768px) { .offline-bar { bottom: 16px; } }
.offline-list .row { display: block; padding: 10px 0; color: var(--paper); }
/* Als App gestartet: oben Platz für die Statusleiste (iOS, durchscheinend) */
.is-app .topbar { padding-top: env(safe-area-inset-top, 0px); height: calc(var(--topbar-h) + env(safe-area-inset-top, 0px)); }
.is-app .sidenav { padding-top: calc(env(safe-area-inset-top, 0px) + 20px); }

/* ==========================================================================
   2.1: Untergruppen, Multiplikatoren, eigene Wege, mehr Wege
   ========================================================================== */
.member-inherited { padding-left: 34px; }
.member-inherited .glogo, .member-inherited .glogo-ph { width: 28px; height: 28px; }
.member-inherited .row-sub { color: var(--paper-3); }
.badge-mult { background: var(--brass-soft); color: var(--brass-2); }
.mult-line { margin-top: 6px; font-size: 14px; color: var(--paper-2); }
.mult-line .icon { color: var(--brass); vertical-align: -3px; margin-right: 4px; }

/* Netz: Wege */
.net-path-via { display: block; font-size: 13px; color: var(--paper-2); line-height: 1.4; }
.net-path .net-path-head { margin-bottom: 4px; }
.net-pathmode { width: 100%; }
.net-pathmode label { flex: 1; }
.net-pathmode small { font-size: 11px; margin-left: 2px; }

/* Netz: eigener Weg */
.net-buildbar { position: absolute; z-index: 9; left: 12px; right: 66px; top: 64px; display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border-radius: var(--radius-l); background: rgba(42, 36, 23, .95); border: 1px solid var(--brass); color: var(--paper); font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); }
.net-buildbar [data-buildbar-text] { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.net-buildbar[hidden] { display: none; }
@media (min-width: 1024px) { .net-buildbar { left: 50%; right: auto; width: min(560px, calc(100% - 24px)); transform: translateX(-50%); } }
.is-building .net-canvas { cursor: crosshair; }
.net-build-list { list-style: none; margin: 0 0 8px; padding: 0 0 0 12px; border-left: 2px solid var(--brass); display: grid; gap: 2px; }
.net-build-step { position: relative; }
.net-build-step::before { content: ""; position: absolute; left: -17px; top: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--brass); }
.net-build-step button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px 4px; background: none; border: 0; border-radius: var(--radius-s); color: var(--paper); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.net-build-step button:hover { background: var(--panel); }
.net-build-link { padding: 0 0 0 4px; }
.net-build-link .badge { font-size: 11px; }
.net-build-link.is-gap .badge { background: rgba(232, 102, 79, .14); color: #e8664f; }
.net-build-save { margin-top: 12px; display: grid; gap: 8px; }
.net-build-save .field { margin: 0; }
.net-saved { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.net-saved li { display: flex; align-items: flex-start; gap: 4px; border: 1px solid var(--line-2); border-radius: var(--radius); }
.net-saved li.is-active { border-color: var(--brass); background: var(--brass-soft); }
.net-saved-main { flex: 1; min-width: 0; display: grid; gap: 2px; padding: 8px 10px; background: none; border: 0; color: var(--paper); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.net-saved-main small { font-size: 12px; }
.net-saved .icon-btn { margin: 4px; }

/* Netz: Reichweite */
.net-reach-sum { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--paper-2); }
.net-reach-sum strong { font-size: 26px; font-weight: 600; color: var(--paper); }
.net-reach-meter { width: 100%; height: 6px; margin: 8px 0 4px; }
.net-reach-meter span { background: #5fa8d3; }
.net-reach-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.net-reach-row { display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 2px; border-radius: var(--radius); border: 1px solid transparent; }
.net-reach-row.is-on { border-color: rgba(224, 178, 82, .45); background: rgba(224, 178, 82, .07); }
.net-reach-check { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; cursor: pointer; }
.net-reach-check input { width: 18px; height: 18px; accent-color: #e0b252; }
.net-reach-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 4px; background: none; border: 0; border-radius: var(--radius-s); color: var(--paper); font: inherit; text-align: left; cursor: pointer; }
.net-reach-main:hover { background: var(--panel); }
.net-reach-main > span:last-child { display: grid; min-width: 0; font-size: 14px; }
.net-reach-main small { font-size: 12px; overflow-wrap: anywhere; }
.net-reach-gain { font-size: 13px; font-weight: 600; color: #5fa8d3; flex-shrink: 0; min-width: 36px; text-align: right; }
.net-reach-way { flex-shrink: 0; padding-left: 8px; padding-right: 8px; }
.net-rank a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 4px; border-radius: var(--radius-s); color: var(--paper); }
.net-rank a:hover { background: var(--panel); }
.net-rank a > span:last-child { display: grid; min-width: 0; flex: 1; font-size: 14px; }
.mult-star { color: var(--brass); font-size: 12px; margin-left: 2px; }
.mult-fields { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.net-gaps { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
