/* Market observatory: presentation only. The harbor staff workspace keeps its
   existing palette; public, authentication and customer pages share this one. */
body[data-theme="pearl"],
body.observatory-account:not([data-role="owner"]):not([data-role="reviewer"]) {
  color-scheme: dark;
  --bg: #101925;
  --surface: #1a2738;
  --surface-alt: #132031;
  --text: #e8edf5;
  --muted: #a2afc1;
  --border: #a8bfd92b;
  --border-strong: #a8bfd952;
  --accent: #adcafd;
  --accent-hover: #c5dcff;
  --accent-soft: #20334e;
  --positive: #8bc7b6;
  --positive-soft: #16302d;
  --negative: #ed9aa9;
  --negative-soft: #35222e;
  --warning: #dfba7d;
  --warning-soft: #2b241d;
  --warning-border: #665138;
  --panel: var(--surface);
  --panel-soft: var(--surface-alt);
  --line: var(--border);
  --tint: var(--surface-alt);
  --danger: var(--negative);
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 14px 40px rgb(0 5 14 / 10%);
  --chart-surface: #101b2b;
  --chart-ink: #e8edf5;
  --chart-muted: #a2afc1;
  --chart-secondary: #8f9fb6;
  --chart-grid: #253448;
  --chart-grid-minor: #1e2d40;
  --chart-divider: #34465e;
  --chart-zero: #91a5c333;
  --chart-crosshair: #b4c8e775;
  --chart-crosshair-faint: #b4c8e74d;
  --chart-hover-surface: #2b3f5c;
  --chart-hover-ink: #e8edf5;
  background: radial-gradient(ellipse at 85% 0, #20314780 0, transparent 48%), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  scrollbar-color: var(--border-strong) var(--bg);
}

/* Shared shell, controls and readable state colors. */
body[data-theme="pearl"] .sidebar {
  background: rgb(12 22 35 / 88%);
  border-color: var(--border);
  backdrop-filter: blur(18px);
}
body[data-theme="pearl"] .topbar { background: transparent; }
body[data-theme="pearl"] .brand { font-weight: 550; letter-spacing: -.5px; }
body[data-theme="pearl"] .brand-mark {
  background: #c5d9f4;
  color: #17283e;
  box-shadow: inset 0 0 0 1px #e1ecff55;
}
body[data-theme="pearl"] .nav-link { border-radius: 8px; }
body[data-theme="pearl"] .nav-link[aria-current="page"] {
  color: #deebff;
  background: #9dc2ff14;
  box-shadow: inset 0 -1px #adcafd8c;
}
body[data-theme="pearl"] .page-heading h1 { font-weight: 550; }
body[data-theme="pearl"] .card {
  border-color: var(--border);
  background: linear-gradient(145deg, #182639eb, #121e2feb);
  box-shadow: var(--shadow);
}
body[data-theme="pearl"] .button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #102137;
  box-shadow: inset 0 1px 0 #ffffff45;
}
body[data-theme="pearl"] .button.primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
body[data-theme="pearl"] .button:not(.primary):not(.ghost):hover:not(:disabled) {
  background: #22344d;
  border-color: #6e88aa;
}
body[data-theme="pearl"] .button.danger { border-color: #754452; }
body[data-theme="pearl"] :is(input, textarea)::placeholder { color: #8293aa; }
body[data-theme="pearl"] :is(input, select, textarea):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
body[data-theme="pearl"] .unread-dot { background: var(--warning); border-color: var(--bg); }
body[data-theme="pearl"] :is(.notice.warning, .data-catalog-gap) {
  background: var(--warning-soft);
  border-color: var(--warning-border);
  color: var(--warning);
}
body[data-theme="pearl"] :is(.notice.error, .field-error) {
  background: var(--negative-soft);
  border-color: #754452;
  color: var(--negative);
}
body[data-theme="pearl"] .toast {
  background: #d9e7fa;
  color: #102137;
  box-shadow: 0 12px 32px #0007;
}
body[data-theme="pearl"] dialog { box-shadow: 0 24px 80px #0008; }
body[data-theme="pearl"] dialog::backdrop { background: #040b16ad; backdrop-filter: blur(5px); }

/* Asset overview, wallet and participation keep the original information order. */
body[data-theme="pearl"] .balance-hero {
  background: radial-gradient(ellipse at 94% 15%, #759fc12b, transparent 63%), linear-gradient(110deg, #1c3048, #142233);
  border-color: #3a506a;
}
body[data-theme="pearl"] :is(.balance-hero h2, .balance-breakdown dt, .balance-hero .hero-actions > p) { color: #afbed1; }
body[data-theme="pearl"] :is(.balance-hero .total, .balance-breakdown dd) { color: #edf3fc; }
body[data-theme="pearl"] .asset-symbol.usdc { color: #b4d0ff; background: #233956; }
body[data-theme="pearl"] :is(.strategy-hero, .membership-hero) {
  background: linear-gradient(120deg, #1c2d44, #121f30);
}
/* QR codes intentionally retain an opaque white quiet zone for scanning. */
body[data-theme="pearl"] .receiving-qr { background: #fff; border-color: #9aaac1; }
body[data-theme="pearl"] .receiving-qr figcaption { color: #44536b; }

/* Authentication is part of the same observatory, including error/consent UI. */
body[data-theme="pearl"] .auth-story h1 { font-weight: 500; }
body[data-theme="pearl"] .auth-visual {
  background: linear-gradient(130deg, #9dbbe115, #52749b0a);
  border-color: #a7c7ee33;
  box-shadow: inset 0 1px 0 #d0e0fa0d;
}
body[data-theme="pearl"] :is(.auth-visual > .row, .auth-visual-footer, .auth-node small) { color: var(--muted); }
body[data-theme="pearl"] .auth-node {
  background: linear-gradient(145deg, #a3c2e817, #7294bd07);
  border-color: #9ebfe32e;
}
body[data-theme="pearl"] .auth-node svg { color: var(--accent); }
body[data-theme="pearl"] .auth-node strong { color: var(--text); }
body[data-theme="pearl"] .auth-form-card {
  background: linear-gradient(145deg, #1a293de8, #121e30ef);
  border-color: #3b4f68;
  box-shadow: 0 24px 80px #02081333, inset 0 1px 0 #c8ddff08;
}
body[data-theme="pearl"] .sensitive-confirmation {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border-strong);
}
body[data-theme="pearl"] .sensitive-confirmation p { color: var(--muted); }
body[data-theme="pearl"] .sensitive-confirmation .intent { color: var(--text); background: var(--surface-alt); }
body[data-theme="pearl"] .sensitive-confirmation :is(input, button) {
  color: var(--text);
  background: var(--surface-alt);
  border-color: var(--border-strong);
}
body[data-theme="pearl"] .sensitive-confirmation input:focus { outline-color: var(--accent); }
body[data-theme="pearl"] .sensitive-confirmation .error { color: var(--negative); }
body[data-theme="pearl"] .sensitive-confirmation button.primary { color: #102137; background: var(--accent); border-color: var(--accent); }

/* Strategy directory, figures, locked guide and membership disclosures. */
body[data-theme="pearl"] :is(.product-service, .product-directory-item) {
  background: linear-gradient(135deg, #17263a, #121e30);
}
body[data-theme="pearl"] :is(.product-service, .product-directory-item)[aria-pressed="true"] {
  background: linear-gradient(110deg, #263e5b, #1a2c43);
  border-color: #7796bf;
}
body[data-theme="pearl"] .product-focus-card { background: linear-gradient(145deg, #1b2a40eb, #131f31eb); }
body[data-theme="pearl"] .product-guide-overlay { background: rgb(15 26 42 / 64%); }
body[data-theme="pearl"] .product-lock-icon { box-shadow: 0 3px 15px #0003; }
body[data-theme="pearl"] .perf-tooltip rect { fill: #d9e7fa; }
body[data-theme="pearl"] .perf-tooltip text { fill: #102137; }
body[data-theme="pearl"] .completion-series svg text { fill: var(--muted); }

/* Research chrome inherits theme colors; venue identities remain unchanged. */
body[data-theme="pearl"] .op-watch-workspace {
  --accent: #adcafd;
  --surface-alt: #132031;
  --border: #a8bfd92b;
}
body[data-theme="pearl"] .op-watch-workspace :is(.op-chart-panel, .op-chart-placeholder) {
  background: var(--surface-alt);
  border-color: var(--border);
  color: var(--text);
  box-shadow: none;
}
body[data-theme="pearl"] .op-watch-workspace .op-placeholder-lines {
  background: repeating-linear-gradient(0deg, transparent 0 18px, var(--border) 19px 20px);
}
body[data-theme="pearl"] .op-watch-workspace .op-chart-heading h3 { color: var(--text); }
body[data-theme="pearl"] .op-watch-workspace .op-symbol-form input {
  background: #15243a;
  border-color: var(--border-strong);
  color: var(--text);
}
body[data-theme="pearl"] .op-watch-workspace :is(.op-top-actions .button, .op-pin) {
  background: #1b2d45;
  border-color: var(--border-strong);
  color: var(--accent);
}
body[data-theme="pearl"] .op-watch-workspace :is(.op-selection-info, .op-chart-placeholder p) { color: var(--muted); }
body[data-theme="pearl"] .op-watch-workspace :is(.op-comparable, .op-selection-info .op-review-link) { color: var(--accent); }
body[data-theme="pearl"] :is(.op-pending, .op-source-row b) { color: var(--warning); }
body[data-theme="pearl"] .op-watch-workspace .op-preview-label { color: var(--warning); background: var(--warning-soft); }
body[data-theme="pearl"] .op-workspace .positive { color: var(--positive); }
body[data-theme="pearl"] .op-workspace .negative { color: var(--negative); }
body[data-theme="pearl"] .live-chart {
  --watch-ink: #e8edf5;
  --watch-muted: #a2afc1;
  --watch-border: #29394d;
  --watch-blue: #adcafd;
  background: var(--chart-surface);
  border-color: var(--border);
}
body[data-theme="pearl"] :is(.live-chart-toolbar, .live-chart-canvas, .watch-chart-root, .live-chart-details, .live-chart-disclosure) {
  background: var(--chart-surface);
  color: var(--text);
  border-color: var(--border);
}
body[data-theme="pearl"] :is(.live-chart-legend, .live-chart-foot, .live-chart-detail-body) { background: #132136; border-color: var(--border); }
body[data-theme="pearl"] .live-chart-venue[data-highlight="true"] { background: #1f314c; }
body[data-theme="pearl"] .live-chart-venue input[type="checkbox"] { accent-color: var(--accent); }
body[data-theme="pearl"] :is(.live-chart-highlight, .live-chart-venue-funding, .live-chart-venue-state,
  .live-chart-description, .live-chart-control-label, .live-chart-funding-controls,
  .live-chart-funding-mode, .live-chart-detail-hint, .watch-chart-tooltip-time, .watch-chart-empty) { color: var(--muted); }
body[data-theme="pearl"] .live-chart-venue[data-state="live"] .live-chart-venue-state { color: var(--positive); }
body[data-theme="pearl"] .live-chart-venue[data-state="paused"] .live-chart-venue-state { color: var(--warning); }
body[data-theme="pearl"] .live-chart-periods { background: #1b2a40; }
body[data-theme="pearl"] :is(.live-chart-periods button, .live-chart-ranges button) { color: var(--muted); }
body[data-theme="pearl"] :is(.live-chart-periods button, .live-chart-ranges button, .live-chart-highlight, .live-chart-funding-mode)[aria-pressed="true"] {
  background: #30486a;
  color: #dceaff;
  box-shadow: none;
}
body[data-theme="pearl"] .live-chart-ranges .live-chart-follow { color: var(--accent); border-color: var(--border-strong); }
/* Existing chart declarations are important; limit matching priority to these labels. */
body[data-theme="pearl"] .live-chart .live-chart-note { color: var(--muted) !important; }
body[data-theme="pearl"] .live-chart .live-chart-status { color: var(--muted) !important; background: #132136; }
body[data-theme="pearl"] .live-chart .live-chart-status:is([data-kind="error"], [data-kind="locked"], [data-kind="stopped"]),
body[data-theme="pearl"] .live-chart[data-review-preview="true"] .live-chart-status { color: var(--warning) !important; }
body[data-theme="pearl"] .live-chart[data-review-preview="true"] { border-color: var(--warning-border); }
body[data-theme="pearl"] .live-chart[data-review-preview="true"] .live-chart-caption::after { color: var(--warning); }
body[data-theme="pearl"] .live-chart-details[open] > summary { background: #20324d; color: var(--accent); }
body[data-theme="pearl"] .live-chart .live-chart-disclosure p { color: var(--muted); }
body[data-theme="pearl"] .live-chart .live-chart-source-detail h4 { color: #c9dcf7; }
body[data-theme="pearl"] .live-chart .live-chart-source-detail h5 { color: var(--muted); }
body[data-theme="pearl"] .live-chart-source-detail { background: #132136; border-color: var(--border); }
body[data-theme="pearl"] .live-chart-source-detail :is(.live-chart-table th, .live-chart-trade-heading) { color: var(--muted); border-color: var(--border); }
body[data-theme="pearl"] .live-chart .live-chart-missing { color: var(--muted); }
body[data-theme="pearl"] .live-chart .live-chart-source-reason { color: var(--warning); }
body[data-theme="pearl"] .watch-chart-tooltip { background: #17273df5; color: var(--text); border-color: var(--border-strong); box-shadow: 0 12px 30px #0005; }
body[data-theme="pearl"] .watch-chart-empty strong { color: var(--text); }

/* Published research cards and comparative tables can be opened by customers. */
body[data-theme="pearl"] .rb-workspace { color: var(--text); }
body[data-theme="pearl"] :is(.rb-heading p, .rb-muted, .rb-filter label > span, .rb-status,
  .rb-asset small, .rb-combo-head span, .rb-pagination, .rb-footnote, .rb-empty,
  .rb-state, .rb-description, .rb-identity, .rb-metrics span, .rb-curation-note,
  .rb-funding-kind, .rb-published-copy, .rb-waiting summary small,
  .rb-waiting-body > p, .rb-page-waiting) { color: var(--muted); }
body[data-theme="pearl"] :is(.rb-tabs, .rb-table-scroll, .rb-table td, .rb-footnote, .rb-card-actions, .rb-waiting) { border-color: var(--border); }
body[data-theme="pearl"] .rb-tabs button { color: var(--muted); }
body[data-theme="pearl"] .rb-tabs [aria-selected="true"] { background: var(--accent-soft); color: var(--accent); }
body[data-theme="pearl"] .rb-filter :is(input, select) { background: var(--surface-alt); color: var(--text); border-color: var(--border-strong); }
body[data-theme="pearl"] .rb-table th { background: #17263b; color: var(--muted); }
body[data-theme="pearl"] :is(.rb-expansion > td, .rb-combo-table, .rb-waiting summary b) { background: var(--surface-alt); }
body[data-theme="pearl"] .rb-featured-card { background: linear-gradient(130deg, #1b2b42, #142033); border-color: var(--border); }
body[data-theme="pearl"] :is(.rb-eyebrow, .rb-type, .rb-positive, .rb-waiting > summary > span::before) { color: var(--accent); }
body[data-theme="pearl"] .rb-venue i { color: #c7b9e7; border-color: #5b4e72; }
body[data-theme="pearl"] :is(.rb-negative, .rb-error) { color: var(--negative); }
body[data-theme="pearl"] :is(.rb-data-note, .rb-combo-note td) { color: #c3b5d6; background: #25233a; }
body[data-theme="pearl"] .rb-waiting { color: var(--muted); }
body[data-theme="pearl"] :is(.arb-eyebrow, .arb-filter-secondary summary, .arb-detail strong) { color: var(--muted); }
body[data-theme="pearl"] .arb-tabs button[aria-selected="true"] { color: var(--accent); border-color: var(--accent); background: linear-gradient(0deg, #adcafd0d, transparent); }
body[data-theme="pearl"] .arb-table-wrap thead { background: var(--surface-alt); color: var(--muted); }
body[data-theme="pearl"] .arb-pair:hover > tr { background: #1c2e46; }
body[data-theme="pearl"] :is(.arb-symbol strong, .arb-empty strong) { color: var(--text); }
body[data-theme="pearl"] :is(.arb-symbol small, .arb-positive) { color: var(--accent); }
body[data-theme="pearl"] .arb-long { background: #1d334e; color: #afcfff; }
body[data-theme="pearl"] .arb-short { background: #2d2942; color: #cbb6f1; }
body[data-theme="pearl"] .arb-primary-metric { background: #adcafd08; }
body[data-theme="pearl"] :is(.arb-negative, .arb-error) { color: var(--negative); }
body[data-theme="pearl"] .arb-star { background: var(--surface); color: var(--muted); border-color: var(--border); }
body[data-theme="pearl"] .arb-star.is-watched { background: #2d2942; color: #cbb6f1; border-color: #62567d; }
body[data-theme="pearl"] .arb-detail td { background: var(--surface-alt) !important; }
body[data-theme="pearl"] .arb-detail .arb-detail-warning { color: var(--warning); }

/* Account recovery is a separate document. Staff roles retain its original UI. */
body.observatory-account:not([data-role="owner"]):not([data-role="reviewer"]) { min-height: 100dvh; }
body.observatory-account:not([data-role="owner"]):not([data-role="reviewer"]) header {
  background: #0d1929;
  border-color: var(--border);
}
body.observatory-account:not([data-role="owner"]):not([data-role="reviewer"]) :is(a, .brand) { color: var(--accent); }
body.observatory-account:not([data-role="owner"]):not([data-role="reviewer"]) :is(.intro, .eyebrow, .muted, .panel p, .event, label, small) { color: var(--muted); }
body.observatory-account:not([data-role="owner"]):not([data-role="reviewer"]) :is(.panel, .metric) {
  background: linear-gradient(135deg, #1a293d, #121f30);
  border-color: var(--border);
}
body.observatory-account:not([data-role="owner"]):not([data-role="reviewer"]) :is(input, select, textarea, button) {
  color: var(--text);
  background: var(--surface-alt);
  border-color: var(--border-strong);
}
body.observatory-account:not([data-role="owner"]):not([data-role="reviewer"]) button.primary {
  color: #102137;
  background: var(--accent);
  border-color: var(--accent);
}
body.observatory-account:not([data-role="owner"]):not([data-role="reviewer"]) :is(input, textarea):focus,
body.observatory-account:not([data-role="owner"]):not([data-role="reviewer"]) button:focus-visible { outline-color: var(--accent); }
body.observatory-account:not([data-role="owner"]):not([data-role="reviewer"]) :is(.code-grid, #message:not(:empty)) {
  color: var(--text);
  background: var(--accent-soft);
}
body.observatory-account:not([data-role="owner"]):not([data-role="reviewer"]) .code-grid code { color: #d0e3ff; }
body.observatory-account:not([data-role="owner"]):not([data-role="reviewer"]) :is(.notice, .callout) {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: var(--warning-border);
}
body.observatory-account:not([data-role="owner"]):not([data-role="reviewer"]) .error { color: var(--negative) !important; }
body.observatory-account:not([data-role="owner"]):not([data-role="reviewer"]) :is(.event, form + form) { border-color: var(--border); }

/* Shared observatory material: translucent planes, quiet edges, no moving data decoration. */
@media screen {
  body[data-theme="pearl"],
  body.observatory-account:not([data-role="owner"]):not([data-role="reviewer"]) {
    --glass: linear-gradient(125deg, rgb(206 223 248 / 10%), rgb(160 185 216 / 3%) 52%, rgb(146 173 208 / 7%));
    --glass-edge: rgb(185 207 237 / 22%);
    --glass-shadow: inset 0 1px 0 rgb(228 239 255 / 10%), inset 1px 0 0 rgb(216 233 254 / 5%), 0 18px 48px -24px rgb(0 5 14 / 55%);
    background: radial-gradient(ellipse at 78% 32%, #40577136, transparent 54%),
      radial-gradient(ellipse at 55% 115%, #35445b50, transparent 67%),
      linear-gradient(120deg, #0d1520, #131e2c 65%, #15202e);
    background-attachment: fixed;
  }
  body[data-theme="pearl"] .sidebar {
    background: rgb(13 22 33 / 65%);
    border-color: rgb(183 205 235 / 14%);
    box-shadow: 0 1px 0 rgb(219 234 255 / 3%);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
  }
  body[data-theme="pearl"] .nav-link {
    font-weight: 450;
    transition: background .2s, color .2s, box-shadow .2s;
  }
  body[data-theme="pearl"] .nav-link[aria-current="page"] {
    background: linear-gradient(135deg, #bed5f412, #a4bbda05);
    box-shadow: inset 0 -1px #bed5f4a3, inset 0 1px #d5e6ff08;
  }
  body[data-theme="pearl"] :is(.card, .product-directory-item, .product-service,
    .auth-form-card, .balance-hero, .membership-hero, .strategy-hero, .rb-featured-card),
  body.observatory-account:not([data-role="owner"]):not([data-role="reviewer"]) .panel {
    background: var(--glass);
    border: 1px solid var(--glass-edge);
    border-top-color: rgb(216 232 255 / 29%);
    border-left-color: rgb(206 225 250 / 26%);
    box-shadow: var(--glass-shadow);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
  }
  body[data-theme="pearl"] .product-focus-card {
    border-radius: 14px;
    background: linear-gradient(125deg, #cedeF91c, #b0c7e208 55%, #94acc913);
  }
  body[data-theme="pearl"] :is(.product-directory-item, .product-service) {
    transition: background .22s, border-color .22s, box-shadow .22s;
  }
  body[data-theme="pearl"] :is(.product-directory-item, .product-service)[aria-pressed="true"] {
    background: linear-gradient(125deg, #c9dcf529, #b2c9e611 70%);
    border-color: #b9d1f166;
    box-shadow: inset 2px 0 #bfd7f4a6, inset 0 1px #edf5ff14, 0 12px 30px -20px #0009;
  }
  body[data-theme="pearl"] :is(.product-directory-item, .product-service):hover {
    background: linear-gradient(125deg, #d1e2f82e, #b3c9e414);
    border-color: #c6dcf985;
  }
  body[data-theme="pearl"] .product-focus-heading {
    background: linear-gradient(110deg, #d0e0f607, transparent 65%);
  }
  body[data-theme="pearl"] :is(.product-focus-heading h2, .page-heading h1) {
    font-weight: 500;
    letter-spacing: .015em;
  }
  body[data-theme="pearl"] .product-focus-return strong { font-weight: 500; color: #c3d8f7; }
  body[data-theme="pearl"] .product-directory-return { font-weight: 500; color: #c3d8f7; }
  body[data-theme="pearl"] .product-chart-tabs { border-color: #bfd3ee21; }
  body[data-theme="pearl"] .product-chart-tabs button[aria-pressed="true"] {
    color: #d2e3fa;
    border-bottom-color: #b4cae9;
  }
  /* Nested chart/empty states remain one plane instead of another opaque card. */
  body[data-theme="pearl"] .product-main-chart :is(.perf-card, .perf-empty-chart, .perf-participation-empty),
  body[data-theme="pearl"] .product-estimate-panel > .card {
    background: transparent;
    border: 0;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  body[data-theme="pearl"] .product-guide-lock {
    background: linear-gradient(115deg, #bacfe715, #809aba08);
    border-color: #bfd3ee26;
  }
  body[data-theme="pearl"] .product-guide-overlay { background: rgb(14 24 38 / 30%); }
  body[data-theme="pearl"] :is(.product-guide-unlocked, .product-managed-entry) {
    background: #0c17232b;
  }
  body[data-theme="pearl"] .button,
  body.observatory-account:not([data-role="owner"]):not([data-role="reviewer"]) button {
    background: linear-gradient(120deg, #c5d8f114, #c5d8f106);
    border-color: #b7cdea45;
    box-shadow: inset 0 1px #e2eeff0a;
    border-radius: 7px;
    font-weight: 500;
    transition: background .2s, border-color .2s, box-shadow .2s, transform .2s;
  }
  body[data-theme="pearl"] .button.primary,
  body.observatory-account:not([data-role="owner"]):not([data-role="reviewer"]) button.primary {
    background: linear-gradient(110deg, #bad5fc, #a3bff0);
    color: #14233a;
    border-color: #c3d9f7;
    box-shadow: inset 0 1px #f0f6ff40, 0 4px 22px #080f1a33;
  }
  body[data-theme="pearl"] .button.primary:hover:not(:disabled),
  body.observatory-account:not([data-role="owner"]):not([data-role="reviewer"]) button.primary:hover:not(:disabled) {
    background: linear-gradient(110deg, #cbe0ff, #b5cef4);
    border-color: #d9e8ff;
    box-shadow: inset 0 1px #fff5, 0 5px 25px #9ac2ff18;
    transform: translateY(-1px);
  }
  body[data-theme="pearl"] .button:not(.primary):not(.ghost):hover:not(:disabled) {
    background: linear-gradient(120deg, #c9ddfa24, #b2caea10);
    border-color: #c3daf477;
  }
  body[data-theme="pearl"] .button.ghost { background: transparent; border-color: transparent; box-shadow: none; }
  body[data-theme="pearl"] .button.ghost:hover:not(:disabled) { background: #bcd3f212; }
  body[data-theme="pearl"] .button.danger { border-color: #ed9aa966; }
  body[data-theme="pearl"] .button:focus-visible { outline: 2px solid #bad7ff; outline-offset: 4px; }
  body[data-theme="pearl"] :is(input, select, textarea) { background: #0b17274d; }
  body[data-theme="pearl"] dialog {
    background: linear-gradient(135deg, #253245f5, #152234fa);
    border-color: #b9cfea4d;
    box-shadow: inset 0 1px #e0edff1c, 0 24px 80px #0008;
  }
  body[data-theme="pearl"] :is(.dialog-head, .dialog-actions) { background: transparent; }
  @media (min-width: 1000px) {
    body[data-theme="pearl"] .main { padding-left: 4vw; padding-right: 4vw; }
    body[data-theme="pearl"] .page-heading { margin-bottom: 30px; }
  }
  @media (prefers-reduced-motion: reduce) {
    body[data-theme="pearl"] :is(.button, .product-directory-item, .product-service, .nav-link) { transition: none; transform: none; }
    body[data-theme="pearl"] .button.primary:hover:not(:disabled) { transform: none; }
  }
  @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    body[data-theme="pearl"] :is(.card, .product-directory-item, .auth-form-card),
    body.observatory-account:not([data-role="owner"]):not([data-role="reviewer"]) .panel { background-color: #172333; }
  }
}

/* V1.0 inner surfaces: wallet, participation, research and account.
   Use one quiet inset plane; do not stack blur on text, plots or table cells. */
@media screen {
  body[data-theme="pearl"],
  body.observatory-account:not([data-role="owner"]):not([data-role="reviewer"]) {
    --glass-inset: linear-gradient(120deg, #c2d7f009, #09131f24);
    --glass-selected: linear-gradient(120deg, #c9dcf524, #b2c9e60d);
  }
  body[data-theme="pearl"] :is(.tabs, .workflow, .customer-participation,
    .strategy-disclosure, .exchange, .table-wrap, .rb-table-scroll, .rb-waiting),
  body.observatory-account:not([data-role="owner"]):not([data-role="reviewer"]) .metric {
    background: var(--glass-inset);
    border-color: #b8cfe626;
    box-shadow: inset 0 1px #dfedff06;
  }
  body[data-theme="pearl"] :is(.tab[aria-pressed="true"], .rb-tabs [aria-selected="true"],
    .live-chart-periods [aria-pressed="true"], .live-chart-ranges [aria-pressed="true"]) {
    background: var(--glass-selected);
    color: #d2e3fa;
    border-color: #bed5f447;
    box-shadow: inset 0 -1px #bed5f480, inset 0 1px #e0edff0a;
    font-weight: 500;
  }
  body[data-theme="pearl"] :is(.tab, .rb-tabs button):hover { color: var(--text); background-color: #bcd3f20c; }
  body[data-theme="pearl"] :is(.tab, .rb-tabs button, .strategy-disclosure summary):focus-visible {
    outline: 2px solid var(--accent); outline-offset: 3px;
  }
  body[data-theme="pearl"] :is(th, .rb-table th, .arb-table-wrap thead) {
    background: #0c17253b;
    border-color: #b8cfe621;
    color: #b4c2d5;
  }
  body[data-theme="pearl"] :is(.table-wrap, .rb-table-scroll) tbody tr:hover { background-color: #bfd5f008; }
  body[data-theme="pearl"] :is(.empty-icon, .step-index, .notification-icon) {
    background: var(--glass-inset); border-color: #b8cfe633;
  }
  body[data-theme="pearl"] :is(.metric-value, .balance-hero .total, .customer-participation h3) { font-weight: 500; }
  body[data-theme="pearl"] :is(.definition-list > div, .list-row, .asset-row, .strategy-facts > div) { border-color: #b8cfe61f; }
  body[data-theme="pearl"] .customer-participation { border-radius: 10px; }
  body[data-theme="pearl"] .strategy-disclosure > summary { color: #c4d5ec; }
  body[data-theme="pearl"] :is(.op-watch-workspace .op-chart-panel, .live-chart, .perf-card) {
    background: var(--glass);
    border: 1px solid var(--glass-edge);
    border-top-color: #d8e8ff4a;
    border-radius: 14px;
    box-shadow: var(--glass-shadow);
  }
  body[data-theme="pearl"] :is(.live-chart-toolbar, .live-chart-legend, .live-chart-foot,
    .live-chart-details, .live-chart-disclosure, .live-chart-detail-body, .live-chart-source-detail) {
    background: #0c17252b; border-color: #b8cfe621;
  }
  /* The data canvas stays opaque and still for stable axes/series contrast. */
  body[data-theme="pearl"] :is(.live-chart-canvas, .watch-chart-root) { background: var(--chart-surface); }
  body[data-theme="pearl"] .live-chart-venue[data-highlight="true"] { background: var(--glass-selected); }
  body[data-theme="pearl"] .live-chart-periods { background: var(--glass-inset); }
  body[data-theme="pearl"] .live-chart-details[open] > summary { background: #bfd5f010; }
  body[data-theme="pearl"] .op-watch-workspace .op-symbol-form input,
  body[data-theme="pearl"] .rb-filter :is(input, select) { background: #0b17274d; }
  body[data-theme="pearl"] .op-watch-workspace :is(.op-top-actions .button, .op-pin) {
    background: var(--glass-inset); border-color: #b7cdea45;
  }
  body.observatory-account:not([data-role="owner"]):not([data-role="reviewer"]) header {
    background: #0d1621a6; border-color: #b7cdeb24;
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  }
  body.observatory-account:not([data-role="owner"]):not([data-role="reviewer"]) :is(input, select, textarea) { background: #0b17274d; }
  body.observatory-account:not([data-role="owner"]):not([data-role="reviewer"]) :is(h1, h2, .status-count) { font-weight: 500; }
  body[data-theme="pearl"] :is(.card, .customer-participation, .live-chart, .perf-card) { min-width: 0; }
}

/* V1.0.1: settlement and earnings share the outer glass plane. */
@media screen {
  body[data-theme="pearl"] .strategy-receipt,
  body[data-theme="pearl"] .customer-terms {
    background: transparent;
    box-shadow: none;
  }
  body[data-theme="pearl"] .strategy-receipt .definition-list > div {
    border-color: #b8cfe621;
  }
  body[data-theme="pearl"] .strategy-receipt-total {
    border-top: 1px solid #bed5f447;
    background: linear-gradient(110deg, #c2d7f00a, transparent);
    padding: 18px 0 4px;
  }
  body[data-theme="pearl"] .strategy-receipt-total strong { font-weight: 500; color: #c3d8f7; }
  body[data-theme="pearl"] .customer-terms .table-wrap { background: #0c172512; box-shadow: none; }
  body[data-theme="pearl"] .customer-terms th { background: #c2d7f008; }
  body[data-theme="pearl"] .customer-terms + .customer-terms { border-top-color: #b8cfe621; }
  body[data-theme="pearl"] .main:has(.customer-strategy-hero) .notice:not(.warning):not(.error) {
    background: var(--glass-inset);
    border-color: #b8cfe62e;
    box-shadow: inset 0 1px #dfedff06;
  }
  body[data-theme="pearl"] dialog .notice.warning {
    background: linear-gradient(120deg, #dfba7d14, #dfba7d07);
    border-color: #dfba7d47;
    color: var(--warning);
  }
}

/* V1.0.2: finish secondary customer surfaces using the same material tokens. */
@media screen {
  body[data-theme="pearl"] :is(.membership-policy, .membership-refund-summary,
    .membership-mark, .dialog-summary, .estimate-summary, .product-reference,
    .product-estimate-panel .product-reference, .product-gate, .product-mini-empty,
    .completion-selection, .completion-evidence, .case-row, .choice, .perf-current, .perf-period,
    .strategy-progress > span, .code-block, .context-help-button, .context-help-close) {
    background: var(--glass-inset);
    border-color: #b8cfe62e;
    box-shadow: inset 0 1px #dfedff06;
  }
  body[data-theme="pearl"] :is(.choice:has(input:checked), .strategy-progress > .current) {
    background: var(--glass-selected); border-color: #bed5f466;
  }
  body[data-theme="pearl"] .notice:not(.warning):not(.error) {
    background: var(--glass-inset); border-color: #b8cfe62e;
  }
  body[data-theme="pearl"] .notice.warning {
    background: linear-gradient(120deg, #dfba7d14, #dfba7d07); border-color: #dfba7d47;
  }
  body[data-theme="pearl"] .notice.error {
    background: linear-gradient(120deg, #ed9aa914, #ed9aa907); border-color: #ed9aa947;
  }
  body[data-theme="pearl"] :is(.pill, .notification-icon, .product-guide-index, .product-lock-icon) {
    background: #bcd3f20b;
  }
  body[data-theme="pearl"] .pill.success { background: #8bc7b614; }
  body[data-theme="pearl"] .pill.warning { background: #dfba7d14; }
  body[data-theme="pearl"] .pill.danger { background: #ed9aa914; }
  body[data-theme="pearl"] .pill.info { background: #adcafd14; }
  body[data-theme="pearl"] :is(.context-help-head, .context-help-body) { background: transparent; }
  body[data-theme="pearl"] :is(.context-help-button, .context-help-close, .icon-button):focus-visible {
    outline: 2px solid var(--accent); outline-offset: 3px;
  }
  /* Standalone market experience uses panel/plain-button markup, not .card. */
  body[data-theme="pearl"]:has(> header.top) .panel {
    background: var(--glass); border: 1px solid var(--glass-edge);
    border-top-color: #d8e8ff4a; border-left-color: #cee1fa42;
    border-radius: 14px; box-shadow: var(--glass-shadow);
    -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  }
  body[data-theme="pearl"] > header.top {
    background: #0d1621a6; border-color: #b7cdeb24;
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  }
  body[data-theme="pearl"]:has(> header.top) :is(.search button, .fields > button, #trial-state > button, #trial-state > .button) {
    background: linear-gradient(110deg, #bad5fc, #a3bff0); color: #14233a;
    border-color: #c3d9f7; border-radius: 7px; font-weight: 500;
    box-shadow: inset 0 1px #f0f6ff40, 0 4px 22px #080f1a33;
  }
  body[data-theme="pearl"]:has(> header.top) :is(.search button, .fields > button, #trial-state > button, #trial-state > .button):hover:not(:disabled) {
    background: linear-gradient(110deg, #cbe0ff, #b5cef4);
  }
  body[data-theme="pearl"]:has(> header.top) :is(.quote, .symbol-list button, .login) {
    background: var(--glass-inset); border-color: #b8cfe62e;
  }
  body[data-theme="pearl"]:has(> header.top) .symbol-list button[aria-pressed="true"] {
    background: var(--glass-selected); border-color: #bed5f466; color: #d2e3fa;
  }
  body[data-theme="pearl"]:has(> header.top) .message {
    background: #1c293df5; border-color: #b9cfea4d; color: var(--text);
  }
  body[data-theme="pearl"]:has(> header.top) .message.error { border-color: var(--negative); }
  @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    body[data-theme="pearl"]:has(> header.top) .panel { background-color: #172333; }
  }
}

@media (prefers-contrast: more) {
  body[data-theme="pearl"] { --muted: #c4d0e0; --border: #536780; --border-strong: #849bb9; }
  body[data-theme="pearl"] :is(.card, .product-directory-item, .product-service, .auth-form-card, .balance-hero) { background: #172333; border-color: #849bb9; }
}
@media print {
  body[data-theme="pearl"] {
    --bg: #fff; --surface: #fff; --surface-alt: #f2f4f8; --text: #18293e;
    --muted: #40536b; --border: #a9b7c7; --border-strong: #8194ac;
    --accent: #315b9c; --accent-soft: #e9eff8; --positive: #25634c;
    --negative: #a83d50; --warning: #80541d; --warning-soft: #fbf1df;
    color-scheme: light; background: #fff; color: var(--text);
  }
  body[data-theme="pearl"] :is(.card, .product-directory-item, .product-focus-card, .balance-hero) { background: #fff; box-shadow: none; }
  body[data-theme="pearl"] :is(.balance-hero h2, .balance-hero .total, .balance-breakdown dt, .balance-breakdown dd) { color: var(--text); }
}
