/* Self-hosted fonts (audit Oct 14, 2026): no more Google Fonts CDN. */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/DMSans-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/DMSans-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/DMSans-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/DMSans-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/DMSans-600-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/DMSans-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/DMSans-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/DMSans-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/Newsreader-500-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/Newsreader-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/Newsreader-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/Newsreader-600-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/Newsreader-600-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/Newsreader-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Talents, mobile-first, no frameworks */
:root {
  --evergreen: #163f39;
  --evergreen-2: #0f332f;
  --paper: #f7f6f1;
  --ink: #152d2b;
  --gold: #d1ae55;
  --mint: #b9d7c8;
  --line: #c9d1cb;
  --border: #c9d1cb;
  --text: #152d2b;
  --muted: #526663;
  --card: #ffffff;
  --red: #b3402e;
  --green: #2e7d4f;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: -webkit-fill-available; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.45;
}
h1, h2, h3 { font-family: "Newsreader", Georgia, serif; font-weight: 600; letter-spacing: -0.01em; }
h1, h2 { margin: 0 0 8px; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--red); font-size: 14px; }
.pos { color: var(--green); }
.neg { color: var(--red); }

/* Buttons and inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 18px;
  border-radius: 10px; border: 1px solid transparent;
  font-size: 16px; font-weight: 600; cursor: pointer;
  text-decoration: none;
}
.btn.primary { background: var(--evergreen); color: #fff; }
.btn.primary:active { background: var(--evergreen-2); }
.btn.ghost { background: transparent; color: var(--evergreen); border-color: var(--line); }
.btn.gold { background: var(--gold); color: var(--ink); }
.btn.danger { background: transparent; color: var(--red); border-color: var(--line); }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 14px; }
.btn.block { width: 100%; }
.link-btn {
  background: none; border: none; padding: 8px;
  color: var(--mint); font-size: 14px; cursor: pointer;
  text-decoration: underline;
}
label { display: block; font-size: 14px; font-weight: 600; margin: 12px 0 4px; }
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], input[type="month"],
input[type="search"], select {
  width: 100%; min-height: 44px;
  padding: 8px 12px; font-size: 16px; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
}
input:focus, select:focus, button:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
select.suggested { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.35); transition: box-shadow 0.6s ease; }

/* Login */
#login-view {
  min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
  background: linear-gradient(180deg, var(--evergreen) 0%, var(--evergreen-2) 100%);
}
#login-view[hidden] { display: none; }
.login-card {
  width: 100%; max-width: 400px;
  background: var(--paper); border-radius: 16px;
  padding: 32px 24px; text-align: center;
  box-shadow: 0 18px 54px rgba(0,0,0,.25);
  border-top: 4px solid var(--gold);
}
.login-brand { position: relative; display: inline-block; margin-bottom: 10px; }
.login-brand::before {
  content: ""; position: absolute; inset: -22px;
  background: radial-gradient(circle, rgba(209,174,85,.4) 0%, rgba(209,174,85,0) 70%);
  pointer-events: none;
}
.login-logo {
  position: relative; display: block;
  width: 88px; height: 88px; border-radius: 22px;
  border: 2px solid var(--gold);
  box-shadow: 0 10px 26px rgba(22,63,57,.35);
}
.login-card h1 { position: relative; padding-bottom: 12px; }
.login-card h1::after {
  content: ""; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 48px; height: 3px; border-radius: 2px; background: var(--gold);
}
.login-mark { width: 120px; height: auto; margin-bottom: 8px; }
.auth-toggle { display: flex; gap: 8px; margin: 20px 0 8px; }
.auth-toggle button {
  flex: 1; min-height: 40px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff;
  font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer;
}
.auth-toggle button.active { background: var(--evergreen); color: #fff; border-color: var(--evergreen); }
#login-view form { text-align: left; }
#login-view form .btn { width: 100%; margin-top: 16px; }
#auth-error { margin-top: 12px; }

/* App shell */
/* The header and the offline banner share one sticky wrapper, so the banner
   sits directly below the Talents title bar (clear of the notch and status
   bar) and stays tied to the header when the page scrolls. */
.app-top { position: sticky; top: 0; z-index: 20; }
#offline-banner {
  background: #7a5b12; color: #fff;
  text-align: center; font-size: 13px; line-height: 1.35;
  padding: 7px 12px;
  box-shadow: 0 2px 8px rgba(15, 51, 47, 0.25);
}
#offline-banner[hidden] { display: none; }
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, #1a4a43 0%, var(--evergreen) 55%, #0f332f 100%);
  color: #fff;
  /* max() fallback: some webview wrappers report env(safe-area-inset-top) as 0,
     which let the status bar overlap the header. 44px keeps it clear there,
     and the real inset still wins in normal browsers. */
  padding: max(12px + env(safe-area-inset-top), 44px) 16px 12px;
  border-bottom: 3px solid var(--gold);
  box-shadow: 0 2px 12px rgba(15, 51, 47, 0.25);
}
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { border-radius: 8px; display: block; box-shadow: 0 1px 4px rgba(0,0,0,0.3); }
.app-title { font-family: "Newsreader", Georgia, serif; font-weight: 600; font-size: 21px; letter-spacing: 0.01em; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.icon-btn-light {
  background: none; border: none; color: #fff;
  font-size: 20px; line-height: 1; cursor: pointer; padding: 4px;
}
.wrap {
  max-width: 720px; margin: 0 auto;
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
  flex: 1 0 auto; width: 100%; box-sizing: border-box;
}
/* App frame: flex column keeps the tab bar in normal flow so iOS can never
   leave it floating above the screen bottom (the old position:fixed did).
   --app-h is set by JS from visualViewport.height, the most truthful measure
   in webview wrappers that misreport 100dvh/-webkit-fill-available short
   (seen Oct 12-13, 2026: dead space below the tab bar in a third-party
   wrapper). The CSS units remain as fallbacks when JS hasn't run. */
#app { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; min-height: -webkit-fill-available; min-height: var(--app-h, 100dvh); }
#app[hidden] { display: none; }
.tabbar {
  position: sticky; bottom: 0; z-index: 10;
  display: flex; gap: 2px;
  background: #fff; border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(21,45,43,.07);
  padding: 10px 12px max(env(safe-area-inset-bottom), 18px);
  /* max() fallback: when a wrapper reports env(safe-area-inset-bottom) as 0,
     18px still keeps the bar clear of the home indicator. */
}
.tabbar button {
  flex: 1; background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  min-height: 66px; padding: 10px 2px 9px; border-radius: 16px;
  font-size: 11px; font-weight: 600; letter-spacing: .01em;
  color: var(--muted);
  transition: background-color .15s ease, color .15s ease;
}
.tabbar button svg { width: 23px; height: 23px; flex: none; }
.tabbar button.active { color: var(--evergreen); background: rgba(22,63,57,.09); }
@media (hover: hover) {
  .tabbar button:not(.active):hover { background: rgba(21,45,43,.04); }
}
.tabbar, .tabbar button, .tabbar button * {
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}
.tabbar.tab-reordering { touch-action: none; }
/* Item 9: overspend badge, a quiet red dot on the Budget tab. */
.tabbar button.has-alert { position: relative; }
.tabbar button.has-alert::after {
  content: ''; position: absolute; top: 9px; right: calc(50% - 22px);
  width: 9px; height: 9px; border-radius: 50%; background: var(--red);
}

/* Item 9: logging nudge card on the Transactions tab. */
.nudge-card {
  position: relative; margin: 12px 12px 0; padding: 12px 44px 12px 14px;
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--gold);
  border-radius: 12px;
}
.nudge-card p { margin: 0 0 10px; }
.nudge-dismiss { position: absolute; top: 4px; right: 4px; }

.tabbar button.tab-dragging {
  position: fixed; z-index: 60; pointer-events: none; margin: 0;
  background: #fff; border-radius: 14px;
  box-shadow: 0 10px 28px rgba(0,0,0,.28);
  transform: scale(1.06); opacity: .96;
}
.tab-drop-placeholder { flex: none; border-radius: 14px; background: rgba(0,0,0,.06); }

/* Month switcher */
.monthbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.copy-row { text-align: center; margin: -4px 0 12px; }
.copy-row .link-btn { color: var(--evergreen); font-size: 14px; }
.copy-row .link-btn:disabled { opacity: .5; }
.monthbar .chev {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: #fff;
  font-size: 22px; color: var(--evergreen); cursor: pointer;
}
.month-mid { text-align: center; }
.month-label { font-size: 20px; font-weight: 700; }
.month-mid .link-btn { color: var(--evergreen); padding: 2px 8px; }

/* Summary card */
.summary-card {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px;
  background: var(--evergreen); color: #fff;
  border-radius: 14px; padding: 16px 12px; margin-bottom: 16px;
}
.stat { text-align: center; }
.stat-label { display: block; font-size: 12.5px; color: var(--mint); margin-bottom: 4px; }
.stat .num { font-size: 17px; font-weight: 700; }
.stat .num.pos { color: #9fe0b8; }
.stat .num.neg { color: #f2a49a; }

/* Sticky budget summary: totals stay visible while scrolling categories (tester request Oct 14, 2026) */
.summary-sticky {
  position: sticky;
  top: var(--sticky-top, 84px);
  z-index: 5;
  background: transparent;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  padding: 10px 0 0;
  margin-bottom: 12px;
  border-radius: 0 0 14px 14px;
  overflow: hidden;
}
.summary-sticky .summary-card,
.summary-sticky .summary-card:last-child {
  margin-bottom: 0;
  border: none;
  border-radius: 14px 14px 0 0;
}
/* Per-card pin toggle (Oct 14, 2026): unpinned cards scroll away normally. */
.summary-card { position: relative; }
.summary-card.pinnable { padding-top: 26px; }
/* Merged bubble: when both summaries are pinned they become one card. */
.summary-card.merged { display: block; padding-bottom: 24px; }
.merged-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.merged-divider { height: 1px; background: rgba(255,255,255,0.12); margin: 12px 4px; }
.pin-btn.pin-bottom { top: auto; bottom: 6px; }
.pin-btn {
  position: absolute; top: 6px; right: 10px;
  border: none; background: none; padding: 4px; cursor: pointer;
  color: #d1ae55;
  transition: opacity 0.15s ease;
}
.pin-btn:not(.pinned) { opacity: 0.5; color: #8aa5a0; }
.pin-btn svg { width: 16px; height: 16px; display: block; }
.pin-btn.popping svg { animation: pin-pop 0.23s ease; }
@keyframes pin-pop {
  0% { transform: scale(1) rotate(0deg); }
  40% { transform: scale(0.7) rotate(-14deg); }
  70% { transform: scale(1.3) rotate(8deg); }
  100% { transform: scale(1) rotate(0deg); }
}
.summary-flow .summary-card { margin-bottom: 10px; }

/* Household sharing: member list with spouse toggle. */
.share-members { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.share-member {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
}
.share-member-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spouse-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; white-space: nowrap; cursor: pointer; }
.spouse-toggle input { width: 18px; height: 18px; accent-color: var(--evergreen); cursor: pointer; }

/* Budget groups */
.group {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; margin-bottom: 12px; overflow: hidden;
}
.group-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; cursor: pointer; list-style: none;
  font-weight: 700; font-size: 16px;
}
.group-head::-webkit-details-marker { display: none; }
.group-head::after { content: "+"; color: var(--muted); font-size: 20px; }
.group[open] .group-head::after { content: "–"; }
.group-total { font-size: 13px; font-weight: 600; color: var(--muted); margin-right: 8px; }

.cat-row { border-top: 1px solid var(--line); padding: 12px 16px; }
.cat-name { font-weight: 600; margin-bottom: 6px; }
.cat-tap { cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
.cat-chev { color: var(--muted); font-size: 20px; line-height: 1; padding: 0 4px; }
.cat-nums { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.num-cell .num-label { display: block; font-size: 11px; color: var(--muted); }
.num-cell { font-size: 15px; font-weight: 600; }
.planned-val {
  display: inline-block; min-width: 64px;
  border-bottom: 1px dashed var(--muted); cursor: pointer;
  color: var(--evergreen);
}
.planned-input { min-height: 34px; font-size: 15px; padding: 4px 8px; }
.pace-note { display: block; font-size: 12px; margin-top: 6px; }
.pace-note.pace-warn { color: var(--red); font-weight: 600; }
.pace-note.pace-ok { color: var(--muted); }

/* Plain-language glossary inside the welcome modal. */
.glossary { margin: 12px 0; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }
.glossary summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.glossary .guide-steps { margin-top: 8px; }
.progress { height: 6px; background: var(--line); border-radius: 3px; margin-top: 8px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--evergreen); border-radius: 3px; }
.progress > i.over { background: var(--red); }

.inline-form {
  display: flex; gap: 8px; padding: 12px 16px;
  border-top: 1px solid var(--line); background: #fbfaf6;
}
.inline-form input { flex: 1; }
.inline-form select { flex: 0 0 120px; }
.add-group-wrap { margin-top: 4px; }

/* Transactions */
.filters { display: grid; gap: 8px; margin-bottom: 12px; }
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-actions .btn { flex: 1; }
/* Bare refresh icon: no button bubble, just the glyph. */
.refresh-icon {
  background: none; border: none; padding: 4px 2px; cursor: pointer;
  font-size: 20px; line-height: 1; color: var(--evergreen);
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
}
.refresh-icon.spinning { animation: spin-once 0.6s ease; }
@keyframes spin-once { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
/* Spacing utilities (replaced inline styles for CSP, audit Oct 14, 2026) */
.mt8 { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.mb16 { margin-bottom: 16px; }
.my12 { margin: 12px 0; }
.inline-form.plain { border: none; background: none; padding: 8px 0 0; }
.txn-row {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px;
  margin-bottom: 8px;
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px;
}
.txn-merchant { font-weight: 600; }
.txn-sub { font-size: 12px; color: var(--muted); }
.txn-amount { font-weight: 700; font-size: 16px; align-self: start; }
.txn-amount.expense { color: var(--red); }
.txn-amount.income { color: var(--green); }
.txn-row-foot { grid-column: 1 / -1; display: flex; gap: 8px; }
.txn-row-foot select { flex: 1; min-height: 38px; font-size: 14px; }
/* Bulk select mode: checkbox column, foot hidden, selected rows highlighted. */
.txn-row.selecting { grid-template-columns: auto 1fr auto; align-items: center; cursor: pointer; }
.txn-row.selecting .txn-row-foot { display: none; }
.txn-select-cb { width: 24px; height: 24px; accent-color: var(--evergreen); cursor: pointer; flex-shrink: 0; }
.txn-row.selected { border-color: var(--evergreen); background: rgba(22, 63, 57, 0.05); }
#txn-bulk-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; align-items: center; gap: 12px;
  background: var(--evergreen); color: #fff;
  padding: 12px 16px max(env(safe-area-inset-bottom), 20px);
  box-shadow: 0 -2px 12px rgba(15, 51, 47, 0.25);
}
#txn-bulk-bar[hidden] { display: none; }
#txn-bulk-count { flex: 1; font-weight: 600; }
#txn-bulk-bar .btn.ghost { color: #fff; border-color: rgba(255,255,255,0.4); }
#txn-bulk-bar .btn.danger { background: #c0392b; border-color: #c0392b; color: #fff; }
#txn-bulk-bar .btn.danger:disabled { opacity: 0.4; }
.icon-btn {
  min-width: 38px; min-height: 38px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff;
  color: var(--red); font-size: 22px; cursor: pointer;
}
/* Transaction edit (pencil) buttons: a clearly larger glyph than the
   delete ×, in ink instead of red so edit never reads as a second
   delete button. Touch target stays 38px. */
.txn-edit, .catdetail-txn-edit { font-size: 28px; color: var(--green); }
.pending-tag {
  display: inline-block; font-size: 11px; font-weight: 700;
  background: var(--mint); color: var(--evergreen);
  border-radius: 4px; padding: 1px 6px; margin-left: 6px;
  vertical-align: middle;
}
.empty { text-align: center; color: var(--muted); padding: 32px 16px; }

/* Accounts */
.section-title { font-size: 16px; margin: 20px 0 8px; color: var(--evergreen); }
.section-title:first-child { margin-top: 0; }
.bank-block {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 16px; margin-bottom: 12px;
}
.bank-head { font-weight: 700; margin-bottom: 8px; }
.bank-head .muted { font-weight: 400; font-size: 13px; }
.acct-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-top: 1px solid var(--line);
}
.acct-row .acct-meta { font-size: 13px; color: var(--muted); }
.notice {
  background: #fdf6e3; border: 1px solid var(--gold);
  border-radius: 10px; padding: 12px 14px; font-size: 14px;
  margin: 12px 0;
}

/* Recurring */
#recurring-section { margin-top: 20px; }
.rec-form {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px; margin-top: 12px;
  display: grid; gap: 4px;
}
.rec-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.rec-form .btn { margin-top: 8px; }

/* Debts */
.debt-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; margin-bottom: 8px; overflow: hidden;
}
.debt-head {
  display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 8px;
  background: none; border: none; padding: 12px 16px; cursor: pointer; text-align: left;
  font: inherit; color: inherit;
}
.debt-chev { color: var(--muted); font-size: 14px; transition: transform .15s ease; flex: 0 0 auto; }
.debt-chev.closed { transform: rotate(-90deg); }
.debt-body { padding: 0 16px 12px; }
.debt-rec-row { display: flex; gap: 8px; align-items: center; font-size: 14px; margin: 2px 0 10px; cursor: pointer; }
.debt-name { font-weight: 700; }
.debt-main { display: flex; flex-direction: column; }
#debt-collapse-all { color: var(--evergreen); }
.tiny-label { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.debt-sub { font-size: 13px; color: var(--muted); }
.debt-actions { flex: 0 0 auto; }
.debt-actions .btn { flex: 0 0 auto; }
.debt-edit-form, .debt-add-form {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px; margin-bottom: 12px;
  display: grid; gap: 4px;
}
.debt-edit-form { margin-top: 12px; }
.debt-add-form { margin-top: 16px; }
.debt-edit-form .row-actions, .debt-add-form .row-actions { margin-top: 8px; }
.debt-edit-form .btn, .debt-add-form .btn { flex: 1; }
#view-debts .kind-toggle { margin-bottom: 4px; }
#view-debts > label { max-width: 280px; }

/* Sharing */
.invite-code {
  font-size: 32px; font-weight: 800; letter-spacing: 4px;
  text-align: center; color: var(--evergreen);
  background: #fff; border: 2px dashed var(--gold);
  border-radius: 12px; padding: 16px; margin: 12px 0 4px;
}
.join-row { margin-top: 16px; }
#sharing-section, #rules-section { margin-top: 8px; }

/* Modal */
.modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(21, 45, 43, .55);
}
.modal[hidden] { display: none; }
/* The dialog is absolutely positioned, not a flex item: iOS Safari does
   not reliably turn a bottom-anchored flex item with max-height into a
   scroll container, so drags on a tall sheet scrolled the page behind it
   instead of the sheet. Absolute positioning plus a dvh cap fixes that,
   and overscroll-behavior keeps edge drags from chaining to the page. */
.dialog {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  background: var(--paper); border-radius: 16px 16px 0 0;
  width: 100%; max-width: 520px; max-height: 92vh; max-height: 92dvh;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain; touch-action: pan-y;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
}
/* While any modal is open, the page behind it must not scroll. */
html:has(.modal:not([hidden])) { overflow: hidden; }
body:has(.modal:not([hidden])) { overflow: hidden; }
.dialog-actions { display: flex; gap: 8px; margin-top: 16px; }
.dialog-actions .btn { flex: 1; }
/* Sticky close row at the top of a tall sheet, so closing never means
   scrolling to the bottom first. The row sticks to the top of the sheet
   while its content scrolls underneath. */
.dialog-x-row {
  position: sticky; top: 0; z-index: 2;
  display: flex; justify-content: flex-end;
  background: var(--paper); padding: 2px 0 8px; margin-bottom: 4px;
}
.dialog-x {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card);
  color: var(--ink); font-size: 22px; line-height: 1;
  display: grid; place-items: center; cursor: pointer; flex: 0 0 auto;
}
.dialog-x:active { background: var(--paper); }

/* Split transactions */
.split-row { display: flex; gap: 8px; margin-bottom: 8px; }
.split-row .split-cat { flex: 1; min-width: 0; }
.split-row .split-amt { flex: 0 0 110px; min-width: 0; }
.split-row .split-del { flex: 0 0 auto; }
.split-head { display: flex; align-items: center; justify-content: space-between; margin: 12px 0 4px; }
.split-title { font-size: 14px; font-weight: 700; }
.split-remaining { font-size: 14px; font-weight: 600; margin: 8px 0; color: var(--green); }
.split-remaining.over { color: var(--red); }
.split-editor { padding: 4px 0 8px; }
#txn-split-toggle-wrap { margin-top: 12px; }
.split-toggle { text-align: left; color: var(--evergreen); }
.guide-steps { display: grid; gap: 12px; margin-top: 12px; }
.guide-step { display: flex; gap: 12px; align-items: flex-start; }
.guide-num {
  flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--evergreen); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}
.kind-toggle { display: flex; gap: 8px; margin-bottom: 4px; }
.kind-toggle button {
  flex: 1; min-height: 44px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff;
  font-size: 15px; font-weight: 600; color: var(--muted); cursor: pointer;
}
.kind-toggle button.active { background: var(--evergreen); color: #fff; border-color: var(--evergreen); }

/* CSV preview table */
table.preview { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 12px; }
table.preview th, table.preview td {
  text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line);
}
table.preview th { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.kind-tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
.kind-tag.expense { background: #f9e2dd; color: var(--red); }
.kind-tag.income { background: #dff0e6; color: var(--green); }

/* Settings: collapsible section groups */
.settings-group {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; margin-bottom: 10px; overflow: hidden;
}
.settings-group-bar {
  display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 8px;
  background: none; border: none; padding: 14px 16px; cursor: pointer; text-align: left;
  font-family: "Newsreader", serif; font-size: 20px; font-weight: 600; color: var(--ink);
}
.settings-group-chev { color: var(--muted); font-size: 16px; transition: transform .15s ease; flex: 0 0 auto; }
.settings-group-bar.open .settings-group-chev { transform: rotate(180deg); }
.settings-group-body { padding: 0 16px 16px; }
.settings-group-body .subsection:first-child { margin-top: 4px; }

/* Toast */
.toast {
  position: fixed; left: 16px; right: 16px; z-index: 100;
  bottom: calc(84px + env(safe-area-inset-bottom));
  background: var(--ink); color: #fff;
  border-radius: 10px; padding: 12px 16px;
  font-size: 14px; text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.toast.error { background: var(--red); }

@media (min-width: 640px) {
  .modal { padding: 24px; }
  .dialog { top: 50%; bottom: auto; transform: translate(-50%, -50%); border-radius: 16px; }
  .filters { grid-template-columns: 200px 1fr; }
  .filters .row-actions { grid-column: 1 / -1; }
}

/* Budget mode toggle */
.budget-mode { margin-bottom: 12px; }

/* Rollover */
.rollover-toggle {
  background: none; border: 1px solid var(--line); border-radius: 50%;
  width: 22px; height: 22px; font-size: 13px; line-height: 1; cursor: pointer;
  color: var(--muted); vertical-align: 1px; margin-left: 4px; padding: 0;
}
.rollover-toggle.on { color: var(--evergreen); border-color: var(--evergreen); background: #eef5f0; }
/* App lock overlay */
.app-lock {
  position: fixed; inset: 0; z-index: 100;
  background: var(--evergreen); color: #fff;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.app-lock[hidden] { display: none; }
.app-lock-card { text-align: center; max-width: 320px; }
.app-lock-card h2 { color: #fff; margin: 12px 0 4px; }
.app-lock-card .muted { color: rgba(255,255,255,.75); }
.app-lock-icon { font-size: 44px; }
#btn-app-unlock { width: 100%; margin-top: 16px; }
#app-lock-error { color: #ffd9d9; margin-top: 12px; }

/* Category detail modal */
.catdetail-name-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.catdetail-name-input {
  font-size: 22px; font-weight: 700; font-family: inherit; color: inherit;
  border: none; border-bottom: 1px dashed var(--line); border-radius: 0;
  padding: 2px 0; margin: 2px 0 8px; width: 100%; background: transparent;
}
.catdetail-name-input:focus { outline: none; border-bottom: 1px solid var(--evergreen); }
.catdetail-summary { display: flex; gap: 16px; margin: 4px 0 12px; }
.catdetail-summary .num-cell { display: flex; flex-direction: column; }
.catdetail-summary .num-label { font-size: 12.5px; color: var(--muted); }
.catdetail-summary .num-val { font-size: 18px; font-weight: 700; }
.catdetail-summary .num-val.neg { color: var(--red); }
.catdetail-summary .num-val.pos { color: var(--green); }
.catdetail-txns-title { margin: 16px 0 8px; font-size: 15px; }
.catdetail-txn { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.catdetail-txn-actions { display: flex; gap: 6px; align-items: center; }
.catdetail-txn-cat { max-width: 150px; font-size: 13px; }
.catdetail-txn:last-child { border-bottom: none; }
.catdetail-txn .txn-merchant { font-weight: 600; }
.catdetail-txn .txn-date { color: var(--muted); font-size: 12.5px; }
.catdetail-txn .txn-amt { font-weight: 700; white-space: nowrap; }

/* Delete-category X: red, with a pop on tap like the pin button. */
.cat-del {
  background: none; border: 1px solid var(--line); border-radius: 50%;
  width: 22px; height: 22px; font-size: 14px; line-height: 1; cursor: pointer;
  color: #c0392b; vertical-align: 1px; margin-left: 4px; padding: 0;
}
.cat-del.popping { animation: del-pop 0.25s ease; }
@keyframes del-pop {
  0% { transform: scale(1) rotate(0deg); }
  40% { transform: scale(1.4) rotate(-12deg); }
  70% { transform: scale(0.9) rotate(10deg); }
  100% { transform: scale(1) rotate(0deg); }
}
.rollover-note { display: block; font-size: 12px; color: var(--green); font-weight: 600; }

/* Goals */
.goal-card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; margin-bottom: 12px;
}
.goal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
.goal-head .row-actions { display: flex; gap: 6px; align-items: center; }
.goal-foot { margin-top: 8px; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.goal-contrib-form { margin-top: 12px; display: grid; gap: 8px; }
.goal-contrib-form[hidden] { display: none; }
.goal-edit-form { margin-top: 12px; display: grid; gap: 8px; }
.goal-edit-form[hidden] { display: none; }
.fld-label { font-size: 11px; color: var(--muted); margin-bottom: -4px; }

/* iOS Safari date input fix: the native date control paints at its intrinsic
   width and ignores width:100%, overflowing its container on phones.
   Resetting appearance lets the declared width win; the native picker
   still opens on tap. Scoped to touch devices so desktop keeps its native
   calendar indicator. */
@media (pointer: coarse) {
  input[type="date"],
  input[type="month"] {
    -webkit-appearance: none;
    appearance: none;
    min-width: 0;
    max-width: 100%;
  }
  input[type="date"]::-webkit-date-and-time-value,
  input[type="month"]::-webkit-date-and-time-value {
    text-align: left;
  }
}

/* Reports */
.report-row { margin-bottom: 12px; }
.report-row.tappable { cursor: pointer; }
.report-detail { margin: 4px 0 20px 4px; }
.report-detail-head { margin-bottom: 8px; font-size: 14px; }
.pie-wrap { display: flex; gap: 16px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.pie { width: 140px; height: 140px; flex: none; }
.pie-legend { flex: 1; min-width: 180px; }
.pie-legend-row { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; margin-bottom: 4px; }
.report-detail-list .acct-row { font-size: 13px; }
.pie-slice { cursor: pointer; }
.pie-legend-row.tappable { cursor: pointer; }
.pie-legend-row.active { font-weight: 700; }
.report-filter-bar { margin-bottom: 12px; font-size: 13px; }
.report-label { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; font-size: 14px; }
.report-amounts { text-align: right; line-height: 1.5; }
.trend-legend { display: flex; gap: 16px; margin: 8px 0; font-size: 13px; color: var(--muted); }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; }
.swatch.income { background: var(--green); }
.swatch.spent { background: var(--red); }
.trend { display: flex; gap: 8px; align-items: flex-end; height: 140px; padding: 8px 4px 0; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.trend-bars { display: flex; gap: 4px; align-items: flex-end; height: 110px; }
.trend-bars i { width: 14px; border-radius: 3px 3px 0 0; min-height: 3px; display: block; }
.trend-income { background: var(--green); }
.trend-spent { background: var(--red); }
.trend-saved { background: var(--gold); }
.swatch.saved { background: var(--gold); }
.trend-label { font-size: 12px; color: var(--muted); margin-top: 6px; }
.trend { position: relative; }
.trend-lines { position: absolute; top: 0; left: 0; pointer-events: none; z-index: 2; overflow: visible; }
.trend-gridlines { position: absolute; top: 8px; left: 0; right: 0; height: 110px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.trend-gridlines i { display: block; height: 1px; background: rgba(22, 63, 57, 0.12); }
.trend-col { position: relative; z-index: 1; }
.trend-wrap { display: flex; gap: 6px; }
.trend-wrap .trend { flex: 1; min-width: 0; gap: 6px; }
.trend-yaxis { display: flex; flex-direction: column; justify-content: space-between; height: 110px; margin-top: 8px; font-size: 10px; line-height: 1; color: var(--muted); text-align: right; flex: 0 0 auto; }
.trend-wrap.trend-scroll .trend { overflow-x: auto; justify-content: flex-start; -webkit-mask: linear-gradient(90deg, transparent, black 15% 85%, transparent); mask: linear-gradient(90deg, transparent, black 15% 85%, transparent); }
.trend-wrap.trend-scroll .trend-col { flex: 0 0 46px; }

/* Paycheck settings */
.check-row { display: flex; align-items: center; gap: 10px; font-weight: 600; margin: 12px 0; cursor: pointer; }
.check-row input[type="checkbox"] { width: 22px; height: 22px; min-height: 0; accent-color: var(--evergreen); }

/* Pay period picker strip */
.period-strip { display: flex; gap: 8px; overflow-x: auto; padding: 14px 2px 4px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; -webkit-mask: linear-gradient(90deg, transparent, black 15% 85%, transparent); mask: linear-gradient(90deg, transparent, black 15% 85%, transparent); }
.period-chip { flex: 0 0 auto; white-space: nowrap; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; min-height: 0; }
.period-chip.active { background: var(--evergreen); border-color: var(--evergreen); color: #fff; }

/* Show/hide password */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 70px; box-sizing: border-box; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--evergreen); font-weight: 700; font-size: 13px; cursor: pointer; min-height: 0; padding: 6px 10px; }

/* Login failure shake */
@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.login-card.shake { animation: shake 0.4s ease; }

/* Auth extras */
.auth-alt { text-align: center; margin: 12px 0 0; }
.auth-alt .link-btn { color: var(--evergreen); font-weight: 600; }
.legal-foot { text-align: center; margin: 18px 0 0; font-size: 13px; color: var(--muted, #6b6b6b); }
.legal-foot a { color: var(--evergreen); }
.ok-msg { color: var(--green, #1e7e34); font-size: 14px; font-weight: 600; }
.subsection { font-size: 15px; font-weight: 700; margin: 18px 0 6px; }
#code-value { user-select: all; }

/* Forgot password: solid secondary button, visible on the paper login card */
#forgot-link-wrap .btn { background: rgba(22, 63, 57, 0.08); border: 1.5px solid var(--evergreen); }
#forgot-link-wrap .btn:active { background: rgba(22, 63, 57, 0.16); }

/* Security: recent activity event log */
.events-list .event-row { display: flex; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px solid rgba(22, 63, 57, 0.08); font-size: 14px; }
.events-list .event-row:last-child { border-bottom: none; }
.copy-row { display: flex; justify-content: center; gap: 18px; }
.copy-row .link-btn.danger { color: var(--red); }
.link-btn.danger { color: var(--red); }

/* Coaching funnel */
.coach-card { position: relative; border: 1px solid var(--gold); border-left: 4px solid var(--gold); background: #fffdf4; border-radius: 10px; padding: 12px 40px 12px 14px; margin: 12px 0; display: flex; flex-direction: column; gap: 10px; }
.coach-card .btn { align-self: flex-start; }
.coach-dismiss { position: absolute; top: 4px; right: 6px; border: 0; background: none; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; padding: 6px; }
.coach-welcome { margin: 0 0 12px; text-align: center; }
.coach-welcome a { color: var(--evergreen); font-weight: 600; }

/* Setup wizard */
.field-label { display: block; font-weight: 600; margin: 14px 0 4px; }
.wiz-radio { display: block; padding: 10px 0; font-weight: 600; }
.wiz-group-head { font-weight: 700; margin: 16px 0 2px; }
.wiz-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.wiz-row label { flex: 1; }
.wiz-row .wiz-amt { width: 110px; }
.wiz-sum { display: flex; justify-content: space-between; padding: 6px 0; font-size: 17px; }
.wiz-sum .pos { color: #1d7a4f; }
.wiz-sum .neg { color: #b3261e; }
.wiz-left.pos { color: #1d7a4f; }
.wiz-left.neg { color: #b3261e; }

/* Scan to split */
#scan-img { max-width: 100%; max-height: 46vh; border-radius: 8px; display: block; margin: 10px auto; }
.scan-meta { display: flex; gap: 8px; margin-bottom: 8px; }
.scan-meta label { flex: 1; min-width: 0; }
.scan-line { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.scan-line .scan-desc { flex: 1; min-width: 0; }
.scan-line .scan-amt { width: 92px; flex: none; }
.scan-line .scan-del { flex: none; }
.scan-assign-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.scan-assign-row .scan-adesc { flex: 1.2; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scan-assign-row .scan-amt-static { flex: none; width: 76px; text-align: right; font-variant-numeric: tabular-nums; }
.scan-assign-row .scan-cat { flex: 1; min-width: 0; }
#scan-cat-totals { margin: 10px 0; }
#scan-review .rev-row { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid rgba(22, 63, 57, 0.08); font-size: 14px; }
#scan-review .rev-total { font-weight: 700; border-bottom: none; }
#scan-nudge { margin-bottom: 10px; }
.scan-quick { margin: 10px 0; }
.scan-quick-label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.scan-quick-row { display: flex; gap: 8px; align-items: center; }
.scan-quick-row select { flex: 1; min-width: 0; }
.scan-quick-armed { flex: none; color: #178a4c; font-weight: 700; font-size: 14px; white-space: nowrap; }
#scan-quick-hint { margin-top: 4px; }
.scan-done { color: #178a4c; font-weight: 700; }
.scan-assign-row.quick-armed { cursor: pointer; }
.scan-assign-row.quick-armed:active { background: rgba(22, 63, 57, 0.06); }
/* Scan-to-split processing indicator (Nov 4, 2026): spinner + staged status
   so the AI read never looks stuck. */
#scan-status[hidden] { display: none; }
#scan-status:not([hidden]) { display: flex; align-items: center; gap: 8px; }
.scan-spinner { width: 16px; height: 16px; flex: none; border: 2px solid #cfd8d3; border-top-color: #178a4c; border-radius: 50%; animation: scan-spin 0.8s linear infinite; }
@keyframes scan-spin { to { transform: rotate(360deg); } }
