/* Backpack details page (below the banner): a Pip-Boy item readout and workbench mod lists.
   Type: Roboto Condensed (Fallout 4's menu face) for reading, Orbitron for section heads, Share Tech Mono for counts. */
#modal .dt {
  --dt-text: #c3efb1; --dt-bright: #e4ffd8; --dt-dim: #6f9c65; --dt-faint: #4d7346;
  --dt-line: rgba(57, 255, 20, 0.15); --dt-fill: rgba(57, 255, 20, 0.06);
  --dt-cc: #41e2ff; --dt-res: #94bbff; --dt-perk: #ffb000; --dt-neg: #ff7b67; --dt-key: #ffd23f;
  padding: 18px 22px 26px;
  font: 400 15px/1.5 'Roboto Condensed', 'Share Tech Mono', sans-serif;
  color: var(--dt-text);
}
#modal .dt * { box-sizing: border-box; }

/* Description */
.dt-desc { margin: 0; font-size: 16.5px; line-height: 1.55; color: var(--dt-text); }
.dt .cc { color: var(--dt-cc); font-weight: 700; }
.dt .num { color: var(--dt-bright); font-weight: 700; }
.dt .neg { color: var(--dt-neg); font-weight: 700; }

/* Readout: the Pip-Boy status strip */
.dt-readout { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; margin: 18px 0 0; }
.dt-read { min-width: 0; margin: 0; padding: 8px 10px 10px; background: var(--dt-fill); border-top: 2px solid rgba(57, 255, 20, 0.4); }
.dt-read dt { margin-bottom: 6px; font: 700 8px/1 'Orbitron', sans-serif; letter-spacing: 2px; color: var(--dt-dim); white-space: nowrap; }
.dt-read dd { margin: 0; font-weight: 700; font-size: 21px; line-height: 1; color: var(--dt-bright); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dt-read dd small { margin-left: 3px; font-size: 12px; font-weight: 400; color: var(--dt-dim); }
.dt-read .dt-to { margin: 0 4px; font-weight: 400; font-size: 15px; color: var(--dt-faint); }
.dt-read .dt-sub { display: block; margin-top: 5px; font-size: 12px; font-weight: 400; line-height: 1.2; color: var(--dt-dim); white-space: normal; }
.dt-read--cc { border-top-color: rgba(65, 226, 255, 0.6); }
.dt-read--cc dd { color: var(--dt-cc); }
.dt-read--res { border-top-color: rgba(148, 187, 255, 0.55); }
.dt-read--res dd { color: var(--dt-res); }

/* Sections */
.dt-sec { margin-top: 28px; }
.dt-head { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; font: 700 10px/1 'Orbitron', sans-serif; letter-spacing: 3px; color: #92e27c; text-transform: uppercase; }
.dt-head::before { content: ''; flex: none; width: 3px; height: 12px; background: var(--green); box-shadow: 0 0 8px rgba(57, 255, 20, 0.6); }
.dt-head::after { content: ''; order: 2; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(57, 255, 20, 0.4), rgba(57, 255, 20, 0.05)); }
.dt-head-meta { order: 3; font: 12px/1 'Share Tech Mono', monospace; letter-spacing: 1px; color: var(--dt-dim); text-transform: none; }
.dt-note { margin: 6px 0 10px 13px; font-size: 13px; color: var(--dt-dim); }

/* Workbench mod rows */
.dt-mods { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--dt-line); }
.dt-mod { border-bottom: 1px solid var(--dt-line); }
.dt-mod-row { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto 14px; align-items: center; gap: 2px 14px; width: 100%; margin: 0; padding: 11px 8px 11px 6px; border: 0; text-align: left; color: inherit; font: inherit; background: none; }
button.dt-mod-row { cursor: pointer; transition: background 0.12s; }
button.dt-mod-row::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--green); opacity: 0; transition: opacity 0.12s; }
button.dt-mod-row:hover { background: var(--dt-fill); }
button.dt-mod-row:hover::before, .dt-mod.is-open > .dt-mod-row::before { opacity: 1; }
.dt-mod.is-open > .dt-mod-row { background: rgba(57, 255, 20, 0.09); }
button.dt-mod-row:focus-visible { outline: 2px solid var(--amber); outline-offset: -2px; }
.dt-mod-tier { align-self: start; margin-top: 1px; padding: 3px 0 2px; font: 12px/1 'Share Tech Mono', monospace; text-align: center; color: var(--dt-dim); border: 1px solid rgba(57, 255, 20, 0.28); transition: background 0.15s, color 0.15s; }
.dt-mod.is-open .dt-mod-tier { color: #041104; background: var(--green); border-color: var(--green); box-shadow: 0 0 10px rgba(57, 255, 20, 0.45); }
.dt-mod-main { display: grid; gap: 3px; min-width: 0; }
.dt-mod-name { font-weight: 700; font-size: 16.5px; line-height: 1.2; color: var(--dt-bright); }
.dt-mod-fx { font-size: 14px; line-height: 1.4; color: var(--dt-text); }
.dt-mod-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin-top: 2px; }
.dt-mod-meta:empty { display: none; }
.dt-perk { font-weight: 700; font-size: 11.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--dt-perk); }
.dt-perk::before { content: '◆ '; font-size: 8px; vertical-align: 1px; opacity: 0.7; }
.dt-count { font: 11.5px/1 'Share Tech Mono', monospace; color: var(--dt-faint); }
.dt-mod-val { display: grid; justify-items: end; gap: 2px; align-self: center; font-variant-numeric: tabular-nums; }
.dt-mod-val b { font-weight: 700; font-size: 24px; line-height: 1; color: var(--dt-cc); }
.dt-mod-val small { font: 10.5px/1 'Share Tech Mono', monospace; color: #3ec46e; }
.dt-res { display: flex; align-items: baseline; gap: 4px; line-height: 1; }
.dt-res b { font-size: 19px; color: var(--dt-res); white-space: nowrap; }
.dt-res .dt-to { margin: 0 3px; font-weight: 400; font-size: 14px; color: var(--dt-faint); }
.dt-res i { width: 18px; font: normal 10px/1 'Share Tech Mono', monospace; color: var(--dt-dim); }
.dt-chev { width: 14px; height: 14px; fill: none; stroke: var(--dt-dim); stroke-width: 1.6; transition: transform 0.2s, stroke 0.12s; }
button.dt-mod-row:hover .dt-chev { stroke: var(--green); }
.dt-mod.is-open .dt-chev { transform: rotate(180deg); stroke: var(--green); }

/* Components drawer: slides open below its row */
.dt-drawer { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.22s ease; }
.dt-mod.is-open > .dt-drawer { grid-template-rows: 1fr; }
.dt-drawer > div { min-height: 0; overflow: hidden; visibility: hidden; transition: visibility 0s 0.22s; }
.dt-mod.is-open > .dt-drawer > div { visibility: visible; transition-delay: 0s; }
.dt-drawer .dt-parts { margin: 0 8px 12px 50px; }

/* Component lists (drawers and the crafting recipe) */
.dt-parts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 26px; margin: 0; padding: 7px 14px 8px; list-style: none; background: rgba(0, 0, 0, 0.32); border-left: 2px solid rgba(57, 255, 20, 0.35); }
.dt-parts li { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; min-width: 0; padding: 5px 0; border-bottom: 1px dotted rgba(57, 255, 20, 0.16); font-size: 14.5px; color: var(--dt-text); }
.dt-parts li:nth-last-child(1), .dt-parts li:nth-last-child(2):nth-child(odd) { border-bottom: 0; }
.dt-parts li span { min-width: 0; }
.dt-parts b { flex: none; font: 13px/1 'Share Tech Mono', monospace; color: var(--dt-bright); }
.dt-parts li.is-key span, .dt-parts li.is-key b { color: var(--dt-key); }
.dt-req { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 8px 0 10px 13px; font-size: 13px; color: var(--dt-dim); }

/* Built-in resistance (packs without resistance mods) */
.dt-fixed { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 11px 8px 11px 13px; border-top: 1px solid var(--dt-line); border-bottom: 1px solid var(--dt-line); }
.dt-fixed p { margin: 0; font-size: 14px; color: var(--dt-text); }

/* Colors */
.dt-colors { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 10px 0 0 13px; padding: 0; list-style: none; }
.dt-colors li { display: flex; align-items: center; gap: 7px; font-size: 14.5px; color: var(--dt-text); }
.dt-colors li::before { content: ''; flex: none; width: 11px; height: 11px; background: var(--sw, #888); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18), 0 0 8px color-mix(in srgb, var(--sw, #888) 45%, transparent); }

/* Location */
.dt-loc { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 18px; margin-top: 10px; padding: 12px 12px 12px 13px; background: var(--dt-fill); border-left: 2px solid rgba(57, 255, 20, 0.45); }
.dt-loc-text { display: grid; gap: 4px; min-width: 0; flex: 1 1 260px; }
.dt-loc-name { font-weight: 700; font-size: 16.5px; line-height: 1.35; color: var(--dt-bright); }
.dt .location-edid { justify-self: start; font: 11.5px/1.2 'Share Tech Mono', monospace; letter-spacing: 1px; color: var(--dt-faint); cursor: pointer; user-select: none; }
.dt .location-edid:hover { color: var(--dt-dim); }
.dt .location-edid:hover::after { content: ' ⧉ copy'; }
.dt-loc-map { flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 14px; border: 1px solid rgba(57, 255, 20, 0.55); color: var(--green); background: rgba(57, 255, 20, 0.06); font: 700 10px/1 'Orbitron', sans-serif; letter-spacing: 2px; cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 7px 100%, 0 calc(100% - 7px)); transition: background 0.12s, color 0.12s; }
.dt-loc-map:hover { color: #041104; background: var(--green); }
.dt-loc-map:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

@media (max-width: 600px) {
  #modal .dt { padding: 16px 14px 22px; }
  .dt-desc { font-size: 15.5px; }
  .dt-readout { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dt-mod-row { grid-template-columns: 26px minmax(0, 1fr) auto 12px; gap: 2px 10px; padding: 10px 4px 10px 4px; }
  .dt-mod-name { font-size: 15.5px; }
  .dt-mod-val b { font-size: 21px; }
  .dt-drawer .dt-parts { margin: 0 4px 10px 36px; }
  .dt-parts { grid-template-columns: minmax(0, 1fr); }
  .dt-parts li:nth-last-child(2):nth-child(odd) { border-bottom: 1px dotted rgba(57, 255, 20, 0.16); }
  .dt-loc-map { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .dt-drawer, .dt-drawer > div, .dt-chev, .dt-mod-tier { transition: none; }
}
