:root {
  --ink: #101a33;
  --muted: #6b7690;
  --line: rgba(16, 26, 51, 0.09);
  --paper: #f4f7fc;
  --white: #ffffff;
  --surface: #ffffff;
  --glass: rgba(255, 255, 255, 0.72);
  --green: #10b981;
  --deep: #17224a;
  --navy: #1d2b57;
  --navy-deep: #131d3f;
  --cyan: #08a9b8;
  --amber: #f4a62a;
  --red: #d94a3a;
  --shadow: 0 20px 46px rgba(19, 29, 63, 0.1);
  --body-bg:
    radial-gradient(circle at 12% 8%, rgba(160, 192, 236, 0.55), transparent 42%),
    radial-gradient(circle at 88% 78%, rgba(198, 210, 240, 0.5), transparent 46%),
    linear-gradient(160deg, #e7edf9 0%, #eef2fa 45%, #eef1f8 100%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #eef1fb;
    --muted: #9aa5c3;
    --line: rgba(238, 241, 251, 0.12);
    --paper: #0b1226;
    --surface: #1b2748;
    --glass: rgba(27, 39, 72, 0.72);
    --shadow: 0 20px 46px rgba(0, 0, 0, 0.35);
    --body-bg:
      radial-gradient(circle at 12% 8%, rgba(29, 43, 87, 0.55), transparent 42%),
      radial-gradient(circle at 88% 78%, rgba(23, 34, 74, 0.5), transparent 46%),
      linear-gradient(160deg, #070b17 0%, #0b1226 45%, #0c1428 100%);
  }
}

:root[data-theme="dark"] {
  --ink: #eef1fb;
  --muted: #9aa5c3;
  --line: rgba(238, 241, 251, 0.12);
  --paper: #0b1226;
  --surface: #1b2748;
  --glass: rgba(27, 39, 72, 0.72);
  --shadow: 0 20px 46px rgba(0, 0, 0, 0.35);
  --body-bg:
    radial-gradient(circle at 12% 8%, rgba(29, 43, 87, 0.55), transparent 42%),
    radial-gradient(circle at 88% 78%, rgba(23, 34, 74, 0.5), transparent 46%),
    linear-gradient(160deg, #070b17 0%, #0b1226 45%, #0c1428 100%);
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--body-bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
  color: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  background: transparent;
  padding: 26px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand-mark {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--white);
  background: linear-gradient(150deg, var(--navy), var(--navy-deep));
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.02em;
  box-shadow: 0 12px 24px rgba(19, 29, 63, 0.28);
}

.nav-list {
  display: grid;
  gap: 12px;
  flex-shrink: 0;
  background: var(--glass);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 14px 10px;
  box-shadow: var(--shadow);
}

.nav-item {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #8891a8;
  display: grid;
  place-items: center;
}

.nav-item-logout {
  flex-shrink: 0;
  margin-top: auto;
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  color: var(--red);
}

.nav-item-logout:hover {
  background: #ffe3df;
  color: var(--red);
}

.nav-item svg {
  width: 20px;
  height: 20px;
}

.nav-item:hover {
  color: var(--ink);
  background: rgba(29, 43, 87, 0.08);
}

.nav-item.active {
  background: linear-gradient(150deg, var(--navy), var(--navy-deep));
  color: var(--white);
  box-shadow: 0 10px 20px rgba(19, 29, 63, 0.32);
}

.workspace {
  padding: 24px 24px 24px 0;
  min-width: 0;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 22px;
}

.topbar-lead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 22px;
}

.topbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 9px;
}

.wordmark-mark {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, var(--navy), var(--navy-deep));
  color: var(--white);
  font-weight: 800;
  font-size: 12px;
}

.wordmark strong {
  font-size: 17px;
  letter-spacing: 0.01em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  display: grid;
  place-items: center;
  color: var(--muted);
  position: relative;
  box-shadow: 0 8px 20px rgba(19, 29, 63, 0.06);
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.icon-button:hover {
  color: var(--ink);
  border-color: rgba(29, 43, 87, 0.24);
}

.icon-button-ghost {
  width: 34px;
  height: 34px;
  box-shadow: none;
}

.icon-dot {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--red);
  border: 1.5px solid var(--white);
}

.notification-wrap,
.search-wrap {
  position: relative;
}

.search-panel {
  position: absolute;
  right: 0;
  top: 52px;
  width: 320px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 12px;
  z-index: 10;
}

.search-panel input {
  margin-bottom: 8px;
}

.search-results {
  display: grid;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
}

.search-result-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
  background: transparent;
  border: 0;
  text-align: left;
  width: 100%;
  color: var(--ink);
}

.search-result-row:hover {
  background: #eef2fb;
}

.search-result-row small {
  color: var(--muted);
  display: block;
}

.search-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 8px 10px;
}

.notification-panel {
  position: absolute;
  right: 0;
  top: 52px;
  width: 280px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 14px;
  z-index: 10;
}

.notification-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 800;
  margin-bottom: 10px;
}

.notification-panel-head .text-button {
  font-weight: 700;
  font-size: 12px;
}

.notification-list {
  max-height: 340px;
  overflow-y: auto;
}

.notification-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 6px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  border-radius: 10px;
  cursor: pointer;
}

.notification-row:hover {
  background: var(--paper);
}

.notification-row:first-of-type {
  border-top: 0;
}

.notification-row span {
  display: block;
  font-weight: 700;
}

.notification-row small {
  display: block;
  color: var(--muted);
  font-weight: 400;
  margin-top: 2px;
}

.notification-row.unread span {
  color: var(--navy);
}

.notification-unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--red);
  flex: none;
  margin-top: 4px;
}

.notification-empty {
  color: var(--muted);
  font-size: 13px;
}

.avatar-chip {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, #f4a62a, #d94a3a);
  color: var(--white);
  font-weight: 800;
  font-size: 13px;
}

.inline-icon {
  width: 15px;
  height: 15px;
  vertical-align: -3px;
  margin-right: 4px;
}

.eyebrow {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 4px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: 34px;
  margin-bottom: 0;
  letter-spacing: 0;
}

h2 {
  font-size: 24px;
  margin-bottom: 8px;
  letter-spacing: 0;
}

.status-pill {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 20px rgba(7, 25, 22, 0.06);
  white-space: nowrap;
}

.pulse {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.16);
}

.pulse.warning {
  background: var(--amber);
  box-shadow: 0 0 0 5px rgba(244, 166, 42, 0.16);
}

.section {
  display: none;
}

.section.active {
  display: block;
}

.merchant-grid,
.security-grid,
.developer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 0.9fr);
  gap: 16px;
  align-items: start;
}

.home-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.pay-layout,
.cards-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
}

.account-panel,
.wide-panel,
.form-panel,
.qr-panel,
.stat-tile {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--glass);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  padding: 20px;
}

.account-panel {
  color: var(--white);
  background:
    linear-gradient(150deg, rgba(23, 34, 74, 0.97), rgba(29, 43, 87, 0.94)),
    repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255, 255, 255, 0.05) 10px, rgba(255, 255, 255, 0.05) 12px);
}

.account-panel p {
  color: #cad3ea;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--muted);
}

.panel-head strong {
  color: var(--ink);
}

.account-panel .panel-head,
.account-panel .panel-head strong {
  color: #eef1fb;
}

.account-panel .icon-button-ghost {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
  color: #eef1fb;
}

.stat-tile-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
}

.stat-tile-row-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-tile {
  display: grid;
  gap: 6px;
}

.stat-tile span {
  color: var(--muted);
  font-size: 13px;
}

.stat-tile strong {
  font-size: 26px;
}

.stat-badge {
  justify-self: start;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
}

.stat-badge-up {
  color: #047857;
  background: #d7fbe9;
}

.stat-badge-down {
  color: var(--red);
  background: #ffe3df;
}

.mini-bar-chart {
  height: 120px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  align-items: end;
}

.mini-bar-chart span {
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--navy), var(--cyan));
}

.mini-bar-chart-paired {
  align-items: end;
  gap: 6px;
}

.mini-bar-chart-paired > div {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  height: 100%;
}

.mini-bar-chart-paired .insights-bar {
  max-width: 10px;
}

.home-insights-totals {
  display: flex;
  gap: 20px;
  margin-bottom: 14px;
}

.home-insights-totals > div {
  display: grid;
  gap: 2px;
}

.home-insights-totals span {
  color: var(--muted);
  font-size: 12px;
}

.home-insights-totals strong {
  font-size: 18px;
}

.home-insights-income {
  color: var(--green);
}

.home-insights-expense {
  color: var(--red);
}

.home-trend-snippet {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.mini-bar-labels {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-top: 8px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.period-select {
  width: auto;
  min-height: 34px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--navy);
}

.expenses-grid {
  display: grid;
  gap: 16px;
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.wide-panel.insights-half {
  grid-column: span 1;
}

.insights-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.insights-controls-row {
  margin-bottom: 14px;
}

.segmented-2 {
  grid-template-columns: repeat(2, 1fr);
}

.insights-custom-range[hidden] {
  display: none;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.wide-panel.help-half {
  grid-column: span 1;
}

#faqSearch {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  margin-bottom: 12px;
}

.faq-category-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.faq-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.faq-chip.active {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: none;
  border: none;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.faq-question svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.faq-question[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 16px 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.faq-answer[hidden] {
  display: none;
}

#faqEmpty[hidden] {
  display: none;
}

.linked-account-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.linked-account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
}

.linked-account-row strong {
  display: block;
  font-size: 14px;
}

.linked-account-row small {
  color: var(--muted);
  font-size: 12px;
}

.linked-account-badges {
  display: flex;
  gap: 8px;
  align-items: center;
}

.badge-primary {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  background: var(--navy);
  color: #fff;
}

.badge-status {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
}

.badge-status.verified {
  color: #047857;
  background: #d7fbe9;
}

.badge-status.pending_verification {
  color: #8a5a00;
  background: #fff1cc;
}

.linked-account-actions {
  display: flex;
  gap: 12px;
}

.text-button.danger {
  color: var(--red);
}

.linked-account-otp {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 16px;
}

.linked-account-otp[hidden] {
  display: none;
}

.handle-current {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.handle-current[hidden] {
  display: none;
}

.handle-current-badge {
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 700;
  background: var(--navy);
  color: #fff;
  flex-shrink: 0;
}

.handle-current div small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.handle-current div strong {
  font-size: 14px;
}

#handleResolveHint[hidden] {
  display: none;
}

#handleResolveHint {
  font-size: 13px;
  margin: -6px 0 12px;
}

.insights-custom-range {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.insights-custom-range input {
  width: auto;
  min-height: 38px;
}

.insights-custom-range span {
  color: var(--muted);
  font-size: 13px;
}

.insights-chart-toggles {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.chip-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  padding: 8px 14px;
  font-weight: 700;
  font-size: 13px;
  color: var(--muted);
  opacity: 0.55;
}

.chip-toggle.active {
  opacity: 1;
  color: var(--ink);
}

.chip-toggle-income.active {
  border-color: var(--green);
}

.chip-toggle-expense.active {
  border-color: var(--red);
}

.chip-toggle .eye-icon {
  width: 15px;
  height: 15px;
}

.chip-toggle strong {
  font-size: 13px;
}

.insights-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 220px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.insights-chart-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1 1 0;
  min-width: 22px;
  max-width: 64px;
  height: 100%;
}

.insights-bar-pair {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  height: 100%;
  width: 100%;
}

.insights-bar {
  width: 100%;
  max-width: 16px;
  border-radius: 4px 4px 0 0;
  border: 0;
  padding: 0;
  cursor: pointer;
  min-height: 3px;
  transition: opacity 120ms ease;
}

.insights-bar.income {
  background: var(--green);
}

.insights-bar.expense {
  background: var(--red);
}

.insights-bar:hover {
  opacity: 0.75;
}

.income-hidden .insights-bar.income {
  display: none;
}

.expense-hidden .insights-bar.expense {
  display: none;
}

.insights-chart-col-label {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}

.insights-chart-detail {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  min-height: 18px;
}

.trends-list {
  display: grid;
  gap: 10px;
}

.trend-card {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 12px 14px;
}

.trend-icon {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #e4e9f9;
  color: var(--navy);
}

.trend-icon svg {
  width: 17px;
  height: 17px;
}

.trend-card p {
  margin: 0;
  font-size: 13px;
  flex: 1;
}

.trend-card strong {
  white-space: nowrap;
}

.category-breakdown {
  display: grid;
  gap: 14px;
}

.category-row {
  display: grid;
  gap: 6px;
}

.category-row-button {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 10px 0;
  text-align: left;
  border-top: 1px solid var(--line);
}

.category-row-button:first-child {
  border-top: 0;
  padding-top: 0;
}

.category-row-button:hover {
  background: var(--surface);
  border-radius: 12px;
}

.category-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.category-row-label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-chip {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--white);
  font-size: 11px;
  font-weight: 800;
  flex: none;
}

.category-row-meta {
  color: var(--muted);
  font-size: 12px;
}

.category-bar-track {
  height: 8px;
  border-radius: 999px;
  background: #e7ecf8;
  overflow: hidden;
}

.category-bar-fill {
  height: 100%;
  border-radius: 999px;
}

.category-budget-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
}

.category-budget-status {
  color: var(--muted);
  font-size: 12px;
}

.category-budget-status.over {
  color: var(--red);
  font-weight: 700;
}

.category-budget-edit {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.category-budget-edit span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.category-budget-input {
  width: 100px;
  min-height: 34px;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  border: 1.5px solid var(--navy);
  border-radius: 999px;
  padding: 0 12px;
  background: #eef2fb;
}

.category-budget-input:hover {
  background: var(--surface);
}

.category-budget-input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

.category-budget-input::placeholder {
  color: #8891a8;
  font-weight: 500;
}

.transaction-category-select {
  min-height: 36px;
  width: auto;
  font-size: 12px;
  border-radius: 999px;
  padding: 0 10px;
}

.nfc-card-compact {
  min-height: 190px;
}

.account-meta,
.metric-row,
.security-list {
  display: grid;
  gap: 10px;
}

.tap-modes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.tap-modes div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.tap-modes span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 4px;
}

.account-meta {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
}

.account-totals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.account-totals div {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  padding: 14px;
}

.account-totals span {
  display: block;
  color: #cad3ea;
  font-size: 12px;
  margin-bottom: 6px;
}

.account-totals strong {
  color: #eef1fb;
  font-size: 22px;
}

.account-meta span {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 10px;
  color: #dff8f0;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.action-tile {
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 12px 8px;
  text-align: center;
}

.action-tile:hover {
  border-color: var(--navy);
  transform: translateY(-1px);
}

.action-tile strong {
  font-size: 13px;
  white-space: nowrap;
}

.tile-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  color: var(--navy);
  background: #e4e9f9;
}

.tile-icon svg {
  width: 18px;
  height: 18px;
}

.wide-panel {
  grid-column: span 2;
}

.metric-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-row div,
.security-list div {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.metric-row span,
.security-list span {
  color: var(--muted);
  display: block;
  font-size: 13px;
}

.metric-row strong,
.security-list strong {
  display: block;
  font-size: 22px;
  margin-top: 4px;
}

.pagination-row[hidden] {
  display: none;
}

.pagination-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.pagination-row .secondary-button {
  min-height: 38px;
  padding: 0 16px;
  font-size: 13px;
}

.pagination-row .secondary-button:disabled {
  opacity: 0.4;
  cursor: default;
}

.transaction-list[hidden] {
  display: none;
}

.transaction-list {
  display: grid;
  gap: 10px;
}

.transaction {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.transaction small,
.transaction span {
  color: var(--muted);
}

.transaction strong {
  display: block;
}

.status {
  justify-self: end;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
  text-transform: capitalize;
}

.status.succeeded {
  color: #047857;
  background: #d7fbe9;
}

.status.pending {
  color: #8a5a00;
  background: #fff1cc;
}

.status.failed {
  color: var(--red);
  background: #ffe3df;
}

.status.delivered {
  color: #047857;
  background: #d7fbe9;
}

.webhook-events-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.webhook-events-actions .secondary-button {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
}

.checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.checkbox-inline {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.checkbox-inline input {
  width: auto;
  min-height: auto;
}

.webhook-secret-reveal {
  border: 1px solid var(--green);
  border-radius: 8px;
  background: #d7fbe9;
  color: #065f46;
  padding: 10px 12px;
  margin: 12px 0;
  font-size: 13px;
  word-break: break-all;
}

.transaction .text-button {
  min-height: 0;
  padding: 0;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #e7ecf8;
  margin-bottom: 18px;
}

.segment {
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.segment.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 5px 12px rgba(19, 29, 63, 0.1);
}

form[hidden],
.ai-form[hidden] {
  display: none;
}

form,
.ai-form {
  display: grid;
  gap: 14px;
}

label span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 12px;
}

.primary-button,
.secondary-button,
.text-button {
  min-height: 44px;
  border-radius: 999px;
  padding: 0 18px;
  font-weight: 800;
}

.primary-button {
  border: 0;
  color: var(--white);
  background: linear-gradient(150deg, var(--navy), var(--navy-deep));
  box-shadow: 0 12px 24px rgba(19, 29, 63, 0.24);
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface);
}

.text-button {
  border: 0;
  color: var(--cyan);
  background: transparent;
}

.qr-code {
  width: min(100%, 260px);
  aspect-ratio: 1;
  margin: 8px auto 18px;
  padding: 16px;
  border-radius: 16px;
  background: var(--white);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
}

.qr-code svg {
  width: 100%;
  height: 100%;
}

.qr-code-small {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  margin: 0;
  padding: 8px;
  border-radius: 12px;
}

.payment-link-reveal[hidden] {
  display: none;
}

.payment-link-reveal {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 14px;
}

.payment-link-reveal strong {
  display: block;
  word-break: break-all;
}

.payment-link-reveal small {
  color: var(--muted);
}

.intent-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
  display: grid;
  gap: 4px;
}

.intent-card span,
.intent-card small {
  color: var(--muted);
}

.intent-card strong {
  font-size: 28px;
}

.filters,
.ai-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 14px;
}

.terminal-amount-label {
  max-width: 240px;
  margin-bottom: 14px;
}

.terminal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

#terminalScanStatus[hidden] {
  display: none;
}

.terminal-row .primary-button,
.terminal-row .secondary-button {
  flex: 1 1 200px;
}

.nfc-card {
  max-width: 400px;
  aspect-ratio: 1.586 / 1;
  border-radius: 20px;
  padding: 24px;
  color: var(--white);
  background:
    radial-gradient(circle at 85% -10%, rgba(255, 255, 255, 0.16), transparent 45%),
    radial-gradient(circle at 15% 10%, rgba(16, 185, 129, 0.45), transparent 30%),
    linear-gradient(150deg, #06231f, #0b5f56 55%, #08a9b8);
  box-shadow: 0 18px 40px -12px rgba(6, 35, 31, 0.55), 0 1px 0 rgba(255, 255, 255, 0.08) inset;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.nfc-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.14);
  pointer-events: none;
}

.card-signal {
  align-self: flex-end;
  width: 44px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  margin-bottom: auto;
}

.nfc-card h2 {
  margin: 0 0 4px;
  font-size: 16px;
}

.nfc-card p {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.nfc-card p,
.nfc-card span {
  color: #dff8f0;
}

.nfc-card-handle {
  color: #8ff0d6;
  font-weight: 700;
  font-size: 13px;
  margin-top: 6px;
}

.nfc-card-handle[hidden] {
  display: none;
}

.nfc-card > span {
  margin-top: auto;
  padding-top: 14px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.85;
}

.nfc-card-manage {
  align-self: flex-start;
  margin-top: 10px;
  padding: 0;
  min-height: 0;
  color: #eafffa;
  font-weight: 700;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.bar-chart {
  height: 230px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  align-items: end;
}

.bar-chart span {
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--green), var(--cyan));
}

pre {
  overflow: auto;
  max-width: 100%;
  margin: 0 0 16px;
  border-radius: 12px;
  background: #0b1226;
  color: #d6e2ff;
  padding: 16px;
  font-size: 13px;
  line-height: 1.6;
}

.api-docs h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 20px 0 8px;
}

.api-docs h3:first-of-type {
  margin-top: 4px;
}

.api-docs p code {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 12px;
}

.answer {
  color: var(--muted);
  margin: 12px 0 0;
}

.risk-meter {
  height: 12px;
  border-radius: 999px;
  background: #e5ece9;
  overflow: hidden;
}

.risk-meter span {
  display: block;
  width: 28%;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--amber));
}

.security-event-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.security-event-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.security-event-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.security-event-row span {
  color: var(--muted);
}

#biometricUnavailable[hidden] {
  display: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(120px);
  border-radius: 8px;
  background: var(--deep);
  color: var(--white);
  padding: 12px 16px;
  box-shadow: var(--shadow);
  transition: transform 180ms ease;
  max-width: calc(100vw - 28px);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.signed-out-overlay[hidden] {
  display: none;
}

.signed-out-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 32px 16px;
  background: var(--body-bg);
}

.signed-out-card {
  width: min(90vw, 400px);
  margin: auto;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--glass);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  padding: 32px 28px;
  display: grid;
  justify-items: center;
  gap: 10px;
}

.signed-out-card form {
  width: 100%;
  text-align: left;
}

.signed-out-card .primary-button {
  width: 100%;
  margin-top: 10px;
}

.auth-divider {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 4px;
  color: var(--muted);
  font-size: 12px;
}

.auth-divider[hidden],
.social-auth-row[hidden],
.social-button[hidden] {
  display: none;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.social-auth-row {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.social-button {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 20px rgba(19, 29, 63, 0.06);
}

.social-button:hover {
  border-color: var(--navy);
  transform: translateY(-1px);
}

.social-linkupp-mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, var(--cyan), var(--navy));
  color: var(--white);
  font-weight: 800;
  font-size: 13px;
}

.pay-link-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.pay-link-card {
  width: min(92vw, 400px);
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--glass);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  padding: 32px 28px;
  display: grid;
  justify-items: center;
  gap: 8px;
}

.pay-link-card .wordmark-mark {
  margin-bottom: 6px;
}

.pay-link-card h2 {
  font-size: 32px;
  margin: 6px 0;
}

.pay-link-card .primary-button {
  width: 100%;
  margin-top: 14px;
}

.pay-link-card .status {
  justify-self: center;
}

.profile-signout {
  margin-top: 18px;
  color: var(--red);
  border-color: #ffd3cb;
}

.two-factor-setup[hidden] {
  display: none;
}

.two-factor-setup {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.two-factor-setup small {
  display: block;
  color: var(--muted);
  margin-bottom: 4px;
}

.two-factor-setup strong {
  display: block;
  font-family: ui-monospace, SFMono-Regular, monospace;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
  word-break: break-all;
}

.two-factor-code {
  display: block;
  margin-bottom: 12px;
}

.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.settings-toggle-row:first-of-type {
  border-top: 0;
}

.settings-toggle-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-height: auto;
  accent-color: var(--navy);
}

@media (max-width: 1180px) {
  .home-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-col-side {
    grid-column: span 2;
  }
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .stat-tile-row-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rail {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 10px 0;
    flex-direction: row;
    justify-content: center;
    height: auto;
    overflow: visible;
    min-width: 0;
  }

  .nav-list {
    grid-auto-flow: column;
    grid-template-columns: none;
    overflow-x: auto;
    min-width: 0;
    max-width: calc(100vw - 90px);
  }

  .workspace {
    padding: 18px 12px 84px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-lead {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .home-grid,
  .merchant-grid,
  .security-grid,
  .developer-grid,
  .insights-grid,
  .help-grid,
  .pay-layout,
  .cards-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-col-side {
    grid-column: span 1;
  }

  .wide-panel {
    grid-column: span 1;
  }
}

@media (max-width: 560px) {
  h1 {
    font-size: 28px;
  }

  .status-pill-text {
    display: none;
  }

  .status-pill {
    padding: 0 10px;
  }

  .category-row-head {
    flex-wrap: wrap;
  }

  .category-row-label {
    flex-wrap: wrap;
  }

  .category-row-meta {
    margin-left: 40px;
  }

  .category-budget-row {
    flex-wrap: wrap;
  }

  .category-budget-edit {
    width: 100%;
  }

  .category-budget-input {
    flex: 1;
    width: auto;
  }

  .metric-row,
  .account-meta,
  .tap-modes,
  .filters,
  .ai-form,
  .stat-tile-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .terminal-row .primary-button,
  .terminal-row .secondary-button {
    flex-basis: 100%;
  }

  .quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .action-tile {
    min-height: 88px;
  }

  .transaction {
    grid-template-columns: 1fr;
  }

  .status {
    justify-self: start;
  }
}
