:root {
  --bone: #E7E0D6;
  --sand: #DBC8A6;
  --khaki: #B2A78B;
  --olive: #4F493C;
  --ink: #141316;

  --paper: #1A191C;      /* card */
  --paper-2: #211F21;    /* raised */
  --rule: #2E2B28;       /* hairlines */
  --rust: #C47E5E;       /* outgoings */
  --sage: #9DAA80;       /* incomings */
  --muted: #8E8672;

  --display: "Special Elite", "Courier New", monospace;
  --type: "Courier Prime", "Courier New", monospace;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--type);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button, input, select { font: inherit; color: inherit; }
code { font-family: var(--type); color: var(--sand); font-size: .92em; }

/* ---------- background engraving ---------- */
.bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.bg .contours path { stroke: var(--sand); opacity: .055; }
.bg .stamp circle { stroke: var(--sand); opacity: .12; }
.bg .stamp text { fill: var(--sand); opacity: .14; }

.shell { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 22px 28px 60px; }

/* ---------- header (sticky) ---------- */
.top {
  position: sticky; top: 0; z-index: 20; margin: -22px -28px 0; padding: 14px 28px 0;
  background: linear-gradient(180deg, rgba(20,19,22,.97) 70%, rgba(20,19,22,.88));
  backdrop-filter: blur(6px); border-bottom: 1px dashed var(--olive);
}
.top-in { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.brand { display: flex; flex-direction: column; padding-bottom: 12px; }
.mark { font-family: var(--display); font-size: 30px; color: var(--sand); letter-spacing: 1px; line-height: 1; }
.mark .dot { color: var(--rust); }
.sub { color: var(--muted); font-size: 11px; letter-spacing: 2px; text-transform: lowercase; margin-top: 4px; }
.tabs { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; align-self: flex-end; }
.tabs button {
  background: none; border: 0; padding: 10px 14px 12px; cursor: pointer;
  color: var(--khaki); letter-spacing: 1.5px; font-size: 16px; font-family: var(--display);
  border-bottom: 3px solid transparent; display: inline-flex; align-items: baseline; gap: 7px;
}
.tabs button i { font-style: normal; font-family: var(--type); font-size: 10px; color: var(--olive); border: 1px solid var(--olive); padding: 0 4px; line-height: 14px; }
.tabs button:hover { color: var(--bone); }
.tabs button:hover i { color: var(--khaki); border-color: var(--khaki); }
.tabs button.on { color: var(--sand); border-bottom-color: var(--rust); }
.tabs button.on i { color: var(--ink); background: var(--sand); border-color: var(--sand); }
.cur-switch { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; letter-spacing: 1px; padding-bottom: 12px; }

/* page titles */
.page-head { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; margin: 30px 0 4px; padding-bottom: 10px; border-bottom: 1px solid var(--rule); }
.page-head h1 { font-family: var(--display); font-weight: 400; font-size: 44px; line-height: 1; margin: 0; color: var(--bone); letter-spacing: 1px; }
.page-head h1::first-letter { color: var(--sand); }
.page-head p { margin: 0; color: var(--muted); font-size: 14px; }

select, input[type=text], input:not([type]), input[type=number], input[type=date], input[type=month], input[type=password] {
  background: var(--paper); border: 1px solid var(--olive); border-radius: 2px;
  padding: 6px 8px; outline: none;
}
select:focus, input:focus { border-color: var(--khaki); }
select { cursor: pointer; }

/* ---------- quick entry ---------- */
.quick { margin: 22px 0 8px; }
#quickForm {
  display: flex; align-items: center; gap: 10px;
  background: var(--paper); border: 1px solid var(--olive);
  padding: 8px 10px 8px 16px; border-radius: 2px;
  box-shadow: 0 1px 0 #000, inset 0 0 0 1px rgba(219,200,166,.03);
}
#quickForm:focus-within { border-color: var(--khaki); }
.prompt { font-family: var(--display); color: var(--rust); font-size: 22px; }
#quickInput { flex: 1; min-width: 0; background: none; border: 0; font-size: 18px; padding: 8px 4px; color: var(--bone); }
#quickInput::placeholder { color: #5f5949; }
#quickCur { background: none; border-color: var(--rule); color: var(--khaki); }
.scan-btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--khaki);
  padding: 6px 10px; border: 1px dashed var(--olive); border-radius: 2px; letter-spacing: 1px;
}
.scan-btn:hover { color: var(--sand); border-color: var(--khaki); }
.enter { background: var(--sand); color: var(--ink); border: 0; padding: 8px 14px; border-radius: 2px; cursor: pointer; letter-spacing: 1px; font-weight: 700; }
.enter:hover { background: var(--bone); }

.preview { min-height: 34px; padding: 8px 4px 0 44px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; }
.preview .chip {
  border: 1px solid var(--olive); padding: 2px 9px; border-radius: 2px; cursor: pointer; background: transparent; color: var(--khaki);
  font-size: 13px;
}
.preview .chip:hover { border-color: var(--khaki); color: var(--bone); }
.preview .chip.sel { background: var(--sand); border-color: var(--sand); color: var(--ink); }
.preview .chip.t-income.sel { background: var(--sage); border-color: var(--sage); }
.preview .chip.t-expense.sel { background: var(--rust); border-color: var(--rust); color: var(--ink); }
.preview .amt { color: var(--bone); font-weight: 700; font-size: 15px; }
.preview .sep { color: var(--olive); }

/* ---------- layout ---------- */
.tab { display: none; }
.tab.on { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

.card {
  background: linear-gradient(180deg, rgba(33,31,33,.92), rgba(26,25,28,.92));
  border: 1px solid var(--rule); border-radius: 2px; padding: 20px 24px 24px; margin-bottom: 22px;
  position: relative;
}
.card::before { /* corner tick, like a ledger book */
  content: ""; position: absolute; left: -1px; top: -1px; width: 14px; height: 14px;
  border-left: 1px solid var(--khaki); border-top: 1px solid var(--khaki); opacity: .5;
}
.card h3 {
  font-family: var(--display); font-weight: 400; font-size: 21px; letter-spacing: 1.5px;
  text-transform: lowercase; color: var(--sand); margin: 0 0 18px; padding-bottom: 8px;
  border-bottom: 1px dotted var(--olive);
}
.card h3.mt { margin-top: 26px; }
.card h4 { font-weight: 400; color: var(--khaki); letter-spacing: 2px; font-size: 12px; text-transform: uppercase; margin: 0 0 8px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.card-head h3 { margin: 0; }
.hint { color: var(--muted); font-family: var(--type); font-size: 12px; letter-spacing: 0; text-transform: none; }
.grid2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 18px; }
.card { min-width: 0; }
.grid2 > .card { margin-bottom: 18px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.period { display: flex; justify-content: space-between; align-items: center; margin: 18px 0 14px; gap: 12px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--olive); border-radius: 2px; overflow: hidden; }
.seg button { background: none; border: 0; padding: 8px 16px; font-size: 14px; cursor: pointer; color: var(--khaki); letter-spacing: 1px; }
.seg button + button { border-left: 1px solid var(--olive); }
.seg button.on { background: var(--olive); color: var(--bone); }
.stepper { display: flex; align-items: center; gap: 14px; }
.stepper button { background: none; border: 1px solid var(--olive); width: 38px; height: 38px; cursor: pointer; color: var(--sand); font-size: 18px; border-radius: 2px; }
.stepper button:hover { border-color: var(--khaki); }
.stepper button:disabled { opacity: .25; cursor: default; }
#periodLabel { font-family: var(--display); font-size: 26px; color: var(--bone); min-width: 220px; text-align: center; letter-spacing: 1px; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--rule); margin-bottom: 18px; background: rgba(26,25,28,.85); }
.kpi { padding: 18px 20px 20px; min-width: 0; border-left: 1px dashed var(--rule); }
.kpi:first-child { border-left: 0; }
.kpi .lbl { font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--muted); }
.kpi .val { font-family: var(--display); font-size: clamp(24px, 3vw, 38px); line-height: 1.1; margin-top: 8px; color: var(--bone); overflow-wrap: anywhere; }
.kpi .val.in { color: var(--sage); }
.kpi .val.out { color: var(--rust); }
.kpi .note { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* bars */
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(96px, 150px) 1fr auto; gap: 12px; align-items: center; cursor: pointer; }
.bar-row .name { color: var(--khaki); font-size: 15px; line-height: 1.2; overflow-wrap: anywhere; }
.bar-row .track { height: 12px; background: repeating-linear-gradient(90deg, var(--rule) 0 1px, transparent 1px 8px); position: relative; }
.bar-row .fill { position: absolute; inset: 0 auto 0 0; background: var(--rust); opacity: .85; transition: width .4s ease; }
.bar-row.inc .fill { background: var(--sage); }
.bar-row .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 14px; }
.bar-row .num small { color: var(--muted); margin-left: 6px; }
.bar-row:hover .name { color: var(--bone); }
.empty { color: var(--muted); font-style: italic; padding: 6px 0; }

.biggest { margin: 0; padding: 0; list-style: none; counter-reset: b; }
.biggest li { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; padding: 6px 0; border-bottom: 1px dotted var(--rule); font-size: 14px; cursor: pointer; }
.biggest li::before { counter-increment: b; content: counter(b) "."; color: var(--muted); }
.biggest li span:first-child { overflow-wrap: anywhere; }
.biggest li span:last-child { white-space: nowrap; }
.biggest li em { display: block; margin-left: 0 !important; }
.biggest li em { font-style: normal; color: var(--muted); font-size: 12px; margin-left: 6px; }

/* charts */
.chart { width: 100%; position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis text, .chart text.lbl { fill: var(--muted); font-family: var(--type); font-size: 11px; }
.chart .gridline { stroke: var(--rule); stroke-dasharray: 2 4; }
.chart .b-out { fill: var(--rust); opacity: .85; }
.chart .b-in { fill: var(--sage); opacity: .85; }
.chart .b-plan { fill: none; stroke: var(--sand); stroke-dasharray: 3 3; }
.chart .b-hit { fill: transparent; cursor: pointer; }
.chart .b-hit:hover { fill: rgba(219,200,166,.06); }
.chart .line-net { fill: none; stroke: var(--sand); stroke-width: 1.4; }
.chart .dot-net { fill: var(--ink); stroke: var(--sand); stroke-width: 1.4; }
.chart .today { stroke: var(--khaki); stroke-dasharray: 1 3; }
.chart.small { margin-top: 12px; }
.tip {
  position: absolute; pointer-events: none; background: var(--ink); border: 1px solid var(--olive);
  padding: 6px 9px; font-size: 12px; white-space: nowrap; transform: translate(-50%, -110%); display: none; z-index: 3;
}
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; }

/* ---------- ledger ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 10px; align-items: center; }
.filters #fSearch { flex: 1; min-width: 180px; }
.chk { color: var(--khaki); font-size: 13px; display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.chk input { accent-color: var(--rust); }
.ghost {
  background: none; border: 1px solid var(--olive); color: var(--khaki); padding: 6px 12px; cursor: pointer; border-radius: 2px; letter-spacing: .5px;
}
.ghost:hover { color: var(--bone); border-color: var(--khaki); }
.solid { background: var(--sand); color: var(--ink); border: 0; padding: 7px 16px; cursor: pointer; border-radius: 2px; font-weight: 700; }
.solid:hover { background: var(--bone); }
.danger { background: none; border: 1px solid transparent; color: var(--rust); cursor: pointer; padding: 6px 10px; }
.danger:hover { border-color: var(--rust); }
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-actions.wrap { flex-wrap: wrap; }
.filebtn { display: inline-block; }
.ledger-sum { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.ledger-sum b { color: var(--bone); font-weight: 400; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
table.ledger th { text-align: left; font-weight: 400; color: var(--muted); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; padding: 8px 10px; border-bottom: 1px solid var(--olive); }
table.ledger td { padding: 9px 10px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
table.ledger tbody tr { background: rgba(20,19,22,.6); }
table.ledger tbody tr:hover { background: rgba(79,73,60,.25); }
table.ledger tr.month-break td { background: transparent; color: var(--sand); font-family: var(--display); letter-spacing: 2px; padding: 18px 10px 6px; border-bottom: 1px dashed var(--olive); font-size: 14px; }
table.ledger tr.month-break td span { float: right; font-family: var(--type); color: var(--muted); font-size: 12px; letter-spacing: 0; }
.r { text-align: right; }
td.date { color: var(--khaki); white-space: nowrap; font-size: 14px; }
td.amt { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.amt .orig { display: block; color: var(--muted); font-size: 11px; }
td.amt.in { color: var(--sage); }
td.note { color: var(--bone); max-width: 380px; }
td.note .flag { color: var(--rust); font-size: 11px; letter-spacing: 1px; margin-left: 8px; border: 1px solid var(--rust); padding: 0 5px; }
td.note .src { color: var(--muted); font-size: 11px; margin-left: 6px; }
.stampc {
  display: inline-block; font-size: 12px; letter-spacing: 1px; padding: 1px 7px; border: 1px solid currentColor; border-radius: 2px;
  color: var(--khaki); text-transform: lowercase; white-space: nowrap;
}
.stampc.in { color: var(--sage); }
td.act { white-space: nowrap; text-align: right; width: 1%; }
td.act button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 2px 6px; font-size: 13px; }
td.act button:hover { color: var(--bone); }
td.act button.del:hover { color: var(--rust); }
.more { display: block; margin: 14px auto 0; }

/* ---------- plan grid ---------- */
table.grid { font-size: 13px; }
table.grid th, table.grid td { padding: 6px 7px; border-bottom: 1px solid var(--rule); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.grid th { color: var(--muted); font-weight: 400; letter-spacing: 1px; font-size: 11px; text-transform: uppercase; }
table.grid th:first-child, table.grid td:first-child { text-align: left; color: var(--khaki); position: sticky; left: 0; background: var(--paper-2); }
table.grid td.cell { cursor: text; }
table.grid td.cell:hover { background: rgba(79,73,60,.3); }
table.grid td.cell.zero { color: #4b463c; }
table.grid td.cell input { width: 72px; text-align: right; padding: 2px 4px; font-size: 13px; }
table.grid td.act-cell { color: var(--muted); font-size: 11px; }
table.grid td.act-cell.over { color: var(--rust); }
table.grid tr.total td { color: var(--sand); border-top: 1px solid var(--olive); }
table.grid tr.actual td { color: var(--muted); }
table.grid td.avg { color: var(--sand); border-left: 1px dashed var(--olive); }
table.grid .rmcat { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 0 0 6px; visibility: hidden; }
table.grid tr:hover .rmcat { visibility: visible; }

/* ---------- family ---------- */
.prog { margin: 6px 0 4px; }
.prog .track { height: 22px; border: 1px solid var(--olive); position: relative; background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(79,73,60,.35) 6px 7px); }
.prog .fill { position: absolute; inset: 0 auto 0 0; background: var(--sand); opacity: .85; }
.prog .fill.repaid { background: var(--sage); opacity: 1; }
.prog .cap { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }
.prog + .prog { margin-top: 18px; }
.lenders { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 22px; }
.lender { border: 1px dashed var(--olive); padding: 10px 12px; }
.lender .who { font-family: var(--display); color: var(--sand); letter-spacing: 1px; }
.lender .owe { font-size: 20px; margin-top: 2px; }
.lender .det { font-size: 12px; color: var(--muted); }
.split { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(0,1fr); gap: 28px; align-items: start; }
.split .lenders { margin-top: 0; }
.lender .owe { font-family: var(--display); font-size: 24px; }

/* shared labelled field */
.pfield { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pfield > span { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.pfield .inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pfield input[type=number] { width: 150px; font-size: 16px; }
.pfield input[type=month], .pfield input[type=date] { min-width: 170px; font-size: 15px; }
.pfield select { font-size: 15px; }
.pfield .chk { font-size: 14px; padding-top: 6px; }
.pfield .chk b { color: var(--sand); font-weight: 400; }
.cur-tag { color: var(--khaki); font-weight: 400; }
.seg.mini button { padding: 6px 12px; min-width: 44px; }

.planner { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px 24px; padding-bottom: 18px; border-bottom: 1px dotted var(--rule); }
.repay-out { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0; margin: 18px 0 6px; border: 1px solid var(--rule); }
.repay-out .ro { padding: 14px 16px; border-left: 1px dashed var(--rule); }
.repay-out .ro:first-child { border-left: 0; }
.repay-out .ro .lbl { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.repay-out .ro .v { font-family: var(--display); font-size: 26px; color: var(--sand); margin-top: 6px; line-height: 1.1; }
.repay-out .ro .v.good { color: var(--sage); }
.repay-out .ro .n { font-size: 12px; color: var(--muted); margin-top: 4px; }
table.sched { margin-top: 14px; }
table.sched td:first-child, table.sched th:first-child { background: transparent; position: static; }
table.sched tr.done td { color: var(--sage); }

/* export */
.export-row { display: flex; gap: 18px 24px; flex-wrap: wrap; margin-bottom: 18px; }
.export-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.exp {
  text-align: left; background: rgba(20,19,22,.6); border: 1px solid var(--olive); color: var(--bone); padding: 14px 16px; cursor: pointer; border-radius: 2px;
  display: flex; flex-direction: column; gap: 4px; transition: border-color .15s, background .15s;
}
.exp b { font-family: var(--display); font-weight: 400; font-size: 18px; color: var(--sand); letter-spacing: 1px; }
.exp span { font-size: 12px; color: var(--muted); }
.exp:hover { border-color: var(--sand); background: rgba(79,73,60,.25); }
.exp:disabled { opacity: .5; cursor: wait; }
.ghost-sel { background: none; border: 1px solid var(--olive); color: var(--khaki); padding: 6px 10px; }

/* ---------- settings ---------- */
.catcols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cats { list-style: none; padding: 0; margin: 0 0 10px; }
.cats li { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; border-bottom: 1px dotted var(--rule); }
.cats li span.n { color: var(--muted); font-size: 12px; margin-left: auto; margin-right: 10px; }
.cats li button { background: none; border: 0; color: var(--muted); cursor: pointer; }
.cats li button:hover { color: var(--rust); }
.catadd { display: flex; gap: 6px; }
.catadd input { flex: 1; min-width: 0; }
.catadd button { background: none; border: 1px solid var(--olive); color: var(--sand); cursor: pointer; width: 34px; border-radius: 2px; }
.rates { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 10px 0 12px; }
.rates label { display: flex; align-items: center; gap: 8px; color: var(--khaki); }
.rates input { width: 90px; }
.field { display: flex; align-items: center; gap: 10px; color: var(--khaki); margin-top: 14px; }
.keyform { display: flex; gap: 8px; margin: 10px 0; }
.keyform input { flex: 1; }
.keyform button { background: none; border: 1px solid var(--olive); color: var(--sand); cursor: pointer; padding: 0 14px; }

/* ---------- dialogs ---------- */
.dlg {
  background: var(--paper-2); color: var(--bone); border: 1px solid var(--olive); border-radius: 2px; padding: 22px 24px; width: min(440px, 94vw);
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
.dlg::backdrop { background: rgba(10,9,11,.72); backdrop-filter: blur(2px); }
.dlg h3 { font-family: var(--display); font-weight: 400; color: var(--sand); letter-spacing: 2px; margin: 0 0 14px; text-transform: lowercase; }
.dlg label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12px; letter-spacing: 1px; margin-bottom: 12px; }
.dlg label input, .dlg label select { font-size: 15px; color: var(--bone); }
.dlg .two { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }
.type-seg { margin-bottom: 14px; }
.type-seg button.on[data-v=expense], .type-seg button.on[data-v=repaid] { background: var(--rust); color: var(--ink); }
.type-seg button.on[data-v=income], .type-seg button.on[data-v=received] { background: var(--sage); color: var(--ink); }
.dlg-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.spacer { flex: 1; }
.dlg.wide { width: min(980px, 96vw); padding: 0; }
.scan-wrap { display: grid; grid-template-columns: 1fr 1.25fr; min-height: 420px; }
.scan-img { background: #0c0b0d; display: flex; align-items: center; justify-content: center; border-right: 1px solid var(--olive); max-height: 80vh; overflow: auto; }
.scan-img img { max-width: 100%; max-height: 80vh; display: none; }
.scan-img iframe { width: 100%; height: 78vh; border: 0; display: none; background: #fff; }
.scan-side { padding: 22px 22px; display: flex; flex-direction: column; max-height: 80vh; overflow: auto; }
#scanRows { flex: 1; }
.srow { display: grid; grid-template-columns: 20px 118px 1fr 84px 66px 58px; gap: 6px; align-items: center; padding: 6px 0; border-bottom: 1px dotted var(--rule); }
.srow input, .srow select { font-size: 13px; padding: 4px 5px; width: 100%; }
.srow .note-in { grid-column: 2 / -1; }
.srow input[type=checkbox] { accent-color: var(--sand); }
.srow.off { opacity: .4; }
.srow .tsel.expense { color: var(--rust); }
.srow .tsel.income { color: var(--sage); }
.spinner { display: inline-block; width: 10px; height: 10px; border: 1px solid var(--sand); border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; margin-right: 8px; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- toast & footer ---------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 30px); opacity: 0; transition: all .25s ease;
  background: var(--bone); color: var(--ink); padding: 10px 16px; border-radius: 2px; z-index: 50; display: flex; gap: 14px; align-items: center;
  font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.5); max-width: 92vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast button { background: none; border: 0; color: var(--ink); text-decoration: underline; cursor: pointer; font-weight: 700; }
.foot { margin-top: 30px; color: #5f5949; font-size: 12px; text-align: right; letter-spacing: 1px; }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .shell { padding: 16px 16px 50px; }
  .top { margin: -16px -16px 0; padding: 10px 16px 0; }
  .top-in { gap: 6px 12px; }
  .brand { padding-bottom: 4px; }
  .mark { font-size: 24px; }
  .sub { display: none; }
  .tabs { gap: 0; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .tabs button { padding: 8px 10px 10px; font-size: 15px; }
  .tabs button i { display: none; }
  .page-head { margin-top: 20px; }
  .page-head h1 { font-size: 34px; }
  .split { grid-template-columns: minmax(0,1fr); }
  #periodLabel { font-size: 21px; min-width: 0; }
  .grid2, .catcols { grid-template-columns: minmax(0,1fr); }
  .top { gap: 12px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi:nth-child(3) { border-left: 0; }
  .kpi:nth-child(n+3) { border-top: 1px dashed var(--rule); }
  .tabs { margin-left: 0; width: 100%; order: 3; }
  .cur-switch { margin-left: auto; }
  #quickForm { flex-wrap: wrap; }
  #quickInput { flex-basis: 100%; order: -1; font-size: 16px; }
  .prompt { display: none; }
  .preview { padding-left: 4px; }
  .scan-wrap { grid-template-columns: 1fr; }
  .scan-img { max-height: 32vh; border-right: 0; border-bottom: 1px solid var(--olive); }
  .bar-row { grid-template-columns: minmax(80px, 110px) 1fr auto; }
  td.note { max-width: 160px; }
  .srow { grid-template-columns: 20px 1fr 1fr 1fr; }
  .kpi .val { font-size: 24px; }
  .kpi { padding: 14px 14px 16px; }
}
.danger-solid { background: var(--rust) !important; }
.dlg p { margin: 0 0 14px; font-size: 14px; }
/* payback form polish */
.pfield .chk { display: block; line-height: 1.5; }
.pfield .chk input { vertical-align: -2px; margin-right: 6px; }
.pfield .chk b { white-space: nowrap; }
#stepValue { width: 90px; }
.planner .inline { flex-wrap: nowrap; }
table.sched td:nth-child(2), table.sched th:nth-child(2) { text-align: left; }
[hidden] { display: none !important; }
@media (max-width: 860px) {
  .tabs { width: 100%; justify-content: space-between; overflow: visible; }
  .tabs button { padding: 8px 2px 10px; font-size: 14px; letter-spacing: .3px; }
}

/* exchange-rate bits */
.rate-row { border: 1px dashed var(--olive); padding: 10px 12px 2px; margin-bottom: 12px; }
.rate-line { display: flex; align-items: center; gap: 8px; }
.rate-line input { flex: 1; }
.rate-line b { color: var(--khaki); font-weight: 400; }
#rateHint { letter-spacing: 0; font-size: 12px; }
.dlg input[readonly] { color: var(--khaki); background: transparent; }
.preview .fx { color: var(--khaki); }
.preview select.chip { max-width: none; }
.preview .rate-in { width: 90px; padding: 2px 6px; background: var(--paper); }

/* plan explanation */
.how-sum { margin: 0 0 16px; color: var(--bone); max-width: 900px; line-height: 1.6; }
table.grid.how td, table.grid.how th { white-space: normal; vertical-align: top; }
table.grid.how td:nth-child(2), table.grid.how td:nth-child(3), table.grid.how td:nth-child(4) { white-space: nowrap; }
table.grid.how td.why { text-align: left; color: var(--muted); font-size: 12.5px; line-height: 1.5; min-width: 320px; max-width: 520px; }
table.grid.how th:last-child { text-align: left; }
table.grid.how td.up { color: var(--rust); }
table.grid.how td.down { color: var(--sage); }
table.grid.how td:first-child { background: transparent; position: static; }

/* bill reading card */
.scan-now { margin: 0 0 14px; line-height: 1.6; }
.scan-now b { color: var(--sand); font-weight: 400; }
.scan-modes { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; margin-bottom: 12px; }
.mode { border: 1px solid var(--rule); padding: 10px 12px; opacity: .7; }
.mode.on { border-color: var(--sand); opacity: 1; }
.mode b { font-family: var(--display); font-weight: 400; color: var(--sand); font-size: 17px; margin-right: 8px; }
.mode .tag { font-size: 11px; color: var(--muted); letter-spacing: 1px; }
.mode ul { margin: 8px 0 0; padding-left: 16px; font-size: 13px; color: var(--khaki); line-height: 1.5; }
.howto { margin: 4px 0 10px; font-size: 14px; }
.howto summary { cursor: pointer; color: var(--sand); }
.howto ol { margin: 8px 0 0; padding-left: 20px; line-height: 1.7; color: var(--bone); }
.howto a { color: var(--sand); }
@media (max-width: 860px) { .scan-modes { grid-template-columns: minmax(0,1fr); } }

.scan-list { margin: 0; padding-left: 18px; line-height: 1.7; color: var(--khaki); font-size: 14px; }
.scan-list b { color: var(--bone); font-weight: 400; }

/* family forecast */
.fc-intro { margin: -6px 0 16px; max-width: 760px; }
.fc-inputs { margin-bottom: 14px; }
.eur-tag { color: var(--khaki); font-weight: 400; }
table.fc { width: 100%; font-size: 14px; }
table.fc td { padding: 9px 10px; border-bottom: 1px dotted var(--rule); vertical-align: top; }
table.fc td:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.fc td:nth-child(2) { font-size: 12.5px; }
table.fc td.good { color: var(--sage); }
table.fc tr.fc-sub td { border-top: 1px solid var(--olive); color: var(--sand); }
table.fc tr.total td { border-top: 1px solid var(--olive); color: var(--bone); }
table.fc tr.total td:first-child { color: var(--sand); }
table.fc tr.big td { font-family: var(--display); font-size: 18px; }
table.fc tr.big td.muted { font-family: var(--type); font-size: 12.5px; }
table.fc .inr { display: block; color: var(--sand); font-family: var(--display); font-size: 18px; }

/* kannada wordmark */
.mark .kn { font-family: "Noto Serif Kannada", serif; font-size: .82em; color: var(--khaki); margin-left: 14px; padding-left: 14px; border-left: 1px solid var(--olive); letter-spacing: 1px; vertical-align: .08em; font-weight: 400; }
.bg .stamp text { font-family: "Special Elite", "Noto Serif Kannada", monospace; }
table.fc tr.info td { color: var(--muted); border-bottom: 1px dashed var(--olive); padding-bottom: 14px; }

/* cash / card */
.preview .chip.pay.sel { background: var(--khaki); border-color: var(--khaki); color: var(--ink); }
.paytag { color: var(--sand); font-size: 11px; letter-spacing: 1px; margin-left: 8px; border: 1px dashed var(--sand); padding: 0 5px; }
.pay-seg { margin: 4px 0 0; align-self: flex-start; }
.pay-seg button.on { background: var(--khaki) !important; color: var(--ink) !important; }
.wallet { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 26px; margin: -8px 0 18px; padding: 12px 18px; border: 1px dashed var(--olive); background: rgba(20,19,22,.6); }
.w-item { display: flex; align-items: baseline; gap: 10px; }
.w-item i { font-style: normal; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.w-item b { font-family: var(--display); font-weight: 400; font-size: 20px; color: var(--bone); }
.w-item.total b { color: var(--sand); }
.w-upd { margin-left: auto; }
/* statement rows */
.srow { grid-template-columns: 20px 118px 1fr 80px 62px 52px 60px !important; }
.srow .sstat { grid-column: 2 / -1; font-size: 11.5px; letter-spacing: .5px; }
.srow .sstat.dup { color: var(--rust); }
.srow .sstat.new { color: var(--sage); }
.srow.off .sstat.dup { opacity: 1; }
.thumbs { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; }
.thumbs img { height: 90px; width: auto; display: block !important; border: 1px solid var(--olive); }
.scan-img { flex-direction: column; }
.dlg.wide { width: min(1100px, 97vw); }
@media (max-width: 860px) { .srow { grid-template-columns: 20px 1fr 1fr 1fr !important; } .w-upd { margin-left: 0; } }

.paytag.india { color: var(--sage); border-color: var(--sage); }
.w-sep { width: 1px; align-self: stretch; background: var(--olive); }
.w-item.india b { color: var(--sage); }
@media (max-width: 860px) { .w-sep { display: none; } }


/* =====================================================================
   MOBILE  (phones and small tablets)
   ===================================================================== */
.tabs .ti { display: none; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.shell { padding-left: max(28px, env(safe-area-inset-left, 0px)); padding-right: max(28px, env(safe-area-inset-right, 0px)); }

@media (max-width: 760px) {
  html { -webkit-text-size-adjust: 100%; }
  body { font-size: 15px; }
  .shell { padding: calc(env(safe-area-inset-top, 0px) + 10px) max(16px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 86px) max(16px, env(safe-area-inset-left, 0px)); }

  /* header: brand + currency only; it scrolls away to give the page room */
  .top { position: static; margin: 0; padding: 0 0 10px; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom: 1px dashed var(--olive); }
  .top-in { flex-wrap: nowrap; align-items: center; gap: 10px; }
  .brand { padding-bottom: 0; min-width: 0; }
  .mark { font-size: 22px; white-space: nowrap; }
  .mark .kn { font-size: .8em; margin-left: 8px; padding-left: 8px; }
  .sub { display: none; }
  .cur-switch { margin-left: auto; padding-bottom: 0; }
  .cur-switch label { display: none; }

  /* tabs become a bottom bar, like a phone app */
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; margin: 0; width: auto; order: 0;
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; overflow: visible;
    padding: 6px max(6px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px));
    background: rgba(20, 19, 22, .97); border-top: 1px solid var(--olive);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  }
  .tabs button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    padding: 6px 0 4px; min-height: 52px; font-size: 11px; letter-spacing: .5px; font-family: var(--type);
    border-bottom: 0; border-top: 2px solid transparent; border-radius: 0; color: var(--muted);
  }
  .tabs button i { display: none; }
  .tabs .ti { display: block; }
  .tabs button.on { color: var(--sand); border-top-color: var(--rust); background: rgba(219, 200, 166, .05); }

  /* quick entry: big, easy to hit */
  .quick { margin: 14px 0 4px; }
  #quickForm { padding: 8px; gap: 8px; flex-wrap: wrap; }
  #quickInput { flex-basis: 100%; order: -1; font-size: 18px; padding: 10px 8px; }
  #quickCur, .scan-btn, .enter { min-height: 44px; }
  #quickCur { flex: 0 0 auto; font-size: 16px; }
  .scan-btn { flex: 1 1 auto; justify-content: center; }
  .enter { flex: 1 1 auto; font-size: 16px; }
  .preview { padding: 8px 0 0; gap: 6px; font-size: 13px; }
  .preview .chip { min-height: 34px; padding: 4px 10px; font-size: 13px; }
  .preview .rate-in { min-height: 34px; }

  /* page titles and blocks */
  .page-head { margin: 18px 0 2px; gap: 6px 12px; }
  .page-head h1 { font-size: 32px; }
  .page-head p { font-size: 13px; flex-basis: 100%; }
  .card { padding: 16px 14px 18px; margin-bottom: 14px; }
  .card h3 { font-size: 18px; margin-bottom: 14px; }
  .grid2 { gap: 0; }
  .period { margin: 14px 0 12px; }
  .period .seg { width: 100%; }
  .period .seg button { flex: 1; min-height: 40px; }
  .stepper { width: 100%; justify-content: space-between; }
  .stepper button { width: 44px; height: 44px; }
  #periodLabel { font-size: 20px; }
  .kpis { grid-template-columns: 1fr 1fr; margin-bottom: 14px; }
  .kpi { padding: 12px 12px 14px; }
  .kpi .val { font-size: 22px; }
  .kpi .note { font-size: 11px; }
  .wallet { margin: -4px 0 14px; padding: 10px 12px; gap: 8px 16px; }
  .w-item { flex-direction: column; gap: 2px; align-items: flex-start; }
  .w-item b { font-size: 17px; }
  .w-upd { width: 100%; min-height: 40px; }
  .bar-row { grid-template-columns: minmax(78px, 30%) 1fr auto; gap: 8px; }
  .bar-row .name, .bar-row .num { font-size: 13px; }
  .bar-row .num small { display: none; }
  .legend { font-size: 11px; gap: 10px; }

  /* every control at least 44px tall; 16px text stops iOS zooming in */
  select, input[type=text], input:not([type]), input[type=number], input[type=date], input[type=month], input[type=password], input[type=email] { font-size: 16px; min-height: 42px; }
  .ghost, .solid, .danger, .ghost-sel, .filebtn { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; }

  /* ledger filters stack into two columns */
  .filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 10px; }
  .filters #fSearch { grid-column: 1 / -1; min-width: 0; }
  .filters .chk { grid-column: 1 / -1; }
  .filters > * { min-width: 0; width: 100%; }
  .ledger-sum { font-size: 12px; }

  /* ledger tables become a list of rows you tap to edit */
  .table-wrap:has(table.ledger) { overflow: visible; }
  table.ledger, table.ledger tbody { display: block; width: 100%; }
  table.ledger thead { display: none; }
  table.ledger tr.month-break { display: block; }
  table.ledger tr.month-break td { display: block; padding: 16px 2px 6px; }
  table.ledger tr[data-id] {
    display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "note note amt" "date cat act";
    gap: 4px 8px; padding: 11px 4px; border-bottom: 1px solid var(--rule); cursor: pointer; background: transparent;
  }
  table.ledger tr[data-id] td { border: 0; padding: 0; display: block; }
  table.ledger tr[data-id] td:nth-child(1) { grid-area: date; font-size: 12px; align-self: center; }
  table.ledger tr[data-id] td:nth-child(2) { grid-area: cat; align-self: center; min-width: 0; }
  table.ledger tr[data-id] td:nth-child(3) { grid-area: note; max-width: none; min-width: 0; font-size: 15px; }
  table.ledger tr[data-id] td:nth-child(4) { grid-area: amt; font-size: 15px; }
  table.ledger tr[data-id] td:nth-child(5) { grid-area: act; width: auto; align-self: center; }
  table.ledger td.act .ed { display: none; }
  table.ledger td.act button { padding: 6px 10px; font-size: 15px; min-width: 40px; min-height: 36px; }
  table.ledger .stampc { font-size: 11px; }
  td.note .flag, td.note .paytag, td.note .src { font-size: 10px; }
  .more { width: 100%; }

  /* plan grid stays a wide table you swipe sideways */
  #planGrid { font-size: 12px; }
  .card-head { flex-direction: column; align-items: stretch; }
  .card-head .row-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .row-actions { width: 100%; }
  #tab-plan .period .row-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  #tab-plan .period .row-actions #planFill { grid-column: 1 / -1; }
  #planSeg { overflow-x: auto; flex-wrap: nowrap; }
  #planSeg button { white-space: nowrap; }

  /* family */
  .planner { grid-template-columns: 1fr; gap: 14px; }
  .pfield input[type=number] { width: 100%; flex: 1; }
  .pfield .inline { flex-wrap: nowrap; }
  .repay-out { grid-template-columns: 1fr 1fr; }
  .repay-out .ro { border-left: 0; border-top: 1px dashed var(--rule); padding: 10px; }
  .repay-out .ro .v { font-size: 19px; }
  table.fc, table.fc tbody, table.fc tr, table.fc td { display: block; width: 100%; }
  table.fc tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 0; border-bottom: 1px dotted var(--rule); }
  table.fc td { border: 0 !important; padding: 0 !important; }
  table.fc td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  table.fc td:last-child { grid-column: 2; grid-row: 1; }
  .lenders { grid-template-columns: 1fr 1fr; }

  /* settings */
  .export-grid { grid-template-columns: 1fr; }
  .exp { padding: 12px 14px; }
  .rates { grid-template-columns: 1fr 1fr; }
  .rates input { width: 100%; }

  /* dialogs slide up from the bottom */
  .dlg {
    width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 14px 14px 0 0; border-width: 1px 0 0;
    max-height: 92vh; overflow-y: auto; padding: 18px max(16px, env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  }
  .dlg[open] { animation: sheet .22s ease-out; }
  @keyframes sheet { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
  .dlg .two { grid-template-columns: 1.4fr 1fr; }
  .dlg-actions { position: sticky; bottom: calc(-18px - env(safe-area-inset-bottom, 0px)); background: var(--paper-2); padding: 10px 0 0; }
  .dlg.wide { width: 100vw; padding: 0; }
  .scan-side { padding: 16px max(14px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px)); max-height: none; }
  .scan-img { max-height: 26vh; }
  .srow { grid-template-columns: 24px 1fr 1fr !important; gap: 6px; padding: 10px 0; }
  .srow input, .srow select { font-size: 15px; min-height: 38px; }

  .toast { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); width: calc(100vw - 32px); justify-content: space-between; }
  .foot { text-align: center; }
  .bg .stamp { display: none; }
}
@media (max-width: 340px) {
  .mark .kn { display: none; }
  .tabs button { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) { .dlg[open], .tab.on { animation: none; } }

@media (max-width: 760px) {
  .filters .ghost, .filters .ghost-sel, .filters .filebtn { font-size: 14px; padding: 6px 8px; text-align: center; line-height: 1.2; }
  .mark { font-size: 21px; }
  .mark .kn { font-size: .78em; }
}

/* sign-in screen */
.gate { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; background: var(--ink);
  padding: calc(env(safe-area-inset-top, 0px) + 20px) max(16px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 20px) max(16px, env(safe-area-inset-left, 0px)); }
.gate-box { width: min(380px, 100%); display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--olive); background: var(--paper-2); padding: 28px 24px; }
.gate-mark { font-family: var(--display); font-size: 30px; color: var(--sand); }
.gate-mark .dot { color: var(--rust); }
.gate-kn { font-family: "Noto Serif Kannada", serif; color: var(--khaki); margin-top: -4px; }
.gate h2 { font-family: var(--display); font-weight: 400; color: var(--bone); font-size: 20px; margin: 16px 0 4px; }
.gate label { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.gate input { font-size: 16px; min-height: 44px; }
.gate .solid { min-height: 46px; margin-top: 12px; font-size: 16px; }
.gate-msg { min-height: 1.4em; font-size: 13px; color: var(--sand); margin: 4px 0 0; }
.gate-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.linkbtn { background: none; border: 0; color: var(--khaki); text-decoration: underline; cursor: pointer; padding: 6px 0; font-size: 13px; }
#accountInfo p { margin: 0; line-height: 1.6; }
#accountInfo b { color: var(--bone); font-weight: 400; }

/* budget */
.budget .bud-big { font-family: var(--display); font-size: 38px; color: var(--sage); line-height: 1.1; }
.budget .bud-big span { font-family: var(--type); font-size: 14px; color: var(--muted); letter-spacing: 1px; margin-left: 4px; }
.budget .bud-big.over { color: var(--rust); }
.budget .bud-sub { color: var(--khaki); margin: 6px 0 12px; font-size: 14px; }
.budget .bud-sub b { color: var(--bone); font-weight: 400; }
.bud-track { height: 10px; border: 1px solid var(--olive); position: relative; margin-bottom: 18px; }
.bud-fill { position: absolute; inset: 0 auto 0 0; background: var(--sand); }
.bud-fill.over { background: var(--rust); }
.bud-rows { display: flex; flex-direction: column; gap: 9px; }
.bud-row { display: grid; grid-template-columns: minmax(90px, 150px) 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.bud-name { color: var(--khaki); }
.bud-bar { height: 8px; background: repeating-linear-gradient(90deg, var(--rule) 0 1px, transparent 1px 8px); position: relative; }
.bud-bar span { position: absolute; inset: 0 auto 0 0; background: var(--sage); opacity: .85; }
.bud-row.over .bud-bar span { background: var(--rust); }
.bud-left { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--bone); }
.bud-row.over .bud-left { color: var(--rust); }
#budgetNote { margin: 14px 0 0; }
/* folded sections */
details.fold > summary { list-style: none; cursor: pointer; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary h3 { display: flex; justify-content: space-between; margin-bottom: 0; }
details.fold > summary h3::after { content: "+"; color: var(--muted); font-family: var(--type); }
details.fold[open] > summary h3 { margin-bottom: 16px; }
details.fold[open] > summary h3::after { content: "−"; }
.tools-list { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.tool { display: flex; align-items: center; gap: 10px; color: var(--khaki); }
.phone-only { display: none; }
@media (max-width: 760px) {
  .desk-only { display: none !important; }
  .phone-only { display: inline; }
  table.ledger td.act, table.ledger tr[data-id] td:nth-child(5) { display: none !important; }
  table.ledger tr[data-id] { grid-template-areas: "note note amt" "date cat cat"; cursor: default; }
  .budget .bud-big { font-size: 32px; }
  .bud-row { grid-template-columns: minmax(80px, 34%) 1fr auto; font-size: 13px; }
}
