/* Heritage AI — App UI styles aligned with the website (warm/light parchment).
   Mirrors apps/mobile/lib/theme/heritage_theme.dart (warm theme) +
   docs/product/canonical-design-system.md tokens.

   The actual product is a single Flutter codebase rendering the SAME
   screens on iOS / Android / PWA / Windows desktop. This stylesheet
   approximates the rendered output so we can review design direction
   in the browser before it ships in Dart. */

/* ════════════════════════════════════════════════════════════════
   TOKENS — exact match to canonical-design-system.md
   ════════════════════════════════════════════════════════════════ */

.ha {
  --bg: #F4EFE5;
  --surface: #FBF7ED;
  --elevated: #FFFFFF;
  --border-subtle: #E6DCC4;
  --border-strong: #CDBE9C;
  --text: #1A130A;
  --text-secondary: #5B4F3A;
  --text-tertiary: #897C63;
  --gold: #D9BC78;
  --gold-hover: #EBCE8A;
  --gold-soft: rgba(217, 188, 120, 0.14);
  --gold-line: rgba(205, 190, 156, 0.6);
  --blue: #5B8FB9;
  --protected: #3FA776;
  --protected-soft: rgba(63, 167, 118, 0.12);
  --warning: #D4A045;
  --critical: #C25450;
  /* Dark recessed surface for "product chrome" (vault status, security) */
  --dark-bg: #0B0F14;
  --dark-bg-2: #11171F;
  --dark-bg-3: #1A2230;
  --dark-border: #1F2937;
  --dark-text: #F5F7FA;
  --dark-text-secondary: #9AA6B6;
  --dark-text-tertiary: #6B7888;
  --font-display: "Fraunces", "Cormorant Garamond", Georgia, serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

.ha * { box-sizing: border-box; }
.ha {
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* Subtle paper grain — like the website's warm bg */
.ha::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(40% 30% at 80% 0%, rgba(217, 188, 120, 0.10), transparent 60%),
    radial-gradient(50% 40% at 0% 100%, rgba(217, 188, 120, 0.05), transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.ha-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  z-index: 1;
  -webkit-overflow-scrolling: touch;
}

/* ── iOS safe areas — status bar overlays top, home indicator overlays bottom.
   The wrapper class `.ha-frame--ios` is added in JSX when wrapping with IOSDevice. */
.ha-frame {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.ha-frame--ios .ha-content { padding-top: 62px; }
.ha-frame--ios .ha-nav { padding-bottom: 34px; height: 106px; }
/* Android in-flow status/nav: smaller adjustments — only protect bottom from gesture pill if needed */
.ha-frame--android .ha-content { padding-top: 16px; }

/* ════════════════════════════════════════════════════════════════
   TOP BAR (mobile) — logo + wordmark + avatar + bell
   ════════════════════════════════════════════════════════════════ */

.ha-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 0;
}
.ha-wordmark-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ha-sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--protected);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
}
.ha-sync-pill::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--protected);
  box-shadow: 0 0 4px var(--protected);
  flex-shrink: 0;
  animation: ha-sync-blink 3s ease-in-out infinite;
}
@keyframes ha-sync-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.ha-sync-pill.offline {
  color: var(--text-tertiary);
}
.ha-sync-pill.offline::before {
  background: var(--text-tertiary);
  box-shadow: none;
  animation: none;
}
.ha-logo-tile {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--gold-soft);
  border: 1px solid var(--border-strong);
  display: grid;
  place-items: center;
  color: var(--gold);
  flex-shrink: 0;
}
.ha-wordmark {
  flex: 1;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 400;
  letter-spacing: -0.015em;
  color: var(--text);
  line-height: 1.1;
  font-variation-settings: "SOFT" 30, "opsz" 144;
}
.ha-wordmark em {
  font-style: italic;
  color: var(--gold);
  font-variation-settings: "SOFT" 50, "WONK" 1, "opsz" 144;
}
.ha-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  display: grid;
  place-items: center;
  color: var(--gold);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  flex-shrink: 0;
}
.ha-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  display: grid;
  place-items: center;
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════════
   EYEBROW / SECTION LABELS — same pattern as website
   ════════════════════════════════════════════════════════════════ */

.ha-eyebrow {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.ha-eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--gold);
}

.ha-mono-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

/* ════════════════════════════════════════════════════════════════
   HEADLINES — Fraunces display
   ════════════════════════════════════════════════════════════════ */

.ha-h-page {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.1;
  font-variation-settings: "SOFT" 30, "opsz" 144;
}
.ha-h-page em {
  font-style: italic;
  color: var(--gold);
  font-variation-settings: "SOFT" 50, "WONK" 1, "opsz" 144;
}
.ha-h-page-sub {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
  margin-top: 6px;
  max-width: 38ch;
}

.ha-h-card {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.2;
  font-variation-settings: "SOFT" 30, "opsz" 144;
}
.ha-h-card em {
  font-style: italic;
  color: var(--gold);
  font-variation-settings: "SOFT" 50, "WONK" 1, "opsz" 144;
}

/* ════════════════════════════════════════════════════════════════
   VAULT STATUS HERO — dark recessed surface (per design system note:
   "Product vault/security panels may use dark recessed surfaces,
    but the app shell is warm/light like the website")
   ════════════════════════════════════════════════════════════════ */

.ha-vault-hero {
  position: relative;
  background:
    radial-gradient(70% 100% at 100% 0%, rgba(63,167,118,0.14), transparent 65%),
    radial-gradient(50% 80% at 0% 100%, rgba(217, 188, 120, 0.10), transparent 60%),
    linear-gradient(160deg, #18253A, #0E1520);
  border-radius: 22px;
  padding: 22px;
  color: var(--dark-text);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 16px 32px -16px rgba(10, 14, 20, 0.55);
}
.ha-vault-hero-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  position: relative;
}
.ha-vault-hero-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(217, 188, 120, 0.10);
  border: 1px solid rgba(217, 188, 120, 0.32);
  display: grid;
  place-items: center;
  color: var(--gold);
}
.ha-vault-hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(63, 167, 118, 0.12);
  border: 1px solid rgba(63, 167, 118, 0.32);
  color: var(--protected);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  font-family: var(--font-mono);
  text-transform: uppercase;
}
.ha-vault-hero-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--protected);
  box-shadow: 0 0 6px var(--protected);
}
.ha-vault-hero-body {
  position: relative;
}
.ha-vault-hero-line {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.015em;
  color: var(--dark-text);
  line-height: 1.2;
  font-variation-settings: "SOFT" 30, "opsz" 144;
}
.ha-vault-hero-line em {
  font-style: italic;
  color: var(--gold);
  font-variation-settings: "SOFT" 50, "WONK" 1, "opsz" 144;
}
.ha-vault-hero-meta {
  font-size: 12px;
  color: var(--dark-text-secondary);
  margin-top: 6px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}
.ha-vault-hero-progress {
  height: 3px;
  background: rgba(63, 167, 118, 0.15);
  border-radius: 3px;
  margin-top: 14px;
  overflow: hidden;
  position: relative;
}
.ha-vault-hero-progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--protected), rgba(63, 167, 118, 0.35));
  border-radius: 3px;
}

/* ════════════════════════════════════════════════════════════════
   PATRIMONY CARD — warm white card
   ════════════════════════════════════════════════════════════════ */

.ha-card {
  background: var(--elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 20px;
}
.ha-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ha-amount {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  margin-top: 4px;
}
.ha-amount-sub {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 4px;
}
.ha-eye {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  display: grid;
  place-items: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════════
   SECTION CARDS — list, categories, beneficiary preview
   ════════════════════════════════════════════════════════════════ */

.ha-section {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 20px;
}
.ha-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.ha-section-link {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--blue);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.ha-section-link.gold {
  color: var(--gold);
}

/* Vault category chips — Wrap of ActionChip in Flutter */
.ha-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ha-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--elevated);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 180ms var(--ease);
}
.ha-chip:hover {
  background: var(--gold-soft);
  border-color: var(--gold);
}
.ha-chip i {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  color: var(--text-secondary);
}

/* Asset / list rows */
.ha-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ha-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  cursor: pointer;
  transition: all 180ms var(--ease);
}
.ha-row:hover {
  border-color: var(--border-strong);
  background: #FFFDF8;
}
.ha-row-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.ha-row-body {
  flex: 1;
  min-width: 0;
}
.ha-row-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.005em;
  line-height: 1.3;
}
.ha-row-sub {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 3px;
}
.ha-row-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.ha-row-value {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* Status badges — match website */
.ha-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  font-family: var(--font-sans);
}
.ha-badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.ha-badge.protected {
  color: var(--protected);
  background: rgba(63, 167, 118, 0.10);
  border: 1px solid rgba(63, 167, 118, 0.25);
}
.ha-badge.warning {
  color: var(--warning);
  background: rgba(212, 160, 69, 0.12);
  border: 1px solid rgba(212, 160, 69, 0.30);
}
.ha-badge.gold {
  color: #6B5421;
  background: var(--gold-soft);
  border: 1px solid var(--gold-line);
}
.ha-badge.neutral {
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
}

/* ════════════════════════════════════════════════════════════════
   YOUR CIRCLE — horizontal avatar list
   ════════════════════════════════════════════════════════════════ */

.ha-circle {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 4px 2px;
  scrollbar-width: none;
}
.ha-circle::-webkit-scrollbar { display: none; }
.ha-circle-person {
  width: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  cursor: pointer;
}
.ha-pavatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--elevated);
  border: 1px solid var(--border-subtle);
  display: grid;
  place-items: center;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  flex-shrink: 0;
}
.ha-circle-name {
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 72px;
}
.ha-circle-pct {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gold);
  font-weight: 500;
  letter-spacing: 0.04em;
}

/* ════════════════════════════════════════════════════════════════
   NEXT VERIFICATION (heartbeat preview card)
   ════════════════════════════════════════════════════════════════ */

.ha-heartbeat-card {
  background: var(--elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.ha-heartbeat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--gold-soft);
  border: 1px solid var(--gold-line);
  color: var(--gold);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  position: relative;
}
.ha-heartbeat-pulse {
  position: absolute;
  inset: -3px;
  border-radius: 14px;
  border: 1px solid var(--gold);
  opacity: 0.4;
  animation: ha-pulse 2.2s ease-in-out infinite;
}
@keyframes ha-pulse {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.08); opacity: 0; }
}

/* ════════════════════════════════════════════════════════════════
   QUICK ACTIONS GRID (2x2)
   ════════════════════════════════════════════════════════════════ */

.ha-quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.ha-quick {
  background: var(--elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  cursor: pointer;
  transition: all 180ms var(--ease);
  min-height: 92px;
  font-family: inherit;
  color: var(--text);
  text-align: left;
}
.ha-quick:hover {
  border-color: var(--border-strong);
  background: #FFFDF8;
}
.ha-quick-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--gold);
}
.ha-quick-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.005em;
  line-height: 1.3;
}

/* ════════════════════════════════════════════════════════════════
   METRIC TILES (two per row, on Vault screen)
   ════════════════════════════════════════════════════════════════ */

.ha-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.ha-metric {
  background: var(--elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 16px;
}
.ha-metric-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  margin-bottom: 8px;
}
.ha-metric-value {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 400;
  color: var(--text);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* ════════════════════════════════════════════════════════════════
   CATEGORY ROW — Vault categories list
   ════════════════════════════════════════════════════════════════ */

.ha-cat-list { display: flex; flex-direction: column; }
.ha-cat-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.ha-cat-row:last-child { border-bottom: none; }
.ha-cat-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--gold-soft);
  border: 1px solid var(--gold-line);
  display: grid;
  place-items: center;
  color: var(--gold);
  flex-shrink: 0;
}
.ha-cat-body { flex: 1; min-width: 0; }
.ha-cat-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  font-family: var(--font-sans);
  letter-spacing: -0.005em;
}
.ha-cat-desc {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
  line-height: 1.5;
}
.ha-cat-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

/* ════════════════════════════════════════════════════════════════
   BENEFICIARY ROW (larger avatar + meta + pct on right)
   ════════════════════════════════════════════════════════════════ */

.ha-ben-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
}
.ha-ben-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  display: grid;
  place-items: center;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  flex-shrink: 0;
}
.ha-ben-body { flex: 1; min-width: 0; }
.ha-ben-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.ha-ben-rel {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}
.ha-ben-pct {
  text-align: right;
  flex-shrink: 0;
}
.ha-ben-pct-num {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--gold);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.ha-ben-pct-label {
  font-size: 10px;
  color: var(--text-tertiary);
  margin-top: 4px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ════════════════════════════════════════════════════════════════
   HEARTBEAT SCREEN — calm verification
   ════════════════════════════════════════════════════════════════ */

.ha-heartbeat-hero {
  background:
    radial-gradient(70% 100% at 50% 0%, rgba(217, 188, 120, 0.15), transparent 65%),
    linear-gradient(180deg, var(--elevated), var(--surface));
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  padding: 32px 24px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  position: relative;
}
.ha-heartbeat-seal {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--elevated);
  border: 1px solid var(--gold-line);
  display: grid;
  place-items: center;
  color: var(--gold);
  position: relative;
  box-shadow: 0 0 0 8px rgba(217, 188, 120, 0.06);
}
.ha-heartbeat-seal::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1px dashed var(--gold-line);
  opacity: 0.5;
  animation: ha-pulse-big 4s linear infinite;
}
@keyframes ha-pulse-big {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.ha-heartbeat-h {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.15;
  font-variation-settings: "SOFT" 30, "opsz" 144;
}
.ha-heartbeat-h em {
  font-style: italic;
  color: var(--gold);
  font-variation-settings: "SOFT" 50, "WONK" 1, "opsz" 144;
}
.ha-heartbeat-sub {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 28ch;
  line-height: 1.55;
}
.ha-heartbeat-timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
}
.ha-heartbeat-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  text-align: left;
}
.ha-heartbeat-step-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-tertiary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ha-heartbeat-step-value {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
  margin-top: 2px;
}
.ha-heartbeat-progress {
  width: 100%;
  height: 6px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  overflow: hidden;
  margin-top: 4px;
}
.ha-heartbeat-progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-hover));
  border-radius: 6px;
}

/* ════════════════════════════════════════════════════════════════
   CTA BUTTONS — match website btn-primary
   ════════════════════════════════════════════════════════════════ */

.ha-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding: 0 24px;
  border-radius: 12px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 180ms var(--ease);
  white-space: nowrap;
}
.ha-btn.primary {
  background: linear-gradient(180deg, var(--gold-hover), var(--gold));
  color: #1A130A;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.22) inset, 0 6px 18px -8px rgba(217, 188, 120, 0.5);
  width: 100%;
}
.ha-btn.primary:hover { background: linear-gradient(180deg, #F5D89A, var(--gold-hover)); }
.ha-btn.secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
  width: 100%;
}
.ha-btn.secondary:hover {
  background: var(--surface);
  border-color: var(--text-tertiary);
}

/* ════════════════════════════════════════════════════════════════
   BOTTOM NAVIGATION (mobile) — Material 3 NavigationBar styling
   ════════════════════════════════════════════════════════════════ */

.ha-nav {
  height: 72px;
  background: var(--surface);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: stretch;
  padding-bottom: env(safe-area-inset-bottom, 0);
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}
.ha-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 0 10px;
}
.ha-nav-pill {
  width: 56px;
  height: 28px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  transition: all 180ms var(--ease);
}
.ha-nav-item.is-active { color: var(--text); }
.ha-nav-item.is-active .ha-nav-pill {
  background: var(--gold-soft);
  border: 1px solid var(--gold-line);
}
.ha-nav-item.is-active svg { color: var(--gold); }

/* ════════════════════════════════════════════════════════════════
   DESKTOP / PWA RAIL — extended navigation rail at 1120px+
   ════════════════════════════════════════════════════════════════ */

.ha-rail {
  width: 248px;
  background: var(--surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.ha-rail-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 28px 24px 24px;
}
.ha-rail-wordmark {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -0.015em;
  color: var(--text);
  font-variation-settings: "SOFT" 30, "opsz" 144;
}
.ha-rail-wordmark em {
  font-style: italic;
  color: var(--gold);
}
.ha-rail-body {
  flex: 1;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}
.ha-rail-item {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  width: 100%;
  transition: all 180ms var(--ease);
}
.ha-rail-item:hover {
  background: rgba(217, 188, 120, 0.06);
  color: var(--text);
}
.ha-rail-item.is-active {
  background: var(--gold-soft);
  color: var(--text);
  border: 1px solid var(--gold-line);
}
.ha-rail-item.is-active svg { color: var(--gold); }
.ha-rail-foot {
  padding: 16px 20px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
}
.ha-rail-foot-name {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  line-height: 1.2;
}
.ha-rail-foot-status {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--protected);
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}
.ha-rail-foot-status::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--protected);
  box-shadow: 0 0 4px var(--protected);
}

/* Rail device sync block */
.ha-rail-sync {
  margin: 0 12px 12px;
  padding: 12px 14px;
  background: var(--protected-soft);
  border: 1px solid rgba(63, 167, 118, 0.22);
  border-radius: 12px;
}
.ha-rail-sync-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--protected);
  margin-bottom: 8px;
}
.ha-rail-sync-head::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--protected);
  box-shadow: 0 0 4px var(--protected);
  animation: ha-sync-blink 3s ease-in-out infinite;
}
.ha-rail-sync-devices {
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
}
.ha-rail-sync-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* Profile screen specifics */
.ha-profile-hero {
  background:
    radial-gradient(60% 100% at 100% 0%, rgba(217, 188, 120, 0.18), transparent 70%),
    var(--elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 22px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.ha-profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  display: grid;
  place-items: center;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  flex-shrink: 0;
  position: relative;
}
.ha-profile-avatar::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--protected);
  border: 3px solid var(--elevated);
}
.ha-profile-info { flex: 1; min-width: 0; }
.ha-profile-name {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.015em;
  line-height: 1.1;
  font-variation-settings: "SOFT" 30, "opsz" 144;
}
.ha-profile-name em {
  font-style: italic;
  color: var(--gold);
  font-variation-settings: "SOFT" 50, "WONK" 1, "opsz" 144;
}
.ha-profile-email {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.ha-profile-kyc {
  margin-top: 8px;
}

/* Setting row — chevron list */
.ha-set-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.ha-set-row:last-child { border-bottom: none; }
.ha-set-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.ha-set-icon.gold {
  background: var(--gold-soft);
  border-color: var(--gold-line);
  color: var(--gold);
}
.ha-set-body { flex: 1; min-width: 0; }
.ha-set-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.ha-set-sub {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
  line-height: 1.45;
}
.ha-set-aside {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-tertiary);
}

/* Toggle switch (iOS-style, gold when on) */
.ha-toggle {
  width: 44px;
  height: 26px;
  border-radius: 13px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 180ms var(--ease);
}
.ha-toggle::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 180ms var(--ease);
}
.ha-toggle.is-on {
  background: linear-gradient(180deg, var(--gold-hover), var(--gold));
  border-color: var(--gold);
}
.ha-toggle.is-on::before { transform: translateX(18px); }

/* Desktop main column */
.ha-desk-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 1;
}
.ha-desk-top {
  height: 72px;
  padding: 0 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.ha-desk-top-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.ha-desk-top-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.015em;
  color: var(--text);
  margin-top: 2px;
  font-variation-settings: "SOFT" 30, "opsz" 144;
}
.ha-desk-top-title em {
  font-style: italic;
  color: var(--gold);
}
.ha-desk-top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ha-desk-search {
  width: 280px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-tertiary);
  font-size: 13px;
  cursor: text;
}
.ha-desk-search kbd {
  margin-left: auto;
  background: var(--elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  padding: 2px 7px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-tertiary);
}
.ha-desk-btn {
  height: 40px;
  padding: 0 18px;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--gold-hover), var(--gold));
  color: #1A130A;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.22) inset;
}
.ha-desk-btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
  box-shadow: none;
}

.ha-desk-body {
  flex: 1;
  overflow-y: auto;
  padding: 32px 36px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Desktop grid */
.ha-desk-grid-2 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  align-items: start;
}
.ha-desk-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.ha-desk-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* Desktop vault hero variant — bigger */
.ha-desk-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  padding: 28px 32px;
  border-radius: 24px;
  align-items: center;
}
.ha-desk-hero .ha-vault-hero-line { font-size: 26px; }
.ha-desk-amount-block {
  text-align: right;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  padding-left: 28px;
}
.ha-desk-amount-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--dark-text-tertiary);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.ha-desk-amount-value {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--dark-text);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* Desktop category cards */
.ha-desk-cat {
  background: var(--elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  cursor: pointer;
  transition: all 220ms var(--ease);
}
.ha-desk-cat:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 14px 32px -16px rgba(26, 19, 10, 0.15);
}
.ha-desk-cat-head { display: flex; align-items: center; gap: 14px; }
.ha-desk-cat-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--gold-soft);
  border: 1px solid var(--gold-line);
  color: var(--gold);
  display: grid;
  place-items: center;
}
.ha-desk-cat-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text);
  font-variation-settings: "SOFT" 30, "opsz" 144;
}
.ha-desk-cat-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 3px;
}
.ha-desk-cat-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

/* Desktop person card — big avatar header */
.ha-desk-ben-hero {
  background: var(--elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 22px;
  padding: 28px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.ha-desk-ben-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  display: grid;
  place-items: center;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
  flex-shrink: 0;
}
.ha-desk-ben-info { flex: 1; }
.ha-desk-ben-name {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.05;
}
.ha-desk-ben-name em {
  font-style: italic;
  color: var(--gold);
}
.ha-desk-ben-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 10px;
  max-width: 56ch;
  line-height: 1.55;
}
.ha-desk-ben-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 20px;
}
.ha-desk-stat {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 14px 16px;
}
.ha-desk-stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}
.ha-desk-stat-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  color: var(--text);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.ha-desk-stat-value.sm { font-size: 15px; font-family: var(--font-sans); font-weight: 500; }
