/* =============================================
   TERRARIA ACCESSORIES TOOL — STYLE.CSS
   Theme: Underground Vault — dark stone, amber gold
   ============================================= */

:root {
  --bg-deep:       #0e0c09;
  --bg-stone:      #1a1612;
  --bg-card:       #201c17;
  --bg-card-hover: #2a2520;
  --border:        #3d352a;
  --border-bright: #6b5a42;
  --gold:          #f0c040;
  --gold-dim:      #b8902e;
  --gold-glow:     rgba(240, 192, 64, 0.15);
  --blue:          #5ba8d4;
  --blue-dim:      #3d7a9e;
  --green:         #7ec85a;
  --red:           #d45b5b;
  --text-primary:  #e8dcc8;
  --text-secondary:#a09070;
  --text-dim:      #6a5a44;
  --recipe-bg:     #161210;
  --ingredient-bg: #0f0d0b;
  --radius:        4px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.noise-overlay {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.04) 2px, rgba(0,0,0,0.04) 4px),
    repeating-linear-gradient(90deg, transparent, transparent 3px, rgba(255,255,255,0.01) 3px, rgba(255,255,255,0.01) 6px);
  opacity: 0.6;
}

body > * { position: relative; z-index: 1; }

/* ─── Header ─────────────────────────────────── */
.site-header {
  background: linear-gradient(180deg, #120f0a 0%, #1a1510 100%);
  border-bottom: 2px solid var(--gold-dim);
  box-shadow: 0 2px 32px rgba(240, 192, 64, 0.12);
  padding: 24px 16px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  max-width: 960px;
  margin: 0 auto;
}

.header-emblem { font-size: 28px; color: var(--gold-dim); opacity: 0.6; animation: spin 12s linear infinite; }
.header-emblem:last-child { animation-direction: reverse; }
@keyframes spin { to { transform: rotate(360deg); } }

.header-text { text-align: center; }

.site-title {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(10px, 2.4vw, 18px);
  color: var(--gold);
  text-shadow: 0 0 12px rgba(240,192,64,0.5), 2px 2px 0px #4a3800;
  letter-spacing: 1px;
  line-height: 1.4;
}

.site-subtitle {
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-top: 8px;
}

/* ─── Main ───────────────────────────────────── */
.main-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 16px 64px;
}

/* ─── Search ─────────────────────────────────── */
.search-container { margin-bottom: 20px; }

.search-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-stone);
  border: 2px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 0 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-wrapper:focus-within {
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.search-icon { font-size: 18px; margin-right: 10px; opacity: 0.5; flex-shrink: 0; }

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: 'Rajdhani', sans-serif;
  font-size: 20px;
  font-weight: 600;
  padding: 14px 0;
  letter-spacing: 0.5px;
}
.search-input::placeholder { color: var(--text-dim); font-weight: 400; }

.clear-btn {
  background: none; border: none; color: var(--text-dim);
  font-size: 16px; cursor: pointer; padding: 4px 8px;
  border-radius: var(--radius); transition: color 0.15s; display: none;
}
.clear-btn:hover { color: var(--gold); }
.clear-btn.visible { display: block; }

.search-meta {
  font-size: 13px; color: var(--text-dim);
  margin-top: 8px; padding-left: 4px; min-height: 20px; letter-spacing: 0.5px;
}

/* ─── Filter bar ─────────────────────────────── */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }

.filter-chip {
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
  padding: 5px 14px;
  border: 1px solid var(--border-bright); border-radius: 2px;
  cursor: pointer; color: var(--text-secondary); background: var(--bg-stone);
  transition: all 0.15s; user-select: none;
}
.filter-chip:hover { border-color: var(--gold-dim); color: var(--gold); }
.filter-chip.active { background: var(--gold-dim); border-color: var(--gold); color: var(--bg-deep); }

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

/* ─── Accessory card ─────────────────────────── */
.acc-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  animation: cardIn 0.25s ease both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.acc-card:hover { border-color: var(--gold-dim); box-shadow: 0 4px 20px rgba(240,192,64,0.1); transform: translateY(-2px); }

.card-header {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 14px 10px; border-bottom: 1px solid var(--border);
}

.item-img-wrap {
  flex-shrink: 0; width: 48px; height: 48px;
  background: var(--ingredient-bg); border: 1px solid var(--border);
  border-radius: var(--radius); display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.item-img-wrap img { max-width: 100%; max-height: 100%; object-fit: contain; image-rendering: pixelated; }
.item-img-placeholder { font-size: 22px; opacity: 0.3; }

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

.item-name { font-size: 16px; font-weight: 700; color: var(--gold); line-height: 1.2; word-break: break-word; }
.item-name a { color: inherit; text-decoration: none; transition: color 0.15s; }
.item-name a:hover { color: #fff; text-decoration: underline; }

.card-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }

.badge { font-size: 10px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; padding: 2px 7px; border-radius: 2px; }
.badge-prehm  { background: rgba(126,200,90,0.15); color: var(--green); border: 1px solid rgba(126,200,90,0.3); }
.badge-hm     { background: rgba(212,91,91,0.12);  color: var(--red);   border: 1px solid rgba(212,91,91,0.3); }
.badge-recipe { background: rgba(91,168,212,0.12); color: var(--blue);  border: 1px solid rgba(91,168,212,0.3); }
.badge-used   { background: rgba(240,192,64,0.1);  color: var(--gold-dim); border: 1px solid rgba(240,192,64,0.25); }

.card-body { padding: 10px 14px; flex: 1; display: flex; flex-direction: column; gap: 10px; }

.effects-text { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

.visible-preview { display: flex; align-items: center; gap: 8px; }
.visible-label { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-dim); }
.visible-img img { height: 40px; image-rendering: pixelated; }

/* ─── Recipe section ─────────────────────────── */
.recipe-section { background: var(--recipe-bg); border-top: 1px solid var(--border); padding: 10px 14px; }

.recipe-section-title {
  font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--blue-dim); margin-bottom: 8px; display: flex; align-items: center; gap: 6px;
}
.recipe-section-title::before {
  content: ''; display: inline-block; width: 14px; height: 2px; background: var(--blue-dim); border-radius: 1px;
}

.recipe-group { margin-bottom: 8px; }
.recipe-group:last-child { margin-bottom: 0; }
.recipe-alt-label { font-size: 10px; color: var(--text-dim); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 4px; }

.recipe-ingredients { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

.ingredient-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-decoration: none; color: var(--text-secondary); transition: color 0.15s; max-width: 70px;
}
.ingredient-item:hover { color: var(--gold); }

.ingredient-img {
  width: 36px; height: 36px; background: var(--ingredient-bg); border: 1px solid var(--border);
  border-radius: var(--radius); display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.ingredient-img img { max-width: 100%; max-height: 100%; object-fit: contain; image-rendering: pixelated; }

.ingredient-name { font-size: 10px; text-align: center; line-height: 1.2; word-break: break-word; }

.recipe-plus { color: var(--text-dim); font-size: 18px; font-weight: 700; padding-bottom: 14px; flex-shrink: 0; }

.workshop-note { font-size: 10px; color: var(--text-dim); letter-spacing: 0.5px; margin-top: 3px; }

/* ─── Crafting tree button ───────────────────── */
.tree-btn {
  display: flex; align-items: center; gap: 6px; justify-content: center;
  width: 100%; margin-top: 8px;
  background: rgba(91,168,212,0.08); border: 1px solid rgba(91,168,212,0.3);
  border-radius: var(--radius); padding: 7px 10px;
  color: var(--blue); font-family: 'Rajdhani', sans-serif;
  font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  cursor: pointer; transition: all 0.18s;
}
.tree-btn:hover { background: rgba(91,168,212,0.18); border-color: var(--blue); color: #8ecfea; }
.tree-btn .tree-btn-icon { font-size: 15px; opacity: 0.8; }

/* ─── Used-in section ────────────────────────── */
.used-in-section { background: rgba(240,192,64,0.04); border-top: 1px solid var(--border); padding: 10px 14px; }

.used-in-title {
  font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--gold-dim); margin-bottom: 8px; display: flex; align-items: center; gap: 6px;
}
.used-in-title::before { content: ''; display: inline-block; width: 14px; height: 2px; background: var(--gold-dim); border-radius: 1px; }

.used-in-list { display: flex; flex-wrap: wrap; gap: 8px; }

.used-in-item {
  display: flex; align-items: center; gap: 6px; text-decoration: none;
  color: var(--text-secondary); font-size: 13px; font-weight: 600;
  padding: 4px 8px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--ingredient-bg); transition: all 0.15s; max-width: 180px;
}
.used-in-item:hover { border-color: var(--gold-dim); color: var(--gold); }
.used-in-item img { width: 22px; height: 22px; object-fit: contain; image-rendering: pixelated; }

.no-recipe-note {
  font-size: 12px; color: var(--text-dim); font-style: italic;
  border-top: 1px solid var(--border); padding: 8px 14px; letter-spacing: 0.3px;
}

/* ─── Empty state ────────────────────────────── */
.empty-state { text-align: center; padding: 80px 20px; }
.empty-state.hidden { display: none; }
.empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.3; }
.empty-title { font-family: 'Press Start 2P', monospace; font-size: 13px; color: var(--text-dim); margin-bottom: 8px; }
.empty-sub { font-size: 14px; color: var(--text-dim); opacity: 0.6; }

/* ─── Footer ─────────────────────────────────── */
.site-footer { text-align: center; padding: 20px 16px; font-size: 12px; color: var(--text-dim); border-top: 1px solid var(--border); }
.site-footer a { color: var(--gold-dim); text-decoration: none; }
.site-footer a:hover { color: var(--gold); }

/* =============================================
   CRAFTING TREE MODAL
   ============================================= */

.tm-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.82);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.22s;
}
.tm-overlay.open { opacity: 1; pointer-events: all; }

.tm-box {
  background: #17130e;
  border: 2px solid var(--gold-dim);
  border-radius: 6px;
  width: 100%; max-width: 1200px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: 0 8px 48px rgba(0,0,0,0.8), 0 0 0 1px rgba(240,192,64,0.1);
  transform: translateY(12px); transition: transform 0.22s;
  overflow: hidden;
}
.tm-overlay.open .tm-box { transform: translateY(0); }

/* Modal header */
.tm-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  background: #110f0a; flex-shrink: 0;
}

.tm-title {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(8px, 1.5vw, 13px);
  color: var(--gold);
  text-shadow: 0 0 8px rgba(240,192,64,0.4);
  line-height: 1.4;
  flex: 1; min-width: 0; margin-right: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.tm-controls { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.tm-ctrl-btn {
  background: var(--bg-stone); border: 1px solid var(--border-bright);
  color: var(--text-secondary); font-family: 'Rajdhani', sans-serif;
  font-size: 15px; font-weight: 700; padding: 4px 10px;
  border-radius: var(--radius); cursor: pointer; transition: all 0.15s;
  min-width: 32px; text-align: center;
}
.tm-ctrl-btn:hover { border-color: var(--gold-dim); color: var(--gold); background: #252018; }

.tm-zoom-label { font-size: 13px; color: var(--text-dim); min-width: 40px; text-align: center; font-weight: 600; }

.tm-fit-btn { font-size: 12px; letter-spacing: 0.5px; }

.tm-close-btn {
  background: rgba(212,91,91,0.1); border: 1px solid rgba(212,91,91,0.3);
  color: var(--red); font-size: 16px; font-weight: 700; width: 32px; height: 32px;
  border-radius: var(--radius); cursor: pointer; transition: all 0.15s;
  display: flex; align-items: center; justify-content: center;
}
.tm-close-btn:hover { background: rgba(212,91,91,0.25); border-color: var(--red); }

/* Legend */
.tm-legend {
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
  padding: 8px 18px; border-bottom: 1px solid var(--border);
  background: #100e09; flex-shrink: 0; font-size: 12px; color: var(--text-dim);
}

.tm-leg-item { display: flex; align-items: center; gap: 5px; }

.tni {
  display: inline-block; width: 14px; height: 14px; border-radius: 2px; border: 1px solid;
}
.tni-root    { background: rgba(240,192,64,0.15); border-color: var(--gold); }
.tni-crafted { background: rgba(91,168,212,0.12); border-color: var(--blue-dim); }
.tni-source  { background: rgba(160,144,112,0.1); border-color: var(--border-bright); }

.tm-leg-sep { color: var(--border-bright); }

.tm-ws-icon { color: #c86020; font-size: 14px; }

.tm-or-badge {
  display: inline-block; background: rgba(160,144,112,0.15);
  border: 1px solid rgba(160,144,112,0.3); border-radius: 3px;
  padding: 1px 6px; font-size: 11px; color: var(--text-secondary);
  font-weight: 700; letter-spacing: 0.5px;
}

/* Scroll area */
.tm-scroll {
  flex: 1; overflow: auto; padding: 24px;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 28px,
    rgba(255,255,255,0.012) 28px, rgba(255,255,255,0.012) 29px
  ),
  repeating-linear-gradient(
    90deg, transparent, transparent 28px,
    rgba(255,255,255,0.012) 28px, rgba(255,255,255,0.012) 29px
  );
  cursor: grab;
}
.tm-scroll:active { cursor: grabbing; }

.tm-viewport {
  display: inline-block; /* shrink-wrap to content */
  transform-origin: top left;
  transition: transform 0.15s;
}

/* ── Tree canvas ────────────────────────────── */
.tc-canvas {
  position: relative;
  /* width/height set by JS */
}

.tc-svg {
  position: absolute; top: 0; left: 0; overflow: visible; pointer-events: none;
}

/* ── Tree nodes ─────────────────────────────── */
.tn {
  position: absolute;
  width: 148px; /* TC.nw */
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  background: #1c1812; border: 1px solid var(--border-bright);
  border-radius: 4px; padding: 8px 6px 7px;
  text-decoration: none; color: var(--text-primary);
  transition: border-color 0.15s, box-shadow 0.15s;
  cursor: default;
}
.tn:hover { border-color: var(--gold-dim); box-shadow: 0 0 10px rgba(240,192,64,0.15); z-index: 10; }

.tn-root {
  border-color: var(--gold);
  background: #201a0e;
  box-shadow: 0 0 14px rgba(240,192,64,0.2);
}

.tn-crafted { border-color: var(--blue-dim); background: #111820; }

.tn-source { border-color: var(--border); background: #151210; }

.tn-img {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
}
.tn-img img { max-width: 100%; max-height: 100%; object-fit: contain; image-rendering: pixelated; }
.tn-img-ph { font-size: 20px; opacity: 0.25; }

.tn-name {
  font-size: 11px; font-weight: 700; text-align: center;
  color: var(--text-primary); line-height: 1.25;
  word-break: break-word; width: 100%;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tn-root  .tn-name { color: var(--gold); }
.tn-crafted .tn-name { color: #8dd0f0; }

.tn-src-tag {
  font-size: 9px; letter-spacing: 0.6px; text-transform: uppercase;
  color: var(--text-dim); font-weight: 600; margin-top: 1px;
}

.tn-wiki-link {
  position: absolute; top: 4px; right: 4px; font-size: 9px;
  color: var(--text-dim); text-decoration: none; opacity: 0;
  transition: opacity 0.15s;
}
.tn:hover .tn-wiki-link { opacity: 1; }

/* Loading */
.tm-loading {
  display: flex; align-items: center; justify-content: center;
  height: 200px; color: var(--text-dim); font-size: 14px; letter-spacing: 1px;
}

/* ─── Responsive ─────────────────────────────── */
@media (max-width: 480px) {
  .results-grid { grid-template-columns: 1fr; }
  .site-title { font-size: 9px; }
  .header-emblem { display: none; }
  .tm-box { max-height: 95vh; }
  .tm-legend { display: none; }
}

/* ─── Category tab separator ─────────────────── */
.filter-sep {
  display: inline-block;
  width: 1px; height: 20px;
  background: var(--border-bright);
  margin: 0 4px;
  vertical-align: middle;
  opacity: 0.5;
}

.filter-chip-cat { border-style: dashed; }
.filter-chip-cat.active { border-style: solid; }

/* ─── Circular reference node in crafting tree ── */
.tn-circular {
  border: 1px dashed #5a4a32 !important;
  background: #110f0c !important;
  opacity: 0.7;
}
.tn-circular .tn-name { color: var(--text-dim) !important; }
.tn-circular .tn-src-tag { color: #b8902e; letter-spacing: 0.5px; }
.tn-img-dim { opacity: 0.4; }

/* =============================================
   SITE NAVIGATION
   ============================================= */
.site-nav {
  display: flex;
  align-items: center;
  gap: 0;
  background: #110f0a;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 12px 20px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: all 0.15s;
  margin-bottom: -1px;
}

.nav-link:hover   { color: var(--gold); border-bottom-color: var(--gold-dim); }
.nav-active       { color: var(--gold) !important; border-bottom-color: var(--gold) !important; }

/* =============================================
   NPC CARDS
   ============================================= */
.npc-portrait {
  flex-shrink: 0; width: 54px; height: 54px;
  background: var(--ingredient-bg); border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.npc-portrait img      { max-width: 100%; max-height: 100%; object-fit: contain; image-rendering: pixelated; }
.npc-portrait-ph       { font-size: 26px; opacity: 0.25; }

.npc-biomes            { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }

.biome-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
  padding: 2px 7px; border-radius: 2px; border: 1px solid;
  background: rgba(0,0,0,0.3);
}

.spawn-block   { margin-top: 6px; font-size: 12px; line-height: 1.5; }
.spawn-label   { color: var(--gold-dim); font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; font-size: 10px; }
.spawn-text    { color: var(--text-secondary); }

.npc-special-note {
  font-size: 11px; color: var(--gold-dim); font-style: italic;
  margin-top: 5px; padding: 5px 8px;
  background: rgba(240,192,64,0.06); border-left: 2px solid var(--gold-dim);
  border-radius: 0 2px 2px 0;
}

.npc-rels { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }

.npc-rel-tag {
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 2px;
  border: 1px solid; white-space: nowrap;
}

.rel-love    { background: rgba(240,192,64,0.12); border-color: rgba(240,192,64,0.35); color: #f0c040; }
.rel-like    { background: rgba(126,200,90,0.1);  border-color: rgba(126,200,90,0.3);  color: #7ec85a; }
.rel-dislike { background: rgba(240,140,40,0.1);  border-color: rgba(240,140,40,0.3);  color: #e08030; }
.rel-hate    { background: rgba(212,91,91,0.1);   border-color: rgba(212,91,91,0.3);   color: #d45b5b; }

.npc-detail-btn { margin: 0; border-radius: 0 0 4px 4px; }

/* =============================================
   NPC DETAIL MODAL
   ============================================= */
.tm-box-npc   { max-width: 700px; }
.tm-box-wide  { max-width: 1100px; }

.npc-detail-body { padding: 20px; display: flex; flex-direction: column; gap: 20px; }

.detail-top {
  display: flex; gap: 16px; align-items: flex-start;
}
.detail-portrait {
  flex-shrink: 0; width: 70px;
  image-rendering: pixelated; border: 1px solid var(--border); border-radius: var(--radius);
}
.detail-top-text { flex: 1; }
.detail-desc    { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 8px; }
.detail-spawn, .detail-weapon, .detail-drops {
  font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 4px;
}
.detail-spawn strong, .detail-weapon strong, .detail-drops strong { color: var(--gold-dim); }
.detail-special { font-size: 12px; color: var(--gold-dim); font-style: italic; margin-top: 6px; }

.detail-section { border-top: 1px solid var(--border); padding-top: 14px; }
.detail-section-title {
  font-size: 11px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--blue-dim); margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.detail-section-title::before {
  content: ''; display: inline-block; width: 14px; height: 2px; background: var(--blue-dim); border-radius: 1px;
}

.detail-rel-row { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; flex-wrap: wrap; }
.detail-rel-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase;
  padding: 2px 9px; border-radius: 2px; border: 1px solid; min-width: 90px; text-align: center;
}
.detail-rel-names { font-size: 13px; color: var(--text-secondary); }
.detail-npc-link  { color: var(--gold-dim); text-decoration: none; }
.detail-npc-link:hover { color: var(--gold); text-decoration: underline; }

.detail-biome-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.detail-biome-note { font-size: 12px; color: var(--text-dim); }

/* =============================================
   RELATIONSHIP MATRIX
   ============================================= */
.matrix-filter-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 18px; border-bottom: 1px solid var(--border);
  background: #110f0a; flex-shrink: 0;
}

.matrix-search {
  flex: 1; max-width: 280px;
  background: var(--bg-stone); border: 1px solid var(--border-bright);
  border-radius: var(--radius); padding: 6px 10px;
  color: var(--text-primary); font-family: 'Rajdhani', sans-serif; font-size: 14px;
  outline: none;
}
.matrix-search:focus { border-color: var(--gold-dim); }

.matrix-toggle {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-secondary); cursor: pointer;
  font-family: 'Rajdhani', sans-serif; font-weight: 600;
}
.matrix-toggle input { cursor: pointer; accent-color: var(--gold-dim); }

.rel-matrix {
  border-collapse: collapse;
  font-family: 'Rajdhani', sans-serif;
}

.matrix-corner { width: 130px; min-width: 130px; }

.matrix-col-head {
  width: 36px; min-width: 36px; height: 130px;
  vertical-align: bottom; padding-bottom: 6px;
  padding-left: 2px;
}

.matrix-col-label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 11px; font-weight: 700; color: var(--text-secondary);
  letter-spacing: 0.5px; white-space: nowrap;
  max-height: 120px; overflow: hidden;
}

.matrix-row-head {
  font-size: 11px; font-weight: 700; color: var(--text-secondary);
  text-align: right; padding-right: 8px;
  white-space: nowrap; min-width: 130px;
  border-right: 1px solid var(--border);
}

.matrix-cell {
  width: 36px; height: 36px; text-align: center; vertical-align: middle;
  border: 1px solid var(--border); font-size: 14px; cursor: default;
  position: relative; transition: background 0.1s;
}

.matrix-self    { background: #0a0807; color: var(--text-dim); font-size: 18px; }
.matrix-empty   { background: #0e0c09; }

.matrix-rel-love    { background: rgba(240,192,64,0.18); }
.matrix-rel-like    { background: rgba(126,200,90,0.15); }
.matrix-rel-dislike { background: rgba(240,140,40,0.15); }
.matrix-rel-hate    { background: rgba(212,91,91,0.15);  }

.matrix-cell:hover  { outline: 1px solid var(--gold-dim); z-index: 2; }

.matrix-mutual {
  position: absolute; bottom: 1px; right: 2px;
  font-size: 9px; opacity: 0.7;
}

/* Relation indicator dots for legend */
.rel-dot {
  display: inline-block; width: 12px; height: 12px;
  border-radius: 50%; border: 1px solid;
}
.rel-dot.rel-love    { background: rgba(240,192,64,0.3); border-color: #f0c040; }
.rel-dot.rel-like    { background: rgba(126,200,90,0.3); border-color: #7ec85a; }
.rel-dot.rel-dislike { background: rgba(240,140,40,0.3); border-color: #e08030; }
.rel-dot.rel-hate    { background: rgba(212,91,91,0.3);  border-color: #d45b5b; }


/* =============================================
   MATRIX SIDE PANEL
   ============================================= */
.matrix-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.matrix-body .tm-scroll {
  flex: 1;
  min-width: 0;
}

.matrix-side-panel {
  width: 260px;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  background: #13100c;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: width 0.2s;
}

.matrix-side-panel.hidden {
  display: none;
}

.sp-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.side-panel-sprite {
  width: 36px;
  height: auto;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.sp-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: var(--gold);
  line-height: 1.5;
  text-shadow: 0 0 8px rgba(240,192,64,0.3);
}

.sp-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.sp-spawn {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.sp-section {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sp-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--blue-dim);
  margin-bottom: 2px;
}

.sp-biome-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sp-biome-note {
  font-size: 11px;
  color: var(--text-dim);
}

.sp-rel-row {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  flex-wrap: wrap;
}

.sp-rel-names {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
}

.sp-special {
  font-size: 11px;
  color: var(--gold-dim);
  font-style: italic;
  border-color: var(--gold-dim);
}

@media (max-width: 700px) {
  .matrix-side-panel { width: 180px; }
  .sp-name { font-size: 7px; }
}

/* =============================================
   SHIMMER PAGE
   ============================================= */

.shimmer-intro {
  background: linear-gradient(135deg, rgba(180,100,255,0.07), rgba(91,168,212,0.05));
  border: 1px solid rgba(180,100,255,0.2);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.shimmer-intro strong { color: #c87af0; }

/* ── Category filter bar ─────────────────────── */
.shimmer-cat-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 28px;
}

.shimmer-cat-btn {
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px; font-weight: 700; letter-spacing: 0.8px;
  padding: 6px 14px; border-radius: 2px;
  border: 1px solid var(--border-bright);
  background: var(--bg-stone); color: var(--text-secondary);
  cursor: pointer; transition: all 0.15s;
  white-space: nowrap;
}
.shimmer-cat-btn:hover { border-color: #c87af0; color: #c87af0; }
.shimmer-cat-btn.active { background: rgba(180,100,255,0.15); border-color: #c87af0; color: #c87af0; }

/* ── Section block ───────────────────────────── */
.sh-section {
  margin-bottom: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  animation: cardIn 0.2s ease both;
}

.sh-section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: #191510;
  border-bottom: 2px solid;
}

.sh-section-icon { font-size: 22px; flex-shrink: 0; }

.sh-section-title-block { flex: 1; min-width: 0; }

.sh-section-title {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(8px, 1.4vw, 12px);
  line-height: 1.4;
  margin-bottom: 4px;
}

.sh-section-desc {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
}

.sh-section-count {
  flex-shrink: 0;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: var(--text-dim);
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 4px 8px;
}

/* ── Table header ────────────────────────────── */
.sh-table-head {
  display: grid;
  grid-template-columns: 1fr 32px 1fr;
  padding: 6px 12px;
  background: #130f0b;
  border-bottom: 1px solid var(--border);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ── Row container ───────────────────────────── */
.sh-rows { display: flex; flex-direction: column; }

/* ── Single transform row ────────────────────── */
.sh-row {
  display: grid;
  grid-template-columns: 1fr 32px 1fr;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  gap: 4px;
  transition: background 0.12s;
}
.sh-row:last-child { border-bottom: none; }
.sh-row:hover { background: var(--bg-card-hover); }

.sh-row-input, .sh-row-output {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.sh-arrow {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  opacity: 0.8;
}

.sh-row-note-wrap {
  grid-column: 1 / -1;
  padding-top: 4px;
}

.sh-row-note {
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
  padding: 3px 8px;
  background: rgba(0,0,0,0.2);
  border-left: 2px solid var(--border-bright);
  border-radius: 0 2px 2px 0;
}

/* ── Interchangeable group row ───────────────── */
.sh-row-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  grid-template-columns: unset;
}

.sh-interchange-arrow {
  font-size: 16px;
  color: #7ec85a;
  font-weight: 700;
  padding: 0 2px;
  flex-shrink: 0;
}

/* ── Item chip ───────────────────────────────── */
.sh-item-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  color: var(--text-secondary);
  background: var(--ingredient-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px 7px 3px 3px;
  transition: all 0.15s;
  white-space: nowrap;
  max-width: 180px;
}
.sh-item-chip:hover {
  border-color: var(--gold-dim);
  color: var(--gold);
  background: #1e1a14;
}

.sh-item-img {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sh-chip-sm .sh-item-img { width: 22px; height: 22px; }
.sh-chip-lg .sh-item-img { width: 36px; height: 36px; }

.sh-item-img img {
  max-width: 100%; max-height: 100%;
  object-fit: contain; image-rendering: pixelated;
}
.sh-img-ph { font-size: 14px; opacity: 0.3; }

.sh-item-name {
  font-size: 11px; font-weight: 600; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis;
}
.sh-chip-lg .sh-item-name { font-size: 12px; }

.sh-qty {
  color: var(--gold-dim);
  font-size: 10px;
  margin-left: 2px;
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 600px) {
  .sh-row {
    grid-template-columns: 1fr 24px 1fr;
    padding: 6px 8px;
  }
  .sh-section-title { font-size: 7px; }
  .shimmer-cat-bar { gap: 4px; }
  .shimmer-cat-btn { font-size: 11px; padding: 5px 10px; }
}

/* =============================================
   CLASS SETUPS PAGE
   ============================================= */

/* ── Step wrapper ────────────────────────────── */
.cs-step {
  margin-bottom: 28px;
}

.cs-step-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── Class selector grid ─────────────────────── */
.cs-class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.cs-class-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 6px;
  padding: 20px 16px;
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: all 0.18s;
  font-family: 'Rajdhani', sans-serif;
  position: relative;
  overflow: hidden;
}

.cs-class-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--cls-color, var(--gold-dim));
  opacity: 0.7;
}

.cs-class-card:hover {
  border-color: var(--cls-color, var(--gold-dim));
  box-shadow: 0 0 20px rgba(0,0,0,0.4), 0 0 0 1px var(--cls-color, var(--gold-dim));
  transform: translateY(-3px);
}

.cs-class-icon   { font-size: 32px; line-height: 1; }
.cs-class-name   { font-family: 'Press Start 2P', monospace; font-size: 9px; color: var(--cls-color, var(--gold)); line-height: 1.4; }
.cs-class-desc   { font-size: 12px; color: var(--text-dim); line-height: 1.4; }
.cs-class-phases { font-size: 11px; color: var(--text-dim); font-weight: 600; letter-spacing: 0.5px; margin-top: 4px; }

/* ── Phase bar ───────────────────────────────── */
.cs-step-phases .cs-step-label {
  flex-wrap: wrap;
}

.cs-back-btn {
  background: var(--bg-stone);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 4px 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.cs-back-btn:hover { border-color: var(--gold-dim); color: var(--gold); }

.cs-phase-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.cs-phase-btn {
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 7px 16px;
  border-radius: 3px;
  border: 1px solid var(--border-bright);
  background: var(--bg-stone);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.cs-phase-btn:hover  { border-color: var(--gold-dim); color: var(--gold); }
.cs-phase-btn.active {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: var(--bg-deep);
}
.cs-phase-empty { opacity: 0.35; cursor: not-allowed; }

/* ── Setup display ───────────────────────────── */
.cs-setup { animation: cardIn 0.2s ease both; }

.cs-setup-header {
  background: #191510;
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 14px 18px;
  border-bottom: 2px solid var(--border-bright);
}

.cs-setup-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(8px, 1.4vw, 12px);
  line-height: 1.5;
}

.cs-setup-class-icon { font-size: 20px; }
.cs-setup-sep        { color: var(--text-dim); opacity: 0.5; }
.cs-setup-phase      { color: var(--text-secondary); }

.cs-notes {
  background: rgba(240,192,64,0.05);
  border-left: 3px solid var(--gold-dim);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 2px;
}

/* ── Slots container ─────────────────────────── */
.cs-slots {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}

/* ── Slot group ──────────────────────────────── */
.cs-slot-group {
  display: grid;
  grid-template-columns: 140px 1fr;
  border-bottom: 1px solid var(--border);
  min-height: 52px;
}
.cs-slot-group:last-child { border-bottom: none; }
.cs-slot-group:hover      { background: var(--bg-card-hover); }

.cs-slot-label {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-dim);
  border-right: 1px solid var(--border);
  background: #13100c;
  word-break: break-word;
}

.cs-slot-items {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
}

/* ── Item card ───────────────────────────────── */
.cs-item-card {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  color: var(--text-secondary);
  background: var(--ingredient-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px 8px 3px 3px;
  transition: all 0.14s;
  white-space: nowrap;
}
.cs-item-card:hover {
  border-color: var(--gold-dim);
  color: var(--gold);
  background: #1e1a14;
}

.cs-item-img {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.cs-item-img img {
  max-width: 100%; max-height: 100%;
  object-fit: contain; image-rendering: pixelated;
}

.cs-item-name {
  font-size: 11px; font-weight: 600; line-height: 1.2;
  max-width: 160px; overflow: hidden; text-overflow: ellipsis;
}

.cs-item-qty {
  font-size: 10px;
  color: var(--gold-dim);
  margin-left: 2px;
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 600px) {
  .cs-class-grid { grid-template-columns: 1fr 1fr; }
  .cs-slot-group { grid-template-columns: 100px 1fr; }
  .cs-slot-label { font-size: 9px; padding: 8px 8px; }
  .cs-setup-title { font-size: 7px; }
}

/* =============================================
   ITEM DETAIL MODAL
   ============================================= */

.tm-box-item { max-width: 760px; }

.item-wiki-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 5px 12px;
  border: 1px solid var(--blue-dim);
  border-radius: var(--radius);
  color: var(--blue);
  background: rgba(91,168,212,0.08);
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}
.item-wiki-btn:hover { background: rgba(91,168,212,0.2); border-color: var(--blue); color: #9dd8f5; }

/* ── Loading & error states ──────────────────── */
.item-modal-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  height: 180px;
  color: var(--text-dim);
  font-size: 14px;
  letter-spacing: 1px;
}

.item-loading-spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--gold-dim);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.item-modal-error {
  padding: 32px 24px;
  text-align: center;
  color: var(--text-secondary);
}
.item-modal-error .error-icon { font-size: 36px; margin-bottom: 12px; opacity: 0.5; }
.item-modal-error p  { margin-bottom: 8px; font-size: 14px; line-height: 1.6; }
.item-modal-error a  { color: var(--gold-dim); }
.error-detail { font-size: 11px; color: var(--text-dim); font-style: italic; }

/* ── Modal body layout ───────────────────────── */
.item-modal-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }

.item-modal-top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.item-modal-img {
  flex-shrink: 0;
  width: 64px; height: 64px;
  background: var(--ingredient-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.item-modal-img img {
  max-width: 100%; max-height: 100%;
  object-fit: contain; image-rendering: pixelated;
}

.item-modal-top-right { flex: 1; min-width: 0; }

.item-modal-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.item-type-badge {
  font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  padding: 2px 8px; border-radius: 2px;
  background: rgba(160,144,112,0.12); border: 1px solid rgba(160,144,112,0.3);
  color: var(--text-secondary);
}

.item-rarity {
  font-size: 10px; font-weight: 700; letter-spacing: 0.8px;
  padding: 2px 8px; border-radius: 2px; border: 1px solid;
  background: rgba(0,0,0,0.3);
}

/* ── Tooltip ─────────────────────────────────── */
.item-tooltip-block {
  background: #0d0b09;
  border: 1px solid #3a2a1a;
  border-radius: 3px;
  padding: 8px 12px;
  margin-bottom: 6px;
}
.item-tooltip-line {
  font-size: 12px;
  color: #c8b090;
  line-height: 1.6;
  font-style: italic;
}

/* ── Prices ──────────────────────────────────── */
.item-prices { display: flex; gap: 12px; flex-wrap: wrap; }
.price-sell, .price-buy {
  font-size: 12px; color: var(--text-dim); font-weight: 600;
}
.item-price { color: var(--gold-dim); }

/* ── Section ─────────────────────────────────── */
.item-section { border-top: 1px solid var(--border); padding-top: 12px; }

.item-section-title {
  font-size: 11px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--blue-dim);
  margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}
.item-section-title::before {
  content: ''; display: inline-block; width: 14px; height: 2px;
  background: var(--blue-dim); border-radius: 1px;
}

/* ── Stats table ─────────────────────────────── */
.item-stats-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.item-stats-table tr { border-bottom: 1px solid var(--border); }
.item-stats-table tr:last-child { border-bottom: none; }
.item-stats-table tr:hover { background: var(--bg-card-hover); }
.stat-label {
  padding: 5px 10px 5px 0; color: var(--text-dim);
  font-weight: 700; letter-spacing: 0.3px; width: 45%;
  text-transform: capitalize;
}
.stat-value { padding: 5px 0; color: var(--text-primary); }

/* ── Recipe row ──────────────────────────────── */
.item-recipe-row {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 6px; margin-bottom: 8px; padding: 6px 8px;
  background: var(--recipe-bg); border-radius: var(--radius);
  border: 1px solid var(--border);
}

.item-ing-chip {
  display: inline-flex; align-items: center; gap: 4px;
  text-decoration: none; color: var(--text-secondary);
  background: var(--ingredient-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2px 6px 2px 2px;
  font-size: 11px; font-weight: 600; transition: all 0.13s;
}
.item-ing-chip:hover { border-color: var(--gold-dim); color: var(--gold); }

.item-ing-img {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
}
.item-ing-img img { max-width: 100%; max-height: 100%; image-rendering: pixelated; object-fit: contain; }

.item-ing-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.item-recipe-plus { color: var(--text-dim); font-size: 16px; font-weight: 700; flex-shrink: 0; }

.item-recipe-station {
  font-size: 10px; color: var(--text-dim); letter-spacing: 0.5px;
  margin-left: auto; font-style: italic; white-space: nowrap;
}

/* ── Used-in list ────────────────────────────── */
.item-usedin-list { display: flex; flex-wrap: wrap; gap: 6px; }

/* ── cs-item-card as button ──────────────────── */
.cs-item-card.item-trigger {
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}
.cs-item-card.item-trigger:focus-visible {
  outline: 2px solid var(--gold-dim);
  outline-offset: 2px;
}
