/* =========================================================
   Crafting Calculator — Organized CSS (merged)
   - Duplicated selectors merged
   - When conflicts existed, the later (lower) value from your file won
   - Kept intentional overrides (especially Inventory + Mobile)
   Source: original style.css
   ========================================================= */

/* =========================================================
   0) PAGE TOKENS
   ========================================================= */
:root{
  /* Layout */
  --cc-maxw: 1040px;
  --cc-page-pad: 12px;
  --cc-container-pad: 16px;
  --cc-card-pad: 14px;
  --cc-gap: 12px;

  /* Typography */
  --cc-font: var(--font, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial);
  --cc-h1: 26px;
  --cc-h2: 15px;
  --cc-body: 15px;
  --cc-small: 12px;

  /* Controls */
  --cc-control-h: 46px;
  --cc-radius: 18px;
  --cc-radius-sm: 14px;

  /* Page accents (subtle) */
  --cc-accent: var(--accent, #7c5cff);
  --cc-accent2: var(--accent-2, #35c6ff);
  --cc-good: var(--good, #2de38e);
  --cc-warn: var(--warn, #ffcc66);

  /* Surfaces */
  --cc-surface: rgba(255,255,255,.06);
  --cc-surface-2: rgba(255,255,255,.045);
  --cc-surface-3: rgba(255,255,255,.03);

  /* Borders / shadows */
  --cc-border: rgba(255,255,255,.10);
  --cc-border-2: rgba(255,255,255,.14);
  --cc-shadow: 0 14px 40px rgba(0,0,0,.35);
  --cc-shadow-soft: 0 10px 24px rgba(0,0,0,.25);
}

/* =========================================================
   1) BASE / RESET
   ========================================================= */
*{ box-sizing: border-box; }
html, body{ height: 100%; }
html{ overflow-x: hidden; }
body{
  margin: 0;
  font-family: var(--cc-font);
  color: var(--text, #e8e9ff);
  font-size: var(--cc-body);
}

/* media */
img{ max-width: 100%; display: block; }
button, input, select{ font: inherit; }
a{ color: inherit; }

/* Reduce motion */
@media (prefers-reduced-motion: reduce){
  *{ scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* =========================================================
   2) PAGE WRAPPER
   ========================================================= */
.page{
  width: min(var(--cc-maxw), 100%);
  margin: 14px auto 18px;
  padding: 0 var(--cc-page-pad);
}

.container{
  width: 100%;
  padding: var(--cc-container-pad);
  border-radius: calc(var(--cc-radius) + 2px);

  background:
    radial-gradient(800px 220px at 12% 0%, rgba(124,92,255,.12), transparent 60%),
    radial-gradient(800px 220px at 88% 0%, rgba(53,198,255,.10), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,.04), transparent 120px),
    var(--panel, #22243a);

  border: 1px solid rgba(255,255,255,.10);
  box-shadow: var(--cc-shadow);
}

/* prevent grid overflow */
.container,
.screen,
.cardBlock,
.search-row,
.qty-row,
.selected-preview,
.results,
.item,
.price-panel{ min-width: 0; }

/* =========================================================
   3) HEADER
   ========================================================= */
.toolHeader{ margin-bottom: 10px; }

.toolTitle{
  margin: 6px 0 6px;
  text-align: center;
  font-size: var(--cc-h1);
  font-weight: 950;
  letter-spacing: .2px;

  background: linear-gradient(90deg, rgba(255,255,255,.9), var(--cc-accent), var(--cc-accent2), rgba(255,255,255,.85));
  background-size: 300% 100%;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: ccTitleGlow 10s linear infinite;
}
@keyframes ccTitleGlow{
  0%{ background-position: 0% 50%; }
  100%{ background-position: 300% 50%; }
}

.toolSubtitle{
  margin: 0 0 12px;
  text-align: center;
  color: var(--muted, #b7b9da);
  opacity: .95;
  font-weight: 700;
}

/* text wrap safety */
.toolTitle, .toolSubtitle, .blockTitle, .item span, .selected-name, .price-title{
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* =========================================================
   4) TABS (segmented control)
   ========================================================= */
.tabs{
  display: grid;
  grid-template-columns: 1fr 1fr auto; /* (merged) final layout includes inventory util btn */
  gap: 8px;

  margin: 12px 0 14px;
  padding: 8px;

  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
}

.tab-btn{
  width: 100%;
  min-height: 44px;
  border-radius: 999px;

  background: transparent;
  border: 1px solid transparent;
  color: rgba(255,255,255,.84);

  font-weight: 950;
  letter-spacing: .2px;
  cursor: pointer;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  transition: background .18s ease, border-color .18s ease, transform .08s ease, color .18s ease;
}
.tab-btn:hover{
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.92);
}
.tab-btn:active{ transform: translateY(1px); }

.tab-btn.active{
  background:
    radial-gradient(500px 200px at 30% 0%, rgba(53,198,255,.16), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.04));
  border-color: rgba(255,255,255,.14);
  box-shadow: var(--cc-shadow-soft);
  color: rgba(255,255,255,.96);
}

/* Utility button (Inventory) */
.tab-util-btn{
  width: 44px;
  height: 44px;
  border-radius: 999px;
  padding: 0;
  display: grid;
  place-items: center;

  background:
    radial-gradient(700px 160px at 10% 0%, rgba(53,198,255,.18), transparent 55%),
    rgba(255,255,255,.04);

  border: 1px solid rgba(255,255,255,.12);
  box-shadow: var(--cc-shadow);
  cursor: pointer;

  transition: transform .08s ease, filter .15s ease, background .15s ease, border-color .15s ease;
}
.tab-util-btn:hover{
  filter: brightness(1.06);
  border-color: rgba(53,198,255,.28);
}
.tab-util-btn:active{ transform: translateY(1px); }
.tab-util-btn:focus-visible{
  outline: none;
  box-shadow: 0 0 0 4px rgba(53,198,255,.18), var(--cc-shadow);
}
.tab-util-icon{ font-size: 18px; }

/* =========================================================
   5) SCREENS / GRID LAYOUT
   ========================================================= */
.screen{
  display: grid;
  gap: var(--cc-gap);
}

/* Cards */
.cardBlock,
.chance-panel,
.results,
.price-panel{
  padding: var(--cc-card-pad);
  border-radius: var(--cc-radius);
  border: 1px solid rgba(255,255,255,.10);
  background:
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  box-shadow: 0 8px 22px rgba(0,0,0,.18);
}

.blockTitle{
  margin: 0 0 10px;
  font-size: var(--cc-h2);
  font-weight: 950;
  letter-spacing: .25px;
  color: rgba(255,255,255,.92);

  display: flex;
  align-items: center;
  gap: 10px;
}
.blockTitle::before{
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--cc-accent2);
  box-shadow: 0 0 0 5px rgba(53,198,255,.10);
  flex: 0 0 auto;
}

/* Desktop composition — uses existing element order */
@media (min-width: 920px){
  #screenWeapons{
    grid-template-columns: 1.12fr .88fr;
    grid-template-areas:
      "pick options"
      "qty  options"
      "chance chance"
      "actions actions"
      "results results";
    align-items: start;
  }

  #screenWeapons .cardBlock:nth-of-type(1){ grid-area: pick; }
  #screenWeapons .cardBlock:nth-of-type(2){ grid-area: qty; }
  #screenWeapons .cardBlock:nth-of-type(3){ grid-area: options; }
  #screenWeapons .chance-panel{ grid-area: chance; }
  #screenWeapons .actionBar{ grid-area: actions; }
  #screenWeapons .resultsStack{ grid-area: results; }

  #screenCraft{
    grid-template-columns: 1.12fr .88fr;
    grid-template-areas:
      "pick options"
      "qty  options"
      "actions actions"
      "results results";
    align-items: start;
  }

  #screenCraft .cardBlock:nth-of-type(1){ grid-area: pick; }
  #screenCraft .cardBlock:nth-of-type(2){ grid-area: qty; }
  #screenCraft .cardBlock:nth-of-type(3){ grid-area: options; }
  #screenCraft .actionBar{ grid-area: actions; }
  #screenCraft .resultsStack{ grid-area: results; }
}

/* =========================================================
   6) FORM CONTROLS
   ========================================================= */
.fieldLabel{
  display: block;
  margin: 10px 0 6px;
  color: rgba(255,255,255,.72);
  font-weight: 900;
  letter-spacing: .2px;
}

select,
input[type="text"],
input[type="number"]{
  width: 100%;
  min-height: var(--cc-control-h);

  border-radius: var(--cc-radius-sm);
  border: 1px solid rgba(255,255,255,.14);

  background: rgba(0,0,0,.18);
  color: rgba(255,255,255,.92);

  padding: 12px 14px;
  outline: none;

  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

select:hover,
input[type="text"]:hover,
input[type="number"]:hover{
  background: rgba(0,0,0,.22);
}

select:focus,
input[type="text"]:focus,
input[type="number"]:focus{
  border-color: rgba(53,198,255,.40);
  box-shadow: 0 0 0 4px rgba(53,198,255,.16);
}

/* Better select colors for dark */
select{ cursor: pointer; }
select option,
select optgroup{
  background: var(--panel-2, #2b2f49);
  color: rgba(255,255,255,.92);
}

/* Differentiation: weapon vs craft selects */
select.select-weapon{ border-color: rgba(124,92,255,.32); }
select.select-weapon:focus{
  border-color: rgba(124,92,255,.56);
  box-shadow: 0 0 0 4px rgba(124,92,255,.16);
}
select.select-craft{ border-color: rgba(255,211,105,.30); }
select.select-craft:focus{
  border-color: rgba(255,211,105,.55);
  box-shadow: 0 0 0 4px rgba(255,211,105,.18);
}

/* Search row (input + clear) */
.search-row{
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 10px;
  align-items: center;
}
.clearX{
  width: 44px;
  height: 44px;
  border-radius: var(--cc-radius-sm);
  padding: 0;

  border: 1px solid rgba(255,107,107,.35);
  background:
    linear-gradient(180deg, rgba(255,107,107,.22), rgba(255,255,255,.02)),
    rgba(255,255,255,.03);
  color: rgba(255,255,255,.92);

  font-weight: 950;
  cursor: pointer;
  transition: transform .08s ease, border-color .18s ease, background .18s ease;
}
.clearX:hover{
  border-color: rgba(255,107,107,.55);
  background:
    linear-gradient(180deg, rgba(255,107,107,.28), rgba(255,255,255,.03)),
    rgba(255,255,255,.05);
}
.clearX:active{ transform: translateY(1px); }
.clearX:focus-visible{ outline: none; box-shadow: 0 0 0 4px rgba(255,107,107,.18); }

/* =========================================================
   7) SELECTED PREVIEW
   ========================================================= */
.selected-preview{
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;

  padding: 12px;
  border-radius: var(--cc-radius);
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);

  justify-content: flex-start; /* (merged) */
}
.selected-preview img{
  width: 54px;
  height: 54px;
  border-radius: 16px;
  object-fit: contain;
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 10px 22px rgba(0,0,0,.25);
  flex: 0 0 auto;
}
.selected-main{ min-width: 0; flex: 1; }
.selected-name{
  font-size: 17px;
  font-weight: 950;
  line-height: 1.15;
}
.selected-sub{
  margin-top: 4px;
  font-size: 12px;
  opacity: .72;
  line-height: 1.2;
}

/* =========================================================
   8) QUANTITY CONTROLS
   ========================================================= */
.qty-row{
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  gap: 8px;
  align-items: center;
}
.qty-row button{
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--cc-radius-sm);

  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.92);

  font-weight: 950;
  cursor: pointer;

  transition: transform .08s ease, background .18s ease, border-color .18s ease;
}
.qty-row button:hover{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.20);
}
.qty-row button:active{ transform: translateY(1px); }

.qty-row input{
  text-align: center;
  font-weight: 950;
  font-size: 18px;
  padding: 10px 10px;
  min-height: 44px;
}

/* tiny screens */
@media (max-width: 360px){
  .qty-row{ gap: 6px; }
  .qty-row button{ min-width: 40px; }
  .qty-row input{ font-size: 17px; }
}

/* =========================================================
   9) CHECKBOX OPTIONS (card toggles)
   ========================================================= */
.checks-stack{
  display: grid;
  gap: 10px;
}

.checkbox-row{
  display: flex;
  align-items: center;
  gap: 12px;

  padding: 12px 12px;
  border-radius: var(--cc-radius);
  border: 1px solid rgba(255,255,255,.12);

  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.82);

  user-select: none;
  cursor: pointer;

  transition: background .18s ease, border-color .18s ease, transform .08s ease;
}
.checkbox-row:hover{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.16);
}
.checkbox-row:active{ transform: translateY(1px); }

.checkbox-row input[type="checkbox"]{
  width: 22px;
  height: 22px;
  accent-color: var(--cc-accent);
  flex: 0 0 auto;
}

/* =========================================================
   10) CHANCE PANEL
   ========================================================= */
.chance-panel{
  position: relative;
  overflow: hidden;
}
.chance-panel::after{
  content: "";
  position: absolute;
  inset: -2px;
  pointer-events: none;
  background: radial-gradient(520px 220px at 20% 0%, rgba(255,211,105,.12), transparent 60%);
  opacity: .9;
}
.chance-panel > *{ position: relative; }

.chance-runes{
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.rune-item{
  display: grid;
  grid-template-columns: 22px 44px 1fr;
  gap: 12px;
  align-items: center;

  padding: 12px;
  border-radius: var(--cc-radius);
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);

  cursor: pointer;
  user-select: none;

  transition: background .18s ease, border-color .18s ease;
}
.rune-item:hover{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.16);
}
.rune-item input{
  width: 22px;
  height: 22px;
  accent-color: var(--cc-accent2);
}
.rune-item img{
  width: 44px;
  height: 44px;
  border-radius: 16px;
  object-fit: contain;
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.10);
}
.chance-result{
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--cc-radius);
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.18);

  color: rgba(255,255,255,.82);
  font-weight: 850;
  line-height: 1.5;
}

/* Two columns for runes on wider screens */
@media (min-width: 720px){
  .chance-runes{ grid-template-columns: 1fr 1fr; }
}

/* =========================================================
   11) ACTION BAR + PRIMARY BUTTON
   ========================================================= */
.actionBar{ display: grid; gap: 10px; }

.primaryAction{
  width: 100%;
  min-height: 50px;

  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);

  background:
    radial-gradient(700px 220px at 20% 0%, rgba(53,198,255,.20), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.04)),
    rgba(124,92,255,.25);

  box-shadow: var(--cc-shadow-soft);
  color: rgba(255,255,255,.96);

  font-weight: 950;
  letter-spacing: .25px;
  cursor: pointer;

  transition: transform .08s ease, filter .18s ease, border-color .18s ease;
}
.primaryAction:hover{
  filter: brightness(1.06);
  border-color: rgba(255,255,255,.20);
}
.primaryAction:active{ transform: translateY(1px); }
.primaryAction:focus-visible{
  outline: none;
  box-shadow: 0 0 0 4px rgba(53,198,255,.18), var(--cc-shadow-soft);
}

/* =========================================================
   12) RESULTS (materials + craft steps)
   ========================================================= */
.resultsStack{ display: grid; gap: 12px; }

.results{
  background:
    radial-gradient(520px 200px at 0% 0%, rgba(124,92,255,.12), transparent 65%),
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
}

.resultHeader{
  display: flex;
  align-items: center;
  gap: 12px;

  padding-bottom: 10px;
  margin-bottom: 12px;

  border-bottom: 1px solid rgba(255,255,255,.10);
}

.resultHeaderIcon{
  width: 46px;
  height: 46px;
  border-radius: 16px;
  object-fit: contain;
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.10);
  flex: 0 0 auto;
}

.resultHeaderText{ min-width: 0; }
.resultHeaderText h2{
  margin: 0;
  font-size: 16px;
  font-weight: 950;
  line-height: 1.2;
  color: rgba(255,255,255,.94);
}

.resultSubtitle{
  margin: 6px 0 0;
  font-size: var(--cc-small);
  font-weight: 900;
  color: rgba(255,255,255,.70);
}

/* Category sections */
.category{
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--cc-radius);

  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.16);
}
.category h3{
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .9px;
  text-transform: uppercase;
  color: rgba(255,255,255,.70);
}

/* List rows */
ul{ list-style: none; padding-left: 0; margin: 0; }

.item{
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
  align-items: center;

  padding: 10px;
  border-radius: var(--cc-radius);
  border: 1px solid transparent;

  background: rgba(255,255,255,.03);
  transition: background .18s ease, border-color .18s ease;
}
.item + .item{ margin-top: 8px; }

.item:hover{
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.10);
}

.item img{
  width: 40px;
  height: 40px;
  border-radius: 14px;
  object-fit: contain;
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.10);
}

/* Qty highlight */
.item span{
  min-width: 0;
  line-height: 1.2;
  color: rgba(255,255,255,.90);
  font-weight: 800;
}
.item span strong{
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  margin-right: 8px;

  background: rgba(53,198,255,.14);
  border: 1px solid rgba(53,198,255,.22);
  color: rgba(255,255,255,.94);
  font-weight: 950;
}

/* Craft steps "Tier" small */
.item small{
  display: inline-block;
  margin-left: 8px;
  font-size: 11px;
  font-weight: 900;
  opacity: .7;
}

/* =========================================================
   13) COPY / EXPORT BUTTONS (inside results)
   ========================================================= */
.copy-wrap{
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed rgba(255,255,255,.12);

  display: grid;
  gap: 10px;
}

.copy-btn{
  width: 100%;
  min-height: 46px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.92);

  font-weight: 950;
  cursor: pointer;

  transition: transform .08s ease, border-color .18s ease, background .18s ease, filter .18s ease;
}
.copy-btn:hover{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.20);
}
.copy-btn:active{ transform: translateY(1px); }
.copy-btn:focus-visible{ outline: none; box-shadow: 0 0 0 4px rgba(53,198,255,.16); }

.copy-btn .copy-icon{ font-size: 18px; line-height: 1; }

/* Variant colors */
.copy-btn.copy-text{
  background:
    linear-gradient(180deg, rgba(45,227,142,.16), rgba(255,255,255,.03));
  border-color: rgba(45,227,142,.25);
}
.copy-btn.copy-text:hover{ border-color: rgba(45,227,142,.42); }

.copy-btn.copy-export{
  background:
    linear-gradient(180deg, rgba(124,92,255,.22), rgba(53,198,255,.10));
  border-color: rgba(124,92,255,.28);
}
.copy-btn.copy-export:hover{ border-color: rgba(124,92,255,.46); }

.copy-status{
  display: none;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .2px;

  padding: 8px 10px;
  border-radius: 999px;

  color: rgba(255,255,255,.86);
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.12);

  text-align: center;
  justify-self: start;
}
.copy-status:not(:empty){ display: inline-block; }

/* Two buttons side-by-side on desktop */
@media (min-width: 720px){
  .copy-wrap{
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
  .copy-status{
    grid-column: 1 / -1;
    justify-self: center;
  }
}

/* =========================================================
   14) PRICES PANEL (TC editor)
   ========================================================= */
.price-panel{
  padding: 12px;
  background: rgba(255,255,255,.035);
}

.price-total{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.price-title{
  font-weight: 950;
  letter-spacing: .2px;
  color: rgba(255,255,255,.92);
}

.tc-badge{
  display: inline-flex;
  align-items: center;
  gap: 8px;

  padding: 8px 10px;
  border-radius: 999px;

  border: 1px solid rgba(255,211,105,.18);
  background: rgba(255,211,105,.08);
  font-weight: 950;
}
.tc-badge img{
  width: 18px;
  height: 18px;
  border-radius: 6px;
  object-fit: contain;
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.10);
}

/* Toggle */
.price-toggle{
  margin-top: 10px;
  width: 100%;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;

  padding: 10px 12px;
  border-radius: var(--cc-radius);
  border: 1px solid rgba(255,255,255,.12);

  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.90);
  font-weight: 950;

  cursor: pointer;
  box-shadow: none;

  transition: background .18s ease, border-color .18s ease;
}
.price-toggle:hover{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.16);
}
.price-toggle .chev{ opacity: .65; transition: transform .18s ease, opacity .18s ease; }

/* Sticky mode (JS toggles .prices-open) */
.price-panel.prices-open{
  padding: 0;
  overflow: auto;
  max-height: min(72vh, 640px);
  border-color: rgba(255,255,255,.12);
}
.price-sticky{
  position: sticky;
  top: 0;
  z-index: 20;

  background: rgba(20,21,38,.92);
  backdrop-filter: blur(10px);

  padding: 12px;
  border-bottom: 1px solid rgba(255,255,255,.10);
}
.price-body{ padding: 0 12px 12px; }

/* Grid rows */
.price-grid{
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.price-row{
  display: grid;
  grid-template-columns: 1fr 110px;
  gap: 10px;
  align-items: center;

  padding: 10px;
  border-radius: var(--cc-radius);

  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.16);

  transition: border-color .18s ease, background .18s ease;
}
.price-row:nth-child(even){ background: rgba(0,0,0,.14); }
.price-row:hover{
  border-color: rgba(255,211,105,.22);
  background: rgba(255,211,105,.06);
}
.price-row:focus-within{
  border-color: rgba(53,198,255,.30);
  box-shadow: 0 0 0 4px rgba(53,198,255,.12);
}

.price-name{
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.price-name img{
  width: 28px;
  height: 28px;
  border-radius: 12px;
  object-fit: contain;
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.10);
}
.price-name span{
  min-width: 0;
  font-weight: 900;
  line-height: 1.15;
}

.price-row input{
  width: 110px;
  justify-self: end;
  text-align: right;

  padding: 10px 10px;
  min-height: 40px;

  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.24);

  font-weight: 950;
}
.price-row input:focus{
  border-color: rgba(255,211,105,.35);
  box-shadow: 0 0 0 4px rgba(255,211,105,.14);
}

@media (max-width: 520px){
  .price-row{ grid-template-columns: 1fr 92px; }
  .price-row input{ width: 92px; }
}

/* =========================================================
   15) EXPORT IMAGE (PNG TEMPLATE)
   Keep width 1280 for consistent exports.
   ========================================================= */
.exportRoot{
  position: fixed;
  left: 0;
  top: 0;

  width: 1280px;
  padding: 60px;

  transform: translateX(calc(-100% - 240px));
  visibility: hidden;
  pointer-events: none;
  z-index: -1;
}

/* Export card theme */
.exportCard{
  position: relative;
  overflow: hidden;

  border-radius: 30px;
  border: 1px solid rgba(255,255,255,.12);

  background:
    radial-gradient(1100px 620px at 12% 0%, rgba(124,92,255,.22), transparent 60%),
    radial-gradient(1000px 560px at 88% 0%, rgba(53,198,255,.18), transparent 60%),
    radial-gradient(900px 520px at 55% 120%, rgba(255,211,105,.10), transparent 60%),
    linear-gradient(180deg, #15162a, #0f1020);

  box-shadow: 0 28px 70px rgba(0,0,0,.65);
  color: rgba(255,255,255,.95);
}

/* Date pill */
.exportDate{
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 5;

  padding: 10px 14px;
  border-radius: 999px;

  font-size: 16px;
  font-weight: 950;
  letter-spacing: .3px;

  color: rgba(255,255,255,.88);
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(6px);

  box-shadow: 0 14px 28px rgba(0,0,0,.35);
}

/* Header */
.exportHeader{
  display: flex;
  align-items: center;
  gap: 24px;

  padding: 36px 36px 22px;
}

.exportIcon{
  width: 158px;
  height: 158px;
  border-radius: 32px;
  object-fit: contain;

  background: rgba(0,0,0,.28);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 18px 30px rgba(0,0,0,.35);
  flex: 0 0 auto;
}

.exportTitle{
  margin: 0;
  font-size: 52px;
  font-weight: 950;
  letter-spacing: .2px;
  line-height: 1.08;
}

.exportMeta{
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 20px;
}

.exportBadge{
  display: inline-flex;
  align-items: center;
  gap: 10px;

  padding: 10px 16px;
  border-radius: 999px;

  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
}
.exportBadge img{
  width: 20px;
  height: 20px;
  border-radius: 8px;
  object-fit: contain;
  background: rgba(0,0,0,.28);
  border: 1px solid rgba(255,255,255,.12);
}

/* Body */
.exportBody{
  padding: 26px 36px 36px;
  border-top: 1px solid rgba(255,255,255,.10);
}

.exportSection{ margin-top: 22px; }
.exportSectionTitle{
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 950;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,.70);
}

.exportGrid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.exportGrid.twoCols{
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.exportRow{
  display: flex;
  align-items: center;
  gap: 18px;

  padding: 20px 24px;
  border-radius: 22px;

  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
}

.exportRow img{
  width: 62px;
  height: 62px;
  border-radius: 18px;
  object-fit: contain;
  background: rgba(0,0,0,.28);
  border: 1px solid rgba(255,255,255,.12);
}

.exportRowName{
  flex: 1;
  min-width: 0;

  font-size: 28px;
  font-weight: 950;
}

.exportRowQty{
  margin-left: auto;
  font-size: 28px;
  font-weight: 950;
  opacity: .95;
}

/* Watermark */
.exportWatermark{
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);

  font-size: 22px;
  font-weight: 950;
  padding: 8px 14px;
  border-radius: 999px;

  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.18);
  opacity: .82;
}

/* During export, remove heavy effects to help mobile */
.exportRoot.exporting .exportCard,
.exportRoot.exporting .exportRow,
.exportRoot.exporting .exportDate{ box-shadow: none !important; }
.exportRoot.exporting .exportDate{ backdrop-filter: none !important; }

/* =========================================================
   16) EXPORT LOADING OVERLAY
   ========================================================= */
.exportLoading{
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: grid;
  place-items: center;

  background: rgba(0,0,0,.45);
  backdrop-filter: blur(4px);
}
.exportLoading[hidden]{ display: none; }

.exportLoadingCard{
  width: min(420px, calc(100% - 28px));
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 12px;

  padding: 16px;
  border-radius: 18px;

  background: rgba(20,21,38,.92);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 18px 60px rgba(0,0,0,.45);
}

.exportLoadingText strong{
  display: block;
  font-weight: 950;
  letter-spacing: .2px;
  color: rgba(255,255,255,.92);
}
.exportLoadingText small{
  display: block;
  margin-top: 2px;
  opacity: .75;
  font-weight: 800;
}

/* Spinner */
.spinner{
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 3px solid rgba(255,255,255,.18);
  border-top-color: rgba(53,198,255,.95);
  animation: ccSpin .8s linear infinite;
  align-self: start;
}
@keyframes ccSpin{ to{ transform: rotate(360deg); } }

.exportProgress{
  grid-column: 1 / -1;
  width: 100%;
  height: 6px;
  margin-top: 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
}
.exportProgressBar{
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cc-accent2), var(--cc-accent));
  border-radius: 999px;
  transition: width .2s ease;
}

/* =========================================================
   17) FOOTER WIDTH (match page container)
   ========================================================= */
#appFooter{
  width: min(var(--cc-maxw), 100%);
  margin: 0 auto 22px;
  padding: 0 var(--cc-page-pad);
}
.page + #appFooter{ margin-top: 14px; }

/* =========================================================
   18) RESPONSIVE TYPO / SPACING
   ========================================================= */
@media (min-width: 920px){
  :root{
    --cc-page-pad: 14px;
    --cc-container-pad: 20px;
    --cc-card-pad: 16px;
    --cc-gap: 14px;

    --cc-h1: 30px;
    --cc-h2: 16px;
    --cc-body: 15px;
  }

  .tabs{ margin-top: 14px; }
}

@media (min-width: 1200px){
  :root{ --cc-maxw: 1100px; }
}

/* =========================================================
   19) INVENTORY (Screen)
   ========================================================= */

/* Inventory wrapper uses the same card styling, but without the default padding */
.invCard{
  padding: 0 !important;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: min(78vh, 860px);

  background:
    radial-gradient(1000px 280px at 10% 0%, rgba(124,92,255,.18), transparent 60%),
    radial-gradient(900px 240px at 60% 0%, rgba(53,198,255,.12), transparent 55%),
    var(--cc-panel);
}

/* header */
.invHeaderScreen{ justify-content: flex-start; gap: 12px; }

.invBack{
  width: 40px;
  height: 40px;
  border-radius: 16px;
  padding: 0;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.92);
  cursor: pointer;
  flex: 0 0 auto;
}
.invBack:hover{ background: rgba(255,255,255,.09); }
.invBack:active{ transform: translateY(1px); }

.invHeader{
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(255,255,255,.10);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.invHeaderLeft{
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  margin-left: 0; /* (merged PC fix) */
}
.invIcon{
  width: 42px;
  height: 42px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  flex: 0 0 auto;
}
.invTitle{
  font-size: 15px;
  font-weight: 950;
  line-height: 1.1;
}
.invSubtitle{
  font-size: 12px;
  opacity: .70;
  margin-top: 3px;
  line-height: 1.2;
}

.invBody{
  padding: 12px 14px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
}

.invPanel{
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.14);
  border-radius: 18px;
  padding: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  height: auto !important; /* (merged PC fix) */
}

/* Collapsible sections (Inventory) */
.invSection{ padding: 0; } /* summary/body handle padding */
.invSectionSummary{
  list-style: none;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
}
.invSectionSummary::-webkit-details-marker{ display: none; }
.invSectionSummary::after{
  content: "▾";
  opacity: .65;
  font-size: 14px;
  transition: transform .15s ease;
}
.invSection[open] > .invSectionSummary::after{ transform: rotate(-180deg); }

.invSectionTitle{
  font-weight: 950;
  letter-spacing: .2px;
}
.invSectionMeta{
  font-size: 12px;
  opacity: .70;
  white-space: nowrap;
}
.invSectionBody{
  padding: 0 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.invResultsSection .invSectionBody{ padding-top: 2px; }

/* Empty placeholder */
.invEmpty{
  padding: 10px 4px;
  border: 1px dashed rgba(255,255,255,.16);
  border-radius: 16px;
  background: rgba(255,255,255,.03);
}
.invEmptyTitle{
  font-weight: 950;
  margin-bottom: 4px;
}
.invEmptyText{ opacity: .75; line-height: 1.35; }

/* Search */
.invSearchRow{
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 10px;
  align-items: center;
}
.invClear{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  padding: 0;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,107,107,.30);
  color: rgba(255,255,255,.92);
  cursor: pointer;
}
.invClear:hover{ border-color: rgba(255,107,107,.50); background: rgba(255,107,107,.08); }

/* Filter chips */
.invFilterChips{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chip{
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.10);
  color: rgba(255,255,255,.90);
  font-weight: 900;
  font-size: 12px;
  cursor: pointer;
}
.chip.active{
  border-color: rgba(53,198,255,.26);
  background: rgba(53,198,255,.10);
}

.invHint{
  font-size: 12px;
  opacity: .72;
  line-height: 1.35;
}

/* Inventory list */
.invList{
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}
.invList::-webkit-scrollbar{ width: 8px; }
.invList::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.10);
  border-radius: 999px;
}

.invRow{
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  margin-bottom: 10px;

  min-width: 0; /* (merged overflow fix) */
}
.invRow img{
  width: 52px;
  height: 52px;
  border-radius: 16px;
  object-fit: contain;
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.08);
}
.invRowTitle{
  font-weight: 950;
  line-height: 1.15;
  font-size: 14px;

  min-width: 0;
  overflow: hidden;

  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.invRowSub{
  font-size: 11px;
  opacity: .68;
  margin-top: 3px;
  line-height: 1.2;

  min-width: 0;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

/* Qty on inventory rows */
.invQty{
  display: grid;
  grid-template-columns: 38px 96px 38px;
  gap: 8px;
  align-items: center;
}
.invQty input{
  width: 96px;
  padding: 10px 10px;
  text-align: center;
  border-radius: 16px;
}
.invStep{
  width: 38px;
  height: 46px;
  border-radius: 16px;
  padding: 0;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.92);
  cursor: pointer;
}
.invStep:hover{ background: rgba(255,255,255,.09); }

@media (min-width: 920px){
  .invQty{ grid-template-columns: 40px 120px 40px; }
  .invQty input{ width: 120px; }
}

.invRow.flash{
  border-color: rgba(53,198,255,.36);
  box-shadow: 0 0 0 6px rgba(53,198,255,.14);
  animation: flashPulse 1.2s ease-out 1;
}
@keyframes flashPulse{
  0%{ transform: scale(1); }
  35%{ transform: scale(1.01); }
  100%{ transform: scale(1); }
}

/* Footer */
.invFooter{
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(255,255,255,.10);
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.invFooter button{
  height: 46px;
  border-radius: 16px;
  font-weight: 950;
  color: rgba(255,255,255,.92);
  cursor: pointer;
}
.invFooter button:active{ transform: translateY(1px); }

.invSecondary{
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
}
.invDanger{
  background: rgba(255,107,107,.18);
  border: 1px solid rgba(255,107,107,.28);
}
.invDanger:hover{ filter: brightness(1.02); }

/* Meta lines */
.invMeta{
  display: block;
  margin-top: 2px;
  font-size: 11px;
  opacity: .68;
}

/* Small badge */
.badge-inv{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(53,198,255,.22);
  background: rgba(53,198,255,.10);
  font-weight: 900;
  font-size: 12px;
}

/* Inventory preview (What's missing) */
.invPreviewTop{
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,.10);
}
.invPreviewTitle{
  font-weight: 950;
  letter-spacing: .2px;
}
.invModeSwitch{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.modeBtn{
  padding: 10px 10px;
  border-radius: 14px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.10);
  color: rgba(255,255,255,.92);
  font-weight: 950;
  cursor: pointer;
}
.modeBtn.active{
  border-color: rgba(124,92,255,.35);
  background: rgba(124,92,255,.14);
}
.invTargetRow{
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 10px;
  align-items: center;
}
.invTargetSelect{
  width: 100%;
  padding: 12px 12px;
  border-radius: 16px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.92);
  font-weight: 900;
}

/* Bottom row: qty + primary action (merged final behavior set in desktop MQ too) */
.invTargetBottom{
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.invQtyControl{
  display: grid;
  grid-template-columns: 1fr 96px 1fr;
  gap: 8px;
  align-items: center;
  width: 100%;
  max-width: none;
}
.invQtyBtn{
  width: 100%;
  min-width: 42px;
  height: 44px;
  border-radius: 16px;
  padding: 0;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.92);
  cursor: pointer;
}
.invQtyBtn:hover{ background: rgba(255,255,255,.09); }
#invTargetQty{
  width: 100%;
  min-width: 0;
  padding: 10px 10px;
  border-radius: 16px;
  text-align: center;
}

/* Inventory primary action (Show missing) */
.invPrimary{
  height: 46px;
  border-radius: 16px;
  width: 100%;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  color: rgba(255,255,255,.96);
  font-weight: 950;
  letter-spacing: .2px;

  cursor: pointer;

  border: 1px solid rgba(255,211,105,.30);
  background:
    radial-gradient(520px 160px at 20% 0%, rgba(47, 154, 253, 0.34), transparent 60%),
    linear-gradient(180deg, rgba(105, 153, 255, 0.2), rgba(94, 50, 175, 0.06)),
    rgba(0,0,0,.18);

  box-shadow: 0 10px 22px rgba(0,0,0,.22);
  transition: transform .08s ease, filter .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.invPrimary:hover{
  filter: brightness(1.06);
  border-color: rgba(30, 54, 190, 0.46);
  box-shadow: 0 12px 26px rgba(0,0,0,.26);
}
.invPrimary:active{ transform: translateY(1px); }
.invPrimary:focus-visible{
  outline: none;
  box-shadow: 0 0 0 4px rgba(255,211,105,.18), 0 12px 26px rgba(0,0,0,.26);
}
.invPrimary:disabled{
  opacity: .55;
  cursor: not-allowed;
  filter: none;
  box-shadow: none;
}
#invShowMissing::before{
  content: "🔎";
  font-size: 16px;
  line-height: 1;
}

.invPreviewNote{
  font-size: 12px;
  opacity: .72;
  line-height: 1.35;
}

/* Results blocks inside inventory */
#invMissingMaterials.results,
#invMissingCraftSteps.results{
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
}

/* Missing list: completed items */
.item.is-complete{
  opacity: .72;
  filter: saturate(.85);
}
.item.is-complete strong{ opacity: .9; }

.invMeta.invDone{
  display: inline-block;
  margin-top: 4px;
  opacity: .9;
  font-weight: 800;
}

/* =========================================================
   INVENTORY — compact normalization of results blocks
   (kept, because these were lower in your file)
   ========================================================= */
#screenInventory .invResultsSection > .invSectionSummary{
  padding: 10px 12px;
  min-height: 44px;
  align-items: center;
}
#screenInventory .invResultsSection > .invSectionBody{
  padding: 6px 10px 10px;
  gap: 10px;
}

#screenInventory #invMissingMaterials.results,
#screenInventory #invMissingCraftSteps.results{
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
}

#screenInventory .results .resultHeader{
  gap: 10px;
  padding-bottom: 8px;
  margin-bottom: 10px;
}
#screenInventory .results .resultHeaderIcon{
  width: 42px;
  height: 42px;
  border-radius: 14px;
}
#screenInventory .results .resultHeaderText h2{
  font-size: 15px;
  line-height: 1.2;
}
#screenInventory .results .resultSubtitle{
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.25;
}

#screenInventory .results .category{
  margin-top: 10px;
  padding: 10px;
  border-radius: 14px;
}
#screenInventory .results .category h3{
  margin-bottom: 8px;
  font-size: 11px;
  letter-spacing: .8px;
}
#screenInventory .results .item{
  grid-template-columns: 36px 1fr;
  gap: 10px;
  padding: 9px;
  border-radius: 14px;
}
#screenInventory .results .item + .item{ margin-top: 8px; }
#screenInventory .results .item img{
  width: 36px;
  height: 36px;
  border-radius: 12px;
}
#screenInventory .results .item span{
  font-weight: 850;
  line-height: 1.2;
}
#screenInventory .results .item span strong{
  padding: 2px 7px;
  margin-right: 7px;
  font-size: 13px;
}
#screenInventory .results .invMeta{
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.25;
  opacity: .72;
}

/* =========================================================
   INVENTORY — responsive tweaks (kept)
   ========================================================= */
@media (min-width: 980px){
  .invBody{ grid-template-columns: 1.15fr .85fr; align-items: start; }
  .invPanel{ height: 100%; }
  .invList{ max-height: calc(78vh - 260px); }
}

@media (max-width: 520px){
  .invCard{ min-height: 84vh; }
  .invFooter{ grid-template-columns: 1fr; }

  #screenInventory .invResultsSection > .invSectionSummary{
    padding: 9px 10px;
    min-height: 42px;
  }
  #screenInventory .invResultsSection > .invSectionBody{ padding: 6px 8px 10px; }
  #screenInventory #invMissingMaterials.results,
  #screenInventory #invMissingCraftSteps.results{
    padding: 9px;
    border-radius: 13px;
  }
  #screenInventory .results .category{
    padding: 9px;
    border-radius: 13px;
  }
  #screenInventory .results .item{
    padding: 8px;
    grid-template-columns: 34px 1fr;
    gap: 9px;
  }
  #screenInventory .results .item img{
    width: 34px;
    height: 34px;
  }
}

/* Desktop: slightly roomier but still consistent */
@media (min-width: 980px){
  #screenInventory .invResultsSection > .invSectionSummary{ padding: 11px 12px; }
  #screenInventory .invResultsSection > .invSectionBody{ padding: 8px 12px 12px; }

  #screenInventory #invMissingMaterials.results,
  #screenInventory #invMissingCraftSteps.results{
    padding: 12px;
    border-radius: 16px;
  }
  #screenInventory .results .category{
    padding: 12px;
    border-radius: 16px;
  }
  #screenInventory .results .item{
    padding: 10px;
    grid-template-columns: 38px 1fr;
  }
}

/* =========================================================
   MOBILE: full-bleed container (fills screen) + no top radius
   ========================================================= */
@media (max-width: 640px){
  .page{
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .container{
    padding: 12px !important;
    border-radius: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    min-height: calc(100vh - 0px) !important;
  }

  .tabs{ margin-top: 8px !important; }

  #appFooter{
    width: 100% !important;
    margin: 0 !important;
    padding: 0 12px 18px !important;
  }
}

/* =========================================================
   INVENTORY — mobile: flatten nested cards for readability
   ========================================================= */
@media (max-width: 640px){
  .invBody{ padding: 10px 10px; gap: 10px; }
  .invPanel{ padding: 10px; border-radius: 16px; }

  /* remove "card inside card" in results */
  #invMissingMaterials.results,
  #invMissingCraftSteps.results{
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
  }

  .invResultsSection .category{
    margin: 10px 0 0;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
  }

  .invResultsSection .category h3{
    margin: 0;
    padding: 8px 2px 6px;
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    opacity: .75;
  }

  .invResultsSection .category ul{
    margin: 0;
    padding: 0;
    list-style: none;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
  }

  .invResultsSection .category ul .item{
    margin: 0 !important;
    padding: 10px 2px !important;
    border-radius: 0 !important;
    background: transparent !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(255,255,255,.10);
  }
  .invResultsSection .category ul .item:last-child{ border-bottom: 0; }

  .invResultsSection .category ul .item img{
    width: 28px;
    height: 28px;
    border-radius: 10px;
  }

  .invResultsSection .invMeta{
    display: block;
    margin-top: 2px;
    font-size: 11px;
    opacity: .72;
    line-height: 1.2;
  }

  .invResultsSection .item.is-complete{ opacity: .68; }
}

/* =========================================================
   INVENTORY: fix overflow horizontal + long names
   ========================================================= */
#screenInventory,
#screenInventory .invCard,
#screenInventory .invBody,
#screenInventory .invPanel,
#screenInventory .invList{
  overflow-x: hidden !important;
}

/* Mobile: shrink qty block to fit */
@media (max-width: 520px){
  #screenInventory .invQty{
    display: grid;
    grid-template-columns: 1fr 72px 1fr;
    gap: 6px;
    align-items: center;
  }
  #screenInventory .invQty input{
    width: 72px;
    min-width: 72px;
    padding: 10px 8px;
  }
  #screenInventory .invStep{
    width: 100%;
    height: 44px;
    border-radius: 16px;
  }
}

/* =========================================================
   INVENTORY (PC) — remove empty gap when "Your inventory" closed
   ========================================================= */
@media (min-width: 980px){
  .screenInventory .invBody{
    display: grid;
    grid-template-columns: minmax(360px, 1fr) minmax(420px, 1fr);
    gap: 16px;
    align-items: start;
  }

  .screenInventory .invBody:has(#invSectionItems:not([open])){
    grid-template-columns: 1fr;
  }

  .screenInventory #invSectionItems:not([open]){
    grid-column: 1 / -1;
    margin-bottom: 8px;
  }

  .screenInventory #invSectionItems:not([open]) + #invPanelPreview{
    grid-column: 1 / -1;
  }

  .screenInventory #invSectionItems:not([open]) > .invSectionSummary{
    border-radius: 14px;
  }
}

/* =========================================================
   INVENTORY — PC fixes (final overrides)
   ========================================================= */
@media (min-width: 980px){
  header.invHeader.invHeaderScreen{ justify-content: flex-start ; }

  /* target row (final) */
  .invTargetBottom{
    display: grid;
    grid-template-columns: max-content 1fr;
    column-gap: 16px;
    row-gap: 10px;
    align-items: center;
  }

  /* Keep qty control compact and stable */
  .invQtyControl{
    width: fit-content;
    max-width: none;
    grid-template-columns: 44px 96px 44px;
  }
  .invQtyBtn{ width: 44px; }
  #invTargetQty{ width: 96px; }

  /* Button fills its column without colliding */
  #invShowMissing.invPrimary{
    white-space: nowrap;
    width: 100%;
    min-width: 260px;
    padding: 0 16px;
    justify-self: stretch;
  }

  /* Allow Your inventory to fully expand */
  #invSectionItems[open] .invList{
    max-height: none !important;
    overflow: visible !important;
  }
  #invSectionItems[open]{ overflow: visible; }
}
/* =========================================================
   INVENTORY — Mobile compact + better +/- buttons
   (paste at the END of your CSS)
   ========================================================= */
@media (max-width: 520px){

  /* 1) Recuperar espaço lateral (padding externo) */
  .container{ padding-left: 10px !important; padding-right: 10px !important; }
  .invBody{ padding: 8px !important; gap: 10px !important; }
  .invPanel{ padding: 8px !important; border-radius: 16px !important; }

  /* 2) Cards (invRow) menos “gordos” sem perder clique */
  .invRow{
    grid-template-columns: 44px 1fr auto !important; /* ícone menor */
    gap: 10px !important;
    padding: 8px !important;
    border-radius: 16px !important;
    margin-bottom: 8px !important;
  }
  .invRow img{
    width: 44px !important;
    height: 44px !important;
    border-radius: 14px !important;
  }

  /* 3) Tipografia levemente menor (pra caber melhor) */
  .invRowTitle{ font-size: 13px !important; }
  .invRowSub{ font-size: 11px !important; }

  /* 4) Área do +/- + input mais “justa” e botões mais legíveis */
  #screenInventory .invQty{
    grid-template-columns: 44px 76px 44px !important; /* botões com área boa */
    gap: 8px !important;
  }

  #screenInventory .invQty input{
    width: 76px !important;
    min-width: 76px !important;
    padding: 10px 8px !important;
    font-size: 16px !important;
    font-weight: 950 !important;
  }

  /* Botões + e - (o que você reclamou: texto minúsculo) */
  #screenInventory .invStep{
    height: 44px !important;
    border-radius: 16px !important;

    font-size: 22px !important;     /* ✅ deixa o símbolo grande */
    font-weight: 1000 !important;
    line-height: 1 !important;

    display: grid !important;
    place-items: center !important;
  }

  /* Melhora toque e evita highlight estranho no mobile */
  #screenInventory .invStep,
  #screenInventory .invStep *{
    -webkit-tap-highlight-color: transparent;
  }

  /* Opcional: deixa o input/btns um pouco mais “grudados” e eficientes */
  #screenInventory .invStep{ min-width: 44px !important; }
}

/* Extra: se o mobile ainda estiver “espaçoso demais”, pode reduzir mais aqui */
@media (max-width: 380px){
  .invBody{ padding: 6px !important; }
  .invPanel{ padding: 7px !important; }
  .invRow{ padding: 7px !important; }
}
/* =========================================================
   INVENTORY — Header alignment fix (stop pushing to the right)
   ========================================================= */
header.invHeader.invHeaderScreen{
  justify-content: flex-start !important;
}
/* INVENTORY — stronger danger button */
.invFooter .invDanger{
  background: linear-gradient(180deg, rgba(255, 70, 70, .32), rgba(255, 70, 70, .18));
  border: 1px solid rgba(255, 70, 70, .55);
  box-shadow: 0 10px 22px rgba(0,0,0,.22);
}

.invFooter .invDanger:hover{
  filter: brightness(1.08);
  border-color: rgba(255, 70, 70, .72);
}

.invFooter .invDanger:active{
  transform: translateY(1px);
}

.invFooter .invDanger::before{
  content: "⚠️";
  margin-right: 10px;
}
/* Floating "Back to top" (discreet) */
.toTopBtn{
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 999;

  width: 44px;
  height: 44px;
  border-radius: 999px;

  border: 1px solid rgba(255,255,255,.14);
  background: rgba(20,21,38,.55);
  backdrop-filter: blur(10px);

  color: rgba(255,255,255,.92);
  font-weight: 1000;
  font-size: 18px;

  display: grid;
  place-items: center;

  cursor: pointer;

  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease, background .18s ease, border-color .18s ease;
}

.toTopBtn.is-visible{
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.toTopBtn:hover{
  background: rgba(20,21,38,.72);
  border-color: rgba(53,198,255,.30);
}

.toTopBtn:active{ transform: translateY(1px); }

/* não cobrir UI do Inventory (que já tem muito controle embaixo) */
#screenInventory[style*="display: grid"] ~ .toTopBtn,
#screenInventory:not([hidden]) ~ .toTopBtn{
  bottom: 74px;
}

/* opcional: esconder total se usuário desativar */
.toTopBtn.is-disabled{ display: none !important; }

/* DEV toast (bottom popup) */
.ccToast{
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%) translateY(10px);
  z-index: 9999;

  padding: 10px 14px;
  border-radius: 999px;

  background: rgba(20,21,38,.85);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(10px);

  color: rgba(255,255,255,.92);
  font-weight: 950;
  font-size: 13px;

  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.ccToast.show{
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}