/* ============================================================
   TRACKER PRO v29 — DESIGN SYSTEM
   ------------------------------------------------------------
   Richtung: "Instrument". Neutrales Graphit statt Marine-Blau,
   Haarlinien statt Schlagschatten, Farbe nur dort, wo sie eine
   Bedeutung trägt (rein/raus/Depot). Zahlen sind der Inhalt
   dieser App — deshalb überall Tabellenziffern, gleiche Breite,
   damit beim laufenden Timer nichts springt.
   Aktionen sind Platin (hell auf dunkel), Zustände sind Kobalt.
   ============================================================ */
:root {
  /* ---- Flächen ---- */
  --bg:          #0A0A0D;
  --bg-elev:     #101014;
  --bg-card:     #15151A;
  --bg-input:    #1B1B21;
  --bg-hover:    #24242C;
  --bg-sunken:   rgba(255,255,255,0.035);
  --border:        rgba(255,255,255,0.07);
  --border-strong: rgba(255,255,255,0.15);

  /* ---- Interaktion ---- */
  --primary:        #4F7CFF;
  --primary-strong: #3D66E8;
  --primary-dim:    rgba(79,124,255,0.16);
  --accent:         #F2F2F6;   /* Platin — primäre Aktionen */
  --accent-ink:     #0A0A0D;

  /* ---- Semantik ---- */
  --success:     #3FCF8E;
  --success-dim: rgba(63,207,142,0.14);
  --danger:      #FF5C68;
  --danger-dim:  rgba(255,92,104,0.14);
  --warning:     #F5B942;
  --warning-dim: rgba(245,185,66,0.14);
  --invest:      #A78BFA;
  --invest-dim:  rgba(167,139,250,0.14);
  --crypto:      #F7931A;
  --crypto-dim:  rgba(247,147,26,0.14);
  --bitget:      #00C087;
  --bitget-dim:  rgba(0,192,135,0.14);
  --up:          #3FCF8E;
  --down:        #FF5C68;

  /* ---- Text ---- */
  --text:       #EDEEF2;
  --text-muted: #92939F;
  --text-dim:   #5C5D6B;

  /* ---- Form ---- */
  --radius-lg: 18px;
  --radius:    14px;
  --radius-sm: 10px;
  --radius-xs: 8px;

  /* ---- Typografie ---- */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable", "Segoe UI", Inter, Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Roboto Mono", Menlo, monospace;
  --font-num: var(--font-mono);

  /* ---- Layout ---- */
  --nav-h: 66px;
  --rail-w: 228px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --subnav-h: 54px;
  --page-max: 860px;

  /* ---- Tiefe ---- */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.35);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.34);
  --shadow-lg: 0 24px 60px rgba(0,0,0,0.55);

  /* ---- Bewegung ---- */
  --ease-spring: cubic-bezier(0.34,1.42,0.64,1);
  --ease-out:    cubic-bezier(0.22,0.61,0.36,1);
  --ease-in-out: cubic-bezier(0.65,0.05,0.36,1);
  --ring: 0 0 0 3px rgba(79,124,255,0.38);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  height: 100%; overflow: hidden;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
}
/* Ein sehr leiser Lichtabfall von oben statt zweier bunter Farbwolken. */
body::before {
  content: ''; position: fixed; inset: 0 0 auto 0; height: 420px;
  background: linear-gradient(180deg, rgba(255,255,255,0.035), transparent 78%);
  pointer-events: none; z-index: 0;
}

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: 27px; letter-spacing: -0.03em; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p  { margin: 0; }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-xs); }
input:focus-visible, select:focus-visible, textarea:focus-visible { box-shadow: none; }

.main::-webkit-scrollbar, dialog::-webkit-scrollbar,
.cmdk-list::-webkit-scrollbar { width: 10px; height: 10px; }
.main::-webkit-scrollbar-thumb, dialog::-webkit-scrollbar-thumb,
.cmdk-list::-webkit-scrollbar-thumb {
  background: var(--border-strong); border-radius: 8px;
  border: 3px solid transparent; background-clip: padding-box;
}
.main::-webkit-scrollbar-thumb:hover, dialog::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }
.main, dialog { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }

/* Zahlen laufen nie aus dem Takt. */
.mono, .stat-val, .big-val, .timer-display, .timer-money, .goal-pct, .goal-vals,
.ins-hero-val, .ins-kpi-val, .ins-bar-val, .asset-val, .holding-val, .balance-amt,
.crypto-price, .hist-val, .sess-earn, .plus, .minus {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "zero" 1;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; position: relative; z-index: 1; }

.main {
  flex: 1;
  overflow-y: auto; overflow-x: hidden;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 24px);
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}
.page { max-width: var(--page-max); margin: 0 auto; padding: 22px 18px 8px; }

/* ============================================================
   NAVIGATION — unten auf dem Handy, links am Rechner
   ============================================================ */
.nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: calc(var(--nav-h) + var(--safe-b));
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(26px) saturate(1.5);
  -webkit-backdrop-filter: blur(26px) saturate(1.5);
  border-top: 1px solid var(--border);
  display: flex; align-items: stretch;
  padding: 8px 6px var(--safe-b);
  z-index: 900;
}
.nav-brand { display: none; }

.nav-btn {
  flex: 1; min-width: 0;
  background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; padding: 6px 2px; border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 10px; font-weight: 600; font-family: var(--font); letter-spacing: -0.01em;
  transition: color 0.18s ease, background 0.18s ease;
  position: relative;
}
.nav-btn svg { width: 22px; height: 22px; fill: currentColor; transition: transform 0.24s var(--ease-spring); }
.nav-btn.active { color: var(--text); }
.nav-btn.active svg { transform: translateY(-1px); }
.nav-btn::before {
  content: ''; position: absolute; top: -8px; left: 50%; width: 26px; height: 2px;
  margin-left: -13px; border-radius: 0 0 3px 3px; background: var(--accent);
  opacity: 0; transform: scaleX(0.2);
  transition: opacity 0.2s ease, transform 0.3s var(--ease-spring);
}
.nav-btn.active::before { opacity: 1; transform: scaleX(1); }
.nav-btn:active svg { transform: scale(0.88); }
.nav-btn[data-tab="invest"].active::before { background: var(--invest); }
.nav-btn[data-tab="invest"].active { color: var(--invest); }
.nav-btn[data-tab="crypto"].active  { color: var(--crypto); }
.nav-btn[data-tab="bitget"].active  { color: var(--bitget); }
.nav-btn[data-tab="markets"].active { color: var(--warning); }
.nav-btn[data-tab="insights"].active { color: var(--text); }

@media (min-width: 1024px) {
  :root { --nav-h: 0px; }
  .nav {
    top: 0; bottom: 0; right: auto; width: var(--rail-w); height: 100%;
    flex-direction: column; align-items: stretch; gap: 3px;
    padding: 20px 12px 20px; border-top: none; border-right: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg-elev) 88%, transparent);
  }
  .nav-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 10px 20px; font-size: 14px; font-weight: 700; letter-spacing: -0.02em;
  }
  .nav-brand .mark {
    width: 26px; height: 26px; border-radius: 8px; flex: 0 0 auto;
    background: var(--accent); color: var(--accent-ink);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 800;
  }
  .nav-brand .sub { display: block; font-size: 11px; font-weight: 500; color: var(--text-dim); letter-spacing: 0; }
  .nav-btn {
    flex: 0 0 auto; flex-direction: row; justify-content: flex-start;
    gap: 12px; padding: 10px 12px; font-size: 14px; font-weight: 600;
  }
  .nav-btn:hover { background: var(--bg-hover); color: var(--text); }
  .nav-btn.active { background: var(--bg-hover); }
  .nav-btn::before {
    top: 50%; left: -12px; margin: -10px 0 0; width: 3px; height: 20px;
    border-radius: 0 3px 3px 0; transform: scaleY(0.2);
  }
  .nav-btn.active::before { transform: scaleY(1); }
  .main { padding-left: var(--rail-w); padding-bottom: 40px; }
  .toast { left: calc(50% + var(--rail-w) / 2); }
}

/* ============================================================
   VIEWS
   ============================================================ */
.view { display: none; animation: fadeUp 0.3s var(--ease-out) both; }
.view.active { display: block; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .view, .todo-anim, .cmdk-panel, .pwa-banner { animation: none !important; }
  * { transition-duration: 0.01ms !important; }
  @keyframes shake { 0%,100% { transform: none; } }
}

/* ============================================================
   KARTEN
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  position: relative;
  box-shadow: var(--shadow-sm);
}
.card + .card, .card + .mt { margin-top: 12px; }
.mt { margin-top: 12px; }

.card-hd {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-bottom: 16px;
}
.card-title { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.card-accent { border-top: 1px solid color-mix(in srgb, var(--primary) 55%, transparent); }
.card-invest { border-top: 1px solid color-mix(in srgb, var(--invest) 55%, transparent); }

/* ============================================================
   ABSCHNITTS-KOPF
   ============================================================ */
.sec-hd {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-bottom: 14px;
}
.sec-hd h1 { font-size: 27px; }
.sec-hd h2 { font-size: 16px; letter-spacing: -0.01em; }
.sec-hd h3 { font-size: 14px; }

/* Kleiner Rubrik-Titel über einer Gruppe von Karten */
.rubric {
  display: flex; align-items: center; gap: 10px;
  margin: 26px 2px 12px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.09em; color: var(--text-dim);
}
.rubric::after { content: ''; flex: 1; height: 1px; background: var(--border); order: 2; }
.rubric > span { order: 3; font-size: 11.5px; }
.rubric:first-child { margin-top: 4px; }

/* ============================================================
   TIMER
   ============================================================ */
.timer-wrap { text-align: center; padding: 10px 0 2px; }

.timer-display {
  font-size: clamp(52px, 15vw, 68px);
  font-weight: 600; line-height: 1;
  color: var(--text); letter-spacing: -0.045em;
  transition: color 0.24s;
}
.timer-display.running { color: var(--success); }

.timer-money {
  font-size: 20px; font-weight: 600; color: var(--text-muted);
  margin-top: 8px; letter-spacing: -0.02em; transition: color 0.24s;
}
.timer-money.running { color: var(--success); }

.timer-folder-pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--bg-input); border: 1px solid var(--border);
  padding: 7px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--text-muted);
  cursor: pointer; margin-top: 12px;
  transition: border-color 0.16s, color 0.16s;
}
.timer-folder-pill:hover { border-color: var(--border-strong); color: var(--text); }
.timer-folder-dot { width: 8px; height: 8px; border-radius: 50%; }

.timer-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 12px 18px; border-radius: var(--radius-sm);
  font-weight: 600; border: 1px solid transparent; cursor: pointer;
  font-size: 15px; font-family: var(--font); letter-spacing: -0.01em;
  transition: transform 0.1s var(--ease-out), background 0.16s, border-color 0.16s, opacity 0.15s, filter 0.15s;
  text-decoration: none; width: 100%;
}
.btn:active { transform: scale(0.982); }
.btn:disabled { opacity: 0.3; pointer-events: none; }

.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #fff; }
.btn-success { background: var(--success); color: #04150C; }
.btn-danger  { background: var(--danger);  color: #1A0407; }
.btn-warning { background: var(--warning); color: #1A1200; }
.btn-invest  { background: var(--invest);  color: #150A2A; }
.btn-success:hover, .btn-danger:hover, .btn-warning:hover, .btn-invest:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--bg-input); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.btn-sm   { padding: 8px 13px; font-size: 13px; width: auto; border-radius: var(--radius-xs); }
.btn-icon { padding: 0; width: 34px; height: 34px; border-radius: var(--radius-xs); flex: 0 0 auto; }
.btn-row  { display: flex; gap: 8px; }
.btn-row > * { flex: 1; }

/* ============================================================
   FORMULARE
   ============================================================ */
label, .label {
  display: block; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-muted); margin-bottom: 8px;
}
input, select, textarea {
  width: 100%; background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text); padding: 12px 14px; border-radius: var(--radius-sm);
  font-size: 15px; font-family: var(--font); outline: none;
  -webkit-appearance: none; appearance: none;
  transition: border-color 0.16s, background 0.16s;
}
select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2392939F'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 18px;
  padding-right: 34px;
}
input::placeholder, textarea::placeholder { color: var(--text-dim); }
input:focus, select:focus, textarea:focus { border-color: var(--primary); background-color: var(--bg-hover); box-shadow: var(--ring); }
input.input-error { border-color: var(--danger) !important; animation: shake 0.24s ease; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}
.fg { margin-bottom: 16px; }
textarea { resize: vertical; min-height: 84px; line-height: 1.5; }

.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; }
.toggle-row label { margin: 0; font-size: 14px; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--text); }
.toggle-check {
  width: 46px !important; height: 27px !important; padding: 0 !important;
  border-radius: 999px !important; cursor: pointer; position: relative;
  background: var(--bg-input) !important; border: 1px solid var(--border) !important;
  flex-shrink: 0; transition: background 0.18s, border-color 0.18s;
}
.toggle-check:checked { background: var(--primary) !important; border-color: var(--primary) !important; }
.toggle-check::after {
  content: ''; position: absolute; width: 21px; height: 21px; border-radius: 50%;
  background: #fff; top: 2px; left: 2px; transition: left 0.2s var(--ease-spring);
  box-shadow: 0 1px 3px rgba(0,0,0,0.35);
}
.toggle-check:checked::after { left: 21px; }

/* ============================================================
   KENNZAHL-KACHELN
   ============================================================ */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-box {
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 14px; text-align: left;
  transition: border-color 0.15s ease;
}
.stat-box:hover { border-color: var(--border-strong); }
.stat-lbl {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--text-muted); margin-bottom: 6px;
}
.stat-val { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.full-col { grid-column: 1/-1; }

/* ============================================================
   LISTEN
   ============================================================ */
.list { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--bg-card); }
.list-row {
  display: flex; align-items: center;
  padding: 13px 16px; background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.list-row:last-child { border-bottom: none; }
.list-row:hover { background: var(--bg-hover); }
.list-main { flex: 1; min-width: 0; }
.list-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; }
.list-right { text-align: right; flex-shrink: 0; margin-left: 12px; }
.list-actions { display: flex; gap: 4px; align-items: center; margin-left: 8px; opacity: 0; transition: opacity 0.15s; }
.list-row:hover .list-actions { opacity: 1; }
@media (hover: none) { .list-actions { opacity: 1; } }

.plus  { color: var(--success); font-weight: 600; }
.minus { color: var(--danger);  font-weight: 600; }

.badge-recurring {
  background: var(--primary-dim); color: var(--primary);
  font-size: 10px; font-weight: 700; padding: 2px 7px;
  border-radius: 5px; margin-left: 6px; vertical-align: middle;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: -0.01em;
}
.badge-up     { background: var(--success-dim); color: var(--success); }
.badge-down   { background: var(--danger-dim);  color: var(--danger); }
.badge-flat   { background: var(--bg-input);    color: var(--text-muted); }
.badge-invest { background: var(--invest-dim);  color: var(--invest); }

/* ============================================================
   ORDNER-KARTEN
   ============================================================ */
.folder-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 580px) { .folder-grid { grid-template-columns: repeat(3, 1fr); } }

.folder-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  cursor: pointer; position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s var(--ease-out), background 0.15s, border-color 0.15s;
}
.folder-card:hover { background: var(--bg-hover); transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.folder-card:active { transform: scale(0.98); }
.folder-card-bar { position: absolute; top: 0; left: 0; right: 0; height: 2px; }
.folder-card-name { font-size: 15px; font-weight: 700; margin: 4px 0 10px; letter-spacing: -0.01em; }
.folder-card-stat { font-size: 12px; color: var(--text-muted); }
.folder-card-earn { font-size: 16px; font-weight: 700; font-family: var(--font-num); margin-top: 4px; letter-spacing: -0.02em; }

/* ============================================================
   DEPOT-ORDNER
   ============================================================ */
.ifolder-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0; cursor: pointer;
  transition: background 0.15s, border-color 0.15s; overflow: hidden;
}
.ifolder-card:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.ifolder-bar { height: 2px; width: 100%; }
.ifolder-body { padding: 15px 16px 16px; }
.ifolder-hd { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ifolder-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.ifolder-name { font-size: 15px; font-weight: 700; flex: 1; letter-spacing: -0.01em; }
.ifolder-meta { display: flex; gap: 6px; align-items: center; }
.ifolder-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 10px; }
.ifolder-stat { background: var(--bg-sunken); border-radius: var(--radius-xs); padding: 9px 10px; }
.ifolder-stat-lbl { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-dim); margin-bottom: 4px; }
.ifolder-stat-val { font-size: 13px; font-weight: 700; font-family: var(--font-num); }
.ifolder-progress-bar { height: 3px; background: rgba(255,255,255,0.07); border-radius: 999px; margin-top: 14px; overflow: hidden; }
.ifolder-progress-fill { height: 100%; border-radius: 999px; transition: width 0.5s var(--ease-out); }

.ungrouped-section-hd {
  display: flex; justify-content: space-between; align-items: center;
  margin: 20px 0 10px; padding: 9px 14px;
  background: var(--bg-sunken); border-radius: var(--radius-sm);
  border: 1px dashed var(--border-strong);
}
.ungrouped-section-title { font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.ungrouped-section-val { font-size: 13px; font-weight: 700; font-family: var(--font-num); color: var(--text-muted); }

/* ============================================================
   DIAGRAMME
   ============================================================ */
.chart-wrap { position: relative; width: 100%; height: 208px; margin: 4px 0; }
canvas.line-chart { width: 100% !important; height: 100% !important; }

.chart-tooltip {
  position: absolute;
  background: var(--bg-elev); border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs); padding: 8px 12px;
  font-size: 12px; font-weight: 600; font-family: var(--font-num);
  pointer-events: none; white-space: nowrap;
  opacity: 0; transition: opacity 0.12s; z-index: 10;
  box-shadow: var(--shadow-md);
}
.chart-tooltip.visible { opacity: 1; }
.chart-tooltip-date { color: var(--text-muted); font-size: 10px; font-weight: 600; margin-top: 3px; font-family: var(--font); }
.chart-tooltip-pl { font-size: 11px; font-weight: 700; margin-top: 2px; }
.chart-tooltip-pl.up { color: var(--up); }
.chart-tooltip-pl.down { color: var(--down); }

/* Segmentierte Zeitraum-Wahl */
.chart-filter-pills {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--bg-input); border: 1px solid var(--border); border-radius: 999px;
}
.pill {
  background: none; border: none; color: var(--text-muted);
  font-size: 11.5px; font-weight: 650; font-family: var(--font);
  padding: 5px 11px; border-radius: 999px; cursor: pointer;
  transition: color 0.16s, background 0.16s;
}
.pill:hover { color: var(--text); }
.pill.active { background: var(--accent); color: var(--accent-ink); }

.chart-axis-x { display: flex; justify-content: space-between; padding: 0 4px; margin-top: 6px; }
.chart-axis-label { font-size: 10px; color: var(--text-dim); font-family: var(--font-num); }

/* ============================================================
   FARBWAHL
   ============================================================ */
.color-row { display: flex; gap: 9px; flex-wrap: wrap; padding: 4px 0; }
.color-dot {
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; box-shadow: 0 0 0 0 transparent;
  transition: transform 0.15s var(--ease-spring), box-shadow 0.15s;
}
.color-dot.sel { transform: scale(1.12); box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px var(--text); }

/* ============================================================
   DIALOGE
   ============================================================ */
dialog {
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 0; max-width: 480px; width: calc(100% - 32px);
  color: var(--text); box-shadow: var(--shadow-lg);
  max-height: 88vh; overflow-y: auto;
}
dialog::backdrop { background: rgba(4,4,7,0.72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
dialog[open] { animation: dialogIn 0.28s var(--ease-out) both; }
dialog[open]::backdrop { animation: backdropIn 0.22s ease both; }
@keyframes dialogIn {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}
@keyframes backdropIn { from { opacity: 0; } to { opacity: 1; } }

.modal-hd {
  padding: 18px 20px 16px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  position: sticky; top: 0; background: var(--bg-elev); z-index: 1;
}
.modal-title { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.modal-body { padding: 20px; }
.modal-ft {
  padding: 14px 20px; background: var(--bg-card);
  display: flex; gap: 8px; border-top: 1px solid var(--border);
  position: sticky; bottom: 0;
}

/* ============================================================
   FILTER-TABS
   ============================================================ */
.filter-tabs {
  display: inline-flex; gap: 2px; margin-bottom: 16px; padding: 3px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 999px; max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.filter-tabs::-webkit-scrollbar { display: none; }
.filter-tab {
  flex: 0 0 auto; padding: 7px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  background: none; color: var(--text-muted);
  border: none; cursor: pointer; font-family: var(--font);
  transition: background 0.16s, color 0.16s;
}
.filter-tab:hover { color: var(--text); }
.filter-tab.active { background: var(--accent); color: var(--accent-ink); }

/* ============================================================
   ZIELE
   ============================================================ */
.goal-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; margin-bottom: 10px;
}
.goal-summary { border-color: color-mix(in srgb, var(--invest) 34%, transparent); background: linear-gradient(140deg, var(--invest-dim), transparent 70%), var(--bg-card); }
.goal-hd { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.goal-name { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.goal-vals { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.goal-pct { font-size: 22px; font-weight: 700; letter-spacing: -0.03em; }
.goal-bar { height: 6px; background: var(--bg-input); border-radius: 999px; overflow: hidden; }
.goal-bar-fill { height: 100%; border-radius: 999px; transition: width 0.6s var(--ease-out); }
.goal-bar-fill.success { background: var(--success); }
.goal-bar-fill.primary { background: var(--primary); }
.goal-bar-fill.invest  { background: var(--invest); }
.goal-bar-fill.warning { background: var(--warning); }
.goal-sub { font-size: 11.5px; color: var(--text-dim); margin-top: 8px; }

/* ============================================================
   HILFSKLASSEN
   ============================================================ */
.hidden { display: none !important; }
.flex   { display: flex; align-items: center; }
.gap-sm { gap: 8px; }
.gap-md { gap: 12px; }
.text-muted   { color: var(--text-muted); }
.text-dim     { color: var(--text-dim); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-invest  { color: var(--invest); }
.bold { font-weight: 700; }
.empty { text-align: center; padding: 52px 20px; color: var(--text-dim); font-size: 14px; line-height: 1.6; }
.empty-icon { font-size: 30px; margin-bottom: 10px; opacity: 0.7; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }

.big-val {
  font-size: 36px; font-weight: 700; font-family: var(--font-num);
  line-height: 1; margin: 10px 0 8px; letter-spacing: -0.035em;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed; bottom: calc(var(--nav-h) + var(--safe-b) + 14px);
  left: 50%; transform: translateX(-50%) translateY(16px);
  background: var(--bg-elev); border: 1px solid var(--border-strong);
  color: var(--text); padding: 12px 16px; border-radius: var(--radius);
  font-size: 14px; font-weight: 500;
  display: flex; align-items: center; gap: 14px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease, transform 0.3s var(--ease-spring);
  z-index: 9999; white-space: nowrap; box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.toast-undo {
  background: none; border: none; color: var(--primary);
  font-weight: 700; cursor: pointer; font-size: 14px; font-family: var(--font); padding: 0;
}

/* ============================================================
   THEME-SCHALTER + HELLES THEMA
   ============================================================ */
.theme-toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.toggle-track {
  width: 46px; height: 27px; background: var(--bg-input); border-radius: 999px;
  border: 1px solid var(--border); position: relative; transition: background 0.18s, border-color 0.18s;
}
.toggle-track.on { background: var(--primary); border-color: var(--primary); }
.toggle-thumb {
  width: 21px; height: 21px; border-radius: 50%; background: #fff;
  position: absolute; top: 2px; left: 2px;
  transition: left 0.2s var(--ease-spring); box-shadow: 0 1px 3px rgba(0,0,0,0.35);
}
.toggle-track.on .toggle-thumb { left: 21px; }

body.light {
  --bg: #F4F5F8;
  --bg-elev: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-input: #EEEFF4;
  --bg-hover: #E5E7EE;
  --bg-sunken: rgba(16,18,32,0.035);
  --border: rgba(16,18,40,0.09);
  --border-strong: rgba(16,18,40,0.18);
  --text: #14162A;
  --text-muted: #5A5D74;
  --text-dim: #8B8EA3;
  --accent: #14162A;
  --accent-ink: #FFFFFF;
  --shadow-sm: 0 1px 2px rgba(16,18,50,0.05);
  --shadow-md: 0 8px 24px rgba(16,18,50,0.09);
  --shadow-lg: 0 24px 60px rgba(16,18,50,0.16);
}
body.light::before { background: linear-gradient(180deg, rgba(16,18,40,0.03), transparent 78%); }
body.light .btn-danger  { color: #fff; }
body.light .btn-invest  { color: #fff; }
body.light .ins-heat-cell { background: rgba(16,18,40,0.06); }
body.light .ins-heat-legend i { background: rgba(16,18,40,0.06); }

/* ============================================================
   DEPOT
   ============================================================ */
.asset-row {
  display: flex; gap: 11px; padding: 14px 16px;
  background: var(--bg-card); border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background 0.15s;
}
.asset-row:last-child { border-bottom: none; }
.asset-row:hover { background: var(--bg-hover); }
.asset-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.asset-info { flex: 1; min-width: 0; }
.asset-name { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.asset-invested { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.asset-right { text-align: right; flex-shrink: 0; }
.asset-val { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
.asset-pl { font-size: 12px; margin-top: 3px; font-family: var(--font-num); }

.hist-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.hist-row:last-child { border-bottom: none; }
.hist-date { font-size: 12px; color: var(--text-muted); }
.hist-val { font-size: 14px; font-weight: 600; }

.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 14px; font-weight: 600;
  font-family: var(--font); padding: 0 0 18px 0; transition: color 0.15s;
}
.back-btn:hover { color: var(--text); }
.back-btn svg { width: 17px; height: 17px; fill: currentColor; }

.history-list { max-height: 250px; overflow-y: auto; }

.edit-ico {
  background: none; border: none; cursor: pointer;
  color: var(--text-dim); padding: 5px; border-radius: 6px; transition: color 0.15s, background 0.15s;
}
.edit-ico:hover { color: var(--text); background: var(--bg-hover); }
.edit-ico svg { width: 15px; height: 15px; fill: currentColor; display: block; }

.sess-row {
  display: flex; gap: 10px; padding: 12px 14px; align-items: center;
  background: var(--bg-card); border-bottom: 1px solid var(--border);
}
.sess-row:last-child { border-bottom: none; }
.sess-row:hover .sess-actions { opacity: 1; }
.sess-main { flex: 1; min-width: 0; }
.sess-title { font-size: 14px; font-weight: 600; }
.sess-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }
.sess-earn { font-size: 14px; font-weight: 700; color: var(--success); flex-shrink: 0; margin-left: 8px; }
.sess-actions { display: flex; gap: 4px; opacity: 0; transition: opacity 0.15s; }
@media (hover: none) { .sess-actions { opacity: 1; } }

.csv-drop-zone {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius);
  padding: 28px; text-align: center; color: var(--text-muted);
  font-size: 14px; cursor: pointer; transition: border-color 0.16s, background 0.16s, color 0.16s;
}
.csv-drop-zone:hover { border-color: var(--primary); background: var(--primary-dim); color: var(--text); }
.csv-preview-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 12px; max-height: 200px; overflow-y: auto; display: block; }
.csv-preview-table th { text-align: left; padding: 7px 8px; color: var(--text-muted); font-weight: 600; border-bottom: 1px solid var(--border); }
.csv-preview-table td { padding: 7px 8px; border-bottom: 1px solid var(--border); }

/* ============================================================
   KRYPTO
   ============================================================ */
.crypto-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.sync-indicator { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-muted); }
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-dim); transition: background 0.24s; }
.sync-dot.live { background: var(--success); animation: pulse-dot 2s infinite; }
.sync-dot.loading { background: var(--warning); }
.sync-dot.error { background: var(--danger); }
@keyframes pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

.crypto-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: var(--bg-card);
  border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s;
}
.crypto-row:last-child { border-bottom: none; }
.crypto-row:hover { background: var(--bg-hover); }
.crypto-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 700; flex-shrink: 0; background: var(--bg-input);
}
.crypto-info { flex: 1; min-width: 0; }
.crypto-name { font-size: 14px; font-weight: 600; }
.crypto-sym { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.crypto-right { text-align: right; flex-shrink: 0; }
.crypto-price { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
.crypto-change { font-size: 12px; margin-top: 3px; font-family: var(--font-num); }
.crypto-mini-chart { width: 60px; height: 32px; flex-shrink: 0; }

.asset-linked-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 5px;
  background: var(--success-dim); color: var(--success);
  border: 1px solid color-mix(in srgb, var(--success) 25%, transparent); margin-left: 6px;
}

.search-bar {
  display: flex; align-items: center; gap: 9px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
  margin-bottom: 12px; transition: border-color 0.16s;
}
.search-bar:focus-within { border-color: var(--primary); box-shadow: var(--ring); }
.search-bar input { border: none; background: none; padding: 0; flex: 1; font-size: 14px; color: var(--text); }
.search-bar input:focus { border: none; background: none; box-shadow: none; }
.search-bar svg { width: 16px; height: 16px; fill: var(--text-muted); flex-shrink: 0; }

/* Ansichts-Tabs innerhalb einer Gruppe */
.view-tabs {
  display: flex; gap: 4px; margin-bottom: 18px;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  padding: 3px; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 999px;
}
.view-tabs::-webkit-scrollbar { display: none; }
.view-tab {
  flex-shrink: 0; background: none; border: none; border-radius: 999px;
  padding: 7px 14px; font-size: 13px; font-weight: 600; white-space: nowrap;
  color: var(--text-muted); cursor: pointer; font-family: var(--font);
  transition: background 0.16s, color 0.16s;
}
.view-tab:hover { color: var(--text); }
.view-tab.active { background: var(--accent); color: var(--accent-ink); }
.view-tab.active-invest { background: var(--invest); color: #150A2A; }
.subnav { margin-bottom: 18px; }
.subnav .view-tab.active { background: var(--accent); color: var(--accent-ink); }

/* ============================================================
   BITGET
   ============================================================ */
.bitget-setup { text-align: center; padding: 44px 20px; color: var(--text-muted); }
.bitget-setup .setup-icon { font-size: 44px; margin-bottom: 16px; opacity: 0.8; }
.bitget-setup h3 { color: var(--text); margin-bottom: 8px; font-size: 18px; }
.bitget-setup p { font-size: 14px; line-height: 1.6; max-width: 320px; margin: 0 auto 20px; }

.api-key-form { background: var(--bg-input); border-radius: var(--radius); border: 1px solid var(--border); padding: 16px; margin-bottom: 16px; }
.api-key-form .api-key-row { display: flex; gap: 8px; align-items: flex-end; }
.api-key-form .fg { margin-bottom: 0; flex: 1; }

.bitget-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted); margin: 20px 0 9px;
}

.balance-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 16px; background: var(--bg-card); border-bottom: 1px solid var(--border);
}
.balance-row:last-child { border-bottom: none; }
.balance-coin { font-size: 14px; font-weight: 600; }
.balance-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }
.balance-right { text-align: right; }
.balance-amt { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
.balance-usd { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; font-family: var(--font-num); }

.position-row { padding: 13px 16px; background: var(--bg-card); border-bottom: 1px solid var(--border); }
.position-row:last-child { border-bottom: none; }
.position-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 9px; }
.position-sym { font-size: 14px; font-weight: 700; }
.position-side-long  { background: var(--success-dim); color: var(--success); padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.position-side-short { background: var(--danger-dim);  color: var(--danger);  padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.position-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.position-stat-lbl { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-dim); margin-bottom: 3px; }
.position-stat-val { font-size: 13px; font-weight: 700; font-family: var(--font-num); }

.order-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 16px; background: var(--bg-card); border-bottom: 1px solid var(--border);
}
.order-row:last-child { border-bottom: none; }
.order-sym { font-size: 14px; font-weight: 700; }
.order-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }
.order-right { text-align: right; }

.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid var(--border); border-top-color: var(--text);
  border-radius: 50%; animation: spin 0.6s linear infinite;
  vertical-align: middle; margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { text-align: center; padding: 34px; color: var(--text-muted); font-size: 14px; }

.crypto-link-row {
  background: var(--bg-input); border-radius: var(--radius-sm);
  padding: 13px 14px; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.crypto-link-info { flex: 1; }
.crypto-link-info .link-title { font-size: 13px; font-weight: 600; color: var(--text); }
.crypto-link-info .link-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }

/* ============================================================
   PWA-BANNER
   ============================================================ */
.pwa-banner {
  display: none; position: fixed;
  bottom: calc(var(--nav-h) + var(--safe-b) + 78px);
  left: 16px; right: 16px;
  background: var(--bg-elev); border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: 14px 16px; z-index: 8000;
  flex-direction: row; align-items: center; gap: 12px;
  box-shadow: var(--shadow-lg); animation: slideUp 0.26s var(--ease-out);
}
.pwa-banner.show { display: flex; }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.pwa-banner-text { flex: 1; color: var(--text); font-size: 14px; font-weight: 600; }
.pwa-banner-sub { font-size: 12px; color: var(--text-muted); font-weight: 400; margin-top: 2px; }
.pwa-banner-btn {
  background: var(--accent); color: var(--accent-ink); border: none;
  padding: 9px 14px; border-radius: var(--radius-xs); font-weight: 700;
  cursor: pointer; font-size: 13px; white-space: nowrap; font-family: var(--font);
}
.pwa-banner-close { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 16px; padding: 4px; }
@media (min-width: 1024px) { .pwa-banner { left: auto; right: 24px; width: 360px; bottom: 24px; } }

/* ============================================================
   MÄRKTE
   ============================================================ */
.mkt-addbar {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px; margin-bottom: 14px;
}
.mkt-addbar .row { display: flex; gap: 8px; }
.mkt-addbar input { flex: 1; min-width: 0; }
.mkt-search-results { position: relative; }
.mkt-suggest {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 50;
  background: var(--bg-elev); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); margin-top: 4px; max-height: 250px;
  overflow-y: auto; box-shadow: var(--shadow-md);
}
.mkt-suggest-item { padding: 11px 12px; cursor: pointer; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 8px; }
.mkt-suggest-item:last-child { border-bottom: none; }
.mkt-suggest-item:hover { background: var(--bg-hover); }
.mkt-suggest-sym { font-weight: 700; color: var(--text); font-size: 14px; }
.mkt-suggest-name { color: var(--text-muted); font-size: 12px; }
.mkt-suggest-ex { color: var(--text-dim); font-size: 11px; white-space: nowrap; }

.holding-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 14px; background: var(--bg-card); border-bottom: 1px solid var(--border);
}
.holding-row:last-child { border-bottom: none; }
.holding-main { min-width: 0; flex: 1; }
.holding-name { font-weight: 650; font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.holding-sub { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.holding-right { text-align: right; white-space: nowrap; }
.holding-val { font-weight: 700; font-size: 15px; letter-spacing: -0.02em; }
.holding-pl { font-family: var(--font-num); font-size: 12px; margin-top: 3px; }
.holding-del { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 16px; padding: 4px 6px; border-radius: 6px; }
.holding-del:hover { color: var(--danger); background: var(--danger-dim); }
.mkt-meta { font-size: 11px; color: var(--text-dim); margin-top: 3px; }
.bitget-subtabs-scroll { display: flex; gap: 4px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 3px; scrollbar-width: none; background: var(--bg-input); border: 1px solid var(--border); border-radius: 999px; margin-bottom: 14px; }
.bitget-subtabs-scroll::-webkit-scrollbar { display: none; }
.bitget-subtabs-scroll .view-tab { white-space: nowrap; flex: 0 0 auto; }

/* ============================================================
   AUFGABEN — Kopfbereich
   ============================================================ */
.todo-hd {
  position: sticky; top: 0; z-index: 30;
  margin: -22px -18px 0; padding: 20px 18px 0;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.todo-hd.stuck { border-bottom-color: var(--border); }
.todo-hd-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.todo-hd-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.todo-hd-title h1 { font-size: 25px; }
.todo-hd-sub { font-size: 13px; color: var(--text-muted); margin-top: 5px; }
.todo-hd-sub b { color: var(--text); font-weight: 650; }

/* Fortschritt des Tages — der eine Balken, der zählt */
.todo-progress {
  height: 3px; border-radius: 999px; background: var(--bg-input);
  overflow: hidden; margin: 14px 0 0;
}
.todo-progress-fill {
  height: 100%; border-radius: 999px; background: var(--success);
  width: 0; transition: width 0.6s var(--ease-out);
}

/* Segmentierte Unternavigation mit Zählern */
.todo-subnav {
  position: relative;
  height: var(--subnav-h);
  display: flex; align-items: stretch;
  padding: 5px; margin: 14px 0 0;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: none;
}
.todo-subnav-ind {
  position: absolute; top: 5px; bottom: 5px; left: 5px;
  width: calc((100% - 10px) / 4);
  transform: translateX(calc(var(--ti, 0) * 100%));
  transition: transform 0.32s var(--ease-spring);
  pointer-events: none; z-index: 0;
}
.todo-subnav-ind::before {
  content: ''; position: absolute; inset: 0;
  background: var(--bg-card); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
}
.todo-sub-btn {
  position: relative; z-index: 1; flex: 1; min-width: 0;
  background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 0; color: var(--text-dim);
  font-size: 10.5px; font-weight: 650; font-family: var(--font); letter-spacing: -0.01em;
  transition: color 0.18s ease;
}
.todo-sub-btn svg { width: 19px; height: 19px; fill: currentColor; transition: transform 0.2s var(--ease-spring); }
.todo-sub-btn.active { color: var(--text); }
.todo-sub-btn:active svg { transform: scale(0.86); }
.todo-sub-count {
  position: absolute; top: 2px; left: 50%; margin-left: 3px;
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px;
  background: var(--bg-hover); color: var(--text-muted);
  font-size: 10px; font-weight: 700; line-height: 17px; text-align: center;
  font-family: var(--font-num);
}
.todo-sub-btn.active .todo-sub-count { background: var(--accent); color: var(--accent-ink); }
.todo-sub-count.urgent { background: var(--danger); color: #fff; }

/* Schnelleingabe — tippen, Enter, weiter */
.todo-quickadd {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 4px 6px 4px 14px;
  margin: 18px 0 14px; transition: border-color 0.16s, box-shadow 0.16s;
}
.todo-quickadd:focus-within { border-color: var(--primary); box-shadow: var(--ring); }
.todo-quickadd svg { width: 17px; height: 17px; fill: var(--text-dim); flex: 0 0 auto; }
.todo-quickadd input {
  flex: 1; min-width: 0; background: none; border: none; padding: 11px 0;
  font-size: 15px; color: var(--text); box-shadow: none;
}
.todo-quickadd input:focus { background: none; border: none; box-shadow: none; }
.todo-quickadd-btn {
  flex: 0 0 auto; background: var(--accent); color: var(--accent-ink);
  border: none; border-radius: var(--radius-xs); padding: 8px 14px;
  font-size: 13px; font-weight: 700; font-family: var(--font); cursor: pointer;
  opacity: 0.35; pointer-events: none; transition: opacity 0.16s;
}
.todo-quickadd.has-text .todo-quickadd-btn { opacity: 1; pointer-events: auto; }
.todo-quickadd-hint {
  font-size: 11.5px; color: var(--text-dim); margin: -8px 2px 16px; line-height: 1.5;
}
.todo-quickadd-hint code {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-muted);
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 5px; padding: 1px 5px;
}

/* Gruppen-Kopf innerhalb einer Liste */
.todo-group-hd {
  display: flex; align-items: center; gap: 10px;
  margin: 24px 2px 10px; color: var(--text-muted);
  font-size: 13px; font-weight: 650;
}
.todo-group-hd .d {
  font-size: 13px; font-weight: 800; color: var(--text);
  font-family: var(--font-num); background: var(--bg-input);
  border-radius: 7px; min-width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
}
.todo-group-hd.is-today .d { background: var(--accent); color: var(--accent-ink); }
.todo-group-hd.is-today { color: var(--text); }
.todo-group-hd .spacer { flex: 1; }
.todo-group-hd .count { font-size: 12px; color: var(--text-dim); font-family: var(--font-num); }
.todo-group-hd .act {
  background: var(--bg-input); border: 1px solid var(--border); color: var(--text-muted);
  font-size: 11.5px; font-weight: 650; font-family: var(--font);
  padding: 4px 10px; border-radius: 999px; cursor: pointer; transition: color 0.15s, border-color 0.15s;
}
.todo-group-hd .act:hover { color: var(--text); border-color: var(--border-strong); }
.todo-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ============================================================
   AUFGABEN — Zeile
   ============================================================ */
.todo-swipe { position: relative; overflow: hidden; background: var(--bg-card); border-bottom: 1px solid var(--border); }
.todo-swipe:last-child { border-bottom: none; }
.todo-swipe.removing { animation: todoLeave 0.26s var(--ease-out) forwards; }
@keyframes todoLeave {
  to { opacity: 0; transform: translateX(8px); max-height: 0; }
}
.todo-under { position: absolute; inset: 0; display: flex; justify-content: space-between; }
.todo-under .u-date, .todo-under .u-list {
  display: flex; align-items: center; width: 110px;
  color: #fff; opacity: 0; transition: opacity 0.12s;
}
.todo-under .u-date { background: var(--warning); color: #1A1200; justify-content: flex-start; padding-left: 22px; }
.todo-under .u-list { background: var(--primary); justify-content: flex-end; padding-right: 22px; margin-left: auto; }
.todo-under svg { width: 21px; height: 21px; fill: currentColor; }
.todo-swipe.show-l .u-date { opacity: 1; }
.todo-swipe.show-r .u-list { opacity: 1; }

.todo-row {
  position: relative; display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 14px; background: var(--bg-card);
  touch-action: pan-y; transition: transform 0.15s ease, background 0.15s;
  user-select: none; -webkit-user-select: none;
}
.todo-row:hover { background: var(--bg-hover); }

.todo-check {
  width: 21px; height: 21px; border-radius: 7px; margin-top: 1px;
  border: 1.5px solid var(--text-dim); background: transparent;
  flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  color: transparent; cursor: pointer; padding: 0;
  transition: background 0.16s, border-color 0.16s, transform 0.16s var(--ease-spring);
}
.todo-check:hover { border-color: var(--text-muted); }
.todo-check:active { transform: scale(0.86); }
.todo-check.done { background: var(--success); border-color: var(--success); color: #04150C; }
.todo-check svg { width: 13px; height: 13px; fill: currentColor; }
.todo-row.is-star .todo-check { border-color: var(--warning); }

.todo-main { flex: 1; min-width: 0; cursor: pointer; padding-right: 2px; }
.todo-title { font-size: 14.5px; font-weight: 550; line-height: 1.35; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.todo-row.is-done .todo-title { color: var(--text-dim); text-decoration: line-through; text-decoration-color: var(--text-dim); }
.todo-note { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.todo-meta { display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.todo-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; color: var(--text-muted);
  background: var(--bg-sunken); border: 1px solid var(--border);
  border-radius: 999px; padding: 2px 9px; white-space: nowrap;
}
.todo-chip .dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.todo-chip.overdue { color: var(--danger); background: var(--danger-dim); border-color: color-mix(in srgb, var(--danger) 26%, transparent); }
.todo-chip.today { color: var(--text); border-color: var(--border-strong); }
.todo-meta .overdue { color: var(--danger); font-weight: 650; }

.todo-star {
  background: none; border: none; padding: 6px; margin: -4px -4px 0 0; cursor: pointer;
  color: var(--text-dim); flex: 0 0 auto; border-radius: 7px;
  transition: color 0.15s, background 0.15s, transform 0.15s var(--ease-spring);
}
.todo-star:hover { color: var(--text-muted); background: var(--bg-input); }
.todo-star:active { transform: scale(0.82); }
.todo-star.on { color: var(--warning); }
.todo-star svg { width: 18px; height: 18px; fill: currentColor; display: block; }

/* Aktionen für Maus-Nutzer — Wischen gibt es dort nicht */
.todo-actions { display: flex; align-items: center; gap: 2px; flex: 0 0 auto; opacity: 0; transition: opacity 0.15s; }
.todo-swipe:hover .todo-actions, .todo-row:focus-within .todo-actions { opacity: 1; }
.todo-act {
  background: none; border: none; padding: 6px; cursor: pointer; border-radius: 7px;
  color: var(--text-dim); transition: color 0.15s, background 0.15s;
}
.todo-act:hover { color: var(--text); background: var(--bg-input); }
.todo-act.danger:hover { color: var(--danger); background: var(--danger-dim); }
.todo-act svg { width: 16px; height: 16px; fill: currentColor; display: block; }
@media (hover: none), (max-width: 700px) { .todo-actions { display: none; } }

.todo-empty {
  padding: 54px 20px; text-align: center; color: var(--text-dim);
  font-size: 13.5px; line-height: 1.65;
}
.todo-empty .big { font-size: 34px; display: block; margin-bottom: 12px; opacity: 0.75; }
.todo-empty .head { display: block; font-size: 15px; font-weight: 650; color: var(--text); margin-bottom: 6px; }
.todo-hint { margin-top: 16px; text-align: center; font-size: 11.5px; color: var(--text-dim); line-height: 1.6; }

.todolist-icon {
  width: 34px; height: 34px; border-radius: var(--radius-xs); flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.todo-back {
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: none; color: var(--text-muted);
  font-size: 13px; font-weight: 600; cursor: pointer; padding: 0; margin-bottom: 12px;
  transition: color 0.15s;
}
.todo-back:hover { color: var(--text); }
.todo-back svg { width: 15px; height: 15px; fill: currentColor; }

.todo-anim { animation: todoContentIn 0.22s var(--ease-out); }
@keyframes todoContentIn {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: none; }
}

.todo-fab {
  position: fixed; right: 18px;
  bottom: calc(var(--nav-h) + var(--safe-b) + 18px);
  width: 54px; height: 54px; border-radius: 18px; border: none;
  background: var(--accent); color: var(--accent-ink);
  font-size: 27px; line-height: 1; font-weight: 300;
  box-shadow: var(--shadow-lg); cursor: pointer; z-index: 500;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s var(--ease-spring);
}
.todo-fab:hover { transform: translateY(-2px) scale(1.03); }
.todo-fab:active { transform: scale(0.9); }
@media (min-width: 1024px) { .todo-fab { right: 28px; bottom: 28px; width: 50px; height: 50px; font-size: 25px; } }

.quick-opts { display: flex; flex-direction: column; gap: 7px; }
.quick-opts button { justify-content: flex-start; text-align: left; width: 100%; }
.emoji-row { display: flex; gap: 6px; flex-wrap: wrap; }
.emoji-btn {
  width: 38px; height: 38px; border-radius: var(--radius-xs); font-size: 18px;
  background: var(--bg-input); border: 1px solid var(--border); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}
.emoji-btn:hover { border-color: var(--border-strong); }
.emoji-btn.sel { border-color: var(--primary); background: var(--primary-dim); }
.star-toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text); }

/* ============================================================
   INSIGHTS
   ============================================================ */
.ins-hd {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 18px;
}

/* Zwei Spalten, sobald Platz da ist */
.ins-grid { display: grid; gap: 12px; }
@media (min-width: 760px) { .ins-grid.two { grid-template-columns: 1fr 1fr; align-items: start; } }
.ins-grid > .card { margin-top: 0; }
.ins-grid > .card + .card { margin-top: 0; }

.ins-hero {
  border: 1px solid var(--border-strong);
  background: linear-gradient(150deg, rgba(255,255,255,0.045), transparent 62%), var(--bg-card);
  padding: 20px;
}
.ins-hero-lbl {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted);
}
.ins-hero-val {
  font-size: clamp(34px, 10vw, 46px); font-weight: 700;
  line-height: 1.05; margin: 8px 0 10px; letter-spacing: -0.04em;
}
.ins-hero-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.ins-split { display: flex; flex-wrap: wrap; gap: 6px; }
.ins-chip {
  display: inline-flex; align-items: baseline; gap: 6px;
  background: var(--bg-sunken); border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 12px; font-size: 12px; color: var(--text-muted);
}
.ins-chip b { font-family: var(--font-num); font-weight: 700; }

/* Veränderungs-Marker */
.ins-delta {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 700; font-family: var(--font-num);
  padding: 3px 9px; border-radius: 999px;
  background: var(--bg-input); color: var(--text-muted);
}
.ins-delta.up   { background: var(--success-dim); color: var(--success); }
.ins-delta.down { background: var(--danger-dim);  color: var(--danger); }

/* Auf einen Blick */
.ins-facts { display: flex; flex-direction: column; gap: 2px; }
.ins-fact {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 2px; border-bottom: 1px solid var(--border);
  font-size: 13.5px; line-height: 1.5; color: var(--text-muted);
}
.ins-fact:last-child { border-bottom: none; }
.ins-fact .ico {
  width: 26px; height: 26px; border-radius: 8px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; background: var(--bg-input);
}
.ins-fact b { color: var(--text); font-weight: 650; }

/* KPI-Kacheln */
.ins-kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 620px) { .ins-kpis { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 760px) { .ins-grid.two .ins-kpis { grid-template-columns: repeat(2, 1fr); } }
.ins-kpi {
  background: var(--bg-sunken); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 13px 14px;
  transition: border-color 0.15s ease;
}
.ins-kpi:hover { border-color: var(--border-strong); }
.ins-kpi-lbl {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--text-muted); margin-bottom: 7px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ins-kpi-val { font-size: 19px; font-weight: 700; line-height: 1.15; letter-spacing: -0.03em; }
.ins-kpi-sub { font-size: 11px; color: var(--text-dim); margin-top: 5px; line-height: 1.35; }

/* Aktivitäts-Raster */
.ins-heat-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; scrollbar-width: none; }
.ins-heat-scroll::-webkit-scrollbar { display: none; }
.ins-heat-months { display: grid; grid-auto-flow: column; grid-auto-columns: 14px; gap: 3px; margin-bottom: 6px; min-width: max-content; }
.ins-heat-month { font-size: 9.5px; color: var(--text-dim); white-space: nowrap; font-weight: 600; }
.ins-heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 14px); grid-auto-columns: 14px; gap: 3px; min-width: max-content; }
.ins-heat-cell {
  width: 14px; height: 14px; border-radius: 4px;
  background: rgba(255,255,255,0.05); cursor: pointer;
  transition: transform 0.12s var(--ease-spring), outline-color 0.12s;
  outline: 1.5px solid transparent; outline-offset: 1px;
}
.ins-heat-cell[data-lvl="1"] { background: rgba(79,124,255,0.30); }
.ins-heat-cell[data-lvl="2"] { background: rgba(79,124,255,0.52); }
.ins-heat-cell[data-lvl="3"] { background: rgba(79,124,255,0.76); }
.ins-heat-cell[data-lvl="4"] { background: var(--primary); }
.ins-heat-cell:hover { transform: scale(1.15); }
.ins-heat-cell.sel { outline-color: var(--text); transform: scale(1.15); }
.ins-heat-legend { display: flex; align-items: center; gap: 5px; font-size: 10px; color: var(--text-dim); margin-top: 12px; }
.ins-heat-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; background: rgba(255,255,255,0.05); }
.ins-heat-legend i[data-lvl="1"] { background: rgba(79,124,255,0.30); }
.ins-heat-legend i[data-lvl="2"] { background: rgba(79,124,255,0.52); }
.ins-heat-legend i[data-lvl="3"] { background: rgba(79,124,255,0.76); }
.ins-heat-legend i[data-lvl="4"] { background: var(--primary); }
.ins-heat-detail {
  font-size: 12.5px; color: var(--text-muted); margin-top: 12px;
  min-height: 18px; padding: 9px 12px; border-radius: var(--radius-xs);
  background: var(--bg-sunken);
}

/* Balkenreihen */
.ins-bars { display: flex; flex-direction: column; gap: 10px; }
.ins-bar-row { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 12px; }
.ins-bar-lbl { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.ins-bar-track { height: 7px; background: var(--bg-sunken); border-radius: 999px; overflow: hidden; }
.ins-bar-fill { height: 100%; border-radius: 999px; background: var(--primary); width: 0; transition: width 0.6s var(--ease-out); }
.ins-bar-val { font-size: 12px; font-weight: 650; color: var(--text-muted); }

/* Monats-Cashflow */
.ins-cf { display: flex; align-items: flex-end; gap: 10px; height: 140px; padding-top: 6px; }
.ins-cf-month { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; }
.ins-cf-cols { flex: 1; display: flex; align-items: flex-end; gap: 4px; width: 100%; justify-content: center; }
.ins-cf-col { width: 42%; max-width: 20px; border-radius: 4px 4px 0 0; min-height: 2px; transition: height 0.6s var(--ease-out); }
.ins-cf-col.in { background: var(--success); }
.ins-cf-col.out { background: var(--danger); }
.ins-cf-lbl { font-size: 10.5px; color: var(--text-dim); font-weight: 600; }

/* Allokation */
.ins-alloc { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.ins-donut { flex-shrink: 0; }
.ins-legend { flex: 1; min-width: 170px; display: flex; flex-direction: column; gap: 9px; }
.ins-legend-row { display: flex; align-items: center; gap: 9px; font-size: 12.5px; }
.ins-legend-dot { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.ins-legend-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ins-legend-val { font-family: var(--font-num); font-weight: 650; }
.ins-legend-pct { color: var(--text-muted); font-size: 11px; width: 42px; text-align: right; font-family: var(--font-num); }

.ins-note { font-size: 11.5px; color: var(--text-dim); line-height: 1.55; margin-top: 12px; }
.ins-empty { font-size: 13px; color: var(--text-dim); padding: 14px 0; line-height: 1.6; }

/* ============================================================
   BEFEHLSPALETTE
   ============================================================ */
.cmdk-backdrop {
  position: fixed; inset: 0; z-index: 950;
  background: rgba(4,4,7,0.6);
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  display: none; align-items: flex-start; justify-content: center;
  padding: max(10vh, 40px) 14px 20px;
}
.cmdk-backdrop.open { display: flex; }
.cmdk-panel {
  width: 100%; max-width: 580px;
  background: var(--bg-elev); border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  overflow: hidden; animation: cmdkIn 0.18s var(--ease-out) both;
  display: flex; flex-direction: column; max-height: 72vh;
}
@keyframes cmdkIn { from { opacity: 0; transform: translateY(-8px) scale(0.985); } to { opacity: 1; transform: none; } }

.cmdk-search { display: flex; align-items: center; gap: 11px; padding: 15px 17px; border-bottom: 1px solid var(--border); }
.cmdk-search svg { width: 17px; height: 17px; fill: var(--text-dim); flex-shrink: 0; }
.cmdk-input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 16px; font-family: var(--font); padding: 0; }
.cmdk-input:focus { background: none; border: none; box-shadow: none; }
.cmdk-input::placeholder { color: var(--text-dim); }
.cmdk-esc { font-size: 10px; font-weight: 700; color: var(--text-dim); border: 1px solid var(--border-strong); border-radius: 5px; padding: 3px 6px; }
.cmdk-list { overflow-y: auto; padding: 7px; }
.cmdk-group { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); padding: 10px 10px 5px; }
.cmdk-item { display: flex; align-items: center; gap: 11px; padding: 10px 11px; border-radius: var(--radius-sm); cursor: pointer; user-select: none; }
.cmdk-item.sel { background: var(--bg-hover); }
.cmdk-icon { width: 22px; text-align: center; font-size: 15px; flex-shrink: 0; }
.cmdk-body { flex: 1; min-width: 0; }
.cmdk-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.cmdk-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.cmdk-hint { font-size: 10px; color: var(--text-dim); flex-shrink: 0; }
.cmdk-none { padding: 30px 14px; text-align: center; color: var(--text-dim); font-size: 13px; }
.cmdk-foot { border-top: 1px solid var(--border); padding: 9px 15px; font-size: 10.5px; color: var(--text-dim); display: flex; gap: 16px; flex-wrap: wrap; }

.cmdk-fab {
  position: fixed; right: 18px;
  bottom: calc(var(--nav-h) + var(--safe-b) + 18px);
  width: 46px; height: 46px; border-radius: 15px;
  background: var(--bg-card); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-md); color: var(--text);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 60; transition: transform 0.14s var(--ease-out);
}
.cmdk-fab:active { transform: scale(0.92); }
.cmdk-fab svg { width: 19px; height: 19px; fill: currentColor; }
body[data-tab="todo"] .cmdk-fab { display: none; }
@media (min-width: 1024px) {
  .cmdk-fab { display: none; }
  body[data-tab="todo"] .cmdk-fab { display: none; }
}


/* ===== Teil 2 ===== */

/* ============================================================
   BITGET v29 — Datenblöcke
   Gleiche Sprache wie der Rest der App: Haarlinien statt
   Schatten, Tabellenziffern, Farbe nur für Vorzeichen.
   ============================================================ */
.bg-ctl {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px; margin-bottom: 14px;
}
.bg-ctl label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--text-dim);
}
.bg-ctl select, .bg-ctl input {
  background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius-xs);
  padding: 7px 9px; font-size: 13px; font-family: var(--font);
  min-width: 118px;
}
.bg-ctl input { font-family: var(--font-mono); text-transform: uppercase; }
.bg-ctl select:focus, .bg-ctl input:focus { outline: none; border-color: var(--border-strong); box-shadow: var(--ring); }
.bg-ctl button { margin-left: auto; }

.bg-blk {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 12px; overflow: hidden;
}
.bg-blk-hd {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--bg-sunken);
}
.bg-blk-ttl { font-size: 14px; font-weight: 650; min-width: 0; }
.bg-blk-path {
  font-family: var(--font-mono); font-size: 10.5px; color: var(--text-dim);
  margin-top: 3px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bg-blk-act { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.bg-blk-body { padding: 0; }
.bg-blk-body > .bg-empty, .bg-blk-body > .bg-err, .bg-blk-body > .bg-note { padding: 16px; }
.bg-blk-body > .bg-explore, .bg-blk-body > .bg-presets { margin: 12px 14px; }

.bg-mini {
  background: var(--bg-input); border: 1px solid var(--border); color: var(--text-muted);
  border-radius: var(--radius-xs); padding: 4px 8px; font-size: 10.5px; font-weight: 700;
  cursor: pointer; font-family: var(--font); letter-spacing: 0.04em;
}
.bg-mini:hover { background: var(--bg-hover); color: var(--text); }

.bg-state {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-dim); padding: 3px 7px; border-radius: 999px; background: var(--bg-input);
  white-space: nowrap;
}
.bg-state-ok   { color: var(--success); background: var(--success-dim); }
.bg-state-err  { color: var(--danger);  background: var(--danger-dim); }
.bg-state-idle { color: var(--warning); background: var(--warning-dim); }

.bg-empty { text-align: center; padding: 22px; color: var(--text-muted); font-size: 13.5px; }
.bg-err   { color: var(--danger); font-size: 13px; line-height: 1.6; white-space: pre-line; }
.bg-note  { font-size: 12px; color: var(--text-muted); line-height: 1.6; }
.bg-note code, .bg-err code {
  background: var(--bg-input); padding: 2px 6px; border-radius: 5px;
  font-family: var(--font-mono); font-size: 11.5px; color: var(--text);
}
.bg-dim { color: var(--text-dim); }
.bg-n   { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.bg-pos { color: var(--success); }
.bg-neg { color: var(--danger); }

/* Kennzahlenzeile über einer Liste */
.bg-sum {
  display: flex; flex-wrap: wrap; gap: 22px;
  padding: 13px 14px; border-bottom: 1px solid var(--border);
}
.bg-sum-l {
  display: block; font-size: 9.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-dim); margin-bottom: 3px;
}
.bg-sum-v { font-size: 19px; font-weight: 700; font-family: var(--font-num); letter-spacing: -0.02em; }

/* Tabelle mit allen Feldern der Antwort */
.bg-tblwrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.bg-tbl { border-collapse: collapse; width: 100%; font-size: 12px; }
.bg-tbl th {
  position: sticky; top: 0; text-align: left; white-space: nowrap;
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-dim); background: var(--bg-elev);
  padding: 8px 12px; border-bottom: 1px solid var(--border);
}
.bg-tbl td {
  padding: 9px 12px; border-bottom: 1px solid var(--border);
  white-space: nowrap; color: var(--text); vertical-align: top;
}
.bg-tbl tbody tr:last-child td { border-bottom: none; }
.bg-tbl tbody tr:hover td { background: var(--bg-hover); }

/* Einzelobjekt als Feldliste */
.bg-kv {
  display: grid; grid-template-columns: minmax(120px, 34%) 1fr;
  font-size: 13px; border-bottom: 1px solid var(--border);
}
.bg-kv-k {
  padding: 8px 14px; color: var(--text-muted); font-size: 12px;
  border-bottom: 1px solid var(--border); font-family: var(--font-mono);
}
.bg-kv-v {
  padding: 8px 14px; border-bottom: 1px solid var(--border);
  overflow-wrap: anywhere;
}
.bg-kv > div:nth-last-child(-n+2) { border-bottom: none; }

.bg-raw {
  margin: 0; padding: 14px; background: var(--bg); color: var(--text-muted);
  font-family: var(--font-mono); font-size: 11.5px; line-height: 1.55;
  max-height: 420px; overflow: auto; white-space: pre; border-top: 1px solid var(--border);
}
.bg-more { border-top: 1px solid var(--border); }
.bg-more > summary {
  cursor: pointer; padding: 10px 14px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim);
}
.bg-more > summary:hover { color: var(--text); }

/* Endpunkt-Explorer */
.bg-explore { display: flex; gap: 8px; }
.bg-explore input {
  flex: 1; min-width: 0; background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius-xs); padding: 9px 11px;
  font-family: var(--font-mono); font-size: 12.5px;
}
.bg-explore input:focus { outline: none; border-color: var(--border-strong); box-shadow: var(--ring); }
.bg-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.bg-preset {
  background: var(--bg-input); border: 1px solid var(--border); color: var(--text-muted);
  border-radius: 999px; padding: 5px 11px; font-size: 11.5px; cursor: pointer; font-family: var(--font);
}
.bg-preset:hover { background: var(--bg-hover); color: var(--text); border-color: var(--border-strong); }

/* Proxy-Status auf dem Einrichtungsbildschirm */
.bg-proxy-state {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--text-muted); line-height: 1.6;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 11px 13px; margin-bottom: 14px;
}
.bg-proxy-state.ok  { border-color: rgba(63,207,142,0.3); }
.bg-proxy-state.err { border-color: rgba(255,92,104,0.3); }
.bg-ok-dot, .bg-err-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.bg-ok-dot  { background: var(--success); box-shadow: 0 0 0 3px var(--success-dim); }
.bg-err-dot { background: var(--danger);  box-shadow: 0 0 0 3px var(--danger-dim); }

.bg-steps { counter-reset: s; margin: 0 0 14px; padding: 0; list-style: none; }
.bg-steps li {
  counter-increment: s; position: relative; padding: 0 0 10px 30px;
  font-size: 13px; line-height: 1.65; color: var(--text-muted);
}
.bg-steps li::before {
  content: counter(s); position: absolute; left: 0; top: 1px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--bg-input); border: 1px solid var(--border);
  font-size: 11px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; justify-content: center;
}
.bg-steps code {
  background: var(--bg-input); border: 1px solid var(--border);
  padding: 2px 7px; border-radius: 5px; font-family: var(--font-mono);
  font-size: 11.5px; color: var(--text);
}

@media (max-width: 560px) {
  .bg-ctl label { flex: 1 1 100%; }
  .bg-ctl select, .bg-ctl input { width: 100%; }
  .bg-ctl button { margin-left: 0; width: 100%; }
  .bg-kv { grid-template-columns: 1fr; }
  .bg-kv-k { padding-bottom: 0; border-bottom: none; }
  .bg-sum-v { font-size: 17px; }
}