/* Spending on the web: the phone's Spending app (components/spending/*),
   drawn by server/web/pages/spending.js. Every colour is a theme variable or
   a category's own colour from the shared engine (spendingModel.mjs). */

.sx { display: flex; flex-direction: column; gap: 12px; padding-bottom: 28px; container-type: inline-size; }
.sx-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 2px; }
.sx-title { font-size: 30px; font-weight: 800; letter-spacing: -0.5px; color: var(--ink); margin: 0; }
.sx-head-btns { display: flex; gap: 8px; }
.sx-iconbtn {
  width: 40px; height: 40px; border-radius: 20px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink); cursor: pointer; padding: 0; flex: none;
  transition: transform .12s;
}
.sx-iconbtn:active { transform: scale(.94); }
.sx-iconbtn.filled { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.sx-iconbtn svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 40; }
.sx-iconbtn:disabled { opacity: .5; cursor: default; }

.sx-tabs { display: flex; gap: 2px; padding: 3px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); }
.sx-tab {
  flex: 1; min-width: 0; height: 38px; border: none; background: none; border-radius: 13px; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 700; color: var(--ink-muted); white-space: normal; padding: 0 4px;
  transition: background .18s, color .18s; overflow-wrap: break-word;
}
.sx-tab.on { background: var(--ink); color: var(--bg); }
@container (max-width: 340px) { .sx-tab { font-size: 13px; padding: 0 2px; letter-spacing: -0.2px; } }
.sx-month { display: flex; align-items: center; justify-content: space-between; margin-top: -2px; }
.sx-month-btn { width: 40px; height: 40px; border: none; background: none; color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; border-radius: 20px; }
.sx-month-btn:hover:not(:disabled) { background: var(--accent-soft); }
.sx-month-btn:disabled { opacity: .25; cursor: default; }
.sx-month-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 48; }
.sx-month-mid { flex: 1; display: flex; flex-direction: column; align-items: center; border: none; background: none; font: inherit; cursor: pointer; min-height: 40px; justify-content: center; }
.sx-month-mid:disabled { cursor: default; }
.sx-month-name { font-size: 15.5px; font-weight: 800; color: var(--ink); }
.sx-month-back { font-size: 12px; font-weight: 700; color: var(--accent); margin-top: 1px; }

.sx-card { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 16px; min-width: 0; }
button.sx-card { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.sx-card.pad-y { padding-top: 6px; padding-bottom: 6px; }
.sx-card.dashed { border-style: dashed; }
.sx-card.warn { border-color: color-mix(in srgb, #F59E0B 45%, transparent); }
.sx-section { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px; margin: 8px 0 -2px; }
.sx-section-title { min-width: 0; white-space: normal; font-size: 11.5px; font-weight: 800; letter-spacing: 1.1px; color: var(--ink-muted); text-transform: uppercase; overflow-wrap: break-word; }
.sx-link { border: none; background: none; font: inherit; color: var(--accent); font-size: 13px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 2px; padding: 4px 0; }
.sx-link svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 56; }
.sx-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.sx-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
/* Two columns only when the page itself is wide (the installed app on a
   desktop), not when the window is: the shell is often a phone-wide column. */
@container (min-width: 760px) {
  .sx-grid.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
}

/* tiles */
.sx-av { flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 800; letter-spacing: .2px; user-select: none; box-sizing: border-box; }
/* A black brand (Uber, Equinox) would vanish into a dark card without its rim. */
.sx-av.brand { border: 1px solid var(--border); }
.sx-emoji { flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 30%; user-select: none; }
.sx-emoji.round { border-radius: 50%; }

/* money */
.sx-big { font-weight: 800; letter-spacing: -1px; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.1; white-space: nowrap; }
.sx-big .c { font-size: .5em; font-weight: 700; letter-spacing: 0; }
.sx-big.danger { color: var(--danger); }
.sx-big.success { color: var(--success); }

/* hero */
.sx-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sx-hero-label { font-size: 13.5px; font-weight: 700; color: var(--ink-muted); }
.sx-hero-covered { font-size: 12px; font-weight: 600; color: var(--ink-faint); white-space: normal; overflow-wrap: break-word; }
.sx-hero-sub { font-size: 13.5px; color: var(--ink-muted); margin-top: 2px; }
.sx-stats { display: flex; border-top: 1px solid var(--border); margin-top: 10px; padding-top: 12px; }
.sx-stat { flex: 1; min-width: 0; }
.sx-stat-label { font-size: 11.5px; font-weight: 600; color: var(--ink-muted); white-space: normal; overflow-wrap: break-word; }
.sx-stat-value { font-size: 16px; font-weight: 800; margin-top: 2px; color: var(--ink); font-variant-numeric: tabular-nums; white-space: normal; overflow-wrap: break-word; }
.sx-behind { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: 14px; background: var(--accent-soft); border: none; width: 100%; font: inherit; cursor: pointer; text-align: left; }
.sx-behind svg { width: 15px; height: 15px; stroke: var(--accent); fill: none; stroke-width: 40; flex: none; }
.sx-behind-text { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--ink); }
.sx-behind-go { font-size: 13px; font-weight: 700; color: var(--accent); white-space: nowrap; }

/* the pace chart */
.sx-pace { position: relative; height: 150px; margin-top: 14px; }
.sx-pace svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.sx-pace .draw { animation: sx-draw 900ms cubic-bezier(.2,.7,.2,1) both; }
@keyframes sx-draw { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.sx-pace-dot { position: absolute; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border-radius: 50%; border: 2px solid var(--surface-solid, var(--surface)); box-shadow: 0 0 0 6px color-mix(in srgb, currentColor 20%, transparent); background: currentColor; }
.sx-bubble { position: absolute; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 10px; background: var(--ink); color: var(--bg); font-size: 12px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sx.anim .sx-pace-dot, .sx.anim .sx-bubble { animation: sx-pop 300ms 750ms both; }
.sx-bubble i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
@keyframes sx-pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
.sx-axis { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; font-size: 11px; font-weight: 600; color: var(--ink-faint); }
.sx-axis span { white-space: nowrap; flex: none; }
.sx-axis span:nth-child(2) { flex: 1 1 auto; min-width: 0; text-align: center; white-space: normal; overflow-wrap: break-word; }

/* review */
.sx-cardhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sx-cardhead-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sx-badge { min-width: 24px; height: 24px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; background: color-mix(in srgb, #F59E0B 14%, transparent); color: #B45309; font-weight: 800; font-size: 12px; }
:root[data-theme='dark'] .sx-badge { color: #FBBF24; }
.sx-card-title { font-size: 16px; font-weight: 800; color: var(--ink); }
.sx-note { font-size: 13px; line-height: 18px; color: var(--ink-muted); margin: 4px 0; }

/* buttons */
.sx-btn {
  min-height: 46px; border-radius: 16px; border: 1px solid var(--ink); background: var(--ink); color: var(--bg);
  font: inherit; font-size: 15px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 16px; cursor: pointer; width: 100%; transition: opacity .12s;
}
.sx-btn:active { opacity: .8; }
.sx-btn:disabled { opacity: .45; cursor: default; }
.sx-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 40; }
.sx-btn.secondary { background: var(--surface); border-color: var(--border); color: var(--ink); }
.sx-btn.soft { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent); }
.sx-btn.danger { background: var(--surface); border-color: color-mix(in srgb, var(--danger) 35%, transparent); color: var(--danger); }
.sx-btns { display: flex; gap: 10px; margin-top: 12px; }
.sx-btns > * { flex: 1; min-width: 0; }

/* rows */
.sx-tx {
  display: flex; align-items: center; gap: 12px; width: calc(100% + 16px); padding: 9px 8px; margin: 0 -8px;
  border: none; background: none; border-radius: 14px; font: inherit; text-align: left; cursor: pointer; color: inherit;
}
.sx-tx:hover { background: var(--accent-soft); }
.sx-tx-body { flex: 1; min-width: 0; }
.sx-tx-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.sx-tx-name { font-size: 15px; font-weight: 600; color: var(--ink); white-space: normal; overflow-wrap: break-word; }
.sx-tx-rc { display: inline-flex; color: var(--accent); flex: none; }
.sx-tx-rc svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 40; }
.sx-tx-sub { font-size: 12.5px; margin-top: 2px; color: var(--ink-muted); white-space: normal; overflow-wrap: break-word; }
.sx-tx-sub.review { color: #B45309; }
:root[data-theme='dark'] .sx-tx-sub.review { color: #FBBF24; }
.sx-dot { width: 6px; height: 6px; border-radius: 3px; background: #F59E0B; flex: none; margin-top: 2px; }
.sx-tx-amt { font-size: 15px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; flex: none; }
.sx-tx-amt.credit { color: var(--success); }
.sx-tx-amt.covered { color: var(--ink-faint); text-decoration: line-through; }

/* horizontal shelves: budget rings, bills */
.sx-shelf { display: flex; gap: 10px; overflow-x: auto; padding: 8px 14px; margin: 0 -14px; scrollbar-width: none; }
.sx-shelf::-webkit-scrollbar { display: none; }
.sx-ring-item { flex: none; width: 100px; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; padding: 12px 6px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font: inherit; color: inherit; }
.sx-ring-item:hover, .sx-bill:hover { border-color: var(--ink-faint); }
.sx-ring { position: relative; flex: none; }
.sx-ring svg { display: block; transform: rotate(-90deg); }
.sx-ring svg circle.fill { transition: stroke-dashoffset 720ms cubic-bezier(.2,.7,.2,1); }
.sx-ring-mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.sx-ring-name { max-width: 100%; margin-top: 8px; font-size: 11.5px; font-weight: 700; color: var(--ink-muted); white-space: normal; overflow-wrap: break-word; }
.sx-ring-value { font-size: 14.5px; font-weight: 800; margin-top: 1px; color: var(--ink); font-variant-numeric: tabular-nums; }
.sx-ring-value.danger { color: var(--danger); }
.sx-ring-sub { font-size: 11.5px; font-weight: 600; color: var(--ink-muted); }
.sx-bill { flex: none; width: 132px; padding: 12px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; gap: 3px; cursor: pointer; font: inherit; color: inherit; text-align: left; }
.sx-bill-name { font-size: 13.5px; font-weight: 700; margin-top: 8px; color: var(--ink); white-space: normal; overflow-wrap: break-word; }
.sx-bill-amt { font-size: 16px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.sx-bill-due { font-size: 12px; font-weight: 700; color: var(--ink-muted); }
.sx-bill-due.soon { color: var(--accent); }

.sx-cta { display: flex; align-items: center; gap: 12px; }
.sx-cta-body { flex: 1; min-width: 0; }
.sx-chev { display: inline-flex; color: var(--ink-faint); flex: none; }
.sx-chev svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 48; }

/* insights */
.sx-insight { display: flex; align-items: center; gap: 12px; padding: 12px 0; width: 100%; border: none; background: none; font: inherit; text-align: left; color: inherit; cursor: pointer; }
.sx-insight:disabled { cursor: default; }
.sx-insight + .sx-insight { border-top: 1px solid var(--border); }
.sx-insight-title { font-size: 14.5px; font-weight: 700; color: var(--ink); }
.sx-insight-body { font-size: 13px; margin-top: 2px; line-height: 18px; color: var(--ink-muted); }

/* segments inside a card */
.sx-seg { display: flex; gap: 2px; padding: 2px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); }
.sx-seg button { flex: 1; height: 32px; border: none; background: none; border-radius: 10px; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--ink-muted); cursor: pointer; }
.sx-seg button.on { background: var(--ink); color: var(--bg); }

/* where it went */
.sx-donut-wrap { display: flex; justify-content: center; margin: 16px 0; }
.sx-donut { position: relative; width: 132px; height: 132px; }
.sx-donut svg { display: block; transform: rotate(-90deg); }
.sx-donut-mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.sx-donut-value { font-size: 20px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.sx-donut-sub { font-size: 11.5px; font-weight: 600; color: var(--ink-muted); }
.sx-cat { display: flex; align-items: center; gap: 12px; padding: 8px 0; width: 100%; border: none; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; border-radius: 12px; }
.sx-cat:hover .sx-cat-name { color: var(--accent); }
.sx-cat-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.sx-cat-line { display: flex; align-items: center; gap: 10px; }
.sx-cat-name { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 600; color: var(--ink); white-space: normal; overflow-wrap: break-word; }
.sx-cat-amt { font-size: 14.5px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sx-cat-pct { width: 34px; text-align: right; font-size: 12px; font-weight: 600; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.sx-rank { width: 14px; text-align: center; font-size: 13px; font-weight: 800; color: var(--ink-faint); }
.sx-bar { position: relative; height: 8px; border-radius: 4px; background: var(--accent-soft); overflow: hidden; flex: 1; min-width: 0; }
.sx-bar > i { display: block; height: 100%; border-radius: inherit; transition: width .5s cubic-bezier(.2,.7,.2,1); }

/* money in & out */
.sx-flow { display: flex; align-items: center; gap: 10px; margin: 5px 0; }
.sx-flow-label { width: 30px; font-size: 13px; font-weight: 700; color: var(--ink-muted); }
.sx-flow-value { min-width: 72px; text-align: right; font-size: 14.5px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* the year */
.sx-trend-head { display: flex; justify-content: space-between; margin-bottom: 12px; }
.sx-trend-value { font-size: 20px; font-weight: 800; margin-top: 2px; color: var(--ink); font-variant-numeric: tabular-nums; }
.sx-bars { position: relative; height: 96px; display: flex; align-items: flex-end; gap: 5px; }
.sx-bars button { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; border: none; background: none; padding: 0; cursor: pointer; }
.sx-bars button:disabled { cursor: default; }
.sx-bars button i { display: block; width: 100%; border-radius: 6px 6px 2px 2px; background: color-mix(in srgb, var(--accent) 34%, transparent); transition: height .4s; }
.sx-bars button.empty i { background: var(--border); }
.sx-bars button.on i { background: var(--accent); }
.sx-bars button:hover:not(:disabled):not(.on) i { background: color-mix(in srgb, var(--accent) 55%, transparent); }
.sx-avg { position: absolute; left: 0; right: 0; border-top: 1.5px dashed color-mix(in srgb, var(--ink) 45%, transparent); pointer-events: none; }
.sx-letters { display: flex; gap: 5px; margin-top: 6px; }
.sx-letters span { flex: 1; text-align: center; font-size: 11px; color: var(--ink-faint); }
.sx-letters span.on { color: var(--ink); font-weight: 800; }
.sx-avg-note { font-size: 12px; margin-top: 8px; color: var(--ink-muted); }

/* receipts */
.sx-mailrow { display: flex; align-items: center; gap: 8px; width: 100%; padding: 11px 0 0; margin-top: 10px; border: none; border-top: 1px solid var(--border); background: none; font: inherit; text-align: left; cursor: pointer; color: inherit; }
.sx-mailrow-title { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.sx-mailrow-title.accent { color: var(--accent); }
.sx-mailrow-sub { font-size: 12.5px; color: var(--ink-muted); margin-top: 2px; }

/* activity */
.sx-search { display: flex; align-items: center; gap: 8px; height: 46px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); padding: 0 14px; }
.sx-search svg { width: 17px; height: 17px; stroke: var(--ink-muted); fill: none; stroke-width: 44; flex: none; }
.sx-search input { flex: 1; min-width: 0; border: none; background: none; font: inherit; font-size: 15.5px; color: var(--ink); outline: none; }
.sx-search input::placeholder { color: var(--ink-faint); }
.sx-search button { border: none; background: none; padding: 0; display: inline-flex; color: var(--ink-faint); cursor: pointer; }
.sx-chips { display: flex; gap: 8px; overflow-x: auto; padding: 0 14px; margin: 0 -14px; scrollbar-width: none; align-items: center; }
.sx-chips::-webkit-scrollbar { display: none; }
.sx-chip { flex: none; height: 34px; padding: 0 13px; border-radius: 17px; border: 1px solid var(--border); background: var(--surface); color: var(--ink-muted); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.sx-chip.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.sx-chip.accent { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--accent); }
.sx-chip-gap { flex: none; width: 2px; height: 22px; background: var(--border); margin: 0 2px; }
.sx-summary { display: flex; align-items: baseline; justify-content: space-between; padding: 0 4px; }
.sx-summary-text { font-size: 13px; font-weight: 600; color: var(--ink-muted); }
.sx-summary-value { font-size: 15px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.sx-day-head { display: flex; justify-content: space-between; padding: 0 6px; margin: 6px 0; font-size: 12.5px; font-weight: 700; color: var(--ink-muted); }
.sx-day-head span:last-child { font-weight: 600; font-variant-numeric: tabular-nums; }
.sx-day { padding: 4px 14px; }
.sx-empty { display: flex; flex-direction: column; align-items: center; padding: 28px 16px; text-align: center; }
.sx-empty-title { font-size: 16px; font-weight: 700; margin-top: 8px; color: var(--ink); }

/* budgets */
.sx-bsum { display: flex; align-items: center; gap: 18px; }
.sx-bsum-text { flex: 1; min-width: 0; }
.sx-bsum-label { font-size: 12.5px; font-weight: 700; color: var(--ink-muted); }
.sx-bsum-value { font-size: 26px; font-weight: 800; margin-top: 2px; color: var(--ink); font-variant-numeric: tabular-nums; }
.sx-bsum-line { font-size: 13px; margin-top: 3px; color: var(--ink-muted); }
.sx-brow { display: flex; align-items: center; gap: 12px; padding: 12px 0; width: 100%; border: none; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.sx-brow + .sx-brow { border-top: 1px solid var(--border); }
.sx-brow-body { flex: 1; min-width: 0; }
.sx-brow-line { display: flex; align-items: baseline; gap: 8px; }
.sx-brow-name { flex: 1; min-width: 0; font-size: 15px; font-weight: 700; color: var(--ink); white-space: normal; overflow-wrap: break-word; }
.sx-brow-left { font-size: 15px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sx-brow-left.danger { color: var(--danger); }
.sx-brow-left small { font-size: 12.5px; font-weight: 600; color: var(--ink-muted); }
.sx-track { position: relative; height: 8px; border-radius: 4px; background: var(--accent-soft); margin-top: 8px; }
.sx-track > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; transition: width .5s cubic-bezier(.2,.7,.2,1); }
.sx-track > b { position: absolute; top: -3px; width: 2px; height: 14px; border-radius: 1px; background: var(--ink); opacity: .5; }
.sx-brow-sub { font-size: 12.5px; margin-top: 6px; color: var(--ink-muted); white-space: normal; overflow-wrap: break-word; }
.sx-setchip { flex: none; display: inline-flex; align-items: center; gap: 3px; height: 30px; padding: 0 10px; border-radius: 15px; border: none; background: var(--accent-soft); color: var(--accent); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.sx-setchip svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 48; }
.sx-setup { display: flex; flex-direction: column; align-items: center; padding: 26px 16px; text-align: center; }
.sx-setup-title { font-size: 19px; font-weight: 800; margin-top: 14px; color: var(--ink); }
.sx-setup-sub { font-size: 14px; margin-top: 6px; color: var(--ink-muted); }

/* recurring */
.sx-rsum { display: flex; align-items: flex-end; gap: 12px; }
.sx-rsum-value { font-size: 32px; font-weight: 800; margin-top: 2px; color: var(--ink); font-variant-numeric: tabular-nums; }
.sx-rsum-value2 { font-size: 20px; font-weight: 800; margin-top: 2px; color: var(--ink); font-variant-numeric: tabular-nums; }
.sx-cal-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.sx-cal-title { font-size: 16px; font-weight: 800; color: var(--ink); }
.sx-cal-meta { font-size: 12.5px; font-weight: 600; color: var(--ink-muted); text-align: right; }
.sx-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.sx-cal-wd { text-align: center; font-size: 11.5px; font-weight: 700; color: var(--ink-faint); margin-bottom: 4px; }
.sx-cal-day { height: 50px; display: flex; flex-direction: column; align-items: center; padding-top: 3px; border: none; background: none; font: inherit; cursor: default; }
.sx-cal-day.has { cursor: pointer; }
.sx-cal-num { width: 32px; height: 32px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; font-size: 13.5px; font-weight: 500; color: var(--ink-faint); box-sizing: border-box; }
.sx-cal-day.has .sx-cal-num { color: var(--ink); font-weight: 800; }
.sx-cal-day.today .sx-cal-num { border: 1.5px solid var(--accent); font-weight: 800; }
.sx-cal-day.on .sx-cal-num { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.sx-cal-dots { display: flex; gap: 3px; margin-top: 3px; height: 6px; }
.sx-cal-dots i { width: 6px; height: 6px; border-radius: 3px; box-sizing: border-box; }
.sx-legend { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 8px; font-size: 12px; font-weight: 600; color: var(--ink-muted); }
.sx-legend i { width: 6px; height: 6px; border-radius: 3px; display: inline-block; box-sizing: border-box; }
.sx-picked { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 6px; }
.sx-picked-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; width: 100%; border: none; background: none; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.sx-rec { display: flex; align-items: center; gap: 12px; padding: 11px 0; width: 100%; border: none; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.sx-rec + .sx-rec { border-top: 1px solid var(--border); }
.sx-rec-name { font-size: 15px; font-weight: 700; color: var(--ink); white-space: normal; overflow-wrap: break-word; }
.sx-rec-name.off { color: var(--ink-muted); }
.sx-rec-sub { font-size: 12.5px; margin-top: 2px; color: var(--ink-muted); white-space: normal; overflow-wrap: break-word; }
.sx-amt { font-size: 15px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sx-up { display: flex; align-items: center; justify-content: flex-end; gap: 1px; margin-top: 2px; color: var(--danger); font-size: 11.5px; font-weight: 700; }

/* sheets */
.sx-sheet { display: flex; flex-direction: column; }
.sx-sheet-top { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 14px 0 6px; text-align: center; }
.sx-sheet-name { font-size: 19px; font-weight: 800; margin-top: 8px; color: var(--ink); word-break: break-word; }
.sx-sheet-date { font-size: 13.5px; font-weight: 600; color: var(--ink-muted); }
.sx-catpill { display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; height: 36px; border-radius: 18px; border: 1px solid; margin-top: 10px; font: inherit; font-size: 14px; font-weight: 700; color: var(--ink); cursor: pointer; }
.sx-catpill svg { width: 14px; height: 14px; stroke: var(--ink-muted); fill: none; stroke-width: 48; }
.sx-catchips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 10px; }
.sx-reviewbox { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 16px; border: 1px solid color-mix(in srgb, #F59E0B 35%, transparent); background: color-mix(in srgb, #F59E0B 10%, transparent); margin-top: 12px; }
.sx-reviewbox b { display: block; font-size: 13px; color: #B45309; }
:root[data-theme='dark'] .sx-reviewbox b { color: #FBBF24; }
.sx-reviewbox span { font-size: 13.5px; color: var(--ink); }
.sx-reviewbox button { flex: none; height: 36px; padding: 0 12px; border-radius: 12px; border: none; background: var(--ink); color: var(--bg); font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
.sx-list { margin-top: 12px; padding-top: 6px; padding-bottom: 6px; }
.sx-info { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 10px 0; width: 100%; border: none; background: none; font: inherit; color: inherit; text-align: left; }
button.sx-info { cursor: pointer; }
.sx-info + .sx-info, .sx-inline + .sx-info { border-top: 1px solid var(--border); }
.sx-info-label { color: var(--ink-muted); font-size: 14.5px; flex: none; }
.sx-info-value { flex: 1; min-width: 0; text-align: right; color: var(--ink); font-size: 14.5px; font-weight: 600; white-space: normal; overflow-wrap: break-word; }
.sx-inline { display: flex; flex-direction: column; gap: 8px; padding-bottom: 12px; }
.sx-field { width: 100%; box-sizing: border-box; min-height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); font: inherit; font-size: 15px; padding: 10px 12px; outline: none; }
.sx-field:focus { border-color: var(--accent); }
textarea.sx-field { min-height: 72px; resize: vertical; }
.sx-hint { font-size: 13px; line-height: 18px; margin-top: 4px; color: var(--ink-muted); }
.sx-switch { position: relative; width: 50px; height: 30px; border-radius: 15px; border: none; background: var(--border); cursor: pointer; flex: none; transition: background .2s; padding: 0; }
.sx-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 12px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.sx-switch.on { background: var(--accent); }
.sx-switch.on::after { transform: translateX(20px); }
.sx-rchead { display: flex; align-items: center; gap: 8px; padding-top: 8px; font-size: 14.5px; font-weight: 800; color: var(--ink); }
.sx-rchead svg { width: 16px; height: 16px; stroke: var(--accent); fill: none; stroke-width: 40; }
.sx-rc-subject { font-size: 14.5px; font-weight: 600; margin-top: 6px; color: var(--ink); word-break: break-word; }
.sx-histhead { display: flex; align-items: center; justify-content: space-between; padding-top: 8px; font-size: 14.5px; font-weight: 800; color: var(--ink); }
.sx-hstats { display: flex; gap: 10px; padding: 10px 0; }
.sx-hrow { display: flex; align-items: center; gap: 6px; padding: 9px 0; width: 100%; border: none; background: none; font: inherit; color: inherit; cursor: pointer; }
.sx-hrow + .sx-hrow { border-top: 1px solid var(--border); }
.sx-hrow span:first-child { flex: 1; text-align: left; font-size: 13.5px; color: var(--ink-muted); }
.sx-raw { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; margin-top: 14px; text-align: center; color: var(--ink-faint); word-break: break-word; }
.sx-cat-top { display: flex; align-items: center; gap: 12px; margin: 14px 0 12px; }
.sx-cat-title { font-size: 20px; font-weight: 800; color: var(--ink); }
.sx-mini { display: flex; gap: 8px; height: 120px; }
.sx-mini > div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.sx-mini small { font-size: 10.5px; font-weight: 600; color: var(--ink-muted); }
.sx-mini .sp { flex: 1; width: 70%; display: flex; flex-direction: column; justify-content: flex-end; }
.sx-mini .sp i { display: block; border-radius: 5px; }
.sx-mini span { font-size: 11px; color: var(--ink-faint); }
.sx-mini span.on { color: var(--ink); font-weight: 800; }
.sx-stepper { display: inline-flex; align-items: center; border: 1px solid var(--border); background: var(--surface); border-radius: 22px; height: 44px; flex: none; }
.sx-stepper button { width: 38px; height: 42px; border: none; background: none; color: var(--ink); font-size: 20px; line-height: 1; cursor: pointer; border-radius: 20px; }
.sx-stepper button:disabled { opacity: .3; cursor: default; }
.sx-stepper input { width: 64px; text-align: center; border: none; background: none; font: inherit; font-size: 14.5px; font-weight: 700; color: var(--ink); outline: none; font-variant-numeric: tabular-nums; }
.sx-stepper input::placeholder { color: var(--ink-faint); font-weight: 600; }
.sx-budgetrow { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.sx-uppill { display: inline-flex; align-items: center; gap: 5px; padding: 0 10px; height: 28px; border-radius: 14px; margin-top: 8px; background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); font-size: 13px; font-weight: 800; }
.sx-editor-top { display: flex; flex-direction: column; align-items: center; margin-top: 6px; text-align: center; }
.sx-erow { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.sx-erow + .sx-erow { border-top: 1px solid var(--border); }
.sx-erow-name { font-size: 14.5px; font-weight: 700; color: var(--ink); white-space: normal; overflow-wrap: break-word; }
.sx-erow-sub { font-size: 12px; margin-top: 1px; color: var(--ink-muted); }
.sx-folder { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 12px; display: flex; flex-direction: column; gap: 4px; }

/* the estimated balance */
button.sx-balance { padding-bottom: 0; }
.sx-balance-row { display: flex; align-items: center; gap: 12px; }
.sx-balance-main { flex: 1; min-width: 0; }
.sx-balance-sub { font-size: 13px; margin-top: 2px; color: var(--ink-muted); white-space: normal; overflow-wrap: break-word; }
.sx-balance-side { width: 116px; flex: none; display: flex; flex-direction: column; gap: 4px; }
@container (max-width: 360px) { .sx-balance-side { width: 84px; } .sx-balance-change { font-size: 10.5px; } }
.sx-balance-change { font-size: 11.5px; line-height: 14px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.sx-balance-action { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--border); margin-top: 12px; padding: 11px 0; color: var(--accent); font-size: 13.5px; font-weight: 700; }
.sx-balance-action span { flex: 1; }
.sx-balance-action svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 44; flex: none; }
.sx-spark { position: relative; width: 100%; }
.sx-spark svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.sx-spark i { position: absolute; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%; }
.sx-money-field { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sx-field.bad { border-color: var(--danger); }

/* the toast of a done thing sits in the page, under the head */
/* statements being read: one row a file, a thin bar, one line of words */
.sx-imports-host:empty { display: none; }
.sx-imports { padding-bottom: 6px; }
.sx-imp { padding: 12px 0 10px; border-top: 1px solid var(--border); }
.sx-imports .sx-card-title + div > .sx-imp:first-child { border-top: none; padding-top: 10px; }
.sx-imp-top { display: flex; align-items: center; gap: 8px; min-height: 22px; }
.sx-imp-name { flex: 1; min-width: 0; text-wrap: balance; font-size: 14.5px; font-weight: 700; line-height: 20px; color: var(--ink); overflow-wrap: anywhere; display: block; }
.sx-imp-top { align-items: flex-start; }
.sx-imp-ico { flex: none; display: inline-flex; width: 18px; height: 20px; align-items: center; color: var(--ink-muted); }
.sx-imp-ico.success { color: var(--success); }
.sx-imp-ico.danger { color: var(--danger); }
.sx-imp-ico svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 44; }
.sx-imp-x { flex: none; width: 40px; height: 40px; margin: -9px -10px -9px 0; border: none; background: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-muted); cursor: pointer; }
.sx-imp-x:hover { background: var(--accent-soft); }
.sx-imp-x svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 44; }
.sx-imp-bar { flex: none; height: 6px; border-radius: 3px; margin-top: 8px; }
.sx-imp-bar.pulse > i { animation: sx-imp-pulse 1.4s ease-in-out infinite; }
@keyframes sx-imp-pulse { 50% { opacity: .4; } }
.sx-imp-line { margin-top: 6px; font-size: 13px; font-weight: 600; line-height: 18px; color: var(--ink-muted); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sx-imp-line.success { color: var(--success); }
.sx-imp-line.danger { color: var(--danger); }
.sx-imp .sx-btns { margin-top: 10px; }
.sx-imp .sx-btn { min-height: 40px; border-radius: 12px; font-size: 14px; }
.sx-done { display: flex; align-items: center; gap: 8px; border-radius: 14px; padding: 11px 14px; background: var(--ink); color: var(--bg); font-size: 13.5px; font-weight: 600; animation: sx-pop 220ms both; }
.sx-done svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 44; flex: none; }

/* welcome */
.sx-welcome { display: flex; flex-direction: column; align-items: center; padding: 28px 16px; text-align: center; }
.sx-welcome-title { font-size: 22px; font-weight: 800; margin-top: 16px; letter-spacing: -0.3px; color: var(--ink); text-wrap: balance; }
.sx-welcome-sub { font-size: 14.5px; margin-top: 6px; color: var(--ink-muted); text-wrap: pretty; }
.sx-welcome-hint { font-size: 12.5px; margin-top: 10px; color: var(--ink-faint); }
.sx-feature { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.sx-feature + .sx-feature { border-top: 1px solid var(--border); }

/* the rise-in, as on the phone */
.sx-rise { animation: sx-rise 360ms cubic-bezier(.2,.7,.2,1) both; }
@keyframes sx-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .sx-rise, .sx-pace .draw, .sx-pace-dot, .sx-bubble, .sx-done, .sx-imp-bar.pulse > i { animation: none; }
  .sx-bar > i, .sx-track > i, .sx-ring svg circle.fill, .sx-bars button i { transition: none; }
}
