/* Finch — personal finance dashboard */

:root {
  color-scheme: light;
  --page: #ffffff;
  --sidebar-bg: #f7f7f5;
  --surface: #ffffff;
  --surface-2: #f4f5f6;
  --surface-3: #fafafa;
  --ink: #16181d;
  --ink-2: #5c6470;
  --ink-3: #8b929c;
  --hairline: #e8e9ec;
  --grid: #f0f1f3;
  --baseline: #d8dade;
  --accent: #f4732a;
  --accent-ink: #ffffff;
  --accent-soft: #fdf0e8;
  --pos: #12874a;
  --neg: #cc3d3d;
  --focus: #2a78d6;
  --link: #1a7fb5;
  --chart-line: #2a78d6;
  /* categorical slots (validated, light) */
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --s5: #e87ba4; --s6: #008300; --s7: #4a3aa7; --s8: #e34948;
  --income: #1baf7a;
  --expense: #eb6834;
  --savings: #0ca30c;
  --shadow: 0 1px 2px rgba(22, 24, 29, 0.04), 0 2px 10px rgba(22, 24, 29, 0.05);
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #101418;
    --sidebar-bg: #141920;
    --surface: #1a2028;
    --surface-2: #232b35;
    --surface-3: #161c23;
    --ink: #eef1f4;
    --ink-2: #a8b2be;
    --ink-3: #79838f;
    --hairline: #28313b;
    --grid: #222a33;
    --baseline: #36404b;
    --accent: #f4823f;
    --accent-soft: #33221a;
    --pos: #35b86e;
    --neg: #e66767;
    --link: #5cb3e0;
    --chart-line: #3987e5;
    /* categorical slots (validated, dark) */
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
    --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
    --income: #199e70;
    --expense: #d95926;
    --savings: #0ca30c;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 10px rgba(0, 0, 0, 0.22);
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--page);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
.hidden { display: none !important; }
button { font: inherit; cursor: pointer; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
a { color: var(--link); text-decoration: none; }
.ic { display: block; }
.ic-wrap { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* --------------------------------- auth --------------------------------- */
.auth-screen {
  min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  background: var(--sidebar-bg); padding: 24px;
}
.auth-card {
  width: 100%; max-width: 360px; background: var(--surface);
  border: 1px solid var(--hairline); border-radius: 20px;
  padding: 36px 28px; text-align: center; box-shadow: var(--shadow);
}
.auth-logo { margin-bottom: 14px; display: flex; justify-content: center; }
.auth-card h1 { font-size: 22px; letter-spacing: -0.01em; }
.auth-sub { color: var(--ink-2); margin: 6px 0 22px; font-size: 14px; }
.auth-card input {
  width: 100%; padding: 12px 14px; margin-bottom: 12px;
  border: 1px solid var(--hairline); border-radius: 10px;
  background: var(--surface-3); font-size: 16px;
}
.auth-card input:focus { outline: 2px solid var(--focus); outline-offset: -1px; }
.auth-error { color: var(--neg); font-size: 13px; margin-bottom: 12px; }

/* -------------------------------- layout -------------------------------- */
.app { min-height: 100dvh; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: stretch;
  border-bottom: 1px solid var(--hairline);
  background: var(--page);
  position: sticky; top: 0; z-index: 30;
  min-height: 58px;
  padding-top: env(safe-area-inset-top);
}
.topbar-left {
  width: 232px; flex-shrink: 0;
  display: flex; align-items: center; gap: 4px;
  padding: 0 12px 0 18px;
  border-right: 1px solid var(--hairline);
}
.brand { display: flex; align-items: center; color: var(--accent); }
.topbar-tools { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink-2);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

.topbar-main {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 22px;
  padding: 0 20px;
}
.topbar-title { font-size: 19px; font-weight: 700; letter-spacing: -0.015em; flex-shrink: 0; }
.topbar-tabs { display: flex; gap: 20px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.topbar-tabs::-webkit-scrollbar { display: none; }
.topbar-tab {
  border: 0; background: none; padding: 18px 0 16px;
  font-size: 14.5px; font-weight: 600; color: var(--ink-3);
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.topbar-tab:hover { color: var(--ink); }
.topbar-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.body { flex: 1; display: flex; min-height: 0; }

.sidebar {
  width: 232px; flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--hairline);
  display: flex; flex-direction: column;
  padding: 12px 10px calc(12px + env(safe-area-inset-bottom));
  position: sticky; top: 58px; height: calc(100dvh - 58px);
}
.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 1px; overflow-y: auto; }
.sidebar-foot { border-top: 1px solid var(--hairline); padding-top: 8px; margin-top: 8px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 9px 12px; border: 0; border-radius: 9px;
  background: transparent; color: var(--ink-2);
  font-size: 14.5px; font-weight: 500; text-align: left;
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.user-chip { gap: 10px; }
.avatar {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  background: var(--surface-2); color: var(--ink-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.user-chip .chev { margin-left: auto; color: var(--ink-3); }

.main { flex: 1; min-width: 0; padding: 22px 26px 56px; background: var(--page); }

/* mobile chrome */
.tabbar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: var(--surface); border-top: 1px solid var(--hairline);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  justify-content: space-around;
}
.tab-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  border: 0; background: none; color: var(--ink-3);
  font-size: 10.5px; font-weight: 600; padding: 3px 8px; min-width: 56px;
}
.tab-item.active { color: var(--accent); }
.fab {
  display: none;
  position: fixed; right: 16px; bottom: calc(74px + env(safe-area-inset-bottom)); z-index: 41;
  width: 52px; height: 52px; border-radius: 50%; border: 0;
  background: var(--accent); color: var(--accent-ink);
  align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(244, 115, 42, 0.42);
}

@media (max-width: 900px) {
  .sidebar { display: none; }
  .topbar-left { width: auto; border-right: 0; padding: 0 6px 0 14px; }
  .topbar-tools { display: none; }
  .topbar-main { padding: 0 12px; gap: 12px; overflow-x: auto; scrollbar-width: none; }
  .topbar-main::-webkit-scrollbar { display: none; }
  .topbar-title { font-size: 17px; }
  .topbar-tab { padding: 16px 0 14px; font-size: 14px; }
  /* Action buttons shrink to their icons so the bar fits a phone. */
  .topbar-actions .btn { padding: 7px 9px; }
  .topbar-actions .lbl { display: none; }
  .tabbar { display: flex; }
  .fab { display: flex; }
  .main { padding: 16px 14px calc(92px + env(safe-area-inset-bottom)); }
}

/* -------------------------------- pieces -------------------------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h2 { font-size: 20px; letter-spacing: -0.015em; }
.page-head .sub { color: var(--ink-2); font-size: 13px; margin-top: 2px; }

.card {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; margin-bottom: 16px;
}
.card-pad-0 { padding: 0; overflow: hidden; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.card-head .eyebrow { font-size: 11.5px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.07em; }
.card-head h3 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; margin-top: 2px; }
.card-head .tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* minmax(0, …) so a column can shrink below its content's min-width —
   with a bare 1fr, long merchant names blow the grid past the viewport. */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.grid-2 > .card { margin-bottom: 0; }
.grid-side { display: grid; grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr); gap: 16px; margin-bottom: 16px; align-items: start; }
.grid-side > .card { margin-bottom: 0; min-width: 0; }
.grid-2 > * { min-width: 0; }
@media (max-width: 900px) { .grid-2, .grid-side { grid-template-columns: minmax(0, 1fr); } }

/* KPI tiles (top of Reports) */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.kpi {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 12px; text-align: center;
}
.kpi .v { font-size: 23px; font-weight: 700; letter-spacing: -0.02em; }
.kpi .v.pos { color: var(--pos); }
.kpi .v.neg { color: var(--neg); }
.kpi .l { font-size: 11px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.07em; margin-top: 4px; }
@media (max-width: 900px) {
  .kpi-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 12px 8px; }
  .kpi .v { font-size: 18px; }
  .kpi .l { font-size: 9.5px; }
}

.hero-number { font-size: 30px; font-weight: 700; letter-spacing: -0.025em; }
.delta { font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.delta.up { color: var(--pos); }
.delta.down { color: var(--neg); }
.delta .vs { color: var(--ink-3); font-weight: 500; }

/* buttons */
.btn {
  border: 1px solid var(--hairline); border-radius: 9px;
  padding: 7px 13px; font-weight: 600; font-size: 13.5px;
  background: var(--surface); color: var(--ink);
  display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.05); }
.btn-danger { color: var(--neg); border-color: transparent; background: transparent; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-block { width: 100%; padding: 12px; justify-content: center; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }

.seg { display: inline-flex; border: 1px solid var(--hairline); border-radius: 9px; overflow: hidden; }
.seg button {
  border: 0; background: var(--surface); color: var(--ink-2);
  font-size: 12.5px; font-weight: 600; padding: 6px 11px;
  border-right: 1px solid var(--hairline);
}
.seg button:last-child { border-right: 0; }
.seg button.active { background: var(--surface-2); color: var(--ink); }
.seg.icons button { padding: 6px 9px; display: flex; align-items: center; }

/* lists */
.row-list { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 2px; border-bottom: 1px solid var(--hairline); min-height: 50px;
}
.row:last-child { border-bottom: 0; }
.row.clickable { cursor: pointer; }
.row.clickable:hover { background: var(--surface-3); }
.r-icon {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: var(--surface-2); display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.r-main { flex: 1; min-width: 0; }
.r-title { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-sub { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-amt { font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.r-amt .r-sub { text-align: right; font-weight: 400; }
.amt-pos { color: var(--pos); }
.chev { color: var(--ink-3); display: flex; }

.date-group {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; font-weight: 600; color: var(--ink-2);
  background: var(--surface-3); border-bottom: 1px solid var(--hairline);
  padding: 7px 14px; margin: 0 -18px;
}
.card-pad-0 .date-group { margin: 0; }

.empty { text-align: center; color: var(--ink-2); padding: 34px 16px; }
.empty .big { font-size: 36px; margin-bottom: 8px; }
.empty p { margin-bottom: 14px; }

/* filters */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filters input[type="search"], .filters select, .input {
  padding: 8px 12px; border: 1px solid var(--hairline); border-radius: 9px;
  background: var(--surface); font-size: 14px; color: var(--ink);
}
.filters input[type="search"] { flex: 1; min-width: 150px; }
.filters input:focus, .filters select:focus, .input:focus { outline: 2px solid var(--focus); outline-offset: -1px; }

/* accounts */
.acct-group {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 2px 8px; border-bottom: 1px solid var(--hairline);
}
.acct-group .g-name { font-size: 15px; font-weight: 700; }
.acct-group .g-total { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.acct-logo {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 700; color: #fff; letter-spacing: 0.02em;
}
.spark { display: flex; align-items: center; opacity: 0.85; }
@media (max-width: 560px) { .spark { display: none; } }

.stacked-bar { display: flex; height: 9px; border-radius: 5px; overflow: hidden; gap: 2px; background: var(--surface-2); margin: 8px 0 12px; }
.stacked-bar > i { display: block; height: 100%; }
.legend-list { display: flex; flex-direction: column; gap: 9px; }
.legend-list .key { display: flex; align-items: center; gap: 9px; font-size: 13.5px; }
.legend-list .key .nm { flex: 1; min-width: 0; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend-list .key .val { font-weight: 600; font-variant-numeric: tabular-nums; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; display: inline-block; }

/* donut + legend grid (Spending report) */
.donut-layout { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.donut { flex-shrink: 0; }
.legend-grid {
  flex: 1; min-width: 240px;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px;
}
@media (max-width: 1200px) { .legend-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .legend-grid { grid-template-columns: 1fr; } .donut-layout { justify-content: center; } }
.legend-grid .key { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; }
.legend-grid .key .dot { margin-top: 5px; }
.legend-grid .key .nm { color: var(--ink-2); }
.legend-grid .key .val { display: block; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }

/* sankey */
.sankey-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sankey-wrap { min-width: 720px; }
.sankey-wrap.compact { min-width: 0; }
.sankey-wrap .ribbon { transition: opacity 0.12s; }
.sankey-wrap svg:hover .ribbon { opacity: 0.2; }
.sankey-wrap svg .ribbon:hover { opacity: 0.62; }

/* charts */
.chart-wrap { position: relative; }
.chart-wrap svg { display: block; width: 100%; height: auto; }
.chart-tip {
  position: fixed; z-index: 100; pointer-events: none;
  background: var(--ink); color: var(--page);
  padding: 7px 10px; border-radius: 8px;
  font-size: 12.5px; line-height: 1.5;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  transform: translate(-50%, calc(-100% - 10px)); white-space: nowrap;
}
.chart-tip b { font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; color: var(--ink-2); }
.legend .key { display: inline-flex; align-items: center; gap: 6px; }

details.chart-table { margin-top: 10px; }
details.chart-table summary { font-size: 12.5px; color: var(--ink-3); cursor: pointer; }
details.chart-table table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
details.chart-table th, details.chart-table td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--hairline); }
details.chart-table td:last-child, details.chart-table th:last-child { text-align: right; font-variant-numeric: tabular-nums; }

/* budget */
.meter { height: 7px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.meter > i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.meter > i.over { background: var(--neg); }
.meter > i.ok { background: var(--s3); }
.budget-row { padding: 11px 2px; border-bottom: 1px solid var(--hairline); }
.budget-row:last-child { border-bottom: 0; }
.b-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.b-name { font-weight: 600; font-size: 14.5px; display: flex; gap: 8px; align-items: center; }
.b-nums { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.b-nums b { color: var(--ink); }
.group-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 2px 6px; font-size: 12px; font-weight: 700;
  color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em;
}
.group-head .gt { font-variant-numeric: tabular-nums; text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--ink-2); }

/* goals */
.goal-card { display: flex; align-items: center; gap: 14px; }
.goal-emoji { font-size: 26px; }
.goal-info { flex: 1; min-width: 0; }
.goal-pct { font-weight: 700; font-size: 15px; }

/* summary sidebar */
.sum-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--hairline); font-size: 13.5px; }
.sum-row:last-of-type { border-bottom: 0; }
.sum-row .k { color: var(--ink-2); }
.sum-row .v { font-weight: 650; font-variant-numeric: tabular-nums; }

/* dropdown menu */
.menu-back { position: fixed; inset: 0; z-index: 55; }
.menu {
  position: fixed; z-index: 56; min-width: 190px;
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 12px; box-shadow: 0 10px 34px rgba(0,0,0,0.16);
  padding: 6px; max-height: 70dvh; overflow-y: auto;
}
.menu button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: 0; background: none; border-radius: 8px;
  padding: 9px 10px; font-size: 14px; text-align: left; color: var(--ink);
}
.menu button:hover { background: var(--surface-2); }
.menu button.sel { font-weight: 700; }
.menu button .ic-wrap { margin-left: auto; color: var(--accent); }
.menu .menu-sep { height: 1px; background: var(--hairline); margin: 5px 0; }

/* modal */
.modal-back { position: fixed; inset: 0; z-index: 60; background: rgba(15, 20, 26, 0.5); display: flex; align-items: flex-end; justify-content: center; }
.modal {
  background: var(--surface); width: 100%; max-width: 470px;
  border-radius: 18px 18px 0 0; padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  max-height: 88dvh; overflow-y: auto; animation: slide-up 0.18s ease-out;
}
@media (min-width: 620px) { .modal-back { align-items: center; } .modal { border-radius: 18px; padding-bottom: 20px; } }
@keyframes slide-up { from { transform: translateY(22px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.modal h3 { font-size: 18px; margin-bottom: 16px; }
.form-grid { display: flex; flex-direction: column; gap: 12px; }
.modal label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); display: block; margin-bottom: 4px; }
.modal input, .modal select, .modal textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--hairline);
  border-radius: 10px; background: var(--surface); font-size: 16px;
}
.modal input:focus, .modal select:focus { outline: 2px solid var(--focus); outline-offset: -1px; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { flex: 1; padding: 11px; justify-content: center; }
.modal-actions .btn-danger { flex: 0 0 auto; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.sign-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--surface-2); padding: 4px; border-radius: 10px; }
.sign-toggle button { border: 0; background: transparent; border-radius: 8px; padding: 8px; font-weight: 600; color: var(--ink-2); }
.sign-toggle button.active-exp { background: var(--surface); color: var(--neg); box-shadow: var(--shadow); }
.sign-toggle button.active-inc { background: var(--surface); color: var(--pos); box-shadow: var(--shadow); }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 90;
  transform: translateX(-50%); background: var(--ink); color: var(--page);
  padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 600;
  box-shadow: 0 6px 24px rgba(0,0,0,0.3);
}
@media (max-width: 900px) { .toast { bottom: calc(140px + env(safe-area-inset-bottom)); } }

/* settings */
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 2px; border-bottom: 1px solid var(--hairline); }
.settings-row:last-child { border-bottom: 0; }
.s-label { font-weight: 600; font-size: 14.5px; }
.s-sub { font-size: 12.5px; color: var(--ink-3); }

/* insights */
.insight { display: flex; gap: 12px; padding: 13px 2px; border-bottom: 1px solid var(--hairline); }
.insight:last-child { border-bottom: 0; }
.insight .ic-wrap { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); flex-shrink: 0; }
.insight .t { font-weight: 650; font-size: 14.5px; }
.insight .d { font-size: 13px; color: var(--ink-2); }
.insight.good .ic-wrap { color: var(--pos); background: rgba(18, 135, 74, 0.1); }
.insight.warn .ic-wrap { color: var(--neg); background: rgba(204, 61, 61, 0.1); }

/* wishlist */
.wish-check {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  border: 1.5px solid var(--baseline); background: transparent; color: transparent;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.wish-check:hover { border-color: var(--pos); color: var(--pos); background: var(--surface-2); }
.pill {
  display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 999px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.02em; vertical-align: 1px;
}
.pill-hot { background: var(--accent-soft); color: var(--accent); }

/* import wizard */
.check-line { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--ink-2); }
.check-line input { width: auto; }
.import-preview {
  border: 1px solid var(--hairline); border-radius: 10px;
  padding: 4px 12px; max-height: 260px; overflow-y: auto; background: var(--surface-3);
}
.import-preview .row { min-height: 44px; }

/* quick add */
.quick-row { display: flex; align-items: center; gap: 10px; }
.quick-sign { font-size: 30px; font-weight: 600; color: var(--ink-3); }
.quick-amount { font-size: 32px !important; font-weight: 700; padding: 6px 10px !important; letter-spacing: -0.02em; }
