:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e6e9f0;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #6366f1;
  --accent-2: #8b5cf6;
  --pos: #16a34a;
  --neg: #e11d48;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
  --radius: 16px;
  --radius-sm: 10px;
  --sidebar-w: 248px;
  --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
}

[data-theme="dark"] {
  --bg: #0b1020;
  --surface: #131a2e;
  --surface-2: #0f1526;
  --border: #232c45;
  --text: #e8edf7;
  --muted: #94a3b8;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Layout */
/* First-load spinner overlay (hidden once the app has rendered) */
.app-loading {
  position: fixed; inset: 0; z-index: 2000;
  display: grid; place-items: center;
  background: var(--bg);
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.app-loading.hidden { opacity: 0; visibility: hidden; }
.app-loading .spinner {
  width: 44px; height: 44px; border-radius: 50%;
  border: 4px solid var(--border); border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Blocking "can't reach server" screen, rendered inside the .app-loading overlay. */
.app-loading .load-error { text-align: center; max-width: 360px; padding: 24px; }
.app-loading .load-error h2 { margin: 0 0 8px; font-size: 20px; }
.app-loading .load-error p { margin: 0 0 18px; color: var(--muted); }

/* Persistent cloud sync-status pill (fixed, bottom-right). */
.sync-status {
  position: fixed; right: 16px; bottom: 16px; z-index: 1500;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 999px;
  font: 600 12px var(--font-body, system-ui), sans-serif;
  background: var(--surface); color: var(--muted);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  transition: opacity 0.3s ease;
}
.sync-status[hidden] { display: none; }
.sync-status.synced { color: var(--pos); }
.sync-status.saving { color: var(--muted); }
.sync-status.conflict { color: var(--accent); }
.sync-status.offline,
.sync-status.failed { color: #fff; background: var(--neg); border-color: var(--neg); }
.sync-status .sync-retry {
  border: 1px solid currentColor; background: transparent; color: inherit;
  font: 700 11px var(--font-body, system-ui), sans-serif;
  padding: 2px 8px; border-radius: 999px; cursor: pointer;
}
.sync-status .sync-retry:hover { background: rgba(255, 255, 255, 0.15); }

/* Server-wins conflict notice — shown once after a reload triggered by another device. */
.conflict-banner {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 1800; max-width: min(560px, calc(100vw - 24px));
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  border: 1px solid var(--accent); box-shadow: var(--shadow);
  font-size: 13px; font-weight: 500; line-height: 1.4;
}
.conflict-banner[hidden] { display: none; }
.conflict-banner-msg { flex: 1; }
.conflict-banner-dismiss {
  flex-shrink: 0; border: none; background: var(--accent); color: #fff;
  font: 700 12px var(--font-body, system-ui), sans-serif;
  padding: 6px 14px; border-radius: 999px; cursor: pointer;
}
.conflict-banner-dismiss:hover { filter: brightness(1.05); }

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  align-items: stretch;
  min-height: 100vh;
}

/* Sidebar — sticky full-height so the nav + dark-mode toggle stay in view as the
   main column scrolls. align-self:start opts out of the grid's stretch so sticky
   works; overflow-y lets the nav scroll internally on very short viewports. */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
}

/* Sidebar header: brand on the left. On mobile, JS adds a .side-actions group
   (feedback + account) on the right; on desktop the header is just the brand. */
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; row-gap: 10px; }
.side-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: auto; }
.brand { display: flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; border-radius: 10px; }
.brand:hover { opacity: 0.85; }
.brand:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.brand-mark {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: 20px;
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}
.brand-mark.long { font-size: 13px; letter-spacing: -0.02em; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 19px; letter-spacing: -0.01em; }
.brand-sub { font-size: 12px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }

.side-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 600; font-size: 14px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(139,92,246,0.12)); color: var(--accent); }
.nav-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: 0.5; }
.nav-item.active .nav-dot { opacity: 1; }

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.side-note { font-size: 12px; color: var(--muted); margin: 0; line-height: 1.5; }
/* Feedback button — a pill in the sidebar foot (desktop)… */
.side-feedback {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font-family: inherit; font-size: 13px; font-weight: 600; border-radius: 8px;
  padding: 7px 12px; cursor: pointer;
}
.side-feedback:hover { border-color: var(--accent); color: var(--accent); }
/* …and a round icon when JS moves it into the header action group (mobile). */
.side-actions .side-feedback { width: 38px; height: 38px; padding: 0; gap: 0; justify-content: center; border-radius: 50%; background: var(--surface); font-size: 16px; }
.side-actions .side-feedback .fb-label { display: none; }

/* Main */
/* min-width:0 lets this grid column shrink below its content's intrinsic width, so
   wide tables scroll inside their .table-wrap instead of stretching the whole page. */
.main { padding: 28px 32px 48px; max-width: 1280px; width: 100%; margin: 0 auto; min-width: 0; }

.topbar {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 26px;
}
.topbar h1 { margin: 0 0 4px; font-family: var(--font-display); font-size: 30px; font-weight: 600; letter-spacing: -0.01em; }
.muted { color: var(--muted); margin: 0; font-size: 14px; }
.topbar-actions { display: flex; gap: 10px; flex-shrink: 0; align-items: center; }

/* Account menu */
.account-menu { position: relative; }
.avatar-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: var(--surface); color: var(--accent);
  border: 1px solid var(--border); transition: background 0.15s, border-color 0.15s;
}
.avatar-btn:hover { background: var(--surface-2); border-color: var(--accent); }
.account-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  min-width: 200px; max-width: calc(100vw - 28px); padding: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
  animation: pop 0.12s ease-out;
}
.account-dropdown[hidden] { display: none; }
.account-info { padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; display: flex; flex-direction: column; gap: 2px; }
.account-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.account-email { font-size: 14px; font-weight: 600; color: var(--text); word-break: break-all; }
.account-item {
  display: block; width: 100%; text-align: left;
  padding: 10px 12px; border: none; background: transparent;
  font-family: inherit; font-size: 14px; font-weight: 500; color: var(--text);
  border-radius: 8px; cursor: pointer;
}
.account-item:hover { background: var(--surface-2); }
.account-item.danger { color: var(--neg); }
.account-item.danger:hover { background: rgba(225,29,72,0.08); }

/* Buttons */
.primary-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; border: none;
  padding: 11px 18px; border-radius: var(--radius-sm);
  font-family: var(--font-display); font-weight: 600; font-size: 15px; cursor: pointer;
  box-shadow: 0 6px 16px rgba(99,102,241,0.3);
  transition: transform 0.12s, box-shadow 0.15s, opacity 0.15s;
}
.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(99,102,241,0.38); }
.primary-btn:active { transform: translateY(0); }
.primary-btn.outline {
  background: var(--surface); color: var(--accent);
  border: 1px solid var(--border); box-shadow: none;
}
.primary-btn.outline:hover { background: var(--surface-2); }
.primary-btn.small { padding: 8px 14px; font-size: 13px; }

.ghost-btn {
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 14px; border-radius: var(--radius-sm);
  font-family: var(--font-display); font-weight: 600; font-size: 14px; cursor: pointer;
  display: flex; align-items: center; gap: 8px; justify-content: center;
  transition: background 0.15s;
}
.ghost-btn:hover { background: var(--border); }
.ghost-btn.small { padding: 8px 10px; font-size: 12.5px; }

/* Theme toggle switch */
.theme-switch {
  display: flex; align-items: center; gap: 10px;
  background: transparent; border: none; cursor: pointer; padding: 4px 2px;
  font-family: inherit; color: var(--text); flex-shrink: 0;
}
.theme-track {
  position: relative; width: 46px; height: 26px; flex-shrink: 0;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; transition: background 0.2s;
}
.theme-ico {
  position: absolute; top: 50%; transform: translateY(-50%);
  font-size: 12px; line-height: 1; transition: opacity 0.2s;
}
.theme-ico.sun { left: 6px; color: #f59e0b; }
.theme-ico.moon { right: 6px; color: #cbd5e1; opacity: 0; }
.theme-knob {
  position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
  background: var(--surface); border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25); transition: transform 0.2s;
}
[data-theme="dark"] .theme-track { background: rgba(99,102,241,0.25); }
[data-theme="dark"] .theme-knob { transform: translateX(20px); }
[data-theme="dark"] .theme-ico.sun { opacity: 0; }
[data-theme="dark"] .theme-ico.moon { opacity: 1; }
.theme-text { font-size: 13px; font-weight: 600; color: var(--muted); }

/* Account settings modal */
.settings-row { display: flex; flex-direction: column; gap: 6px; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.settings-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.settings-value { font-size: 15px; font-weight: 600; word-break: break-all; }
.settings-edit-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.settings-input { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; background: var(--bg); margin-top: 6px; }
.settings-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.settings-field-label { display: block; font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 10px; }
.settings-form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.settings-hint { font-size: 12px; color: var(--muted); margin: 6px 0 0; line-height: 1.4; }
.settings-msg { font-size: 13px; margin: 6px 0 0; min-height: 16px; }
.settings-msg.ok { color: var(--pos); }
.settings-msg.err { color: var(--neg); }
.danger-zone { border: 1px solid rgba(225,29,72,0.3); border-radius: var(--radius-sm); padding: 16px; background: rgba(225,29,72,0.04); margin-top: 4px; }
.danger-zone h4 { margin: 0 0 6px; font-size: 15px; color: var(--neg); }
.danger-zone p { font-size: 13px; line-height: 1.5; margin: 0 0 14px; }
.confirm-warn { color: var(--neg); font-size: 13px; line-height: 1.5; margin: 14px 0 12px !important; }
.confirm-actions { display: flex; gap: 10px; justify-content: flex-end; }

.icon-btn {
  background: transparent; border: none; color: var(--muted);
  font-size: 24px; line-height: 1; cursor: pointer; padding: 4px 8px;
  border-radius: 8px;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 22px; }
/* The Assets vs Liabilities widget row has four stats; ≤900px it collapses to 1 col below. */
.acct-widgets { grid-template-columns: repeat(4, 1fr); }
/* Budget top row: 4 stat cards (2×2) on the left, expense bar chart filling the right. */
.budget-top { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; align-items: stretch; margin-bottom: 22px; }
.budget-cards { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 18px; }
.budget-cards .card.stat { justify-content: center; } /* center content when stretched to match the chart card */
.budget-breakdown { margin: 0; }
.chart-wrap.budget-bars { height: 210px; }
@media (max-width: 860px) { .budget-top { grid-template-columns: 1fr; } .budget-cards { grid-template-rows: auto; } }
.card.stat { padding: 20px 22px; display: flex; flex-direction: column; gap: 6px; }
.stat-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat-value { font-family: var(--font-display); font-size: 34px; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: lining-nums tabular-nums; }
.stat-value.pos { color: var(--pos); }
.stat-value.neg { color: var(--neg); }
.stat-meta { font-size: 12px; color: var(--muted); }
.card.stat.highlight {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none; color: #fff;
}
.card.stat.highlight .stat-label,
.card.stat.highlight .stat-meta { color: rgba(255,255,255,0.85); }
.card.stat.highlight .stat-value { color: #fff; }

/* Milestone progress strip */
.milestone-card { padding: 16px 22px; margin-bottom: 18px; display: flex; flex-direction: column; gap: 10px; }
.milestone-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.milestone-head-right { display: flex; align-items: baseline; gap: 14px; }
.milestone-title { font-size: 13px; font-weight: 600; color: var(--muted); }
.milestone-status { font-size: 13px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.milestone-status .ms-pct { color: var(--accent); }
.goal-btn { white-space: nowrap; flex-shrink: 0; }
.milestone-track { display: flex; align-items: center; gap: 12px; }
.milestone-target { font-size: 13px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.milestone-bar { flex: 1; height: 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.milestone-fill {
  height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.4s ease;
}
.goal-editor { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.goal-editor[hidden] { display: none; }
.goal-editor input {
  flex: 1; max-width: 260px; font-family: inherit; font-size: 14px; color: var(--text);
  padding: 9px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2);
}
.goal-editor input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }

/* Charts */
.chart-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 18px; }
/* Assets-by-category / liabilities-by-category donuts: two equal columns. */
.acct-cat-charts { grid-template-columns: 1fr 1fr; }
/* Breathing room above the standalone month bar on the Assets vs Liabilities view. */
#view-accounts .actuals-bar { margin-top: 22px; }
.chart-card { padding: 20px 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-head.wrap { flex-wrap: wrap; gap: 10px; }
.range-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.date-range { display: flex; align-items: center; gap: 6px; }
.month-picker { position: relative; }
.month-field {
  font-family: inherit; font-size: 12px;
  padding: 5px 10px; border-radius: 8px; min-width: 86px; text-align: center;
  border: 1px solid var(--border); background: var(--surface-2); cursor: pointer;
  color: var(--muted); transition: border-color 0.15s, color 0.15s;
}
.month-field:hover { border-color: var(--accent); }
.month-field.has-value { color: var(--text); font-weight: 600; }
.month-field[aria-expanded="true"] { border-color: var(--accent); }

.month-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30;
  width: 224px; padding: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.month-pop[hidden] { display: none; }
.month-pop-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.mp-year { font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.mp-nav {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  width: 26px; height: 26px; border-radius: 7px; cursor: pointer; font-size: 14px; line-height: 1;
}
.mp-nav:hover:not(:disabled) { background: var(--border); }
.mp-nav:disabled { opacity: 0.35; cursor: default; }
.month-pop-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mp-month {
  background: transparent; border: 1px solid transparent; color: var(--text);
  padding: 8px 0; border-radius: 7px; cursor: pointer; font-size: 12.5px; font-weight: 600;
}
.mp-month:hover:not(:disabled) { background: var(--surface-2); }
.mp-month.selected { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.mp-month:disabled { opacity: 0.3; cursor: default; }
.date-sep { color: var(--muted); font-size: 12px; }
.card-head h2 { margin: 0; font-family: var(--font-display); font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.chart-wrap { position: relative; height: 280px; }
.chart-wrap.donut { height: 220px; }

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.seg button {
  border: none; background: transparent; color: var(--muted);
  font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 999px; cursor: pointer;
}
.seg button.active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }

.legend { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.legend-swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.legend-name { color: var(--text); font-weight: 500; }
.legend-val { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }

.empty-hint { color: var(--muted); font-size: 13px; text-align: center; padding: 24px 12px; margin: 0; }
/* Empty-state hint that sits inside a fixed-height chart area — center it rather than
   leaving the message stranded below a tall blank box. :not([hidden]) so the flex
   display doesn't override the `hidden` attribute and overlay a populated chart. */
.chart-empty:not([hidden]) { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }

/* Tables */
.table-card { padding: 20px 22px; }
.table-wrap { overflow-x: auto; }
.acct-table { width: 100%; border-collapse: collapse; }
.acct-table th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--border);
}
.acct-table td { padding: 13px 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
.acct-table tr:last-child td { border-bottom: none; }
.acct-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.acct-table tbody tr:hover { background: var(--surface-2); }

.pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
  min-width: 78px; text-align: center;
}
.pill.asset { color: var(--pos); border-color: rgba(22,163,74,0.3); background: rgba(22,163,74,0.08); }
.pill.liability { color: var(--neg); border-color: rgba(225,29,72,0.3); background: rgba(225,29,72,0.08); }

.link-btn { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 600; padding: 4px 8px; border-radius: 6px; }
.link-btn:hover { color: var(--accent); background: var(--surface-2); }

/* Select-to-delete */
.head-actions { display: flex; align-items: center; gap: 10px; }
/* Budget: shared toolbar (month picker left, bulk actions right) above the two tables. */
.budget-toolbar-actions { margin-left: auto; }
#budgetTables .card.table-card { margin-bottom: 18px; }
#budgetTables .card.table-card:last-child { margin-bottom: 0; }
.select-hint { margin: -6px 0 14px; font-size: 12px; color: var(--muted); }
.muted-cell { font-size: 12px; color: var(--muted); cursor: help; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.pager-arrow { min-width: 32px; padding-left: 0; padding-right: 0; font-size: 16px; line-height: 1; }
.pager-status { font-size: 13px; color: var(--muted); font-weight: 600; margin-left: 4px; }
.pager button:disabled { opacity: 0.4; cursor: default; }

/* Budget vs actual: month nav + summary + per-line actual input */
.actuals-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 2px 0 12px; }
.actuals-monthnav { display: flex; align-items: center; gap: 6px; }
.actuals-month { font-size: 14px; font-weight: 700; min-width: 110px; text-align: center; }
.actuals-summary { margin: 0; font-size: 13px; font-weight: 600; }
.actuals-summary.muted { font-weight: 500; }
.actuals-summary.pos { color: var(--pos); }
.actuals-summary.neg { color: var(--neg); }
.actuals-monthnav button:disabled { opacity: 0.4; cursor: default; }
.actual-input {
  width: 88px; padding: 5px 8px; text-align: right; font-size: 14px;
  font-variant-numeric: tabular-nums; border: 1px solid var(--border);
  border-radius: 7px; background: var(--bg); color: var(--text);
}
.actual-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

/* Per-account month-over-month change pill (Accounts table) */
.chg-pill {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.chg-pill.good { color: var(--pos); background: rgba(22,163,74,0.14); }
.chg-pill.bad { color: var(--neg); background: rgba(225,29,72,0.14); }
.chg-pill.flat { color: var(--accent-2); background: rgba(139,92,246,0.14); font-weight: 600; }

/* Accounts table: the Value (input) and Change (pill) cells hold boxed content with
   ~9px of inner right inset, so the right-aligned numeric headers would sit flush at
   the cell edge — 9px to the right of the digits. Nudge those headers in to line up
   over the box content. Scoped to .accounts-table so the budget table is unaffected. */
.accounts-table th.num { padding-right: 21px; }

/* Savings goals (sinking funds) */
/* Stats strip and the goal cards below share one column grid so the cards line up
   directly under the stat boxes (3 across, collapsing to 2 then 1 on smaller screens). */
.goals-stats,
.goals-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.goals-stats { margin-bottom: 16px; }
.goals-stats[hidden] { display: none; }
.goals-stats .card.stat { padding: 16px 18px; }
.goals-stats .stat-value { font-size: 28px; }
.goal-card { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; background: var(--surface-2); }
.goal-card.done { border-color: var(--pos); }
.goal-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; margin-bottom: 10px; }
.goal-name { font-weight: 700; }
.goal-amounts { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.goal-of { color: var(--muted); font-weight: 500; }
.goal-bar { height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; }
.goal-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.goal-card.done .goal-fill { background: var(--pos); }
.goal-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; font-size: 13px; }
.goal-pct { color: var(--muted); font-weight: 600; }
.goal-remaining { color: var(--muted); font-variant-numeric: tabular-nums; }
.goal-card.done .goal-remaining { color: var(--pos); font-weight: 600; }
.goal-pace { margin-top: 8px; font-size: 12.5px; color: var(--muted); min-height: 1.4em; }
.goal-pace strong { color: var(--text); font-weight: 700; }
.goal-pace.warn { color: var(--neg); }
/* margin-top: auto pins the actions (and their top separator) to the bottom of the
   card, so the line separator sits at the same height across cards regardless of
   whether a target-date pace line is present. */
.goal-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.goal-act-group { display: flex; gap: 10px; align-items: center; }
/* Small grey outline pill — used for the Add / Withdraw goal actions. */
.pill-btn { font: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; padding: 5px 13px; border-radius: 999px; border: 1px solid var(--border); background: transparent; transition: background .15s, border-color .15s, color .15s; }
.pill-btn:hover { background: var(--surface-2); border-color: var(--muted); color: var(--text); }
.contrib-context { margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.confirm-text { margin: 0 0 4px; font-size: 14px; line-height: 1.55; color: var(--text); }
.field-opt { font-weight: 500; color: var(--muted); }
.field-hint { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.link-btn.danger { color: var(--neg); }
.acct-table tbody tr.selectable { cursor: pointer; }
.acct-table tbody tr.selected { background: rgba(99, 102, 241, 0.12); }
.acct-table tbody tr.selected:hover { background: rgba(99, 102, 241, 0.16); }

/* Drag-and-drop row reordering */
.drag-col { width: 20px; padding: 0 !important; }
.drag-handle { width: 20px; text-align: center; cursor: grab; color: var(--border); font-size: 16px; user-select: none; }
.drag-handle:hover { color: var(--muted); }
.acct-table tbody tr.drag-dragging { opacity: 0.4; }
.acct-table tbody tr.drag-over { outline: 2px solid var(--accent); outline-offset: -1px; background: rgba(99,102,241,0.07); }

.danger-btn {
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--border);
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-family: var(--font-display); font-weight: 600; font-size: 13px;
  cursor: not-allowed; opacity: 0.5;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s, opacity 0.15s, transform 0.12s;
}
.danger-btn:not(:disabled) {
  background: var(--neg); color: #fff; border-color: var(--neg);
  cursor: pointer; opacity: 1;
  box-shadow: 0 6px 16px rgba(225, 29, 72, 0.3);
}
.danger-btn:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(225, 29, 72, 0.4); }
.danger-btn:not(:disabled):active { transform: translateY(0); }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 20px; z-index: 50;
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); width: 100%; max-width: 440px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.25);
  animation: pop 0.15s ease-out;
}
#acctHistModal .modal { max-width: 560px; }
@keyframes pop { from { transform: translateY(8px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-family: var(--font-display); font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.modal-body { padding: 20px 22px; display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); min-width: 0; }
/* The `hidden` attribute must beat `.field`'s display:flex, else conditionally-shown
   fields (e.g. budget "Whose income?" / "Split this bill") never actually hide. */
.field[hidden] { display: none; }
.field input, .field select, .field textarea {
  font-family: inherit; font-size: 15px; color: var(--text);
  padding: 11px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2);
  font-weight: 500; width: 100%; box-sizing: border-box;
}
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

/* Rebalance nudge — drift between live asset mix and the user's target allocation */
.rebalance-nudge {
  margin-top: 14px; padding: 11px 13px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 13px; line-height: 1.5; color: var(--text);
  display: flex; gap: 8px; align-items: baseline;
}
.rebalance-nudge .rb-icon { flex-shrink: 0; }
.rebalance-nudge.on-target { color: var(--muted); }
.rebalance-nudge.on-target .rb-icon { color: var(--pos); }

/* Target allocation modal rows: category label + % input on one line */
.target-row { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; color: var(--text); }
.target-input { display: inline-flex; align-items: center; gap: 6px; }
.target-input input { width: 84px; text-align: right; }
.target-input .pct { color: var(--muted); font-weight: 600; }
.target-total { margin: 8px 0 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.target-total.over { color: var(--neg); }

/* Bill splitting (shared expenses) */
.split-badge { display: inline-block; font-size: 10.5px; font-weight: 700; color: var(--accent); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 1px 7px; margin-left: 6px; vertical-align: middle; white-space: nowrap; }
.cell-sub { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
.split-pct-input { margin-top: 8px; }

/* Joint-account pill: two-colour bar showing each person's share of shared bills */
.joint-pill { padding: 16px 20px; margin-bottom: 22px; }
.joint-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; margin-bottom: 10px; }
.joint-head h2 { margin: 0; font-family: var(--font-display); font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.joint-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13.5px; }
.joint-item { display: inline-flex; align-items: center; gap: 7px; color: var(--text); }
.joint-item strong { font-weight: 700; }
.joint-dot { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.joint-dot.me, .joint-seg.me { background: var(--accent); }
/* Cyan for the partner share — clearer contrast against the indigo "me" segment
   than --accent-2 (purple), which is too close in hue. Scoped to the joint bar. */
.joint-dot.partner, .joint-seg.partner { background: #06b6d4; }
.joint-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--border); }
.joint-seg { transition: width .2s ease; }
.joint-caption { font-size: 13px; color: var(--muted); margin: 10px 0 0; }

/* Income-first onboarding modal */
.intro-lead { font-size: 14.5px; line-height: 1.55; color: var(--muted); margin: 0 0 18px; }

/* Budget insight stats: annual surplus, biggest expense, subscriptions (descriptive, no targets) */
.insights-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 22px; }
.insights-row[hidden] { display: none; } /* grid display would otherwise override the `hidden` attribute */
/* A notch smaller than the headline KPIs above, so these read as a secondary "at a glance" row. */
.insight-stat .stat-value { font-size: 27px; }
.insight-stat .stat-meta { min-height: 16px; } /* keep tile heights even when a meta line is empty */
.link-btn.inline { padding: 0; font-size: inherit; vertical-align: baseline; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.link-btn.inline:hover { background: none; color: var(--accent); text-decoration: underline; opacity: 0.8; }
@media (max-width: 860px) { .insights-row { grid-template-columns: 1fr; gap: 18px; } }

/* Additional tools — expandable sidebar group */
.nav-group { display: flex; flex-direction: column; gap: 4px; }
.nav-caret { margin-left: auto; font-size: 18px; line-height: 1; opacity: 0.6; transition: transform 0.2s; }
.nav-group.expanded .nav-caret { transform: rotate(90deg); }
.nav-sub { display: none; flex-direction: column; gap: 2px; }
.nav-group.expanded .nav-sub { display: flex; }
.nav-item.sub { padding: 9px 12px 9px 30px; font-size: 13px; }
.nav-item.sub .nav-dot { width: 5px; height: 5px; }

/* Tool views (shown in the main area like any other view) */
.tool-card { padding: 24px 26px; }
/* stretch so the inputs panel and the result panel are always the same height and their edges line up */
.tool-layout { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; align-items: stretch; }
.tool-inputs {
  display: flex; flex-direction: column; gap: 16px; min-width: 0;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 20px;
}
/* fields now sit on a surface-2 panel, so lift their fill to the base surface for contrast */
.tool-inputs .field input, .tool-inputs .field select { background: var(--surface); }
/* Saved-configuration bar: load a preset from the dropdown, or save the current inputs. */
.calc-presets { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.calc-presets .preset-select {
  flex: 1 1 160px; min-width: 0; font-family: inherit; font-size: 13px; color: var(--text);
  padding: 8px 10px; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm);
}
/* Save = purple, Delete = red (delete only shows once a preset is selected). */
.calc-presets .preset-save { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.calc-presets .preset-save:hover { filter: brightness(1.06); }
.calc-presets .preset-del { background: var(--neg); border-color: var(--neg); color: #fff; }
.calc-presets .preset-del:hover { filter: brightness(1.06); }
.tool-explainer { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 0 0 18px; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.fire-rate-hint { font-size: 11px; color: var(--muted); font-weight: 500; }

/* App-wide disclaimer footer (shown under every view). */
.app-footer { margin-top: 36px; padding: 16px 0 4px; border-top: 1px solid var(--border); font-size: 11.5px; line-height: 1.5; color: var(--muted); text-align: center; max-width: 760px; margin-left: auto; margin-right: auto; }
input.fire-rate-capped { border-color: var(--neg) !important; outline-color: var(--neg); }
input.fire-rate-capped + .fire-rate-hint { color: var(--neg); font-weight: 600; }
.tool-chart { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border); }
.tool-breakdown { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border); }

.tool-result {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 20px;
  display: flex; flex-direction: column; gap: 18px;
  min-width: 0; /* allow the grid track to shrink instead of being forced wide by a long value */
}
.tr-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 14px; min-width: 0; }
.tr-label { color: var(--muted); font-weight: 600; flex-shrink: 0; }
/* Long values wrap/break instead of overflowing and distorting the layout. */
.tr-val { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 0; text-align: right; overflow-wrap: anywhere; }
.tr-row.highlight { padding-bottom: 18px; border-bottom: 1px solid var(--border); margin-bottom: 2px; }
.tr-row.highlight .tr-val { font-family: var(--font-display); font-size: 26px; color: var(--accent); }

@media (max-width: 720px) { .tool-layout { grid-template-columns: 1fr; } }

/* Invest vs mortgage — full-width inputs, a verdict banner, then two side-by-side scenario cards */
.im-inputs { margin-bottom: 18px; }
.im-verdict {
  background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(139,92,246,0.12));
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: var(--radius-sm); padding: 13px 18px; margin-bottom: 16px;
  font-size: 14px; line-height: 1.5; color: var(--text);
}
.im-verdict:empty { display: none; }
.im-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: stretch; }
.im-scenario {
  background: var(--surface-2); border: 1px solid var(--border);
  border-top: 3px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0;
}
.im-scenario-overpay { border-top-color: var(--pos); }
.im-scenario-invest { border-top-color: var(--accent); }
.im-scenario-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.im-scenario-title { margin: 0; font-size: 15px; }
/* "Suggested" badge — JS shows it on whichever route comes out ahead on the entered numbers. */
.im-scenario-pill {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
  color: var(--pos); background: rgba(22,163,74,0.13);
}
.im-scenario-pill[hidden] { display: none; }
.im-scenario-sub { margin: -6px 0 2px; font-size: 12px; color: var(--muted); line-height: 1.4; }
.im-rows { display: flex; flex-direction: column; gap: 11px; }
.im-scenario .tr-row { font-size: 13.5px; }
/* Per-card narrative — spells out the phases (overpay → invest the freed-up payment). */
.im-scenario-note { margin: 2px 0 0; padding-top: 12px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); line-height: 1.45; }
@media (max-width: 720px) { .im-cards { grid-template-columns: 1fr; } }

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--surface);
  padding: 12px 20px; border-radius: 999px; font-size: 14px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25); z-index: 60;
  animation: rise 0.2s ease-out;
}
@keyframes rise { from { transform: translateX(-50%) translateY(10px); opacity: 0; } to { transform: translateX(-50%); opacity: 1; } }

/* Responsive */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: static; height: auto; overflow: visible; align-self: auto;
    flex-direction: row; align-items: center;
    gap: 16px; flex-wrap: wrap; padding: 14px 18px; min-width: 0;
  }
  /* Nav wraps onto as many rows as needed so EVERY item is visible (no horizontal
     scroll). The "Additional tools" group is flattened inline (toggle hidden, the 4
     calculators shown as normal items) so it wraps cleanly with the rest. */
  .side-nav {
    flex-direction: row; flex-wrap: wrap; margin-left: auto;
    min-width: 0; gap: 6px;
  }
  .nav-item { white-space: nowrap; flex: 0 0 auto; }
  .nav-group { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  #toolsToggle { display: none; }
  .nav-sub { display: flex; flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .nav-item.sub { padding: 11px 12px; }
  .nav-item.sub .nav-dot { width: 7px; height: 7px; }
  /* The only thing left in the foot is the synced note, which is hidden on mobile —
     so the foot has nothing to show. (Feedback + dark mode now live in the header.) */
  .side-foot { display: none; }
  .cards { grid-template-columns: 1fr; }
  .chart-grid { grid-template-columns: 1fr; }
  .goals-stats, .goals-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .main { padding: 20px; }
  /* Keep the title + avatar on one row; avatar stays top-right. */
  .topbar { flex-direction: row; align-items: flex-start; }
  .topbar-actions { justify-content: flex-end; }
}

/* Phones: stack the sidebar vertically, full-width nav, single-column grids,
   full-width modals + stacked form fields. */
@media (max-width: 600px) {
  .sidebar { flex-direction: column; align-items: stretch; gap: 14px; padding: 14px 16px; }
  .side-nav { margin-left: 0; gap: 6px; }
  .nav-item { padding: 11px 12px; font-size: 13px; }
  .main { padding: 16px 14px 40px; }
  /* Title + avatar stay on one row (row inherited from the ≤900 block); avatar
     stays top-right so the account dropdown opens into the viewport, not off-screen. */
  .topbar { gap: 12px; }
  .topbar h1 { font-size: 24px; }
  .budget-cards { grid-template-columns: 1fr; }
  .goals-stats, .goals-grid { grid-template-columns: 1fr; }
  .stat-value { font-size: 27px; }
  .field-row { grid-template-columns: 1fr; }
  .modal-overlay { padding: 12px; }
  .modal { max-width: none; }
  .sync-status { right: 10px; bottom: 10px; padding: 6px 10px; font-size: 11px; }
}

/* Onboarding tour (first signup) — spotlight + guide card. Built by tour.js.
   Backdrop captures clicks so the dimmed area is a deliberate no-op; the card sits
   above it. The spotlight itself is purely visual (pointer-events: none). */
.tour-backdrop { position: fixed; inset: 0; z-index: 1000; background: transparent; }
.tour-spotlight {
  position: fixed; z-index: 1001; pointer-events: none;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.55), 0 0 0 2px var(--accent);
  transition: top 0.18s ease, left 0.18s ease, width 0.18s ease, height 0.18s ease;
}
.tour-card {
  position: fixed; z-index: 1002; width: min(360px, calc(100vw - 24px));
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
  padding: 18px 20px; animation: pop 0.15s ease-out;
}
.tour-card-centered { top: 50% !important; left: 50% !important; transform: translate(-50%, -50%); }
.tour-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tour-title { margin: 0; font-family: var(--font-display); font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.tour-close {
  flex: none; border: none; background: none; cursor: pointer; padding: 0;
  width: 28px; height: 28px; border-radius: var(--radius-sm); font-size: 22px; line-height: 1;
  color: var(--muted);
}
.tour-close:hover { background: var(--surface-2); color: var(--text); }
.tour-body { margin: 10px 0 16px; font-size: 14px; line-height: 1.55; color: var(--text); }
.tour-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tour-foot-left { display: flex; align-items: center; gap: 14px; }
.tour-counter { font-size: 12px; font-weight: 600; color: var(--muted); }
.tour-btns { display: flex; align-items: center; gap: 8px; }
.tour-skip {
  border: none; background: none; cursor: pointer; padding: 6px 4px;
  font: inherit; font-size: 12px; font-weight: 600; color: var(--muted); text-decoration: underline;
}
.tour-skip:hover { color: var(--text); }

/* Phase-2 calculator hub: form fields + menu choices inside the card. */
.tour-field { margin-top: 12px; }
.tour-choice {
  display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left;
  margin-top: 10px; padding: 11px 13px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  font: inherit; color: var(--text); transition: border-color 0.15s, transform 0.05s;
}
.tour-choice:hover { border-color: var(--accent); }
.tour-choice:active { transform: translateY(1px); }
.tour-choice-name { font-weight: 700; font-size: 14px; }
.tour-choice-desc { font-size: 12px; color: var(--muted); }

@media (max-width: 600px) {
  /* Pin the card to the bottom on phones so it never overlaps the spotlighted target. */
  .tour-card { top: auto !important; bottom: 14px; left: 50% !important; transform: translateX(-50%); width: calc(100vw - 24px); }
  .tour-card-centered { top: auto !important; transform: translateX(-50%); }
}
