/* =====================================================================
   Seiten-spezifische Styles (nur Tokens aus den Themes verwenden)
   ===================================================================== */
.btn-reset { background: none; border: 0; width: 100%; text-align: left; font: inherit; }
.grow { flex: 1; }
.center { text-align: center; }
.small { font-size: 13px; }
.big { font-size: 1.4rem; }
.pre { white-space: pre-line; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.danger-text { color: var(--danger) !important; border-color: transparent !important; }
p .icon, .small .icon { display: inline-block; vertical-align: -3px; width: 15px; height: 15px; margin-right: 4px; }
.mini-select {
    background: var(--surface-3); color: var(--text); border: 1px solid var(--border);
    border-radius: var(--radius-s); padding: 5px 8px; font-size: 13px;
}
.section { margin-top: 34px; }
.section-head { margin-bottom: 12px; }
.section-head .section-title { margin: 0; }
.section-card { margin-top: var(--gap); }
.small-spinner { width: 20px; height: 20px; border-width: 2px; margin: 12px auto; }

/* --------------------------- Öffentliche Seiten --------------------------- */
body.public { display: block; }
.public-wrap { min-height: 100dvh; display: flex; flex-direction: column; }
.public-head {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    padding: 4px 20px 4px 8px; background: var(--bg-elevated); min-height: var(--header-h);
}
.public-prefs { display: flex; gap: 8px; }
.public-main { flex: 1; display: grid; place-items: start center; padding: 48px 16px; }
.public-foot { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; padding: 18px; font-size: 12.5px; }
.public-foot a { color: var(--text-muted); }
.auth-card {
    width: min(460px, 100%); background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius-l); padding: 30px 28px; box-shadow: var(--shadow);
    display: flex; flex-direction: column; gap: 16px;
}
.auth-card.center { align-items: center; }
.auth-title { color: var(--heading); font-size: 1.7rem; }
.auth-lead { margin-top: -6px; }
.auth-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 14px; }
.auth-progress { font-size: 13px; text-align: center; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--text-muted); }
.check input { margin-top: 3px; accent-color: var(--brand); width: 16px; height: 16px; flex: none; }
.pw-meter { height: 4px; background: var(--surface-3); border-radius: 99px; margin: 8px 0 4px; overflow: hidden; }
.pw-meter span { display: block; height: 100%; width: 0; background: var(--danger); transition: width .2s, background .2s; }
.pw-meter span[data-score="2"] { background: var(--warn); }
.pw-meter span[data-score="3"], .pw-meter span[data-score="4"] { background: var(--success); }
.doc { width: min(760px, 100%); }
.doc h2 { font-size: 1.1rem; margin: 26px 0 8px; color: var(--text); }
.doc p { color: var(--text-muted); }

/* -------------------------------- Dashboard -------------------------------- */
.dash-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.budget-card {
    display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-l); padding: 14px 22px; min-width: 240px;
}
.budget-card .kpi-value { font-size: 1.9rem; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: var(--gap); }
.kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; color: var(--text); text-decoration: none; }
.kpi .kpi-value { font-size: 1.3rem; overflow-wrap: anywhere; }
.kpi-link:hover { border-color: var(--brand); }
.kpi-icon {
    display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; flex: none;
    background: var(--surface-3); color: var(--brand);
}
.kpi-icon .icon { width: 20px; height: 20px; }
.dash-grid { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(0, 1.7fr); gap: var(--gap); align-items: start; }
.dash-side { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.dash-donut .chart-donut { max-width: 300px; }
.budget-use { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 12px 0 6px; }
.legend-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.legend-list .legend-item { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: center; color: var(--text); }
.legend-list .swatch { width: 12px; height: 12px; }
.dash-foot { margin-top: 26px; display: flex; justify-content: center; align-items: center; gap: 6px; }
.dash-foot .icon { width: 14px; height: 14px; }

/* ------------------------------ Transaktionen ------------------------------ */
.tx-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; max-width: 872px; margin: 0 auto 14px; }
.month-nav { display: inline-flex; align-items: center; gap: 4px; }
.month-nav .icon-btn { color: var(--text); width: 36px; height: 36px; }
.month-label { min-width: 150px; text-align: center; font-family: var(--font-display); font-size: 1.05rem; }
.month-nav-left { margin: -12px 0 18px -8px; }
.tx-summary { display: flex; gap: 10px; flex-wrap: wrap; max-width: 872px; margin: 0 auto 14px; }
.tx-kpi {
    flex: 1 1 140px; display: flex; flex-direction: column; padding: 10px 14px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.tx-kpi .num { font-size: 1.1rem; }
.tx-form { max-width: 690px; margin: 0 auto; }
.tx-form-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 12px; margin: 50px 0 26px; }
.tx-form-top .budget-box { justify-self: end; margin-top: -48px; margin-right: -120px; }
.form-title { cursor: default; margin: 0; }
.form-title:active { transform: none; }
.tx-card { max-width: 690px; }
.amount-wrap { display: flex; align-items: center; gap: 6px; width: 100%; }
.amount-wrap input { flex: 1; min-width: 0; background: transparent; border: 0; text-align: right; font-family: var(--font-num); font-size: 1.02rem; padding: 6px 2px; }
.amount-wrap input:focus { outline: none; box-shadow: 0 1px 0 var(--brand); }
.amount-wrap .cur { order: 0; color: var(--text); font-family: var(--font-num); }
.end-row input { background: transparent; border: 0; color: var(--text); font-family: var(--font-num); }

/* -------------------------------- Kategorien -------------------------------- */
.cat-head .page-title { margin-bottom: 12px; }
.cat-layout { display: grid; grid-template-columns: minmax(280px, 520px) minmax(0, 1fr); gap: 40px; align-items: center; }
.cat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 28px; }
.cat-row { display: grid; grid-template-columns: 60px minmax(0, 1fr) 32px; align-items: center; gap: 8px; }
.cat-open { background: none; border: 0; padding: 0; border-radius: 10px; }
.cat-open:hover { background: var(--surface); }
.cat-text { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: baseline; }
.cat-name { font-family: var(--font-display); font-size: 1.12rem; overflow-wrap: anywhere; }
.cat-amount { color: var(--text-muted); font-size: 14px; }
.cat-limit { color: var(--text-faint); }
.cat-limit.neg { color: var(--expense); }
.cat-unassigned .cat-icon { color: var(--text-faint); }
.add-cat { margin-top: 32px; }
.cat-chart { --donut-gap: var(--bg); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.cat-chart .chart-donut { max-width: 380px; }

/* --------------------------------- Sparen --------------------------------- */
.goal-card { display: flex; flex-direction: column; gap: 12px; }
.goal-card h3 { font-size: 1.05rem; }
.goal-amounts { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
.plan-row { align-items: flex-start; }
.plan-badge { --swatch: var(--chart-brand); }
.plan-values { text-align: right; }

/* ------------------------------ Konten & Familie ------------------------------ */
.acc-badge, .fam-badge, .member-badge { --swatch: var(--brand); }
.total-row { padding: 14px 4px 2px; border-top: 1px solid var(--line); margin-top: 6px; }
.vault-hint { margin-top: -16px; }
.family-card { display: flex; flex-direction: column; gap: 14px; }
.family-card h3 { font-size: 1.1rem; }
.family-actions { margin-top: 4px; }
.members { border-top: 1px solid var(--border); }
.list-row.wrap { flex-wrap: wrap; }
.fp-card { margin-top: var(--gap); display: flex; flex-direction: column; gap: 8px; }
.fp { display: inline-block; width: fit-content; }
.invites { margin-bottom: var(--gap); border-color: var(--brand); }

/* -------------------------------- Analysen -------------------------------- */
.hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.hbar-track { height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.hbar-fill { height: 100%; background: var(--swatch); border-radius: inherit; }

/* ------------------------------ Einstellungen ------------------------------ */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.settings-card { display: flex; flex-direction: column; gap: 14px; }
.settings-card > .btn { align-self: flex-start; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.theme-card {
    display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: var(--radius);
    background: var(--surface-3); border: 2px solid transparent; color: var(--text); text-align: left;
}
.theme-card[aria-pressed="true"] { border-color: var(--brand); }
.theme-preview { display: grid; grid-template-columns: 2fr 1fr 1fr; height: 42px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.theme-preview i { display: block; }
.events summary { cursor: pointer; color: var(--text-muted); font-size: 14px; }

@media (max-width: 1100px) {
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dash-grid { grid-template-columns: minmax(0, 1fr); }
    .cat-layout { grid-template-columns: minmax(0, 1fr); }
    .cat-chart { order: -1; }
    .tx-form-top .budget-box { margin-right: 0; }
}

@media (max-width: 900px) {
    .kpis, .kpis-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .kpi { padding: 12px; gap: 10px; }
    .kpi-icon { width: 32px; height: 32px; }
    .kpi .kpi-value { font-size: 1.05rem; }
    .settings-grid { grid-template-columns: minmax(0, 1fr); }
    .tx-form-top { grid-template-columns: minmax(0, 1fr); margin: 6px 0 16px; }
    .tx-form-top > span { display: none; }
    .tx-form-top .budget-box { justify-self: stretch; margin: 0; order: -1; }
    .cat-row { grid-template-columns: 48px minmax(0, 1fr) 32px; }
    .cat-icon .icon { width: 32px; height: 32px; }
    .cat-list { gap: 18px; }
    .cat-text { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .cat-chart .chart-donut { max-width: 290px; }
    .month-label { min-width: 120px; }
    .public-main { padding: 24px 12px; }
    .auth-card { padding: 22px 18px; }
    .plan-row { flex-wrap: wrap; }
    .plan-values { text-align: left; width: 100%; padding-left: 52px; }
}

/* ----------------------- Wiederholung (Intervall) ----------------------- */
.mini-input {
    width: 64px; background: var(--surface-3); color: var(--text); border: 1px solid var(--border);
    border-radius: var(--radius-s); padding: 5px 8px; font-size: 14px; text-align: center;
}
.interval-ctl { gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.rec-preview { min-width: 110px; text-align: right; }
.interval-row, .end-row { border-bottom: 0; }
.ai-hint { color: var(--brand); }

/* ---------------------------- Sparziel-Rechner ---------------------------- */
.seg-block { display: flex; width: 100%; }
.seg-block button { flex: 1; }
.goal-calc { min-height: 1.4em; color: var(--brand); display: flex; align-items: center; gap: 6px; font-size: 14px; }
.goal-calc .icon { width: 16px; height: 16px; }

/* ------------------------------- Produkte ------------------------------- */
.product { display: flex; gap: 12px; align-items: center; min-width: 0; }
.product-img {
    width: 64px; height: 64px; object-fit: contain; border-radius: 10px; background: #fff; flex: none;
}
.product-img-empty { display: grid; place-items: center; background: var(--surface-3); color: var(--text-faint); }
.product-compact { padding-top: 10px; border-top: 1px solid var(--border); }
.product-compact .product-img { width: 44px; height: 44px; }
.product-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.product-title { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--text-muted); }
.product-link { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; width: fit-content; }
.product-link .icon { width: 14px; height: 14px; }
.ad-tag { background: var(--warn-bg); color: var(--warn); }
.product-search .input-box { flex: 1; min-width: 180px; }
.product-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.product-card {
    display: flex; flex-direction: column; justify-content: space-between; gap: 12px;
    padding: 14px; border-radius: var(--radius); background: var(--surface-3); border: 1px solid var(--border);
}
.product-card .btn { width: 100%; }
.disclosure { margin-top: 12px; }

/* ------------------------------- Bank ------------------------------- */
.bank-list { max-height: 50vh; overflow-y: auto; }
.bank-pick {
    display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
    padding: 10px 8px; border: 0; border-radius: var(--radius-s); background: transparent; color: var(--text);
}
.bank-pick:hover { background: var(--surface-3); }
.bank-pick span:first-of-type { flex: 1; }
.neg-tag { background: var(--danger-bg); color: var(--danger); }
.bank-note { margin-top: 12px; }
.goal-card > .row-between:first-child { flex-wrap: nowrap; align-items: flex-start; }
.goal-card > .row-between:first-child > .row { flex-wrap: nowrap; min-width: 0; }
.goal-card > .row-between:first-child h3 { overflow-wrap: anywhere; }
.goal-card .tool-btn { flex: none; }
.row-between > .seg { margin-bottom: 14px; }

/* --------------------------------- Über mich --------------------------------- */
.nav-foot { flex-wrap: wrap; row-gap: 8px; }
.about section + section { margin-top: 34px; }
.about-welcome p { color: var(--text); font-size: 1.02rem; line-height: 1.7; margin-bottom: 12px; }
.about-signature { font-family: var(--font-display); color: var(--heading) !important; }
.about-author { display: flex; gap: 22px; align-items: flex-start; }
.about-author h2 { margin-top: 0; }
.about-photo { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 2px solid var(--brand); flex: none; }
.about-name { font-family: var(--font-display); font-size: 1.15rem; color: var(--text) !important; margin-bottom: 8px; }
@media (max-width: 600px) { .about-author { flex-direction: column; align-items: center; text-align: center; } }

.link-note { font-size: 13px; color: var(--text-muted); margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.link-note .icon { display: inline-block; width: 15px; height: 15px; vertical-align: -3px; color: var(--brand); }
.link-note .small-spinner { display: inline-block; width: 14px; height: 14px; margin: 0; }

/* --------------------------- Öffentliche Navigation --------------------------- */
.public-nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-left: auto; }
.public-nav a:not(.btn) { color: var(--text-muted); text-decoration: none; font-size: 14.5px; }
.public-nav a:not(.btn):hover, .public-nav a[aria-current="page"] { color: var(--text); }
.public-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; text-decoration-color: var(--brand); }
.btn-sm { min-height: 34px; padding: 0 14px; font-size: 14px; }
@media (max-width: 720px) {
    .public-head { padding: 6px 12px; gap: 8px; }
    .public-nav { order: 3; width: 100%; justify-content: space-between; gap: 10px; margin: 0; }
    .public-nav a:not(.btn) { font-size: 13.5px; }
}

/* --------------------------- Landingpage --------------------------- */
body[data-page="home"] .public-main { display: block; padding: 0 16px 48px; }
.landing { width: min(1120px, 100%); margin: 0 auto; }
.lp-hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; padding: 56px 0 40px; }
.lp-eyebrow { color: var(--brand); font-weight: 600; font-size: 13.5px; letter-spacing: .02em; margin: 0 0 10px; }
.lp-title { color: var(--heading); font-size: clamp(1.9rem, 4.2vw, 3rem); line-height: 1.12; margin: 0 0 16px; }
.lp-lead { color: var(--text-muted); font-size: 1.06rem; line-height: 1.6; }
.lp-cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 22px 0 18px; }
.lp-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; color: var(--text-muted); font-size: 14px; }
.lp-points li { display: flex; gap: 8px; align-items: center; }
.lp-points .icon { width: 16px; height: 16px; color: var(--success); flex: none; }
.lp-shot img { width: 100%; height: auto; border-radius: var(--radius-l); border: 1px solid var(--border); box-shadow: var(--shadow); display: block; }
.lp-section { padding: 40px 0; border-top: 1px solid var(--border); }
.lp-h2 { color: var(--heading); font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin: 0 0 8px; }
.lp-sub { color: var(--text-muted); margin: 0 0 24px; }
.lp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.lp-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-l); padding: 20px; }
.lp-card h3 { font-size: 1.02rem; margin: 12px 0 6px; color: var(--text); }
.lp-card p { color: var(--text-muted); font-size: 14px; line-height: 1.55; margin: 0; }
.lp-ico { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--surface-3); color: var(--brand); }
.lp-ico .icon { width: 22px; height: 22px; }
.lp-ico-lg { width: 64px; height: 64px; flex: none; }
.lp-ico-lg .icon { width: 32px; height: 32px; }
.lp-steps { list-style: none; counter-reset: s; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.lp-steps li { counter-increment: s; position: relative; padding: 20px 20px 20px 64px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-l); }
.lp-steps li::before { content: counter(s); position: absolute; left: 18px; top: 18px; width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: var(--brand-contrast); display: grid; place-items: center; font-weight: 700; }
.lp-steps h3 { margin: 4px 0 6px; font-size: 1rem; color: var(--text); }
.lp-steps p { margin: 0; color: var(--text-muted); font-size: 14px; }
.lp-security { display: flex; gap: 24px; align-items: flex-start; }
.lp-security p { color: var(--text-muted); max-width: 70ch; line-height: 1.6; }
.faq-list { display: grid; gap: 10px; margin: 16px 0; }
.faq-item { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; }
.faq-item summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; color: var(--brand); font-size: 1.3rem; line-height: 1; }
.faq-item[open] summary::after { content: '–'; }
.faq-item h3 { margin: 0; font-size: 1rem; color: var(--text); }
.faq-item p { color: var(--text-muted); margin: 10px 0 0; line-height: 1.6; }
.lp-final { text-align: center; }
.lp-final p { color: var(--text-muted); }
@media (max-width: 860px) {
    .lp-hero { grid-template-columns: 1fr; padding-top: 32px; gap: 28px; }
    .lp-steps { grid-template-columns: 1fr; }
    .lp-security { flex-direction: column; gap: 12px; }
}

/* --------------------------- FAQ & Sicherheit --------------------------- */
.crumbs { font-size: 13px; color: var(--text-faint); margin-bottom: 8px; }
.crumbs a { color: var(--text-muted); }
.faq-toc { margin: 20px 0 10px; }
.faq-toc ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.faq-toc a { color: var(--text-muted); }
.faq-entry { scroll-margin-top: 20px; }
.doc p { line-height: 1.65; }
.faq-cta { margin-top: 28px; }
.sec-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sec-compare h3 { margin: 0 0 8px; font-size: 1rem; color: var(--text); }
.sec-compare ul { margin: 0; padding-left: 18px; color: var(--text-muted); display: grid; gap: 4px; }
@media (max-width: 640px) { .sec-compare { grid-template-columns: 1fr; } }
