/* My Gullak — layout & components. Colours come only from tokens.css. */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--acc); text-decoration: none; }
::selection { background: var(--acc-bg); }
.ic { flex: none; }
[hidden] { display: none !important; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: 232px 1fr; gap: 16px; padding: 16px; min-height: 100vh; align-items: start; }
main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* ---------- sidebar ---------- */
.side { position: sticky; top: 16px; height: calc(100vh - 32px); background: var(--side); border-radius: 22px; padding: 16px 14px; display: flex; flex-direction: column; gap: 2px; overflow: auto; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; padding: 2px 8px 12px; }
.brand .logo { width: 34px; height: 34px; border-radius: 11px; background: var(--peach); color: var(--peach-ink); display: grid; place-items: center; }
.brand .my { font-weight: 700; color: var(--muted); }
.book { display: flex; align-items: center; gap: 10px; background: var(--tile); border-radius: 12px; padding: 8px 10px; margin: 0 0 12px; font-weight: 800; box-shadow: var(--shadow); width: 100%; text-align: left; }
.book .cur { width: 26px; height: 26px; border-radius: 8px; background: var(--acc-bg); color: var(--acc-ink); display: grid; place-items: center; font-size: 14px; }
.book .code { color: var(--muted); font-weight: 700; font-size: 12px; }
.book .ic { margin-left: auto; color: var(--muted); }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; font-weight: 700; color: var(--dim); }
.nav a.on { background: var(--acc-bg); color: var(--acc-ink); }
.side .sec { font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--ink); background: var(--band); border-radius: 8px; padding: 5px 12px; margin: 18px 0 6px; }
.side .acct { display: flex; justify-content: space-between; gap: 8px; padding: 6px 12px; font-weight: 700; color: var(--dim); border-radius: 10px; width: 100%; text-align: left; }
.side .acct:hover { background: var(--soft); }
.side .acct b { color: var(--ink); white-space: nowrap; }
.side .acct b.neg { color: var(--neg-ink); }
.side .me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 2px; border-top: 1px solid var(--line); font-weight: 800; }
.side .me .av { width: 32px; height: 32px; border-radius: 99px; background: var(--acc); color: var(--on-strong); display: grid; place-items: center; font-size: 14px; }

/* ---------- primitives ---------- */
.tile { background: var(--tile); border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; min-width: 0; }
.lbl { font-size: 12px; font-weight: 700; color: var(--muted); }
.big { font-size: 26px; font-weight: 800; letter-spacing: -.6px; margin-top: 2px; }
.muted { color: var(--muted); }
.pos { color: var(--pos-ink); } .neg { color: var(--neg-ink); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 13px; border-radius: 11px; font-weight: 800; font-size: 13px; background: var(--acc); color: var(--on-strong); white-space: nowrap; }
.btn:active { transform: scale(.98); }
.btn.soft { background: var(--soft); color: var(--ink); }
.btn.white { background: var(--tile); color: var(--ink); box-shadow: var(--shadow); }
.btn.danger { background: var(--neg-bg); color: var(--neg-ink); }
.btn.ink { background: var(--ink); color: var(--on-strong); }
.btn.sm { padding: 7px 11px; font-size: 12px; border-radius: 9px; }
.pill { display: inline-block; padding: 5px 11px; border-radius: 99px; font-size: 13px; font-weight: 800; background: var(--soft); color: var(--muted); white-space: nowrap; }
.pill.g { background: var(--pos-bg); color: var(--pos-ink); } .pill.r { background: var(--neg-bg); color: var(--neg-ink); } .pill.acc { background: var(--acc-bg); color: var(--acc-ink); }
button.pill.g, button.pill.r { cursor: pointer; } button.pill.g:active, button.pill.r:active { transform: scale(.95); }
.em { width: 34px; height: 34px; border-radius: 10px; background: var(--soft); display: grid; place-items: center; font-size: 16px; flex: none; }
.hd { display: flex; align-items: center; gap: 12px; }
.hd h1 { margin: 0; font-size: 22px; font-weight: 800; }
.month { display: flex; align-items: center; gap: 8px; font-size: 22px; font-weight: 800; }
.month .btn { padding: 8px; }
.seg { display: grid; grid-auto-flow: column; gap: 4px; background: var(--soft); padding: 4px; border-radius: 12px; }
.seg button { padding: 7px 4px; border-radius: 9px; font-weight: 800; font-size: 12px; color: var(--muted); text-align: center; }
.seg button.on { background: var(--tile); color: var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.tabs { display: flex; gap: 4px; background: var(--tile); padding: 4px; border-radius: 14px; box-shadow: var(--shadow); align-self: flex-start; }
.tabs button { padding: 8px 14px; border-radius: 10px; font-weight: 800; color: var(--muted); font-size: 13px; }
.tabs button.on { background: var(--acc-bg); color: var(--acc-ink); }
.empty { text-align: center; padding: 28px 20px; color: var(--muted); font-weight: 700; }
.empty .bigx { font-size: 36px; margin-bottom: 6px; }
.hint { font-size: 12px; color: var(--muted); font-weight: 700; line-height: 1.45; }
.bar { height: 5px; border-radius: 99px; background: var(--band); margin-top: 5px; overflow: hidden; max-width: 260px; }
.bar i { display: block; height: 100%; background: var(--pos); border-radius: 99px; }
.bar i.r { background: var(--neg); }
.dashed { border: 2px dashed var(--line); background: transparent; box-shadow: none; align-items: center; padding: 14px; color: var(--muted); font-weight: 800; flex-direction: row; justify-content: center; gap: 6px; }

/* ---------- forms ---------- */
.f { display: block; margin-bottom: 12px; }
.f > span { display: block; font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin: 0 0 5px 3px; }
.f input, .f select, .in2 { width: 100%; background: var(--soft); border-radius: 11px; padding: 10px 12px; font-weight: 700; border: 2px solid transparent; outline: none; color: var(--ink); -webkit-appearance: none; appearance: none; }
.f input:focus, .f select:focus, .in2:focus-within { background: var(--tile); border-color: var(--acc); }
.f select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238A8593' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.in2 { display: flex; align-items: center; gap: 8px; }
.in2 input { background: none; border: 0; outline: none; padding: 0; width: 100%; font-weight: 800; }
.in2 small { margin-left: auto; color: var(--muted); font-weight: 600; white-space: nowrap; }
.in2.amount { font-size: 22px; font-weight: 800; }
.in2.amount input { font-size: 22px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.emojis { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.emojis button { width: 34px; height: 34px; border-radius: 10px; background: var(--soft); font-size: 17px; }
.emojis button.on { background: var(--acc-bg); outline: 2px solid var(--acc); }
.actions { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--line); gap: 8px; }
.del { color: var(--neg-ink); font-weight: 800; font-size: 13px; }
.stat { display: flex; gap: 14px; font-size: 13px; font-weight: 700; padding: 10px 12px; background: var(--soft); border-radius: 11px; color: var(--muted); margin-bottom: 12px; }
.stat b { color: var(--ink); }
.stat.r { background: var(--neg-bg); color: var(--neg-ink); } .stat.r b { color: var(--neg-ink); }
.sug { display: flex; align-items: center; gap: 8px; background: var(--acc-bg); color: var(--acc-ink); border-radius: 11px; padding: 9px 12px; font-weight: 800; font-size: 13px; margin: -4px 0 12px; }
.sug small { font-weight: 700; opacity: .8; margin-left: auto; }
.opt { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 11px; font-weight: 700; border: 2px solid transparent; width: 100%; text-align: left; }
.opt.on { background: var(--acc-bg); border-color: var(--acc); }
.opt .rad { width: 18px; height: 18px; border-radius: 99px; border: 2px solid var(--line); display: grid; place-items: center; flex: none; }
.opt.on .rad { border-color: var(--acc); } .opt.on .rad::after { content: ''; width: 9px; height: 9px; border-radius: 99px; background: var(--acc); }
.opt .amt { margin-left: auto; color: var(--pos-ink); font-weight: 800; } .opt .grp { font-size: 11px; color: var(--muted); font-weight: 700; margin-left: 4px; }
.kind { display: flex; gap: 6px; }
.kind button { flex: 1; border-radius: 12px; padding: 10px 6px; text-align: center; font-weight: 800; font-size: 13px; background: var(--soft); }
.kind button.on { background: var(--acc-bg); box-shadow: inset 0 0 0 2px var(--acc); }
.kind button div { font-size: 20px; } .kind button small { display: block; font-size: 11px; font-weight: 700; color: var(--muted); margin-top: 2px; }

/* ---------- popover & toast ---------- */
.pop { position: fixed; z-index: 30; background: var(--tile); border-radius: 18px; box-shadow: var(--shadow-pop); padding: 18px 20px; max-height: calc(100vh - 24px); overflow: auto; animation: popin .14s ease; }
@keyframes popin { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.pop .ph { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 15px; margin-bottom: 12px; }
.pop .ph small { display: block; font-weight: 700; color: var(--muted); font-size: 12px; }
.pop .x { width: 30px; height: 30px; border-radius: 9px; background: var(--soft); display: grid; place-items: center; color: var(--muted); }
#toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(12px); background: var(--ink); color: var(--on-strong); padding: 10px 18px; border-radius: 999px; font-weight: 800; font-size: 14px; opacity: 0; transition: .2s; z-index: 40; pointer-events: none; white-space: nowrap; }
#toast.show { opacity: 1; transform: translateX(-50%); }

/* ---------- budget ---------- */
.tiles { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 12px; }
.tiles.attn { grid-template-columns: 1.6fr 1fr 1fr 1.4fr; }
.hero { flex-direction: row; align-items: center; justify-content: space-between; background: var(--pos-bg); color: var(--pos-ink); }
.hero .lbl { color: inherit; opacity: .75; }
.hero .big { font-size: 40px; letter-spacing: -1.5px; }
.hero.zero { background: var(--acc-bg); color: var(--acc-ink); }
.hero.warn { background: var(--neg-bg); color: var(--neg-ink); }
.attn-tile { background: var(--neg-bg); color: var(--neg-ink); }
.attn-tile .lbl { color: inherit; opacity: .8; }
.attn-tile .btn { align-self: flex-start; margin-top: auto; background: var(--neg); color: #fff; }
.gt .qh { display: grid; grid-template-columns: 22px 34px 1fr 130px 120px 130px; gap: 12px; align-items: center; font-weight: 800; font-size: 16px; padding-bottom: 6px; cursor: pointer; border-radius: 12px; }
.gt .qh .chev { color: var(--muted); display: grid; place-items: center; width: 22px; height: 24px; border-radius: 8px; transition: transform .15s; }
.gt .qh .chev:hover { background: var(--soft); color: var(--ink); }
.gt.closed .qh .chev { transform: rotate(-90deg); }
.gt.closed .qh { padding-bottom: 0; }
.gt .qh .gs { text-align: right; line-height: 1.15; }
.gt .qh .gs small { display: block; font-size: 10px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase; color: var(--muted); }
.gt .qh .gs b { font-size: 14px; color: var(--ink); }
.gt .qh .gs b.neg { color: var(--neg-ink); }
.gt .qh .gname { grid-column: 2 / 4; justify-self: start; display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; text-align: left; padding: 3px 10px 3px 3px; margin-left: -3px; border-radius: 10px; }
.gt .qh .gname:hover { background: var(--soft); }
.gt .qh .gname i { width: 26px; height: 26px; border-radius: 8px; display: inline-grid; place-items: center; font-size: 13px; font-style: normal; background: var(--acc-bg); }
.tr { display: grid; grid-template-columns: 22px 34px 1fr 130px 120px 130px; gap: 12px; align-items: center; }
.tr { padding: 7px 0; border-bottom: 1px solid var(--line); }
.tr:last-child { border-bottom: 0; }
.tr .h { color: var(--line); cursor: grab; touch-action: none; user-select: none; display: grid; place-items: center; }
.tr .n { font-weight: 800; text-align: left; }
.tr .in { width: 110px; margin-left: auto; text-align: right; background: var(--soft); border-radius: 9px; padding: 7px 10px; font-weight: 800; border: 2px solid transparent; outline: none; }
.tr .in:focus { background: var(--tile); border-color: var(--acc); }
.tr .sp { text-align: right; color: var(--muted); font-weight: 600; }
.tr .av { text-align: right; }
.tr.dragging { opacity: .3; }
.ghost { position: fixed; pointer-events: none; z-index: 50; background: var(--tile); border-radius: 14px; box-shadow: var(--shadow-pop); padding: 8px 14px; font-weight: 800; }
.tile.dropping { box-shadow: 0 0 0 2px var(--acc) inset, var(--shadow); }
.due { background: var(--warn-bg); color: var(--warn-ink); border-radius: var(--radius); padding: 12px 16px; display: flex; align-items: center; gap: 12px; font-weight: 800; }
.due .btn { background: rgba(255,255,255,.7); color: var(--warn-ink); }

/* ---------- transactions ---------- */
.search { display: flex; align-items: center; gap: 8px; margin-left: auto; width: 280px; background: var(--tile); border-radius: 11px; padding: 0 10px 0 12px; box-shadow: var(--shadow); border: 2px solid transparent; }
.search:focus-within { border-color: var(--acc); }
.search input { flex: 1; min-width: 0; border: 0; outline: none; background: none; padding: 8px 0; font-weight: 700; }
.search input::placeholder { color: var(--muted); }
.search .clr { width: 20px; height: 20px; border-radius: 99px; background: var(--soft); color: var(--muted); display: grid; place-items: center; }
.btn.white.on { box-shadow: inset 0 0 0 2px var(--acc), var(--shadow); color: var(--acc-ink); }
.btn .cnt { background: var(--acc); color: var(--on-strong); border-radius: 99px; font-size: 11px; padding: 1px 6px; margin-left: 2px; }
.ledger-tabs { align-self: stretch; flex-wrap: wrap; }
.ledger-tabs .all { margin-left: auto; color: var(--muted); font-weight: 700; }
.ledger-tabs .all.on { color: var(--acc-ink); font-weight: 800; }
.qa { background: var(--acc-bg); border-radius: 18px; padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.qa-top { display: flex; align-items: center; gap: 12px; }
.qa .seg { background: rgba(255,255,255,.55); }
:root[data-theme="dark"] .qa .seg { background: rgba(0,0,0,.25); }
.qa .seg button.expense.on { color: var(--neg-ink); } .qa .seg button.income.on { color: var(--pos-ink); } .qa .seg button.transfer.on { color: var(--sky-ink); }
.kbd-hints { margin-left: auto; display: flex; gap: 16px; font-size: 12px; font-weight: 700; color: var(--acc-ink); opacity: .85; }
kbd { display: inline-block; border: 1px solid var(--acc); border-radius: 5px; padding: 0 6px; font-size: 11px; font-weight: 800; background: var(--tile); color: var(--acc-ink); font-family: inherit; }
.qa-fields { display: grid; grid-template-columns: 150px minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) 150px minmax(0, 1fr) auto; gap: 8px; align-items: stretch; }
.qa .in2, .qa .in2 input, .qa .in2 select { min-width: 0; }
.qa-fields.xfer { grid-template-columns: 150px minmax(0, 1fr) auto minmax(0, 1fr) 150px minmax(0, 1.3fr) auto; }
.qa-fields.xfer-env { grid-template-columns: 150px minmax(0, 1fr) minmax(0, 1fr) auto minmax(0, 1fr) 150px minmax(0, 1fr) auto; }
.qa .in2 { background: var(--tile); padding: 0 12px; min-height: 42px; }
.qa .in2 input { padding: 9px 0; }
.qa .in2.amount { font-size: 18px; padding-left: 12px; }
.qa .in2.amount .sym { color: var(--muted); }
.qa .in2.amount input { font-size: 18px; }
.qa .in2.sel { padding: 0; }
.qa .in2.sel select { background-color: transparent; border: 0; padding: 9px 30px 9px 12px; }
.qa .in2.sel:focus-within { background: var(--tile); }
.qa .in2.static { color: var(--muted); font-weight: 700; }
.seg.prefs { display: flex; flex-wrap: wrap; max-width: 640px; } .seg.prefs button { padding: 7px 12px; }
.profile-top { display: flex; align-items: flex-start; gap: 18px; flex-wrap: wrap; margin-bottom: 6px; }
.avatar { position: relative; width: 84px; height: 84px; border-radius: 99px; background: var(--acc); color: var(--on-strong); display: grid; place-items: center; font-size: 32px; font-weight: 800; cursor: pointer; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar i { position: absolute; right: 2px; bottom: 2px; width: 24px; height: 24px; border-radius: 99px; background: var(--tile); color: var(--acc-ink); display: grid; place-items: center; box-shadow: var(--shadow); }
.side .me img.av { width: 32px; height: 32px; border-radius: 99px; object-fit: cover; }
.qa .in2.date input { font-weight: 700; color: var(--ink); }
.qa .xfer-arrow { align-self: center; color: var(--acc-ink); font-weight: 800; }
.qa .btn { padding: 10px 16px; }
.fchips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fc { display: inline-flex; align-items: center; gap: 6px; padding: 6px 6px 6px 11px; border-radius: 999px; background: var(--acc-bg); color: var(--acc-ink); font-weight: 800; font-size: 13px; }
.fc.sm { padding: 3px 4px 3px 9px; font-size: 12px; }
.fc .x { width: 18px; height: 18px; border-radius: 99px; background: rgba(78,65,168,.15); display: grid; place-items: center; color: inherit; }
.ledger { padding-top: 10px; }
.lg { display: grid; grid-template-columns: 96px 1.3fr 160px 1fr 110px 110px 120px; gap: 10px; align-items: center; padding: 7px 0; font-size: 13px; }
.ledger.noBal .lg { grid-template-columns: 96px 1.3fr 160px 1fr 110px 110px; }
.lg .date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ledger.noBal .bal { display: none; }
.lth { font-size: 11px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.ltr { border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 10px; }
.ltr:hover { background: var(--soft); box-shadow: 0 0 0 6px var(--soft); }
.ltr:last-of-type { border-bottom: 0; }
.lg .r { text-align: right; font-variant-numeric: tabular-nums; }
.lg .out { font-weight: 800; } .lg .in { font-weight: 800; color: var(--pos-ink); }
.lg .pay { display: flex; align-items: center; gap: 8px; font-weight: 800; min-width: 0; }
.lg .pay .pn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg .pay .xf { font-size: 12px; font-weight: 700; white-space: nowrap; }
.lg .memo { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.em.sm { width: 26px; height: 26px; font-size: 13px; border-radius: 8px; }
.pill.sm { padding: 3px 9px; font-size: 12px; }
button.pill.acc { cursor: pointer; } button.pill.acc:hover { box-shadow: inset 0 0 0 2px var(--acc); }
.lfoot { display: flex; gap: 18px; padding-top: 12px; margin-top: 6px; font-weight: 700; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }
.lfoot b { color: var(--ink); }
.fr { display: grid; grid-template-columns: 86px 1fr; gap: 10px; align-items: center; margin-bottom: 10px; }
.fr .k { font-size: 11px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); }
.fr input, .fr select { width: 100%; background: var(--soft); border-radius: 11px; padding: 9px 12px; font-weight: 700; border: 2px solid transparent; outline: none; color: var(--ink); -webkit-appearance: none; appearance: none; }
.fr input:focus, .fr select:focus { background: var(--tile); border-color: var(--acc); }
.fr .seg { justify-self: start; }
.fr .seg button { padding: 6px 12px; }

/* ---------- net worth ---------- */
.nw-chart { padding: 18px 22px; }
.nw-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.nw-top .big { font-size: 40px; letter-spacing: -1.5px; }
.delta { font-weight: 800; color: var(--pos-ink); background: var(--pos-bg); border-radius: 99px; padding: 4px 10px; font-size: 13px; }
.delta.neg { color: var(--neg-ink); background: var(--neg-bg); }
.switch { display: inline-flex; gap: 4px; background: var(--soft); padding: 4px; border-radius: 11px; }
.switch button { padding: 6px 12px; border-radius: 8px; font-weight: 800; font-size: 13px; color: var(--muted); }
.switch button.on { background: var(--tile); color: var(--acc-ink); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.nw-top .switch:first-of-type { margin-left: auto; }
.nw-svg { position: relative; margin-top: 8px; }
.nw-svg svg { display: block; width: 100%; height: auto; }
.nw-svg .ax { font-size: 11px; font-weight: 700; fill: var(--muted); font-family: var(--font); }
.nw-svg .val { font-size: 12px; font-weight: 800; fill: var(--ink); font-family: var(--font); paint-order: stroke; stroke: var(--tile); stroke-width: 4px; stroke-linejoin: round; }
.nw-svg .hit { cursor: crosshair; }
.nw-tip { position: absolute; top: 0; background: var(--ink); color: var(--on-strong); border-radius: 10px; padding: 6px 10px; font-weight: 800; font-size: 13px; pointer-events: none; white-space: nowrap; box-shadow: var(--shadow-pop); }
.nw-tip small { display: block; font-size: 11px; font-weight: 700; opacity: .75; }
.mini { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.comp { display: grid; grid-template-columns: 1.5fr 1fr; gap: 12px; align-items: start; }
.nw-side { display: flex; flex-direction: column; gap: 12px; }
.stack { display: flex; height: 22px; border-radius: 99px; overflow: hidden; gap: 2px; margin: 14px 0 10px; }
.stack i { display: block; height: 100%; }
.leg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.leg div { display: flex; gap: 10px; align-items: center; font-weight: 800; } .leg i { width: 12px; height: 12px; border-radius: 4px; flex: none; } .leg small { display: block; color: var(--muted); font-weight: 700; font-size: 12px; }
.sh { display: grid; grid-template-columns: 1fr 150px 50px 1fr; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); font-weight: 700; width: 100%; text-align: left; border-radius: 8px; }
.sh:hover { background: var(--soft); box-shadow: 0 0 0 6px var(--soft); }
.sh .v { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; } .sh .v small { color: var(--muted); font-weight: 700; font-size: 11px; margin-left: 4px; } .sh .p { text-align: right; color: var(--muted); font-weight: 800; font-size: 12px; }
.sh .sbar { height: 6px; border-radius: 99px; background: var(--band); overflow: hidden; } .sh .sbar i { display: block; height: 100%; border-radius: 99px; }
.sh .cur { font-size: 11px; font-weight: 800; color: var(--muted); background: var(--soft); border-radius: 6px; padding: 1px 6px; margin-right: 8px; }
.lnk { font-weight: 800; color: var(--neg-ink); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.ratebox { display: flex; align-items: center; gap: 8px; background: var(--soft); border-radius: 12px; padding: 8px 12px; font-weight: 800; font-size: 16px; margin-top: 10px; }
.ratebox .in { display: inline-flex; align-items: center; gap: 4px; background: var(--tile); border-radius: 9px; padding: 5px 10px; box-shadow: inset 0 0 0 2px var(--acc); width: 120px; }
.ratebox .in input { border: 0; outline: none; background: none; width: 100%; font-weight: 800; font-size: 16px; }
.ratebox small { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 700; }
.bk { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); font-weight: 700; width: 100%; text-align: left; border-radius: 8px; }
.bk:hover { background: var(--soft); box-shadow: 0 0 0 6px var(--soft); }
.bk b { font-weight: 800; } .bk small { display: block; color: var(--muted); font-weight: 700; font-size: 12px; }

/* ---------- settings ---------- */
.set { display: grid; grid-template-columns: 240px 1fr; gap: 12px; align-items: start; }
.sn { padding: 10px; gap: 2px; position: sticky; top: 16px; }
.sn a { padding: 10px 12px; border-radius: 11px; font-weight: 800; color: var(--dim); }
.sn a:hover { background: var(--soft); }
.sn a.on { background: var(--acc-bg); color: var(--acc-ink); }
.sn .gh { font-size: 11px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase; color: var(--muted); padding: 14px 12px 4px; }
.sn .gh:first-child { padding-top: 4px; }
.stab { min-height: 420px; }
.sh-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-bottom: 1px solid var(--line); font-weight: 700; width: 100%; text-align: left; border-radius: 10px; }
.row:last-child { border-bottom: 0; }
button.row:hover { background: var(--soft); }
.row small { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.row.env { padding-left: 44px; }
.row.closed { opacity: .55; }
.f.sel-sm { margin: 0; } .f.sel-sm select { width: auto; padding: 6px 30px 6px 10px; font-size: 13px; }
.gh2 { font-size: 11px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase; color: var(--muted); padding: 14px 6px 4px; }
.in2.static { color: var(--muted); font-weight: 700; }
.seg.prefs { display: flex; flex-wrap: wrap; max-width: 640px; } .seg.prefs button { padding: 7px 12px; }
.profile-top { display: flex; align-items: flex-start; gap: 18px; flex-wrap: wrap; margin-bottom: 6px; }
.avatar { position: relative; width: 84px; height: 84px; border-radius: 99px; background: var(--acc); color: var(--on-strong); display: grid; place-items: center; font-size: 32px; font-weight: 800; cursor: pointer; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar i { position: absolute; right: 2px; bottom: 2px; width: 24px; height: 24px; border-radius: 99px; background: var(--tile); color: var(--acc-ink); display: grid; place-items: center; box-shadow: var(--shadow); }
.side .me img.av { width: 32px; height: 32px; border-radius: 99px; object-fit: cover; }
.chk { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 13px; margin: 2px 0 8px; cursor: pointer; }
.chk input { width: 18px; height: 18px; accent-color: var(--acc); }

/* ---------- density ---------- */
:root[data-density="compact"] .tr { padding: 3px 0; }
:root[data-density="compact"] .tr .in { padding: 4px 10px; }
:root[data-density="compact"] .bar { height: 4px; margin-top: 3px; }
:root[data-density="compact"] .lg { padding: 4px 0; font-size: 12.5px; }
:root[data-density="compact"] .em.sm { width: 22px; height: 22px; font-size: 12px; }
:root[data-density="compact"] .row { padding: 5px 6px; }
:root[data-density="compact"] .tile { padding: 12px 16px; }
:root[data-density="compact"] .gt .qh { font-size: 15px; }
:root[data-density="compact"] .side .acct { padding: 4px 12px; }

/* ---------- privacy blur: every place an amount is shown ---------- */
:root.privacy .side .acct b, :root.privacy .big, :root.privacy .pill, :root.privacy .lg .r, :root.privacy .gt .qh .gs b, :root.privacy .tr .sp, :root.privacy .tr .in,
:root.privacy .sh .v, :root.privacy .leg small, :root.privacy .bk > b, :root.privacy .bk small, :root.privacy .delta, :root.privacy .nw-svg .val, :root.privacy .nw-tip, :root.privacy .lfoot b,
:root.privacy .stat b, :root.privacy .tiles .lbl .neg, :root.privacy .tiles .lbl .pos, :root.privacy .mini .lbl.pos, :root.privacy .mini .lbl.neg, :root.privacy .row > b, :root.privacy .opt .amt, :root.privacy .pop .ph small, :root.privacy .attn-tile > div:not(.lbl), :root.privacy .qa .amount input, :root.privacy .in2.amount input, :root.privacy .wrow b, :root.privacy .drow span:last-child, :root.privacy .kv2 .v, :root.privacy .li .a, :root.privacy .trow .r, :root.privacy .rtip, :root.privacy .rchart .val
  { filter: blur(6px); user-select: none; transition: filter .15s; }
:root.privacy .side .acct:hover b, :root.privacy .ltr:hover .r, :root.privacy .tr:hover .sp, :root.privacy .tr:hover .in, :root.privacy .tr:hover .pill, :root.privacy .in2.amount input:focus, :root.privacy .qa .amount input:focus { filter: none; }

/* ---------- report ---------- */
.tiles.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g2 { display: grid; grid-template-columns: 1.2fr 1fr; gap: 12px; align-items: start; }
.wlist { margin-top: 8px; display: flex; flex-direction: column; }
.wrow { display: grid; grid-template-columns: 28px 1fr 60px 110px; gap: 10px; align-items: center; padding: 7px 4px; border-bottom: 1px solid var(--line); font-weight: 700; width: 100%; text-align: left; border-radius: 8px; }
.wrow:last-child { border-bottom: 0; } .wrow:hover { background: var(--soft); box-shadow: 0 0 0 4px var(--soft); }
.wbar { height: 6px; border-radius: 99px; background: var(--band); margin-top: 5px; overflow: hidden; } .wbar i { display: block; height: 100%; border-radius: 99px; }
.r { text-align: right; font-variant-numeric: tabular-nums; }
.drow { display: flex; justify-content: space-between; padding: 8px 4px; border-bottom: 1px solid var(--line); font-weight: 700; width: 100%; text-align: left; border-radius: 8px; }
.drow:last-child { border-bottom: 0; } .drow:hover { background: var(--soft); box-shadow: 0 0 0 4px var(--soft); }
.clegend { display: flex; gap: 16px; font-size: 12px; font-weight: 800; color: var(--muted); }
.clegend span { display: inline-flex; align-items: center; gap: 6px; } .clegend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.rchart { position: relative; margin-top: 8px; }
.rchart svg { display: block; width: 100%; height: auto; }
.rchart .ax { font-size: 11px; font-weight: 700; fill: var(--muted); font-family: var(--font); }
.rchart .val { font-size: 12px; font-weight: 800; fill: var(--ink); font-family: var(--font); paint-order: stroke; stroke: var(--tile); stroke-width: 4px; stroke-linejoin: round; }
.rchart .hit { cursor: crosshair; }
.ex { display: grid; grid-template-columns: 300px 1fr; gap: 12px; align-items: start; }
.ex .gh { font-size: 11px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase; color: var(--muted); padding: 10px 10px 4px; }
.li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 11px; font-weight: 700; width: 100%; text-align: left; }
.li:hover { background: var(--soft); } .li.on { background: var(--acc-bg); color: var(--acc-ink); }
.li .a { margin-left: auto; font-weight: 800; font-variant-numeric: tabular-nums; }
.kv2 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.kv2 > div { background: var(--soft); border-radius: 12px; padding: 10px 12px; } .kv2 .v { font-size: 20px; font-weight: 800; }
.trow { display: flex; gap: 10px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--line); font-weight: 700; width: 100%; text-align: left; border-radius: 8px; }
.trow:hover { background: var(--soft); box-shadow: 0 0 0 4px var(--soft); }

/* ---------- responsive (narrow laptop) ---------- */
@media (max-width: 1100px) {
  .app { grid-template-columns: 72px 1fr; }
  .side { padding: 14px 10px; }
  .brand span:not(.logo), .book span:not(.cur), .nav a span, .side .sec, .side .acct, .side .me b { display: none; }
  .nav a { justify-content: center; padding: 10px; }
  .book { justify-content: center; padding: 6px; }
  .tr, .gt .qh { grid-template-columns: 22px 34px 1fr 100px 90px 110px; }
  .lg { grid-template-columns: 90px 1.2fr 130px 1fr 96px 96px 104px; }
  .qa-fields { grid-template-columns: 110px minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr) 140px minmax(0, 1fr) auto; }
  .qa-fields.xfer { grid-template-columns: 110px minmax(0, 1fr) auto minmax(0, 1fr) 140px minmax(0, 1fr) auto; }
  .qa-fields.xfer-env { grid-template-columns: 110px minmax(0, 1fr) minmax(0, 1fr) auto minmax(0, 1fr) 140px minmax(0, 1fr) auto; }
  .lg .pay .xf { display: none; }
  .kbd-hints { display: none; }
  .comp { grid-template-columns: 1fr; }
  .set { grid-template-columns: 1fr; } .sn { position: static; }
  .g2, .ex { grid-template-columns: 1fr; } .tiles.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nw-top .big { font-size: 32px; }
}

/* ---------- About (bento: one screen, tiles sized to their content) ---------- */
.ab-one { display: flex; flex-direction: column; gap: 12px; min-height: calc(100vh - 32px); }
.ab-bento {
  flex-grow: 1; display: grid; gap: 12px;
  grid-template-columns: 340px minmax(0, 1fr) 330px;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  grid-template-areas:
    "photo title quote"
    "photo story quote"
    "who   pot   pot"
    "p1    p2    p3";
}
.ab-t-photo { grid-area: photo; padding: 14px; }
.ab-t-title { grid-area: title; flex-direction: row; align-items: center; gap: 14px; padding: 18px 22px; }
.ab-t-story { grid-area: story; gap: 10px; padding: 20px 24px; }
.ab-t-quote { grid-area: quote; background: var(--acc-bg); color: var(--acc-ink); justify-content: center; gap: 6px; padding: 24px 26px; }
.ab-t-who   { grid-area: who; gap: 2px; justify-content: center; }
.ab-t-pot   { grid-area: pot; background: var(--peach); color: var(--peach-ink); flex-direction: row; align-items: center; gap: 14px; justify-content: flex-start; }
.ab-p1 { grid-area: p1; } .ab-p2 { grid-area: p2; } .ab-p3 { grid-area: p3; }

.ab-photo { flex-grow: 1; min-height: 0; border-radius: 14px; overflow: hidden; background: var(--soft); }
.ab-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ab-ph { height: 100%; min-height: 230px; border-radius: 14px; border: 2px dashed var(--band); display: grid; place-content: center; justify-items: center; gap: 7px; color: var(--dim); }
.ab-ph b { font-size: 13px; letter-spacing: .4px; }
.ab-ph small { font-size: 12px; font-weight: 700; color: var(--muted); }

.ab-t-title h1 { margin: 0; font-size: 30px; font-weight: 900; letter-spacing: -.5px; }
.ab-lede { margin: 1px 0 0; font-size: 15px; font-weight: 700; color: var(--dim); }
.ab-lab { font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--ink); background: var(--band); border-radius: 8px; padding: 5px 12px; align-self: flex-start; }
.ab-p { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.65; }

.ab-pot { width: 42px; height: 42px; border-radius: 14px; background: var(--peach); color: var(--peach-ink); display: grid; place-items: center; flex-shrink: 0; }
.ab-pot.big { width: 46px; height: 46px; background: rgba(255, 255, 255, .55); }
.ab-pot.sm { width: 26px; height: 26px; border-radius: 9px; }
:root[data-theme="dark"] .ab-pot.big { background: rgba(255, 255, 255, .07); }
.ab-t-pot p { margin: 0; font-size: 14px; font-weight: 700; line-height: 1.6; }

.ab-mark { font-size: 46px; font-weight: 900; line-height: .7; opacity: .45; }
.ab-t-quote blockquote { margin: 0; font-size: 18px; font-weight: 800; line-height: 1.5; }
.ab-t-quote small { font-size: 12px; font-weight: 800; opacity: .75; margin-top: 4px; }

.ab-t-who b { font-size: 21px; font-weight: 900; letter-spacing: -.3px; }
.ab-t-who small { font-size: 13px; font-weight: 700; color: var(--dim); margin-bottom: 8px; }

.ab-p1, .ab-p2, .ab-p3 { gap: 7px; justify-content: center; padding: 16px 20px; }
.ab-p1 b, .ab-p2 b, .ab-p3 b { font-size: 15px; font-weight: 900; }
.ab-p1 p, .ab-p2 p, .ab-p3 p { margin: 0; font-size: 13px; font-weight: 600; line-height: 1.5; color: var(--dim); }
.ab-ic { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; }
.ab-ic.sky { background: var(--sky); color: var(--sky-ink); }
.ab-ic.mint { background: var(--mint); color: var(--mint-ink); }
.ab-ic.peach { background: var(--peach); color: var(--peach-ink); }

.ab-foot { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 2px 0 4px; font-size: 13px; font-weight: 800; color: var(--dim); }
.ab-foot span { display: inline-flex; align-items: center; gap: 6px; }
.ab-heart { color: var(--neg); }

@media (max-width: 1400px) {
  .ab-one { min-height: 0; }
  .ab-bento {
    grid-template-columns: 300px minmax(0, 1fr);
    grid-template-rows: auto auto auto auto auto;
    grid-template-areas:
      "photo title"
      "photo story"
      "photo quote"
      "who   pot"
      "p1    p2"
      "p3    p3";
  }
  .ab-ph { min-height: 300px; }
}
@media (max-width: 900px) {
  .ab-bento { grid-template-columns: 1fr; grid-template-areas: "photo" "title" "story" "quote" "who" "pot" "p1" "p2" "p3"; }
  .ab-photo { max-width: 320px; }
}

/* ---------- touch (iPad / phone) ----------
   Everything here is behind `pointer: coarse`, so the desktop design is untouched.
   Apple's own guidance is a 44px minimum target; a mouse is happy with less, a fingertip is not. */
@media (pointer: coarse) {
  .btn { padding: 12px 16px; min-height: 44px; }
  .btn.sm { padding: 10px 14px; font-size: 13px; min-height: 40px; }
  .seg button { padding: 11px 10px; min-height: 42px; font-size: 13px; }
  .nav a { padding: 13px 12px; min-height: 46px; }
  .side .acct { padding: 11px 12px; min-height: 42px; }
  .sn a { padding: 12px 12px; min-height: 44px; }
  button.pill, .pill.g, .pill.r, .pill.acc { padding: 9px 14px; }
  .gt .qh .chev { width: 40px; height: 40px; }
  .tr .h { width: 34px; }

  /* iOS zooms the whole page when a field smaller than 16px takes focus. */
  .f input, .f select, .in2 input, .tr .in, .search input, .ratebox .in input { font-size: 16px; }
  .f input, .f select, .in2 { padding: 12px 12px; }
  .tr .in { padding: 10px 10px; }

  /* A keyboard the device may not have. */
  .kbd-hints { display: none; }

  /* No grey flash on tap, and no text-selection callout when pressing a row or a drag handle. */
  a, button, .tr, .ltr, .trow, .wrow, .drow, .li, .row { -webkit-tap-highlight-color: transparent; }
  .tr .h, .side .acct, .gt .qh, .trow, .li { -webkit-touch-callout: none; }

  /* Privacy blur is revealed by hovering, which a finger cannot do — press and hold instead.
     The real switch is Settings → Profile → Privacy, since H needs a keyboard. */
  :root.privacy .side .acct:active b, :root.privacy .ltr:active .r, :root.privacy .tr:active .sp,
  :root.privacy .tr:active .in, :root.privacy .tr:active .pill, :root.privacy .trow:active .r,
  :root.privacy .wrow:active b, :root.privacy .li:active .a, :root.privacy .row:active > b { filter: none; }
}
