:root {
  color-scheme: dark;
  --bg: #09131f; --panel: #101e2d; --panel-2: #132437; --inset:#0b1826;
  --border:#293b4d; --line:#203243; --text:#edf4f9; --muted:#a6b7c8; --faint:#7d93a7;
  --accent:#80e3e4; --accent-text:#062e36; --accent-wash:#16444c;
  --plus:#81e3b9; --minus:#f4a4ab; --warm:#f0c783; --paid:#a6beff;
  --shadow: 0 18px 50px #0003;
  --round:22px; --round-sm:12px;
  --ui: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --number: "Avenir Next", "SF Pro Display", "Segoe UI", var(--ui);
}
:root[data-style="slate"] {
  --bg:#171b21; --panel:#20262e; --panel-2:#272e38; --inset:#191f27; --border:#3b4553; --line:#333d49;
  --text:#f2f5f9; --muted:#b4becb; --faint:#9aa8b8; --accent:#a6dbff; --accent-text:#132637; --accent-wash:#263e52;
  --plus:#8bd8ac; --minus:#f6a1a8; --warm:#f3c282;
  --round:14px; --round-sm:8px; --shadow:0 7px 24px #0002;
}
:root[data-theme="light"] {
  color-scheme:light;
  --bg:#edf4f8; --panel:#fbfdff; --panel-2:#e7f0f6; --inset:#f1f6fa; --border:#c7d6e1; --line:#d7e3eb;
  --text:#142638; --muted:#435b70; --faint:#577084; --accent:#157885; --accent-text:#fff; --accent-wash:#d8f2f4;
  --plus:#167553; --minus:#ad3746; --warm:#8f5922; --paid:#375fa2; --shadow:0 14px 38px #263c5520;
}
:root[data-theme="light"][data-style="slate"] {
  --bg:#f1f3f6; --panel:#fff; --panel-2:#ecf1f7; --inset:#f4f6fa; --border:#cbd3df; --line:#e0e5ed;
  --accent:#1c648d; --accent-wash:#e1eef9; --text:#1d2836; --muted:#4b5d72; --faint:#607389;
}
*, *::before, *::after { box-sizing:border-box; }
html { min-height:100%; background:var(--bg); }
body { margin:0; font-family:var(--ui); color:var(--text); background:var(--bg); font-size:15px; line-height:1.5; }
a { color:inherit; text-decoration:none; }
a, button, input, select, textarea, summary { -webkit-tap-highlight-color:transparent; }
button, input, select, textarea { font:inherit; color:inherit; }
button { cursor:pointer; border:0; background:none; }
button:disabled { opacity:.48; cursor:not-allowed; }
button, a, summary { touch-action:manipulation; }
:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
h1,h2,h3,p { margin:0; }
h1 { font-size:clamp(26px,4vw,36px); line-height:1.15; letter-spacing:-.045em; font-weight:720; }
h2 { font-size:19px; line-height:1.36; font-weight:660; letter-spacing:-.02em; }
p { color:var(--muted); overflow-wrap:anywhere; }
small { color:var(--muted); font-size:12px; overflow-wrap:anywhere; }
svg { flex:none; }
:where(.amount,.headline,.calendar-day,.month-control,.water-step strong,.rank-row strong,.calendar-stats strong,.big-stat,.plot-axis,.axis-labels,.date-chip,.comparison strong) {
  font-family:var(--number); font-variant-numeric:tabular-nums lining-nums;
}
.amount,.headline strong,.comparison strong { overflow-wrap:anywhere; min-width:0; }
.plus { color:var(--plus); } .minus { color:var(--minus); } .neutral { color:var(--text); } .warm { color:var(--warm); }
.layout { min-height:100dvh; }
.rail { position:fixed; width:202px; inset:0 auto 0 0; z-index:2; padding:25px 15px; display:flex; flex-direction:column; justify-content:space-between; border-right:1px solid var(--line); background:color-mix(in srgb,var(--bg) 90%,var(--panel)); }
.rail-head { padding:0 12px 36px; }
.brand { display:inline-flex; align-items:center; min-height:44px; gap:11px; font-weight:700; font-size:16px; letter-spacing:.012em; }
.brand img { border-radius:10px; display:block; box-shadow:0 5px 18px #0002; }
.rail nav { display:grid; gap:6px; margin-bottom:auto; }
.nav-link { display:flex; align-items:center; gap:14px; padding:0 15px; border-radius:13px; color:var(--muted); min-height:49px; }
.nav-link:hover { background:var(--panel-2); color:var(--text); }
.nav-link.selected { color:var(--accent); background:var(--panel-2); font-weight:660; }
.nav-link.selected svg { stroke-width:2; }
.rail-foot { padding:12px 12px 0; display:grid; gap:7px; }
.connection { display:inline-flex; align-items:center; gap:7px; color:var(--muted); font-size:12px; white-space:nowrap; }
.connection i,.status i { border-radius:50%; width:6px; height:6px; display:inline-block; background:var(--plus); flex:none; }
.connection.offline i { background:var(--warm); }
.workspace { margin-left:202px; }
.topbar { padding:12px clamp(20px,4vw,56px); min-height:68px; display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid var(--line); }
.topbar .brand { display:none; }
.wide-name { font-size:14px; font-weight:650; color:var(--muted); letter-spacing:.02em; }
.top-tools { display:flex; align-items:center; gap:12px; }
.mobile-sync { display:none; }
.badge { display:inline-flex; align-items:center; color:var(--accent); border:1px solid var(--border); border-radius:50px; padding:5px 10px; font-size:12px; white-space:nowrap; }
.history-link { display:inline-flex; align-items:center; justify-content:center; gap:4px; min-height:44px; padding-inline:4px; color:var(--accent); white-space:nowrap; font-size:13px; font-weight:600; }
.history-link:hover { text-decoration:underline; }
.badge:hover { background:var(--panel-2); }
.icon-button { width:44px; min-height:44px; display:inline-grid; place-items:center; color:var(--muted); border-radius:11px; flex:none; padding:0; }
.icon-button:hover { background:var(--panel-2); color:var(--text); }
.main { width:min(100%,1440px); margin:0 auto; padding:30px clamp(20px,4vw,56px) 72px; min-width:0; }
.page-head { display:flex; gap:10px; align-items:center; justify-content:space-between; margin:0 0 20px; flex-wrap:wrap; }
.page-head p,.section-head p { margin:5px 0 0; font-size:13px; }
.panel { min-width:0; border:1px solid var(--border); border-radius:var(--round); background:var(--panel); }
.home-grid { display:grid; grid-template-columns:minmax(0,1.5fr) minmax(260px,1fr); gap:20px; align-items:start; }
.ledger-sheet,.overview-aside { min-width:0; }
.overview-aside { display:grid; gap:16px; }
.summary { padding:23px 24px 0; border-color:color-mix(in srgb,var(--border) 82%,var(--accent)); background:linear-gradient(137deg,var(--panel-2),var(--panel) 76%); }
.summary-top { display:flex; justify-content:space-between; align-items:center; gap:8px; color:var(--text); font-weight:640; }
.status { color:var(--muted); display:inline-flex; gap:6px; align-items:center; font-size:12px; font-weight:500; white-space:nowrap; padding:4px 9px; border:1px solid var(--line); border-radius:99px; }
.status.loss i { background:var(--minus); } .status.rest i,.status.missing i { background:var(--faint); }
.headline { padding:0; min-height:62px; margin:5px 0 0; max-width:100%; display:flex; align-items:baseline; text-align:left; gap:9px; }
.headline strong { font-size:clamp(42px,5.1vw,76px); font-weight:650; letter-spacing:-.065em; line-height:1.03; }
.headline span { font-size:17px; color:var(--muted); font-weight:620; letter-spacing:.02em; }
.headline svg { color:var(--faint); align-self:center; margin-left:3px; }
.headline:hover svg { color:var(--accent); }
.period { display:flex; align-items:center; gap:8px; color:var(--muted); font-size:13px; margin:3px 0 13px; }
.period i { width:3px; height:3px; background:var(--faint); border-radius:50%; }
.totals-strip { border-top:1px solid var(--border); display:flex; }
.totals-strip button { display:grid; align-content:center; justify-items:start; gap:3px; flex:1; text-align:left; min-width:0; padding:11px 8px 12px 0; }
.totals-strip button + button { border-left:1px solid var(--line); padding-left:12px; }
.totals-strip button > span:first-child { color:var(--muted); font-size:12px; }
.totals-strip .amount { font-size:clamp(16px,2vw,25px); font-weight:660; line-height:1.13; }
.month-control { display:inline-flex; align-items:center; border:1px solid var(--line); border-radius:var(--round-sm); background:var(--panel); gap:3px; white-space:nowrap; }
.month-picker { display:grid; justify-items:end; gap:2px; }
.month-picker small { color:var(--muted); font-size:12px; }
.month-control select { width:auto; min-width:88px; border:0; border-radius:5px; min-height:44px; padding:0 2px; background:var(--panel); font:650 14px var(--ui); text-align:center; cursor:pointer; }
.quick-actions { display:grid; grid-template-columns: 1.44fr 1fr; gap:9px; margin:13px 0; }
.primary,.secondary,.segment,.text-button { display:inline-flex; align-items:center; justify-content:center; gap:7px; min-height:44px; padding:8px 13px; border-radius:var(--round-sm); line-height:1.24; font-size:14px; font-weight:650; text-align:center; }
.primary { background:var(--accent); color:var(--accent-text); border:1px solid transparent; }
.primary:hover:not(:disabled) { background:color-mix(in srgb,var(--accent) 85%,white); }
:root[data-theme="light"] .primary:hover:not(:disabled) { background:color-mix(in srgb,var(--accent) 84%,black); }
.secondary,.segment { border:1px solid var(--border); background:var(--panel-2); color:var(--text); }
.secondary:hover,.segment:hover { border-color:var(--accent); }
.text-button { color:var(--accent); padding-inline:4px; }
.text-button:hover { text-decoration:underline; }
.segment.single { border-radius:8px; min-width:54px; color:var(--muted); font-size:12px; }
.calendar-section,.content-panel { padding:19px; }
.content-panel + .content-panel { margin-top:13px; }
.section-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:13px; min-width:0; }
.section-head > div { min-width:0; }
.calendar-section .section-head { margin-bottom:8px; }
.calendar-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:5px; }
.weekday { text-align:center; color:var(--faint); font-size:12px; padding:3px 0 1px; }
/* Keep the sign legible at every tint level. */
.calendar-section { --cal-positive:#a3f3c4; --cal-negative:#ffb5c0; --cal-payment:#bed4ff; }
:root[data-theme="light"] .calendar-section { --cal-positive:#075336; --cal-negative:#8a1b32; --cal-payment:#21477f; }
.calendar-day { min-width:0; min-height:80px; position:relative; display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:18px minmax(1.2em,1fr) 13px; align-content:start; gap:3px; text-align:left; padding:6px 5px; border:1px solid var(--line); border-radius:8px; background:var(--inset); color:var(--muted); container-type:inline-size; }
.day-date { display:flex; align-items:center; gap:4px; font-size:15px; line-height:1.1; font-weight:550; color:var(--muted); }
.day-amount {
  display:flex; flex-wrap:wrap; align-items:baseline; align-self:center; min-width:0;
  font-family:system-ui,sans-serif; font-variant-numeric:tabular-nums lining-nums;
  font-size:clamp(14px,34cqi,19px); line-height:1.15; letter-spacing:normal; font-weight:500;
  color:var(--calendar-ink,var(--text));
}
.day-amount[data-digits="4"] { font-size:clamp(13px,29.5cqi,17px); }
.day-amount > span { min-width:0; max-width:100%; overflow-wrap:anywhere; }
.day-amount > span:first-child { white-space:nowrap; }
.day-fraction { font-size:.85em; }
.day-state { font:550 12px/1.14 var(--ui); color:var(--muted); overflow-wrap:anywhere; }
[data-outcome="positive"],[data-tone="positive"] { --tile-tone:var(--plus); --calendar-ink:var(--cal-positive); }
[data-outcome="negative"],[data-tone="negative"] { --tile-tone:var(--minus); --calendar-ink:var(--cal-negative); }
[data-outcome="payment"],[data-tone="payment"] { --tile-tone:var(--paid); --calendar-ink:var(--cal-payment); }
[data-level="1"],.calendar-legend i:first-of-type { --tint:9%; }
[data-level="2"],.calendar-legend i:nth-of-type(2) { --tint:17%; }
[data-level="3"],.calendar-legend i:nth-of-type(3) { --tint:27%; }
.calendar-day:is([data-outcome="positive"],[data-outcome="negative"],[data-outcome="payment"]),.calendar-legend i { background:color-mix(in srgb,var(--inset),var(--tile-tone) var(--tint)); }
.calendar-day[data-level="2"] .day-state,.calendar-day[data-level="3"] .day-state { color:var(--text); }
.calendar-day[data-outcome="none"] .day-amount { color:var(--muted); }
.calendar-day.missing { border-style:dashed; }
.calendar-day.future,.calendar-day.inactive { background:var(--inset); }
.calendar-day.future > span,.calendar-day.inactive > span { color:var(--muted); font-weight:510; }
.calendar-day.today { border-color:var(--accent); }
.calendar-day:hover,.calendar-day:focus-visible { outline:2px solid var(--accent); outline-offset:-2px; z-index:1; }
.calendar-day .payment-dot,.calendar-legend i.payment-key { border:0; width:6px; height:6px; border-radius:50%; display:inline-block; background:var(--paid); }
.calendar-legend { display:flex; align-items:center; flex-wrap:wrap; gap:5px 12px; margin:12px 0 4px; color:var(--muted); font-size:11px; }
.calendar-legend span { display:flex; align-items:center; gap:2px; }
.calendar-legend i { width:11px; height:9px; display:inline-block; border:1px solid var(--border); border-radius:2px; }
.calendar-legend i:first-of-type { margin-left:2px; }
.calendar-note.chart-note { margin:3px 0 10px; font-size:11px; }
.calendar-stats { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:5px; padding-top:11px; border-top:1px solid var(--line); }
.calendar-stats div { display:grid; gap:3px; padding-right:4px; }
.calendar-stats div:not(:first-child) { border-left:1px solid var(--line); padding-left:7px; }
.calendar-stats strong { font-size:23px; line-height:1.1; font-weight:650; }
.calendar-stats span { color:var(--muted); font-size:11px; line-height:1.25; }
:root[data-style="ink"] .ledger-sheet { border:1px solid var(--border); border-radius:var(--round); background:var(--panel); overflow:hidden; }
:root[data-style="ink"] .ledger-sheet .summary,:root[data-style="ink"] .ledger-sheet .calendar-section { border:0; border-radius:0; }
:root[data-style="ink"] .ledger-sheet .summary { padding-bottom:4px; }
:root[data-style="ink"] .ledger-sheet .calendar-section { border-top:1px solid var(--line); }
:root[data-style="ink"] .quick-actions { margin:6px 19px 15px; }
:root[data-style="slate"] .summary { background:var(--panel); border-top:2px solid var(--accent); }
:root[data-style="slate"] .headline strong { color:var(--text); letter-spacing:-.055em; }
:root[data-style="slate"] .headline.minus strong { color:var(--minus); }
:root[data-style="slate"] .calendar-grid { gap:1px; border:1px solid var(--border); border-radius:9px; background:var(--border); overflow:hidden; }
:root[data-style="slate"] .weekday { background:var(--panel-2); padding:5px 0; }
:root[data-style="slate"] .calendar-day { border-radius:0; border:0; }
:root[data-style="slate"] .calendar-day.today { box-shadow:inset 0 0 0 1px var(--accent); }
:root[data-style="slate"] .calendar-blank,:root[data-style="slate"] .calendar-day.future { background:var(--inset); }
.ledger-row { width:100%; display:grid; grid-template-columns:42px minmax(0,1fr) auto auto; align-items:center; gap:10px; min-height:58px; border-top:1px solid var(--line); padding:8px 1px; text-align:left; }
.ledger-row:hover,.list-line:hover,.water-step:hover,.rank-row:hover { background:var(--panel-2); }
.ledger-row > span:nth-child(2) { display:grid; gap:1px; }
.ledger-row b { line-height:1.25; overflow-wrap:anywhere; }
.ledger-row > .amount { font-size:17px; font-weight:650; }
.ledger-row > svg { color:var(--faint); }
.date-chip { display:grid; justify-items:center; align-content:center; padding:4px; width:39px; min-height:42px; border-radius:9px; color:var(--text); background:var(--inset); font-size:20px; font-weight:670; line-height:1; }
.date-chip small { font-size:10px; margin-top:4px; }
.chart { display:grid; grid-template-columns:42px minmax(0,1fr); column-gap:9px; min-width:0; }
.chart-actual { min-width:0; position:relative; }
.plot-axis { position:relative; display:flex; flex-direction:column; justify-content:space-between; color:var(--faint); font-size:10px; text-align:right; margin:0 0 20px; overflow-wrap:anywhere; }
.plot-axis span:nth-child(2):nth-last-child(2) { position:absolute; top:var(--at); right:0; transform:translateY(-50%); }
.daily-plot { position:relative; height:146px; display:flex; gap:2px; border-top:1px dashed var(--border); border-bottom:1px dashed var(--border); }
.chart-small .daily-plot { height:110px; }
.plot-zero { position:absolute; top:var(--zero); width:100%; height:1px; background:var(--faint); opacity:.6; }
.plot-item { position:relative; flex:1; min-width:0; min-height:44px; padding:0; color:var(--accent); }
.plot-item.plus { color:var(--plus); }.plot-item.minus { color:var(--minus); }
.plot-item i { position:absolute; left:12%; width:76%; min-width:1px; height:var(--len); inset-block-start:var(--offset); background:currentColor; border-radius:2px; opacity:.83; }
.plot-item.unrecorded i { top:var(--zero); left:50%; transform:translate(-50%,-50%); height:5px; width:5px; border-radius:50%; background:var(--inset); border:1px solid var(--faint); }
.plot-item:hover { background:var(--panel-2); }
.axis-labels { display:flex; justify-content:space-between; font-size:10px; color:var(--muted); margin-top:7px; }
.chart-note { color:var(--muted); font-size:13px; margin-top:9px; }
.chart-empty,.empty { color:var(--muted); padding:18px 3px; font-size:14px; }
.accumulation { display:block; width:100%; height:146px; overflow:visible; }
.accumulation line { stroke:var(--faint); stroke-dasharray:4 3; opacity:.6; }
.accumulation path { stroke:var(--accent); fill:none; stroke-width:2; vector-effect:non-scaling-stroke; }
.accumulation circle { fill:var(--accent); }
.point-links { display:flex; position:absolute; inset:0 0 18px; }
.point-links button { flex:1; min-width:0; padding:0; }
.point-links button:hover { background:color-mix(in srgb, var(--accent), transparent 92%); }
.water-step,.rank-row { color:var(--text); width:100%; min-height:45px; display:grid; grid-template-columns:minmax(64px,1fr) minmax(28px,1.25fr) minmax(56px,.7fr); gap:8px; align-items:center; padding:5px 0; border-top:1px solid var(--line); text-align:left; white-space:normal; }
.water-step span,.rank-row span { overflow-wrap:anywhere; }
.water-step i,.rank-row > i { position:relative; min-width:0; height:15px; border-radius:4px; background:var(--inset); }
.water-step i::before,.rank-row > i::before { content:""; position:absolute; left:var(--zero); inset-block:0; width:1px; background:var(--faint); opacity:.6; }
.water-step b,.rank-row b { position:absolute; left:var(--left); width:var(--size); max-width:100%; top:3px; bottom:3px; background:currentColor; border-radius:3px; opacity:.8; }
.water-total { font-weight:720; }
.water-total b { color:var(--accent); }
.water-step strong,.rank-row strong { text-align:right; overflow-wrap:anywhere; }
.cost-share { height:36px; border-radius:9px; overflow:hidden; display:flex; margin-bottom:10px; }
.cost-share button { flex-basis:0; padding:0; min-width:2px; }
.dot { background:var(--tone); width:8px; height:8px; border-radius:50%; display:inline-block; margin-right:5px; }
.filter-bar { display:grid; grid-template-columns:repeat(auto-fit,minmax(135px,1fr)); align-items:end; gap:9px; padding:14px; margin-bottom:17px; }
.filter-actions { display:flex; gap:8px; align-items:end; flex-wrap:wrap; }
.tabs { display:flex; border-bottom:1px solid var(--line); gap:11px; margin-bottom:15px; flex-wrap:wrap; }
.tabs button { min-height:46px; color:var(--muted); padding:0 8px; border-bottom:2px solid transparent; }
.tabs button.active { color:var(--accent); border-color:var(--accent); font-weight:650; }
.analysis-grid,.manage-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; gap:15px; }
.analysis-grid > *, .manage-grid > * { margin-top:0 !important; }
.analysis-grid .notes-panel { min-height:150px; }
.scope-break,.comparison { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; border-block:1px solid var(--line); padding:10px 0; margin:10px 0; }
.scope-break > div,.comparison > div { display:grid; align-content:start; gap:4px; }
.scope-break > div + div,.comparison > div + div { padding-left:8px; border-left:1px solid var(--line); }
.comparison strong,.comparison .amount { font-size:clamp(17px,2.5vw,24px); font-weight:680; }
.initial,.login-screen { min-height:100dvh; display:grid; place-items:center; align-content:center; gap:13px; padding:25px; }
.initial img,.login-panel img { border-radius:16px; }
.login-panel { width:min(100%,390px); padding:30px; box-shadow:var(--shadow); }
.login-panel h1 { margin-top:12px; }
.login-panel p { margin:8px 0 17px; }
.login-panel form { display:grid; gap:12px; }
.login-panel > a { margin-top:10px; }
.fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:9px 0; }
fieldset.fields { border:1px solid var(--line); border-radius:var(--round-sm); margin:14px 0 8px; padding:10px; }
fieldset legend { padding:0 5px; color:var(--warm); }
label { display:grid; gap:5px; min-width:0; color:var(--muted); font-size:13px; }
input:not([type="checkbox"]),select,textarea { width:100%; min-width:0; min-height:44px; background:var(--inset); border:1px solid var(--border); border-radius:var(--round-sm); padding:8px 10px; color:var(--text); font-size:16px; }
input[type="file"] { font-size:14px; }
input[readonly] { color:var(--muted); }
textarea { resize:vertical; }
.raw-input { min-height:194px; line-height:1.7; }
.check-line { display:flex; align-items:center; gap:7px; min-height:44px; }
input[type="checkbox"] { width:19px; height:19px; accent-color:var(--accent); flex:none; }
.form-actions { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0 2px; align-items:center; }
.preview { margin-top:15px; scroll-margin-top:10px; }
.preview-line,.entry-header,.list-line { display:flex; width:100%; min-height:44px; align-items:center; gap:8px; justify-content:space-between; border-top:1px solid var(--line); padding:8px 0; text-align:left; overflow-wrap:anywhere; }
.preview-line > div:first-child,.entry-header > span:first-child { display:grid; min-width:0; align-content:center; gap:3px; }
.preview-edit { display:flex; justify-content:end; flex:0 0 auto; }
.preview-edit input { width:88px; text-align:right; }
.report-update { display:grid; gap:8px; margin-block:14px; padding-top:12px; border-top:1px solid var(--line); }
.report-update h3 { margin:0; }
.report-update .text-button { justify-self:start; }
.report-conflict small { color:var(--muted); }
.source-calculation { display:grid; grid-template-columns:1fr auto; gap:6px 14px; color:var(--muted); }
.source-calculation dd { margin:0; text-align:right; font-variant-numeric:tabular-nums; color:var(--text); }
[data-included-options][hidden] { display:none; }
.notice { color:var(--muted); background:var(--panel-2); border:1px solid var(--border); border-radius:var(--round-sm); margin:0 0 12px; padding:9px 11px; font-size:13px; overflow-wrap:anywhere; }
.notice a { color:var(--accent); margin-left:8px; }
.notice.attention,.notice.danger { color:var(--warm); border-color:color-mix(in srgb,var(--warm) 45%,var(--border)); }
.notice.danger,.warning-list { color:var(--minus); }
.warning-list { padding-left:20px; margin:8px 0; }
.big-stat { font-size:clamp(34px,7vw,58px); font-weight:650; letter-spacing:-.05em; }
.entry.voided { color:var(--faint); }
.entry.voided .entry-header { opacity:.7; }
.entry-header > .amount { font-size:19px; font-weight:670; }
.inline-details,.source-details { border-top:1px solid var(--line); color:var(--muted); font-size:13px; }
.inline-details summary,.source-details summary { cursor:pointer; padding:11px 0; min-height:44px; }
.inline-details p { padding-bottom:8px; }
.source-details pre,.inline-details pre,.conflict pre { overflow-wrap:anywhere; white-space:pre-wrap; border-radius:var(--round-sm); padding:11px; background:var(--inset); font-size:13px; overflow:auto; max-height:320px; }
.mini-form { padding:7px 9px 11px; background:var(--inset); border-radius:var(--round-sm); margin-bottom:8px; }
.payment-wrap,.edit-line { border-top:0; }
.upload-form { display:flex; align-items:flex-end; gap:8px; flex-wrap:wrap; margin:12px 0; }
.upload-form label { flex:1 1 190px; }
#toast { position:fixed; inset:auto 18px 20px auto; max-width:min(430px,calc(100% - 36px)); z-index:8; background:var(--panel-2); color:var(--text); border-radius:12px; border:1px solid var(--border); padding:9px 13px; opacity:0; pointer-events:none; transition:opacity .16s; box-shadow:var(--shadow); }
#toast.visible { opacity:1; }
#toast.danger { color:var(--minus); }
#toast.attention { color:var(--warm); }
dialog.dialog { width:min(570px,calc(100% - 26px)); max-height:min(78dvh,670px); padding:18px; color:var(--text); box-shadow:var(--shadow); }
dialog::backdrop { background:#0008; }
.drilldown { margin-top:9px; }
.tree { padding-left:10px; }
.tree summary > span { margin-right:7px; }
.review-layout { width:min(100%,965px); margin:0 auto; padding:32px 18px; }
.review-head { margin-bottom:22px; }
.review-head p,.review-caption p { margin-top:4px; }
.review-grid { display:grid; gap:20px; grid-template-columns:repeat(2,minmax(0,1fr)); }
.review-option { min-width:0; }
.review-caption { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:10px; }
.review-caption a { color:var(--accent); border:1px solid var(--border); padding:10px; border-radius:9px; white-space:nowrap; }
.review-option iframe { display:block; width:100%; max-width:430px; height:830px; border:1px solid var(--border); padding:0; border-radius:23px; background:var(--bg); }
.icon-check { display:flex; width:100%; max-width:430px; gap:12px; align-items:center; padding:14px; margin-top:10px; border-radius:13px; background:linear-gradient(120deg,#293c52,#112332 55%,#315466); color:#f2f8ff; }
.icon-check.slate-icon { background:linear-gradient(120deg,#384652,#181d25 55%,#414957); }
.icon-check img { border-radius:22%; box-shadow:0 4px 10px #0005; }
@media (max-width:1140px) {
  .rail { width:156px; }
  .workspace { margin-left:156px; }
  .main,.topbar { padding-inline:22px; }
  .home-grid { grid-template-columns:minmax(0,1.35fr) minmax(230px,1fr); gap:13px; }
}
@media (max-width:885px) and (min-width:721px) {
  .rail { width:66px; align-items:center; padding-inline:7px; }
  .rail-head { padding-inline:0; }
  .rail .brand span,.rail .nav-link span,.rail-foot { display:none; }
  .workspace { margin-left:66px; }
}
@media (max-width:720px) {
  .rail { width:100%; inset:auto 0 0; display:block; border:0; border-top:1px solid var(--border); padding:4px 8px max(env(safe-area-inset-bottom),5px); background:color-mix(in srgb,var(--panel) 94%,var(--bg)); }
  .rail-head,.rail-foot,.wide-name { display:none; }
  .rail nav { grid-template-columns:repeat(5,minmax(0,1fr)); gap:3px; }
  .nav-link { display:grid; justify-items:center; align-content:center; min-height:50px; gap:2px; padding:3px; border-radius:10px; font-size:11px; }
  .nav-link.selected { background:var(--accent-wash); }
  .workspace { margin:0; }
  .topbar { min-height:57px; padding:calc(6px + env(safe-area-inset-top)) 14px 6px; }
  .topbar .brand { display:inline-flex; min-height:39px; gap:8px; }
  .brand img { width:31px; height:31px; border-radius:8px; }
  .top-tools { gap:4px; }
  .mobile-sync { display:inline-flex; margin:0 4px; }
  .topbar .icon-button { width:37px; }
  .main { padding:17px 13px calc(76px + env(safe-area-inset-bottom)); }
  .page-head { margin-bottom:11px; gap:7px; }
  .page-head h1 { font-size:28px; }
  .page-head p { font-size:13px; }
  .month-control .icon-button { width:40px; }
  .month-control select { min-width:81px; font-size:13px; }
  .home-grid,.analysis-grid,.manage-grid { grid-template-columns:minmax(0,1fr); gap:12px; }
  .summary { padding:15px 15px 0; }
  .headline { min-height:55px; gap:7px; }
  .headline strong { font-size:clamp(39px,12vw,55px); }
  .headline span { font-size:14px; }
  .period { margin-bottom:9px; }
  .totals-strip button { padding-block:8px 10px; }
  .totals-strip .amount { font-size:19px; }
  :root[data-style="ink"] .quick-actions { margin:4px 13px 12px; }
  .calendar-section,.content-panel { padding:12px; }
  .calendar-section .section-head { margin-bottom:6px; }
  .calendar-grid { gap:3px; }
  .calendar-day { padding:5px 3px; min-height:68px; border-radius:6px; }
  .day-date { font-size:13px; }
  .calendar-day { grid-template-rows:15px minmax(1.2em,1fr) 12px; }
  .calendar-legend { margin:8px 0; gap:4px 7px; }
  .calendar-legend span { font-size:11px; }
  .calendar-stats { padding-top:8px; }
  .calendar-stats strong { font-size:20px; }
  .calendar-stats span { font-size:10px; }
  .chart-small .daily-plot { height:87px; }
  .content-panel h2 { font-size:18px; }
  .overview-aside { gap:13px; }
  .filter-bar { grid-template-columns:repeat(2,minmax(0,1fr)); padding:10px; margin-bottom:12px; }
  .filter-actions { grid-column:1/-1; }
  #toast { bottom:calc(64px + env(safe-area-inset-bottom)); }
  .review-grid { grid-template-columns:minmax(0,1fr); }
}
@media (max-width:365px) {
  .main { padding-inline:9px; }
  .calendar-day { padding-inline:1px; }
  .calendar-section,.content-panel { padding-inline:9px; }
  .calendar-grid { gap:2px; }
}
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior:auto !important; transition:none !important; }
}
.correction-diff { grid-column:1/-1; }
.revision-diff h3 { font-size:15px; }
.bulk-row { display:grid; grid-template-columns:minmax(0,1fr) minmax(75px,.7fr) minmax(90px,1fr); align-items:center; gap:6px; padding:5px 0; border-bottom:1px solid var(--line); }
.bulk-row input,.bulk-row select { padding-inline:6px; }
.analysis-filters { margin:0 0 12px; border-bottom:1px solid var(--line); }
.analysis-filters > summary,.quality-detail > summary,.project-detail > summary { cursor:pointer; }
.analysis-filters > summary { min-height:44px; padding:10px 2px; }
.analysis-filters > summary span { color:var(--muted); font-size:13px; margin-inline-start:12px; }
.analysis-filters .filter-bar { margin-bottom:10px; }
.period-headline { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 10px; text-align:left; padding:0; }
.period-headline .amount { font-family:var(--number); font-size:clamp(27px,4vw,40px); letter-spacing:-.045em; font-weight:680; line-height:1.15; }
.period-headline svg { color:var(--faint); }
.overview-result > .chart-note { margin:4px 0 11px; }
.insight-row { display:grid; grid-template-columns:minmax(0,1fr) auto 14px; width:100%; text-align:left; align-items:center; gap:10px; padding:10px 0; border-top:1px solid var(--line); }
.insight-row > span:first-child,.period-comparison button { display:grid; gap:2px; }
.insight-row b { overflow-wrap:anywhere; font-size:15px; }
.insight-row .amount,.cost-total b { font-variant-numeric:tabular-nums; font-weight:670; }
.insight-row svg { color:var(--faint); }
.insight-row.empty-insight b { font-weight:500; color:var(--muted); font-size:13px; }
.period-comparison { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); border-block:1px solid var(--line); margin:6px 0; }
.period-comparison button { align-content:start; text-align:left; padding:9px 5px; min-width:0; }
.period-comparison button+button { border-left:1px solid var(--line); }
.period-comparison .amount { font-size:clamp(16px,2vw,24px); font-weight:680; }
.period-comparison button > span:last-child { color:var(--muted); font-size:11px; }
.quality-detail,.quality-line { border-bottom:1px solid var(--line); }
.quality-detail > summary,.quality-line { padding:8px 0; min-height:42px; }
.quality-detail > summary b,.quality-line b,.project-detail > summary small { float:right; }
.quality-line { color:var(--muted); }
.quality-days { display:flex; flex-wrap:wrap; gap:4px; padding-bottom:9px; }
.date-link { color:var(--accent); min-height:36px; padding:3px 7px; background:var(--inset); }
.project-rank strong small,.cost-rank strong small { display:block; color:var(--muted); font:500 11px/1.35 var(--ui); }
.project-rank,.cost-rank { grid-template-columns:minmax(65px,1fr) minmax(22px,1fr) minmax(74px,.9fr); }
.cost-controls,.cost-total { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:7px; }
.cost-controls { margin:4px 0 12px; }
.basis-control { display:flex; border:1px solid var(--border); border-radius:var(--round-sm); overflow:hidden; }
.basis-control button { padding:6px 12px; min-height:38px; color:var(--muted); }
.basis-control .chosen { background:var(--accent-wash); color:var(--accent); font-weight:650; }
.cost-total { padding:7px 0 12px; }
.cost-total span { color:var(--muted); }
.cost-total b { font-size:25px; }
.cost-structure { grid-column:1/-1; }
@media (min-width:800px) {
  .cost-structure .rank-row { grid-template-columns:minmax(94px,1fr) minmax(42px,2.5fr) minmax(90px,1fr); }
}
@media (max-width:720px) {
  .analysis-filters > summary span { font-size:12px; margin-inline-start:6px; }
}
.calendar-day[data-selected="true"] { outline:2px solid var(--accent); outline-offset:-2px; z-index:1; }
.reported-caption { margin:12px 0 5px; font-weight:640; }
.reported-caption small { font-weight:450; margin-left:5px; }
.home-quality { margin:8px 0 0; color:var(--muted); font-size:13px; }
.home-quality summary { cursor:pointer; }
.calendar-sources { margin-top:8px; border-top:1px solid var(--line); }
.calendar-sources > summary,.rank-denominator > summary { padding:8px 0; cursor:pointer; color:var(--muted); }
.calendar-sources > summary { font-size:12px; }
.stat-source { padding:6px 0; font-size:13px; }
.stat-source > b { display:block; margin-bottom:4px; }
.stat-source .quality-days { padding-bottom:2px; }
.rank-denominator { border-bottom:1px solid var(--line); font-size:13px; }
div.rank-denominator { padding:8px 0; color:var(--muted); }
div.rank-denominator > span { margin-right:10px; }
.cost-total-detail > summary { cursor:pointer; justify-content:flex-start; }
.cost-total-detail > summary b { margin-left:auto; }
.cost-total-detail > summary::after { content:"⌄"; color:var(--accent); font-size:18px; }
.cost-total-detail[open] > summary::after { transform:rotate(180deg); }
.project-days { padding-left:8px; }
.detail-evidence { display:flex; align-items:baseline; flex-wrap:wrap; gap:4px 12px; border-left:2px solid var(--accent); padding:5px 10px; margin:6px 0; }
.detail-evidence > span:first-child { color:var(--muted); }
.detail-back { display:flex; gap:12px; }
.timeline-scroll { overflow-x:auto; max-width:100%; scrollbar-color:var(--border) var(--inset); }

/* Analysis uses the same graphite surfaces and the calendar's clear tabular figures. */
:root { --category-light:67%; }
:root[data-theme="light"] { --category-light:45%; }
.analysis-head { display:grid; grid-template-columns:minmax(0,1fr) auto auto; align-items:center; gap:clamp(8px,2vw,18px); }
.analysis-head .month-picker small { display:none; }
.ask-link { white-space:nowrap; }
.analysis-filters { margin-bottom:0; }
.analysis-filters > summary { display:flex; align-items:center; gap:8px; }
.analysis-filters > summary::before { content:'›'; color:var(--faint); }
.analysis-filters[open] > summary::before { transform:rotate(90deg); }
.analysis-filters > summary span { margin:0; }
.coverage-line { display:block; min-height:34px; padding:4px 1px; color:var(--muted); font-size:12px; text-align:left; }
.analysis-tabs { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:0; }
.analysis-tabs button { white-space:nowrap; }
.analysis-grid .content-panel { min-width:0; }
.analysis-grid .section-head { margin-bottom:9px; }
.period-headline .amount,.big-stat,.headline strong,:root[data-style="slate"] .headline strong { font-family:system-ui,var(--ui); font-variant-numeric:tabular-nums; letter-spacing:normal; font-weight:550; }
.analysis-grid strong,.analysis-grid .amount,.source-row strong,.detail-evidence .amount { font-family:system-ui,var(--ui); font-variant-numeric:tabular-nums; letter-spacing:normal; }
.analysis-grid .amount,.source-row strong { font-weight:550; }
.period-headline .amount { font-size:clamp(36px,5vw,56px); }
.period-facts { margin-top:10px; }
.period-facts button,.composition-preview,.spend-categories button,.spark-row,.project-legend,.month-bar { display:grid; width:100%; align-items:center; min-height:44px; border-top:1px solid var(--line); padding:7px 1px; text-align:left; gap:8px; }
.period-facts button { grid-template-columns:1fr auto; color:var(--muted); font-size:13px; }
.period-facts button:first-child { color:var(--text); }
.period-facts svg,.spark-row>svg:last-child,.source-row>svg { color:var(--faint); }
.mode-switch { display:inline-flex; max-width:100%; gap:2px; margin:0 0 10px; padding:2px; background:var(--inset); border:1px solid var(--line); border-radius:var(--round-sm); }
.mode-switch button { min-height:38px; padding:4px 11px; border-radius:calc(var(--round-sm) - 3px); color:var(--muted); font-size:13px; }
.mode-switch button.chosen { background:var(--panel-2); color:var(--text); box-shadow:0 0 0 1px var(--border); font-weight:600; }
.month-bar { grid-template-columns:minmax(61px,.6fr) minmax(45px,2.4fr) minmax(64px,auto); }
.month-bar>span,.comparison-stats button,.spark-row>span:first-child { display:grid; }
.month-bar small { color:var(--muted); font-size:11px; }
.month-bar>i { position:relative; height:18px; background:var(--inset); border-radius:3px; }
.month-bar>i::after { content:''; position:absolute; left:clamp(0px,var(--axis),calc(100% - 1px)); width:1px; inset-block:-3px; background:var(--faint); }
.month-bar b { position:absolute; inset-block:1px; background:currentColor; border-radius:2px; }
.month-bar .zero-mark { min-width:2px; color:var(--text); }
.month-bar strong,.project-legend strong,.spend-categories strong { text-align:right; font-weight:550; }
.comparison-stats { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin-top:8px; padding-top:8px; border-top:1px solid var(--line); }
.comparison-stats button { text-align:left; align-content:start; gap:3px; padding:0; }
.comparison-stats small { font-size:11px; }
.history-note { display:block; margin-top:10px; color:var(--muted); text-align:left; text-decoration:underline; text-decoration-style:dotted; text-underline-offset:3px; font-size:12px; }
.category-dot { display:inline-block; flex:none; width:9px; height:9px; margin-right:8px; border-radius:50%; background:var(--tone); }
.composition-preview { grid-template-columns:minmax(0,1fr) auto; }
.composition-strip { display:flex; height:8px; gap:2px; overflow:hidden; border-radius:4px; margin:4px 0 10px; }
.ring-layout { display:grid; grid-template-columns:minmax(0,1fr); align-items:center; gap:10px; }
.project-ring { position:relative; width:min(100%,440px); margin:0 auto; }
.project-ring svg { display:block; width:100%; }
.project-ring circle { cursor:pointer; pointer-events:visibleStroke; }
.ring-center { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); width:25%; display:flex; flex-direction:column; align-items:center; justify-content:center; pointer-events:none; text-align:center; }
.ring-center small { font-size:11px; }
.ring-center strong { font-size:clamp(17px,2.5vw,28px); font-weight:550; }
.project-legend { grid-template-columns:minmax(0,1fr) auto auto; gap:8px; }
.project-legend small { min-width:6.8ch; white-space:nowrap; text-align:right; font-variant-numeric:tabular-nums; }
.project-legend>span,.spark-row b { overflow-wrap:anywhere; }
.ring-separate { margin-top:12px; }
.ring-separate h3 { color:var(--muted); font-size:12px; }
.ring-separate .project-legend { grid-template-columns:1fr auto; }
.spark-row { grid-template-columns:minmax(68px,1fr) minmax(45px,96px) auto 12px; }
.spark-row b { font-size:14px; font-weight:550; }
.micro-line { display:block; width:100%; height:30px; }
.micro-line path,.spend-plot path { fill:none; stroke:currentColor; stroke-width:1.7; vector-effect:non-scaling-stroke; }
.micro-line circle,.spend-plot circle { fill:currentColor; }
.spend-legend { display:flex; flex-wrap:wrap; gap:6px 14px; margin:0 0 12px; }
.spend-key { display:grid; grid-template-columns:auto 1fr; align-items:center; justify-items:start; gap:1px 5px; text-align:left; min-height:44px; padding:0; font-size:12px; }
.spend-key strong { grid-column:2; }
.spend-key:disabled { opacity:.75; }
.spend-axis { float:left; width:41px; display:flex; height:116px; flex-direction:column; justify-content:space-between; }
.spend-axis small { font-size:10px; }
.spend-trace { overflow-x:auto; border-block:1px solid var(--line); }
.spend-plot { position:relative; height:116px; }
.spend-plot svg { height:100%; width:100%; display:block; }
.spend-plot .point-links { inset:0; }
.spend-report { --tone:var(--accent); color:var(--tone); }
.spend-extra { --tone:var(--warm); color:var(--tone); }
.spend-other { --tone:var(--paid); color:var(--tone); }
.spend-categories button { grid-template-columns:1fr auto 5.5ch; }
.scope-tree summary,.dialog h3 { font-weight:600; }
.dialog .section-head { position:sticky; top:-1px; z-index:1; background:var(--panel); padding:6px 0; }
.dialog .drilldown { max-height:none; overflow:visible; }
.dialog-intro,.dialog .extremes { margin-bottom:10px; }
.source-row { grid-template-columns:minmax(0,1fr) auto 16px; }
@media (min-width: 721px) {
  .analysis-result { grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr); }
  .analysis-result .month-comparison { grid-column:2; grid-row:1 / span 2; }
  .analysis-projects { grid-template-columns:minmax(0,1.2fr) minmax(0,1fr); }
}
@media (max-width: 720px) {
  .analysis-head { margin-bottom:4px; gap:7px; }
  .analysis-head .month-control .icon-button { width:31px; }
  .ask-link { padding:4px; font-size:13px; }
  .ask-link svg { width:12px; }
  .ring-layout { grid-template-columns:minmax(0,1fr); gap:6px; }
  .project-ring { width:min(100%,410px); }
  .ring-center strong { font-size:clamp(18px,5vw,23px); }
  .mode-switch button { min-height:40px; }
  .main form :is(input,select,textarea,button) { scroll-margin-block:70px calc(76px + env(safe-area-inset-bottom)); }
  html.keyboard-open .rail { visibility:hidden; }
  .source-row strong { white-space:nowrap; }
}

.ring-callout { cursor:pointer; }
.ring-callout polyline { fill:none; stroke-width:1.2; stroke-linejoin:round; vector-effect:non-scaling-stroke; }
.ring-callout text { fill:var(--text); font:500 13px var(--ui); }
[data-alias-preview]:not(:empty) { display:block; margin-block:8px; color:var(--text); }
@media (max-width:720px) { .main form :is(input,select,textarea):not([type=checkbox]) { font-size:16px; } }

.analysis-tabs { grid-template-columns:repeat(5,minmax(0,1fr)); }
.home-attendance { padding:13px 0 12px; border-top:1px solid var(--line); }
.attendance-numbers { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,105px),1fr)); gap:12px; margin-block:5px; }
.attendance-cell { min-width:0; }
.attendance-cell > small,.people-scope,.attendance-caption,.people-project small,.people-month small,.people-compare-row small { color:var(--muted); }
.attendance-cell > small { display:block; font-size:13px; }
.attendance-cell > span { display:flex; flex-wrap:wrap; align-items:baseline; gap:3px 5px; }
.attendance-cell strong { font-family:system-ui,var(--ui); font-weight:620; line-height:1.4; font-size:clamp(20px,2.6vw,28px); font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.attendance-cell > span small,.people-project small,.people-month small { font-size:12px; font-weight:450; }
.attendance-caption { display:flex; justify-content:space-between; align-items:baseline; flex-wrap:wrap; gap:4px 10px; margin-top:6px; font-size:13px; }
.attendance-caption a { color:var(--accent); padding-block:5px; }
.people-scope { font-size:13px; line-height:1.55; margin:3px 0 13px; }
.attendance-day .attendance-numbers { margin-block:12px; }
.attendance-day h3 { font-size:16px; margin:18px 0 4px; }
.people-project,.people-compare-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:3px 10px; padding:9px 0; border-top:1px solid var(--line); overflow-wrap:anywhere; }
.people-project > div { display:grid; align-content:start; gap:3px; }
.people-project > div:nth-child(2),.people-compare-row > div { text-align:right; }
.people-project b,.people-compare-row strong { font-size:15px; font-weight:600; font-variant-numeric:tabular-nums; }
.people-pair { grid-column:1/-1; }
.people-title { display:flex; flex-wrap:wrap; align-items:center; gap:6px 14px; justify-content:space-between; }
.people-title select { min-height:40px; width:auto; max-width:100%; font-size:14px; }
.people-title label { max-width:100%; }
.people-overview { grid-column:1/-1; }
.people-compare-row { align-items:center; font-size:14px; line-height:1.4; }
.people-compare-row strong,.people-compare-row small { display:block; }
.people-compare-row em { grid-column:1/-1; justify-self:end; color:var(--muted); font-style:normal; font-size:13px; }
.people-month { border-top:1px solid var(--line); }
.people-month > summary { display:grid; grid-template-columns:minmax(75px,auto) minmax(14px,1fr) auto; align-items:center; gap:12px; min-height:52px; cursor:pointer; }
.people-month > summary > span { display:grid; }
.people-month strong { font-variant-numeric:tabular-nums; }
.people-track { height:5px; background:var(--line); border-radius:2px; }
.people-track i { display:block; height:100%; background:var(--accent); border-radius:inherit; }
.people-month-detail { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,125px),1fr)); gap:8px; padding:8px 0; }
.people-month-detail > p,.people-month-detail > details { grid-column:1/-1; }
.people-check { display:flex; align-items:center; gap:10px; border-top:1px solid var(--line); padding:8px 0; min-height:44px; }
.people-check small { color:var(--muted); margin-left:auto; }
.detail-evidence > small { flex:1 0 100%; color:var(--muted); }
.people-count-trend .plot-item.people-bar { color:var(--accent); }
@media(max-width:760px) {
  .attendance-numbers { gap:10px; }
  .people-mean-trend select { max-width:185px; }
  .analysis-tabs button { padding-inline:2px; }
}
.people-summary { padding-top:9px; margin:8px 0; border-top:1px solid var(--line); font-size:14px; line-height:1.55; }

.batch-preview .section-head {align-items:center;flex-wrap:wrap}
.batch-preview [data-batch-year] {width:6em;margin-inline-start:.5em}
.batch-counts {color:var(--muted);margin:1em 0}
.batch-counts strong {color:var(--text);font-variant-numeric:tabular-nums}
.batch-table-wrap {overflow-x:auto}
.batch-table {border-collapse:collapse;width:100%;font-variant-numeric:tabular-nums}
.batch-table th,.batch-table td {padding:10px 12px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top}
.batch-table th {font-weight:500;color:var(--muted);white-space:nowrap}
.batch-table td.amount {white-space:nowrap}
.batch-table td small {display:block;max-width:24em;color:var(--muted)}
.batch-table summary {cursor:pointer;white-space:nowrap}
.batch-table select,.batch-table input {display:block;width:100%;min-width:8em;max-width:16em}
.batch-table select+*,.batch-table input+* {margin-top:6px}
.batch-table pre {white-space:pre-wrap;min-width:15em}
.batch-actions {display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.batch-actions label {display:flex;align-items:center}
.batch-table-wrap {max-height:min(65vh,700px);scrollbar-gutter:stable}
.batch-table thead th {position:sticky;top:0;background:var(--panel);z-index:1}
@media(min-width:1100px){
  .report-import-workspace:has(.batch-preview) {display:grid;grid-template-columns:minmax(235px,.8fr) minmax(0,2fr);align-items:start;gap:18px}
  .report-import-workspace:has(.batch-preview) .raw-input {min-height:330px}
  .report-import-workspace:has(.batch-preview) .batch-preview {margin-top:0}
}
