/* ui/shared/item-sheet.css — Item Inspector modal (DIM pass; centered in the
   R2 D2-flow pass). Tap a vault row → this modal appears centered with the full
   gear card, VS EQUIPPED deltas, and a visible action row. z-index 34: above
   overlays (30), below toasts (40) — ui-design-system §3. Same comic-terminal
   language as the loadout overlay; tap targets ≥44px. */

.item-sheet-root {
  position: fixed;
  inset: 0;
  z-index: 34;
  font-family: 'Courier New', Courier, monospace;
  text-transform: uppercase;
  letter-spacing: 1px;
  /* UI SCALE (docs/ui-scale-vault-view.md): the sheet is appended straight to
     document.body (vault.js), outside the .ob-overlay/.loadout-overlay zoom
     roots (styles.css:21) — adopt the same zoom here so stats text scales
     with the accessibility setting like every other menu. inset:0 above is
     percentage-based (100% of the viewport-anchored containing block), so
     the root still fills the true viewport under zoom; only literal vh/vw
     lengths inside (below) need compensating — see C2 comments. */
  zoom: var(--ui-scale, 1);
}

.is-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 20, 0.62);
}

.is-sheet {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  /* Viewport units resolve against the true viewport, then render magnified
     by the ancestor zoom (see .item-sheet-root above) — dividing by
     --ui-scale here nets back to the real screen fraction so the sheet
     can't exceed it (100vw as the narrow-screen width fallback; 86vh as
     the height cap below). The 560px design cap is intentionally left
     un-divided so the sheet still grows with UI SCALE like the rest of
     the zoomed menus, same as every other length in this file. */
  width: min(560px, calc(100vw / var(--ui-scale, 1)));
  max-height: calc(86vh / var(--ui-scale, 1));
  display: flex;
  flex-direction: column;
  background: var(--void, #0a0e2a);
  border: 1px solid var(--green-dim, rgba(51,255,102,.25));
  box-shadow: 0 0 0 1px rgba(51, 255, 102, .08), 0 12px 48px rgba(0, 0, 0, .65);
  padding-bottom: 8px;
  animation: is-pop-in .16s ease-out;
}
@keyframes is-pop-in {
  from { transform: translate(-50%, calc(-50% + 16px)); opacity: 0; }
  to   { transform: translate(-50%, -50%);              opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .is-sheet { animation: none; }
}

/* Bottom-sheet drag-handle affordance — hidden since the sheet became a
   centered modal (R2 D2-flow); the element stays in the DOM for stability. */
.is-grip { display: none; }

.is-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.is-body .is-card { margin: 0; }

/* ── VS EQUIPPED delta readout ──────────────────────────────────────────── */
.is-compare {
  border: 1px solid var(--green-dim, rgba(51,255,102,.25));
  background: rgba(51, 255, 102, .03);
  padding: 8px 10px;
}
.is-compare-head {
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--amber, #ffb000);
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.is-compare-empty .is-compare-head { color: var(--green-dim, rgba(51,255,102,.25)); margin-bottom: 0; }
.is-compare-grid {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 3px 12px;
  align-items: baseline;
}
.is-cmp-h {
  font-size: 8px;
  letter-spacing: 1.5px;
  color: var(--green, #33ff66);
  opacity: .55;
}
.is-cmp-k { font-size: 10px; color: var(--amber, #ffb000); opacity: .85; letter-spacing: .5px; }
.is-cmp-v { font-size: 11px; color: var(--green, #33ff66); font-weight: 700; text-align: right; }
.is-cmp-w { font-size: 11px; color: var(--green, #33ff66); opacity: .55; text-align: right; }
.is-cmp-d { font-size: 10px; text-align: center; min-width: 14px; }
.is-cmp-up   { color: var(--green, #33ff66); }
.is-cmp-down { color: #ff5d5d; }
.is-cmp-even { color: var(--green-dim, rgba(51,255,102,.25)); }

/* ── Action row ─────────────────────────────────────────────────────────── */
.is-actions {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 14px 6px;
  border-top: 1px solid var(--green-dim, rgba(51,255,102,.25));
  align-items: center;
}
/* Neutralize the global absolute-positioned .touch-btn inside the sheet
   (same fix the loadout overlay applies). */
.item-sheet-root .touch-btn { position: static; transform: none; }

.is-action {
  flex: 1 1 auto;
  min-height: 44px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 1.5px;
  cursor: pointer;
  background: none;
  border: 1px solid var(--green-dim, rgba(51,255,102,.25));
  color: var(--green, #33ff66);
  transition: background .1s, color .1s, border-color .1s;
}
.is-action-equip {
  background: rgba(51, 255, 102, .08);
  border-color: var(--green, #33ff66);
  font-weight: 700;
}
.is-action-equip:hover { background: var(--green, #33ff66); color: var(--void, #0a0e2a); }
.is-action-fav { color: var(--amber, #ffb000); }
.is-action-fav.active { border-color: var(--amber, #ffb000); background: rgba(255, 176, 0, .12); }
.is-action-junk.active { border-color: #ff5d5d; color: #ff5d5d; background: rgba(255, 93, 93, .08); }
.is-action-dismantle { color: #ff5d5d; border-color: rgba(255, 93, 93, .4); }
.is-action-dismantle.confirming {
  background: rgba(255, 93, 93, .18);
  border-color: #ff5d5d;
  font-weight: 700;
}
.is-action-close { flex: 0 1 auto; opacity: .8; }
.is-action-change {
  color: var(--amber, #ffb000);
  border-color: rgba(255, 176, 0, .45);
}
.is-action-change:hover {
  background: rgba(255, 176, 0, .12);
  border-color: var(--amber, #ffb000);
}
.is-equipped-tag {
  flex: 1 1 auto;
  text-align: center;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--green, #33ff66);
  border: 1px solid var(--green, #33ff66);
}

/* named-arsenal-spec.md §5.2/§10 a3 — the refuse-and-explain for exotic
   dismantle. Same shape as .is-equipped-tag (a static reason, not a button);
   gold to read as "exotic", not red (dismantle's own color) — this isn't a
   danger state, it's the identity of the item itself. */
.is-exotic-locked-tag {
  flex: 1 1 auto;
  text-align: center;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--gold, #ffd479);
  border: 1px solid var(--gold, #ffd479);
}

/* Free-ability slot step inside the inspect sheet (replaces the body-mounted
   av-slot-sheet for the click-to-inspect path). */
.is-slot-pick {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.is-slot-pick-title {
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--amber, #ffb000);
  text-align: center;
  margin-bottom: 4px;
}
.is-slot-btn {
  width: 100%;
  text-align: left;
  justify-content: flex-start;
}

/* Focused cell (controller) — matches the design-system focus treatment. */
.is-action.ui-focused {
  outline: 2.5px solid var(--amber, #ffb000);
  outline-offset: 1px;
  box-shadow: 0 0 12px rgba(255, 176, 0, .45);
}

/* Landscape phones: the sheet would eat the whole short screen — cap it and
   let the body scroll. */
@media (max-height: 480px) {
  .is-sheet { max-height: calc(94vh / var(--ui-scale, 1)); }
  .is-body { padding: 4px 12px 6px; gap: 6px; }
  .is-actions { padding: 6px 12px 4px; }
  .is-action { min-height: 40px; }
}

/* ── THE SOURCE ROW — "where do I farm this?" (progression.md §0 Phase 2) ──── */
/* Deliberately quieter than .is-compare: the compare block is the decision you
   came here to make, this is the follow-up. Same border language, no fill. */
.is-source {
  border: 1px solid var(--green-dim, rgba(51,255,102,.25));
  padding: 8px 10px;
}
.is-source-head {
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--amber, #ffb000);
  margin-bottom: 6px;
}
.is-source-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
}
.is-source-row + .is-source-row { border-top: 1px solid rgba(51,255,102,.12); }
.is-source-name {
  flex: 1 1 auto;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--green, #33ff66);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* ≥44px tap target per the sheet's own action rule, without the visual weight
   of a primary action — this is a shortcut, not the point of the screen. */
.is-source-farm {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 6px 12px;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--amber, #ffb000);
  background: transparent;
  border: 1px solid var(--amber-dim, rgba(255,176,0,.4));
  cursor: pointer;
}
.is-source-farm:hover,
.is-source-farm:focus-visible { background: rgba(255,176,0,.12); }
.is-source-note {
  margin-top: 6px;
  font-size: 9px;
  line-height: 1.4;
  color: var(--green-dim, rgba(51,255,102,.45));
}
