/* ===========================================================================
   search.css — the sidebar's search, the secondary filters panel, the result
   list at its four densities, and the add-card picker.
   Owned by search.js / panels.js / addcard.js. DESIGN.md §8.

   Loaded after app.css, so the three shell-level rules here (the grid columns,
   the resize handle and the filter column) can live beside the component they
   belong to without app.css having to know about them.
   =========================================================================== */

/* ============================================ shell: sidebar · filters · stage
   The binder view is three columns: the sidebar (its width is dragged and
   remembered by panels.js), the filters panel, and the stage. The filters
   panel is a real column, so opening it PUSHES the binder along rather than
   covering it — a result can still be dragged from the sidebar into a pocket
   with the panel open. */
.shell {
  position: relative;               /* containing block for the resize handle */
  grid-template-columns: var(--sidebar-w, 330px) 0px minmax(0, 1fr);
  transition: grid-template-columns var(--t-3) var(--ease-out);
}
.shell.is-filters-open { grid-template-columns: var(--sidebar-w, 330px) var(--filters-w) minmax(0, 1fr); }
:root { --filters-w: clamp(280px, 21vw, 320px); }

/* While the handle is being dragged nothing may animate behind it, and no text
   may be selected by the sweep of the pointer. */
body.is-resizing-sidebar { cursor: col-resize; user-select: none; }
body.is-resizing-sidebar .shell { transition: none; }

/* ------------------------------------------------------------ resize handle */
.sidebar-resizer {
  position: absolute; top: 0; bottom: 0; z-index: 6;
  left: var(--sidebar-w, 330px);
  width: 11px; margin-left: -5px;
  cursor: col-resize; touch-action: none;
  background: transparent;
}
/* A hairline that brightens under the pointer — the grip is wider than it looks. */
.sidebar-resizer::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 4px; width: 3px;
  border-radius: var(--radius-pill);
  background: transparent;
  transition: background var(--t-1) var(--ease-out);
}
.sidebar-resizer:hover::before,
body.is-resizing-sidebar .sidebar-resizer::before { background: color-mix(in srgb, var(--accent) 65%, transparent); }
.sidebar-resizer:focus-visible { outline: none; }
.sidebar-resizer:focus-visible::before {
  background: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 28%, transparent);
}
/* three grip dots, so it reads as something to take hold of */
.sidebar-resizer::after {
  content: ""; position: absolute; top: 50%; left: 4px; width: 3px; height: 26px;
  transform: translateY(-50%);
  border-radius: var(--radius-pill);
  background: repeating-linear-gradient(180deg, var(--ink-3) 0 3px, transparent 3px 7px);
  opacity: 0; transition: opacity var(--t-1) var(--ease-out);
}
.sidebar-resizer:hover::after { opacity: .5; }

/* ------------------------------------------------- the sidebar's icon rail
   panels.js folds the sidebar into a narrow rail of icons (Search, Sets,
   Value) and back: its button at the end of the tab bar, the rail's first
   button to open it again. A wide screen only — on a narrow one the sidebar is
   a sheet, and none of this applies. */
:root { --side-rail-w: 60px; }
.side-fold, .side-rail { display: none; }
@media (min-width: 981px) {
  .sidebar { position: relative; }
  .sidebar > .tabs { padding-right: 46px; }
  .side-fold {
    position: absolute; top: 5px; right: 6px; z-index: 2;
    display: grid; place-items: center; width: 32px; height: 32px; padding: 0;
    border: 0; border-radius: 9px; background: none; color: var(--ink-3); cursor: pointer;
    transition: color var(--t-1) var(--ease-out), background var(--t-1) var(--ease-out);
  }
  .side-fold:hover { color: var(--ink); background: var(--bg-3); }
  .side-fold:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

  .shell.is-rail { grid-template-columns: var(--side-rail-w) 0px minmax(0, 1fr); }
  .shell.is-rail > .sidebar-resizer { display: none; }
  /* above the stage, so a button's label can show over it */
  .shell.is-rail > .sidebar { z-index: 7; overflow: visible; }
  .shell.is-rail > .sidebar > :not(.side-rail) { display: none !important; }
  .shell.is-rail > .sidebar > .side-rail { display: flex; }
  .side-rail[hidden] { display: none !important; }
  .side-rail {
    flex-direction: column; align-items: center; gap: 6px;
    padding: 10px 0; height: 100%;
  }
  .side-rail-sep { width: 26px; height: 1px; margin: 2px 0 4px; background: var(--line); }
  .side-rail-btn {
    position: relative; display: grid; place-items: center;
    width: 42px; height: 42px; padding: 0; border: 0; border-radius: 12px;
    background: none; color: var(--ink-3); cursor: pointer;
    transition: color var(--t-1) var(--ease-out), background var(--t-1) var(--ease-out), transform var(--t-1) var(--ease-out);
  }
  .side-rail-btn svg { width: 20px; height: 20px; }
  .side-rail-btn:hover { color: var(--ink); background: var(--bg-3); }
  .side-rail-btn:active { transform: scale(.94); }
  .side-rail-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
  /* its name, beside it, on hover or keyboard focus */
  .side-rail-btn::after {
    content: attr(data-tip); position: absolute; left: calc(100% + 10px); top: 50%; z-index: 30;
    padding: 5px 10px; border-radius: 8px; white-space: nowrap; pointer-events: none;
    font-size: 12.5px; font-weight: 650; color: var(--ink);
    background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2, 0 8px 22px rgba(0, 0, 0, .35));
    opacity: 0; translate: -4px -50%;
    transition: opacity var(--t-1) var(--ease-out), translate var(--t-1) var(--ease-out);
  }
  .side-rail-btn:hover::after, .side-rail-btn:focus-visible::after { opacity: 1; translate: 0 -50%; }
  /* Sets or Value, from the rail: the panel itself, beside the rail, over the binder */
  .side-flyout {
    position: absolute; z-index: 40;
    left: calc(var(--side-rail-w) + 8px); top: 10px; bottom: 10px;
    width: min(360px, calc(100vw - var(--side-rail-w) - 40px));
    display: flex; flex-direction: column; min-height: 0;
    border-radius: 16px; overflow: hidden;
    background: var(--bg-2); border: 1px solid var(--line);
    box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .65), 0 0 0 1px var(--hairline);
    animation: side-flyout-in var(--t-2) var(--ease-out);
  }
  .side-flyout:focus { outline: none; }
  .side-flyout-head {
    flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--line);
  }
  .side-flyout-head h2 { margin: 0; font-size: 15px; font-weight: 750; letter-spacing: -.01em; }
  .side-flyout > .panel { display: flex; flex: 1; min-height: 0; overflow-y: auto; }
  .side-rail-btn.is-open { color: var(--accent-text); background: color-mix(in srgb, var(--accent) 13%, transparent); }
  .side-rail-btn.is-open::before {
    content: ""; position: absolute; left: -9px; top: 11px; bottom: 11px; width: 3px; border-radius: 0 3px 3px 0;
    background: var(--accent);
  }
  .side-rail-btn.is-open::after { opacity: 0 !important; }
  /* a share link's viewer has no Sets tab, so no Sets icon either */
  body.is-shared .side-rail-btn[data-tab="sets"] { display: none; }
}
:root[data-motion="off"] .side-rail-btn, :root[data-motion="off"] .side-rail-btn::after { transition: none; }
@keyframes side-flyout-in { from { opacity: 0; translate: -8px 0; } }
:root[data-motion="off"] .side-flyout { animation: none; }

/* --------------------------------------------------------- filters column */
.filter-dock {
  position: relative; z-index: 5;
  min-width: 0; overflow: hidden;
  display: flex; flex-direction: column;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  box-shadow: inset 1px 0 0 var(--hairline), inset -1px 0 0 var(--hairline);
  visibility: hidden; opacity: 0;
  transition: opacity var(--t-3) var(--ease-out), visibility 0s linear var(--t-3);
}
.shell.is-filters-open > .filter-dock {
  visibility: visible; opacity: 1;
  transition: opacity var(--t-3) var(--ease-out), visibility 0s;
}
/* The panel keeps its full width while the column collapses, so its contents
   are clipped away rather than reflowing on every frame of the slide. */
.filter-dock > .srch-filters { width: var(--filters-w); flex: 1; min-height: 0; }

/* ------------------------------------------------------------ sidebar tabs
   Search · Sets · Value. The shape is app.css's; this is the accent lift the
   rest of the panel is dressed in. */
.sidebar .tabs { box-shadow: var(--glass-edge); }
.sidebar .tab.is-active::after { box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 65%, transparent); }

/* =========================================================== search host
   One component, two homes: the sidebar and the wide picker. Layout decisions
   key off the host's own width (container queries), not the viewport, so the
   stacked ≤980px sidebar gets the roomy layout too. */
.search-host {
  display: flex; flex-direction: column;
  flex: 1; min-height: 0; min-width: 0;
  container: srch / inline-size;
}

.srch { display: flex; flex-direction: column; gap: var(--sp-2); flex: 1; min-height: 0; min-width: 0; }
.srch-ico { display: inline-grid; place-items: center; flex: none; }
.srch-ico svg { display: block; }

/* ----------------------------------------------------------------- header */
.srch-head { display: flex; flex-direction: column; gap: var(--sp-2); flex: none; }
.srch-top { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
/* The game and the tools (Scan, Filters) on a row; the query on its own under them. */
.srch-gamerow { display: flex; align-items: center; gap: 6px; min-width: 0; }
.srch-gamerow > .gp-wrap > .gp-btn { flex: 1; }
.srch-qrow { display: flex; gap: 6px; min-width: 0; flex: 1; }
.srch-qwrap { position: relative; flex: 1; min-width: 0; }
.srch-qicon {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--ink-3); pointer-events: none;
  transition: color var(--t-1) var(--ease-out);
}
.srch-qwrap:focus-within .srch-qicon { color: var(--accent-text); }
/* The two read differently: the query an outlined pill to type in, the game a filled chip to choose from. */
.srch .srch-q {
  height: 40px; padding-left: 34px; border-radius: var(--radius-pill); font-size: 14px;
  background: var(--bg); border-color: var(--line);
  transition: border-color var(--t-1) var(--ease-out), box-shadow var(--t-1) var(--ease-out);
}
.srch .srch-q:focus { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.srch-qicon { left: 13px; }
.srch .srch-q::-webkit-search-cancel-button { cursor: pointer; }
.srch .gp-btn.srch-game {
  height: 34px; border-radius: 10px; font-size: 13px; font-weight: 650;
  border-color: transparent;
  background: color-mix(in srgb, var(--accent) 9%, var(--bg-3));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 16%, transparent);
}
.srch .gp-btn.srch-game:hover { background: color-mix(in srgb, var(--accent) 14%, var(--bg-3)); }
.srch .gp-btn.srch-game:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.srch-fbtn { flex: none; gap: 7px; padding: 0 11px; height: 34px; }
.srch-fbtn[aria-expanded="true"] {
  color: var(--ink); border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 14%, var(--bg-3));
  box-shadow: var(--glass-edge), var(--glow-accent);
}
.srch-fcount {
  display: inline-grid; place-items: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--radius-pill);
  background: var(--accent-fill); color: var(--accent-ink);
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
}

/* Scan: the card scanner (scan.js) — the camera, or a photo where there is none. */
.srch-scan { flex: none; gap: 6px; padding: 0 11px; height: 34px; }
.srch-scan .srch-ico { color: var(--accent-text); }
/* Its file input is only ever clicked by the button (the file chooser has to open from the tap). */
.srch-scan-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; overflow: hidden; }

/* Wide (the picker): all on one line — the game, the query, then Scan and Filters. */
@container srch (min-width: 520px) {
  .srch-top { flex-direction: row; align-items: center; }
  .srch-gamerow { display: contents; }
  .srch-top .gp-btn.srch-game { order: 1; width: auto; flex: 0 1 230px; min-width: 150px; }
  .srch-top .srch-qrow { order: 2; }
  .srch-top .srch-scan { order: 3; }
  .srch-top .srch-fbtn { order: 4; }
}
/* Narrower: Scan keeps its icon and gives up the word first, the query box needs the room more. */
@container srch (max-width: 400px) {
  .srch-scan-t { display: none; }
  .srch-scan { width: 34px; padding: 0; }
}
/* A very narrow sidebar keeps the icon and drops the word. */
@container srch (max-width: 300px) {
  .srch-fbtn-t { display: none; }
  .srch-fbtn { padding: 0 9px; }
}

/* ------------------------------------------------------- active filter chips */
.srch-active { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.srch-achip {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%;
  height: 25px; padding: 0 6px 0 10px; border-radius: var(--radius-pill);
  font-size: 11.5px; font-weight: 600; color: var(--ink);
  background: color-mix(in srgb, var(--accent) 14%, var(--bg-3));
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: var(--glass-edge);
  cursor: pointer;
  transition: border-color var(--t-1) var(--ease-out), background var(--t-1) var(--ease-out);
}
.srch-achip:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 20%, var(--bg-3)); }
.srch-achip:hover .srch-achip-x { color: var(--danger); }
.srch-achip-t { min-width: 0; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srch-achip-x { font-size: 15px; line-height: 1; color: var(--ink-2); transition: color var(--t-1) var(--ease-out); }
.srch-clear {
  background: none; border: none; padding: 3px 6px; border-radius: 6px;
  font-size: 12px; font-weight: 650; color: var(--accent-text); cursor: pointer;
  transition: background var(--t-1) var(--ease-out);
}
.srch-clear:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* In the picker the panel sits under this row, so it must never change height:
   picking SR★★ would otherwise push SR★★★ down from under the pointer. It keeps
   its place even when empty and stays one line, scrolling sideways instead of
   wrapping (the panel shows every pick as a pressed chip anyway). */
.srch--modal.is-filters-open .srch-active[hidden] { display: flex !important; visibility: hidden; }
.srch--modal.is-filters-open .srch-active {
  flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
  /* room for the focus ring inside the scroller, without moving the chips */
  min-height: 32px; padding: 4px; margin: -4px;
}
.srch--modal.is-filters-open .srch-active::-webkit-scrollbar { display: none; }
.srch--modal.is-filters-open .srch-achip,
.srch--modal.is-filters-open .srch-clear { flex: none; }

/* ------------------------------------------------------------ index status */
.srch-index { display: flex; flex-direction: column; gap: 5px; }
.srch-index-label { display: flex; align-items: center; gap: var(--sp-2); font-size: 11.5px; color: var(--ink-2); }
.srch-index-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srch-index-pct { font-variant-numeric: tabular-nums; }
.srch-index.is-error .srch-index-label { color: var(--danger); }
.srch-index.is-error .srch-index-t { white-space: normal; }
.srch-index.is-error .srch-progress { display: none; }
.srch-progress { height: 5px; background: var(--bg-3); border-radius: var(--radius-pill); overflow: hidden; box-shadow: inset 0 0 0 1px var(--hairline); }
.srch-progress-bar {
  height: 100%; width: 0; border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width var(--t-3) var(--ease-out);
}

/* ============================================================ filters panel
   Its own header (what it is, how many are on, Clear all, ×) over its own
   scroller. In the sidebar it is a column of the shell; in the picker it is a
   column of the dialog. */
.srch-main { display: flex; flex-direction: column; gap: var(--sp-2); flex: 1; min-height: 0; }

.srch-filters {
  display: flex; flex-direction: column; min-height: 0; min-width: 0;
  background: var(--bg-2);
}
.srch-fp-head {
  display: flex; align-items: center; gap: var(--sp-2); flex: none;
  min-height: 46px; padding: 0 10px 0 14px;
  border-bottom: 1px solid var(--line);
  box-shadow: var(--glass-edge);
}
.srch-fp-t { margin: 0; font-size: var(--fs-h3); font-weight: 650; letter-spacing: -0.01em; }
.srch-fp-n {
  flex: none; padding: 2px 8px; border-radius: var(--radius-pill);
  font-size: var(--fs-micro); font-weight: 650; font-variant-numeric: tabular-nums;
  color: var(--accent-text);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
.srch-fp-gap { flex: 1; }
.srch-fp-clear { flex: none; }
.srch .srch-fp-x { flex: none; color: var(--ink-3); }
.srch .srch-fp-x:hover { color: var(--ink); }
.srch-filters:focus { outline: none; }
.srch-filters:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }

.srch-fbody {
  flex: 1; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain;
  padding: 4px 14px 18px;
}
/* "Show N cards" — only where the panel covers the results (the picker on a phone, below). */
.srch-fp-foot { display: none; }

.srch-frow { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-2); padding: 10px 0 8px; }
.srch-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.srch-field .input { width: 100%; }
.srch-field-l,
.srch-facet-h,
.srch-attr > summary {
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3);
}

.srch-facets.is-loading { opacity: .55; transition: opacity var(--t-1) var(--ease-out); }
.srch-facet { padding: var(--sp-2) 0; border-top: 1px solid var(--line-soft); min-width: 0; }
/* Tall enough for the count badge, so it appearing does not nudge the chips. */
.srch-facet-h { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; min-height: 16px; }
.srch-facet-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srch-facet-n {
  display: inline-grid; place-items: center; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: var(--radius-pill); background: var(--accent-fill); color: var(--accent-ink);
  font-size: 10px; font-weight: 700; letter-spacing: 0; font-variant-numeric: tabular-nums;
}

.srch-attr > summary {
  display: flex; align-items: center; gap: 7px;
  min-height: 22px; padding: 2px 0; border-radius: 6px;
  list-style: none; cursor: pointer; user-select: none;
  transition: color var(--t-1) var(--ease-out);
}
.srch-attr > summary::-webkit-details-marker { display: none; }
.srch-attr > summary::before {
  content: ""; flex: none; width: 5px; height: 5px; margin: 0 3px 2px 2px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg); transition: transform var(--t-1) var(--ease-out);
}
.srch-attr[open] > summary { margin-bottom: 7px; }
.srch-attr[open] > summary::before { transform: rotate(45deg); margin-bottom: 4px; }
.srch-attr > summary:hover { color: var(--ink-2); }

/* ------------------------------------------------------------------- chips */
.srch-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.srch-chip {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  height: 26px; padding: 0 10px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 600; color: var(--ink-2);
  background: var(--bg-3); border: 1px solid var(--line);
  box-shadow: var(--glass-edge);
  cursor: pointer;
  transition: background var(--t-1) var(--ease-out), border-color var(--t-1) var(--ease-out),
    color var(--t-1) var(--ease-out);
}
.srch-chip:hover { color: var(--ink); border-color: color-mix(in srgb, var(--ink) 20%, var(--line)); }
.srch-chip[aria-pressed="true"] {
  color: var(--ink); border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  background: color-mix(in srgb, var(--accent) 18%, var(--bg-3));
}
/* The tick sits on the corner rather than inline, so pressing a chip never widens
   it and reflows the chips after it out from under the pointer. */
.srch-chip[aria-pressed="true"]::before {
  content: "✓"; position: absolute; top: -5px; right: -4px;
  display: grid; place-items: center; width: 13px; height: 13px; border-radius: 50%;
  font-size: 8.5px; font-weight: 800; line-height: 1;
  background: var(--accent-fill); color: var(--accent-ink);
  box-shadow: 0 0 6px color-mix(in srgb, var(--accent) 60%, transparent);
}
.srch-chip.is-zero:not([aria-pressed="true"]) { opacity: .5; }
.srch-chip-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srch-chip-n { font-size: 10.5px; font-weight: 550; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.srch-chip-more { color: var(--accent-text); background: transparent; border-style: dashed; }
.srch-stars { color: var(--gold-text); letter-spacing: -.04em; }

/* ------------------------------------------------- search within one list
   A long list of values (the sets, the rarities, a big attribute) has a small
   search box of its own under its heading: chip height, pill-shaped like the
   chips, a magnifier inside, and the accent ring on focus every input has. In
   the sidebar the panel is a column of the shell, outside .srch, so all of
   this keys off .srch-filters. */
.srch-find { position: relative; min-width: 0; margin-bottom: 7px; }
.srch-field > .srch-find { margin-bottom: 0; }
.srch-find-ico {
  position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  color: var(--ink-3); pointer-events: none;
  transition: color var(--t-1) var(--ease-out);
}
.srch-find-ico svg { width: 12px; height: 12px; }
.srch-find:focus-within .srch-find-ico { color: var(--accent-text); }
.srch-filters .srch-find-q {
  display: block; width: 100%; height: 26px;
  padding: 0 8px 0 26px; border-radius: var(--radius-pill);
  font-size: 12px;
}
.srch-filters .srch-find-q::-webkit-search-cancel-button { cursor: pointer; }
/* "No matches" (and, for the sets, how many do): an empty one takes no room. */
.srch-find-note { margin: 0; font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.srch-find-note.is-none { color: var(--ink-2); }
.srch-facet .srch-find-note:not(:empty) { margin: -2px 0 7px 3px; }
.srch-field > .srch-find-note:not(:empty) { margin-left: 3px; }
/* The Set field is a column with a gap; an empty note hands its gap back. */
.srch-field > .srch-find-note:empty { margin-top: -5px; }

.srch-price { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 6px; color: var(--ink-3); }
.srch-price .input { width: 100%; }
.srch-price .input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent); }
/* the display currency's symbol inside each box (--sym is its width, set by search.js) */
.srch-money { position: relative; display: block; min-width: 0; }
.srch-cur {
  position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  font-size: 12px; font-weight: 650; color: var(--ink-3); pointer-events: none;
}
.srch-money .input { padding-left: calc(14px + var(--sym, 1ch)); }
.srch-goods {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px;
  padding-bottom: 12px; margin-bottom: 2px;
  border-bottom: 1px solid var(--line-soft);
}
.srch-goods .srch-facet-t { margin-right: 2px; }
.srch-goods .check { padding: 0; }
.srch-fnote { margin: var(--sp-2) 0 4px; font-size: 12px; color: var(--ink-3); }

/* ============================================================= results bar
   Sort and the zoom levels are always here, beside the match count — never
   only inside the filter panel (DESIGN.md §8). */
.srch-pane { display: flex; flex-direction: column; flex: 1 1 0; min-height: min(150px, 62%); min-width: 0; }
.srch-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--sp-2);
  min-height: 30px; margin-bottom: 6px; flex: none;
}
.srch-status {
  flex: 1 1 100%; min-width: 0;
  font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.srch-sortbox {
  display: flex; align-items: center; gap: 6px; flex: 1 1 auto; min-width: 0;
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3);
}
.srch-sort-ico { color: var(--ink-3); }
.srch-sortbox .input {
  flex: 1 1 auto; width: auto; min-width: 0; max-width: 210px;
  font-weight: 500; letter-spacing: normal; text-transform: none; color: var(--ink);
}
.srch-sortbox-l { display: none; }

.srch-zooms {
  display: flex; gap: 2px; flex: none; padding: 2px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.srch .srch-vbtn {
  width: 26px; height: 24px; padding: 0;
  color: var(--ink-3); background: transparent; border-color: transparent; box-shadow: none;
  border-radius: 6px;
}
.srch .srch-vbtn:hover { color: var(--ink); background: var(--bg-3); border-color: transparent; transform: none; }
.srch .srch-vbtn[aria-pressed="true"] {
  color: var(--accent-ink); background: var(--accent-fill); border-color: transparent;
  box-shadow: 0 1px 6px color-mix(in srgb, var(--accent) 35%, transparent);
}

/* Wide enough for one row: the count, then sort, then the zoom levels. */
@container srch (min-width: 430px) {
  .srch-status { flex: 1 1 auto; }
  .srch-sortbox { flex: 0 1 auto; }
  .srch-sortbox-l { display: inline; }
}

/* --------------------------------------------------------------- results
   The list itself is the scroll container (and the IntersectionObserver's
   root); positioned so item offsets are measured against it. */
.srch-results {
  position: relative;
  flex: 1; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain;
  margin: 0 -6px; padding: 2px 6px 10px;
}
.srch-results:focus { outline: none; }
.srch-results.is-stale .srch-items { opacity: .5; transition: opacity var(--t-1) var(--ease-out) .1s; }
.srch-sentinel { height: 1px; }

.srch-note {
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-2);
  padding: 26px 12px; text-align: center; font-size: var(--fs-sm); color: var(--ink-3);
}
.srch-note p { margin: 0; }
.srch-note-t { color: var(--ink-2); font-weight: 550; max-width: 40ch; overflow-wrap: anywhere; }
.srch-note-s { max-width: 38ch; overflow-wrap: anywhere; }

.srch-more { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 12px 0 4px; }
.srch-more-t { font-size: 12px; color: var(--ink-3); text-align: center; }
.srch-more-t:empty { display: none; }

.srch-item { font: inherit; color: inherit; text-align: left; margin: 0; -webkit-tap-highlight-color: transparent; }
.srch-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.srch.is-draggable .srch-item { cursor: grab; }
.srch.is-draggable .srch-item:active { cursor: grabbing; }
img.is-broken { visibility: hidden; }

/* "In binder" — already somewhere in the open binder */
.srch-inb {
  display: none; align-items: center;
  padding: 3px 5px; border-radius: 4px;
  font-size: 9px; font-weight: 750; line-height: 1; letter-spacing: .05em; text-transform: uppercase;
  color: var(--accent-ink); background: var(--accent-fill); white-space: nowrap;
}
.srch-item.is-in .srch-inb { display: inline-flex; }

/* ------------------------------------------------- zoom 1 & 2: rows (list) */
.srch .res {
  display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  width: 100%; padding: 7px; border-radius: var(--radius-sm);
  background: transparent; border: 1px solid transparent;
  cursor: pointer; touch-action: manipulation; -webkit-touch-callout: none;
  transition: background var(--t-1) var(--ease-out), border-color var(--t-1) var(--ease-out);
}
@media (hover: hover) { .srch .res:hover { background: var(--bg-3); border-color: var(--line); } }
.srch .res-img {
  display: block; width: 42px; aspect-ratio: var(--card-ratio); object-fit: cover;
  border-radius: 4px; background: var(--bg-3); box-shadow: var(--shadow-1);
}
.srch .res-body { display: flex; flex-direction: column; min-width: 0; }
.srch .res-name { font-size: 12.8px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srch .res-meta { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srch .res-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.srch .res-price { font-size: 12.5px; font-weight: 650; color: var(--gold-text); font-variant-numeric: tabular-nums; }

/* Compact: one tight line per card — as many as will fit on screen. */
.srch .res.is-compact {
  grid-template-columns: 22px minmax(0, 1fr) auto; gap: 9px;
  padding: 3px 7px; border-radius: 7px;
}
.srch .res.is-compact .res-img { width: 22px; border-radius: 3px; }
.srch .res.is-compact .res-name { font-size: 12.2px; }
.srch .res.is-compact .res-side { flex-direction: row; align-items: center; gap: 7px; }
.srch .res.is-compact .res-price { font-size: 12px; }
.srch .res.is-compact .srch-rar { max-width: 74px; padding: 0 5px; font-size: 10px; }
.srch .res.is-compact .srch-inb { padding: 2px 4px; font-size: 8.5px; }

/* --------------------------------------------- zoom 3 & 4: tiles and cards
   Column count follows the panel's own width, not the window's. */
.srch-results.is-grid .srch-items,
.srch-results.is-large .srch-items { display: grid; }
.srch-results.is-grid .srch-items { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: var(--sp-2) 6px; }
.srch-results.is-large .srch-items { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 14px 10px; }

@container srch (min-width: 420px) {
  .srch-results.is-grid .srch-items { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
  .srch-results.is-large .srch-items { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
@container srch (min-width: 760px) {
  .srch-results.is-grid .srch-items { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
  .srch-results.is-large .srch-items { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }
}

.srch-tile,
.srch-card {
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
  padding: 5px; border-radius: var(--radius-sm);
  background: transparent; border: 1px solid transparent;
  cursor: pointer; touch-action: manipulation; -webkit-touch-callout: none;
  transition: background var(--t-1) var(--ease-out), border-color var(--t-1) var(--ease-out);
}
/* Hover only where there is a mouse: a finger that lands on a result to scroll
   the list lit it up and lifted it, as though it were being picked. */
@media (hover: hover) {
  .srch-tile:hover,
  .srch-card:hover { background: var(--bg-3); border-color: var(--line); }
}

.srch-thumb {
  position: relative; display: block; width: 100%;
  aspect-ratio: var(--card-ratio); overflow: hidden;
  border-radius: 6px; background: var(--pocket); box-shadow: var(--shadow-1);
  transition: transform var(--t-2) var(--ease-out), box-shadow var(--t-2) var(--ease-out);
}
.srch-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.srch-thumb .srch-inb { position: absolute; top: 5px; left: 5px; z-index: 2; box-shadow: var(--shadow-1); }
@media (hover: hover) { .srch-item:hover .srch-thumb { transform: translateY(-2px); box-shadow: var(--shadow-card); } }
.srch-item:focus-visible .srch-thumb { transform: translateY(-2px); box-shadow: var(--shadow-card); }
.srch-ptag {
  position: absolute; left: 4px; bottom: 4px; z-index: 2;
  padding: 1.5px 6px; border-radius: 4px;
  font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--gold-text); background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.srch-tile-name { font-size: 11px; font-weight: 550; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.srch-card { padding: 6px 6px 8px; gap: 3px; }
.srch-card .srch-thumb { margin-bottom: 4px; border-radius: 7px; box-shadow: var(--shadow-card); }
.srch-card-name {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  min-height: 2.6em; font-size: 12.5px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere;
}
.srch-card-set { font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srch-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 2px; }
.srch-rar {
  min-width: 0; max-width: 62%; padding: 1px 6px; border-radius: 4px;
  font-size: 10.5px; font-weight: 700; color: var(--ink-2);
  background: var(--bg-3); border: 1px solid var(--line);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.srch-rar:empty { visibility: hidden; }
@media (hover: hover) { .srch-item:hover .srch-rar { background: var(--bg-2); } }
.srch-card-price { font-size: 12.5px; font-weight: 700; color: var(--gold-text); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ wide layouts */

/* The stacked sidebar (≤980px) spans the window: lay the filter sheet out in columns. */
@container srch (min-width: 620px) {
  .srch--sidebar .srch-results.is-compact .srch-items,
  .srch--sidebar .srch-results.is-list .srch-items {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); column-gap: 10px;
  }
}

/* The picker: filters become a column beside the card grid. */
@container srch (min-width: 760px) {
  .srch--modal.is-filters-open .srch-main {
    display: grid; grid-template-columns: 250px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr);
    gap: var(--sp-4);
  }
  .srch--modal .srch-filters {
    background: transparent;
    border-right: 1px solid var(--line);
  }
  .srch--modal .srch-fp-head { min-height: 34px; padding: 0 12px 8px 0; box-shadow: none; border-bottom: 1px solid var(--line-soft); }
  .srch--modal .srch-fbody { padding: 0 14px 12px 0; }
  .srch--modal .srch-pane { min-height: 0; }
}
/* Too narrow for a column: the panel stacks above the results, scrolling itself. */
@container srch (max-width: 759px) {
  .srch--modal .srch-filters {
    flex: 0 1 auto; max-height: 46%;
    border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden;
  }
  .srch--modal .srch-fp-head { min-height: 38px; padding: 0 8px 0 12px; }
  .srch--modal .srch-fbody { padding: 2px 12px 12px; }
}

/* ============================================================ picker modal */
.modal.modal-wide { width: min(1040px, 96vw); }
.modal.modal-picker {
  display: flex; flex-direction: column;
  /* Most of the screen both ways: as many results across as it will hold. */
  width: 94vw; max-width: none;
  height: 88vh; max-height: 88vh; overflow: hidden;
}
.picker { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.picker-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 14px 16px 12px; border-bottom: 1px solid var(--line); flex: none;
  box-shadow: var(--glass-edge);
}
.picker-titles { min-width: 0; }
.picker-head h2 { margin: 0; font-size: var(--fs-h2); letter-spacing: -0.02em; }
.picker-where {
  margin: 3px 0 0; font-size: var(--fs-sm); color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.picker-search { padding: 12px 16px 0; }
.picker-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap;
  padding: 10px 16px; border-top: 1px solid var(--line); flex: none;
}
.picker-chain { font-size: 13px; }

/* Phones (and short landscape screens) get the whole screen: a sheet with the
   title and the × along the top, the search under them and the results filling
   the rest. It keeps clear of the notch and the rounded corners (the × rides
   inside the padding with everything else); the foot keeps the home
   indicator's strip. */
@media (max-width: 640px), (max-height: 520px) {
  .modal.modal-picker {
    position: fixed; inset: 0;
    width: auto; height: auto; max-height: none;
    border: none; border-radius: 0;
    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) 0 env(safe-area-inset-left, 0px);
    /* Nothing is left beside a whole-screen sheet to see through it to; the page
       ghosting through the glass would only muddy the results. */
    background: var(--bg-2);
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .picker-head { padding: 10px 12px; }
  .picker-search { padding: 10px 12px 0; }
  .picker-foot { padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)); }
  /* Beside the Filters button a phone has not quite the room for the whole hint. */
  .srch--modal .srch-q { text-overflow: ellipsis; }

  /* No room to stack the filters over the results (they would get a few rows
     each): the panel opens over the results instead, the full width of the
     screen, with its own scroller and a foot that says how many cards the
     filters leave and takes the thumb back to them. The search stays above it,
     and its Filters button closes it again. */
  @container srch (max-width: 759px) {
    .srch--modal .srch-main { position: relative; }
    .srch--modal .srch-filters {
      position: absolute; top: 0; bottom: 0; z-index: 6;
      /* out to the screen's edges, over the host's 12px of padding */
      left: -12px; right: -12px;
      max-height: none;
      border: none; border-top: 1px solid var(--line); border-radius: 0;
      background: var(--bg-2);
      box-shadow: 0 -12px 32px rgba(0, 0, 0, .28);
      animation: srch-panel-up var(--t-2) var(--ease-out);
    }
    /* What it covers can be neither seen nor tabbed to — hidden, not removed,
       so the result list keeps its place for when the panel closes. The
       active-filter row goes too: the panel's own head counts them. */
    .srch--modal.is-filters-open .srch-pane { visibility: hidden; }
    .srch.srch--modal.is-filters-open .srch-active { display: none !important; }

    .srch--modal .srch-fp-x { width: 36px; height: 36px; }
    /* A landscape phone has little height to spare, so the foot gives some back there. */
    .srch--modal .srch-fp-foot {
      display: flex; flex: none;
      padding: clamp(6px, 1.2vh, 10px) 12px;
      border-top: 1px solid var(--line);
      box-shadow: var(--glass-edge);
    }
    .srch--modal .srch-fp-show { flex: 1; height: clamp(34px, 5.2vh, 42px); font-size: 14.5px; }
    /* Fingers, not a pointer: taller chips and headings to tap. */
    .srch--modal .srch-chip { height: 32px; padding: 0 12px; font-size: 13px; }
    .srch--modal .srch-attr > summary { min-height: 32px; }
  }
}
@keyframes srch-panel-up { from { opacity: 0; transform: translateY(14px); } }

/* A narrow picker (a phone's): tiles two to a row, big enough to read, and a
   third or fourth as the screen widens. Wider pickers keep the steps above. */
@container srch (max-width: 559px) {
  .srch--modal .srch-results.is-grid .srch-items {
    grid-template-columns: repeat(auto-fill, minmax(min(140px, calc(50% - 3px)), 1fr));
    row-gap: 12px;
  }
  .srch--modal .srch-tile-name { font-size: 12.5px; }
  .srch--modal .srch-ptag { font-size: 11px; }
}

/* Touch screens: an input under 16px makes iOS zoom the page when it takes
   focus, and the picker (and a filters panel) never come back out of it. */
@media (hover: none), (pointer: coarse) {
  /* 16px or iOS zooms the page in on focus: the picker, the Filters panel, and the sidebar's own search. */
  .srch--modal .input,
  .srch-filters .input,
  .srch-qwrap .input,
  .srch .select { font-size: 16px; }
  .srch--modal .input-sm,
  .srch-filters .input-sm { height: 32px; }
  .srch-filters .srch-find-q { height: 32px; padding-left: 30px; }
  .srch-find-ico { left: 11px; }
  .srch-find-ico svg { width: 13px; height: 13px; }
}

/* ================================================ empty pockets: add a card */
.pocket.is-addable { cursor: pointer; container-type: inline-size; }
.pocket.is-addable:hover { background: color-mix(in srgb, #000 12%, transparent); }
.pocket.is-addable:hover::after { border-color: rgba(255,255,255,.34); }
.pocket.is-addable:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.pocket-add {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: rgba(255,255,255,.92); text-align: center;
  opacity: 0; transition: opacity var(--t-1) var(--ease-out); pointer-events: none;
}
.pocket.is-addable:hover .pocket-add,
.pocket.is-addable:focus-visible .pocket-add { opacity: 1; }
.pocket-add-plus {
  display: grid; place-items: center;
  width: clamp(20px, 34cqi, 42px); aspect-ratio: 1; border-radius: 50%;
  font-size: clamp(15px, 24cqi, 28px); line-height: 1;
  background: rgba(255,255,255,.16); box-shadow: inset 0 0 0 1px rgba(255,255,255,.32);
}
.pocket-add-label { font-size: clamp(9px, 9.5cqi, 12px); font-weight: 650; letter-spacing: .03em; text-shadow: 0 1px 2px rgba(0,0,0,.55); }
@container (max-width: 72px) { .pocket-add-label { display: none; } }

body.is-dragging-card .pocket-add { opacity: 0 !important; }
/* No hover on touch: keep a quiet "+" so empty pockets read as tappable. */
@media (hover: none) {
  .pocket.is-addable .pocket-add { opacity: .6; }
  .pocket-add-label { display: none; }
}

/* ============================================================== sets panel */
#sets-list .set-row {
  width: 100%; margin: 0; font: inherit; color: inherit; text-align: left;
  background: transparent;
}
#sets-list .set-row:hover { background: var(--bg-3); border-color: var(--line); }
#sets-list .set-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
#sets-list .set-row:focus-visible .set-go { opacity: 1; }
#sets-list .set-text { min-width: 0; }
#sets-list .set-name,
#sets-list .set-meta { display: block; }

/* ============================================================ card preview
   peek.js paints it; the shell is in binder.css. Only the two pieces this
   redesign added live here. */
#card-peek .peek-meta { display: flex; align-items: center; gap: 7px; margin-top: 2px; }
#card-peek .peek-set { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#card-peek .peek-rar {
  flex: none; padding: 1px 7px; border-radius: var(--radius-pill);
  font-size: 10.5px; font-weight: 700; color: var(--ink-2);
  background: var(--bg-3); border: 1px solid var(--line);
}

/* =================================================== the sheet, below 980px
   No room for three columns: the sidebar stacks above the stage (app.css) and
   the filters panel slides in over the stage as a sheet. */
@media (max-width: 980px) {
  .shell,
  .shell.is-filters-open {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 44vh) minmax(0, 1fr);
    transition: none;
  }
  .sidebar-resizer { display: none; }

  .filter-dock {
    position: fixed; left: 0; top: 52px; bottom: 0; z-index: 46;
    width: min(340px, 88vw);
    border-right: 1px solid var(--line);
    box-shadow: var(--shadow-2);
    opacity: 1;
    transform: translateX(-101%);
    transition: transform var(--t-3) var(--ease-out), visibility 0s linear var(--t-3);
  }
  .shell.is-filters-open > .filter-dock {
    transform: none;
    transition: transform var(--t-3) var(--ease-out), visibility 0s;
  }
  .filter-dock > .srch-filters { width: 100%; }

  /* The scrim dims the stage the sheet is over — never the sidebar above it, so
     the Filters button that opened it still closes it. It is a grid item in the
     stage's own cell; a click on it lands on the shell, which closes the sheet. */
  .shell.is-filters-open::after {
    content: ""; grid-row: 2; grid-column: 1; position: relative; z-index: 45;
    background: color-mix(in srgb, #05060a 48%, transparent);
    animation: mo-backdrop-in var(--t-2) var(--ease-out);
  }
  :root[data-theme="light"] .shell.is-filters-open::after { background: color-mix(in srgb, #1a1d24 32%, transparent); }
}

/* ============================================================ focus & motion */
.srch-chip:focus-visible,
.srch-achip:focus-visible,
.srch-clear:focus-visible,
.srch-attr > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Reduced and Off: the panel and the stage still change size, they just do not
   travel to get there. (design.css already stops every transition at Off.) */
:root[data-motion="reduced"] .shell,
:root[data-motion="reduced"] .filter-dock,
:root[data-motion="off"] .shell,
:root[data-motion="off"] .filter-dock { transition: none; }
/* The phone picker's filter panel fades in rather than rising. */
:root[data-motion="reduced"] .srch--modal .srch-filters { animation-name: mo-backdrop-in; }
/* Before motion.js has written data-motion, follow the system. */
@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion="full"]) .srch *,
  :root:not([data-motion="full"]) .srch-filters *,
  :root:not([data-motion="full"]) .shell,
  :root:not([data-motion="full"]) .filter-dock,
  :root:not([data-motion="full"]) .pocket-add { transition: none !important; }
  :root:not([data-motion="full"]) .srch--modal .srch-filters { animation-name: mo-backdrop-in; }
}

@media print {
  .pocket-add { display: none !important; }
  .filter-dock, .sidebar-resizer { display: none !important; }
}

/* ---- TCGplayer, on each search result, in the sidebar and the add-card picker (search.js tcgLink): the card's page in a new
   tab. On a row it sits at the end; on a tile, in the art's top-right corner under the pointer. */
.srch-tcg {
  display: inline-grid; place-items: center; flex: none;
  width: 24px; height: 24px; border-radius: 6px; cursor: pointer;
  color: var(--ink-3); background: transparent;
  transition: color var(--t-1) var(--ease-out), background var(--t-1) var(--ease-out), opacity var(--t-1) var(--ease-out);
}
.srch-tcg svg { width: 15px; height: 15px; }
.srch-tcg:hover { color: var(--accent-ink); background: var(--accent-fill); }
.srch .res.is-compact .srch-tcg { width: 20px; height: 20px; }
.srch-thumb .srch-tcg {
  position: absolute; top: 5px; right: 5px; z-index: 3;
  color: rgba(255, 255, 255, .92); background: color-mix(in srgb, #0a0c12 70%, transparent);
  box-shadow: var(--shadow-1); opacity: 0;
}
@media (hover: hover) { .srch-item:hover .srch-thumb .srch-tcg { opacity: 1; } }
.srch-item:focus-visible .srch-thumb .srch-tcg { opacity: 1; }
.srch-thumb .srch-tcg:hover { color: var(--accent-ink); background: var(--accent-fill); }
@media (hover: none) { .srch-thumb .srch-tcg { opacity: .85; } }

/* ---- Which printing a result is (search.js renderItem, printing.js searchPrintings): a Pokémon card
   printed as a 1st Edition too is a result for each, tagged "Unlimited" and, in gold, "1st Edition". */
.srch-ed {
  display: inline-block; vertical-align: 1px; margin-left: 6px; padding: 1px 5px; border-radius: 4px;
  font-size: 9.5px; font-weight: 750; letter-spacing: .03em; line-height: 1.3; white-space: nowrap;
  color: var(--ink-2); background: var(--bg-3); box-shadow: inset 0 0 0 1px var(--line);
}
.srch-ed.is-first { color: #1a1206; background: linear-gradient(180deg, #ffe08a, #e9b949); box-shadow: none; }
.srch-tile > .srch-ed, .srch-card > .srch-ed { align-self: flex-start; margin-left: 0; }
