:root {
  --bg: #FBFBFD; --card: #FFFFFF; --text: #1D1D1F; --muted: #86868B; --line: #E5E5EA; --soft: #F5F5F7;
  --accent: #65B32E; --accent-hover: #4A8A21; --accent-tint: rgba(101,179,46,0.10);
  --error: #D0463B; --ochre: #C2891B; --radius: 18px;
  --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.04);
  --page-gap: 24px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', 'Segoe UI', Roboto, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.5;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
button { font: inherit; color: inherit; }

header.top {
  position: sticky; top: 0; z-index: 30; background: #fff; border-bottom: 1px solid #D2D2D7;
  padding: 12px 30px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.head-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo { display: inline-flex; align-items: center; font-weight: 700; font-size: 1.2rem; letter-spacing: -0.03em; text-decoration: none; color: var(--text); }
.logo svg { width: 30px; height: 30px; margin: -2px 6px 0 0; }
.logo span { color: var(--accent); font-weight: 400; letter-spacing: -0.02em; }
.app-title { font-size: 1rem; font-weight: 600; padding-left: 12px; border-left: 1px solid #D2D2D7; white-space: nowrap; }
.tabs { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: rgba(120,120,128,0.12); border-radius: 11px; padding: 3px; }
.tabs button { border: 0; background: none; border-radius: 8px; padding: 6px 26px; font-size: 0.88rem; font-weight: 500; color: var(--muted); cursor: pointer; transition: all .2s; }
.tabs button[hidden] { display: none; }
.tabs button.active { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,0.12); }
.status { font-size: 0.8rem; color: var(--muted); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.status:empty { display: none; }
.status.err { color: var(--error); font-weight: 600; }
.status.err::before { background: var(--error); }

.head-right { justify-self: end; display: flex; align-items: center; gap: 4px; min-width: 0; }
.head-right .status { margin-right: 10px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 10px; background: none; color: #48484A; cursor: pointer; transition: background .15s, color .15s; }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:hover:not(:disabled) { background: var(--soft); color: var(--text); }
.icon-btn:disabled { color: #C7C7CC; cursor: default; }
.icon-btn[hidden] { display: none; }
.icon-btn.go { background: var(--accent); color: #fff; }
.icon-btn.go:hover:not(:disabled) { background: var(--accent-hover); color: #fff; }
.icon-btn.danger:hover:not(:disabled) { background: rgba(208,70,59,0.1); color: var(--error); }
.icon-btn.check-on, .icon-btn.check-on:hover:not(:disabled) { background: #EFE4F7; color: #7030A0; }
.icon-btn.off-on, .icon-btn.off-on:hover:not(:disabled) { background: #E5E5EA; color: var(--text); }
body:not(.authed) header.top { display: none; }
body:not(.authed) { background: linear-gradient(160deg, #F4F9EF 0%, var(--bg) 55%); min-height: 100vh; }
.login { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; min-height: 100vh; padding: 24px 16px; }
.login[hidden] { display: none; }
.login-card { width: min(360px, 100%); background: var(--card); border-radius: var(--radius); box-shadow: 0 12px 40px rgba(29,29,31,0.08), 0 0 0 1px rgba(0,0,0,0.04); padding: 32px 28px 24px; text-align: center; }
.login-card label { display: block; font-size: 0.82rem; color: var(--muted); margin: 0 0 4px; text-align: left; }
.login-card input { width: 100%; height: 44px; padding: 0 12px; margin-bottom: 14px; font: inherit; font-size: 1rem; border: 1px solid #D2D2D7; border-radius: 10px; }
.login-card input.code { text-align: center; font-size: 1.25rem; font-weight: 600; letter-spacing: 0.3em; padding-left: 0.3em; margin-bottom: 0; font-variant-numeric: tabular-nums; }
.login-card input::placeholder { color: #D2D2D7; }
.login-go { width: 100%; height: 44px; font-size: 0.95rem; }
.login-card[hidden], #account-form[hidden], .account-menu[hidden], #acc-new-fields[hidden] { display: none; }
.login-link { display: block; margin: 12px auto 0; border: 0; background: none; font-size: 0.82rem; color: var(--muted); cursor: pointer; }
.login-link:hover { color: var(--text); text-decoration: underline; }
.account-menu { display: grid; gap: 8px; margin-top: 10px; }
.account-menu .btn { height: 40px; }
.account-idle { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 6px; font-size: 0.82rem; color: var(--muted); }
.account-idle label { flex: 0 0 100%; }
.account-idle input { width: 72px; height: 40px; padding: 0 10px; font: inherit; font-size: 0.95rem; border: 1px solid #D2D2D7; border-radius: 10px; }
.account-idle input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.account-menu .login-err { margin: 0; }
.account-menu .login-err:empty { display: none; }
#account-form label { display: block; font-size: 0.82rem; color: var(--muted); margin: 0 0 4px; }
#account-form input { width: 100%; height: 42px; padding: 0 12px; margin-bottom: 12px; font: inherit; font-size: 0.95rem; border: 1px solid #D2D2D7; border-radius: 10px; }
#account-form input:focus { outline: 2px solid var(--accent); border-color: transparent; }
#account-form .login-err { margin-top: 0; }
.recovery-value { display: block; padding: 14px 10px; margin-bottom: 14px; text-align: center; font-size: 1.05rem; font-weight: 600; letter-spacing: 0.04em; background: var(--soft); border-radius: 10px; overflow-wrap: anywhere; user-select: all; }
.login-card input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.login-err { min-height: 1.4em; margin: 10px 0 6px; line-height: 1.35; font-size: 0.86rem; font-weight: 600; color: var(--error); }
.wrap { max-width: 1440px; margin: 0 auto; padding: var(--page-gap) 30px 48px; }
.kpis { position: sticky; top: calc(var(--head-h, 60px) + var(--page-gap)); z-index: 11; background: var(--bg); display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; padding-bottom: 18px; }
.kpis::before { content: ''; position: absolute; left: -4px; right: -4px; top: calc(-1 * var(--page-gap)); height: var(--page-gap); background: var(--bg); }
.kpis[hidden] { display: none; }
.kpi { position: relative; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 20px; }
.kpi .lbl { font-size: 0.8rem; color: var(--muted); }
.kpi.off { opacity: .45; }
.kpi .val { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.25; margin-top: 2px; }
.kpi .val small { font-size: 0.85rem; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-right: 4px; }
.kpi .hint { font-size: 0.78rem; color: var(--muted); }
.kpi.low .val { color: var(--ochre); }
.kpi.pay .val, .kpi.pay .val small { color: var(--accent-hover); }
.kpi.pay.cost .val, .kpi.pay.cost .val small { color: var(--error); }
.kpi.neg .val { color: var(--error); }
.kpi.input { cursor: text; transition: box-shadow .15s; }
.kpi.input:hover { box-shadow: 0 0 0 1px var(--accent); }
.kpi-step { width: 54px; font: inherit; font-weight: 600; color: var(--text); text-align: right; padding: 0 5px; border: 1px solid var(--line); border-radius: 6px; background: #FFF6BF; outline: 0; }
.kpi-step:focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.kpi-edit { width: 100%; font: inherit; font-size: 1.2rem; font-weight: 700; padding: 0 6px; margin-top: 2px; border: 2px solid var(--accent); border-radius: 6px; outline: 0; font-variant-numeric: tabular-nums; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 0 0 8px; }
.card-head::before { content: ''; position: absolute; z-index: -2; left: -4px; right: -4px; top: calc(-1 * var(--page-gap)); height: calc(var(--page-gap) + var(--radius)); background: var(--bg); }
.card-head::after { content: ''; position: absolute; z-index: -1; inset: 0; background: #fff; border-radius: var(--radius) var(--radius) 0 0; box-shadow: var(--shadow); clip-path: inset(-4px -4px 0 -4px); }
.card-head { position: sticky; top: calc(var(--head-h, 60px) + var(--page-gap) + var(--kpi-h, 0px)); z-index: 10; display: flex; align-items: center; gap: 4px; padding: 18px 20px 14px; flex-wrap: wrap; }
.card-head h2 { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.01em; margin-right: 10px; }
.budget-check { display: inline-flex; align-items: center; gap: 5px; margin: 0 auto 0 8px; font-size: 0.82rem; color: var(--muted); white-space: nowrap; cursor: pointer; }
.b-head .budget-check { margin: 0 6px; }
.budget-check input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.picked-info { font-size: 0.82rem; color: var(--accent-hover); font-weight: 600; margin-right: 8px; }
.picked-info[hidden] { display: none; }
.version-pick { height: 32px; border: 0; border-radius: 9px; background-color: var(--soft); padding: 0 10px; font: inherit; font-size: 0.85rem; font-weight: 600; color: var(--text); cursor: pointer; width: 300px; max-width: calc(100vw - 32px); text-align: left; padding-right: 28px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2386868B' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#dlg-input.single { height: 44px; min-height: 0; resize: none; }
.version-pick:hover { background-color: #E8E8ED; }
.version-pick-wrap { position: relative; min-width: 0; }
.version-menu { position: absolute; z-index: 60; top: calc(100% + 4px); left: 0; width: 300px; max-width: calc(100vw - 32px); max-height: 320px; overflow-y: auto; padding: 4px; background: #fff; border: 1px solid #E5E5EA; border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14); }
.version-menu[hidden] { display: none; }
.version-item { display: block; width: 100%; padding: 7px 10px; border: 0; border-radius: 7px; background: none; font: inherit; font-size: 0.85rem; font-weight: 600; color: var(--text); text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.version-item.inactive { font-weight: 400; color: #A1A1A6; }
.version-item:hover, .version-item:focus-visible { background: var(--soft); outline: none; }
.version-item.current { background: var(--soft); }
.budget { display: grid; grid-template-columns: minmax(0, 560px); justify-content: center; gap: 18px; align-items: start; }
.budget[hidden] { display: none; }
.b-side { position: sticky; top: calc(var(--head-h, 60px) + var(--page-gap)); }
.b-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.b-head { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.b-head h2 { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.01em; margin-right: auto; }
.b-kind { font-size: 0.72rem; color: var(--muted); white-space: nowrap; margin-right: 4px; }
.b-sec { font-size: 0.72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin: 12px 0 2px; }
.b-row { display: flex; align-items: center; gap: 4px; min-height: 30px; border-bottom: 1px solid var(--soft); }
.b-row { position: relative; }
.b-row:hover { background: #FAFAFC; }
.b-row .grip { left: -13px; }
.b-row:hover .grip { opacity: .75; }
.b-row.drag-row { opacity: .4; }
.b-in { border: 0; background: transparent; font: inherit; font-size: 0.85rem; color: var(--text); padding: 3px 5px; border-radius: 6px; min-width: 0; outline: 0; }
.b-in:hover { background: var(--soft); }
.b-in:focus { background: #fff; box-shadow: 0 0 0 2px var(--accent); }
.b-in::placeholder { color: #B9B9BE; }
.b-in.bad:focus { box-shadow: 0 0 0 2px var(--error); }
.b-name { flex: 1 1 auto; }
.b-title { flex: 1 1 auto; font-size: 1rem; font-weight: 700; }
.b-num { width: 84px; flex: 0 0 auto; text-align: right; font-variant-numeric: tabular-nums; }
.b-num.small { width: 46px; }
.b-version-tag { flex: 0 0 auto; padding: 3px 5px; color: #A1A1A6; font-size: 0.72rem; font-weight: 400; }
.b-version-row { cursor: pointer; }
button.b-version-name { border: 0; background: none; font: inherit; font-size: 0.85rem; color: inherit; text-align: left; cursor: pointer; }
.b-version-row:hover .b-version-name { color: var(--accent); text-decoration: underline; }
.b-version-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 3px 5px; font-size: 0.85rem; }
.b-num.mid { width: 72px; }
.b-out.mid { width: 68px; }
.b-out { flex: 0 0 auto; width: 84px; padding: 3px 5px; font-size: 0.85rem; text-align: right; font-variant-numeric: tabular-nums; }
@media (hover: none) { .b-x, .b-plus, .b-note-btn { opacity: 1 !important; } }
.b-x { flex: 0 0 auto; width: 22px; height: 22px; border: 0; border-radius: 6px; background: none; color: var(--muted); padding: 0; cursor: pointer; opacity: 0; }
.b-row:hover .b-x, .b-head:hover .b-x, .b-x:focus { opacity: 1; }
.b-x:hover { background: rgba(208,70,59,0.1); color: var(--error); }
.b-x svg { display: block; width: 14px; height: 14px; margin: auto; }
.b-add { display: inline-block; border: 0; background: none; padding: 6px 5px; font-size: 0.8rem; font-weight: 500; color: var(--accent-hover); cursor: pointer; }
.b-add:hover { text-decoration: underline; }
.b-cols { display: flex; align-items: center; gap: 4px; font-size: 0.72rem; font-weight: 600; color: var(--muted); padding-bottom: 2px; border-bottom: 1px solid var(--line); }
.b-cols span { text-align: right; padding-right: 5px; box-sizing: border-box; white-space: nowrap; }
.b-cols span:first-child { flex: 1 1 auto; padding-left: 5px; text-align: left; }
.b-sum { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 30px; font-size: 0.85rem; padding: 0 5px; font-variant-numeric: tabular-nums; }
.b-sum.total { font-weight: 700; border-top: 1px solid var(--line); margin-top: 2px; }
.b-sum .b-lbl { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); }
.b-result { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; padding: 8px 5px; border-radius: 10px; background: var(--soft); font-size: 0.85rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.b-result small { display: block; font-weight: 400; font-size: 0.72rem; color: var(--muted); }
.b-rest { display: flex; justify-content: space-between; margin-top: 12px; padding: 10px 5px; border-radius: 10px; background: var(--accent-tint); color: var(--accent-hover); font-weight: 700; font-variant-numeric: tabular-nums; }
.b-rest.neg { background: rgba(208,70,59,0.1); color: var(--error); }
.b-tools { grid-column: 1 / -1; display: flex; justify-content: flex-end; margin-bottom: -12px; }
.b-tools .b-add { padding: 0 5px; }
.b-adds { display: flex; flex-wrap: wrap; gap: 6px; }
.b-chev { flex: 0 0 auto; width: 20px; height: 22px; border: 0; background: none; color: var(--muted); font-size: 0.7rem; cursor: pointer; transition: transform .15s; transform: rotate(90deg); }
.closed > .b-head .b-chev, .closed > .b-row .b-chev { transform: none; }
.b-chev-space { flex: 0 0 20px; }
.b-note-btn { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; opacity: 0; }
.b-note-btn svg { width: 14px; height: 14px; }
.b-row:hover .b-note-btn, .b-note-btn:focus { opacity: 1; }
.b-note-btn:hover { background: var(--soft); color: var(--text); }
.b-note-mark { position: relative; flex: 1 1 auto; min-width: 0; display: flex; }
.b-note-mark .b-name { width: 100%; }
.b-note-mark::after { content: ''; position: absolute; top: 0; right: 0; border-style: solid; border-width: 0 7px 7px 0; border-color: transparent var(--ochre) transparent transparent; pointer-events: none; }
.b-plus { flex: 0 0 auto; width: 22px; height: 22px; border: 0; border-radius: 6px; background: none; color: var(--accent-hover); font-size: 1rem; line-height: 1; cursor: pointer; opacity: 0; }
.b-row:hover .b-plus, .b-plus:focus { opacity: 1; }
.b-plus:hover { background: var(--accent-tint); }
.b-slot-amount { flex: 0 0 72px; text-align: right; }
.b-share { flex: 0 0 auto; width: 46px; display: inline-flex; align-items: center; font-size: 0.78rem; color: var(--muted); }
.b-share .b-num.small { width: 34px; padding: 3px 2px; }
.b-end { height: 4px; }
.closed > .b-head { margin-bottom: 0; }
.b-body[hidden] { display: none; }
.b-node.group > .b-row, .b-node.group > .b-row .b-name { font-weight: 600; }
.b-node > .b-body { margin-left: 9px; padding-left: 8px; border-left: 2px solid var(--soft); margin-bottom: 4px; }
.b-sign.minus { color: var(--error); font-weight: 700; }
.b-sign:not(.minus) { color: var(--accent-hover); font-weight: 700; }
.b-sign-space { flex: 0 0 22px; }
.b-sign { flex: 0 0 auto; width: 22px; height: 22px; border: 0; border-radius: 6px; background: var(--soft); color: var(--muted); font-size: 0.8rem; cursor: pointer; }
.b-note { display: block; width: 100%; margin-top: 8px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; font-size: 0.82rem; line-height: 1.4; color: var(--text); resize: none; overflow: hidden; outline: 0; }
.b-note:focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.b-note::placeholder { color: #B9B9BE; }
@media (max-width: 1400px) { header.top { grid-template-columns: auto minmax(0, 1fr) auto; } .tabs { justify-self: center; } .head-left { min-width: 0; overflow: hidden; } .head-left > :not(.logo) { display: none; } }
@media (max-width: 760px) { header.top .tabs button { padding: 6px 7px; font-size: 0.72rem; } }
@media (max-width: 520px) {
  header.top { display: flex; flex-wrap: wrap; justify-content: space-between; padding: 8px 12px; gap: 6px; }
  header.top .tabs { order: -1; width: 100%; grid-auto-columns: auto; justify-self: stretch; }
  header.top .tabs button { padding: 6px 2px; font-size: 0.68rem; white-space: nowrap; }
  section .a-table { font-size: 0.72rem; }
  section .a-table th, section .a-table td { padding: 0 2px; }
  section .a-table th { font-size: 0.64rem; }
}
.amort { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; max-width: 980px; margin: 0 auto; }
.amort[hidden] { display: none; }
.a-inputs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 10px 0 18px; }
.a-inputs label { display: block; padding: 9px 11px; border-radius: 10px; background: var(--soft); font-size: 0.72rem; color: var(--muted); cursor: text; transition: box-shadow .15s; }
.a-inputs label:hover { box-shadow: 0 0 0 1px #C7C7CC; }
.a-inputs label:focus-within { background: #fff; box-shadow: 0 0 0 2px var(--accent); }
.a-inputs input { display: block; width: 100%; padding: 0; border: 0; background: transparent; font: inherit; font-size: 1rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; outline: 0; }
.a-inputs input.bad { color: var(--error); }
.a-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.a-facts.a-five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.a-fact { padding: 9px 11px; border-radius: 10px; background: var(--soft); }
.a-fact span { display: block; font-size: 0.72rem; color: var(--muted); }
.a-fact small { display: block; margin-top: 2px; font-size: 0.72rem; line-height: 1.3; color: var(--muted); }
.a-fact b { display: block; font-size: 1rem; font-variant-numeric: tabular-nums; }
.a-battery-row { display: flex; align-items: center; gap: 9px; margin-top: 6px; }
.a-battery { position: relative; flex: 1; min-width: 0; height: 15px; margin-right: 3px; padding: 2px; border: 1.5px solid #AEAEB2; border-radius: 5px; background: #fff; }
.a-battery::after { content: ''; position: absolute; top: 50%; right: -5px; width: 3px; height: 7px; margin-top: -3.5px; border-radius: 0 2px 2px 0; background: #AEAEB2; }
.a-battery div { height: 100%; border-radius: 2px; background: var(--accent); }
.a-battery-row em { font-style: normal; font-size: 0.72rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.a-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.a-table th, .a-table td { height: 28px; line-height: 27px; padding: 0 6px; text-align: right; border-bottom: 1px solid var(--soft); overflow: visible; position: static; }
.a-table th { position: static; top: auto; font-size: 0.72rem; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); background: none; }
.a-table th:first-child, .a-table td:first-child { text-align: left; }
.a-table tfoot td { font-weight: 700; border-top: 1px solid var(--line); border-bottom: 0; }
.a-now td { background: var(--accent-tint); font-weight: 600; }
@media (max-width: 760px) {
  .a-inputs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .a-facts, .a-facts.a-five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.d-letter { padding: 34px 40px; border-radius: var(--radius); background: #FBF6EC; box-shadow: var(--shadow); font-family: Georgia, 'Times New Roman', serif; font-size: 1.05rem; line-height: 1.7; color: #3A332A; }
.d-letter p { max-width: 640px; margin: 0 auto 1em; white-space: pre-wrap; }
.d-letter p:first-child { font-size: 1.35rem; }
.d-letter p:last-child { margin-bottom: 0; font-style: italic; }
@media (max-width: 760px) { .d-letter { padding: 22px 20px; font-size: 1rem; } }
.a-facts.d-three { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 0; }
.d-three .a-fact b { font-size: 1.25rem; }
.d-month-hint { margin-top: 8px; font-size: 0.75rem; color: var(--muted); }
.d-good b { color: var(--accent-hover); }
.d-bad b { color: var(--error); }
.d-item-line { display: grid; grid-template-columns: minmax(0, 1fr) 120px 70px 70px 96px; gap: 8px; align-items: baseline; padding: 7px 4px; font-size: 0.88rem; font-variant-numeric: tabular-nums; border-bottom: 1px solid var(--soft); }
.d-item-line > :nth-child(n+2) { text-align: right; }
.d-item-to { color: var(--muted); font-size: 0.8rem; }
.d-item-head { padding-top: 0; font-size: 0.72rem; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); }
.d-item-head b { font-weight: 600; }
.d-item-group { margin-top: 6px; font-weight: 700; background: var(--soft); border-radius: 7px; border-bottom: 0; }
.d-contact { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 8px; padding: 7px 4px; font-size: 0.88rem; border-bottom: 1px solid var(--soft); }
.d-step { cursor: pointer; font-size: 0.88rem; flex-wrap: nowrap; align-items: baseline; }
.d-step input { accent-color: var(--accent); }
.d-switch { display: flex; flex-wrap: wrap; justify-content: center; justify-self: center; gap: 2px; padding: 3px; border-radius: 10px; background: rgba(120,120,128,0.12); }
.d-switch button { border: 0; background: none; border-radius: 8px; padding: 5px 13px; font-size: 0.82rem; font-weight: 500; color: var(--muted); cursor: pointer; }
.d-switch button.active { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,0.12); }
.d-switch button.d-home { background: var(--accent); color: #fff; font-weight: 600; }
.d-file { display: flex; justify-content: space-between; gap: 10px; padding: 7px 4px; font-size: 0.88rem; border-bottom: 1px solid var(--soft); }
.d-file a, .d-file-open { color: var(--accent-hover); font-weight: 600; }
.d-file-open { font-size: 0.8rem; }
.d-item-group small { margin-left: 8px; font-size: 0.78rem; font-weight: 400; color: var(--muted); }
.d-item-off, .d-item-off b { color: var(--muted); font-weight: 400; }
.d-item-total { font-weight: 700; border-bottom: 0; border-top: 1px solid var(--line); margin-top: -1px; }
.d-notes-off .d-item-note:not(.d-open) { display: none; }
.d-i { display: none; width: 16px; height: 16px; margin-left: 6px; padding: 0; border: 1px solid var(--muted); border-radius: 50%; background: none; color: var(--muted); font-size: 0.68rem; font-weight: 700; font-style: normal; line-height: 14px; text-align: center; vertical-align: 1px; cursor: pointer; }
.d-notes-off .d-i { display: inline-block; }
.d-notes-off .d-note-row { cursor: pointer; }
.d-notes-off .d-note-row:hover { background: var(--soft); }
.d-i:hover, .d-i[aria-expanded="true"] { border-color: var(--accent-hover); color: var(--accent-hover); }
.d-item-note { padding: 6px 8px 8px; font-size: 0.8rem; line-height: 1.45; color: #515154; white-space: pre-wrap; }
@media (max-width: 760px) {
  .d-item-line { grid-template-columns: minmax(0, 1fr) 96px 72px; }
  .d-item-line .d-item-to { display: none; }
  .d-contact { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .a-facts.d-three { grid-template-columns: minmax(0, 1fr); }
}
.d-row { padding: 8px 0; border-bottom: 1px solid var(--soft); }
.d-row, .d-item { position: relative; }
.d-row .grip, .d-item .grip { left: -13px; top: 18px; }
.d-item:hover .grip, .d-row:hover .grip { opacity: .75; }
.d-item.drag-row, .d-row.drag-row { opacity: .4; }
.d-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.d-line .b-name { flex: 1 1 180px; font-weight: 600; }
.d-plan { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; }
.d-plan .d-num { width: 80px; text-align: right; background: #FFF6BF; font-weight: 600; }
.d-line .d-num { width: 92px; flex: 0 0 auto; text-align: right; font-variant-numeric: tabular-nums; background: #FFF6BF; }
.d-line .d-num[hidden], .d-line .d-month[hidden] { display: none; }
.d-currency { flex: 0 0 auto; height: 30px; padding: 0 4px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font: inherit; font-size: 0.8rem; color: inherit; cursor: pointer; }
.d-line .d-month { width: 68px; flex: 0 0 auto; text-align: right; font-size: 0.78rem; background: var(--soft); }
.d-line .d-text { flex: 1 1 200px; }
.d-count { display: inline-flex; align-items: center; gap: 4px; font-size: 0.75rem; color: var(--muted); white-space: nowrap; cursor: pointer; }
.d-count input { accent-color: var(--accent); }
.d-off .b-name, .d-off .d-num { text-decoration: line-through; color: var(--muted); }
.d-row .b-x { opacity: 0; }
.d-row:hover .b-x, .d-row .b-x:focus { opacity: 1; }
.d-row .b-note { margin-top: 5px; border-color: transparent; background: var(--soft); color: #515154; font-size: 0.78rem; padding: 6px 8px; }
.d-step-done .d-text { text-decoration: line-through; color: var(--muted); }
.a-table td.neg { color: var(--error); font-weight: 600; }
@media (hover: none) { .d-row .b-x { opacity: 1; } }
@media print {
  header.top, .b-add, .b-x, .grip, .d-switch, .d-i, .plan-tool, .col-resize { display: none !important; }
  .wrap { padding: 0; max-width: none; }
  .b-card { box-shadow: none; border: 1px solid var(--line); break-inside: avoid-page; }
  .a-table tr { break-inside: avoid; }
}
.b-new { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border: 2px dashed var(--line); border-radius: var(--radius); padding: 16px 18px; font-size: 0.85rem; color: var(--muted); }
@media (max-width: 1120px) {
  .budget { grid-template-columns: minmax(0, 1fr); }
  .b-side { position: static; }
}
.btn { border: 0; background: var(--soft); border-radius: 9px; padding: 6px 13px; font-size: 0.82rem; font-weight: 500; cursor: pointer; transition: background .15s; }
.btn:hover:not(:disabled) { background: #E8E8ED; }
.btn[hidden] { display: none; }
.btn:disabled { color: #B9B9BE; cursor: default; }
.btn.check-on { background: #F1E9F7; color: #7030A0; font-weight: 600; }
.btn.check-on:hover:not(:disabled) { background: #E8DCF2; }
.btn.go { background: var(--accent); color: #fff; font-weight: 600; }
.btn.go:hover:not(:disabled) { background: var(--accent-hover); }
.btn.danger { background: var(--error); color: #fff; font-weight: 600; }
.btn.danger:hover:not(:disabled) { background: #B53A30; }

.grid-wrap { position: relative; }
.plan-tool { position: absolute; left: 2px; top: 50%; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-top: -10px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--muted); cursor: pointer; }
.plan-tool svg { width: 13px; height: 13px; }
.plan-tool[hidden] { display: none; }
.plan-tool:hover { color: var(--text); background: var(--soft); }
.plan-tool.danger:hover { color: var(--error); }
.plan-tool.check.on, .plan-tool.check.on:hover { background: #EFE4F7; color: #7030A0; }
.plan-tool.off.on, .plan-tool.off.on:hover { background: #E5E5EA; color: var(--text); }
.row-tools { position: absolute; right: 4px; top: 50%; z-index: 1; display: flex; gap: 3px; margin-top: -10px; }
.row-tools .plan-tool { position: static; margin: 0; }
body.dragging .plan-tool { display: none; }
@media (hover: hover) { #btn-note, #btn-del, #btn-check, #btn-off { display: none; } }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
th, td { height: 30px; line-height: 29px; padding: 0 8px; text-align: right; white-space: nowrap; overflow: hidden; border-bottom: 1px solid var(--soft); position: relative; scroll-margin-top: calc(var(--sticky-h, 110px) + var(--page-gap) + 36px); }
thead th { position: sticky; top: calc(var(--sticky-h, 110px) + var(--page-gap)); z-index: 3; background: #fff; font-size: 0.75rem; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); }
th.first, .cell.first { background: #fff; text-align: left; padding-left: 20px; box-shadow: 1px 0 0 var(--line); text-overflow: ellipsis; }
/* Schrift im Plan bleibt immer gleich gross, egal wie breit das Fenster ist */
.plan-opts { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 0 auto 0 8px; }
.plan-opts .budget-check { margin: 0; }
.plan-search { width: 180px; height: 30px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font: inherit; font-size: 0.82rem; }
.plan-search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,0,0,.04); }
.card-head #btn-fold-all { margin-left: 8px; }
.card-head #btn-fold-all[hidden] { display: none; }
.budget-check input:disabled { cursor: default; opacity: .5; }
.cat-row .cell { background: var(--soft); font-weight: 600; }
.cat-row .cell.first { background: var(--soft); font-weight: 700; }
.cat-row.drop-into .cell { background: #EEF7E6; box-shadow: inset 0 0 0 1px var(--accent); }
.cat-chev { display: inline-block; width: 14px; color: var(--muted); cursor: pointer; }
tr.in-cat .cell.first { padding-left: 34px; }
.cell.plus { color: #4B8A1F; }
.plan-total .cell { font-weight: 700; border-top: 1px solid var(--line); }
.plan-extra { padding: 8px 20px 4px; }
.plan-extra[hidden] { display: none; }
.plan-actions { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 6px; }
.plan-note { display: block; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 0.85rem; resize: vertical; }
.plan-tool.on { background: #EEF7E6; color: #4B8A1F; }
.plan-tool.sign { font-size: 12px; line-height: 1; }
#grid { font-size: 0.66rem; }
#grid thead th { font-size: 0.66rem; }
#grid .cell.pct { font-size: 0.6rem; }
#grid .cell.err { font-size: 0.66rem; }
#grid th.first { font-size: 0.75rem; }
#grid .cell.first { font-size: 0.82rem; }
.col-resize { position: absolute; top: 0; right: 0; bottom: 0; width: 9px; cursor: col-resize; touch-action: none; }
.col-resize:hover, body.col-resizing .col-resize { background: linear-gradient(to left, var(--accent) 2px, transparent 2px); }
body.col-resizing, body.col-resizing * { cursor: col-resize !important; user-select: none; -webkit-user-select: none; }
.cell.years { text-align: center; color: var(--muted); }
.cell.edit { cursor: cell; }
.cell.edit:hover { box-shadow: inset 0 0 0 1px #C7C7CC; }
.cell.first.edit:hover { box-shadow: inset 0 0 0 1px #C7C7CC, 1px 0 0 var(--line); }
.cell.sel, .cell.sel:hover { box-shadow: inset 0 0 0 2px var(--accent) !important; }
.grip { position: absolute; left: 3px; top: 50%; width: 10px; height: 16px; margin-top: -8px; cursor: grab; touch-action: none; opacity: .3; background-image: radial-gradient(circle, currentColor 1.1px, transparent 1.2px); background-size: 5px 5.3px; transition: opacity .12s; }
tr:hover .grip { opacity: .75; }
body.dragging, body.dragging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
tr.drag-row td { background: var(--soft) !important; opacity: .55; }
#drop-line { position: absolute; z-index: 5; height: 3px; margin-top: -1.5px; background: var(--accent); border-radius: 2px; pointer-events: none; }
.cell.total { font-weight: 600; background: var(--soft); }
.cell.pct { color: var(--muted); font-size: 0.75rem; }
.cell.neg { color: var(--error); }
.cell.err { color: var(--error); font-weight: 600; font-size: 0.72rem; }
.cell.mark-y { background: #FFF6BF; }
/* Jahr von Hand auf 0 gesetzt: ganz leicht schraffiert, auch das % daneben */
.cell.zeroed, tr.check .cell.zeroed { background-image: repeating-linear-gradient(135deg, rgba(0,0,0,0.07) 0 1px, transparent 1px 6px); color: #B9B9BE; }
/* Jahre: Abweichungen von 100% fallen auf, 100% tritt zurück */
.cell.pct-full { color: #C7C7CC; }
.cell.pct-high, tr.check .cell.pct-high { background: rgba(248,105,107,0.42); color: var(--text) !important; font-weight: 600; }
.cell.pct-low, tr.check .cell.pct-low { background: rgba(99,190,123,0.42); color: var(--text) !important; font-weight: 600; }
/* Zeile unter der Maus und Zeile der aktiven Zelle: grüner Schleier über allen Farben */
tbody tr:hover .cell, tbody tr:has(.cell.sel) .cell { background-image: linear-gradient(rgba(101,179,46,0.16), rgba(101,179,46,0.16)) !important; }
tbody tr:hover .cell.zeroed, tbody tr:has(.cell.sel) .cell.zeroed { background-image: repeating-linear-gradient(135deg, rgba(0,0,0,0.07) 0 1px, transparent 1px 6px), linear-gradient(rgba(101,179,46,0.16), rgba(101,179,46,0.16)) !important; }
/* Inaktive Zeile: blass und durchgestrichen, ohne Farben */
tr.off .cell { color: #B9B9BE !important; font-weight: 400 !important; }
tr.off .cell:not(.total) { background-color: transparent !important; }
tr.off .cell.total { color: #A1A1A6 !important; }
tr.off .cell.first { background-color: #fff !important; text-decoration: line-through; }
tbody tr.picked .cell { background-image: linear-gradient(rgba(101,179,46,0.28), rgba(101,179,46,0.28)) !important; }
tbody tr.picked .cell.zeroed { background-image: repeating-linear-gradient(135deg, rgba(0,0,0,0.07) 0 1px, transparent 1px 6px), linear-gradient(rgba(101,179,46,0.28), rgba(101,179,46,0.28)) !important; }
tfoot td { font-weight: 700; border-top: 1px solid var(--line); border-bottom: 0; }
tr.check .cell { background: #EFE4F7; }
tr.check .cell:not(.err):not(.neg) { color: #7030A0; }
tr.check .cell.mark-y { background: #FFF6BF; }
.cell.note::after { content: ''; position: absolute; top: 0; right: 0; border-style: solid; border-width: 0 7px 7px 0; border-color: transparent var(--ochre) transparent transparent; }

#editor { position: absolute; z-index: 6; height: 30px; padding: 0 7px; border: 2px solid var(--accent); border-radius: 3px; outline: 0; font: inherit; font-size: 0.82rem; background: #fff; box-shadow: 0 3px 12px rgba(0,0,0,0.16); font-variant-numeric: tabular-nums; }
.foot { padding: 12px 20px 8px; font-size: 0.78rem; color: var(--muted); }
.foot span { display: inline-block; margin-right: 14px; }
.foot i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }

dialog { margin: auto; border: 0; border-radius: var(--radius); padding: 22px; width: min(440px, calc(100vw - 32px)); box-shadow: 0 16px 50px rgba(0,0,0,0.25); color: var(--text); }
dialog::backdrop { background: rgba(0,0,0,0.3); }
dialog h3 { font-size: 1.05rem; margin-bottom: 6px; }
dialog p { font-size: 0.88rem; color: var(--muted); margin-bottom: 12px; overflow-wrap: anywhere; }
dialog textarea { width: 100%; min-height: 96px; padding: 9px 11px; border: 1px solid #D2D2D7; border-radius: 10px; font: inherit; font-size: 0.9rem; margin-bottom: 14px; resize: vertical; }
dialog textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Jede Zeile gleich hoch und einzeilig; wird es eng, zuerst Schrift und Abstände kleiner */
@media (max-width: 1340px) {
  .kpi { padding: 14px 14px; }
  .kpi .val { font-size: 1.3rem; }
  table { font-size: 0.74rem; }
  th, td { padding-left: 4px; padding-right: 4px; }
  .cell.pct { font-size: 0.68rem; }
}
@media (max-width: 1120px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  table { font-size: 0.66rem; }
  thead th { font-size: 0.66rem; }
  th, td { padding-left: 1px; padding-right: 1px; }
  th.first, .cell.first { padding-left: 17px; padding-right: 6px; }
  .cell.pct { font-size: 0.6rem; }
}
/* Monate und Jahre zusammen: volle Fensterbreite */
body.combined .wrap, body.wide-page .wrap { max-width: none; }
body.combined table th, body.combined table td { padding-left: 3px; padding-right: 3px; }
body.combined th.first, body.combined .cell.first { padding-left: 20px; padding-right: 8px; }
body.combined thead th, body.combined .cell.pct { font-size: 0.92em; }
body.combined .block-start { box-shadow: inset 2px 0 0 var(--line); padding-left: 6px; }
.grid-wrap.scrollx { overflow-x: auto; }
.scrollx table { table-layout: fixed; width: var(--tw); font-size: 0.78rem; }
.scrollx thead th { top: 0; transform: translateY(var(--th-shift, 0)); }
.scrollx th, .scrollx td { scroll-margin-left: 150px; }
.scrollx th.first, .scrollx .cell.first { position: sticky; left: 0; z-index: 2; text-overflow: ellipsis; }
.scrollx thead th.first { z-index: 4; }
@media (max-width: 900px) {
  header.top { grid-template-columns: auto 1fr; padding: 10px 16px; }
  .logo { font-size: 0; }
  .logo span { display: none; }
  .logo svg { margin: 0; }
  .app-title { display: none; }
  .tabs { justify-self: end; }
  .tabs button { padding: 6px 8px; font-size: 0.8rem; }
  .head-right { grid-column: 1 / -1; justify-self: stretch; justify-content: space-between; }
  :root { --page-gap: 14px; }
  .wrap { padding: var(--page-gap) 16px 32px; }
  .kpis { position: static; grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 12px 14px; }
  .kpi .val { font-size: 1.25rem; }
  .card-head { padding: 18px 14px 12px; }
}

/* Logo auf der Anmeldung immer ganz, auch auf schmalen Bildschirmen */
.logo.login-logo { font-size: 1.45rem; }
.logo.login-logo span { display: inline; }
.logo.login-logo svg { width: 36px; height: 36px; margin: -2px 6px 0 0; }

/* Startseite nach der Anmeldung */
.home { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; max-width: 1100px; margin: 8vh auto 0; }
.home[hidden] { display: none; }
.home-tile { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 42px 20px; border: 0; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); font-size: 1.05rem; font-weight: 600; color: var(--text); cursor: pointer; transition: box-shadow .15s, transform .15s; }
.home-tile svg { width: 40px; height: 40px; color: var(--accent); }
.home-tile:hover { box-shadow: 0 8px 26px rgba(29,29,31,0.1), 0 0 0 1px var(--accent); transform: translateY(-1px); }
.tabs[hidden] { display: none; }
.app-title:empty { display: none; }
@media (max-width: 900px) { .home { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .home { grid-template-columns: minmax(0, 1fr); margin-top: 16px; } .home-tile { flex-direction: row; justify-content: center; padding: 24px 20px; } }

/* Kopf bleibt beim Wechseln ruhig: gleiche Höhe mit und ohne Reiter, gleiche Breite der Reiter, Platz für die Bildlaufleiste */
html { scrollbar-gutter: stable; }
header.top { min-height: 69px; }
.head-right { grid-column: 3; justify-self: end; }
.tabs button, .tabs button.active { font-weight: 600; }

/* Aufrunden und Anteil: Felder genau untereinander */
.kpi.pay .hint { display: grid; grid-template-columns: 88px 54px auto; align-items: center; gap: 0 2px; margin-top: 2px; }

/* Hypothek eingeklappt: nur noch die Kacheln */
#amort .closed .a-table, #amort .closed .b-note { display: none; }
#amort .closed .a-facts { margin-bottom: 0; }

/* Erinnerungen: Datum neben dem Namen, Fenster beim Anmelden */
.remind-tag { margin-left: 6px; padding: 0 5px; border-radius: 4px; font-size: 0.62rem; font-weight: 600; color: var(--muted); background: var(--soft); }
.remind-tag.due { color: #fff; background: var(--error); }
.plan-tool.remind.on { color: var(--accent); }
#remind-dlg { width: min(520px, calc(100vw - 32px)); }
#remind-list { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; margin-bottom: 14px; overflow-y: auto; }
.remind-item { padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.remind-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.remind-date { font-size: 0.78rem; font-weight: 600; color: var(--accent); }
.remind-date.late { color: var(--error); }
.remind-version { font-size: 0.78rem; color: var(--muted); }
#remind-dlg p.remind-note { margin: 6px 0 0; color: var(--text); white-space: pre-wrap; }

/* Tod: Aufteilung Anja/Amia und Erbe pro Eintrag */
.d-split { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 6px 0 0 18px; font-size: 0.75rem; color: var(--muted); }
.d-split-who { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.d-split .d-pct { width: 52px; text-align: right; font-size: 0.78rem; background: #FFF6BF; }
.d-split .d-pct.bad { outline: 2px solid var(--error); }
.d-estate-hint { margin: 0 4px 16px; }
.d-shares td:not(:first-child), .d-shares th:not(:first-child) { text-align: right; }
.d-split-rest.bad { color: var(--error); font-weight: 600; }

/* ===== Look 10.11.2026: weicher, luftiger; nur Aussehen, keine Funktion ===== */
:root { --bg: #F2F2F5; --radius: 20px; --shadow: 0 1px 2px rgba(0,0,0,0.03), 0 8px 24px rgba(0,0,0,0.045); }
header.top { background: rgba(255,255,255,0.86); -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px); border-bottom: 0; box-shadow: 0 1px 0 rgba(0,0,0,0.06); }
.app-title { border-left-color: var(--line); }
/* Reiter als Pillen, der aktive dunkel */
.tabs, .d-switch { background: rgba(120,120,128,0.09); border-radius: 999px; padding: 4px; gap: 2px; }
.tabs button, .d-switch button { border-radius: 999px; transition: background .15s, color .15s; }
.tabs button:hover:not(.active), .d-switch button:hover:not(.active) { color: var(--text); background: rgba(0,0,0,0.04); }
.tabs button.active, .d-switch button.active { background: var(--text); color: #fff; box-shadow: none; }
/* Kacheln: ohne Rahmen, grosse ruhige Zahlen; Saldo-Kachel farbig hinterlegt */
.kpi { padding: 18px 22px; }
.kpi .val { font-weight: 600; letter-spacing: -0.03em; }
.kpi.pay { background: #EEF6E7; }
.kpi.pay.cost { background: #FBECEA; }
.kpi.pay .lbl { color: var(--accent-hover); }
.kpi.pay.cost .lbl { color: var(--error); }
.a-fact { padding: 12px 14px; border-radius: 14px; }
.a-fact b { font-size: 1.3rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; }
.a-fact.d-good { background: #EEF6E7; }
.a-fact.d-good span { color: var(--accent-hover); }
.a-fact.d-bad { background: #FBECEA; }
.a-fact.d-bad span { color: var(--error); }
.b-card { padding: 20px 22px; }
.b-head h2, .card-head h2 { font-weight: 650; letter-spacing: -0.02em; }
/* Tabellen: feinere Linien, Zeile unter der Maus leicht hinterlegt */
.a-table th { border-bottom-color: var(--soft); font-weight: 500; }
.a-table tbody tr:hover td { background: #FAFAFC; }
.a-table tfoot td { border-top-color: var(--line); font-weight: 650; }
/* Knöpfe, Felder, Fenster runder */
.btn { border-radius: 999px; padding: 7px 15px; }
.icon-btn { border-radius: 999px; }
.version-pick { border-radius: 999px; padding-left: 14px; }
.version-menu { border-radius: 14px; border-color: var(--line); }
dialog { border-radius: 22px; }
.login-card { border-radius: 24px; }
/* Aufteilung: Person mit Initiale, Anteil am Erbe als Balken */
.d-avatar { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin-right: 8px; border-radius: 50%; font-size: 0.7rem; font-weight: 600; vertical-align: middle; }
.d-bar { display: inline-block; width: 46px; height: 4px; margin-left: 8px; border-radius: 2px; background: var(--line); vertical-align: middle; overflow: hidden; }
.d-bar i { display: block; height: 100%; border-radius: 2px; }
/* Eingaben im Reiter Tod: jede Zeile als leichte Karte, Felder ohne Gelb, Schalter statt Häkchen, Anteile als Pillen */
#death .d-row { margin-bottom: 8px; padding: 12px 14px 10px 26px; border: 1px solid var(--line); border-radius: 16px; background: #fff; transition: border-color .15s, box-shadow .15s; }
#death .d-row:hover { border-color: #D6D6DB; box-shadow: 0 2px 10px rgba(0,0,0,0.04); }
#death .d-row .grip { left: 8px; top: 20px; }
#death .d-line { gap: 8px; }
#death .d-line .b-in { height: 34px; border-radius: 10px; }
#death .d-line .b-name { font-size: 0.95rem; font-weight: 600; }
#death .d-line .d-num, #death .d-line .d-month, #death .d-currency { height: 34px; border: 0; border-radius: 10px; background: var(--soft); font-weight: 600; }
#death .d-line .d-month { font-weight: 500; }
#death .d-line .d-num:focus, #death .d-line .d-month:focus { background: #fff; }
#death .d-currency { padding: 0 8px; }
#death .d-off .b-name { text-decoration: none; }
#death .d-off .d-num { text-decoration: none; color: var(--muted); }
/* Häkchen als Schalter */
#death .d-count input { appearance: none; -webkit-appearance: none; position: relative; flex: 0 0 auto; width: 30px; height: 18px; margin: 0; border-radius: 999px; background: #D1D1D6; cursor: pointer; transition: background .15s; }
#death .d-count input::before { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.2); transition: transform .15s; }
#death .d-count input:checked { background: var(--accent); }
#death .d-count input:checked::before { transform: translateX(12px); }
#death .d-count input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#death .d-count { gap: 7px; font-size: 0.78rem; }
/* Anteile pro Person als Pillen, Hinweis als Marke */
#death .d-split { margin: 10px 0 0; gap: 6px; }
#death .d-split-who { gap: 6px; padding: 3px 4px 3px 11px; border-radius: 999px; background: var(--soft); color: var(--text); font-size: 0.78rem; font-weight: 500; }
#death .d-split .d-pct { width: 48px; height: 24px; padding: 0 6px; border-radius: 999px; background: #fff; font-weight: 600; }
#death .d-split-rest { padding: 3px 10px; border-radius: 999px; background: #FAF1DA; color: #8A6A0B; font-size: 0.75rem; font-weight: 500; }
#death .d-split-rest:empty { display: none; }
#death .d-split-rest.bad { background: #FBECEA; color: var(--error); }
#death .d-split .d-count { margin-left: auto; }
/* Notiz: ruhig, ohne graue Box; Rahmen erst beim Schreiben */
#death .d-row .b-note { margin-top: 10px; padding: 8px 0 2px; border: 0; border-top: 1px solid var(--soft); border-radius: 0; background: transparent; color: #515154; font-size: 0.82rem; }
#death .d-row .b-note:focus { box-shadow: none; border-top-color: var(--accent); }
.d-filter { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 4px 0; }
.d-filter-lbl { font-size: 0.82rem; color: var(--muted); }
/* Ruhiger und ausgerichtet: grössere Felder mit festen Breiten, Schalter beider Zeilen in derselben Spalte */
#death .d-line, #death .d-split { gap: 10px; }
#death .d-line .b-in, #death .d-line .d-num, #death .d-line .d-month, #death .d-currency { height: 40px; font-size: 0.9rem; border-radius: 12px; }
#death .d-line .b-name { flex: 1 1 200px; padding: 0 10px; }
#death .d-line .d-text { flex: 1 1 180px; padding: 0 12px; }
#death .d-line .d-num { width: 140px; padding: 0 14px; }
#death .d-line .d-month { width: 104px; padding: 0 14px; text-align: center; }
#death .d-currency { width: 84px; }
#death .d-line .d-count, #death .d-split .d-count { flex: 0 0 190px; margin-left: 0; }
#death .d-line .b-x { width: 28px; height: 28px; }
#death .d-split { margin-top: 12px; padding-right: 38px; }
#death .d-split .d-count { margin-left: auto; }
/* Prozent: die Pille ist das Feld, ohne weisses Innenfeld */
#death .d-split-who { height: 36px; padding: 0 14px; gap: 4px; font-size: 0.85rem; cursor: text; transition: box-shadow .15s; }
#death .d-split-who:focus-within { box-shadow: 0 0 0 2px var(--accent); background: #fff; }
#death .d-split .d-pct, #death .d-split .d-pct:hover, #death .d-split .d-pct:focus { width: 38px; height: 30px; padding: 0 2px; border-radius: 0; background: transparent; box-shadow: none; font-size: 0.9rem; text-align: right; }
#death .d-split-rest { height: 28px; display: inline-flex; align-items: center; padding: 0 12px; font-size: 0.8rem; }   /* gelbe Marke bleibt: hilft beim Aufteilen */
#death .d-line .b-name { flex: 1 1 140px; }
#death .d-line .d-num { width: 128px; }
#death .d-line .d-month { width: 96px; }
#death .d-line .d-count, #death .d-split .d-count { flex-basis: 172px; }
#death .d-line .b-name { padding: 0 12px; margin-left: -12px; }   /* Text bündig mit Anteilen und Notiz */
/* Runden auf / Anteil in der Kachel oben rechts: helle Pillen statt gelber Kästchen */
.kpi-step { width: 64px; height: 26px; margin: 2px 2px 2px 0; padding: 0 10px; border: 0; border-radius: 999px; background: rgba(255,255,255,0.8); font-size: 0.82rem; font-weight: 600; text-align: right; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06); transition: box-shadow .15s, background .15s; }
.kpi-step:hover { background: #fff; }
.kpi-step:focus { background: #fff; border: 0; box-shadow: 0 0 0 2px var(--accent); }
.kpi.pay .hint { display: grid; grid-template-columns: 88px 64px auto; align-items: center; column-gap: 6px; }
