/* Riftbound Collection Manager — styled on the Nocturne design system. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --color-bg: #161826;
  --color-surface: #232532;
  --color-text: #e9e9ed;
  --color-accent: #9184d9;
  --color-divider: color-mix(in srgb, #e9e9ed 16%, transparent);

  --color-neutral-100: #f3f5fe;
  --color-neutral-200: #e4e7f5;
  --color-neutral-300: #cfd3e5;
  --color-neutral-400: #b2b6ca;
  --color-neutral-500: #9397ab;
  --color-neutral-600: #75798c;
  --color-neutral-700: #595d6c;
  --color-neutral-800: #3f424d;
  --color-neutral-900: #292b31;

  --color-accent-100: #f5f4ff;
  --color-accent-200: #e7e5fe;
  --color-accent-300: #d2cefd;
  --color-accent-400: #b5abfc;
  --color-accent-500: #968ae0;
  --color-accent-600: #796cbf;
  --color-accent-700: #5d5294;
  --color-accent-800: #423a6a;
  --color-accent-900: #2b2741;

  --font-heading: "Inter", system-ui, sans-serif;
  --font-mono: ui-monospace, Menlo, monospace;

  --space-1: 2.8px;
  --space-2: 5.6px;
  --space-3: 8.4px;
  --space-4: 11.2px;
  --space-6: 16.8px;
  --space-8: 22.4px;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;

  --shadow-sm: 0 0 0 1px #3f424d;
  --shadow-md: 0 0 0 1px #595d6c, 0 6px 18px rgba(0,0,0,0.55);
  --shadow-lg: 0 0 0 1px #9397ab, 0 16px 40px rgba(0,0,0,0.65);

  /* app-local grounds, not in the base token sheet */
  --color-page: #0f111c;
  --color-rail: #12141f;
  --color-tile-unowned: #14161f;
  --color-well: #0f111c;

  /* deck-builder availability semaphore */
  --status-green: #5fb87a;
  --status-blue: #5b9bd5;
  --status-yellow: #d1a94c;
  --status-red: #d5696b;
}

/* Riftbound domain marks */
.dom-fury { background: #b06a72; }
.dom-calm { background: #5f8fa8; }
.dom-mind { background: #7f86b8; }
.dom-body { background: #a8916a; }
.dom-chaos { background: #8a6fa3; }
.dom-order { background: #9aa0ad; }

/* Same domain colors, expressed as a row accent border — a decklist row's
   background is reserved for the ownership completion wash (set inline via
   ownershipGradientStyle), so this stays a line, never a fill. */
.row-dom-fury { border-left: 3px solid #b06a72; }
.row-dom-calm { border-left: 3px solid #5f8fa8; }
.row-dom-mind { border-left: 3px solid #7f86b8; }
.row-dom-body { border-left: 3px solid #a8916a; }
.row-dom-chaos { border-left: 3px solid #8a6fa3; }
.row-dom-order { border-left: 3px solid #9aa0ad; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { background: var(--color-page); }
body {
  margin: 0;
  color: var(--color-text);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
}
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 500; margin: 0; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  font-family: var(--font-heading); font-weight: 500; font-size: 12px; line-height: 1.2;
  color: var(--color-text);
  background: transparent; border: 1px solid transparent;
  padding: var(--space-2) calc(var(--space-3) * 1.2);
  border-radius: var(--radius-md);
  height: 30px;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { color: var(--color-accent); border-color: var(--color-accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--color-accent) 12%, transparent); }
.btn-primary:active { background: color-mix(in srgb, var(--color-accent) 22%, transparent); }
.btn-secondary { border-color: var(--color-divider); }
.btn-secondary:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.btn-secondary:active { background: color-mix(in srgb, var(--color-text) 14%, transparent); }
.btn-ghost { color: var(--color-accent); padding-inline: var(--space-2); border-color: transparent; }
.btn-ghost:hover { background: color-mix(in srgb, var(--color-accent) 10%, transparent); }
.btn-ghost:active { background: color-mix(in srgb, var(--color-accent) 18%, transparent); }
.btn-ghost.danger { color: color-mix(in srgb, #e08a86 100%, var(--color-accent) 0%); }
.btn-icon { width: 30px; padding: 0; }

/* ---- topbar ---- */
.topbar {
  display: flex; align-items: center; gap: var(--space-6);
  padding: 0 var(--space-6); height: 52px;
  background: var(--color-surface); border-bottom: 1px solid var(--color-divider);
  position: sticky; top: 0; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.brand-mark { width: 9px; height: 9px; transform: rotate(45deg); background: var(--color-accent); }
.brand-word { font: 600 14px/1 var(--font-heading); letter-spacing: .18em; color: var(--color-text); }
.brand-badge {
  font: 500 10px/1 var(--font-mono); letter-spacing: .1em; color: var(--color-accent-300);
  border: 1px solid color-mix(in srgb, var(--color-accent) 45%, transparent);
  padding: 3px 5px; border-radius: var(--radius-sm);
}

.tabs { display: flex; gap: 2px; flex-shrink: 0; }
.tab {
  font: 400 12.5px/1 var(--font-heading); color: var(--color-neutral-500);
  padding: 7px 11px; border-radius: var(--radius-sm); border: none; background: transparent;
  cursor: pointer;
}
.tab:hover { color: var(--color-neutral-300); }
.tab.active {
  font-weight: 500; color: var(--color-accent-200);
  background: color-mix(in srgb, var(--color-accent) 18%, transparent);
  box-shadow: inset 0 -2px 0 var(--color-accent);
}

.active-binder-picker {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 5px 5px 10px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--color-accent) 14%, transparent);
  flex-shrink: 0;
}
.active-binder-picker label {
  font: 500 10px/1 var(--font-heading); letter-spacing: .08em; text-transform: uppercase;
  color: var(--color-accent-200); white-space: nowrap;
}
.active-binder-picker select {
  appearance: none; -webkit-appearance: none;
  background: var(--color-page); color: var(--color-accent-100);
  border: 1px solid color-mix(in srgb, var(--color-accent) 40%, transparent);
  border-radius: var(--radius-sm); font: 500 12px/1 var(--font-heading);
  padding: 5px 8px; cursor: pointer; max-width: 180px;
}
.active-binder-picker select:hover { border-color: var(--color-accent); }

.topbar-search {
  flex: 1; max-width: 320px; display: flex; align-items: center; gap: 8px;
  height: 30px; padding: 0 10px;
  background: var(--color-bg); border: 1px solid var(--color-neutral-800); border-radius: var(--radius-sm);
}
.topbar-search svg { flex-shrink: 0; }
.topbar-search input {
  flex: 1; min-width: 0; background: transparent; border: none; outline: none;
  color: var(--color-text); font: 400 12px/1 var(--font-heading);
}
.topbar-search input::placeholder { color: var(--color-neutral-600); }

.topbar-stats { margin-left: auto; font: 400 11.5px/1 var(--font-mono); color: var(--color-neutral-500); white-space: nowrap; }

.account-area { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.account-email {
  font: 400 11.5px/1 var(--font-mono); color: var(--color-neutral-400);
  max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---- form fields (auth) ---- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label { font: 400 12px/1 var(--font-heading); color: var(--color-neutral-400); }
.input {
  width: 100%; min-height: 36px; padding: 6px 10px; font: 400 13px/1.3 var(--font-heading);
  color: var(--color-text); caret-color: var(--color-accent);
  background: var(--color-bg); border: 1px solid var(--color-neutral-800); border-radius: var(--radius-md);
}
.input:hover { border-color: color-mix(in srgb, var(--color-text) 45%, transparent); }
.input:focus-visible { border-color: var(--color-accent); outline-offset: 0; }
.btn-block { width: 100%; }

.auth-error { color: #e08a86; font-size: 12px; margin: 0; }
.auth-switch { display: flex; justify-content: space-between; margin-top: var(--space-3); }
.auth-switch button {
  background: none; border: none; cursor: pointer; padding: 0;
  font: 400 11.5px/1 var(--font-heading); color: var(--color-accent-300);
}
.auth-switch button:hover { text-decoration: underline; }

/* ---- filters bar ---- */
.filters-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  background: var(--color-rail); border-bottom: 1px solid var(--color-divider);
  position: sticky; top: 52px; z-index: 29;
}
.filters-bar select {
  appearance: none; -webkit-appearance: none;
  background: var(--color-bg); color: var(--color-neutral-300);
  border: 1px solid var(--color-neutral-800); border-radius: var(--radius-sm);
  font: 400 11.5px/1.2 var(--font-heading); padding: 6px 10px; cursor: pointer;
}
.filters-bar select:hover { border-color: color-mix(in srgb, var(--color-text) 45%, transparent); }

.set-nav {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: var(--space-2) var(--space-6);
  background: var(--color-page); border-bottom: 1px solid var(--color-divider);
}
.set-nav a {
  color: var(--color-neutral-500); text-decoration: none;
  font: 400 11px/1.2 var(--font-heading);
  padding: 4px 9px; border-radius: 20px; border: 1px solid var(--color-neutral-800);
}
.set-nav a:hover { color: var(--color-accent-300); border-color: color-mix(in srgb, var(--color-accent) 55%, transparent); }

main { padding: var(--space-8) var(--space-8) 60px; max-width: 1760px; margin: 0 auto; }
.loading { color: var(--color-neutral-500); text-align: center; padding: 60px 0; }

/* ---- set / collection header ---- */
.collection { margin-bottom: 48px; }
.collection-header {
  display: flex; align-items: flex-end; gap: var(--space-8);
  margin-bottom: var(--space-6); scroll-margin-top: 120px;
}
.collection-kicker {
  font: 500 10px/1 var(--font-heading); letter-spacing: .14em; text-transform: uppercase;
  color: var(--color-accent-300); margin-bottom: 7px;
}
.collection-title { font-size: 28px; margin-bottom: var(--space-3); color: var(--color-text); }
.collection-meta {
  display: flex; align-items: center; gap: var(--space-4);
  font: 400 12px/1 var(--font-heading); color: var(--color-neutral-500);
}
.collection-meta .sep { color: var(--color-neutral-800); }
.collection-meta b { color: var(--color-text); font-weight: 500; }

.completion { margin-left: auto; flex-shrink: 0; }
.completion-figure { display: flex; align-items: baseline; gap: 6px; margin-bottom: 6px; justify-content: flex-end; }
.completion-pct { font: 500 24px/1 var(--font-heading); color: var(--color-text); }
.completion-caption { font: 400 11.5px/1 var(--font-heading); color: var(--color-neutral-500); white-space: nowrap; }
.completion-bar { width: 260px; height: 5px; border-radius: 3px; background: var(--color-neutral-900); overflow: hidden; }
.completion-bar-fill {
  height: 100%; background: linear-gradient(90deg, var(--color-accent-700), var(--color-accent));
  box-shadow: 0 0 12px color-mix(in srgb, var(--color-accent) 60%, transparent);
}

/* ---- grid ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: var(--space-6);
}

.tile {
  display: flex; flex-direction: column; gap: 7px;
  padding: 7px; border-radius: var(--radius-md);
  background: var(--color-tile-unowned);
  box-shadow: inset 0 0 0 1px var(--color-neutral-900);
  transition: box-shadow .16s ease-out, background .16s ease-out;
}
.tile.owned { background: var(--color-surface); box-shadow: inset 0 0 0 1px var(--color-accent-800); }

.tile-art {
  position: relative; aspect-ratio: 5/7; border-radius: var(--radius-sm);
  overflow: hidden; background: var(--color-well); cursor: pointer;
}
.tile-art img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0.42; transition: opacity .16s ease-out; }
.tile.owned .tile-art img { opacity: 1; }
.badge-cost {
  position: absolute; top: 6px; left: 6px; width: 19px; height: 19px; border-radius: 50%;
  background: var(--color-well); box-shadow: inset 0 0 0 1px var(--color-neutral-700);
  display: flex; align-items: center; justify-content: center;
  font: 500 11px/1 var(--font-heading); color: var(--color-text);
}
.domain-dots { position: absolute; top: 6px; right: 6px; display: flex; flex-direction: column; gap: 3px; }
.domain-dots span { width: 9px; height: 9px; border-radius: 2px; }
.foil-sheen {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, color-mix(in srgb, var(--color-accent) 26%, transparent) 48%, transparent 62%);
}
.print-note {
  position: absolute; left: 6px; bottom: 6px; font: 500 8.5px/1.2 var(--font-mono);
  padding: 2px 5px; border-radius: 3px; background: var(--color-well);
  box-shadow: inset 0 0 0 1px var(--color-accent-600); color: var(--color-accent-300);
}

.tile-info { min-width: 0; cursor: pointer; }
.tile-name {
  font: 500 12px/1.25 var(--font-heading); color: var(--color-neutral-500);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tile.owned .tile-name { color: var(--color-text); }
.tile-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 3px;
  font: 400 9.5px/1.3 var(--font-mono); color: var(--color-neutral-600);
}

.tile-steppers { display: flex; flex-direction: column; gap: 3px; }
.lang-row { display: flex; align-items: center; gap: 4px; }
.lang-tag {
  font: 600 8.5px/1 var(--font-mono); color: var(--color-neutral-600);
  width: 14px; text-align: center; flex-shrink: 0;
}

.stepper {
  display: flex; align-items: center; gap: 3px; flex: 1;
  padding: 3px; border-radius: var(--radius-sm);
  background: var(--color-well); box-shadow: inset 0 0 0 1px var(--color-neutral-900);
  transition: box-shadow .3s ease-out;
}
.stepper.flash { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-accent) 60%, transparent); }
.stepper-tag { width: 13px; text-align: center; font: 500 9px/1 var(--font-mono); color: var(--color-neutral-500); flex-shrink: 0; }
.stepper.foil .stepper-tag { color: var(--color-accent-400); }

.stepper-btn {
  flex-shrink: 0; width: 19px; height: 19px; border-radius: 3px; border: none;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  font: 400 13px/1 var(--font-heading); padding: 0;
  background: var(--color-neutral-900); color: var(--color-neutral-400);
}
.stepper-btn:hover { background: var(--color-neutral-800); color: var(--color-text); }
.stepper-btn.plus { background: color-mix(in srgb, var(--color-accent) 16%, transparent); color: var(--color-accent-300); }
.stepper-btn.plus:hover { background: color-mix(in srgb, var(--color-accent) 30%, transparent); color: var(--color-accent-100); }
.stepper.flash .stepper-btn.plus { background: color-mix(in srgb, var(--color-accent) 45%, transparent); }

.stepper-count {
  flex: 1; min-width: 0; text-align: center; font: 500 11.5px/1 var(--font-mono);
  color: var(--color-neutral-700); background: transparent; border: none; padding: 0;
}
.stepper-count.pos { color: var(--color-text); }
.stepper.foil .stepper-count.pos { color: var(--color-accent-300); }
.stepper.flash .stepper-count { color: var(--color-accent-200); }
.stepper-count-input {
  flex: 1; min-width: 0; width: 100%; text-align: center; font: 500 11.5px/1 var(--font-mono);
  color: var(--color-accent-100); background: var(--color-bg); border: 1px solid var(--color-accent); border-radius: 2px;
}

.tile-footer { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 1px; }
.tile-binder-dots { display: flex; gap: 3px; align-items: center; min-width: 0; }
.tile-binder-dots span.dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.tile-binder-dots .none { font: 400 9px/1 var(--font-heading); color: var(--color-neutral-700); }
.tile-total { font: 500 9.5px/1 var(--font-mono); color: var(--color-neutral-700); flex-shrink: 0; }
.tile-total.pos { color: var(--color-accent-400); }
.tile-price-text { display: none; font: 500 10px/1 var(--font-mono); color: var(--color-accent-300); }

.view-toggle { display: flex; gap: 4px; }

/* ---- collection: list mode ----
   Reuses the exact same .tile elements/data as the grid — only the layout
   is reflowed via CSS, so search/filters/steppers/refresh logic all keep
   working unchanged regardless of which mode is active. */
#app.list-mode .grid { display: flex; flex-direction: column; gap: 4px; }
#app.list-mode .tile { flex-direction: row; align-items: center; gap: var(--space-3); padding: 5px 8px; }
#app.list-mode .tile-art { width: 38px; height: 53px; aspect-ratio: unset; flex-shrink: 0; }
#app.list-mode .tile-art .badge-cost { width: 14px; height: 14px; font-size: 8px; top: 3px; left: 3px; }
#app.list-mode .tile-art .domain-dots { top: 3px; right: 3px; gap: 2px; }
#app.list-mode .tile-art .domain-dots span { width: 5px; height: 5px; }
#app.list-mode .tile-art .badge-price { display: none; }
#app.list-mode .tile-price-text { display: block; width: 62px; text-align: right; flex-shrink: 0; }
#app.list-mode .tile-info { flex: 1 1 240px; min-width: 0; }
#app.list-mode .tile-meta { flex-wrap: nowrap; overflow: hidden; }
#app.list-mode .tile-steppers { flex-direction: row; gap: 8px; flex-shrink: 0; }
#app.list-mode .stepper { flex: 0 0 88px; }
#app.list-mode .tile-footer { flex-direction: row; width: auto; flex-shrink: 0; gap: var(--space-4); }
#app.list-mode .tile-binder-dots { width: 40px; }

@media (max-width: 900px) {
  #app.list-mode .tile { flex-wrap: wrap; }
  #app.list-mode .tile-steppers, #app.list-mode .tile-footer { flex-basis: 100%; justify-content: flex-start; padding-left: 50px; }
}

/* ---- modals (shared) ---- */
.modal-overlay {
  position: fixed; inset: 0; background: color-mix(in srgb, var(--color-neutral-900) 55%, transparent);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: var(--space-4);
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: var(--color-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 420px; max-height: 85vh; display: flex; flex-direction: column;
  padding: var(--space-6); gap: var(--space-4);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-size: 17px; }
.icon-btn { background: transparent; border: none; color: var(--color-neutral-500); font-size: 15px; cursor: pointer; padding: 4px 6px; border-radius: var(--radius-sm); }
.icon-btn:hover { color: var(--color-text); background: color-mix(in srgb, var(--color-text) 8%, transparent); }

/* ---- card detail drawer ---- */
.modal-detail { max-width: 900px; width: 94vw; background: var(--color-page); padding: 0; overflow: hidden; }
.detail-body { display: flex; overflow-y: auto; max-height: 85vh; }
.detail-left {
  width: 280px; flex-shrink: 0; padding: var(--space-8); background: var(--color-rail);
  border-right: 1px solid var(--color-divider); display: flex; flex-direction: column; gap: var(--space-6);
}
.detail-art-wrap { position: relative; aspect-ratio: 5/7; border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-md); background: var(--color-well); }
.detail-art-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-art-wrap .badge-cost { top: 10px; left: 10px; width: 28px; height: 28px; font-size: 15px; }
.detail-art-wrap .domain-dots { top: 12px; right: 12px; }
.detail-art-wrap .domain-dots span { width: 12px; height: 12px; }

.detail-right { flex: 1; min-width: 0; padding: var(--space-8); display: flex; flex-direction: column; gap: var(--space-6); }
.detail-head { display: flex; align-items: flex-start; gap: var(--space-6); }
.detail-kicker { font: 500 10px/1 var(--font-heading); letter-spacing: .14em; text-transform: uppercase; color: var(--color-accent-300); margin-bottom: 8px; }
.detail-title { font-size: 22px; margin-bottom: 6px; }
.detail-subline { font: 400 12px/1 var(--font-heading); color: var(--color-neutral-500); }
.detail-price { margin-top: 4px; font: 500 12px/1 var(--font-mono); color: var(--color-accent-300); }
.detail-price a { color: var(--color-neutral-400); font-family: var(--font-heading); font-weight: 400; }
.detail-price a:hover { color: var(--color-accent-200); }
.detail-actions { margin-left: auto; display: flex; gap: var(--space-2); flex-shrink: 0; }

.rules-panel {
  padding: var(--space-6); border-radius: var(--radius-md); background: var(--color-surface);
  font: 400 12.5px/1.7 var(--font-heading); color: var(--color-neutral-300); white-space: pre-line;
}
.rules-panel:empty { display: none; }

.inventory-block-header { display: flex; align-items: baseline; gap: var(--space-4); margin-bottom: var(--space-4); flex-wrap: wrap; }
.inventory-block-title { font: 600 10px/1 var(--font-heading); letter-spacing: .12em; text-transform: uppercase; color: var(--color-neutral-500); }
.inventory-summary { font: 400 11px/1 var(--font-mono); color: var(--color-neutral-600); }
.inventory-new-binder { margin-left: auto; font: 400 11px/1 var(--font-heading); color: var(--color-accent-300); cursor: pointer; background: none; border: none; padding: 0; }
.inventory-new-binder:hover { text-decoration: underline; }

.inventory-rows { display: flex; flex-direction: column; gap: var(--space-2); }
.inventory-row {
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm);
  background: var(--color-tile-unowned); box-shadow: inset 0 0 0 1px var(--color-neutral-900);
  display: flex; flex-direction: column; gap: var(--space-2);
}
.inventory-row.filled { background: var(--color-surface); }
.inventory-row-head { display: flex; align-items: center; gap: var(--space-3); }
.inventory-row-dot { width: 7px; height: 7px; border-radius: 2px; flex-shrink: 0; background: var(--color-neutral-600); }
.inventory-row-name { flex: 1; min-width: 0; font: 500 12.5px/1.2 var(--font-heading); color: var(--color-neutral-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inventory-row.filled .inventory-row-name { color: var(--color-text); }
.inventory-row-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.inventory-row-move {
  background: transparent; border: 1px solid var(--color-neutral-800); color: var(--color-neutral-500);
  font: 400 10px/1 var(--font-heading); padding: 3px 7px; border-radius: var(--radius-sm); cursor: pointer;
}
.inventory-row-move:hover { border-color: var(--color-accent); color: var(--color-accent-300); }
.inventory-sub-rows { display: flex; flex-direction: column; gap: 3px; padding-left: 15px; }
.inventory-sub-row { display: flex; align-items: center; gap: 6px; }
.inventory-sub-lang { width: 20px; font: 600 9px/1 var(--font-mono); color: var(--color-neutral-600); flex-shrink: 0; }
.inventory-sub-row .stepper { flex: 0 0 100px; }

.inventory-total { display: flex; align-items: center; gap: var(--space-4); margin-top: var(--space-2); padding-top: var(--space-4); border-top: 1px solid var(--color-divider); }
.inventory-total-label { font: 500 12px/1 var(--font-heading); color: var(--color-text); }
.inventory-total-figs { margin-left: auto; display: flex; gap: var(--space-4); }
.inventory-total-figs span { font: 500 13px/1 var(--font-mono); color: var(--color-text); }
.inventory-total-figs .foil { color: var(--color-accent-300); }

/* ---- binder manager ---- */
.binder-list { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; max-height: 45vh; }
.binder-item {
  display: flex; align-items: center; gap: var(--space-3);
  background: var(--color-tile-unowned); box-shadow: inset 0 0 0 1px var(--color-neutral-900);
  border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3);
}
.binder-item .swatch {
  width: 22px; height: 22px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0;
}
.binder-item .name { flex: 1; font: 500 12.5px/1.2 var(--font-heading); color: var(--color-text); }
.binder-item .binder-count { font: 400 11px/1 var(--font-mono); color: var(--color-neutral-500); }
.binder-item .binder-value { font: 500 11px/1 var(--font-mono); color: var(--color-accent-300); }
.binder-item button.binder-delete { background: transparent; border: none; color: var(--color-neutral-600); cursor: pointer; font-size: 13px; padding: 3px 5px; }
.binder-item button.binder-delete:hover { color: #e08a86; }
.binder-empty { color: var(--color-neutral-500); font-size: 12px; text-align: center; padding: 12px 0; }

.binder-form { display: flex; gap: 6px; border-top: 1px solid var(--color-divider); padding-top: var(--space-4); }
.binder-form input[type="color"] { width: 32px; height: 30px; padding: 0; border: 1px solid var(--color-neutral-800); border-radius: var(--radius-sm); background: var(--color-bg); cursor: pointer; }
.binder-form input[type="text"]#binderIcon { width: 40px; text-align: center; }
.binder-form input[type="text"]#binderName { flex: 1; }
.binder-form input {
  background: var(--color-bg); border: 1px solid var(--color-neutral-800); color: var(--color-text);
  border-radius: var(--radius-sm); font: 400 12.5px/1 var(--font-heading); padding: 6px 8px;
}
.binder-form input:focus-visible { border-color: var(--color-accent); }
.binder-form input[type="text"]#deckIcon { width: 40px; text-align: center; }
.binder-form input[type="text"]#deckName { flex: 1; }

.binder-item .type-tag {
  font: 500 9px/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase;
  color: var(--color-accent-300); border: 1px solid color-mix(in srgb, var(--color-accent) 45%, transparent);
  padding: 2px 5px; border-radius: 3px; flex-shrink: 0;
}

/* ---- deck shelf (3b) ---- */
.decks-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: var(--space-6); gap: var(--space-4); }

.deck-gallery {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4);
  margin-top: var(--space-6);
}
@media (max-width: 900px) { .deck-gallery { grid-template-columns: 1fr; } }

.deck-card {
  display: flex; gap: var(--space-4);
  padding: var(--space-4); border-radius: var(--radius-md);
  background: var(--color-surface); box-shadow: inset 0 0 0 1px var(--color-neutral-900);
  cursor: pointer; transition: box-shadow .15s;
}
.deck-card.legal { box-shadow: inset 0 0 0 1px var(--color-accent-800); }
.deck-card:hover { box-shadow: inset 0 0 0 1px var(--color-accent-700); }
.deck-card-thumb {
  width: 52px; aspect-ratio: 5/7; flex-shrink: 0; border-radius: var(--radius-sm);
  background: var(--color-well) center/cover; display: flex; align-items: center; justify-content: center;
  font-size: 20px; overflow: hidden;
}
.deck-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.deck-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.deck-card-title-row { display: flex; align-items: center; gap: 8px; }
.deck-card-name { font: 500 14px/1.2 var(--font-heading); color: var(--color-text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-card-domains { display: flex; gap: 3px; flex-shrink: 0; }
.deck-card-domains span { width: 8px; height: 8px; border-radius: 2px; }
.deck-card-meta { font: 400 10.5px/1 var(--font-mono); color: var(--color-neutral-500); }
.deck-card-bar { height: 3px; border-radius: 2px; background: var(--color-neutral-900); overflow: hidden; }
.deck-card-bar-fill { height: 100%; background: var(--color-neutral-700); }
.deck-card.legal .deck-card-bar-fill { background: var(--color-accent); }
.deck-card-status { font: 400 11px/1 var(--font-heading); color: var(--color-neutral-500); }
.deck-card.legal .deck-card-status { color: var(--color-accent-300); }
.deck-card-value { margin-top: 4px; font: 500 11px/1 var(--font-mono); color: var(--color-accent-300); }
.deck-card-value .of { color: var(--color-neutral-600); font-weight: 400; }
.deck-card-delete {
  align-self: flex-start; background: none; border: none; color: var(--color-neutral-600);
  cursor: pointer; font-size: 12px; padding: 2px 4px; flex-shrink: 0;
}
.deck-card-delete:hover { color: #e08a86; }
.deck-empty { color: var(--color-neutral-500); font-size: 13px; grid-column: 1/-1; padding: 30px 0; text-align: center; }

/* ---- deck builder (full page, 3a) ---- */
#deckBuilderView {
  min-height: calc(100vh - 52px); display: flex; flex-direction: column; gap: var(--space-4);
  padding: var(--space-6) var(--space-8) var(--space-8);
}
.back-link {
  background: none; border: none; cursor: pointer;
  color: var(--color-accent-300); font: 400 12px/1 var(--font-heading); padding: 4px 0;
}
.back-link:hover { color: var(--color-accent-100); text-decoration: underline; }
.db-topline { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.db-topline-actions { display: flex; gap: var(--space-2); }

.deckbuilder-layout {
  display: grid; grid-template-columns: 252px 1fr 312px; gap: var(--space-6);
  align-items: start;
}
@media (max-width: 1200px) { .deckbuilder-layout { grid-template-columns: 1fr; } }

.db-rail, .db-decklist {
  background: var(--color-rail); border-radius: var(--radius-md);
  padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-6);
}

.db-kicker { font: 500 10px/1 var(--font-heading); letter-spacing: .14em; color: var(--color-accent-300); margin-bottom: var(--space-2); }
.db-name-input {
  font: 500 20px/1.2 var(--font-heading); color: var(--color-text); background: transparent;
  border: 1px solid transparent; border-radius: var(--radius-sm); padding: 3px 5px; width: 100%; margin: 0 0 var(--space-2) -5px;
}
.db-name-input:hover { border-color: var(--color-neutral-800); }
.db-name-input:focus-visible { border-color: var(--color-accent); background: var(--color-surface); }
.db-domain-marks { display: flex; align-items: center; gap: 6px; font: 400 12px/1 var(--font-heading); color: var(--color-neutral-400); }
.db-domain-marks span.dot { width: 8px; height: 8px; border-radius: 2px; }

.db-pick {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); background: var(--color-surface);
}
.db-pick img { width: 30px; height: 42px; object-fit: cover; border-radius: 3px; flex-shrink: 0; }
.db-pick-info { flex: 1; min-width: 0; }
.db-pick-role { font: 500 9px/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--color-neutral-500); }
.db-pick-name { font: 500 12.5px/1.3 var(--font-heading); color: var(--color-text); }
.db-pick-domains { display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.db-pick-domains span.dot { width: 7px; height: 7px; border-radius: 2px; }
.db-pick-empty { flex: 1; font: 400 11.5px/1.5 var(--font-heading); color: var(--color-neutral-500); }
.db-pick-change {
  flex-shrink: 0; background: none; border: 1px solid var(--color-neutral-800); color: var(--color-neutral-400);
  font: 400 10.5px/1 var(--font-heading); padding: 5px 8px; border-radius: var(--radius-sm); cursor: pointer;
}
.db-pick-change:hover { border-color: var(--color-accent); color: var(--color-accent-300); }

.db-count-card { background: var(--color-surface); border-radius: var(--radius-md); padding: var(--space-4); }
.db-count-main { display: flex; align-items: baseline; gap: 6px; margin-bottom: var(--space-2); }
.db-count-num { font: 500 24px/1 var(--font-heading); color: var(--color-text); }
.db-count-card.incomplete .db-count-num { color: var(--color-accent-300); }
.db-count-suffix { font: 400 11.5px/1 var(--font-heading); color: var(--color-neutral-500); }
.db-progress { height: 4px; border-radius: 2px; background: var(--color-neutral-900); overflow: hidden; margin-bottom: var(--space-2); }
.db-progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--color-accent-700), var(--color-accent));
  box-shadow: 0 0 10px color-mix(in srgb, var(--color-accent) 55%, transparent);
}
.db-legality-line { display: flex; align-items: center; gap: 6px; font: 400 11px/1 var(--font-heading); color: var(--color-neutral-500); }
.db-legality-line::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--color-neutral-600); flex-shrink: 0; }
.db-legality-line.ok { color: var(--color-accent-400); }
.db-legality-line.ok::before { background: var(--color-accent); }

.db-mini-counts { display: flex; flex-direction: column; gap: var(--space-2); }
.db-mini-count { display: flex; align-items: center; justify-content: space-between; font: 400 12px/1 var(--font-heading); color: var(--color-neutral-400); }
.db-mini-count b { font-family: var(--font-mono); font-weight: 500; color: var(--color-text); }
.db-mini-count.ok b { color: var(--status-green); }

.db-section-title { font: 500 10.5px/1 var(--font-heading); letter-spacing: .08em; text-transform: uppercase; color: var(--color-neutral-400); margin-bottom: var(--space-3); }
.db-curve { display: flex; align-items: flex-end; gap: 5px; height: 88px; }
.db-curve-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.db-curve-count { font: 400 9.5px/1 var(--font-mono); color: var(--color-neutral-600); }
.db-curve-count.pos { color: var(--color-neutral-400); }
.db-curve-bar { width: 100%; border-radius: 2px 2px 0 0; background: var(--color-accent-700); min-height: 3px; }
.db-curve-bar.tallest { background: var(--color-accent); }
.db-curve-label { font: 400 9.5px/1 var(--font-mono); color: var(--color-neutral-600); }

.db-composition { display: flex; flex-direction: column; gap: var(--space-2); }
.db-comp-row { display: flex; align-items: center; gap: var(--space-3); font: 400 11.5px/1 var(--font-heading); color: var(--color-neutral-400); }
.db-comp-label { width: 66px; flex-shrink: 0; }
.db-comp-bar-track { flex: 1; height: 3px; border-radius: 2px; background: var(--color-neutral-900); overflow: hidden; }
.db-comp-bar-fill { height: 100%; background: var(--color-accent-600); }
.db-comp-count { font-family: var(--font-mono); color: var(--color-neutral-500); width: 20px; text-align: right; flex-shrink: 0; }

.db-buildable {
  background: var(--color-tile-unowned); box-shadow: inset 0 0 0 1px var(--color-neutral-900);
  border-radius: var(--radius-md); padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2);
}
.db-buildable-figure { font: 500 13px/1.3 var(--font-heading); color: var(--color-text); }
.db-buildable-line { font: 400 11.5px/1.4 var(--font-heading); color: var(--color-accent-300); }
.db-buildable-line.complete { color: var(--color-neutral-500); }

.db-value { display: flex; flex-direction: column; gap: 4px; }
.db-value-row { display: flex; align-items: center; justify-content: space-between; font: 400 11.5px/1 var(--font-heading); color: var(--color-neutral-400); }
.db-value-row span:last-child { font-family: var(--font-mono); color: var(--color-accent-300); }
.db-value-of { color: var(--color-neutral-600) !important; font-weight: 400; }

.legality-issues {
  list-style: none; margin: 0; padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--status-yellow) 10%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--status-yellow) 35%, transparent);
  font: 400 11px/1.6 var(--font-heading); color: var(--color-neutral-300);
  display: flex; flex-direction: column; gap: 2px; max-height: 120px; overflow-y: auto;
}
.legality-issues li::before { content: "• "; color: var(--status-yellow); }

/* pool */
.db-pool { min-width: 0; display: flex; flex-direction: column; gap: var(--space-4); }
.db-pool-zone { display: flex; align-items: center; gap: var(--space-2); }
.db-pool-zone-label { font: 400 11px/1 var(--font-heading); color: var(--color-neutral-600); }
.db-pool-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.db-pool-toolbar .input { min-height: 32px; padding: 5px 9px; font-size: 12.5px; }
.db-pool-toolbar #dbSearch { flex: 0 1 320px; }
.db-pool-toolbar #dbTypeFilter { width: 150px; }
.db-scope-chips { display: flex; gap: var(--space-2); }
.sort-chip {
  padding: 5px 10px; border-radius: var(--radius-sm); cursor: pointer; border: none;
  font: 400 11.5px/1.2 var(--font-heading); background: transparent; color: var(--color-neutral-600);
}
.sort-chip.active { background: var(--color-neutral-900); color: var(--color-text); }
.db-pool-summary { margin-left: auto; font: 400 11px/1 var(--font-mono); color: var(--color-neutral-600); }

.db-pool-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-4);
}
/* A card only counts as "in the deck" once a physical copy is filed in its
   folder (holdings[deck.id]) — that's the accent ring. Ownership elsewhere
   (art opacity) is shown separately, purely as browsing info. */
.pool-tile.in-deck { background: var(--color-surface); box-shadow: inset 0 0 0 1px var(--color-accent-800); }
.pool-tile.in-deck .tile-art { box-shadow: inset 0 0 0 2px var(--color-accent); }
.pool-tile .tile-art img { opacity: 1; }
.pool-tile.not-owned .tile-art img { opacity: 0.42; }
.ghost-badge {
  position: absolute; left: 6px; bottom: 6px; font: 600 8px/1.2 var(--font-mono);
  padding: 2px 5px; border-radius: 3px; background: var(--color-well);
  box-shadow: inset 0 0 0 1px var(--status-yellow); color: var(--status-yellow);
  letter-spacing: .04em; text-transform: uppercase;
}
.badge-price {
  position: absolute; right: 6px; bottom: 6px; font: 600 9.5px/1.2 var(--font-mono);
  padding: 2px 6px; border-radius: 3px; background: var(--color-well);
  box-shadow: inset 0 0 0 1px var(--color-neutral-700); color: var(--color-neutral-300);
}
.pool-tile.illegal { opacity: 0.4; }
.pool-tile .tile-steppers { gap: 3px; }
.pool-footer { display: flex; align-items: center; justify-content: space-between; padding: 0 1px; font: 400 9.5px/1 var(--font-mono); color: var(--color-neutral-600); }
.pool-footer .need { color: var(--color-accent-400); }
.pool-single-action {
  width: 100%; padding: 5px; border-radius: var(--radius-sm); border: 1px solid var(--color-neutral-800);
  background: transparent; color: var(--color-neutral-300); font: 500 10.5px/1 var(--font-heading); cursor: pointer;
}
.pool-single-action:hover { border-color: var(--color-accent); color: var(--color-accent-200); }
.pool-single-action.active { background: color-mix(in srgb, var(--color-accent) 18%, transparent); border-color: var(--color-accent); color: var(--color-accent-200); }
.pool-champion-toggle {
  position: absolute; bottom: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--color-well); box-shadow: inset 0 0 0 1px var(--color-neutral-700); color: var(--color-neutral-400); font-size: 11px;
}
.pool-champion-toggle:hover { color: var(--status-yellow); box-shadow: inset 0 0 0 1px var(--status-yellow); }
.pool-champion-toggle.is-champion { background: color-mix(in srgb, var(--status-yellow) 25%, transparent); color: var(--status-yellow); box-shadow: inset 0 0 0 1px var(--status-yellow); }

/* decklist */
.db-decklist-header { display: flex; align-items: baseline; justify-content: space-between; font: 600 11px/1 var(--font-heading); letter-spacing: .1em; color: var(--color-neutral-400); flex-shrink: 0; gap: var(--space-2); }
.db-decklist-header #dbDecklistCount { font-family: var(--font-mono); font-weight: 400; letter-spacing: 0; color: var(--color-neutral-500); }
.db-decklist-header.illegal #dbDecklistCount { color: var(--color-accent-300); }
.db-decklist-view-toggle { display: flex; gap: 4px; }
.db-decklist-view-toggle .sort-chip { padding: 3px 8px; font-size: 10.5px; }
.db-decklist-groups { display: flex; flex-direction: column; gap: var(--space-4); overflow-y: auto; }
.db-decklist-group-title {
  display: flex; align-items: baseline; gap: 8px; font: 500 10.5px/1 var(--font-heading); letter-spacing: .08em;
  text-transform: uppercase; color: var(--color-neutral-400); margin-bottom: var(--space-2);
}
.db-decklist-group-title .n { font-family: var(--font-mono); color: var(--color-neutral-600); flex-shrink: 0; }
.db-decklist-group-title .rule { flex: 1; height: 1px; background: var(--color-divider); }
.db-decklist-row {
  display: flex; align-items: center; gap: 6px; padding: 3px 6px; border-radius: 3px;
  border-left: 3px solid transparent;
}
.db-decklist-row.short { background: color-mix(in srgb, var(--status-yellow) 10%, transparent); }
.db-decklist-row.short .db-decklist-row-name { color: var(--color-neutral-300); }
.db-decklist-row button {
  flex-shrink: 0; width: 18px; height: 18px; border-radius: 3px; border: none; cursor: pointer;
  background: var(--color-neutral-900); color: var(--color-neutral-400); font: 400 12px/1 var(--font-heading);
}
.db-decklist-row button:hover { background: var(--color-neutral-800); color: var(--color-text); }
.db-decklist-row-qty { width: 18px; text-align: center; font: 500 11.5px/1 var(--font-mono); color: var(--color-neutral-400); flex-shrink: 0; }
.db-decklist-row-dot { width: 6px; height: 6px; border-radius: 2px; flex-shrink: 0; }
.db-decklist-row-name { flex: 1; min-width: 0; font: 400 12px/1.3 var(--font-heading); color: var(--color-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-decklist-shortfall { font: 500 10px/1 var(--font-mono); color: var(--status-yellow); flex-shrink: 0; }

.db-decklist-row-thumb { width: 32px; height: 44px; border-radius: 4px; object-fit: cover; flex-shrink: 0; }
.db-decklist-row[data-row-card], .db-decklist-single-row[data-row-card] { cursor: pointer; }
/* filter, not background: every row now carries an inline ownership-status
   background (see ownershipGradientStyle), which an external stylesheet
   background rule could never win against on hover. */
.db-decklist-row[data-row-card]:hover, .db-decklist-single-row[data-row-card]:hover { filter: brightness(1.35); }
.db-decklist-owned-flag {
  flex-shrink: 0; margin-left: auto; padding-left: 6px; font: 500 9.5px/1 var(--font-mono);
  color: var(--color-neutral-600); white-space: nowrap;
  max-width: 92px; overflow: hidden; text-overflow: ellipsis;
}
.db-decklist-owned-flag.pos { color: var(--color-accent-300); }
.db-decklist-group-title.sideboard { opacity: .85; }
.db-decklist-single-row { display: flex; align-items: center; gap: 8px; padding: 3px 2px; border-radius: 3px; }
.db-decklist-single-row .db-decklist-row-name { font-weight: 500; }
.db-decklist-single-row button { width: 18px; height: 18px; border-radius: 3px; border: none; background: var(--color-neutral-900); color: var(--color-neutral-400); cursor: pointer; }
.db-decklist-single-row button:hover { color: #e08a86; }
.db-decklist-empty { font: 400 11px/1 var(--font-heading); color: var(--color-neutral-600); padding: var(--space-2) 0; }
.db-decklist-actions { display: flex; flex-direction: column; gap: var(--space-2); flex-shrink: 0; margin-top: auto; padding-top: var(--space-4); border-top: 1px solid var(--color-divider); }

/* ---- scanner ---- */
.scan-view {
  max-width: 480px; margin: 0 auto; padding: var(--space-8) var(--space-6);
  display: flex; flex-direction: column; gap: var(--space-4); align-items: stretch;
}
.scan-hint { font: 400 12.5px/1.5 var(--font-heading); color: var(--color-neutral-500); margin: 0; }
.scan-capture-btn {
  display: flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: var(--space-6); border-radius: var(--radius-lg); cursor: pointer;
  background: var(--color-surface); box-shadow: inset 0 0 0 1px var(--color-accent-800);
  font: 500 15px/1 var(--font-heading); color: var(--color-text);
  transition: box-shadow .16s ease-out, background .16s ease-out;
}
.scan-capture-btn:hover { box-shadow: inset 0 0 0 1px var(--color-accent); background: color-mix(in srgb, var(--color-accent) 10%, var(--color-surface)); }
.scan-status { text-align: center; font: 400 12.5px/1 var(--font-heading); color: var(--color-accent-300); }

.scan-result-card {
  display: flex; flex-direction: column; gap: var(--space-4);
  padding: var(--space-4); border-radius: var(--radius-md);
  background: var(--color-tile-unowned); box-shadow: inset 0 0 0 1px var(--color-neutral-900);
}
.scan-result-card img { width: 96px; border-radius: var(--radius-sm); float: left; margin-right: var(--space-4); }
.scan-result-info { overflow: hidden; }
.scan-result-name { font: 500 15px/1.3 var(--font-heading); color: var(--color-text); }
.scan-result-meta { margin-top: 3px; font: 400 11px/1.3 var(--font-mono); color: var(--color-neutral-500); }
.scan-result-steppers { clear: both; display: flex; flex-direction: column; gap: 4px; }
.scan-result-steppers .stepper { max-width: 220px; }

.scan-fallback {
  padding: var(--space-4); border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--status-yellow) 8%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--status-yellow) 30%, transparent);
  font: 400 12.5px/1.4 var(--font-heading); color: var(--color-neutral-300);
}
.scan-fallback-text { font: 400 11.5px/1.4 var(--font-mono); color: var(--color-neutral-400); word-break: break-word; margin-bottom: var(--space-3); }
.scan-fallback-options { display: flex; flex-direction: column; gap: 4px; margin-bottom: var(--space-3); }
.scan-fallback-option {
  text-align: left; padding: 6px 8px; border-radius: var(--radius-sm); border: none; cursor: pointer;
  background: var(--color-neutral-900); color: var(--color-text); font: 400 12px/1.3 var(--font-heading);
}
.scan-fallback-option:hover { background: var(--color-neutral-800); }

/* ---- toast ---- */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--color-surface); border: 1px solid var(--color-accent); color: var(--color-text);
  padding: 8px 16px; border-radius: var(--radius-md); font: 400 12.5px/1 var(--font-heading);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; height: auto; padding: var(--space-3) var(--space-6); gap: var(--space-3); }
  .topbar-search { order: 3; max-width: none; flex-basis: 100%; }
  .filters-bar { position: static; }
  .detail-body { flex-direction: column; max-height: none; }
  .detail-left { width: auto; border-right: none; border-bottom: 1px solid var(--color-divider); }
}
