/* ============================================================
   css/ui-next.css — the preview interface (lib/ui-next-gate.js).

   Every rule is scoped under html.ui-next, so without the class this file
   does nothing. The painters are in js/ui-next.js: the verdict summary
   and scan log (.un-panel, under the token hero on every chain) and the
   homepage's Called it strip (#unProof).
   ============================================================ */

html.ui-next {
  --un-bg: rgba(255, 255, 255, 0.03);
  --un-line: rgba(255, 255, 255, 0.09);
  --un-text: #e8e8ef;
  --un-dim: #7c7c92;
  --un-red: #ff4d5e;
  --un-orange: #ff8844;
  --un-yellow: #ffcc00;
  --un-green: #30d158;
  --un-cyan: #00d4ff;
  --un-mono: 'JetBrains Mono', ui-monospace, monospace;
}

/* ---- verdict summary + scan log ---- */
html.ui-next .un-panel {
  margin: 16px 0;
  background: var(--un-bg);
  border: 1px solid var(--un-line);
  border-radius: 18px;
  padding: 20px;
  color: var(--un-text);
  /* Clear the sticky top bar when the panel is scrolled to. */
  scroll-margin-top: 96px;
}
html.ui-next .un-head { margin-bottom: 16px; }
html.ui-next .un-verdict { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; }
html.ui-next .un-word { font-size: 30px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.1; }
html.ui-next .un-score { font-family: var(--un-mono); font-size: 15px; color: var(--un-dim); }
html.ui-next .un-score b { font-size: 26px; color: var(--un-text); font-weight: 700; }
html.ui-next .un-state {
  font-family: var(--un-mono); font-size: 11px; letter-spacing: 1px;
  border: 1px solid var(--un-line); border-radius: 6px; padding: 2px 8px; color: var(--un-dim);
  align-self: center;
}
html.ui-next .un-verdict[data-tone="red"] .un-word { color: var(--un-red); }
html.ui-next .un-verdict[data-tone="orange"] .un-word { color: var(--un-orange); }
html.ui-next .un-verdict[data-tone="yellow"] .un-word { color: var(--un-yellow); }
html.ui-next .un-verdict[data-tone="green"] .un-word { color: var(--un-green); }
html.ui-next .un-verdict[data-tone="neutral"] .un-word { color: var(--un-cyan); }
html.ui-next .un-panel[data-state="waiting"] .un-word { animation: un-pulse 1.4s ease-in-out infinite; }
@keyframes un-pulse { 50% { opacity: 0.45; } }
html.ui-next .un-reason { margin-top: 6px; font-size: 15px; color: var(--un-text); opacity: 0.85; }

html.ui-next .un-body { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
html.ui-next .un-sub {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--un-dim);
  padding: 0 4px 8px; border-bottom: 1px solid var(--un-line);
}
html.ui-next .un-sub span { font-family: var(--un-mono); text-transform: none; letter-spacing: 0; }

html.ui-next .un-row {
  display: grid; grid-template-columns: 10px minmax(0, 1fr) minmax(0, 1.2fr) auto;
  gap: 12px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--un-line);
}
html.ui-next .un-row:last-child { border-bottom: 0; }
html.ui-next .un-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--un-dim); }
html.ui-next .un-name { font-weight: 600; font-size: 14px; min-width: 0; }
html.ui-next .un-name small { display: block; font-weight: 400; font-size: 11px; color: var(--un-dim); margin-top: 2px; }
html.ui-next .un-find { font-family: var(--un-mono); font-size: 12px; color: var(--un-text); opacity: 0.9; min-width: 0; overflow-wrap: anywhere; }
html.ui-next .un-chip {
  font-family: var(--un-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
  border-radius: 5px; padding: 3px 7px; border: 1px solid var(--un-line); color: var(--un-dim); white-space: nowrap;
}
html.ui-next .un-row[data-st="flag"] .un-dot { background: var(--un-red); box-shadow: 0 0 8px var(--un-red); }
html.ui-next .un-row[data-st="flag"] .un-chip { color: var(--un-red); border-color: rgba(255, 77, 94, 0.45); background: rgba(255, 77, 94, 0.1); }
html.ui-next .un-row[data-st="watch"] .un-dot { background: var(--un-orange); }
html.ui-next .un-row[data-st="watch"] .un-chip { color: var(--un-orange); border-color: rgba(255, 136, 68, 0.45); background: rgba(255, 136, 68, 0.1); }
html.ui-next .un-row[data-st="pass"] .un-dot { background: var(--un-green); }
html.ui-next .un-row[data-st="pass"] .un-chip { color: var(--un-green); border-color: rgba(48, 209, 88, 0.4); background: rgba(48, 209, 88, 0.08); }
html.ui-next .un-row[data-st="pending"] .un-dot { animation: un-pulse 1s ease-in-out infinite; }
html.ui-next .un-row[data-st="pending"] .un-find,
html.ui-next .un-row[data-st="off"] .un-find { color: var(--un-dim); }

/* DeFade's tick and lock in place of the scorer's emoji (js/ui-next.js labelHtml). */
html.ui-next .un-ic svg { margin: 0 0 0 0.35em !important; vertical-align: -0.15em; }
html.ui-next .un-ic { white-space: nowrap; }
html.ui-next .un-row[data-st="pass"] .un-ic,
html.ui-next .un-reason .un-ic { color: var(--un-green); }
html.ui-next .un-log {
  background: #05050b; border: 1px solid var(--un-line); border-radius: 12px;
  font-family: var(--un-mono); font-size: 11.5px; overflow: hidden; min-width: 0;
}
html.ui-next .un-log-head {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-bottom: 1px solid var(--un-line); color: var(--un-dim);
}
html.ui-next .un-timer { margin-left: auto; color: var(--un-text); }
html.ui-next .un-live { color: var(--un-green); }
html.ui-next .un-live::before { content: '●'; margin-right: 5px; animation: un-pulse 1s ease-in-out infinite; }
html.ui-next .un-live.done { color: var(--un-dim); }
html.ui-next .un-live.done::before { animation: none; }
html.ui-next .un-log ol { list-style: none; margin: 0; padding: 8px 12px 10px; min-height: 120px; }
html.ui-next .un-log li { display: flex; gap: 10px; padding: 2px 0; line-height: 1.45; min-width: 0; }
html.ui-next .un-log time { color: var(--un-dim); flex: 0 0 auto; }
html.ui-next .un-log span { min-width: 0; overflow-wrap: anywhere; color: var(--un-text); opacity: 0.85; }
html.ui-next .un-log li[data-k="flag"] span { color: var(--un-red); opacity: 1; }
html.ui-next .un-log li[data-k="watch"] span { color: var(--un-orange); opacity: 1; }
html.ui-next .un-log li[data-k="off"] span { color: var(--un-dim); }
html.ui-next .un-log li[data-k="verdict"] span,
html.ui-next .un-log li[data-k="done"] span { color: var(--un-cyan); opacity: 1; }
html.ui-next .un-log li:last-child span::after { content: '▌'; margin-left: 3px; animation: un-pulse 1s steps(1) infinite; color: var(--un-dim); }

/* ---- homepage: the Called it strip ---- */
html.ui-next .un-proof {
  background: var(--un-bg); border: 1px solid var(--un-line); border-radius: 22px; padding: 22px;
  color: var(--un-text); min-width: 0;
}
html.ui-next .un-proof[hidden] { display: none; }
html.ui-next .un-proof-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
html.ui-next .un-proof-head h2 { font-size: 24px; font-weight: 700; margin: 0; }
html.ui-next .un-proof-head h2 em { font-style: normal; color: var(--un-red); }
html.ui-next .un-proof-head p { margin: 4px 0 0; color: var(--un-dim); font-size: 14px; }
html.ui-next .un-proof-head p b { color: var(--un-text); font-family: var(--un-mono); }
html.ui-next .un-proof-head a { color: var(--un-cyan); text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap; }
html.ui-next .un-proof-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
html.ui-next .un-proof-card {
  display: block; text-decoration: none; color: inherit; background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--un-line); border-radius: 14px; padding: 14px; min-width: 0;
  transition: border-color 0.15s;
}
html.ui-next .un-proof-card:hover { border-color: rgba(255, 77, 94, 0.45); }
html.ui-next .un-proof-top { display: flex; justify-content: space-between; gap: 8px; }
html.ui-next .un-proof-top b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
html.ui-next .un-proof-top span { font-size: 11px; color: var(--un-dim); border: 1px solid var(--un-line); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
html.ui-next .un-proof-flag { font-family: var(--un-mono); font-size: 11px; color: var(--un-red); margin-top: 8px; }
html.ui-next .un-proof-mc { font-family: var(--un-mono); font-size: 16px; margin-top: 8px; }
html.ui-next .un-proof-mc em { font-style: normal; color: var(--un-red); font-weight: 700; }
html.ui-next .un-proof-lead { font-size: 12px; color: var(--un-dim); margin-top: 6px; }

/* ---- homepage order: scan first, then proof, then discovery; the
   tools (tracker, Pro, rug database, KOL, everywhere) move below.
   Overrides css/ui-v2.css's grid, which every page carries. ---- */
html.ui-v2.ui-next .container > main {
  grid-template-areas:
    "scan scan scan"
    "results results results"
    "proof proof proof"
    "discover discover discover"
    "tracker tracker pro"
    "rugs rugs rugs"
    "kol kol every"
    "api api api";
}
html.ui-v2.ui-next #unProof { grid-area: proof; }

@media (max-width: 900px) {
  html.ui-v2.ui-next .container > main {
    grid-template-areas: "scan" "results" "proof" "discover" "tracker" "pro" "rugs" "kol" "every" "api";
  }
  html.ui-next .un-body { grid-template-columns: minmax(0, 1fr); }
  html.ui-next .un-proof-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  html.ui-next .un-panel { padding: 16px; border-radius: 16px; }
  html.ui-next .un-word { font-size: 24px; }
  html.ui-next .un-row { grid-template-columns: 10px minmax(0, 1fr) auto; }
  html.ui-next .un-find { grid-column: 2 / -1; grid-row: 2; }
  html.ui-next .un-proof { padding: 16px; border-radius: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  html.ui-next .un-panel *, html.ui-next .un-live::before { animation: none !important; }
}
