:root {
  color-scheme: light;
  --ink: #182c24;
  --green: #143d31;
  --muted: #496055;
  --line: #d9e3da;
  --base: #f3f5ef;
  --white: #fff;
  font: 16px/1.5 system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--base); color: var(--ink); }
.wrap { width: min(100% - 32px, 900px); margin-inline: auto; }
.top { background: var(--green); color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; padding-block: 14px; }
.brand strong { display: block; letter-spacing: .16em; line-height: 1.25; }
.brand span { display: block; color: #d4e7c7; font-size: .68rem; letter-spacing: .16em; }
#app-menu { position: relative; margin-left: auto; z-index: 5; }
#app-menu summary { display: grid; place-items: center; list-style: none; width: 44px; height: 44px; border: 1px solid #93b397; border-radius: 10px; cursor: pointer; }
#app-menu summary::-webkit-details-marker { display: none; }
.brand .hamburger { width: 20px; height: 2px; background: #fff; box-shadow: 0 -6px #fff, 0 6px #fff; }
.app-menu-actions { position: absolute; top: calc(100% + 6px); right: 0; min-width: 150px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); box-shadow: 0 8px 20px rgb(0 0 0 / 18%); }
.app-menu-actions button { display: block; width: 100%; min-height: 44px; text-align: left; }
.app-menu-actions button:hover { background: var(--base); }
main { padding-block: 24px 48px; }
h1, h2, h3, h4, p, ul, fieldset { margin: 0; }
h1 { font-size: clamp(1.75rem, 6vw, 2.65rem); letter-spacing: -.04em; line-height: 1.12; }
h2 { font-size: 1.22rem; letter-spacing: -.02em; }
h3 { font-size: 1.1rem; }
h4 { font-size: .9rem; margin-bottom: 8px; }
p, li, strong { overflow-wrap: anywhere; }
ul { list-style: none; padding: 0; }
.eyebrow { color: #35624a; font-size: .73rem; letter-spacing: .16em; font-weight: 750; margin-bottom: 8px; }
.muted { color: var(--muted); font-weight: 400; }
.panel { min-width: 0; padding: 16px; border-radius: 16px; background: var(--white); border: 1px solid var(--line); }
.welcome { max-width: 480px; margin: 24px auto 0; padding: clamp(20px, 5vw, 32px); }
.welcome p:not(.eyebrow) { margin: 16px 0 24px; color: var(--muted); }
#status:empty { display: none; }
#status, .notice { background: #e8eee3; border-radius: 12px; padding: 10px 14px; margin-block: 12px; }
#status.error { color: #862f26; background: #f7e8e4; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 10px; margin: 24px 0 12px; }
.section-head:first-child { margin-top: 0; }
.balances { background: var(--green); color: #fff; border: 0; }
.totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(145px, 100%), 1fr)); gap: 10px; margin-top: 12px; }
.total { padding: 10px 12px; background: #245243; border-radius: 10px; }
.total span { display: block; color: #d4e7c7; font-size: .75rem; letter-spacing: .08em; }
.total strong { font-size: 1.23rem; font-variant-numeric: tabular-nums; }
.cards, .forms, .activity { display: grid; gap: 10px; }
.cards { grid-template-columns: repeat(auto-fit, minmax(min(225px, 100%), 1fr)); }
.card strong, .entry strong { display: block; }
.card p, .entry p, time { font-size: .88rem; color: var(--muted); }
.entry ul { margin-top: 7px; font-size: .9rem; }
.entry li + li { margin-top: 2px; }
.badge { color: var(--green); background: #e0eadf; border-radius: 999px; padding: 3px 10px; font-size: .78rem; }
form, fieldset, #transfer, #split-lines { display: grid; gap: 12px; }
fieldset { border: 0; padding: 0; min-inline-size: 0; }
label { display: grid; gap: 4px; font-size: .87rem; font-weight: 620; min-width: 0; }
input, select, button { min-height: 44px; font: inherit; border-radius: 8px; }
input, select { width: 100%; min-width: 0; padding: 8px 10px; border: 1px solid #8fa597; background: #fff; color: var(--ink); font-size: 1rem; }
button { padding: 8px 14px; border: 1px solid transparent; background: var(--green); color: #fff; cursor: pointer; font-weight: 650; }
button.secondary, button.quiet { background: transparent; color: var(--green); border-color: #8fa597; }
button:disabled, fieldset:disabled button { opacity: .6; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #a25b13; outline-offset: 2px; }
.split-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 8px; align-items: end; }
.split-row button { grid-column: 1 / -1; justify-self: end; }
#add-split, #retry { margin-top: 10px; }
#actions, #workspace-content > section:last-child { margin-top: 24px; }
@media (min-width: 650px) {
  .wrap { width: min(100% - 56px, 900px); }
  .forms { grid-template-columns: 1.35fr 1fr; align-items: start; }
}

#account-layout { display: grid; gap: 18px; }
#account-sidebar, #account-detail { min-width: 0; }
#account-sidebar .section-head { margin-block: 18px 8px; }
#all-accounts { width: 100%; text-align: left; margin-bottom: 10px; }
.account-group { margin-bottom: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); overflow: hidden; }
.account-group summary { cursor: pointer; padding: 10px 12px; }
.account-group summary small { display: block; color: var(--muted); margin-left: 1em; overflow-wrap: anywhere; }
.account-row { display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; gap: 10px; width: 100%; text-align: left; background: transparent; color: var(--ink); border-radius: 0; border-top: 1px solid var(--line); }
.account-row[aria-pressed="true"], #all-accounts[aria-pressed="true"] { background: #e0eadf; }
.account-row strong, .transaction-amounts small { display: block; }
.account-logo { width: 38px; height: 38px; display: inline-grid; place-items: center; position: relative; overflow: hidden; border-radius: 8px; background: #e0eadf; color: var(--green); }
.account-logo img { position: absolute; inset: 0; width: 100%; height: 100%; padding: 4px; object-fit: contain; background: white; }
.positive { color: #246547; }
.negative { color: #a13231; }
.transaction-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, auto); gap: 12px; }
.transaction-amounts { text-align: right; font-variant-numeric: tabular-nums; }
.transaction-amounts small { color: var(--muted); }
#account-detail .section-head { margin-block: 10px; }
@media (max-width: 699px) {
  #account-layout:not(.show-detail) #account-detail, #account-layout.show-detail #account-sidebar { display: none; }
}
@media (min-width: 700px) {
  .wrap { width: min(100% - 56px, 1220px); }
  #account-layout { grid-template-columns: minmax(240px, 1fr) minmax(0, 2.2fr); }
  #accounts-back { display: none; }
}

#import-dialog, #statement-dialog { width: min(640px, calc(100% - 32px)); max-height: 85vh; border: 1px solid var(--line); border-radius: 14px; background: var(--white); color: var(--ink); padding: 20px; }
#import-dialog::backdrop, #statement-dialog::backdrop { background: rgb(0 0 0 / 45%); }
#import-form { display: grid; gap: 10px; margin-block: 12px; }
#import-form label { display: grid; gap: 4px; }
#import-form label.check { display: flex; align-items: center; gap: 8px; }
#import-form label.check input, .import-row > input[type="checkbox"] { width: auto; min-width: 0; flex: none; margin: 0; padding: 0; }
#import-new { display: grid; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 0; }
#import-new[hidden] { display: none; }
#import-report details { margin-block: 10px; }
#import-report summary { cursor: pointer; font-weight: 700; }
.import-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: start; padding: 8px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.import-row-body { display: grid; gap: 4px; min-width: 0; }
.import-row-detail { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--muted, inherit); font-size: .92rem; }
.import-row-detail input, .import-row-detail select { min-width: 0; max-width: 100%; flex: 1 1 160px; }
button.small { padding: 4px 10px; font-size: .85rem; }
#confirm-import { margin-top: 12px; }

.account-tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-block: 12px; }
#open-transaction { min-width: 44px; font-size: 1.35rem; }
#account-dialog, #transaction-dialog, #group-dialog, #order-dialog {
  width: min(620px, calc(100% - 32px)); max-height: 88vh; border: 1px solid var(--line);
  border-radius: 16px; padding: 16px; background: var(--white); color: var(--ink);
}
dialog::backdrop { background: rgb(0 0 0 / 45%); }
dialog > button[data-close] { margin-block: 8px; }
.dialog-status:empty { display: none; }

.transaction-types {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 24px;
}
.transaction-types label { position: relative; cursor: pointer; }
.transaction-types input { position: absolute; width: 1px; height: 1px; min-height: 0; opacity: 0; }
.transaction-types span {
  display: grid; place-items: center; min-height: 44px; padding-inline: 4px;
  border-radius: 20px; text-align: center;
}
.transaction-types input:checked + span { background: var(--green); color: white; }
.transaction-types input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

#transaction textarea { width: 100%; font: inherit; padding: 8px; }

#status-filters { display: flex; flex-wrap: nowrap; gap: 4px; margin-bottom: 8px; overflow-x: auto; padding: 2px; }
#status-filters button { flex: none; }
#status-filters [data-status] { background: var(--white); color: var(--ink); border: 1px solid var(--line); border-radius: 22px; }
#status-filters [aria-pressed="true"] { background: var(--green); color: white; }
#status-filters [data-status]::before {
  content: ''; display: inline-block; width: .65em; height: .65em;
  border-radius: 50%; margin-right: .45em; background: var(--dot); opacity: .55;
}
#status-filters [aria-pressed="true"]::before { opacity: 1; }
[data-status="cleared"] { --dot: #36c76a; }
[data-status="pending"] { --dot: #f25461; }
[data-status="forecast"] { --dot: #9ca3af; }

#filter-dialog { width: min(460px, 90vw); max-height: 85vh; border: 1px solid var(--line); border-radius: 16px; }
.filter-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.filter-options label { display: flex; align-items: center; gap: 8px; }
.filter-options input, #activity input[type=checkbox], #activity-table input[type=checkbox] { width: 1.2rem; min-height: 1.2rem; }
#activity-table { overflow: auto; }
#activity-table table { width: 100%; border-collapse: collapse; }
#activity-table th, #activity-table td { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; }
#bulk-menu, #reconcile-panel { margin-block: 8px; }
#bulk-menu button { margin: 4px; }
#status-filters button[aria-pressed=true] { background: var(--green); color: white; }

#activity { gap: 0; margin-top: 8px; }
#activity .transaction-row {
  padding: 5px 8px; gap: 0 8px; border-radius: 0; border-width: 0 0 1px;
  line-height: 1.25; align-items: start;
}
.transaction-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.transaction-meta { display: flex; gap: 4px 8px; flex-wrap: wrap; color: var(--muted); font-size: .75rem; }
.transaction-meta time { font-size: inherit; }
.transaction-meta span:last-child { overflow-wrap: anywhere; }
.transaction-amounts { font-size: .875rem; }
.transaction-amounts small { font-size: .75rem; }
.transaction-details { grid-column: 1 / -1; color: var(--muted); font-size: .75rem; }
.transaction-details summary { cursor: pointer; width: fit-content; }
#activity-table th, #activity-table td { padding: 4px 6px; }

#open-transaction { margin-left: auto; }
#archived-dialog, #account-actions-dialog { width: min(420px, calc(100% - 32px)); max-height: 85vh; border: 1px solid var(--line); border-radius: 14px; }
#account-actions-list { display: grid; gap: 6px; }
.archived-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-block: 4px; }
.account-row { touch-action: pan-y; -webkit-touch-callout: none; user-select: none; }
@media (max-width: 600px) {
  #status-filters [data-status] { font-size: 0; }
  #status-filters [data-status]::before { font-size: 14px; margin: 0; }
  #status-filters button { min-width: 32px; padding-inline: 6px; }
}

.balances summary { cursor: pointer; font-weight: 700; }
.transaction-scroll {
  max-height: min(62dvh, 44rem);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.transaction-interactive { cursor: pointer; touch-action: pan-y; -webkit-touch-callout: none; }
.transaction-interactive:hover { background: var(--base); }
#transaction-actions { width: min(360px, calc(100% - 32px)); border: 1px solid var(--line); border-radius: 14px; }
#transaction-action-list { display: grid; gap: 6px; }

#archived-dialog { width: min(620px, calc(100% - 24px)); }
.archive-tools { display: flex; gap: 8px; margin-block: 12px; }
.archive-tools input { flex: 1; min-width: 0; }
#archived-list h3 { margin-block: 14px 5px; color: var(--muted); }
.archive-section { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.archived-row { padding: 0 8px 0 0; }
.archived-row + .archived-row { border-top: 1px solid var(--line); }
.archived-row .account-row { border: 0; min-width: 0; }
.account-group summary { -webkit-touch-callout: none; user-select: none; }

#edit-group-dialog { width: min(420px, calc(100% - 24px)); border: 1px solid var(--line); border-radius: 14px; }
#edit-group-form label { margin-block: 12px; }

.group-balances { display: grid; font-variant-numeric: tabular-nums; }

#sharing-dialog { width: min(520px, calc(100% - 24px)); max-height: 85vh; }
#sharing-request, #sharing-list { margin-block: 12px; }
#sharing-choices label { display: flex; gap: 8px; align-items: center; }
#sharing-choices input { width: auto; min-height: 0; }

.sharing-group { margin-block: 8px; }
.sharing-group summary, #sharing-new summary { cursor: pointer; }
.sharing-account { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 8px; }
.sharing-account small { display: block; color: var(--muted); }
.sharing-switch { appearance: none; position: relative; flex: none; width: 42px; min-height: 24px; height: 24px; padding: 0; border-radius: 20px; background: #848b87; cursor: pointer; }
.sharing-switch::before { content: ''; position: absolute; inset: 3px auto auto 3px; width: 16px; height: 16px; border-radius: 50%; background: white; }
.sharing-switch:checked { background: #16803c; }
.sharing-switch:checked::before { transform: translateX(18px); }

.sharing-switch:indeterminate { background: #a86412; }
.sharing-switch:indeterminate::before { transform: translateX(9px); }

#account-dialog { width: min(560px, calc(100% - 24px)); max-height: 90dvh; padding: 16px; }
.account-editor-row, .account-logo-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#account-form-title { font-size: clamp(1.4rem, 5vw, 2rem); }
.account-editor-tabs { display: flex; padding: 3px; gap: 3px; background: var(--base); border-radius: 24px; margin-bottom: 16px; }
.account-editor-tabs button { flex: 1; border-radius: 24px; background: transparent; color: var(--ink); }
.account-editor-tabs button[aria-pressed="true"] { background: var(--green); color: white; }
.account-editor-fields { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.account-editor-fields > * { margin: 0; padding: 10px 12px; }
.account-editor-fields > * + * { border-top: 1px solid var(--line); }
.account-editor-fields input { min-width: 0; }
.account-logo-row label { min-width: 0; }
.account-editor-row output { font-weight: 700; text-align: right; }

.account-icon-menu summary { cursor: pointer; }
#logo-preview { display: inline-flex; vertical-align: middle; margin-inline-start: 8px; }
#account-actions-list hr { width: 100%; border: 0; border-top: 1px solid var(--line); }

#account-view-menu { position: relative; min-width: 0; }
#account-view-menu summary { cursor: pointer; }
#account-view-picker {
  position: absolute;
  z-index: 10;
  inset-block-start: calc(100% + 4px);
  inset-inline-end: 0;
  width: max-content;
  max-width: min(300px, calc(100vw - 32px));
  padding: 4px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 6px 18px rgb(0 0 0 / 16%);
}
#account-view-picker button { display: block; width: 100%; text-align: left; overflow-wrap: anywhere; }

#statement-report details { margin-block: 10px; }
#statement-report summary { cursor: pointer; font-weight: 700; }
.statement-list { margin: 6px 0; padding-inline-start: 18px; overflow-wrap: anywhere; }
.proposal { display: grid; grid-template-columns: auto 1fr; gap: 6px 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.proposal input[type="text"], .proposal input:not([type]) { grid-column: 2; min-width: 0; }
.balance-check { margin-block: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.balance-check p { margin: 2px 0; }
.rule-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto; gap: 6px; margin-block: 6px; }
#confirm-statement { width: 100%; margin-block: 12px 4px; }
@media (max-width: 520px) { .rule-row { grid-template-columns: 1fr; } }

#delete-account-dialog { width: min(420px, calc(100% - 32px)); border: 1px solid var(--line); border-radius: 14px; }
#delete-account-dialog h2 { margin-top: 0; }
#delete-account-text { color: var(--muted); line-height: 1.45; }
.delete-account-actions { display: grid; gap: 8px; margin-top: 16px; }
.delete-account-actions button { width: 100%; padding-block: 11px; border-radius: 10px; }
button.danger { color: #b3261e; border-color: #e3a9a4; }
.archived-row button.danger { padding-inline: 10px; }

/* Release 48: font size, dark theme, privacy, Settings, Export and print. */
html[data-font="s"] { font-size: 14px; }
html[data-font="l"] { font-size: 18px; }
html[data-font="xl"] { font-size: 20px; }
:root { font-size: 1rem; }
body { font-size: 1rem; }
html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e6efe9; --green: #2f7a5f; --muted: #a9bcb1; --line: #34443c; --base: #101714; --white: #18221d;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]):not([data-theme="dark"]) {
    color-scheme: dark;
    --ink: #e6efe9; --green: #2f7a5f; --muted: #a9bcb1; --line: #34443c; --base: #101714; --white: #18221d;
  }
}
html[data-dark="true"] .top, html[data-dark="true"] .balances { background: #143d31; }
html[data-dark="true"] input, html[data-dark="true"] select, html[data-dark="true"] textarea { background: #0f1713; color: var(--ink); border-color: #4b5f55; }
html[data-dark="true"] button.secondary, html[data-dark="true"] button.quiet { color: #9fd8bd; border-color: #4b5f55; }
html[data-dark="true"] #status, html[data-dark="true"] .notice { background: #1f2c25; }
html[data-dark="true"] #status.error { background: #3a1f1b; color: #ffb4a8; }
html[data-dark="true"] .badge, html[data-dark="true"] .account-logo,
html[data-dark="true"] .account-row[aria-pressed="true"], html[data-dark="true"] #all-accounts[aria-pressed="true"] { background: #23362d; color: #cfe8db; }
html[data-dark="true"] .positive { color: #7fd6a4; }
html[data-dark="true"] .negative { color: #ff9b91; }
html[data-dark="true"] .eyebrow { color: #9fd8bd; }
html[data-dark="true"] dialog { background: var(--white); color: var(--ink); }

#privacy-toggle { margin-left: auto; width: 44px; height: 44px; padding: 0; display: grid; place-items: center; border: 1px solid #93b397; border-radius: 10px; background: transparent; color: #fff; }
#privacy-toggle[hidden] { display: none; }
#privacy-toggle svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#privacy-toggle + #app-menu { margin-left: 8px; }
.total-local { grid-column: 1 / -1; }

#settings-dialog, #export-dialog { width: min(640px, calc(100% - 16px)); height: min(860px, 92dvh); max-height: 92dvh; padding: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--base); color: var(--ink); }
#export-dialog { height: auto; }
.settings-page { display: flex; flex-direction: column; height: 100%; }
.settings-bar { display: flex; align-items: center; gap: 8px; padding: 12px 14px; position: sticky; top: 0; background: var(--base); z-index: 1; }
.settings-bar .grow { flex: 1; }
.settings-bar button.round { width: 40px; height: 40px; padding: 0; border-radius: 50%; font-size: 1.1rem; }
.settings-body { padding: 0 14px 20px; overflow: auto; flex: 1; }
.settings-body h2 { margin: 2px 0 2px; font-size: clamp(1.6rem, 6vw, 2.1rem); }
.settings-sub { margin: 0 0 12px; color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.settings-section { margin: 18px 4px 6px; color: var(--muted); font-weight: 700; font-size: .95rem; }
.settings-card { background: var(--white); border-radius: 14px; overflow: hidden; }
.settings-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 10px 14px; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; font-weight: 400; border-radius: 0; }
.settings-card > .settings-row:first-child, .settings-card > :first-child .settings-row { border-top: 0; }
button.settings-row:hover { background: color-mix(in srgb, var(--line) 45%, transparent); }
.settings-icon { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: #fff; font-size: 1rem; background: var(--icon, #4b7bec); }
.settings-text { flex: 1; min-width: 0; }
.settings-text strong { display: block; font-weight: 550; }
.settings-text small { display: block; color: var(--muted); font-size: .82rem; overflow-wrap: anywhere; }
.settings-value { color: var(--muted); font-size: .92rem; white-space: nowrap; }
.settings-chevron::after { content: '›'; color: var(--muted); font-size: 1.4rem; line-height: 1; }
.segmented { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 10px; background: color-mix(in srgb, var(--line) 70%, transparent); }
.segmented button { padding: 5px 10px; border-radius: 8px; background: transparent; color: var(--ink); font-weight: 550; }
.segmented button[aria-pressed="true"] { background: var(--white); box-shadow: 0 1px 3px rgb(0 0 0 / 15%); }
/* A row with choices keeps its title on one line; when both do not fit, the choices move under it. */
.settings-row.has-choice { flex-wrap: wrap; row-gap: 8px; }
.settings-row.has-choice .settings-text { flex: 1 0 auto; max-width: 100%; }
.settings-row.has-choice .settings-text strong { white-space: nowrap; }
.settings-row.has-choice > .segmented { flex: 0 1 auto; margin-left: auto; }
.settings-tabs { display: grid; grid-template-columns: 1fr 1fr; width: 100%; margin-bottom: 12px; }
.settings-search { margin-bottom: 12px; border-radius: 10px; }
.currency-sign { display: block; font-size: 1.05rem; font-weight: 600; }
.rate-button { padding: 2px 6px; background: transparent; color: #2d6cdf; font-weight: 500; text-align: right; font-size: .85rem; }
html[data-dark="true"] .rate-button { color: #7fb0ff; }
.rate-button small { display: block; color: var(--muted); }
.count-pill { min-width: 54px; padding: 2px 10px; border-radius: 999px; background: #3b82f6; color: #fff; text-align: center; font-size: .85rem; font-weight: 600; }
.count-pill.zero { background: #e5484d; }
.category-child { padding-left: 34px; }
.category-toggle { width: 32px; height: 32px; padding: 0; background: transparent; color: var(--muted); font-size: 1rem; }
.category-editor { display: grid; gap: 10px; padding: 14px; }
.category-editor label { display: grid; gap: 4px; }
.category-editor .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.color-choices { display: flex; flex-wrap: wrap; gap: 6px; }
.color-choices button { width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 2px solid transparent; }
.color-choices button[aria-pressed="true"] { border-color: var(--ink); }
.export-fields { display: grid; gap: 0; }
.export-fields select, .export-fields input { width: auto; max-width: 60%; border: 0; background: transparent; text-align: right; color: var(--muted); }
html[data-dark="true"] .export-fields select, html[data-dark="true"] .export-fields input { background: transparent; }
.export-custom { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }

#print-area { display: none; }
@media print {
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block; color: #000; font-size: 11px; }
  #print-area table { width: 100%; border-collapse: collapse; }
  #print-area th, #print-area td { padding: 3px 4px; border-bottom: 1px solid #ccc; text-align: left; vertical-align: top; }
  #print-area td.num, #print-area th.num { text-align: right; white-space: nowrap; }
  #print-area h1 { font-size: 18px; margin: 0 0 4px; }
  #print-area .print-summary { display: flex; gap: 24px; margin: 8px 0 12px; }
}
.category-open { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; padding: 0; border: 0; background: transparent; color: inherit; font-weight: 400; text-align: left; overflow-wrap: anywhere; }
.category-colour { display: grid; gap: 4px; }
.settings-row > select { width: auto; max-width: 55%; }
.segmented[aria-label="Font size"] button:nth-child(1) { font-size: .78rem; }
.segmented[aria-label="Font size"] button:nth-child(3) { font-size: 1.08rem; }
.segmented[aria-label="Font size"] button:nth-child(4) { font-size: 1.22rem; }
/* Account groups: balances while collapsed, only the accounts when expanded. */
.account-group[open] > summary .group-balances { display: none; }
.import-accounts { margin-block: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; }
.import-account-choice { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.import-account-choice select, .import-account-choice input { grid-column: 1 / -1; }
.import-edit { display: grid; gap: 6px; width: 100%; padding: 6px 0; }
.import-edit label { display: grid; gap: 2px; }
.field-hint { margin: -4px 0 8px; color: var(--muted); font-size: .85rem; }
.rate-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.rate-field button { height: 40px; min-width: 44px; padding: 0 10px; font-size: 1.1rem; }
#rate-unit { color: var(--muted); font-weight: 400; font-size: .85rem; }
.receipt-field { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-block: 8px; }
.receipt-field small { flex-basis: 100%; color: var(--muted); overflow-wrap: anywhere; }

/* Reorder mode (release 59) */
#accounts.reordering li[data-id] { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; }
#accounts.reordering .account-row { cursor: default; }
#accounts.reordering summary { display: flex; align-items: center; gap: 4px; list-style: none; cursor: default; }
#accounts.reordering summary::-webkit-details-marker { display: none; }
#accounts.reordering .group-balances { display: none; }
.drag-handle { display: grid; place-items: center; width: 44px; min-height: 44px; font-size: 22px; color: var(--muted); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.drag-handle:focus-visible { outline: 2px solid var(--green); outline-offset: -4px; border-radius: 8px; }
.drop-hint { padding: 8px 12px; color: var(--muted); font-size: 0.85em; border-top: 1px dashed var(--line); }
.drag-ghost { position: fixed; z-index: 1000; pointer-events: none; margin: 0; list-style: none; background: var(--white); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35); opacity: 0.96; }
.drag-gap { list-style: none; border: 2px dashed var(--line); border-radius: 10px; margin: 2px 6px; }
li.drag-ghost { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; }
summary.drag-ghost { display: flex; align-items: center; gap: 4px; padding: 10px 12px; }
summary.drag-ghost .group-balances { display: none; }
body.dragging, body.dragging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
#open-order[aria-pressed="true"] { width: auto; padding-inline: 14px; background: var(--green); color: #fff; }
#accounts [hidden] { display: none !important; }
.reorder-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; padding: 8px 8px 8px 12px; border-radius: 12px; background: var(--green); color: #fff; font-size: 0.9em; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); }
.reorder-bar button { background: #fff; color: var(--green); padding: 6px 16px; }

/* Release 64: every dialog has its title and a round close button (✕) on one row, close on the far right. */
.dialog-head { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.dialog-head > h2, .dialog-head > h3 { flex: 1; min-width: 0; margin: 0; overflow-wrap: anywhere; }
.dialog-head > form { margin: 0; }
button.close-x { flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border-radius: 50%; border: 1.5px solid #8fa597; background: transparent; color: var(--ink); }
button.close-x svg { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
button.close-x:hover { background: color-mix(in srgb, var(--line) 45%, transparent); }
.settings-bar .settings-title { flex: 1; min-width: 0; margin: 0; font-size: clamp(1.25rem, 5vw, 1.6rem); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-body > .settings-search { width: 100%; margin: 0 0 12px; }

/* Release 65: bottom tabs (Accounts, Budgets, Scheduled, Reports) and their pages. */
body.with-tabs main { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
#tabbar { position: fixed; left: 50%; bottom: calc(10px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20; display: flex; gap: 2px; width: min(520px, calc(100% - 20px)); padding: 6px; border: 1px solid var(--line); border-radius: 30px; background: color-mix(in srgb, var(--white) 92%, transparent); backdrop-filter: blur(12px); box-shadow: 0 8px 28px rgb(0 0 0 / 22%); }
#tabbar button { position: relative; flex: 1; display: grid; justify-items: center; gap: 2px; padding: 6px 2px; border: 0; border-radius: 24px; background: transparent; color: var(--ink); font-size: .74rem; font-weight: 600; }
#tabbar button[aria-pressed="true"] { background: color-mix(in srgb, var(--line) 75%, transparent); color: #2d6cdf; }
#tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab-badge { position: absolute; top: 0; left: calc(50% + 6px); min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: #e5484d; color: #fff; font-size: .7rem; line-height: 19px; }
html[data-dark="true"] #tabbar button[aria-pressed="true"] { color: #6ea8ff; }
.tab-view { padding-top: 4px; }
.tab-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.tab-head h2 { flex: 1; min-width: 0; margin: 0; font-size: clamp(1.6rem, 6vw, 2.1rem); }
.tab-head button.round, .calendar-bar button.round { width: 40px; height: 40px; padding: 0; border-radius: 50%; font-size: 1.15rem; flex: none; }
.report-note { margin-top: 14px; }
.report-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.report-controls select { width: auto; flex: 1 1 140px; border-radius: 10px; }
.report-controls button { flex: none; }
.report-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 0 0 12px; }
.report-summary div { padding: 10px 12px; border-radius: 12px; background: var(--white); border: 1px solid var(--line); min-width: 0; }
.report-summary span { display: block; color: var(--muted); font-size: .82rem; }
.report-summary strong { display: block; overflow-wrap: anywhere; }
.chart-box { margin: 0 0 12px; padding: 8px; border-radius: 14px; background: var(--white); border: 1px solid var(--line); }
.chart { display: block; width: 100%; height: auto; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-label { fill: var(--muted); font-size: 11px; }
.chart-legend { display: flex; gap: 14px; padding: 4px 8px 0; font-size: .82rem; color: var(--muted); }
.chart-legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; background: var(--key); }
.bar-list { display: grid; gap: 2px; margin-bottom: 12px; padding: 6px; border-radius: 14px; background: var(--white); border: 1px solid var(--line); }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font-weight: 500; text-align: left; }
button.bar-row:hover { background: color-mix(in srgb, var(--line) 45%, transparent); }
.bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-amount { color: var(--muted); font-size: .88rem; white-space: nowrap; }
.bar-track { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--line) 60%, transparent); overflow: hidden; }
.bar-track span { display: block; height: 100%; border-radius: 3px; }
.report-table { overflow-x: auto; margin-bottom: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--white); }
.report-table table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.report-table th, .report-table td { padding: 8px 12px; text-align: left; border-top: 1px solid var(--line); white-space: nowrap; }
@media (max-width: 600px) { .report-table table { font-size: .82rem; } .report-table th, .report-table td { padding: 7px 8px; } }
.report-table th { border-top: 0; color: var(--muted); font-weight: 600; }
.report-table td:not(:first-child), .report-table th:not(:first-child) { text-align: right; white-space: nowrap; }
.report-table .total-row td { font-weight: 700; }
.report-choice { display: grid; gap: 4px; margin-bottom: 12px; }
.report-up { margin-bottom: 10px; }
.budget-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.budget-top > div { flex: 1; min-width: 0; }
.budget-remaining { display: block; font-size: clamp(1.6rem, 7vw, 2.4rem); overflow-wrap: anywhere; }
.budget-remaining.negative, .negative { color: #e5484d; }
.budget-sub { color: var(--muted); }
.ring { width: 64px; height: 64px; flex: none; }
.ring-track { fill: none; stroke: var(--line); stroke-width: 5; }
.ring-fill { fill: none; stroke-width: 5; stroke-linecap: round; }
.ring-text { fill: var(--ink); font-size: 9px; font-weight: 700; }
.budget-group { margin-bottom: 12px; }
.budget-group > summary { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px; padding: 8px 4px; cursor: pointer; }
.budget-group > summary small { color: var(--muted); }
.budget-card { display: flex; gap: 12px; align-items: center; width: 100%; margin-bottom: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); color: var(--ink); font-weight: 400; text-align: left; }
.budget-icon { position: relative; flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: color-mix(in srgb, var(--line) 70%, transparent); font-weight: 700; }
.budget-alert { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; background: #e5484d; color: #fff; font-size: .75rem; line-height: 20px; text-align: center; }
.budget-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.budget-line { overflow-wrap: anywhere; }
.budget-text small { color: var(--muted); }
.budget-bar { height: 7px; margin-top: 4px; border-radius: 4px; background: color-mix(in srgb, var(--line) 60%, transparent); overflow: hidden; }
.budget-bar span { display: block; height: 100%; border-radius: 4px; }
#budget-dialog, #schedule-dialog { width: min(560px, calc(100% - 24px)); max-height: 90dvh; }
.budget-form { display: grid; gap: 10px; }
.budget-form label { display: grid; gap: 4px; }
.budget-choices { display: grid; gap: 2px; max-height: 240px; overflow: auto; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; }
.budget-choices .check { display: flex; align-items: center; gap: 8px; }
.budget-choices .check input { width: auto; }
.budget-choices .child { padding-left: 22px; }
.schedule-kinds button[aria-pressed="true"], .schedule-kinds button:focus-visible { background: var(--white); box-shadow: 0 1px 3px rgb(0 0 0 / 15%); }
.schedule-actions { display: grid; gap: 8px; }
.scheduled-layout { display: grid; gap: 14px; }
@media (min-width: 820px) { .scheduled-layout { grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); align-items: start; } }
.calendar { padding: 12px; border-radius: 16px; background: var(--white); border: 1px solid var(--line); }
.calendar-bar { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.calendar-bar strong { font-size: 1.3rem; }
.calendar-bar strong span { color: var(--muted); font-weight: 500; }
.calendar-bar .grow { flex: 1; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.calendar-weekday { text-align: center; color: var(--muted); font-size: .78rem; padding-bottom: 2px; }
.calendar-day { display: grid; align-content: start; gap: 2px; min-height: 52px; padding: 4px; border: 0; border-radius: 10px; background: color-mix(in srgb, var(--line) 35%, transparent); color: var(--ink); font-weight: 600; text-align: left; overflow: hidden; }
.calendar-day small { font-size: .62rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.calendar-day.due { background: color-mix(in srgb, #3e63dd 25%, transparent); }
.calendar-day.due-overdue { background: #b3263a; color: #fff; }
.calendar-day[aria-pressed="true"] { outline: 2px solid #2d6cdf; }
.calendar-today { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #2d6cdf; color: #fff; }
.scheduled-card { margin-top: 12px; padding: 12px; border-radius: 16px; background: var(--white); border: 1px solid var(--line); }
.scheduled-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.scheduled-card.expense .scheduled-card-head strong { color: #e5484d; }
.scheduled-card.income .scheduled-card-head strong { color: #30a46c; }
.scheduled-card-head select { width: auto; border: 0; background: transparent; color: var(--muted); }
.scheduled-total { display: block; margin: 6px 0 10px; font-size: 1.6rem; overflow-wrap: anywhere; }
.scheduled-total.muted { color: var(--muted); }
.scheduled-card .report-summary { margin: 0; }
.scheduled-card .report-summary div { border: 0; padding: 4px 0; background: transparent; }
.scheduled-heading { margin: 4px 2px 8px; font-weight: 700; font-size: 1.1rem; }
.scheduled-heading.overdue { color: #e5484d; }
.scheduled-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-bottom: 14px; }
.scheduled-item { display: grid; gap: 3px; padding: 12px; border: 1px solid var(--line); border-radius: 18px; background: var(--white); color: var(--ink); font-weight: 400; text-align: left; }
.scheduled-item-top { display: flex; align-items: center; gap: 8px; }
.scheduled-day { font-size: 2.2rem; font-weight: 700; line-height: 1; }
.scheduled-item.overdue .scheduled-day, .scheduled-item.overdue .scheduled-when { color: #e5484d; }
.scheduled-when { flex: 1; display: grid; font-size: .8rem; }
.scheduled-item-top .account-logo { width: 36px; height: 36px; }
.scheduled-name { margin-top: 4px; overflow-wrap: anywhere; }
.scheduled-amount { font-size: 1.25rem; }
.scheduled-amount.expense { color: #e5484d; }
.scheduled-amount.income { color: #30a46c; }
.scheduled-meta { color: var(--muted); overflow-wrap: anywhere; }

/* Release 66: Ask AI tab. */
#tabbar button { min-width: 0; }
#tabbar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.ai-picker { flex: 0 1 220px; width: auto; min-width: 0; border-radius: 10px; }
.ai-messages { display: grid; gap: 10px; margin-bottom: 12px; }
.ai-bubble { max-width: min(680px, 92%); padding: 10px 14px; border-radius: 18px; background: var(--white); border: 1px solid var(--line); overflow-wrap: anywhere; }
.ai-bubble.user { justify-self: end; background: #2d6cdf; border-color: #2d6cdf; color: #fff; }
.ai-bubble.waiting { color: var(--muted); }
.ai-bubble p { margin: 0 0 6px; }
.ai-bubble p:last-child { margin-bottom: 0; }
.ai-bubble ul { margin: 4px 0 6px; padding-left: 20px; }
.ai-gap { height: 4px; }
.ai-provider { display: block; margin-top: 6px; color: var(--muted); font-size: .75rem; }
.ai-composer { position: sticky; bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 5; display: flex; align-items: flex-end; gap: 8px; padding: 6px; border: 1px solid var(--line); border-radius: 24px; background: var(--white); box-shadow: 0 4px 16px rgb(0 0 0 / 15%); }
.ai-composer textarea { flex: 1; min-height: 40px; max-height: 160px; padding: 9px 12px; border: 0; background: transparent; color: var(--ink); font: inherit; resize: none; }
.ai-composer textarea:focus { outline: none; }
.ai-send { width: 40px; height: 40px; padding: 0; border-radius: 50%; background: #2d6cdf; font-size: 1.2rem; flex: none; }
.ai-footer { margin-top: 10px; }
.ai-delete { padding: 2px 4px; color: #e5484d; font-weight: 500; }
.ai-consent { display: grid; gap: 12px; max-width: 620px; margin: 0 auto; padding: 18px; border-radius: 20px; background: var(--white); border: 1px solid var(--line); }
.ai-consent h2 { margin: 4px 0; text-align: center; }
.ai-flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 12px; border-radius: 14px; background: color-mix(in srgb, var(--line) 40%, transparent); text-align: center; }
.ai-flow div { display: grid; justify-items: center; gap: 2px; }
.ai-flow small { color: var(--muted); font-size: .72rem; }
.ai-flow-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--white); font-size: 1.2rem; }
.ai-promise { display: flex; gap: 12px; align-items: flex-start; }
.ai-promise p { margin: 2px 0 0; color: var(--muted); }
.ai-promise-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: color-mix(in srgb, var(--line) 60%, transparent); font-size: 1.1rem; }
.ai-allow { width: 100%; padding: 12px; border-radius: 24px; background: #2d6cdf; }
#ai-view .tab-head h2 { flex: none; white-space: nowrap; }
#ai-view .tab-head .ai-picker { flex: 1 1 auto; margin-left: auto; max-width: 260px; }
.ai-composer textarea, html[data-dark="true"] .ai-composer textarea { border: 0; background: transparent; }
.ai-bubble ul { list-style: disc; }

/* Release 67: compact tab bar; on wide screens it sits at the bottom of the account column, and the
   account list can be hidden with the sidebar button. */
#tabbar { width: min(420px, calc(100% - 20px)); padding: 4px; border-radius: 22px; gap: 0; }
#tabbar button { padding: 4px 2px; border-radius: 18px; font-size: .66rem; gap: 1px; }
#tabbar svg { width: 21px; height: 21px; }
.tab-badge { top: -2px; min-width: 17px; height: 17px; line-height: 17px; font-size: .64rem; }
body.with-tabs main { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
.ai-composer { bottom: calc(70px + env(safe-area-inset-bottom)); }
#toggle-sidebar { display: none; }
#toggle-sidebar svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
@media (min-width: 700px) {
  :root { --wrap-width: min(100vw - 56px, 1220px); }
  #tabbar { left: calc((100vw - var(--wrap-width)) / 2); transform: none; width: max(240px, calc((var(--wrap-width) - 18px) / 3.2)); bottom: 12px; }
  body.sidebar-hidden #tabbar, body.with-tabs:not([data-tab="accounts"]) #tabbar { left: 50%; transform: translateX(-50%); width: 400px; }
  #toggle-sidebar { display: inline-block; background: var(--white); color: var(--ink); border: 1px solid var(--line); border-radius: 22px; }
  #toggle-sidebar[aria-pressed="true"] { background: var(--green); color: #fff; }
  #account-layout.sidebar-hidden { grid-template-columns: minmax(0, 1fr); }
  #account-layout.sidebar-hidden #account-sidebar { display: none; }
}

/* Release 68: Cleared / Pending / Forecast are dot-only "LED" buttons (names stay as label and tooltip). */
#status-filters [data-status] { position: relative; width: 44px; height: 44px; min-height: 44px; padding: 0; font-size: 0; line-height: 0; color: transparent; border-radius: 50%; background: var(--white); overflow: hidden; }
/* The dot is pinned to the exact centre of the round button. */
#status-filters [data-status]::before { position: absolute; top: 50%; left: 50%; width: 14px; height: 14px; margin: 0; transform: translate(-50%, -50%); opacity: .3; }
#status-filters [data-status][aria-pressed="true"] { background: var(--white); border-color: var(--dot); }
#status-filters [data-status][aria-pressed="true"]::before { opacity: 1; box-shadow: 0 0 0 3px color-mix(in srgb, var(--dot) 30%, transparent), 0 0 10px var(--dot); }

/* Release 70: transaction type buttons fit narrow phones; Safari's date box keeps to the form width. */
.transaction-types span { font-size: clamp(.64rem, 3vw, 1rem); line-height: 1.15; overflow-wrap: normal; word-break: keep-all; padding-inline: 1px; }
@media (max-width: 400px) { .transaction-types { gap: 2px; padding: 3px; } .transaction-types span { min-height: 40px; letter-spacing: -0.01em; } }
input[type="date"] { display: block; width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; -webkit-appearance: none; appearance: none; text-align: left; }
input[type="date"]::-webkit-date-and-time-value { text-align: left; margin: 0; }
/* Phones: the whole toolbar (status dots, view buttons, +) fits on one line, even at 320 px. */
@media (max-width: 600px) {
  #status-filters { gap: 3px; }
  #status-filters button { width: 32px; min-width: 0; height: 34px; min-height: 34px; padding: 0; font-size: .85rem; border-radius: 10px; }
  #status-filters [data-status] { width: 32px; height: 32px; min-height: 32px; border-radius: 50%; }
  #status-filters [data-status]::before { width: 10px; height: 10px; }
}

/* Release 72: category icons (line drawings on a coloured tile) and the icon chooser. */
.category-tile svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; max-height: 220px; overflow: auto; padding: 2px; }
.icon-choices button { display: grid; place-items: center; height: 40px; padding: 0; border-radius: 10px; border: 2px solid transparent; background: color-mix(in srgb, var(--line) 55%, transparent); color: var(--ink); }
.icon-choices button[aria-pressed="true"] { border-color: var(--ink); background: var(--white); }
.icon-choices svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon-choices span { font-size: .7rem; font-weight: 600; }

/* Release 74: Scan receipt button in the transaction form. */
.scan-receipt { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin: 0 0 10px; }
.scan-receipt svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linejoin: round; }
#scan-note { margin: -4px 0 10px; }

/* Release 75: on phones the account's title row has a round ✕ (back to the account list) instead of a
   "Back to accounts" button: name and ✕ on the first line, balance under the name. */
@media (max-width: 699px) {
  #account-detail .detail-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "title close" "balance balance"; align-items: center; gap: 2px 10px; }
  #account-detail .detail-head h2 { grid-area: title; min-width: 0; overflow-wrap: anywhere; }
  #account-detail .detail-head #selected-balance { grid-area: balance; }
  #account-detail .detail-head #accounts-back { grid-area: close; }
}

/* Settings → Import from clipboard */
.clipboard-text { width: 100%; min-height: 220px; font: .85rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 10px 12px; border-radius: 12px; resize: vertical; white-space: pre; overflow: auto; }
.settings-actions { display: flex; gap: 10px; justify-content: flex-end; margin: 12px 0 0; }

/* Sign-in choice and the Face ID / Touch ID lock (Settings → Security) */
.login-choices { display: flex; flex-wrap: wrap; gap: 10px; }
.login-hint { color: var(--muted); font-size: .85rem; margin: 10px 0 0; }
.app-lock { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: var(--base); color: var(--ink); }
.app-lock[hidden] { display: none; }
.app-lock-card { width: min(360px, 100%); text-align: center; display: grid; gap: 10px; justify-items: center; }
.app-lock-card h2 { margin: 6px 0 0; }
.app-lock-card p { margin: 0; color: var(--muted); }
.app-lock-icon { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.app-lock-card #unlock { min-width: 180px; margin-top: 8px; }
.unlock-error { color: #e5484d !important; font-size: .9rem; }
body.locked { overflow: hidden; }
body.locked main > :not(#app-lock), body.locked header, body.locked #tabbar { visibility: hidden; }
