:root {
  --bg: #f2f3f7;
  --card: #ffffff;
  --card2: #f7f8fb;
  --text: #15171c;
  --muted: #6b7280;
  --line: #e5e7ee;
  --accent: #2f6df6;
  --accent-soft: #e6eeff;
  --green: #12a150;
  --red: #e5484d;
  --amber: #f0a000;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --radius: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0d0f14;
  --card: #181b22;
  --card2: #20242d;
  --text: #eef0f5;
  --muted: #9aa1ae;
  --line: #2a2f3a;
  --accent: #5b8cff;
  --accent-soft: #1d2a4a;
  --green: #34c472;
  --red: #ff6369;
  --amber: #ffb224;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { margin: 0; }
.muted { color: var(--muted); }
.pos { color: var(--green); }
.neg { color: var(--red); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Layout ---------- */
#app { min-height: 100%; }
.sidebar { display: none; }
#main {
  max-width: 860px;
  margin: 0 auto;
  padding: calc(12px + var(--safe-t)) 16px calc(96px + var(--safe-b));
  outline: none;
}
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: space-around;
  padding: 6px 4px calc(6px + var(--safe-b));
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11px; color: var(--muted); padding: 4px 0;
}
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.on { color: var(--accent); }
.fab {
  position: fixed; right: 18px; bottom: calc(76px + var(--safe-b)); z-index: 21;
  width: 56px; height: 56px; border-radius: 50%; border: 0;
  background: var(--accent); color: #fff; font-size: 32px; line-height: 1;
  box-shadow: 0 6px 18px rgba(47, 109, 246, .4);
}
.fab:active { transform: scale(.95); }

@media (min-width: 900px) {
  .tabbar { display: none; }
  .sidebar {
    display: flex; flex-direction: column;
    position: fixed; top: 0; bottom: 0; left: 0; width: 232px;
    background: var(--card); border-right: 1px solid var(--line);
    padding: 18px 12px;
  }
  .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; padding: 4px 10px 18px; }
  .brand img { width: 30px; height: 30px; }
  #sidenav a {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 12px; border-radius: 10px; color: var(--text); margin-bottom: 2px;
  }
  #sidenav a svg { width: 20px; height: 20px; color: var(--muted); }
  #sidenav a:hover { background: var(--card2); }
  #sidenav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
  #sidenav a.on svg { color: var(--accent); }
  #sidenav .sep { height: 1px; background: var(--line); margin: 10px 8px; }
  #main { margin-left: 232px; max-width: none; padding: 24px 36px 60px; }
  #main > * { max-width: 980px; margin-left: auto; margin-right: auto; }
  .fab { bottom: 28px; right: 32px; }
}

/* ---------- View header ---------- */
.vh {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 6px 0 14px;
}
.vh h1 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vh .back { font-size: 26px; padding: 0 6px 0 0; background: none; border: 0; color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 999px; padding: 8px 14px;
  background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 14px;
  white-space: nowrap;
}
.btn.primary { background: var(--accent); color: #fff; }
.btn.danger { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; padding: 12px; font-size: 16px; }
.btn:disabled { opacity: .5; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 0;
  background: var(--card); color: var(--text); box-shadow: var(--shadow);
  display: inline-flex; align-items: center; justify-content: center; font-size: 18px;
}

/* ---------- Cards / lists ---------- */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; margin-bottom: 14px;
}
.card.flush { padding: 0; overflow: hidden; }
.card h2 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 10px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.card-head h2 { margin: 0; }
.section-title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 18px 4px 8px; display: flex; justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 700px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid2 > .card { margin-bottom: 0; } .grid2 { margin-bottom: 14px; } }

.big { font-size: 32px; font-weight: 800; letter-spacing: -.02em; }
.stats { display: flex; gap: 10px; flex-wrap: wrap; }
.stat { flex: 1; min-width: 122px; background: var(--card2); border-radius: 12px; padding: 10px 12px; }
.stat .l { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 17px; font-weight: 700; margin-top: 2px; white-space: nowrap; }

.list { list-style: none; margin: 0; padding: 0; }
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px; border-bottom: 1px solid var(--line);
  cursor: pointer; background: var(--card);
}
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--card2); }
.row .main { flex: 1; min-width: 0; }
.row .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .amt { font-weight: 600; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row .amt .sub { text-align: right; font-weight: 400; }
.ico {
  width: 38px; height: 38px; flex: none; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 19px;
  background: var(--card2);
}
.ico.round { border-radius: 50%; }
.day-head {
  display: flex; justify-content: space-between;
  padding: 8px 16px; font-size: 13px; font-weight: 600; color: var(--muted);
  background: var(--card2); border-bottom: 1px solid var(--line);
}
.group-head { display: flex; justify-content: space-between; padding: 10px 16px 6px; font-weight: 700; font-size: 14px; border-bottom: 1px solid var(--line); }
.empty { text-align: center; color: var(--muted); padding: 32px 16px; }
.empty .e { font-size: 40px; margin-bottom: 6px; }

/* progress */
.bar { height: 8px; border-radius: 99px; background: var(--card2); overflow: hidden; position: relative; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--green); }
.bar > i.warn { background: var(--amber); }
.bar > i.over { background: var(--red); }
.bar .today-mark { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--text); opacity: .35; }
.budget-row { padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.budget-row:last-child { border-bottom: 0; }
.budget-row:hover { background: var(--card2); }
.budget-row .top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.budget-row .top .main { flex: 1; min-width: 0; }
.budget-row .foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }

/* month nav / segmented */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.monthnav { display: inline-flex; align-items: center; background: var(--card); border-radius: 999px; box-shadow: var(--shadow); }
.monthnav button { border: 0; background: none; padding: 7px 14px; font-size: 18px; color: var(--accent); }
.monthnav span { min-width: 140px; text-align: center; font-weight: 600; }
.seg { display: inline-flex; background: var(--card2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); font-weight: 600; }
:root[data-theme="dark"] .seg button.on { background: #343a47; }
.seg.full { display: flex; }
.seg.full button { flex: 1; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips .seg { flex: none; }
.chips .seg button { white-space: nowrap; }
.pill-select, .search {
  border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 7px 12px; font-size: 14px; max-width: 100%;
}
.search { flex: 1; min-width: 160px; }

/* ---------- Sheet / modal ---------- */
.sheet-wrap {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0, 0, 0, .38);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .15s ease;
}
.sheet {
  width: 100%; max-width: 560px; max-height: 92vh;
  background: var(--bg); border-radius: 20px 20px 0 0;
  display: flex; flex-direction: column;
  animation: up .22s cubic-bezier(.2, .8, .2, 1);
}
@media (min-width: 700px) {
  .sheet-wrap { align-items: center; }
  .sheet { border-radius: 20px; max-height: 88vh; }
}
.sheet-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 14px 16px 10px; border-bottom: 1px solid var(--line);
}
.sheet-head h3 { font-size: 17px; flex: 1; text-align: center; }
.sheet-head .btn { min-width: 72px; }
.sheet-body { padding: 14px 16px calc(18px + var(--safe-b)); overflow-y: auto; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } }

.fieldset { background: var(--card); border-radius: 14px; margin-bottom: 14px; overflow: hidden; box-shadow: var(--shadow); }
.field {
  display: flex; align-items: center; gap: 12px; min-height: 46px;
  padding: 6px 14px; border-bottom: 1px solid var(--line);
}
.field:last-child { border-bottom: 0; }
.field > span:first-child { width: 110px; flex: none; color: var(--muted); font-size: 14px; }
.field input, .field select, .field textarea {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: none; padding: 6px 0; font-size: 16px; text-align: right;
}
.field select { text-align-last: right; cursor: pointer; }
.field input[type="checkbox"] { flex: none; width: 22px; height: 22px; accent-color: var(--accent); }
.field.col { flex-direction: column; align-items: stretch; }
.field.col > span:first-child { width: auto; padding-top: 6px; }
.field textarea { text-align: left; resize: vertical; min-height: 60px; }
.toggle-row { justify-content: space-between; }
.amount-box {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--card); border-radius: 14px; padding: 12px 14px; margin: 12px 0 14px; box-shadow: var(--shadow);
}
.amount-box .cur { font-size: 22px; color: var(--muted); font-weight: 600; }
.amount-box input {
  border: 0; background: transparent; outline: none; font-size: 36px; font-weight: 800;
  width: 100%; text-align: center; letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}
.amount-box.expense input { color: var(--red); }
.amount-box.income input { color: var(--green); }
.catgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; padding: 10px; }
.catgrid button {
  border: 1.5px solid transparent; background: var(--card2); border-radius: 12px;
  padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 11.5px; line-height: 1.15; text-align: center; min-height: 64px;
}
.catgrid button .em { font-size: 22px; }
.catgrid button.on { border-color: var(--accent); background: var(--accent-soft); }
.split-row { display: flex; gap: 8px; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.split-row select, .split-row input { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: var(--card2); }
.split-row select { flex: 1; min-width: 0; }
.split-row input { width: 100px; text-align: right; }
.receipt-thumb { max-width: 100%; max-height: 220px; border-radius: 10px; display: block; margin: 8px auto; cursor: zoom-in; }
.sheet-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.sheet-actions .btn { flex: 1; padding: 12px; }
.emoji-input { width: 54px !important; flex: none !important; text-align: center !important; font-size: 22px !important; }
.color-dots { display: flex; gap: 8px; flex-wrap: wrap; padding: 8px 0; justify-content: flex-end; }
.color-dots button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; }
.color-dots button.on { border-color: var(--text); }

/* ---------- Charts ---------- */
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--muted); font-size: 11px; }
.chart .grid line { stroke: var(--line); }
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut-wrap .chart { width: 180px; flex: none; margin: 0 auto; }
.donut-wrap .legend { flex: 1; min-width: 200px; }
.legend-item { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 14px; cursor: pointer; }
.legend-item i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend-item .n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-key { display: flex; gap: 14px; font-size: 13px; color: var(--muted); margin-top: 8px; flex-wrap: wrap; }
.legend-key i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: right; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.tbl tr:last-child td { border-bottom: 0; }
.scroll-x { overflow-x: auto; }

/* ---------- Calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dow { text-align: center; font-size: 11px; color: var(--muted); font-weight: 600; padding-bottom: 4px; }
.cal .d {
  min-height: 62px; font-size: 10.5px !important; border-radius: 10px; background: var(--card2); padding: 4px 5px;
  font-size: 11px; cursor: pointer; display: flex; flex-direction: column; overflow: hidden;
  border: 1.5px solid transparent;
}
.cal .d.out { opacity: .35; }
.cal .d.today .dn { background: var(--accent); color: #fff; border-radius: 99px; padding: 0 6px; }
.cal .d.sel { border-color: var(--accent); }
.cal .dn { font-weight: 700; font-size: 12px; align-self: flex-start; }
.cal .d .e { color: var(--red); margin-top: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cal .d .i { color: var(--green); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cal .d .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); display: inline-block; margin-left: 3px; }

/* ---------- Toast / lock / welcome ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(150px + var(--safe-b)); transform: translateX(-50%) translateY(20px);
  background: #1f2430; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 80; max-width: 90vw; text-align: center;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
}
#toast.show { opacity: 1; transform: translateX(-50%); }
#lock {
  position: fixed; inset: 0; z-index: 100; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
}
#lock[hidden] { display: none; }
.pin-dots { display: flex; gap: 14px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--accent); }
.pin-dots i.f { background: var(--accent); }
.pin-dots.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 76px); gap: 14px; }
.keypad button {
  height: 76px; border-radius: 50%; border: 0; background: var(--card); box-shadow: var(--shadow);
  font-size: 28px; font-weight: 500;
}
.keypad button.blank { visibility: hidden; }
.keypad button.txt { font-size: 15px; background: none; box-shadow: none; color: var(--accent); }
.welcome { max-width: 440px; margin: 8vh auto 0; text-align: center; }
.welcome img { width: 84px; height: 84px; }
.welcome h1 { font-size: 30px; margin: 14px 0 6px; }
.welcome p { color: var(--muted); margin: 0 0 24px; }
.welcome .fieldset { text-align: left; }
.welcome .btn { margin-bottom: 10px; }
body.no-chrome .tabbar, body.no-chrome .fab, body.no-chrome .sidebar { display: none; }
body.no-chrome #main { margin-left: auto; }

.banner {
  display: flex; align-items: center; gap: 10px;
  background: color-mix(in srgb, var(--amber) 16%, var(--card)); border-radius: 14px; padding: 12px 14px; margin-bottom: 14px;
  font-size: 14px; cursor: pointer;
}
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: var(--card2); color: var(--muted); vertical-align: 1px; }
.badge.red { background: color-mix(in srgb, var(--red) 15%, transparent); color: var(--red); }
.badge.amber { background: color-mix(in srgb, var(--amber) 18%, transparent); color: color-mix(in srgb, var(--amber) 70%, var(--text)); }
.badge.green { background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--green); }
.ring { position: relative; width: 64px; height: 64px; flex: none; }
.ring svg { width: 64px; height: 64px; transform: rotate(-90deg); }
.ring span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.goal-card { display: flex; gap: 14px; align-items: center; }
.goal-card .main { flex: 1; min-width: 0; }
.goal-card .title { font-weight: 700; font-size: 16px; }
.more-list .row .chev { color: var(--muted); font-size: 18px; }
.img-viewer { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .9); display: flex; align-items: center; justify-content: center; }
.img-viewer img { max-width: 96vw; max-height: 92vh; }

/* ---------- fixes & additions ---------- */
.hidden { display: none !important; }
/* iPhone Safari zooms into any input smaller than 16px — keep them at 16px on phones */
@media (max-width: 899px) {
  .search, .pill-select, .split-row input, .split-row select, .field input, .field select { font-size: 16px; }
}
/* Safari: right-align date values like the other fields */
.field input[type="date"] { min-height: 34px; -webkit-appearance: none; appearance: none; }
.field input::-webkit-date-and-time-value { text-align: right; }
.field > span.note { width: auto; flex: 1; white-space: normal; }
.vh.compact h1 { font-size: 24px; }
@media (max-width: 899px) { .vh h1 { font-size: 28px; } .vh.compact h1 { font-size: 21px; } }
.icon-btn:disabled { opacity: .3; }
.row .icon-btn { box-shadow: none; background: var(--card2); flex: none; }

/* logos */
.ico { overflow: hidden; }
.ico img.logo, .pv-logo img.logo { width: 100%; height: 100%; object-fit: contain; background: #fff; display: block; }
.ico.sm { width: 30px; height: 30px; font-size: 15px; }
.pv-logo { width: 28px; height: 28px; flex: none; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 1px var(--line); }
.pv-logo:empty { display: none; }

/* payee suggestions */
.suggest { border-top: 1px solid var(--line); max-height: 280px; overflow-y: auto; }
.sug {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 14px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left;
}
.sug:last-child { border-bottom: 0; }
.sug:hover, .sug:focus-visible { background: var(--card2); outline: none; }
.sug .main { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#main > p { margin-left: auto !important; margin-right: auto !important; padding-left: 6px; padding-right: 6px; }

/* ---------- line icons ---------- */
.i { width: 20px; height: 20px; display: block; flex: none; }
.ico .i { width: 20px; height: 20px; }
.ico.sm .i { width: 16px; height: 16px; }
.ico.acc { color: var(--accent); background: var(--accent-soft); }
.ico .letter { font-weight: 700; font-size: 16px; color: #fff; line-height: 1; }
.ico.sm .letter { font-size: 13px; }
.i.inline { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; color: var(--muted); }
.btn .i { width: 16px; height: 16px; }
.btn.block .i { width: 18px; height: 18px; }
.empty .e { display: flex; justify-content: center; color: var(--muted); opacity: .5; }
.empty .e .i { width: 44px; height: 44px; stroke-width: 1.4; }
.banner > .i { width: 24px; height: 24px; color: color-mix(in srgb, var(--amber) 80%, var(--text)); }
.ring span .i { width: 24px; height: 24px; }
.gm { display: inline-flex; align-items: center; gap: 8px; }
.gm .ico.sm { width: 24px; height: 24px; }
.gm .ico.sm .i { width: 14px; height: 14px; }
.catgrid button .em { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: inherit; }
.catgrid button .em .i { width: 19px; height: 19px; }
.icon-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; padding: 4px 0 10px; }
.icon-picker button { aspect-ratio: 1; border: 0; border-radius: 50%; background: var(--card2); color: var(--muted); display: flex; align-items: center; justify-content: center; padding: 0; }
.icon-picker button:hover { color: var(--text); }
.icon-picker button.on { background: var(--pc, var(--accent)); color: #fff; }
.icon-picker .i { width: 19px; height: 19px; }
.budget-row .top > .ico.round.sm { width: 28px; height: 28px; }
.ring span svg { transform: none; width: 24px; height: 24px; }

/* ---------- sign in ---------- */
#auth { position: fixed; inset: 0; z-index: 110; background: var(--bg); overflow-y: auto; display: flex; justify-content: center; align-items: flex-start; padding: max(8vh, env(safe-area-inset-top)) 16px 32px; }
.auth-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.auth-card h1 { margin: 10px 0 2px; font-size: 26px; }
.auth-card > p { margin: 0 0 18px; }
.auth-card .fieldset { width: 100%; text-align: left; }
.auth-card .btn.block { width: 100%; justify-content: center; margin-top: 8px; padding: 12px; }
.auth-msg { width: 100%; padding: 10px 12px; margin-bottom: 12px; border-radius: 12px; background: var(--card); font-size: 14px; }
.auth-msg.err { background: color-mix(in srgb, var(--red) 14%, var(--card)); color: var(--red); }
.invite-new { padding: 16px; margin-bottom: 14px; text-align: center; }
.invite-code { font: 700 22px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 1px; margin: 10px 0 6px; user-select: all; }
.invite-link { word-break: break-all; user-select: all; margin-bottom: 4px; }
