/* Tokens live in design-system/tokens.css (loaded first by index.html). */

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
}
button { font-family: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d4d4d4; border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #b4b4b4; background-clip: padding-box; border: 2px solid transparent; }
::-webkit-scrollbar-track { background: transparent; }

/* ========== Shell ========== */
.shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ========== Sidebar ========== */
.sidebar {
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  padding: 8px;
  gap: 2px;
  overflow-y: auto;
  border-right: 1px solid transparent;
}
.sb-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px 10px;
}
.sb-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
}
.sb-icon-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
}
.sb-icon-btn:hover { background: var(--bg-hover); }

.sb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  user-select: none;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  line-height: 1.2;
}
.sb-item:hover { background: var(--bg-hover); }
.sb-item.active { background: var(--bg-active); }
.sb-item svg { flex-shrink: 0; color: var(--text-secondary); }
.sb-item.active svg { color: var(--text); }
.sb-item .label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-item .trailing {
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
}

.sb-section-label {
  padding: 14px 10px 6px;
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.sb-chat {
  display: block;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}
.sb-chat:hover { background: var(--bg-hover); }
.sb-chat.active { background: var(--bg-active); }

.sb-user {
  margin-top: auto;
  padding-top: 8px;
}
.sb-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
}
.sb-user-row:hover { background: var(--bg-hover); }
.sb-user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(135deg, #3d5afe, #00b8d4);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sb-user-name { font-size: 13px; }
.sb-user-plan { font-size: 11px; color: var(--text-tertiary); }

/* ========== Main ========== */
.main {
  position: relative;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  height: 52px;
  border-bottom: 1px solid transparent;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
}
.topbar-model {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
}
.topbar-model:hover { background: var(--bg-hover); }
.topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-share {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.btn-share:hover { background: var(--bg-hover); }

.content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.page {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 24px 24px 120px;
}
.page-wide {
  max-width: 1000px;
}

/* ========== Headings ========== */
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.02em; color: var(--text); }
h1 { font-size: 32px; letter-spacing: -0.025em; line-height: 1.1; }
h2 { font-size: 22px; letter-spacing: -0.02em; }
h3 { font-size: 16px; }
h4 { font-size: 13px; color: var(--text-secondary); font-weight: 500; letter-spacing: 0; }
p { margin: 0; }
.muted { color: var(--text-secondary); }
.tiny { font-size: 12px; }
.mono { font-family: var(--font-mono); font-feature-settings: "tnum" 1; }
.tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

/* ========== Cards ========== */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
}
.card-flat {
  background: var(--bg-sunken);
  border-radius: var(--r-lg);
  padding: 20px;
  border: 1px solid transparent;
}
.card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-soft);
}
.card-row:last-child { border-bottom: none; }

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  line-height: 1;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: #2b2b2b; }
.btn-secondary { background: var(--bg); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--bg-hover); }
.btn-ghost:hover { background: var(--bg-hover); }
.btn-danger { color: var(--negative); }
.btn-danger:hover { background: var(--negative-bg); }

/* Chip / pill */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12px;
  background: var(--bg);
  color: var(--text-secondary);
  white-space: nowrap;
}
.chip.tonal { background: var(--bg-sunken); border-color: transparent; }
.chip.positive { color: var(--positive); background: var(--positive-bg); border-color: transparent; }
.chip.negative { color: var(--negative); background: var(--negative-bg); border-color: transparent; }

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.tab {
  padding: 10px 14px;
  border: none;
  background: transparent;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-weight: 500;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--text); }

/* ========== Composer ========== */
.composer-wrap {
  position: sticky;
  bottom: 0;
  padding: 16px 24px 24px;
  background: linear-gradient(to bottom, transparent, var(--bg) 30%);
  display: flex;
  justify-content: center;
}
.composer {
  width: 100%;
  max-width: 820px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 28px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-pop);
}
.composer-input {
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  resize: none;
  padding: 8px 6px;
  color: var(--text);
  min-height: 28px;
  max-height: 200px;
}
.composer-input::placeholder { color: var(--text-placeholder); }
.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.composer-actions-left { display: flex; gap: 4px; }
.composer-actions-right { display: flex; gap: 4px; align-items: center; }
.icon-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn.send {
  background: var(--text);
  color: #fff;
}
.icon-btn.send:hover { background: #2b2b2b; color: #fff; }
.composer-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
}

/* ========== Layout helpers ========== */
.row { display: flex; gap: 12px; }
.col { display: flex; flex-direction: column; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-2 > * { min-width: 0; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-3 > * { min-width: 0; }
.between { display: flex; align-items: center; justify-content: space-between; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.center { display: flex; align-items: center; }

/* ========== Chat message ========== */
.msg {
  padding: 18px 0;
  display: flex;
  gap: 16px;
}
.msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-sunken);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}
.msg-avatar.user { background: linear-gradient(135deg, #3d5afe, #00b8d4); color: #fff; }
.msg-body { flex: 1; min-width: 0; }
.msg-body p + p { margin-top: 12px; }
.msg-body h3 { margin: 16px 0 8px; }
.msg-body ul { margin: 8px 0 8px 0; padding-left: 20px; }
.msg-body li { margin-bottom: 4px; }
.user-msg {
  background: var(--bg-sunken);
  padding: 10px 16px;
  border-radius: 24px;
  display: inline-block;
  max-width: 80%;
}
.msg-row-user {
  display: flex;
  justify-content: flex-end;
  padding: 18px 0;
}

/* ========== Charts ========== */
.spark-axis {
  font-size: 11px;
  fill: var(--text-tertiary);
}
.chart-grid line { stroke: var(--border-soft); }
.chart-area-fill { fill: rgba(13,13,13,0.04); }
.chart-area-fill-green { fill: url(#chart-grad-green); }
.chart-area-fill-red { fill: url(#chart-grad-red); }
.chart-line { stroke: var(--text); stroke-width: 1.75; fill: none; }
.chart-line-green { stroke: var(--g-500); stroke-width: 2.25; fill: none; stroke-linejoin: round; }
.chart-line-red { stroke: var(--r-500); stroke-width: 2.25; fill: none; stroke-linejoin: round; }
.chart-dot { fill: var(--g-500); }
.chart-dot.down { fill: var(--r-500); }
.chart-dot-cross { stroke: var(--g-500); stroke-width: 2; fill: #fff; }
.chart-tip {
  position: absolute;
  background: var(--text);
  color: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  pointer-events: none;
  transform: translate(-50%, -110%);
  white-space: nowrap;
  box-shadow: var(--shadow-pop);
}
.chart-tip::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 8px;
  height: 8px;
  background: var(--text);
  transform: translateX(-50%) rotate(45deg);
}

/* ========== Account row ========== */
.acct-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
}
.acct-row:last-child { border-bottom: none; }
.acct-row:hover { background: linear-gradient(transparent, transparent); }
.acct-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.acct-logo.ryt { background: #fef3e7; color: #c84a00; }
.acct-logo.wise { background: #e0f2dd; color: #163300; }

.acct-name { font-size: 14px; font-weight: 500; }
.acct-meta { font-size: 12px; color: var(--text-tertiary); }
.acct-amount { font-size: 14px; font-variant-numeric: tabular-nums; font-weight: 500; }
.acct-trend { font-size: 12px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }

/* Memory card */
.memory-item {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.memory-item .dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--text);
  margin-top: 8px;
  flex-shrink: 0;
}
.memory-item .body { flex: 1; }
.memory-meta { font-size: 11px; color: var(--text-tertiary); margin-top: 4px; }

/* Goal */
.goal-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px;
}
.goal-bar {
  height: 6px;
  background: var(--bg-sunken);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 12px;
}
.goal-bar-fill {
  height: 100%;
  background: var(--text);
  border-radius: 999px;
}

/* Settings */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border-soft);
}
.setting-row:last-child { border-bottom: none; }
.setting-label { font-size: 14px; font-weight: 500; }
.setting-help { font-size: 12px; color: var(--text-secondary); margin-top: 2px; max-width: 480px; }
.switch {
  width: 36px;
  height: 20px;
  background: var(--border-strong);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: background 120ms;
  border: none;
  flex-shrink: 0;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 999px;
  transition: transform 120ms;
}
.switch.on { background: var(--text); }
.switch.on::after { transform: translateX(16px); }

/* Eyebrow */
.eyebrow {
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
}

/* Big numbers */
.huge-num {
  font-size: 44px;
  font-weight: 500;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}
.med-num {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.015em;
  font-variant-numeric: tabular-nums;
}

/* Suggestion chips under intro */
.suggest-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.suggest {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  background: var(--bg);
}
.suggest:hover { background: var(--bg-hover); }

/* Inline data table within chat */
.inline-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 13px;
}
.inline-table th, .inline-table td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-soft);
}
.inline-table th {
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 12px;
  background: var(--bg-sunken);
}
.inline-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.inline-table th.num { text-align: right; }

/* Hidden balance */
/* Privacy mask — fixed-width dots instead of a blur you can almost read.
   .private on .shell masks every .amt; .blur-amount is the legacy hook. */
.private .amt, .blur-amount {
  position: relative;
  color: transparent !important;
  user-select: none;
}
.private .amt *, .blur-amount * { color: transparent !important; }
.private .amt::after, .blur-amount::after {
  content: "••••••";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  letter-spacing: 0.08em;
  font-size: min(1em, 22px);
}
.private .amt.right::after { left: auto; right: 0; }
.private .chart-amt { visibility: hidden; }

/* Source badge */
.source-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 10px;
}
.source-line .dot { width: 4px; height: 4px; background: currentColor; border-radius: 999px; }

/* ========== Time range pills (1D / 1W / 1M / 3M / 6M / YTD / 1Y / 2Y) ========== */
.range-pills {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--bg-sunken);
}
.range-pill {
  padding: 6px 14px;
  border-radius: 999px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-tertiary);
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0;
}
.range-pill:hover { color: var(--text); }
.range-pill.active {
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

/* ========== Donut legend ========== */
.legend {
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1;
}
.legend-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.legend-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.legend-name { font-size: 14px; font-weight: 500; color: var(--text); }
.legend-amt { font-size: 16px; font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.legend-bar {
  display: flex;
  align-items: center;
  gap: 0;
}
.legend-bar-fill {
  height: 4px;
  border-radius: 999px;
}
.legend-bar-rest {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background-image: repeating-linear-gradient(to right, var(--border-strong) 0 2px, transparent 2px 6px);
  background-size: 6px 4px;
  margin-left: 2px;
}

/* ========== Donut chart ========== */
.donut-wrap {
  display: flex;
  align-items: center;
  gap: 32px;
  min-width: 0;
  flex-wrap: wrap;
}
.donut-wrap > svg { flex-shrink: 0; }
.donut-wrap .legend { min-width: 0; }

/* ========== KPI strip ========== */
.kpi {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.kpi-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}
.kpi-value {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.kpi-sub { font-size: 12px; color: var(--text-tertiary); }
.kpi-sub.pos { color: var(--positive); }
.kpi-sub.neg { color: var(--negative); }

/* Big number on hero cards (more like the reference) */
.hero-num {
  font-size: 38px;
  font-weight: 600;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
  white-space: nowrap;
}

/* Positive / negative inline change line */
.change-line {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.change-line.pos { color: var(--positive); }
.change-line.neg { color: var(--negative); }
.change-line .arrow {
  display: inline-flex;
  width: 14px;
  height: 14px;
  align-items: center;
  justify-content: center;
}

/* Section header */
.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 32px 0 14px;
}
.section-title h2 { letter-spacing: -0.02em; }

/* Account row v2 — softer, no chevron on hover */
.acct-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  background: var(--bg);
  transition: border-color 100ms, background 100ms;
}
.acct-card:hover { border-color: var(--border-strong); background: #fcfcfc; }
.acct-card .swatch {
  width: 8px;
  height: 40px;
  border-radius: 999px;
  flex-shrink: 0;
}
.acct-card .body { flex: 1; min-width: 0; }
.acct-card .name { font-size: 15px; font-weight: 500; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.acct-card .meta { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
.acct-card .amount { font-size: 18px; font-weight: 500; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; text-align: right; }
.acct-card .change { font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; margin-top: 2px; }
.acct-card .change.pos { color: var(--positive); }
.acct-card .change.neg { color: var(--negative); }

/* Hero card title group */
.hero-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.hero-title-row > * { min-width: 0; }

/* Goal redux */
.goal-bar {
  height: 8px;
  background: var(--bg-sunken);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 14px;
}
.goal-bar-fill {
  height: 100%;
  background: var(--g-500);
  border-radius: 999px;
}

/* Page header layout */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 24px;
}
.page-header .h-eyebrow {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 500;
  margin-bottom: 6px;
}
.page-header .h-meta { font-size: 13px; color: var(--text-tertiary); }

/* Wider page for dashboard */
.page-dash { max-width: 1120px; padding: 32px 32px 80px; }

/* Stack the distribution + goal pair on narrower viewports */
@media (max-width: 1080px) {
  .grid-2.stack-md { grid-template-columns: 1fr !important; }
}

/* Monthly savings bar chart */
.savings-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 78px;
  margin-top: 18px;
  margin-bottom: 4px;
}
.savings-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  position: relative;
  min-width: 0;
}
.savings-bar-track {
  height: 60px;
  display: flex;
  align-items: flex-end;
}
.savings-bar-fill {
  width: 100%;
  background: var(--g-500);
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  transition: height 200ms ease;
}
.savings-bar-col:hover .savings-bar-fill { background: var(--g-700); }
.savings-bar-label {
  font-size: 10px;
  color: var(--text-tertiary);
  margin-top: 6px;
  white-space: nowrap;
  text-align: center;
}

/* Type section (grouped accounts) */
.type-section {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px 22px;
  background: var(--bg);
}
.type-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-soft);
}

/* Holdings table tweaks */
.holdings-table th, .holdings-table td { padding: 12px 14px; }
.holdings-table tr:last-child td { border-bottom: none; }
.holdings-table .mono { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.02em; }
.holdings-table td.num.mono { font-size: 12px; color: var(--text-tertiary); }


/* ============================================================
   v2 components
   ============================================================ */
button:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Money — muted currency + decimals so the integer reads first */
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.money .cur { color: var(--text-tertiary); font-weight: 500; margin-right: 0.22em; font-size: 0.8em; letter-spacing: 0; }
.money .dec { color: var(--text-tertiary); font-size: 0.6em; font-weight: 500; }
.money.xl { font-size: 46px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.money.xl .cur { font-size: 0.5em; vertical-align: 0.5em; }
.money.lg { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.money.lg .cur { font-size: 0.6em; vertical-align: 0.25em; }

/* Delta chip */
.delta {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums;
  padding: 3px 9px; border-radius: var(--r-pill); white-space: nowrap;
}
.delta.up { color: var(--up); background: var(--up-bg); }
.delta.down { color: var(--down); background: var(--down-bg); }
.delta.flat, .delta.new { color: var(--text-secondary); background: var(--bg-sunken); }
.delta.sm { font-size: 11px; padding: 2px 7px; }

/* Change decomposition bar */
.decomp-bar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; gap: 2px; background: var(--bg-sunken); }
.decomp-bar > span { display: block; height: 100%; transition: flex var(--dur-3) var(--ease); }
.decomp-legend { display: flex; gap: var(--sp-4); flex-wrap: wrap; margin-top: var(--sp-2); font-size: 12px; color: var(--text-secondary); }
.decomp-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.hatch { background-image: repeating-linear-gradient(135deg, var(--text-tertiary) 0 2px, transparent 2px 5px); opacity: 0.7; }

/* Allocation strip */
.alloc-strip { display: flex; height: 40px; border-radius: var(--r-md); overflow: hidden; gap: 3px; margin: var(--sp-4) 0 var(--sp-2); }
.alloc-strip > button {
  position: relative; border: 0; padding: 0; min-width: 4px;
  transition: flex var(--dur-3) var(--ease), filter var(--dur-1) var(--ease);
}
.alloc-strip > button:hover { filter: brightness(1.08); }
.alloc-strip > button span { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 12px; font-weight: 600; color: #fff; white-space: nowrap; }
.alloc-row {
  display: grid; grid-template-columns: 10px 1fr auto 52px 16px; gap: var(--sp-3); align-items: center;
  padding: 11px 0; border-top: 1px solid var(--border-soft); cursor: pointer; width: 100%;
  background: none; border-left: 0; border-right: 0; border-bottom: 0; text-align: left;
}
.alloc-row:hover .alloc-name { text-decoration: underline; text-underline-offset: 3px; }
.alloc-row .sw { width: 10px; height: 10px; border-radius: 3px; }
.alloc-name { font-weight: 500; font-size: 14px; }
.alloc-sub { font-size: 12px; color: var(--text-tertiary); }
.alloc-pct { text-align: right; color: var(--text-tertiary); font-size: 12px; font-variant-numeric: tabular-nums; }
.alloc-amt { font-size: 15px; font-weight: 500; }
.alloc-chev { color: var(--text-tertiary); transition: transform var(--dur-2) var(--ease); display: inline-flex; }
.alloc-chev.open { transform: rotate(90deg); }
.alloc-children { padding: 0 0 8px 22px; }
.alloc-child { display: grid; grid-template-columns: 20px 1fr auto 52px; gap: var(--sp-3); align-items: center; padding: 6px 0; font-size: 13px; cursor: pointer; }
.alloc-child:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

/* Signed savings bars */
.sbars { display: flex; align-items: stretch; gap: 3px; height: 128px; margin-top: var(--sp-4); position: relative; }
.sbars::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px dashed var(--border-strong); }
.sbar { flex: 1; display: flex; flex-direction: column; position: relative; }
.sbar .half { flex: 1; display: flex; }
.sbar .half.top { align-items: flex-end; }
.sbar .half.bot { align-items: flex-start; }
.sbar i { display: block; width: 100%; border-radius: 3px; transition: height var(--dur-3) var(--ease); }
.sbar .top i { background: var(--up); }
.sbar .bot i { background: var(--down); opacity: 0.75; }
.sbar:hover i { filter: brightness(0.9); }
.sbar-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-tertiary); margin-top: 6px; }

/* Institution logo chip (monogram fallback) */
.logo-chip {
  flex-shrink: 0; position: relative; overflow: hidden;
  display: inline-grid; place-items: center;
  color: #fff; font-weight: 700; letter-spacing: 0.02em;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
}
.logo-chip img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Freshness dot */
.fresh { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-tertiary); }
.fresh::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
  background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 20%, transparent);
}
.fresh.fresh-ok { --c: var(--fresh); }
.fresh.fresh-aging { --c: var(--aging); }
.fresh.fresh-stale { --c: var(--stale); }
.fresh .nudge { color: var(--a-700); font-weight: 500; }

/* Archived toggle */
.link-btn { border: 0; background: none; padding: 0; color: var(--text-secondary); font-size: 12px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--text); }

/* Chart */
.chart-band { fill: url(#chart-hatch); }
.delta .money .cur, .change .money .cur, .kpi-sub .money .cur, .decomp-legend .money .cur, .tiny .money .cur { color: inherit; font-size: 1em; margin-right: 0.2em; }
.kpi-value .money .cur, .med-num .money .cur, .alloc-amt .cur, .amount .money .cur { font-size: 0.72em; }
.private .money.xl::after { font-size: 0.6em; }
.inline-table td .money .cur, .holding-row .money .cur { color: inherit; opacity: 0.7; }
.price-cell { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.price-sub { font-size: 11px; font-variant-numeric: tabular-nums; }
.price-sub.up { color: var(--up); }
.price-sub.down { color: var(--down); }
.price-sub.flat { color: var(--text-tertiary); }
.live-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--fresh); margin-right: 6px; vertical-align: 1px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--fresh) 20%, transparent); }
.holdings-table td, .holdings-table th { white-space: nowrap; }
.holdings-table td.desc { white-space: normal; color: var(--text-secondary); }
.held-in { display: inline-flex; gap: 3px; }
.chart-legend { display: flex; gap: var(--sp-4); font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.chart-legend i { display: inline-block; width: 16px; height: 0; vertical-align: middle; margin-right: 6px; }
.chart-legend .lg-total { border-top: 2px solid var(--positive); }
.chart-legend .lg-base { border-top: 1.5px dashed var(--text-tertiary); }

/* Projection assumptions */
.pgroup-title { font-size: 12px; font-weight: 500; color: var(--text-tertiary); margin: var(--sp-5) 0 var(--sp-2); letter-spacing: 0.02em; }
.pgroup-title:first-of-type { margin-top: 0; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--sp-3) var(--sp-4); }
.pfield { display: flex; flex-direction: column; gap: 4px; }
.pfield-label { font-size: 13px; font-weight: 500; }
.pfield-input {
  display: flex; align-items: center; gap: 6px; padding: 0 10px; height: 36px;
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg);
  transition: border-color var(--dur-1) var(--ease);
}
.pfield-input:focus-within { border-color: var(--text); box-shadow: 0 0 0 3px rgba(0,0,0,0.06); }
.pfield-input input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 14px;
  font-variant-numeric: tabular-nums; color: var(--text); padding: 0;
}
.pfix { font-size: 12px; color: var(--text-tertiary); white-space: nowrap; }
.pfield-hint { font-size: 11px; color: var(--text-tertiary); }
.pfield-hint .money .cur { color: inherit; font-size: 1em; }

/* ============================================================
   Phone / PWA
   ============================================================ */
.tabbar { display: none; }
.compose-fab { display: none; }
.offline-banner {
  background: var(--a-100); color: var(--a-800); font-size: 12px; font-weight: 500;
  text-align: center; padding: 6px 12px; padding-top: calc(6px + env(safe-area-inset-top));
}
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 767px) {
  html, body { overscroll-behavior-y: none; }
  .shell { grid-template-columns: 1fr; height: 100dvh; }
  .sidebar { display: none; }
  .main { height: 100dvh; }
  :root {
    --tabbar-h: 58px;
    --tabbar-gap: max(12px, calc(env(safe-area-inset-bottom) - 10px));  /* floats just above the home indicator */
    --tabbar-top: calc(var(--tabbar-h) + var(--tabbar-gap));            /* content and floating bars clear this */
  }
  .content { padding-bottom: calc(var(--tabbar-top) + 24px); padding-top: env(safe-area-inset-top); }
  .offline-banner + .content { padding-top: 0; }

  /* Bottom tab bar — a floating Liquid Glass capsule (iOS 26); material = .glass */
  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; z-index: 45; height: var(--tabbar-h); bottom: var(--tabbar-gap);
    left: max(20px, env(safe-area-inset-left)); right: calc(max(20px, env(safe-area-inset-right)) + var(--tabbar-h) + 10px);
    padding: 4px; border-radius: var(--r-pill);
    touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  }
  /* Compose island — glass circle beside the tab bar (where iOS 26 puts Search): a note is one tap away */
  .compose-fab {
    display: grid; place-items: center; position: fixed; z-index: 45; padding: 0;
    right: max(20px, env(safe-area-inset-right)); bottom: var(--tabbar-gap);
    width: var(--tabbar-h); height: var(--tabbar-h); border-radius: 50%; color: var(--text);
    -webkit-tap-highlight-color: transparent;
  }
  .compose-fab svg { width: 24px; height: 24px; }
  .tabbar.none .tb-pill { opacity: 0; }
  /* Selection platter: springs between tabs; becomes a lens that follows your finger when dragged */
  .tb-pill {
    position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 4);
    border-radius: var(--r-pill); background: var(--glass-platter); pointer-events: none;
    transform: translateX(calc(var(--i, 0) * 100%));
    transition: transform var(--dur-glass) var(--spring), scale 280ms var(--spring),
      background-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
  }
  .tabbar.moving .tb-pill { animation: tb-stretch var(--dur-glass) var(--ease); }
  .tabbar.scrubbing .tb-pill {
    transform: translateX(var(--lens-x, 0px)); scale: 1.1 1.2; background: var(--glass-lens);
    box-shadow: 0 8px 22px -6px rgba(0,0,0,.22), inset 0 0 0 .5px rgba(0,0,0,.08), inset 0 1px 1px var(--glass-rim);
    transition: transform 90ms linear, scale 280ms var(--spring),
      background-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
  }
  .tab-btn {
    position: relative; z-index: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    border: 0; background: none; padding: 0; border-radius: var(--r-pill); cursor: pointer;
    font: inherit; font-size: 10.5px; font-weight: 500; color: var(--text-secondary);
    -webkit-tap-highlight-color: transparent; transition: color var(--dur-2) var(--ease);
  }
  .tab-btn svg { width: 22px; height: 22px; transition: scale 280ms var(--spring); }
  .tab-btn.active { color: var(--text); font-weight: 600; }
  .tab-btn.lensed svg { scale: 1.15; }
  .tab-btn:active svg { scale: .9; }
  .tabbar.moving .tab-btn.active svg { animation: tb-pop 420ms var(--spring); }

  /* Chat: sits above the tab bar; drawer goes full-screen */
  .shell .chat-fab { bottom: calc(var(--tabbar-top) + 12px); right: 20px; }
  .shell .chat-drawer { width: 100vw; max-width: 100vw; border-left: 0; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }

  /* Page rhythm */
  .page-dash { padding: 16px 16px 24px; }
  .page-header { flex-wrap: nowrap; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
  .page-header h1 { font-size: 26px; }
  .page-header .btn { padding: 8px 10px; }
  .btn-label { display: none; }
  .card { padding: 18px !important; border-radius: 18px; }
  .section-title { margin-top: 28px; }

  /* Hero */
  .hero-title-row { flex-direction: column; align-items: stretch !important; gap: 14px; }
  .money.xl { font-size: 36px; }
  .range-pills { width: 100%; display: flex; }
  .range-pill { flex: 1; padding: 7px 0; }
  .decomp-legend { gap: 6px 12px; }

  /* Grids collapse */
  .grid-3:has(> .kpi) { grid-template-columns: 1fr; gap: 8px; }
  .grid-2, .grid-2.stack-md { grid-template-columns: 1fr !important; }
  .kpi { padding: 14px 16px; }
  .kpi-value { font-size: 20px; }
  .row.gap-12.mb-24 > .kpi { min-width: calc(50% - 6px) !important; }

  /* Account rows: drop the sparkline, tighten */
  .acct-card { padding: 12px 14px !important; gap: 12px; }
  .acct-card svg[width="130"] { display: none; }
  .acct-card > div[style*="min-width"] { min-width: 0 !important; }
  .acct-card .name .chip { display: none; }
  .type-section { padding: 16px; }

  /* Tables: keep the essentials */
  .hide-sm { display: none; }
  .inline-table th, .inline-table td { padding-left: 6px; padding-right: 6px; }
  .holdings-table td.desc { display: none; }

  /* Allocation strip rows */
  .alloc-row { grid-template-columns: 10px 1fr auto 16px; }
  .alloc-row .alloc-pct { display: none; }

  /* Forms: 16px stops iOS zooming into inputs */
  input, select, textarea { font-size: 16px !important; }
  .page-header > .row > div.row { flex-wrap: wrap; }

  /* Settings */
  .setting-row { gap: 12px; }
}
.chart-legend { flex-wrap: wrap; row-gap: 4px; }
.chart-legend > span { white-space: nowrap; }
@media (max-width: 767px) {
  .shell .chat-fab { width: 48px; height: 48px; padding: 0; justify-content: center; }
  .chat-fab span:last-child { display: none; }
  .source-line { flex-wrap: wrap; row-gap: 2px; }
  .source-line .dot, .source-line .dot + span { display: none; }
}
@media (max-width: 767px) {
  .card > .between { flex-wrap: wrap; gap: 6px; }
  .holdings-table { font-size: 13px; }
}
@media (max-width: 767px) {
  .type-section { padding: 0; border: 0; background: none; }
  .type-section-head { padding: 0 2px 4px; }
  .acct-card .fresh { white-space: nowrap; }
  .acct-card .amount .money { font-size: 15px !important; }
  .holdings-table td:first-child .mono { font-size: 12px; }
  .holdings-table .price-sub { font-size: 10.5px; }
}

/* Login / splash */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: var(--bg-sidebar); }
.login-card {
  width: 100%; max-width: 360px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-card);
  padding: 28px 24px; display: flex; flex-direction: column; gap: 14px;
}
.login-card h1 { font-size: 26px; margin: 0; }
.login-logo { border-radius: 50%; display: block; }
.login-btn { width: 100%; padding: 12px; font-size: 15px; margin-top: 4px; }
.login-error { font-size: 13px; color: var(--negative); background: var(--negative-bg); padding: 8px 12px; border-radius: var(--r-md); }

/* ============================================================
   Phone screens (mobile.jsx) — patterns from the Lightyear /
   Trading 212 reference study, tokens only. Prefix: mx-
   ============================================================ */
.mx-page { padding-bottom: 12px; }

.mx-topbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px 4px; }
.mx-topleft, .mx-topright { display: flex; align-items: center; gap: 8px; }
.mx-avatar { width: 32px; height: 32px; border-radius: 50%; display: block; }
.mx-scope { position: relative; display: inline-flex; align-items: center; gap: 4px; padding: 0 11px 0 13px; height: 34px; border-radius: var(--r-pill); background: var(--bg-sunken); font-size: 13px; font-weight: 600; }
.mx-scope select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; font: inherit; color: var(--text); padding-right: 2px; outline: none; }
.mx-scope svg { width: 14px; height: 14px; color: var(--text-secondary); pointer-events: none; }
.mx-iconbtn { width: 36px; height: 36px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--bg-sunken); color: var(--text-secondary); padding: 0; flex: none; }
.mx-iconbtn svg { width: 18px; height: 18px; }
.mx-iconbtn.spin svg { animation: mx-spin 1s linear infinite; }
@keyframes mx-spin { to { transform: rotate(360deg); } }

.mx-hero { padding: 14px 20px 0; }
.mx-lbl { font-size: 15px; color: var(--text-secondary); margin-bottom: 2px; }
.mx-hero .money.xl { font-size: 34px; }
.mx-hero-row { display: flex; align-items: center; gap: 10px; }
.mx-chg-note { flex-basis: 100%; font-weight: 400; }
.mx-eye { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 0; padding: 0; display: grid; place-items: center; background: var(--bg-sunken); color: var(--text-secondary); cursor: pointer; }
.mx-eye svg { width: 16px; height: 16px; }
.mx-chg { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: baseline; margin-top: 8px; font-size: 13px; font-weight: 500; }
.mx-chg .money .cur, .mx-v .money .cur, .mx-sub .money .cur, .mx-chip .money .cur, .mx-quick .money .cur, .mx-ts .money .cur { color: inherit; font-size: 1em; margin-right: .15em; }
.up { color: var(--up); } .down { color: var(--down); } .mut { color: var(--text-tertiary); }

.mx-chart { position: relative; margin-top: 8px; }
.mx-chart-empty { margin: 16px 20px; padding: 28px 12px; text-align: center; font-size: 13px; color: var(--text-tertiary); background: var(--bg-sunken); border-radius: var(--r-lg); }
.mx-pt { font-size: 10.5px; fill: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.mx-tip { position: absolute; top: 0; transform: translateX(-50%); background: var(--text); color: #fff; font-size: 11.5px; font-weight: 500; padding: 4px 9px; border-radius: var(--r-pill); white-space: nowrap; pointer-events: none; font-variant-numeric: tabular-nums; }
.mx-pills { padding: 8px 16px 0; }
.mx-pills .range-pills { width: 100%; display: flex; }
.mx-pills .range-pill { flex: 1; padding: 7px 0; }

.mx-statpair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 20px 0; }
.mx-k { font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-tertiary); }
.mx-v { font-size: 15.5px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.mx-s { font-size: 11.5px; color: var(--text-tertiary); margin-top: 1px; }

.mx-bento { display: grid; grid-template-columns: 1.15fr 1fr; gap: 8px; margin: 18px 16px 0; }
.mx-bento.two { grid-template-columns: 1fr 1fr; margin-top: 8px; }
.mx-bento-col { display: grid; gap: 8px; }
.mx-tile { display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 2px; background: var(--bg-sidebar); border: 1px solid var(--border-soft); border-radius: 18px; padding: 12px 13px; min-width: 0; font: inherit; color: inherit; cursor: pointer; }
.mx-tile.static { cursor: default; }
.mx-tile:active:not(.static) { transform: scale(.98); }
.mx-t { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-tertiary); }
.mx-t i { width: 7px; height: 7px; border-radius: 2px; }
.mx-tv { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; margin-top: 2px; }
.mx-tile.big .mx-tv { font-size: 21px; }
.mx-ts { font-size: 11.5px; color: var(--text-tertiary); }
.mx-tspark { margin-top: auto; padding-top: 10px; width: 100%; }
.mx-tspark svg { width: 100%; }

.mx-seg { display: flex; gap: 20px; margin: 24px 20px 2px; border-bottom: 1px solid var(--border-soft); }
.mx-seg button { border: 0; background: none; padding: 9px 0; margin-bottom: -1px; font: inherit; font-size: 14px; font-weight: 500; color: var(--text-tertiary); border-bottom: 2px solid transparent; cursor: pointer; }
.mx-seg button.on { color: var(--text); border-bottom-color: var(--text); }

.mx-list { display: flex; flex-direction: column; }
.mx-lrow, .mx-arow { display: grid; align-items: center; gap: 12px; padding: 11px 20px; width: 100%; border: 0; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.mx-lrow { grid-template-columns: 38px minmax(0, 1fr) 60px auto; }
.mx-arow { grid-template-columns: auto minmax(0, 1fr) auto; }
.mx-lrow + .mx-lrow, .mx-arow + .mx-arow { border-top: 1px solid var(--border-soft); }
.mx-lrow:active, .mx-arow:active { background: var(--bg-hover); }
.mx-lmain { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.mx-nm { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-mt { font-size: 12px; color: var(--text-tertiary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-lmain .fresh { white-space: nowrap; overflow: hidden; }
.mx-rt { display: flex; flex-direction: column; align-items: flex-end; text-align: right; font-size: 14px; font-weight: 500; }
.mx-sub { font-size: 12px; font-weight: 500; }
.mx-ico { width: 34px; height: 34px; border-radius: 10px; background: var(--bg-sunken); display: grid; place-items: center; color: var(--text-secondary); }
.mx-ico svg { width: 16px; height: 16px; }
.mx-more { display: block; width: 100%; border: 0; background: none; text-align: center; font: inherit; font-size: 13px; font-weight: 500; color: var(--text-secondary); padding: 14px; cursor: pointer; }
.mx-empty { padding: 28px 20px; text-align: center; font-size: 13px; color: var(--text-tertiary); }
.mx-group { font-size: 12px; font-weight: 600; color: var(--text-tertiary); letter-spacing: .04em; text-transform: uppercase; padding: 20px 20px 4px; }
.mx-foot { font-size: 12px; color: var(--text-tertiary); }

.mx-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 16px; min-height: 56px; position: sticky; top: 0; z-index: 20; }
/* iOS 26 scroll-edge effect: content softens and fades under the floating buttons instead of a solid bar */
.mx-nav::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, var(--bg) 30%, transparent);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  -webkit-mask-image: linear-gradient(to bottom, #000 45%, transparent); mask-image: linear-gradient(to bottom, #000 45%, transparent);
}
.mx-nav .mx-iconbtn.glass { width: 40px; height: 40px; color: var(--text); }
.mx-nav-title { font-size: 15px; font-weight: 600; flex: 1; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-nav-right { min-width: 36px; display: flex; justify-content: flex-end; }

.mx-center { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 6px 20px 0; gap: 4px; }
.mx-center .logo-chip { margin-bottom: 6px; }
.mx-name { font-size: 14px; color: var(--text-secondary); }
.mx-bigval { font-size: 36px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; }
.mx-bigval .cur { font-size: .55em; vertical-align: .35em; }
.mx-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: var(--r-pill); font-size: 12px; font-weight: 500; background: var(--bg-sunken); color: var(--text-secondary); margin-top: 6px; }
.mx-chip.fill.up { background: var(--positive); color: #fff; }
.mx-chip.fill.down { background: var(--negative); color: #fff; }
.mx-err { font-size: 12px; color: var(--negative); background: var(--negative-bg); padding: 6px 10px; border-radius: var(--r-md); margin-top: 8px; }
.mx-statpair .mx-stat { min-width: 0; }
.mx-center + .mx-statpair { text-align: center; }

.mx-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 18px 20px 0; }
.mx-btns.one { grid-template-columns: 1fr; }
.mx-hint { font-size: 12px; color: var(--text-tertiary); margin-top: 6px; }
.mx-btn { border: 0; padding: 13px; border-radius: var(--r-pill); font: inherit; font-weight: 600; font-size: 14px; background: var(--bg-sunken); color: var(--text); cursor: pointer; }
.mx-btn.pri { background: var(--accent); color: var(--accent-text); }
.mx-btn.on { box-shadow: inset 0 0 0 1.5px var(--text); }
.mx-btn:disabled { opacity: .6; }
.mx-section { margin-top: 8px; }

.mx-update { display: flex; flex-direction: column; min-height: calc(100dvh - env(safe-area-inset-top)); }
.mx-datepill input { border: 0; background: var(--bg-sunken); border-radius: var(--r-pill); padding: 6px 10px; font: inherit; font-size: 13px !important; color: var(--text); max-width: 150px; }
.mx-datepill.glass { display: inline-flex; border-radius: var(--r-pill); }
.mx-datepill.glass input { background: transparent; padding: 9px 12px; }
.mx-entry { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 40px 20px 0; text-align: center; }
.mx-amount { display: flex; align-items: baseline; justify-content: center; gap: 6px; width: 100%; }
.mx-amount-cur { font-size: 22px; font-weight: 500; color: var(--text-tertiary); }
.mx-amount input { max-width: calc(100vw - 90px); border: 0; outline: 0; background: transparent; text-align: center; font: inherit; font-size: 44px !important; font-weight: 600; letter-spacing: -0.03em; color: var(--text); font-variant-numeric: tabular-nums; caret-color: var(--text); }
.mx-was { font-size: 13px; color: var(--text-tertiary); margin-top: 6px; }
.mx-was .money .cur { color: inherit; font-size: 1em; }
.mx-quick { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.mx-quick button { border: 1px solid var(--border); background: var(--bg); border-radius: var(--r-pill); padding: 8px 13px; font: inherit; font-size: 13px; font-weight: 500; color: var(--text); cursor: pointer; }
.mx-cta { margin: 16px 20px calc(16px + env(safe-area-inset-bottom)); padding: 16px; border: 0; border-radius: var(--r-pill); background: var(--accent); color: var(--accent-text); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.mx-cta:disabled { opacity: .5; }

.mx-hold-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.mx-price { font-size: 36px !important; }
.mx-card { margin: 20px 16px 0; border: 1px solid var(--border); border-radius: 20px; padding: 14px 16px; }
.mx-card-title { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.mx-kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mx-parts { margin-top: 12px; border-top: 1px solid var(--border-soft); }
.mx-parts .mx-arow { padding: 10px 0; }
.mx-card .mx-foot { margin-top: 8px; }
.mx-pots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 18px 16px 0; }
.mx-pot { border: 1px solid var(--border); border-radius: 16px; padding: 11px 13px; }

/* Sync button — one control everywhere: icon + "Synced 7m ago".
   Spins while the Mac refreshes; amber dot when the Mac is offline. */
.sync-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px 0 10px;
  border: 1px solid var(--border-strong); border-radius: var(--r-pill); background: var(--bg);
  font: inherit; font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; cursor: pointer;
  transition: background var(--dur-1) var(--ease);
}
.sync-btn:hover { background: var(--bg-hover); }
.sync-btn:disabled { cursor: progress; }
.sync-ic { position: relative; display: inline-grid; place-items: center; color: var(--text-secondary); }
.sync-btn.syncing .sync-ic svg { animation: sync-spin 0.9s linear infinite; }
@keyframes sync-spin { to { transform: rotate(360deg); } }
.sync-dot {
  position: absolute; top: -2px; right: -3px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--aging); box-shadow: 0 0 0 2px var(--bg);
}
.sync-btn.offline .sync-txt { color: var(--text-secondary); }
.sync-btn.compact { height: 34px; padding: 0 12px 0 10px; font-size: 12.5px; }   /* phone: glass toolbar pill */
.sync-btn.compact .sync-dot { box-shadow: 0 0 0 2px #fff; }
.sync-btn.glass:hover { background: var(--glass-fill-solid); }
@media (prefers-reduced-motion: reduce) { .sync-btn.syncing .sync-ic svg { animation-duration: 2.5s; } }

/* Holding logos — rounded squares like account logos, hairline so white logos keep an edge */
.stock-logo { display: block; flex: none; object-fit: cover; background: #fff; border: 1px solid var(--border-soft); box-sizing: border-box; }
.stock-badge { display: inline-grid; place-items: center; flex: none; background: var(--bg-sunken); color: var(--text-secondary); font-family: var(--font-mono); font-weight: 600; letter-spacing: -0.02em; }
.sym-cell { display: inline-flex; align-items: center; gap: 10px; }

/* ============================================================
   Spacing & lists (v3) — 8-pt rhythm, "inside ≤ between"
   Phone: 16 side margin · 24 between sections · 8 header→content
   Lists: Apple-style inset groups — one rounded container per
   section, hairline dividers inset to the text column.
   ============================================================ */
:root { --mx-side: 16px; --mx-section: 24px; --mx-head: 8px; --mx-radius: 16px; }

/* one left edge for everything on the phone */
.mx-topbar { padding: 10px var(--mx-side) 0; }
.mx-hero { padding: 16px var(--mx-side) 0; }
.mx-pills { padding: 8px var(--mx-side) 0; }
.mx-statpair { margin: var(--mx-section) var(--mx-side) 0; }
.mx-bento { margin: var(--mx-section) var(--mx-side) 0; }
.mx-bento.two { margin-top: 8px; }
.mx-seg { margin: 32px var(--mx-side) var(--mx-head); }
.mx-nav { padding: 8px calc(var(--mx-side) - 4px); }
.mx-center { padding: 4px var(--mx-side) 0; }
.mx-btns { margin: 20px var(--mx-side) 0; }
.mx-card { margin: var(--mx-section) var(--mx-side) 0; }
.mx-pots { margin: 20px var(--mx-side) 0; }
.mx-chart-empty { margin: 16px var(--mx-side); }

/* section header: label left, total right */
.mx-sechead {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin: var(--mx-section) calc(var(--mx-side) + 4px) var(--mx-head);
  font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-tertiary);
}
.mx-sechead > span:first-child { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.mx-sechead .money { font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text-secondary); }
.mx-sechead .money .cur { font-size: 1em; color: var(--text-tertiary); }
.mx-sechead-note { font-weight: 500; letter-spacing: 0; text-transform: none; }
.mx-secdot { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.mx-secfoot { margin: 8px calc(var(--mx-side) + 4px) 0; font-size: 12px; line-height: 1.5; color: var(--text-tertiary); }
.mx-footnote { margin-top: 32px; }

/* inset grouped list */
.mx-inset { margin: 0 var(--mx-side); background: var(--bg); border: 1px solid var(--border); border-radius: var(--mx-radius); overflow: hidden; }
.mx-inset.mx-first { margin-top: 16px; }
.mx-inset > .mx-lrow, .mx-inset > .mx-arow { padding: 12px 14px; position: relative; border-top: 0; }
.mx-inset > .mx-lrow + .mx-lrow::before, .mx-inset > .mx-arow + .mx-arow::before,
.mx-inset > .mx-inset-more::before {
  content: ""; position: absolute; top: 0; right: 0; left: 64px; border-top: 1px solid var(--border-soft);
}
.mx-inset > .mx-arow + .mx-arow::before { left: 60px; }
.mx-inset-more {
  position: relative; display: block; width: 100%; border: 0; background: none; padding: 13px 14px 13px 64px;
  text-align: left; font: inherit; font-size: 13.5px; font-weight: 500; color: var(--b-700); cursor: pointer;
}
.mx-inset-more::before { left: 64px; }
.mx-inset .mx-lrow:active, .mx-inset .mx-arow:active, .mx-inset-more:active { background: var(--bg-hover); }

/* accounts tab */
.mx-titlebar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px var(--mx-side) 0; }
.mx-titleacts { display: inline-flex; align-items: center; gap: 8px; }
/* toolbar pill (title bars): glass, or solid black for the primary action */
.glass-pill { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px 0 11px; border: 0; border-radius: var(--r-pill); font: inherit; font-size: 12.5px; font-weight: 600; color: var(--text); white-space: nowrap; cursor: pointer; }
.glass-pill svg { width: 16px; height: 16px; }
.glass-pill.dark { background: var(--accent); color: var(--accent-text); }
.mx-title { font-size: 28px; letter-spacing: -0.025em; margin: 0; }
.mx-summary { margin: 16px var(--mx-side) 0; padding: 16px; border: 1px solid var(--border); border-radius: var(--mx-radius); background: var(--bg); }
.mx-sumval { display: block; font-size: 30px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; margin-top: 2px; }
.mx-sumval .cur { font-size: .55em; vertical-align: .3em; }
.mx-allocbar { display: flex; gap: 2px; height: 8px; border-radius: 999px; overflow: hidden; margin: 14px 0 12px; background: var(--bg-sunken); }
.mx-allocbar > span { display: block; min-width: 3px; }
.mx-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.mx-legend-item { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 8px; text-align: left; border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.mx-legend-top { grid-column: 1 / -1; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); }
.mx-legend-top i { width: 8px; height: 8px; border-radius: 2px; }
.mx-legend-val { font-size: 15px; font-weight: 600; }
.mx-legend-val .money .cur { font-size: .75em; }
.mx-legend-pct { align-self: end; font-size: 12px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.mx-notice { display: flex; gap: 10px; align-items: flex-start; margin: 16px var(--mx-side) 0; padding: 12px 14px; border-radius: 12px; background: var(--a-100); }
.mx-notice-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--aging); margin-top: 5px; flex: none; }
.mx-notice-title { font-size: 13px; font-weight: 600; color: var(--a-900); }
.mx-notice-body { font-size: 12px; color: var(--a-800); margin-top: 2px; line-height: 1.45; }
.mx-section-block { scroll-margin-top: 12px; }
.mx-acctrow { grid-template-columns: 38px minmax(0, 1fr) auto; }
.mx-acctrow .mx-mt { display: flex; align-items: center; min-width: 0; }
.mx-acctrow .mx-mt .fresh { flex: none; }
.mx-mt-extra { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-rt .mx-sub .money .cur { color: inherit; font-size: 1em; }

/* desktop: one list per section instead of cards inside a card */
.type-section { border: 0; padding: 0; background: none; }
.type-section-head { padding: 0 4px; margin-bottom: 8px; }
.acct-list { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--bg); }
.acct-list > .acct-card { border: 0; border-radius: 0; margin: 0; }
.acct-list > .acct-card + .acct-card { border-top: 1px solid var(--border-soft); }
.acct-list > .acct-card:hover { background: var(--bg-sidebar); }
.mx-acctrow .nudge { color: var(--a-700); font-weight: 500; white-space: nowrap; }

/* Projection (phone) */
.mx-realtoggle { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-secondary); }
.mx-steprow { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 14px; position: relative; }
.mx-inset > .mx-steprow + .mx-steprow::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; border-top: 1px solid var(--border-soft); }
.mx-stepper { display: inline-flex; align-items: center; gap: 6px; }
.mx-stepper > button { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--bg-sunken); color: var(--text); font-size: 18px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.mx-stepper > button:active { background: var(--bg-active); }
.mx-stepval { display: inline-flex; align-items: baseline; justify-content: center; gap: 3px; min-width: 64px; font-variant-numeric: tabular-nums; }
.mx-stepval input { border: 0; outline: 0; background: transparent; text-align: center; font: inherit; font-size: 15px !important; font-weight: 600; color: var(--text); padding: 0; }
.mx-stepunit { font-size: 11.5px; color: var(--text-tertiary); }
.mx-insettext { padding: 14px; font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.mx-insettext .money .cur { color: inherit; font-size: 1em; }
.mx-kvrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; font-size: 14px; position: relative; }
.mx-inset > .mx-kvrow + .mx-kvrow::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; border-top: 1px solid var(--border-soft); }
.mx-kvrow > span:first-child { color: var(--text-secondary); }
.mx-kvrow .money { font-weight: 600; }
.mx-inset-more.mx-plain { padding-left: 14px; }
.mx-inset-more.mx-plain::before { left: 14px; }
.mx-yearrow { display: grid; grid-template-columns: minmax(0, 1fr) auto 16px; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; border: 0; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; position: relative; }
.mx-inset > .mx-yearrow + .mx-yearrow::before, .mx-inset > .mx-yeardetail + .mx-yearrow::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; border-top: 1px solid var(--border-soft); }
.mx-yearrow.target { background: var(--a-100); }
.mx-yeardetail { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; padding: 4px 14px 14px; }
.mx-yeardetail > div { display: flex; justify-content: space-between; font-size: 13px; }
.mx-yeardetail > div > span { color: var(--text-tertiary); }
.mx-has-savebar { padding-bottom: 76px; }
.mx-savebar {   /* glass accessory floating above the tab bar (like Music's mini player) */
  position: fixed; left: 20px; right: 20px; z-index: 44;   /* same insets as the tab bar */
  bottom: calc(var(--tabbar-top, 0px) + 12px);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 6px 6px 6px 18px; border-radius: var(--r-pill); color: var(--text);
  font-size: 13.5px; font-weight: 500;
}
.mx-savebar > div { display: flex; gap: 6px; }
.mx-savebar button { border: 0; border-radius: var(--r-pill); padding: 9px 14px; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.mx-savebar-ghost { background: transparent; color: var(--text-secondary); }
.mx-savebar-pri { background: var(--accent); color: var(--accent-text); }
.mx-savebar-pri:disabled { opacity: .7; }

/* ============================================================
   Desktop parity — same patterns as the phone screens
   ============================================================ */
/* section header: dot · label · count | note + subtotal */
.sec-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin: 24px 4px 8px; font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-tertiary);
}
.type-section > .sec-head { margin-top: 0; }
.sec-head-label { display: inline-flex; align-items: center; gap: 7px; }
.sec-dot { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.sec-head-right { display: inline-flex; align-items: baseline; gap: 12px; }
.sec-head-note { font-weight: 500; letter-spacing: 0; text-transform: none; font-size: 12px; }
.sec-head .money { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; text-transform: none; color: var(--text); }
.sec-head .money .cur { font-size: .75em; color: var(--text-tertiary); }
.acct-list-more {
  display: block; width: 100%; border: 0; border-top: 1px solid var(--border-soft); background: none;
  padding: 13px 22px; text-align: left; font: inherit; font-size: 13.5px; font-weight: 500; color: var(--b-700); cursor: pointer;
}
.acct-list-more:hover { background: var(--bg-sidebar); }
.sections { display: flex; flex-direction: column; gap: 28px; margin-top: 28px; }

/* accounts summary card */
.acct-summary { padding: 22px 24px !important; }
.acct-summary .money.lg { display: block; margin-top: 4px; }
.acct-summary .mx-allocbar { height: 10px; margin: 16px 0 16px; }
.acct-legend { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 20px; }
.acct-legend-item { display: flex; flex-direction: column; gap: 2px; text-align: left; border: 0; background: none; padding: 8px 10px; margin: -8px -10px; border-radius: var(--r-md); font: inherit; color: inherit; cursor: pointer; }
.acct-legend-item:hover { background: var(--bg-sidebar); }
.acct-legend-top { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-secondary); }
.acct-legend-top i { width: 8px; height: 8px; border-radius: 2px; }
.acct-legend-val { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.acct-legend-val .money .cur { font-size: .72em; }
.acct-legend-pct { font-size: 12px; color: var(--text-tertiary); }

/* notice + footnote */
.notice { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; padding: 12px 16px; border-radius: 12px; background: var(--a-100); }
.notice-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--aging); margin-top: 6px; flex: none; }
.notice-title { font-size: 13.5px; font-weight: 600; color: var(--a-900); }
.notice-body { font-size: 12.5px; color: var(--a-800); margin-top: 2px; }
.footnote { margin: 28px 4px 0; font-size: 12.5px; line-height: 1.6; color: var(--text-tertiary); max-width: 720px; }

/* history table year separators */
.inline-table tr.year-row td { padding-top: 18px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-tertiary); background: none; border-bottom: 1px solid var(--border); }
.inline-table tbody tr.year-row:first-child td { padding-top: 6px; }

/* inset lists inside desktop cards */
.mx-inset.flush { margin-left: 0; margin-right: 0; }
.card .sec-head { margin-left: 2px; margin-right: 2px; }

/* projection chart legend: one quiet line */
.proj-legend { gap: 6px 14px; font-size: 11.5px; color: var(--text-tertiary); margin-top: 8px; }
.proj-legend .lg-band { display: inline-block; width: 14px; height: 8px; border-radius: 2px; background: var(--g-500); opacity: .2; vertical-align: middle; margin-right: 6px; }

/* ============================================================
   Liquid Glass (iOS 26) — the floating navigation layer only: tab bar,
   nav buttons, toolbar pills, floating bars. Never on content (cards,
   lists, charts). Web pages can't get Apple's real material (SVG
   backdrop refraction is Chromium-only; -apple-visual-effect is private
   to native apps), so: frosted blur + saturation, a specular rim and a
   soft shadow. Solid first, glass where backdrop-filter exists.
   Rules: design-system/README.md › Liquid Glass.
   ============================================================ */
:where(.glass) { position: relative; }   /* zero specificity: fixed/sticky components keep theirs */
.glass {
  isolation: isolate;
  background: var(--glass-fill-solid);
  border: 0.5px solid var(--glass-edge);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-rim), inset 0 -1px 0 rgba(255,255,255,.35);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .glass {
    background-color: var(--glass-fill);
    background-image: linear-gradient(to bottom, rgba(255,255,255,.38), rgba(255,255,255,0) 55%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);   /* literal values: Safari ignores var() here */
    backdrop-filter: blur(20px) saturate(180%);
  }
}
/* Specular rim — light catches the top-left edge and fades round the sides */
.glass::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(155deg, rgba(255,255,255,.95), rgba(255,255,255,0) 35%, rgba(255,255,255,0) 65%, rgba(255,255,255,.45));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
button.glass { cursor: pointer; transition: scale 280ms var(--spring), background-color var(--dur-1) var(--ease); }
button.glass:active { scale: 1.06; }   /* glass swells under your finger */
@keyframes tb-stretch { 0% { scale: 1 1; } 35% { scale: 1.18 .9; } 70% { scale: .98 1.03; } 100% { scale: 1 1; } }
@keyframes tb-pop { 0% { scale: .8; } 55% { scale: 1.12; } 100% { scale: 1; } }
@media (prefers-contrast: more) {
  .glass { background: var(--bg); border-color: var(--border-strong); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .glass { background: var(--glass-fill-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  .tb-pill, .tab-btn svg, button.glass { transition: none; }
  .tabbar.moving .tb-pill, .tabbar.moving .tab-btn.active svg { animation: none; }
  button.glass:active { scale: 1; }
}

/* ============================================================
   Notes — the money journal (notes.jsx): composer sheet, rows,
   history, toast. See design-system/README.md › Notes.
   ============================================================ */
/* Composer: a sheet on the phone (top-anchored, so the keyboard never covers it), a dialog on desktop */
.note-layer { position: fixed; inset: 0; z-index: 80; }
.note-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.32); animation: note-fade 240ms var(--ease); }
.note-sheet { position: absolute; display: flex; flex-direction: column; background: var(--bg); color: var(--text); }
.note-sheet.phone {
  left: 0; right: 0; bottom: 0; top: max(10px, env(safe-area-inset-top)); border-radius: 22px 22px 0 0;
  box-shadow: 0 -8px 40px rgba(0,0,0,.16);
  animation: note-up 420ms cubic-bezier(.32,.72,0,1); transition: transform 260ms cubic-bezier(.32,.72,0,1);
}
.note-sheet.desk {
  left: 50%; top: 12vh; width: min(580px, calc(100vw - 48px)); max-height: 76vh; transform: translateX(-50%);
  border-radius: 20px; box-shadow: 0 24px 80px -12px rgba(0,0,0,.28), 0 0 0 1px rgba(0,0,0,.05);
  animation: note-pop 220ms var(--ease);
}
.note-layer.closing .note-backdrop { animation: note-fade-out 210ms ease-in forwards; }
.note-layer.closing:not(.dragged) .note-sheet.phone { animation: note-down 210ms ease-in forwards; }
.note-layer.closing .note-sheet.desk { animation: note-pop-out 160ms ease-in forwards; }
@keyframes note-fade { from { opacity: 0; } }
@keyframes note-fade-out { to { opacity: 0; } }
@keyframes note-up { from { transform: translateY(100%); } }
@keyframes note-down { to { transform: translateY(100%); } }
@keyframes note-pop { from { opacity: 0; transform: translateX(-50%) translateY(8px) scale(.97); } }
@keyframes note-pop-out { to { opacity: 0; transform: translateX(-50%) scale(.98); } }

.note-head { position: relative; flex: none; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 16px 14px 6px; touch-action: none; }
.note-sheet.desk .note-head { padding-top: 14px; touch-action: auto; }
.note-grabber { position: absolute; top: 6px; left: 50%; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; background: var(--border-strong); }
.note-head .mx-iconbtn.glass { width: 36px; height: 36px; color: var(--text); }
.note-title { text-align: center; font-size: 15px; font-weight: 600; }
.note-save {
  min-width: 72px; height: 36px; padding: 0 16px; border: 0; border-radius: var(--r-pill); background: var(--accent); color: var(--accent-text);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; transition: opacity var(--dur-1) var(--ease), scale 280ms var(--spring);
}
.note-save:active:not(:disabled) { scale: .96; }
.note-save:disabled { opacity: .28; cursor: default; }
.note-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 2px 20px 28px; }
.note-input {
  display: block; width: 100%; min-height: 92px; max-height: 45vh; resize: none; border: 0; outline: 0; padding: 8px 0;
  background: transparent; font: inherit; font-size: 18px !important; line-height: 1.45; color: var(--text); caret-color: var(--text);
}
.note-sheet.desk .note-input { font-size: 17px !important; min-height: 112px; }
.note-input::placeholder { color: var(--text-tertiary); }

.note-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.note-chip {
  position: relative; display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 5px 0 7px; border: 0;
  border-radius: var(--r-pill); background: var(--bg-sunken); font: inherit; font-size: 13px; font-weight: 500; color: var(--text);
  animation: chip-in 260ms var(--spring);
}
.note-chip > button { width: 22px; height: 22px; border-radius: 50%; border: 0; padding: 0; display: grid; place-items: center; background: transparent; color: var(--text-tertiary); cursor: pointer; }
.note-chip > button svg { width: 13px; height: 13px; }
.note-chip.add, .note-chip.when { padding: 0 12px 0 10px; background: transparent; color: var(--text-secondary); box-shadow: inset 0 0 0 1px var(--border-strong); cursor: pointer; animation: none; }
.note-chip.add svg, .note-chip.when svg { width: 15px; height: 15px; }
.note-chip.add.on { background: var(--text); color: var(--accent-text); box-shadow: none; }
.note-chip.when.set { color: var(--text); box-shadow: inset 0 0 0 1.5px var(--text); }
.note-chip.when input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px !important; }
@keyframes chip-in { from { opacity: 0; scale: .85; } }
.note-hint { margin-top: 10px; font-size: 12.5px; color: var(--text-tertiary); }
.note-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px; margin-top: 12px; padding: 6px; border-radius: 16px; background: var(--bg-sunken); }
.note-pick { display: flex; align-items: center; gap: 9px; min-height: 40px; padding: 6px 10px; border: 0; border-radius: 12px; background: transparent; font: inherit; font-size: 13.5px; font-weight: 500; color: var(--text); text-align: left; cursor: pointer; }
.note-pick > span:not(.logo-chip) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-pick.on { background: var(--bg); box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 0 0 1px var(--border); }
.note-pick > svg { width: 16px; height: 16px; flex: none; }
.note-err { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--r-100); color: var(--r-700); font-size: 13px; line-height: 1.45; }
.notes-setup { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: var(--a-100); color: var(--a-800); font-size: 13px; line-height: 1.5; }
.notes-setup code { font-family: var(--font-mono); font-size: 12px; }
.notes-setup-wrap { margin: 4px var(--mx-side) 0; }
.note-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--border-soft); font-size: 12.5px; color: var(--text-tertiary); }
.note-del, .note-confirm button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 0; border-radius: var(--r-pill); background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--text-secondary); cursor: pointer; }
.note-del { color: var(--negative); }
.note-del svg { width: 15px; height: 15px; }
.note-confirm { display: inline-flex; align-items: center; gap: 2px; color: var(--text); font-weight: 500; }
.note-confirm > span { margin-right: 4px; }
.note-confirm button.danger { background: var(--negative); color: #fff; padding: 6px 14px; }
.note-kbd { margin-top: 18px; font-size: 11.5px; color: var(--text-tertiary); }
.note-kbd kbd, .sb-kbd { font-family: var(--font-sans); font-size: 11px; line-height: 1.5; padding: 0 5px; border-radius: 5px; border: 1px solid var(--border); background: var(--bg-sunken); color: var(--text-secondary); }

/* Rows: full (history: time column) and compact (Overview, account pages) */
.note-row { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; width: 100%; padding: 12px 14px; border: 0; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.note-row.compact { grid-template-columns: minmax(0, 1fr); }
.note-row:active { background: var(--bg-hover); }
.mx-inset > .note-row + .note-row::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; border-top: 1px solid var(--border-soft); }
.mx-inset > .note-row + .mx-inset-more.mx-plain::before { left: 14px; }
.mx-inset > .mx-inset-more:first-child::before { display: none; }
.note-time { padding-top: 2px; font-size: 12.5px; font-weight: 500; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.note-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.note-body { font-size: 15px; line-height: 1.45; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.note-row.compact .note-body { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.note-body mark { background: var(--a-100); color: inherit; border-radius: 3px; padding: 0 1px; }
.note-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12px; color: var(--text-tertiary); }
.note-acct, .note-on { display: inline-flex; align-items: center; gap: 5px; font-weight: 500; color: var(--text-secondary); }
.note-on svg { width: 13px; height: 13px; }
.note-add { display: flex; align-items: center; gap: 8px; }
.note-add svg { width: 16px; height: 16px; flex: none; }
.note-start { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.note-start > svg { width: 16px; height: 16px; color: var(--text-tertiary); }
.note-start:active { background: var(--bg-hover); }
.mx-sechead-link { border: 0; background: none; padding: 0; font: inherit; font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--b-700); cursor: pointer; }

/* The note under a balance-history row — why it changed */
.note-line { display: flex; align-items: flex-start; gap: 6px; margin-top: 4px; font-size: 12.5px; line-height: 1.4; font-weight: 400; color: var(--text-secondary); white-space: normal; }
.note-line svg { width: 13px; height: 13px; flex: none; margin-top: 2px; color: var(--text-tertiary); }
.note-line > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.note-line b { flex: none; font-weight: 600; color: var(--text-tertiary); }
td .note-line { max-width: 440px; }

/* History */
.notes-search { display: flex; align-items: center; gap: 8px; height: 40px; margin: 8px var(--mx-side) 0; padding: 0 6px 0 12px; border-radius: 12px; background: var(--bg-sunken); color: var(--text-tertiary); }
.notes-search > svg { width: 17px; height: 17px; flex: none; }
.notes-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 15px; color: var(--text); -webkit-appearance: none; appearance: none; }
.notes-search input::-webkit-search-cancel-button { display: none; }
.notes-search button { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--text-tertiary); cursor: pointer; }
.notes-search button svg { width: 14px; height: 14px; }
.notes-filter { display: flex; align-items: center; gap: 10px; margin: 12px var(--mx-side) 0; }
.notes-filter .note-chip { animation: none; }
.notes-filter-n { font-size: 12.5px; color: var(--text-tertiary); }
.notes-foot { display: flex; align-items: flex-start; gap: 6px; margin-top: 16px; }
.notes-foot svg { width: 14px; height: 14px; flex: none; margin-top: 1px; }
.notes-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 48px 28px 24px; text-align: center; font-size: 14px; line-height: 1.5; color: var(--text-secondary); }
.notes-empty b { margin-top: 4px; font-size: 18px; font-weight: 600; color: var(--text); }
.notes-empty > span:not(.notes-empty-ic) { max-width: 330px; }
.notes-empty-ic { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 20px; background: var(--bg-sunken); color: var(--text); }
.notes-empty-ic svg { width: 28px; height: 28px; }
.note-cta { display: inline-flex; align-items: center; gap: 8px; height: 44px; margin-top: 12px; padding: 0 20px; border: 0; border-radius: var(--r-pill); background: var(--accent); color: var(--accent-text); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.note-cta svg { width: 18px; height: 18px; }
/* desktop */
.notes-col { max-width: 760px; }
.notes-desk .notes-search { height: 42px; margin: 0; background: var(--bg); box-shadow: inset 0 0 0 1px var(--border-strong); }
.notes-desk .notes-filter { margin: 12px 0 0; }
.notes-desk .notes-setup { margin: 0 0 16px; }
.notes-day { margin-top: 24px; }
.note-list { overflow: hidden; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg); }
.note-list > .note-row { padding: 14px 16px; }
.note-list > .note-row + .note-row { border-top: 1px solid var(--border-soft); }
.note-list > .note-row:hover { background: var(--bg-hover); }
.notes-card .note-list { border-radius: 14px; }
.notes-desk .notes-empty { padding: 64px 28px 40px; }
.sb-new { margin: 2px 0 8px; }
.sb-new .sb-kbd { margin-left: auto; }

/* Toast — glass pill above the tab bar (bottom-centre on desktop) */
.toast {
  position: fixed; z-index: 90; left: 50%; bottom: 24px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 10px; max-width: calc(100vw - 40px); padding: 7px 7px 7px 10px;
  border-radius: var(--r-pill); font-size: 13.5px; font-weight: 500; color: var(--text); animation: toast-in 380ms var(--spring);
}
.toast-ic { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--text); color: var(--accent-text); }
.toast-ic svg { width: 14px; height: 14px; stroke-width: 2.4; }
.toast-msg { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 6px; }
.toast button { flex: none; padding: 6px 12px; border: 0; border-radius: var(--r-pill); background: var(--glass-platter); font: inherit; font-weight: 600; color: var(--text); cursor: pointer; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 14px) scale(.96); } }
@media (max-width: 767px) { .toast { bottom: calc(var(--tabbar-top) + 12px); } }
@media (prefers-reduced-motion: reduce) {
  .note-backdrop, .note-sheet, .note-chip, .toast { animation: none !important; }
  .note-sheet.phone { transition: none; }
}

/* ============================================================
   Passcode (privacy.jsx) — the keypad that guards showing your numbers.
   Full screen on the phone (like iOS), a dialog on desktop.
   ============================================================ */
.pin-layer { position: fixed; inset: 0; z-index: 95; }
.pin-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.32); animation: note-fade 220ms var(--ease); }
.pin-sheet { position: absolute; display: flex; flex-direction: column; align-items: center; background: var(--bg); color: var(--text); }
.pin-sheet.phone { inset: 0; padding: max(56px, calc(env(safe-area-inset-top) + 40px)) 24px calc(env(safe-area-inset-bottom) + 20px); animation: pin-up 380ms cubic-bezier(.32,.72,0,1); }
.pin-sheet.desk {
  left: 50%; top: 50%; width: 360px; padding: 32px 28px 22px; border-radius: 24px; transform: translate(-50%, -50%);
  box-shadow: 0 24px 80px -12px rgba(0,0,0,.28), 0 0 0 1px rgba(0,0,0,.05); animation: pin-pop 220ms var(--ease);
}
.pin-layer.closing .pin-backdrop { animation: note-fade-out 180ms ease-in forwards; }
.pin-layer.closing .pin-sheet.phone { animation: pin-down 180ms ease-in forwards; }
.pin-layer.closing .pin-sheet.desk { animation: pin-pop-out 150ms ease-in forwards; }
@keyframes pin-up { from { transform: translateY(100%); } }
@keyframes pin-down { to { transform: translateY(100%); } }
@keyframes pin-pop { from { opacity: 0; transform: translate(-50%, -48%) scale(.97); } }
@keyframes pin-pop-out { to { opacity: 0; transform: translate(-50%, -50%) scale(.98); } }
.pin-logo { width: 52px; height: 52px; border-radius: 50%; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.pin-title { margin-top: 18px; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.pin-sub { max-width: 280px; margin-top: 4px; font-size: 14px; line-height: 1.45; color: var(--text-tertiary); text-align: center; }
.pin-dots { display: flex; gap: 18px; height: 14px; margin-top: 28px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--text-tertiary); transition: background-color 120ms, box-shadow 120ms, scale 220ms var(--spring); }
.pin-dots i.on { background: var(--text); box-shadow: inset 0 0 0 1.5px var(--text); scale: 1.08; }
.pin-dots.ok i { background: var(--positive); box-shadow: inset 0 0 0 1.5px var(--positive); }
.pin-dots.busy i.on { animation: pin-pulse 700ms ease-in-out infinite; }
.pin-dots.shake { animation: pin-shake 420ms cubic-bezier(.36,.07,.19,.97); }
@keyframes pin-shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-8px); } 40%, 60% { transform: translateX(8px); } }
@keyframes pin-pulse { 50% { opacity: .45; } }
.pin-msg { min-height: 20px; margin-top: 14px; font-size: 13px; font-weight: 500; color: var(--negative); text-align: center; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 76px); gap: 16px 26px; margin-top: auto; padding-top: 16px; }
.pin-pad button {
  width: 76px; height: 76px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--bg-sunken);
  font: inherit; font-size: 30px; font-weight: 400; color: var(--text); font-variant-numeric: tabular-nums; cursor: pointer;
  -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; transition: background-color 80ms;
}
.pin-pad button:active:not(:disabled) { background: var(--bg-active); }
.pin-pad button.pin-text { background: transparent; font-size: 15px; font-weight: 500; }
.pin-pad button.pin-text svg { width: 26px; height: 26px; }
.pin-pad button:disabled { cursor: default; }
.pin-pad.locked button:not(.pin-text) { opacity: .35; }
.pin-sheet.desk .pin-pad { grid-template-columns: repeat(3, 68px); gap: 12px 22px; margin-top: 8px; }
.pin-sheet.desk .pin-pad button { width: 68px; height: 68px; font-size: 26px; }
.pin-link { margin-top: 18px; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 500; color: var(--b-700); cursor: pointer; }
.pin-password { display: flex; flex-direction: column; align-items: stretch; width: 100%; max-width: 300px; margin-top: 24px; }
.pin-password input { height: 46px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: 12px; outline: none; background: var(--bg); font: inherit; font-size: 16px; color: var(--text); }
.pin-password input:focus { border-color: var(--text); }
.pin-go { height: 46px; margin-top: 4px; border: 0; border-radius: var(--r-pill); background: var(--accent); color: var(--accent-text); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.pin-go:disabled { opacity: .35; cursor: default; }
.pin-password .pin-link { align-self: center; }
@media (prefers-reduced-motion: reduce) { .pin-backdrop, .pin-sheet, .pin-dots { animation: none !important; } }

/* ============================================================
   The web runs the same screens as the phone: a centred column,
   with the sidebar standing in for the tab bar (iPhone → iPad).
   ============================================================ */
.mx-web { width: 100%; }
@media (min-width: 768px) {
  .mx-web { max-width: 720px; margin: 0 auto; padding: 16px 0 72px; }
  .mx-savebar { left: calc(50% + 120px); right: auto; width: min(560px, calc(100vw - 300px)); transform: translateX(-50%); bottom: 24px; }
}
@media (hover: hover) {
  button.mx-lrow:hover, button.mx-arow:hover, .note-row:hover, button.set-row:hover, .mx-inset-more:hover, .note-start:hover,
  .mx-legend-item:hover { background: var(--bg-hover); }
}

/* ============================================================
   Settings (settings.jsx) — grouped rows, a word or two each
   ============================================================ */
.set-page .mx-titlebar { padding-bottom: 4px; }
.set-profile { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 12px 14px; }
.set-profile img { width: 44px; height: 44px; border-radius: 50%; flex: none; }
.set-row {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 9px 14px;
  border: 0; background: none; text-align: left; font: inherit; color: inherit;
}
button.set-row { cursor: pointer; }
button.set-row:active:not(:disabled) { background: var(--bg-hover); }
button.set-row:disabled { cursor: progress; }
.mx-inset > .set-row + .set-row::before { content: ""; position: absolute; top: 0; left: 60px; right: 0; border-top: 1px solid var(--border-soft); }
.mx-inset > .set-row:not(:has(.mx-ico)) + .set-row::before, .mx-inset > .set-row + .set-row:not(:has(.mx-ico))::before { left: 14px; }
.set-label { flex: 1; min-width: 0; font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-value { flex: none; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: var(--text-tertiary); }
.set-row > svg { flex: none; width: 16px; height: 16px; color: var(--text-tertiary); }
.set-row.bad .set-value, .set-row.bad .set-label { color: var(--negative); }
.set-row .switch { flex: none; pointer-events: none; }
.set-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--fresh); box-shadow: 0 0 0 3px color-mix(in srgb, var(--fresh) 22%, transparent); }
.set-dot.aging { background: var(--aging); box-shadow: 0 0 0 3px color-mix(in srgb, var(--aging) 22%, transparent); }
.set-dot.stale { background: var(--stale); box-shadow: 0 0 0 3px color-mix(in srgb, var(--stale) 22%, transparent); }
.set-foot { display: flex; align-items: flex-start; gap: 6px; }
.set-foot svg { width: 13px; height: 13px; flex: none; margin-top: 2px; }
.set-out { margin-top: var(--mx-section); margin-bottom: 8px; }
.set-out button { display: block; width: 100%; padding: 14px; border: 0; background: none; font: inherit; font-size: 15px; font-weight: 600; color: var(--negative); cursor: pointer; }
.set-out button:active { background: var(--bg-hover); }

/* ============================================================
   Start-up — the splash lives in index.html (inline, paints first);
   the app fades in over it, and a hairline bar shows while the
   numbers saved on this device refresh.
   ============================================================ */
.shell { animation: app-in 260ms var(--ease) both; }
@keyframes app-in { from { opacity: 0; } }
.refresh-bar { position: absolute; top: 0; left: 0; right: 0; z-index: 60; height: 2px; overflow: hidden; pointer-events: none; }
.refresh-bar::after { content: ""; position: absolute; top: 0; bottom: 0; width: 30%; border-radius: 2px; background: var(--text); animation: refresh-slide 1.1s cubic-bezier(.65,0,.35,1) infinite; }
@keyframes refresh-slide { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
@media (prefers-reduced-motion: reduce) { .shell, .refresh-bar::after { animation: none; } }
