/* KW-News Designsystem — Tokens, Komponenten, Light/Dark */

:root {
  /* Brand */
  --brand-500: #f97316;   /* Orange als Primärfarbe — Nachrichten/Alert-Anmutung */
  --brand-600: #ea580c;
  --brand-400: #fb923c;

  /* Status */
  --green-500: #10b981;
  --red-500:   #ef4444;
  --amber-500: #f59e0b;
  --blue-500:  #3b82f6;
  --violet-500:#8b5cf6;

  /* Light Theme */
  --bg:          #fafaf9;
  --bg-elev:     #ffffff;
  --bg-subtle:   #f4f4f5;
  --border:      #e4e4e7;
  --border-strong:#d4d4d8;
  --text:        #18181b;
  --text-muted:  #71717a;
  --text-subtle: #a1a1aa;
  --ring:        rgba(249, 115, 22, 0.35);
  --shadow:      0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04);
  --shadow-lg:   0 10px 25px rgba(0,0,0,0.08), 0 4px 10px rgba(0,0,0,0.04);
}

html.dark {
  --bg:          #0a0a0b;
  --bg-elev:     #131316;
  --bg-subtle:   #1c1c20;
  --border:      #27272a;
  --border-strong:#3f3f46;
  --text:        #fafafa;
  --text-muted:  #a1a1aa;
  --text-subtle: #71717a;
  --ring:        rgba(249, 115, 22, 0.5);
  --shadow:      0 1px 2px rgba(0,0,0,0.5), 0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg:   0 10px 25px rgba(0,0,0,0.6), 0 4px 10px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* Layout */
.app {
  display: grid;
  grid-template-columns: 1fr 240px;  /* Sidebar rechts */
  min-height: 100vh;
}
.sidebar {
  background: var(--bg-elev);
  border-left: 1px solid var(--border);  /* Border zur Content-Seite */
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px 20px;
  font-weight: 700; font-size: 16px;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-400));
  display: grid; place-items: center;
  color: white; font-weight: 800; font-size: 13px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--bg-subtle); color: var(--text); }
.nav-item.active { background: var(--bg-subtle); color: var(--text); }
/* Accent-Strich beim aktiven Item rechts (Sidebar ist rechts) */
.nav-item.active { position: relative; }
.nav-item.active::after {
  content: ""; width: 3px; height: 18px;
  background: var(--brand-500); border-radius: 2px;
  position: absolute;
  right: -14px;
  top: 50%;
  transform: translateY(-50%);
}
.nav-icon { width: 18px; height: 18px; flex: none; }
.nav-section-label {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
  padding: 16px 12px 6px;
}

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
  position: sticky; top: 0; z-index: 10;
}
.topbar-title { font-weight: 600; font-size: 15px; flex: none; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex: none; }

/* Globale Suche in der Topbar */
.search-bar {
  flex: 1;
  max-width: 480px;
  margin: 0 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  transition: all .15s;
  cursor: text;
}
.search-bar:hover { border-color: var(--border-strong); }
.search-bar:focus-within {
  border-color: var(--brand-500);
  background: var(--bg-elev);
  box-shadow: 0 0 0 3px var(--ring);
}
.search-bar svg { color: var(--text-subtle); flex: none; }
.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}
.search-bar input::placeholder { color: var(--text-subtle); }
.search-kbd {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  flex: none;
  font-family: ui-sans-serif, system-ui, sans-serif;
}

.content { padding: 28px; max-width: 1400px; width: 100%; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--text);
  font-weight: 500; font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}
.btn:hover { background: var(--bg-subtle); }
.btn-primary {
  background: var(--brand-500);
  border-color: var(--brand-500);
  color: white;
}
.btn-primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn-icon { width: 34px; height: 34px; padding: 0; justify-content: center; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--bg-subtle); }

/* Cards */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.card-title { font-weight: 600; font-size: 14px; }
.card-body { padding: 18px; }
.card-pad-sm { padding: 14px; }

/* Stat tiles */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.stat-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* Top-Interessen-Variante des Stat-Tiles: keine grosse Zahl, sondern Liste */
.stat.stat-topics { gap: 10px; }
.topics-list { display: flex; flex-direction: column; gap: 7px; margin-top: 2px; }
.topic-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}
.topic-row .badge { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.topic-count {
  font-weight: 700; font-size: 14px; color: var(--text);
  flex: none;
}
.stat {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 6px;
}
.stat-label {
  font-size: 12px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.04em; font-weight: 500;
}
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.stat-foot { font-size: 12px; color: var(--text-muted); }
.stat-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--bg-subtle);
}
.stat-head { display: flex; align-items: flex-start; justify-content: space-between; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px; font-weight: 600;
  background: var(--bg-subtle);
  color: var(--text-muted);
}
.badge-high   { background: rgba(239, 68, 68, 0.12);  color: var(--red-500); }
.badge-normal { background: rgba(59, 130, 246, 0.12); color: var(--blue-500); }
.badge-low    { background: rgba(113, 113, 122, 0.15); color: var(--text-muted); }
.badge-tech   { background: rgba(139, 92, 246, 0.12); color: var(--violet-500); }
.badge-finance{ background: rgba(16, 185, 129, 0.12); color: var(--green-500); }
.badge-news   { background: rgba(245, 158, 11, 0.12); color: var(--amber-500); }
.badge-up { color: var(--green-500); background: rgba(16, 185, 129, 0.10); }
.badge-down { color: var(--red-500); background: rgba(239, 68, 68, 0.10); }

/* Push list */
.push-item {
  display: flex; gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
  cursor: pointer;
}
.push-item:last-child { border-bottom: none; }
.push-item:hover { background: var(--bg-subtle); }
.push-score {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: grid; place-items: center;
  font-weight: 700; font-size: 14px;
  flex: none;
  background: var(--bg-subtle);
  color: var(--text);
}
.push-score.high { background: rgba(239, 68, 68, 0.12); color: var(--red-500); }
.push-score.mid  { background: rgba(245, 158, 11, 0.12); color: var(--amber-500); }
.push-score.low  { background: rgba(113, 113, 122, 0.15); color: var(--text-muted); }
.push-body { flex: 1; min-width: 0; }
.push-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.push-summary { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin-bottom: 8px; }
.push-meta { display: flex; gap: 10px; font-size: 12px; color: var(--text-subtle); align-items: center; flex-wrap: wrap; }
.push-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-subtle); }

/* Watchlist */
.watch-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
/* 2-spaltige Variante fuer die Watchlist-Vollansicht */
.watch-grid-2 { grid-template-columns: repeat(2, 1fr); }
.watch-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--bg-subtle);
  transition: background .15s;
  cursor: pointer;
}
.watch-item:hover { background: var(--border); }
.watch-left { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.watch-sym { font-weight: 700; font-size: 13px; }
.watch-name { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px;}
.watch-right { text-align: right; }
.watch-price { font-weight: 700; font-size: 13px; }
.watch-chg { font-size: 11px; font-weight: 600; }
.watch-chg.up { color: var(--green-500); }
.watch-chg.down { color: var(--red-500); }
.spark { width: 60px; height: 22px; margin: 0 10px; }

/* Digest countdown */
.digest-card {
  background: linear-gradient(135deg, rgba(249,115,22,0.10), rgba(249,115,22,0.02));
  border: 1px solid rgba(249,115,22,0.25);
}
.digest-time { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.digest-sub { font-size: 12px; color: var(--text-muted); }

/* Layout helpers */
.row { display: flex; gap: 20px; }
.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* Dashboard-Row: zwei Spalten gleicher Hoehe, beide mit internem Scroll */
.dashboard-row {
  align-items: stretch;
  min-height: 600px;
  max-height: calc(100vh - 180px);
}
.news-feed-card { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.news-feed-body { flex: 1; overflow-y: auto; min-height: 0; }
.dashboard-right { display: flex; flex-direction: column; gap: 20px; min-height: 0; min-width: 0; }
.watchlist-card { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.watchlist-card > .card-pad-sm { flex: 1; overflow-y: auto; min-height: 0; }

/* Schoenerer Scrollbar */
.news-feed-body::-webkit-scrollbar,
.watchlist-card > .card-pad-sm::-webkit-scrollbar { width: 8px; }
.news-feed-body::-webkit-scrollbar-track,
.watchlist-card > .card-pad-sm::-webkit-scrollbar-track { background: transparent; }
.news-feed-body::-webkit-scrollbar-thumb,
.watchlist-card > .card-pad-sm::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}
.news-feed-body::-webkit-scrollbar-thumb:hover,
.watchlist-card > .card-pad-sm::-webkit-scrollbar-thumb:hover {
  background: var(--text-subtle);
}
.section-title {
  font-size: 18px; font-weight: 700; letter-spacing: -0.01em;
  margin: 0 0 14px;
}
.muted { color: var(--text-muted); }

/* Form bits (Editor) */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.input, .textarea, .select {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px var(--ring);
}
.textarea { resize: vertical; min-height: 80px; }
.help { font-size: 12px; color: var(--text-muted); }

/* Tag input */
.tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 6px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg-elev);
  min-height: 42px;
}
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  background: var(--bg-subtle);
  border-radius: 999px;
  font-size: 12px; font-weight: 500;
}
.tag .x { color: var(--text-subtle); cursor: pointer; }
.tag-input { border: none; outline: none; background: transparent; flex: 1; font-size: 13px; color: var(--text); min-width: 100px; padding: 4px; }

/* Slider */
.slider-row { display: flex; align-items: center; gap: 12px; }
.slider {
  flex: 1; -webkit-appearance: none; appearance: none;
  height: 6px; border-radius: 3px;
  background: linear-gradient(to right, var(--brand-500) 0%, var(--brand-500) 75%, var(--border) 75%, var(--border) 100%);
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: white;
  border: 2px solid var(--brand-500);
  cursor: pointer;
  box-shadow: var(--shadow);
}
.slider-value {
  font-weight: 700; font-size: 14px;
  min-width: 40px; text-align: right;
}

/* Radio pills */
.pills { display: flex; gap: 6px; }
.pill {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  font-size: 12px; font-weight: 500;
  cursor: pointer;
  transition: all .15s;
}
.pill.active {
  background: var(--brand-500);
  color: white;
  border-color: var(--brand-500);
}

/* Toggle */
.toggle {
  position: relative;
  width: 38px; height: 22px;
  background: var(--border-strong);
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s;
}
.toggle::after {
  content: ""; position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%; background: white;
  transition: transform .15s;
  box-shadow: var(--shadow);
}
.toggle.on { background: var(--brand-500); }
.toggle.on::after { transform: translateX(16px); }

/* Interessen-Liste */
.interest-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.interest-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  cursor: pointer;
  transition: all .15s;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}
.interest-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.interest-card.paused {
  opacity: 0.55;
  background: var(--bg-subtle);
}
.interest-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.interest-name {
  font-weight: 700; font-size: 15px; letter-spacing: -0.01em;
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.interest-card-controls {
  display: flex; align-items: center; gap: 10px;
  flex: none;
}
.interest-desc {
  font-size: 13px; color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}
.interest-meta {
  display: flex; gap: 8px; align-items: center;
  font-size: 11px; color: var(--text-subtle);
  flex-wrap: wrap;
}
.interest-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-subtle); flex: none; }
.interest-stats {
  display: flex; align-items: center; gap: 12px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: auto;
}
.interest-spark { width: 84px; height: 28px; flex: none; }
.interest-spark rect { fill: var(--brand-500); opacity: 0.7; }
.interest-stats-text { display: flex; gap: 6px; align-items: baseline; font-size: 12px; flex: 1; min-width: 0; }
.interest-stats-text .big { font-size: 18px; font-weight: 700; color: var(--text); line-height: 1; }
.interest-stats-text .lbl { color: var(--text-muted); }
.interest-card.paused .interest-spark rect { fill: var(--text-subtle); opacity: 0.4; }
.interest-paused-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-elev);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
}

@media (max-width: 900px) {
  .interest-grid { grid-template-columns: 1fr; gap: 10px; }
  .interest-card { padding: 14px 16px; }
}

/* Interest-Editor */
.editor-form .field:last-child { margin-bottom: 0; }
.editor-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
}
.tester-meta {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}
.tester-meta-label { font-size: 12px; color: var(--text-muted); }
.tester-list { padding: 8px 0; }
.match-item {
  display: flex; gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  transition: background .15s, opacity .2s;
  cursor: pointer;
}
.match-item:last-child { border-bottom: none; }
.match-item:hover { background: var(--bg-subtle); }
.match-item.below {
  opacity: 0.45;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 6px,
    var(--bg-subtle) 6px,
    var(--bg-subtle) 7px
  );
}
.match-score {
  width: 38px; height: 38px;
  border-radius: 9px;
  display: grid; place-items: center;
  font-weight: 700; font-size: 13px;
  flex: none;
  background: var(--bg-subtle); color: var(--text);
}
.match-score.high { background: rgba(239, 68, 68, 0.12); color: var(--red-500); }
.match-score.mid  { background: rgba(245, 158, 11, 0.12); color: var(--amber-500); }
.match-score.low  { background: rgba(113, 113, 122, 0.15); color: var(--text-muted); }
.match-body { flex: 1; min-width: 0; }
.match-title { font-weight: 600; font-size: 13px; line-height: 1.4; margin-bottom: 4px; }
.match-reason {
  font-size: 11px; color: var(--text-muted);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.match-reason-tag {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 7px;
  background: var(--bg-subtle);
  border-radius: 999px;
  font-size: 10px;
  color: var(--text-muted);
}
.match-reason-tag.kw { color: var(--violet-500); background: rgba(139, 92, 246, 0.1); }
.match-reason-tag.sem { color: var(--blue-500); background: rgba(59, 130, 246, 0.1); }
.tester-threshold-line {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 18px;
  background: rgba(249, 115, 22, 0.08);
  border-bottom: 1px solid rgba(249, 115, 22, 0.2);
  font-size: 11px; color: var(--brand-600);
  font-weight: 600;
}
html.dark .tester-threshold-line { color: var(--brand-400); }
.editor-grid {
  align-items: stretch;
  min-height: 600px;
  max-height: calc(100vh - 180px);
}
.editor-grid > .card { min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.editor-form-scroll { flex: 1; overflow-y: auto; min-height: 0; padding: 18px; }
.tester-scroll { flex: 1; overflow-y: auto; min-height: 0; }

/* Mobile editor */
@media (max-width: 900px) {
  .editor-grid { grid-template-columns: 1fr; max-height: none; min-height: 0; }
  .editor-grid > .card { min-height: 360px; }
  .editor-form-scroll { overflow: visible; }
  .tester-scroll { overflow: visible; }
}

/* Watchlist-Vollansicht */
.watchlist-grid {
  align-items: stretch;
  min-height: 600px;
  max-height: calc(100vh - 180px);
  grid-template-columns: 320px 1fr;
}
.watchlist-grid > .card { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.watchlist-search {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
}
.watchlist-search .input { height: 32px; font-size: 13px; }
.watchlist-search .pills .pill { padding: 4px 10px; font-size: 11px; }
.watchlist-symbols { flex: 1; overflow-y: auto; min-height: 0; }
.watch-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 12px;
  padding: 10px 14px 10px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
}
.watch-row:hover { background: var(--bg-subtle); }
.watch-row.selected {
  background: var(--bg-subtle);
  box-shadow: inset 3px 0 0 var(--brand-500);
}
.watch-row-sym { font-weight: 700; font-size: 13px; grid-row: 1; grid-column: 1; }
.watch-row-name {
  font-size: 11px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  grid-row: 2; grid-column: 1;
}
.watch-row-price { font-weight: 600; font-size: 13px; grid-row: 1; grid-column: 2; text-align: right; }
.watch-row-chg { font-size: 11px; font-weight: 600; grid-row: 2; grid-column: 2; text-align: right; }
.watch-row-chg.up { color: var(--green-500); }
.watch-row-chg.down { color: var(--red-500); }

.watch-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
  flex-wrap: wrap;
}
.symbol-block h2 {
  font-size: 22px; font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.symbol-name { color: var(--text-muted); font-weight: 500; font-size: 14px; margin-left: 8px; }
.price-line { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.price-line .price { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.price-line .chg { font-size: 14px; font-weight: 600; }
.price-line .chg.up { color: var(--green-500); }
.price-line .chg.down { color: var(--red-500); }
.price-meta { font-size: 12px; color: var(--text-muted); }

.range-switcher { display: flex; gap: 2px; padding: 3px; background: var(--bg-subtle); border-radius: 8px; }
.range-switcher button {
  border: none; background: transparent; color: var(--text-muted);
  font-size: 12px; font-weight: 600;
  padding: 5px 12px; border-radius: 6px; cursor: pointer;
  transition: all .15s;
}
.range-switcher button:hover { color: var(--text); }
.range-switcher button.active {
  background: var(--bg-elev); color: var(--text);
  box-shadow: var(--shadow);
}

.watch-chart-wrap {
  flex: 1; min-height: 280px;
  padding: 12px 22px 32px 64px;     /* Platz fuer Y-Labels links und X-Labels unten */
  position: relative;
}
.watch-chart-wrap svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart-grid-line { stroke: var(--border); stroke-dasharray: 2 4; }
.chart-area { fill: rgba(16,185,129,0.08); }
.chart-line { fill: none; stroke: var(--green-500); stroke-width: 1.8; stroke-linejoin: round; }

/* Achsen-Beschriftungen als HTML (gestochen scharf, kein SVG-Stretching) */
.chart-y-axis {
  position: absolute;
  left: 6px;
  top: 12px;
  bottom: 32px;
  width: 54px;
  pointer-events: none;
}
.chart-y-axis span {
  position: absolute;
  right: 4px;
  font-size: 11px;
  color: var(--text-subtle);
  font-variant-numeric: tabular-nums;
  transform: translateY(-50%);
  white-space: nowrap;
}
/* Y-Positionen entsprechen den SVG-Grid-Linien (y/320) */
.chart-y-axis span:nth-child(1) { top: 12.5%; }   /* y=40  -> $213.50 */
.chart-y-axis span:nth-child(2) { top: 31.25%; }  /* y=100 -> $212.65 */
.chart-y-axis span:nth-child(3) { top: 50%; }     /* y=160 -> $211.80 */
.chart-y-axis span:nth-child(4) { top: 68.75%; }  /* y=220 -> $210.95 */
.chart-y-axis span:nth-child(5) { top: 87.5%; }   /* y=280 -> $210.10 */

.chart-x-axis {
  position: absolute;
  left: 64px;
  right: 22px;
  bottom: 10px;
  height: 16px;
  pointer-events: none;
}
.chart-x-axis span {
  position: absolute;
  font-size: 11px;
  color: var(--text-subtle);
  font-variant-numeric: tabular-nums;
  transform: translateX(-50%);
}
/* X-Positionen entsprechen den 4 Datapunkten (x/800) */
.chart-x-axis span:nth-child(1) { left: 17.5%; }  /* x=140 */
.chart-x-axis span:nth-child(2) { left: 42.5%; }  /* x=340 */
.chart-x-axis span:nth-child(3) { left: 67.5%; }  /* x=540 */
.chart-x-axis span:nth-child(4) { left: 92.5%; }  /* x=740 */

.chart-point {
  fill: var(--bg-elev);
  stroke: var(--green-500);
  stroke-width: 2;
  cursor: pointer;
  transition: r .15s, stroke-width .15s;
}
.chart-point:hover, .chart-point.active {
  stroke-width: 3;
}

.chart-tooltip {
  position: absolute;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  z-index: 5;
  transform: translate(-50%, calc(-100% - 14px));
  white-space: nowrap;
  opacity: 0;
  transition: opacity .12s, left .08s, top .08s;
}
.chart-tooltip.show { opacity: 1; }
.chart-tooltip .tt-time { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.chart-tooltip .tt-price { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.chart-tooltip .tt-chg { font-size: 11px; font-weight: 600; margin-top: 1px; }
.chart-tooltip .tt-chg.up { color: var(--green-500); }
.chart-tooltip .tt-chg.down { color: var(--red-500); }
.chart-tooltip::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: var(--bg-elev);
  border-right: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
}

.watch-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--border);
}
.stat-mini { padding: 14px 18px; border-right: 1px solid var(--border); }
.stat-mini:last-child { border-right: none; }
.stat-mini-label {
  font-size: 10px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; font-weight: 600;
}
.stat-mini-value { font-size: 14px; font-weight: 600; }

/* Add-Symbol Button neben Header-Titel */
.btn-sm {
  height: 28px; padding: 0 10px;
  font-size: 12px;
}

@media (max-width: 900px) {
  .watchlist-grid {
    grid-template-columns: 1fr;
    max-height: none; min-height: 0;
  }
  .watchlist-symbols { max-height: 240px; }
  .watch-stats-row { grid-template-columns: repeat(2, 1fr); }
  .stat-mini { padding: 10px 14px; }
  .stat-mini:nth-child(2) { border-right: none; }
  .stat-mini:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .price-line .price { font-size: 22px; }
  .symbol-block h2 { font-size: 18px; }
  .watch-chart-wrap { min-height: 240px; padding: 12px 16px; }
  .watch-detail-header { padding: 14px 16px; }
}

/* Quellen-Liste */
.source-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  transition: background .15s;
}
.source-item:last-child { border-bottom: none; }
.source-item:hover { background: var(--bg-subtle); }

.status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--text-subtle);
  flex: none;
}
.status-dot.ok   { background: var(--green-500); box-shadow: 0 0 0 3px rgba(16,185,129,0.18); }
.status-dot.warn { background: var(--amber-500); box-shadow: 0 0 0 3px rgba(245,158,11,0.18); }
.status-dot.err  { background: var(--red-500);   box-shadow: 0 0 0 3px rgba(239,68,68,0.18); }
.status-dot.off  { background: var(--text-subtle); }

.source-name-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 4px;
}
.source-name { font-weight: 600; font-size: 14px; }

.badge-rss     { background: rgba(249,115,22,0.10); color: var(--brand-500); }
.badge-api     { background: rgba(59,130,246,0.10); color: var(--blue-500); }
.badge-reddit  { background: rgba(239,68,68,0.10); color: var(--red-500); }
.badge-hn      { background: rgba(245,158,11,0.10); color: var(--amber-500); }
.badge-lang    { background: var(--bg-subtle); color: var(--text-muted); }

.source-endpoint {
  font-size: 12px; color: var(--text-muted);
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  margin-bottom: 6px;
  word-break: break-all;
}

.source-meta {
  display: flex; gap: 8px; flex-wrap: wrap;
  font-size: 11px; color: var(--text-subtle);
  align-items: center;
}
.source-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-subtle); flex: none; }
.source-meta .err-text { color: var(--red-500); font-weight: 600; }
.source-meta .warn-text { color: var(--amber-500); font-weight: 600; }

.source-actions {
  display: flex; gap: 10px; align-items: center;
  flex: none;
}

@media (max-width: 900px) {
  .source-item {
    grid-template-columns: auto 1fr;
    row-gap: 10px;
    padding: 12px 14px;
  }
  .source-actions {
    grid-column: 2 / 3;
    grid-row: 2;
    justify-content: flex-end;
  }
  .source-endpoint { font-size: 11px; }
}

/* Info-Display (statisches Feld) */
.info-display {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
}

/* Onboarding-Wizard */
.onboarding-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}
.wizard {
  width: 100%;
  max-width: 620px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.wizard-progress {
  display: flex;
  gap: 6px;
  padding: 20px 28px 0;
}
.wizard-progress-step {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--bg-subtle);
}
.wizard-progress-step.done,
.wizard-progress-step.active { background: var(--brand-500); }

.wizard-header {
  padding: 24px 28px 8px;
}
.wizard-step-num {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-500);
  margin-bottom: 8px;
}
.wizard-title {
  font-size: 22px; font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.wizard-subtitle {
  font-size: 14px; color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}
.wizard-body {
  padding: 18px 28px 24px;
}
.wizard-actions {
  display: flex;
  justify-content: space-between;
  padding: 16px 28px;
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
}

/* Pack-Selector im Wizard */
.pack-selector {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.pack-option {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  background: var(--bg);
  transition: all .15s;
}
.pack-option:hover { border-color: var(--brand-500); }
.pack-option.selected {
  border-color: var(--brand-500);
  background: rgba(249,115,22,0.05);
  box-shadow: 0 0 0 3px var(--ring);
}
.pack-option-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.pack-option .pack-name { font-size: 14px; }
.pack-option .pack-meta { font-size: 11px; color: var(--text-muted); margin-bottom: 6px; }
.pack-option .pack-sources { font-size: 11px; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 4px; }
.pack-option .pack-sources span { background: var(--bg-subtle); padding: 1px 7px; border-radius: 999px; }

/* Telegram-Linking-Anleitung im Wizard */
.linking-card {
  background: var(--bg-subtle);
  border-radius: 12px;
  padding: 18px;
  display: grid;
  grid-template-columns: 1fr 100px;
  gap: 16px;
  align-items: center;
}
.linking-card .qr-block {
  width: 100px; height: 100px;
}
.linking-code-big {
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-align: center;
  color: var(--brand-500);
  padding: 10px;
  background: var(--bg-elev);
  border: 1px dashed var(--brand-500);
  border-radius: 8px;
  margin-bottom: 12px;
}
.linking-instructions {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
}
.linking-instructions ol { padding-left: 18px; margin: 0; }
.linking-instructions li { margin-bottom: 4px; }

/* Archiv */
.archive-toolbar {
  display: flex; gap: 10px; align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.archive-search { flex: 1; min-width: 280px; }
.archive-day-header {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 18px 0 8px;
}
.archive-day-header:first-child { padding-top: 0; }
.archive-item {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 14px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
  background: var(--bg-elev);
  align-items: center;
  cursor: pointer;
  transition: all .15s;
}
.archive-item:hover { border-color: var(--border-strong); background: var(--bg-subtle); }
.archive-time { font-size: 11px; color: var(--text-muted); white-space: nowrap; flex: none; }
.archive-title { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.archive-meta {
  font-size: 11px; color: var(--text-subtle);
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.archive-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-subtle); flex: none; }

@media (max-width: 700px) {
  .pack-selector { grid-template-columns: 1fr; }
  .linking-card { grid-template-columns: 1fr; }
  .linking-card .qr-block { justify-self: center; }
  .archive-item { grid-template-columns: 38px 1fr; }
  .archive-item .archive-time { grid-column: 1 / -1; grid-row: 2; padding-left: 52px; }
}

/* Settings-Seite */
.settings-stack {
  display: flex; flex-direction: column;
  gap: 18px;
  max-width: 880px;
}
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.settings-row:last-child { border-bottom: none; }
.settings-row-label { flex: 1; min-width: 0; }
.settings-row-title { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.settings-row-help { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.settings-row-control { flex: none; }

.link-code-block {
  display: flex; gap: 18px; align-items: center;
  padding: 18px;
  background: var(--bg-subtle);
  border-radius: 10px;
  margin: 0 18px 18px;
}
.link-code {
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--brand-500);
  padding: 10px 14px;
  background: var(--bg-elev);
  border: 1px dashed var(--brand-500);
  border-radius: 8px;
  flex: 1;
  text-align: center;
}
.qr-block {
  width: 96px; height: 96px;
  flex: none;
  border-radius: 8px;
  overflow: hidden;
  background: white;
  padding: 6px;
}
.qr-block svg { width: 100%; height: 100%; display: block; }

.connection-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
}
.connection-status.connected { background: rgba(16,185,129,0.12); color: var(--green-500); }
.connection-status.not-connected { background: var(--bg-subtle); color: var(--text-muted); }

.linking-steps {
  list-style: none; padding: 0 18px 18px; margin: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.linking-steps li {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px; color: var(--text);
}
.step-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--bg-subtle);
  color: var(--text-muted);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
  flex: none; margin-top: 1px;
}

.time-picker { width: 110px; }
.digest-slots {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.danger-card {
  border-color: rgba(239,68,68,0.3);
}
.danger-card .card-header { background: rgba(239,68,68,0.04); }
.btn-danger {
  background: rgba(239,68,68,0.1);
  border-color: rgba(239,68,68,0.3);
  color: var(--red-500);
}
.btn-danger:hover {
  background: var(--red-500);
  color: white;
}

@media (max-width: 700px) {
  .link-code-block { flex-direction: column; gap: 14px; }
  .link-code { width: 100%; font-size: 18px; }
  .settings-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .settings-row-control { width: 100%; }
  .digest-slots .time-picker { flex: 1; }
}

/* Modal / Dialog */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 24px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 760px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  flex: none;
}
.modal-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.modal-close {
  width: 32px; height: 32px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px;
  display: grid;
  place-items: center;
  transition: background .15s, color .15s;
  font-size: 18px;
}
.modal-close:hover { background: var(--bg-subtle); color: var(--text); }
.modal-tabs {
  display: flex;
  padding: 0 22px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex: none;
}
.modal-tab {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 12px 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.modal-tab:hover { color: var(--text); }
.modal-tab.active {
  color: var(--text);
  border-bottom-color: var(--brand-500);
}
.modal-body {
  padding: 18px 22px;
  overflow-y: auto;
  min-height: 0;
  flex: 1;
}
.modal-body h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 700;
  margin: 0 0 10px;
}
.modal-actions {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-elev);
  flex: none;
  font-size: 12px;
  color: var(--text-muted);
}

/* Katalog-Tab: Suche + Kategorie-Pills */
.catalog-toolbar {
  display: flex; flex-direction: column; gap: 8px;
  margin-bottom: 20px;
}

/* Starter-Pakete */
.starter-packs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}
.pack-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  background: var(--bg);
  transition: all .15s;
  cursor: pointer;
  display: flex; flex-direction: column;
}
.pack-card:hover { border-color: var(--brand-500); transform: translateY(-1px); box-shadow: var(--shadow); }
.pack-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px;
}
.pack-emoji { font-size: 18px; line-height: 1; }
.pack-name { font-weight: 700; font-size: 14px; }
.pack-meta { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; }
.pack-sources {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin-bottom: 12px;
  font-size: 11px;
}
.pack-sources span {
  background: var(--bg-subtle);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 999px;
}
.pack-card .btn { margin-top: auto; height: 30px; font-size: 12px; }

/* Katalog-Eintraege */
.catalog-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.catalog-entry {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  align-items: center;
  background: var(--bg);
  transition: all .15s;
}
.catalog-entry:hover { border-color: var(--border-strong); background: var(--bg-subtle); }
.catalog-logo {
  width: 38px; height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
  color: white;
  flex: none;
}
.catalog-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.catalog-name-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.catalog-name { font-weight: 600; font-size: 13px; }
.catalog-desc { font-size: 11px; color: var(--text-muted); line-height: 1.4; }
.catalog-add {
  height: 28px;
  padding: 0 12px;
  font-size: 12px;
  white-space: nowrap;
}

.badge-paywall-free { background: rgba(16,185,129,0.12); color: var(--green-500); }
.badge-paywall-soft { background: rgba(245,158,11,0.12); color: var(--amber-500); }

/* Eigene-URL-Tab */
.url-check-result {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-subtle);
}
.url-check-status {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 13px;
  margin-bottom: 10px;
}
.url-check-status.ok { color: var(--green-500); }
.url-check-status.warn { color: var(--amber-500); }
.url-check-rows {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.url-check-rows .field { margin-bottom: 0; }
.url-check-rows .field-full { grid-column: 1 / -1; }
.url-warning {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(245,158,11,0.1);
  border-left: 3px solid var(--amber-500);
  border-radius: 6px;
  color: var(--amber-600, var(--amber-500));
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 700px) {
  .modal-backdrop { padding: 0; }
  .modal {
    max-width: 100%;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
    width: 100%;
  }
  .starter-packs { grid-template-columns: 1fr; }
  .url-check-rows { grid-template-columns: 1fr; }
}

/* Page banner index */
.preview-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}
.preview-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: all .15s;
  cursor: pointer;
}
.preview-card:hover { border-color: var(--brand-500); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.preview-card h3 { margin: 0 0 6px; font-size: 15px; }
.preview-card p { margin: 0; font-size: 13px; color: var(--text-muted); }

/* Bottom-Nav (Mobile) */
.bottom-nav {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 60px;
  padding: 6px 18px env(safe-area-inset-bottom, 6px);  /* Seiten-Padding gegen Rundung des Phone-Frames */
  background: var(--bg-elev);
  border-top: 1px solid var(--border);
  z-index: 20;
  justify-content: space-around;
  align-items: stretch;
}
/* Scrollbar auf Mobile dezent / unsichtbar (Viewer-Iframe + reales Mobile) */
@media (max-width: 900px) {
  html, body { scrollbar-width: none; -ms-overflow-style: none; }
  html::-webkit-scrollbar, body::-webkit-scrollbar { width: 0; height: 0; display: none; }
}
.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 8px;
  padding: 4px 2px;
  transition: color .15s, background .15s;
}
.bottom-nav-item:active { background: var(--bg-subtle); }
.bottom-nav-item.active { color: var(--brand-500); }
.bottom-nav-icon { width: 22px; height: 22px; flex: none; }

/* Responsive */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .bottom-nav { display: flex; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .watch-grid { grid-template-columns: 1fr; }
  .content { padding: 16px 16px 88px; }   /* Bottom-Padding fuer Bottom-Nav */
  .topbar { padding: 0 22px; gap: 4px; overflow: hidden; }  /* Padding fuer iPhone-Notch / Viewer-Phone-Frame-Rundung */
  .topbar > * { min-width: 0; }
  .search-bar input { min-width: 0; width: 0; flex: 1; }   /* Damit Search-Bar in der schmalen Topbar schrumpfen kann */
  .topbar-title { font-size: 14px; }
  .search-bar { margin: 0 4px; height: 34px; padding: 0 10px; }
  .search-bar input { font-size: 13px; }
  .search-kbd { display: none; }
  #theme-label { display: none; }                  /* Theme-Label weg auf Mobile */
  .btn { padding: 0 10px; }
  .btn-primary .btn-label { display: none; }       /* "+ Neues Interesse" Text weg */
  .btn-primary { padding: 0 10px; }
  .dashboard-row { max-height: none; min-height: 0; }  /* Mobile: Spalten gestapelt, kein fixes Limit */
  .news-feed-body { overflow: visible; }
  .watchlist-card > .card-pad-sm { overflow: visible; }

  /* Kompakte Stat-Tiles */
  .stat { padding: 12px; gap: 4px; }
  .stat-label { font-size: 10px; }
  .stat-value { font-size: 20px; }
  .stat-foot { font-size: 11px; }
  .stat-icon { width: 26px; height: 26px; }
  .stat-icon svg { width: 14px; height: 14px; }
  .topics-list { gap: 5px; }
  .topic-count { font-size: 13px; }

  /* News-Feed: nur die ersten 3 Items zeigen */
  .news-feed-body .push-item:nth-child(n+4) { display: none; }

  /* Watchlist kompakter */
  .watch-grid { gap: 6px; }
  .watch-item { padding: 8px 10px; }
  .watch-sym { font-size: 12px; }
  .watch-name { font-size: 10px; max-width: 110px; }
  .watch-price { font-size: 12px; }
  .watch-chg { font-size: 10px; }
  .spark { width: 50px; height: 18px; margin: 0 8px; }
}
