
.filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.filter-grid label {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 8px;
  padding: 6px;
}

.filter-grid input {
  width: auto;
}

.legend-box {
  display: grid;
  gap: 6px;
}

.legend-item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.legend-swatch {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.28);
}

.command-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 8px 0;
}

.command-tab {
  flex: 1;
  min-width: 76px;
  padding: 7px;
  background: var(--button2);
  font-size: 11px;
}

.command-tab.active {
  background: var(--button);
}

.command-card {
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.14);
  border-radius: 10px;
  padding: 8px;
  margin: 8px 0;
  font-size: 12px;
}

.command-card h3 {
  margin: 0 0 4px;
  font-size: 13px;
  color: #fff;
}

.command-card .meta {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 5px;
  white-space: pre-wrap;
}

.command-card .body {
  white-space: pre-wrap;
  color: var(--text);
  line-height: 1.35;
}

.command-form {
  border-top: 1px solid rgba(255,255,255,0.14);
  margin-top: 10px;
  padding-top: 10px;
}

.command-form.compact textarea {
  min-height: 58px;
}

.line-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 5px;
  align-items: center;
  padding: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-size: 12px;
}

.line-item button {
  padding: 5px 7px;
  font-size: 11px;
}

.command-warning {
  color: #ffcf8f;
  font-size: 11px;
  line-height: 1.35;
}


.player-auth-box {
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.14);
  border-radius: 10px;
  padding: 8px;
  margin-top: 8px;
}

.player-auth-box .status {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 8px;
  line-height: 1.35;
}

.player-profile-form {
  display: grid;
  gap: 6px;
}

.profile-readonly-note {
  font-size: 11px;
  color: #ffcf8f;
  line-height: 1.35;
  margin-top: 8px;
}

.auth-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.auth-row > * {
  flex: 1;
}


/* Standalone label size controller styling */
.map-label {
  transform-origin: center center !important;
  transition: transform 0.08s linear, font-size 0.08s linear, width 0.08s linear;
}


/* Improved Mastiff resource cards */
.resource-card {
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(25, 48, 82, 0.38), rgba(5, 12, 26, 0.72));
  border-color: rgba(92, 180, 255, 0.22);
}

.card-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.card-topline h3 {
  font-size: 15px;
  letter-spacing: 0.02em;
  margin: 0;
}

.status-pill {
  flex: 0 0 auto;
  border: 1px solid rgba(120, 200, 255, 0.25);
  background: rgba(30, 90, 140, 0.28);
  color: #ccecff;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 10px;
  line-height: 1;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pill.threat {
  border-color: rgba(255, 120, 120, 0.35);
  background: rgba(130, 40, 50, 0.35);
  color: #ffd0d0;
}

.money-value {
  font-size: 24px;
  line-height: 1.1;
  font-weight: 900;
  color: #dfffe5;
  text-shadow: 0 0 8px rgba(90, 255, 150, 0.28);
  margin: 6px 0 8px;
}

.command-fields {
  display: grid;
  gap: 4px;
  margin: 6px 0;
}

.command-field-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 8px;
  align-items: baseline;
  font-size: 12px;
}

.command-field-row span {
  color: var(--muted);
  font-size: 11px;
}

.command-field-row b {
  color: var(--text);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.command-image {
  width: 100%;
  max-height: 155px;
  object-fit: cover;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,0.16);
  margin-bottom: 8px;
  background: rgba(0,0,0,0.25);
}

.image-card .body,
.resource-card .body {
  border-top: 1px solid rgba(255,255,255,0.10);
  margin-top: 8px;
  padding-top: 8px;
  font-size: 12px;
  color: #dcecff;
}

.funds-card {
  border-left: 3px solid rgba(90, 255, 150, 0.45);
}

.poi-card {
  border-left: 3px solid rgba(255, 100, 100, 0.45);
}


/* Floating dossier windows */
#floatingDossierLayer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2500;
}

.floating-dossier {
  position: fixed;
  width: 360px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 90px);
  background: rgba(5, 12, 26, 0.96);
  border: 1px solid rgba(92, 180, 255, 0.36);
  border-radius: 14px;
  box-shadow: 0 16px 45px rgba(0,0,0,0.58), 0 0 18px rgba(70,160,255,0.13);
  color: var(--text);
  overflow: hidden;
  pointer-events: auto;
}

.floating-dossier-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 10px 8px;
  background: linear-gradient(180deg, rgba(31, 95, 159, 0.38), rgba(13, 27, 48, 0.78));
  border-bottom: 1px solid rgba(92,180,255,0.20);
  cursor: move;
  user-select: none;
}

.floating-title {
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 0.03em;
}

.floating-subtitle {
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
  line-height: 1.25;
}

.floating-actions {
  display: flex;
  gap: 5px;
}

.floating-actions button {
  width: 28px;
  height: 26px;
  padding: 0;
  border-radius: 7px;
  background: rgba(255,255,255,0.10);
  color: white;
  font-weight: 900;
}

.floating-actions button:hover {
  background: rgba(92,180,255,0.30);
}

.floating-dossier-content {
  padding: 10px;
  overflow-y: auto;
  max-height: calc(100vh - 155px);
}

.floating-dossier-image {
  width: 100%;
  max-height: 230px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.16);
  margin-bottom: 10px;
  background: rgba(0,0,0,0.25);
}

.floating-body {
  white-space: pre-wrap;
  border-top: 1px solid rgba(255,255,255,0.12);
  margin-top: 10px;
  padding-top: 10px;
  font-size: 13px;
  line-height: 1.45;
}

.dossier-dock {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 2400;
  display: none;
  flex-direction: column;
  gap: 6px;
  max-width: 280px;
  pointer-events: auto;
}

.dossier-dock.active {
  display: flex;
}

.dock-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  text-align: left;
  border: 1px solid rgba(92, 180, 255, 0.30);
  background: rgba(5, 12, 26, 0.92);
  box-shadow: 0 8px 22px rgba(0,0,0,0.32);
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--text);
}

.dock-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dock-item small {
  color: var(--muted);
  font-size: 10px;
}

.dragging-dossier {
  user-select: none;
}


/* Personnel dossiers and image loading fixes */
.personnel-card {
  border-left: 3px solid rgba(120, 190, 255, 0.45);
}

.image-preview-box {
  margin-top: 6px;
}

.command-image.preview {
  max-height: 120px;
}

.command-image.broken-image,
.floating-dossier-image.broken-image {
  display: block;
  min-height: 42px;
  border: 1px dashed rgba(255, 120, 120, 0.45);
  background:
    linear-gradient(135deg, rgba(120,30,40,0.18), rgba(0,0,0,0.12));
  color: #ffd0d0;
  padding: 10px;
}

.command-image.broken-image::after,
.floating-dossier-image.broken-image::after {
  content: "Image failed to load. Use a direct image URL or assets/images/file.jpg";
  display: block;
  font-size: 11px;
  color: #ffd0d0;
}


/* Mission board */
.mission-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.mission-card {
  border-left: 3px solid rgba(255, 210, 90, 0.5);
}

.mission-form {
  margin-bottom: 10px;
}

.vote-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin: 8px 0;
}

.vote-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(23, 43, 71, 0.86);
  border: 1px solid rgba(92,180,255,0.18);
  color: var(--text);
}

.vote-btn.selected {
  background: rgba(43, 115, 93, 0.82);
  border-color: rgba(120,255,190,0.35);
}

.vote-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.vote-summary {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin: 10px 0;
}

.vote-summary span {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 8px;
  padding: 7px;
  text-align: center;
  font-size: 12px;
}


/* Standalone popout controller support */
#floatingDossierLayer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2500;
}

#floatingDossierLayer .floating-dossier {
  pointer-events: auto;
}

.floating-dossier {
  min-width: 320px;
}

.floating-dossier-content .command-fields {
  margin-bottom: 8px;
}


/* Contract map link + expanded profile styling */
.mission-map-link {
  display: block;
  margin: 8px 0;
  padding: 8px 10px;
  border: 1px solid rgba(92,180,255,0.28);
  border-radius: 9px;
  background: rgba(31,95,159,0.22);
  color: #dcecff;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}

.mission-map-link:hover {
  background: rgba(31,95,159,0.38);
  filter: brightness(1.12);
}

.player-profile-form textarea {
  min-height: 62px;
}


/* Clean personnel profile display */
.personnel-sections {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.10);
  padding-top: 8px;
}

.personnel-sections section {
  display: grid;
  gap: 3px;
}

.personnel-sections h4 {
  margin: 0;
  color: #dcecff;
  font-size: 12px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.personnel-sections p {
  margin: 0;
  white-space: pre-wrap;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}


/* Supabase admin editing note */
.admin-permission-note {
  color: #ffcf8f;
  font-size: 11px;
  line-height: 1.35;
}


/* Resizable floating dossiers */
.floating-dossier {
  resize: none;
  min-width: 280px;
  min-height: 220px;
}

.floating-dossier-content {
  height: auto;
}

.resize-handle {
  position: absolute;
  z-index: 5;
  background: transparent;
}

.resize-e {
  top: 42px;
  right: 0;
  width: 8px;
  bottom: 12px;
  cursor: ew-resize;
}

.resize-s {
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 8px;
  cursor: ns-resize;
}

.resize-se {
  right: 0;
  bottom: 0;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
}

.resize-se::after {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 9px;
  height: 9px;
  border-right: 2px solid rgba(160, 220, 255, 0.75);
  border-bottom: 2px solid rgba(160, 220, 255, 0.75);
  opacity: 0.8;
}

.resizing-dossier,
.dragging-dossier {
  user-select: none;
}


/* Left sidebar mode switcher */
.sidebar-mode-nav {
  margin: 10px 0 12px;
  padding: 10px;
  border: 1px solid rgba(92, 180, 255, 0.18);
  border-radius: 12px;
  background: rgba(7, 14, 28, 0.72);
}

.sidebar-mode-title {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.sidebar-mode-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.sidebar-mode-btn {
  width: 100%;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid rgba(92, 180, 255, 0.18);
  background: rgba(17, 34, 59, 0.72);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.sidebar-mode-btn:hover {
  filter: brightness(1.08);
}

.sidebar-mode-btn.active {
  background: rgba(39, 94, 160, 0.82);
  border-color: rgba(120, 205, 255, 0.42);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.sidebar-panes {
  display: block;
}

.sidebar-pane {
  display: none;
  animation: sidebarPaneFade 0.14s ease;
}

.sidebar-pane.active {
  display: block;
}

.sidebar-pane-heading {
  margin: 0 0 10px;
  font-size: 18px;
}

.sidebar-pane #labelSizeInput {
  margin-bottom: 4px;
}

@keyframes sidebarPaneFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}


/* Supabase cloud sync */
.cloud-sync-box {
  border-color: rgba(120, 220, 255, 0.24);
  background: rgba(20, 54, 88, 0.16);
}

#cloudSyncStatus {
  color: #b9e4ff;
}


/* Auto cloud sync status */
#cloudSyncStatus {
  min-height: 1.2em;
}

.store-tabs{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-bottom:10px}.store-tab{padding:8px;border-radius:9px;background:var(--button2);font-size:12px}.store-tab.active{background:var(--button)}.store-item-card{border-left:3px solid rgba(255,210,90,.55)}.vote-progress{height:8px;border-radius:999px;background:rgba(255,255,255,.08);overflow:hidden;margin:8px 0;border:1px solid rgba(255,255,255,.10)}.vote-progress>div{height:100%;background:rgba(120,220,160,.72)}

.price-grid{display:grid;grid-template-columns:1fr 1fr;gap:5px;margin:8px 0}.price-grid div{border:1px solid rgba(255,255,255,.10);background:rgba(255,255,255,.05);border-radius:8px;padding:6px}.price-grid span{display:block;color:var(--muted);font-size:10px}.price-grid b{font-size:12px}.personal-pay-currency{margin:4px 0 8px}

/* Mastiff Operations Command v1 */
.ops-tabs{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-bottom:10px}.ops-tab{padding:8px;border-radius:9px;background:var(--button2);color:var(--text);font-size:12px;font-weight:700}.ops-tab.active{background:var(--button);border-color:rgba(120,205,255,.42)}.ops-grid{display:grid;gap:8px}.ops-resource-card{border:1px solid rgba(92,180,255,.20);border-radius:12px;padding:9px;background:rgba(10,25,45,.72)}.ops-resource-card.heat{border-color:rgba(255,125,105,.28)}.ops-resource-card b{display:block;font-size:13px}.ops-resource-card strong{display:block;font-size:24px;margin:6px 0}.ops-asset-card{border-left:3px solid rgba(90,180,255,.58)}.ops-target-card{border-left:3px solid rgba(255,190,90,.58)}.ops-stat-grid{display:grid;grid-template-columns:1fr 1fr;gap:6px}.ops-stat-grid label{display:grid;gap:3px;color:var(--muted);font-size:11px}.ops-stat-grid.readonly div{border:1px solid rgba(255,255,255,.10);border-radius:8px;padding:6px;background:rgba(255,255,255,.04)}.ops-stat-grid.readonly span{display:block;color:var(--muted);font-size:10px}.ops-stat-grid.readonly b{display:block;font-size:16px}


/* v1.0.1 hotfix */
.ops-permission-note{padding:7px 9px;margin-bottom:8px;border:1px solid rgba(92,180,255,.18);border-radius:9px;background:rgba(255,255,255,.045);color:var(--muted);font-size:11px}


/* v1.0.3 mission coordinate patch */
.mission-jump-btn {
  display: block;
  width: 100%;
  margin: 8px 0;
}


/* v1.0.4 operations permission refresh */
.ops-permission-note {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}
.mini-btn {
  padding: 5px 7px;
  font-size: 10px;
  border-radius: 7px;
}


/* v1.1 RTS target-marker actions and personnel stat controls */
.target-action-list {
  display: grid;
  gap: 4px;
  margin-top: 6px;
}
.target-action-list button {
  width: 100%;
  padding: 5px 7px;
  font-size: 11px;
}
.personnel-ops-stats {
  display: grid;
  gap: 4px;
  margin-top: 9px;
  border-top: 1px solid rgba(255,255,255,0.10);
  padding-top: 8px;
}
.personnel-ops-stats h4 {
  margin: 0 0 2px;
  color: #dcecff;
  font-size: 12px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.personnel-stat-row {
  display: grid;
  grid-template-columns: 1fr 28px 24px 24px;
  gap: 4px;
  align-items: center;
  font-size: 11px;
}
.personnel-stat-row b { text-align: center; }
.personnel-stat-row button {
  padding: 3px 0;
  min-height: 22px;
  border-radius: 6px;
}


/* v1.2 combined RTS V2/V3 */
.ops-tabs-wide {
  grid-template-columns: 1fr 1fr;
}

.faction-card {
  border-left: 3px solid rgba(180, 140, 255, 0.65);
}

.world-event-card {
  border-left: 3px solid rgba(90, 210, 255, 0.5);
}

.world-event-card.active-event {
  border-left-color: rgba(120, 255, 160, 0.7);
}

.ops-hidden-card {
  opacity: 0.82;
  border-style: dashed;
}

.target-action-list {
  display: grid;
  gap: 4px;
  margin-top: 6px;
}

.target-action-list button {
  width: 100%;
  padding: 5px 7px;
  font-size: 11px;
}


/* v1.2.1 marker strategic action menu */
.strategic-marker-menu {
  display: grid;
  gap: 5px;
  min-width: 190px;
}

.strategic-marker-menu select {
  width: 100%;
  font-size: 12px;
  padding: 5px;
  border-radius: 7px;
  background: rgba(10,18,30,.95);
  color: #f2f6ff;
  border: 1px solid rgba(255,255,255,.22);
}


/* v1.3 region ownership and territories */
.territory-details {
  margin-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.10);
  padding-top: 8px;
}

.territory-details summary {
  cursor: pointer;
  color: #dcecff;
  font-weight: 700;
  font-size: 12px;
}

.territory-details select {
  width: 100%;
  margin-top: 6px;
  background: rgba(10,18,30,.95);
  color: #f2f6ff;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 7px;
  padding: 5px;
}

#regionFactionCustomInput.hidden {
  display: none;
}


/* v1.4 inventory arsenal UI */
.player-inventory-popout {
  width: min(1180px, 94vw);
  height: min(760px, 88vh);
  left: 3vw;
  top: 5vh;
  resize: both;
  overflow: hidden;
}

.player-inventory-popout .dossier-body {
  height: calc(100% - 44px);
  overflow: auto;
}

.arsenal-ui {
  background: linear-gradient(180deg, rgba(31,38,22,.92), rgba(10,14,10,.96));
}

.arsenal-topbar {
  display:flex;
  gap:10px;
  align-items:center;
  margin-bottom:10px;
}

.arsenal-topbar select {
  flex:1;
  background:rgba(0,0,0,.55);
  color:#f4f6ed;
  border:1px solid rgba(255,255,255,.2);
  padding:8px;
  border-radius:6px;
}

.weight-pill {
  padding:8px 10px;
  border-radius:6px;
  background:rgba(0,0,0,.45);
  border:1px solid rgba(255,255,255,.14);
  color:#e8ead8;
}

.arsenal-grid {
  display:grid;
  grid-template-columns: 270px 1fr 330px;
  gap:12px;
  min-height:430px;
}

.arsenal-left,.arsenal-center,.arsenal-right,.admin-loadout-tools {
  border:1px solid rgba(255,255,255,.12);
  background:rgba(8,12,8,.55);
  border-radius:6px;
  padding:10px;
}

.arsenal-left h3,.loadout-items h3,.admin-loadout-tools h3 {
  margin:0 0 8px;
  color:#eef3df;
}

.stash-box {
  height:360px;
  overflow:auto;
  background:rgba(0,0,0,.35);
  border:1px solid rgba(255,255,255,.08);
  padding:6px;
}

.kit-paperdoll {
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:8px;
}

.arsenal-slot {
  min-height:78px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.055);
  border-radius:5px;
  padding:7px;
  overflow:hidden;
}

.arsenal-slot.filled {
  background:rgba(110,122,88,.22);
  border-color:rgba(240,255,220,.22);
}

.slot-label {
  font-size:11px;
  color:#c9d0b8;
  text-transform:uppercase;
  letter-spacing:.04em;
}

.slot-value {
  margin-top:6px;
  font-size:12px;
  color:#f6f8ee;
  overflow-wrap:anywhere;
}

.weapon-panel {
  min-height:124px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(0,0,0,.34);
  border-radius:5px;
  padding:8px;
  margin-bottom:10px;
}

.weapon-panel h4 {
  margin:0 0 8px;
  color:#dce7c7;
}

.weapon-main {
  min-height:34px;
  font-size:13px;
  color:#fff;
  overflow-wrap:anywhere;
}

.weapon-attachments {
  display:flex;
  gap:5px;
  flex-wrap:wrap;
  margin-top:8px;
}

.weapon-attachments span {
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.06);
  border-radius:4px;
  padding:3px 5px;
  font-size:10px;
}

.inventory-row {
  display:grid;
  grid-template-columns: 1fr 46px;
  gap:8px;
  padding:5px 6px;
  border-bottom:1px solid rgba(255,255,255,.07);
  font-size:12px;
}

.inventory-row span {
  overflow-wrap:anywhere;
}

.inventory-row b {
  text-align:right;
}

.loadout-items {
  margin-top:12px;
  max-height:260px;
  overflow:auto;
  background:rgba(0,0,0,.25);
  border:1px solid rgba(255,255,255,.08);
  padding:8px;
  border-radius:6px;
}

.admin-loadout-tools {
  margin-top:12px;
}

.admin-loadout-tools textarea,
.text-tool-popout textarea {
  width:100%;
  min-height:210px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size:11px;
  background:rgba(0,0,0,.55);
  color:#eef3df;
  border:1px solid rgba(255,255,255,.18);
  border-radius:6px;
  padding:8px;
}

.text-tool-popout {
  width:min(900px,90vw);
  height:min(650px,85vh);
  resize:both;
}

.text-tool-popout .dossier-body {
  height:calc(100% - 44px);
}

.text-tool-popout textarea {
  height:calc(100% - 95px);
}

.flea-market-popout {
  width:min(1120px,94vw);
  height:min(720px,88vh);
  resize:both;
  overflow:hidden;
}

.flea-market-popout .dossier-body {
  height:calc(100% - 44px);
  overflow:auto;
  background:linear-gradient(180deg, rgba(13,18,24,.98), rgba(4,7,10,.98));
}

.flea-tabs {
  position:sticky;
  top:0;
  z-index:5;
  background:rgba(4,7,10,.96);
  padding-bottom:8px;
}

.flea-market-body .store-card,
.flea-market-body .command-card {
  border-left:3px solid rgba(120,170,255,.55);
}


/* v1.5 trader market */
.market-launcher {
  border:1px solid rgba(255,255,255,.14);
  background:rgba(0,0,0,.16);
  border-radius:10px;
  padding:8px;
}

.market-status {
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.045);
  padding:7px 9px;
  border-radius:8px;
  margin-bottom:10px;
}

.flea-card {
  display:grid;
  grid-template-columns: 110px 1fr;
  gap:10px;
  align-items:start;
}

.flea-card .command-image {
  width:100%;
  max-height:110px;
  object-fit:cover;
  grid-row: span 4;
}

.trader-card {
  border-left:3px solid rgba(255,196,90,.68);
}

.trader-card.out-of-range {
  opacity:.58;
  border-left-color:rgba(255,100,90,.5);
}

.trader-card details {
  margin-top:8px;
  border-top:1px solid rgba(255,255,255,.10);
  padding-top:7px;
}

.trader-card summary {
  cursor:pointer;
  color:#dcecff;
  font-weight:700;
}


/* v1.5.1 item database and drag/drop inventory */
.item-db-form {
  border-left: 3px solid rgba(130,210,255,.65);
}

.item-db-card.warning {
  border-left: 3px solid rgba(255,190,90,.7);
}

.danger-text {
  color: #ff9b9b;
  font-weight: 900;
}

.draggable-item {
  cursor: grab;
}

.draggable-item:active {
  cursor: grabbing;
}

.drop-zone {
  outline: 1px dashed rgba(255,255,255,.10);
  transition: outline-color .12s ease, background .12s ease;
}

.drop-zone.drag-over {
  outline-color: rgba(120,210,255,.9);
  background: rgba(120,210,255,.10);
}

.loadout-items.drop-zone {
  min-height: 160px;
}

.item-db-card .command-image {
  max-height: 80px;
  object-fit: cover;
}


/* v1.5.2 admin-only profile fields */
.profile-admin-lock {
  color: #ffcf8f;
  font-size: 10px;
  font-weight: 700;
}

.player-profile-form input:disabled,
.player-profile-form select:disabled {
  opacity: 0.72;
  cursor: not-allowed;
  border-color: rgba(255, 207, 143, 0.25);
}


/* v1.5.3 player stats inventory sidebar and resize */
.player-command-popout,
.player-stats-inventory-popout {
  resize: both !important;
  overflow: auto !important;
  width: min(1220px, 95vw);
  height: min(780px, 90vh);
  min-width: 720px;
  min-height: 520px;
  max-width: 98vw;
  max-height: 96vh;
}

.player-command-popout::after,
.player-stats-inventory-popout::after {
  content: "";
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 16px;
  height: 16px;
  pointer-events: none;
  border-right: 2px solid rgba(160, 220, 255, 0.85);
  border-bottom: 2px solid rgba(160, 220, 255, 0.85);
  opacity: 0.9;
}

.player-command-popout .dossier-body,
.player-stats-inventory-popout .dossier-body {
  height: calc(100% - 44px);
  overflow: auto;
}

.sidebar-mode-buttons {
  grid-template-columns: 1fr 1fr;
}


/* v1.6 faction dossiers and launcher-style side panes */
.clickable-card {
  cursor: pointer;
}

.clickable-card:hover {
  filter: brightness(1.06);
}

.faction-dossier-popout,
.sidebar-section-popout {
  resize: both !important;
  overflow: auto !important;
  width: min(1040px, 94vw);
  height: min(720px, 88vh);
  min-width: 560px;
  min-height: 420px;
  max-width: 98vw;
  max-height: 96vh;
}

.faction-dossier-popout::after,
.sidebar-section-popout::after {
  content: "";
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 16px;
  height: 16px;
  pointer-events: none;
  border-right: 2px solid rgba(160, 220, 255, 0.85);
  border-bottom: 2px solid rgba(160, 220, 255, 0.85);
  opacity: 0.9;
}

.faction-dossier-body,
.sidebar-section-body {
  height: calc(100% - 44px);
  overflow: auto;
}

.faction-dossier-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-left: 5px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.045);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.faction-dossier-hero h2 {
  margin: 0 0 4px;
}

.faction-info-sections {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.faction-info-section {
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.18);
  border-radius: 10px;
  padding: 9px;
}

.faction-info-section h4 {
  margin: 0;
  color: #dcecff;
}

.faction-info-section p {
  margin: 6px 0 0;
  white-space: pre-wrap;
  color: var(--muted);
}

.compact-row {
  gap: 4px;
  flex-wrap: nowrap;
}

.sidebar-popout-launcher {
  border: 1px solid rgba(92, 180, 255, 0.18);
  background: rgba(7, 14, 28, 0.62);
  border-radius: 12px;
  padding: 10px;
}

.sidebar-popout-holder.hidden {
  display: none;
}

.sidebar-section-popout .section {
  margin: 0 0 12px;
}

.sidebar-section-popout .sidebar-popout-section {
  display: block;
}


/* v1.7 logistics capacity */
.ops-resource-card .small {
  margin-top: 5px;
}

.store-item-card .command-field-row b {
  overflow-wrap: anywhere;
}


/* v1.7.1 draggable kit sections */
.arsenal-slot.section-draggable,
.weapon-panel.section-draggable {
  cursor: grab;
  position: relative;
}

.arsenal-slot.section-draggable:active,
.weapon-panel.section-draggable:active {
  cursor: grabbing;
}

.arsenal-slot.section-draggable.drag-over,
.weapon-panel.section-draggable.drag-over {
  outline: 2px solid rgba(120, 220, 255, 0.95);
  background: rgba(120, 220, 255, 0.12);
}

.slot-hint {
  margin-top: 6px;
  font-size: 10px;
  color: rgba(220, 238, 255, 0.62);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.arsenal-slot:not(.filled) .slot-hint,
.weapon-panel:not(.filled) .slot-hint {
  color: rgba(255, 220, 160, 0.75);
}

.stash-box.drag-over {
  outline: 2px solid rgba(125, 255, 180, 0.9);
  background: rgba(125, 255, 180, 0.10);
}


/* v1.8 profile popout, roleplay stash and trader buyback */
.profile-popout {
  resize: both !important;
  overflow: auto !important;
  width: min(820px, 92vw);
  height: min(720px, 88vh);
  min-width: 520px;
  min-height: 420px;
}

.profile-popout-body {
  height: calc(100% - 44px);
  overflow: auto;
}

.profile-summary-card {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 10px;
}

.profile-summary-card img {
  width: 86px;
  height: 86px;
  object-fit: cover;
  border-radius: 10px;
}

.profile-summary-card h2 {
  margin: 0 0 5px;
}

.profile-edit-details {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  padding: 8px;
  background: rgba(0,0,0,.16);
}

.profile-edit-details summary {
  cursor: pointer;
  font-weight: 800;
  color: #dcecff;
}

.sticky-auth-actions {
  position: sticky;
  top: 0;
  z-index: 3;
  background: rgba(5,10,18,.92);
  padding: 8px;
  border-radius: 10px;
  margin-bottom: 10px;
}

.roleplay-stash-box {
  border-color: rgba(255, 210, 120, .22);
  background: rgba(80, 55, 12, .16);
  max-height: 190px;
}

.roleplay-stash-row {
  grid-template-columns: 1fr 42px 58px;
}

.stash-sell-select {
  width: 100%;
  margin: 4px 0 8px;
  background: rgba(0,0,0,.55);
  color: #eef3df;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 6px;
  padding: 6px;
}

.mini-sell-btn {
  padding: 3px 6px;
  font-size: 10px;
}

.inventory-row {
  align-items: center;
}

.inventory-row small {
  color: rgba(220,235,255,.62);
  margin-left: 6px;
}


/* v1.9 trader shop and image drop */
.trader-shop-popout { resize: both !important; overflow: auto !important; width:min(1180px,95vw); height:min(780px,90vh); min-width:680px; min-height:460px; }
.trader-shop-body { height:calc(100% - 44px); overflow:auto; }
.trader-category-tabs { display:flex; gap:6px; flex-wrap:wrap; margin:8px 0 10px; }
.trader-category-tabs .active { filter:brightness(1.25); border-color:rgba(140,220,255,.75); }
.trader-sell-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.sell-stash-list,.sell-basket { border:1px solid rgba(255,255,255,.12); background:rgba(0,0,0,.18); border-radius:10px; padding:8px; min-height:180px; }
.sell-basket.drag-over { outline:2px solid rgba(120,220,255,.9); background:rgba(120,220,255,.1); }
.trader-card.clickable-card { cursor:pointer; }
.trader-card.clickable-card:hover { filter:brightness(1.08); }
.image-drop-input { outline:1px dashed rgba(160,220,255,.28); }
.image-drop-input.drag-over, input.drag-over, textarea.drag-over { outline:2px solid rgba(120,220,255,.95) !important; background:rgba(120,220,255,.10) !important; }
.asset-action-card { border-left:3px solid rgba(160,220,255,.75); }


/* v1.9.1 container cargo drop zones */
.container-cargo-drop {
  margin-top: 8px;
  padding: 6px;
  border: 1px dashed rgba(190, 220, 255, 0.28);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.18);
  min-height: 52px;
}

.container-cargo-drop.drag-over {
  outline: 2px solid rgba(125, 220, 255, 0.95);
  background: rgba(125, 220, 255, 0.12);
}

.container-cargo-title {
  font-size: 10px;
  color: rgba(220, 238, 255, 0.72);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.container-cargo-row {
  display: grid;
  grid-template-columns: 1fr 32px;
  gap: 4px;
  padding: 3px 4px;
  border-top: 1px solid rgba(255,255,255,0.07);
  font-size: 10px;
  color: #eef3df;
}

.container-cargo-row span {
  overflow-wrap: anywhere;
}

.container-cargo-row b {
  text-align: right;
}

.container-cargo-row:hover {
  background: rgba(255,255,255,0.06);
}

.kit-paperdoll .arsenal-slot {
  min-height: 118px;
}


/* v1.10 asset upgrades and travel */
.travel-card {
  border-left: 3px solid rgba(115, 210, 255, .8);
}

.ops-asset-card .command-field-row b {
  overflow-wrap: anywhere;
}

#opAssetEquipment {
  min-height: 120px;
}

#opTargetTraderSettings.hidden {
  display: none;
}


/* v1.10.1 cargo hitbox and magazine-stack fixes */
.arsenal-slot.section-draggable {
  position: relative;
}

.arsenal-slot.section-draggable .container-cargo-drop {
  position: relative;
  z-index: 5;
  pointer-events: auto;
}

.arsenal-slot.section-draggable.drag-over:has(.container-cargo-drop.drag-over) {
  outline: 1px dashed rgba(190, 220, 255, 0.28);
  background: rgba(0, 0, 0, 0.10);
}

.container-cargo-drop.drag-over {
  outline: 3px solid rgba(125, 220, 255, 0.98);
  background: rgba(125, 220, 255, 0.18);
}

.inventory-row small,
.container-cargo-row small {
  display: inline-block;
  margin-left: 5px;
  color: rgba(220,235,255,.66);
  font-size: 10px;
}

.admin-only-control {
  display: inline-block;
}


/* v1.10.2 typed item slots and stash filter */
.weapon-attachment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.weapon-attachment-slot {
  border: 1px dashed rgba(190, 220, 255, 0.24);
  border-radius: 7px;
  padding: 5px;
  background: rgba(0,0,0,.14);
  min-height: 46px;
}

.weapon-attachment-slot.filled {
  border-style: solid;
  background: rgba(255,255,255,.045);
}

.weapon-attachment-slot.drag-over {
  outline: 2px solid rgba(125, 220, 255, 0.95);
  background: rgba(125, 220, 255, 0.13);
}

.stash-category-filter {
  width: 100%;
  margin: 4px 0 8px;
  background: rgba(0,0,0,.55);
  color: #eef3df;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 6px;
  padding: 6px;
}

.slot-value small,
.weapon-main small,
.weapon-attachment-slot small {
  display: inline-block;
  margin-left: 5px;
  color: rgba(220,235,255,.68);
  font-size: 10px;
}


/* v1.10.3 admin stash wipe controls */
.admin-stash-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid rgba(255, 120, 100, 0.20);
  border-radius: 9px;
  background: rgba(90, 20, 12, 0.14);
}

.admin-stash-controls .danger {
  width: 100%;
}


/* v1.10.4 Operations hotfix */
.travel-card {
  border-left: 3px solid rgba(115, 210, 255, .8);
}

.ops-asset-card .command-field-row b {
  overflow-wrap: anywhere;
}

#opAssetEquipment {
  min-height: 120px;
}

#opTargetTraderSettings.hidden {
  display: none;
}


/* v1.10.5 trader/inventory icon and category fixes */
.command-image,
.flea-card .command-image,
.item-db-card .command-image,
.store-item-icon {
  width: 128px !important;
  height: 128px !important;
  max-width: 128px !important;
  max-height: 128px !important;
  object-fit: contain !important;
  border-radius: 10px;
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.10);
}

.inv-item-icon,
.trader-inventory-row .store-item-icon,
.inventory-row .inv-item-icon,
.inventory-row .store-item-icon,
.container-cargo-row .inv-item-icon,
.weapon-main .inv-item-icon,
.slot-value .inv-item-icon,
.weapon-attachment-slot .inv-item-icon {
  width: 32px !important;
  height: 32px !important;
  max-width: 32px !important;
  max-height: 32px !important;
  object-fit: contain !important;
  border-radius: 6px;
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.10);
  margin-right: 6px;
  vertical-align: middle;
}

.trader-category-select {
  width: 100%;
  margin: 4px 0 8px;
  background: rgba(0,0,0,.55);
  color: #eef3df;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 6px;
  padding: 6px;
}

.inventory-row,
.trader-inventory-row,
.container-cargo-row {
  align-items: center;
}

.inventory-row span,
.container-cargo-row span {
  overflow-wrap: anywhere;
}


/* v1.10.6 trader card layout and sell filters */
.store-item-card.flea-card,
.flea-card.store-item-card {
  display: grid !important;
  grid-template-columns: 140px minmax(0, 1fr) !important;
  gap: 12px !important;
  align-items: start !important;
}

.store-item-card.flea-card > .store-item-icon,
.flea-card.store-item-card > .store-item-icon {
  grid-column: 1;
  grid-row: 1 / span 5;
  width: 128px !important;
  height: 128px !important;
  max-width: 128px !important;
  max-height: 128px !important;
  object-fit: contain !important;
  align-self: start;
}

.store-item-card.flea-card > .card-topline,
.store-item-card.flea-card > .command-fields,
.store-item-card.flea-card > .price-grid,
.store-item-card.flea-card > label,
.store-item-card.flea-card > select,
.store-item-card.flea-card > .row,
.store-item-card.flea-card > .vote-progress,
.store-item-card.flea-card > .body {
  grid-column: 2;
  min-width: 0;
}

.store-item-card.flea-card .command-field-row {
  grid-template-columns: minmax(105px, 150px) minmax(0, 1fr);
}

.store-item-card.flea-card .command-field-row b,
.store-item-card.flea-card .command-field-row span {
  white-space: normal;
  word-break: normal;
  overflow-wrap: anywhere;
}

.store-item-card.flea-card .price-grid {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.trader-shop-body .store-item-card {
  margin-bottom: 10px;
}

.trader-inventory-row {
  grid-template-columns: 40px minmax(0, 1fr) 44px !important;
}

.trader-inventory-row .store-item-icon {
  width: 32px !important;
  height: 32px !important;
  max-width: 32px !important;
  max-height: 32px !important;
  object-fit: contain !important;
}

.sell-stash-list .trader-category-select {
  margin: 8px 0;
}

.item-db-card .command-image,
.item-db-card .store-item-icon,
.command-card.item-db-card img {
  width: 96px !important;
  height: 96px !important;
  max-width: 96px !important;
  max-height: 96px !important;
  object-fit: contain !important;
}


/* v1.10.7 purchase destination clarity */
.store-item-card .command-field-row span {
  color: rgba(210, 230, 255, 0.82);
}


/* v1.10.8 live store refresh/editor fixes */
.trader-shop-popout .store-item-card .row .secondary,
.trader-shop-popout .store-item-card .row .danger {
  min-width: 74px;
}


/* v1.10.9 auto item database / valuation */
.item-db-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  margin: 8px 0 12px;
}

.item-db-card .command-fields {
  margin-top: 8px;
}

.inventory-row small {
  color: rgba(220,235,255,.68);
  margin-left: 6px;
}


/* v1.10.10 player reset controls */
.admin-stash-controls .hard-reset {
  margin-top: 6px;
  border-color: rgba(255, 60, 45, 0.75);
  box-shadow: 0 0 0 1px rgba(255,60,45,0.15) inset;
}

.admin-reset-note {
  border: 1px solid rgba(255, 150, 80, 0.25);
  background: rgba(120, 55, 18, 0.16);
  border-radius: 10px;
  padding: 10px;
  color: rgba(245, 235, 220, 0.94);
}


/* v1.10.11 Steam64 save hint */
.steam64-save-hint {
  margin-top: 4px;
  color: rgba(210,230,255,.68);
}


/* v1.10.12 underbarrel grenade slot */
.weapon-attachment-grid {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}


/* v1.10.13 cloud persistence hardening */
.cloud-sync-box {
  border-color: rgba(100, 190, 255, 0.26);
}

#cloudSyncStatus {
  color: rgba(220, 240, 255, 0.90);
}


/* v1.11 player transfers and company crate inventories */
.wallet-transfer-grid,
.company-crates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.transfer-panel,
.company-crate-card {
  border: 1px solid rgba(190,220,255,0.18);
  border-radius: 12px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.18);
  margin-top: 10px;
}

.transfer-panel h3,
.company-crate-card h3 {
  margin-top: 0;
}

.transfer-confirm-box {
  border: 1px dashed rgba(160, 210, 255, 0.25);
  border-radius: 10px;
  padding: 8px;
  margin-top: 8px;
  background: rgba(20, 50, 70, 0.16);
}

.crate-item-list {
  max-height: 260px;
  overflow: auto;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 6px;
  background: rgba(0,0,0,0.14);
}

.company-crate-card .inventory-row {
  grid-template-columns: 36px minmax(0, 1fr) 44px;
}


/* v1.11.1 responsive refresh coordinator */
.mastiff-refresh-line {
  min-height: 16px;
  font-size: 11px;
  color: rgba(210,230,255,.72);
  margin: 4px 0 6px;
}

.mastiff-refresh-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 99999;
  padding: 8px 12px;
  border: 1px solid rgba(160,210,255,.32);
  border-radius: 10px;
  background: rgba(10,18,26,.92);
  color: rgba(235,245,255,.95);
  box-shadow: 0 8px 28px rgba(0,0,0,.35);
  pointer-events: none;
}

button.is-busy,
button[data-busy="true"] {
  opacity: .72;
  cursor: wait !important;
}


/* v1.12.2 RTS QoL action log / proposals */
.ops-requirements {
  display: grid;
  gap: 5px;
  margin: 6px 0;
}

.ops-req {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 5px 7px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.035);
}

.ops-req.ok {
  border-color: rgba(90, 220, 140, .22);
}

.ops-req.bad {
  border-color: rgba(255, 95, 95, .35);
  background: rgba(120, 15, 15, .14);
}

.chance-good { color: #80f0a0; }
.chance-warn { color: #ffd36b; }
.chance-bad { color: #ff8d82; }

.ops-log-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.ops-log-card {
  border-left: 4px solid rgba(160, 190, 230, .55);
}

.ops-log-card.success { border-left-color: rgba(100, 230, 140, .95); }
.ops-log-card.critical-success { border-left-color: rgba(120, 255, 190, .95); box-shadow: 0 0 0 1px rgba(120,255,190,.12) inset; }
.ops-log-card.failure { border-left-color: rgba(255, 185, 90, .95); }
.ops-log-card.critical-failure { border-left-color: rgba(255, 80, 80, .95); box-shadow: 0 0 0 1px rgba(255,80,80,.15) inset; }

.ops-log-roll {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  margin: 8px 0;
  padding: 8px;
  border-radius: 10px;
  background: rgba(0,0,0,.20);
}

.ops-log-roll span {
  color: rgba(220,235,255,.72);
}

.result-success,
.result-critical-success,
.proposal-approved {
  background: rgba(70, 210, 120, .18);
  border-color: rgba(70,210,120,.35);
}

.result-failure,
.proposal-pending {
  background: rgba(255, 190, 80, .15);
  border-color: rgba(255,190,80,.32);
}

.result-critical-failure,
.proposal-denied {
  background: rgba(255, 80, 80, .16);
  border-color: rgba(255,80,80,.36);
}

.proposal-resolved {
  background: rgba(120, 190, 255, .14);
  border-color: rgba(120,190,255,.32);
}

.ops-proposal-card {
  border-left: 4px solid rgba(120,190,255,.55);
}

.ops-proposal-card.proposal-pending { border-left-color: rgba(255,210,90,.95); }
.ops-proposal-card.proposal-approved { border-left-color: rgba(90,230,140,.95); }
.ops-proposal-card.proposal-denied { border-left-color: rgba(255,90,90,.95); }
.ops-proposal-card.proposal-resolved { border-left-color: rgba(120,190,255,.95); }

.infobox.bad {
  border-color: rgba(255,80,80,.35);
  background: rgba(120,0,0,.18);
}


/* v1.12.3 World events / regional economy expansion */
.economy-card {
  border-left: 4px solid rgba(120, 230, 180, .65);
}

.ops-industry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 6px;
  margin: 8px 0;
}

.ops-industry-grid label {
  font-size: 11px;
  color: rgba(220,235,255,.75);
}

.ops-industry-grid input {
  margin-top: 3px;
}

.economy-admin-actions {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) repeat(4, minmax(92px, auto));
  gap: 6px;
  margin-top: 8px;
}

@media (max-width: 780px) {
  .economy-admin-actions {
    grid-template-columns: 1fr;
  }
}

.world-event-card.active-event {
  box-shadow: 0 0 0 1px rgba(90, 210, 255, .22) inset;
}


/* v1.12.4 NPC faction RTS actions */
.npc-action-card {
  border-left: 4px solid rgba(225, 145, 255, .75);
}

.npc-action-card h4 {
  margin: 12px 0 5px;
  color: rgba(235, 220, 255, .95);
}

.ops-log-card .status-pill.result-unknown {
  background: rgba(180,180,180,.14);
}


/* v1.12.5 clandestine faction actions */
.ops-log-card.clandestine-hidden {
  border-left-color: rgba(190, 120, 255, .95);
  background: linear-gradient(135deg, rgba(70,20,95,.16), rgba(0,0,0,.08));
}

.clandestine-box {
  border: 1px dashed rgba(205, 150, 255, .38);
  border-radius: 10px;
  padding: 8px;
  margin-top: 8px;
  background: rgba(60, 20, 90, .18);
}

.clandestine-box b {
  color: rgba(235, 210, 255, .98);
}

.clandestine-box button {
  margin-top: 7px;
}


/* v1.12.6 military units / armies */
.ops-unit-card {
  border-left: 4px solid rgba(160, 170, 255, .75);
}

.unit-info-row.unknown {
  background: rgba(80, 65, 110, .14);
}

.unit-info-row.known {
  background: rgba(50, 95, 75, .10);
}

.unit-info-row {
  grid-template-columns: minmax(90px, 160px) minmax(0, 1fr) auto;
}

.unit-known-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 6px;
  margin: 7px 0;
}

.ops-unit-div-icon {
  background: transparent;
  border: 0;
}

.ops-unit-map-icon {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(220,220,255,.9);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(20, 25, 40, .86);
  color: rgba(245,245,255,.95);
  font-size: 15px;
  box-shadow: 0 2px 9px rgba(0,0,0,.45);
}

.ops-unit-map-icon.hidden-unit {
  background: rgba(35, 20, 50, .88);
  color: rgba(235,210,255,.96);
  border-style: dashed;
}


/* v1.12.7 unit garrisons */
.garrison-summary {
  border: 1px dashed rgba(170, 210, 255, .22);
  border-radius: 9px;
  padding: 7px;
  margin: 7px 0;
  background: rgba(20, 45, 70, .13);
}

.garrison-summary b {
  display: block;
  margin-bottom: 4px;
  color: rgba(230, 245, 255, .95);
}

.unit-info-row .mini-btn,
.garrison-summary + .mini-btn {
  justify-self: end;
}

.ops-unit-map-icon {
  cursor: move;
}

.ops-unit-map-icon::after {
  content: "";
}

.ops-unit-card .command-field-row:nth-of-type(2) b {
  color: rgba(225, 235, 255, .95);
}


/* v1.13 Campaign QoL / Admin Hub */
.qol-hub-window {
  min-width: 780px;
  min-height: 520px;
}

.qol-content {
  height: calc(100% - 56px);
  overflow: auto;
}

.qol-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  position: sticky;
  top: 0;
  z-index: 5;
  padding-bottom: 8px;
  background: rgba(8,14,20,.94);
}

.qol-tabs button.active {
  border-color: rgba(120, 210, 255, .65);
  background: rgba(55, 120, 170, .28);
}

.qol-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(285px, 1fr));
  gap: 12px;
}

.qol-card {
  border: 1px solid rgba(170, 210, 255, .18);
  border-radius: 12px;
  padding: 10px;
  background: rgba(0,0,0,.18);
}

.qol-card h3 {
  margin-top: 0;
}

.qol-mini-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.qol-mini-grid div {
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  padding: 6px;
  background: rgba(0,0,0,.16);
}

.qol-mini-grid b {
  display: block;
  font-size: 18px;
}

.qol-mini-grid span {
  display: block;
  font-size: 10px;
  color: rgba(220,235,255,.72);
}

.qol-warning,
.qol-line,
.qol-search-row,
.qol-feed-row,
.qol-diag {
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  padding: 7px;
  margin: 6px 0;
  background: rgba(255,255,255,.035);
}

.qol-warning {
  border-color: rgba(255, 210, 90, .28);
  background: rgba(120, 80, 15, .14);
}

.qol-line b,
.qol-search-row b,
.qol-feed-row b,
.qol-warning b,
.qol-diag b {
  display: block;
}

.qol-line span,
.qol-search-row span,
.qol-feed-row span,
.qol-warning span,
.qol-diag span {
  display: block;
  color: rgba(225,235,245,.76);
  font-size: 12px;
}

.qol-feed {
  max-height: 430px;
  overflow: auto;
}

.qol-results {
  margin-top: 8px;
  max-height: 480px;
  overflow: auto;
}

.qol-results pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 11px;
}

.qol-diag.ok {
  border-color: rgba(95,220,140,.28);
}

.qol-diag.bad {
  border-color: rgba(255,80,80,.32);
  background: rgba(110,0,0,.16);
}

.mini-btn {
  font-size: 11px !important;
  padding: 4px 7px !important;
  width: auto !important;
}

@media (max-width: 900px) {
  .qol-hub-window {
    width: calc(100vw - 24px) !important;
    left: 12px !important;
  }
  .qol-grid {
    grid-template-columns: 1fr;
  }
}


/* v1.13.1 framework fill-out */
.qol-feed-row .danger.mini-btn {
  margin-left: 6px;
}

.qol-card .good + .secondary,
.qol-card .secondary + .secondary,
.qol-card .secondary + .good {
  margin-left: 4px;
}


/* v1.13.2 deeper QoL pass */
.qol-snapshot-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 6px 0;
  padding: 6px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  background: rgba(0,0,0,.16);
}

.qol-overlay-label {
  background: transparent;
  border: none;
}

.qol-overlay-label span {
  display: inline-block;
  padding: 2px 5px;
  border-radius: 6px;
  background: rgba(5,12,18,.78);
  color: rgba(235,245,255,.95);
  font-size: 11px;
  white-space: nowrap;
  border: 1px solid rgba(160,210,255,.22);
}

.qol-overlay-label.unit-label span {
  border-color: rgba(210,180,255,.28);
}


/* v1.13.3 sidebar section launcher restoration */
.panel.left[data-sidebar-tabbed="1"] > .section {
  margin-bottom: 0;
}

.sidebar-mode-nav {
  margin: 10px 0;
}

.sidebar-mode-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 6px;
}

.sidebar-mode-btn {
  min-height: 36px;
  white-space: normal;
  line-height: 1.15;
}

.sidebar-panes {
  margin-top: 8px;
}

.sidebar-pane {
  display: none;
}

.sidebar-pane.active {
  display: block;
}

.sidebar-popout-launcher {
  border: 1px solid rgba(160, 210, 255, .18);
  background: rgba(0,0,0,.18);
  border-radius: 12px;
  padding: 10px;
}

.sidebar-section-popout {
  min-width: 620px;
  min-height: 420px;
  resize: both;
  overflow: hidden;
}

.sidebar-section-popout .sidebar-section-body {
  height: calc(100% - 42px);
  overflow: auto;
  padding: 10px;
}

.sidebar-popout-holder.hidden {
  display: none !important;
}

@media (max-width: 850px) {
  .sidebar-section-popout {
    min-width: 92vw;
    width: 92vw !important;
    left: 4vw !important;
  }
}


/* v1.13.4 map-side regional economy controls */
.map-economy-box {
  border: 1px solid rgba(130, 210, 170, .22);
  border-radius: 12px;
  padding: 9px;
  margin: 10px 0;
  background: rgba(20, 70, 50, .12);
}
.map-economy-box h3 {
  margin: 0 0 6px;
  font-size: 14px;
  color: rgba(220, 255, 235, .95);
}
.map-economy-box .row { gap: 6px; }
.map-economy-box input, .map-economy-box select { min-width: 0; }
#regionEconomyStatus, #markerEconomyStatus {
  color: rgba(210, 235, 220, .82);
  margin-top: 4px;
}


/* v1.13.5 map-side action menus */
.map-action-menu {
  border: 1px solid rgba(255, 205, 120, .22);
  border-radius: 10px;
  padding: 8px;
  margin-top: 8px;
  background: rgba(85, 55, 15, .14);
}

.map-action-menu b {
  display: block;
  margin-bottom: 5px;
  color: rgba(255, 235, 190, .98);
}

.map-action-menu select {
  width: 100%;
  margin-bottom: 5px;
}

.map-action-menu button {
  width: 100%;
  margin-top: 5px;
}

.map-action-menu .warn {
  color: rgba(255, 190, 140, .95);
}


/* v1.13.6 player approval voting */
.proposal-vote-box {
  border: 1px solid rgba(120, 190, 255, .20);
  border-radius: 10px;
  padding: 8px;
  margin: 8px 0;
  background: rgba(25, 65, 95, .14);
}

.ops-proposal-card.proposal-player-approved {
  border-color: rgba(110, 230, 150, .35);
}

.ops-proposal-card .proposal-vote-box .row {
  margin-top: 6px;
}


/* v1.13.7 Operations Queue / Action Timers */
.ops-queue-card {
  border-color: rgba(160, 190, 255, .22);
}
.ops-queue-card.queue-ready,
.ops-queue-card.queue-in_progress {
  background: rgba(25, 55, 95, .12);
}
.status-pill.queue-ready,
.status-pill.queue-in_progress {
  background: rgba(60, 120, 200, .22);
  border-color: rgba(130, 200, 255, .35);
}
.status-pill.queue-resolved {
  background: rgba(60, 150, 90, .20);
  border-color: rgba(120, 230, 160, .32);
}
.status-pill.queue-cancelled {
  background: rgba(150, 80, 70, .20);
  border-color: rgba(240, 140, 130, .32);
}


/* v1.13.8 inventory lockdown */
.inventory-lock-banner {
  border: 1px solid rgba(255, 90, 90, .35);
  background: rgba(110, 15, 15, .22);
  border-radius: 12px;
  padding: 9px;
  margin: 0 0 9px;
}

.inventory-lock-banner b {
  display: block;
  color: rgba(255, 220, 220, .98);
}

.inventory-lock-banner span,
.inventory-lock-banner small {
  display: block;
  color: rgba(255, 230, 230, .82);
  margin-top: 3px;
}

.inventory-lock-admin {
  border: 1px solid rgba(255, 185, 95, .28);
  background: rgba(90, 60, 15, .18);
  border-radius: 12px;
  padding: 9px;
  margin: 0 0 9px;
}

.inventory-lock-admin h3 {
  margin-top: 0;
}


/* v1.13.9 character stat generation */
.character-stats-panel {
  width: 100%;
}

.stat-generation-box,
.admin-stat-editor,
.stat-meta {
  border: 1px solid rgba(150, 200, 255, .18);
  border-radius: 12px;
  padding: 10px;
  margin-top: 10px;
  background: rgba(0,0,0,.16);
}

.stat-input-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin: 8px 0;
}

.stat-input-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  padding: 6px;
  background: rgba(255,255,255,.035);
}

.stat-input-grid span {
  font-size: 12px;
  color: rgba(230,240,255,.82);
}

#pointBuyRemaining.ok { color: rgba(120, 240, 150, .95); }
#pointBuyRemaining.warn { color: rgba(255, 220, 120, .95); }
#pointBuyRemaining.bad { color: rgba(255, 120, 120, .95); }


/* v1.13.10 level / XP / stat progression */
.level-up-box {
  border-color: rgba(110, 230, 150, .25);
  background: rgba(20, 80, 45, .16);
}

.trade-stat-note {
  color: rgba(160, 240, 190, .95);
  margin: 4px 0;
}

.admin-stat-editor .row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.stat-meta .command-field-row b {
  text-align: right;
}


/* v1.13.10 progression and stat-effect framework */
.level-up-box {
  border-color: rgba(120, 240, 160, .24);
  background: rgba(25, 85, 45, .14);
}

.trade-stat-note {
  border: 1px solid rgba(120, 240, 160, .18);
  border-radius: 8px;
  padding: 5px 7px;
  margin: 5px 0;
  background: rgba(35, 90, 45, .15);
  color: rgba(205, 255, 220, .9);
}

#levelPointSpending.ok { color: rgba(120, 240, 150, .95); }
#levelPointSpending.warn { color: rgba(255, 220, 120, .95); }
#levelPointSpending.bad { color: rgba(255, 120, 120, .95); }

.admin-stat-editor .row label {
  min-width: 110px;
}


/* v1.13.11 supplier loyalty trade effects */
.trade-stat-note {
  line-height: 1.35;
}


/* v1.13.12 asset condition / repair / abandon voting */
.status-pill.asset-condition-operational {
  background: rgba(70, 210, 120, .16);
  border-color: rgba(70, 210, 120, .30);
}

.status-pill.asset-condition-damaged {
  background: rgba(255, 190, 80, .17);
  border-color: rgba(255, 190, 80, .35);
}

.status-pill.asset-condition-destroyed {
  background: rgba(255, 80, 80, .18);
  border-color: rgba(255, 80, 80, .38);
}

.status-pill.asset-condition-missing,
.status-pill.asset-condition-abandoned {
  background: rgba(155, 135, 255, .17);
  border-color: rgba(155, 135, 255, .35);
}

.ops-asset-card.asset-condition-damaged {
  border-left: 4px solid rgba(255, 190, 80, .85);
}

.ops-asset-card.asset-condition-destroyed {
  border-left: 4px solid rgba(255, 80, 80, .90);
}

.ops-asset-card.asset-condition-missing,
.ops-asset-card.asset-condition-abandoned {
  border-left: 4px solid rgba(155, 135, 255, .85);
}

.asset-condition-note,
.asset-action-box {
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 10px;
  padding: 8px;
  margin: 7px 0;
  background: rgba(255,255,255,.04);
}

.asset-condition-note.bad {
  border-color: rgba(255, 80, 80, .28);
  background: rgba(120, 10, 10, .18);
}

.asset-condition-note.warn {
  border-color: rgba(155, 135, 255, .28);
  background: rgba(40, 30, 90, .16);
}

.asset-action-box {
  display: grid;
  gap: 6px;
}


/* v1.13.13 configurable sound settings */
.sound-settings-panel {
  display: grid;
  gap: 10px;
}

.sound-master,
.sound-add-custom,
.sound-group {
  border: 1px solid rgba(130, 190, 255, .20);
  border-radius: 12px;
  padding: 9px;
  background: rgba(15, 35, 65, .16);
}

.sound-master h3,
.sound-add-custom h3,
.sound-group h3 {
  margin-top: 0;
}

.sound-row {
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 10px;
  padding: 6px;
  margin: 6px 0;
  background: rgba(255,255,255,.035);
}

.sound-row summary {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.sound-row summary span:first-child {
  display: grid;
  gap: 2px;
}

.sound-row summary small {
  color: rgba(220,235,255,.62);
  font-size: 10px;
}

.sound-row textarea {
  min-height: 60px;
}

.sound-file-label {
  display: grid;
  gap: 4px;
  font-size: 12px;
}

.sound-file-label input {
  font-size: 11px;
}


/* v1.13.14 ambient music controls */
.music-control-card {
  border: 1px solid rgba(130, 190, 255, .24);
  border-radius: 12px;
  padding: 10px;
  background: rgba(15, 45, 85, .20);
}

.music-control-card h3 {
  margin-top: 0;
}

.music-controls-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.music-controls-row button {
  width: 100%;
}

.music-control-card input[type="range"] {
  width: 100%;
}

.music-admin-editor {
  border-color: rgba(180, 140, 255, .28);
  background: rgba(55, 30, 95, .18);
}

.music-admin-editor textarea {
  min-height: 95px;
}

.sound-settings-panel .warn {
  color: rgba(255, 220, 120, .95);
}


/* v1.13.15 asset/trader profile images and blurbs */
.asset-profile-image,
.trader-profile-image {
  width: 128px;
  height: 128px;
  max-width: 100%;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.28);
  margin: 0 0 8px;
  display: block;
}

.asset-profile-blurb,
.trader-profile-blurb {
  border: 1px solid rgba(130, 190, 255, .16);
  background: rgba(20, 45, 75, .16);
  border-radius: 10px;
  padding: 8px;
  margin: 7px 0;
  font-size: 12px;
  line-height: 1.42;
  color: rgba(230, 242, 255, .92);
  white-space: pre-wrap;
}

.trader-profile-panel {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 10px;
  align-items: start;
  border: 1px solid rgba(130, 190, 255, .20);
  border-radius: 12px;
  padding: 9px;
  margin-bottom: 9px;
  background: rgba(10, 28, 52, .22);
}

.trader-profile-panel-image {
  width: 128px;
  height: 128px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.28);
}

.trader-profile-panel-body .card-topline {
  margin-bottom: 4px;
}

@media (max-width: 560px) {
  .trader-profile-panel {
    grid-template-columns: 1fr;
  }
}


/* v1.13.16 nuclear weapons framework */
.nuclear-command-form {
  border-color: rgba(255, 110, 80, .35);
  background: rgba(80, 18, 12, .18);
}

.ops-resource-card.nuclear {
  border-color: rgba(255, 130, 95, .30);
  background: rgba(90, 30, 25, .20);
}

.nuclear-card {
  border-left: 4px solid rgba(255, 130, 95, .75);
}

.nuclear-card.nuclear-status-prepared {
  border-left-color: rgba(255, 210, 90, .95);
  box-shadow: 0 0 18px rgba(255, 180, 60, .10);
}

.nuclear-card.nuclear-status-fired {
  border-left-color: rgba(255, 70, 70, .95);
  background: rgba(80, 10, 10, .16);
}

.status-pill.nuclear-status-prepared {
  border-color: rgba(255, 210, 90, .38);
  background: rgba(140, 90, 20, .28);
  color: rgba(255, 235, 180, .95);
}

.status-pill.nuclear-status-fired {
  border-color: rgba(255, 80, 80, .42);
  background: rgba(130, 20, 20, .32);
  color: rgba(255, 215, 215, .95);
}

.nuke-fire-controls {
  border: 1px solid rgba(255, 80, 80, .26);
  border-radius: 10px;
  padding: 8px;
  margin-top: 8px;
  background: rgba(90, 10, 10, .16);
}

.nuke-fire-controls summary {
  cursor: pointer;
  font-weight: 800;
  color: rgba(255, 210, 195, .98);
  margin-bottom: 6px;
}

.nuke-fire-controls button {
  width: 100%;
  margin-top: 6px;
}

.small.warn {
  color: rgba(255, 210, 130, .96);
}


/* v1.13.17 company bank loans */
.loan-dashboard {
  display: grid;
  gap: 10px;
}

.bank-card,
.company-loan-card,
.loan-request-form {
  border-color: rgba(100, 180, 255, .22);
}

.company-loan-card.loan-proposed {
  border-left: 4px solid rgba(255, 210, 100, .85);
}

.company-loan-card.loan-active {
  border-left: 4px solid rgba(100, 180, 255, .85);
}

.company-loan-card.loan-paid {
  border-left: 4px solid rgba(100, 235, 150, .85);
}

.company-loan-card.loan-defaulted,
.company-loan-card.loan-rejected {
  border-left: 4px solid rgba(255, 90, 90, .85);
}

.status-pill.loan-proposed {
  background: rgba(255, 210, 100, .16);
  border-color: rgba(255, 210, 100, .36);
}

.status-pill.loan-active {
  background: rgba(100, 180, 255, .16);
  border-color: rgba(100, 180, 255, .36);
}

.status-pill.loan-paid {
  background: rgba(100, 235, 150, .16);
  border-color: rgba(100, 235, 150, .36);
}

.status-pill.loan-defaulted,
.status-pill.loan-rejected {
  background: rgba(255, 90, 90, .16);
  border-color: rgba(255, 90, 90, .36);
}

.loan-repayment-box,
.manual-repayment-proposal {
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 10px;
  padding: 8px;
  margin-top: 8px;
  background: rgba(255,255,255,.04);
}

.loan-repayment-box h4 {
  margin: 0 0 4px;
}

.manual-repayment-proposal {
  display: grid;
  gap: 6px;
}


/* v1.13.18 mission reconciliation */
.mission-recon-panel {
  display: grid;
  gap: 10px;
}

.recon-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.recon-tab {
  border: 1px solid rgba(130, 190, 255, .20);
  border-radius: 10px;
  padding: 7px;
  background: rgba(15, 35, 65, .28);
  color: rgba(230,240,255,.92);
}

.recon-tab.active {
  border-color: rgba(130, 220, 255, .55);
  background: rgba(45, 90, 130, .38);
}

.recon-import-box {
  min-height: 140px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
}

.recon-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 6px;
}

.recon-checklist span,
.recon-info,
.recon-good,
.recon-warning,
.recon-error {
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 8px;
  padding: 6px;
  background: rgba(255,255,255,.04);
  font-size: 12px;
}

.recon-good {
  border-color: rgba(100,235,150,.30);
  background: rgba(35,90,45,.18);
}

.recon-warning {
  border-color: rgba(255,210,100,.35);
  background: rgba(105,80,20,.18);
}

.recon-error {
  border-color: rgba(255,90,90,.35);
  background: rgba(120,20,20,.20);
}

.snapshot-row,
.recon-entity,
.manual-repayment-proposal {
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 10px;
  padding: 8px;
  margin: 7px 0;
  background: rgba(255,255,255,.035);
}

.snapshot-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.snapshot-row small {
  display: block;
  opacity: .72;
}

.recon-entity summary {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.recon-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 11px;
}

.recon-table th,
.recon-table td {
  border-bottom: 1px solid rgba(255,255,255,.08);
  text-align: left;
  padding: 4px;
}

.recon-plus {
  color: rgba(120,240,150,.96);
}

.recon-minus {
  color: rgba(255,120,120,.96);
}


/* v1.13.19 admin action price editor */
.action-price-admin {
  border-color: rgba(255, 210, 100, .24);
  background: rgba(80, 60, 20, .14);
}

.action-price-list {
  display: grid;
  gap: 8px;
}

.action-price-row {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  padding: 8px;
  background: rgba(255,255,255,.04);
}

.action-price-row summary {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.action-price-row summary span:first-child {
  display: grid;
  gap: 2px;
}

.action-price-row summary small {
  color: rgba(225,235,255,.62);
  font-size: 10px;
}

.action-price-row .codebox {
  min-height: 72px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
}

.action-price-row textarea {
  resize: vertical;
}


/* v1.13.20 action price difficulty scaling */
.cost-scaling-box {
  border: 1px solid rgba(130, 190, 255, .16);
  border-radius: 10px;
  padding: 7px;
  margin: 8px 0;
  background: rgba(15, 45, 85, .12);
}

.cost-scaling-box summary {
  cursor: pointer;
  color: rgba(225, 238, 255, .92);
  font-weight: 700;
}

.cost-scaling-box .row {
  gap: 6px;
}


/* v1.13.26 random marker population controls */
#randomMarkerCountInput {
  min-width: 72px;
}

#randomMarkerTypeInput {
  min-width: 160px;
}


/* v1.13.28 region-limited random marker population */
#randomMarkerRegionInput {
  width: 100%;
  margin-top: 6px;
  min-height: 32px;
}

#populateRandomMarkersBtn {
  white-space: normal;
}


/* v1.13.29 reset/admin safety */
.danger-zone {
  border-color: rgba(255, 90, 90, .34);
  background: rgba(120, 20, 20, .13);
}

.danger-zone h3 {
  color: rgba(255, 190, 190, .96);
}


/* v1.13.29 region economy detail popup */
.region-detail-box {
  margin-top: 8px;
  padding: 6px;
  border: 1px solid rgba(150, 200, 255, .18);
  border-radius: 8px;
  background: rgba(10, 25, 45, .22);
}

.region-detail-box summary {
  cursor: pointer;
  font-weight: 700;
}

.region-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin: 6px 0;
}

.region-stat-grid div {
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 6px;
  padding: 4px;
  background: rgba(255,255,255,.04);
}

.region-stat-grid span {
  display: block;
  font-size: 10px;
  opacity: .75;
}

.region-stat-grid b {
  display: block;
  font-size: 12px;
}


/* v1.13.30 nuclear blast map markers */
.nuke-marker-details {
  margin: 7px 0;
  padding: 7px;
  border: 1px solid rgba(255, 100, 80, .34);
  border-radius: 8px;
  background: rgba(120, 20, 10, .18);
  color: rgba(255, 230, 220, .96);
  font-size: 12px;
  line-height: 1.45;
}


/* v1.13.31 research and capability locks */
.research-dashboard {
  border-color: rgba(120, 210, 255, .25);
  background: rgba(20, 55, 85, .16);
}

.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.research-card {
  border-color: rgba(130, 190, 255, .18);
}

.capability-lock-row {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 10px;
  padding: 8px;
  margin: 6px 0;
  background: rgba(255,255,255,.035);
}

.capability-lock-row span {
  font-size: 12px;
  color: rgba(225,235,255,.78);
}


/* v1.13.34 bulletproof inventory validation */
.inventory-validation {
  border: 1px solid rgba(120, 190, 255, .22);
  border-radius: 12px;
  padding: 10px;
  margin: 0 0 10px 0;
  background: rgba(20, 45, 70, .16);
}

.inventory-validation.good {
  border-color: rgba(120, 230, 160, .28);
  background: rgba(20, 70, 42, .12);
}

.inventory-validation.bad {
  border-color: rgba(255, 90, 90, .42);
  background: rgba(100, 25, 25, .18);
}

.inventory-validation h3 {
  margin-top: 0;
}

.inventory-validation details {
  margin-top: 6px;
  padding: 6px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 8px;
  background: rgba(255,255,255,.035);
}

.inventory-validation summary {
  cursor: pointer;
  font-weight: 700;
}

.inventory-validation ul {
  margin: 6px 0 0 18px;
  padding: 0;
}

.inventory-validation li {
  margin: 3px 0;
}


/* v1.13.35 functional inventory UX */
.drag-compatible {
  outline: 2px solid rgba(93, 220, 120, .88) !important;
  box-shadow: 0 0 0 3px rgba(93, 220, 120, .18), 0 0 18px rgba(93, 220, 120, .18) !important;
}

.drag-invalid {
  outline: 2px solid rgba(255, 80, 80, .85) !important;
  box-shadow: 0 0 0 3px rgba(255, 80, 80, .15), 0 0 18px rgba(255, 80, 80, .16) !important;
  cursor: not-allowed !important;
}

.capacity-meter {
  position: relative;
  min-height: 18px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  overflow: hidden;
  margin: 5px 0 7px;
  background: rgba(255,255,255,.055);
}

.capacity-meter > div {
  height: 100%;
  min-height: 18px;
  background: rgba(120, 210, 140, .38);
}

.capacity-meter.near > div {
  background: rgba(255, 190, 80, .46);
}

.capacity-meter.over > div {
  background: rgba(255, 80, 80, .52);
}

.capacity-meter.unknown,
.capacity-meter.empty {
  border-style: dashed;
}

.capacity-meter span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: rgba(245,245,245,.95);
  text-shadow: 0 1px 2px rgba(0,0,0,.65);
  pointer-events: none;
}

.compat-summary {
  margin: 6px 0;
  padding: 6px;
  border: 1px solid rgba(120, 180, 255, .18);
  border-radius: 8px;
  background: rgba(50, 90, 140, .08);
  line-height: 1.35;
}

.fit-badges {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
}


/* v1.13.39 shared loadout templates */
.template-hub {
  gap: 12px;
}

.template-submit-card textarea,
.template-card textarea {
  min-height: 120px;
}

.template-shot {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  margin: 6px 0;
}

.template-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 6px 0;
}

.template-tags span {
  border: 1px solid rgba(120,180,255,.25);
  background: rgba(70,120,210,.14);
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 11px;
}

.template-compare.good {
  border: 1px solid rgba(80,210,120,.25);
  background: rgba(40,120,70,.08);
  border-radius: 10px;
  padding: 8px;
  margin: 8px 0;
}

.template-compare.needs-items {
  border: 1px solid rgba(255,170,70,.28);
  background: rgba(150,95,30,.10);
  border-radius: 10px;
  padding: 8px;
  margin: 8px 0;
}

.template-table-wrap {
  overflow: auto;
  max-height: 360px;
  border-radius: 8px;
  margin-top: 8px;
}

.template-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.template-compare-table th,
.template-compare-table td {
  border-bottom: 1px solid rgba(255,255,255,.08);
  padding: 6px;
  vertical-align: top;
}

.template-compare-table tr.missing td {
  background: rgba(180,70,30,.10);
}

.template-compare-table tr.covered td {
  background: rgba(40,130,70,.06);
}

.template-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0,0,0,.66);
  display: grid;
  place-items: center;
  padding: 24px;
}

.template-detail-inner {
  position: relative;
  width: min(1100px, 96vw);
  max-height: 92vh;
  overflow: auto;
  background: rgba(14,22,34,.98);
  border: 1px solid rgba(180,210,255,.22);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 20px 80px rgba(0,0,0,.55);
}


/* v1.13.40 loadout template unavailable warning states */
.template-warning {
  border: 1px solid rgba(255, 95, 75, .35);
  background: rgba(150, 35, 20, .14);
  color: rgba(255, 225, 215, .96);
  border-radius: 10px;
  padding: 8px;
  margin: 8px 0;
  font-size: 12px;
}

.template-warning.softer {
  border-color: rgba(255, 190, 90, .32);
  background: rgba(160, 110, 25, .12);
}

.template-compare-table tr.unavailable td {
  background: rgba(170, 30, 25, .16);
}

.template-compare-table tr.purchasable td {
  background: rgba(160, 105, 30, .11);
}

.template-card button[disabled] {
  opacity: .48;
  cursor: not-allowed;
}


/* v1.13.58 searchable item database/catalog picker */
.catalog-search-widget {
  display: grid;
  gap: 6px;
}

.catalog-search-input,
.item-db-search input {
  width: 100%;
}

.catalog-search-results {
  display: grid;
  gap: 4px;
  max-height: 260px;
  overflow: auto;
  border: 1px solid rgba(160, 210, 255, .18);
  border-radius: 10px;
  padding: 6px;
  background: rgba(5, 12, 20, .28);
}

.catalog-search-result {
  display: grid;
  grid-template-columns: 1fr;
  text-align: left;
  padding: 7px 9px;
  border-radius: 8px;
}

.catalog-search-result small {
  opacity: .82;
  font-size: 11px;
}

.item-db-search {
  margin-top: 8px;
  margin-bottom: 8px;
}


/* v1.13.59 total carried loadout weight */
.loadout-weight-card {
  display: grid;
  grid-template-columns: minmax(220px, .9fr) minmax(220px, 1.1fr);
  gap: 10px;
  margin: 10px 0;
  padding: 12px;
  border: 1px solid rgba(150, 210, 255, .22);
  border-radius: 14px;
  background: rgba(8, 18, 28, .72);
  box-shadow: 0 10px 24px rgba(0,0,0,.22);
}

.loadout-weight-main {
  display: grid;
  gap: 3px;
}

.loadout-weight-main span {
  font-size: 12px;
  opacity: .82;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.loadout-weight-main strong {
  font-size: 28px;
  line-height: 1.1;
}

.loadout-weight-main small,
.loadout-weight-details small {
  opacity: .8;
}

.loadout-weight-breakdown {
  display: grid;
  gap: 4px;
}

.loadout-weight-details {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 6px;
}

.loadout-weight-details summary {
  cursor: pointer;
  opacity: .88;
}

.loadout-weight-heavy {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 6px;
}

.loadout-weight-heavy small {
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px;
  padding: 3px 7px;
  background: rgba(255,255,255,.04);
}

.good-text {
  color: #83f0a1;
}

.warning-text {
  color: #ffd37a;
}

@media (max-width: 900px) {
  .loadout-weight-card {
    grid-template-columns: 1fr;
  }
}

/* v1.13.68 faction ownership colour swatch */
.faction-colour-dot {
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.7);
  margin-right: 0.35em;
  vertical-align: -0.08em;
}

/* v1.14 economy seeding and faction aggregate polish */
.economy-card .command-field-row b,
.faction-card .command-field-row b {
  text-align: right;
}
.ops-industry-grid input {
  min-width: 54px;
}


/* v1.14.05 inventory responsiveness */
.inventory-row.drag-compatible,
.drag-compatible {
  outline: 2px solid rgba(80, 220, 140, .75);
}

.inventory-row.drag-invalid,
.drag-invalid {
  outline: 2px solid rgba(255, 90, 90, .8);
}


/* v1.14.06 form preservation */
.command-form input:focus,
.command-form textarea:focus,
.command-form select:focus {
  outline: 2px solid rgba(120, 200, 255, .55);
}
