:root {
  --bg: #0c1018;
  --bg-elevated: #131923;
  --surface: #1a212e;
  --border: #2a3346;
  --text: #e6edf3;
  --text-muted: #8b94a7;
  --accent: #ff7a1a;
  --accent-soft: rgba(255, 122, 26, 0.15);
  --good: #2ea043;
  --bad: #e5534b;
  --warn: #d29922;
  --radius: 16px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, 'Noto Sans Devanagari',
    'Noto Sans Tamil', 'Noto Sans Bengali', sans-serif;
  font-size: 16px;
  line-height: 1.45;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

.shell {
  max-width: 520px;
  margin: 0 auto;
  /* Bottom padding leaves room for the fixed bottom-nav (height ~64px)
     plus the iOS safe-area inset. */
  padding: 18px 16px calc(88px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ─── Tab panels — Phase 2a.25 ────────────────────────────────────────── */

.tab-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: tab-fade-in 180ms ease-out;
}

.tab-panel[hidden] {
  display: none;
}

@keyframes tab-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Bottom navigation ──────────────────────────────────────────────── */

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  background: rgba(12, 16, 24, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  z-index: 30;
}

.bottom-nav-tab {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  padding: 10px 6px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  border-radius: 12px;
  transition: color 120ms ease, background 120ms ease;
  font-family: inherit;
}

.bottom-nav-tab:hover {
  color: var(--text);
}

.bottom-nav-tab.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.bottom-nav-icon {
  font-size: 20px;
  line-height: 1;
}

.bottom-nav-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

/* ─── Earn-tab hero ──────────────────────────────────────────────────── */

.earn-hero {
  background: linear-gradient(135deg, var(--accent-soft), transparent 70%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.earn-hero-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

.earn-hero-value {
  font-size: 42px;
  font-weight: 800;
  color: var(--accent);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  line-height: 1.1;
}

.earn-hero-sub {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 6px;
}

/* ─── Profile-tab hero ───────────────────────────────────────────────── */

.profile-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.profile-hero-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 26px;
}

.profile-hero-name {
  font-size: 18px;
  font-weight: 700;
}

.profile-hero-meta {
  font-size: 13px;
  color: var(--text-muted);
}

.profile-misc {
  text-align: center;
  padding: 4px;
}

/* ─── Collapsible "Why this works" / "Show details" blocks ───────────── */

.why-details,
.slm-details,
.result-evidence-details {
  background: transparent;
  border-top: 1px dashed var(--border);
  padding-top: 8px;
  margin-top: 4px;
}

.why-details summary,
.slm-details summary,
.result-evidence-details summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--text-muted);
  list-style: none;
  padding: 6px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.why-details summary::-webkit-details-marker,
.slm-details summary::-webkit-details-marker,
.result-evidence-details summary::-webkit-details-marker {
  display: none;
}

.why-details summary::after,
.slm-details summary::after,
.result-evidence-details summary::after {
  content: '▾';
  color: var(--text-muted);
  font-size: 10px;
  transition: transform 120ms ease;
}

.why-details[open] summary::after,
.slm-details[open] summary::after,
.result-evidence-details[open] summary::after {
  transform: rotate(180deg);
}

.slm-summary-text {
  font-weight: 600;
  color: var(--text);
}

.slm-summary-hint {
  color: var(--text-muted);
  font-size: 11px;
}

.why-details > p,
.slm-details > .slm-row,
.result-evidence-details > .result-evidence {
  margin-top: 6px;
}

/* ─── Plain-language capture-note (cleaner than diagnostics-note) ────── */

.capture-note {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* ─── Topbar tweaks — softer brand mark, narrower profile chip ───────── */

.topbar {
  padding-bottom: 4px;
}

/* ─── First-run wizard (Phase 2a.26) ────────────────────────────────── */

.first-run-sheet {
  /* Full-screen modal — wizard owns the whole viewport on first run. */
  place-items: stretch;
  background: var(--bg);
}

.first-run-content {
  max-width: 480px;
  margin: auto;
  max-height: none;
  border-radius: 0;
  background: var(--bg);
  border: 0;
  padding: calc(24px + env(safe-area-inset-top)) 22px calc(28px + env(safe-area-inset-bottom));
  gap: 0;
}

.first-run-step {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: tab-fade-in 200ms ease-out;
}

.first-run-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  padding: 16px 0 24px;
}

.first-run-logo {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 38px;
  box-shadow: 0 12px 32px rgba(255, 122, 26, 0.25);
}

.first-run-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.first-run-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  max-width: 360px;
  margin: 0 auto;
}

.first-run-section-title {
  font-size: 20px;
  font-weight: 700;
}

.first-run-section-sub {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
}

.first-run-back {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-size: 13px;
  text-align: left;
  padding: 4px 0;
  cursor: pointer;
  align-self: flex-start;
}

.first-run-back:hover {
  color: var(--text);
}

.first-run-choices {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.first-run-choice {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
  font-family: inherit;
}

.first-run-choice:hover {
  border-color: var(--accent);
  background: var(--bg-elevated);
}

.first-run-choice.primary {
  background: linear-gradient(135deg, var(--accent-soft), transparent 80%);
  border-color: var(--accent);
}

.first-run-choice.secondary {
  opacity: 0.85;
}

.first-run-choice-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.first-run-choice-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.first-run-choice-body strong {
  font-size: 15px;
  font-weight: 700;
}

.first-run-choice-body span {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
}

.first-run-language-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.first-run-language-grid button {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  text-align: center;
  font-family: inherit;
}

.first-run-language-grid button:hover {
  border-color: var(--accent);
  background: var(--bg-elevated);
}

.first-run-language-grid button span {
  font-size: 17px;
  font-weight: 700;
}

.first-run-language-grid button em {
  font-size: 11px;
  font-style: normal;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.first-run-input {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 16px;
  padding: 14px 16px;
  font-family: inherit;
}

.first-run-input:focus {
  outline: none;
  border-color: var(--accent);
}

.first-run-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.first-run-actions.vertical {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.first-run-primary {
  flex: 1;
  background: var(--accent);
  border: 0;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  transition: opacity 120ms ease;
}

.first-run-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.first-run-secondary {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
}

.first-run-secondary:hover {
  border-color: var(--accent);
}

.first-run-link {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
  font-family: inherit;
  padding: 6px 8px;
}

.first-run-link:hover {
  color: var(--accent);
}

.first-run-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  padding: 24px;
  justify-content: center;
}

.first-run-spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: verify-spin 1s linear infinite;
}

.first-run-phrase-grid {
  list-style: none;
  margin: 0;
  padding: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  counter-reset: phrase;
}

.first-run-phrase-grid li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}

.first-run-phrase-grid li:nth-last-child(-n+2) {
  border-bottom: none;
}

.first-run-phrase-num {
  font-size: 11px;
  color: var(--text-muted);
  min-width: 18px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.first-run-phrase-word {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.first-run-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
  cursor: pointer;
}

.first-run-checkbox input {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.first-run-status {
  font-size: 13px;
  color: var(--text-muted);
  padding: 10px 12px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
}

.first-run-persona-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.first-run-persona-list button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.first-run-persona-list button:hover {
  border-color: var(--accent);
}

.first-run-persona-list .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 700;
  flex-shrink: 0;
}

.first-run-persona-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.first-run-persona-meta strong {
  font-size: 14px;
  font-weight: 600;
}

.first-run-persona-meta em {
  font-size: 11px;
  font-style: normal;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.first-run-empty {
  color: var(--text-muted);
  font-size: 13px;
  padding: 20px;
  text-align: center;
}

/* ─── Backup warning banner (Home tab) ───────────────────────────────── */

.backup-warning-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(229, 83, 75, 0.12);
  border: 1px solid rgba(229, 83, 75, 0.35);
  border-radius: var(--radius-sm);
  color: var(--text);
}

.backup-warning-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.backup-warning-text {
  flex: 1;
  font-size: 13px;
  line-height: 1.45;
}

.backup-warning-text strong {
  display: block;
  font-size: 13px;
  margin-bottom: 2px;
}

.backup-warning-action {
  background: var(--bad);
  border: 0;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}

/* ─── Reset-device button (Profile tab, danger styling) ──────────────── */

.link-button.danger {
  color: var(--bad);
  margin-left: 12px;
}

.link-button.danger:hover {
  color: var(--bad);
  text-decoration: underline;
}

/* ─── DPDP card (Phase 4.0) ──────────────────────────────────────────── */

.dpdp-card .dpdp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.secondary-button.danger {
  border-color: rgba(229, 83, 75, 0.5);
  color: var(--bad);
}

.secondary-button.danger:hover {
  border-color: var(--bad);
  background: rgba(229, 83, 75, 0.1);
}

.dpdp-links {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.dpdp-links a {
  color: var(--accent);
  text-decoration: none;
  font-size: 12px;
}

.dpdp-links a:hover { text-decoration: underline; }

.dpdp-links button.link-button {
  padding: 0;
  font-size: 12px;
}

.dpdp-card .capture-result {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
  font-size: 13px;
  line-height: 1.5;
}

.dpdp-card .capture-result .mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
}

.first-run-legal-notice {
  margin-top: 16px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

.first-run-legal-notice a {
  color: var(--accent);
}

.first-run-recovery-link {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  transition: border-color 120ms ease, color 120ms ease;
}

.first-run-recovery-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ─── Phone OTP card (Phase 4.3) ─────────────────────────────────────── */

.phone-otp-card input[type="tel"],
.phone-otp-card input[type="text"] {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 16px;
  padding: 12px 14px;
  font-family: inherit;
  letter-spacing: 1px;
}

.phone-otp-card input:focus {
  outline: none;
  border-color: var(--accent);
}

.phone-otp-card #phoneOtpCodeInput {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 6px;
  text-align: center;
  font-size: 22px;
}

.phone-otp-card .capture-meta[data-tone='good'] { color: var(--good); }
.phone-otp-card .capture-meta[data-tone='bad']  { color: var(--bad); }

.phone-otp-card .capture-result[data-tone='good'] {
  border-left-color: var(--good);
  color: var(--good);
}

.phone-otp-card .capture-result[data-tone='bad'] {
  border-left-color: var(--bad);
  color: var(--bad);
}

.phone-otp-card #phoneOtpVerifyHint {
  margin-bottom: 8px;
}

/* ─── Offline banner (Phase 4.4) ─────────────────────────────────────── */

.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px calc(10px + env(safe-area-inset-top));
  background: rgba(229, 83, 75, 0.95);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.offline-banner[hidden] {
  display: none;
}

.offline-banner-icon {
  font-size: 16px;
}

.offline-banner-text {
  flex: 0 1 auto;
}

/* ─── Improved toast (Phase 4.4) ─────────────────────────────────────── */

.toast {
  /* Existing toast positioning preserved; the new variant adds
     a Retry button + dismiss button when toast.innerHTML is set
     by the new showToast signature. */
}

.toast .toast-text {
  flex: 1;
  margin-right: 12px;
}

.toast .toast-action {
  background: var(--accent);
  border: 0;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-right: 8px;
  font-family: inherit;
}

.toast .toast-dismiss {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  font-family: inherit;
}

.toast[data-tone='bad'] {
  border-left: 3px solid var(--bad);
}

.toast[data-tone='good'] {
  border-left: 3px solid var(--good);
}

/* ─── PWA install card (Phase 4.4) ───────────────────────────────────── */

.pwa-install-card {
  background: linear-gradient(135deg, var(--accent-soft), transparent 80%);
  border-color: var(--accent);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent);
  color: #0c1018;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 22px;
}

.brand-title {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.3px;
}

.brand-sub {
  color: var(--text-muted);
  font-size: 12px;
}

.profile-button {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  padding: 6px 10px 6px 6px;
  cursor: pointer;
  max-width: 60%;
}

.profile-button:hover {
  border-color: var(--accent);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
}

.profile-meta {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.15;
  overflow: hidden;
}

.profile-name {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}

.profile-language {
  font-size: 11px;
  color: var(--text-muted);
}

.prompt-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.prompt-greeting {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
}

.prompt-greeting-sub {
  color: var(--text-muted);
  font-size: 13px;
}

.input-row textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 16px;
  resize: vertical;
  min-height: 60px;
}

.input-row textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: transparent;
}

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

.mic-button {
  flex: 1;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s;
}

.mic-button[aria-pressed='true'] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  animation: pulse 1.2s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-soft); }
  50% { box-shadow: 0 0 0 8px transparent; }
}

.send-button {
  background: var(--accent);
  color: #0c1018;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 22px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}

.send-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.suggestion-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.slm-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.slm-load-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.slm-load-button:hover:not(:disabled) {
  border-color: var(--accent);
}

.slm-load-button.ready {
  background: rgba(46, 160, 67, 0.12);
  border-color: var(--good);
  color: var(--good);
}

.slm-load-button:disabled {
  cursor: progress;
  opacity: 0.8;
}

.slm-icon {
  font-size: 18px;
}

.slm-label {
  flex: 1;
  font-weight: 600;
}

#slmProgress {
  width: 100%;
  height: 6px;
  appearance: none;
}

#slmProgress::-webkit-progress-bar {
  background: var(--surface);
  border-radius: 4px;
}

#slmProgress::-webkit-progress-value {
  background: var(--accent);
  border-radius: 4px;
}

.slm-status {
  font-size: 11px;
  color: var(--text-muted);
}

.slm-status[data-tone='good'] { color: var(--good); }
.slm-status[data-tone='bad'] { color: var(--bad); }

.chip {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
}

.chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.flow {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.flow-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.flow-step {
  font-weight: 600;
}

.flow-confidence {
  color: var(--text-muted);
  font-size: 12px;
}

.flow-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.flow-list li {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
}

.flow-list li.passed { color: var(--good); }
.flow-list li.blocked { color: var(--bad); }
.flow-list li.complete { color: var(--text); }

.flow-layer {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  color: var(--text-muted);
}

.result {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 600;
}

.result-header .badge {
  background: var(--good);
  color: #0c1018;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.result-header .badge.blocked { background: var(--bad); color: #fff; }
.result-header .badge.planned { background: var(--warn); }

.result-body {
  font-size: 15px;
  line-height: 1.5;
}

.result-body .vernacular {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  padding: 12px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 16px;
}

.result-detail-grid {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 14px;
  font-size: 13px;
}

.result-detail-grid dt {
  color: var(--text-muted);
}

.result-detail-grid dd {
  margin: 0;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  word-break: break-all;
}

.pay-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 14px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #0c1018;
  font-weight: 700;
  text-decoration: none;
}

.pay-action:active {
  transform: translateY(1px);
}

.listen-action {
  min-height: 36px;
  margin: 10px 0 2px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
}

.listen-action:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.diagnostics {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
}

.diagnostics summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-weight: 600;
}

.diagnostics summary::-webkit-details-marker { display: none; }
.diagnostics summary::after {
  content: '▾';
  color: var(--text-muted);
  font-size: 12px;
  margin-left: 8px;
}

.diagnostics[open] summary::after { content: '▴'; }

.diagnostics-meta {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 400;
}

.diagnostics-list {
  list-style: none;
  margin: 0;
  padding: 0 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.diagnostics-list li {
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.diagnostics-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.diagnostics-id {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  color: var(--text-muted);
  font-size: 11px;
  width: 36px;
}

.diagnostics-label {
  flex: 1;
  font-weight: 600;
}

.diagnostics-list .tag {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}

.diagnostics-list .tag.good { background: rgba(46, 160, 67, 0.18); color: var(--good); }
.diagnostics-list .tag.warn { background: rgba(210, 153, 34, 0.18); color: var(--warn); }
.diagnostics-list .tag.bad { background: rgba(229, 83, 75, 0.18); color: var(--bad); }

.diagnostics-detail {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.diagnostics-note {
  margin: 4px 16px 16px;
  padding: 10px 12px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.5;
}

.flag-report-card select,
.flag-report-card textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
  font-size: 14px;
}

.flag-report-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 8px;
}

.handoff-row {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.handoff-label {
  color: var(--text-muted);
  font-size: 12px;
  margin-right: 4px;
  width: 100%;
}

.handoff-action {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.handoff-action:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.pairing-card .pairing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.pairing-half {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.pairing-half strong {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.pairing-half input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  font-size: 16px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 2px;
  text-align: center;
}

.federated-card .federated-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.federated-row {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.federated-row-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.federated-row-head strong {
  font-size: 14px;
  font-weight: 700;
}

.federated-payout {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px;
  color: var(--accent);
}

.federated-row-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.federated-mode {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.federated-mode.fedavg {
  background: rgba(255, 122, 26, 0.18);
  color: var(--accent);
}

.federated-mode.hash {
  background: rgba(46, 160, 67, 0.18);
  color: var(--good);
}

.federated-row-result {
  font-size: 12px;
  color: var(--good);
  margin-top: 4px;
  padding: 6px 8px;
  background: rgba(46, 160, 67, 0.08);
  border-radius: var(--radius-sm);
}

.federated-empty {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 16px;
}

.trust-passport-card .trust-passport-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.trust-stat {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.trust-stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.trust-stat-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.trust-passport-card .capture-meta[data-tone='good'] { color: var(--good); }
.trust-passport-card .capture-meta[data-tone='bad'] { color: var(--bad); }
.trust-stat-value[data-tone='good'] { color: var(--good); }
.trust-stat-value[data-tone='bad'] { color: var(--bad); }

.trust-share {
  background: var(--surface);
  border-left: 3px solid var(--good);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.trust-share-label {
  font-size: 13px;
  font-weight: 600;
}

.trust-share-url {
  display: flex;
  gap: 8px;
  align-items: center;
}

.trust-share-url input {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  padding: 8px 10px;
}

.trust-share-qr {
  background: #ffffff;
  border-radius: var(--radius-sm);
  padding: 8px;
  display: flex;
  justify-content: center;
}

.trust-share-qr svg {
  width: 100%;
  max-width: 200px;
  height: auto;
  display: block;
}

.trust-evidence {
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 6px;
}

.trust-evidence-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.trust-evidence-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.trust-evidence-list li strong {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.daily-brief-body {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 0 0 10px;
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  color: var(--text);
}

.attestation-claims {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
}

.attestation-claims-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.attestation-claims-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.attestation-claims-list li strong {
  font-weight: 600;
  color: var(--text);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
}

.pairing-code {
  padding: 10px;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
}

.pairing-qr {
  margin-top: 8px;
  padding: 8px;
  background: #ffffff;
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: center;
}

.pairing-qr svg {
  width: 100%;
  max-width: 220px;
  height: auto;
  display: block;
}

.pairing-claim-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.pairing-scan-video {
  width: 100%;
  max-height: 280px;
  margin-top: 8px;
  background: #000;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.pairing-code-line {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 14px;
  color: var(--text-muted);
}

.pairing-code-value {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--accent);
}

.pairing-phrase {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-muted);
  margin-top: 2px;
}

.pairing-phrase-value {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.6;
  word-spacing: 4px;
}

.pairing-card .capture-meta[data-tone='good'] { color: var(--good); }
.pairing-card .capture-meta[data-tone='bad'] { color: var(--bad); }

@media (max-width: 480px) {
  .pairing-card .pairing-grid {
    grid-template-columns: 1fr;
  }
}

.mesh-node-card .mesh-ticker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.mesh-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.mesh-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}

.mesh-stat-value {
  font-size: 15px;
  font-weight: 700;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  color: var(--text);
}

.mesh-node-card .capture-meta[data-tone='good'] {
  color: var(--good);
}

.mesh-node-card .capture-meta[data-tone='bad'] {
  color: var(--bad);
}

@media (max-width: 480px) {
  .mesh-node-card .mesh-ticker {
    grid-template-columns: 1fr 1fr;
  }
  .mesh-node-card .mesh-ticker .mesh-stat:nth-child(3) {
    grid-column: span 2;
  }
}

.more-controls {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
}

.more-controls summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-weight: 600;
}

.more-controls summary::-webkit-details-marker { display: none; }
.more-controls summary::after {
  content: '▾';
  color: var(--text-muted);
  font-size: 12px;
  margin-left: 8px;
}

.more-controls[open] summary::after { content: '▴'; }

.more-controls-meta {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 400;
  text-align: right;
  flex: 1;
}

.more-controls-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 12px 14px;
}

.capture-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.capture-header,
.capture-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.capture-header {
  font-weight: 650;
}

.file-action {
  min-height: 36px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--bg-elevated);
  cursor: pointer;
  font-size: 13px;
}

.file-action input {
  display: none;
}

#healthDocText {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  min-height: 92px;
}

.capture-meta,
.capture-result {
  color: var(--text-muted);
  font-size: 12px;
}

.capture-result {
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.profile-auth-card,
.worker-alert-card {
  background: var(--bg-elevated);
}

.passkey-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.secondary-button {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
}

.secondary-button:hover:not(:disabled),
.link-button:hover:not(:disabled) {
  color: var(--accent);
  border-color: var(--accent);
}

.secondary-button:disabled,
.link-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.result-evidence {
  font-size: 11px;
  color: var(--text-muted);
  padding-top: 6px;
  border-top: 1px solid var(--border);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  word-break: break-all;
}

.recent {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.recent-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  font-weight: 600;
}

.recent-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.recent-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 8px 10px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.recent-empty {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 12px;
}

.recent-intent {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-status.completed { color: var(--good); }
.recent-status.blocked { color: var(--bad); }
.recent-status.planned { color: var(--warn); }

.link-button {
  background: transparent;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

/* Profile sheet */
.sheet {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: grid;
  place-items: flex-end center;
  z-index: 20;
}

.sheet[hidden] {
  display: none;
}

.sheet-content {
  width: 100%;
  max-width: 520px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 18px 18px 0 0;
  padding: 18px 16px calc(20px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 70vh;
  overflow-y: auto;
}

.sheet-title {
  font-size: 18px;
  font-weight: 700;
}

.sheet-sub {
  color: var(--text-muted);
  font-size: 13px;
}

.onboarding-sheet .sheet-content {
  max-height: 80vh;
}

.onboarding-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  counter-reset: tour;
}

.onboarding-steps li {
  position: relative;
  padding: 12px 14px 12px 44px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
  counter-increment: tour;
}

.onboarding-steps li::before {
  content: counter(tour);
  position: absolute;
  left: 12px;
  top: 12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
}

.onboarding-steps li strong {
  font-size: 14px;
}

.onboarding-steps li span {
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.onboarding-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 4px;
}

.more-controls-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0 4px;
}

.profile-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-list li button {
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.profile-list li button:hover {
  border-color: var(--accent);
}

.profile-list li button.active {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.profile-section {
  margin-top: 4px;
}

.profile-section h4 {
  margin: 12px 0 4px;
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.7px;
}

.profile-demo-note {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
  background: rgba(210, 153, 34, 0.08);
  border-left: 3px solid var(--warn);
  padding: 8px 10px;
  border-radius: 0 8px 8px 0;
}

.profile-empty {
  list-style: none;
  color: var(--text-muted);
  font-size: 13px;
  padding: 8px 4px;
}

.profile-list li {
  list-style: none;
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.secondary-action {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 11px;
  align-self: center;
  white-space: nowrap;
}

.secondary-action:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.profile-list li .profile-list-name {
  font-size: 14px;
  font-weight: 600;
}

.profile-list li .profile-list-id {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.sheet-close {
  margin-top: 6px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 30;
  max-width: 90%;
}

@media (max-width: 380px) {
  .prompt-greeting { font-size: 18px; }
  .send-button { padding: 12px 16px; }
}

/* ─── Phase 8.0 — earnings tracker card ─────────────────────────────── */

.earnings-form {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.earnings-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  align-items: center;
  gap: 8px;
}

.earnings-row label {
  font-size: 13px;
  font-weight: 500;
  color: #555;
}

.earnings-row input,
.earnings-row select {
  padding: 8px 10px;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  font-size: 14px;
  background: white;
  min-width: 0;
}

.earnings-list {
  margin-top: 12px;
  border-top: 1px solid #eee;
  padding-top: 12px;
}

.earnings-list-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #f3f3f3;
  font-size: 13px;
}

.earnings-list-entry:last-child {
  border-bottom: none;
}

.earnings-list-entry .delete-entry {
  background: none;
  border: none;
  color: #c00;
  cursor: pointer;
  font-size: 12px;
  padding: 2px 6px;
}

.earnings-list-entry .delete-entry:hover {
  text-decoration: underline;
}

.earnings-summary {
  margin-top: 12px;
  padding: 12px;
  background: #f7f9fc;
  border-left: 3px solid #0a7;
  border-radius: 4px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  white-space: pre-wrap;
  line-height: 1.5;
}

@media (max-width: 380px) {
  .earnings-row {
    grid-template-columns: 1fr;
  }
}

/* ─── Phase 8.1 — mesh-contribution dashboard card ──────────────────── */

.mesh-dashboard-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 10px 0;
}

.mesh-dashboard-controls label {
  font-size: 13px;
  color: #555;
}

.mesh-dashboard-controls input[type="month"] {
  padding: 6px 8px;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  font-size: 14px;
}

.mesh-dashboard-headline {
  margin: 12px 0;
  padding: 12px;
  background: linear-gradient(135deg, #f0fdf9 0%, #e6f9f3 100%);
  border-radius: 8px;
  text-align: center;
}

.mesh-dashboard-total {
  font-size: 32px;
  font-weight: 700;
  color: #0a7;
  font-variant-numeric: tabular-nums;
}

.mesh-dashboard-meta {
  font-size: 12px;
  color: #555;
  margin-top: 4px;
}

.mesh-dashboard-breakdown {
  margin: 10px 0;
  display: grid;
  gap: 4px;
}

.mesh-dashboard-breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: #f9f9f9;
  border-radius: 4px;
  font-size: 13px;
}

.mesh-dashboard-breakdown-label {
  color: #555;
}

.mesh-dashboard-breakdown-value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.mesh-dashboard-timeline {
  margin: 10px 0;
  border-top: 1px solid #eee;
  padding-top: 10px;
}

.mesh-dashboard-timeline-heading {
  font-size: 12px;
  font-weight: 600;
  color: #555;
  margin-bottom: 8px;
}

.mesh-dashboard-timeline-row {
  display: grid;
  grid-template-columns: 90px 1fr 60px;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.mesh-dashboard-timeline-bar {
  height: 6px;
  background: #0a7;
  border-radius: 3px;
  min-width: 2px;
}

.mesh-dashboard-timeline-row .mesh-dashboard-timeline-value {
  text-align: right;
}

/* ─── Phase 8.2 — MFI consent issuance card ─────────────────────────── */

.mfi-consent-form {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.mfi-consent-issued {
  margin: 12px 0;
  padding: 12px;
  background: #fff7e6;
  border-left: 3px solid #f59e0b;
  border-radius: 4px;
}

.mfi-consent-share {
  display: grid;
  gap: 6px;
}

.mfi-share-label {
  font-size: 12px;
  font-weight: 600;
  color: #555;
}

.mfi-consent-share input[type="text"] {
  width: 100%;
  padding: 8px;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 11px;
  background: white;
}

.mfi-consent-list-heading {
  margin-top: 14px;
  font-size: 12px;
  font-weight: 600;
  color: #555;
  border-top: 1px solid #eee;
  padding-top: 12px;
}

.mfi-consent-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.mfi-consent-list-empty {
  font-size: 12px;
  color: #999;
  font-style: italic;
  padding: 8px 0;
}

.mfi-consent-list-entry {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #f9f9f9;
  border-radius: 4px;
  font-size: 12px;
}

.mfi-consent-list-entry-meta {
  font-size: 11px;
  color: #777;
  margin-top: 2px;
}

.mfi-consent-list-entry .mfi-revoke {
  background: none;
  border: none;
  color: #c00;
  cursor: pointer;
  font-size: 11px;
  padding: 2px 6px;
}

.mfi-consent-list-entry .mfi-revoke:hover {
  text-decoration: underline;
}

.mfi-consent-status-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  margin-left: 4px;
}

.mfi-consent-status-badge.active { background: #d1fae5; color: #065f46; }
.mfi-consent-status-badge.revoked { background: #fee2e2; color: #991b1b; }
.mfi-consent-status-badge.expired { background: #e5e7eb; color: #6b7280; }
.mfi-consent-status-badge.exhausted { background: #fef3c7; color: #92400e; }

/* ─── Phase 8.3 — UPI cash-out card ─────────────────────────────────── */

.mesh-withdrawal-balance {
  margin: 12px 0;
  padding: 16px;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-radius: 8px;
  text-align: center;
  border: 1px solid #bae6fd;
}

.mesh-withdrawal-balance-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: #0369a1;
  letter-spacing: 0.5px;
}

.mesh-withdrawal-balance-value {
  font-size: 36px;
  font-weight: 700;
  color: #0c4a6e;
  font-variant-numeric: tabular-nums;
  margin: 4px 0;
}

.mesh-withdrawal-balance-meta {
  font-size: 12px;
  color: #0369a1;
}

.mesh-withdrawal-form {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.mesh-withdrawal-list-heading {
  margin-top: 14px;
  font-size: 12px;
  font-weight: 600;
  color: #555;
  border-top: 1px solid #eee;
  padding-top: 12px;
}

.mesh-withdrawal-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.mesh-withdrawal-list-empty {
  font-size: 12px;
  color: #999;
  font-style: italic;
  padding: 8px 0;
}

.mesh-withdrawal-list-entry {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #f9f9f9;
  border-radius: 4px;
  font-size: 12px;
}

.mesh-withdrawal-list-entry-amount {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}

.mesh-withdrawal-list-entry-meta {
  font-size: 11px;
  color: #777;
  margin-top: 2px;
}

.mesh-withdrawal-status-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  margin-left: 4px;
}

.mesh-withdrawal-status-badge.pending { background: #fef3c7; color: #92400e; }
.mesh-withdrawal-status-badge.provider_accepted { background: #dbeafe; color: #1e40af; }
.mesh-withdrawal-status-badge.paid { background: #d1fae5; color: #065f46; }
.mesh-withdrawal-status-badge.failed { background: #fee2e2; color: #991b1b; }

/* Phase 8.4 — push opt-in card additions. */
.push-opt-in-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 12px;
  display: grid;
  gap: 6px;
  font-size: 13px;
  line-height: 1.4;
}
.push-opt-in-list li {
  padding-left: 4px;
}
.push-opt-in-list strong {
  font-weight: 650;
}
.push-opt-in-mode {
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm, 6px);
  display: grid;
  gap: 4px;
  font-size: 13px;
}
.push-opt-in-mode strong {
  font-weight: 700;
}
.push-opt-in-mode-note {
  font-size: 12px;
  opacity: 0.85;
}
.push-opt-in-mode-real {
  background: #ecfdf5;
  color: #065f46;
  border-left: 3px solid #10b981;
}
.push-opt-in-mode-local {
  background: #fff7ed;
  color: #9a3412;
  border-left: 3px solid #f59e0b;
}
.push-opt-in-disable {
  margin-top: 10px;
  text-align: center;
}
.push-opt-in-details {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-muted, #6b7280);
}
.push-opt-in-details summary {
  cursor: pointer;
  font-weight: 600;
  padding: 4px 0;
}
.push-opt-in-details p {
  margin: 8px 0;
  line-height: 1.5;
}

/* Phase 9.0b — SLM install card additions. */
.slm-install-card {
  background: var(--bg-elevated);
}
.slm-install-device {
  margin: 8px 0 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm, 6px);
  background: #f1f5f9;
  color: #0f172a;
  font-size: 12px;
}
.slm-install-device-grid {
  display: grid;
  gap: 4px;
}
.slm-installed-heading {
  margin: 14px 0 8px;
  font-size: 13px;
  font-weight: 700;
}
.slm-installed-row {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px);
  padding: 8px 10px;
  margin-bottom: 8px;
  font-size: 13px;
}
.slm-installed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.slm-installed-name {
  font-weight: 650;
}
.slm-installed-meta {
  color: var(--text-muted, #6b7280);
  font-size: 12px;
  margin-bottom: 4px;
}
.slm-installed-actions {
  text-align: right;
}
.slm-install-status-installed {
  background: #d1fae5;
  color: #065f46;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}
.slm-install-status-failed {
  background: #fee2e2;
  color: #991b1b;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}
.slm-install-status-removed {
  background: #f3f4f6;
  color: #6b7280;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}
.slm-install-catalogue {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.slm-pack-tile {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px);
  padding: 10px 12px;
  background: var(--surface);
}
.slm-pack-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.slm-pack-name {
  font-weight: 650;
  font-size: 14px;
}
.slm-pack-runtime {
  font-size: 11px;
  color: var(--text-muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.slm-pack-meta {
  margin: 4px 0 6px;
  font-size: 12px;
  color: var(--text-muted, #6b7280);
}
.slm-pack-description {
  margin: 6px 0;
  font-size: 12px;
  line-height: 1.4;
}
.slm-pack-actions {
  margin-top: 8px;
}
.slm-pack-progress {
  display: block;
  width: 100%;
  margin-top: 8px;
  height: 6px;
}
.slm-install-empty {
  padding: 12px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted, #6b7280);
}
