:root {
  --bg: #0A0D0B;
  --surface: #121712;
  --surface-2: #1A211B;
  --surface-hover: #212921;
  --border: #2A332A;
  --text: #F2F2F1;
  --text-muted: #9CA39A;
  --accent: #D4AF37;
  --accent-fg: #12261F;
  --accent-hover: #E4C25E;
  --accent-pos: #22C55E;
  --accent-neg: #F87171;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --radius: var(--radius-md);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow-md: 0 8px 24px rgba(0,0,0,.35);
  --font-display: "Manrope", "Inter", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

/* InnerCapital-Markentheme (abgelöst: neutrales Indigo-SaaS-Theme ohne
   Bezug zum Logo). Farben aus media/InnerCapitalLogo.png abgeleitet:
   dunkles Waldgrün (Baum/Wurzeln) als Grundton, Gold (Ring/Balken) als
   Akzent. --accent-pos/--accent-neg bleiben bewusst neutrales Grün/Rot
   (Finanz-Konvention Gewinn/Verlust, siehe frontend.md) statt Markenfarben,
   damit sie sich klar vom Akzent-Gold unterscheiden.
   Wird per data-theme="light" auf <html> aktiviert (siehe base.html). */
:root[data-theme="light"] {
  --bg: #FAF9F5;
  --surface: #FFFFFF;
  --surface-2: #F5F3EC;
  --surface-hover: #EDEAE0;
  --border: #E6E2D6;
  --text: #151A16;
  --text-muted: #6E6B5F;
  --accent: #8A6416;
  --accent-fg: #FFFFFF;
  --accent-hover: #6E4F0E;
  --accent-pos: #16A34A;
  --accent-neg: #DC2626;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.08);
  --shadow-md: 0 8px 24px rgba(15,23,42,.10);
}

/* Breakpoint-Konvention (CSS kennt ohne Präprozessor keine wiederverwend-
   baren Media-Query-Variablen - daher als Kommentar dokumentiert, JEDE
   neue/überarbeitete Media-Query soll sich an einem dieser 3 Werte
   orientieren statt neue ad-hoc-Breakpoints einzuführen):
   640px  - Formulare/Filter werden einspaltig
   860px  - Hauptnav klappt zu Hamburger-Menü, Sidebar wird static/full-width
   1080px - Layout-Grid bekommt schmalere Sidebar-Spalte */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* ---- Overflow-Schutz (global) ----
   Ursache der gemeldeten Layout-Bugs (Formularfelder liefen aus Sidebar/
   Panel heraus): native <input>/<select>-Elemente haben eine intrinsische
   Mindestbreite, die in CSS-Grid/Flex ohne explizites min-width:0 die
   Track-/Containerbreite aushebelt. Diese Regel gilt ab sofort für JEDES
   Template - jedes neue Grid/Flex mit Formularelementen als Kindern MUSS
   zusätzlich minmax(0, ...) auf seinen Tracks nutzen (siehe .criterion-row
   weiter unten als Beispiel). */
input, select, textarea, button { min-width: 0; font: inherit; }
.field { width: 100%; min-width: 0; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; }
.layout, .sidebar, .filter-grid, .criteria-builder, .criterion-row { min-width: 0; }
.criterion-row > * { min-width: 0; }
code { overflow-wrap: anywhere; }
.hint-text { overflow-wrap: anywhere; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  transition: background-color 0.15s ease, color 0.15s ease;
}

a { color: inherit; }

/* ---- Topbar ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-link { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-mark { color: var(--accent); font-size: 20px; }
.brand-logo { height: 32px; width: 32px; object-fit: contain; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 0.01em;
}

/* ---- Topnav: Direktlinks + gruppierte Dropdowns ---- */
.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.topnav a,
.nav-group-trigger {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: var(--radius);
  transition: color 0.15s ease, background-color 0.15s ease;
}
.topnav a:hover,
.nav-group-trigger:hover { color: var(--text); background: var(--surface-2); }
.topnav a.active,
.nav-group-menu a.active { color: var(--accent); }
.nav-caret { font-size: 9px; display: inline-block; margin-left: 2px; transition: transform 0.15s ease; }
.nav-group.open .nav-caret { transform: rotate(180deg); }

.nav-group { position: relative; }
.nav-group-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  z-index: 50;
  flex-direction: column;
  gap: 2px;
}
.nav-group.open .nav-group-menu { display: flex; }
.nav-group-menu a { text-transform: none; letter-spacing: normal; font-size: 13px; padding: 8px 10px; }
.nav-group-label { display: none; } /* nur auf Mobile relevant, siehe unten */
.notif-bell-group { position: relative; }
.notif-bell-trigger { position: relative; font-size: 15px; padding: 8px 10px; text-transform: none; }
.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--accent-neg);
  color: #fff;
  font-size: 10px;
  line-height: 15px;
  text-align: center;
  font-family: var(--font-mono);
}
.notif-panel { min-width: 320px; max-width: 360px; padding: 0; right: 0; left: auto; }
.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.notif-panel-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.notif-mark-all {
  font-size: 12px;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  font-family: inherit;
}
.notif-mark-all:hover { text-decoration: underline; }
.notif-list { max-height: 360px; overflow-y: auto; display: flex; flex-direction: column; }
.notif-item {
  display: block;
  text-align: left;
  width: 100%;
  padding: 10px;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
  background: none;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { border-left-color: var(--accent); background: var(--surface-2); }
.notif-item-title { font-size: 13px; font-weight: 600; margin: 0 0 2px; }
.notif-item-message { font-size: 12px; color: var(--text-muted); margin: 0 0 4px; white-space: pre-line; }
.notif-item-time { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }
.notif-empty { padding: 16px 10px; font-size: 13px; color: var(--text-muted); text-align: center; margin: 0; }
.nav-user-group { margin-left: 8px; }
.nav-user-trigger { text-transform: none; letter-spacing: normal; }
.nav-user { color: var(--accent); font-size: 13px; }
.nav-inline-form { display: block; }
.nav-logout {
  width: 100%;
  text-align: left;
  color: var(--accent-neg);
  padding: 8px 10px;
  font-size: 13px;
  border-radius: var(--radius);
}
.nav-logout:hover { background: var(--surface-2); }

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 36px;
  height: 36px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}
.hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.hamburger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: border-color 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle .icon-dark { display: none; }
.theme-toggle .icon-light { display: inline; }
:root[data-theme="light"] .theme-toggle .icon-dark { display: inline; }
:root[data-theme="light"] .theme-toggle .icon-light { display: none; }

/* ---- Wealth View/Expert View-Umschalter (siehe base.html, ui_mode.js) ---- */
.ui-mode-switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  padding: 2px;
  flex-shrink: 0;
  gap: 2px;
}
.ui-mode-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.ui-mode-btn:hover { color: var(--text); }
.ui-mode-btn.active { background: var(--accent); color: var(--accent-fg); }
.ui-mode-btn:disabled { opacity: 0.6; cursor: wait; }

/* ---- Mobile Navigation (<=860px) ---- */
@media (max-width: 860px) {
  .topbar { padding: 14px 16px; flex-wrap: wrap; }
  .hamburger { display: flex; order: 2; }
  .brand { order: 1; }

  .topnav {
    display: none;
    order: 3;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
  }
  .topnav.open { display: flex; }

  .topnav a,
  .nav-group-trigger { width: 100%; text-align: left; padding: 12px 8px; font-size: 14px; }
  .nav-group-trigger { pointer-events: none; } /* auf Mobile nur Abschnitts-Ueberschrift, siehe .nav-group-label */
  .nav-group-trigger .nav-caret { display: none; }
  .nav-group-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 10px 8px 2px;
  }
  .nav-group-menu {
    display: flex !important;
    position: static;
    border: none;
    box-shadow: none;
    padding: 0;
    background: none;
  }
  .nav-group-menu a { padding: 10px 8px 10px 16px; font-size: 14px; }
  .nav-user-group { margin-left: 0; }
  .nav-user-trigger { padding: 0; }
  .nav-user-trigger .nav-user { display: block; padding: 10px 8px 2px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }

  .ui-mode-switch { order: 4; align-self: flex-start; margin-top: 4px; }
  .theme-toggle { order: 5; margin-left: auto; }
}

/* ---- Flash messages ---- */
.flash-stack { padding: 12px 28px 0; display: flex; flex-direction: column; gap: 8px; }
.flash {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  border: 1px solid var(--border);
}
.flash-success { border-color: var(--accent-pos); color: var(--accent-pos); }
.flash-warning { border-color: var(--accent); color: var(--accent); }
.flash-error { border-color: var(--accent-neg); color: var(--accent-neg); }

/* ---- Layout ---- */
main { padding: 24px 28px 60px; }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.sidebar { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 16px; min-width: 0; max-width: 100%; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.panel-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--text);
}

/* Admin-Panel (siehe templates/admin/) - eigene, kleine Utility-Klassen
   statt Inline-style-Attributen, damit /admin/... eine strikte
   Content-Security-Policy ohne 'unsafe-inline' fahren kann (siehe
   webapp/admin/__init__.py). */
.admin-login-panel { max-width: 400px; margin: 60px auto; }
.admin-search-form { margin-bottom: 16px; }
.admin-inline-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.admin-permission-matrix th, .admin-permission-matrix td { white-space: normal; }
.admin-permission-cell { text-align: center; }
.admin-permission-category-row td {
  background: var(--surface-2);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.panel-subtitle {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 14px 0 8px;
}

/* ---- Forms ---- */
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--text-muted);
}
.field-compact { margin-bottom: 0; }

.field input,
.field select,
.field textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 7px 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.field textarea { resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.cf-filter {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 7px 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.cf-filter:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.data-table thead th a[data-sort] { cursor: pointer; user-select: none; }
.data-table thead th a[data-sort]::after { content: ""; margin-left: 4px; }
.data-table thead th a[data-sort][data-dir="asc"]::after { content: "\2191"; }
.data-table thead th a[data-sort][data-dir="desc"]::after { content: "\2193"; }

.etf-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 20;
  margin-top: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  max-height: 260px;
  overflow-y: auto;
}
.etf-search-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 9px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
}
.etf-search-item:last-child { border-bottom: none; }
.etf-search-item:hover,
.etf-search-item.is-active {
  background: var(--surface);
}
.etf-search-item .etf-search-ticker {
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
}
.etf-search-item .etf-search-meta {
  color: var(--text-muted);
  font-size: 11px;
}
.etf-search-empty {
  padding: 8px 9px;
  color: var(--text-muted);
  font-size: 12px;
}

.filter-group { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 10px; }
.filter-group summary {
  cursor: pointer;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 10px;
}
.filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 10px;
  margin-top: 8px;
}

/* ---- Eigener Strategie-Baukasten (custom_strategies.html) ---- */
.criteria-builder {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 420px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  min-width: 0;
}
.criterion-row {
  display: grid;
  grid-template-columns: minmax(0,16px) minmax(0,1fr) minmax(0,1fr) minmax(0,56px) minmax(0,64px) minmax(0,64px);
  gap: 6px;
  align-items: center;
  min-width: 0;
}
.criterion-row-index {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  text-align: center;
}
.criterion-row select,
.criterion-row input {
  font-size: 11.5px;
  padding: 6px 6px;
}
.custom-strategy-card { display: block; }

.criterion-row-header {
  padding: 0 0 4px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.criterion-row-header span:first-child { visibility: hidden; }

.page-stack { display: flex; flex-direction: column; gap: var(--space-5); }
.builder-panel { max-width: 900px; }

@media (max-width: 640px) {
  .criterion-row, .criterion-row-header { grid-template-columns: 16px 1fr; grid-template-rows: auto auto auto auto auto; }
  .criterion-row-header { display: none; }
}

.btn {
  display: inline-block;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  padding: 9px 14px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.btn:hover { background: var(--accent); color: var(--accent-fg); }
.btn-primary { width: 100%; }
.btn-block { width: 100%; margin-top: 16px; }

.btn-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn-link:hover { color: var(--text); }

.tab-link {
  margin-top: 0;
  padding: 8px 14px;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
}
.tab-link:hover { color: var(--text); }
.tab-link.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }

.update-form { display: flex; flex-direction: column; }

/* ---- Results ---- */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  font-size: 12.5px;
  color: var(--text-muted);
}
.result-count { font-family: var(--font-mono); color: var(--accent); }

/* ---- Pagination ---- */
.pagination {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 10px 0;
}
.pagination-info { font-family: var(--font-mono); color: var(--accent); white-space: nowrap; }
.pagination-pages {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pagination-pages .btn-link { margin: 0; }
.pagination-current { font-family: var(--font-mono); white-space: nowrap; }
.per-page-select {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.per-page-option {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 2px 6px;
  border: 1px solid transparent;
  border-radius: var(--radius);
}
.per-page-option:hover { color: var(--text); }
.per-page-option.active {
  color: var(--accent);
  border-color: var(--accent);
}

.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: auto;
  background: var(--surface);
}

.data-table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 13px; }
.data-table th, .data-table td { padding: 10px 12px; text-align: left; white-space: nowrap; }
.data-table thead th {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-body);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  position: sticky;
  top: 0;
}
.data-table thead th a { text-decoration: none; color: inherit; }
.data-table thead th a.active { color: var(--accent); }
.sort-arrow { margin-left: 3px; font-size: 9px; }

.data-table tbody tr { border-bottom: 1px solid var(--border); }
.data-table tbody tr:hover { background: var(--surface-2); }

.ticker-tag {
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
  text-decoration: none;
}
a.ticker-tag:hover, a.company-name-link:hover { text-decoration: underline; }

.company-name-link { color: inherit; text-decoration: none; }
.company-name-link:hover { text-decoration: underline; }

.isin-text {
  color: var(--text-muted);
  font-size: 11.5px;
  letter-spacing: 0.02em;
}

/* ---- Data bars (Signaturelement) ---- */
.databar-wrap { display: flex; align-items: center; gap: 8px; }
.databar-value { min-width: 52px; }
.databar-track {
  position: relative;
  width: 60px;
  height: 6px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
}
.databar-fill { position: absolute; top: 0; left: 0; height: 100%; }
.databar-fill.pos { background: var(--accent-pos); }
.databar-fill.neg { background: var(--accent-neg); }
.databar-fill.warn { background: #F59E0B; }

/* ---- Empty state ---- */
.empty-state {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}
.empty-headline {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--text);
  margin-bottom: 6px;
}

/* ---- History page ---- */
.history-page, .settings-page { max-width: 760px; margin: 0 auto; }
.history-title { font-family: var(--font-mono); font-size: 26px; color: var(--accent); margin: 8px 0 20px; }
.back-link { margin-bottom: 4px; }
.history-form { margin-bottom: 20px; max-width: 260px; }
.chart-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}
.history-table { width: 100%; border: 1px solid var(--border); border-radius: var(--radius); }

/* ---- Firmenprofil: Kurschart (KLineChart, siehe price-chart.js) ---- */
.company-profile-page { max-width: 980px; }

.price-chart-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.price-chart-toolbar-group { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.price-chart-toolbar-label { font-size: 11px; color: var(--text-muted); margin-right: 2px; }

.price-chart-btn {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 9px;
  cursor: pointer;
  line-height: 1.4;
}
.price-chart-btn:hover { color: var(--text); }
.price-chart-btn.active {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}
.price-chart-btn-clear { margin-left: 4px; }

.price-chart-body { display: flex; gap: 16px; align-items: flex-start; }
.price-chart-canvas { flex: 1 1 auto; min-width: 0; height: 460px; }
.price-chart-empty { flex: 1 1 auto; margin: 60px 0; text-align: center; }

.price-chart-side {
  flex: 0 0 190px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.price-chart-side-row { display: flex; justify-content: space-between; gap: 8px; color: var(--text); }
.price-chart-side-row span:first-child { color: var(--text-muted); }
.price-chart-side-sep { border: none; border-top: 1px solid var(--border); margin: 4px 0; }

@media (max-width: 720px) {
  .price-chart-body { flex-direction: column; }
  .price-chart-side { flex: 1 1 auto; flex-direction: row; flex-wrap: wrap; }
  .price-chart-side-row { flex: 1 1 45%; }
}

/* ---- Footer ---- */
.footer {
  padding: 20px 28px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11.5px;
  text-align: center;
}
.footer-brand {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--text);
  margin-bottom: 6px;
}
.footer-links { margin-top: 10px; display: flex; gap: 16px; justify-content: center; }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--accent); }

.cookie-banner,
.disclaimer-banner {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 12px 28px;
}
.cookie-banner p,
.disclaimer-banner p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
  max-width: 900px;
}
.cookie-banner form,
.disclaimer-banner form { flex-shrink: 0; }

.disclaimer-banner {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  border-bottom: 1px solid var(--accent);
}
.cookie-banner {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.landing { max-width: 980px; margin: 0 auto; padding: 20px 24px 60px; }
.landing-hero { text-align: center; padding: 48px 12px 40px; }
.landing-hero-logo { height: 88px; width: 88px; object-fit: contain; }
.landing-hero-slogan {
  margin: 10px 0 0;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
  text-transform: uppercase;
}
.landing-hero h1 {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  margin: 0 0 18px;
  line-height: 1.25;
}
.landing-lead {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 28px;
  line-height: 1.6;
}
.landing-cta { display: flex; gap: 12px; justify-content: center; }

.landing-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 20px;
}
.landing-feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.landing-feature h2 {
  font-family: var(--font-display);
  font-size: 16px;
  margin: 0 0 10px;
  color: var(--accent);
}
.landing-feature p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

.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;
}

.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.plan-grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1000px) { .plan-grid-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { .plan-grid-4 { grid-template-columns: 1fr; } }

/* ---- Monatlich/Jährlich-Umschalter (siehe subscribe.html, subscribe.js) ---- */
.billing-period-switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  padding: 2px;
  gap: 2px;
}
.period-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.period-btn:hover { color: var(--text); }
.period-btn.active { background: var(--accent); color: var(--accent-fg); }

/* ---- Feature-Vergleich je Tarif-Karte (siehe pricing.html, subscribe.html, _pricing_macros.html) ---- */
.feature-checklist {
  list-style: none; margin: 16px 0 0; padding: 0; text-align: left;
  display: flex; flex-direction: column; gap: 7px;
}
.feature-checklist li { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.4; }
.feature-check-icon { flex-shrink: 0; width: 16px; text-align: center; font-weight: 700; }
.feature-checklist .feature-included { color: var(--text); }
.feature-checklist .feature-included .feature-check-icon { color: var(--accent-pos); }
.feature-checklist .feature-excluded { color: var(--text-muted); }
.feature-checklist .feature-excluded .feature-check-icon { color: var(--text-muted); }
.plan-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; text-align: center;
}
.plan-card-highlight { border-color: var(--accent); }
.plan-card h2 { font-family: var(--font-display); font-size: 17px; margin: 0 0 10px; }
.plan-badge {
  display: inline-block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em;
  background: var(--accent); color: var(--bg); padding: 2px 8px; border-radius: 999px; margin-left: 6px;
  vertical-align: middle;
}
.plan-price { font-family: var(--font-display); font-size: 30px; font-weight: 700; margin: 10px 0 18px; }
.plan-price span { font-size: 13px; color: var(--text-muted); font-weight: 400; }
.legal-page { max-width: 720px; margin: 0 auto; }
.legal-draft-warning {
  background: color-mix(in srgb, var(--accent-neg) 15%, var(--surface));
  border: 1px solid var(--accent-neg); border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 20px; font-size: 13px; line-height: 1.6;
}
.consent-checkbox {
  display: flex; align-items: flex-start; gap: 8px; text-align: left;
  font-size: 11.5px; color: var(--text-muted); line-height: 1.5; margin: 14px 0;
}
.consent-checkbox input { margin-top: 3px; flex-shrink: 0; }
@media (max-width: 700px) { .plan-grid { grid-template-columns: 1fr; } }

.landing-disclaimer {
  margin-top: 32px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.landing-disclaimer p {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

@media (max-width: 700px) {
  .landing-features { grid-template-columns: 1fr; }
  .landing-hero h1 { font-size: 26px; }
}

/* ---- Strategy cards ---- */
.strategy-list { display: flex; flex-direction: column; gap: 8px; }
.strategy-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--surface-2);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.strategy-card:hover { border-color: var(--accent); }
.strategy-card.selected { border-color: var(--accent); background: rgba(201, 162, 93, 0.08); }
.strategy-card input { display: none; }
.strategy-card-label { font-weight: 600; font-size: 13px; color: var(--text); }
.strategy-card-desc { font-size: 11.5px; color: var(--text-muted); line-height: 1.45; }

/* ---- Strategy header on results ---- */
.strategy-header { margin-bottom: 20px; }
.strategy-title { font-family: var(--font-display); font-size: 24px; margin: 0 0 6px; color: var(--accent); }
.strategy-description { color: var(--text-muted); font-size: 13px; max-width: 640px; line-height: 1.55; }

/* ---- Recommendation cards ---- */
.rec-list { display: flex; flex-direction: column; gap: 10px; }
.rec-group-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin: 18px 0 8px;
}
.rec-group-label:first-child { margin-top: 0; }
.rec-card {
  display: grid;
  grid-template-columns: minmax(0,32px) minmax(0,1fr) minmax(0,120px) minmax(0,70px);
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  min-width: 0;
}
.rec-rank {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}
.rec-heading { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.rec-quote {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.ki-analyse-link {
  display: inline-block;
  margin-left: 8px;
  font-size: 11px;
  white-space: nowrap;
}

.gemini-analysis {
  white-space: pre-wrap;
  line-height: 1.6;
  font-size: 13.5px;
}

.sell-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.sell-badge-sell { background: color-mix(in srgb, var(--accent-neg) 20%, transparent); color: var(--accent-neg); }
.sell-badge-watch { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent); }
.sell-badge-hold { background: color-mix(in srgb, var(--accent-pos) 20%, transparent); color: var(--accent-pos); }
.sell-reasons {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  max-width: 260px;
  line-height: 1.4;
}

.glossary-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-left: 4px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  cursor: help;
  vertical-align: middle;
}
.glossary-tip:hover,
.glossary-tip:focus {
  background: var(--accent);
  color: var(--bg);
  outline: none;
}
.rec-name { font-weight: 600; font-size: 14px; }
.rec-sector { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.rec-reasons {
  margin: 0;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.6;
}
.rec-weak-points {
  margin: 4px 0 0;
  padding-left: 18px;
  color: var(--accent-neg);
  opacity: 0.85;
  font-size: 12.5px;
  line-height: 1.6;
}

/* -- Expert View: Faktor-Breakdown je Empfehlung (siehe strategies.py::
   score_stock() -> factor_breakdown, recommend.html) -- */
.factor-breakdown { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.factor-breakdown-row { display: flex; align-items: center; gap: 8px; font-size: 11.5px; }
.factor-breakdown-label { flex: 0 0 120px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.factor-breakdown-track { flex: 1; width: auto; }
.factor-breakdown-pct { flex: 0 0 28px; text-align: right; font-family: var(--font-mono); color: var(--text-muted); }
.rec-score { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.rec-score-value { font-family: var(--font-mono); font-size: 18px; font-weight: 600; color: var(--text); }
.score-track {
  width: 100px;
  height: 5px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
}
.score-fill { height: 100%; }
.score-fill.high { background: var(--accent-pos); }
.score-fill.mid { background: var(--accent); }
.score-fill.low { background: var(--accent-neg); }
.rec-actions { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.rec-actions .btn-link { margin: 0; text-align: right; }

@media (max-width: 700px) {
  .rec-card { grid-template-columns: 1fr; text-align: left; }
  .rec-score { align-items: flex-start; }
}

/* ---- Nav auth ---- */
.nav-user { color: var(--accent); font-size: 13px; margin-left: 4px; }
.nav-inline-form { display: inline; }
.link-button {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  font-family: var(--font-body);
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-button:hover { color: var(--accent-neg); }

/* ---- Auth pages ---- */
.auth-page { max-width: 380px; margin: 40px auto; }
.auth-brand { text-align: center; margin-bottom: 20px; }
.auth-brand-logo { height: 64px; width: 64px; object-fit: contain; }
.auth-brand-slogan {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-size: 12.5px;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}
.auth-panel { padding: 24px; }
.auth-form { display: flex; flex-direction: column; gap: 4px; }
.auth-switch { margin-top: 16px; font-size: 12.5px; color: var(--text-muted); text-align: center; }
.auth-switch a { color: var(--accent); text-decoration: underline; }

.btn-danger { border-color: var(--accent-neg); color: var(--accent-neg); }
.btn-danger:hover { background: var(--accent-neg); color: var(--bg); }

/* ---- Badges ---- */
.badge {
  display: inline-block;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.badge-real { color: var(--accent-pos); border-color: var(--accent-pos); }
.badge-virtual { color: var(--accent); border-color: var(--accent); }
.badge-buy { color: var(--accent-pos); border-color: var(--accent-pos); }
.badge-sell { color: var(--accent-neg); border-color: var(--accent-neg); }
.badge-strategy {
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
}
.badge-strategy:hover { color: var(--accent); border-color: var(--accent); }
.badge-ai { color: var(--text-muted); }

.blog-disclaimer {
  font-size: 12.5px;
  color: var(--text-muted);
  background: var(--bg-elevated, transparent);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 20px;
}

.pos-text { color: var(--accent-pos); }
.neg-text { color: var(--accent-neg); }
.accent-gold { color: var(--accent); }

/* ---- Buy/Sell-Umschalter (trade.html) ---- */
.action-switch {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.action-option {
  flex: 1;
  text-align: center;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-2);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.action-option input { display: none; }
.action-option.active { color: var(--accent); border-color: var(--accent); }

/* ---- Orderbuch ---- */
.orders-page { max-width: 980px; margin: 0 auto; }
.depot-filter-form select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 7px 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.col-note { color: var(--text-muted); max-width: 220px; white-space: normal; }
.row-buy-link, .row-sell-link { font-size: 11.5px; }

/* ---- Depot list ---- */
.depot-list { display: flex; flex-direction: column; gap: 12px; }
.depot-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s ease;
}
.depot-card:hover { border-color: var(--accent); }
.depot-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.depot-name { font-family: var(--font-display); font-weight: 600; font-size: 16px; }
.depot-strategy { font-size: 11px; color: var(--text-muted); }
.depot-stats { display: flex; gap: 28px; margin-top: 12px; }
.stat-label { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 2px; }
.stat-value { font-family: var(--font-mono); font-size: 14px; }

/* ---- Depot detail ---- */
.depot-detail { max-width: 920px; margin: 0 auto; }
.depot-detail-header { display: flex; align-items: center; gap: 12px; margin: 8px 0 20px; flex-wrap: wrap; }
.depot-detail-header .history-title { margin: 0; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.stat-value-lg { display: block; font-family: var(--font-mono); font-size: 19px; margin-top: 4px; }
.hint-text { color: var(--accent); font-size: 12.5px; margin-bottom: 20px; }
.section-title { font-family: var(--font-display); font-size: 17px; margin: 28px 0 12px; }
.txn-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.txn-form .field { margin-bottom: 0; min-width: 110px; }
.delete-depot-form { margin: 32px 0 8px; }

/* ---- Export/Import (data_io) ---- */
.export-links {
  font-size: 11.5px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.export-links .btn-link { margin: 0; }

/* ---- Cashflow-Portfolio-Vorschlag ---- */
.allocation-panel {
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 24px;
}
.allocation-panel .panel-title { display: block; margin-bottom: 14px; }
.allocation-panel .hint-text { color: var(--text-muted); font-weight: 400; }
.rec-card-picked { border-color: var(--accent); }

@media (max-width: 700px) {
  .stat-row { grid-template-columns: 1fr 1fr; }
  .depot-stats { flex-wrap: wrap; gap: 16px; }
}

/* ---- Newsportal ---- */
.news-list { display: flex; flex-direction: column; gap: 10px; }
.news-card {
  display: flex;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s ease;
}
.news-card:hover { border-color: var(--accent); }
.news-thumb {
  width: 100px;
  height: 70px;
  object-fit: cover;
  border-radius: var(--radius);
  flex-shrink: 0;
  background: var(--surface-2);
}
.news-body { min-width: 0; }
.news-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}
.news-source { color: var(--accent); font-weight: 600; }
.news-headline { font-family: var(--font-display); font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.news-summary { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }

/* ---- Firmenprofil ---- */
.company-header { margin-bottom: 20px; }
.company-header-top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.company-title { font-family: var(--font-display); font-size: 24px; margin: 0; color: var(--text); }
.company-subline { color: var(--text-muted); font-size: 12.5px; margin-top: 4px; }
.company-price-row { margin-top: 10px; font-family: var(--font-mono); font-size: 20px; }
.company-about-desc { font-size: 13px; line-height: 1.6; color: var(--text); margin: 0 0 14px; }
.company-meta-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px 20px; margin: 0; padding: 0; }
.company-meta-list div { display: flex; flex-direction: column; gap: 2px; }
.company-meta-list dt { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.company-meta-list dd { margin: 0; font-size: 13px; }
.company-quick-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }

@media (max-width: 700px) {
  .news-card { flex-direction: column; }
  .news-thumb { width: 100%; height: 140px; }
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
}

@media (max-width: 860px) {
  /* Einheitliche, schmalere Seitenabstände passend zur mobilen Topbar */
  main { padding: 16px 16px 48px; }
  .flash-stack { padding: 12px 16px 0; }
  .footer { padding: 16px; }
  .cookie-banner,
  .disclaimer-banner { padding: 12px 16px; flex-direction: column; align-items: stretch; }
  .cookie-banner form,
  .disclaimer-banner form { width: 100%; }
  .cookie-banner button,
  .disclaimer-banner button { width: 100%; }

  /* Touch-Ziele vergroessern (Richtwert ~44px) */
  .btn, .btn-link, .link-button {
    padding: 11px 14px;
    font-size: 14px;
  }
  .field input, .field select, .field textarea {
    padding: 10px 10px;
    font-size: 14px;
  }
  .data-table th, .data-table td { padding: 10px 10px; }

  /* Zweispaltige Filterraster auf schmalen Screens einspaltig */
  .filter-grid { grid-template-columns: 1fr; }
}

/* ---- Willkommens-Tutorial (siehe webapp/static/tutorial.js) ---- */
.tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.tutorial-overlay[hidden] { display: none; }
.tutorial-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 460px;
  width: 100%;
  padding: 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.tutorial-step-count {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.tutorial-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  margin: 0 0 10px;
  color: var(--text);
}
.tutorial-body {
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.55;
  margin-bottom: 18px;
}
.tutorial-dots { display: flex; gap: 6px; margin-bottom: 18px; }
.tutorial-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border); }
.tutorial-dot.is-active { background: var(--accent); }
.tutorial-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tutorial-actions .btn { padding: 8px 12px; font-size: 12.5px; }

/* ---- FAQ ---- */
.faq-section { margin-bottom: 28px; }
.faq-section:last-child { margin-bottom: 0; }
.faq-section-title {
  font-family: var(--font-display);
  font-size: 20px;
  margin: 0 0 6px;
  color: var(--accent);
}
.faq-section-intro { color: var(--text-muted); font-size: 13px; max-width: 720px; line-height: 1.55; margin-bottom: 16px; }
.faq-page-list { display: flex; flex-direction: column; gap: 10px; }
.faq-page-item { border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.faq-page-item:last-child { border-bottom: none; }
.faq-page-name { font-weight: 600; font-size: 13.5px; color: var(--text); }
.faq-page-desc { color: var(--text-muted); font-size: 12.5px; line-height: 1.5; margin-top: 2px; }
.faq-strategy-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.faq-strategy-summary { cursor: pointer; list-style-position: outside; }
.faq-strategy-summary::marker { color: var(--accent); }
.faq-strategy-name { font-weight: 600; font-size: 13.5px; color: var(--text); }
.faq-strategy-risk { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); margin-left: 8px; }
.faq-strategy-desc { color: var(--text-muted); font-size: 12.5px; line-height: 1.5; margin-top: 4px; }
.faq-strategy-detail { border-top: 1px solid var(--border); margin-top: 10px; padding-top: 4px; }
.faq-glossary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; }
.faq-glossary-term { font-weight: 600; font-size: 13px; color: var(--text); }
.faq-glossary-def { color: var(--text-muted); font-size: 12.5px; line-height: 1.5; margin-top: 2px; }
@media (max-width: 700px) {
  .faq-glossary-grid { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------------
   Einsteiger-/Profi-Layout (data-experience auf <body>, siehe base.html
   und webapp/web/helpers.py:current_experience_level()). Betrifft das
   gesamte Nutzer-Tool (nicht /admin - admin_base.html setzt das Attribut
   bewusst nicht). Standard/Profi bleibt die bestehende, dichte Darstellung;
   für Einsteiger:innen wird global mehr Luft/größere Schrift gegeben und
   fortgeschrittene Werkzeuge werden in .advanced-panel eingeklappt.
   ------------------------------------------------------------------- */
body[data-experience="beginner"] {
  font-size: 15px;
  line-height: 1.65;
}
body[data-experience="beginner"] .layout { gap: 30px; }
body[data-experience="beginner"] .sidebar { gap: 20px; }
body[data-experience="beginner"] .panel { padding: 20px; }
body[data-experience="beginner"] .panel-title { font-size: 16.5px; }
body[data-experience="beginner"] .field { font-size: 13px; gap: 5px; margin-bottom: 14px; }
body[data-experience="beginner"] .field input,
body[data-experience="beginner"] .field select,
body[data-experience="beginner"] .field textarea { padding: 9px 10px; font-size: 13.5px; }
body[data-experience="beginner"] .btn { padding: 11px 16px; font-size: 14px; }
body[data-experience="beginner"] .hint-text { font-size: 13.5px; line-height: 1.55; }
body[data-experience="beginner"] .data-table { font-size: 13.5px; }
body[data-experience="beginner"] .data-table th,
body[data-experience="beginner"] .data-table td { padding: 13px 14px; }
body[data-experience="beginner"] .glossary-tip { width: 16px; height: 16px; }

/* Fortgeschrittene Werkzeuge/Datenquellen: für Profis sofort offen (dichte
   Standarddarstellung unverändert), für Einsteiger:innen eingeklappt hinter
   einer klar beschrifteten "Profi"-Markierung statt sie ersatzlos zu
   entfernen - die Funktionen bleiben erreichbar. */
.advanced-panel {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--surface-2);
}
.advanced-panel + .advanced-panel { margin-top: 12px; }
.advanced-panel summary {
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}
.advanced-panel[open] summary { margin-bottom: 12px; }

/* -- Gespeicherte Screener-Filter (webapp/templates/index.html, siehe
   stock_screener/services/saved_screen_service.py) -- */
.saved-screen-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.saved-screen-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.saved-screen-item a { font-size: 13px; }
.saved-screen-delete { color: var(--text-muted); font-size: 12px; }
.saved-screen-delete:hover { color: var(--accent-neg); }
.advanced-badge {
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  margin-left: 8px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  color: var(--accent);
  vertical-align: middle;
}

/* Kennzahlen-Spalten, die vor allem Profis etwas sagen (ISIN, Geld/Brief,
   Nettomarge, ROE, ROA) - für Einsteiger:innen ausgeblendet, um die Tabelle
   auf die für den Einstieg wichtigsten Spalten zu verkürzen. KGV (pe_ratio)
   bewusst NICHT dabei: das Willkommens-Tutorial (tutorial.js) nennt KGV als
   Beispiel-Filterkriterium fuer neue Nutzer:innen - die sehen den passenden
   Wert sonst nirgends in der Tabelle. Serverseitig bleiben Sortierung/Daten
   unverändert erreichbar (Profil-Umschaltung zeigt sofort alle Spalten). */
body[data-experience="beginner"] .col-isin,
body[data-experience="beginner"] .col-bid,
body[data-experience="beginner"] .col-ask,
body[data-experience="beginner"] .col-net_margin,
body[data-experience="beginner"] .col-roe,
body[data-experience="beginner"] .col-roa,
body[data-experience="beginner"] .col-high_24h,
body[data-experience="beginner"] .col-low_24h { display: none; }

/* ---------------------------------------------------------------------
   Wealth View / Expert View - Finanzplaner-Dashboard (data-ui-mode auf
   <body>, siehe base.html, ui_mode.js, webapp/web/helpers.py:
   current_ui_mode(), _dashboard_wealth.html/_dashboard_expert.html).
   Unabhängig vom Einsteiger-/Profi-Layout oben: dort geht es um Erklärungen/
   Jargon, hier um welches LAYOUT gerendert wird.
   ------------------------------------------------------------------- */

/* -- Wealth View: Hero-Karte mit Nettovermögen + Verlaufschart -- */
.wealth-hero { margin-bottom: 16px; }
.wealth-hero-top { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.wealth-hero-value { font-family: var(--font-mono); font-size: 34px; margin-top: 4px; }
.wealth-change-badge { font-family: var(--font-mono); font-size: 13px; }

/* -- Wealth View: Depot-Karten (Grid statt Tabelle) -- */
.wealth-depot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.wealth-depot-card .depot-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 16px; }

/* -- Wealth View: Top-Positionen als Chip-Liste -- */
.position-chip-list { display: flex; flex-direction: column; gap: 8px; }
.position-chip {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s ease;
}
.position-chip:hover { border-color: var(--accent); }
.position-ticker { font-family: var(--font-mono); font-weight: 600; min-width: 64px; }
.position-name { flex: 1; color: var(--text-muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.position-value { font-family: var(--font-mono); font-size: 13px; }

/* -- Wealth View: Allokations-Aufschlüsselung (wiederverwendet .databar-*) -- */
.allocation-list { display: flex; flex-direction: column; gap: 10px; }
.allocation-row { display: flex; align-items: center; gap: 10px; }
.allocation-sector { flex: 0 0 96px; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.allocation-track { flex: 1; width: auto; }
.allocation-pct { flex: 0 0 44px; text-align: right; font-family: var(--font-mono); font-size: 12.5px; }

/* -- Wealth View: Insights (rein beobachtend, siehe dashboard_service.
   _build_insights() - keine Anlageberatung) -- */
.insights-panel { border-left: 3px solid var(--accent); }
.insights-list { display: flex; flex-direction: column; gap: 8px; padding-left: 18px; font-size: 13px; color: var(--text-muted); }

/* -- Expert View: dichtes Kennzahlen-Grid statt weniger Stat-Cards -- */
.expert-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px 20px; }
.expert-stat { display: flex; flex-direction: column; }
.expert-stat .stat-value { font-family: var(--font-mono); font-size: 16px; margin-top: 2px; }

/* -- Expert View: Firmenprofil-Kennzahlengruppen (webapp/templates/
   company_profile.html) -- */
.company-metrics-groups { display: flex; flex-direction: column; gap: 18px; }
.company-metrics-group-title { font-family: var(--font-body); font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 8px; }

/* -- Expert View: Gewinner/Verlierer-Streifen -- */
.movers-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.movers-column { display: flex; flex-direction: column; gap: 4px; }
.movers-column-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 4px; }
.mover-chip { display: flex; justify-content: space-between; padding: 6px 8px; border-radius: var(--radius-sm); text-decoration: none; color: var(--text); font-family: var(--font-mono); font-size: 13px; }
.mover-chip:hover { background: var(--surface-hover); }

.expert-shortcuts { display: flex; gap: 10px; margin-bottom: 16px; }

@media (max-width: 700px) {
  .wealth-depot-grid { grid-template-columns: 1fr; }
  .movers-strip { grid-template-columns: 1fr; gap: 10px; }
}

/* -- Expert View: mode-aware Dichte fuer Screener/Depot-Tabellen (siehe
   index.html, depots.html, depot_detail.html) - unabhaengig vom
   Einsteiger-/Profi-Anzeigemodus zeigt Expert View IMMER alle Spalten,
   in dichterer Darstellung als der Profi-Standard oben. */
body[data-ui-mode="expert"] .col-isin,
body[data-ui-mode="expert"] .col-bid,
body[data-ui-mode="expert"] .col-ask,
body[data-ui-mode="expert"] .col-net_margin,
body[data-ui-mode="expert"] .col-roe,
body[data-ui-mode="expert"] .col-roa,
body[data-ui-mode="expert"] .col-high_24h,
body[data-ui-mode="expert"] .col-low_24h { display: table-cell !important; }
body[data-ui-mode="expert"] .data-table { font-size: 12.5px; }
body[data-ui-mode="expert"] .data-table th,
body[data-ui-mode="expert"] .data-table td { padding: 6px 8px; }
