/* ───────── Tokens ───────── */
:root {
  color-scheme: dark;
  --bg: #0b0d12;
  --surface: #141821;
  --surface-2: #1b2030;
  --surface-3: #232a3d;
  --line: rgba(255, 255, 255, .075);
  --line-strong: rgba(255, 255, 255, .14);
  --text: #eef0f6;
  --muted: #8b93a8;
  --faint: #5d657a;
  --accent: #7c6cff;
  --accent-2: #4f9dff;
  --accent-soft: rgba(124, 108, 255, .16);
  --pos: #2fd08a;
  --neg: #ff5d73;
  --pos-soft: rgba(47, 208, 138, .14);
  --neg-soft: rgba(255, 93, 115, .14);
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 12px 32px rgba(0, 0, 0, .28);
  --r: 20px;
  --r-sm: 12px;
  --sidebar: 244px;
  --pad: 28px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f3f4f9;
    --surface: #ffffff;
    --surface-2: #f0f2f8;
    --surface-3: #e5e8f2;
    --line: rgba(18, 24, 48, .08);
    --line-strong: rgba(18, 24, 48, .16);
    --text: #12151f;
    --muted: #666e88;
    --faint: #9aa1b8;
    --accent: #5b4bf0;
    --accent-2: #2b7de9;
    --accent-soft: rgba(91, 75, 240, .1);
    --pos: #0e9d62;
    --neg: #e0334c;
    --pos-soft: rgba(14, 157, 98, .1);
    --neg-soft: rgba(224, 51, 76, .1);
    --shadow: 0 1px 2px rgba(18, 24, 48, .05), 0 8px 24px rgba(18, 24, 48, .06);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f4f9;
  --surface: #ffffff;
  --surface-2: #f0f2f8;
  --surface-3: #e5e8f2;
  --line: rgba(18, 24, 48, .08);
  --line-strong: rgba(18, 24, 48, .16);
  --text: #12151f;
  --muted: #666e88;
  --faint: #9aa1b8;
  --accent: #5b4bf0;
  --accent-2: #2b7de9;
  --accent-soft: rgba(91, 75, 240, .1);
  --pos: #0e9d62;
  --neg: #e0334c;
  --pos-soft: rgba(14, 157, 98, .1);
  --neg-soft: rgba(224, 51, 76, .1);
  --shadow: 0 1px 2px rgba(18, 24, 48, .05), 0 8px 24px rgba(18, 24, 48, .06);
}

/* ───────── Base ───────── */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  font-variant-numeric: tabular-nums;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.priv .amt { filter: blur(9px); user-select: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ───────── Layout ───────── */
.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }

.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; gap: 22px;
  padding: calc(22px + var(--safe-t)) 16px 18px calc(16px + var(--safe-l));
  border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px; }
.logo {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 18px rgba(124, 108, 255, .35);
}
.brand-name { font-weight: 700; font-size: 19px; letter-spacing: -.02em; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 13px; padding: 11px 12px; border-radius: 12px;
  color: var(--muted); font-weight: 560; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--surface); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.side-foot { margin-top: auto; padding: 0 10px; }
.side-note { display: flex; align-items: center; gap: 8px; color: var(--faint); font-size: 12.5px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--pos); }

.main { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(14px + var(--safe-t)) calc(var(--pad) + var(--safe-r)) 12px var(--pad);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(18px); backdrop-filter: saturate(160%) blur(18px);
}
.top-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.top-left h1 { font-size: 26px; font-weight: 720; letter-spacing: -.025em; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.content { padding: 6px calc(var(--pad) + var(--safe-r)) 56px var(--pad); max-width: 1280px; margin: 0 auto; outline: none; }

.pf-select { position: relative; display: inline-flex; align-items: center; }
.pf-select select {
  appearance: none; -webkit-appearance: none; background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 34px 8px 14px; font-weight: 600; font-size: 14px; max-width: 220px; min-height: 38px;
  text-overflow: ellipsis;
}
.pf-select .ic { position: absolute; right: 11px; width: 15px; height: 15px; pointer-events: none; color: var(--muted); }
.pf-select.hidden { display: none; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--muted);
  background: var(--surface); border: 1px solid var(--line); transition: color .15s, background .15s;
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.icon-btn.spin .ic { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border-radius: 12px; font-weight: 620; background: var(--surface-2); border: 1px solid var(--line); transition: filter .15s, background .15s;
}
.btn:hover { background: var(--surface-3); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border-color: transparent; box-shadow: 0 6px 18px rgba(124, 108, 255, .28); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--neg); }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface); color: var(--text); }
.btn:disabled { opacity: .5; cursor: default; }

/* ───────── Cards ───────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow); min-width: 0; }
.card + .card { margin-top: 16px; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-title h2 { font-size: 16px; font-weight: 680; letter-spacing: -.01em; }
.eyebrow { color: var(--muted); font-size: 13px; font-weight: 560; }
.grid { display: grid; gap: 16px; margin-top: 16px; }
.grid > .card { margin: 0; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-wide { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }

/* Segmented control & chips */
.seg { display: inline-flex; background: var(--surface-2); border-radius: 12px; padding: 3px; gap: 2px; border: 1px solid var(--line); }
.seg button { padding: 6px 13px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 13.5px; min-height: 32px; white-space: nowrap; }
.seg button.on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 6px 13px; border-radius: 999px; font-weight: 600; font-size: 13.5px; color: var(--muted);
  background: transparent; border: 1px solid transparent; min-height: 34px; transition: all .15s;
}
.chip:hover { color: var(--text); }
.chip.on { background: var(--accent-soft); color: var(--accent); }
.chip.outline { border-color: var(--line); background: var(--surface); }
.chip.outline.on { border-color: transparent; background: var(--accent-soft); }
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.buy { background: var(--pos-soft); color: var(--pos); }
.badge.sell { background: var(--neg-soft); color: var(--neg); }
.badge.dividend { background: var(--accent-soft); color: var(--accent); }

/* ───────── Hero ───────── */
.hero { padding: 24px 24px 14px; }
.hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hero-value { font-size: 44px; font-weight: 740; letter-spacing: -.035em; line-height: 1.1; margin-top: 4px; }
.hero-delta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; font-weight: 620; font-size: 15.5px; min-height: 24px; }
.hero-delta .pill { padding: 2px 10px; border-radius: 999px; font-size: 13.5px; }
.hero-delta .pill.pos { background: var(--pos-soft); }
.hero-delta .pill.neg { background: var(--neg-soft); }
.hero-delta .when { color: var(--muted); font-weight: 500; font-size: 13.5px; }
.chart { position: relative; width: 100%; height: 300px; margin-top: 10px; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .zero-line { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 4; }
.chart text { fill: var(--faint); font-size: 11.5px; font-family: var(--font); }
.chart .cursor { stroke: var(--line-strong); stroke-width: 1; }
.chart-foot { display: flex; justify-content: center; margin-top: 6px; padding-bottom: 4px; }
.empty-chart { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }

/* ───────── KPI ───────── */
.kpi { padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.kpi .k-label { color: var(--muted); font-size: 13px; font-weight: 560; display: flex; align-items: center; gap: 6px; }
.kpi .k-value { font-size: 23px; font-weight: 700; letter-spacing: -.02em; }
.kpi .k-sub { font-size: 13px; color: var(--muted); font-weight: 560; }

/* ───────── Donut / legend ───────── */
.alloc { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 22px; align-items: center; }
.alloc-card { container-type: inline-size; }
@container (max-width: 540px) { .alloc { grid-template-columns: 1fr; justify-items: center; gap: 14px; } .alloc .legend { width: 100%; } }
.donut { position: relative; width: 200px; height: 200px; }
.donut svg { width: 100%; height: 100%; display: block; }
.donut .seg-arc { transition: opacity .15s, stroke-width .15s; cursor: pointer; }
.donut.hovering .seg-arc:not(.on) { opacity: .35; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; padding: 0 38px; }
.donut-center .dc-top { font-size: 12.5px; color: var(--muted); font-weight: 560; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donut-center .dc-main { font-size: 20px; font-weight: 720; letter-spacing: -.02em; }
.legend { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.legend .lg { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; transition: background .15s; }
.legend .lg.on { background: var(--surface-2); }
.lg i { width: 10px; height: 10px; border-radius: 3px; display: block; }
.lg .lg-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 580; }
.lg .lg-val { color: var(--muted); font-weight: 600; font-size: 14px; }

/* ───────── Lists / tables ───────── */
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 6px; border-top: 1px solid var(--line); min-width: 0; }
.list-row:first-child { border-top: 0; }
.list-row.link { cursor: pointer; border-radius: 12px; padding-left: 8px; padding-right: 8px; margin: 0 -8px; }
.list-row.link:hover { background: var(--surface-2); }
.lr-main { flex: 1; min-width: 0; }
.lr-title { font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-end { text-align: right; flex: none; }
.lr-end .v { font-weight: 640; }
.lr-end .s { font-size: 13px; font-weight: 560; }
.avatar {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none;
  font-weight: 700; font-size: 13px; color: #fff; letter-spacing: -.02em;
}

.table { display: flex; flex-direction: column; }
.row { display: grid; align-items: center; gap: 12px; padding: 13px 14px; border-top: 1px solid var(--line); }
.row.head { border-top: 0; padding-top: 4px; padding-bottom: 8px; color: var(--muted); font-size: 12.5px; font-weight: 600; user-select: none; }
.row.head .sortable { cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.row.head .sortable:hover { color: var(--text); }
.row.head .sortable.on { color: var(--text); }
.row:not(.head):hover { background: var(--surface-2); }
.row.click { cursor: pointer; }
.row .r { text-align: right; justify-self: end; }
.row .name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.row .name .t { min-width: 0; }
.row .sub { font-size: 12.5px; color: var(--muted); font-weight: 520; }
.row .strong { font-weight: 640; }
.pos-row { grid-template-columns: minmax(200px, 2.2fr) .8fr .9fr 1.1fr .7fr 1.2fr 92px; }
.act-row { grid-template-columns: 96px 108px minmax(160px, 2fr) .8fr .9fr 1.1fr 76px; }
.table-card { padding: 10px 8px 8px; overflow: hidden; }
.table-card .row { margin: 0 -2px; border-radius: 0; }
.month-sep { padding: 16px 14px 6px; color: var(--muted); font-size: 12.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.spark { width: 84px; height: 30px; display: block; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 14px; }
.toolbar .grow { flex: 1; }
.search { position: relative; flex: 1 1 220px; max-width: 360px; }
.search .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); }
.search input { width: 100%; padding-left: 40px; }

.summary-line { color: var(--muted); font-weight: 560; margin: 4px 0 6px; }
.summary-line b { color: var(--text); font-weight: 680; }

/* ───────── Forms ───────── */
input, select, textarea {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; min-height: 44px;
  font-size: 16px; /* verhindert Auto-Zoom auf iOS */ width: 100%; transition: border-color .15s, background .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); }
input::placeholder { color: var(--faint); }
select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
.pf-select select { background-image: none; padding-right: 34px; width: auto; }
input[type="date"] { min-height: 44px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .lbl { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.hint { font-size: 12.5px; color: var(--muted); }
.total-box { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); font-weight: 600; }
.total-box b { font-size: 19px; letter-spacing: -.02em; }
.switch { position: relative; width: 50px; height: 30px; border-radius: 999px; background: var(--surface-3); flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(20px); }

.setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.setting:first-of-type { border-top: 0; }
.setting .s-t { font-weight: 620; }
.setting .s-d { color: var(--muted); font-size: 13.5px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ───────── Modal ───────── */
.overlay {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px;
  background: rgba(4, 6, 12, .6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: fade .18s ease-out;
}
.sheet {
  width: 100%; max-width: 560px; max-height: min(88vh, 860px); max-height: min(88dvh, 860px); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 24px; box-shadow: 0 30px 80px rgba(0,0,0,.45);
  animation: pop .22s cubic-bezier(.2,.9,.3,1.1);
}
.sheet.wide { max-width: 760px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px 8px; }
.sheet-head h2 { font-size: 19px; font-weight: 700; letter-spacing: -.015em; min-width: 0; }
.sheet-body { padding: 10px 22px 22px; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 16px; }
.sheet-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 22px calc(18px + var(--safe-b)); border-top: 1px solid var(--line); }
.sheet-foot .btn { min-width: 110px; min-height: 44px; }
.sheet-foot .left { margin-right: auto; min-width: 0; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }
@keyframes slideup { from { transform: translateY(40px); opacity: .6; } }
body.locked { overflow: hidden; }

#toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%); z-index: 200; pointer-events: none; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast-item { background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 999px; font-weight: 620; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.35); animation: pop .2s ease-out; max-width: 90vw; }

/* ───────── Empty / welcome ───────── */
.welcome { text-align: center; padding: 56px 24px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.welcome .logo { width: 64px; height: 64px; border-radius: 20px; }
.welcome .logo .ic { width: 30px; height: 30px; }
.welcome h2 { font-size: 26px; letter-spacing: -.025em; }
.welcome p { color: var(--muted); max-width: 440px; }
.empty { text-align: center; color: var(--muted); padding: 36px 12px; }

/* ───────── Tab bar (Phone) ───────── */
.tabbar { display: none; }

/* ───────── Detail ───────── */
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--surface-2); border-radius: 14px; padding: 12px 14px; min-width: 0; }
.stat .l { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat .v { font-weight: 680; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-head { display: flex; align-items: center; gap: 14px; }
.detail-price { font-size: 30px; font-weight: 730; letter-spacing: -.03em; line-height: 1.1; }

.bar-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 13px; color: var(--muted); font-weight: 560; }
.bar-legend span { display: inline-flex; align-items: center; gap: 6px; }
.bar-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

.ph { display: none; }

/* ───────── Responsive ───────── */
/* iPad (Hochformat) & schmale Fenster: Icon-Leiste */
@media (max-width: 1023px) {
  :root { --sidebar: 84px; --pad: 22px; }
  .brand-name, .nav a span, .side-note span:last-child { display: none; }
  .sidebar { align-items: center; padding-left: calc(10px + var(--safe-l)); padding-right: 10px; }
  .nav a { justify-content: center; padding: 13px; }
  .brand { padding: 4px 0; }
  .side-foot { padding: 0; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-wide, .alloc-grid { grid-template-columns: 1fr; }
  .hero-value { font-size: 40px; }
  .pos-row { grid-template-columns: minmax(180px, 2fr) .9fr 1.1fr 1.2fr 84px; }
  .pos-row .c-price, .pos-row .c-weight { display: none; }
  .act-row { grid-template-columns: 90px 100px minmax(140px, 2fr) .8fr 1.1fr 70px; }
  .act-row .c-price { display: none; }
}

/* iPhone & kleine Fenster */
@media (max-width: 719px) {
  :root { --pad: 16px; --r: 18px; }
  .app { display: block; }
  .sidebar { display: none; }
  .topbar { padding: calc(10px + var(--safe-t)) calc(var(--pad) + var(--safe-r)) 8px calc(var(--pad) + var(--safe-l)); }
  .top-left { flex-direction: column; align-items: flex-start; gap: 6px; }
  .top-left h1 { font-size: 24px; }
  .pf-select select { font-size: 13.5px; min-height: 32px; padding-top: 4px; padding-bottom: 4px; max-width: 200px; }
  .top-actions { gap: 6px; }
  .icon-btn { width: 40px; height: 40px; }
  .add-btn span { display: none; }
  .add-btn { width: 40px; padding: 0; }
  .content { padding: 4px calc(var(--pad) + var(--safe-r)) calc(104px + var(--safe-b)) calc(var(--pad) + var(--safe-l)); }
  .card { padding: 16px; }
  .hero { padding: 18px 16px 8px; }
  .hero-value { font-size: 36px; }
  .chart { height: 232px; }
  .chart-foot { display: block; }
  .chart-foot .chips { flex-wrap: nowrap; justify-content: space-between; }
  .chart-foot .chip { padding: 6px 10px; flex: 1; text-align: center; }
  .hero .seg { width: 100%; }
  .hero .seg button { flex: 1; }
  .grid { gap: 12px; margin-top: 12px; }
  .g2, .g3, .g-wide { grid-template-columns: 1fr; }
  .g3.kpis, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding: 14px 15px; }
  .kpi .k-value { font-size: 19px; }
  .alloc { grid-template-columns: 1fr; justify-items: center; gap: 12px; }
  .alloc .legend { width: 100%; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr);
    padding: 6px calc(6px + var(--safe-r)) calc(6px + var(--safe-b)) calc(6px + var(--safe-l));
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px);
    border-top: 1px solid var(--line);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0 4px; color: var(--faint); font-size: 10.5px; font-weight: 640; border-radius: 12px; }
  .tabbar a .ic { width: 23px; height: 23px; }
  .tabbar a.active { color: var(--accent); }

  /* Positions-Tabelle → Karten-Liste */
  .table-card { padding: 4px 4px; }
  .row.head { display: none; }
  .pos-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name value" "name pnl"; gap: 0 10px; padding: 12px 12px; }
  .pos-row .c-name { grid-area: name; }
  .pos-row .c-value { grid-area: value; }
  .pos-row .c-pnl { grid-area: pnl; }
  .pos-row .c-shares, .pos-row .c-price, .pos-row .c-weight, .pos-row .c-spark { display: none; }
  .ph { display: inline; }
  .act-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name total" "name date"; gap: 0 10px; padding: 12px 12px; }
  .act-row .c-date { grid-area: date; justify-self: end; font-size: 12.5px; color: var(--muted); }
  .act-row .c-type, .act-row .c-shares, .act-row .c-price, .act-row .c-actions { display: none; }
  .act-row .c-name { grid-area: name; }
  .act-row .c-total { grid-area: total; }
  .act-row .name .badge-inline { display: inline; }
  .pf-tag { display: none; }
  .search { max-width: none; flex-basis: 100%; }
  .toolbar { gap: 8px; }

  .form-grid { grid-template-columns: 1fr 1fr; gap: 12px; }

  /* Modals → Bottom Sheets */
  .overlay { align-items: end; padding: 0; }
  .sheet { max-width: none; border-radius: 26px 26px 0 0; max-height: 94vh; max-height: 94dvh; animation: slideup .28s cubic-bezier(.2,.9,.3,1); border-bottom: 0; }
  .sheet-head { padding: 18px 18px 6px; }
  .sheet-body { padding: 8px 18px 18px; }
  .sheet-foot { padding: 12px 18px calc(14px + var(--safe-b)); }
  .sheet-foot .btn { flex: 1; min-width: 0; }
  .setting { flex-wrap: wrap; }
  #toast { bottom: calc(86px + var(--safe-b)); }
}

@media (max-width: 340px) {
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
  .hero-value { font-size: 32px; }
}
@media (min-width: 720px) {
  .badge-inline { display: none; }
}
.badge-inline { display: none; }
@media (hover: none) {
  .row:not(.head):hover, .nav a:hover { background: transparent; }
  .row.click:active, .list-row.link:active { background: var(--surface-2); }
}
@media (min-width: 1280px) { .hero .chart { height: 340px; } }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
