/*
 * Banking. The prototype's look (tools/design/prototype/styles.css), which
 * Nicolas reviewed. Colours are tokens on :root, light and dark from the
 * device's setting (BFE-INS-2). System fonts only; nothing is fetched
 * (BFE-ICO-5).
 */
:root {
  color-scheme: light dark;
  /* more contrast than the prototype's (Nicolas, 2026-11-14): a greyer page so the white
     sections stand out, darker secondary text, the coloured bar on top */
  --bg: #eceff4;
  --surface: #ffffff;
  --panel: #f0f2f5;
  --fg: #14161a;
  --muted: #4a515d;
  --faint: #6f7682;
  --rule: #dfe3e9;
  --rule-strong: #c4cad3;
  /* the bar on top, and the start page's section headings (blue for now: Nicolas has not chosen) */
  --bar-bg: #1d5fc4;
  --bar-fg: #ffffff;
  --head-fg: #1d5fc4;
  --card-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  --accent: #0b57c2;
  --accent-bg: #e6effc;
  --sel: #e8ecf2;
  --pos: #1d7a46;
  --s1: #1f63c4;
  --s2: #8fb6ea;
  --s3: #9aa1ab;
  --amber-bg: #fdf1dc;
  --amber-fg: #7a4a06;
  --amber-mark: #d48a12;
  --blue-bg: #e6effc;
  --blue-fg: #0d4a9e;
  --blue-mark: #2f74d6;
  --grey-bg: #eef0f3;
  --grey-fg: #4a515c;
  --grey-mark: #8a919c;
  --gap: #e9ebef;
  --shadow: 0 8px 28px rgba(16, 24, 40, 0.16);
  --in-bg: #d9f1e1;
  --day-bg: #e7edf6; --day-fg: #3a4a60;
  --in-bar: #2f9a5c;
  --h-orange-bg: #fdebdc; --h-orange-fg: #b4530e;
  --h-blue-bg: #e3edfb; --h-blue-fg: #1f5fbf;
  --h-slate-bg: #e8ecf1; --h-slate-fg: #4b5a6e;
  --h-pink-bg: #fbe4ec; --h-pink-fg: #b23a68;
  --h-teal-bg: #dcf2ef; --h-teal-fg: #13756b;
  --h-violet-bg: #ece6fb; --h-violet-fg: #6a45c2;
  --h-yellow-bg: #fbf1cf; --h-yellow-fg: #8a6a00;
  --h-cyan-bg: #dcf0f8; --h-cyan-fg: #1a7090;
  --h-green-bg: #def3e4; --h-green-fg: #1d7a46;
  --h-indigo-bg: #e4e6fb; --h-indigo-fg: #3f48b8;
  --h-grey-bg: #eceef1; --h-grey-fg: #6b7380;
  --h-sand-bg: #f3ecdd; --h-sand-fg: #85693a;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1013; --surface: #1c1f24; --panel: #252930; --fg: #f1f3f5; --muted: #b3bac4; --faint: #8b929d;
    --bar-bg: #1a4f9e; --bar-fg: #ffffff; --head-fg: #8db6f2; --card-shadow: none;
    --rule: #2e3238; --rule-strong: #434952; --accent: #7fb0ff; --accent-bg: #1d2c44; --sel: #2a3038; --pos: #5cc489;
    --s1: #6aa3f0; --s2: #2f5d99; --s3: #6b737e;
    --amber-bg: #3a2c12; --amber-fg: #f3c978; --amber-mark: #e0a23a;
    --blue-bg: #1d2c44; --blue-fg: #a9c9fa; --blue-mark: #6aa3f0;
    --grey-bg: #262a30; --grey-fg: #c2c8d0; --grey-mark: #7b838e;
    --gap: #23272c; --shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
    --in-bg: #1b3b25;
    --day-bg: #232d3a; --day-fg: #b9c6d8;
    --in-bar: #4fbf7d;
    --h-orange-bg: #3d2a1a; --h-orange-fg: #f2a86a;
    --h-blue-bg: #1d2c44; --h-blue-fg: #8db6f2;
    --h-slate-bg: #262d36; --h-slate-fg: #a9b6c6;
    --h-pink-bg: #3c2130; --h-pink-fg: #f09ab9;
    --h-teal-bg: #17332f; --h-teal-fg: #6fd1c3;
    --h-violet-bg: #2c2443; --h-violet-fg: #b9a3f2;
    --h-yellow-bg: #3a321a; --h-yellow-fg: #e7c95a;
    --h-cyan-bg: #17303a; --h-cyan-fg: #79c6e3;
    --h-green-bg: #18321f; --h-green-fg: #6fd08f;
    --h-indigo-bg: #24284a; --h-indigo-fg: #a6acf2;
    --h-grey-bg: #2a2e34; --h-grey-fg: #a3aab5;
    --h-sand-bg: #352e22; --h-sand-fg: #d9c08f;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1013; --surface: #1c1f24; --panel: #252930; --fg: #f1f3f5; --muted: #b3bac4; --faint: #8b929d;
  --bar-bg: #1a4f9e; --bar-fg: #ffffff; --head-fg: #8db6f2; --card-shadow: none;
  --rule: #2e3238; --rule-strong: #434952; --accent: #7fb0ff; --accent-bg: #1d2c44; --sel: #2a3038; --pos: #5cc489;
  --s1: #6aa3f0; --s2: #2f5d99; --s3: #6b737e;
  --amber-bg: #3a2c12; --amber-fg: #f3c978; --amber-mark: #e0a23a;
  --blue-bg: #1d2c44; --blue-fg: #a9c9fa; --blue-mark: #6aa3f0;
  --grey-bg: #262a30; --grey-fg: #c2c8d0; --grey-mark: #7b838e;
  --gap: #23272c; --shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
  --in-bg: #1b3b25;
  --day-bg: #232d3a; --day-fg: #b9c6d8;
  --in-bar: #4fbf7d;
  --h-orange-bg: #3d2a1a; --h-orange-fg: #f2a86a;
  --h-blue-bg: #1d2c44; --h-blue-fg: #8db6f2;
  --h-slate-bg: #262d36; --h-slate-fg: #a9b6c6;
  --h-pink-bg: #3c2130; --h-pink-fg: #f09ab9;
  --h-teal-bg: #17332f; --h-teal-fg: #6fd1c3;
  --h-violet-bg: #2c2443; --h-violet-fg: #b9a3f2;
  --h-yellow-bg: #3a321a; --h-yellow-fg: #e7c95a;
  --h-cyan-bg: #17303a; --h-cyan-fg: #79c6e3;
  --h-green-bg: #18321f; --h-green-fg: #6fd08f;
  --h-indigo-bg: #24284a; --h-indigo-fg: #a6acf2;
  --h-grey-bg: #2a2e34; --h-grey-fg: #a3aab5;
  --h-sand-bg: #352e22; --h-sand-fg: #d9c08f;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
/* `hidden` hides, whatever display a class gives (as in callback.html). Without
   this, `.icon-btn`'s flex kept the refresh button on screen for viewers
   without consent (BFE-VW-3) while the attribute said it was hidden. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent); text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 14px; color: var(--muted); font-weight: 600; text-transform: none; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.est { font-style: italic; }
.pos { color: var(--pos); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* ---- shell ---------------------------------------------------------------- */
/* One arrangement at every width (BFE-LAY-1): the coloured bar, then the screen. The page
   scrolls under the status bar on the iPhone (black-translucent), so the bar's colour runs up
   behind it. Pulling down at the top refreshes (BFE-NET-14): not the browser's own. */
html, body { overscroll-behavior-y: contain; }
.app { min-height: 100vh; min-height: 100dvh; }
.count { font-size: 12px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--grey-bg); color: var(--grey-fg); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; }
.count.amber { background: var(--amber-bg); color: var(--amber-fg); }

.main { min-width: 0; }
.bar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
  min-height: 56px; padding: 8px max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
  padding-top: max(8px, env(safe-area-inset-top));
  background: var(--bar-bg); color: var(--bar-fg);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08), 0 2px 8px rgba(16, 24, 40, 0.12);
}
.bar h1 { font-size: 19px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar.start h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.back { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; margin-left: -8px; padding: 0 6px; color: var(--accent); background: none; border: 0; cursor: pointer; font-size: 16px; }
.bar .back { color: var(--bar-fg); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; background: none; border-radius: 10px; cursor: pointer; color: var(--fg); }
.icon-btn:hover { background: var(--panel); }
.icon-btn svg, .back svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* the mock says its figures are invented (BFE-MOCK-5) */
.sample { font-size: 12px; color: var(--amber-fg); background: var(--amber-bg); border-radius: 6px; padding: 2px 8px; white-space: nowrap; }
.spin svg { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* the pull's indicator under the bar: drawn out by the finger, open and turning while busy */
.pull { height: var(--pull, 0px); overflow: hidden; display: flex; align-items: flex-end; justify-content: center; transition: height 0.2s ease; }
.pull.pulling { transition: none; }
.pull.busy { height: 48px; }
.pull-disc { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin-bottom: 8px; border-radius: 50%; background: var(--surface); color: var(--bar-bg); box-shadow: var(--card-shadow); }
.pull-disc svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transform: rotate(calc(var(--pull, 0px) * 4deg)); }
.pull.ready .pull-disc { background: var(--bar-bg); color: var(--bar-fg); }
.pull.busy .pull-disc svg { animation: spin 0.9s linear infinite; }
@media (prefers-reduced-motion: reduce) { .pull { transition: none; } .pull.busy .pull-disc svg { animation: none; } }

.content { padding: 18px max(16px, env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); max-width: 1180px; margin: 0 auto; }
body.desktop .content { padding: 22px 28px 60px; }
.li { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; padding: 8px 16px; border-bottom: 1px solid var(--rule); color: var(--fg); }
.li:hover { background: var(--panel); }
.li.on { background: var(--sel); }
.li .t { font-weight: 600; }
.li-h { padding: 14px 16px 4px; font-size: 12px; color: var(--faint); }
.empty { padding: 60px 24px; text-align: center; color: var(--muted); }

/* ---- the start page (BFE-OVZ) ------------------------------------------------- */
.content.start { max-width: 1080px; }
/* the bar's own buttons (search, an account's panel): light on the bar's colour */
.actionslot { display: inline-flex; margin-right: -8px; }
.actionslot:empty { display: none; }
.bar .actionslot .icon-btn { color: var(--bar-fg); }
.bar .actionslot .icon-btn:hover { background: rgba(255, 255, 255, 0.16); }
/* an account's panel: what there is beyond its transactions */
.acctpanel .sub { margin: 2px 0 12px; }
/* an account at two banks names each IBAN on its own line, one block under the name */
.acctpanel .sub:has(+ .sub) { margin-bottom: 0; }
.acctpanel .rows { border: 1px solid var(--rule); border-radius: 14px; overflow: clip; }
.sections, .sections > .col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-content: start; }
/* from 900 px the money on the left, the insight views on the right */
@media (min-width: 900px) { .sections { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.sec { background: var(--surface); border-radius: 16px; box-shadow: var(--card-shadow); border: 1px solid var(--rule); overflow: clip; }
.sec-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; padding: 10px 16px; color: var(--head-fg); font-size: 18px; font-weight: 700; border-bottom: 1px solid var(--rule); }
a.sec-h .name { display: flex; align-items: center; gap: 6px; }
a.sec-h .chev { color: var(--head-fg); font-size: 22px; line-height: 1; opacity: 0.8; }
a.sec-h:hover .name { text-decoration: underline; text-underline-offset: 3px; }
.sec-h .total { color: var(--fg); font-size: 18px; font-weight: 650; white-space: nowrap; }
.sec.menu .sec-h { font-size: 15px; color: var(--muted); min-height: 42px; }
.srow { display: flex; align-items: center; gap: 11px; min-height: 68px; padding: 10px 12px 10px 16px; color: var(--fg); border-bottom: 1px solid var(--rule); }
.srow:last-child { border-bottom: 0; }
.srow:hover { background: var(--panel); }
.srow:active { background: var(--sel); }
.srow.menu { min-height: 56px; }
.srow .av { width: 40px; height: 40px; border-radius: 12px; }
.srow .av svg { width: 22px; height: 22px; stroke-width: 1.9; }
.srow.menu .av { width: 34px; height: 34px; border-radius: 10px; }
.srow.menu .av svg { width: 19px; height: 19px; }
.srow .l { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.srow .n { font-size: 16.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srow.menu .n { font-size: 16px; font-weight: 500; }
.srow .s { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.srow .v { font-size: 17px; font-weight: 650; white-space: nowrap; color: var(--fg); }
.srow .chev { font-size: 22px; line-height: 1; color: var(--faint); margin-left: -2px; }
/* the start page's icons in full colour: the glyph light on the hue */
.srow .h-orange { background: var(--h-orange-fg); } .srow .h-blue { background: var(--h-blue-fg); } .srow .h-slate { background: var(--h-slate-fg); }
.srow .h-pink { background: var(--h-pink-fg); } .srow .h-teal { background: var(--h-teal-fg); } .srow .h-violet { background: var(--h-violet-fg); }
.srow .h-yellow { background: var(--h-yellow-fg); } .srow .h-cyan { background: var(--h-cyan-fg); } .srow .h-green { background: var(--h-green-fg); }
.srow .h-indigo { background: var(--h-indigo-fg); } .srow .h-grey { background: var(--h-grey-fg); } .srow .h-sand { background: var(--h-sand-fg); }
.srow .av[class*="h-"] { color: var(--surface); }
.startfoot { margin-top: 24px; text-align: center; font-size: 13px; color: var(--muted); }
.startfoot .foot-links { margin-top: 6px; }
.startfoot .foot-links a { color: var(--muted); }
.startfoot .foot-links a:hover { color: var(--accent); }
/* the selection's overview above the list, on the iPad */
.aside.above { margin-bottom: 14px; }

/* ---- cards and rows --------------------------------------------------------- */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
body.desktop .grid.groups { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 16px; min-width: 0; box-shadow: var(--card-shadow); }
a.card, .card.link { display: block; color: var(--fg); cursor: pointer; }
a.card:hover { border-color: var(--rule-strong); }
.card-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.card-h .name { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.card-h .total { font-size: 18px; font-weight: 600; white-space: nowrap; }
.row { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; color: var(--muted); min-width: 0; }
.row > :first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.row b { color: var(--fg); font-weight: 600; white-space: nowrap; }
a.row { color: var(--muted); }
a.row:hover b { color: var(--accent); }
.foot { margin-top: 8px; font-size: 12.5px; color: var(--faint); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.mark { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.mark.amber { background: var(--amber-mark); }
.mark.blue { background: var(--blue-mark); }
.mark.grey { background: var(--grey-mark); }
.section { margin-top: 26px; }
.section > h2 { margin-bottom: 10px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.section > h2 .small { font-weight: 400; }
/* the balance with the chart button beside it, top right */
.herorow { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.herorow .grow { flex: 1; min-width: 220px; }
.herorow > .chip { margin-top: 6px; }
.hero { font-size: 30px; font-weight: 650; letter-spacing: -0.01em; }
.sub { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.kv > div { background: var(--panel); border-radius: 10px; padding: 10px 12px; }
.kv .k { font-size: 12.5px; color: var(--muted); }
.kv .v { font-weight: 600; font-size: 17px; margin-top: 2px; }
.note { font-size: 13px; color: var(--muted); margin-top: 8px; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-weight: 500; color: var(--faint); font-size: 12.5px; padding: 6px 8px 6px 0; border-bottom: 1px solid var(--rule); }
table.t td { padding: 8px 8px 8px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.t td.num, table.t th.num { text-align: right; white-space: nowrap; }
.scrollx { overflow-x: auto; }

/* ---- chips, buttons, inputs ------------------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border: 1px solid var(--rule-strong); border-radius: 17px; background: var(--surface); color: var(--fg); font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }
select.chip { appearance: none; -webkit-appearance: none; padding-right: 26px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: right 13px top 15px, right 8px top 15px; background-size: 5px 5px; background-repeat: no-repeat; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--rule-strong); background: var(--surface); cursor: pointer; font-size: 14px; color: var(--fg); }
.btn:hover { background: var(--panel); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
:root[data-theme="dark"] .btn.primary { color: #0d1626; }
.btn.small { min-height: 32px; font-size: 13px; padding: 0 10px; }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
input[type="search"], input[type="number"], .inputs input[type="text"], select.inp {
  font: inherit; min-height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--rule-strong); background: var(--surface); color: var(--fg); width: 100%;
}
input[type="number"], .inputs input[type="text"] { width: 120px; }
.search { position: relative; margin-bottom: 4px; }
.inputs { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; background: var(--panel); border-radius: 12px; padding: 12px 14px; margin: 12px 0; }
.inputs label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); }
.inputs .saved { font-size: 12.5px; color: var(--muted); margin-left: auto; align-self: center; }
.tag { display: inline-flex; align-items: center; padding: 0 7px; height: 20px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.tag.new { background: var(--accent-bg); color: var(--accent); }
.tag.changed { background: var(--amber-bg); color: var(--amber-fg); }
.tag.ended { background: var(--grey-bg); color: var(--grey-fg); }
.tag.est { background: var(--grey-bg); color: var(--grey-fg); font-style: italic; font-weight: 500; }
.tag.pending { background: var(--grey-bg); color: var(--grey-fg); font-weight: 500; }
.cat { display: inline-block; font-size: 12px; padding: 0 7px; line-height: 20px; border-radius: 6px; background: var(--panel); color: var(--muted); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }

/* ---- notices ---------------------------------------------------------------- */
.notices { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.notice { display: flex; gap: 10px; align-items: flex-start; border-radius: 12px; padding: 11px 14px; font-size: 14px; }
.notice svg { width: 18px; height: 18px; flex: none; margin-top: 2px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.notice b { font-weight: 650; }
.notice .act { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 8px; }
.notice .act button { min-height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid currentColor; background: transparent; cursor: pointer; font-size: 13px; color: inherit; }
.notice .body { flex: 1; min-width: 0; }
/* the chevron that minimises (BFE-NOT-9): a 44px target reaching into the notice's padding, so the notice keeps its size */
.notice button.min { flex: none; display: grid; place-items: center; width: 44px; height: 44px; margin: -11px -14px -11px -8px; padding: 0; border: 0; border-radius: 12px; background: transparent; color: inherit; cursor: pointer; opacity: .75; }
.notice button.min:hover { opacity: 1; }
.notice button.min svg { margin-top: 0; }
.notice.minimised { cursor: pointer; }
.notice.amber { background: var(--amber-bg); color: var(--amber-fg); }
.notice.blue { background: var(--blue-bg); color: var(--blue-fg); }
.notice.grey { background: var(--grey-bg); color: var(--grey-fg); }
.fold { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 12px; background: var(--panel); border: 0; width: 100%; cursor: pointer; font-size: 14px; color: var(--fg); text-align: left; }
.fold .mark { margin-right: -2px; }
.fold span.grow { flex: 1; }

/* ---- transactions ------------------------------------------------------------- */
/* clip, not hidden: hidden would make the list the sticky day headers' scroll container */
.txlist { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); overflow: clip; }
.day { position: sticky; top: 56px; z-index: 2; padding: 8px 14px 6px; font-size: 12.5px; color: var(--faint); background: color-mix(in srgb, var(--surface) 94%, transparent); border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; }
.tx { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--rule); cursor: pointer; min-height: 56px; align-items: center; }
.tx:hover { background: var(--panel); }
.tx.on { background: var(--sel); }
.tx .l { min-width: 0; }
.tx .cp { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx .meta { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; min-width: 0; margin-top: 2px; }
.tx .meta .d1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tx .meta .cat { flex: none; }
/* icons in front of rows, and one hue per category family on icon and pill alike */
.av { flex: none; width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; letter-spacing: -0.02em; }
.av svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tx { justify-content: flex-start; gap: 12px; }
.tx .l { flex: 1; }
.tx.own .av { opacity: 0.75; }
.av { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
.av.img { background: var(--panel); overflow: hidden; padding: 0; }
.av.img img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.av.xs { width: 22px; height: 22px; border-radius: 6px; margin-right: 2px; }
.av.xs svg { width: 13px; height: 13px; }
.av.big { width: 64px; height: 64px; border-radius: 16px; }
.av.big svg { width: 34px; height: 34px; }
/* a bank account's bank before Banking has its logo (BFE-OVZ-8): the name on the bank's colour, the same in both themes */
.av.bank { --bank-ing: #ff6200; --bank-bunq: #20262b; --bank-knab: #0b3a8c; --bank-other: #5d6673; color: #fff; background: var(--bank-other); box-shadow: inset 0 0 0 1px var(--rule-strong); }
.av.bank.bank-ing { background: var(--bank-ing); }
.av.bank.bank-bunq { background: var(--bank-bunq); }
.av.bank.bank-knab { background: var(--bank-knab); }
.av.bank .bankname { font-size: 11.5px; font-weight: 750; letter-spacing: 0; }
.av.bank.img { background: #fff; }
.av.bank.img img { object-fit: contain; }
/* the icon picker */
.pick-cur { display: flex; justify-content: center; margin: 14px 0 6px; }
.pick-h { font-size: 12.5px; color: var(--faint); margin: 12px 0 6px; }
.hues { display: flex; flex-wrap: wrap; gap: 8px; }
.hue { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.hue.on { border-color: var(--fg); }
.glyphs { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.glyph { height: 44px; border-radius: 10px; border: 2px solid transparent; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.glyph.on { border-color: var(--fg); }
.glyph svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sheet.picker { width: min(560px, calc(100vw - 32px)); }
label.btn { position: relative; }
.av.sm { width: 28px; height: 28px; border-radius: 8px; font-size: 10.5px; }
.av.sm svg { width: 16px; height: 16px; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.h-orange { background: var(--h-orange-bg); color: var(--h-orange-fg); }
.h-blue { background: var(--h-blue-bg); color: var(--h-blue-fg); }
.h-slate { background: var(--h-slate-bg); color: var(--h-slate-fg); }
.h-pink { background: var(--h-pink-bg); color: var(--h-pink-fg); }
.h-teal { background: var(--h-teal-bg); color: var(--h-teal-fg); }
.h-violet { background: var(--h-violet-bg); color: var(--h-violet-fg); }
.h-yellow { background: var(--h-yellow-bg); color: var(--h-yellow-fg); }
.h-cyan { background: var(--h-cyan-bg); color: var(--h-cyan-fg); }
.h-green { background: var(--h-green-bg); color: var(--h-green-fg); }
.h-indigo { background: var(--h-indigo-bg); color: var(--h-indigo-fg); }
.h-grey { background: var(--h-grey-bg); color: var(--h-grey-fg); }
/* money coming in, as the ING app shows it */
.tx .amt.pos { background: var(--in-bg); color: var(--pos); padding: 2px 8px; border-radius: 7px; margin-right: -8px; }
/* a contrasting band between the days */
.day { background: var(--day-bg); color: var(--day-fg); font-weight: 600; border-bottom-color: transparent; }
/* invoice and fixed-payment teasers in an opened row */
.clip svg { width: 14px; height: 14px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -2px; }
.teaser { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; font-size: 13.5px; color: var(--muted); }
.teaser .grow { flex: 1; min-width: 0; }
.teaser b { color: var(--fg); font-weight: 600; }
.teaser > svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.teaser .av { width: 28px; height: 28px; border-radius: 8px; }
.teaser .av svg { width: 16px; height: 16px; }
/* recurring costs: dates and amounts in right-aligned columns under a header row */
.txlist.rec .tx { justify-content: flex-start; gap: 12px; }
.txlist.rec .tx .l { flex: 1; }
.rechead { display: flex; gap: 12px; padding: 8px 14px 6px; font-size: 12px; color: var(--faint); border-bottom: 1px solid var(--rule); }
.rechead .l { flex: 1; min-width: 0; }
.rc { flex: none; min-width: 84px; text-align: right; white-space: nowrap; position: relative; }
.rc .v { font-weight: 600; color: var(--fg); }
.rc .per { font-size: 12.5px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.rc.date { min-width: 66px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.tx.own .rc .v { color: var(--faint); font-weight: 500; }
.rechead .rc { font-size: 12px; font-weight: 400; color: var(--faint); }
/* the name with its category pill (and tags) on one line, wrapping when there is no room */
.txlist.rec .cp { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 6px; white-space: normal; }
.txlist.rec .cp .cat { font-weight: 400; }
/* desktop: hovering the amount shows since when, per year, the total */
.hovertip { display: none; position: absolute; right: calc(100% + 10px); top: 50%; transform: translateY(-50%); z-index: 5; text-align: left; white-space: nowrap; background: var(--surface); border: 1px solid var(--rule-strong); box-shadow: var(--shadow); border-radius: 8px; padding: 6px 9px; font-size: 12.5px; font-weight: 400; color: var(--fg); line-height: 1.5; }
/* wherever there is a mouse, not only in the desktop layout */
@media (hover: hover) and (pointer: fine) {
  .rc.amt:hover .hovertip { display: block; }
  .tx .rc.amt .v { text-decoration: underline dotted var(--rule-strong); text-underline-offset: 3px; cursor: default; }
}
/* the row that opens below a transaction or a recurring payment */
.rowopen { padding: 4px 14px 14px; border-bottom: 1px solid var(--rule); background: var(--sel); }
.rowopen .desc { margin: 4px 0 8px; background: var(--surface); }
.rowopen .row { align-items: center; }
.pays { margin-top: 8px; background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; overflow: clip; }
.pays-h { padding: 6px 10px; font-size: 12px; color: var(--faint); border-bottom: 1px solid var(--rule); }
.pays .pr { display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; border-bottom: 1px solid var(--rule); font-size: 13.5px; color: var(--muted); }
.pays .pr:last-child { border-bottom: 0; }
.pays .pr b { color: var(--fg); font-weight: 600; white-space: nowrap; }
/* desktop: lists at a readable width, with a side column for what belongs beside them */
body.desktop .content.with-aside { display: grid; grid-template-columns: minmax(0, 760px) 280px; gap: 28px; }
.aside { position: sticky; top: 76px; align-self: start; }
.aside .kv { grid-template-columns: 1fr; }
.aside .chips { margin-top: 0; }
.sidef { padding: 4px 0 12px; }
.sidef .li { min-height: 40px; padding: 6px 14px; }
.sidef .li-h { padding: 12px 14px 4px; }
.sidepad { padding: 4px 12px; }
body.phone .txlist.rec .tx, body.phone .rechead { gap: 8px; }
.tx .amt { font-weight: 600; white-space: nowrap; }
.tx.own .cp, .tx.own .amt { color: var(--faint); font-weight: 500; }
/* above the list: the search and filters, then a bar that stays at the top with the count and the
   button that pins them back into it */
.txhead { position: sticky; top: calc(56px + env(safe-area-inset-top)); z-index: 4; background: var(--bg); }
body.desktop .txhead, body.tablet .txhead { top: 56px; }
.txhead.pinned { padding-top: 8px; border-bottom: 1px solid var(--rule); box-shadow: 0 6px 14px rgba(16, 24, 40, 0.08); }
.txbar { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.txbar .grow { flex: 1; min-width: 0; }
.findbtn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.day { top: calc(56px + var(--txhead, 0px)); }
/* the overview of the selection, beside the list */
.sumrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 14px; font-size: 14px; }
.sumrow b { font-weight: 600; white-space: nowrap; }
.gapline { padding: 18px 14px; text-align: center; color: var(--muted); font-size: 13px; background: repeating-linear-gradient(135deg, var(--gap) 0 6px, transparent 6px 12px); border-bottom: 1px solid var(--rule); }
.more { padding: 16px; text-align: center; color: var(--faint); font-size: 13px; }

/* ---- charts ------------------------------------------------------------------- */
.chart { position: relative; width: 100%; margin: 6px 0; }
.chart svg { display: block; overflow: visible; touch-action: pan-y; }
.chart .ax { font-size: 11px; fill: var(--faint); }
.chart .lbl { font-size: 11px; fill: var(--muted); }
.chart .grid { stroke: var(--rule); stroke-width: 1; }
.chart .zero { stroke: var(--rule-strong); stroke-width: 1; }
.chart .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .ln.s1 { stroke: var(--s1); }
.chart .ln.s2 { stroke: var(--s2); }
.chart .ln.s3 { stroke: var(--s3); stroke-width: 1.6; }
.chart .ln.dashed { stroke-dasharray: 5 4; }
.chart .bar.s1 { fill: var(--s1); }
.chart .bar.s2 { fill: var(--s2); }
.chart .bar.s3 { fill: var(--s3); }
/* the BV's dividend beside the salary, in a colour of its own (BFE-INC-2) */
.chart .bar.dividend { fill: var(--amber-mark); }
.chart .bar.part { fill: var(--s2); }
.chart .area.s1 { fill: var(--s1); }
.chart .area.s2 { fill: var(--s2); }
.chart .gapband { fill: var(--gap); }
.chart .projband { fill: var(--bg); opacity: 0.35; }
.chart .marker { stroke: var(--rule-strong); stroke-dasharray: 3 3; }
.chart .refline { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 6 4; }
.chart .cross { stroke: var(--muted); stroke-width: 1; }
.chart .hit { fill: transparent; }
/* money in is green in charts as in lists; a chosen bar sits on a band; an unfinished period is lighter */
.chart .bar.in { fill: var(--in-bar); }
.chart .bar.in.part, .chart .bar.s3.part { opacity: 0.5; }
.chart .bar.in.part { fill: var(--in-bar); }
.chart .bar.s3.part { fill: var(--s3); }
.chart .selband { fill: var(--sel); }
.sw.in { background: var(--in-bar); }
/* value against money put in, as Meesman's app draws it: money in a slate area, growth a teal band, a loss amber */
.chart .ln.value { stroke: var(--h-teal-fg); }
.chart .ln.moneyin { stroke: var(--h-slate-fg); stroke-width: 1.6; }
.chart .gin-top { stop-color: var(--h-slate-fg); stop-opacity: 0.55; }
.chart .gin-bottom { stop-color: var(--h-slate-fg); stop-opacity: 0.04; }
.chart .band.gain { fill: var(--h-teal-fg); opacity: 0.3; }
.chart .band.loss { fill: var(--amber-mark); opacity: 0.45; }
.sw.value { background: var(--h-teal-fg); } .sw.moneyin { background: var(--h-slate-fg); }
.sw.gain { background: color-mix(in srgb, var(--h-teal-fg) 30%, transparent); } .sw.loss { background: color-mix(in srgb, var(--amber-mark) 45%, transparent); }
.tip { position: absolute; z-index: 4; pointer-events: none; background: var(--surface); border: 1px solid var(--rule-strong); box-shadow: var(--shadow); border-radius: 8px; padding: 7px 9px; font-size: 12.5px; white-space: nowrap; }
.tip-h { color: var(--muted); margin-bottom: 2px; }
.sw { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }
.sw.s1 { background: var(--s1); } .sw.s2 { background: var(--s2); } .sw.s3 { background: var(--s3); } .sw.dividend { background: var(--amber-mark); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--muted); }
.spark { width: 84px; height: 24px; flex: none; }
.spark path { fill: none; stroke: var(--s1); stroke-width: 1.6; }

/* ranked list */
.rank { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 4px 12px; align-items: center; }
.rank .rk { display: contents; color: var(--fg); cursor: pointer; }
.rank .rk > * { padding: 9px 0; border-bottom: 1px solid var(--rule); }
.rank .rk:hover > *, .rank .rk.on > * { background: var(--panel); }
.rank .rowopen.span { grid-column: 1 / -1; }
/* rows that open in place inside cards and tables */
.row.click, tr.click { cursor: pointer; }
.row.click:hover, .row.click.on, tr.click:hover td, tr.click.on td { background: var(--panel); }
.rowopen.inset { margin: 2px -16px 4px; padding: 8px 16px 10px; }
td.rowopen { padding: 6px 10px 10px; }
.headlink { color: var(--fg); }
.headlink:hover .name { color: var(--accent); }
.chev { color: var(--faint); font-weight: 400; margin-left: 2px; }
.rank .bar-in { height: 6px; border-radius: 3px; background: var(--s2); margin-top: 5px; }

/* ---- sheet, toast, prototype panel -------------------------------------------- */
.scrim { position: fixed; inset: 0; background: rgba(10, 14, 20, 0.38); z-index: 20; }
.sheet {
  position: fixed; z-index: 21; background: var(--surface); box-shadow: var(--shadow); overflow: auto;
  left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 64px); border-radius: 16px; padding: 18px 20px 20px;
}
body.phone .sheet { left: 0; right: 0; top: auto; bottom: 0; transform: none; width: auto; max-height: 86vh; border-radius: 18px 18px 0 0; padding-bottom: max(20px, env(safe-area-inset-bottom)); }
.grab { width: 38px; height: 5px; border-radius: 3px; background: var(--rule-strong); margin: -6px auto 12px; }
body:not(.phone) .grab { display: none; }
.sheet .close { position: absolute; right: 8px; top: 8px; }
.sheet h2 { padding-right: 40px; }
.desc { margin: 12px 0; padding: 10px 12px; background: var(--panel); border-radius: 10px; font-size: 13.5px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
/* links that open a document */
.doclink { display: inline-flex; align-items: center; gap: 5px; }
.doclink svg { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.doclink.missing { color: var(--amber-fg); }
/* the document viewer: nearly the whole screen */
.sheet.viewer { width: min(1100px, 96vw); height: 94vh; max-height: 94vh; display: flex; flex-direction: column; padding: 14px 16px 16px; }
body.phone .sheet.viewer { top: 0; height: 100vh; height: 100dvh; max-height: none; border-radius: 0; padding-top: max(14px, env(safe-area-inset-top)); }
.viewer-h { display: flex; align-items: center; gap: 12px; padding-right: 44px; margin-bottom: 10px; }
.viewer-h h2 { flex: 1; min-width: 0; padding: 0; }
.viewer-body { flex: 1; overflow: auto; background: var(--panel); border-radius: 10px; padding: 18px; }
.viewer-body iframe { width: 100%; height: 100%; border: 0; background: #ffffff; border-radius: 4px; }
.viewer-body.loading, .viewer-body.failed { display: grid; place-items: center; color: var(--muted); }
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; z-index: 30; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
body.phone .toasts { bottom: calc(24px + env(safe-area-inset-bottom)); }
.toast { background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
/* the loading screen, gone once the app has drawn itself (BFE-NET-13) */
#boot { position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; justify-items: center; gap: 12px; background: var(--bg); color: var(--faint); font-size: 14px; }
#boot img { border-radius: 22px; }
/* the connection note under the header (BFE-NET-7): covers nothing, takes no input */
.connnote { padding: 4px 16px; font-size: 12.5px; color: var(--muted); text-align: center; pointer-events: none; }
/* a refusal or a failure, said in place (BFE-AUTH-2, BFE-NET-10) */
.failed { padding: 14px 16px; border-radius: 12px; background: var(--grey-bg); color: var(--grey-fg); font-size: 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.failed .grow { flex: 1; min-width: 180px; }
/* a new version of the app (BFE-UPD-1 to BFE-UPD-5) */
.vd { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(10, 14, 20, 0.38); padding: 16px; }
.vd-panel { background: var(--surface); border-radius: 16px; padding: 20px; max-width: 360px; width: 100%; box-shadow: var(--shadow); }
.vd-message { margin: 0 0 6px; font-size: 16px; }
.vd-countdown { margin: 0 0 12px; color: var(--faint); font-size: 13px; }
.vd-actions { display: flex; gap: 8px; justify-content: flex-end; }
/* the hue Overig takes, kept apart from own transfers' grey (SPEC §5.1) */
.h-sand { background: var(--h-sand-bg); color: var(--h-sand-fg); }

.doc { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.doc .nm { display: flex; align-items: center; gap: 8px; min-width: 0; }
.doc .nm svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.7; }
.doc.missing .nm { color: var(--amber-fg); }
.tabsline { display: flex; gap: 4px; border-bottom: 1px solid var(--rule); margin: 14px 0 4px; }
.tabsline a { padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabsline a.on { color: var(--fg); border-color: var(--fg); font-weight: 600; }

/* ---- the app's own, beyond the prototype -------------------------------------- */
.backslot:empty { display: none; }
.viewer-wrap { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.content.wide { max-width: none; }
.li.sub { padding-left: 30px; }
.below { color: var(--amber-fg); }
.loading { padding: 8px 0; color: var(--faint); font-size: 13px; }
.rowopen .failed { margin: 6px 0; }
.pays .pr.own span, .pays .pr.own b { color: var(--faint); font-weight: 500; }
.txlist.coming .tx { cursor: pointer; }
.txlist.coming .right { text-align: right; flex: none; margin-left: auto; }
.txlist.coming .who { flex: 1; min-width: 0; }
.txlist.coming .cpn { font-weight: 600; }
table.t tr.click td { cursor: pointer; }
.bar h1 { min-width: 6em; }
body.phone .bar .sample { font-size: 11px; padding: 2px 6px; }

@media print {
  .bar .icon-btn, .pull, .btns, .chips, .tabsline { display: none !important; }
  .card, .sec { break-inside: avoid; }
}
