/* Equipment workbench: quiet surfaces, physical modules, clear interaction states. */
#terra-app.command-v55 .te-workbench {
  --te-ink: #242c32;
  --te-muted: #788187;
  --te-line: #d4d8da;
  --te-accent: #bc8b36;
  --te-paper: #fafbf9;
  --te-field: #eef0ef;
  width: 100%;
  min-width: 0;
  container-type: inline-size;
  container-name: equipment55;
  padding: 24px 0 8px;
  color: var(--te-ink);
  border-top: 1px solid var(--te-line);
  font: 12px/1.5 Arial, 'Microsoft YaHei', sans-serif;
}
#terra-app.command-v55 .te-workbench * { box-sizing: border-box; }
#terra-app.command-v55 .te-workbench [hidden] { display: none !important; }
#terra-app.command-v55 .te-workbench :is(h4, p) { margin: 0; min-height: 0; }
#terra-app.command-v55 .te-workbench button {
  font: inherit !important;
  letter-spacing: 0 !important;
  text-align: left;
  width: auto;
  min-width: 0;
  color: var(--te-ink) !important;
  background: var(--te-paper) !important;
  border: 1px solid var(--te-line) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  margin: 0 !important;
  clip-path: none !important;
  transform: none !important;
  cursor: pointer;
}
#terra-app.command-v55 .te-workbench button:hover:not(:disabled) { border-color: #88969f !important; background: #fff !important; color: var(--te-ink) !important; }
#terra-app.command-v55 .te-workbench button:focus-visible { outline: 2px solid var(--te-accent) !important; outline-offset: 3px !important; }
#terra-app.command-v55 .te-workbench button:disabled { color: #848c91 !important; background: #edf0ef !important; border-color: #d6dbdd !important; opacity: 1; cursor: not-allowed; }
#terra-app.command-v55 .te-header, #terra-app.command-v55 .te-inventory-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
#terra-app.command-v55 .te-workbench .te-kicker { display: block; font: 8px/1.7 Consolas, monospace; letter-spacing: .13em; color: var(--te-muted); }
#terra-app.command-v55 .te-workbench h4 { padding: 0; margin: 2px 0 0; border: 0; font: 700 18px/1.4 Arial, 'Microsoft YaHei', sans-serif; letter-spacing: .03em; color: var(--te-ink); }
#terra-app.command-v55 .te-mode { flex-shrink: 0; padding: 5px 8px; background: #e7e9e5; font-size: 9px; color: #656e72; }
#terra-app.command-v55 .te-workbench .te-help { margin: 12px 0 20px; font-size: 10px; line-height: 1.7; color: #788187; }
#terra-app.command-v55 .te-mount-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 0 9px; border-bottom: 1px solid var(--te-line); font-size: 11px; }
#terra-app.command-v55 .te-mount-label > span { color: var(--te-muted); font: 9px/1.5 Consolas, 'Microsoft YaHei', monospace; }
#terra-app.command-v55 .te-hardpoints, #terra-app.command-v55 .te-hull-mounts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 12px; }
#terra-app.command-v55 .te-hardpoints { position: relative; padding: 13px; background: #e8ebea; border: 1px solid #d8dddd; }
#terra-app.command-v55 .te-hardpoints::before { content: ''; position: absolute; top: 8px; bottom: 8px; left: calc(50% - .5px); width: 1px; background: #c8cfd2; pointer-events: none; }
#terra-app.command-v55 .te-mount { position: relative; min-width: 0; }
#terra-app.command-v55 .te-workbench .te-slot { display: flex; flex-direction: column; align-items: stretch; width: 100%; min-height: 170px; padding: 11px 10px 13px; border-color: #cbd1d4 !important; background: #f5f6f3 !important; overflow: visible; }
#terra-app.command-v55 .te-slot-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 11px; }
#terra-app.command-v55 .te-slot-head > span { font: 7px/1.5 Consolas, monospace; letter-spacing: .05em; color: #929a9e; }
#terra-app.command-v55 .te-workbench .te-model { display: block; width: 100%; height: 98px; min-height: 0; flex: 0 0 auto; overflow: visible; pointer-events: none; }
#terra-app.command-v55 .te-slot-name { display: block; font-size: 11px; line-height: 1.5; font-weight: 700; overflow-wrap: anywhere; }
#terra-app.command-v55 .te-slot-stat { display: block; margin-top: 5px; color: #889095; font-size: 8px; line-height: 1.55; min-height: 25px; }
#terra-app.command-v55 .te-workbench .te-remove { display: flex; justify-content: space-between; width: 100%; min-height: 28px; padding: 5px 10px; border-top: 0 !important; font-size: 9px !important; color: #727e85 !important; background: #ebeeed !important; }
#terra-app.command-v55 .te-workbench .te-remove:hover:not(:disabled) { color: #92592e !important; border-color: #bc9c78 !important; }
#terra-app.command-v55 .te-hull-label { margin-top: 22px; }
#terra-app.command-v55 .te-hull-mounts .te-slot { min-height: 156px; }
#terra-app.command-v55 .te-hull-mounts .te-model { height: 82px; }
#terra-app.command-v55 .te-workbench .is-locked .te-slot { border-style: dashed !important; }
#terra-app.command-v55 .te-workbench .is-locked .te-model { opacity: .38; }
#terra-app.command-v55 .te-workbench .is-locked .te-slot-head > span { color: #a0a6a9; }
#terra-app.command-v55 .te-workbench .te-slot.is-compatible { border-color: #c19a54 !important; background: #fffaf0 !important; outline: 1px solid #c19a5444; }
#terra-app.command-v55 .te-workbench .te-slot.is-compatible .te-slot-head > span { color: #ae813c; }
#terra-app.command-v55 .te-workbench .te-slot.is-incompatible { opacity: .47; }
#terra-app.command-v55 .te-workbench .te-slot.is-drop-target { outline: 3px solid #b88836; outline-offset: 1px; background: #f5e6c5 !important; }
#terra-app.command-v55 .te-inventory-head { margin-top: 27px; padding-top: 21px; border-top: 1px solid var(--te-line); }
#terra-app.command-v55 .te-workbench .te-clear { min-height: 27px; padding: 4px 8px; font-size: 9px !important; color: #7a8185 !important; background: transparent !important; }
#terra-app.command-v55 .te-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 14px 0 0; border-bottom: 1px solid #bcc4c8; }
#terra-app.command-v55 .te-workbench .te-filters button { display: flex; align-items: center; justify-content: space-between; min-width: 0; padding: 10px 8px; border: 0 !important; border-bottom: 3px solid transparent !important; font-size: 10px !important; color: #7e888d !important; background: transparent !important; }
#terra-app.command-v55 .te-workbench .te-filters button > span { font: 9px Consolas, monospace; opacity: .7; }
#terra-app.command-v55 .te-workbench .te-filters button[aria-pressed=true] { color: var(--te-ink) !important; border-bottom-color: var(--te-ink) !important; font-weight: 700 !important; }
#terra-app.command-v55 .te-selection { min-height: 66px; padding: 13px 0 14px; color: #899196; }
#terra-app.command-v55 .te-selection-title { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; font-weight: 700; }
#terra-app.command-v55 .te-selection-title > small { flex-shrink: 0; color: #a08250; font-size: 9px; font-weight: 400; }
#terra-app.command-v55 .te-workbench .te-selection p { color: #929a9f; margin: 5px 0 0; font-size: 9px; line-height: 1.6; }
#terra-app.command-v55 .te-selection.has-selection { color: var(--te-ink); }
#terra-app.command-v55 .te-workbench .te-counter { display: block; margin-top: 5px; color: #8c9498; font-size: 8px; line-height: 1.6; }
#terra-app.command-v55 .te-inventory { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-content: start; gap: 8px; max-height: 385px; padding: 3px 5px 8px 3px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #b7bfc3 #eef0ef; }
#terra-app.command-v55 .te-workbench .te-item { position: relative; display: flex; flex-direction: column; align-items: stretch; min-width: 0; min-height: 151px; padding: 9px 8px 23px; background: #f5f6f4 !important; border-color: #d6dcde !important; cursor: grab; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
#terra-app.command-v55 .te-item-top { display: flex; justify-content: space-between; gap: 5px; font: 8px/1.2 Consolas, 'Microsoft YaHei', monospace; color: #a18b61; }
#terra-app.command-v55 .te-item-top b { color: #485961; font-size: 11px; }
#terra-app.command-v55 .te-item-top small { color: #a0a8ab; font-size: 8px; font-weight: 400; }
#terra-app.command-v55 .te-item .te-model { height: 67px; margin: 4px 0 3px; }
#terra-app.command-v55 .te-item-name { font-size: 10px; line-height: 1.5; font-weight: 700; overflow-wrap: anywhere; }
#terra-app.command-v55 .te-item-type { font-size: 8px; line-height: 1.6; color: #9ba2a5; margin-top: 4px; }
#terra-app.command-v55 .te-workbench .te-item.is-selected { border: 2px solid #b78a3e !important; padding: 8px 7px 22px; background: #fcf8ee !important; }
#terra-app.command-v55 .te-workbench .te-item.is-depleted { cursor: not-allowed; background: #eef0ee !important; }
#terra-app.command-v55 .te-workbench .te-item.is-depleted .te-model { opacity: .35; }
#terra-app.command-v55 .te-workbench .te-item.is-depleted .te-item-name { color: #a2a9ad; }
#terra-app.command-v55 .te-drag-grip { position: absolute; bottom: 1px; right: 1px; display: grid; place-items: center; width: 34px; height: 28px; touch-action: none; cursor: grab; }
#terra-app.command-v55 .te-drag-grip svg { width: 16px; height: 16px; fill: #9ea8ad; pointer-events: none; }
#terra-app.command-v55 .is-depleted .te-drag-grip { display: none; }
#terra-app.command-v55 .te-workbench .te-status { min-height: 30px; padding-top: 12px; font-size: 9px; line-height: 1.7; color: #8d969b; }
#terra-app.command-v55 .te-workbench .te-empty { padding: 28px 15px; text-align: center; color: #8d969b; font-size: 11px; background: #eef0ef; }
#terra-app.command-v55 .te-workbench[aria-busy=true] { cursor: progress; }
#terra-app.command-v55 .te-workbench[aria-busy=true] .te-inventory { opacity: .6; }
.te-drag-ghost { position: fixed; top: 0; left: 0; z-index: 9999; width: 140px; padding: 8px; background: #fffef7f2; color: #24333c; border: 2px solid #b78a3e; box-shadow: 0 8px 30px #17242c33; pointer-events: none; font: 10px/1.5 Arial, 'Microsoft YaHei', sans-serif; }
.te-drag-ghost .te-model { display: block; width: 100%; height: 83px; }
.te-drag-ghost b { display: block; text-align: center; }
@media (max-width: 1100px) and (min-width: 701px) {
  #terra-app.command-v55 .te-hardpoints { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #terra-app.command-v55 .te-inventory { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  #terra-app.command-v55 .te-workbench { padding-top: 20px; }
  #terra-app.command-v55 .te-mode { font-size: 8px; padding: 4px 6px; }
  #terra-app.command-v55 .te-hardpoints { padding: 8px; gap: 7px; }
  #terra-app.command-v55 .te-workbench .te-slot { padding: 9px 8px 11px; min-height: 159px; }
  #terra-app.command-v55 .te-workbench .te-model { height: 84px; }
  #terra-app.command-v55 .te-hull-mounts .te-model { height: 76px; }
  #terra-app.command-v55 .te-slot-name { font-size: 10px; }
  #terra-app.command-v55 .te-slot-head > span { font-size: 6px; }
  #terra-app.command-v55 .te-inventory { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 460px; gap: 8px; }
  #terra-app.command-v55 .te-item .te-model { height: 86px; }
  #terra-app.command-v55 .te-workbench .te-item { min-height: 168px; padding: 10px 10px 26px; }
  #terra-app.command-v55 .te-workbench .te-item.is-selected { padding: 9px 9px 25px; }
  #terra-app.command-v55 .te-item-name { font-size: 11px; }
  #terra-app.command-v55 .te-drag-grip { width: 44px; height: 35px; }
}
@media (prefers-reduced-motion: reduce) {
  #terra-app.command-v55 .te-workbench * { animation: none !important; transition: none !important; }
}

/* Full-width base / online docks use the space as a rack, never giant cards.
 * Queries are based on the workbench width rather than the browser width. */
@container equipment55 (min-width: 680px) {
  #terra-app.command-v55 .te-hardpoints { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #terra-app.command-v55 .te-inventory { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@container equipment55 (min-width: 960px) {
  #terra-app.command-v55 .te-hardpoints { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #terra-app.command-v55 .te-inventory { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* V5.6: instance identity, rolled affixes, unique powers, and target comparison. */
#terra-app.command-v55 .te-slot-instance { display: block; margin-top: 5px; color: #8b9498; font: 8px/1.6 Consolas, 'Microsoft YaHei', monospace; }
#terra-app.command-v55 .te-instance-number { display: block; margin: 3px 0 5px; color: #929a9c; font: 8px/1.5 Consolas, monospace; letter-spacing: .04em; }
#terra-app.command-v55 .te-item.te-grade-5 { border-top: 2px solid #b99861 !important; }
#terra-app.command-v55 .te-item.te-grade-6 { border-top: 2px solid #ab8741 !important; background: #f4f0e6 !important; }
#terra-app.command-v55 .te-item.te-grade-6 .te-item-top { color: #947237; }
#terra-app.command-v55 .te-item.has-greater { border-top-color: #a96543 !important; }
#terra-app.command-v55 .te-greater-label { display: block; margin-top: 5px; color: #a0613e; font-size: 9px; font-weight: 700; letter-spacing: .04em; }
#terra-app.command-v55 .te-affixes { display: grid; gap: 6px; margin-top: 12px; padding-top: 9px; border-top: 1px solid #c9d0ce88; }
#terra-app.command-v55 .te-affix { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; font-size: 10px; line-height: 1.5; color: #657079; }
#terra-app.command-v55 .te-affix > b { font-weight: 600; color: #48575d; }
#terra-app.command-v55 .te-affix > small { grid-column: 1/-1; font-size: 8px; line-height: 1.4; color: #99a1a3; }
#terra-app.command-v55 .te-affix.is-greater > :is(span,b) { color: #a16040; }
#terra-app.command-v55 .te-affixes.is-compact { margin-top: 9px; padding-top: 7px; gap: 5px; }
#terra-app.command-v55 .te-affixes.is-compact .te-affix { font-size: 8px; gap: 1px 3px; }
#terra-app.command-v55 .te-affixes.is-compact .te-affix > small { font-size: 7px; }
#terra-app.command-v55 .te-power { display: block; padding: 11px 12px; margin-top: 12px; color: #957a48; background: #eee5d158; border-left: 2px solid #b29659; }
#terra-app.command-v55 .te-power > b { display: block; font-size: 11px; font-weight: 600; line-height: 1.6; color: #8f743f; }
#terra-app.command-v55 .te-power > b em { font-size: 9px; font-style: normal; white-space: nowrap; }
#terra-app.command-v55 .te-power > span { display: block; font-size: 9px; line-height: 1.75; color: #9c8c69; margin-top: 4px; }
#terra-app.command-v55 .te-power > small { display: block; font-size: 8px; color: #aaa18d; margin-top: 5px; }
#terra-app.command-v55 .te-power.is-unique { border-left-color: #a78242; background: #e6d4ac55; }
#terra-app.command-v55 .te-power.is-compact { margin-top: 9px; padding: 7px 6px; }
#terra-app.command-v55 .te-power.is-compact > b { font-size: 9px; }
#terra-app.command-v55 .te-power.is-compact > :is(span,small),
#terra-app.command-v55 .te-power.is-compact > b em { font-size: 8px; line-height: 1.6; }
#terra-app.command-v55 .te-loot-filters { display: flex; flex-wrap: wrap; gap: 5px; padding-top: 10px; }
#terra-app.command-v55 .te-workbench .te-loot-filters button { min-height: 25px; padding: 4px 7px; font-size: 8px !important; border-color: #d8dddc !important; color: #8a9396 !important; background: transparent !important; }
#terra-app.command-v55 .te-workbench .te-loot-filters button[aria-pressed=true] { background: #e9e1cc !important; border-color: #c1aa75 !important; color: #867142 !important; }
#terra-app.command-v55 .te-workbench .te-loot-filters button:disabled { opacity: .45; }
#terra-app.command-v55 .te-selection-title { flex-wrap: wrap; }
#terra-app.command-v55 .te-selection-title > small { font: 8px/1.6 Consolas, 'Microsoft YaHei', monospace; }
#terra-app.command-v55 .te-compare-targets { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 16px; }
#terra-app.command-v55 .te-workbench .te-compare-targets button { min-height: 27px; padding: 5px 10px; color: #879196 !important; font-size: 9px !important; }
#terra-app.command-v55 .te-workbench .te-compare-targets button[aria-pressed=true] { color: #333f45 !important; border-color: #87979f !important; background: #e8edeb !important; }
#terra-app.command-v55 .te-workbench .te-slot.is-compare-target { outline: 2px solid #9e8350; outline-offset: 1px; }
#terra-app.command-v55 .te-compare { margin-top: 12px; padding: 12px; background: #edf0ed; border: 1px solid #d4ddda; }
#terra-app.command-v55 .te-compare-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px 12px; border-bottom: 1px solid #cdd6d2; padding-bottom: 9px; margin-bottom: 6px; font-size: 10px; color: #637079; }
#terra-app.command-v55 .te-compare-heading small { color: #97a29f; font-size: 8px; }
#terra-app.command-v55 .te-compare-row { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr) auto; gap: 8px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid #dce1de; font-size: 10px; line-height: 1.4; color: #718078; }
#terra-app.command-v55 .te-compare-row small { font: 9px/1.6 Consolas, monospace; color: #9aa39f; }
#terra-app.command-v55 .te-compare-row b { font: 600 10px/1.5 Consolas, monospace; }
#terra-app.command-v55 .te-compare-row .is-gain { color: #5e866c; }
#terra-app.command-v55 .te-compare-row .is-loss { color: #ac7864; }
#terra-app.command-v55 .te-workbench .te-compare-note { color: #9aa49c; font-size: 8px; line-height: 1.7; margin-top: 9px; }
#terra-app.command-v55 .te-mechanisms { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-top: 15px; }
#terra-app.command-v55 .te-mechanisms > div { min-width: 0; }
#terra-app.command-v55 .te-mechanisms > div > small { font-size: 8px; color: #9caaa3; }
#terra-app.command-v55 .te-mechanisms .te-power { padding: 7px; margin-top: 7px; }
#terra-app.command-v55 .te-mechanisms .te-power > b { font-size: 9px; }
#terra-app.command-v55 .te-mechanisms .te-power > span { font-size: 8px; }
#terra-app.command-v55 .te-workbench .te-install { display: flex; justify-content: space-between; width: 100%; padding: 11px 15px; margin-top: 12px !important; color: #eee6d2 !important; background: #574d38 !important; border-color: #786c51 !important; font-size: 11px !important; }
#terra-app.command-v55 .te-workbench .te-install:hover:not(:disabled) { background: #6a5c3f !important; color: #fff1ce !important; }
#terra-app.command-v55 .te-workbench .te-install:disabled { background: #d6dad3 !important; color: #9da49b !important; border-color: #d6dad3 !important; }
#terra-app.command-v55 .te-item.te-grade-5.is-selected,
#terra-app.command-v55 .te-item.te-grade-6.is-selected { padding-top: 8px; }
@media (max-width:700px) {
  #terra-app.command-v55 .te-affixes.is-compact .te-affix { font-size: 9px; }
  #terra-app.command-v55 .te-affixes.is-compact .te-affix > small { font-size: 8px; }
  #terra-app.command-v55 .te-item .te-model { height: 76px; }
  #terra-app.command-v55 .te-compare { padding: 10px; }
  #terra-app.command-v55 .te-compare-row { grid-template-columns: minmax(0, .8fr) minmax(0, 1.1fr) auto; gap: 5px; font-size: 9px; }
  #terra-app.command-v55 .te-compare-row small { font-size: 8px; }
  #terra-app.command-v55 .te-compare-row b { font-size: 9px; }
  #terra-app.command-v55 .te-mechanisms { gap: 7px; }
}
