/* ==========================================================================
   TRP Dashboard – INX InvestingExperts
   Farben: INX-Navy/Gold; Diagrammfarben mit dem Dataviz-Validator geprüft
   (hell gegen #ffffff, dunkel gegen #101d30).
   ========================================================================== */

:root {
  color-scheme: light;
  --font: "Source Sans 3", "Source Sans Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Lora", Georgia, "Times New Roman", serif;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 7px;

  --bg: #f2f4f7;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #eef1f5;
  --border: #e3e7ed;
  --border-strong: #cdd4dd;
  --ink: #13202e;
  --ink-2: #3d4b5a;
  --muted: #5b6773;
  --grid: #e9ecf1;
  --axis: #c9d0d9;

  --navy: #002f5d;
  --deep: #011a34;
  --gold: #c9a75a;
  --gold-ink: #8a6a1f;
  --gold-soft: #f7f0e1;
  --accent: #002f5d;
  --accent-hover: #0b3f75;
  --accent-ink: #ffffff;
  --link: #1b729a;
  --focus: #2a78d6;

  --pos: #127a3a;
  --pos-bg: #e6f4eb;
  --neg: #c2323b;
  --neg-bg: #fbe9ea;
  --warn: #8f5500;
  --warn-bg: #fdf0da;
  --info: #1d5fa8;
  --info-bg: #e8f1fb;

  --s-me: #2a78d6;
  --s-inx: #c08a1e;
  --d-megatrend: #0f988c;
  --d-smartmoney: #7059d6;
  --d-ipo: #d9467e;
  --d-reserve: #a9b3bf;
  --bar: #2a78d6;
  --bar-track: #dbe7f6;

  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 10px rgba(16, 24, 40, .05);
  --shadow-lg: 0 30px 80px rgba(1, 26, 52, .28);
  --scrim: rgba(1, 17, 34, .45);

  --sidebar-bg: linear-gradient(180deg, #002f5d 0%, #011a34 100%);
  --sidebar-ink: rgba(255, 255, 255, .74);
  --sidebar-ink-strong: #ffffff;
  --sidebar-hover: rgba(255, 255, 255, .07);
  --sidebar-active: rgba(255, 255, 255, .12);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #081322;
    --surface: #101d30;
    --surface-2: #13233a;
    --surface-3: #192b44;
    --border: #22354f;
    --border-strong: #30486a;
    --ink: #e9eef5;
    --ink-2: #bac6d4;
    --muted: #8fa3b8;
    --grid: #1b2c44;
    --axis: #2f4665;
    --gold-ink: #d9b66a;
    --gold-soft: rgba(201, 167, 90, .14);
    --accent: #3987e5;
    --accent-hover: #4c95ec;
    --link: #6cb4e6;
    --focus: #6cb4e6;
    --pos: #3ecf72;
    --pos-bg: rgba(62, 207, 114, .13);
    --neg: #ff7a7a;
    --neg-bg: rgba(255, 122, 122, .13);
    --warn: #f0b44c;
    --warn-bg: rgba(240, 180, 76, .14);
    --info: #7db7f5;
    --info-bg: rgba(57, 135, 229, .16);
    --s-me: #3987e5;
    --s-inx: #bf8a2a;
    --d-megatrend: #169c8f;
    --d-smartmoney: #8474e6;
    --d-ipo: #e0588c;
    --d-reserve: #4d607a;
    --bar: #3987e5;
    --bar-track: #1c3353;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow-lg: 0 30px 80px rgba(0, 0, 0, .55);
    --scrim: rgba(0, 6, 14, .62);
    --sidebar-bg: linear-gradient(180deg, #0b1b31 0%, #060f1c 100%);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #081322;
  --surface: #101d30;
  --surface-2: #13233a;
  --surface-3: #192b44;
  --border: #22354f;
  --border-strong: #30486a;
  --ink: #e9eef5;
  --ink-2: #bac6d4;
  --muted: #8fa3b8;
  --grid: #1b2c44;
  --axis: #2f4665;
  --gold-ink: #d9b66a;
  --gold-soft: rgba(201, 167, 90, .14);
  --accent: #3987e5;
  --accent-hover: #4c95ec;
  --link: #6cb4e6;
  --focus: #6cb4e6;
  --pos: #3ecf72;
  --pos-bg: rgba(62, 207, 114, .13);
  --neg: #ff7a7a;
  --neg-bg: rgba(255, 122, 122, .13);
  --warn: #f0b44c;
  --warn-bg: rgba(240, 180, 76, .14);
  --info: #7db7f5;
  --info-bg: rgba(57, 135, 229, .16);
  --s-me: #3987e5;
  --s-inx: #bf8a2a;
  --d-megatrend: #169c8f;
  --d-smartmoney: #8474e6;
  --d-ipo: #e0588c;
  --d-reserve: #4d607a;
  --bar: #3987e5;
  --bar-track: #1c3353;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, .55);
  --scrim: rgba(0, 6, 14, .62);
  --sidebar-bg: linear-gradient(180deg, #0b1b31 0%, #060f1c 100%);
}

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
p { margin: 0; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.num, .tab { font-variant-numeric: tabular-nums; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.muted { color: var(--muted); }
.gold { color: var(--gold-ink); }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.icon { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: -3px; }
.icon-sm { width: 15px; height: 15px; vertical-align: -2px; }

/* ---------- App-Rahmen ---------- */
.app { min-height: 100vh; }
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: 248px; z-index: 40;
  display: flex; flex-direction: column;
  background: var(--sidebar-bg);
  color: var(--sidebar-ink);
  padding: 22px 14px 18px;
  overflow-y: auto;
}
.brand { padding: 4px 10px 22px; border-bottom: 1px solid rgba(255, 255, 255, .09); margin-bottom: 14px; }
.brand-logo { display: block; width: 168px; height: auto; filter: brightness(0) invert(1); opacity: .96; }
.brand-product { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.brand-product b { color: var(--sidebar-ink-strong); font-size: 15px; font-weight: 600; letter-spacing: .01em; }
.brand-tag {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: #1d1400; background: var(--gold); border-radius: 5px; padding: 2px 6px;
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--sidebar-ink); font-weight: 500; font-size: 15px;
  text-decoration: none; position: relative;
}
.nav a:hover { background: var(--sidebar-hover); color: var(--sidebar-ink-strong); }
.nav a[aria-current="page"] { background: var(--sidebar-active); color: var(--sidebar-ink-strong); }
.nav a[aria-current="page"]::before {
  content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--gold);
}
.nav .badge-count {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--gold); color: #1d1400; font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.nav-section { margin: 20px 12px 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .45); }
.sidebar-foot { margin-top: auto; padding-top: 16px; }
.member-card {
  display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08);
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
  color: #1d1400; background: linear-gradient(135deg, #e3c98c, #c9a75a);
}
.member-card b { display: block; color: #fff; font-size: 14px; font-weight: 600; }
.member-card span { font-size: 12.5px; color: rgba(255, 255, 255, .6); }
.sidebar-links { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; }
.sidebar-links button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: 0; background: none; color: var(--sidebar-ink); padding: 8px 12px; border-radius: 9px; font-size: 14px; text-align: left;
}
.sidebar-links button:hover { background: var(--sidebar-hover); color: #fff; }

.main { min-width: 0; min-height: 100vh; display: flex; flex-direction: column; margin-left: 248px; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 16px 32px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-title { min-width: 0; flex: 1 1 260px; }
.topbar-title h1 { font-family: var(--font-serif); font-weight: 600; font-size: 26px; color: var(--ink); letter-spacing: -.005em; }
.topbar-title p { color: var(--muted); font-size: 14px; margin-top: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mobile-brand { display: none; }
.view { padding: 28px 32px 40px; width: 100%; max-width: 1440px; outline: none; }
.footer {
  margin-top: auto; padding: 18px 32px 28px; color: var(--muted); font-size: 13px;
  display: flex; gap: 8px 18px; flex-wrap: wrap; border-top: 1px solid var(--border);
}
.demo-pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600;
  color: var(--gold-ink); background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}

/* ---------- Bedienelemente ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: 14.5px; white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #1d1400; }
.btn-gold:hover { background: #d5b672; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-3); }
.btn-danger { color: var(--neg); }
.btn-danger:hover { background: var(--neg-bg); border-color: color-mix(in srgb, var(--neg) 40%, transparent); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13.5px; border-radius: 8px; gap: 6px; }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.seg {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px;
  background: var(--surface-3); border: 1px solid var(--border);
  max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg button {
  display: inline-flex; align-items: center; gap: 7px;
  border: 0; background: transparent; color: var(--ink-2);
  padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: 14px; white-space: nowrap;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }
.seg .dot { width: 8px; height: 8px; }

.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.dot-megatrend { background: var(--d-megatrend); }
.dot-smartmoney { background: var(--d-smartmoney); }
.dot-ipo { background: var(--d-ipo); }
.dot-reserve { background: var(--d-reserve); }
.dot-me { background: var(--s-me); }
.dot-inx { background: var(--s-inx); }

/* ---------- Karten & Raster ---------- */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-7 { grid-column: span 7; }
.span-6 { grid-column: span 6; } .span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; }
.span-3 { grid-column: span 3; }
.stack { display: flex; flex-direction: column; gap: 20px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); min-width: 0;
}
.card-pad { padding: 20px 22px; }
.card-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 18px 22px 0;
}
.card-head h2 { font-size: 16.5px; font-weight: 600; color: var(--ink); }
.card-head p { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.card-head .card-tools { display: flex; gap: 6px; flex: none; align-items: center; }
.card-body { padding: 16px 22px 20px; }
.card-foot { padding: 12px 22px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card-link { font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 4px; }
.card-inx { border-top: 3px solid var(--gold); }

/* Hero */
.hero { position: relative; overflow: hidden; }
.hero-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; font-weight: 600; }
.hero-value { font-size: 52px; font-weight: 600; letter-spacing: -.02em; line-height: 1.05; margin-top: 8px; color: var(--ink); }
.hero-delta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; font-size: 15px; }
.hero-split { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.hero-split div span { display: block; font-size: 13px; color: var(--muted); }
.hero-split div b { font-size: 18px; font-weight: 600; }

.chip {
  display: inline-flex; align-items: center; gap: 5px; font-weight: 600; font-size: 13.5px;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
.chip-pos { background: var(--pos-bg); color: var(--pos); }
.chip-neg { background: var(--neg-bg); color: var(--neg); }
.chip-neutral { background: var(--surface-3); color: var(--ink-2); }
.chip-gold { background: var(--gold-soft); color: var(--gold-ink); }
.chip-info { background: var(--info-bg); color: var(--info); }
.chip-warn { background: var(--warn-bg); color: var(--warn); }

/* KPI-Kacheln */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.kpi-label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.kpi-value { font-size: 25px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); line-height: 1.2; }
.kpi-value.pos { color: var(--pos); }
.kpi-value.neg { color: var(--neg); }
.kpi-sub { font-size: 13.5px; color: var(--muted); }
.kpi .meter { margin-top: 8px; }

.info-tip {
  display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%;
  border: 1px solid var(--border-strong); color: var(--muted); font-size: 10.5px; font-weight: 700;
  cursor: help; background: none; padding: 0; line-height: 1;
}

/* Meter */
.meter { height: 8px; border-radius: 99px; background: var(--bar-track); overflow: hidden; position: relative; }
.meter > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--bar); }
.meter.megatrend { background: color-mix(in srgb, var(--d-megatrend) 18%, transparent); }
.meter.megatrend > i { background: var(--d-megatrend); }
.meter.smartmoney { background: color-mix(in srgb, var(--d-smartmoney) 18%, transparent); }
.meter.smartmoney > i { background: var(--d-smartmoney); }
.meter.ipo { background: color-mix(in srgb, var(--d-ipo) 18%, transparent); }
.meter.ipo > i { background: var(--d-ipo); }
.meter.reserve { background: color-mix(in srgb, var(--d-reserve) 30%, transparent); }
.meter.reserve > i { background: var(--d-reserve); }

/* Depot-Zeilen (Aufteilung) */
.alloc-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 11px 0; border-top: 1px solid var(--border); }
.alloc-row:first-of-type { border-top: 0; }
.alloc-name { display: flex; align-items: center; gap: 9px; font-weight: 600; }
.alloc-name small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; }
.alloc-val { text-align: right; font-size: 14px; white-space: nowrap; }
.alloc-val b { font-weight: 600; }

/* Tabellen */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.data th {
  text-align: left; font-weight: 600; font-size: 12.5px; color: var(--muted);
  padding: 10px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface);
}
table.data td { padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data th:first-child, table.data td:first-child { padding-left: 22px; }
table.data th:last-child, table.data td:last-child { padding-right: 22px; }
table.data .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data .c { text-align: center; }
table.data tbody tr.clickable { cursor: pointer; }
table.data tbody tr.clickable:hover td { background: var(--surface-2); }
table.data tfoot td { font-weight: 600; border-top: 1px solid var(--border-strong); border-bottom: 0; background: var(--surface-2); }
.title-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.title-cell .logo {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 13px; letter-spacing: .02em;
  color: #fff;
}
.logo.megatrend { background: var(--d-megatrend); }
.logo.smartmoney { background: var(--d-smartmoney); }
.logo.ipo { background: var(--d-ipo); }
.title-cell > div { min-width: 0; max-width: 230px; }
.title-cell b { display: block; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title-cell small { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.row-sub { display: block; font-size: 12.5px; color: var(--muted); }

/* Tranchen-Chips */
.tranches { display: inline-flex; gap: 4px; }
.tr-chip {
  display: inline-grid; place-items: center; min-width: 30px; height: 22px; padding: 0 5px;
  border-radius: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em;
  border: 1px solid var(--border-strong); color: var(--muted); background: transparent;
}
.tr-chip.done { background: var(--navy); border-color: var(--navy); color: #fff; }
:root[data-theme="dark"] .tr-chip.done { background: #2d5d93; border-color: #2d5d93; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tr-chip.done { background: #2d5d93; border-color: #2d5d93; } }
.tr-chip.t4 { border-style: dashed; }
.tr-chip.t4.done { background: var(--gold); border-color: var(--gold); color: #1d1400; border-style: solid; }
.tr-chip.miss { border-color: var(--warn); color: var(--warn); background: var(--warn-bg); }

/* Status */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-offen { color: var(--info); }
.status-geschlossen { color: var(--muted); }

/* Listen / Feed */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding: 13px 0; border-top: 1px solid var(--border); }
.feed li:first-child { border-top: 0; padding-top: 4px; }
.feed-date { text-align: center; line-height: 1.15; }
.feed-date b { display: block; font-size: 17px; font-weight: 600; color: var(--ink); }
.feed-date span { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.feed-main { min-width: 0; }
.feed-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; }
.feed-text { color: var(--ink-2); font-size: 14px; margin-top: 2px; }
.feed-meta { color: var(--muted); font-size: 13px; margin-top: 3px; display: flex; gap: 6px 12px; flex-wrap: wrap; align-items: center; }
.new-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); display: inline-block; }
.tag {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; letter-spacing: .02em;
  padding: 2px 8px; border-radius: 6px; white-space: nowrap;
}
.tag-kauf { background: var(--info-bg); color: var(--info); }
.tag-verkauf { background: var(--surface-3); color: var(--ink-2); }
.tag-neu { background: var(--gold-soft); color: var(--gold-ink); }
.tag-stop { background: var(--warn-bg); color: var(--warn); }

/* Abgleich */
.sync-list { list-style: none; margin: 0; padding: 0; }
.sync-list li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--border); }
.sync-list li:first-child { border-top: 0; padding-top: 2px; }
.sync-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.sync-ico.warn { background: var(--warn-bg); color: var(--warn); }
.sync-ico.info { background: var(--info-bg); color: var(--info); }
.sync-ico.ok { background: var(--pos-bg); color: var(--pos); }
.sync-main { flex: 1; min-width: 0; }
.sync-main b { font-weight: 600; }
.sync-main p { font-size: 13.5px; color: var(--muted); margin-top: 1px; }
.sync-main .btn { margin-top: 8px; }
.sync-ok { display: flex; align-items: center; gap: 10px; color: var(--pos); font-weight: 600; padding: 6px 0; }

/* Leerzustand */
.empty { text-align: center; padding: 36px 20px; color: var(--muted); }
.empty .icon { width: 30px; height: 30px; color: var(--border-strong); margin-bottom: 8px; }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }

/* Werkzeugleiste */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .spacer { flex: 1; }
.search { position: relative; }
.search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 36px; width: 240px; }

/* Formulare */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12.5px; color: var(--muted); }
.field .err { font-size: 12.5px; color: var(--neg); font-weight: 600; }
.input, select.input, textarea.input {
  height: 40px; padding: 0 12px; border-radius: 9px; width: 100%;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink);
  font-size: 15px;
}
textarea.input { height: auto; min-height: 72px; padding: 10px 12px; resize: vertical; }
.input:focus { outline: 2px solid color-mix(in srgb, var(--focus) 55%, transparent); outline-offset: 0; border-color: var(--focus); }
.input[aria-invalid="true"] { border-color: var(--neg); }
.input-suffix { position: relative; }
.input-suffix .input { padding-right: 40px; }
.input-suffix span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; pointer-events: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.calc-box {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
}
.calc-box span { display: block; font-size: 12.5px; color: var(--muted); }
.calc-box b { font-size: 17px; font-weight: 600; }
.radio-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.radio-cards label {
  position: relative; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px;
  border: 1px solid var(--border-strong); border-radius: 10px; cursor: pointer; background: var(--surface);
}
.radio-cards input { position: absolute; opacity: 0; pointer-events: none; }
.radio-cards b { font-size: 14.5px; }
.radio-cards small { font-size: 12.5px; color: var(--muted); }
.radio-cards label:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.radio-cards label:has(input:disabled) { opacity: .45; cursor: not-allowed; }
.radio-cards label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.note {
  display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; padding: 11px 13px;
  border-radius: 10px; background: var(--info-bg); color: var(--ink-2);
}
.note .icon { color: var(--info); margin-top: 1px; }
.note.warn { background: var(--warn-bg); }
.note.warn .icon { color: var(--warn); }
.note.gold { background: var(--gold-soft); }
.note.gold .icon { color: var(--gold-ink); }

/* Modal / Seitenpanel */
.scrim {
  position: fixed; inset: 0; z-index: 80; background: var(--scrim);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: fade .15s ease-out;
}
.scrim.drawer-mode { justify-content: flex-end; padding: 0; align-items: stretch; }
.modal {
  width: min(640px, 100%); max-height: calc(100vh - 48px); overflow: auto;
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg);
  border: 1px solid var(--border); animation: pop .18s ease-out;
}
.modal.wide { width: min(880px, 100%); }
.drawer {
  width: min(720px, 100%); height: 100%; overflow: auto; background: var(--surface);
  box-shadow: var(--shadow-lg); border-left: 1px solid var(--border); animation: slide .2s ease-out;
}
.modal-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 24px 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 19px; font-weight: 600; }
.modal-head p { color: var(--muted); font-size: 14px; margin-top: 3px; }
.modal-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 18px; }
.modal-foot { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px; background: var(--surface); border-top: 1px solid var(--border); flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } }
@keyframes slide { from { transform: translateX(40px); opacity: .4; } }

/* Positionsdetail */
.detail-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.detail-kpis div { background: var(--surface); padding: 12px 14px; }
.detail-kpis span { display: block; font-size: 12.5px; color: var(--muted); }
.detail-kpis b { font-size: 17px; font-weight: 600; }
.section-title { font-size: 15px; font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }

/* Toast */
#toast-root { position: fixed; z-index: 120; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 12px;
  background: var(--deep); color: #fff; box-shadow: var(--shadow-lg); font-weight: 500; font-size: 14.5px;
  animation: pop .2s ease-out; pointer-events: auto;
}
.toast .icon { color: #7fdca2; }

/* Menü */
.menu { position: relative; }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 230px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg);
  padding: 6px; display: none;
}
.menu.open .menu-list { display: block; }
.menu-list button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 11px;
  border: 0; background: none; border-radius: 8px; text-align: left; font-size: 14.5px; color: var(--ink);
}
.menu-list button:hover { background: var(--surface-3); }
.menu-list hr { border: 0; border-top: 1px solid var(--border); margin: 6px 4px; }

/* ---------- Diagramme ---------- */
.viz { position: relative; width: 100%; }
.viz svg { display: block; width: 100%; height: auto; overflow: visible; }
.viz text { font-family: var(--font); fill: var(--muted); font-size: 12px; }
.viz .axis-label { font-variant-numeric: tabular-nums; }
.viz .grid-line { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.viz .base-line { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.viz .zero-line { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.viz .crosshair { stroke: var(--ink-2); stroke-width: 1; opacity: .55; }
.viz .end-label { font-weight: 600; font-size: 12.5px; fill: var(--ink); }
.viz .val-label { fill: var(--ink-2); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.viz .cat-label { fill: var(--ink-2); font-size: 13px; }
.viz .hit { fill: transparent; cursor: default; }
.viz .mark-hover { opacity: .82; }
.viz-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-2); margin-bottom: 10px; }
.viz-legend span { display: inline-flex; align-items: center; gap: 7px; }
.viz-legend .key-line { width: 16px; height: 3px; border-radius: 2px; display: inline-block; }
.viz-legend .key-box { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.viz-legend .key-track { width: 16px; height: 9px; border-radius: 3px; display: inline-block; }
.viz-tip {
  position: fixed; z-index: 150; pointer-events: none; min-width: 150px; max-width: 280px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--border); border-radius: 11px;
  box-shadow: var(--shadow-lg); padding: 10px 12px; font-size: 13px; line-height: 1.35;
  opacity: 0; transition: opacity .08s;
}
.viz-tip.show { opacity: 1; }
.viz-tip .tip-title { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.viz-tip .tip-row { display: grid; grid-template-columns: 14px 1fr; gap: 2px 8px; align-items: center; margin-top: 4px; }
.viz-tip .tip-row i { width: 12px; height: 3px; border-radius: 2px; display: block; }
.viz-tip .tip-row b { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.viz-tip .tip-row span { grid-column: 2; color: var(--muted); font-size: 12.5px; }
.viz-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.viz-table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12.5px; padding: 7px 8px; border-bottom: 1px solid var(--border); }
.viz-table td { padding: 7px 8px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.viz-table td + td, .viz-table th + th { text-align: right; }
.viz-table-wrap { max-height: 360px; overflow: auto; }
.spark { display: block; }

/* Kopfbereich Musterportfolio */
.inx-banner {
  position: relative; overflow: hidden; border-radius: var(--radius); padding: 24px 26px;
  background: linear-gradient(120deg, #002f5d 0%, #011a34 70%); color: #fff;
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr); gap: 24px; align-items: center;
  border: 1px solid rgba(255, 255, 255, .06);
}
.inx-banner::after {
  content: ""; position: absolute; right: -80px; top: -120px; width: 360px; height: 360px; border-radius: 50%;
  border: 2px solid rgba(201, 167, 90, .35); pointer-events: none;
}
.inx-banner h2 { font-family: var(--font-serif); font-size: 26px; font-weight: 600; }
.inx-banner p { color: rgba(255, 255, 255, .72); font-size: 14.5px; margin-top: 6px; }
.inx-banner .kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; }
.inx-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; position: relative; z-index: 1; }
.inx-stats div { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); border-radius: 12px; padding: 12px 14px; }
.inx-stats span { display: block; font-size: 12.5px; color: rgba(255, 255, 255, .66); }
.inx-stats b { font-size: 21px; font-weight: 600; color: #fff; }
.inx-stats .up { color: #7fdca2; }
.inx-stats .down { color: #ff9b9b; }

/* Planung */
.alloc-inputs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.alloc-inputs .field label { display: flex; align-items: center; gap: 7px; }
.stackbar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; gap: 2px; background: var(--surface); }
.stackbar i { display: block; height: 100%; }
.stackbar i:first-child { border-radius: 99px 0 0 99px; }
.stackbar i:last-child { border-radius: 0 99px 99px 0; }
.sum-ok { color: var(--pos); font-weight: 600; }
.sum-bad { color: var(--neg); font-weight: 600; }
.schema-table input { width: 84px; }
.kbd { font-size: 12px; border: 1px solid var(--border-strong); border-bottom-width: 2px; padding: 0 5px; border-radius: 5px; color: var(--muted); }

/* Mobile Navigation */
.tabbar { display: none; }
.fab { display: none; }

/* ---------- Responsiv ---------- */
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-lg-12 { grid-column: span 12; }
  .span-lg-6 { grid-column: span 6; }
  .inx-banner { grid-template-columns: 1fr; }
}
@media (max-width: 1080px) {
  .sidebar { width: 76px; padding: 18px 10px; }
  .main { margin-left: 76px; }
  .brand-logo, .brand-product, .nav-section, .member-card div, .sidebar-links span { display: none; }
  .brand { padding: 0 0 12px; display: grid; place-items: center; }
  .brand::before { content: "INX"; font-family: var(--font-serif); font-weight: 600; color: #fff; font-size: 18px; letter-spacing: .06em; }
  .nav a { justify-content: center; padding: 12px 0; }
  .nav a .label { display: none; }
  .nav .badge-count { position: absolute; top: 4px; right: 6px; min-width: 18px; height: 18px; font-size: 11px; padding: 0 5px; }
  .nav a[aria-current="page"]::before { left: -10px; }
  .member-card { justify-content: center; padding: 8px 0; }
  .sidebar-links button { justify-content: center; }
  .span-md-12 { grid-column: span 12; }
  .span-md-6 { grid-column: span 6; }
}
@media (max-width: 860px) {
  body { font-size: 15px; padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .topbar { padding: 12px 16px; gap: 10px; }
  .topbar-title h1 { font-size: 22px; }
  .topbar-title p { font-size: 13px; }
  .mobile-brand { display: flex; align-items: center; gap: 8px; width: 100%; }
  .mobile-brand img { height: 22px; width: auto; }
  :root[data-theme="dark"] .mobile-brand img { filter: brightness(0) invert(1); }
  .topbar-actions { width: 100%; }
  .topbar-actions .seg { flex: 1 1 100%; }
  .topbar-actions .btn-trade { display: none; }
  .view { padding: 18px 16px 28px; }
  .footer { padding: 16px 16px 24px; }
  .grid { gap: 14px; }
  .grid > [class*="span-"] { grid-column: span 12; }
  .kpis { gap: 10px; }
  .kpi { padding: 13px 14px; }
  .kpi-value { font-size: 21px; }
  .hero-value { font-size: 40px; }
  .hero-split { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-head { padding: 16px 16px 0; }
  .card-body { padding: 14px 16px 16px; }
  .card-pad { padding: 16px; }
  .card-foot { padding: 12px 16px; }
  .alloc-row { grid-template-columns: minmax(0, 1fr) auto; }
  .alloc-row .meter { grid-column: 1 / -1; grid-row: 2; }
  .inx-banner { padding: 20px 18px; }
  .inx-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .alloc-inputs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid, .form-grid-3 { grid-template-columns: minmax(0, 1fr); }
  .radio-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calc-box { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search input { width: 100%; }
  .search { flex: 1 1 100%; }
  .scrim { padding: 0; align-items: flex-end; }
  .modal, .modal.wide { width: 100%; max-height: 92vh; border-radius: 18px 18px 0 0; }
  .drawer { width: 100%; }
  .modal-head, .modal-body { padding-left: 18px; padding-right: 18px; }
  .modal-foot { padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); }

  /* Tabellen werden zu Karten */
  table.data.cards thead { display: none; }
  table.data.cards, table.data.cards tbody, table.data.cards tfoot { display: block; }
  table.data.cards tr {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px;
    padding: 14px 16px; border-bottom: 1px solid var(--border);
  }
  table.data.cards td { display: block; padding: 0 !important; border: 0; text-align: left !important; min-width: 0; }
  table.data.cards td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 1px; }
  table.data.cards td.cell-main { grid-column: 1 / -1; }
  table.data.cards td.cell-wide { grid-column: 1 / -1; }
  table.data.cards td.cell-hide { display: none; }
  table.data.cards tfoot tr { background: var(--surface-2); }
  .title-cell b { white-space: normal; }

  .tabbar {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: var(--surface); border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 2px; border-radius: 10px;
    color: var(--muted); font-size: 11.5px; font-weight: 600; text-decoration: none; position: relative;
  }
  .tabbar a .icon { width: 22px; height: 22px; }
  .tabbar a[aria-current="page"] { color: var(--ink); }
  .tabbar a[aria-current="page"] .icon { color: var(--accent); }
  .tabbar .badge-count {
    position: absolute; top: 0; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
    background: var(--gold); color: #1d1400; font-size: 10.5px; font-weight: 700; display: grid; place-items: center;
  }
  .fab {
    display: inline-flex; position: fixed; right: 16px; bottom: calc(78px + env(safe-area-inset-bottom)); z-index: 61;
    height: 52px; padding: 0 18px; border-radius: 26px; box-shadow: var(--shadow-lg);
  }
}
@media (max-width: 420px) {
  .kpis { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .hero-value { font-size: 36px; }
  .inx-stats b { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .sidebar, .topbar-actions, .tabbar, .fab, .card-tools { display: none !important; }
  .app { grid-template-columns: 1fr; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* ---------- Ergänzungen für Ansichten ---------- */
.linklike { border: 0; background: none; padding: 0; color: var(--ink); font-weight: 600; text-align: left; cursor: pointer; }
.linklike:hover { color: var(--link); text-decoration: underline; }
.linklike[disabled] { cursor: default; color: var(--ink); text-decoration: none; }
.card-head h2 .dot { vertical-align: 1px; margin-right: 4px; }
.card-head h2 .icon { vertical-align: -2px; }

.viz-card .viz-table-area { display: none; }
.viz-card.zeige-tabelle .viz-table-area { display: block; }
.viz-card.zeige-tabelle .viz-chart-area { display: none; }

.hero-compare {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; padding: 10px 12px;
  border-radius: 10px; background: var(--gold-soft); font-size: 14px; color: var(--ink-2);
}
.hero-compare b { color: var(--ink); }

/* Balkenlisten */
.hbar-list { display: flex; flex-direction: column; }
.hbar-row {
  display: grid; grid-template-columns: minmax(110px, 30%) minmax(0, 1fr) minmax(92px, auto); gap: 14px;
  align-items: center; padding: 7px 6px; border-radius: 8px; outline-offset: 0;
}
.hbar-row:hover { background: var(--surface-2); }
.hbar-label { min-width: 0; }
.hbar-label b { display: block; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-label small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { position: relative; height: 14px; }
.hbar-track > i { position: absolute; top: 1px; bottom: 1px; background: var(--bar); border-radius: 0 4px 4px 0; min-width: 2px; }
.hbar-track > i.up { background: var(--pos); border-radius: 0 4px 4px 0; }
.hbar-track > i.down { background: var(--neg); border-radius: 4px 0 0 4px; }
.hbar-zero { position: absolute; left: 50%; top: -4px; bottom: -4px; width: 1px; background: var(--axis); }
.hbar-track.bullet > em { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; background: var(--bar-track); }
.hbar-track.bullet > i { top: 3px; bottom: 3px; left: 0; }
.hbar-val { text-align: right; font-size: 13.5px; font-weight: 600; white-space: nowrap; color: var(--ink); }
.hbar-val .muted { font-weight: 400; }
.hbar-list.divergierend .hbar-row { grid-template-columns: minmax(110px, 28%) minmax(0, 1fr) minmax(128px, auto); }

/* gestapelte Aufteilung */
.stack-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 13.5px; color: var(--ink-2); }
.stack-legend span { display: inline-flex; align-items: center; gap: 7px; }
.stack-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.stack-legend b { font-weight: 600; color: var(--ink); }
.stackbar i:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

table.data tr.aktiv td { background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
table.data tr.aktiv td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.daten-aktionen { display: flex; flex-wrap: wrap; gap: 10px; }
.sektor-block .section-title { font-size: 14px; }
.edit-table td { padding: 8px 6px; }
.edit-table .input { height: 36px; font-size: 14px; }
.edit-table .input-suffix .input { padding-right: 30px; }
.edit-table .input-suffix span { right: 9px; }
.schema-table td .input-suffix { width: 92px; margin-left: auto; }
.schema-table td .input { height: 36px; }
.schema-table th:first-child, .schema-table td:first-child { padding-left: 0; }
.schema-table th:last-child, .schema-table td:last-child { padding-right: 0; }

@media (max-width: 860px) {
  .cell-hide-m { display: none; }
  .hbar-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; }
  .hbar-list.divergierend .hbar-row { grid-template-columns: minmax(0, 1fr) auto; }
  .hbar-track { grid-column: 1 / -1; grid-row: 2; }
  .hbar-label { grid-row: 1; }
  .hbar-val { grid-row: 1; }
  .edit-table thead { display: none; }
  .edit-table, .edit-table tbody { display: block; }
  .edit-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--border); }
  .edit-table td { padding: 0; border: 0; }
}

/* Hero: Aufschlüsselung */
.hero { display: flex; flex-direction: column; }
.hero-list { margin-top: 18px; display: flex; flex-direction: column; gap: 2px; }
.hero-list-title { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.hero-row { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; font-size: 14px; padding: 5px 0; border-top: 1px solid var(--border); }
.hero-row:first-of-type { border-top: 0; }
.hero-row b { font-weight: 600; text-align: right; min-width: 64px; }
.hero-row em { font-style: normal; text-align: right; min-width: 76px; color: var(--muted); }
.hero-row span.name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero .hero-compare { margin-top: auto; }
.hero .hero-split, .hero .hero-list { margin-bottom: 16px; }
.hero-spacer { flex: 1; min-height: 12px; }
.hero-compare { justify-content: space-between; }

/* Schemas als Raster */
.schema-grid { display: grid; grid-template-columns: minmax(78px, auto) repeat(3, minmax(0, 1fr)) minmax(52px, auto); gap: 8px 10px; align-items: center; }
.schema-grid .sg-head { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.schema-grid .sg-head.r, .schema-grid .sg-sum { text-align: right; }
.schema-grid .input { height: 38px; padding: 0 26px 0 10px; }
.schema-grid .input-suffix span { right: 9px; }
.schema-grid b { font-weight: 600; }

/* Feed einklappen */
.feed-mehr { margin-top: 8px; width: 100%; }

/* Mobil: kompakte Kopfzeile, Karten in drei Spalten */
.mb-actions { margin-left: auto; display: flex; gap: 6px; }
@media (max-width: 860px) {
  .topbar { position: static; background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom: 0; padding-bottom: 4px; }
  .topbar .desk-only { display: none; }
  .topbar-actions .seg { width: 100%; }
  .mobile-brand .demo-pill { font-size: 12px; }
  table.data.cards tr { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  table.data.cards td > div { justify-content: flex-start !important; }
  table.data.cards tr.aktiv td:first-child { box-shadow: none; }
  table.data.cards tr.aktiv { box-shadow: inset 3px 0 0 var(--gold); }
  .inx-banner::after { display: none; }
  .hero-split { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .hero-split div b { font-size: 16px; }
  .fab { height: 48px; padding: 0 16px; }
}
@media (max-width: 359px) {
  table.data.cards tr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* dichte Tabelle (Musterportfolio neben dem Änderungsprotokoll) */
table.data.dense th, table.data.dense td { padding-left: 8px; padding-right: 8px; }
table.data.dense th:first-child, table.data.dense td:first-child { padding-left: 20px; }
table.data.dense th:last-child, table.data.dense td:last-child { padding-right: 20px; }
table.data.dense .title-cell { gap: 10px; }
table.data.dense .title-cell .logo { width: 32px; height: 32px; font-size: 12px; border-radius: 9px; }

.hinweis-liste { margin: 6px 0 0; padding-left: 18px; }
.hinweis-liste li { margin: 3px 0; }

@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mobile-brand img { filter: brightness(0) invert(1); } }
:root[data-theme="dark"] .mobile-brand img { filter: brightness(0) invert(1); }

.viz .ref-label { paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }

/* ---------- Rundgang ---------- */
.tour { display: none; }
.tour.an { display: block; }
.tour-sperre { position: fixed; inset: 0; z-index: 200; background: transparent; }
.tour.zentriert .tour-sperre { background: var(--scrim); animation: fade .2s ease-out; }
.tour-spot {
  position: fixed; z-index: 201; display: none; border-radius: 16px; pointer-events: none;
  box-shadow: 0 0 0 2px var(--gold), 0 0 0 9999px var(--tour-dim);
  transition: left .28s ease, top .28s ease, width .28s ease, height .28s ease;
}
:root { --tour-dim: rgba(1, 17, 34, .58); }
:root[data-theme="dark"] { --tour-dim: rgba(0, 5, 12, .7); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --tour-dim: rgba(0, 5, 12, .7); } }
.tour-karte {
  position: fixed; z-index: 202; width: 360px; max-width: calc(100vw - 24px);
  background: var(--surface); color: var(--ink); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-lg); padding: 18px 20px 16px; outline: none;
  transition: left .28s ease, top .28s ease, opacity .15s ease;
}
.tour-karte.wechsel { opacity: 0; }
.tour.zentriert .tour-karte { left: 50%; top: 50%; transform: translate(-50%, -50%); width: 540px; padding: 26px 28px 22px; transition: opacity .15s ease; }
.tour-kicker { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-ink); }
.tour-karte h3 { font-family: var(--font-serif); font-size: 21px; font-weight: 600; margin: 6px 0 8px; color: var(--ink); }
.tour.zentriert .tour-karte h3 { font-size: 25px; }
.tour-text { color: var(--ink-2); font-size: 14.5px; line-height: 1.55; }
.tour-kopf { display: flex; justify-content: space-between; align-items: center; margin: -6px -10px 0 0; }
.tour-schritt { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gold-ink); }
.tour-fuss { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; }
.tour.zentriert .tour-fuss { justify-content: flex-end; margin-top: 22px; }
.tour-knoepfe { display: flex; gap: 6px; margin-left: auto; }
.tour-punkte { display: flex; gap: 5px; align-items: center; }
.tour-punkte i { width: 6px; height: 6px; border-radius: 50%; background: var(--border-strong); }
.tour-punkte i.an { background: var(--gold); width: 16px; border-radius: 3px; }
.tour-kacheln { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.tour-kacheln div { border: 1px solid var(--border); border-radius: 12px; padding: 12px 13px; background: var(--surface-2); }
.tour-kacheln .icon { color: var(--gold-ink); width: 22px; height: 22px; }
.tour-kacheln b { display: block; font-size: 14px; font-weight: 600; margin-top: 8px; color: var(--ink); }
.tour-kacheln span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
@media (max-width: 860px) {
  .tour-karte { width: calc(100vw - 24px); padding: 16px 16px 14px; }
  .tour.zentriert .tour-karte { width: calc(100vw - 24px); padding: 22px 18px 18px; }
  .tour-kacheln { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .tour-kacheln div { display: grid; grid-template-columns: 26px minmax(0, 1fr); column-gap: 10px; align-items: start; padding: 10px 12px; }
  .tour-kacheln b { margin-top: 1px; }
  .tour-kacheln span { grid-column: 2; }
}
