/* ── tokens ─────────────────────────────────────────── */
:root {
  --r: 5px;
  --r-sm: 3px;
  --bg: #06080d;
  --bg-2: #0b0f17;
  --panel: #0d1219;
  --panel-2: #121a24;
  --panel-3: #172030;
  --ink: #c0d2e4;
  --ink-2: #7c98b0;
  --muted: #3d5568;
  --line: rgba(120,165,200,0.10);
  --accent: #5bc8f5;
  --accent-rgb: 91,200,245;
  --accent-2: #3dd4a0;
  --accent-2-rgb: 61,212,160;
  --amber: #f0a030;
  --amber-rgb: 240,160,48;
  --violet: #9d84f0;
  --violet-rgb: 157,132,240;
  --coral: #f07068;
  --coral-rgb: 240,112,104;
  --pink: #d070b0;
  --pink-rgb: 208,112,176;
  --link: #5b9ef5;
  --link-rgb: 91,158,245;
  --shadow-card: 0 1px 3px rgba(0,0,0,.55), 0 6px 20px rgba(0,0,0,.28);
  --shadow-raise: 0 4px 12px rgba(0,0,0,.6), 0 14px 36px rgba(0,0,0,.38);
}

html[data-theme='light'] {
  --bg: #edf0f5;
  --bg-2: #e4e8f0;
  --panel: #ffffff;
  --panel-2: #f2f5f9;
  --panel-3: #eaeff5;
  --ink: #0d1820;
  --ink-2: #3c5268;
  --muted: #7892a4;
  --line: rgba(20,45,65,0.11);
  --accent: #0078be;
  --accent-rgb: 0,120,190;
  --accent-2: #00885a;
  --accent-2-rgb: 0,136,90;
  --amber: #b47010;
  --amber-rgb: 180,112,16;
  --violet: #6240c0;
  --violet-rgb: 98,64,192;
  --coral: #c43830;
  --coral-rgb: 196,56,48;
  --pink: #982870;
  --pink-rgb: 152,40,112;
  --link: #1a6fc4;
  --link-rgb: 26,111,196;
  --shadow-card: 0 1px 3px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.05);
  --shadow-raise: 0 4px 12px rgba(0,0,0,.09), 0 12px 30px rgba(0,0,0,.07);
}

/* ── reset ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button { cursor: pointer; font: inherit; }
a { color: inherit; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── base ───────────────────────────────────────────── */
html {
  min-height: 100%;
  background: var(--bg);
}

body {
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.5;
  background:
    radial-gradient(ellipse 70% 30% at 10% 0%, rgba(var(--accent-rgb), .05), transparent),
    var(--bg);
}

/* ── layout ─────────────────────────────────────────── */
.page-shell {
  max-width: 1680px;
  margin: 0 auto;
  padding: 12px 16px 28px;
}

/* ── topbar ─────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}

.topbar-brand {
  display: flex;
  align-items: baseline;
  gap: 14px;
  min-width: 0;
}

.topbar-logo-link {
  display: block;
  flex-shrink: 0;
}
.topbar-logo {
  height: 25px;
  width: auto;
  display: block;
  margin-left: 20px;
  margin-bottom: -4px;
  opacity: 0.8;
  filter: saturate(1.5) drop-shadow(0 0 3px rgba(0, 0, 0, .8)) drop-shadow(0 1px 4px rgba(0, 0, 0, .6));
}

.topbar-title {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(17px, 2vw, 24px);
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  white-space: nowrap;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.total-badge {
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, monospace;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 3px 10px;
  white-space: nowrap;
}

.theme-toggle {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel-2);
  color: var(--ink-2);
  font-size: 14px;
  padding: 0;
  transition: background 150ms, border-color 150ms, color 150ms;
}
.theme-toggle:hover {
  background: var(--panel-3);
  border-color: rgba(var(--accent-rgb), .25);
  color: var(--ink);
}

/* ── toolbar ────────────────────────────────────────── */
.toolbar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 10px 12px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-card);
}

.search-form {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 8px;
  align-items: center;
}

.mode-button {
  padding: 5px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel-2);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
  transition: background 160ms, color 160ms, border-color 160ms;
}
.mode-button:hover { color: var(--ink); background: var(--panel-3); }
.mode-button.is-active {
  background: var(--accent);
  color: #020c12;
  border-color: var(--accent);
}

.mode-switch {
  display: flex;
  gap: 2px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 3px;
}
.mode-switch .mode-button {
  border: none;
  background: transparent;
  color: var(--muted);
}
.mode-switch .mode-button:hover { background: var(--panel-3); color: var(--ink-2); }
.mode-switch .mode-button.is-active {
  background: var(--accent);
  color: #020c12;
  border: none;
}
.mode-button:disabled:not(.is-active) {
  opacity: 0.36;
  cursor: not-allowed;
}
.mode-button:disabled.is-active {
  cursor: default;
}

.search-input-wrap { display: block; }
.search-input-wrap input {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 8px 12px;
  color: var(--ink);
  font: inherit;
  outline: none;
  transition: border-color 150ms, box-shadow 150ms;
}
.search-input-wrap input::placeholder { color: var(--muted); }
.search-input-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}


.toolbar-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.status-line {
  margin: 0;
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-2);
}
.hint {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}

/* ── results grid ───────────────────────────────────── */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(440px, 1fr));
  gap: 10px;
}

/* ── card animation ─────────────────────────────────── */
@keyframes card-appear {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── card ───────────────────────────────────────────── */
.benchmark-card {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 10px;
  min-height: 230px;
  padding: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-card);
  animation: card-appear 260ms ease both;
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}
.benchmark-card:has(.popup-wrap:hover) {
  z-index: 10;
}
.benchmark-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-raise);
  border-color: rgba(var(--accent-rgb), .20);
}
.benchmark-card.is-selected {
  border-color: var(--accent-2);
  box-shadow: var(--shadow-card), 0 0 0 1px rgba(var(--accent-2-rgb), .45);
}
.benchmark-card.is-selected:hover {
  border-color: var(--accent-2);
  box-shadow: var(--shadow-raise), 0 0 0 1px rgba(var(--accent-2-rgb), .55);
}

/* ── paper panel ────────────────────────────────────── */
.paper-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: calc(var(--r) - 1px);
  background: var(--bg-2);
  overflow: hidden;
}

.thumb-wrap {
  position: relative;
  overflow: hidden;
  flex: 1;
}

.thumb-wrap + .thumb-wrap:not([hidden]) {
  border-top: 1px solid var(--line);
}

.page-count-badge {
  position: absolute;
  left: 6px;
  bottom: 6px;
  z-index: 2;
  padding: 1px 4px;
  background: transparent;
  color: #0f1111;
  border: none;
  text-shadow: 0 1px 2px rgba(255,255,255,.8), 0 0 4px rgba(255,255,255,.6);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.2;
  pointer-events: none;
}

.paper-shot,
.paper-shot-p2 {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center top;
  display: block;
  cursor: zoom-in;
  transition: transform 220ms ease;
}

/* when page-2 is visible, let both images size to their natural ratio
   so they stack flush with no letterbox gap */
.paper-panel:has(.thumb-wrap--p2:not([hidden])) .thumb-wrap {
  flex: none;
}
.paper-panel:has(.thumb-wrap--p2:not([hidden])) .paper-shot,
.paper-panel:has(.thumb-wrap--p2:not([hidden])) .paper-shot-p2 {
  height: auto;
}

/* dim overlay on hover */
.thumb-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 180ms ease;
  pointer-events: none;
  z-index: 1;
}

/* centered expand-circle icon */
.thumb-wrap::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.7);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.52);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7'/%3E%3C/svg%3E");
  background-size: 20px 20px;
  background-repeat: no-repeat;
  background-position: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
  z-index: 2;
}

.thumb-wrap:hover::after {
  background: rgba(0, 0, 0, 0.28);
}

.thumb-wrap:hover::before {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.thumb-wrap:hover .paper-shot,
.thumb-wrap:hover .paper-shot-p2 {
  transform: scale(1.04);
}


.score-badge {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 2;
  padding: 1px 4px;
  background: transparent;
  border: none;
  color: #1a6b3a;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  pointer-events: none;
}

/* ── card copy ──────────────────────────────────────── */
.card-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.card-heading {
  min-width: 0;
  flex: 1;
}

.benchmark-name {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.08;
  color: var(--ink);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.benchmark-title {
  margin: 4px 0 0;
  font-size: 11.5px;
  color: var(--ink-2);
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  flex-shrink: 0;
  filter: saturate(0.65);
}

.paper-id,
.paper-date,
.paper-version {
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, monospace;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-2);
}

/* ── link row ───────────────────────────────────────── */
.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.link-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  min-height: 22px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, monospace;
  font-size: 10px;
  font-weight: 700;
  color: var(--link);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: background 130ms, border-color 130ms;
}
.link-chip:hover {
  background: rgba(var(--link-rgb), .12);
  border-color: rgba(var(--link-rgb), .30);
}

/* ── popup chips (Links, Examples) ──────────────────── */
.popup-chip {
  cursor: pointer;
  color: var(--ink-2);
}
.popup-chip:hover {
  background: rgba(var(--violet-rgb), .12);
  border-color: rgba(var(--violet-rgb), .30);
}

.popup-wrap {
  position: relative;
  display: inline-block;
}
.popup-wrap .popup-menu {
  display: none;
}
.popup-wrap:hover .popup-menu {
  display: block;
}

.popup-menu {
  position: absolute;
  bottom: 100%;
  right: 0;
  z-index: 200;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 0;
  min-width: 280px;
  max-width: min(680px, calc(100vw - 32px));
  max-height: min(540px, 75vh);
  overflow-y: auto;
  box-shadow: var(--shadow-raise);
}
.popup-menu a,
.popup-menu li {
  display: block;
  padding: 5px 12px;
  color: var(--ink);
  text-decoration: none;
  font-size: .8rem;
  line-height: 1.5;
  white-space: normal;
  word-break: break-word;
  list-style: none;
}
.popup-menu a:hover,
.popup-menu li:hover {
  background: var(--panel-2);
}
.popup-menu a {
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.popup-menu--examples {
  max-width: min(1088px, calc(100vw - 32px));
}
.popup-menu--examples li {
  font-size: .48rem;
}

/* ── Norms pill color ───────────────────────────────── */
.fact-row[data-label="Norms"] .mini-pill {
  background: rgba(var(--coral-rgb), .10);
  color: var(--coral);
  border-color: rgba(var(--coral-rgb), .20);
}

/* ── fact grid ──────────────────────────────────────── */
.fact-grid {
  display: grid;
  gap: 3px;
  margin-top: 8px;
  flex: 1;
}

.fact-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding-top: 5px;
  border-top: 1px solid var(--line);
}

.fact-label {
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, monospace;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  padding-top: 2px;
}

.fact-value {
  font-size: 11.5px;
  color: var(--ink-2);
  line-height: 1.35;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.mini-pill {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: var(--r-sm);
  font-size: 10.5px;
  background: var(--panel-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
}

/* category-colored pills */
.fact-row[data-label="Domain"] .mini-pill {
  background: rgba(var(--accent-rgb), .09);
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), .16);
}
.fact-row[data-label="Tasks"] .mini-pill {
  background: rgba(var(--amber-rgb), .09);
  color: var(--amber);
  border-color: rgba(var(--amber-rgb), .16);
}
.fact-row[data-label="Modality"] .mini-pill {
  background: rgba(var(--violet-rgb), .09);
  color: var(--ink-2);
  border-color: rgba(var(--violet-rgb), .16);
}
.fact-row[data-label="Metrics"] .mini-pill {
  background: rgba(var(--accent-2-rgb), .09);
  color: var(--accent-2);
  border-color: rgba(var(--accent-2-rgb), .16);
}
.fact-row[data-label="Resources"] .mini-pill {
  background: rgba(var(--coral-rgb), .09);
  color: var(--coral);
  border-color: rgba(var(--coral-rgb), .16);
}
.fact-row[data-label="Repro"] .mini-pill {
  background: rgba(var(--pink-rgb), .09);
  color: var(--pink);
  border-color: rgba(var(--pink-rgb), .16);
}

/* ── load more ──────────────────────────────────────── */
.load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 22px 0 8px;
}

.load-more {
  padding: 9px 32px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
  transition: background 150ms, border-color 150ms, color 150ms, transform 150ms;
}
.load-more:hover {
  background: var(--panel-3);
  border-color: rgba(var(--accent-rgb), .20);
  color: var(--ink);
  transform: translateY(-1px);
}
.load-more:active { transform: translateY(0); }

/* ── image overlay ──────────────────────────────────── */
@keyframes overlay-bg-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes overlay-img-in {
  from { opacity: 0; transform: scale(0.93); }
  to   { opacity: 1; transform: scale(1); }
}

.img-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.img-overlay.is-open {
  display: flex;
  animation: overlay-bg-in 180ms ease both;
}

.img-overlay.is-open .overlay-img,
.img-overlay.is-open .overlay-pdf-wrap {
  animation: overlay-img-in 220ms ease both;
}

.overlay-img {
  max-width: 100%;
  max-height: min(1024px, calc(100dvh - 80px));
  object-fit: contain;
  border-radius: var(--r);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
}

.overlay-pdf-wrap {
  position: relative;
  max-width: 90vw;
  max-height: min(1024px, calc(100dvh - 80px));
  border-radius: var(--r);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.overlay-canvas {
  display: block;
  background: #fff;
}

.overlay-text-layer {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  opacity: 0.3;
  line-height: 1;
}
.overlay-text-layer span {
  position: absolute;
  white-space: pre;
  color: transparent;
  pointer-events: all;
}
.overlay-text-layer span::selection {
  background: rgba(var(--accent-rgb), 0.4);
}
.overlay-text-layer br { display: none; }

@keyframes overlay-pulse {
  0%, 100% { opacity: 0.5; }
  50%       { opacity: 1; }
}
.overlay-loading {
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, monospace;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  animation: overlay-pulse 1.4s ease-in-out infinite;
  letter-spacing: 0.04em;
}

.overlay-close {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  font-size: 16px;
  line-height: 1;
  transition: background 140ms, border-color 140ms;
  z-index: 201;
}
.overlay-close:hover {
  background: var(--panel-3);
  border-color: rgba(var(--accent-rgb), .25);
}

.overlay-prev,
.overlay-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: white;
  font-size: 26px;
  line-height: 1;
  z-index: 201;
  transition: background 140ms;
}
.overlay-prev:hover,
.overlay-next:hover { background: rgba(0, 0, 0, 0.78); }
.overlay-prev { left: 16px; }
.overlay-next { right: 60px; }

.overlay-pager {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 12px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, monospace;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  z-index: 201;
  pointer-events: none;
}

.overlay-basket-btn {
  position: static;
  padding: 8px 14px;
  background: #ffd911;
  color: #0f1111;
  border: 1px solid #f2c200;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  transition: background 120ms, transform 120ms;
}
.overlay-basket-btn:hover {
  background: #f0c800;
  transform: translateY(-1px);
}
.overlay-basket-btn.is-added {
  background: var(--panel-2);
  color: var(--ink-2);
  border-color: var(--line);
}

/* ── empty state ────────────────────────────────────── */
.empty-state {
  max-width: 380px;
  margin: 32px auto 0;
  padding: 28px 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-card);
  text-align: center;
}

.empty-icon {
  font-size: 32px;
  opacity: 0.2;
  margin-bottom: 12px;
  line-height: 1;
}

.empty-state h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.empty-state p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

/* ── add-to-basket button ───────────────────────────── */
.card-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  align-self: flex-end;
  margin-top: 10px;
}
.find-similar-btn {
  padding: 3px 10px;
  background: var(--panel-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: background 120ms;
}
.find-similar-btn:hover {
  background: var(--panel-3);
}
.basket-add-btn {
  padding: 3px 10px;
  background: #ffd911;
  color: #0f1111;
  border: 1px solid #f2c200;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: background 120ms, transform 120ms;
}
.basket-add-btn:hover {
  background: #f0c800;
  transform: scale(1.05);
}
.basket-add-btn.is-added {
  background: var(--panel-2);
  color: var(--ink-2);
  border-color: var(--line);
}

/* ── basket topbar button ───────────────────────────── */
.basket-btn {
  background: none;
  border: none;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--r-sm);
  color: var(--ink);
  transition: background 120ms;
}
.basket-btn:hover {
  background: var(--panel-2);
}
.basket-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: #ffd911;
  color: #0f1111;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 800;
  vertical-align: middle;
}


.overlay-basket-cta {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 201;
  display: flex;
  align-items: center;
  gap: 10px;
}
.overlay-basket-copy {
  max-width: 220px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.54);
  color: rgba(255, 255, 255, 0.86);
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  white-space: nowrap;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* ── basket overlay ─────────────────────────────────── */
.basket-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--bg);
  overflow-y: auto;
  padding: 24px;
}
.basket-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.basket-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}
.basket-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.basket-export-btn {
  padding: 5px 12px;
  background: #ffd911;
  color: #0f1111;
  border: 1px solid #f2c200;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background 120ms;
}
.basket-export-btn:hover {
  background: #f0c800;
}
.basket-export-btn:disabled {
  opacity: 0.62;
  cursor: progress;
}
.basket-close-btn {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 14px;
  cursor: pointer;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms;
}
.basket-close-btn:hover {
  background: var(--panel-3);
}
