@import url('/static/fonts.css');

:root {
  /* ── Redesign: cool near-black surfaces + refined gold ── */
  /* Surfaces (layered) */
  --bg:            #0a0c11;
  --surface-0:     #0e1117;
  --surface-1:     #141823;
  --surface-2:     #1b2030;
  --surface-3:     #232a3c;
  --line:          #262d3d;
  --line-soft:     #1c2230;

  /* Semantic surface aliases (existing names → new palette) */
  --panel:         #141823;
  --panel-hover:   #1b2030;
  --border:        #262d3d;
  --border-hover:  #38415a;

  /* Text */
  --text:          #eef1f7;
  --text-2:        #aeb7c8;
  --muted:         #6f7a90;
  --faint:         #3a4254;

  /* Brand — refined gold (replaces the old purple accent) */
  --gold:          #f2c14e;
  --gold-deep:     #d9a637;
  --gold-soft:     #3a2f12;
  --accent:        #f2c14e;
  --accent-dim:    #d9a637;
  --accent-glow:   rgba(242,193,78,0.20);
  --accent-subtle: rgba(242,193,78,0.08);

  /* TradeupSpy filter controls: cool-slate translucent border, transparent fill */
  --filter-border:       rgba(101,136,156,0.22);
  --filter-border-hover: rgba(101,136,156,0.42);
  --filter-fill:         rgba(101,136,156,0.06);

  /* Verdict */
  --green:         #34d99b;
  --green-glow:    rgba(52,217,155,0.14);
  --red:           #ff6b6b;
  --red-glow:      rgba(255,107,107,0.13);

  /* Rarity (CS2 tiers) */
  --r-consumer:    #b0b6c4;
  --r-industrial:  #6aa0d8;
  --r-milspec:     #4b69ff;
  --r-restricted:  #8847ff;
  --r-classified:  #d32ee6;
  --r-covert:      #eb4b4b;
  --r-contraband:  #e4ae39;
  --r-gold:        #ffd06b;

  --shadow-sm:     0 2px 8px rgba(0,0,0,0.45);
  --shadow-md:     0 8px 24px -12px rgba(0,0,0,0.7);
  --shadow-lg:     0 24px 60px -20px rgba(0,0,0,0.8);
  --radius-sm:     6px;
  --radius-md:     10px;
  --radius-lg:     14px;
  --transition:    0.15s ease;

  --font-ui:       "Archivo", "Segoe UI", system-ui, sans-serif;
  --font-num:      "IBM Plex Mono", ui-monospace, monospace;

  /* Aliases used by skin_detail.html */
  --text-dim:      #6f7a90;   /* same as --muted */
  --surface:       #0e1117;   /* darkest layered surface */
}

/* Light theme (toggle in the header; persisted in localStorage) */
html[data-theme="light"] {
  --bg:            #f4f3f9;
  --panel:         #ffffff;
  --panel-hover:   #f0edf8;
  --border:        #e4e1ef;
  --border-hover:  #d2cce6;
  --text:          #1b1828;
  --text-2:        #45506a;
  --muted:         #71708f;
  --accent:        #c08a1e;
  --accent-dim:    #a8761a;
  --gold:          #c08a1e;
  --gold-deep:     #a8761a;
  --accent-glow:   rgba(192,138,30,0.18);
  --accent-subtle: rgba(192,138,30,0.09);
  --filter-border:       rgba(70,100,120,0.32);
  --filter-border-hover: rgba(70,100,120,0.55);
  --filter-fill:         rgba(70,100,120,0.05);
  --green:         #119a6a;
  --green-glow:    rgba(17,154,106,0.12);
  --red:           #dc4646;
  --red-glow:      rgba(220,70,70,0.10);
  --shadow-sm:     0 2px 8px rgba(20,16,40,0.08);
  --shadow-md:     0 4px 20px rgba(20,16,40,0.12);
  --shadow-lg:     0 8px 40px rgba(20,16,40,0.16);
  --text-dim:      #71708f;
  --surface:       #ffffff;
  --surface-0:     #f4f3f9;
  --surface-1:     #ffffff;
  --surface-2:     #f0edf8;
  --surface-3:     #e7e3f1;
  --line:          #e4e1ef;
  --line-soft:     #eeebf6;
}
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: #cfc9e6; }

* { box-sizing: border-box; margin: 0; padding: 0; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

body {
  font-family: var(--font-ui);
  /* Subtle gold "spotlight" depth behind the top of every page, fading into the
     near-black surface — premium ambience without washing out content. */
  background: radial-gradient(940px 520px at 50% -140px, rgba(242,193,78,0.06), transparent 70%), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* Light theme: drop the glow (gold-on-light reads muddy) — flat surface only. */
html[data-theme="light"] body { background: var(--bg); }
::selection { background: rgba(242,193,78,0.26); color: #0a0c11; }

/* Numeric / data text uses the mono face (prices, ROI, stats). */
.num, .v, .stat-value, .price, .roi { font-family: var(--font-num); font-feature-settings: "tnum" 1; letter-spacing: -0.02em; }

/* ── Header ── */
header {
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(12,14,19,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 200;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.header-logo-icon {
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  flex-shrink: 0;
  box-shadow: 0 0 16px var(--accent-glow);
}
.header-logo-text { display: flex; flex-direction: column; }
.header-logo-title { font-size: 0.92rem; font-weight: 700; color: var(--text); letter-spacing: -0.01em; line-height: 1; }
.header-logo-sub { font-size: 0.62rem; color: var(--muted); margin-top: 2px; line-height: 1; }

.badge-live {
  font-size: 0.62rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 99px;
  border: 1px solid rgba(242,193,78,0.3);
  background: rgba(242,193,78,0.08);
  color: var(--accent);
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

/* Mobile filter toggle */
.filter-toggle {
  display: none;
  align-items: center;
  gap: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 7px 13px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color var(--transition);
}
.filter-toggle:hover { border-color: var(--border-hover); }
.filter-toggle svg { width: 15px; height: 15px; stroke: var(--muted); }

/* ── Drawer overlay ── */
.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 149;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.drawer-overlay.visible { display: block; }

/* ── Layout ── */
.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - 56px);
}
/* Collapsed (filters hidden) on desktop — content takes the full width */
.layout.sidebar-hidden { grid-template-columns: 1fr; }
.layout.sidebar-hidden > aside { display: none; }

aside {
  border-right: 1px solid var(--border);
  padding: 0 14px 80px;
  background: var(--panel);
  overflow-y: auto;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
}

/* Centred content column */
main { padding: 20px 24px; overflow-y: auto; width: 100%; max-width: 1200px; margin-inline: auto; }

/* The filter toggle is available on desktop too (collapses the sidebar) */
.filter-toggle { display: flex; }

/* ── Sidebar sections ── */
.section {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.section:last-of-type { border-bottom: none; }

.section-title {
  font-size: 0.64rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text);
  margin-bottom: 12px;
  text-align: center;
}

/* ── Form controls ── */
label {
  display: block;
  font-size: 0.64rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
  margin-bottom: 6px;
  margin-top: 12px;
  text-align: center;
}
label:first-child { margin-top: 0; }
/* Inline toggle/checkbox labels opt out of the centered field-label styling */
.toggle-pill, .source-row label, .st-label, .arb-toggle, .arb-mkt-opt {
  margin-top: 0;
  margin-bottom: 0;
  text-align: left;
}

input, select {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--filter-border);
  background: var(--filter-fill);
  color: var(--text);
  font-size: 0.82rem;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  outline: none;
}
input:hover, select:hover { border-color: var(--filter-border-hover); }
input:focus, select:focus {
  border-color: var(--accent);
  background: var(--surface-1);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
input::placeholder { color: var(--muted); font-style: italic; }

/* TradeupSpy-style custom dropdown caret on filter selects */
aside select,
.filter-row select,
.section select,
.picker-filterbar select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236f7a90' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  cursor: pointer;
}

/* Native checkboxes / radios pick up the gold accent (was the browser default). */
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--accent); }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.row2 label { margin-top: 0; }

/* ── Toggle pill ── */
.toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
}
.toggle-pill input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-pill .track {
  width: 36px; height: 20px;
  background: var(--border);
  border-radius: 10px;
  position: relative;
  transition: background var(--transition), box-shadow var(--transition);
  border: 1px solid var(--border-hover);
  flex-shrink: 0;
}
.toggle-pill input:checked + .track {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}
.toggle-pill .thumb {
  position: absolute;
  width: 12px; height: 12px;
  background: var(--muted);
  border-radius: 50%;
  top: 3px; left: 3px;
  transition: transform var(--transition), background var(--transition);
}
.toggle-pill input:checked + .track .thumb {
  transform: translateX(16px);
  background: #fff;
}

/* ── Source rows ── */
.source-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 0.8rem;
}
.source-name { flex: 1; }
.hint {
  font-size: 0.63rem;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 4px;
}

/* ── Segmented control (pricing source) ── */
.seg {
  display: flex;
  gap: 4px;
  background: var(--filter-fill);
  border: 1px solid var(--filter-border);
  border-radius: var(--radius-md);
  padding: 4px;
}
.seg button {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 6px 6px;
  border-radius: calc(var(--radius-md) - 3px);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.seg button:hover { color: var(--text); background: rgba(101,136,156,0.12); }
.seg button.active {
  background: var(--accent);
  color: #14110a;
  box-shadow: 0 0 10px var(--accent-glow);
}
.seg button.active:hover { background: var(--accent); color: #14110a; }
.seg button.active.custom {
  background: var(--accent-subtle);
  color: var(--accent);
  box-shadow: none;
}

.adv-toggle {
  margin-top: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  transition: color var(--transition);
}
.adv-toggle:hover { color: var(--text); }
.adv-toggle .chev { display: inline-block; transition: transform 0.2s; }
.adv-toggle.open .chev { transform: rotate(90deg); }

/* Per-row pricing source badge */
.src-badge {
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 4px;
  margin-left: 4px;
  vertical-align: middle;
}
.src-badge.missing { color: var(--red); border-color: var(--red); opacity: 0.8; }

/* ── Hero section ── */
.hero-section {
  margin-bottom: 24px;
}
.hero-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}
.hero-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.hero-subtitle {
  font-size: 0.72rem;
  color: var(--muted);
}
.hero-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.hero-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition), transform 0.1s;
}
.hero-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0.7;
}
.hero-card.hero-profit { border-left: 3px solid var(--green); }
.hero-card.hero-loss   { border-left: 3px solid var(--red); }
.hero-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-glow), 0 4px 24px rgba(0,0,0,0.5);
  transform: translateY(-2px);
}
.hero-card-name {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hero-card-meta {
  font-size: 0.64rem;
  color: var(--muted);
  margin-bottom: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hero-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}
.hero-metric-label {
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 2px;
}
.hero-metric-value {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}
.hero-metric-value.positive { color: var(--green); }
.hero-metric-value.negative { color: var(--red); }
.hero-rank {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-subtle);
  border: 1px solid var(--accent-glow);
  color: var(--accent);
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Stats bar ── */
.stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  transition: border-color var(--transition);
}
.stat:hover { border-color: var(--border-hover); }
.stat .k { font-size: 0.56rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; }
.stat .v { font-size: 1.1rem; font-weight: 700; margin-top: 3px; letter-spacing: -0.01em; }

/* ── Section divider ── */
.results-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.results-section-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}
.results-divider {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Status bar ── */
.status {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--panel);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  margin-bottom: 10px;
  color: var(--muted);
}

/* ── Progress bar ── */
.progress-wrap { margin-bottom: 14px; }
.progress-track {
  height: 3px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), #c084fc);
  transition: width 0.35s ease;
  box-shadow: 0 0 8px var(--accent-glow);
}
.progress-fill.indeterminate {
  width: 30%;
  animation: progress-slide 1.5s ease-in-out infinite;
}
@keyframes progress-slide {
  0%   { margin-left: 0%;   width: 30%; }
  50%  { margin-left: 60%;  width: 30%; }
  100% { margin-left: 0%;   width: 30%; }
}
.progress-label {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 5px;
  text-align: right;
}

/* ── Result cards ── */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 5px;
  overflow: hidden;
  border-left: 3px solid var(--border);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.card.profit { border-left-color: var(--green); }
.card.loss   { border-left-color: var(--red); }
.card:hover  { border-color: var(--border-hover); }
.card.highlighted {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-glow);
}

.card-head {
  padding: 11px 14px;
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  transition: background var(--transition);
}
.card-head:hover   { background: var(--panel-hover); }
.card.open .card-head { background: var(--panel-hover); }

.card-title { font-weight: 600; font-size: 0.88rem; letter-spacing: -0.01em; }
.card-meta  { font-size: 0.66rem; color: var(--muted); margin-top: 2px; }

.metrics {
  display: flex;
  gap: 12px;
  font-size: 0.82rem;
  text-align: right;
  flex-shrink: 0;
  align-items: center;
}
.metrics > div { display: flex; flex-direction: column; }
.metrics span { display: block; font-size: 0.56rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

/* When a card is expanded the metrics move into the divider bar below, so hide
   the duplicate set in the header. */
.card.open .card-head .metrics { display: none; }

.card-body {
  display: none;
  grid-template-columns: 1fr;          /* Inputs section above, Outputs below */
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  font-size: 0.78rem;
}
.card.open .card-body { display: grid; }

/* Metrics bar acts as a clear border between the Inputs and Outputs sections */
.metrics-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 32px;
  margin: 2px -14px;                    /* span the full card width */
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  font-size: 0.92rem;
  font-weight: 600;
}
.metrics-bar > div { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.metrics-bar span { font-size: 0.54rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }

/* Per-contract risk / outcome strip */
.risk-strip { margin: -4px 0 2px; }
.risk-stats {
  display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center;
  font-size: 0.7rem; color: var(--muted); margin-bottom: 5px;
}
.risk-win { font-weight: 700; }
.risk-win.good { color: var(--green); }
.risk-win.mid { color: #e0a23a; }
.risk-win.bad { color: var(--red); }
.risk-bar {
  display: flex; height: 7px; border-radius: 4px; overflow: hidden;
  background: #0d0b14; border: 1px solid var(--border);
}
.risk-seg { height: 100%; min-width: 1px; }
.risk-seg.win  { background: var(--green); }
.risk-seg.lose { background: var(--red); }
.risk-seg + .risk-seg { box-shadow: -1px 0 0 rgba(0,0,0,0.25); }

/* Section header (Inputs / Outputs) */
.sk-section-head {
  font-weight: 600;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.sk-count {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text);
  background: var(--panel-hover);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 7px;
}

/* Items laid out next to each other in a responsive grid of tiles */
.sk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

/* ── Skin tile (reference card style) ───────────────────────────────────── */
.tile {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition);
}
.tile:hover { border-color: var(--accent); transform: translateY(-1px); }

.tile-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
  padding: 8px 10px 5px;
}
.tile-name { display: flex; flex-direction: column; line-height: 1.18; min-width: 0; }
.tile-weapon { font-weight: 700; font-size: 0.82rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-finish { font-size: 0.72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-corner { font-size: 0.72rem; font-weight: 700; color: var(--muted); flex-shrink: 0; padding-top: 1px; }
.tile-corner.prob { color: var(--accent); }

.tile-img-wrap {
  position: relative;
  padding: 6px 10px;
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tile-img, .tile-img-ph {
  width: 100%;
  height: 92px;
  object-fit: contain;
}
.tile-img-ph { background: #050409; border-radius: 6px; }

.tile-badge {
  position: absolute;
  top: 2px;
  left: 10px;
  font-size: 0.54rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 3px;
  z-index: 1;
}
.tile-badge.st { background: #b85c00; color: #fff; }
.tile-badge.sv { background: #c97f00; color: #1a1206; }

.tile-mkts {
  position: absolute;
  top: 2px;
  right: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 1;
}
.tile-mkt {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 8, 18, 0.72);
  border: 1.5px solid transparent;
  overflow: hidden;
  transition: transform var(--transition), border-color var(--transition);
}
.tile-mkt:hover { transform: scale(1.12); }
.tile-mkt.cheapest { border-color: var(--green); }
.tile-mkt.steam { border-color: #4a90d9; }
.tile-mkt-logo { width: 15px; height: 15px; object-fit: contain; }
.tile-mkt .cmkt-abbr { font-size: 0.5rem; font-weight: 700; color: var(--text); }

.tile-watch {
  position: absolute; top: 2px; left: 50%; transform: translateX(-50%);
  width: 24px; height: 22px; padding: 0; z-index: 2;
  background: rgba(10,8,18,0.6); border: 1px solid var(--border); border-radius: 5px;
  color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity var(--transition), color var(--transition), border-color var(--transition);
}
.tile:hover .tile-watch { opacity: 1; }
.tile-watch svg { width: 13px; height: 13px; }
.tile-watch:hover { color: var(--text); border-color: var(--accent); }
.tile-watch.on { opacity: 1; color: #e0a23a; border-color: #e0a23a; }
.tile-watch.on svg { fill: #e0a23a; }

.tile-float {
  position: absolute;
  bottom: 4px;
  right: 8px;
  font-size: 0.6rem;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.45);
  padding: 1px 5px;
  border-radius: 3px;
}

.tile-foot {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 10px 9px;
  text-decoration: none;
  background: linear-gradient(180deg, rgba(124, 77, 255, 0.10), rgba(124, 77, 255, 0.24));
  border-top: 1px solid var(--border);
}
.tile-wear { font-size: 0.64rem; color: var(--muted); display: flex; align-items: center; }
.tile-price { font-size: 0.98rem; font-weight: 700; color: var(--text); }
.tile-foot:hover .tile-price { color: var(--accent); }

.sk-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  border-bottom: 1px solid #0d0b14;
  gap: 8px;
}
.sk-row span:last-child { color: var(--muted); white-space: nowrap; }

.sk-row-img {
  align-items: center;
  padding: 5px 0;
  gap: 10px;
  justify-content: flex-start;
}

/* Tile styling for grid items */
.sk-grid .sk-row-img {
  align-items: flex-start;
  padding: 8px;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  transition: border-color var(--transition);
}
.sk-grid .sk-row-img:hover { border-color: var(--border-hover, #2a2638); }
.skin-thumb {
  width: 54px;
  height: 40px;
  object-fit: contain;
  border-radius: 5px;
  background: #050409;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.skin-thumb-placeholder {
  width: 54px;
  height: 40px;
  background: #050409;
  border-radius: 5px;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.sk-info { flex: 1; min-width: 0; }
.sk-name-row {
  font-size: 0.77rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sk-sub { font-size: 0.67rem; color: var(--muted); margin-top: 2px; }

/* Inside grid tiles the name has less width — let it wrap instead of truncating */
.sk-grid .sk-name-row {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.25;
}

.buy-link { color: var(--text); text-decoration: none; transition: color var(--transition); }
.buy-link:hover { color: var(--accent); }

.output-price-link {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px dotted var(--border);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}
.output-price-link:hover { color: var(--accent); border-bottom-color: var(--accent); }

.src-badge, .buy-badge {
  display: inline-block;
  font-size: 0.55rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  background: #110f1e;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.03em;
  margin-left: 3px;
  vertical-align: middle;
  transition: background var(--transition), color var(--transition);
}
.buy-badge:hover { background: var(--accent); color: #fff; }

/* ── Currency selector (header) ── */
.currency-select {
  width: auto;            /* override the global input,select { width:100% } */
  flex-shrink: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-size: 0.78rem;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition);
}
.currency-select:focus { border-color: var(--accent); }

/* ── Bigger skin image + market strip on contract rows ── */
.sk-row-img .skin-thumb,
.sk-row-img .skin-thumb-placeholder { width: 90px; height: 68px; }

.cmkt-strip {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.cmkt {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.04);
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 2px 7px 2px 3px;
  text-decoration: none;
  cursor: pointer;
  transition: border-color var(--transition), transform 0.1s;
}
.cmkt:hover { border-color: var(--accent); transform: translateY(-1px); }

/* Liquidity dot (availability: green = many listings, red = few) */
.liq-dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.3);
}

/* Top Picks rendered as detailed cards */
.hero-cards.detailed { display: flex; flex-direction: column; gap: 10px; }
.hero-rank-inline {
  display: inline-block;
  font-size: 0.7rem; font-weight: 800;
  color: var(--accent);
  background: var(--accent-subtle);
  border: 1px solid rgba(242,193,78,0.3);
  border-radius: 5px;
  padding: 0 6px;
  margin-right: 4px;
  vertical-align: middle;
}
.cmkt.steam    { border-color: rgba(96,165,250,0.35); background: rgba(96,165,250,0.07); }
.cmkt.cheapest { border-color: rgba(34,197,94,0.35);  background: rgba(34,197,94,0.07); }
.cmkt-logo {
  width: 18px; height: 18px;
  object-fit: contain; border-radius: 3px;
  background: rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.cmkt-abbr {
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.5rem; font-weight: 700; color: var(--muted);
  background: #110f1e; border-radius: 3px; flex-shrink: 0;
}
.cmkt-price { font-size: 0.72rem; font-weight: 700; color: var(--text); white-space: nowrap; }
.cmkt.steam    .cmkt-price { color: #60a5fa; }
.cmkt.cheapest .cmkt-price { color: #22c55e; }

/* ── Pagination ── */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 24px 0 8px;
  flex-wrap: wrap;
}
.pager button {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 6px 11px;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.pager button:hover:not(:disabled) { border-color: var(--accent); background: var(--panel-hover); }
.pager button:disabled { opacity: 0.4; cursor: default; }
.pager button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pager .pager-info { color: var(--muted); font-size: 0.75rem; margin: 0 8px; }

.tag-st {
  font-size: 0.6rem;
  font-weight: 600;
  background: rgba(242,193,78,0.1);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 5px;
  border: 1px solid rgba(242,193,78,0.25);
}
.tag-feasible {
  font-size: 0.58rem; font-weight: 600;
  background: rgba(74,222,128,0.1); color: var(--green);
  padding: 1px 6px; border-radius: 3px; margin-left: 6px;
  border: 1px solid rgba(74,222,128,0.2);
}
.tag-infeasible {
  font-size: 0.58rem; font-weight: 600;
  background: rgba(248,113,113,0.1); color: var(--red);
  padding: 1px 6px; border-radius: 3px; margin-left: 6px;
  border: 1px solid rgba(248,113,113,0.2);
}
.tag-suspicious {
  font-size: 0.58rem;
  font-weight: 600;
  background: rgba(251,191,36,0.1);
  color: #f59e0b;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 6px;
  border: 1px solid rgba(251,191,36,0.25);
  cursor: default;
}
.avail-tag {
  font-size: 0.63rem; padding: 1px 5px; border-radius: 3px;
  margin-left: 5px; font-weight: 600;
}
.avail-ok  { background: rgba(74,222,128,0.1);  color: var(--green); border: 1px solid rgba(74,222,128,0.2); }
.avail-low { background: rgba(248,113,113,0.1); color: var(--red);   border: 1px solid rgba(248,113,113,0.2); }

/* "+N similar" on a Top Pick — variants of the same trade collapsed below */
.tag-similar {
  font-size: 0.58rem; font-weight: 600;
  background: var(--panel-hover); color: var(--muted);
  padding: 1px 6px; border-radius: 3px; margin-left: 6px;
  border: 1px solid var(--border); cursor: default;
}

/* ── Contract card actions (★ Save / ✎ Log run) ── */
.card-acts { display: flex; gap: 6px; flex-shrink: 0; }
.card-act-btn {
  background: none; border: 1px solid var(--border); color: var(--muted);
  border-radius: 5px; padding: 3px 8px; cursor: pointer;
  font-size: 0.7rem; font-family: inherit; white-space: nowrap; flex-shrink: 0;
  text-decoration: none; line-height: 1.5;
  transition: border-color var(--transition), color var(--transition);
}
.card-act-btn:hover { border-color: var(--accent); color: var(--text); }

/* Collection set icon shown next to a contract card's title. */
.collection-icon {
  width: 17px; height: 17px; object-fit: contain; vertical-align: -3px;
  margin-right: 5px; border-radius: 3px;
}

/* Save / Log-run inside the expanded trade-up body — larger, easy-to-hit copies
   of the compact header actions, revealed when a card is opened. */
.card-body-acts { display: flex; gap: 8px; margin-top: 12px; }
.card-body-acts .card-act-btn {
  flex: 1; text-align: center; padding: 8px 12px; font-size: 0.8rem;
}
.card-body-acts .save-contract-btn,
.card-body-acts .save-contract-auth {
  background: var(--accent-subtle, rgba(242,193,78,0.12));
  border-color: rgba(242,193,78,0.4); color: var(--accent);
}

/* ── Shopping list (consolidated buy list on a contract card) ── */
.shoplist-toggle {
  margin-left: auto; background: none; border: 1px solid var(--border);
  color: var(--muted); border-radius: 5px; padding: 2px 8px; cursor: pointer;
  font-size: 0.66rem; font-family: inherit;
  transition: border-color var(--transition), color var(--transition);
}
.shoplist-toggle:hover { border-color: var(--accent); color: var(--text); }
.shoplist {
  margin: 8px 0 10px; padding: 10px 12px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.74rem;
}
.shop-row { display: flex; gap: 8px; align-items: baseline; padding: 3px 0; flex-wrap: wrap; }
.shop-qty { font-family: var(--font-num); font-weight: 700; color: var(--accent); flex-shrink: 0; }
.shop-name { color: var(--text); }
.shop-wear { color: var(--muted); }
.shop-float { font-family: var(--font-num); font-size: 0.68rem; color: var(--muted); }
.shop-price { margin-left: auto; font-family: var(--font-num); color: var(--text-2); white-space: nowrap; }
.shop-foot {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  border-top: 1px solid var(--border); margin-top: 8px; padding-top: 8px;
}
.shop-note { font-size: 0.66rem; color: var(--muted); flex: 1; min-width: 180px; }
.shop-total { font-family: var(--font-num); font-weight: 700; color: var(--text); }
.shop-copy {
  background: var(--accent-subtle); border: 1px solid rgba(242,193,78,0.4); color: var(--accent);
  border-radius: 5px; padding: 4px 10px; cursor: pointer; font-size: 0.7rem; font-family: inherit;
}
.shop-copy:hover { border-color: var(--accent); }

/* ── Pinned contract (handoff from inventory / home cards) ── */
.pinned-section { margin-bottom: 22px; }
.pinned-section .hero-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pin-dismiss {
  background: none; border: 1px solid var(--border); color: var(--muted);
  border-radius: var(--radius-sm); padding: 5px 11px; cursor: pointer; font-size: 0.74rem;
  font-family: inherit; flex-shrink: 0;
}
.pin-dismiss:hover { border-color: var(--red); color: var(--red); }

.empty { color: var(--muted); text-align: center; padding: 48px 20px; font-size: 0.88rem; }

/* ── Tooltip ── */
.tooltip-box {
  position: fixed;
  background: #1a1727;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.72rem;
  color: var(--text);
  line-height: 1.55;
  max-width: 260px;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s;
  box-shadow: var(--shadow-md);
}

/* ── Header nav ── */
.header-nav { display: flex; gap: 4px; margin-left: auto; }
.header-nav a {
  color: var(--muted);
  font-size: 0.78rem;
  text-decoration: none;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.header-nav a:hover { border-color: var(--border); color: var(--text); background: var(--panel-hover); }
.header-nav a.active { color: var(--accent); border-color: rgba(242,193,78,0.3); background: var(--accent-subtle); }

/* ── Mobile nav (burger + slide-down menu) ── */
.nav-burger {
  display: none;
  align-items: center; justify-content: center;
  width: 34px; height: 34px; background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--muted); cursor: pointer; flex-shrink: 0;
  transition: border-color var(--transition), color var(--transition);
}
.nav-burger:hover { border-color: var(--accent); color: var(--text); }
.nav-burger svg { width: 17px; height: 17px; }

.mobile-menu-backdrop {
  display: none;
  position: fixed; inset: 0; z-index: 194;
  background: rgba(0,0,0,0.45);
}
.mobile-menu-backdrop.visible { display: block; }

.mobile-menu {
  display: none;
  position: fixed; top: 56px; left: 0; right: 0; z-index: 195;
  flex-direction: column; gap: 2px;
  padding: 10px 14px 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 18px 40px rgba(0,0,0,0.55);
  max-height: calc(100dvh - 56px); overflow-y: auto;
  opacity: 0; transform: translateY(-8px); pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.mobile-menu.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.mobile-menu a {
  color: var(--text); text-decoration: none;
  font-size: 0.9rem; font-weight: 600;
  padding: 11px 12px; border-radius: var(--radius-sm);
  border: 1px solid transparent;
}
.mobile-menu a:hover { background: var(--panel-hover); }
.mobile-menu a.active { color: var(--accent); background: var(--accent-subtle); border-color: rgba(242,193,78,0.3); }
.mobile-menu-divider { height: 1px; background: var(--border); margin: 8px 0; }
.mobile-menu-currency {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 4px 12px 2px; color: var(--muted); font-size: 0.78rem; font-weight: 600;
}

/* The header never wraps, so trim it as space runs out instead of clipping. */
@media (max-width: 1280px) {
  .header-nav a { padding: 5px 9px; }
  .header-logo-sub { display: none; }
  header .badge-live { display: none; }
}
/* Below ~1140px the full link row can't fit (the finder header is the widest) —
   switch to the burger menu. */
@media (max-width: 1140px) {
  .header-nav { display: none; }
  .nav-burger { display: flex; }
  .mobile-menu { display: flex; }
}

/* ── Header right / user area ── */
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.user-area { position: relative; }

/* Round account button: silhouette placeholder signed out, Steam avatar signed
   in. The dropdown hangs off .user-area (position: relative). */
.user-round-btn {
  position: relative;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0; flex-shrink: 0;
  transition: border-color var(--transition), color var(--transition);
}
.user-round-btn:hover { border-color: var(--accent); color: var(--text); }
.user-avatar-ph { width: 17px; height: 17px; }

.user-avatar {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* Tracked-contract alert count, pinned to the button's corner */
.user-alert-badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 15px; height: 15px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--red, #ef4444);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 15px;
  text-align: center;
  pointer-events: none;
}

.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--panel);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  min-width: 175px;
  z-index: 300;
  padding: 6px;
  flex-direction: column;
  gap: 2px;
  box-shadow: var(--shadow-lg);
}
.user-dropdown.open { display: flex; }
.dropdown-name {
  font-size: 0.72rem; color: var(--muted);
  padding: 6px 10px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.user-dropdown button,
.user-dropdown a {
  display: flex; align-items: center; gap: 8px;
  background: none; border: none; color: var(--text);
  cursor: pointer; padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem; font-family: inherit;
  text-align: left; width: 100%;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.user-dropdown button:hover,
.user-dropdown a:hover { background: var(--panel-hover); color: var(--accent); }
.user-dropdown button svg,
.user-dropdown a svg { color: var(--muted); transition: color var(--transition); flex-shrink: 0; }
.user-dropdown button:hover svg,
.user-dropdown a:hover svg { color: var(--accent); }
.dropdown-divider { height: 1px; background: var(--border); margin: 5px 4px; }

/* ── Modal ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--panel);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  padding: 26px 26px 22px;
  width: min(440px, 95vw);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-wide { width: min(700px, 95vw); }

.modal-close {
  position: absolute; top: 13px; right: 15px;
  background: none; border: none; color: var(--muted);
  font-size: 1.3rem; cursor: pointer; line-height: 1;
  padding: 3px 7px; border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}
.modal-close:hover { background: var(--panel-hover); color: var(--text); }

.modal-title {
  font-size: 1rem; font-weight: 700; margin-bottom: 18px;
  padding-right: 26px; letter-spacing: -0.01em;
}

.modal-tabs {
  display: flex; gap: 0; margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.modal-tab-btn {
  background: none; border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted); cursor: pointer;
  font-size: 0.82rem; font-family: inherit;
  padding: 6px 14px 8px; margin-bottom: -1px;
  transition: color var(--transition), border-color var(--transition);
}
.modal-tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.modal-tab-btn:hover:not(.active) { color: var(--text); }

.modal-tab-pane { display: flex; flex-direction: column; gap: 10px; }
.modal-tab-pane input[type="email"],
.modal-tab-pane input[type="password"] {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 0.85rem; font-family: inherit;
}

.auth-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg);
  color: var(--text); cursor: pointer; font-size: 0.85rem;
  font-family: inherit; text-decoration: none; text-align: center;
  transition: background var(--transition), border-color var(--transition);
}
.auth-btn:hover { background: var(--panel-hover); border-color: var(--border-hover); }
.auth-btn.primary {
  background: var(--accent); color: #fff; border-color: var(--accent);
  font-weight: 700; box-shadow: 0 2px 12px var(--accent-glow);
}
.auth-btn.primary:hover { background: var(--accent-dim); box-shadow: 0 4px 20px rgba(242,193,78,0.4); }
.steam-btn  { background: #1b2838; border-color: #2a475e; color: #c7d5e0; }
.steam-btn:hover  { background: #233244; }
.google-btn { background: #fff; border-color: #e5e7eb; color: #374151; }
.google-btn:hover { background: #f9fafb; }

.auth-divider {
  text-align: center; color: var(--muted); font-size: 0.72rem; position: relative;
}
.auth-divider::before, .auth-divider::after {
  content: ""; position: absolute; top: 50%; width: 40%; height: 1px; background: var(--border);
}
.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }

.auth-desc  { font-size: 0.78rem; color: var(--muted); line-height: 1.65; }
.auth-error { color: var(--red); font-size: 0.78rem; min-height: 18px; }

/* ── Inventory ── */
.inv-count { font-size: 0.8rem; color: var(--muted); font-weight: 400; margin-left: 6px; }
.inv-controls { display: flex; gap: 8px; margin: 10px 0 12px; flex-wrap: wrap; }
.inv-controls input {
  flex: 1; min-width: 200px;
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-sm); padding: 8px 11px; font-size: 0.8rem;
}
.inv-controls input:focus { outline: none; border-color: var(--accent); }
.inv-controls button {
  background: var(--panel); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-sm); padding: 8px 14px; font-size: 0.8rem;
  font-weight: 600; cursor: pointer; transition: border-color var(--transition);
}
.inv-controls button:hover { border-color: var(--accent); }

/* ── Fetcher health ── */
.fh-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px;
  margin-bottom: 16px;
}
.fh-stats > div {
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px;
  display: flex; flex-direction: column; gap: 2px;
}
.fh-stats span { font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 700; }
.fh-stats strong { font-size: 0.84rem; font-weight: 600; }
.fh-h { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.fh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px 14px; }
.fh-row { display: flex; justify-content: space-between; gap: 8px; font-size: 0.74rem; padding: 3px 0; border-bottom: 1px solid var(--border); }
.fh-mkt { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Theme toggle ── */
.theme-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--muted); cursor: pointer; flex-shrink: 0;
  transition: border-color var(--transition), color var(--transition);
}
.theme-toggle:hover { border-color: var(--accent); color: var(--text); }
.theme-toggle svg { width: 17px; height: 17px; }

/* ── Watchlist ── */
.watchlist-btn {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--muted); cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}
.watchlist-btn:hover { border-color: var(--accent); color: var(--text); }
.watchlist-btn svg { width: 17px; height: 17px; }
.watchlist-count {
  position: absolute; top: -5px; right: -5px; min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--accent); color: #fff; border-radius: 999px; font-size: 0.6rem;
  font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.wl-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 8px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
}
.wl-row.met { border-color: var(--green); }
.wl-name { flex: 1; min-width: 0; }
.wl-name a { color: var(--text); text-decoration: none; font-size: 0.84rem; font-weight: 600; }
.wl-name a:hover { color: var(--accent); }
.wl-sub { font-size: 0.68rem; color: var(--muted); margin-top: 2px; }
.wl-row.met .wl-sub { color: var(--green); }
.wl-target { font-size: 0.72rem; color: var(--muted); display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.wl-target input {
  width: 76px; background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: 5px; padding: 5px 7px; font-size: 0.74rem; text-align: right;
}
.wl-target input:focus { outline: none; border-color: var(--accent); }
.wl-del {
  background: none; border: 1px solid var(--border); color: var(--muted);
  border-radius: 5px; padding: 5px 10px; cursor: pointer; font-size: 0.72rem;
}
.wl-del:hover { border-color: var(--red); color: var(--red); }

/* ── Saved contracts ── */
.saved-contract { margin-bottom: 14px; }
.saved-contract-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 6px;
}
.saved-contract-meta { font-size: 0.7rem; color: var(--muted); }
.saved-contract-actions { display: flex; gap: 6px; }
.saved-contract-actions button {
  background: none; border: 1px solid var(--border); color: var(--muted);
  border-radius: 5px; padding: 4px 10px; cursor: pointer; font-size: 0.72rem;
  transition: border-color var(--transition), color var(--transition);
}
.saved-contract-actions button:hover { border-color: var(--accent); color: var(--text); }
.saved-contract .card { cursor: default; }

/* Inline price editor */
.saved-edit-panel {
  border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 10px 10px; background: var(--bg);
  padding: 12px 14px; margin-top: -8px;
}
.se-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .se-cols { grid-template-columns: 1fr; } }
.se-h { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.se-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.se-name { flex: 1; font-size: 0.72rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.se-prob { color: var(--accent); font-size: 0.66rem; }
.se-price input {
  width: 78px; background: var(--panel); border: 1px solid var(--border);
  color: var(--text); border-radius: 5px; padding: 4px 7px; font-size: 0.74rem; text-align: right;
}
.se-price input:focus { outline: none; border-color: var(--accent); }
.se-metrics {
  display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 12px 0 10px;
  padding-top: 10px; border-top: 1px solid var(--border); font-size: 0.78rem; color: var(--muted);
}
.se-metrics strong { color: var(--text); }
.se-actions { display: flex; gap: 8px; }
.se-actions button {
  border: 1px solid var(--border); border-radius: 6px; padding: 6px 14px;
  font-size: 0.74rem; font-weight: 600; cursor: pointer; transition: border-color var(--transition);
}
.se-actions .se-save { background: var(--accent); color: #fff; border-color: var(--accent); }
.se-actions .se-reset { background: none; color: var(--muted); }
.se-actions button:hover { border-color: var(--accent); }
.inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(125px, 1fr));
  gap: 9px; max-height: 60vh; overflow-y: auto; padding-right: 4px;
}
.inv-item {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px;
  display: flex; flex-direction: column; gap: 5px;
  transition: border-color var(--transition);
}
.inv-item:hover { border-color: var(--border-hover); }
.inv-img { width: 100%; aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center; }
.inv-img img { width: 100%; height: 100%; object-fit: contain; border-radius: 4px; }
.inv-thumb-placeholder { width: 100%; height: 100%; background: var(--panel); border-radius: 4px; }
.inv-name { font-size: 0.68rem; font-weight: 500; line-height: 1.4; word-break: break-word; }
.inv-wear { font-size: 0.63rem; color: var(--muted); }

/* ── Price data section ── */
.price-data-info { display: flex; flex-direction: column; gap: 5px; margin-top: 2px; }
.price-data-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.76rem; }
.price-data-label { color: var(--muted); flex-shrink: 0; }
.price-data-val { color: var(--text); text-align: right; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.refresh-prices-btn {
  margin-top: 10px; width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: transparent; border: 1px solid var(--border-hover);
  color: var(--muted); border-radius: var(--radius-sm);
  padding: 7px 12px; font-size: 0.78rem; font-family: inherit;
  cursor: pointer; transition: var(--transition);
}
.refresh-prices-btn:hover { border-color: var(--accent); color: var(--accent); }
.refresh-prices-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Toast ── */
.auth-toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: var(--panel); border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm); padding: 9px 18px;
  font-size: 0.82rem; font-family: inherit; z-index: 2000;
  box-shadow: var(--shadow-md); white-space: nowrap;
  animation: toastIn 0.2s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Mobile FAB ── */
.fab {
  display: none;
  position: fixed; bottom: 20px; right: 20px; z-index: 300;
  background: var(--accent); color: #fff;
  border: none; border-radius: 50px; padding: 13px 22px;
  font-weight: 700; font-size: 0.9rem; font-family: inherit;
  cursor: pointer; box-shadow: 0 4px 24px var(--accent-glow);
  transition: opacity var(--transition), transform 0.1s;
}
.fab:hover { box-shadow: 0 6px 30px rgba(242,193,78,0.5); }
.fab:active { transform: scale(0.96); }

/* ── Animations ── */
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.spin { animation: spin 1s linear infinite; }

/* ── Sliders ── */
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px; border-radius: 2px;
  background: var(--border); border: none; padding: 0; margin-top: 6px;
  cursor: pointer; box-shadow: none;
}
input[type="range"]:focus { box-shadow: none; border: none; }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); cursor: pointer;
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--accent), 0 0 8px var(--accent-glow);
}

/* ── Tablet ── */
@media (max-width: 1024px) {
  .hero-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  aside { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .card-body { grid-template-columns: 1fr; }
}

/* ── Mobile ── */
@media (max-width: 640px) {
  header { padding: 0 16px; gap: 10px; }
  .header-logo-sub { display: none; }
  .badge-live { display: none; }
  .filter-toggle { display: flex; }

  /* Declutter the header: currency moves into the burger menu, the Filters
     button collapses to its icon, and the crowded finder header drops the
     logo text (the icon still links home). */
  header .header-right > .currency-select { display: none; }
  .filter-toggle .ft-label { display: none; }
  header:has(.filter-toggle) .header-logo-text { display: none; }

  .layout { grid-template-columns: 1fr; }
  aside {
    position: fixed; top: 0; left: 0;
    width: min(88vw, 310px); height: 100dvh;
    z-index: 150; border-right: 1px solid var(--border); border-bottom: none;
    transform: translateX(-110%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 64px 14px 100px; overflow-y: auto;
  }
  aside.drawer-open { transform: translateX(0); box-shadow: 4px 0 40px rgba(0,0,0,0.7); }

  main { padding: 12px 12px 90px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .hero-cards { grid-template-columns: 1fr; }
  .card-head { grid-template-columns: 1fr; gap: 6px; }
  .metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; text-align: left; }
  .metrics > div { flex-direction: row; align-items: baseline; gap: 5px; }
  .card-body { grid-template-columns: 1fr; padding: 11px 13px; font-size: 0.79rem; }
  .fab { display: flex; align-items: center; gap: 8px; }
}
