/* Family Savings Planner. Header top padding is owned by /responsive.css. */
:root {
  --pad-inline: clamp(0.75rem, 3vw, 2rem);
  --pad-block: clamp(1rem, 3vh, 2.5rem);
  --bg: #f5f6fa; --card: #ffffff; --raise: #fbfbfd; --line: #e7e9f0; --line-2: #eef0f5;
  --ink: #0f172a; --ink-2: #475569; --ink-3: #8a94a6;
  --brand: #4f46e5; --brand-2: #4338ca; --brand-soft: #eef0ff;
  --ok: #059669; --ok-soft: #e8f7f0; --warn: #b45309; --warn-soft: #fff5e6; --bad: #e11d48; --bad-soft: #fff0f3;
  --k-goal: #6366f1; --k-goal-soft: #eef0ff; --k-child: #db2777; --k-child-soft: #fdf0f7;
  --k-project: #d97706; --k-project-soft: #fff5e6; --k-loan: #0284c7; --k-loan-soft: #e9f6fd;
  --r: 16px; --r-sm: 10px;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 6px 24px -12px rgba(15,23,42,.12);
  --shadow-lg: 0 24px 64px -16px rgba(15,23,42,.35);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020; --card: #121a2c; --raise: #162036; --line: #222d45; --line-2: #1b2539;
    --ink: #e7ecf5; --ink-2: #aeb9cc; --ink-3: #7f8ba3;
    --brand: #8b93ff; --brand-2: #a5abff; --brand-soft: #1d2250;
    --ok: #34d399; --ok-soft: #0f2a22; --warn: #fbbf24; --warn-soft: #2a2210; --bad: #fb7185; --bad-soft: #2d1419;
    --k-goal: #8b93ff; --k-goal-soft: #1d2250; --k-child: #f472b6; --k-child-soft: #2c1426;
    --k-project: #fbbf24; --k-project-soft: #2a2210; --k-loan: #38bdf8; --k-loan-soft: #0c2536;
    --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 24px 64px -16px rgba(0,0,0,.7);
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: 'Plus Jakarta Sans', system-ui, sans-serif; line-height: 1.5; -webkit-font-smoothing: antialiased; }
/* body is a flex column in /responsive.css: without an explicit width the
   container shrinks to its content and every tab ends up a different width. */
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding-inline: var(--pad-inline); padding-bottom: var(--pad-block); }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 800; letter-spacing: -.025em; }
h2 { font-size: 1.05rem; font-weight: 750; }
h3 { font-size: .95rem; font-weight: 700; }
.num, .amount, .big { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); } .soft { color: var(--ink-2); } .small { font-size: .84rem; }
.page-head { margin: 1.1rem 0 1.1rem; display: grid; gap: .35rem; }
.subtitle { color: var(--ink-2); max-width: 68ch; margin: 0; font-size: .95rem; }
body.has-plan .page-head .subtitle { display: none; }
body.has-plan .page-head { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; }
body.has-plan .planner { margin-top: 1rem; }
.stack { display: grid; gap: 1rem; }
.cols { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }
.row { display: flex; gap: .6rem; align-items: center; } .wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); min-width: 0; }
.card-pad { padding: clamp(1rem, 2.2vw, 1.4rem); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: 1rem 1.25rem .5rem; flex-wrap: wrap; }
.card-head .sub { color: var(--ink-3); font-size: .82rem; font-weight: 500; }
.card-body { padding: 0 1.25rem 1.1rem; }
.card-foot { border-top: 1px solid var(--line-2); padding: .7rem 1.25rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.empty { text-align: center; padding: 2.5rem 1.25rem; display: grid; gap: .6rem; justify-items: center; }
.empty .ico-tile { width: 56px; height: 56px; border-radius: 16px; }
.notice { background: var(--warn-soft); color: var(--warn); border-radius: var(--r-sm); padding: .6rem .9rem; font-size: .88rem; font-weight: 600; }

/* App bar + navigation */
.app-bar { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .9rem; }
.plan-name { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.plan-name strong { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-switch { appearance: none; font: inherit; font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; color: var(--ink); background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238a94a6' stroke-width='2'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E") no-repeat right .2rem center; border: 0; padding: .1rem 1.6rem .1rem 0; max-width: 60vw; cursor: pointer; }
.bar-right { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: .35rem; font-size: .76rem; font-weight: 700; padding: .25rem .6rem; border-radius: 999px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.chip svg { width: 13px; height: 13px; }
.chip.ok { background: var(--ok-soft); color: var(--ok); } .chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); } .chip.brand { background: var(--brand-soft); color: var(--brand); }
.nav { display: flex; gap: .25rem; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: .3rem; margin-bottom: 1.1rem; box-shadow: var(--shadow); position: sticky; top: .5rem; z-index: 20; overflow-x: auto; scrollbar-width: none; }
.nav a { display: flex; align-items: center; gap: .45rem; padding: .55rem .85rem; border-radius: 10px; color: var(--ink-2); font-weight: 650; font-size: .9rem; white-space: nowrap; }
.nav a svg { width: 18px; height: 18px; }
.nav a:hover { background: var(--line-2); color: var(--ink); }
.nav a.active { background: var(--brand-soft); color: var(--brand); }
@media (max-width: 720px) {
  .nav { position: fixed; top: auto; bottom: 0; left: 0; right: 0; margin: 0; border-radius: 0; border-width: 1px 0 0; padding: .3rem .3rem calc(.3rem + env(safe-area-inset-bottom)); justify-content: space-around; }
  .nav a { flex-direction: column; gap: .15rem; font-size: .68rem; padding: .4rem .3rem; flex: 1; justify-content: center; }
  .nav a svg { width: 20px; height: 20px; }
  .nav a.nav-extra { display: none; }
  body.has-plan .container { padding-bottom: 5.5rem; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; font: inherit; font-weight: 700; font-size: .9rem; padding: .6rem 1rem; border-radius: 11px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; min-height: 40px; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn svg { width: 16px; height: 16px; }
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; } .btn.primary:hover { background: var(--brand-2); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); } .btn.ghost:hover { background: var(--line-2); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger-ghost { background: transparent; border-color: transparent; color: var(--bad); } .btn.danger-ghost:hover { background: var(--bad-soft); }
.btn.small { font-size: .82rem; padding: .35rem .7rem; min-height: 32px; border-radius: 9px; }
.btn.block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; border: 0; background: transparent; color: var(--ink-3); width: 34px; height: 34px; border-radius: 9px; cursor: pointer; }
.icon-btn:hover { background: var(--line-2); color: var(--ink); } .icon-btn svg { width: 18px; height: 18px; }
.file-btn { position: relative; overflow: hidden; } .file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.link { font-weight: 650; font-size: .88rem; display: inline-flex; align-items: center; gap: .25rem; }
.link svg { width: 15px; height: 15px; }
.back-link { display: inline-flex; align-items: center; gap: .3rem; color: var(--ink-2); font-weight: 650; font-size: .9rem; }
.back-link svg { width: 16px; height: 16px; }

/* Icons tiles + avatars */
.ico-tile { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; flex: none; background: var(--brand-soft); color: var(--brand); }
.ico-tile svg { width: 21px; height: 21px; }
.ico-tile.k-goal { background: var(--k-goal-soft); color: var(--k-goal); } .ico-tile.k-child { background: var(--k-child-soft); color: var(--k-child); }
.ico-tile.k-project { background: var(--k-project-soft); color: var(--k-project); } .ico-tile.k-loan { background: var(--k-loan-soft); color: var(--k-loan); }
.ico-tile.sm { width: 34px; height: 34px; border-radius: 10px; } .ico-tile.sm svg { width: 17px; height: 17px; }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; font-weight: 800; font-size: .85rem; color: #fff; flex: none; background: var(--brand); }
.avatar.a1 { background: #0ea5e9; } .avatar.a2 { background: #db2777; } .avatar.a3 { background: #059669; } .avatar.a4 { background: #d97706; }
.avatar.sm { width: 26px; height: 26px; font-size: .7rem; }

/* List rows */
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li + li { border-top: 1px solid var(--line-2); }
.r { display: flex; align-items: center; gap: .8rem; padding: .75rem 1.25rem; color: inherit; width: 100%; text-align: left; background: none; border: 0; font: inherit; }
button.r, a.r { cursor: pointer; } button.r:hover, a.r:hover { background: var(--raise); }
.r-main { flex: 1; min-width: 0; display: grid; gap: .1rem; }
.r-title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-meta { color: var(--ink-3); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-end { text-align: right; display: grid; gap: .1rem; justify-items: end; flex: none; }
.r-amt { font-weight: 750; font-variant-numeric: tabular-nums; }
.r-sub { color: var(--ink-3); font-size: .78rem; }
.r .chev { color: var(--ink-3); width: 16px; height: 16px; flex: none; }
.r.off { opacity: .5; } .r.off .r-title { text-decoration: line-through; }
.group-head { display: flex; justify-content: space-between; align-items: center; padding: .7rem 1.25rem .35rem; font-size: .75rem; font-weight: 750; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 1px; background: var(--line-2); border-top: 1px solid var(--line-2); }
.stat { background: var(--card); padding: .8rem 1.25rem; display: grid; gap: .1rem; }
.stat span { font-size: .74rem; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.stat strong { font-size: 1.08rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.bar { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; display: flex; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.bar.thin { height: 5px; }

/* Overview hero */
.hero { padding: 1.4rem 1.4rem 1.2rem; display: grid; gap: 1.1rem; background: linear-gradient(135deg, var(--brand-soft), var(--card) 60%); }
.hero-top { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: flex-end; }
.eyebrow { font-size: .78rem; font-weight: 750; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.big { font-size: clamp(2rem, 5vw, 2.8rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.people { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.person { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: .9rem 1rem; display: grid; gap: .55rem; }
.person-top { display: flex; align-items: center; gap: .65rem; }
.person-top .grow strong { display: block; font-size: .98rem; } .person-top .grow span { font-size: .8rem; color: var(--ink-3); }
.person-amt { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.person p { margin: 0; font-size: .86rem; color: var(--ink-2); }
.split-bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; gap: 2px; }
.split-bar i { display: block; height: 100%; }

/* Plan cards */
.item-grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.item-card { display: grid; gap: .8rem; padding: 1.05rem 1.1rem; color: inherit; transition: transform .15s, box-shadow .15s; }
.item-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.item-card .top { display: flex; gap: .75rem; align-items: center; }
.item-card .top strong { display: block; font-size: 1rem; line-height: 1.3; }
.item-card .top span { font-size: .78rem; color: var(--ink-3); font-weight: 600; }
.item-card .figure { display: flex; align-items: baseline; gap: .35rem; }
.item-card .figure b { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.item-card .figure small { color: var(--ink-3); font-weight: 600; }
.item-card .meta { font-size: .8rem; color: var(--ink-2); }
.kind-picker { display: grid; gap: .6rem; }
.kind-opt { display: flex; gap: .85rem; align-items: center; text-align: left; font: inherit; border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: .9rem 1rem; cursor: pointer; color: var(--ink); }
.kind-opt:hover { border-color: var(--brand); background: var(--raise); }
.kind-opt strong { display: block; } .kind-opt span { font-size: .82rem; color: var(--ink-2); }

/* Item header */
.item-head { display: flex; gap: .9rem; align-items: center; padding: 1.2rem 1.25rem 1rem; }
.item-head h2 { font-size: clamp(1.2rem, 2.4vw, 1.5rem); font-weight: 800; letter-spacing: -.02em; }
.item-head .kind { font-size: .78rem; font-weight: 700; color: var(--ink-3); }
.settings-list { display: grid; gap: .1rem; }
.setting { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; font-size: .9rem; }
.setting span { color: var(--ink-3); } .setting strong { font-weight: 650; text-align: right; }

/* Child timeline */
.timeline { position: relative; padding: .3rem 1.25rem 1rem; }
.stage { position: relative; padding-left: 1.9rem; }
.stage::before { content: ''; position: absolute; left: .55rem; top: 0; bottom: 0; width: 2px; background: var(--line); }
.stage:first-child::before { top: 1.3rem; } .stage:last-child::before { bottom: calc(100% - 1.3rem); }
.stage .dot { position: absolute; left: .17rem; top: 1rem; width: 14px; height: 14px; border-radius: 50%; background: var(--card); border: 2px solid var(--line); }
.stage.past .dot, .stage.done .dot { background: var(--ok); border-color: var(--ok); }
.stage.current .dot { background: var(--k-child); border-color: var(--k-child); box-shadow: 0 0 0 4px var(--k-child-soft); }
.stage-btn { display: flex; width: 100%; align-items: center; gap: .75rem; font: inherit; color: inherit; background: none; border: 0; padding: .7rem .6rem; border-radius: 12px; cursor: pointer; text-align: left; }
.stage-btn:hover { background: var(--raise); }
.stage.current > .stage-btn { background: var(--k-child-soft); }
.stage-btn .grow strong { display: block; font-size: .95rem; } .stage-btn .grow span { font-size: .78rem; color: var(--ink-3); }
.stage-panel { margin: .2rem 0 .8rem; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--card); }
.stage-panel .r { padding: .6rem 1rem; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .88rem; font-variant-numeric: tabular-nums; }
th { text-align: left; font-size: .72rem; font-weight: 750; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; padding: .55rem .75rem; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--card); }
td { padding: .6rem .75rem; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
th.num, td.num { text-align: right; }
tr.current td { background: var(--brand-soft); font-weight: 700; }
tr.future td { color: var(--ink-3); }
td.pos { color: var(--ok); font-weight: 700; } td.neg { color: var(--bad); font-weight: 700; }
th:first-child, td:first-child { padding-left: 1.25rem; position: sticky; left: 0; background: inherit; }
td:first-child { background: var(--card); } tr.current td:first-child { background: var(--brand-soft); }
th:last-child, td:last-child { padding-right: 1.25rem; }
.tall { max-height: 70vh; overflow: auto; } .tall thead th { position: sticky; top: 0; z-index: 1; }

/* Chart */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-dasharray: 3 4; }
.chart .axis { fill: var(--ink-3); font-size: 11px; font-family: inherit; } .chart .mid { text-anchor: middle; }
.chart .now { fill: var(--ink); font-weight: 700; }
.legend { display: flex; gap: .9rem; flex-wrap: wrap; font-size: .8rem; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }

/* Forms */
.field { display: grid; gap: .3rem; min-width: 0; }
.field-label { font-size: .8rem; font-weight: 700; color: var(--ink-2); }
.field-hint { font-size: .78rem; color: var(--ink-3); margin: 0; }
.grid2 { display: grid; gap: .8rem 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: start; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: .55rem .7rem; min-height: 42px; width: 100%; min-width: 0; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
input:disabled, select:disabled { background: var(--line-2); color: var(--ink-3); }
input[type=checkbox] { width: 20px; height: 20px; min-height: 0; accent-color: var(--brand); flex: none; }
.check { display: flex; gap: .6rem; align-items: center; font-size: .9rem; cursor: pointer; }
.seg { display: inline-flex; background: var(--line-2); border-radius: 11px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { font: inherit; font-size: .85rem; font-weight: 650; border: 0; background: transparent; color: var(--ink-2); padding: .4rem .8rem; border-radius: 9px; cursor: pointer; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(15,23,42,.12); }
.money-input { position: relative; } .money-input span { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-weight: 600; pointer-events: none; }
.money-input input { padding-left: 2.6rem; font-variant-numeric: tabular-nums; }

/* Side sheet (desktop) / bottom sheet (mobile) */
.sheet { border: 0; padding: 0; margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(460px, 100vw); background: var(--card); color: var(--ink); box-shadow: var(--shadow-lg); }
.sheet[open] { animation: sheet-in .22s ease-out; }
@keyframes sheet-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet::backdrop { background: rgba(15,23,42,.42); backdrop-filter: blur(2px); }
.sheet form { display: flex; flex-direction: column; height: 100%; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--line-2); }
.sheet-head h2 { font-size: 1.1rem; }
.sheet-body { flex: 1; overflow: auto; padding: 1.1rem 1.25rem; display: grid; gap: 1rem; align-content: start; }
.sheet-foot { display: flex; gap: .5rem; padding: .9rem 1.25rem calc(.9rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-2); align-items: center; }
.sheet-foot .grow { flex: 1; }
@media (max-width: 720px) {
  .sheet { margin: auto 0 0; width: 100vw; max-width: 100vw; height: auto; max-height: 92dvh; border-radius: 20px 20px 0 0; }
  .sheet[open] { animation: sheet-up .25s ease-out; }
  .sheet form { height: auto; max-height: 92dvh; }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

#toast { position: fixed; left: 50%; bottom: calc(1.25rem + env(safe-area-inset-bottom)); transform: translate(-50%, 160%); background: var(--ink); color: var(--card); padding: .75rem 1.1rem; border-radius: 12px; font-weight: 650; font-size: .9rem; transition: transform .25s; z-index: 60; max-width: calc(100vw - 2rem); box-shadow: var(--shadow-lg); }
#toast.show { transform: translate(-50%, 0); }
@media (max-width: 720px) { #toast { bottom: calc(5.5rem + env(safe-area-inset-bottom)); } }

/* Welcome */
.welcome { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: start; }
.welcome .feature { display: flex; gap: .8rem; align-items: flex-start; } .welcome .feature p { margin: .15rem 0 0; font-size: .86rem; color: var(--ink-2); }
@media (max-width: 820px) { .welcome { grid-template-columns: 1fr; } }

.about { margin: 2.5rem 0 1rem; color: var(--ink-2); max-width: 75ch; font-size: .92rem; }
.about h2 { color: var(--ink); margin-bottom: .5rem; }
.kids { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); padding: 0 1.25rem 1.2rem; }
.kid { display: grid; gap: .5rem; padding: .9rem; border-radius: 14px; background: var(--k-child-soft); color: inherit; }
.kid .row strong { font-size: 1rem; } .kid span { font-size: .82rem; color: var(--ink-2); }
.date-badge { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--line-2); flex: none; line-height: 1.05; }
.date-badge b { font-size: .95rem; } .date-badge small { font-size: .66rem; color: var(--ink-3); font-weight: 700; text-transform: uppercase; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin: .4rem 0 -.2rem; }
.section-title h2 { font-size: 1rem; color: var(--ink-2); }
@media (max-width: 640px) {
  .big { font-size: 2rem; }
  .r { padding: .7rem 1rem; } .card-head, .card-body { padding-left: 1rem; padding-right: 1rem; }
  .stat { padding: .7rem 1rem; }
}
@media print { .aczh-nav, .nav, .btn, .icon-btn, .aczh-footer, .about { display: none !important; } .card { box-shadow: none; break-inside: avoid; } }

/* Breakdowns */
.r-note { color: var(--ink-2); font-size: .8rem; line-height: 1.45; white-space: pre-line; margin-top: .2rem; }
.r .r-main { align-self: flex-start; } .r .r-end { align-self: flex-start; }
.sub-head { display: flex; justify-content: space-between; gap: .75rem; padding: .55rem 1.25rem; background: var(--raise); border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); font-size: .8rem; font-weight: 750; color: var(--ink-2); }
.stage-panel .sub-head { padding: .5rem 1rem; }
.sub-head span:last-child { font-variant-numeric: tabular-nums; }
.bd-table td, .bd-table th { font-size: .84rem; }
.bd-table tfoot td { font-weight: 800; border-top: 2px solid var(--line); border-bottom: 0; }
.bd-table td.zero { color: var(--ink-3); }
.bd-table td.total { font-weight: 800; }
.bd-list { display: grid; gap: .8rem; padding: 0 1.25rem 1.2rem; }
.bd-item { display: grid; gap: .35rem; }
.bd-item .spread { font-size: .9rem; } .bd-item .spread strong { font-variant-numeric: tabular-nums; }
.bd-toggle { padding: 0 1.25rem .8rem; }

.schedule { display: grid; gap: .5rem; }
.step { display: grid; grid-template-columns: minmax(150px, 1.1fr) minmax(120px, .8fr) 2fr; gap: .75rem; align-items: center; padding: .65rem .9rem; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-size: .88rem; }
.step.now { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.step-when { color: var(--ink-2); font-weight: 650; } .step-amt { font-variant-numeric: tabular-nums; } .step-why { color: var(--ink-3); font-size: .82rem; }
@media (max-width: 640px) { .step { grid-template-columns: 1fr auto; } .step-why { grid-column: 1 / -1; } }

/* Yearly review */
.review-steps { display: flex; gap: .35rem; flex-wrap: wrap; }
.review-steps a { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 650; color: var(--ink-3); padding: .25rem .6rem .25rem .3rem; border-radius: 999px; background: var(--line-2); }
.review-steps a span { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--card); font-size: .72rem; }
.review-steps a.on { background: var(--brand); color: #fff; } .review-steps a.on span { color: var(--brand); }
.review-steps a.done { color: var(--ok); } .review-steps a.done span { background: var(--ok-soft); }
.review-nav { display: flex; justify-content: space-between; gap: .75rem; padding: .25rem 0 1rem; }
.rv-rows { display: grid; gap: .5rem; padding: 0 1.25rem 1rem; }
.rv-row { display: grid; grid-template-columns: minmax(140px, 2fr) minmax(100px, 1fr) minmax(120px, 1.2fr) auto auto; gap: .5rem; align-items: center; }
.rv-row.debt { grid-template-columns: minmax(140px, 2fr) minmax(120px, 1.2fr) minmax(80px, .7fr) minmax(100px, 1fr) auto; }
.rv-row .check { white-space: nowrap; }
@media (max-width: 720px) { .rv-row, .rv-row.debt { grid-template-columns: 1fr 1fr; } .rv-row > :first-child { grid-column: 1 / -1; } }
.muted-card { opacity: .65; }
.pos-text { color: var(--ok); font-weight: 700; font-size: .78rem; } .neg-text { color: var(--bad); font-weight: 700; font-size: .78rem; }
a.chip:hover { filter: brightness(.97); }

details.advanced { margin-top: .5rem; border-top: 1px dashed var(--line); padding-top: .5rem; }
details.advanced summary { cursor: pointer; font-size: .82rem; font-weight: 650; color: var(--ink-3); padding: .2rem 0; }
@media (max-width: 720px) { .app-bar { gap: .5rem; } .bar-right { gap: .35rem; } .bar-right .chip { font-size: .7rem; } .plan-name strong, .plan-switch { font-size: 1.1rem; } }

@media (max-width: 720px) {
  .app-bar { flex-wrap: nowrap; }
  .plan-name { flex: 1; min-width: 0; }
  .chip.sync .lbl, .bar-right .btn .lbl, .chip .lbl-due { display: none; }
  .chip.sync { padding: .3rem; } .bar-right .btn.small { padding: .35rem .5rem; }
}
