/* Pane: iOS-style layout with a Liquid Glass look.
   Colours are tokens on :root; dark mode swaps them, and html.solid turns the glass opaque. */

:root {
  --accent: #0a84ff;
  /* Fills use --accent; text and buttons use darker/lighter shades that pass WCAG AA on glass.
     app.js sets all three for the chosen accent colour. */
  --accent-strong: var(--accent-strong-c, #0066d6);
  --accent-text: var(--accent-text-l, #0058c4);
  --bg: #e9ecf5;
  --text: #0b0b0f;
  --text2: #46464e;
  --text3: #75757d;
  --text-wall: #36363e; /* secondary text placed directly on the wallpaper */
  --control-edge: #66666e; /* 1px edge that makes fields, switches and selections visible on glass */
  --switch-on: #248a3d;
  --switch-off: #78787f;
  --tick-fill: var(--accent-strong);
  --sep: rgba(60, 60, 67, .16);
  --fill: rgba(120, 120, 128, .12);
  --danger: #c00013;
  --positive: #1a7f44;
  --blob-opacity: .85;

  --glass-bg: rgba(255, 255, 255, .58);
  --glass-border: rgba(255, 255, 255, .65);
  --glass-hi: rgba(255, 255, 255, .95);
  --glass-lo: rgba(255, 255, 255, .2);
  --glass-shadow: rgba(30, 40, 90, .14);
  --glass-solid: #f7f8fc;
  --lens: rgba(255, 255, 255, .7);
  --blur: 22px;

  --blob1: #7aa7ff; --blob2: #ff9ad5; --blob3: #ffd27a; --blob4: #8ff0d2;

  --spring: cubic-bezier(.3, 1.35, .5, 1);
  --ease: cubic-bezier(.25, .8, .25, 1);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #07070b;
    --text: #f5f5f7;
    --text2: #c2c2ca;
    --text3: #9a9aa2;
    --text-wall: #d6d6de;
    --control-edge: #96969e;
    --switch-on: #2f9e4c;
    --switch-off: #808088;
    --tick-fill: color-mix(in srgb, var(--accent-strong) 70%, #fff);
    --accent-text: var(--accent-text-d, #7ab8ff);
    --sep: rgba(84, 84, 88, .55);
    --fill: rgba(118, 118, 128, .24);
    --danger: #ff6961;
    --positive: #4ade80;
    --blob-opacity: .6;
    --glass-bg: rgba(28, 28, 34, .58);
    --glass-border: rgba(255, 255, 255, .14);
    --glass-hi: rgba(255, 255, 255, .24);
    --glass-lo: rgba(0, 0, 0, .25);
    --glass-shadow: rgba(0, 0, 0, .4);
    --glass-solid: #1c1c22;
    --lens: rgba(0, 0, 0, .32);
    --blob1: #2546b8; --blob2: #8a2a6e; --blob3: #8a5a12; --blob4: #0f6e5a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #07070b;
  --text: #f5f5f7;
  --text2: #c2c2ca;
  --text3: #9a9aa2;
  --text-wall: #d6d6de;
  --control-edge: #96969e;
  --switch-on: #2f9e4c;
  --switch-off: #808088;
  --tick-fill: color-mix(in srgb, var(--accent-strong) 70%, #fff);
  --accent-text: var(--accent-text-d, #7ab8ff);
  --sep: rgba(84, 84, 88, .55);
  --fill: rgba(118, 118, 128, .24);
  --danger: #ff6961;
  --positive: #4ade80;
  --blob-opacity: .6;
  --glass-bg: rgba(28, 28, 34, .58);
  --glass-border: rgba(255, 255, 255, .14);
  --glass-hi: rgba(255, 255, 255, .24);
  --glass-lo: rgba(0, 0, 0, .25);
  --glass-shadow: rgba(0, 0, 0, .4);
  --glass-solid: #1c1c22;
  --lens: rgba(0, 0, 0, .32);
  --blob1: #2546b8; --blob2: #8a2a6e; --blob3: #8a5a12; --blob4: #0f6e5a;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 17px/1.3 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button, input, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

/* ---------- wallpaper ---------- */
.wallpaper { position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.blob { position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%; filter: blur(60px); opacity: var(--blob-opacity); }
.b1 { background: var(--blob1); top: -30vmax; left: -25vmax; animation: drift1 26s ease-in-out infinite alternate; }
.b2 { background: var(--blob2); top: 10vmax; right: -35vmax; animation: drift2 31s ease-in-out infinite alternate; }
.b3 { background: var(--blob3); bottom: -35vmax; left: -10vmax; animation: drift3 28s ease-in-out infinite alternate; }
.b4 { background: var(--blob4); bottom: -20vmax; right: -30vmax; width: 50vmax; height: 50vmax; animation: drift1 35s ease-in-out infinite alternate-reverse; }
@keyframes drift1 { to { transform: translate(18vmax, 14vmax) scale(1.1); } }
@keyframes drift2 { to { transform: translate(-20vmax, 10vmax) scale(.9); } }
@keyframes drift3 { to { transform: translate(14vmax, -16vmax) scale(1.15); } }
html.still .blob { animation: none; }
@media (prefers-reduced-motion: reduce) { .blob { animation: none; } }

/* ---------- glass ---------- */
.glass {
  position: relative;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(190%);
  backdrop-filter: blur(var(--blur)) saturate(190%);
  border: 1px solid var(--glass-border);
  box-shadow:
    inset 0 1px 0 var(--glass-hi),
    inset 0 -1px 1px var(--glass-lo),
    0 10px 30px -8px var(--glass-shadow);
}
/* Specular sheen across the top-left edge */
.glass::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,.32) 0%, rgba(255,255,255,0) 38%, rgba(255,255,255,0) 70%, rgba(255,255,255,.12) 100%);
  pointer-events: none;
  mix-blend-mode: overlay;
}
html.solid .glass { background: var(--glass-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
html.solid .glass::before { display: none; }

/* ---------- nav bar ---------- */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  padding-top: var(--safe-t);
  transition: background .25s var(--ease), box-shadow .25s var(--ease);
}
.navbar.scrolled {
  background: linear-gradient(var(--glass-bg), var(--glass-bg));
  -webkit-backdrop-filter: blur(var(--blur)) saturate(190%);
  backdrop-filter: blur(var(--blur)) saturate(190%);
  box-shadow: 0 1px 0 var(--sep);
}
html.solid .navbar.scrolled { background: var(--glass-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
.nav-inner {
  max-width: 560px; margin: 0 auto; height: 56px; padding: 0 16px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
}
.nav-side.right { justify-self: end; }
.nav-title { font-weight: 600; opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s var(--ease); }
.navbar.scrolled .nav-title { opacity: 1; transform: none; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; color: var(--accent-text);
  transition: transform .3s var(--spring);
}
.icon-btn:active { transform: scale(.88); }
.icon-btn svg { width: 22px; height: 22px; stroke-width: 2.4; }

/* ---------- layout ---------- */
.app {
  position: relative; z-index: 1;
  max-width: 560px; margin: 0 auto;
  padding: calc(var(--safe-t) + 56px) 16px calc(var(--safe-b) + 120px);
}
.view { animation: viewIn .35s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }
.large-title { font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: .01em; margin: 4px 4px 2px; }
.subtitle { margin: 0 4px 18px; color: var(--text-wall); font-size: 15px; }
.view[data-view="tasks"] .large-title,
.view[data-view="search"] .large-title,
.view[data-view="settings"] .large-title { margin-bottom: 16px; }
.section-h { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-wall); margin: 26px 20px 8px; }
.footnote { font-size: 13px; color: var(--text-wall); margin: 10px 20px; }

.card { border-radius: 26px; padding: 18px; }
.hero { display: flex; align-items: center; gap: 18px; }
.ring { width: 80px; height: 80px; flex: none; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring-track { stroke: var(--fill); }
.ring-fill { stroke: var(--accent-text); stroke-linecap: round; stroke-dasharray: 213.6; stroke-dashoffset: 213.6; transition: stroke-dashoffset .8s var(--ease); }
.hero-label { font-size: 13px; font-weight: 600; color: var(--accent-text); }
.hero-big { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.hero-sub { color: var(--text2); font-size: 15px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.tile-label { font-size: 13px; font-weight: 600; color: var(--accent-text); }
.tile-value { font-size: 26px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
.tile-sub { font-size: 13px; color: var(--text2); }

/* ---------- lists ---------- */
.list { border-radius: 26px; overflow: hidden; }
.list:empty { display: none; }
.row {
  position: relative; width: 100%; text-align: left;
  display: flex; align-items: center; gap: 12px;
  min-height: 52px; padding: 10px 16px;
}
.row:not(:last-child)::after {
  content: ""; position: absolute; left: 16px; right: 0; bottom: 0; height: 1px;
  background: var(--sep); transform: scaleY(.6);
}
.row.fund-row:not(:last-child)::after { left: 64px; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 17px; }
.row-sub { font-size: 13px; color: var(--text2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.action { justify-content: center; }
.row.action:active, .row.fund-row:active, .row.entry:active { opacity: .55; }
.row.fund-row { cursor: pointer; }
.row.solo { border-radius: 26px; margin-top: 16px; }
.row.wrap { flex-direction: column; align-items: stretch; gap: 10px; padding-top: 14px; padding-bottom: 12px; }
.danger { color: var(--danger); }
.empty-row { padding: 22px 16px; text-align: center; color: var(--text2); font-size: 15px; }
.row-value { color: var(--text2); font-variant-numeric: tabular-nums; }
.row-tag { font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--fill); color: var(--text2); }
.row-tag.warn { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }
.amt { font-weight: 600; font-variant-numeric: tabular-nums; }
.amt.pos { color: var(--positive); }
.amt.neg { color: var(--danger); }

/* Emoji in a tinted rounded square, like Wallet pass icons */
.fchip {
  flex: none; width: 36px; height: 36px; border-radius: 11px;
  display: grid; place-items: center; font-size: 19px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--c) 85%, #fff 15%), var(--c));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 3px 8px -3px var(--c);
}
.add-pill {
  flex: none; height: 32px; padding: 0 12px; border-radius: 999px;
  font-size: 14px; font-weight: 600; color: var(--accent-text); font-variant-numeric: tabular-nums;
  transition: transform .3s var(--spring);
}
.add-pill:active { transform: scale(.9); }

/* ---------- wallet cards ---------- */
.wallet { display: flex; flex-direction: column; padding-bottom: 8px; }
.wcard {
  position: relative; display: block; width: 100%; text-align: left;
  height: 196px; padding: 18px 20px; border-radius: 26px; overflow: hidden;
  color: #fff;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(255,255,255,.16), rgba(255,255,255,0) 50%),
    linear-gradient(150deg, color-mix(in srgb, var(--c) 96%, transparent), color-mix(in srgb, var(--c) 90%, #000 10%));
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid rgba(255,255,255,.38);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 -1px 1px rgba(0,0,0,.12), 0 -6px 22px -10px rgba(0,0,0,.35), 0 16px 34px -14px color-mix(in srgb, var(--c) 70%, #000);
  text-shadow: 0 1px 2px rgba(0,0,0,.18);
  transition: transform .45s var(--spring);
}
html.solid .wcard { background: linear-gradient(150deg, var(--c), color-mix(in srgb, var(--c) 75%, #000)); -webkit-backdrop-filter: none; backdrop-filter: none; }
/* Wallet stack: each card tucks under the next, showing its top strip */
.wallet .wcard + .wcard { margin-top: -130px; }
.wallet .wcard:active { transform: translateY(-8px) scale(.99); }
@media (hover: hover) { .wallet .wcard:hover { transform: translateY(-8px); } }
.wcard-top { display: flex; align-items: center; gap: 10px; height: 34px; }
.wcard-emoji { font-size: 24px; text-shadow: none; }
.wcard-name { flex: 1; min-width: 0; font-size: 18px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wcard-saved { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.wcard-mid { margin-top: 16px; font-size: 14px; opacity: .95; text-align: right; }
.wcard-bar { margin-top: 26px; height: 8px; border-radius: 4px; background: rgba(0,0,0,.3); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255,255,255,.8); }
.wcard-bar span { display: block; height: 100%; border-radius: inherit; background: #fff; box-shadow: 0 0 10px rgba(255,255,255,.7); transition: width .8s var(--ease); }
.wcard-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.wcard-foot span:last-child { opacity: .92; }
.sheet-body > .wcard, #fundPreview .wcard { margin-bottom: 14px; }

.action-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.pill-btn.big { height: 48px; justify-self: stretch; font-size: 16px; font-weight: 600; }
.pill-btn.end { justify-self: end; }

/* ---------- fund form & money entry ---------- */
.inline-input {
  border: 0; outline: 0; background: none; text-align: right; font-size: 17px;
  color: var(--accent-text); min-width: 0; width: 150px; font-variant-numeric: tabular-nums;
}
.inline-input::placeholder { color: var(--text2); }
.inline-input[type="month"] { width: auto; font: inherit; color: var(--accent-text); }
.emoji-row { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; }
.emoji-btn { aspect-ratio: 1; border-radius: 12px; font-size: 22px; display: grid; place-items: center; transition: transform .3s var(--spring), background .2s; }
.emoji-btn[aria-pressed="true"] { background: var(--lens); box-shadow: inset 0 0 0 2px var(--accent); }
.emoji-btn:active { transform: scale(.85); }
.hint { margin: 12px 8px 0; font-size: 14px; color: var(--text2); text-align: center; }
.select {
  appearance: none; -webkit-appearance: none;
  border: 0; outline: 0; font-size: 17px; color: var(--text2); cursor: pointer;
  text-align: right; text-align-last: right; min-width: 0; max-width: 60%;
  padding: 4px 20px 4px 0; text-overflow: ellipsis;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") right center / 14px no-repeat;
}
.select option { color: initial; }
.money-fund { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 600; margin: 6px 0 4px; }
.amount-input {
  width: 100%; border: 0; outline: 0; background: none; text-align: center;
  font-size: 56px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums;
  padding: 6px 0; color: var(--text);
}
.amount-input::placeholder { color: var(--text2); }
.amount-input.over { color: var(--danger); }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 4px 0 16px; }
.chip-btn { height: 34px; padding: 0 14px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--accent-text); transition: transform .3s var(--spring); }
.chip-btn:active { transform: scale(.9); }
.sheet.behind { transform: scale(.94) translateY(-14px) !important; filter: brightness(.85); }

/* ---------- controls ---------- */
.segmented {
  position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding: 3px; border-radius: 999px; margin-bottom: 14px;
}
.segmented.small { background: var(--fill); margin: 0; flex: none; box-shadow: inset 0 0 0 1px var(--control-edge); }
.segmented button { position: relative; z-index: 1; height: 34px; padding: 0 14px; border-radius: 999px; font-size: 15px; font-weight: 500; color: var(--text2); transition: color .2s; }
.segmented.small button { height: 28px; padding: 0 12px; font-size: 13px; }
.segmented button[aria-pressed="true"] { color: var(--text); font-weight: 600; }
.seg-thumb {
  position: absolute; top: 3px; bottom: 3px; left: 0; border-radius: 999px;
  background: var(--lens);
  box-shadow: 0 3px 10px rgba(0,0,0,.12), inset 0 0 0 1px var(--control-edge);
  transition: transform .45s var(--spring), width .45s var(--spring);
}

.switch {
  appearance: none; -webkit-appearance: none; flex: none; margin: 0;
  width: 51px; height: 31px; border-radius: 999px; background: var(--switch-off);
  position: relative; cursor: pointer; transition: background .25s;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.18), 0 1px 1px rgba(0,0,0,.12);
  transition: transform .35s var(--spring), width .2s;
}
.switch:active::after { width: 33px; }
.switch:checked { background: var(--switch-on); }
.switch:checked::after { transform: translateX(20px); }
.switch:checked:active::after { transform: translateX(14px); }

.swatches { display: flex; gap: 8px; }
.swatch { width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--control-edge); transition: transform .3s var(--spring); }
.swatch[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--control-edge), 0 0 0 2px var(--bg), 0 0 0 4px var(--text); }
.swatch:active { transform: scale(.85); }

.search-field { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px; border-radius: 999px; margin-bottom: 14px; color: var(--text2); border-color: var(--control-edge); }
.search-field svg { width: 20px; height: 20px; }
.search-field input { flex: 1; border: 0; outline: 0; background: none; font-size: 17px; color: var(--text); min-width: 0; }
.search-field input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; z-index: 30; left: 0; right: 0;
  bottom: calc(var(--safe-b) + 14px);
  max-width: 560px; margin: 0 auto; padding: 0 16px;
  display: flex; gap: 10px; align-items: center;
}
.tab-group { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); height: 64px; padding: 4px; border-radius: 999px; }
.tab {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 10px; font-weight: 600; color: var(--text);
  border-radius: 999px; transition: color .2s, transform .3s var(--spring);
}
.tab svg { width: 24px; height: 24px; }
.tab:active { transform: scale(.9); }
.tab.active { color: var(--accent-text); }
:root[data-theme="dark"] .tab.active, :root[data-theme="dark"] .tab-search.active { color: color-mix(in srgb, var(--accent-text) 60%, #fff); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tab.active, :root:not([data-theme="light"]) .tab-search.active { color: color-mix(in srgb, var(--accent-text) 60%, #fff); }
}
.tab-lens {
  position: absolute; top: 4px; bottom: 4px; left: 0; border-radius: 999px;
  background: var(--lens);
  box-shadow: inset 0 0 0 1px var(--control-edge), 0 2px 10px rgba(0,0,0,.08);
  transition: transform .5s var(--spring), width .5s var(--spring);
}
.tab-search { flex: none; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; transition: color .2s, transform .3s var(--spring); }
.tab-search:active { transform: scale(.9); }
.tab-search.active { color: var(--accent-text); }

/* ---------- sheet ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.28); animation: fadeIn .3s var(--ease); }
.scrim.out { animation: fadeOut .25s var(--ease) forwards; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
.sheet {
  position: fixed; z-index: 50;
  left: 8px; right: 8px; bottom: calc(var(--safe-b) + 8px);
  max-width: 560px; margin: 0 auto; max-height: calc(100% - var(--safe-t) - 40px); overflow: auto;
  border-radius: 34px; padding: 0 16px 18px;
  --glass-bg: rgba(255,255,255,.62);
  transform: translateY(calc(100% + 40px));
  transition: transform .5s var(--spring);
}
:root[data-theme="dark"] .sheet { --glass-bg: rgba(30,30,36,.66); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sheet { --glass-bg: rgba(30,30,36,.66); } }
.sheet.open { transform: none; }
.sheet.dragging { transition: none; }
.sheet-grab { height: 22px; display: grid; place-items: center; cursor: grab; touch-action: none; }
.sheet-grab span { width: 38px; height: 5px; border-radius: 3px; background: var(--text3); }
.sheet-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-bottom: 14px; touch-action: none; }
.sheet-head h3 { margin: 0; font-size: 17px; font-weight: 600; }
.pill-btn { height: 40px; padding: 0 16px; border-radius: 999px; font-weight: 500; justify-self: start; transition: transform .3s var(--spring), opacity .2s; }
.pill-btn:active { transform: scale(.92); }
.pill-btn.primary { background: var(--accent-strong); color: #fff; font-weight: 600; box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 6px 16px -6px var(--accent-strong); }
.pill-btn:disabled { opacity: .4; }
.fields { display: grid; gap: 10px; margin-bottom: 14px; }
.field { width: 100%; border: 0; outline: 0; border-radius: 18px; padding: 14px 16px; background: var(--fill); font-size: 17px; resize: none; box-shadow: inset 0 0 0 1px var(--control-edge); }
.field:focus { box-shadow: 0 0 0 2px var(--accent); }
/* Placeholders double as labels on a few fields, so they get full text contrast. */
input::placeholder, textarea::placeholder { color: var(--text2); opacity: 1; }
.list.inner { box-shadow: none; }

/* ---------- alert ---------- */
.alert-wrap { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(0,0,0,.25); padding: 24px; animation: fadeIn .2s; }
.alert { width: min(300px, 100%); border-radius: 30px; padding: 22px 18px 16px; text-align: center; animation: pop .4s var(--spring); --glass-bg: rgba(255,255,255,.7); }
:root[data-theme="dark"] .alert { --glass-bg: rgba(40,40,46,.72); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .alert { --glass-bg: rgba(40,40,46,.72); } }
@keyframes pop { from { opacity: 0; transform: scale(1.12); } }
.alert h3 { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.alert p { margin: 0 0 18px; font-size: 14px; color: var(--text2); }
.alert-actions { display: grid; grid-auto-flow: column; gap: 8px; }
.alert-actions button { height: 46px; border-radius: 999px; background: var(--fill); font-weight: 600; transition: transform .3s var(--spring); }
.alert-actions button:active { transform: scale(.94); }
.alert-actions .destructive { background: var(--danger); color: #fff; }

/* ---------- toast ---------- */
.toast {
  position: fixed; z-index: 70; left: 50%; top: calc(var(--safe-t) + 10px);
  padding: 12px 20px; border-radius: 999px; font-size: 15px; font-weight: 600;
  transform: translate(-50%, -140%); transition: transform .5s var(--spring);
  white-space: nowrap; pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); }

@media (min-width: 700px) {
  .app { padding-top: calc(var(--safe-t) + 72px); }
}

/* ---------- find my bills ---------- */
.promo {
  display: flex; align-items: center; gap: 14px; width: 100%; margin-top: 12px;
  text-align: left; padding: 16px 18px; transition: transform .3s var(--spring);
}
.promo:active { transform: scale(.98); }
.promo-icon {
  flex: none; width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 22px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 80%, #fff 20%), var(--accent));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 4px 10px -4px var(--accent);
}
.promo-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.promo-title { font-weight: 600; }
.promo-sub { font-size: 13px; color: var(--text2); }
.chev { width: 18px; height: 18px; color: var(--text3); flex: none; }
.accent { color: var(--accent-text); }
.scan-link { margin-top: 18px; }

.scan-hero { font-size: 46px; text-align: center; margin: 4px 0 6px; }
.scan-lead { text-align: center; color: var(--text2); margin: 0 6px 18px; font-size: 16px; }
.scan-actions { display: grid; gap: 10px; margin-bottom: 16px; }
.file-btn { position: relative; display: grid; place-items: center; cursor: pointer; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-btn:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 40%, transparent); }
.tips .row { align-items: flex-start; }
.tip-icon { font-size: 20px; width: 28px; text-align: center; flex: none; padding-top: 1px; }
.row-sub.wrap { white-space: normal; }
.row-sub.dim { color: var(--text2); font-size: 12px; }
.one-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.scan-summary { margin: 2px 6px 6px; font-size: 15px; color: var(--text2); text-align: center; }
#scanSheet .select { max-width: 55%; font-size: 16px; color: var(--accent-text); }
#scanSheet .hint { margin: 0 0 14px; }
#signSeg button { font-variant-numeric: tabular-nums; }

.row.sugg { align-items: flex-start; cursor: pointer; }
.row.sugg:not(:last-child)::after { left: 100px; }
.row.sugg .fchip { margin-top: 2px; }
.sugg-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.sugg-amt { font-weight: 700; font-variant-numeric: tabular-nums; flex: none; }
.tick {
  appearance: none; -webkit-appearance: none; flex: none; margin: 8px 0 0;
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--control-edge); cursor: pointer;
  transition: background-color .2s, border-color .2s, transform .3s var(--spring);
}
.tick:checked {
  border-color: var(--tick-fill);
  background: var(--tick-fill) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4L18 8'/%3E%3C/svg%3E") center / 16px no-repeat;
}
.tick:active { transform: scale(.85); }

/* ---------- sign in ---------- */
.pill-btn.wide { width: 100%; }
#authSheet .field { margin-bottom: 12px; text-align: center; }
.code-input { font-size: 30px; letter-spacing: .35em; font-weight: 700; font-variant-numeric: tabular-nums; padding-left: calc(16px + .35em); }
.auth-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; }
.link-btn { color: var(--accent-text); font-size: 15px; font-weight: 500; padding: 8px 4px; }
.link-btn:disabled { color: var(--text3); }
#syncList .row-value.one-line { max-width: 60%; }
#syncList .row:disabled { opacity: .5; }

/* ---------- keyboard focus & motion ---------- */
:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; }
/* Rows sit inside rounded lists that clip overflow, so their ring goes inside. */
.row:focus-visible { outline-offset: -3px; border-radius: 14px; }
.field:focus-visible, .inline-input:focus-visible, .select:focus-visible, .amount-input:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; }
.search-field:focus-within { outline: 3px solid var(--accent-text); outline-offset: 2px; }
.search-field input:focus-visible { outline: 0; }
.wallet .wcard:focus-visible { outline-offset: 3px; transform: translateY(-8px); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ---------- Pro ---------- */
.pro-hero { display: grid; place-items: center; margin: 2px 0 8px; }
.pro-hero img { border-radius: 18px; box-shadow: 0 10px 24px -10px rgba(60, 40, 140, .5); }
.perks { margin-bottom: 14px; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.plan {
  position: relative; display: flex; flex-direction: column; gap: 2px; text-align: left;
  padding: 16px 14px 14px; border-radius: 22px; transition: transform .3s var(--spring);
}
.plan:active { transform: scale(.97); }
.plan[aria-checked="true"] { box-shadow: inset 0 0 0 2.5px var(--accent-strong), 0 10px 26px -12px var(--glass-shadow); }
.plan-name { font-size: 15px; font-weight: 600; color: var(--text2); }
.plan-price { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.plan-price small { font-size: 14px; font-weight: 600; color: var(--text2); }
.plan-sub { font-size: 13px; color: var(--text2); }
.plan-badge {
  position: absolute; top: -9px; right: 12px; padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; color: #fff; background: var(--accent-strong);
}
