/* Layout: one 1080px column. Top bar with brand, section tabs and New entry. A shared period and group filter scopes the Dashboard and Journal.
   Dashboard = net hero over a ruled strip of income, expenses and savings rate, then cash-flow columns, two pivotable breakdown cards and a group table.
   Journal = month-ruled ledger rows with receipt thumbnails. Settings = list editors. Colour lives in the charts only: blue is money in, orange is money out. */
:root {
  --font-ui: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-fig: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --bg: #f1f3f2;
  --surface: #fcfcfb;
  --inset: #f3f4f2;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --ink-3: #6f6d68;
  --line: #e1e0d9;
  --axis: #c3c2b7;
  --income: #2a78d6;
  --expense: #eb6834;
  --other: #b3b1a8;
  --good: #006300;
  --bad: #d03b3b;
  --focus: #2a78d6;
  --btn-bg: #0b0b0b;
  --btn-fg: #fcfcfb;
  --scrim: rgba(11, 11, 11, .45);
  --shadow: 0 10px 30px rgba(11, 11, 11, .16);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0d0d; --surface: #1a1a19; --inset: #232322; --ink: #ffffff; --ink-2: #c3c2b7; --ink-3: #9b9990;
    --line: #2c2c2a; --axis: #3f3f3b; --income: #3987e5; --expense: #d95926; --other: #55544f;
    --good: #0ca30c; --bad: #d03b3b; --focus: #6da7ec; --btn-bg: #ffffff; --btn-fg: #0b0b0b;
    --scrim: rgba(0, 0, 0, .6); --shadow: 0 10px 30px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0d0d; --surface: #1a1a19; --inset: #232322; --ink: #ffffff; --ink-2: #c3c2b7; --ink-3: #9b9990;
  --line: #2c2c2a; --axis: #3f3f3b; --income: #3987e5; --expense: #d95926; --other: #55544f;
  --good: #0ca30c; --bad: #d03b3b; --focus: #6da7ec; --btn-bg: #ffffff; --btn-fg: #0b0b0b;
  --scrim: rgba(0, 0, 0, .6); --shadow: 0 10px 30px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font-ui); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
.mono { font-family: var(--font-fig); font-variant-numeric: tabular-nums; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.wrap { max-width: 1080px; margin-inline: auto; padding-inline: 16px; padding-block: 0 112px; }

/* top bar */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 0 28px; border-bottom: 1px solid var(--line); padding-top: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1.15rem; letter-spacing: -.01em; padding-block: 6px; }
.brand svg { display: block; }
.tabs { display: flex; gap: 2px; order: 3; width: 100%; overflow-x: auto; }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 12px 14px; color: var(--ink-2); font-weight: 500; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; margin-bottom: 6px; }
.new-top { display: none; }
@media (min-width: 720px) {
  .tabs { order: 0; width: auto; }
  .new-top { display: inline-flex; }
  .top-actions { margin-bottom: 8px; }
}
.fab { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 20; display: inline-flex; align-items: center; gap: 8px; height: 52px; padding: 0 20px; border-radius: 26px; border: 0; background: var(--btn-bg); color: var(--btn-fg); font-weight: 600; box-shadow: var(--shadow); cursor: pointer; }
@media (min-width: 720px) { .fab { display: none; } }

/* controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 6px; border: 1px solid var(--axis); background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--inset); }
.btn.primary { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-fg); }
.btn.primary:hover { opacity: .88; background: var(--btn-bg); }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.sm { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn[disabled] { opacity: .55; cursor: default; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 6px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--inset); color: var(--ink); }
select, input[type="text"], input[type="search"], input[type="date"], input[type="time"], textarea { width: 100%; min-width: 0; min-height: 40px; padding: 0 10px; border: 1px solid var(--axis); border-radius: 6px; background: var(--surface); color: var(--ink); }
textarea { padding: 8px 10px; resize: vertical; min-height: 64px; }
select { padding-right: 6px; }
.f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 500; color: var(--ink-2); min-width: 0; }
.seg { display: inline-flex; border: 1px solid var(--axis); border-radius: 6px; overflow: hidden; background: var(--surface); }
.seg button { min-height: 32px; padding: 0 12px; border: 0; background: transparent; color: var(--ink-2); font-size: 13px; font-weight: 500; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--axis); }
.seg button[aria-pressed="true"], .seg button[aria-checked="true"] { background: var(--ink); color: var(--surface); }

/* notices and filters */
.notice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 16px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink-2); font-size: 14px; }
.notice.error { border-color: var(--bad); color: var(--ink); }
[hidden] { display: none !important; }
.sync { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink-2); font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; }
.sync i { width: 8px; height: 8px; border-radius: 50%; background: #0ca30c; flex: none; }
.sync.busy i { background: #fab219; }
.sync.off i { background: #d03b3b; }
.loginbox { max-width: 380px; margin: 8vh auto 0; }
.lockico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent, #1c5cab) 14%, transparent); color: var(--accent, #1c5cab); margin-bottom: 12px; }
body.locked .tabs, body.locked .fab, body.locked #new-top, body.locked #filters { display: none !important; }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; padding-block: 18px 6px; }
.filters .f { flex: 1 1 150px; max-width: 240px; }
.range-note { color: var(--ink-3); font-size: 13px; padding-bottom: 10px; flex: 1 1 100%; }
@media (min-width: 720px) { .range-note { flex: 0 1 auto; margin-left: auto; } }

#view { display: flex; flex-direction: column; gap: 16px; padding-top: 12px; }
.loading { color: var(--ink-3); padding: 48px 0; text-align: center; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px; min-width: 0; }
.card-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 14px; }
.card-h h2 { font-size: 1rem; font-weight: 600; }
.sub { color: var(--ink-3); font-size: 13px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 16px; }

/* summary */
.summary { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr); gap: 16px 24px; align-items: center; }
@media (max-width: 760px) { .summary { grid-template-columns: minmax(0, 1fr); } }
.hero .lbl { color: var(--ink-2); font-size: 13px; font-weight: 500; }
.hero-fig { font-size: clamp(3rem, 1rem + 6vw, 3.75rem); font-weight: 600; letter-spacing: -.025em; line-height: 1.05; margin-block: 6px 8px; overflow-wrap: anywhere; }
.hero-fig.lg { font-size: clamp(2.3rem, .6rem + 5vw, 3.2rem); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.status.good { color: var(--good); }
.status.bad { color: var(--bad); }
.status.flat { color: var(--ink-2); }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-left: 1px solid var(--line); }
.kpi { padding: 4px 18px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi + .kpi { border-left: 1px solid var(--line); }
.kpi .lbl { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 13px; font-weight: 500; }
.kpi .val { font-size: 1.55rem; font-weight: 600; letter-spacing: -.015em; overflow-wrap: anywhere; }
.kpi .note { color: var(--ink-3); font-size: 12px; }
@media (max-width: 760px) {
  .kpis { grid-template-columns: 1fr; border-left: 0; border-top: 1px solid var(--line); }
  .kpi { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: baseline; padding: 12px 0; }
  .kpi + .kpi { border-left: 0; border-top: 1px solid var(--line); }
  .kpi .note { flex-basis: 100%; }
}
.key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; flex: none; }
.key.inc, .dot.inc, .k.inc { background: var(--income); }
.key.exp, .dot.exp, .k.exp { background: var(--expense); }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* trend chart */
#trend-box { min-height: 200px; width: 100%; }
#trend-box svg { display: block; max-width: 100%; font-family: var(--font-ui); }
#trend-box .tick { fill: var(--ink-3); font-size: 11px; }
#trend-box .grid { stroke: var(--line); stroke-width: 1; }
#trend-box .base { stroke: var(--axis); stroke-width: 1; }
#trend-box .b-inc { fill: var(--income); }
#trend-box .b-exp { fill: var(--expense); }
#trend-box .hl { fill: var(--inset); opacity: 0; }
#trend-box .hl.on { opacity: 1; }
#trend-box .hit { fill: transparent; cursor: default; outline: none; }
.empty-chart { display: grid; place-items: center; min-height: 160px; color: var(--ink-3); text-align: center; }

/* breakdown bars */
.brows { display: flex; flex-direction: column; gap: 2px; }
.brow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 12px; width: 100%; text-align: left; background: none; border: 0; border-radius: 6px; padding: 8px 8px; margin-inline: -8px; width: calc(100% + 16px); cursor: pointer; }
.brow:hover { background: var(--inset); }
.brow.static { cursor: default; }
.brow .bl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.brow .bv { font-size: 13px; white-space: nowrap; }
.brow .bv b { font-weight: 500; }
.brow .bv span { color: var(--ink-3); margin-left: 8px; }
.brow .bb { grid-column: 1 / -1; height: 10px; }
.brow .bb i { display: block; height: 100%; min-width: 3px; border-radius: 0 4px 4px 0; }
.bb i.exp { background: var(--expense); }
.bb i.inc { background: var(--income); }
.bb i.oth { background: var(--other); }
.hint { margin-top: 10px; color: var(--ink-3); font-size: 12px; }

/* tables */
.scroll { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { font-size: 12px; font-weight: 500; color: var(--ink-3); text-align: right; padding: 0 0 8px 12px; white-space: nowrap; }
.tbl td { padding: 10px 0 10px 12px; border-top: 1px solid var(--line); text-align: right; white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { text-align: left; padding-left: 0; white-space: normal; }
.tbl tfoot td { font-weight: 600; border-top: 1px solid var(--axis); }

/* empty dashboard */
.empty { display: grid; gap: 14px; justify-items: start; padding: 28px 24px; }
.empty h2 { font-size: 1.25rem; font-weight: 600; }
.empty p { color: var(--ink-2); max-width: 52ch; }
.empty svg { max-width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* journal */
.jbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.jbar .f { flex: 1 1 140px; }
.jbar .f.grow { flex: 2 1 220px; }
.jtoggle { display: none; }
@media (max-width: 719px) {
  .tab { padding: 12px 9px; font-size: 14px; }
  #new-top { display: none; }
  .jtoggle { display: inline-flex; align-self: flex-end; }
  .jbar .f.grow { flex: 1 1 100%; }
  .jbar > .f:not(.grow), .jbar > .btn.ghost { display: none; }
  .jbar.show > .f:not(.grow) { display: grid; }
  .jbar.show > .btn.ghost { display: inline-flex; }
  body { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
}
.jhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 16px; }
.jsum { color: var(--ink-2); font-size: 14px; }
.jsum b { font-weight: 600; color: var(--ink); }
.ledger { list-style: none; margin: 8px 0 0; padding: 0; }
.mh { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 22px 0 8px; border-bottom: 1px solid var(--axis); font-weight: 600; font-size: 14px; }
.mh .mono { font-weight: 400; font-size: 12px; color: var(--ink-2); }
.row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto 44px auto; grid-template-areas: "date main amt thumb act"; gap: 4px 14px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.r-date small { display: block; font-size: 11px; opacity: .8; margin-top: 1px; }
.r-date { grid-area: date; font-size: 13px; color: var(--ink-2); padding-top: 2px; }
.r-main { grid-area: main; min-width: 0; }
.r-amt { grid-area: amt; font-size: 14px; font-weight: 500; text-align: right; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; padding-top: 1px; }
.r-thumb { grid-area: thumb; }
.r-act { grid-area: act; display: flex; align-items: center; gap: 2px; justify-content: flex-end; min-height: 34px; margin-top: -6px; }
.r-part { font-weight: 500; overflow-wrap: anywhere; }
.r-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; color: var(--ink-2); font-size: 13px; }
.r-note { margin-top: 4px; color: var(--ink-3); font-size: 13px; overflow-wrap: anywhere; }
.sep { color: var(--axis); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 4px; background: var(--inset); border: 1px solid var(--line); font-size: 12px; color: var(--ink-2); }
.tag.grp { color: var(--ink); font-weight: 500; }
.tag.sample { margin-left: 8px; font-weight: 400; }
.tag.proj { margin-left: 8px; border-color: var(--axis); color: var(--ink); font-weight: 500; }
details.more { border-top: 1px solid var(--line); padding-top: 12px; }
details.more summary { cursor: pointer; font-size: 13px; font-weight: 500; color: var(--ink-2); list-style: none; display: flex; align-items: center; gap: 6px; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: '+'; width: 16px; text-align: center; font-weight: 600; }
details.more[open] summary::before { content: '\2212'; }
details.more .stack, details.more > div { display: grid; gap: 16px; margin-top: 14px; }
.hintline { font-size: 12px; color: var(--ink-3, var(--ink-2)); margin: 4px 0 0; }
.pgrid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.pcard h3 { margin: 0 0 2px; font-size: 1rem; }
.pcard .nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.pcard .nums b { display: block; font-size: 1.05rem; font-family: var(--font-fig); font-weight: 500; }
.pcard .nums span { font-size: 12px; color: var(--ink-2); }
.pcard .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.thumb { padding: 0; border: 1px solid var(--line); border-radius: 4px; width: 40px; height: 40px; overflow: hidden; background: var(--inset); cursor: zoom-in; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ask { font-size: 13px; color: var(--ink-2); margin-right: 6px; }
@media (max-width: 640px) {
  .row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "date amt" "main main" "thumb act"; gap: 6px 12px; }
  .r-act { margin-top: 0; }
}
.noresult { padding: 36px 0; text-align: center; color: var(--ink-2); display: grid; gap: 12px; justify-items: center; }

/* settings */
.setgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 12px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 10px; border: 1px solid var(--axis); border-radius: 6px; background: var(--surface); font-size: 14px; }
.chip button { display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; border: 0; background: transparent; border-radius: 4px; color: var(--ink-3); cursor: pointer; }
.chip button:hover { background: var(--inset); color: var(--ink); }
.addrow { display: flex; gap: 8px; }
.card h3 { font-size: 1rem; font-weight: 600; }
.card .help { color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.stack { display: grid; gap: 12px; }

/* sheet, lightbox, toast, tooltip */
.layer { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.layer .scrim { position: absolute; inset: 0; background: var(--scrim); }
.sheet { position: relative; width: 100%; max-width: 580px; max-height: 100%; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 20px; }
.sheet form { display: grid; gap: 16px; }
.sheet header { display: flex; align-items: center; justify-content: space-between; }
.sheet h2 { font-size: 1.15rem; font-weight: 600; }
.stack-s { display: grid; gap: 16px; }
.g2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 480px) { .g2 { grid-template-columns: minmax(0, 1fr); } }
.cur-wrap { position: relative; }
.cur-wrap .cur { position: absolute; left: 10px; top: 0; bottom: 0; display: flex; align-items: center; color: var(--ink-3); pointer-events: none; }
.cur-wrap input { padding-left: 28px; font-family: var(--font-fig); font-variant-numeric: tabular-nums; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend, .lbl-s { padding: 0; font-size: 12px; font-weight: 500; color: var(--ink-2); margin-bottom: 6px; display: block; }
.pchips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.pchip { min-height: 34px; padding: 0 12px; border: 1px solid var(--axis); border-radius: 6px; background: var(--surface); font-size: 14px; cursor: pointer; }
.pchip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.linkbtn { background: none; border: 0; padding: 4px 0; margin-top: 4px; color: var(--ink-2); font-size: 13px; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; justify-self: start; }
.qa { display: flex; gap: 8px; margin-top: 6px; }
.drop { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px; border: 1px dashed var(--axis); border-radius: 8px; background: var(--inset); }
.drop.over { border-color: var(--ink); }
.drop .pv { width: 64px; height: 64px; border-radius: 6px; object-fit: cover; border: 1px solid var(--line); background: var(--surface); }
.drop .txt { flex: 1 1 160px; color: var(--ink-2); font-size: 13px; }
.drop label.btn:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.err { color: var(--bad); font-size: 13px; min-height: 1em; }
.foot { display: flex; justify-content: flex-end; gap: 10px; }
.lightbox .scrim { background: rgba(0, 0, 0, .8); }
.lightbox figure { position: relative; margin: 0; max-width: 100%; max-height: 100%; display: grid; gap: 10px; justify-items: center; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 120px); border-radius: 6px; background: #fff; }
.lightbox figcaption { color: #fff; font-size: 14px; }
.lightbox .btn { position: absolute; top: 8px; right: 8px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom, 0px)); z-index: 70; max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 8px; background: var(--ink); color: var(--surface); font-size: 14px; box-shadow: var(--shadow); }
@media (min-width: 720px) { .toast { bottom: 28px; } }
.tip { position: fixed; z-index: 80; pointer-events: none; max-width: 260px; padding: 8px 10px; border: 1px solid var(--axis); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow); font-size: 13px; }
.tip .tip-t { color: var(--ink-2); margin-bottom: 4px; }
.tip .tip-r { display: flex; align-items: baseline; gap: 8px; }
.tip .tip-r b { font-weight: 600; }
.tip .tip-r span { color: var(--ink-2); }
.tip .k { display: inline-block; width: 12px; height: 3px; border-radius: 2px; align-self: center; }
@media (max-width: 640px) {
  .layer.sheet-layer { align-items: flex-end; padding: 0; }
  .sheet { max-width: none; border-radius: 14px 14px 0 0; max-height: 94%; padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: no-preference) {
  .sheet { animation: rise .16s ease-out; }
  @keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}
/* export, import, theme */
.sheet.wide { max-width: 760px; }
.stack header { display: flex; align-items: center; justify-content: space-between; }
.opts { display: grid; gap: 10px; }
.opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--axis); border-radius: 8px; background: var(--surface); cursor: pointer; }
.opt:hover { background: var(--inset); }
.opt:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.opt input, .check input { margin-top: 4px; accent-color: var(--ink); flex: none; }
.opt b { display: block; font-weight: 600; }
.opt small { display: block; margin-top: 2px; color: var(--ink-2); font-size: 13px; line-height: 1.45; }
.opt .rec { display: inline-block; margin-left: 8px; padding: 0 6px; border-radius: 4px; background: var(--ink); color: var(--surface); font-size: 11px; font-weight: 500; vertical-align: 1px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.prog .bar { height: 8px; border-radius: 4px; background: var(--inset); border: 1px solid var(--line); overflow: hidden; }
.prog .bar i { display: block; height: 100%; width: 0; background: var(--ink); transition: width .2s; }
.prog p { margin-top: 6px; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 12px; }
.drop.big { flex-direction: column; justify-content: center; text-align: center; padding: 30px 16px; gap: 14px; }
.drop.big .txt { flex: none; font-size: 14px; }
.tbl.left th, .tbl.left td { text-align: left; }
.tbl.left th.r, .tbl.left td.r { text-align: right; }
.tbl.left td { white-space: normal; overflow-wrap: anywhere; }
.toast-btn { margin-left: 14px; padding: 0; border: 0; background: none; color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
/* Long journals stay fast without pagination */
.ledger .row { content-visibility: auto; contain-intrinsic-size: auto 64px; }
/* Print / save as PDF from the browser or host: every entry, no controls, no blank trailing pages */
@media print {
  @page { size: A4; margin: 12mm; }
  html, body { height: auto !important; min-height: 0 !important; overflow: visible !important; background: #fff !important; }
  .top, .tabs, .top-actions, .fab, #notice, #filters, .jbar, .jhead .actions, .r-act, .toast, #tip, #layer-root, .noresult, .view-actions { display: none !important; }
  body::before, body::after { display: none !important; }
  .card { box-shadow: none !important; break-inside: auto; border-color: #ddd !important; }
  .row, .mh { break-inside: avoid; page-break-inside: avoid; }
  .mh { break-after: avoid; }
  .row { grid-template-columns: 70px minmax(0, 1fr) auto 64px !important; grid-template-areas: "date main amt thumb" !important; padding: 8px 0 !important; }
  .thumb { width: 56px !important; height: 56px !important; border: 1px solid #ccc !important; }
  .thumb img { display: block !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
