:root {
  --bg: #0F1417;
  --surface: #161D21;
  --surface-2: #1D262B;
  --border: #2A353B;
  --text: #E7EAE8;
  --text-muted: #8CA0A0;
  --accent-pos: #4FBF8B;
  --accent-neg: #C1554A;
  --accent-gold: #C9A25D;
  --radius: 4px;
  --font-display: "Fraunces", serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
}

/* Helles Thema – "gedrucktes Research-Memo" statt Trading-Terminal-Dunkel.
   Wird per data-theme="light" auf <html> aktiviert (siehe base.html). */
:root[data-theme="light"] {
  --bg: #F6F4EE;
  --surface: #FFFFFF;
  --surface-2: #EDE9DD;
  --border: #D9D3C2;
  --text: #1E2422;
  --text-muted: #6A7570;
  --accent-pos: #2E8F63;
  --accent-neg: #B23B2E;
  --accent-gold: #93701F;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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-gold); font-size: 20px; }
.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-gold); }
.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 */
.nav-user-group { margin-left: 8px; }
.nav-user-trigger { text-transform: none; letter-spacing: normal; }
.nav-user { color: var(--accent-gold); 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-gold); color: var(--accent-gold); }
.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; }

/* ---- 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; }

  .theme-toggle { order: 4; 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-gold); color: var(--accent-gold); }
.flash-error { border-color: var(--accent-neg); color: var(--accent-neg); }

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

.layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  align-items: start;
}

.sidebar { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 16px; }

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

.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-pos);
  outline-offset: 1px;
}

.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-gold);
  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;
  padding-right: 2px;
}
.criterion-row {
  display: grid;
  grid-template-columns: 16px 1fr 1fr 56px 64px 64px;
  gap: 6px;
  align-items: center;
}
.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; }

@media (max-width: 700px) {
  .criterion-row { grid-template-columns: 16px 1fr; grid-template-rows: auto auto auto auto auto; }
}

.btn {
  display: inline-block;
  border: 1px solid var(--accent-pos);
  background: transparent;
  color: var(--accent-pos);
  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-pos); color: #0F1417; }
.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); }

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

/* ---- 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-gold); 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-gold);
  border-color: var(--accent-gold);
}

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

/* ---- 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 { max-width: 760px; margin: 0 auto; }
.history-title { font-family: var(--font-mono); font-size: 26px; color: var(--accent-gold); 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-gold);
  border-color: var(--accent-gold);
}
.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-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-gold); }

.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-gold) 12%, var(--surface));
  border-bottom: 1px solid var(--accent-gold);
}
.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 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-gold);
}
.landing-feature p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.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-gold); }
.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-gold); 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-pos); }
.strategy-card.selected { border-color: var(--accent-gold); 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-gold); }
.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-gold);
  margin: 18px 0 8px;
}
.rec-group-label:first-child { margin-top: 0; }
.rec-card {
  display: grid;
  grid-template-columns: 32px 1fr 120px 70px;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.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-gold) 20%, transparent); color: var(--accent-gold); }
.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-gold);
  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;
}
.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-gold); }
.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-gold); 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-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-pos); 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-gold); border-color: var(--accent-gold); }
.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-gold); border-color: var(--accent-gold); }
.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); }

/* ---- 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-gold); border-color: var(--accent-gold); }

/* ---- 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-gold); }
.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-gold); 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-gold);
  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-gold); }

@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-gold); }
.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-gold); 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-pos); }
.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-gold);
}
.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-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-gold); margin-left: 8px; }
.faq-strategy-desc { color: var(--text-muted); font-size: 12.5px; line-height: 1.5; margin-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; }
}
