/* Home Assistant look-and-feel: Roboto, HA default theme tokens, ha-card
   surfaces. Ingress serves this page inside an iframe where HA theme
   variables don't reach, so the defaults are mirrored here for both modes.
   Chart mark colors are dataviz-validated per surface (see comments). */

:root {
  --bg: #fafafa;                  /* --primary-background-color */
  --surface: #ffffff;             /* --card-background-color */
  --text: #212121;                /* --primary-text-color */
  --muted: #727272;               /* --secondary-text-color */
  --border: rgba(0, 0, 0, 0.12);  /* --divider-color */
  --primary: #03a9f4;             /* --primary-color (HA blue) */
  --primary-ink: #ffffff;
  --error: #db4437;               /* --error-color */
  --success-text: #2e7d32;
  --warning-text: #b26b00;
  --chart-mark: #03a9f4;          /* validated: light card surface */
  --chart-mark-2: #ef6c00;        /* validated: light card surface */
  --chart-mark-3: #8e24aa;        /* validated: light card surface */
  --radius-card: 12px;            /* --ha-card-border-radius */
  --radius-control: 8px;
}
/* Dark tokens apply when the OS prefers dark (unless the user pinned light
   with the toggle) or when the toggle pinned dark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111111;
    --surface: #1c1c1c;
    --text: #e1e1e1;
    --muted: #9b9b9b;
    --border: rgba(255, 255, 255, 0.12);
    --primary: #03a9f4;
    --primary-ink: #ffffff;
    --error: #ef5350;
    --success-text: #81c784;
    --warning-text: #ffb74d;
    --chart-mark: #039be5;        /* validated: dark card surface */
    --chart-mark-2: #e65100;      /* validated: dark card surface */
    --chart-mark-3: #9c27b0;      /* validated: dark card surface */
  }
}
:root[data-theme="dark"] {
  --bg: #111111;
  --surface: #1c1c1c;
  --text: #e1e1e1;
  --muted: #9b9b9b;
  --border: rgba(255, 255, 255, 0.12);
  --primary: #03a9f4;
  --primary-ink: #ffffff;
  --error: #ef5350;
  --success-text: #81c784;
  --warning-text: #ffb74d;
  --chart-mark: #039be5;
  --chart-mark-2: #e65100;
  --chart-mark-3: #9c27b0;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* the hidden attr must beat display classes */
body {
  margin: 0;
  font-family: Roboto, "Noto Sans", -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

/* ---- toolbar (HA app header) ---- */
.topbar {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  height: 56px;
  padding: 0 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { font-size: 1.25rem; font-weight: 400; letter-spacing: 0.01em; white-space: nowrap; display: inline-flex; align-items: center; gap: 0.5rem; }
.brand-logo { height: 1em; width: auto; }
/* nav pills scroll horizontally when they don't fit; the fading chevrons on
   either edge hint that more are off-screen (classes toggled by base.html) */
.nav-scroll { position: relative; flex: 1; min-width: 0; }
.topbar nav { display: flex; gap: 0.15rem; overflow-x: auto; scrollbar-width: none; }
.topbar nav::-webkit-scrollbar { display: none; }
.nav-chevron {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2.4rem;
  display: flex;
  align-items: center;
  border: none;
  padding: 0;
  color: var(--muted);
  font: inherit;
  font-size: 1.3rem;
  cursor: pointer;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}
.nav-chevron:hover { color: var(--text); }
.nav-chevron-left {
  left: 0;
  justify-content: flex-start;
  background: linear-gradient(to right, var(--surface) 35%, transparent);
}
.nav-chevron-right {
  right: 0;
  justify-content: flex-end;
  background: linear-gradient(to left, var(--surface) 35%, transparent);
}
.nav-scroll.can-left .nav-chevron-left,
.nav-scroll.can-right .nav-chevron-right { opacity: 1; pointer-events: auto; }
.topbar nav a {
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}
.topbar nav a:hover { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }
.topbar nav a.active { background: color-mix(in srgb, var(--primary) 18%, transparent); color: var(--primary); }
.logout-form { margin: 0; }
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.icon-button:hover { color: var(--text); background: color-mix(in srgb, var(--text) 8%, transparent); }
.icon-action { width: 32px; height: 32px; }
.icon-action:hover { color: var(--primary); }
.icon-danger:hover { color: var(--error); background: color-mix(in srgb, var(--error) 10%, transparent); }
.icon-button:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: block; }
  :root:not([data-theme="light"]) .icon-moon { display: none; }
}
.link-button {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font: inherit;
  font-weight: 500;
}
.link-button:hover { text-decoration: underline; }

.container { margin: 0 auto; padding: 1.5rem 1.5rem 3rem; }
/* the container's padding alone sets the gap below the topbar — first
   elements (h2's 1.8rem top margin, p's default) must not add to it, and
   pinned bars that open a page absorb their own top padding so their
   controls line up with plain pages' first content */
.container > :first-child { margin-top: 0; }
.container > .filters:first-child { margin-top: -0.6rem; }
.container > .rules-head:first-child { margin-top: -1.1rem; }  /* the tab buttons' own 0.5rem padding reads as page gap */
.desc-cell { max-width: 26rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
h1 { font-size: 1.5rem; font-weight: 400; margin: 0 0 1rem; }
h2 { font-size: 1rem; font-weight: 500; color: var(--muted); text-transform: none; margin: 1.8rem 0 0.6rem; }
.hint { color: var(--muted); }
a { color: var(--primary); }
.error { color: var(--error); }
code {
  background: color-mix(in srgb, var(--text) 7%, transparent);
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  font-size: 0.85em;
}

/* ---- ha-card surfaces ---- */
.table-wrap, .budget-bars, .login-box, .stat-tile, .flash {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}
.table-wrap {
  overflow-x: auto;
  /* theme-aware scrollbars: the tokens flip with dark mode so the thumb is
     always a subtle tint of the text color instead of the OS default */
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--text) 30%, transparent) transparent;
}
.table-wrap::-webkit-scrollbar { height: 8px; width: 8px; }
.table-wrap::-webkit-scrollbar-track { background: transparent; }
.table-wrap::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--text) 25%, transparent);
  border-radius: 4px;
}
.table-wrap::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--text) 45%, transparent);
}
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.6rem 1rem; border-bottom: 1px solid var(--border); }
tbody:last-of-type tr:last-child td { border-bottom: none; }
th { color: var(--muted); font-weight: 500; white-space: nowrap; }
tbody tr:hover td { background: color-mix(in srgb, var(--text) 3%, transparent); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sort-link { color: inherit; text-decoration: none; white-space: nowrap; }
.sort-link:hover { color: var(--primary); }
.info-icon { color: var(--muted); display: inline-flex; align-items: center; vertical-align: middle; cursor: help; }
.info-icon:hover { color: var(--primary); }
.credit { color: var(--success-text); }
.nowrap { white-space: nowrap; }
.over { color: var(--error); }
.total-row td { font-weight: 700; border-top: 2px solid var(--border); }

/* ---- badges / pills ---- */
.badge { padding: 0.1rem 0.6rem; border-radius: 999px; font-size: 0.78rem; font-weight: 500; border: 1px solid var(--border); }
.badge-ok { color: var(--success-text); }
.badge-partial { color: var(--warning-text); }
.badge-failed { color: var(--error); }
.count-pill { background: var(--primary); color: var(--primary-ink); border-radius: 999px; padding: 0.05rem 0.65rem; font-size: 0.95rem; vertical-align: middle; font-weight: 500; }
.count-detail { color: var(--muted); font-size: 0.95rem; vertical-align: middle; font-weight: 400; }
.companion-pill { background: var(--surface); border: 1px solid var(--primary); color: var(--primary); border-radius: 999px; padding: 0.1rem 0.6rem; font-size: 0.8rem; font-weight: 500; }
.companion-pill[data-state="busy"] { border-color: var(--warning-text); color: var(--warning-text); }
.ai-badge { color: var(--primary); border: 1px dashed var(--primary); border-radius: 999px; padding: 0.05rem 0.5rem; font-size: 0.76rem; white-space: nowrap; }
.over-badge { color: var(--error); border: 1px solid var(--error); border-radius: 999px; padding: 0 0.4rem; font-size: 0.75rem; margin-left: 0.3rem; }
.flash { border-color: var(--primary); padding: 0.7rem 1rem; }

/* ---- buttons & inputs (Material-ish, HA) ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 0.9rem;
  border-radius: var(--radius-control);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
.btn-accent { border-color: var(--primary); color: var(--primary); }
.btn-accent:hover { background: color-mix(in srgb, var(--primary) 10%, transparent); }
.btn-danger { border-color: var(--error); color: var(--error); }
.btn-danger:hover { background: color-mix(in srgb, var(--error) 10%, transparent); }
.btn-chevron { padding: 0 0.35rem; color: var(--muted); }
.btn-chevron:hover { color: var(--text); }

button[type="submit"]:not(.link-button):not(.btn):not(.icon-button), .save-button {
  height: 36px;
  padding: 0 1.2rem;
  border: none;
  border-radius: var(--radius-control);
  background: var(--primary);
  color: var(--primary-ink);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
button[type="submit"]:not(.link-button):not(.btn):not(.icon-button):hover, .save-button:hover {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
input[type="text"], input[type="password"], input[type="search"], select {
  height: 36px;
  padding: 0 0.6rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
input:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }

/* ---- page furniture ---- */
.page-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; margin-bottom: 0.75rem; }
.queue-count { margin-left: auto; display: inline-flex; gap: 0.5rem; align-items: center; white-space: nowrap; }
.month-nav { display: flex; gap: 0.6rem; align-items: center; }
.inline-month-nav { margin: 1rem 0; }
.inline-month-nav + h2 { margin-top: 1rem; }  /* the chart heading follows the selector, tighter than a full section gap */
.filters { display: flex; gap: 0.6rem; margin-bottom: 1rem; align-items: center; flex-wrap: wrap; }
/* filter/search bars pin below the topbar; full-bleed over the container's
   side padding so scrolling rows never peek out beside them */
.filters, .search-row {
  position: sticky;
  top: 56px;
  z-index: 9;
  background: var(--bg);
  margin-left: -1.5rem;
  margin-right: -1.5rem;
  padding: 0.6rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.filters .btn-chevron { height: 36px; }
.filters select, .confirm-form select { max-width: 14rem; }
.confirm-form { display: flex; gap: 0.5rem; align-items: center; margin: 0; width: 100%; }
.confirm-form button[type="submit"] { margin-left: auto; }
.apply-matching { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.apply-form { margin: 1rem 0; }
.inline-form { display: inline; margin: 0; }
.rule-form { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.6rem; align-items: center; }
.rule-form input[type="text"] { flex: 1; min-width: 12rem; max-width: 28rem; }
.rule-form .apply-matching { display: inline-flex; align-items: center; gap: 0.35rem; }
.budget-input { width: 7rem; text-align: right; }
.pin-form { display: block; margin-bottom: 1rem; }

/* ---- stat tiles ---- */
.stat-row { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.stat-tile { padding: 1rem 1.4rem; min-width: 11rem; display: flex; flex-direction: column; }
.stat-value { font-size: 1.7rem; font-weight: 400; }
.stat-label { color: var(--muted); font-size: 0.85rem; }
.stat-link { text-decoration: none; color: inherit; }
.stat-link:hover { border-color: var(--primary); }
.accounts-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.8rem; }
.account-tile { flex-direction: row; align-items: center; gap: 0.9rem; }
.account-tile-body { display: flex; flex-direction: column; min-width: 0; }
.account-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-balance { font-size: 0.9rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.account-asat { font-size: 0.78rem; white-space: nowrap; display: inline-flex; align-items: center; gap: 0.25rem; }
.bank-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 8px;
  background: #ffffff;   /* logos assume a light backdrop; keep it in dark mode */
  padding: 3px;
  border: 1px solid var(--border);
}
.bank-cell { padding-right: 0; }
.bank-logo.bank-logo-sm { width: 22px; height: 22px; padding: 2px; border-radius: 6px; display: block; }

/* ---- upload ---- */
.upload-form { display: flex; gap: 0.8rem; align-items: stretch; margin-bottom: 1.2rem; }
.drop-zone {
  flex: 1;
  border: 2px dashed var(--border);
  border-radius: var(--radius-card);
  padding: 1.2rem;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  background: var(--surface);
}
.drop-zone:hover, .drop-zone.drag { border-color: var(--primary); }
.drop-zone input { display: none; }
.drop-zone { display: flex; align-items: center; justify-content: center; gap: 0.8rem; flex-wrap: wrap; }
.faux-button {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 1.2rem;
  border-radius: var(--radius-control);
  border: 1px solid var(--primary);
  color: var(--primary);
  font-weight: 500;
  white-space: nowrap;
}
.drop-zone:hover .faux-button { background: color-mix(in srgb, var(--primary) 10%, transparent); }
.upload-side { display: flex; flex-direction: column; gap: 0.5rem; justify-content: center; }
.upload-side select, .upload-side input { max-width: 17rem; }
#new-account-fields { display: flex; gap: 0.4rem; }

/* ---- budget bars ---- */
.budget-bars { display: flex; flex-direction: column; gap: 0.45rem; padding: 1rem 1.2rem; }
.budget-row { display: grid; grid-template-columns: 11rem 1fr 15rem; gap: 0.8rem; align-items: center; color: inherit; text-decoration: none; border-radius: 6px; }
a.budget-row:hover { background: color-mix(in srgb, var(--text) 4%, transparent); }
a.budget-row:hover .budget-name { color: var(--primary); }
.budget-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.budget-track { height: 8px; background: color-mix(in srgb, var(--text) 8%, transparent); border-radius: 4px; overflow: hidden; }
.budget-fill { height: 100%; background: var(--chart-mark); border-radius: 4px; }
.budget-fill.over { background: var(--error); }
.budget-fill.nobudget { opacity: 0.45; }
.budget-figures { font-variant-numeric: tabular-nums; font-size: 0.88rem; text-align: right; white-space: nowrap; }

/* ---- chart ---- */
.chart-wrap { padding: 1rem; }
.spend-chart { width: 100%; height: auto; display: block; }
.spend-chart .gridline { stroke: var(--border); stroke-width: 1; }
.spend-chart .axis-line { stroke: color-mix(in srgb, var(--text) 30%, transparent); stroke-width: 1; }
.spend-chart .bar-neg { cursor: pointer; }
.spend-chart .limit-line { stroke: var(--warning-text); stroke-width: 1.5; stroke-dasharray: 2 3; }
.spend-chart .limit-hit { stroke: transparent; stroke-width: 12; cursor: default; }
.spend-chart .limit-warn { font-size: 12px; fill: var(--warning-text); cursor: default; }
.spend-chart .bar { fill: var(--chart-mark); opacity: 0.55; }
.spend-chart .bar-recurring { fill: var(--chart-mark-2); }
.spend-chart .bar-other { fill: var(--chart-mark-3); }
.spend-chart .bar-current { opacity: 1; }
.chart-legend { display: flex; gap: 1.2rem; align-items: center; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.5rem; }
.legend-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 0.4rem; vertical-align: -1px; }
.legend-recurring { background: var(--chart-mark-2); }
.legend-spending { background: var(--chart-mark); }
.legend-other { background: var(--chart-mark-3); }
.spend-chart .bar-hit { fill: transparent; cursor: pointer; }
.spend-chart .bar-group:hover .bar { opacity: 1; }
.spend-chart .axis-label { fill: var(--muted); font-size: 11px; }

/* ---- categories ---- */
.account-row-form { display: flex; gap: 0.6rem; align-items: center; margin: 0; }
.account-row-form input[name="name"] { flex: 0 1 26rem; min-width: 10rem; width: 26rem; }
.archived-row td { opacity: 0.55; }
.row-actions { display: flex; justify-content: flex-end; align-items: center; gap: 0.2rem; }
.filters #txn-search { flex: 1; min-width: 12rem; max-width: 26rem; }
.limit-card { display: flex; gap: 1rem; align-items: center; padding: 0.7rem 1rem; }
.search-row { display: flex; gap: 0.6rem; align-items: center; margin-bottom: 1rem; }
.search-row input[type="search"] { flex: 1; max-width: 26rem; }
/* rules page: the tabs + active tab's search pin as one block; the inner
   search rows must not try to stick on their own */
.rules-head {
  position: sticky;
  top: 56px;
  z-index: 9;
  background: var(--bg);
  margin: 0 -1.5rem 1rem;
  padding: 0.6rem 1.5rem 0;
  border-bottom: 1px solid var(--border);
}
.rules-head .tabs { margin-bottom: 0.4rem; border-bottom: 0; }
.rules-head .search-row {
  position: static;
  margin: 0;
  padding: 0.2rem 0 0.6rem;
  border-bottom: 0;
  background: transparent;
}

/* ---- dialogs ---- */
dialog {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  color: var(--text);
  padding: 1.2rem 1.4rem;
  min-width: 20rem;
}
dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
dialog h2 { margin: 0 0 0.8rem; }
dialog form input[type="text"] { width: 100%; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1rem; }
.split-cell { white-space: nowrap; padding-right: 0; }
.split-part td { background: color-mix(in srgb, var(--text) 2.5%, transparent); border-bottom-style: dashed; }
.part-amount { width: 7rem; text-align: right; font-variant-numeric: tabular-nums; }
.search-hit td { background: color-mix(in srgb, var(--primary) 14%, transparent); }
tbody tr.search-current td { background: color-mix(in srgb, var(--primary) 32%, transparent); }
.add-category-bar, .totals-bar {
  position: sticky;
  bottom: 0;
  margin-top: 0.8rem;
  padding: 0.7rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.12);
  z-index: 5;
}
.totals-bar { margin-left: auto; width: fit-content; min-width: 24rem; padding: 0.5rem 1rem; }
.totals-line { display: flex; justify-content: space-between; gap: 2.5rem; }
.totals-grand { font-weight: 700; border-top: 1px solid var(--border); margin-top: 0.25rem; padding-top: 0.25rem; }
.add-category-bar input[name="name"] { flex: 1; max-width: 28rem; }
.apply-bar { width: fit-content; }
/* ---- tabs ---- */
.tabs { display: flex; gap: 0.3rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border); }
.tabs .tab {
  background: none; border: none; font: inherit; cursor: pointer;
  padding: 0.5rem 1rem; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs .tab:hover { color: var(--text); }
.tabs .tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }
.add-category-bar .confirm-form button[type="submit"] { margin-left: 0; }
.grow-cell { width: 99%; }  /* claim the table's slack so other columns hug their content */
.number-input { width: 13rem; }
.cat-select { max-width: 13rem; }
.alloc-select { width: 7.5rem; }
.note-input { width: 11rem; }
.note-input::placeholder { color: color-mix(in srgb, var(--muted) 60%, transparent); }
.flash-saved { border-color: var(--success-text) !important; box-shadow: 0 0 0 1px var(--success-text); transition: box-shadow 1.2s ease 0.8s, border-color 1.2s ease 0.8s; }
/* offers under a picker after a manual category/type change */
.followup { display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; margin-top: 0.25rem; }
.followup button { font-size: 0.78rem; padding: 0.15rem 0.5rem; border: 1px solid var(--border); border-radius: 6px; background: transparent; color: var(--primary); cursor: pointer; text-align: left; }
.followup button:hover { background: color-mix(in srgb, var(--primary) 10%, transparent); }
.grow-cell .confirm-form { width: 100%; }
.grow-cell .confirm-form input[name="name"] { flex: 0 1 26rem; min-width: 10rem; width: 26rem; }
.grow-cell .confirm-form select { width: 16rem; max-width: 16rem; flex: none; }
.icon-placeholder { display: inline-block; width: 32px; height: 32px; }
.danger { color: var(--error); }

.version-tag { color: var(--muted); font-size: 0.78rem; white-space: nowrap; }

/* ---- login ---- */
.login-box { max-width: 22rem; margin: 12vh auto 0; padding: 2rem; }
.login-box h1 { text-align: center; }
.login-title { display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
.login-logo { height: 1.15em; width: auto; }
.login-box form { display: flex; flex-direction: column; gap: 0.8rem; }

@media (max-width: 720px) {
  .budget-row { grid-template-columns: 1fr; gap: 0.2rem; }
  .budget-figures { text-align: left; }
  .topbar { height: auto; padding: 0.5rem 1rem; gap: 0.7rem; }
  .accounts-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand-text { display: none; }  /* the logo is sufficient */
  .brand-logo { height: 1.5em; }
}

