  /* =====================================================================
     Windows 11 — Dark mode (Fluent / Mica inspired)
     ===================================================================== */
  /* =====================================================================
     macOS-inspired theme (Sequoia / Sonoma) — calm, soft, system-flavored
     ===================================================================== */
  :root {
    color-scheme: dark;
    --bg:        #121214;
    --panel:     #1b1b1f;
    --panel2:    #24242a;
    --code:      #0d0d10;
    --line:      rgba(255,255,255,.09);
    --line2:     rgba(255,255,255,.16);
    --fg:        #f5f5f7;
    --fg2:       #e8e8ea;
    --mute:      #98989d;
    --mute2:     #8e8e93;
    --accent:    #0a84ff;
    --accent2:   #409cff;
    --accent-fg: #ffffff;
    --good:      #30d158;
    --warn:      #ffd60a;
    --bad:       #ff453a;
    --bad2:      #d70015;
    --hover:     rgba(255,255,255,.05);
    --hover2:    rgba(255,255,255,.09);
    --header-bg: rgba(18,18,20,.82);
    --modal-bg:  rgba(24,24,28,.94);
    --btn-disabled-bg: rgba(255,255,255,.08);
    --selection-bg: rgba(10,132,255,.35);
    --map-bg:    #0f1417;
    --map-land:  #2a3138;
    --map-stroke:rgba(255,255,255,.10);
    --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text",
            "Segoe UI Variable Text", "Segoe UI", "Helvetica Neue",
            system-ui, Arial, sans-serif;
    --display: -apple-system, BlinkMacSystemFont, "SF Pro Display",
               "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
    --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Cascadia Code",
            "JetBrains Mono", "Consolas", Menlo, monospace;
    --radius:    10px;
    --radius-sm: 6px;
    --radius-lg: 14px;
    --shadow-card: 0 1px 2px rgba(0,0,0,.30), 0 0 0 .5px rgba(255,255,255,.04);
    --shadow-pop:  0 10px 30px rgba(0,0,0,.45), 0 0 0 .5px rgba(255,255,255,.08);
  }
  /* macOS Light palette */
  html[data-theme="light"] {
    color-scheme: light;
    --bg:        #f5f5f7;
    --panel:     #ffffff;
    --panel2:    #fbfbfd;
    --code:      #f0f0f3;
    --line:      rgba(0,0,0,.08);
    --line2:     rgba(0,0,0,.16);
    --fg:        #1d1d1f;
    --fg2:       #2f2f33;
    --mute:      #6e6e73;
    --mute2:     #86868b;
    --accent:    #007aff;
    --accent2:   #339dff;
    --accent-fg: #ffffff;
    --good:      #28a745;
    --warn:      #b25e09;
    --bad:       #d70015;
    --bad2:      #b1271b;
    --hover:     rgba(0,0,0,.04);
    --hover2:    rgba(0,0,0,.07);
    --header-bg: rgba(255,255,255,.78);
    --modal-bg:  rgba(252,252,254,.96);
    --btn-disabled-bg: rgba(0,0,0,.06);
    --selection-bg: rgba(0,122,255,.25);
    --map-bg:    #eef2f6;
    --map-land:  #d6dde4;
    --map-stroke:rgba(0,0,0,.12);
    --shadow-card: 0 1px 2px rgba(0,0,0,.05), 0 0 0 .5px rgba(0,0,0,.04);
    --shadow-pop:  0 14px 40px rgba(0,0,0,.18), 0 0 0 .5px rgba(0,0,0,.06);
  }
  * { box-sizing: border-box; }
  html, body {
    margin: 0; padding: 0;
    background: var(--bg);
  }
  html { scrollbar-gutter: stable; }
  body {
    background: var(--bg); color: var(--fg2);
    font: 14px/1.5 var(--sans);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    -webkit-user-select: text;
    user-select: text;
  }
  p, li, h1, h2, h3, h4, h5, h6, a, button, label, summary, dt, dd, td, th,
  span, strong, em, small, code, pre, blockquote, figcaption {
    -webkit-user-select: text;
    user-select: text;
  }
  a { color: var(--accent); text-decoration: none; }
  a:hover { text-decoration: underline; color: var(--accent2); }
  ::selection { background: var(--selection-bg); color: var(--fg); }

  /* Custom scrollbars */
  *::-webkit-scrollbar { width: 12px; height: 12px; }
  *::-webkit-scrollbar-track { background: transparent; }
  *::-webkit-scrollbar-thumb {
    background: var(--line2); border-radius: 6px;
    border: 3px solid transparent; background-clip: padding-box;
  }
  *::-webkit-scrollbar-thumb:hover { background: var(--mute); border: 3px solid transparent; background-clip: padding-box; }

  /* Header / title bar — shared with landing */
  header.site {
    background: var(--header-bg);
    border-bottom: 1px solid var(--line);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    position: sticky; top: 0; z-index: 20;
  }
  header.site .inner {
    max-width: 1200px; margin: 0 auto;
    min-height: 48px; box-sizing: border-box;
    padding: .6rem 1.4rem;
    display: flex; align-items: center; gap: 1rem;
  }
  header.site a { color: var(--fg); text-decoration: none; }
  header.site .brand {
    display: flex; align-items: center; gap: .25rem;
    text-decoration: none; color: inherit;
  }
  header.site .logo {
    width: 28px; height: 28px;
    display: block; object-fit: contain;
    -webkit-user-select: none; user-select: none;
    -webkit-user-drag: none;
  }
  header.site strong {
    font-family: var(--mono);
    font-weight: 600;
    letter-spacing: -.01em;
    color: var(--fg);
    font-size: 1rem;
  }
  header.site nav {
    margin-left: auto; display: flex; gap: .25rem;
    font-size: .9rem; align-items: center;
  }
  header.site nav a, header.site nav .navlink {
    color: var(--fg2);
    padding: .35rem .75rem; border-radius: var(--radius-sm);
    transition: background .12s;
  }
  header.site nav a:hover, header.site nav .navlink:hover {
    background: var(--hover); color: var(--fg); text-decoration: none;
  }

  /* Header user menu (avatar + balance, dropdown) */
  .nav-balance {
    display: inline-flex; flex-direction: column; align-items: flex-end;
    color: var(--fg); padding: .1rem .5rem .1rem 0; line-height: 1.1;
    text-align: right;
  }
  .nav-balance .usd { color: var(--mute); font-size: .62rem; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
  .nav-balance .amt { font-family: var(--mono); font-weight: 600; font-size: .95rem; font-variant-numeric: tabular-nums; margin-top: .05rem; }
  .user-menu { position: relative; display: inline-flex; align-items: center; gap: .15rem; }
  .avatar-trigger {
    display: inline-flex; align-items: center; gap: .4rem;
    background: transparent; border: none; cursor: pointer;
    padding: .15rem .55rem .15rem .15rem; max-width: none; flex: 0 0 auto;
    border-radius: 999px;
    transition: background .15s;
  }
  .avatar-trigger:hover { background: var(--hover); }
  .avatar-trigger:active { transform: scale(.98); }
  .nav-addr {
    font-family: var(--mono); font-size: .78rem; color: var(--mute);
    letter-spacing: .02em;
    max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--hover);
    display: grid; place-items: center;
    padding: 0; flex: 0 0 auto;
    overflow: hidden;
    box-shadow: inset 0 0 0 .5px rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.18);
  }
  .avatar > span { display: block; width: 100%; height: 100%; line-height: 0; }
  .avatar svg { display: block; width: 100%; height: 100%; }
  .user-menu-addr {
    display: flex; align-items: center; gap: .4rem;
    margin-top: .35rem; padding: .4rem .5rem;
    background: var(--hover); border-radius: var(--radius-sm);
  }
  .user-menu-addr code {
    flex: 1; font-family: var(--mono); font-size: .78rem; color: var(--fg);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; user-select: all;
  }
  .user-menu-addr button {
    padding: .25rem .55rem; font-size: .72rem; max-width: none;
    background: var(--panel); color: var(--fg); border: 1px solid var(--line);
    border-radius: calc(var(--radius-sm) - 2px); cursor: pointer;
  }
  .user-menu-addr button:hover { background: var(--hover2); }
  .user-menu-panel {
    position: absolute; top: calc(100% + .5rem); right: 0;
    min-width: 220px; max-width: 280px;
    background: var(--modal-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-pop);
    padding: .5rem;
    z-index: 50;
    backdrop-filter: saturate(180%) blur(24px);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
  }
  .user-menu-section { padding: .45rem .6rem .35rem; }
  .user-menu-section .label {
    color: var(--mute); font-size: .68rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .06em;
  }
  .user-menu-sep { height: 1px; background: var(--line); margin: .25rem .35rem; }
  .theme-row { display: flex; gap: .25rem; margin-top: .4rem; padding: .2rem; background: var(--hover); border-radius: var(--radius-sm); }
  .theme-row button {
    flex: 1; padding: .38rem .4rem; font-size: .78rem; max-width: none;
    background: transparent; color: var(--fg2); border: none; font-weight: 500;
    border-radius: calc(var(--radius-sm) - 2px);
  }
  .theme-row button:hover { background: var(--hover2); color: var(--fg); border-color: transparent; }
  .theme-row button.active {
    background: var(--panel); color: var(--fg); border-color: transparent;
    box-shadow: 0 1px 2px rgba(0,0,0,.15), 0 0 0 .5px var(--line2);
  }
  .theme-row button.active:hover { background: var(--panel); }
  .settings-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: .6rem; padding: .35rem .6rem;
  }
  .settings-row .label {
    color: var(--mute); font-size: .75rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .04em;
  }
  .settings-row .i18n-picker,
  .settings-row .cur-picker { display: inline-flex; }
  .settings-row .i18n-picker-trigger,
  .settings-row .cur-picker-trigger {
    background: transparent; border: 1px solid var(--line);
    padding: .32rem .55rem !important; border-radius: var(--radius-sm);
    color: var(--fg); font-size: .82rem; cursor: pointer;
  }
  .settings-row .i18n-picker-trigger:hover,
  .settings-row .cur-picker-trigger:hover { background: var(--hover); }
  .user-menu-item {
    display: block; width: 100%; text-align: left;
    background: transparent; color: var(--fg); border: none;
    padding: .5rem .6rem; border-radius: var(--radius-sm);
    font: inherit; font-size: .88rem; cursor: pointer; max-width: none;
  }
  .user-menu-item:hover { background: var(--hover2); }

  /* Layout */
  main { max-width: 1200px; margin: 0 auto; padding: 1.6rem 1.4rem 4rem; }
  h1 {
    font: 600 1.65rem/1.2 var(--display);
    margin: .2rem 0 1.4rem;
    color: var(--fg);
    letter-spacing: -.005em;
  }
  h2 {
    font: 600 1.05rem/1.3 var(--display);
    margin: 0 0 .75rem;
    color: var(--fg);
    text-transform: none; letter-spacing: 0;
  }

  /* Cards / panels — Mica surface */
  .card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem 1.2rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-card);
  }
  .card.stat { padding: .7rem 1rem; margin-bottom: 0; }

  /* Collapsible cards */
  .card[data-collapsible] > h2,
  .card[data-collapsible] > div:first-child > h2 {
    cursor: pointer;
    display: inline-flex; align-items: center; gap: .45rem;
  }
  .card[data-collapsible] > h2::after,
  .card[data-collapsible] > div:first-child > h2::after {
    content: "▾"; color: var(--mute); font-weight: 400;
    transition: transform .15s;
  }
  .card.collapsed > h2::after,
  .card.collapsed > div:first-child > h2::after { transform: rotate(-90deg); }
  .card.collapsed { padding-bottom: .6rem; padding-top: .6rem; }
  .card.collapsed > *:not(:first-child) { display: none !important; }
  .card.collapsed > div:first-child > *:not(h2) { display: none !important; }

  /* Grid (legacy) */
  .grid { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 1rem; }

  /* ---------------- Hero (overview metrics) ---------------- */
  .hero {
    margin: .2rem 0 1.4rem;
    padding: .9rem 1.2rem 1rem;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
  }
  .hero-head {
    display: flex; align-items: center; gap: .65rem;
    width: 100%; background: transparent; border: none; color: inherit;
    padding: .15rem .3rem .65rem; margin: 0 0 .8rem;
    border-bottom: 1px solid var(--line);
    border-radius: var(--radius-sm);
    cursor: pointer; text-align: left;
    font: inherit;
    transition: background .12s, color .12s;
  }
  .hero-head:hover { background: var(--hover); }
  .hero-head:hover .hero-head-value { color: var(--accent); }
  .hero-head-icon { display: none; }
  .hero-head-label {
    color: var(--mute); font-size: .9rem;
    font-family: var(--sans); font-weight: 600;
  }
  .hero-head-value {
    color: var(--fg); font-family: var(--mono); font-size: .9rem;
    flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis;
    transition: color .12s;
  }
  .hero-head-chev { color: var(--mute); font-size: .85rem; flex: 0 0 auto; transition: transform .15s; }
  .hero.collapsed .hero-head-chev { transform: rotate(-90deg); }
  .hero.collapsed .hero-head { padding-bottom: .15rem; margin-bottom: 0; border-bottom-color: transparent; }
  .hero.collapsed .hero-row { display: none; }
  .hero.collapsed { padding: .7rem 1.2rem; }

  .hero-row {
    display: flex; flex-wrap: wrap; align-items: flex-start;
    gap: .5rem 2rem;
  }
  .hero-sep { width: 1px; align-self: stretch; background: var(--line); margin: .15rem 0; }
  .metric { display: flex; flex-direction: column; gap: .2rem; padding: .2rem .1rem; min-width: 0; text-align: right; }
  .metric .label {
    color: var(--mute); font-size: .55rem !important; font-weight: 500;
    text-transform: none; letter-spacing: 0;
    display: flex; align-items: center; gap: .3rem;
    text-align: left; align-self: stretch;
    margin-bottom: .35rem;
  }
  .metric .label .info {
    display: inline-grid; place-items: center;
    width: 13px; height: 13px; border-radius: 50%;
    background: var(--hover2); color: var(--mute);
    font-size: 9px; font-weight: 700; line-height: 1;
    font-family: var(--sans); letter-spacing: 0;
    text-transform: none;
    margin-left: auto;
  }
  .metric .label .info:hover { background: var(--accent); color: #fff; }
  .metric .label svg { display: none; }
  .metric .value {
    font: 600 1.75rem/1.1 var(--display);
    font-variant-numeric: tabular-nums; color: var(--fg);
    letter-spacing: -.02em;
  }
  .metric .value .cr { color: var(--mute); font-weight: 400; font-size: .55em; margin-left: .08em; letter-spacing: 0; }
  /* Generic small currency-unit suffix (e.g. "AWB", "AWB/min") */
  .unit { color: var(--mute); font-weight: 400; font-size: .68em; margin-left: .18em; letter-spacing: 0; }
  .metric .sub { color: var(--mute); font-size: .7rem; line-height: 1.35; }
  .metric .usd-est { color: var(--mute); font-size: .62rem; letter-spacing: .02em; font-variant-numeric: tabular-nums; line-height: 1; margin-bottom: -.25rem; text-align: right; }
  .metric-pos .value { color: var(--good); }
  .metric-neg .value { color: var(--bad); }
  .metric-reward .value { color: var(--accent); }
  @media (max-width: 720px) {
    .hero-sep { display: none; }
    .hero-row { gap: .8rem 1.3rem; }
    .metric .value { font-size: 1.4rem !important; }
  }

  /* Section (My Connections, etc.) */
  .section { margin: 1.4rem 0 1.4rem; }
  .section-head {
    display: flex; align-items: center; gap: .7rem; flex-wrap: wrap;
    padding-bottom: .6rem; margin-bottom: .9rem;
    border-bottom: 1px solid var(--line);
  }
  .section-head h2 { margin: 0; }

  /* Inline elements */
  .mono { font-family: var(--mono); font-size: 1em; word-break: break-all; }
  .reason { color: var(--mute); }
  .delta-pos { color: var(--good); }
  .delta-neg { color: var(--bad); }
  .right { text-align: right; }
  .empty { color: var(--mute); padding: .9rem 0; }
  .hide { display: none !important; }

  /* Readability floor */
  .reason, .sub, .badge, label, p, td, th, li, dd, dt, summary {
    font-size: max(0.9rem, 13px) !important;
  }
  .metric .label, .pill, .validated-pill,
  .hero-head-label, .hero-head-value, .hero-head-chev,
  .tabs button, .col-filter, .spec, .copy-btn,
  th, tbody td, header.site nav,
  .stat .v {
    font-size: revert !important;
  }
  .metric .value { font-size: 1.75rem !important; }
  .metric .sub { font-size: .68rem !important; }
  .metric .usd-est { font-size: .62rem !important; }

  /* Pills */
  .pill {
    display: inline-block;
    padding: 2px .6rem;
    font-size: .85rem;
    border: 1px solid var(--line2);
    color: var(--fg2);
    background: var(--hover);
    border-radius: 999px;
  }
  .pill.good { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, transparent); background: color-mix(in srgb, var(--good) 12%, transparent); }
  .pill.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: color-mix(in srgb, var(--warn) 12%, transparent); }
  .pill.bad  { color: var(--bad);  border-color: color-mix(in srgb, var(--bad)  45%, transparent); background: color-mix(in srgb, var(--bad)  12%, transparent); }
  .pill.off  { color: var(--mute); border-color: color-mix(in srgb, var(--mute) 35%, transparent); background: color-mix(in srgb, var(--mute) 10%, transparent); }
  .validated-pill {
    background: color-mix(in srgb, var(--good) 12%, transparent); color: var(--good);
    border: 1px solid color-mix(in srgb, var(--good) 40%, transparent); padding: 1px .55rem;
    border-radius: 999px; font-size: .85rem;
  }

  /* Buttons — Fluent accent */
  button, .btn {
    background: var(--accent);
    color: var(--accent-fg);
    border: 1px solid transparent;
    padding: .42rem 1rem;
    border-radius: var(--radius-sm);
    font: 600 .9rem/1.3 var(--sans);
    cursor: pointer;
    transition: background .12s, border-color .12s, color .12s, transform .04s;
  }
  button:hover, .btn:hover {
    background: var(--accent2);
    color: var(--accent-fg);
  }
  button:active { background: var(--accent2); transform: translateY(0); filter: brightness(.95); }
  button:disabled { background: var(--btn-disabled-bg); color: var(--mute2); cursor: not-allowed; }
  button.ghost {
    color: var(--fg);
    background: var(--hover);
    border: 1px solid var(--line2);
    font-weight: 500;
  }
  button.ghost:hover { background: var(--hover2); color: var(--fg); border-color: var(--line2); }
  button.ghost.active {
    color: var(--accent-fg); background: var(--accent); border-color: var(--accent);
  }
  button.ghost.active:hover { background: var(--accent2); border-color: var(--accent2); }
  button.danger {
    color: #fff; background: var(--bad2); border-color: var(--bad2);
  }
  button.danger:hover { background: color-mix(in srgb, var(--bad2) 80%, #000); border-color: color-mix(in srgb, var(--bad2) 80%, #000); }

  /* Inputs */
  input, textarea, select {
    background: var(--hover);
    border: 1px solid var(--line2);
    color: var(--fg);
    border-radius: var(--radius-sm);
    padding: .42rem .65rem;
    font: inherit;
    width: 100%;
    transition: border-color .12s, background .12s, box-shadow .12s;
  }
  input::placeholder, textarea::placeholder { color: var(--mute2); }
  input:hover, textarea:hover, select:hover { background: var(--hover2); }
  input:focus, textarea:focus, select:focus {
    outline: none;
    background: var(--panel);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
  }
  textarea { font-family: var(--mono); font-size: .9rem; min-height: 110px; }
  label { display: block; font-size: .85rem; color: var(--fg2); margin-bottom: .3rem; font-weight: 500; }

  /* Tables */
  table { width: 100%; border-collapse: collapse; font-size: .92rem; background: transparent; }
  th, td {
    text-align: left; padding: .55rem .75rem;
    border-bottom: 1px solid var(--line);
  }
  th {
    color: var(--mute); font-weight: 600; font-size: .85rem;
    font-family: var(--sans);
    text-transform: none; letter-spacing: 0;
    background: transparent;
    border-bottom: 1px solid var(--line2);
  }
  td.mono { word-break: break-all; }
  tbody tr:hover td { background: var(--hover); }

  /* Compact activity table — small font, one-line rows with optional subscript. */
  .activity-table { font-size: .76rem; }
  .activity-table th, .activity-table td {
    padding: .35rem .5rem;
    vertical-align: middle;
    white-space: nowrap;
  }
  .activity-table td.wrap, .activity-table th.wrap { white-space: normal; }
  .activity-table .pill,
  .activity-table .validated-pill,
  .activity-table .proto-badge {
    font-size: .62rem;
    padding: 1px .4rem;
    line-height: 1.3;
  }
  .activity-table .proto-badge { gap: .2rem; }
  .activity-table .proto-icon { width: 11px; height: 11px; }
  .activity-table .sub,
  .activity-table .sup {
    display: block;
    font-size: .65rem;
    color: var(--mute);
    line-height: 1.2;
    font-weight: 400;
    opacity: .85;
  }
  .activity-table .sub { margin-top: 1px; }
  .activity-table .sup { margin-bottom: 1px; }
  .activity-table .cell-stack { display: inline-flex; flex-direction: column; gap: 0; }
  .activity-table .badges { display: inline-flex; align-items: center; gap: .25rem; flex-wrap: nowrap; }
  .activity-table button { font-size: .7rem; padding: 3px 8px; }
  .activity-table button.icon-btn { padding: 3px 7px; min-width: 0; }

  .row { display: flex; gap: .6rem; align-items: center; }
  .row > * { flex: 1; }

  /* Code / pre blocks */
  pre {
    background: var(--code);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: .7rem .85rem;
    overflow: auto;
    font-family: var(--mono);
    font-size: .9rem;
    color: var(--fg2);
    white-space: pre;
  }

  /* Tabs — Win11 pivot style */
  .tabs {
    display: flex; gap: .25rem;
    border-bottom: 1px solid var(--line);
    margin: 0 0 1.2rem;
  }
  .tabs button {
    background: transparent; color: var(--mute);
    border: none; border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: .55rem .9rem;
    font: 500 .95rem/1.3 var(--sans);
    cursor: pointer;
    position: relative;
  }
  .tabs button:hover { color: var(--fg); background: transparent; }
  .tabs button.active {
    color: var(--fg);
    font-weight: 600;
  }
  .tabs button.active::after {
    content: ""; position: absolute;
    left: .9rem; right: .9rem; bottom: -1px;
    height: 3px; border-radius: 2px;
    background: var(--accent);
  }
  .tabs button.active:hover { background: transparent; color: var(--fg); }
  .tabs button.admin-only { color: var(--accent); }

  /* Filter grid (marketplace) */
  .filter-grid {
    display: grid; gap: .8rem 1rem;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
  .col-filter { width: 100%; margin-top: .2rem; font-size: .8rem; padding: .3rem .4rem; }

  /* Network map */
  .map-wrap {
    position: relative;
    width: 100%;
    background: var(--map-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 2 / 1;
    max-height: 540px;
  }
  #worldMap { display: block; width: 100%; height: 100%; }
  #mapDots circle {
    cursor: pointer;
    transition: r .12s ease, opacity .12s ease;
  }
  #mapDots circle.dot-listing { fill: var(--accent); stroke: rgba(255,255,255,.85); stroke-width: .6; opacity: .9; }
  #mapDots circle.dot-mine    { fill: var(--good);   stroke: rgba(255,255,255,.85); stroke-width: .6; opacity: .95; }
  #mapDots circle.dot-pulse {
    fill: var(--accent); opacity: .25; pointer-events: none;
    animation: mapPulse 2.4s ease-out infinite;
  }
  #mapDots circle.dot-pulse.mine { fill: var(--good); }
  #mapDots circle:hover { opacity: 1; }
  @keyframes mapPulse {
    0%   { r: 3;  opacity: .45; }
    100% { r: 14; opacity: 0;   }
  }
  .map-tip {
    position: absolute;
    background: var(--modal-bg);
    color: var(--fg);
    border: 1px solid var(--line2);
    border-radius: var(--radius-sm);
    padding: .35rem .55rem;
    font-size: .75rem;
    box-shadow: var(--shadow-pop);
    pointer-events: none;
    max-width: 240px;
    z-index: 3;
  }
  .map-tip .mt-title { font-weight: 600; margin-bottom: .15rem; }
  .map-tip .mt-meta  { color: var(--mute); font-size: .7rem; }
  .map-legend {
    display: flex; align-items: center; gap: 1rem;
    margin-top: .6rem; font-size: .78rem; color: var(--mute); flex-wrap: wrap;
  }
  .map-swatch {
    display: inline-block; width: 10px; height: 10px; border-radius: 50%;
    margin-right: .35rem; vertical-align: middle;
    border: 1px solid rgba(255,255,255,.7);
  }
  .map-swatch.listing { background: var(--accent); }
  .map-swatch.mine    { background: var(--good); }
  #mapFilter button { padding: .25rem .55rem; font-size: .75rem; }

  /* Compact marketplace filter bar */
  .mf-card { padding: .7rem .9rem; }
  .mf-row {
    display: flex; align-items: stretch; gap: .5rem; flex-wrap: wrap;
    --mf-h: 32px;
  }
  .mf-row + .mf-row { margin-top: .55rem; }
  .mf-row > select,
  .mf-row > input,
  .mf-row > button,
  .mf-row > label {
    height: var(--mf-h);
    box-sizing: border-box;
    font-size: .82rem;
    line-height: 1;
  }
  .mf-row select, .mf-row input[type="text"], .mf-row input:not([type]) {
    padding: 0 .55rem;
  }
  .mf-row button { padding: 0 .85rem; max-width: none; }
  .mf-search { flex: 1 1 180px; min-width: 140px; }
  .mf-proto  { flex: 0 0 auto; min-width: 100px; max-width: 140px; }
  .mf-row .proto-picker { min-width: 0; flex: 0 0 auto; height: var(--mf-h); }
  .mf-row .proto-picker-trigger {
    height: var(--mf-h); min-height: 0;
    padding: 0 .5rem; font-size: .78rem;
  }
  .mf-price {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: 0 .5rem;
    background: var(--hover); border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    font-size: .74rem; color: var(--mute);
    flex: 0 0 auto; white-space: nowrap;
  }
  .mf-price input[type="range"] {
    width: 80px; accent-color: var(--accent);
    height: auto; margin: 0; padding: 0;
  }
  .mf-price-val { color: var(--fg); font-weight: 600; min-width: 2.6em; text-align: right; }
  .mf-adv-toggle {
    background: transparent; color: var(--mute); border: 1px dashed var(--line2);
    padding: 0 .55rem !important; font-size: .74rem; font-weight: 500;
    border-radius: var(--radius-sm); cursor: pointer; font-family: inherit;
    max-width: none; display: inline-flex; align-items: center; justify-content: center;
    line-height: 1;
  }
  .mf-adv-toggle.active { color: var(--accent); border-color: var(--accent); border-style: solid; }
  .mf-adv-toggle:hover { color: var(--fg); border-color: var(--line2); background: var(--hover); }
  .mf-adv {
    display: grid; gap: .5rem .7rem;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    margin-top: .55rem; padding-top: .55rem;
    border-top: 1px solid var(--line);
  }
  .mf-adv[hidden] { display: none; }
  .mf-adv label { font-size: .72rem; color: var(--mute); margin: 0 0 .15rem; display: block; }
  .mf-adv select, .mf-adv input { font-size: .8rem; padding: .3rem .45rem; }

  /* Protocol icon (next to dropdowns and on listing cards) */
  .proto-icon {
    display: inline-grid; place-items: center;
    width: 18px; height: 18px; flex: 0 0 auto;
    color: var(--fg2);
  }
  .proto-icon svg { width: 100%; height: 100%; display: block; }
  .proto-badge {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: 2px .55rem; border-radius: 999px;
    border: 1px solid var(--line2); color: var(--fg2);
    font-size: .72rem; font-weight: 500;
  }
  .proto-badge .proto-icon { width: 13px; height: 13px; color: var(--accent); }

  /* Custom proto picker (wraps a hidden <select>) */
  .proto-picker { position: relative; display: inline-flex; align-items: stretch; min-width: 160px; }
  .proto-picker.full { width: 100%; }
  .proto-picker > select { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
  .proto-picker-trigger {
    flex: 1; display: inline-flex; align-items: center; gap: .35rem;
    padding: .35rem .55rem; border-radius: var(--radius);
    border: 1px solid var(--line2); background: var(--panel);
    color: var(--fg); font-size: .82rem; cursor: pointer;
    text-align: left; min-height: 34px;
  }
  .proto-picker-trigger:hover { background: var(--hover); }
  .proto-picker-trigger:focus { outline: 2px solid color-mix(in srgb, var(--accent) 50%, transparent); outline-offset: 1px; }
  .proto-picker-trigger .caret { margin-left: auto; opacity: .55; font-size: .7rem; }
  .proto-picker-trigger .label { font-weight: 500; }
  .proto-picker-trigger .proto-icon { width: 16px; height: 16px; color: var(--accent); }
  .proto-picker-menu {
    position: absolute; top: 100%; left: 0; right: 0;
    margin-top: 4px; padding: 4px;
    background: var(--panel); border: 1px solid var(--line2);
    border-radius: var(--radius); box-shadow: var(--shadow-card);
    z-index: 1000; max-height: 320px; overflow-y: auto;
    display: none;
  }
  .proto-picker.open .proto-picker-menu { display: block; }
  .proto-picker-option {
    display: flex; align-items: center; gap: .4rem;
    padding: .35rem .5rem; border-radius: calc(var(--radius) - 2px);
    cursor: pointer; font-size: .82rem; color: var(--fg);
  }
  .proto-picker-option:hover, .proto-picker-option.focused { background: var(--hover); }
  .proto-picker-option.selected { background: color-mix(in srgb, var(--accent) 14%, transparent); cursor: default; }
  .proto-picker-option.selected:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
  .proto-picker-option .proto-icon { width: 16px; height: 16px; color: var(--accent); }
  .proto-picker-option.hidden { display: none; }

  .node-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: .9rem 1.1rem;
    margin-bottom: .8rem;
    background: var(--panel);
    box-shadow: var(--shadow-card);
    transition: background .12s, border-color .12s;
  }
  .node-card:hover { background: var(--panel2); border-color: var(--line2); }
  .node-card h3 { margin: 0 0 .3rem; font: 600 1.02rem/1.25 var(--display); color: var(--fg); }
  .specs {
    display: flex; flex-wrap: wrap; gap: .35rem .6rem;
    font-size: .85rem; color: var(--mute);
    margin: .4rem 0 .6rem;
  }
  .spec {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: 1px .55rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--hover);
  }
  .spec strong { color: var(--fg); font-weight: 600; }
  .flag { font-size: 1rem; line-height: 1; }

  /* Modal — content dialog */
  .modal-bg {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.4);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    display: none; align-items: center; justify-content: center;
    padding: 1rem; z-index: 50;
  }
  .modal-bg.open { display: flex; }
  .modal {
    background: var(--modal-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    max-width: 640px; width: 100%;
    padding: 1.4rem 1.6rem;
    max-height: 90vh; overflow: auto;
    box-shadow: var(--shadow-pop);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
  }
  .modal h2 {
    color: var(--fg); font-size: 1.2rem; font-weight: 600;
    text-transform: none; letter-spacing: 0;
  }
