  /* Unified onto the same design system as index.css/analysis.css (item 1,
     launch UX review 2026-07) — same palette, fonts, and .topbar/.brand
     header chrome as the React-driven pages (web/static/js/design/app.jsx's
     Topbar), hand-written here since this page stays plain HTML/JS rather
     than a React entry point. The table/filter/notice/gated-state rules
     below are UNCHANGED in behavior — only the design tokens they read
     changed, via the alias block right after :root, so this file's own
     selectors didn't all need renaming one by one. */

  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  :root {
    /* Same source values as index.css / analysis.css. */
    --bg:       #03051a;
    --bg-elev:  #080c28;
    --bg-elev2: #0e1336;
    --line:     #1a2046;
    --line-2:   #232a55;
    --text:     #e8eaf2;
    --text-dim: #7e84a8;
    --text-faint:#4e527a;
    --accent:    #a8a8e0;
    --accent-dim:#5e5fa8;
    --cls-bundled: #e08070;
    --cls-cabaled: #dc9e47;
    --cls-organic: #6ea8ff;
    --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
    --sans: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
    --pad-x: 56px;
    --col-max: 1320px;

    /* Local aliases — every selector below keeps its original name, only
       pointed at the shared palette. */
    --surface: var(--bg-elev);
    --border: var(--line);
    --row-border: var(--line);
    --text-primary: var(--text);
    --text-secondary: var(--text-dim);
    --text-tertiary: var(--text-dim);
    --text-muted: var(--text-faint);
    --red: var(--cls-bundled);
    --yellow: var(--cls-cabaled);
    --blue: var(--cls-organic);
    --gray: var(--text-faint);
  }

  html, body {
    min-height: 100%;
    background: var(--bg);
    color: var(--text-primary);
    font-family: var(--sans);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  a { color: inherit; }

  /* Topbar — identical markup/classes to app.jsx's Topbar (analysis.html),
     sticky rather than fixed (so `main` needs no top-padding hack to avoid
     being covered). */
  .topbar {
    min-height: 56px;
    display: flex; align-items: center;
    /* Opaque on purpose — WebKit fails to paint translucent backgrounds on
       sticky bars (see analysis.css .topbar for the full story; same fix,
       same composite color, enforced by tests/web/mobile_smoke.playwright.mjs). */
    background: #06081c;
    position: sticky; top: 0; z-index: 50;
  }
  /* This page has exactly one Topbar layout (unlike app.jsx/projects-app.jsx,
     which reuse Topbar across contexts via inline style overrides), so the
     position/justify-content/flex values that would be inline style={{}}
     props in JSX are baked directly into these base rules instead — CSP
     style-src has no unsafe-inline (test_csp_no_unsafe.py), which is fine
     for React's runtime style.property assignments but not for a literal
     style="" HTML attribute in static markup like this page. */
  /* nav | brand | actions as three real grid columns — the brand was
     position:absolute at left:50% here too, and out of flow it painted over
     the last nav link ("Docs") as soon as the window narrowed. Columns
     shrink; they never overlap. Same fix and same breakpoint as
     analysis.css so both pages behave identically. */
  .topbar .row {
    display: grid; grid-template-columns: 1fr auto 1fr;
    align-items: center; column-gap: 24px; width: 100%;
  }
  .brand { display:flex; align-items: baseline; gap: 8px; font-weight: 600; letter-spacing: -0.01em; justify-self: center; white-space: nowrap; }
  .brand-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 14px var(--accent); transform: translateY(-1px); }
  .brand-word { font-family: var(--mono); letter-spacing: 0.04em; font-size: 14px; }
  /* Scrolls inside its own column instead of pushing the page wider than the
     viewport; the scrollbar itself is hidden (five links don't need one). */
  .topbar-nav {
    display: flex; gap: 22px; color: var(--text-dim); min-width: 0;
    overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
  }
  .topbar-nav::-webkit-scrollbar { width: 0; height: 0; }
  .topbar-nav a { font-size: 13px; text-decoration: none; white-space: nowrap; }
  .topbar-nav a:hover { color: var(--text); }
  .nav-home { color: var(--text); }
  .topbar-actions { display: flex; align-items: center; gap: 14px; justify-self: end; min-width: 0; }

  @media (max-width: 1023px) {
    /* The page gutter shrinks with the window. 56px a side is a desktop
       measure — on a 360px phone it left the scan table only 248px and the
       page scrolled sideways. The topbar already used these numbers. */
    :root { --pad-x: 20px; }
    .topbar { min-height: 78px; }
    .topbar .container { padding: 0 20px; }
    .topbar .row {
      grid-template-columns: auto 1fr;
      grid-template-areas: "brand actions" "nav nav";
      column-gap: 12px; row-gap: 8px; padding: 10px 0;
    }
    .brand { grid-area: brand; justify-self: start; }
    .topbar-actions { grid-area: actions; flex-wrap: wrap; justify-content: flex-end; }
    .topbar-nav { grid-area: nav; gap: 18px; }
  }
  .btn {
    height: 30px; padding: 0 12px;
    border: 1px solid var(--line-2); border-radius: 4px;
    background: transparent; color: var(--text);
    font: 500 12px/1 var(--sans); letter-spacing: 0.02em;
    display: inline-flex; align-items: center; gap: 8px;
    cursor: pointer;
  }
  .btn-accent { background: var(--accent); color: #0a0d22; border-color: var(--accent); }
  .btn-accent:hover { color: #0a0d22; background: #b8b8ee; border-color: #b8b8ee; }

  .container { max-width: var(--col-max); margin: 0 auto; padding: 0 var(--pad-x); }

  /* Main */
  main {
    max-width: 900px;
    padding: 40px var(--pad-x) 80px;
  }

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

  /* Recent scans / Watchlist tab switch (item 2, launch UX review 2026-07) —
     replaces the old static "Recent scans" <h1>; the Watchlist tab reads
     window.LuminosWatchlist (web/static/js/watchlist-store.js) instead of
     /api/history, so it works the same in every LUMINOS_PUBLIC_HISTORY_MODE
     (it's local to the visitor's own browser, never broadcast). */
  .tab-switch {
    display: flex;
    gap: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3px;
  }
  .tab-btn {
    border: 0;
    background: transparent;
    color: var(--text-tertiary);
    font: 500 13px/1 var(--sans);
    padding: 7px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
  }
  .tab-btn:hover { color: var(--text-primary); }
  .tab-btn.active { background: var(--bg-elev2); color: var(--text-primary); }

  /* Filter input with icons */
  .filter-wrap {
    position: relative;
    width: 240px;
  }

  .filter-input {
    width: 100%;
    height: 36px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 32px 0 32px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
  }

  .filter-input::placeholder { color: var(--text-muted); }
  .filter-input:focus { border-color: var(--line-2); }

  /* CSS magnifying glass icon */
  .filter-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    pointer-events: none;
    opacity: 0.35;
  }

  .filter-icon::before {
    content: "";
    position: absolute;
    width: 9px;
    height: 9px;
    border: 1.5px solid var(--text-secondary);
    border-radius: 50%;
    top: 0;
    left: 0;
  }

  .filter-icon::after {
    content: "";
    position: absolute;
    width: 5px;
    height: 1.5px;
    background: var(--text-secondary);
    top: 10px;
    left: 8px;
    transform: rotate(45deg);
    transform-origin: left center;
  }

  /* Hide magnifying glass when filtering */
  .filter-wrap.has-value .filter-icon { display: none; }
  .filter-wrap.has-value .filter-input { padding-left: 12px; }

  /* Clear button */
  .filter-clear {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: none;
    background: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 4px;
    transition: background 0.15s;
  }

  .filter-clear:hover { background: var(--border); }

  .filter-clear::before,
  .filter-clear::after {
    content: "";
    position: absolute;
    width: 10px;
    height: 1.5px;
    background: var(--text-tertiary);
    top: 50%;
    left: 50%;
  }

  .filter-clear::before { transform: translate(-50%, -50%) rotate(45deg); }
  .filter-clear::after  { transform: translate(-50%, -50%) rotate(-45deg); }

  .filter-wrap.has-value .filter-clear { display: flex; }

  /* Summary stats */
  .summary-stats {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-tertiary);
    margin-bottom: 24px;
    line-height: 1;
  }

  .summary-stats .sep { margin: 0 4px; }

  .stat-count-red { color: var(--red); }
  .stat-count-yellow { color: var(--yellow); }
  .stat-count-blue { color: var(--blue); }
  .stat-count-gray { color: var(--gray); }

  /* Persistent opinion-framing notice — see the HTML comment above
     #history-notice for why this stays visible on every load rather than
     only behind the one-time disclaimer.js gate. */
  .history-notice {
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--text-secondary);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 20px;
  }
  .history-notice a { color: var(--text-primary); text-decoration: underline; text-underline-offset: 2px; }
  .history-notice a:hover { color: var(--blue); }

  /* Policy-gated feed states (LUMINOS_PUBLIC_HISTORY_MODE) — see
     web/app.py's _PUBLIC_HISTORY_MODE docstring. Only apply to the Recent
     scans tab; the Watchlist tab is local-only and never gated. */
  .feed-locked, .feed-anonymized {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-tertiary);
    font-size: 13px;
  }

  /* Table */
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .scan-table {
    width: 100%;
    border-collapse: collapse;
  }

  .scan-table th {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
    text-align: left;
    padding: 0 0 16px 12px;
    letter-spacing: 0;
  }

  .scan-table th:first-child { padding-left: 14px; }
  .scan-table th.right { text-align: right; padding-right: 8px; }

  .scan-table td {
    padding: 0 0 0 12px;
    vertical-align: middle;
    height: 48px;
  }

  .scan-table td:first-child { padding-left: 14px; }

  .scan-table tbody tr {
    cursor: pointer;
    border-left: 2px solid transparent;
    transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
  }

  .scan-table tbody tr.border-red    { border-left-color: var(--red); }
  .scan-table tbody tr.border-yellow { border-left-color: var(--yellow); }
  .scan-table tbody tr.border-blue   { border-left-color: var(--blue); }
  .scan-table tbody tr.border-gray   { border-left-color: var(--gray); }

  .scan-table tbody tr:hover {
    background: var(--surface);
    transform: translateX(2px);
  }

  .scan-table tbody tr.border-red:hover    { border-left-color: #CF3D4E; }
  .scan-table tbody tr.border-yellow:hover { border-left-color: #D4A23D; }
  .scan-table tbody tr.border-blue:hover   { border-left-color: #5A8CBB; }
  .scan-table tbody tr.border-gray:hover   { border-left-color: #5a6078; }

  /* Row separators — not on last row */
  .scan-table tbody tr.row-bordered {
    border-bottom: 1px solid var(--row-border);
  }

  .token-cell {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  /* Coin image (market.logoURI via /api/history, or the watchlist tab's own
     saved snapshot) — hides itself onerror, so a row without a logo simply
     has no image, never a broken icon. */
  .row-logo {
    width: 22px; height: 22px; border-radius: 999px;
    object-fit: cover; flex: 0 0 auto;
    background: rgba(255,255,255,0.04);
  }

  .token-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    transition: color 0.15s ease;
  }

  /* Token name hover colors inherited from row */
  tr.border-red:hover .token-name    { color: var(--red); }
  tr.border-yellow:hover .token-name { color: var(--yellow); }
  tr.border-blue:hover .token-name   { color: var(--blue); }
  tr.border-gray:hover .token-name   { color: var(--gray); }

  .token-ticker {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--text-tertiary);
  }

  .token-addr {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-muted);
  }

  .classification-cell {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .class-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
  }

  .class-dot.red { background: var(--red); }
  .class-dot.yellow { background: var(--yellow); }
  .class-dot.blue { background: var(--blue); }
  .class-dot.gray { background: var(--gray); }

  .class-label {
    font-size: 13px;
    font-weight: 400;
  }

  .class-label.red { color: var(--red); }
  .class-label.yellow { color: var(--yellow); }
  .class-label.blue { color: var(--blue); }
  .class-label.gray { color: var(--gray); }

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

  .time-cell {
    text-align: right;
    font-size: 13px;
    color: var(--text-tertiary);
    padding-right: 8px;
  }

  /* Watchlist-tab remove button — same cell as .time-cell, swapped in only
     for watchlist rows (history.js sets data-watchlist="1" on the table). */
  .row-remove {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-tertiary);
    border-radius: 6px;
    width: 24px; height: 24px;
    line-height: 1;
    cursor: pointer;
    font-size: 13px;
  }
  .row-remove:hover { color: var(--red); border-color: var(--red); }

  /* Date group separators */
  .date-separator {
    padding: 0 0 0 14px;
    height: auto;
  }

  .date-separator td {
    padding: 24px 0 8px 14px;
    height: auto;
  }

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

  /* States */
  .loading, .empty-state {
    text-align: center;
    padding: 80px 0;
    font-size: 15px;
    color: var(--text-tertiary);
  }

  .empty-state a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
  }

  .empty-state a:hover { color: var(--text-primary); }

  .empty-icon {
    display: block;
    margin: 0 auto 16px;
    opacity: 0.3;
  }

  .empty-text {
    font-size: 14px;
    color: var(--text-tertiary);
    margin-bottom: 8px;
  }

  .empty-link {
    font-size: 13px;
  }

  /* No-match state (filtering) */
  .no-match {
    text-align: center;
    padding: 60px 0;
    font-size: 14px;
    color: var(--text-tertiary);
  }

  .hidden { display: none; }

  /* Mobile */
  @media (max-width: 640px) {
    :root { --pad-x: 16px; }
    .topbar .container { padding: 0 16px; }
    /* Five links + the New-scan button overflow a 390px phone, which clipped
       Methodology and Docs off the edge invisibly. Same phone treatment as
       analysis.css: drop the two redundant entries (Scan = brand/New-scan,
       Methodology = linked in the disclaimer paragraph below) so the rest
       stay fully visible. */
    .topbar-nav { gap: 13px; }
    .topbar-nav .nav-phone-hidden { display: none; }
    /* main.container: `main` alone (0,0,1) loses to `.container` (0,1,0),
       so this rule never applied and the 56px desktop gutter stayed. */
    main.container { padding: 24px var(--pad-x) 60px; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 16px; }
    .filter-wrap { width: 100%; }
    .token-addr { display: none; }
    .scan-table { font-size: 13px; }
  }
  .site-footer { text-align: center; padding: 26px 16px 30px; font-size: 12px; color: var(--text-faint); letter-spacing: 0.04em; }
  .site-footer a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
  .site-footer a:hover { color: var(--text-secondary); }
