/* CoinLedger v0.1 — "Hauptbuch"
   Tinte + Messing. Zahlen in Plex Mono (tabular), Summen mit
   klassischer Buchhaltungs-Doppellinie. */

:root {
  --ink: #0C1013;
  --paper: #12181E;
  --paper-2: #171F26;
  --line: #23303A;
  --line-soft: #1B2530;
  --text: #E6EDF1;
  --muted: #8CA0AC;
  --brass: #E0B558;
  --brass-dim: #9A7C3A;
  --mint: #46C08E;
  --red: #E36778;
  --steel: #5E9BD6;
  --radius: 10px;
  --font-ui: "Archivo", system-ui, sans-serif;
  --font-num: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ink); color: var(--text);
  font: 15px/1.5 var(--font-ui);
}
a { color: var(--brass); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

.mono, td.num, .num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }

/* ---- Grundgerüst ---- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.nav {
  border-right: 1px solid var(--line-soft);
  padding: 20px 14px calc(14px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 18px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: baseline; gap: 8px; padding: 0 8px; }
.brand-mark { color: var(--brass); font-size: 20px; }
.brand-logo { height: 26px; width: auto; display: block; border-radius: 5px; }
@media (max-width: 900px) { .brand-logo { height: 24px; } }
.brand-name { font-weight: 700; letter-spacing: .02em; font-size: 17px; }
.brand-name span { color: var(--brass); }
.brand-ver { color: var(--muted); font-size: 11px; font-family: var(--font-num); }
.nav nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav nav a {
  display: flex; gap: 10px; align-items: center;
  padding: 9px 10px; border-radius: 8px; color: var(--muted); font-weight: 500;
}
.nav nav a:hover { color: var(--text); background: var(--paper); text-decoration: none; }
.nav nav a.on { color: var(--text); background: var(--paper-2); box-shadow: inset 2px 0 0 var(--brass); }
.nico { width: 18px; text-align: center; color: var(--brass-dim); }
.nav nav a.on .nico { color: var(--brass); }
.nav-out { color: var(--muted); font-size: 13px; padding: 8px 10px; }

.main { padding: 22px 28px 60px; max-width: 1200px; min-width: 0; }
.page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.head-meta { color: var(--muted); font-size: 12px; }

/* Signatur: Hauptbuch-Doppellinie */
.ledger-rule {
  margin: 14px 0 22px;
  border-top: 1px solid var(--brass-dim);
  border-bottom: 1px solid var(--brass-dim);
  height: 4px;
}
tr.sumrow td {
  border-top: 1px solid var(--brass-dim);
  border-bottom: 3px double var(--brass-dim);
  font-weight: 600;
}

/* ---- Karten & Raster ---- */
.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
.card {
  background: var(--paper); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 16px 18px;
}
.card h2 { margin: 0 0 12px; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.kpi { font-family: var(--font-num); font-size: 26px; font-weight: 600; letter-spacing: -.01em; }
.kpi small { font-size: 13px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.sub { color: var(--muted); font-size: 12.5px; margin-top: 4px; }

.pos { color: var(--mint); }
.neg { color: var(--red); }
.brass { color: var(--brass); }
.mut { color: var(--muted); }

/* ---- Tabellen ---- */
.tablewrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.list th {
  text-align: left; color: var(--muted); font-weight: 600; font-size: 11.5px;
  text-transform: uppercase; letter-spacing: .07em;
  padding: 8px 10px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.list td { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.list td.num, table.list th.num { text-align: right; white-space: nowrap; }
table.list tr:hover td { background: var(--paper-2); }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: .03em;
  border: 1px solid var(--line); color: var(--muted); white-space: nowrap;
}
.badge.buy { color: var(--mint); border-color: rgba(70,192,142,.4); }
.badge.sell, .badge.spend, .badge.gift_out { color: var(--red); border-color: rgba(227,103,120,.4); }
.badge.trade { color: var(--brass); border-color: rgba(224,181,88,.4); }
.badge.transfer { color: var(--steel); border-color: rgba(94,155,214,.4); }
.badge.staking_reward, .badge.lending_income, .badge.airdrop, .badge.mining,
.badge.fork, .badge.other_income { color: var(--mint); border-color: rgba(70,192,142,.35); }
.badge.review { color: var(--ink); background: var(--brass); border-color: var(--brass); }

/* Haltefrist-Leiste (Lot-Reifung bis steuerfrei) */
.frist { display: flex; align-items: center; gap: 8px; min-width: 160px; }
.frist .bar { flex: 1; height: 6px; border-radius: 4px; background: var(--line-soft); overflow: hidden; }
.frist .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brass-dim), var(--brass)); }
.frist.free .bar i { background: var(--mint); }
.frist .lbl { font-size: 11px; color: var(--muted); white-space: nowrap; font-family: var(--font-num); }
.frist.free .lbl { color: var(--mint); }

/* ---- Formulare ---- */
label.f { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 4px; }
input[type=text], input[type=password], input[type=number], input[type=datetime-local],
input[type=file], select, textarea {
  width: 100%; background: var(--ink); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px;
  font: 14px var(--font-ui);
}
input:focus, select:focus, textarea:focus { border-color: var(--brass-dim); outline: none; }
.btn {
  display: inline-block; background: var(--brass); color: #14100A;
  border: 0; border-radius: 8px; padding: 10px 16px;
  font: 600 14px var(--font-ui); cursor: pointer;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.small { padding: 6px 10px; font-size: 12.5px; }
.btn.danger { background: transparent; color: var(--red); border: 1px solid rgba(227,103,120,.5); }

.flash { border-radius: 8px; padding: 10px 14px; margin: 0 0 16px; font-size: 13.5px; border: 1px solid; }
.flash.ok { border-color: rgba(70,192,142,.5); color: var(--mint); background: rgba(70,192,142,.06); }
.flash.warn { border-color: rgba(224,181,88,.5); color: var(--brass); background: rgba(224,181,88,.06); }
.flash.err { border-color: rgba(227,103,120,.5); color: var(--red); background: rgba(227,103,120,.06); }

details.box { border: 1px solid var(--line-soft); border-radius: 8px; padding: 10px 14px; margin: 10px 0; }
details.box summary { cursor: pointer; color: var(--muted); font-size: 13px; }

.section { margin-top: 26px; }
.section > h2 { font-size: 15px; margin: 0 0 10px; font-weight: 700; }
.hint { color: var(--muted); font-size: 12.5px; }

/* ---- Login ---- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 360px; max-width: 100%; }
.login-card .brand { justify-content: center; margin-bottom: 8px; }
.login-rule { margin: 14px 0 18px; border-top: 1px solid var(--brass-dim); border-bottom: 1px solid var(--brass-dim); height: 4px; }

/* ---- Mobil: Kopfleiste + Vollbild-Menü ---- */
.nav-burger { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  /* Geschlossen: schmale Kopfleiste */
  .nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 30;
    /* v2.16: umbrechen, damit der Hinweis "Fremdes Portfolio" eine eigene
       Zeile unter Logo und Knöpfen bekommt statt als schmale Säule daneben */
    height: auto; flex-direction: row; align-items: center; flex-wrap: wrap;
    background: rgba(12,16,19,.97); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line-soft); border-right: 0;
    padding: 8px 12px;
    padding-top: calc(8px + env(safe-area-inset-top));
  }
  .brand { display: flex; margin: 0; flex: 1; align-items: center; }
  .nav-burger {
    display: inline-flex; align-items: center; justify-content: center;
    width: 46px; height: 46px; font-size: 24px; line-height: 1;
    background: var(--paper); color: var(--text);
    border: 1px solid var(--line-soft); border-radius: 10px; cursor: pointer;
    margin-left: auto;
  }
  /* v1.59: Der Portfolio-Umschalter gehoert mobil NUR ins offene Menue —
     in der schmalen Kopfleiste war er abgeschnitten ("Ti…"). */
  .nav nav, .nav-install, .ios-hint, .nav-out, .nav .tenant-switch { display: none; }

  /* Offen: Vollbild-Overlay ÜBER dem Seiteninhalt, X bleibt oben */
  .nav.open {
    bottom: 0; height: 100dvh;
    flex-direction: column; align-items: stretch; flex-wrap: nowrap;
    overflow-y: auto; overscroll-behavior: contain;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
  .nav.open .brand { flex: 0 0 auto; width: 100%; }
  .nav.open nav {
    display: flex; flex-direction: column; gap: 4px;
    width: 100%; flex: 0 0 auto; padding: 16px 0 8px;
  }
  .nav.open nav a {
    flex-direction: row; gap: 14px; font-size: 17px;
    padding: 14px 12px; min-height: 52px; border-radius: 10px;
    width: 100%;
  }
  .nav.open nav a.on { box-shadow: inset 3px 0 0 var(--brass); background: var(--paper-2); }
  .nav.open .tenant-switch { display: block !important; width: 100%; flex: 0 0 auto;
    margin: 10px 0 0; padding: 0 4px; }
  .nav.open .nav-install:not([hidden]) {
    display: block; width: 100%; flex: 0 0 auto; margin-top: 10px;
    padding: 14px 12px; min-height: 52px; font-size: 16px;
  }
  .nav.open .ios-hint:not([hidden]) { display: block; width: 100%; flex: 0 0 auto; margin-top: 10px; }
  .nav.open .nav-out {
    display: block; width: 100%; flex: 0 0 auto; text-align: center;
    padding: 14px 12px; min-height: 52px; margin-top: 10px; font-size: 16px;
    border-top: 1px solid var(--line-soft);
  }

  .main { padding: calc(76px + env(safe-area-inset-top)) 14px 40px; }
  .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr 1fr; }
  .kpi { font-size: 21px; }
}
@media (max-width: 520px) {
  .grid.c3, .grid.c4 { grid-template-columns: 1fr 1fr; }
  .page-head h1 { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
@media print {
  .nav, .head-meta, .btn, form.noprint { display: none !important; }
  body { background: #fff; color: #000; }
  .card { border-color: #999; background: #fff; }
  table.list th, table.list td { border-color: #bbb; color: #000; }
  a { color: #000; }
}

/* --- PWA-Installation (v0.2) --- */
.nav-install {
  display: block; width: calc(100% - 24px); margin: 10px 12px;
  padding: 9px 12px; border: 1px solid var(--brass, #E0B558);
  background: transparent; color: var(--brass, #E0B558);
  font: 600 13px 'Archivo', sans-serif; letter-spacing: .02em;
  border-radius: 8px; cursor: pointer; transition: background .15s, color .15s;
}
.nav-install:hover { background: var(--brass, #E0B558); color: #0C1013; }
.ios-hint {
  margin: 10px 12px; padding: 9px 30px 9px 12px; position: relative;
  border: 1px dashed var(--brass, #E0B558); border-radius: 8px;
  color: #cdd6dd; font-size: 12px; line-height: 1.5;
}
.ios-hint b { color: var(--brass, #E0B558); }
.ios-hint button {
  position: absolute; top: 4px; right: 6px; border: 0; background: none;
  color: #cdd6dd; font-size: 15px; cursor: pointer; padding: 2px 4px;
}
.btn.sm { padding: 4px 10px; font-size: 12px; }
@media (max-width: 899px) {
  .nav-install, .ios-hint { margin: 8px auto; width: min(420px, calc(100% - 24px)); }
}

/* --- Markt & Signale (v0.3) --- */
.siglist { list-style: none; margin: 10px 0 0; padding: 0; }
.sig { padding: 7px 10px 7px 28px; position: relative; font-size: 13px;
  line-height: 1.5; border-top: 1px dashed rgba(224,181,88,.25); }
.sig::before { position: absolute; left: 8px; top: 7px; font-weight: 700; }
.sig.good { color: #9fd8bf; } .sig.good::before { content: '▲'; color: #46C08E; }
.sig.warn { color: #eab3ba; } .sig.warn::before { content: '▼'; color: #E36778; }
.sig.info { color: #b8c4cd; } .sig.info::before { content: '●'; color: #5E9BD6; }
.badge.b-pos { border-color: #46C08E; color: #46C08E; }
.badge.b-neg { border-color: #E36778; color: #E36778; }
.badge.b-mid { border-color: #5E9BD6; color: #5E9BD6; }
.spark { flex: 0 0 auto; }
table.list.mini td { padding: 4px 8px; font-size: 12.5px; }
.flash.warn { border-color: #E0B558; color: #e8d5a8; }


/* --- v0.13: Feinschliff --- */
.anon-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; font-size: 17px; margin-left: auto; margin-right: 8px;
  background: var(--paper); color: var(--mut);
  border: 1px solid var(--line-soft); border-radius: 10px; cursor: pointer;
}
.anon-toggle.on { color: var(--brass); border-color: var(--brass); }
body.anon .mono, body.anon .kpi, body.anon td.num, body.anon .spark, body.anon .frist .lbl,
body.anon .sens {
  filter: blur(7px); user-select: none;
}
.card { min-width: 0; }
.flash { overflow-wrap: anywhere; }
.mono { overflow-wrap: anywhere; }
table.list select { min-width: 110px; }

@media (max-width: 900px) {
  .anon-toggle { margin-left: auto; }
  .nav-burger { margin-left: 0; }
  /* Install-Button/iOS-Hinweis NIE in der Kopfleiste — nur im offenen Menü */
  .nav .nav-install, .nav .ios-hint { display: none; }
  .nav.open .nav-install:not([hidden]):not([data-installed]) { display: block; }
  .nav.open .ios-hint:not([hidden]) { display: block; }
}
@media (max-width: 640px) {
  .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; }
}


/* v0.15 */
table.list td, table.list th { overflow-wrap: normal; word-break: normal; }
table.list td .hint { white-space: normal; }
/* v1.69: .pfchart-tip war totes Markup (wird vom JS beim Start entfernt) —
   Regeln entfernt; die echte Infobox ist .pfchart-box (siehe unten). */
.pfchart-line { transition: opacity .35s ease; opacity: 1; }
.pfchart-line.fade-out { opacity: 0; }
.pos-detail[open] summary .hint { transform: rotate(180deg); display: inline-block; }


/* v0.22: Chart-Scrubber */
.pfchart svg { touch-action: pan-y; }
.pfchart-line {
  position: absolute; top: 0; width: 0;
  border-left: 1px dashed var(--brass); pointer-events: none; z-index: 4;
}
.pfchart-box {
  position: absolute; color: var(--text);
  border: 1px solid rgba(224, 181, 88, .5); border-radius: 10px; padding: 7px 10px;
  font-size: 12px; line-height: 1.6; pointer-events: none; z-index: 5;
  white-space: nowrap;
  /* v1.69: DIES ist die Infobox der Charts (das JS erzeugt .pfchart-box) —
     v1.67/68 hatten faelschlich .pfchart-tip gestylt, ein Ueberbleibsel,
     das beim Start entfernt wird. Deshalb kam die Transparenz nie an.
     Rund 40 % Deckkraft; Lesbarkeit ueber Weichzeichner + Textschatten.
     rgba-Zeile = Rueckfall fuer Browser ohne color-mix. */
  /* v1.70: noch durchlaessiger (~22 %) und der Weichzeichner von 6 auf 1,5 px —
     der starke Blur hat den Kurs unter der Box verschwommen wirken lassen.
     Lesbarkeit kommt jetzt fast nur aus dem kraeftigeren Textschatten. */
  background: rgba(16, 21, 26, .22);
  background: color-mix(in srgb, var(--paper-2) 22%, transparent);
  -webkit-backdrop-filter: blur(1.5px);
  backdrop-filter: blur(1.5px);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .95), 0 0 6px rgba(0, 0, 0, .7);
  box-shadow: none;
  transition: opacity .35s ease;
  opacity: 1;
}
.pfchart-box.fade-out { opacity: 0; }

/* v0.24: Mobil ohne Querscrollen */
.m-only { display: none !important; }
@media (max-width: 680px) {
  .m-hide { display: none !important; }
  td.m-only, th.m-only { display: table-cell !important; }
  span.m-only { display: inline !important; }
  div.m-only { display: block !important; }
  table.list .btn.small { padding: 5px 7px; font-size: 13px; }
  table.list { font-size: 12.5px; }
  table.list th, table.list td { padding: 7px 4px; }
  table.list td:first-child, table.list th:first-child { padding-left: 2px; padding-right: 2px; }
  table.list .badge { font-size: 10px; padding: 2px 6px; }
  table.list .mono { letter-spacing: -0.2px; }
  td.m-only { font-size: 12px; max-width: 130px; overflow-wrap: anywhere; }
  .login-card input { font-size: 16px; } /* verhindert iOS-Zoom */
}
/* Autofill-Optik (weißes Feld) neutralisieren */
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--paper-2) inset !important;
  -webkit-text-fill-color: var(--text) !important;
  caret-color: var(--text);
  transition: background-color 9999s ease-in-out 0s;
}
.login-card input { width: 100%; box-sizing: border-box; }
/* Lots: Gruppierung */
tr.grp-head td { cursor: pointer; background: rgba(212,175,55,0.04); }
tr.grp-head td b { color: var(--brass); }
tr.grp-year td { background: rgba(255,255,255,0.02); cursor: pointer; }
/* FEHLER bis v0.81: hier stand tr.grp-lot, die Zeilen heissen aber tr.lot-row.
   Dadurch griff das Einklappen nie und die gesamte Lot-Liste war offen. */
tr.lot-row { display: none; }
tr.lot-row.open { display: table-row; }
tr.grp-year { display: none; }
tr.grp-year.open { display: table-row; }
.caret { display: inline-block; transition: transform .15s; margin-right: 6px; color: var(--mut); }
.open-h .caret { transform: rotate(90deg); }

/* v0.41: Herkunfts-Matrix & Ursachen-Tabellen mobil ohne Querscrollen */
table.list.matrix { table-layout: fixed; width: 100%; }
table.list.matrix td.src, table.list.matrix th.src {
  overflow-wrap: anywhere; word-break: break-word; white-space: normal;
}
@media (max-width: 680px) {
  table.list.matrix td, table.list.matrix th { padding: 6px 3px; font-size: 12px; }
  table.list.matrix td:first-child, table.list.matrix th:first-child { width: 22%; }
  table.list.matrix td.src, table.list.matrix th.src { width: 42%; font-size: 11px; line-height: 1.35; }
  table.list.matrix td.num, table.list.matrix th.num { width: 36%; white-space: nowrap; }
  #ursachen table.list td { overflow-wrap: anywhere; }
  #ursachen summary { line-height: 1.6; }
}

/* v0.41: NFT-Galerie */
.nft-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.nft-card { padding: 0; overflow: hidden; }
.nft-img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; background: var(--paper-2); }
.nft-noimg { display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 12px; text-align: center; padding: 10px; }
.nft-body { padding: 10px 12px 12px; }
@media (max-width: 680px) {
  .nft-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

/* v0.46: Tabellen, die auf dem Handy zu Karten umbrechen (Wallets, Importe, Benutzer) */
@media (max-width: 680px) {
  table.list.stack { display: block; }
  table.list.stack tbody { display: block; }
  table.list.stack tr { display: block; border: 1px solid var(--line-soft); border-radius: 10px;
    margin-bottom: 10px; padding: 8px 10px; }
  table.list.stack tr:first-child { display: none; } /* Kopfzeile */
  table.list.stack td { display: block; width: 100%; border: none; padding: 3px 0;
    text-align: left !important; white-space: normal; overflow-wrap: anywhere; }
  table.list.stack td:empty { display: none; }
  table.list.stack td[data-l]::before { content: attr(data-l) ": "; color: var(--muted);
    font-size: 11px; letter-spacing: .04em; }
  table.list.stack td input[type="text"], table.list.stack td select { width: 100%; }
}
.userbtns { white-space: nowrap; }
@media (max-width: 680px) {
  .userbtns { white-space: normal; }
  .userbtns form { display: inline-block !important; margin: 3px 4px 0 0; }
}

/* v0.50: Chart-Vollbild (Markt & Signale) */
.chartzone { position: relative; }
/* Knopf ÜBER dem Diagramm statt darauf — er verdeckte sonst die Kurve */
.chartzone .fs-btn { display: block; margin: 0 0 6px auto; opacity: .8; }
.chartzone .fs-btn:hover { opacity: 1; }
body.chart-fs-open { overflow: hidden; }
#chartFs { position: fixed; inset: 0; z-index: 999; background: var(--paper-2, #0c1013);
  display: flex; flex-direction: column; padding: 10px 12px 14px; }
#chartFs .fs-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
#chartFs .fs-title { font-weight: 600; font-size: 15px; }
#chartFs .fs-body { flex: 1; display: flex; flex-direction: column; justify-content: center; overflow: auto; }
#chartFs svg { width: 100%; height: auto; }
#chartFs .fs-hint { color: var(--muted); font-size: 12px; margin-top: 6px; }
@media (orientation: landscape) and (max-height: 500px) {
  #chartFs { padding: 6px 8px; }
  #chartFs .fs-head { margin-bottom: 2px; }
  #chartFs .fs-hint { display: none; }
}

/* v0.52: Wallet-Sync — aufklappbare Karten mit Status-Badge */
#w1 summary::-webkit-details-marker, .card details > summary::-webkit-details-marker { display: none; }
.card details > summary { list-style: none; }
.card details > summary::before { content: '▸'; color: var(--muted); margin-right: 6px; }
.card details[open] > summary::before { content: '▾'; }
.badge.pos { background: rgba(70,192,142,.14); color: #46C08E; }
.badge.neg { background: rgba(227,103,120,.14); color: #E36778; }
.badge.brass { background: rgba(224,181,88,.14); color: #E0B558; }
.badge.mut { background: rgba(138,147,166,.14); color: var(--muted); }

/* v0.58: Dashboard-Tabellen passen aufs Handy (kein Querscrollen mehr) */
@media (max-width: 680px) {
  table.list.fit { table-layout: fixed; width: 100%; }
  table.list.fit td, table.list.fit th { padding: 7px 4px; font-size: 12.5px; overflow-wrap: anywhere; }
  table.list.fit td:first-child, table.list.fit th:first-child { width: 34%; }
  table.list.fit td.num, table.list.fit th.num { width: 33%; white-space: nowrap; }
  .m-only { display: inline !important; }
  br.m-only { display: block !important; }
  .statusline { line-height: 1.8; }
}
.m-only { display: none; }

/* v0.58: Fortschritts-Overlay für lange Aktionen */
#busyOverlay { position: fixed; inset: 0; z-index: 1000; display: flex;
  align-items: center; justify-content: center; background: rgba(8,11,14,.72); backdrop-filter: blur(3px); }
.busy-box { background: var(--paper); border: 1px solid var(--line-soft); border-radius: 14px;
  padding: 22px 26px; max-width: 340px; text-align: center; }
.busy-spin { width: 34px; height: 34px; margin: 0 auto 12px; border-radius: 50%;
  border: 3px solid var(--line-soft); border-top-color: var(--brass); animation: busyspin .9s linear infinite; }
@keyframes busyspin { to { transform: rotate(360deg); } }
.busy-title { font-weight: 600; margin-bottom: 6px; }
.busy-sub { color: var(--muted); font-size: 12.5px; line-height: 1.6; }

/* v0.78: Chart-Zoom */
.pfchart, .chartzone { overflow: hidden; touch-action: pan-y; }
.pfchart svg, .chartzone svg { transition: transform .05s linear; will-change: transform; }
.zoom-badge { position: absolute; left: 4px; bottom: 4px; z-index: 3; opacity: .85; }

/* v0.80: Staking-Aktionen kompakt (Handy) */
td.posact { width: 34px; }
td.posact summary { list-style: none; text-align: center; }
td.posact summary::-webkit-details-marker { display: none; }
td.posact details[open] { position: relative; z-index: 2; }

/* v0.81: Aktionsmenü als Überlagerung, damit es die Tabelle nicht aufreißt */
td.posact { width: 30px; position: relative; }
td.posact > details > div {
  position: absolute; right: 0; top: 100%; z-index: 20; min-width: 150px;
  background: var(--paper); border: 1px solid var(--line-soft); border-radius: 10px;
  padding: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.45);
}
td.posact > details > div a, td.posact > details > div button { white-space: nowrap; }

/* v0.82: ⓘ-Einblendung für Erklärungen */
.infobox { display: inline-block; position: relative; vertical-align: middle; }
.infobox > summary {
  list-style: none; cursor: pointer; width: 17px; height: 17px; line-height: 16px;
  text-align: center; border-radius: 50%; border: 1px solid var(--line-soft);
  color: var(--muted); font-size: 11px; font-style: italic; font-weight: 600; user-select: none;
}
.infobox > summary::-webkit-details-marker { display: none; }
.infobox[open] > summary { border-color: var(--brass); color: var(--brass); }
.infobox-body {
  position: absolute; z-index: 30; left: 0; top: 22px; width: min(300px, 78vw);
  background: var(--paper); border: 1px solid var(--line-soft); border-radius: 10px;
  padding: 10px 12px; box-shadow: 0 8px 24px rgba(0,0,0,.5);
  font-size: 12px; line-height: 1.6; color: var(--muted); font-weight: 400;
}
@media (max-width: 680px) { .infobox-body { left: auto; right: 0; } }

/* v0.83: Zeitraum-Umschalter im Vollbild */
.fs-ranges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.fs-ranges a { display: inline-block; padding: 4px 10px; border: 1px solid var(--line-soft);
  border-radius: 999px; font-size: 12.5px; text-decoration: none; }
.fs-ranges a.on { border-color: var(--brass); color: var(--brass); }
.fs-ranges.loading { opacity: .5; pointer-events: none; }

/* v0.88: NFT-Vollbild */
.nft-fs { position: fixed; inset: 0; z-index: 90; background: rgba(8,10,14,.96);
  display: flex; flex-direction: column; padding: 10px; }
.nft-fs-head { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 4px 2px 10px; }
.nft-fs-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nft-fs-body { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; }
.nft-fs-body img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }

/* v0.92: arbeitender Knopf */
.btn.busy { opacity: .65; cursor: progress; animation: busypulse 1.1s ease-in-out infinite; }
@keyframes busypulse { 50% { opacity: .4; } }


/* v1.01: Zyklen-Kennzahlen brechen mobil um.
   WICHTIG: Diese Regeln stehen bewusst am DATEIENDE. Die .fit-Regel weiter oben
   ("table.list.fit td.num { white-space: nowrap }") hat dieselbe Spezifitaet;
   bei Gleichstand gewinnt die spaetere. Vorher standen die cyc-Regeln davor und
   wurden wirkungslos ueberstimmt — die Werte ("… ATH 106.307,00 € (06.10.2025)",
   "860 Tage seit dem 4. Halving …") liefen deshalb rechts aus dem Bild und
   zogen die ganze Seite mit in die Breite, inklusive der Kopfzeile. */
@media (max-width: 680px) {
  table.list.fit.cyc td.num, table.list.fit.cyc th.num {
    white-space: normal; overflow-wrap: anywhere; width: 60%; text-align: right;
  }
  table.list.fit.cyc td:first-child, table.list.fit.cyc th:first-child { width: 40%; }
  /* Nichts darf breiter sein als der Bildschirm — Sicherheitsnetz gegen
     Querscrollen, falls irgendwo doch ein zu breites Element auftaucht. */
  html, body { overflow-x: hidden; }
}


/* --- v1.33: Schmale Bildschirme --- */
/* Zweispaltige Eckdaten-Tabellen (.list.fit) haben rechts oft zusammengesetzte
   Werte wie "26.05.2021 · 6,7 · buy". Mit nowrap schieben die sich auf dem
   Handy aus der Karte heraus — hier darf umbrochen werden. */
@media (max-width: 620px) {
  table.list.fit td.num, table.list.fit th.num { white-space: normal; overflow-wrap: anywhere; }
  table.list.fit td { padding: 7px 6px; }
  table.list.fit td:first-child { width: 46%; }
}
/* Knopfgruppen, die auf dem Desktop rechts stehen: auf dem Handy in eine
   eigene Zeile umbrechen statt ueber den Rand zu laufen. */
.aktionen { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 620px) {
  .aktionen { justify-content: flex-start; margin-top: 6px; }
  .aktionen .btn { flex: 1 1 auto; text-align: center; }
}

/* --- Mandanten-Umschalter (Etappe 2) ------------------------------------ */
.tenant-switch { margin: 6px 10px 4px; }
/* v1.60: kleine Beschriftung ueber dem Portfolio-Umschalter */
.tenant-switch-label {
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--mut, #8b98a5); margin: 0 2px 4px;
}
.tenant-switch select {
  width: 100%; font-size: 13px; padding: 6px 8px;
  background: rgba(255,255,255,.05); color: var(--fg, #e8eef2);
  border: 1px solid rgba(255,255,255,.12); border-radius: 8px;
}
/* v2.16: Der Hinweis sass als Flex-Element neben der Kopfzeile und wurde
   dort zu einer schmalen Saeule, die Logo und Knoepfe ueberlappte. Jetzt
   nimmt er immer die volle Breite unter der Kopfzeile ein. */
.tenant-hint {
  flex: 0 0 100%; width: 100%; box-sizing: border-box; order: 99;
  margin: 6px 0 8px; padding: 7px 12px; font-size: 12.5px; line-height: 1.4;
  border-radius: 8px; background: rgba(230,180,60,.12);
  border: 1px solid rgba(230,180,60,.35); color: #e8c86a;
  white-space: normal; text-align: left;
}

/* v1.56: Mobil-Sicherheitsnetz — kompakte Datentabellen (.fit) laufen auf
   schmalen Bildschirmen nie mehr seitlich aus dem Layout: Was nach dem
   Ausblenden der m-hide-Spalten noch zu breit ist, wird wischbar. */
@media (max-width: 680px) {
  table.fit { display: block; overflow-x: auto; max-width: 100%;
              -webkit-overflow-scrolling: touch; }
  table.fit th { white-space: nowrap; }
}

/* v1.61: Signal-Punkt in der Bestandsliste + Pop-up */
.sigdot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; margin-left: 6px; vertical-align: middle;
  border-radius: 50%; border: 0; cursor: pointer;
  font-size: 13px; font-weight: 800; line-height: 1; color: #10151a;
}
.sigdot.sig-good { background: var(--good, #4caf7d); }
.sigdot.sig-warn { background: var(--bad, #e05b5b); }
#sigModal::backdrop { background: rgba(0,0,0,.55); backdrop-filter: blur(2px); }

/* v1.62: Bestaende & Entwicklung auf dem Handy — Werte und ± nicht mehr
   umbrechen oder abschneiden: Zahlen bleiben einzeilig, die Tabelle nutzt
   die volle Breite mit schlankeren Abstaenden und etwas kleinerer Schrift;
   die Asset-Spalte bleibt schmal. */
@media (max-width: 680px) {
  .pos-row td.num { white-space: nowrap; font-size: 12.5px; }
  .pos-row td.num span { white-space: nowrap; }
  .pos-row td, .pos-breakdown td { padding-left: 6px; padding-right: 6px; }
  .pos-row td:first-child { max-width: 92px; padding-right: 2px; }
  .sigdot { width: 18px; height: 18px; font-size: 12px; margin-left: 3px; }
}
.sigdot + .sigdot { margin-left: 3px; }

/* v1.75: Nur-Lese-Rollen (advisor_read, admin_read) — schreibende Knoepfe
   sind ausgegraut statt erst beim Klick eine Fehlermeldung zu zeigen. */
button.ro-gesperrt, input[type="submit"].ro-gesperrt {
  opacity: .4; cursor: not-allowed; pointer-events: none;
}

/* ---- v1.82: Koinly-Vergleich, mobil lesbar --------------------------------
   Die vierspaltigen Tabellen brachen auf dem Handy buchstabenweise um
   (Ueberschriften untereinander als einzelne Zeichen). Ab hier: Bloecke und
   Karten auf schmalen Schirmen, ab 700px wieder normale Tabellen.          */
.vgl-block { margin: 0 0 14px; }
.vgl-block h3 { font-size: 13px; margin: 0 0 6px; color: var(--mut, #8b98a5);
  text-transform: uppercase; letter-spacing: .06em; }
.vgl-zeile { padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.vgl-zeile:last-child { border-bottom: 0; }
.vgl-name { display: block; font-size: 13px; margin-bottom: 3px; }
.vgl-summe .vgl-name { font-weight: 700; }
.vgl-werte { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; }
.vgl-werte em { font-style: normal; color: var(--mut, #8b98a5); margin-right: 3px; }
.vgl-werte .mono { white-space: nowrap; }

.vgl-coins { display: flex; flex-direction: column; gap: 8px; }
.vgl-coin { display: block; padding: 9px 11px; border: 1px solid var(--line-soft);
  border-radius: 10px; text-decoration: none; color: inherit; }
.vgl-coin-kopf { display: flex; justify-content: space-between; align-items: baseline;
  gap: 10px; margin-bottom: 4px; }
.vgl-coin-kopf b { font-size: 14px; }
.vgl-coin-zeile { display: block; font-size: 12.5px; color: var(--text); margin-top: 2px; }
.vgl-coin-zeile em { font-style: normal; color: var(--mut, #8b98a5); margin-right: 4px; }
.vgl-tag { display: inline-block; font-size: 11px; border: 1px solid var(--line-soft);
  border-radius: 6px; padding: 1px 6px; margin: 3px 5px 0 0; color: var(--mut, #8b98a5); }

@media (max-width: 700px) {
  /* Detailtabellen als Karten: Kopfzeile weg, jede Zelle mit ihrer
     Beschriftung aus data-l davor. */
  table.vgl-detail thead, table.vgl-detail tr:first-child { display: none; }
  table.vgl-detail, table.vgl-detail tbody { display: block; width: 100%; }
  table.vgl-detail tr { display: block; border: 1px solid var(--line-soft);
    border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; }
  table.vgl-detail td { display: flex; justify-content: space-between; gap: 12px;
    padding: 3px 0 !important; border: 0 !important; text-align: right !important;
    white-space: normal; font-size: 12.5px; max-width: none !important; }
  table.vgl-detail td::before { content: attr(data-l); color: var(--mut, #8b98a5);
    text-align: left; flex: 0 0 auto; font-size: 11.5px; }
  table.vgl-detail td:empty { display: none; }
}
@media (min-width: 701px) {
  .vgl-zeile { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
  .vgl-name { margin: 0; flex: 1 1 auto; }
  .vgl-werte { flex: 0 0 auto; gap: 4px 22px; }
  .vgl-coins { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

/* v1.89: Unter-Navigation (Reiter) fuer zusammengehoerige Seiten */
.subnav { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 14px; }
/* v2.07: deutlicher — die Reiter wurden vorher schlicht uebersehen */
.subnav { padding: 6px; background: var(--card-2, rgba(255,255,255,.03));
  border: 1px solid var(--line-soft); border-radius: 12px; margin: 2px 0 16px; }
.subnav a { display: inline-block; padding: 9px 16px; border: 1px solid transparent;
  border-radius: 999px; font-size: 14px; font-weight: 600; text-decoration: none;
  color: var(--mut, #8b98a5); }
.subnav a:hover { color: var(--text); border-color: var(--line-soft); }
.subnav a.on { background: var(--gold, #E0B558); color: #10151a;
  border-color: var(--gold, #E0B558); box-shadow: 0 1px 6px rgba(224,181,88,.25); }

/* v2.17: Eingesetztes Geld je Jahr — mobil zuerst. Die generische
   Karten-Darstellung brach die Betraege zeichenweise um; hier stehen
   Beschriftung und Betrag nebeneinander und Betraege nie umgebrochen. */
.inv-jahr { border-bottom: 1px solid var(--line-soft); padding: 9px 0; }
.inv-jahr:last-of-type { border-bottom: 0; }
.inv-jahr > summary { list-style: none; cursor: pointer; display: block; }
.inv-jahr > summary::-webkit-details-marker { display: none; }
.inv-jahr > summary::before { content: '▸'; color: var(--muted); margin-right: 6px; font-size: 12px; }
.inv-jahr[open] > summary::before { content: '▾'; }
.inv-jahr-nr { font-weight: 700; font-size: 15px; font-family: var(--font-num); }
.inv-werte { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 5px; padding-left: 16px; }
.inv-w { display: flex; align-items: baseline; gap: 6px; }
.inv-w em { font-style: normal; color: var(--muted); font-size: 11.5px; }
.inv-w b { font-family: var(--font-num); font-size: 13.5px; white-space: nowrap; }
.inv-w b.mut { color: var(--muted); font-weight: 400; }
.inv-summe { border-top: 1px solid var(--line-soft); margin-top: 4px; padding-top: 10px; }
.inv-summe .inv-jahr-nr { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
.inv-coins { margin: 8px 0 2px; padding-left: 16px; display: flex; flex-direction: column; gap: 4px; }
.inv-coin { font-size: 13px; border-bottom: 1px dotted var(--line-soft); padding-bottom: 5px; }
.inv-coin-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
/* v2.18: Menge, Durchschnittskurs und heutiger Wert unter dem Coin */
.inv-coin-detail { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 2px; font-size: 12px;
  color: var(--muted); font-family: var(--font-num); }
.inv-coin-detail em { font-style: normal; margin-right: 5px; font-family: var(--font-sans, inherit); }
.inv-coin-detail b { font-weight: 600; }
.inv-coin:last-child { border-bottom: 0; }
.inv-coin-sym { font-weight: 600; }
.inv-coin-werte { display: flex; gap: 10px; font-family: var(--font-num); white-space: nowrap; }
@media (min-width: 700px) {
  .inv-jahr > summary { display: flex; align-items: baseline; gap: 16px; }
  .inv-werte { margin-top: 0; padding-left: 0; flex: 1; justify-content: flex-end; gap: 4px 26px; }
  .inv-summe { display: flex; align-items: baseline; gap: 16px; }
}

/* v2.19: Die Gesamt-Prozentangabe klebte absolut oben rechts und lief auf
   schmalen Schirmen in den Betrag hinein — besonders im fremden Portfolio,
   wo die Hinweiszeile alles nach unten schiebt. Mobil steht sie jetzt im
   Textfluss, ab 700px wieder oben rechts. */
.kpi-pct { text-align: right; margin: 0 0 4px; }
.kpi-pct .mono { font-size: 17px; font-weight: 600; }
@media (min-width: 700px) {
  .kpi-pct { position: absolute; top: 12px; right: 14px; margin: 0; }
}

/* v2.19: Hinweis im aufgeklappten Menue nicht aufblaehen */
.nav .tenant-hint { flex: 0 0 auto; align-self: stretch; }

/* v2.20: Bankkonten — mobil zuerst */
.bk-liste { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.bk-konto { display: block; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: 12px;
  text-decoration: none; color: inherit; background: var(--paper, transparent); }
.bk-konto:hover { border-color: var(--brass, #E0B558); }
.bk-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.bk-kopf b { font-size: 15px; }
.bk-saldo { font-size: 17px; font-weight: 700; white-space: nowrap; }
.bk-saldo.mut { color: var(--muted); font-weight: 400; }
.bk-fuss { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px;
  margin-top: 4px; font-size: 12px; color: var(--muted); }
.bk-summe { display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 12px 14px; border-top: 2px solid var(--line-soft); margin-top: 4px; font-weight: 600; }
.bk-summe b { font-size: 19px; white-space: nowrap; }
.bk-form, .bk-filter { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; align-items: end; }
.bk-form input, .bk-form select, .bk-filter input, .bk-filter select { width: 100%; box-sizing: border-box; }
.bk-knoepfe { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.bk-summen { display: flex; flex-wrap: wrap; gap: 6px 22px; padding-bottom: 10px; border-bottom: 1px solid var(--line-soft); }
.bk-summen span { display: flex; flex-direction: column; }
.bk-summen em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.bk-summen b { font-size: 15px; white-space: nowrap; }
.bk-umsatz { padding: 9px 0; border-bottom: 1px dotted var(--line-soft); }
.bk-umsatz:last-child { border-bottom: 0; }
.bk-u-kopf { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: baseline; }
.bk-u-tag { font-size: 12px; color: var(--muted); white-space: nowrap; }
.bk-u-name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-u-betrag { font-weight: 700; white-space: nowrap; font-size: 14px; }
.bk-u-detail { font-size: 12.5px; margin-top: 3px; line-height: 1.4; word-break: break-word; }
@media (max-width: 520px) {
  .bk-u-kopf { grid-template-columns: 1fr auto; }
  .bk-u-tag { grid-column: 1 / -1; }
}
@media print {
  .noprint, .nav, .tenant-hint { display: none !important; }
  .bk-umsatz { break-inside: avoid; }
  body { background: #fff; color: #000; }
  .pos { color: #0a6b2e !important; } .neg { color: #b3261e !important; }
}

/* v2.22: Protokoll des Bankabrufs */
.fints-log { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.fints-zeile { padding: 5px 8px; border-radius: 6px; background: rgba(255,255,255,.03); line-height: 1.4; }
.fints-zeile.ok { border-left: 3px solid var(--pos, #3fb950); }
.fints-zeile.warn { border-left: 3px solid #d29922; }
.fints-zeile.fehler { border-left: 3px solid var(--neg, #e06c75); }

/* v2.25: Kontoansicht — Zeitraum-Schnellwahl und Seiten */
.bk-zeitraum { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
.bk-chip { padding: 4px 10px; border: 1px solid var(--line-soft, #333); border-radius: 999px; font-size: 13px;
           text-decoration: none; color: inherit; }
.bk-chip.aktiv { background: var(--accent, #3b82f6); border-color: var(--accent, #3b82f6); color: #fff; }
.bk-suche { grid-column: 1 / -1; }
.bk-seiten { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between;
             margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line-soft, #333); }
.bk-blaettern { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.bk-seiten a { text-decoration: none; }

/* v2.27: Zuordnung und Notiz bei Konten */
.bk-gruppe { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 2px 4px;
             font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--mut, #9aa0a6); }
.bk-gruppe:first-child { margin-top: 0; }
.bk-gruppe b { font-size: 14px; text-transform: none; letter-spacing: 0; }
.bk-notiz { display: block; margin-top: 6px; font-size: 13px; color: var(--mut, #9aa0a6); font-style: italic;
            overflow-wrap: anywhere; }
.bk-notiz-voll { margin-top: 10px; padding: 8px 10px; border-left: 3px solid var(--brass, #E0B558);
                 background: rgba(255,255,255,.03); border-radius: 6px; font-size: 14px; line-height: 1.45;
                 overflow-wrap: anywhere; }

/* v2.31: Reihenfolge der Konten und Gruppen */
.bk-sortleiste { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 10px; }
.bk-sorthinweis { flex: 1 1 260px; }
.bk-gblock { display: flex; flex-direction: column; gap: inherit; }
.bk-liste .bk-gblock + .bk-gblock { margin-top: 4px; }
.bk-pfeile, .bk-griff { display: none; }
.bk-liste.sortieren .bk-pfeile { display: inline-flex; gap: 4px; }
.bk-liste.sortieren .bk-griff { display: inline; margin-right: 6px; color: var(--mut, #9aa0a6); cursor: grab; }
.bk-pfeile button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line-soft, #333);
                    background: transparent; color: inherit; font-size: 15px; line-height: 1; cursor: pointer; }
.bk-pfeile button:hover { border-color: var(--brass, #E0B558); }
.bk-gruppe-rechts { display: inline-flex; gap: 10px; align-items: center; }
.bk-liste.sortieren .bk-konto { cursor: grab; border-style: dashed; position: relative; padding-right: 88px; }
.bk-liste.sortieren .bk-kpfeile { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
.bk-liste.sortieren .bk-gruppe { cursor: grab; padding: 6px 4px; border-radius: 8px; background: rgba(255,255,255,.03); }
.bk-liste.sortieren .bk-summe { opacity: .4; }
.bk-zieht { opacity: .35; }
.bk-bewegt { animation: bkBewegt .6s ease; }
@keyframes bkBewegt { from { box-shadow: 0 0 0 2px var(--brass, #E0B558); } to { box-shadow: 0 0 0 0 transparent; } }

/* v2.32: hidden-Attribut gilt immer (sonst setzen z. B. .btn { display } es außer Kraft) */
[hidden] { display: none !important; }
.btn-klein { padding: 5px 11px; font-size: 13px; border-radius: 7px; }
.bk-link { background: none; border: 0; padding: 4px 2px; color: var(--mut, #9aa0a6); font-size: 13px;
           cursor: pointer; text-decoration: none; }
.bk-link:hover { color: var(--brass, #E0B558); }
.bk-sortleiste { justify-content: flex-end; margin: 0 0 6px; }
.bk-sorthinweis { flex: 1 1 220px; font-size: 12px; }
.bk-abrufleiste { margin-bottom: 14px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
                  justify-content: space-between; padding: 10px 14px; font-size: 14px; }
.bk-abrufknoepfe { display: inline-flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.bk-klapp { margin-bottom: 10px; padding: 10px 14px; }
.bk-klapp > summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.bk-klapp > summary .hint { font-weight: 400; }
.bk-klapp[open] > summary { margin-bottom: 10px; }

/* v2.34: Favoriten (Stern) und Bankkonten auf der Startseite */
.bk-stern { background: none; border: 0; padding: 0 6px 0 0; margin: 0; font-size: 17px; line-height: 1;
            color: var(--mut, #9aa0a6); cursor: pointer; vertical-align: -1px; }
.bk-stern.an { color: var(--brass, #E0B558); }
.bk-stern:hover { color: var(--brass, #E0B558); }
.bk-liste.sortieren .bk-stern { pointer-events: none; opacity: .5; }
.bk-start { margin-bottom: 14px; padding: 10px 14px; }
.bk-start-kopf { margin-bottom: 4px; font-size: 14px; }
.bk-start-kopf a { text-decoration: none; }
.bk-start-konto { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; text-decoration: none;
                  color: inherit; border-top: 1px solid var(--line-soft, #333); font-size: 14px; }
.bk-start-konto:first-of-type { border-top: 0; }
.bk-start-konto:hover span { color: var(--brass, #E0B558); }
.bk-start-konto span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.bk-start-konto b { white-space: nowrap; }

/* v2.36: Saldenabgleich am Konto */
.bk-abgleich { display: block; margin-top: 5px; font-size: 12.5px; }
.bk-abgleich-voll { margin-top: 10px; padding: 8px 10px; border-radius: 6px; font-size: 13.5px; line-height: 1.45;
                    background: rgba(255,255,255,.03); border-left: 3px solid var(--pos, #3fb950); overflow-wrap: anywhere; }
.bk-abgleich-voll.fehler { border-left-color: var(--neg, #e06c75); }

/* v2.38: Portfolio-Liste als Karten (Desktop und mobil gleich lesbar) */
.pf-liste { display: flex; flex-direction: column; gap: 10px; }
.pf-karte { scroll-margin-top: 90px; border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 10px 12px; }
.pf-karte.pf-frage { border-color: var(--red); }
.pf-kopf { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 10px; }
.pf-name { font-size: 15px; overflow-wrap: anywhere; }
.pf-tags .vgl-tag { margin: 0 0 0 4px; }
.pf-meta { margin-top: 4px; font-size: 12.5px; line-height: 1.5; }
.pf-aktionen { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; }
.pf-aktionen form { margin: 0; }
.pf-art { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pf-art { flex: 1 1 220px; flex-wrap: nowrap; }
.pf-art select { width: auto; flex: 1 1 auto; min-width: 0; max-width: 220px; font-size: 13px; padding: 6px 8px; }
.pf-aktionen .btn { white-space: nowrap; }
.pf-rot { background: var(--red); border-color: var(--red); color: #fff; }
.pf-bestaetigen { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
@media (max-width: 700px) {
  .pf-tags .vgl-tag:first-child { margin-left: 0; }
  .pf-aktionen .btn { min-height: 38px; }
}

/* v2.39: Warnzeichen am Saldo und Saldenpruefung */
.bk-warn { display: inline-flex; align-items: center; justify-content: center; width: 1.25em; height: 1.25em;
  margin-left: 6px; border-radius: 50%; background: var(--red); color: #fff; font: 700 0.8em var(--font-ui);
  vertical-align: 0.1em; cursor: help; }
.bk-pruefung { margin-top: 10px; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 6px; font-size: 13.5px; }
.bk-pruefung summary { cursor: pointer; }
.bk-pr-tab td, .bk-pr-tab th { font-size: 12.5px; }
.bk-pr-tab .r { text-align: right; }
.bk-pr-bruch td { background: rgba(227,103,120,.10); }
.bk-pr-liste { margin: 0 0 6px; padding-left: 18px; font-size: 12.5px; line-height: 1.6; }
.bk-pr-tag { white-space: nowrap; }
.bk-pr-tab td.r, .bk-pr-tab th.r { white-space: nowrap; }
.bk-pr-export { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line-soft); font-size: 13px; line-height: 1.6; }
.bk-vormerk { margin-top: 12px; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 6px; scroll-margin-top: 90px; }
.bk-vormerk-frage { border-color: var(--red); }
