:root {
  --page: #f4f7f9;
  --surface: #ffffff;
  --surface-soft: #f8fafb;
  --surface-teal: #edf9f6;
  --surface-blue: #eef5ff;
  --surface-amber: #fff8e8;
  --ink: #172033;
  --ink-soft: #526075;
  --ink-faint: #7b8799;
  --line: #dce4ea;
  --line-strong: #cbd6df;
  --primary: #08766b;
  --primary-strong: #075d55;
  --blue: #2563a9;
  --amber: #b76e00;
  --rose: #b42345;
  --green: #087a55;
  --shadow-sm: 0 1px 2px rgba(22, 32, 51, .05), 0 4px 12px rgba(22, 32, 51, .04);
  --shadow-lg: 0 20px 60px rgba(22, 32, 51, .18);
  --sidebar: 256px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--page); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, a { touch-action: manipulation; }
button { color: inherit; }
a { color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--ink-soft); }
.small { font-size: 13px; }
.eyebrow {
  display: block;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.lucide { width: 18px; height: 18px; stroke-width: 2; flex: 0 0 auto; }

/* Authentication */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, .9fr) minmax(460px, 1.1fr); background: var(--surface); }
.auth-brand {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 44px clamp(32px, 6vw, 84px);
  background: #123b3a;
  color: #fff;
  overflow: hidden;
  position: relative;
}
.auth-brand::after {
  content: "";
  position: absolute;
  inset: auto -8% 12% 14%;
  height: 1px;
  background: rgba(255,255,255,.18);
  box-shadow: 0 -72px 0 rgba(255,255,255,.08), 0 72px 0 rgba(255,255,255,.08), 0 144px 0 rgba(255,255,255,.05);
  transform: rotate(-8deg);
}
.brand-lockup, .sidebar-brand { display: flex; align-items: center; gap: 11px; font-weight: 850; }
.brand-lockup { font-size: 20px; position: relative; z-index: 1; }
.brand-mark, .mobile-brand-mark {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 900;
}
.auth-brand .brand-mark { background: #fff; color: #0d6159; }
.auth-message { max-width: 550px; position: relative; z-index: 1; }
.auth-message .eyebrow { color: #86e1d1; }
.auth-message h1 { max-width: 520px; margin: 14px 0 18px; font-size: 46px; line-height: 1.07; }
.auth-message p { max-width: 520px; margin: 0; color: rgba(255,255,255,.78); font-size: 18px; line-height: 1.6; }
.auth-proof { position: relative; z-index: 1; display: flex; align-items: center; gap: 9px; color: rgba(255,255,255,.72); font-size: 13px; }
.auth-form-panel { display: grid; place-items: center; min-height: 100vh; padding: 36px; }
.auth-form-wrap { width: min(430px, 100%); }
.auth-heading { margin-bottom: 28px; }
.auth-heading h2 { margin: 0 0 8px; font-size: 30px; }
.auth-heading p { margin: 0; color: var(--ink-soft); line-height: 1.5; }
.mobile-brand-mark { display: none; margin-bottom: 22px; }
.auth-form { display: grid; gap: 16px; }
.profile-shortcuts { display: grid; gap: 10px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.profile-choice {
  width: 100%;
  display: grid;
  grid-template-columns: 40px minmax(0,1fr) 18px;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 11px;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s, box-shadow .16s, transform .16s;
}
.profile-choice:hover { border-color: #8fcac1; box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.profile-choice strong, .profile-choice small { display: block; }
.profile-choice small { margin-top: 3px; color: var(--ink-soft); }
.choice-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; }
.choice-icon.teal { color: var(--primary); background: var(--surface-teal); }
.choice-icon.blue { color: var(--blue); background: var(--surface-blue); }

/* Controls */
.button, .icon-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 750;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .15s;
}
.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
}
.button.primary { background: var(--primary); color: #fff; }
.button.primary:hover { background: var(--primary-strong); box-shadow: 0 5px 14px rgba(8,118,107,.2); }
.button.secondary { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); }
.button.secondary:hover { border-color: #9db0be; background: var(--surface-soft); }
.button.danger { background: #fff0f3; color: var(--rose); }
.button.subtle { background: transparent; color: var(--primary); }
.button.wide { width: 100%; }
.button:disabled, .icon-button:disabled { opacity: .55; cursor: wait; transform: none; }
.icon-button {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
}
.icon-button:hover { border-color: #9db0be; background: var(--surface-soft); }
.icon-button.compact { width: 32px; height: 32px; }
.icon-button.compact .lucide { width: 15px; height: 15px; }
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

.field { display: grid; gap: 7px; min-width: 0; color: #243047; font-size: 13px; font-weight: 720; }
.field small { color: var(--ink-faint); font-weight: 500; line-height: 1.4; }
.field input, .field select, .field textarea, .input-shell {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}
.field input, .field select, .field textarea { padding: 9px 11px; outline: none; }
.field textarea { min-height: 88px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input-shell:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(8,118,107,.12); }
.input-shell { display: flex; align-items: center; gap: 9px; padding: 0 11px; }
.input-shell .lucide { color: var(--ink-faint); width: 17px; }
.input-shell input { min-height: 40px; border: 0; padding: 0; box-shadow: none !important; }
.inline-error, .inline-warning, .inline-success { border-radius: 8px; padding: 11px 13px; font-size: 13px; line-height: 1.45; }
.inline-error { border: 1px solid #ffc7d2; background: #fff1f4; color: #8e1836; }
.inline-warning { border: 1px solid #f3d49c; background: var(--surface-amber); color: #794900; }
.inline-success { border: 1px solid #a8ddc8; background: #effaf5; color: #075c42; }

/* Application shell */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0,1fr); }
.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: var(--surface);
}
.sidebar-brand { min-height: 70px; padding: 14px 18px; font-size: 18px; }
.sidebar-brand .brand-mark { width: 38px; height: 38px; }
.nav-groups { flex: 1; overflow-y: auto; padding: 4px 10px 20px; }
.nav-group { margin-top: 17px; }
.nav-group:first-child { margin-top: 3px; }
.nav-group-label { display: block; padding: 0 10px 7px; color: var(--ink-faint); font-size: 10px; font-weight: 850; text-transform: uppercase; }
.nav-item {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #5b687a;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 690;
  text-align: left;
}
.nav-item:hover { background: var(--surface-soft); color: var(--ink); }
.nav-item.active { background: var(--surface-teal); color: var(--primary-strong); }
.nav-item.active .lucide { stroke-width: 2.4; }
.sidebar-footer { border-top: 1px solid var(--line); padding: 10px; }
.user-summary {
  width: 100%;
  display: grid;
  grid-template-columns: 36px minmax(0,1fr) 18px;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 8px;
  cursor: pointer;
  text-align: left;
}
.user-summary:hover { background: var(--surface-soft); }
.user-summary strong, .user-summary small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-summary strong { font-size: 13px; }
.user-summary small { margin-top: 2px; color: var(--ink-faint); font-size: 11px; }
.user-avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #dcefeb; color: var(--primary-strong); font-weight: 850; }
.workspace { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.96);
  padding: 10px clamp(18px, 3vw, 34px);
  backdrop-filter: blur(12px);
}
.page-heading { min-width: 0; display: flex; align-items: center; gap: 12px; }
.page-heading h1 { margin: 0; font-size: 22px; line-height: 1.2; }
.page-heading p { margin: 3px 0 0; color: var(--ink-soft); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.mobile-menu { display: none; }
.content { width: min(1480px, 100%); margin: 0 auto; padding: 26px clamp(18px, 3vw, 34px) 46px; }
.content-stack { display: grid; gap: 20px; }

/* Dashboard and content */
.welcome-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  border: 1px solid #b8ddd6;
  border-left: 4px solid var(--primary);
  background: var(--surface-teal);
  padding: 17px 18px;
}
.welcome-band h2 { margin: 0 0 5px; font-size: 18px; }
.welcome-band p { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.45; }
.progress-track { height: 7px; overflow: hidden; border-radius: 999px; background: #d7e6e2; }
.progress-track > span { display: block; height: 100%; background: var(--primary); transition: width .2s; }
.metrics-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.metric-card, .panel, .account-card, .empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.metric-card { min-width: 0; padding: 16px; }
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.metric-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; }
.metric-icon.teal { color: var(--primary); background: var(--surface-teal); }
.metric-icon.blue { color: var(--blue); background: var(--surface-blue); }
.metric-icon.amber { color: var(--amber); background: var(--surface-amber); }
.metric-icon.rose { color: var(--rose); background: #fff0f3; }
.metric-label { color: var(--ink-soft); font-size: 12px; font-weight: 760; }
.metric-value { margin-top: 13px; overflow: hidden; text-overflow: ellipsis; font-size: 25px; line-height: 1.15; font-weight: 850; }
.metric-help { min-height: 36px; margin-top: 7px; color: var(--ink-faint); font-size: 12px; line-height: 1.45; }
.status-dot { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 750; }
.status-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-dot.green { color: var(--green); }
.status-dot.yellow { color: var(--amber); }
.status-dot.orange, .status-dot.red { color: var(--rose); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(320px,.65fr); gap: 16px; }
.panel { min-width: 0; padding: 17px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-header h2 { margin: 0; font-size: 16px; }
.panel-header p { margin: 4px 0 0; color: var(--ink-soft); font-size: 12px; }
.quick-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.quick-action {
  min-height: 88px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 740;
  text-align: left;
}
.quick-action:hover { border-color: #9bc9c1; background: var(--surface-teal); color: var(--primary-strong); }
.quick-action .lucide { width: 20px; height: 20px; }
.account-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.account-card { position: relative; overflow: hidden; padding: 16px; }
.account-card.primary-account { border-color: #8fcac1; }
.account-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--account-color, var(--primary)); }
.account-name { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 760; }
.account-name > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-tools { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.account-balance { margin-top: 14px; font-size: 23px; font-weight: 850; }
.account-meta { margin-top: 5px; color: var(--ink-faint); font-size: 12px; }
.badge { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; border-radius: 999px; padding: 3px 8px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.badge.teal { color: var(--primary-strong); background: var(--surface-teal); }
.badge.blue { color: #1d5085; background: var(--surface-blue); }
.badge.amber { color: #744700; background: var(--surface-amber); }
.badge.rose { color: #8e1836; background: #fff0f3; }
.feed { display: grid; }
.feed-row { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); }
.feed-row:first-child { border-top: 0; padding-top: 2px; }
.feed-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: var(--surface-soft); color: var(--ink-soft); }
.feed-copy strong, .feed-copy small { display: block; }
.feed-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.feed-copy small { margin-top: 3px; color: var(--ink-faint); font-size: 11px; }
.feed-amount { text-align: right; font-size: 13px; font-weight: 820; white-space: nowrap; }
.feed-amount.expense { color: var(--rose); }
.feed-amount.income { color: var(--green); }
.empty-state { display: grid; place-items: center; min-height: 220px; padding: 28px; text-align: center; }
.empty-state-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 12px; border-radius: 8px; background: var(--surface-teal); color: var(--primary); }
.empty-state h2 { margin: 0 0 7px; font-size: 17px; }
.empty-state p { max-width: 480px; margin: 0 0 17px; color: var(--ink-soft); font-size: 13px; line-height: 1.5; }
.view-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.view-actions-left, .view-actions-right { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.search-box { width: min(300px,100%); }
.table-shell { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-sm); }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 13px; }
th { background: var(--surface-soft); color: var(--ink-faint); padding: 10px 13px; font-size: 10px; font-weight: 820; text-align: left; text-transform: uppercase; }
td { border-top: 1px solid var(--line); padding: 12px 13px; vertical-align: middle; }
.table-action-heading { width: 64px; text-align: right; }
.table-actions { width: 64px; text-align: right; white-space: nowrap; }
.amount-cell { font-weight: 820; white-space: nowrap; }
.conversion-note { margin-top: 3px; color: var(--ink-faint); font-size: 10px; }
.priority-row { padding: 13px 0; border-top: 1px solid var(--line); }
.priority-row:first-child { border-top: 0; padding-top: 0; }
.priority-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.priority-row h3 { margin: 0; font-size: 13px; }
.priority-row p { margin: 6px 0 0; color: var(--ink-soft); font-size: 12px; line-height: 1.45; }
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 52px minmax(0,1fr) 92px; gap: 8px; align-items: center; color: var(--ink-faint); font-size: 11px; }
.bar-track { height: 8px; overflow: hidden; border-radius: 999px; background: #e7edf1; }
.bar-fill { display: block; height: 100%; background: var(--blue); }

/* Forms and drawer */
.drawer { position: fixed; inset: 0; z-index: 50; display: grid; grid-template-columns: minmax(0,1fr) minmax(460px,720px); }
.drawer-backdrop { grid-column: 1 / -1; grid-row: 1; border: 0; background: rgba(15,23,42,.42); cursor: default; }
.drawer-panel { grid-column: 2; grid-row: 1; z-index: 1; height: 100vh; overflow: hidden; background: var(--surface); box-shadow: var(--shadow-lg); }
.drawer-header { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 13px 20px; }
.drawer-header h2 { margin: 3px 0 0; font-size: 21px; }
.drawer-body { height: calc(100vh - 74px); overflow-y: auto; padding: 20px; }
.form-layout { display: grid; gap: 22px; }
.form-section { display: grid; gap: 13px; }
.form-section + .form-section { padding-top: 20px; border-top: 1px solid var(--line); }
.form-section-title h3 { margin: 0; font-size: 14px; }
.form-section-title p { margin: 4px 0 0; color: var(--ink-soft); font-size: 12px; line-height: 1.45; }
.field-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.span-2 { grid-column: span 2; }
.form-actions { position: sticky; bottom: -20px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); background: rgba(255,255,255,.96); margin: 2px -20px -20px; padding: 14px 20px; backdrop-filter: blur(8px); }
.segmented { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; padding: 4px; border-radius: 8px; background: #eef2f5; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { min-height: 37px; display: flex; align-items: center; justify-content: center; gap: 6px; border-radius: 6px; color: var(--ink-soft); cursor: pointer; font-size: 12px; font-weight: 760; }
.segmented input:checked + span { background: var(--surface); color: var(--primary-strong); box-shadow: var(--shadow-sm); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; cursor: pointer; }
.switch-copy strong, .switch-copy small { display: block; }
.switch-copy strong { font-size: 13px; }
.switch-copy small { margin-top: 3px; color: var(--ink-faint); font-size: 11px; }
.switch-control { position: relative; width: 38px; height: 22px; flex: 0 0 auto; }
.switch-control input { position: absolute; opacity: 0; }
.switch-track { position: absolute; inset: 0; border-radius: 999px; background: #cbd5df; transition: background .15s; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s; }
.switch-control input:checked + .switch-track { background: var(--primary); }
.switch-control input:checked + .switch-track::after { transform: translateX(16px); }
.conversion-preview { min-height: 84px; display: grid; gap: 8px; border: 1px solid #a9d5ce; border-radius: 8px; background: var(--surface-teal); padding: 13px; }
.conversion-preview.loading { color: var(--ink-soft); }
.preview-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.preview-main strong { font-size: 14px; }
.preview-amount { color: var(--primary-strong); font-size: 20px; font-weight: 880; white-space: nowrap; }
.preview-details { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--ink-soft); font-size: 11px; }
details.advanced { border-top: 1px solid var(--line); padding-top: 14px; }
details.advanced summary { display: flex; align-items: center; gap: 7px; color: var(--primary-strong); cursor: pointer; font-size: 13px; font-weight: 760; }
details.advanced .field-grid { margin-top: 14px; }

/* Onboarding and currency */
.onboarding-list { display: grid; gap: 9px; margin-top: 16px; }
.onboarding-step { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 11px; border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.onboarding-step.current { border-color: #82c8bd; background: var(--surface-teal); }
.onboarding-step.done { background: #f4faf7; }
.step-number { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #e6edf1; color: var(--ink-soft); font-size: 11px; font-weight: 850; }
.onboarding-step.done .step-number { background: var(--green); color: #fff; }
.step-copy strong, .step-copy small { display: block; }
.step-copy strong { font-size: 13px; }
.step-copy small { margin-top: 3px; color: var(--ink-faint); font-size: 11px; line-height: 1.4; }
.rate-hero { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 18px; align-items: center; border-left: 4px solid var(--primary); background: var(--surface-teal); padding: 18px; }
.rate-hero h2 { margin: 0 0 6px; font-size: 18px; }
.rate-hero p { margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.5; }
.rate-number { text-align: right; font-size: 25px; font-weight: 880; }
.rate-number small { display: block; margin-top: 4px; color: var(--ink-faint); font-size: 11px; font-weight: 500; }
.rate-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.source-note { margin: 0; color: var(--ink-faint); font-size: 11px; line-height: 1.45; }
.source-note a { color: var(--primary); font-weight: 700; }

/* Toasts */
.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: grid; gap: 8px; width: min(390px,calc(100vw - 36px)); }
.toast { display: grid; grid-template-columns: 20px minmax(0,1fr) auto; align-items: start; gap: 9px; border: 1px solid var(--line); border-radius: 8px; background: #182333; color: #fff; padding: 12px; box-shadow: var(--shadow-lg); animation: toast-in .18s ease-out; }
.toast.success .lucide { color: #7ce0bd; }
.toast.error .lucide { color: #ff9bb1; }
.toast button { border: 0; background: transparent; color: #fff; cursor: pointer; padding: 0; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1180px) {
  .metrics-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .account-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .quick-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-form-panel { padding: 24px; }
  .mobile-brand-mark { display: inline-grid; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(286px,85vw); transform: translateX(-105%); transition: transform .18s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 19; border: 0; background: rgba(15,23,42,.34); }
  .mobile-menu { display: inline-grid; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .drawer { grid-template-columns: minmax(0,1fr) minmax(420px,680px); }
}

@media (max-width: 680px) {
  .topbar { min-height: 64px; align-items: flex-start; flex-wrap: wrap; gap: 9px; padding: 10px 14px; }
  .page-heading { width: 100%; }
  .page-heading h1 { font-size: 19px; }
  .page-heading p { max-width: calc(100vw - 92px); }
  .top-actions { width: 100%; padding-left: 52px; }
  .tutorial-button span { display: none; }
  .tutorial-button { width: 40px; padding: 0; }
  .content { padding: 16px 14px 34px; }
  .welcome-band, .rate-hero { grid-template-columns: 1fr; display: grid; align-items: start; }
  .welcome-band .button { justify-self: start; }
  .metrics-grid, .account-list, .rate-grid { grid-template-columns: 1fr; }
  .metric-help { min-height: 0; }
  .quick-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .view-actions { align-items: stretch; flex-direction: column; }
  .view-actions-left, .view-actions-right, .search-box { width: 100%; }
  .view-actions .button { flex: 1; }
  .drawer { grid-template-columns: 1fr; }
  .drawer-panel { grid-column: 1; }
  .drawer-body { padding: 16px; }
  .field-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .form-actions { bottom: -16px; margin: 2px -16px -16px; padding: 12px 16px; }
  .onboarding-step { grid-template-columns: 32px minmax(0,1fr); }
  .onboarding-step .button, .onboarding-step .badge { grid-column: 2; justify-self: start; }
  .rate-number { text-align: left; }
}

@media (max-width: 420px) {
  .auth-form-panel { place-items: start center; padding: 22px 16px; }
  .auth-heading h2 { font-size: 26px; }
  .top-actions { padding-left: 0; }
  .top-actions .button.primary { flex: 1; }
  .quick-grid { grid-template-columns: 1fr 1fr; }
  .quick-action { min-height: 82px; }
  .segmented span { font-size: 11px; }
  .preview-main { display: grid; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
