/* Aktien-Cockpit – Gestaltung im Stil von Apple (macOS / iOS)
   Systemfarben, San Francisco, Materialien mit Unschärfe, gruppierte Listen. */
:root {
  color-scheme: light;
  --page: #f2f2f7;
  --surface-1: #ffffff;
  --surface-2: #f2f2f7;
  --surface-3: #e5e5ea;
  --fill: rgba(118, 118, 128, 0.12);
  --fill-2: rgba(118, 118, 128, 0.20);
  --material: rgba(246, 246, 248, 0.72);
  --material-side: rgba(240, 240, 245, 0.78);
  --text-primary: #000000;
  --text-secondary: rgba(60, 60, 67, 0.72);
  --text-muted: rgba(60, 60, 67, 0.56);
  --axis-muted: rgba(60, 60, 67, 0.45);
  --grid: rgba(60, 60, 67, 0.10);
  --baseline: rgba(60, 60, 67, 0.22);
  --border: rgba(60, 60, 67, 0.13);
  --border-strong: rgba(60, 60, 67, 0.22);
  --blue: #007aff; --green: #34c759; --red: #ff3b30; --orange: #ff9500; --yellow: #ffcc00;
  --teal: #30b0c7; --indigo: #5856d6; --purple: #af52de; --pink: #ff2d55; --gray: #8e8e93;
  --series-1: #007aff; --series-2: #ff9500; --series-3: #30b0c7; --series-4: #ffcc00;
  --series-5: #ff2d55; --series-6: #34c759; --series-7: #5856d6; --series-8: #ff3b30;
  --muted-series: #c7c7cc;
  --up: #248a3d;
  --down: #d70015;
  --up-line: #34c759; --down-line: #ff3b30;
  --good: #34c759; --warning: #ff9500; --serious: #ff9500; --critical: #ff3b30;
  --accent: #007aff; --accent-ink: #ffffff; --accent-wash: rgba(0, 122, 255, 0.12);
  --focus: rgba(0, 122, 255, 0.55);
  --div-neg-3: #d70015; --div-neg-2: #ff6961; --div-neg-1: #ffd1cf; --div-mid: #ececf0;
  --div-pos-1: #c6e9d0; --div-pos-2: #5dd27a; --div-pos-3: #248a3d;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 2px 10px rgba(0, 0, 0, 0.04);
  --shadow-pop: 0 10px 40px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar: 240px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", system-ui, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #000000; --surface-1: #1c1c1e; --surface-2: #2c2c2e; --surface-3: #3a3a3c;
    --fill: rgba(118, 118, 128, 0.24); --fill-2: rgba(118, 118, 128, 0.36);
    --material: rgba(28, 28, 30, 0.72); --material-side: rgba(30, 30, 32, 0.80);
    --text-primary: #ffffff; --text-secondary: rgba(235, 235, 245, 0.70); --text-muted: rgba(235, 235, 245, 0.50);
    --axis-muted: rgba(235, 235, 245, 0.40); --grid: rgba(84, 84, 88, 0.35); --baseline: rgba(84, 84, 88, 0.65);
    --border: rgba(84, 84, 88, 0.45); --border-strong: rgba(84, 84, 88, 0.75);
    --blue: #0a84ff; --green: #30d158; --red: #ff453a; --orange: #ff9f0a; --yellow: #ffd60a;
    --teal: #40c8e0; --indigo: #5e5ce6; --purple: #bf5af2; --pink: #ff375f; --gray: #8e8e93;
    --series-1: #0a84ff; --series-2: #ff9f0a; --series-3: #40c8e0; --series-4: #ffd60a;
    --series-5: #ff375f; --series-6: #30d158; --series-7: #5e5ce6; --series-8: #ff453a;
    --muted-series: #48484a; --up: #30d158; --down: #ff453a; --up-line: #30d158; --down-line: #ff453a;
    --good: #30d158; --warning: #ff9f0a; --serious: #ff9f0a; --critical: #ff453a;
    --accent: #0a84ff; --accent-wash: rgba(10, 132, 255, 0.20); --focus: rgba(10, 132, 255, 0.6);
    --div-neg-3: #ff453a; --div-neg-2: #b3352d; --div-neg-1: #4d1f1c; --div-mid: #2c2c2e;
    --div-pos-1: #1d3d25; --div-pos-2: #248a3d; --div-pos-3: #30d158;
    --shadow: none; --shadow-pop: 0 10px 40px rgba(0, 0, 0, 0.6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #000000; --surface-1: #1c1c1e; --surface-2: #2c2c2e; --surface-3: #3a3a3c;
  --fill: rgba(118, 118, 128, 0.24); --fill-2: rgba(118, 118, 128, 0.36);
  --material: rgba(28, 28, 30, 0.72); --material-side: rgba(30, 30, 32, 0.80);
  --text-primary: #ffffff; --text-secondary: rgba(235, 235, 245, 0.70); --text-muted: rgba(235, 235, 245, 0.50);
  --axis-muted: rgba(235, 235, 245, 0.40); --grid: rgba(84, 84, 88, 0.35); --baseline: rgba(84, 84, 88, 0.65);
  --border: rgba(84, 84, 88, 0.45); --border-strong: rgba(84, 84, 88, 0.75);
  --blue: #0a84ff; --green: #30d158; --red: #ff453a; --orange: #ff9f0a; --yellow: #ffd60a;
  --teal: #40c8e0; --indigo: #5e5ce6; --purple: #bf5af2; --pink: #ff375f; --gray: #8e8e93;
  --series-1: #0a84ff; --series-2: #ff9f0a; --series-3: #40c8e0; --series-4: #ffd60a;
  --series-5: #ff375f; --series-6: #30d158; --series-7: #5e5ce6; --series-8: #ff453a;
  --muted-series: #48484a; --up: #30d158; --down: #ff453a; --up-line: #30d158; --down-line: #ff453a;
  --good: #30d158; --warning: #ff9f0a; --serious: #ff9f0a; --critical: #ff453a;
  --accent: #0a84ff; --accent-wash: rgba(10, 132, 255, 0.20); --focus: rgba(10, 132, 255, 0.6);
  --div-neg-3: #ff453a; --div-neg-2: #b3352d; --div-neg-1: #4d1f1c; --div-mid: #2c2c2e;
  --div-pos-1: #1d3d25; --div-pos-2: #248a3d; --div-pos-3: #30d158;
  --shadow: none; --shadow-pop: 0 10px 40px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font); font-size: 14px; line-height: 1.43; letter-spacing: -0.006em;
  background: var(--page); color: var(--text-primary);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; }
a:hover { opacity: .8; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); }
h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.022em; line-height: 1.15; }
h2 { font-size: 19px; font-weight: 600; letter-spacing: -0.017em; }
h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.012em; }
h4 { font-size: 13px; font-weight: 600; }
p { margin: 0 0 8px; }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .92em; background: var(--fill); padding: 1px 5px; border-radius: 5px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-radius: 8px; }
#view:focus { outline: none; }
.num, td.num, th.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.muted { color: var(--text-muted); }
.secondary { color: var(--text-secondary); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.up { color: var(--up); }
.down { color: var(--down); }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.grow { flex: 1; }
.right { text-align: right; }
.center { text-align: center; }
.mt { margin-top: 20px; }
.mb { margin-bottom: 20px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 14px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------------ Layout */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--material-side); backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-right: 0.5px solid var(--border-strong); padding: 18px 10px; display: flex; flex-direction: column; gap: 2px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 10px 18px; font-weight: 700; font-size: 16px; letter-spacing: -0.02em; font-family: var(--font-display); }
.brand svg { flex: none; border-radius: 7px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--text-primary); font-weight: 500; font-size: 14px; }
.nav a svg { width: 18px; height: 18px; flex: none; color: var(--accent); }
.nav a:hover { background: var(--fill); opacity: 1; }
.nav a.active { background: var(--accent); color: #fff; }
.nav a.active svg { color: #fff; }
.nav .badge { margin-left: auto; }
.sidebar-foot { margin-top: auto; padding: 12px 10px 0; font-size: 11px; color: var(--text-muted); line-height: 1.6; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 28px;
  background: var(--material); backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-bottom: 0.5px solid var(--border);
}
.content { padding: 24px 28px 56px; max-width: 1440px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .sub { color: var(--text-secondary); margin-top: 4px; font-size: 14px; }
.menu-btn { display: none; }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.g-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); align-items: start; }

.card { background: var(--surface-1); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head .hint { color: var(--text-muted); font-size: 12px; }
.card.flush .card-head { padding: 16px 20px 0; }
.box { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.box h4 { font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; }
.box ul { margin: 0; padding-left: 18px; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ------------------------------------------------------------------ Steuerelemente */
button, .btn {
  font: inherit; font-weight: 500; font-size: 13.5px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 9px; border: 0; background: var(--fill); color: var(--accent); padding: 7px 14px; line-height: 1.25; white-space: nowrap;
  transition: background .15s, transform .08s, opacity .15s;
}
button:hover, .btn:hover { background: var(--fill-2); opacity: 1; }
button:active, .btn:active { transform: scale(.98); }
button:disabled { opacity: .45; cursor: default; transform: none; }
button.primary, .btn.primary { background: var(--accent); color: #fff; }
button.primary:hover, .btn.primary:hover { filter: brightness(1.08); background: var(--accent); }
button.danger { color: var(--red); }
button.ghost { background: transparent; }
button.ghost:hover { background: var(--fill); }
button.icon { padding: 7px; border-radius: 50%; }
button.sm, .btn.sm { padding: 5px 11px; font-size: 12.5px; border-radius: 8px; }
button svg, .btn svg { width: 16px; height: 16px; }
input, select, textarea {
  font: inherit; font-size: 14px; color: var(--text-primary); background: var(--fill); border: 0;
  border-radius: 9px; padding: 8px 11px; min-width: 0; transition: box-shadow .15s, background .15s;
}
input::placeholder { color: var(--text-muted); }
input:focus, select:focus, textarea:focus { outline: none; box-shadow: 0 0 0 3.5px var(--focus); background: var(--surface-1); }
select { appearance: none; -webkit-appearance: none; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='14' viewBox='0 0 10 14'%3E%3Cpath d='M1.5 5 5 1.5 8.5 5M1.5 9 5 12.5 8.5 9' fill='none' stroke='%238e8e93' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
textarea { width: 100%; min-height: 120px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-secondary); font-weight: 500; }
label.check { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.help { font-size: 12px; color: var(--text-muted); font-weight: 400; }

/* Segmentierte Steuerung (UISegmentedControl / NSSegmentedControl) */
.seg { display: inline-flex; background: var(--fill); border-radius: 9px; padding: 2px; }
.seg button { background: transparent; color: var(--text-primary); border-radius: 7px; padding: 4px 12px; font-size: 12.5px; font-weight: 500; }
.seg button:hover { background: transparent; opacity: .75; }
.seg button.on { background: var(--surface-1); box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 3px 1px rgba(0, 0, 0, .04); font-weight: 600; opacity: 1; }
:root[data-theme="dark"] .seg button.on { background: #636366; }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) .seg button.on { background: #636366; } }

.search { position: relative; flex: 1; max-width: 480px; }
.search input { width: 100%; padding-left: 34px; border-radius: 10px; }
.search > svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-muted); pointer-events: none; }
.dropdown { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40; background: var(--surface-1); border-radius: 12px;
  box-shadow: var(--shadow-pop); max-height: 400px; overflow-y: auto; padding: 5px; border: 0.5px solid var(--border); }
.dropdown .opt { display: flex; gap: 10px; align-items: center; padding: 8px 10px; cursor: pointer; border-radius: 8px; text-align: left; }
.dropdown .opt:hover { background: var(--fill); }
.dropdown .opt.sel { background: var(--accent); color: #fff; }
.dropdown .opt.sel .muted { color: rgba(255, 255, 255, .8); }
.dropdown .opt .sym { font-weight: 600; min-width: 84px; }
.dropdown .empty { padding: 12px; color: var(--text-muted); }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--fill); color: var(--text-secondary); white-space: nowrap; }
.badge.accent { background: var(--accent-wash); color: var(--accent); }
.badge.pos { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--up); }
.badge.neg { background: color-mix(in srgb, var(--red) 15%, transparent); color: var(--down); }
.badge.warn { background: color-mix(in srgb, var(--orange) 20%, transparent); color: var(--text-primary); }
.badge.count { background: var(--red); color: #fff; min-width: 18px; justify-content: center; }
.nav a.active .badge.count { background: #fff; color: var(--accent); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--fill); font-size: 13px; color: var(--text-primary); font-weight: 500; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }

/* ------------------------------------------------------------------ Tabellen (gruppierte Listen) */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; vertical-align: middle; }
td { border-top: 0.5px solid var(--border); }
th { font-size: 11.5px; font-weight: 600; color: var(--text-muted); white-space: nowrap; background: var(--surface-1); position: sticky; top: 0; text-transform: uppercase; letter-spacing: .02em; }
th.sortable { cursor: pointer; user-select: none; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--fill); }
tbody tr.click { cursor: pointer; }
td .name { font-weight: 600; }
td .sub { font-size: 12px; color: var(--text-muted); }
.cell-name { min-width: 180px; max-width: 340px; }
table td:first-child, table th:first-child { padding-left: 20px; }
table td:last-child, table th:last-child { padding-right: 20px; }
.card:not(.flush) table td:first-child, .card:not(.flush) table th:first-child { padding-left: 0; }
.card:not(.flush) table td:last-child, .card:not(.flush) table th:last-child { padding-right: 0; }

/* ------------------------------------------------------------------ Diagramme */
.chart { position: relative; width: 100%; user-select: none; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .base-line { stroke: var(--baseline); stroke-width: 1; shape-rendering: crispEdges; }
.chart .tick { fill: var(--axis-muted); font-size: 11px; font-variant-numeric: tabular-nums; font-family: var(--font); }
.chart .crosshair { stroke: var(--text-muted); stroke-width: 1; }
.chart-tip { position: absolute; pointer-events: none; z-index: 5; background: var(--material); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%);
  color: var(--text-primary); border-radius: 10px; padding: 8px 11px; font-size: 12px; box-shadow: var(--shadow-pop); white-space: nowrap; min-width: 140px; border: 0.5px solid var(--border); }
.chart-tip .t { color: var(--text-muted); margin-bottom: 4px; font-weight: 500; }
.chart-tip .r { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.chart-tip .r b { font-variant-numeric: tabular-nums; font-weight: 600; margin-left: 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .ln { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.hbars .hb { display: grid; grid-template-columns: minmax(90px, 38%) 1fr 64px; align-items: center; gap: 10px; padding: 5px 0; }
.hbars .hb .l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); font-size: 13px; }
.hbars .hb .bar { height: 8px; background: var(--fill); border-radius: 4px; position: relative; }
.hbars .hb .bar > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 4px; min-width: 3px; }
.hbars .hb .v { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; }
.spark { display: block; }

/* ------------------------------------------------------------------ Nachrichten */
.news-card { display: flex; flex-direction: column; gap: 10px; }
.news-head { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.news-head h3 { font-size: 16px; line-height: 1.35; }
.news-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--text-muted); }
.kp { margin: 0; padding-left: 18px; }
.kp li { margin: 5px 0; }
.kp sup a { font-size: 10px; margin-left: 2px; }
.articles { list-style: none; margin: 0; padding: 0; }
.articles li { padding: 10px 0; border-top: 0.5px solid var(--border); display: flex; gap: 10px; }
.articles .n { color: var(--text-muted); font-size: 11px; min-width: 22px; font-variant-numeric: tabular-nums; padding-top: 2px; }
.articles a { color: var(--text-primary); font-weight: 500; }
.articles a:hover { color: var(--accent); opacity: 1; }
details summary { cursor: pointer; color: var(--accent); font-weight: 500; }
.sent { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 12px; }
.sent-bar { width: 60px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--red), var(--gray), var(--green)); position: relative; opacity: .85; }
.sent-bar > i { position: absolute; top: -3px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); transform: translateX(-50%); }
.hl-list { list-style: none; padding: 0; margin: 0; }
.hl-list li { display: flex; gap: 10px; padding: 9px 0; border-top: 0.5px solid var(--border); align-items: center; }
.hl-list li:first-child { border-top: 0; }
.hl-list .sym { font-weight: 600; min-width: 70px; }

/* ------------------------------------------------------------------ Diverses */
.empty-state { text-align: center; padding: 48px 16px; color: var(--text-secondary); }
.empty-state h2 { margin-bottom: 8px; color: var(--text-primary); }
.loading { opacity: .55; transition: opacity .2s; pointer-events: none; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--fill-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.notice { padding: 12px 14px; border-radius: 12px; background: var(--surface-1); font-size: 13px; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center; }
.notice.warn { background: color-mix(in srgb, var(--orange) 14%, var(--surface-1)); }
.notice.error { background: color-mix(in srgb, var(--red) 12%, var(--surface-1)); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 0; font-size: 13.5px; margin: 0; }
.kv dt, .kv dd { padding: 8px 0; border-top: 0.5px solid var(--border); }
.kv dt:first-of-type, .kv dd:first-of-type { border-top: 0; }
.kv dt { color: var(--text-secondary); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }

/* ------------------------------------------------------------------ Dialoge & Hinweise */
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .32); backdrop-filter: blur(3px); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px; overflow-y: auto; animation: fade .15s; }
.modal { background: var(--surface-1); border-radius: 16px; width: 100%; max-width: 540px; box-shadow: var(--shadow-pop); animation: pop .2s cubic-bezier(.2, .9, .3, 1.2); }
.modal.wide { max-width: 920px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 6px; }
.modal-body { padding: 14px 20px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 0.5px solid var(--border); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; max-width: min(460px, calc(100vw - 32px)); }
.toast { background: rgba(30, 30, 32, .86); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); color: #fff; padding: 10px 18px; border-radius: 999px; box-shadow: var(--shadow-pop); font-size: 13px; font-weight: 500; animation: tin .25s cubic-bezier(.2, .9, .3, 1.2); text-align: center; }
.toast.error { background: rgba(215, 0, 21, .92); }
.toast.ok::before { content: "✓ "; color: #30d158; font-weight: 700; }
@keyframes tin { from { transform: translateY(10px) scale(.96); opacity: 0; } }
.login { max-width: 360px; margin: 14vh auto; }

/* ------------------------------------------------------------------ Analyse & Ideen */
.hero { text-align: center; padding: 40px 12px 30px; }
.hero h1 { font-size: 40px; margin-bottom: 8px; letter-spacing: -0.03em; }
.hero p { max-width: 620px; margin: 0 auto 22px; font-size: 16px; }
.search.big { max-width: 620px; margin: 0 auto; }
.search.big input { padding: 15px 16px 15px 46px; font-size: 17px; border-radius: 14px; background: var(--surface-1); box-shadow: var(--shadow), 0 0 0 0.5px var(--border); }
.search.big input:focus { box-shadow: 0 0 0 4px var(--focus); }
.search.big > svg { left: 16px; width: 20px; height: 20px; }
.hero .quick { justify-content: center; margin-top: 16px; }
a.chip:hover { background: var(--accent); color: #fff; opacity: 1; }
.chip.check { cursor: pointer; padding: 6px 14px; }
.chip.check input { position: absolute; opacity: 0; pointer-events: none; }
.chip.on { background: var(--accent); color: #fff; }
.chip.check::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--text-muted); display: inline-block; box-sizing: border-box; }
.chip.check.on::before { border-color: #fff; background: #fff; box-shadow: inset 0 0 0 3.5px var(--accent); }
.chip.check:focus-within { box-shadow: 0 0 0 3px var(--focus); }
.score-pill { display: inline-flex; min-width: 36px; justify-content: center; padding: 2px 9px; border-radius: 999px; font-weight: 700; font-size: 12.5px;
  color: #fff; background: var(--c); font-variant-numeric: tabular-nums; }
.score-pill.big { font-size: 17px; padding: 6px 12px; min-width: 52px; border-radius: 12px; }
.ring { position: relative; width: 84px; height: 84px; flex: none; }
.ring svg { width: 84px; height: 84px; transform: rotate(-90deg); }
.ring span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 26px; font-weight: 700; font-family: var(--font-display); letter-spacing: -0.02em; }
.badge.big { font-size: 13px; padding: 4px 11px; margin-top: 4px; }
.sbars { display: flex; flex-direction: column; gap: 9px; }
.sbars.compact { gap: 6px; }
.sbar { display: grid; grid-template-columns: 92px 1fr 30px; align-items: center; gap: 10px; font-size: 13px; }
.sbars.compact .sbar { font-size: 12px; grid-template-columns: 84px 1fr 26px; }
.sbar .l { color: var(--text-secondary); }
.sbar .track { height: 6px; background: var(--fill); border-radius: 3px; position: relative; }
.sbar .track > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; }
.sbar .track > s { position: absolute; top: -3px; bottom: -3px; width: 1.5px; background: var(--baseline); border-radius: 1px; }
.sbar .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.sw { display: grid; grid-template-columns: 1fr; gap: 12px; }
.sw h4 { font-size: 12px; margin-bottom: 4px; }
.sw ul, .ai-pick ul, .idea ul { margin: 0; padding-left: 18px; font-size: 13px; }
.sw li, .ai-pick li { margin: 3px 0; }
.price-big { font-size: 36px; font-weight: 700; letter-spacing: -0.025em; font-family: var(--font-display); font-variant-numeric: tabular-nums; line-height: 1.1; }
.chg-pill { display: inline-flex; padding: 3px 9px; border-radius: 7px; color: #fff; font-weight: 600; font-size: 13.5px; font-variant-numeric: tabular-nums; background: var(--gray); white-space: nowrap; }
.chg-pill.up { background: var(--up-line); }
.chg-pill.down { background: var(--down-line); }
.chg-pill.sm { font-size: 12px; padding: 2px 7px; border-radius: 6px; min-width: 66px; justify-content: flex-end; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 12px 16px; padding-top: 14px; border-top: 0.5px solid var(--border); }
.idea .kpis { border-top: 0; padding-top: 0; }
.kpi .v { font-weight: 600; font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mtable { font-size: 13.5px; }
.mtable th, .mtable td { padding: 8px 6px; }
.mtable th { position: static; }
.mtable td:first-child { color: var(--text-secondary); cursor: help; }
.help-dot { display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; background: var(--fill); font-size: 9px; font-weight: 700; color: var(--text-muted); margin-left: 3px; }
tr.self td { background: var(--accent-wash); }
.ai-card { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, var(--surface-1)), var(--surface-1) 140px); }
.ai-card h2 svg { color: var(--accent); }
.verdict-line { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; margin: 14px 0 8px; font-size: 16px; }
.ai-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; }
.ai-sec h4 { font-size: 13px; color: var(--text-secondary); margin: 10px 0 4px; }
.ai-sec p { margin: 0; }
.filters { display: flex; flex-direction: column; gap: 14px; }
.frow { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.flabel { font-size: 12px; font-weight: 600; color: var(--text-muted); min-width: 64px; }
.strat { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; flex: 1; }
.strat button { flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 2px; white-space: normal; text-align: left; padding: 10px 12px; color: var(--text-primary); border-radius: 12px; background: var(--fill); }
.strat button span { font-size: 11.5px; color: var(--text-muted); font-weight: 400; }
.strat button.on { background: var(--accent); color: #fff; }
.strat button.on span { color: rgba(255, 255, 255, .85); }
.idea { display: flex; flex-direction: column; gap: 14px; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.idea:hover { transform: translateY(-2px); box-shadow: var(--shadow-pop); }
.idea h3 { font-size: 17px; }
.rank { width: 30px; height: 30px; border-radius: 50%; background: var(--fill); display: grid; place-items: center; font-weight: 700; flex: none; font-size: 14px; }
.ai-pick { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.ai-pick p { margin: 0 0 8px; }
.ai-pick h4 { font-size: 12px; margin-bottom: 2px; }

/* ------------------------------------------------------------------ Responsive */
@media (max-width: 1180px) {
  .g4, .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-2-1, .g-1-2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 60; transform: translateX(-100%); transition: transform .25s cubic-bezier(.2, .9, .3, 1); box-shadow: var(--shadow-pop); background: var(--surface-1); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, .3); z-index: 50; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 8px 12px; }
  .content { padding: 16px 14px 40px; }
  .g2, .g3, .g4, .cols2, .form-grid, .ai-grid { grid-template-columns: 1fr; }
  .hide-sm { display: none !important; }
  h1 { font-size: 26px; }
  .hero { padding: 20px 4px 18px; }
  .hero h1 { font-size: 30px; }
  .price-big { font-size: 30px; }
  .sbar { grid-template-columns: 80px 1fr 26px; }
  .card { padding: 16px; }
  .search { min-width: 44px; }
  .strat { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cell-name { min-width: 0; max-width: 46vw; }
  .cell-name .name, .cell-name .sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  table td:first-child, table th:first-child { padding-left: 14px; }
  table td:last-child, table th:last-child { padding-right: 14px; }
}

/* ------------------------------------------------------------------ iPhone: Tab-Leiste, sichere Bereiche */
.tabbar { display: none; }
.tab-badge { position: absolute; top: 2px; left: calc(50% + 6px); background: var(--red); color: #fff; font-style: normal; font-size: 11px; font-weight: 700;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: grid; place-items: center; }
.login { max-width: 340px; margin: 16vh auto 0; padding: 0 20px; text-align: center; }
.login-icon { border-radius: 20px; box-shadow: var(--shadow-pop); margin-bottom: 18px; }
.login h1 { margin-bottom: 6px; }
.login form { margin-top: 22px; display: flex; flex-direction: column; }
.login input, .login button { width: 100%; padding: 12px 14px; font-size: 16px; border-radius: 12px; }
@media (max-width: 860px) {
  .menu-btn { display: none !important; }
  .topbar .grow { display: none; }
  .sidebar { display: none; }
  .topbar { padding: calc(8px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right)) 8px calc(12px + env(safe-area-inset-left)); }
  .content { padding-left: calc(14px + env(safe-area-inset-left)); padding-right: calc(14px + env(safe-area-inset-right));
    padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; justify-content: space-around;
    padding: 6px env(safe-area-inset-right) calc(4px + env(safe-area-inset-bottom)) env(safe-area-inset-left);
    background: var(--material); backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px);
    border-top: 0.5px solid var(--border-strong); }
  .tabbar a { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 500;
    color: var(--gray); padding: 2px 0; -webkit-tap-highlight-color: transparent; }
  .tabbar a.active { color: var(--accent); }
  .tabbar a:hover { opacity: 1; }
  .toasts { bottom: calc(96px + env(safe-area-inset-bottom)); }
  input, select, textarea { font-size: 16px; }  /* verhindert Zoom beim Fokussieren auf iOS */
  .search input { font-size: 16px; }
}
@media (display-mode: standalone) {
  body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  input, textarea, p, li, td { -webkit-user-select: text; user-select: text; }
}

@media print {
  .sidebar, .topbar, button { display: none !important; }
  .app { display: block; }
  .card { box-shadow: none; break-inside: avoid; }
}
