/* ---------- tokens ---------- */
:root {
  --bg: #0b0d11;
  --panel: #12151b;
  --panel-2: #171b22;
  --field: #0d1015;
  --line: #21262f;
  --line-2: #303845;
  --ink: #e9ecf1;
  --muted: #8b93a3;
  --dim: #5d6674;
  --gold: #e2a83d;
  --gold-bright: #f0bd5e;
  --gold-ink: #1a1206;
  --red: #e66767;
  --red-soft: rgba(230, 103, 103, .12);
  --red-line: rgba(230, 103, 103, .35);
  --blue: #3987e5;
  --green: #4cc38a;
  --focus: #7aa7ff;
  --radius: 8px;
  --sidebar-w: 236px;
  --topbar-h: 56px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, "Cascadia Mono", Consolas, Menlo, monospace;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); color-scheme: dark; -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh; min-height: 100dvh;
  margin: 0;
  background: var(--bg); color: var(--ink);
  font: 15px/1.5 var(--sans);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
body.drawer-open { overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled, input:disabled, select:disabled { cursor: not-allowed; opacity: .5; }
h1, h2, h3, p, dl { margin: 0; }
h1 { font-size: 1.55rem; font-weight: 700; letter-spacing: -.015em; }
h2 { font-size: 1.02rem; font-weight: 650; letter-spacing: -.01em; }
h3 { font-size: .95rem; font-weight: 650; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.skip-link { position: fixed; z-index: 200; top: .5rem; left: .5rem; padding: .6rem .85rem; transform: translateY(-200%); border-radius: var(--radius); background: var(--ink); color: var(--bg); font-weight: 650; text-decoration: none; }
.skip-link:focus { transform: none; }
.hint { color: var(--dim); font-size: .8rem; line-height: 1.45; }

/* ---------- sidebar ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 60;
  display: flex; flex-direction: column;
  width: var(--sidebar-w);
  height: 100vh; height: 100dvh;
  border-right: 1px solid var(--line);
  background: #0d0f14;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
}
.brand { display: flex; align-items: center; gap: .7rem; padding: 1.1rem 1rem 1.05rem; border-bottom: 1px solid var(--line); }
.brand-mark, .topbar-mark {
  display: grid; place-items: center;
  width: 32px; height: 32px; flex: 0 0 auto;
  border-radius: 7px;
  background: linear-gradient(160deg, var(--gold-bright), var(--gold) 60%, #b7811f);
  color: var(--gold-ink);
  font-family: var(--mono); font-size: 1rem; font-weight: 700;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-name { font-weight: 700; letter-spacing: -.01em; }
.brand-product { color: var(--dim); font-size: .72rem; font-weight: 550; }
.sidebar-close { display: none; margin-left: auto; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 7px; background: transparent; color: var(--muted); }
.sidebar-close svg { width: 12px; height: 12px; }

.side-nav { display: flex; flex-direction: column; gap: 2px; padding: .8rem .6rem; }
.side-link {
  position: relative;
  display: flex; align-items: center; gap: .7rem;
  min-height: 40px; padding: 0 .7rem;
  border: 0; border-radius: 7px;
  background: transparent; color: var(--muted);
  font-size: .9rem; font-weight: 550; text-align: left;
}
.side-link svg { width: 15px; height: 15px; flex: 0 0 auto; opacity: .8; }
.side-link:hover { background: rgba(255,255,255,.045); color: var(--ink); }
.side-link.is-active { background: rgba(226,168,61,.1); color: var(--gold-bright); }
.side-link.is-active::before { content: ""; position: absolute; left: -.6rem; top: 9px; bottom: 9px; width: 2px; border-radius: 2px; background: var(--gold); }
.nav-count { margin-left: auto; min-width: 22px; padding: .1rem .38rem; border-radius: 99px; background: var(--red-soft); border: 1px solid var(--red-line); color: var(--red); font-family: var(--mono); font-size: .68rem; font-weight: 650; text-align: center; }
.nav-lock { display: grid; place-items: center; margin-left: auto; color: var(--dim); }
.nav-lock svg { width: 12px; height: 12px; }
.side-link.is-locked { color: var(--dim); }
.side-link.is-locked:hover { background: rgba(255,255,255,.03); color: var(--muted); }

.sidebar-backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(4,5,8,.6); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); opacity: 0; transition: opacity .2s ease; }
.sidebar-backdrop.is-visible { opacity: 1; }

/* ---------- topbar (mobile) ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: none;
  align-items: center; gap: .75rem;
  min-height: var(--topbar-h);
  padding: calc(.4rem + env(safe-area-inset-top)) max(.9rem, env(safe-area-inset-right)) .4rem max(.9rem, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
  background: rgba(11,13,17,.92);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.menu-button { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); }
.menu-button svg { width: 15px; height: 15px; }
.topbar-title { min-width: 0; line-height: 1.2; }
.topbar-title span { display: block; color: var(--dim); font-size: .68rem; font-weight: 550; }
.topbar-title strong { display: block; font-size: .98rem; font-weight: 650; }
.topbar-mark { margin-left: auto; width: 30px; height: 30px; font-size: .9rem; }

/* ---------- layout ---------- */
.main { min-width: 0; margin-left: var(--sidebar-w); padding: clamp(1.1rem, 2.5vw, 2.2rem) clamp(1.1rem, 3vw, 2.6rem) 3rem; }
.page { max-width: 1240px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; }
.page-sub { margin-top: .3rem; color: var(--muted); font-size: .9rem; }

/* ---------- buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 40px; padding: .55rem 1rem;
  border: 1px solid transparent; border-radius: var(--radius);
  font-size: .88rem; font-weight: 620; line-height: 1.1;
  transition: background .12s ease, border-color .12s ease;
}
.button-primary { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.button-primary:hover:not(:disabled) { background: var(--gold-bright); border-color: var(--gold-bright); }
.button-secondary { background: var(--panel-2); border-color: var(--line-2); color: var(--ink); }
.button-secondary:hover:not(:disabled) { border-color: var(--dim); }
.button-danger { background: transparent; border-color: var(--red-line); color: var(--red); }
.button-danger:hover:not(:disabled) { background: var(--red-soft); }
.text-button { padding: .2rem 0; border: 0; background: none; color: var(--gold-bright); font-size: .82rem; font-weight: 620; }
.text-button:hover { text-decoration: underline; }
.text-button-muted { color: var(--muted); }
.icon-button { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 7px; background: transparent; color: var(--muted); }
.icon-button svg { width: 12px; height: 12px; }
.icon-button:hover { color: var(--ink); border-color: var(--line-2); }

/* ---------- error banner ---------- */
.error-banner {
  position: fixed; z-index: 90; top: 1rem; right: 1rem;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  width: min(480px, calc(100vw - 2rem));
  padding: .9rem 1rem;
  border: 1px solid var(--red-line); border-radius: var(--radius);
  background: #1a1114;
  box-shadow: 0 18px 50px rgba(0,0,0,.5);
}
.error-banner strong { color: var(--red); font-size: .9rem; }
.error-banner p { margin-top: .2rem; color: var(--muted); font-size: .84rem; }

/* ---------- stat row ---------- */
.stat-row {
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr));
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel);
  overflow: hidden;
}
.stat { min-width: 0; padding: 1.05rem 1.2rem 1rem; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat-label { display: block; color: var(--muted); font-size: .74rem; font-weight: 550; }
.stat-value { display: block; margin: .3rem 0 .1rem; font-family: var(--mono); font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat small { color: var(--dim); font-size: .74rem; }
.stat-alert .stat-value { color: var(--red); }
.stat-alert .stat-label::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: .4rem; border-radius: 50%; background: var(--red); vertical-align: 1px; }

/* ---------- cards & charts ---------- */
.card { min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); overflow: hidden; }
.chart-grid > *, .overview-grid > *, .scan-layout > * { min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .95rem 1.2rem; border-bottom: 1px solid var(--line); }
.card-note { color: var(--dim); font-family: var(--mono); font-size: .76rem; }
.card-body { padding: 1.2rem; }
.chart-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 1rem; margin-top: 1rem; }
.chart { min-height: 260px; padding: .8rem .8rem .4rem; }
.chart-fallback { margin: 1rem 1.2rem 1.2rem; padding: 2rem 1rem; border: 1px dashed var(--line-2); border-radius: var(--radius); color: var(--dim); font-size: .85rem; text-align: center; }

/* ---------- overview extras ---------- */
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 1rem; margin-top: 1rem; align-items: start; }
.data-table { min-width: 620px; }
.data-table th { padding-top: .55rem; padding-bottom: .55rem; }
.data-table td { padding-top: .7rem; padding-bottom: .7rem; }
td.num { font-family: var(--mono); font-size: .82rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.num-alert { color: var(--red); font-weight: 650; }
.cell-sub { display: block; margin-top: .1rem; color: var(--dim); font-size: .7rem; }
.rate { display: flex; align-items: center; gap: .5rem; }
.rate-bar { width: 54px; height: 4px; flex: 0 0 auto; overflow: hidden; border-radius: 2px; background: var(--line); }
.rate-bar span { display: block; height: 100%; border-radius: 2px; background: var(--red); }
.seller-list { display: flex; flex-direction: column; }
.seller-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%; padding: .72rem 1.2rem; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); font-size: .86rem; text-align: left; }
.seller-row:last-child { border-bottom: 0; }
.seller-row:hover { background: rgba(255,255,255,.03); }
.seller-row-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.seller-row-name em { margin-left: .45rem; padding: .08rem .38rem; border: 1px solid rgba(76,195,138,.35); border-radius: 99px; color: var(--green); font-size: .66rem; font-style: normal; font-weight: 600; vertical-align: 1px; }
.seller-row-count { flex: 0 0 auto; color: var(--red); font-family: var(--mono); font-size: .76rem; }
.detail-export { display: inline-flex; margin: 0 0 1rem; text-decoration: none; }
.seller-empty { padding: 1.2rem; color: var(--dim); font-size: .85rem; }

/* ---------- skeletons / loading ---------- */
.dashboard-loading { display: grid; gap: 1rem; margin-top: 1rem; }
.skeleton-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; }
.skeleton-panels { display: grid; grid-template-columns: 1.2fr .8fr; gap: 1rem; }
.skeleton { display: block; min-height: 92px; border-radius: 10px; background: linear-gradient(100deg, var(--panel) 30%, var(--panel-2) 50%, var(--panel) 70%); background-size: 220% 100%; animation: shimmer 1.4s linear infinite; }
.skeleton-panels .skeleton { min-height: 300px; }
.findings-loading { display: grid; gap: .6rem; }
.findings-loading .skeleton { min-height: 60px; }
.catalog-loading { display: grid; gap: .5rem; margin-bottom: 1rem; }
.catalog-loading .skeleton { min-height: 48px; }
@keyframes shimmer { to { background-position: -220% 0; } }

/* ---------- empty states ---------- */
.empty-state { margin-top: 1rem; padding: clamp(1.6rem, 4vw, 2.6rem); border: 1px dashed var(--line-2); border-radius: 10px; background: transparent; }
.empty-state p { margin: .45rem 0 1.1rem; max-width: 520px; color: var(--muted); font-size: .9rem; }

/* ---------- scan page ---------- */
.scan-layout { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 1rem; align-items: start; }
.activity-panel { position: sticky; top: 1rem; }
.category-scope { min-width: 0; margin: 0; padding: 0; border: 0; }
.category-scope .hint { margin-bottom: .4rem; }
.category-option { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 58px; border-bottom: 1px solid var(--line); }
.category-option:last-of-type { border-bottom: 0; }
.category-option label { display: flex; min-width: 0; flex: 1; align-items: center; gap: .75rem; cursor: pointer; }
.category-option strong { display: block; font-size: .92rem; font-weight: 620; }
.category-option small { display: block; margin-top: .1rem; color: var(--dim); font-size: .75rem; }
input[type="checkbox"] { width: 16px; height: 16px; flex: 0 0 auto; accent-color: var(--gold); }
.category-choose { flex: 0 0 auto; padding: .3rem 0; border: 0; background: none; color: var(--gold-bright); font-size: .8rem; font-weight: 620; }
.category-choose:hover { text-decoration: underline; }

.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; margin-top: 1.2rem; }
.field-grid label { min-width: 0; }
.field-grid label > span { display: block; margin-bottom: .35rem; color: var(--muted); font-size: .78rem; font-weight: 600; }
.field-grid small { display: block; margin-top: .3rem; color: var(--dim); font-size: .74rem; line-height: 1.35; }
input[type="number"], input[type="search"], select {
  width: 100%; min-height: 42px;
  padding: .55rem .7rem;
  border: 1px solid var(--line-2); border-radius: var(--radius);
  background: var(--field); color: var(--ink);
  font-variant-numeric: tabular-nums;
}
input[type="number"] { font-family: var(--mono); font-size: .88rem; }
select { padding-right: 2rem; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238b93a3' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .7rem center; }
input::placeholder { color: var(--dim); opacity: 1; }
input:focus, select:focus { border-color: var(--dim); outline: none; }
input:focus-visible, select:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

.advanced { margin-top: 1.2rem; border-top: 1px solid var(--line); }
.advanced > summary { display: flex; align-items: center; gap: .45rem; padding: .85rem 0 0; list-style: none; color: var(--muted); cursor: pointer; font-size: .8rem; font-weight: 600; }
.advanced > summary::-webkit-details-marker { display: none; }
.advanced > summary::after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid var(--dim); border-bottom: 1.5px solid var(--dim); transform: rotate(45deg) translateY(-2px); transition: transform .15s ease; }
.advanced[open] > summary::after { transform: rotate(225deg) translateY(-1px); }
.form-message { margin-top: 1rem; padding: .7rem .85rem; border: 1px solid var(--red-line); border-radius: var(--radius); background: var(--red-soft); color: var(--red); font-size: .85rem; }
.scan-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.3rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.scan-actions .button-primary { min-width: 140px; }
#lockHint { margin-top: .6rem; }

.login-dialog { width: min(360px, calc(100vw - 2rem)); padding: 1.4rem; border: 1px solid var(--line-2); border-radius: 12px; background: var(--panel); color: var(--ink); }
.login-dialog::backdrop { background: rgba(4,5,8,.7); }
.login-dialog h2 { margin-bottom: .3rem; }
.login-dialog input { margin-top: .9rem; }
.login-actions { display: flex; justify-content: flex-end; gap: .7rem; margin-top: 1.1rem; }

/* game picker */
.catalog-picker {
  position: fixed; z-index: 70;
  top: max(1rem, env(safe-area-inset-top)); right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom));
  display: flex; flex-direction: column;
  width: min(440px, calc(100vw - 2rem));
  padding: 1.1rem;
  border: 1px solid var(--line-2); border-radius: 12px;
  background: var(--panel-2);
  box-shadow: -20px 0 60px rgba(0,0,0,.55);
}
.picker-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-bottom: .8rem; border-bottom: 1px solid var(--line); }
.picker-actions { display: flex; gap: 1rem; }
.catalog-picker .hint { margin: .7rem 0; }
.search-field { position: relative; display: block; min-width: 0; }
.search-field svg { position: absolute; top: 50%; left: .75rem; width: 14px; height: 14px; transform: translateY(-50%); color: var(--dim); pointer-events: none; }
.search-field input { padding-left: 2.3rem; }
.catalog-list { flex: 1; min-height: 0; margin-top: .7rem; overflow: auto; -webkit-overflow-scrolling: touch; border-top: 1px solid var(--line); }
.catalog-list label { display: flex; min-height: 44px; align-items: center; gap: .65rem; padding: .5rem .2rem; border-bottom: 1px solid var(--line); cursor: pointer; }
.catalog-list label span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.catalog-list label strong { font-weight: 600; font-size: .88rem; }
.catalog-list label small { margin-left: .45rem; color: var(--dim); font-size: .74rem; }
.catalog-empty { padding: 2rem 0; color: var(--dim); text-align: center; }

/* activity */
.status-label { padding: .22rem .5rem; border: 1px solid var(--line-2); border-radius: 99px; color: var(--muted); font-family: var(--mono); font-size: .68rem; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; }
.status-label[data-status="scanning"] { border-color: rgba(226,168,61,.4); background: rgba(226,168,61,.1); color: var(--gold-bright); }
.status-label[data-status="complete"] { border-color: rgba(76,195,138,.4); background: rgba(76,195,138,.1); color: var(--green); }
.status-label[data-status="error"], .status-label[data-status="cancelled"] { border-color: var(--red-line); background: var(--red-soft); color: var(--red); }
.scan-progress { margin-bottom: 1.1rem; }
.progress-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .45rem; }
.progress-head span { min-width: 0; color: var(--muted); font-size: .82rem; line-height: 1.4; overflow-wrap: anywhere; }
.progress-head strong { flex: 0 0 auto; color: var(--gold-bright); font-family: var(--mono); font-size: 1rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.progress-track { height: 5px; overflow: hidden; border-radius: 3px; background: var(--line); }
.progress-track span { display: block; width: 2%; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--gold), var(--gold-bright)); transition: width .6s ease; }
.progress-eta { margin-top: .45rem; color: var(--dim); font-family: var(--mono); font-size: .76rem; }
.activity-line { min-height: 3em; color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.runtime-meta { margin: .9rem 0; border-top: 1px solid var(--line); }
.runtime-meta div { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.runtime-meta dt { color: var(--dim); font-size: .8rem; }
.runtime-meta dd { margin: 0; font-family: var(--mono); font-size: .8rem; font-weight: 550; text-align: right; overflow-wrap: anywhere; }

/* ---------- findings ---------- */
.filter-bar { display: grid; grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(130px, .6fr)) auto; gap: .6rem; padding: .9rem 1.2rem; border-bottom: 1px solid var(--line); }
.check-control { display: flex; min-height: 42px; align-items: center; gap: .5rem; padding: 0 .75rem; border: 1px solid var(--line-2); border-radius: var(--radius); font-size: .85rem; white-space: nowrap; cursor: pointer; }
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; min-width: 920px; border-collapse: collapse; }
th { padding: .6rem 1.2rem; border-bottom: 1px solid var(--line); color: var(--dim); font-size: .68rem; font-weight: 650; letter-spacing: .07em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: .85rem 1.2rem; border-bottom: 1px solid var(--line); vertical-align: top; font-size: .86rem; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: rgba(255,255,255,.025); }
tbody tr:last-child td { border-bottom: 0; }
.listing-title, .seller-name { display: block; font-weight: 600; }
.listing-title { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feedback-score, .price-value { display: block; font-family: var(--mono); font-weight: 600; font-variant-numeric: tabular-nums; }
.listing-meta, .seller-meta, .feedback-meta, .price-meta { display: block; margin-top: .15rem; color: var(--dim); font-size: .74rem; }
.listing-meta { font-family: var(--mono); }
.signal-list { display: flex; max-width: 280px; flex-wrap: wrap; gap: .3rem; }
.signal { padding: .18rem .45rem; border: 1px solid var(--red-line); border-radius: 99px; background: var(--red-soft); color: var(--red); font-size: .7rem; font-weight: 600; white-space: nowrap; }
.signal-none { color: var(--dim); font-size: .78rem; }
.inspect-button { padding: .38rem .7rem; border: 1px solid var(--line-2); border-radius: 7px; background: transparent; color: var(--ink); font-size: .78rem; font-weight: 620; white-space: nowrap; }
.inspect-button:hover { border-color: var(--gold); color: var(--gold-bright); }
.listing-actions { display: flex; align-items: center; justify-content: flex-end; gap: .4rem; }
.listing-export { padding: .38rem .55rem; border: 1px solid var(--line-2); border-radius: 7px; color: var(--muted); font-size: .72rem; font-weight: 620; text-decoration: none; white-space: nowrap; }
.listing-export:hover { border-color: var(--gold); color: var(--gold-bright); }
.table-empty { padding: 3rem 1rem; color: var(--muted); text-align: center; }
.table-empty strong { color: var(--ink); }
.table-empty p { margin-top: .25rem; font-size: .85rem; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 1rem; padding: .9rem 1.2rem; border-top: 1px solid var(--line); }
.pagination span { color: var(--dim); font-family: var(--mono); font-size: .78rem; }

/* ---------- dialog ---------- */
.listing-dialog { width: min(760px, calc(100vw - 2rem)); max-height: min(780px, calc(100vh - 2rem)); max-height: min(780px, calc(100dvh - 2rem)); padding: 0; overflow: hidden; border: 1px solid var(--line-2); border-radius: 12px; background: var(--panel); color: var(--ink); }
.listing-dialog::backdrop { background: rgba(4,5,8,.7); }
.dialog-shell { display: flex; max-height: inherit; flex-direction: column; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex: 0 0 auto; padding: 1.1rem 1.2rem; border-bottom: 1px solid var(--line); }
.dialog-kicker { margin-bottom: .2rem; color: var(--dim); font-family: var(--mono); font-size: .72rem; }
.dialog-content { padding: 1.2rem; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.detail-grid div { min-width: 0; padding: .7rem .8rem; border-right: 1px solid var(--line); }
.detail-grid div:last-child { border-right: 0; }
.detail-grid dt { color: var(--dim); font-size: .7rem; }
.detail-grid dd { margin: .15rem 0 0; overflow-wrap: anywhere; font-family: var(--mono); font-size: .85rem; font-weight: 600; }
.detail-section { margin-top: 1.15rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.detail-section h3 { margin-bottom: .6rem; }
.evidence-list, .duplicate-list { display: grid; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.evidence-list li, .duplicate-list li { padding: .65rem .8rem; border: 1px solid var(--red-line); border-left-width: 3px; border-radius: 6px; background: var(--red-soft); font-size: .85rem; }
.evidence-list strong { display: block; margin-bottom: .3rem; }
.evidence-list code { display: inline-block; margin: .1rem .35rem .1rem 0; font-family: var(--mono); font-size: .78rem; color: var(--red); white-space: normal; overflow-wrap: anywhere; }
.duplicate-list strong { font-family: var(--mono); font-weight: 600; }
.listing-description { max-height: 300px; margin: 0; padding: .9rem; overflow: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); background: var(--field); color: var(--muted); font: .8rem/1.55 var(--mono); white-space: pre-wrap; word-break: break-word; }
.detail-section .listing-meta { font-size: .8rem; line-height: 1.7; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .chart-grid, .scan-layout, .overview-grid { grid-template-columns: minmax(0, 1fr); }
  .activity-panel { position: static; }
  .filter-bar { grid-template-columns: minmax(200px, 1fr) repeat(2, minmax(130px, .6fr)); }
}

@media (max-width: 1023.98px) {
  .topbar { display: flex; }
  .main { margin-left: 0; }
  .sidebar { transform: translateX(-105%); transition: transform .22s ease; box-shadow: 24px 0 60px rgba(0,0,0,.5); width: min(300px, 84vw); }
  .sidebar.is-open { transform: none; }
  .sidebar-close { display: grid; }
  .error-banner { top: calc(var(--topbar-h) + .75rem + env(safe-area-inset-top)); }
}

@media (max-width: 720px) {
  /* Findings: the desktop table becomes stacked tappable cards - no
     horizontal scrolling, and the whole row opens the listing. The coverage
     table on the Overview keeps its scrolling layout. */
  .findings-section .table-wrap { overflow-x: visible; }
  .findings-section table, .findings-section tbody { display: block; min-width: 0; }
  .findings-section thead { display: none; }
  .findings-section tbody tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: .45rem .8rem; padding: .9rem .95rem; border-bottom: 1px solid var(--line); }
  .findings-section tbody td { display: block; padding: 0; border: 0; }
  .findings-section tbody tr:last-child { border-bottom: 0; }
  .findings-section td:nth-child(1) { width: 100%; order: 1; }
  .findings-section .listing-title { max-width: none; white-space: normal; }
  .findings-section td:nth-child(3) { width: 100%; order: 2; }
  .findings-section .signal-list { max-width: none; }
  .findings-section td:nth-child(2) { order: 3; flex: 1 1 auto; min-width: 0; }
  .findings-section td:nth-child(4) { order: 4; text-align: right; }
  .findings-section td:nth-child(5) { order: 5; text-align: right; }
  .findings-section .price-meta { display: inline; margin: 0 0 0 .25rem; }
  .findings-section td:nth-child(6) { width: 100%; order: 6; }
  .findings-section .inspect-button { width: 100%; min-height: 40px; }

  .page-head { flex-direction: column; align-items: stretch; gap: .9rem; }
  .stat-row, .skeleton-row { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .stat:nth-child(2n) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .skeleton-panels { grid-template-columns: 1fr; }
  .filter-bar { grid-template-columns: repeat(2, minmax(0,1fr)); padding: .8rem; }
  .filter-bar .search-field { grid-column: 1 / -1; }
  .detail-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .detail-grid div:nth-child(2n) { border-right: 0; }
  .detail-grid div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 460px) {
  .main { padding: .9rem max(.9rem, env(safe-area-inset-right)) calc(2rem + env(safe-area-inset-bottom)) max(.9rem, env(safe-area-inset-left)); }
  .stat { padding: .85rem .9rem; }
  .card-head, .card-body, .filter-bar, .pagination { padding-left: .9rem; padding-right: .9rem; }
  th, td { padding-left: .9rem; padding-right: .9rem; }
  .field-grid { grid-template-columns: 1fr; }
  .filter-bar { grid-template-columns: 1fr; }
  .filter-bar .search-field { grid-column: auto; }
  .check-control { width: 100%; }
  .pagination { justify-content: space-between; gap: .5rem; }
  .catalog-picker { top: max(.5rem, env(safe-area-inset-top)); right: max(.5rem, env(safe-area-inset-right)); bottom: max(.5rem, env(safe-area-inset-bottom)); left: max(.5rem, env(safe-area-inset-left)); width: auto; }
  .listing-dialog { width: calc(100vw - 1rem); max-height: calc(100vh - 1rem); max-height: calc(100dvh - 1rem); }
  .dialog-header, .dialog-content { padding: .9rem; }
  .scan-actions { flex-direction: column; }
  .scan-actions .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
