/* Scanner revamp, 2026-09-29: the board leads.
   Refines Precision Terminal without new colours, fonts, motion or live-refresh work. Measured before:
   desktop's first coin row sat 54% down the screen with 4 rows visible (rows 104px, reasons wrapped to
   three lines in a 223px column); on phones the first row sat 59% down with one card visible. This file
   removes the bands above the board and gives verdict reasons the width they need. No words, warnings,
   odds or caveats are removed. Loaded last so it wins over the earlier overlays by source order. */

/* The RH token button now sits with Watching / My coins / Saved views. This div stays in the DOM as the
   anchor the RH panel is inserted after. */
.rh-market-access { display: none; }

@media (min-width: 761px) {
  /* The navigation and the tab title already name the Scanner: keep the heading for assistive tech
     only, and give its 68px back to the board. */
  .scanner-heading { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
  /* Toolbar sits directly under the section nav. */
  .scanner-tools { padding-top: 12px; }
  /* Workspace views stay on one line; the board status keeps its own compact line under them
     (sharing the line crushed it into the counts). */
  #board-sec .workspace-tools { flex-wrap: nowrap; white-space: nowrap; }
  #board-sec #feed-health { padding-top: 0; padding-bottom: 6px; }
}

@media (min-width: 1101px) {
  /* Verdict reasons: 28ch forced an 82-character reason onto three lines; 44ch reads in one or two
     and still fits the frame beside the numeric columns (a 360px minimum pushed Grad off the edge). */
  .board td.c-v .why-inline { max-width: 44ch; }
}

@media (max-width: 760px) {
  /* Toolbar: same controls and 44px+ targets, less air between them. */
  .scanner-tools { padding-top: 4px; padding-bottom: 4px; row-gap: 6px; }
  /* Board status: one quiet line. */
  #board-sec #feed-health { padding-top: 2px; padding-bottom: 6px; }
  /* Coin cards: tighter rhythm, same content and order. */
  #rows tr[data-t] { padding-top: 12px; padding-bottom: 12px; row-gap: 8px; }
}

@media (max-width: 760px) {
  /* Alert settings is a fixed sheet capped to the space above the tab bar, but its content was
     clipped (overflow: clip): Done and the closed-app alert controls sat below the cap, unreachable.
     Let the sheet scroll instead, without scrolling the board behind it. */
  #alert-settings { overflow-y: auto; overscroll-behavior: contain; }
  /* Live · Alerts · Tools share one line: the grid was built for two buttons, so Alerts pushed Tools
     onto a second row. */
  .scanner-tools .scanner-live { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Alerts moved out of the Tools menu onto the toolbar: it matches the Tools button beside it, and turns
   lavender (the system's active colour) while scanner alerts are on. */
.scanner-live #alerts { display: flex; align-items: center; justify-content: center; gap: 8px; box-sizing: border-box; min-height: 44px; padding: 8px 12px; border: 1px solid var(--rule); border-radius: 6px; background: var(--panel); color: var(--dim); font-size: 13px; font-weight: 500; }
.scanner-live #alerts:hover { border-color: var(--rule-strong); }
.scanner-live #alerts[aria-pressed="true"] { color: var(--uv); border-color: var(--uv); }
.scanner-live #alerts:focus-visible { outline: 2px solid var(--uv); outline-offset: 3px; }
.scanner-live #alerts .i { flex: none; }

@media (max-width: 760px) {
  .scanner-live #alerts { min-height: 46px; padding: 8px; }
  /* The tab bar held five destinations; the duplicate Surging entry is gone, so four even columns. */
  .tabbar { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  /* Tools sheet: an even two-column grid instead of mixed widths. */
  .scanner-extra-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #scanner-extras .scanner-extra-actions #radar-toggle, #scanner-extras .scanner-extra-actions #record-open { grid-column: auto; width: auto; }
  .scanner-extra-actions > .scanner-extra-close { grid-column: 1 / -1; }
  #scanner-extras .workspace-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; grid-column: 1 / -1; }
  #scanner-extras .workspace-tools #rh-market-open, #scanner-extras .workspace-tools #saved-views { grid-column: 1 / -1; }
}

/* Coin trade panel: wallet header with Multi (pick several trading wallets for one buy), All/None, and a settings cog
   that shows the live slippage (and delay when several wallets are picked). */
.trade .tr-wallets-head { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.trade .tr-wallets-label { flex: 1; min-width: 0; font-size: 12px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--dim); }
.trade :is(.tr-multi, .tr-pick-all, .tr-gear) { display: inline-flex; align-items: center; justify-content: center; gap: 6px; box-sizing: border-box; min-height: 36px; padding: 6px 12px; border: 1px solid var(--rule); border-radius: 5px; background: var(--bg); color: var(--dim); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.trade :is(.tr-multi, .tr-pick-all, .tr-gear):hover:not(:disabled) { border-color: var(--rule-strong); color: var(--text); }
.trade :is(.tr-multi, .tr-pick-all, .tr-gear):focus-visible { outline: 2px solid var(--uv); outline-offset: 2px; }
.trade .tr-multi[aria-pressed="true"], .trade .tr-gear[aria-expanded="true"] { border-color: var(--uv); background: var(--uv-soft); color: var(--uv); }
.trade .tr-multi:disabled { opacity: .45; cursor: not-allowed; }
.trade .tr-gear span { font-variant-numeric: tabular-nums; }
.trade .tr-settings { display: grid; gap: 18px; margin: 0 0 14px; padding: 14px; border: 1px solid var(--rule); border-radius: 6px; background: var(--bg); }
.trade .tr-settings .slip-control { margin: 0; padding: 0; border: 0; }
.trade .tr-settings .delay-control { padding-top: 18px; border-top: 1px solid var(--rule); }
.trade .tr-settings > .btn { justify-self: start; }
/* Multi: a picked wallet shows a check so selection reads as membership, not a single choice. */
.tr-wallets.multi button { position: relative; padding-right: 30px; }
.tr-wallets.multi button::after { content: ""; position: absolute; top: 12px; right: 10px; width: 12px; height: 12px; box-sizing: border-box; border: 1px solid var(--rule-strong); border-radius: 3px; }
.tr-wallets.multi button[aria-pressed="true"]::after { border-color: var(--uv); background: var(--uv) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 6.2l2 2 4-4.4' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat; }

@media (max-width: 760px) {
  .trade :is(.tr-multi, .tr-pick-all, .tr-gear) { min-height: 44px; }
}
.delay-control .slip-presets { flex: 1 1 240px; }
.delay-control .slip-presets button { white-space: nowrap; }

/* Creator profile: one wallet's last 24 hours of launches. */
.creator-sheet { max-width: 560px; }
.creator-sheet .cr-in { box-sizing: border-box; max-height: min(86vh, 900px); overflow-y: auto; padding: 22px 22px 18px; }
.cr-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.cr-kicker { margin: 0 0 4px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.cr-head h2 { margin: 0; font-size: 22px; }
.cr-addr { margin: 6px 0 0; }
.cr-addr .addr-copy { padding: 0; border: 0; background: none; color: var(--dim); font: 12px/1.4 var(--mono); text-align: left; word-break: break-all; cursor: pointer; }
.cr-actions, .cr-line-actions { display: flex; flex: none; gap: 8px; }
.cr-actions .btn, .cr-line-actions .btn { display: inline-flex; align-items: center; box-sizing: border-box; min-height: 36px; text-decoration: none; }
.cr-follow.on { border-color: var(--uv); background: var(--uv-soft); color: var(--uv); }
.cr-read { margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 6px; background: var(--bg); font-size: 14px; line-height: 1.55; }
.cr-read.good { border-color: color-mix(in srgb, var(--up) 50%, var(--rule)); }
.cr-read.bad { border-color: color-mix(in srgb, var(--down) 50%, var(--rule)); }
.cr-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-bottom: 10px; overflow: hidden; border: 1px solid var(--rule); border-radius: 6px; background: var(--rule); }
.cr-stat { display: grid; gap: 4px; padding: 10px 12px; background: var(--panel); }
.cr-stat span { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.cr-stat b { font-size: 16px; }
.cr-stat b.up { color: var(--up); }
.cr-stat b.down { color: var(--down); }
.cr-hint { margin: 0 0 16px; font-size: 12.5px; line-height: 1.55; color: var(--dim); }
.cr-note { margin: 0 0 16px; padding: 10px 12px; border: 1px solid var(--uv); border-radius: 6px; background: var(--uv-soft); font-size: 13px; line-height: 1.5; }
.creator-sheet h3 { margin: 18px 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.cr-coins, .cr-links { display: grid; gap: 6px; margin: 0 0 12px; padding: 0; list-style: none; }
.cr-coin { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "logo name tags" "logo meta tags"; align-items: center; column-gap: 10px; row-gap: 2px; box-sizing: border-box; width: 100%; min-height: 52px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 6px; background: var(--bg); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.cr-coin:hover, .cr-link:hover { border-color: var(--rule-strong); }
.cr-coin:focus-visible, .cr-link:focus-visible, .pl-row .cr-open:focus-visible { outline: 2px solid var(--uv); outline-offset: 2px; }
.cr-coin .logo { grid-area: logo; }
.cr-name { grid-area: name; display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.cr-name b { white-space: nowrap; }
.cr-name small { overflow: hidden; font-size: 12px; color: var(--dim); text-overflow: ellipsis; white-space: nowrap; }
.cr-meta { grid-area: meta; font-size: 12px; color: var(--dim); }
.cr-tags { grid-area: tags; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.cr-tag { padding: 2px 7px; border: 1px solid var(--rule); border-radius: 4px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.cr-tag.good { border-color: color-mix(in srgb, var(--up) 50%, var(--rule)); color: var(--up); }
.cr-tag.bad { border-color: color-mix(in srgb, var(--down) 50%, var(--rule)); color: var(--down); }
.cr-link { display: flex; align-items: center; justify-content: space-between; box-sizing: border-box; width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--rule); border-radius: 6px; background: var(--bg); color: inherit; font: inherit; cursor: pointer; }
.cr-link small { color: var(--dim); }
.cr-more { margin: 0 0 8px; }
.cr-status { padding: 24px 0; color: var(--dim); }
.cr-foot { display: flex; justify-content: flex-end; margin-top: 16px; }
/* Coin panel: who launched this coin. */
.cr-sec .cr-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.cr-sec .cr-line small { display: block; margin-top: 3px; font-size: 12px; color: var(--dim); }
/* Creator watch: the address opens the profile. */
.pl-row .cr-open { padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 600; text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 3px; cursor: pointer; }

@media (max-width: 560px) {
  .creator-sheet .cr-in { max-height: 88vh; padding: 18px 16px max(18px, env(safe-area-inset-bottom)); }
  .cr-head { flex-direction: column; }
  .cr-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cr-coin { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "logo name" "logo meta" "logo tags"; }
  .cr-tags { justify-content: flex-start; }
  .cr-actions .btn, .cr-line-actions .btn { min-height: 44px; }
}

/* Smart-wallet tracker. */
.sw-list, .sw-buys { display: grid; gap: 6px; margin: 0 0 14px; padding: 0; list-style: none; }
.sw-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "id rec" "now rec"; align-items: center; column-gap: 12px; row-gap: 2px; box-sizing: border-box; width: 100%; min-height: 52px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 6px; background: var(--bg); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.sw-row:hover, .sw-buy:hover { border-color: var(--rule-strong); }
.sw-row:focus-visible, .sw-buy:focus-visible, .sw-back:focus-visible, .sw-inline:focus-visible { outline: 2px solid var(--uv); outline-offset: 2px; }
.sw-id { grid-area: id; font-weight: 600; }
.sw-rec { grid-area: rec; font-size: 13px; color: var(--dim); text-align: right; }
.sw-rec b { color: var(--text); }
.sw-now { grid-area: now; font-size: 12px; color: var(--dim); }
.sw-buy { display: flex; align-items: center; gap: 10px; box-sizing: border-box; width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--rule); border-radius: 6px; background: var(--bg); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.sw-buy span.num { flex: 1; font-size: 12px; color: var(--dim); }
.sw-back { display: inline-flex; align-items: center; min-height: 36px; margin: -6px 0 6px; padding: 0; border: 0; background: none; color: var(--dim); font: inherit; font-size: 13px; cursor: pointer; }
.sw-back:hover { color: var(--text); }
.sw-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sw-inline { padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 600; text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 3px; cursor: pointer; }

@media (max-width: 760px) {
  /* Tools sheet: All RH tokens and Smart wallets share a row. */
  #scanner-extras .workspace-tools #rh-market-open { grid-column: auto; }
}
@media (max-width: 560px) {
  .sw-row { grid-template-columns: minmax(0, 1fr); grid-template-areas: "id" "rec" "now"; }
  .sw-rec { text-align: left; }
  .sw-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sw-back { min-height: 44px; }
}

/* Coin panel, first paint only (app.js removes the class when idle): skip laying out off-screen sections. */
#insp.insp-fresh .sec { content-visibility: auto; contain-intrinsic-size: auto 480px; }

/* Board order held while the pointer is on the rows (app.js holdOrder). */
.tape .t-held { color: var(--uv); font-weight: 600; }
