:root {
  --bg: #0e1320;
  --bg-2: #151c2b;
  --panel: rgba(22, 31, 48, 0.86);
  --panel-solid: #182236;
  --line: rgba(159, 188, 218, 0.22);
  --text: #eef5fb;
  --muted: #99a9bc;
  --accent: #5dd4c8;
  --accent-2: #f7c948;
  --danger: #ff7a7a;
  --good: #8fe388;
  --blue: #7bb6ff;
  --shadow: 0 20px 80px rgba(0, 0, 0, 0.35);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", system-ui, sans-serif;
}

/* v63 final QA override: keep the public build readable after all historical
   responsive rules have loaded. */
.ops-game-shell {
  height: auto !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

.ops-layout {
  height: auto !important;
  min-height: calc(100vh - 148px) !important;
  overflow: visible !important;
}

.ops-left-dock,
.ops-right-dock {
  overflow: visible !important;
  padding-right: 0 !important;
}

.ops-brief-card,
.ops-registry,
.ops-doctrine,
.ops-mission-board,
.ops-intel-board,
.ops-object-board,
.ops-after-action,
.ops-intel-board .inspector-card,
.ops-object-board .object-detail,
.ops-after-action .ops-decision-board {
  overflow: visible !important;
}

.ops-brief-card p,
.ops-doctrine p,
.ops-command-deck p,
.ops-right-dock .inspector-card p,
.ops-after-action p,
.ops-right-dock .sample-data code,
.mission-objective strong,
.mission-objective small,
.mission-objective em,
.ops-registry .mini-object strong,
.ops-registry .mini-object small,
.mini-object strong,
.mini-object small,
.object-node strong,
.object-node small,
.intel-contact strong,
.intel-contact span,
.intel-contact i,
.panel-title strong,
.doctrine-step,
.queue-directive,
.contact-queue-list span,
.contact-queue-list small,
.object-detail h3,
.object-detail p,
.ops-decision-board p,
.ops-decision-board strong,
.ops-decision-board span,
.footer-actions button b,
.footer-actions button span,
.stage-nav button,
.execution-order strong,
.execution-order small,
.execution-order i {
  max-width: none !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  -webkit-line-clamp: unset !important;
  -webkit-box-orient: initial !important;
}

.contact-queue-list {
  gap: 10px !important;
  overflow: visible !important;
}

.contact-queue-list button {
  min-height: 50px !important;
  grid-template-columns: 30px minmax(0, 1fr) auto !important;
  gap: 10px !important;
  padding: 8px 10px !important;
  border-radius: 7px !important;
}

.contact-queue-list b {
  width: 26px !important;
  height: 26px !important;
  font-size: 10px !important;
}

.contact-queue-list span {
  font-size: 12px !important;
  line-height: 1.22 !important;
}

.contact-queue-list small {
  font-size: 10px !important;
  line-height: 1.25 !important;
  text-align: left !important;
}

.contact-queue-list button.backup-entry::after {
  align-self: start !important;
  padding: 3px 7px !important;
  font-size: 9px !important;
}

.queue-directive {
  padding: 8px 10px !important;
  border: 1px solid rgba(88, 198, 170, 0.24) !important;
  border-radius: 7px !important;
  background: rgba(88, 198, 170, 0.08) !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
}

.footer-actions {
  flex-wrap: wrap !important;
  align-items: stretch !important;
  justify-content: flex-end !important;
}

.footer-actions button,
.footer-actions button:not(.primary),
.footer-actions .action-gate,
.footer-actions .audio-key,
.footer-actions .drill-key {
  max-width: none !important;
  min-width: 92px !important;
  min-height: 42px !important;
  padding: 8px 12px !important;
  line-height: 1.18 !important;
}

.footer-actions .action-gate {
  min-width: 132px !important;
}

.execution-order.selected.recommended {
  border-color: rgba(88, 198, 170, 0.72) !important;
  background:
    linear-gradient(135deg, rgba(88, 198, 170, 0.18), rgba(12, 24, 22, 0.92)) !important;
  box-shadow:
    inset 4px 0 0 rgba(88, 198, 170, 0.82),
    0 0 0 1px rgba(88, 198, 170, 0.18) !important;
}

.execution-order.selected.recommended span {
  color: #70e5ae !important;
}

.execution-order.selected.recommended i {
  border-color: rgba(88, 198, 170, 0.46) !important;
  background: rgba(88, 198, 170, 0.14) !important;
  color: #dcffef !important;
}

.ops-system-buttons {
  gap: 10px !important;
}

.ops-control-pad {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(66px, auto)) !important;
  gap: 7px !important;
  padding: 5px !important;
}

.ops-control-pad button {
  width: auto !important;
  min-width: 66px !important;
  min-height: 42px !important;
  grid-template-rows: auto auto !important;
  padding: 6px 9px !important;
}

.ops-control-pad button b,
.ops-control-pad button span {
  max-width: none !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
}

.ops-control-pad button b {
  font-size: 10px !important;
}

.ops-control-pad button span {
  font-size: 11px !important;
}

@media (max-height: 760px) and (min-width: 1181px) {
  .ops-layout {
    grid-template-columns: minmax(236px, 260px) minmax(0, 1fr) minmax(292px, 340px) !important;
    gap: 10px !important;
    padding: 10px !important;
  }

  .ops-doctrine .panel-title,
  .ops-doctrine p,
  .ops-doctrine .tutorial-controls {
    display: flex !important;
  }

  .ops-doctrine p {
    display: block !important;
    font-size: 11px !important;
    line-height: 1.35 !important;
  }

  .contact-queue-list button {
    min-height: 46px !important;
    grid-template-columns: 28px minmax(0, 1fr) auto !important;
    padding: 7px 9px !important;
  }

  .ops-control-pad {
    grid-template-columns: repeat(4, minmax(62px, auto)) !important;
  }

  .ops-control-pad button {
    min-width: 62px !important;
    min-height: 40px !important;
    padding: 6px 8px !important;
  }
}

@media (max-width: 760px) {
  body {
    overflow-x: hidden !important;
  }

  .ops-game-shell {
    display: block !important;
    min-height: 100vh !important;
  }

  .ops-topbar,
  .ops-footer {
    position: relative !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    padding: 10px !important;
  }

  .ops-brand h1 {
    font-size: 17px !important;
    line-height: 1.16 !important;
  }

  .ops-turn-strip {
    display: flex !important;
    gap: 8px !important;
    overflow-x: auto !important;
    padding-bottom: 2px !important;
    scroll-snap-type: x proximity;
  }

  .ops-turn-strip div {
    min-width: 112px !important;
    scroll-snap-align: start;
  }

  .ops-system-buttons {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .ops-level-jump,
  .ops-control-pad {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .ops-level-jump button,
  .ops-control-pad button {
    width: auto !important;
    min-height: 42px !important;
  }

  .ops-layout {
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    height: auto !important;
    gap: 10px !important;
    padding: 10px !important;
  }

  .ops-left-dock,
  .ops-right-dock {
    display: grid !important;
    gap: 10px !important;
  }

  .ops-map-stage {
    order: -1 !important;
    min-height: 620px !important;
    grid-template-rows: auto minmax(430px, 58vh) auto !important;
    overflow: visible !important;
  }

  .ops-map-toolbar {
    grid-template-columns: 1fr !important;
    min-height: 0 !important;
    gap: 8px !important;
    overflow: visible !important;
  }

  .ops-map-toolbar > div:first-child strong {
    display: block !important;
  }

  .ops-map-toolbar strong,
  .ops-map-toolbar span {
    white-space: normal !important;
  }

  .ops-layer-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .ops-layer-tabs .layer-switch span,
  .ops-layer-tabs .layer-switch small {
    display: block !important;
  }

  .ops-wargame-map {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 430px !important;
    overflow: hidden !important;
  }

  .ops-registry .mini-object,
  .contact-queue-list button {
    min-height: 54px !important;
  }

  .contact-queue-list button {
    grid-template-columns: 30px minmax(0, 1fr) !important;
  }

  .contact-queue-list button.backup-entry::after {
    grid-column: 2 !important;
    justify-self: start !important;
  }

  .footer-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    justify-content: stretch !important;
  }

  .footer-actions button,
  .footer-actions button:not(.primary),
  .footer-actions .action-gate,
  .footer-actions .audio-key,
  .footer-actions .drill-key {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 48px !important;
  }

  .footer-actions .action-gate {
    grid-column: 1 / -1 !important;
  }
}

@media (max-width: 430px) {
  .ops-topbar,
  .ops-footer,
  .ops-layout {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  .ops-brand h1 {
    font-size: 16px !important;
  }

  .ops-map-stage {
    min-height: 590px !important;
    grid-template-rows: auto minmax(410px, 58vh) auto !important;
  }

  .ops-wargame-map {
    min-height: 410px !important;
  }
}

/* v78 MiniMax icon pass: replace letter tiles with generated tactical icon cells. */
.object-node .object-icon,
.mini-object .object-icon,
.object-slot .object-icon,
.intel-contact .token-icon,
.intel-token .token-icon,
.war-counter .war-icon,
.contact-queue-list .queue-icon {
  display: grid;
  width: var(--icon-size) !important;
  height: var(--icon-size) !important;
  min-width: var(--icon-size) !important;
  min-height: var(--icon-size) !important;
  max-width: var(--icon-size) !important;
  max-height: var(--icon-size) !important;
  inline-size: var(--icon-size) !important;
  block-size: var(--icon-size) !important;
  flex: 0 0 var(--icon-size) !important;
  aspect-ratio: 1 / 1 !important;
  background-image:
    linear-gradient(180deg, rgba(11, 23, 33, 0.32), rgba(3, 6, 12, 0.46)),
    var(--icon-atlas);
  background-size: 400% 500%;
  background-position: var(--icon-x, 0%) var(--icon-y, 0%);
  overflow: hidden !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
  -webkit-line-clamp: unset !important;
}

.object-node .object-icon,
.object-slot .object-icon {
  --icon-size: 34px;
}

.mini-object .object-icon {
  --icon-size: 32px;
  width: var(--icon-size) !important;
  height: var(--icon-size) !important;
  min-width: var(--icon-size) !important;
}

.war-counter .war-icon {
  --icon-size: 34px;
  margin-bottom: 2px;
}

.intel-contact {
  width: 128px;
  min-height: 76px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 8px;
  align-items: center;
}

.intel-contact .token-icon {
  --icon-size: 36px;
  grid-column: 1;
  grid-row: 1 / span 2;
}

.intel-contact span,
.intel-contact strong,
.intel-contact i {
  grid-column: 2;
}

.intel-token {
  grid-template-rows: 34px auto auto;
}

.intel-token .token-icon {
  --icon-size: 32px;
  justify-self: center;
}

.contact-queue-list button {
  grid-template-columns: 28px minmax(0, 1fr) minmax(64px, auto);
}

.contact-queue-list .queue-icon {
  --icon-size: 24px;
  width: var(--icon-size) !important;
  height: var(--icon-size) !important;
}

@media (max-width: 760px) {
  .object-node .object-icon {
    --icon-size: 26px;
  }

  .war-counter .war-icon {
    --icon-size: 26px;
  }

  .intel-contact {
    width: 92px;
    min-height: 50px;
    grid-template-columns: 28px minmax(0, 1fr);
    column-gap: 5px;
  }

  .intel-contact .token-icon {
    --icon-size: 26px;
  }
}

@media (max-width: 430px) {
  .object-node .object-icon {
    --icon-size: 22px;
  }

  .war-counter .war-icon {
    --icon-size: 22px;
  }

  .intel-contact {
    width: 74px;
    min-height: 38px;
    grid-template-columns: 24px minmax(0, 1fr);
    padding: 4px 5px;
  }

  .intel-contact .token-icon {
    --icon-size: 22px;
  }

  .intel-contact span {
    display: none;
  }
}

/* v63 final top-control pass: keep UNDO/REDO/JUDGE readable on desktop. */
.ops-system-buttons {
  gap: 10px !important;
}

.ops-control-pad {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(66px, auto)) !important;
  gap: 7px !important;
  padding: 5px !important;
}

.ops-control-pad button {
  width: auto !important;
  min-width: 66px !important;
  min-height: 42px !important;
  grid-template-rows: auto auto !important;
  padding: 6px 9px !important;
}

.ops-control-pad button b,
.ops-control-pad button span {
  max-width: none !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
}

.ops-control-pad button b {
  font-size: 10px !important;
}

.ops-control-pad button span {
  font-size: 11px !important;
}

@media (max-height: 760px) and (min-width: 1181px) {
  .ops-control-pad {
    grid-template-columns: repeat(4, minmax(62px, auto)) !important;
  }

  .ops-control-pad button {
    min-width: 62px !important;
    min-height: 40px !important;
    padding: 6px 8px !important;
  }
}

@media (max-width: 760px) {
  .ops-control-pad {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .ops-control-pad button {
    min-width: 0 !important;
    width: auto !important;
  }
}

/* v64 terminal QA override: this must remain the last block in the file. */
.inspector-card.token-panel {
  max-width: 100% !important;
  min-width: 0 !important;
  overflow: visible !important;
}

.inspector-card.token-panel p,
.inspector-card.token-panel .hint-box,
.inspector-card.token-panel .mechanic-note,
.inspector-card.token-panel .mechanic-note strong,
.inspector-card.token-panel .mechanic-note span {
  display: block !important;
  max-width: 100% !important;
  overflow: visible !important;
  overflow-wrap: anywhere !important;
  text-overflow: clip !important;
  white-space: normal !important;
  -webkit-line-clamp: unset !important;
}

.inspector-card.token-panel .assign-row {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(116px, 1fr)) !important;
  gap: 9px !important;
  align-items: stretch !important;
  justify-content: stretch !important;
}

.inspector-card.token-panel .assign-row button {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  min-height: 42px !important;
  padding: 8px 10px !important;
  overflow: visible !important;
  overflow-wrap: anywhere !important;
  text-align: center !important;
  text-overflow: clip !important;
  white-space: normal !important;
}

.inspector-card.token-panel .assign-row span {
  grid-column: 1 / -1 !important;
  min-width: 0 !important;
  overflow-wrap: anywhere !important;
  line-height: 1.35 !important;
}

.stage-card.replay .battle-sandbox .unit-counter {
  width: 96px !important;
  min-width: 0 !important;
  max-width: 112px !important;
  grid-template-columns: 24px minmax(0, 1fr) !important;
  gap: 6px !important;
  padding: 6px 7px !important;
  overflow: visible !important;
}

.stage-card.replay .battle-sandbox .unit-counter b {
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
}

.stage-card.replay .battle-sandbox .unit-counter span {
  min-width: 0 !important;
  overflow: visible !important;
  overflow-wrap: anywhere !important;
  text-overflow: clip !important;
  white-space: normal !important;
}

@media (max-width: 760px) {
  .inspector-card.token-panel .assign-row {
    grid-template-columns: 1fr !important;
  }

  .stage-card.replay .battle-sandbox .unit-counter {
    width: 88px !important;
    max-width: 96px !important;
    grid-template-columns: 1fr !important;
    justify-items: center !important;
  }

  .stage-card.replay .battle-sandbox .unit-counter b {
    display: none !important;
  }

  .stage-card.replay .battle-sandbox .unit-counter span {
    font-size: 9px !important;
    text-align: center !important;
  }
}

/* v68 terminal mobile QA override: this block intentionally stays at EOF. */
.mobile-field-action {
  display: none;
}

@media (max-width: 760px) {
  .app-shell .level-list {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    overflow: visible !important;
  }

  .app-shell .level-button {
    min-height: 74px !important;
    grid-template-columns: 30px minmax(0, 1fr) auto !important;
    gap: 9px !important;
    align-items: center !important;
    overflow: visible !important;
    padding: 9px 10px !important;
  }

  .app-shell .level-button span:nth-child(2) {
    display: grid !important;
    gap: 3px !important;
    min-width: 0 !important;
    overflow: visible !important;
  }

  .app-shell .level-button strong,
  .app-shell .level-button small,
  .app-shell .level-state {
    display: block !important;
    max-width: 100% !important;
    overflow: visible !important;
    overflow-wrap: anywhere !important;
    text-overflow: clip !important;
    white-space: normal !important;
    -webkit-line-clamp: unset !important;
    -webkit-box-orient: initial !important;
  }

  .app-shell .level-button strong {
    font-size: 13px !important;
    line-height: 1.22 !important;
  }

  .app-shell .level-button small {
    color: rgba(214, 231, 236, 0.82) !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
  }

  .app-shell .level-state {
    grid-column: 3 !important;
    justify-self: end !important;
    max-width: 76px !important;
    padding: 5px 7px !important;
    border-radius: 999px !important;
    font-size: 10px !important;
    line-height: 1.1 !important;
    text-align: center !important;
  }

  .ops-game-shell:has(.mobile-field-action) {
    padding-bottom: 178px !important;
  }

  .mobile-field-action {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 12px !important;
    border: 1px solid rgba(255, 217, 117, 0.55) !important;
    border-radius: 16px !important;
    background:
      linear-gradient(135deg, rgba(255, 217, 117, 0.18), rgba(80, 199, 255, 0.11)),
      rgba(4, 12, 20, 0.94) !important;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.34), inset 0 0 0 1px rgba(255, 255, 255, 0.06) !important;
    position: fixed !important;
    left: 10px !important;
    right: 10px !important;
    bottom: 10px !important;
    z-index: 74 !important;
  }

  .mobile-field-action__copy,
  .mobile-field-action__buttons {
    min-width: 0 !important;
  }

  .mobile-field-action__copy span {
    display: inline-flex !important;
    width: fit-content !important;
    margin-bottom: 4px !important;
    padding: 3px 7px !important;
    border-radius: 999px !important;
    background: rgba(255, 217, 117, 0.18) !important;
    color: #ffd975 !important;
    font-size: 11px !important;
    font-weight: 900 !important;
    letter-spacing: 0.08em !important;
  }

  .mobile-field-action__copy strong,
  .mobile-field-action__copy small {
    display: block !important;
    max-width: 100% !important;
    overflow: visible !important;
    overflow-wrap: anywhere !important;
    text-overflow: clip !important;
    white-space: normal !important;
  }

  .mobile-field-action__copy strong {
    color: #fff7d8 !important;
    font-size: 15px !important;
    line-height: 1.28 !important;
  }

  .mobile-field-action__copy small {
    margin-top: 5px !important;
    color: rgba(229, 240, 249, 0.86) !important;
    font-size: 11px !important;
    line-height: 1.35 !important;
  }

  .mobile-field-action__buttons {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .mobile-field-action__buttons button {
    width: 100% !important;
    min-height: 48px !important;
    padding: 10px 12px !important;
    border-radius: 14px !important;
    font-size: 15px !important;
    font-weight: 900 !important;
    overflow: visible !important;
    overflow-wrap: anywhere !important;
    text-overflow: clip !important;
    white-space: normal !important;
  }

  .tutorial-coach,
  .tutorial-coach.place-bottom,
  .tutorial-coach.place-top,
  .tutorial-coach.place-side,
  .tutorial-coach.place-side-right {
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    top: auto !important;
    bottom: 14px !important;
    width: auto !important;
    max-width: calc(100vw - 24px) !important;
    transform: none !important;
    z-index: 80 !important;
  }

  .ops-game-shell:has(.mobile-field-action) .tutorial-coach,
  .ops-game-shell:has(.mobile-field-action) .tutorial-coach.place-bottom,
  .ops-game-shell:has(.mobile-field-action) .tutorial-coach.place-top,
  .ops-game-shell:has(.mobile-field-action) .tutorial-coach.place-side,
  .ops-game-shell:has(.mobile-field-action) .tutorial-coach.place-side-right {
    bottom: 174px !important;
  }

  .tutorial-coach::before,
  .tutorial-coach.place-bottom::before,
  .tutorial-coach.place-top::before,
  .tutorial-coach.place-side::before,
  .tutorial-coach.place-side-right::before {
    display: none !important;
  }
}

/* v69 terminal mobile level-card readability override: keep this at true EOF. */
@media (max-width: 760px) {
  .app-shell .sidebar {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  .app-shell .level-list {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
    padding: 0 !important;
  }

  .app-shell .level-button {
    display: grid !important;
    grid-template-columns: 34px minmax(0, 1fr) auto !important;
    grid-template-rows: auto !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
    min-height: 78px !important;
    padding: 10px 12px !important;
    overflow: visible !important;
    text-align: left !important;
  }

  .app-shell .level-button .level-num {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    justify-self: center !important;
  }

  .app-shell .level-button > span:nth-child(2) {
    grid-column: 2 !important;
    grid-row: 1 !important;
    display: grid !important;
    gap: 4px !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
  }

  .app-shell .level-button strong,
  .app-shell .level-button small {
    display: block !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
    overflow-wrap: normal !important;
    word-break: keep-all !important;
    text-overflow: clip !important;
    white-space: normal !important;
    writing-mode: horizontal-tb !important;
    -webkit-line-clamp: unset !important;
    -webkit-box-orient: initial !important;
  }

  .app-shell .level-button strong {
    font-size: 15px !important;
    line-height: 1.25 !important;
    letter-spacing: 0.01em !important;
  }

  .app-shell .level-button small {
    display: block !important;
    color: rgba(214, 231, 236, 0.82) !important;
    font-size: 12px !important;
    line-height: 1.25 !important;
  }

  .app-shell .level-state {
    grid-column: 3 !important;
    grid-row: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    justify-self: end !important;
    width: auto !important;
    min-width: 76px !important;
    max-width: 96px !important;
    min-height: 34px !important;
    padding: 6px 9px !important;
    border-radius: 999px !important;
    overflow: visible !important;
    white-space: nowrap !important;
    text-align: center !important;
  }
}
/* v71 true EOF story-mode override. */
.ops-game-shell .ops-system-menu {
  position: relative !important;
  justify-self: end !important;
}

.ops-game-shell .ops-system-menu > summary {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 38px !important;
  padding: 0 14px !important;
  border: 1px solid rgba(255, 217, 117, 0.28) !important;
  border-radius: 999px !important;
  background: rgba(255, 217, 117, 0.08) !important;
  color: #ffe6a3 !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  cursor: pointer !important;
  list-style: none !important;
}

.ops-game-shell .ops-system-menu > summary::-webkit-details-marker {
  display: none !important;
}

.ops-game-shell .ops-system-menu .ops-system-buttons {
  position: absolute !important;
  top: calc(100% + 10px) !important;
  right: 0 !important;
  z-index: 90 !important;
  display: grid !important;
  width: min(360px, calc(100vw - 24px)) !important;
  padding: 12px !important;
  border: 1px solid rgba(255, 217, 117, 0.22) !important;
  border-radius: 18px !important;
  background: rgba(4, 10, 16, 0.96) !important;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.46) !important;
}

.ops-game-shell .ops-system-menu:not([open]) .ops-system-buttons {
  display: none !important;
}

.ops-game-shell .ops-layout {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 12px !important;
}

.ops-game-shell .ops-left-dock,
.ops-game-shell .ops-right-dock {
  display: none !important;
}

.ops-game-shell .ops-map-stage {
  grid-template-rows: auto auto minmax(520px, 1fr) auto !important;
  gap: 10px !important;
  min-height: calc(100vh - 162px) !important;
}

.ops-game-shell .story-step-card {
  display: grid !important;
  grid-template-columns: 86px minmax(0, 1fr) minmax(220px, 0.34fr) !important;
  align-items: center !important;
  gap: 14px !important;
  padding: 16px !important;
  border: 1px solid rgba(255, 217, 117, 0.28) !important;
  border-radius: 22px !important;
  background:
    radial-gradient(circle at 8% 10%, rgba(255, 217, 117, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(17, 35, 45, 0.95), rgba(5, 12, 18, 0.91)) !important;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.04) !important;
}

.ops-game-shell .story-step-index {
  display: grid !important;
  place-items: center !important;
  min-height: 78px !important;
  border-radius: 18px !important;
  background: rgba(255, 217, 117, 0.11) !important;
  color: #ffe5a1 !important;
}

.ops-game-shell .story-step-index span,
.ops-game-shell .story-step-copy span,
.ops-game-shell .story-step-action small {
  color: rgba(255, 236, 183, 0.78) !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  letter-spacing: 0.06em !important;
}

.ops-game-shell .story-step-index strong {
  color: #fff5ce !important;
  font-size: 34px !important;
  line-height: 1 !important;
}

.ops-game-shell .story-step-copy {
  min-width: 0 !important;
}

.ops-game-shell .story-step-copy h2,
.ops-game-shell .story-step-copy p {
  margin: 0 !important;
}

.ops-game-shell .story-step-copy h2 {
  margin-top: 4px !important;
  color: #fff7d8 !important;
  font-size: clamp(22px, 2.4vw, 34px) !important;
  line-height: 1.08 !important;
}

.ops-game-shell .story-step-copy p {
  max-width: 76ch !important;
  margin-top: 7px !important;
  color: rgba(232, 242, 238, 0.88) !important;
  font-size: 15px !important;
  line-height: 1.52 !important;
}

.ops-game-shell .story-step-action {
  display: grid !important;
  align-content: center !important;
  gap: 6px !important;
  min-height: 78px !important;
  padding: 14px !important;
  border-radius: 18px !important;
  background: rgba(88, 198, 170, 0.12) !important;
  box-shadow: inset 0 0 0 1px rgba(88, 198, 170, 0.24) !important;
}

.ops-game-shell .story-step-action strong {
  color: #d8fff1 !important;
  font-size: 18px !important;
  line-height: 1.22 !important;
}

.ops-game-shell .ops-map-toolbar {
  grid-template-columns: minmax(0, 1fr) auto !important;
  min-height: 42px !important;
  opacity: 0.9 !important;
}

.ops-game-shell .ops-layer-tabs {
  display: none !important;
}

.ops-game-shell .ops-map-toolbar .ops-pulse {
  max-width: 520px !important;
}

.ops-game-shell .ops-wargame-map {
  min-height: 520px !important;
}

.ops-game-shell.flow-object .intel-contact,
.ops-game-shell.flow-relation .intel-contact,
.ops-game-shell.flow-complete .intel-contact {
  display: none !important;
}

.ops-game-shell.flow-field .object-node:not(.active),
.ops-game-shell.flow-repair .object-node:not(.active) {
  opacity: 0.2 !important;
  transform: translate(-50%, -50%) scale(0.86) !important;
  pointer-events: none !important;
}

.ops-game-shell.flow-object .object-node:not(.guide-target):not(.object-pick-mode) {
  opacity: 0.46 !important;
}

.ops-game-shell .ops-map-legend,
.ops-game-shell .map-status-board,
.ops-game-shell .tactical-readout {
  opacity: 0.58 !important;
  transform: scale(0.94) !important;
  transform-origin: top left !important;
}

.ops-game-shell.flow-object .map-status-board,
.ops-game-shell.flow-field .map-status-board,
.ops-game-shell.flow-repair .map-status-board,
.ops-game-shell.flow-object .tactical-readout,
.ops-game-shell.flow-field .tactical-readout,
.ops-game-shell.flow-repair .tactical-readout {
  display: none !important;
}

.ops-game-shell .ops-command-deck {
  display: none !important;
}

.ops-game-shell.flow-relation .ops-command-deck,
.ops-game-shell.flow-complete .ops-command-deck {
  display: grid !important;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr) !important;
  padding: 12px !important;
  border: 1px solid rgba(255, 217, 117, 0.18) !important;
  border-radius: 18px !important;
  background: rgba(5, 13, 20, 0.72) !important;
}

.ops-game-shell.flow-relation .ops-command-cards,
.ops-game-shell.flow-complete .ops-command-cards {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.ops-game-shell .assign-row {
  grid-template-columns: minmax(0, 1fr) !important;
}

.ops-game-shell .assign-row > span {
  width: fit-content !important;
}

.ops-game-shell .assign-more {
  display: grid !important;
  gap: 8px !important;
}

.ops-game-shell .assign-more > summary {
  width: fit-content !important;
  padding: 7px 10px !important;
  border: 1px solid rgba(159, 188, 218, 0.2) !important;
  border-radius: 999px !important;
  color: rgba(214, 229, 228, 0.78) !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  cursor: pointer !important;
}

.ops-game-shell .assign-more:not([open]) > button {
  display: none !important;
}

.ops-game-shell .ops-footer {
  grid-template-columns: minmax(0, 1fr) max-content !important;
}

.ops-game-shell .ops-radio-feed {
  grid-template-columns: minmax(0, 1fr) !important;
}

.ops-game-shell .ops-radio-feed span:not(.active),
.ops-game-shell .ops-history-line,
.ops-game-shell .footer-actions .audio-key,
.ops-game-shell .footer-actions .drill-key {
  display: none !important;
}

.ops-game-shell .footer-actions {
  justify-content: end !important;
}

.ops-game-shell .footer-actions .action-gate {
  min-width: 168px !important;
}

@media (max-width: 920px) {
  .ops-game-shell .ops-topbar {
    grid-template-columns: minmax(0, 1fr) auto !important;
  }

  .ops-game-shell .ops-turn-strip {
    display: none !important;
  }

  .ops-game-shell .story-step-card {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    padding: 13px !important;
  }

  .ops-game-shell .story-step-index {
    display: none !important;
  }

  .ops-game-shell .story-step-action {
    min-height: 0 !important;
  }

  .ops-game-shell .story-step-copy h2 {
    font-size: 22px !important;
  }

  .ops-game-shell .story-step-copy p {
    font-size: 13px !important;
    line-height: 1.42 !important;
  }

  .ops-game-shell .ops-map-toolbar {
    display: none !important;
  }

  .ops-game-shell .ops-map-stage {
    min-height: 0 !important;
    grid-template-rows: auto minmax(500px, 1fr) auto !important;
  }

  .ops-game-shell .ops-wargame-map {
    min-height: 500px !important;
  }

  .ops-game-shell.flow-relation .ops-command-deck,
  .ops-game-shell.flow-complete .ops-command-deck {
    grid-template-columns: 1fr !important;
  }

  .ops-game-shell.flow-relation .ops-command-cards,
  .ops-game-shell.flow-complete .ops-command-cards {
    grid-template-columns: 1fr !important;
  }

  .ops-game-shell .ops-footer {
    grid-template-columns: 1fr !important;
  }

  .ops-game-shell .footer-actions {
    width: 100% !important;
  }

  .ops-game-shell .footer-actions .action-gate {
    width: 100% !important;
  }
}

@media (max-width: 760px) {
  .ops-game-shell {
    padding: 10px !important;
  }

  .ops-game-shell:has(.mobile-field-action) {
    padding-bottom: 154px !important;
  }

  .ops-game-shell .story-step-copy p {
    display: -webkit-box !important;
    overflow: hidden !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
  }

  .ops-game-shell .ops-map-stage {
    gap: 8px !important;
  }

  .ops-game-shell .ops-wargame-map {
    min-height: 474px !important;
  }

  .ops-game-shell .object-node {
    width: 96px !important;
    min-height: 86px !important;
  }

  .ops-game-shell .intel-contact {
    width: 100px !important;
    min-height: 58px !important;
  }

  .ops-game-shell .ops-map-legend {
    display: none !important;
  }

  .ops-game-shell .mobile-field-action {
    border-radius: 18px !important;
  }
}

/* v71 final story-mode override: keep this at true EOF. */
.ops-game-shell .ops-system-menu {
  position: relative !important;
  justify-self: end !important;
}

.ops-game-shell .ops-system-menu > summary {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 38px !important;
  padding: 0 14px !important;
  border: 1px solid rgba(255, 217, 117, 0.28) !important;
  border-radius: 999px !important;
  background: rgba(255, 217, 117, 0.08) !important;
  color: #ffe6a3 !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  cursor: pointer !important;
  list-style: none !important;
}

.ops-game-shell .ops-system-menu > summary::-webkit-details-marker {
  display: none !important;
}

.ops-game-shell .ops-system-menu .ops-system-buttons {
  position: absolute !important;
  top: calc(100% + 10px) !important;
  right: 0 !important;
  z-index: 90 !important;
  display: grid !important;
  width: min(360px, calc(100vw - 24px)) !important;
  padding: 12px !important;
  border: 1px solid rgba(255, 217, 117, 0.22) !important;
  border-radius: 18px !important;
  background: rgba(4, 10, 16, 0.96) !important;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.46) !important;
}

.ops-game-shell .ops-system-menu:not([open]) .ops-system-buttons {
  display: none !important;
}

.ops-game-shell .ops-layout {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 12px !important;
}

.ops-game-shell .ops-left-dock,
.ops-game-shell .ops-right-dock {
  display: none !important;
}

.ops-game-shell .ops-map-stage {
  grid-template-rows: auto auto minmax(520px, 1fr) auto !important;
  gap: 10px !important;
  min-height: calc(100vh - 162px) !important;
}

.ops-game-shell .story-step-card {
  display: grid !important;
  grid-template-columns: 86px minmax(0, 1fr) minmax(220px, 0.34fr) !important;
  align-items: center !important;
  gap: 14px !important;
  padding: 16px !important;
  border: 1px solid rgba(255, 217, 117, 0.28) !important;
  border-radius: 22px !important;
  background:
    radial-gradient(circle at 8% 10%, rgba(255, 217, 117, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(17, 35, 45, 0.95), rgba(5, 12, 18, 0.91)) !important;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.04) !important;
}

.ops-game-shell .story-step-index {
  display: grid !important;
  place-items: center !important;
  min-height: 78px !important;
  border-radius: 18px !important;
  background: rgba(255, 217, 117, 0.11) !important;
  color: #ffe5a1 !important;
}

.ops-game-shell .story-step-index span,
.ops-game-shell .story-step-copy span,
.ops-game-shell .story-step-action small {
  color: rgba(255, 236, 183, 0.78) !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  letter-spacing: 0.06em !important;
}

.ops-game-shell .story-step-index strong {
  color: #fff5ce !important;
  font-size: 34px !important;
  line-height: 1 !important;
}

.ops-game-shell .story-step-copy {
  min-width: 0 !important;
}

.ops-game-shell .story-step-copy h2,
.ops-game-shell .story-step-copy p {
  margin: 0 !important;
}

.ops-game-shell .story-step-copy h2 {
  margin-top: 4px !important;
  color: #fff7d8 !important;
  font-size: clamp(22px, 2.4vw, 34px) !important;
  line-height: 1.08 !important;
}

.ops-game-shell .story-step-copy p {
  max-width: 76ch !important;
  margin-top: 7px !important;
  color: rgba(232, 242, 238, 0.88) !important;
  font-size: 15px !important;
  line-height: 1.52 !important;
}

.ops-game-shell .story-step-action {
  display: grid !important;
  align-content: center !important;
  gap: 6px !important;
  min-height: 78px !important;
  padding: 14px !important;
  border-radius: 18px !important;
  background: rgba(88, 198, 170, 0.12) !important;
  box-shadow: inset 0 0 0 1px rgba(88, 198, 170, 0.24) !important;
}

.ops-game-shell .story-step-action strong {
  color: #d8fff1 !important;
  font-size: 18px !important;
  line-height: 1.22 !important;
}

.ops-game-shell .ops-map-toolbar {
  grid-template-columns: minmax(0, 1fr) auto !important;
  min-height: 42px !important;
  opacity: 0.9 !important;
}

.ops-game-shell .ops-layer-tabs {
  display: none !important;
}

.ops-game-shell .ops-map-toolbar .ops-pulse {
  max-width: 520px !important;
}

.ops-game-shell .ops-wargame-map {
  min-height: 520px !important;
}

.ops-game-shell.flow-object .intel-contact,
.ops-game-shell.flow-relation .intel-contact,
.ops-game-shell.flow-complete .intel-contact {
  display: none !important;
}

.ops-game-shell.flow-field .object-node:not(.active),
.ops-game-shell.flow-repair .object-node:not(.active) {
  opacity: 0.2 !important;
  transform: translate(-50%, -50%) scale(0.86) !important;
  pointer-events: none !important;
}

.ops-game-shell.flow-object .object-node:not(.guide-target):not(.object-pick-mode) {
  opacity: 0.46 !important;
}

.ops-game-shell .ops-map-legend,
.ops-game-shell .map-status-board,
.ops-game-shell .tactical-readout {
  opacity: 0.58 !important;
  transform: scale(0.94) !important;
  transform-origin: top left !important;
}

.ops-game-shell.flow-object .map-status-board,
.ops-game-shell.flow-field .map-status-board,
.ops-game-shell.flow-repair .map-status-board,
.ops-game-shell.flow-object .tactical-readout,
.ops-game-shell.flow-field .tactical-readout,
.ops-game-shell.flow-repair .tactical-readout {
  display: none !important;
}

.ops-game-shell .ops-command-deck {
  display: none !important;
}

.ops-game-shell.flow-relation .ops-command-deck,
.ops-game-shell.flow-complete .ops-command-deck {
  display: grid !important;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr) !important;
  padding: 12px !important;
  border: 1px solid rgba(255, 217, 117, 0.18) !important;
  border-radius: 18px !important;
  background: rgba(5, 13, 20, 0.72) !important;
}

.ops-game-shell.flow-relation .ops-command-cards,
.ops-game-shell.flow-complete .ops-command-cards {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.ops-game-shell .assign-row {
  grid-template-columns: minmax(0, 1fr) !important;
}

.ops-game-shell .assign-row > span {
  width: fit-content !important;
}

.ops-game-shell .assign-more {
  display: grid !important;
  gap: 8px !important;
}

.ops-game-shell .assign-more > summary {
  width: fit-content !important;
  padding: 7px 10px !important;
  border: 1px solid rgba(159, 188, 218, 0.2) !important;
  border-radius: 999px !important;
  color: rgba(214, 229, 228, 0.78) !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  cursor: pointer !important;
}

.ops-game-shell .assign-more:not([open]) > button {
  display: none !important;
}

.ops-game-shell .ops-footer {
  grid-template-columns: minmax(0, 1fr) max-content !important;
}

.ops-game-shell .ops-radio-feed {
  grid-template-columns: minmax(0, 1fr) !important;
}

.ops-game-shell .ops-radio-feed span:not(.active),
.ops-game-shell .ops-history-line,
.ops-game-shell .footer-actions .audio-key,
.ops-game-shell .footer-actions .drill-key {
  display: none !important;
}

.ops-game-shell .footer-actions {
  justify-content: end !important;
}

.ops-game-shell .footer-actions .action-gate {
  min-width: 168px !important;
}

@media (max-width: 920px) {
  .ops-game-shell .ops-topbar {
    grid-template-columns: minmax(0, 1fr) auto !important;
  }

  .ops-game-shell .ops-turn-strip {
    display: none !important;
  }

  .ops-game-shell .story-step-card {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    padding: 13px !important;
  }

  .ops-game-shell .story-step-index {
    display: none !important;
  }

  .ops-game-shell .story-step-action {
    min-height: 0 !important;
  }

  .ops-game-shell .story-step-copy h2 {
    font-size: 22px !important;
  }

  .ops-game-shell .story-step-copy p {
    font-size: 13px !important;
    line-height: 1.42 !important;
  }

  .ops-game-shell .ops-map-toolbar {
    display: none !important;
  }

  .ops-game-shell .ops-map-stage {
    min-height: 0 !important;
    grid-template-rows: auto minmax(500px, 1fr) auto !important;
  }

  .ops-game-shell .ops-wargame-map {
    min-height: 500px !important;
  }

  .ops-game-shell.flow-relation .ops-command-deck,
  .ops-game-shell.flow-complete .ops-command-deck {
    grid-template-columns: 1fr !important;
  }

  .ops-game-shell.flow-relation .ops-command-cards,
  .ops-game-shell.flow-complete .ops-command-cards {
    grid-template-columns: 1fr !important;
  }

  .ops-game-shell .ops-footer {
    grid-template-columns: 1fr !important;
  }

  .ops-game-shell .footer-actions {
    width: 100% !important;
  }

  .ops-game-shell .footer-actions .action-gate {
    width: 100% !important;
  }
}

@media (max-width: 760px) {
  .ops-game-shell {
    padding: 10px !important;
  }

  .ops-game-shell:has(.mobile-field-action) {
    padding-bottom: 154px !important;
  }

  .ops-game-shell .story-step-copy p {
    display: -webkit-box !important;
    overflow: hidden !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
  }

  .ops-game-shell .ops-map-stage {
    gap: 8px !important;
  }

  .ops-game-shell .ops-wargame-map {
    min-height: 474px !important;
  }

  .ops-game-shell .object-node {
    width: 96px !important;
    min-height: 86px !important;
  }

  .ops-game-shell .intel-contact {
    width: 100px !important;
    min-height: 58px !important;
  }

  .ops-game-shell .ops-map-legend {
    display: none !important;
  }

  .ops-game-shell .mobile-field-action {
    border-radius: 18px !important;
  }
}

/* v71 story-first simplification: default to one clear next action, keep expert controls tucked away. */
.ops-game-shell {
  --story-accent: #ffd975;
  --story-panel: rgba(6, 13, 19, 0.86);
}

.ops-system-menu {
  position: relative;
  justify-self: end;
}

.ops-system-menu > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(255, 217, 117, 0.28);
  border-radius: 999px;
  background: rgba(255, 217, 117, 0.08);
  color: #ffe6a3;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.ops-system-menu > summary::-webkit-details-marker {
  display: none;
}

.ops-system-menu .ops-system-buttons {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 90;
  display: grid !important;
  width: min(360px, calc(100vw - 24px));
  padding: 12px;
  border: 1px solid rgba(255, 217, 117, 0.22);
  border-radius: 18px;
  background: rgba(4, 10, 16, 0.96);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.46);
}

.ops-system-menu:not([open]) .ops-system-buttons {
  display: none !important;
}

.ops-layout {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 12px !important;
}

.ops-left-dock,
.ops-right-dock {
  display: none !important;
}

.ops-map-stage {
  grid-template-rows: auto auto minmax(520px, 1fr) auto !important;
  gap: 10px !important;
  min-height: calc(100vh - 162px) !important;
}

.story-step-card {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) minmax(220px, 0.34fr);
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(255, 217, 117, 0.28);
  border-radius: 22px;
  background:
    radial-gradient(circle at 8% 10%, rgba(255, 217, 117, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(17, 35, 45, 0.95), rgba(5, 12, 18, 0.91));
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.story-step-index {
  display: grid;
  place-items: center;
  min-height: 78px;
  border-radius: 18px;
  background: rgba(255, 217, 117, 0.11);
  color: #ffe5a1;
}

.story-step-index span,
.story-step-copy span,
.story-step-action small {
  color: rgba(255, 236, 183, 0.78);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.story-step-index strong {
  color: #fff5ce;
  font-size: 34px;
  line-height: 1;
}

.story-step-copy {
  min-width: 0;
}

.story-step-copy h2,
.story-step-copy p {
  margin: 0;
}

.story-step-copy h2 {
  margin-top: 4px;
  color: #fff7d8;
  font-size: clamp(22px, 2.4vw, 34px);
  line-height: 1.08;
}

.story-step-copy p {
  max-width: 76ch;
  margin-top: 7px;
  color: rgba(232, 242, 238, 0.88);
  font-size: 15px;
  line-height: 1.52;
}

.story-step-action {
  display: grid;
  align-content: center;
  gap: 6px;
  min-height: 78px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(88, 198, 170, 0.12);
  box-shadow: inset 0 0 0 1px rgba(88, 198, 170, 0.24);
}

.story-step-action strong {
  color: #d8fff1;
  font-size: 18px;
  line-height: 1.22;
}

.ops-map-toolbar {
  grid-template-columns: minmax(0, 1fr) auto !important;
  min-height: 42px !important;
  opacity: 0.9;
}

.ops-layer-tabs {
  display: none !important;
}

.ops-map-toolbar .ops-pulse {
  max-width: 520px;
}

.ops-wargame-map {
  min-height: 520px !important;
}

.flow-object .intel-contact,
.flow-relation .intel-contact,
.flow-complete .intel-contact {
  display: none !important;
}

.flow-field .object-node:not(.active),
.flow-repair .object-node:not(.active) {
  opacity: 0.2 !important;
  transform: translate(-50%, -50%) scale(0.86) !important;
  pointer-events: none !important;
}

.flow-object .object-node:not(.guide-target):not(.object-pick-mode) {
  opacity: 0.46;
}

.ops-map-legend,
.map-status-board,
.tactical-readout {
  opacity: 0.58;
  transform: scale(0.94);
  transform-origin: top left;
}

.flow-object .map-status-board,
.flow-field .map-status-board,
.flow-repair .map-status-board,
.flow-object .tactical-readout,
.flow-field .tactical-readout,
.flow-repair .tactical-readout {
  display: none !important;
}

.ops-command-deck {
  display: none !important;
}

.flow-relation .ops-command-deck,
.flow-complete .ops-command-deck {
  display: grid !important;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr) !important;
  padding: 12px !important;
  border: 1px solid rgba(255, 217, 117, 0.18) !important;
  border-radius: 18px !important;
  background: rgba(5, 13, 20, 0.72) !important;
}

.flow-relation .ops-command-cards,
.flow-complete .ops-command-cards {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.assign-row {
  grid-template-columns: minmax(0, 1fr) !important;
}

.assign-row > span {
  width: fit-content;
}

.assign-more {
  display: grid;
  gap: 8px;
}

.assign-more > summary {
  width: fit-content;
  padding: 7px 10px;
  border: 1px solid rgba(159, 188, 218, 0.2);
  border-radius: 999px;
  color: rgba(214, 229, 228, 0.78);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.assign-more:not([open]) > button {
  display: none !important;
}

.ops-footer {
  grid-template-columns: minmax(0, 1fr) max-content !important;
}

.ops-radio-feed {
  grid-template-columns: minmax(0, 1fr) !important;
}

.ops-radio-feed span:not(.active),
.ops-history-line,
.footer-actions .audio-key,
.footer-actions .drill-key {
  display: none !important;
}

.footer-actions {
  justify-content: end !important;
}

.footer-actions .action-gate {
  min-width: 168px !important;
}

@media (max-width: 920px) {
  .ops-topbar {
    grid-template-columns: minmax(0, 1fr) auto !important;
  }

  .ops-turn-strip {
    display: none !important;
  }

  .story-step-card {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 13px;
  }

  .story-step-index {
    display: none;
  }

  .story-step-action {
    min-height: 0;
  }

  .story-step-copy h2 {
    font-size: 22px;
  }

  .story-step-copy p {
    font-size: 13px;
    line-height: 1.42;
  }

  .ops-map-toolbar {
    display: none !important;
  }

  .ops-map-stage {
    min-height: 0 !important;
    grid-template-rows: auto minmax(500px, 1fr) auto !important;
  }

  .ops-wargame-map {
    min-height: 500px !important;
  }

  .flow-relation .ops-command-deck,
  .flow-complete .ops-command-deck {
    grid-template-columns: 1fr !important;
  }

  .flow-relation .ops-command-cards,
  .flow-complete .ops-command-cards {
    grid-template-columns: 1fr !important;
  }

  .ops-footer {
    grid-template-columns: 1fr !important;
  }

  .footer-actions {
    width: 100%;
  }

  .footer-actions .action-gate {
    width: 100% !important;
  }
}

@media (max-width: 760px) {
  .ops-game-shell {
    padding: 10px !important;
  }

  .ops-game-shell:has(.mobile-field-action) {
    padding-bottom: 154px !important;
  }

  .ops-system-menu .ops-system-buttons {
    right: 0;
  }

  .story-step-card {
    border-radius: 18px;
  }

  .story-step-copy p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
  }

  .ops-map-stage {
    gap: 8px !important;
  }

  .ops-wargame-map {
    min-height: 474px !important;
  }

  .object-node {
    width: 96px !important;
    min-height: 86px !important;
  }

  .intel-contact {
    width: 100px !important;
    min-height: 58px !important;
  }

  .ops-map-legend {
    display: none !important;
  }

  .mobile-field-action {
    border-radius: 18px !important;
  }
}

/* v65 mobile action pass: selected fields must expose the next action without hunting in the right dock. */
.mobile-field-action {
  display: none;
}

@media (max-width: 760px) {
  .mobile-field-action {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
    width: 100% !important;
    margin: 10px 0 0 !important;
    padding: 12px !important;
    border: 1px solid rgba(255, 217, 117, 0.55) !important;
    border-radius: 16px !important;
    background:
      linear-gradient(135deg, rgba(255, 217, 117, 0.18), rgba(80, 199, 255, 0.11)),
      rgba(4, 12, 20, 0.94) !important;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.34), inset 0 0 0 1px rgba(255, 255, 255, 0.06) !important;
    position: relative !important;
    z-index: 22 !important;
  }

  .mobile-field-action__copy,
  .mobile-field-action__buttons {
    min-width: 0 !important;
  }

  .mobile-field-action__copy span {
    display: inline-flex !important;
    width: fit-content !important;
    margin-bottom: 4px !important;
    padding: 3px 7px !important;
    border-radius: 999px !important;
    background: rgba(255, 217, 117, 0.18) !important;
    color: #ffd975 !important;
    font-size: 11px !important;
    font-weight: 900 !important;
    letter-spacing: 0.08em !important;
  }

  .mobile-field-action__copy strong,
  .mobile-field-action__copy small {
    display: block !important;
    max-width: 100% !important;
    overflow: visible !important;
    overflow-wrap: anywhere !important;
    text-overflow: clip !important;
    white-space: normal !important;
  }

  .mobile-field-action__copy strong {
    color: #fff7d8 !important;
    font-size: 16px !important;
    line-height: 1.28 !important;
  }

  .mobile-field-action__copy small {
    margin-top: 5px !important;
    color: rgba(229, 240, 249, 0.86) !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
  }

  .mobile-field-action__buttons {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .mobile-field-action__buttons button {
    width: 100% !important;
    min-height: 50px !important;
    padding: 11px 12px !important;
    border-radius: 14px !important;
    font-size: 15px !important;
    font-weight: 900 !important;
    overflow: visible !important;
    overflow-wrap: anywhere !important;
    text-overflow: clip !important;
    white-space: normal !important;
  }

  .tutorial-coach,
  .tutorial-coach.place-bottom,
  .tutorial-coach.place-top,
  .tutorial-coach.place-side,
  .tutorial-coach.place-side-right {
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    top: auto !important;
    bottom: 14px !important;
    width: auto !important;
    max-width: calc(100vw - 24px) !important;
    transform: none !important;
    z-index: 80 !important;
  }

  .tutorial-coach::before,
  .tutorial-coach.place-bottom::before,
  .tutorial-coach.place-top::before,
  .tutorial-coach.place-side::before,
  .tutorial-coach.place-side-right::before {
    display: none !important;
  }
}

/* v64 final visual QA pass: remove the last measured text/button spillovers. */
.inspector-card.token-panel {
  max-width: 100% !important;
  min-width: 0 !important;
  overflow: visible !important;
}

.inspector-card.token-panel p,
.inspector-card.token-panel .hint-box,
.inspector-card.token-panel .mechanic-note,
.inspector-card.token-panel .mechanic-note strong,
.inspector-card.token-panel .mechanic-note span {
  display: block !important;
  max-width: 100% !important;
  overflow: visible !important;
  overflow-wrap: anywhere !important;
  text-overflow: clip !important;
  white-space: normal !important;
  -webkit-line-clamp: unset !important;
}

.inspector-card.token-panel .assign-row {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(116px, 1fr)) !important;
  gap: 9px !important;
  align-items: stretch !important;
  justify-content: stretch !important;
}

.inspector-card.token-panel .assign-row button {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  min-height: 42px !important;
  padding: 8px 10px !important;
  overflow: visible !important;
  overflow-wrap: anywhere !important;
  text-align: center !important;
  text-overflow: clip !important;
  white-space: normal !important;
}

.inspector-card.token-panel .assign-row span {
  grid-column: 1 / -1 !important;
  min-width: 0 !important;
  overflow-wrap: anywhere !important;
  line-height: 1.35 !important;
}

.stage-card.replay .battle-sandbox .unit-counter {
  width: 96px !important;
  min-width: 0 !important;
  max-width: 112px !important;
  grid-template-columns: 24px minmax(0, 1fr) !important;
  gap: 6px !important;
  padding: 6px 7px !important;
  overflow: visible !important;
}

.stage-card.replay .battle-sandbox .unit-counter b {
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
}

.stage-card.replay .battle-sandbox .unit-counter span {
  min-width: 0 !important;
  overflow: visible !important;
  overflow-wrap: anywhere !important;
  text-overflow: clip !important;
  white-space: normal !important;
}

@media (max-width: 760px) {
  .inspector-card.token-panel .assign-row {
    grid-template-columns: 1fr !important;
  }

  .stage-card.replay .battle-sandbox .unit-counter {
    width: 88px !important;
    max-width: 96px !important;
    grid-template-columns: 1fr !important;
    justify-items: center !important;
  }

  .stage-card.replay .battle-sandbox .unit-counter b {
    display: none !important;
  }

  .stage-card.replay .battle-sandbox .unit-counter span {
    font-size: 9px !important;
    text-align: center !important;
  }
}

/* v63: QA hardening. Favor readable, playable controls over one-screen
   compression so players can always see what they selected and what to do. */
.ops-game-shell {
  min-height: 100vh;
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
}

.ops-layout {
  min-height: calc(100vh - 148px);
  height: auto;
  overflow: visible;
}

.ops-left-dock,
.ops-right-dock {
  overflow: visible;
  padding-right: 0;
}

.ops-brief-card,
.ops-registry,
.ops-doctrine,
.ops-mission-board,
.ops-intel-board,
.ops-object-board,
.ops-after-action,
.ops-intel-board .inspector-card,
.ops-object-board .object-detail,
.ops-after-action .ops-decision-board {
  overflow: visible;
}

.ops-brief-card p,
.ops-doctrine p,
.ops-command-deck p,
.ops-right-dock .inspector-card p,
.ops-right-dock .sample-data code,
.mission-objective strong,
.mission-objective small,
.mission-objective em,
.ops-registry .mini-object strong,
.ops-registry .mini-object small,
.mini-object strong,
.mini-object small,
.object-node strong,
.object-node small,
.intel-contact strong,
.intel-contact span,
.intel-contact i,
.panel-title strong,
.doctrine-step,
.queue-directive,
.contact-queue-list span,
.contact-queue-list small,
.object-detail h3,
.object-detail p,
.ops-decision-board p,
.ops-decision-board strong,
.ops-decision-board span,
.footer-actions button b,
.footer-actions button span,
.stage-nav button,
.execution-order strong,
.execution-order small,
.execution-order i {
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  -webkit-line-clamp: unset;
  -webkit-box-orient: initial;
}

.contact-queue-list {
  gap: 10px;
  overflow: visible;
}

.contact-queue-list button {
  min-height: 50px;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 7px;
}

.contact-queue-list b {
  width: 26px;
  height: 26px;
  font-size: 10px;
}

.contact-queue-list span {
  font-size: 12px;
  line-height: 1.22;
}

.contact-queue-list small {
  font-size: 10px;
  line-height: 1.25;
  text-align: left;
}

.contact-queue-list button.backup-entry::after {
  align-self: start;
  padding: 3px 7px;
  font-size: 9px;
}

.queue-directive {
  padding: 8px 10px;
  border: 1px solid rgba(88, 198, 170, 0.24);
  border-radius: 7px;
  background: rgba(88, 198, 170, 0.08);
  font-size: 12px;
  line-height: 1.35;
}

.ops-right-dock .inspector-card p,
.ops-after-action p,
.ops-right-dock .sample-data code {
  font-size: 12px;
  line-height: 1.42;
}

.object-detail {
  scrollbar-width: thin;
}

.footer-actions {
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: flex-end;
}

.footer-actions button,
.footer-actions button:not(.primary),
.footer-actions .action-gate,
.footer-actions .audio-key,
.footer-actions .drill-key {
  max-width: none;
  min-width: 92px;
  min-height: 42px;
  padding: 8px 12px;
  line-height: 1.18;
}

.footer-actions .action-gate {
  min-width: 132px;
}

.execution-order.selected.recommended {
  border-color: rgba(88, 198, 170, 0.72);
  background:
    linear-gradient(135deg, rgba(88, 198, 170, 0.18), rgba(12, 24, 22, 0.92));
  box-shadow:
    inset 4px 0 0 rgba(88, 198, 170, 0.82),
    0 0 0 1px rgba(88, 198, 170, 0.18);
}

.execution-order.selected.recommended span {
  color: #70e5ae;
}

.execution-order.selected.recommended i {
  border-color: rgba(88, 198, 170, 0.46);
  background: rgba(88, 198, 170, 0.14);
  color: #dcffef;
}

@media (max-height: 760px) and (min-width: 1181px) {
  .ops-game-shell {
    overflow-y: auto;
  }

  .ops-layout {
    min-height: calc(100vh - 148px);
    grid-template-columns: minmax(236px, 260px) minmax(0, 1fr) minmax(292px, 340px);
    gap: 10px;
    padding: 10px;
  }

  .ops-left-dock,
  .ops-right-dock {
    overflow: visible;
  }

  .ops-brief-card,
  .ops-registry,
  .ops-doctrine,
  .ops-mission-board,
  .ops-intel-board,
  .ops-object-board,
  .ops-after-action {
    padding: 10px;
  }

  .ops-doctrine .panel-title,
  .ops-doctrine p,
  .ops-doctrine .tutorial-controls {
    display: flex;
  }

  .ops-doctrine p {
    display: block;
    font-size: 11px;
    line-height: 1.35;
  }

  .doctrine-step {
    font-size: 11px;
    line-height: 1.3;
  }

  .contact-queue-list {
    gap: 8px;
  }

  .contact-queue-list button {
    min-height: 46px;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    padding: 7px 9px;
  }

  .contact-queue-list span,
  .contact-queue-list small {
    line-height: 1.22;
  }

  .ops-right-dock .inspector-card p,
  .ops-right-dock .sample-data code {
    display: block;
    overflow: visible;
  }
}

@media (max-width: 760px) {
  body {
    overflow-x: hidden;
  }

  .ops-game-shell {
    display: block;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .ops-topbar,
  .ops-footer {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
  }

  .ops-brand h1 {
    font-size: 17px;
    line-height: 1.16;
  }

  .ops-turn-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scroll-snap-type: x proximity;
  }

  .ops-turn-strip div {
    min-width: 112px;
    scroll-snap-align: start;
  }

  .ops-system-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .ops-level-jump,
  .ops-control-pad {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .ops-level-jump button,
  .ops-control-pad button {
    width: auto;
    min-height: 42px;
  }

  .ops-layout {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: auto;
    gap: 10px;
    padding: 10px;
    overflow: visible;
  }

  .ops-left-dock,
  .ops-right-dock {
    display: grid;
    gap: 10px;
    overflow: visible;
  }

  .ops-map-stage {
    order: -1;
    min-height: 620px;
    grid-template-rows: auto minmax(430px, 58vh) auto;
    overflow: visible;
  }

  .ops-map-toolbar {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: 8px;
    overflow: visible;
  }

  .ops-map-toolbar > div:first-child strong {
    display: block;
  }

  .ops-map-toolbar strong,
  .ops-map-toolbar span {
    white-space: normal;
  }

  .ops-layer-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ops-layer-tabs .layer-switch span,
  .ops-layer-tabs .layer-switch small {
    display: block;
  }

  .ops-wargame-map {
    min-width: 680px;
  }

  .ops-map-stage > .ops-wargame-map,
  .ops-wargame-map {
    overflow: auto;
  }

  .ops-registry .mini-object,
  .contact-queue-list button {
    min-height: 54px;
  }

  .contact-queue-list button {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .contact-queue-list button.backup-entry::after {
    grid-column: 2;
    justify-self: start;
  }

  .footer-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    justify-content: stretch;
  }

  .footer-actions button,
  .footer-actions button:not(.primary),
  .footer-actions .action-gate,
  .footer-actions .audio-key,
  .footer-actions .drill-key {
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: 48px;
  }

  .footer-actions .action-gate {
    grid-column: 1 / -1;
  }
}

@media (max-width: 430px) {
  .ops-topbar,
  .ops-footer,
  .ops-layout {
    padding-left: 8px;
    padding-right: 8px;
  }

  .ops-brand h1 {
    font-size: 16px;
  }

  .ops-map-stage {
    min-height: 590px;
    grid-template-rows: auto minmax(410px, 58vh) auto;
  }

  .ops-wargame-map {
    min-width: 640px;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 14% 10%, rgba(93, 212, 200, 0.16), transparent 28%),
    radial-gradient(circle at 82% 8%, rgba(247, 201, 72, 0.11), transparent 28%),
    linear-gradient(135deg, #0b101b 0%, #101827 42%, #151a22 100%);
  min-height: 100vh;
}

button {
  font: inherit;
  color: inherit;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

button:hover {
  transform: translateY(-1px);
  border-color: rgba(93, 212, 200, 0.55);
  background: rgba(93, 212, 200, 0.08);
}

.war-counter:hover,
.intel-contact:hover,
.intel-token:hover,
.object-node:hover,
.sector-label:hover,
.unit-counter:hover,
.map-chip:hover {
  transform: translate(-50%, -50%);
}

.intel-token.active:hover,
.object-node.active:hover {
  transform: translate(-50%, -50%) scale(1.04);
}

.object-node.active:hover {
  transform: translate(-50%, -50%) scale(1.06);
}

button.primary {
  border-color: transparent;
  background: linear-gradient(135deg, #44c8bd, #5f9dff);
  color: #07111d;
  font-weight: 700;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
}

.sidebar {
  min-height: 100vh;
  padding: 24px;
  background: rgba(7, 11, 18, 0.78);
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--accent), var(--blue));
  color: #07111d;
  font-weight: 900;
  font-size: 24px;
}

.brand h1,
.topbar h2,
h3,
h4,
p {
  margin-top: 0;
}

.brand h1 {
  margin-bottom: 4px;
  font-size: 20px;
}

.brand p,
.topbar p,
.mission-card p,
.task-panel p,
.source-card p,
.plan-card p,
.tip-banner p,
.ai-coach p {
  color: var(--muted);
  line-height: 1.65;
}

.level-list {
  display: grid;
  gap: 10px;
  overflow: auto;
  padding-right: 4px;
}

.level-button {
  text-align: left;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  position: relative;
}

.level-button strong,
.level-button small {
  display: block;
}

.level-button small {
  color: var(--muted);
  margin-top: 4px;
}

.level-button.active {
  background: rgba(93, 212, 200, 0.13);
  border-color: rgba(93, 212, 200, 0.55);
}

.level-button.complete .level-num {
  background: rgba(143, 227, 136, 0.22);
  color: var(--good);
}

.level-num {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 800;
}

.level-state {
  grid-column: 2;
  color: var(--accent);
  font-size: 12px;
}

.sidebar-footer {
  margin-top: auto;
}

.progress-line,
.bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  border-radius: 999px;
}

.progress-line span,
.bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.side-actions {
  display: flex;
  gap: 8px;
}

.side-actions button {
  flex: 1;
  padding: 8px;
  font-size: 13px;
}

.main-panel {
  padding: 26px;
  min-width: 0;
}

.topbar {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
}

.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
}

.topbar h2 {
  font-size: 34px;
  margin-bottom: 10px;
}

.topbar-metrics {
  display: flex;
  gap: 12px;
  align-items: center;
}

.metric,
.toggle {
  min-width: 92px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.metric span,
.toggle span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  font-size: 28px;
}

.toggle {
  display: flex;
  gap: 8px;
  align-items: center;
}

.stage-nav {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.stage-nav button {
  padding: 10px 8px;
  white-space: nowrap;
}

.stage-nav button span {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 12px;
}

.stage-nav button.active {
  background: rgba(93, 212, 200, 0.14);
  border-color: rgba(93, 212, 200, 0.58);
}

.stage-nav button.done span {
  background: rgba(143, 227, 136, 0.2);
  color: var(--good);
}

.stage-card {
  min-height: calc(100vh - 210px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 22px;
  overflow: hidden;
}

.brief-layout,
.two-column,
.graph-layout,
.action-layout,
.replay-layout {
  display: grid;
  gap: 20px;
}

.brief-layout {
  grid-template-columns: minmax(0, 1.5fr) 390px;
}

.command-room {
  min-height: 560px;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(10, 15, 24, 0.15), rgba(10, 15, 24, 0.86)),
    url("./assets/images/command-room.svg");
  background-size: cover;
  background-position: center;
}

.room-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 0 14%, rgba(255, 255, 255, 0.08) 14.3% 14.7%, transparent 15% 28%, rgba(255, 255, 255, 0.05) 28.3% 28.7%, transparent 29%),
    linear-gradient(180deg, rgba(93, 212, 200, 0.08), transparent 42%);
}

.holo-table {
  position: absolute;
  left: 50%;
  bottom: 110px;
  width: 360px;
  height: 180px;
  transform: translateX(-50%) perspective(600px) rotateX(58deg);
  border-radius: 50%;
  border: 2px solid rgba(93, 212, 200, 0.55);
  background: rgba(93, 212, 200, 0.08);
  box-shadow: 0 0 50px rgba(93, 212, 200, 0.2);
}

.radar-ring {
  position: absolute;
  inset: 26px;
  border: 1px solid rgba(93, 212, 200, 0.5);
  border-radius: 50%;
}

.radar-dot {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent-2);
  box-shadow: 0 0 20px var(--accent-2);
}

.dot-a { left: 30%; top: 44%; }
.dot-b { left: 55%; top: 30%; }
.dot-c { left: 68%; top: 62%; }

.character {
  position: absolute;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  max-width: 520px;
}

.character.commander {
  left: 30px;
  bottom: 28px;
}

.character.mentor {
  right: 30px;
  top: 28px;
}

.avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #24334f, #5dd4c8);
  color: #fff;
  font-weight: 900;
  flex: 0 0 auto;
}

.speech,
.mission-card,
.task-panel,
.source-card,
.preview-panel,
.edit-preview,
.score-panel,
.ai-coach,
.tip-banner {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 13, 22, 0.62);
  backdrop-filter: blur(14px);
  padding: 16px;
}

.speech p {
  margin-bottom: 0;
}

.mission-card {
  display: flex;
  flex-direction: column;
}

.mission-card h3 {
  font-size: 28px;
}

.check-list {
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.check-list li {
  position: relative;
  padding-left: 24px;
  color: var(--text);
  line-height: 1.55;
}

.check-list li::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  position: absolute;
  left: 0;
  top: 8px;
}

.brief-actions,
.stage-controls,
.replay-actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.two-column.wide-left {
  grid-template-columns: minmax(0, 1.4fr) 390px;
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.source-card {
  min-width: 0;
}

.source-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.source-head span,
.choice-meta {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px;
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--accent-2);
  font-weight: 700;
}

.choice-stack,
.card-grid {
  display: grid;
  gap: 10px;
}

.card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.choice-card {
  text-align: left;
  display: grid;
  gap: 6px;
  padding: 14px;
}

.choice-card strong {
  font-size: 15px;
}

.choice-card small {
  color: var(--muted);
  line-height: 1.55;
}

.choice-card.selected {
  background: rgba(93, 212, 200, 0.12);
  border-color: rgba(93, 212, 200, 0.65);
}

.choice-card.selected.trap {
  background: rgba(255, 122, 122, 0.1);
  border-color: rgba(255, 122, 122, 0.58);
}

.tip-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  border-color: rgba(247, 201, 72, 0.42);
}

.tip-banner p {
  margin: 0;
}

.stage-hint-meter {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(93, 212, 200, 0.32);
  border-radius: 8px;
  padding: 9px 10px;
  margin: 10px 0 12px;
  background: rgba(93, 212, 200, 0.07);
}

.stage-hint-meter span {
  display: grid;
  place-items: center;
  min-width: 48px;
  height: 30px;
  border-radius: 999px;
  background: rgba(93, 212, 200, 0.18);
  color: var(--accent);
  font-weight: 900;
}

.stage-hint-meter p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 13px;
}

.ontology-board {
  display: grid;
  gap: 20px;
}

.preview-panel {
  margin-top: 20px;
}

.object-preview,
.property-preview,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.object-pill,
.tag-row span,
.property-preview span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.06);
}

.object-pill.good,
.good-text {
  border-color: rgba(143, 227, 136, 0.48);
  color: var(--good);
}

.object-pill.bad,
.bad-text {
  border-color: rgba(255, 122, 122, 0.48);
  color: var(--danger);
}

.graph-layout {
  grid-template-columns: minmax(0, 1fr) 420px;
}

.graph-canvas {
  min-height: 610px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,0.04) 1px, transparent 1px),
    radial-gradient(circle at 50% 50%, rgba(93, 212, 200, 0.12), transparent 48%);
  background-size: 42px 42px, 42px 42px, auto;
}

.graph-canvas svg {
  width: 100%;
  height: 610px;
}

.graph-node circle {
  fill: url(#nodeGlow);
  stroke: rgba(255, 255, 255, 0.72);
  stroke-width: 0.4;
  vector-effect: non-scaling-stroke;
}

.graph-node text {
  fill: var(--text);
  font-size: 3px;
  paint-order: stroke;
  stroke: rgba(8, 13, 22, 0.9);
  stroke-width: 0.7;
  vector-effect: non-scaling-stroke;
}

line.edge-good,
line.edge-bad {
  stroke-width: 0.8;
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
}

line.edge-good {
  stroke: rgba(93, 212, 200, 0.85);
}

line.edge-bad {
  stroke: rgba(255, 122, 122, 0.85);
  stroke-dasharray: 2 2;
}

.ai-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.plan-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 13, 22, 0.64);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.plan-card.selected {
  border-color: rgba(93, 212, 200, 0.7);
  background: rgba(93, 212, 200, 0.1);
}

.plan-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.confidence {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(93, 212, 200, 0.1);
  color: var(--accent);
  font-size: 24px;
  font-weight: 900;
  flex: 0 0 auto;
}

.confidence span {
  font-size: 12px;
  margin-left: 2px;
}

.plan-section strong {
  display: block;
  margin-bottom: 6px;
}

.plan-section ul {
  padding-left: 18px;
  color: var(--muted);
}

.chain-text {
  color: var(--accent-2) !important;
}

.outcome {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.ai-coach {
  margin-top: 16px;
  display: flex;
  gap: 12px;
}

.action-layout {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.selected-plan {
  color: var(--accent);
}

.warning {
  color: var(--accent-2);
}

.edit-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.edit-card.good {
  border-color: rgba(143, 227, 136, 0.38);
}

.edit-card.bad {
  border-color: rgba(255, 122, 122, 0.42);
}

.replay-layout {
  grid-template-columns: minmax(0, 1fr) 430px;
}

.map-panel,
.score-panel {
  min-width: 0;
}

.tactical-map {
  height: 460px;
  border: 1px solid var(--line);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(115deg, rgba(54, 81, 62, 0.7), rgba(36, 51, 79, 0.76)),
    url("./assets/images/tactical-map.svg");
  background-size: cover;
}

.map-grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 44px 44px;
}

.route {
  position: absolute;
  height: 3px;
  background: rgba(247, 201, 72, 0.86);
  transform-origin: left center;
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(247, 201, 72, 0.4);
}

.route-a {
  left: 24%;
  top: 50%;
  width: 52%;
  transform: rotate(8deg);
}

.route-b {
  left: 42%;
  top: 62%;
  width: 34%;
  transform: rotate(-18deg);
  background: rgba(93, 212, 200, 0.8);
}

.map-event {
  position: absolute;
  width: 28px;
  height: 28px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.8);
  background: rgba(93, 212, 200, 0.82);
  color: #07111d;
  font-weight: 900;
}

.convoy {
  position: absolute;
  left: 22%;
  top: 48%;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: var(--accent-2);
  box-shadow: 0 0 20px rgba(247, 201, 72, 0.75);
}

.convoy.move {
  animation: convoyMove 4s ease-in-out forwards;
}

@keyframes convoyMove {
  0% { left: 22%; top: 48%; }
  38% { left: 42%; top: 51%; }
  70% { left: 58%; top: 45%; }
  100% { left: 73%; top: 51%; }
}

.timeline {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.timeline-item {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.timeline-item.play {
  animation: pulseItem 0.6s ease both;
}

@keyframes pulseItem {
  0% { border-color: var(--line); transform: translateX(0); }
  40% { border-color: var(--accent); transform: translateX(4px); }
  100% { border-color: var(--line); transform: translateX(0); }
}

.timeline-item span {
  color: var(--accent);
  font-weight: 800;
}

.timeline-item p {
  margin: 0;
}

.grade-card {
  display: grid;
  place-items: center;
  border-radius: 8px;
  padding: 18px;
  background: linear-gradient(145deg, rgba(93, 212, 200, 0.16), rgba(247, 201, 72, 0.1));
  border: 1px solid rgba(93, 212, 200, 0.42);
  margin-bottom: 14px;
}

.grade-card strong {
  font-size: 64px;
  line-height: 1;
}

.grade-card p {
  margin: 6px 0 0;
}

.score-bars {
  display: grid;
  gap: 10px;
}

.score-row > div:first-child {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  font-size: 13px;
}

.trace-panel {
  margin-top: 16px;
}

.issue-box {
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 122, 122, 0.1);
  border: 1px solid rgba(255, 122, 122, 0.36);
  margin-bottom: 12px;
}

.issue-box.good {
  background: rgba(143, 227, 136, 0.1);
  border-color: rgba(143, 227, 136, 0.36);
}

.issue-box p {
  margin: 0 0 6px;
}

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

.trace-item {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 8px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
}

.trace-item span {
  color: var(--accent);
  font-weight: 900;
}

.trace-item.bad span {
  color: var(--danger);
}

.trace-item p {
  margin: 0;
  color: var(--muted);
}

.battle-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 18px;
  align-items: start;
}

.battle-board,
.battle-aar {
  min-width: 0;
}

.battle-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.82fr);
  gap: 16px;
  align-items: stretch;
  border: 1px solid rgba(159, 188, 218, 0.24);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  background:
    linear-gradient(135deg, rgba(8, 13, 22, 0.9), rgba(25, 36, 54, 0.82)),
    radial-gradient(circle at 92% 18%, rgba(93, 212, 200, 0.16), transparent 34%);
  box-shadow: var(--shadow);
}

.battle-header.failed {
  background:
    linear-gradient(135deg, rgba(12, 12, 20, 0.92), rgba(43, 27, 34, 0.86)),
    radial-gradient(circle at 90% 20%, rgba(255, 122, 122, 0.18), transparent 34%);
}

.battle-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.battle-header h3 {
  margin: 5px 0 8px;
  font-size: 30px;
}

.battle-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.58;
}

.battle-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.battle-metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.045);
}

.battle-metric span {
  color: var(--muted);
  font-size: 12px;
}

.battle-metric strong {
  display: block;
  margin: 3px 0 8px;
  font-size: 24px;
}

.battle-metric .bar {
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.battle-metric .bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 14px rgba(93, 212, 200, 0.42);
}

.battle-sandbox {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  border: 1px solid rgba(159, 188, 218, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(8, 13, 22, 0.06), rgba(8, 13, 22, 0.34)),
    url("./assets/images/generated/wargame-map.png"),
    url("./assets/images/tactical-map.svg");
  background-size: cover;
  background-position: center;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.035),
    inset 0 -140px 170px rgba(4, 8, 14, 0.48),
    var(--shadow);
  isolation: isolate;
}

.battle-sandbox.theme-route {
  background:
    linear-gradient(180deg, rgba(28, 18, 7, 0.08), rgba(8, 13, 22, 0.38)),
    radial-gradient(circle at 58% 36%, rgba(247, 201, 72, 0.14), transparent 28%),
    url("./assets/images/generated/wargame-map.png"),
    url("./assets/images/tactical-map.svg");
  background-size: cover;
  background-position: center;
}

.battle-sandbox.theme-evidence {
  background:
    linear-gradient(180deg, rgba(16, 8, 28, 0.12), rgba(8, 13, 22, 0.38)),
    radial-gradient(circle at 70% 48%, rgba(176, 140, 255, 0.16), transparent 28%),
    url("./assets/images/generated/wargame-map.png"),
    url("./assets/images/tactical-map.svg");
  background-size: cover;
  background-position: center;
}

.battle-sandbox.theme-ai {
  background:
    linear-gradient(180deg, rgba(5, 24, 30, 0.12), rgba(8, 13, 22, 0.38)),
    radial-gradient(circle at 48% 42%, rgba(93, 212, 200, 0.16), transparent 30%),
    url("./assets/images/generated/wargame-map.png"),
    url("./assets/images/tactical-map.svg");
  background-size: cover;
  background-position: center;
}

.battle-sandbox.theme-action {
  background:
    linear-gradient(180deg, rgba(32, 18, 10, 0.16), rgba(8, 13, 22, 0.4)),
    radial-gradient(circle at 62% 52%, rgba(255, 122, 122, 0.13), transparent 28%),
    url("./assets/images/generated/wargame-map.png"),
    url("./assets/images/tactical-map.svg");
  background-size: cover;
  background-position: center;
}

.battle-sandbox.theme-governance {
  background:
    linear-gradient(180deg, rgba(9, 18, 34, 0.16), rgba(8, 13, 22, 0.4)),
    radial-gradient(circle at 68% 28%, rgba(123, 182, 255, 0.16), transparent 28%),
    url("./assets/images/generated/wargame-map.png"),
    url("./assets/images/tactical-map.svg");
  background-size: cover;
  background-position: center;
}

.battle-sandbox::before,
.battle-sandbox::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.battle-sandbox::before {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 58px 58px;
  mix-blend-mode: screen;
  opacity: 0.62;
}

.battle-sandbox::after {
  border: 1px solid rgba(93, 212, 200, 0.14);
  box-shadow: inset 0 0 90px rgba(0, 0, 0, 0.42);
}

.battle-map-shade {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 25% 36%, rgba(93, 212, 200, 0.12), transparent 22%),
    radial-gradient(circle at 75% 40%, rgba(247, 201, 72, 0.14), transparent 20%),
    linear-gradient(90deg, rgba(5, 9, 16, 0.14), rgba(5, 9, 16, 0.02) 45%, rgba(5, 9, 16, 0.24));
}

.battle-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
}

.supply-path,
.recon-path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.supply-path.base {
  stroke: rgba(7, 12, 20, 0.72);
  stroke-width: 2.8;
}

.supply-path.safe {
  stroke: rgba(247, 201, 72, 0.86);
  stroke-width: 0.86;
  stroke-dasharray: 3 2;
  filter: drop-shadow(0 0 5px rgba(247, 201, 72, 0.62));
}

.battle-sandbox.playing .supply-path.safe {
  animation: dashFlow 4.8s linear infinite;
}

.battle-sandbox.defeat .supply-path.safe {
  stroke: rgba(255, 122, 122, 0.86);
  filter: drop-shadow(0 0 5px rgba(255, 122, 122, 0.58));
}

.recon-path {
  stroke: rgba(93, 212, 200, 0.76);
  stroke-width: 0.72;
  stroke-dasharray: 1.8 2.4;
}

.sensor-ring,
.objective-ring {
  fill: rgba(93, 212, 200, 0.04);
  stroke: rgba(93, 212, 200, 0.56);
  stroke-width: 0.3;
  stroke-dasharray: 1.8 1.2;
}

.objective-ring {
  fill: rgba(247, 201, 72, 0.08);
  stroke: rgba(247, 201, 72, 0.7);
}

.battle-sandbox.playing .sensor-ring,
.battle-sandbox.playing .objective-ring {
  animation: ringPulse 2.4s ease-in-out infinite;
}

.map-chip {
  position: absolute;
  z-index: 5;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  min-width: 76px;
  max-width: 126px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 6px;
  padding: 5px 8px;
  background: rgba(7, 12, 20, 0.72);
  color: #dbefff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
  word-break: keep-all;
  backdrop-filter: blur(10px);
}

.map-chip.intel {
  border-color: rgba(176, 140, 255, 0.5);
}

.map-chip.graph {
  border-color: rgba(143, 227, 136, 0.48);
}

.risk-zone {
  position: absolute;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 150px;
  height: 96px;
  border: 1px dashed rgba(255, 122, 122, 0.58);
  border-radius: 50%;
  background: rgba(255, 122, 122, 0.08);
  color: #ffd3d3;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  box-shadow: 0 0 40px rgba(255, 122, 122, 0.12);
}

.risk-zone span {
  max-width: 108px;
  line-height: 1.25;
  white-space: normal;
  word-break: keep-all;
}

.risk-zone.primary {
  left: 63%;
  top: 36%;
}

.risk-zone.secondary {
  left: 38%;
  top: 54%;
  width: 128px;
  height: 82px;
  border-color: rgba(247, 201, 72, 0.46);
  background: rgba(247, 201, 72, 0.07);
  color: #fff2b2;
}

.battle-sandbox.playing .risk-zone {
  animation: riskPulse 2s ease-in-out infinite;
}

.unit-counter {
  position: absolute;
  z-index: 8;
  width: 78px;
  min-height: 44px;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 6px;
  align-items: center;
  padding: 7px;
  border: 1px solid rgba(123, 182, 255, 0.72);
  border-radius: 6px;
  background: linear-gradient(145deg, rgba(10, 22, 35, 0.92), rgba(16, 45, 62, 0.82));
  color: #eef5fb;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38), 0 0 20px rgba(123, 182, 255, 0.18);
}

.unit-counter b {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: rgba(123, 182, 255, 0.2);
  color: var(--blue);
}

.unit-counter span {
  display: block;
  font-size: 12px;
  color: #d9e8ff;
  font-weight: 800;
  line-height: 1.15;
  white-space: normal;
  word-break: keep-all;
  text-align: left;
}

.map-chip.active,
.risk-zone.active,
.unit-counter.active {
  border-color: rgba(93, 212, 200, 0.82);
  box-shadow:
    0 0 0 1px rgba(93, 212, 200, 0.42),
    0 0 26px rgba(93, 212, 200, 0.24),
    0 10px 28px rgba(0, 0, 0, 0.38);
}

.map-chip.active,
.risk-zone.active {
  background: rgba(8, 28, 34, 0.9);
}

.unit-counter.active b,
.map-chip.active,
.risk-zone.active span {
  color: #f2fffd;
}

.unit-counter.recon {
  left: 20%;
  top: 42%;
  border-color: rgba(93, 212, 200, 0.72);
}

.unit-counter.recon b {
  background: rgba(93, 212, 200, 0.18);
  color: var(--accent);
}

.unit-counter.convoy {
  left: 11%;
  top: 60%;
  border-color: rgba(247, 201, 72, 0.76);
}

.unit-counter.convoy b {
  background: rgba(247, 201, 72, 0.18);
  color: var(--accent-2);
}

.unit-counter.relay {
  left: 49%;
  top: 61%;
}

.unit-counter.objective {
  left: 84%;
  top: 36%;
  border-color: rgba(143, 227, 136, 0.72);
}

.unit-counter.objective b {
  background: rgba(143, 227, 136, 0.18);
  color: var(--good);
}

.battle-sandbox.playing .unit-counter.recon {
  animation: reconSweep 5s ease-in-out forwards;
}

.battle-sandbox.playing.victory .unit-counter.convoy {
  animation: convoyVictory 5.4s ease-in-out forwards;
}

.battle-sandbox.playing.defeat .unit-counter.convoy {
  animation: convoyFailure 4.2s ease-in-out forwards;
}

.battle-sandbox.playing.victory .unit-counter.objective {
  animation: objectiveGlow 1.8s ease-in-out infinite;
}

.battle-verdict {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 8;
  padding: 10px 12px;
  border: 1px solid rgba(143, 227, 136, 0.48);
  border-radius: 6px;
  background: rgba(7, 12, 20, 0.78);
  color: var(--good);
  font-weight: 900;
  box-shadow: 0 0 24px rgba(143, 227, 136, 0.12);
}

.battle-sandbox.defeat .battle-verdict {
  border-color: rgba(255, 122, 122, 0.52);
  color: var(--danger);
}

.battle-command-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.battle-result-card {
  border: 1px solid rgba(143, 227, 136, 0.44);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 14px;
  background: linear-gradient(145deg, rgba(143, 227, 136, 0.14), rgba(93, 212, 200, 0.09));
}

.battle-result-card.failed {
  border-color: rgba(255, 122, 122, 0.48);
  background: linear-gradient(145deg, rgba(255, 122, 122, 0.14), rgba(247, 201, 72, 0.07));
}

.battle-result-card span,
.battle-score-details summary {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.battle-result-card strong {
  display: block;
  margin: 5px 0;
  font-size: 34px;
}

.battle-result-card p {
  margin: 0;
  color: var(--muted);
}

.phase-track,
.causality-card,
.battle-score-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(8, 13, 22, 0.52);
  margin-bottom: 14px;
}

.phase-track h3,
.causality-card h3 {
  margin-top: 0;
}

.replay-focus-card {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(93, 212, 200, 0.32);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(10, 28, 34, 0.9), rgba(7, 15, 24, 0.84)),
    repeating-linear-gradient(90deg, rgba(93, 212, 200, 0.06) 0 1px, transparent 1px 20px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.replay-focus-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.replay-focus-card strong {
  font-size: 22px;
  line-height: 1.15;
}

.replay-focus-card em {
  color: var(--accent);
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.replay-focus-meta {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(93, 212, 200, 0.12);
  color: #d6fffa;
  font-size: 11px;
  font-weight: 800;
}

.replay-focus-card.empty {
  border-color: rgba(159, 188, 218, 0.2);
  background: rgba(8, 13, 22, 0.46);
}

.battle-event {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 10px;
  align-items: start;
  border-top: 1px solid rgba(159, 188, 218, 0.16);
  padding: 11px 0;
}

.battle-event:first-of-type {
  border-top: 0;
}

.battle-event span {
  color: var(--accent);
  font-weight: 900;
}

.battle-event strong {
  display: block;
  margin-bottom: 3px;
}

.battle-event p,
.causality-card p,
.small-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.battle-event.danger span,
.battle-event.warning span {
  color: var(--danger);
}

.battle-event.success span {
  color: var(--good);
}

.battle-playing .battle-event {
  animation: eventReveal 0.55s ease both;
  animation-delay: var(--delay);
}

.battle-score-details {
  padding: 12px;
}

.battle-score-details summary {
  cursor: pointer;
  margin-bottom: 10px;
}

.ontology-causal-chain {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
  margin: 12px 0;
}

.ontology-causal-chain span {
  min-height: 40px;
  display: grid;
  place-items: center;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.045);
  font-size: 12px;
  font-weight: 800;
}

.ontology-causal-chain i {
  display: none;
}

.small-note {
  font-size: 12px;
}

@keyframes dashFlow {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -30; }
}

@keyframes ringPulse {
  0%, 100% { opacity: 0.56; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.03); }
}

@keyframes riskPulse {
  0%, 100% { opacity: 0.72; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

@keyframes reconSweep {
  0%, 100% { transform: translate(0, 0); }
  35% { transform: translate(9px, -8px); }
  70% { transform: translate(18px, -2px); }
}

@keyframes convoyVictory {
  0%, 100% { transform: translate(0, 0); }
  38% { transform: translate(13px, -6px); }
  72% { transform: translate(24px, 3px); }
}

@keyframes convoyFailure {
  0%, 100% { transform: translate(0, 0); }
  35% { transform: translate(8px, -3px); }
  70% { transform: translate(8px, -3px); border-color: rgba(255, 122, 122, 0.8); }
}

@keyframes objectiveGlow {
  0%, 100% { box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38), 0 0 18px rgba(143, 227, 136, 0.22); }
  50% { box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38), 0 0 32px rgba(143, 227, 136, 0.54); }
}

@keyframes eventReveal {
  0% { opacity: 0.35; transform: translateX(0); border-color: rgba(159, 188, 218, 0.16); }
  45% { opacity: 1; transform: translateX(5px); border-color: rgba(93, 212, 200, 0.5); }
  100% { opacity: 1; transform: translateX(0); border-color: rgba(159, 188, 218, 0.16); }
}

.empty {
  color: var(--muted);
}

.ops-game-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 76px minmax(0, 1fr) 72px;
  background:
    linear-gradient(180deg, rgba(4, 8, 14, 0.88), rgba(8, 13, 22, 0.64)),
    url("./assets/images/generated/wargame-map.png");
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.ops-topbar,
.ops-footer {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 10px 16px;
  background: linear-gradient(90deg, rgba(5, 8, 14, 0.96), rgba(18, 29, 44, 0.91));
  border-bottom: 1px solid rgba(159, 188, 218, 0.24);
  box-shadow: 0 12px 42px rgba(0, 0, 0, 0.38);
  z-index: 20;
}

.ops-footer {
  grid-template-columns: minmax(0, 1fr) auto;
  border-top: 1px solid rgba(159, 188, 218, 0.24);
  border-bottom: 0;
}

.ops-brand,
.ops-system-buttons,
.ops-layer-tabs,
.footer-actions,
.tutorial-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ops-brand p {
  margin: 0 0 2px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.ops-brand h1 {
  margin: 0;
  font-size: 21px;
}

.ops-turn-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.ops-turn-strip div {
  position: relative;
  border: 1px solid rgba(159, 188, 218, 0.2);
  border-radius: 6px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.045);
  overflow: hidden;
}

.ops-turn-strip div::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: rgba(159, 188, 218, 0.36);
}

.ops-turn-strip div.active {
  border-color: rgba(93, 212, 200, 0.5);
  background: rgba(93, 212, 200, 0.09);
}

.ops-turn-strip div.active::before {
  background: var(--accent);
}

.ops-turn-strip span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.ops-turn-strip strong {
  display: block;
  margin-top: 2px;
  font-size: 13px;
}

.ops-system-buttons button,
.ops-layer-tabs button,
.ops-footer button {
  padding: 8px 10px;
}

.ops-system-buttons button.disabled {
  opacity: 0.42;
  pointer-events: none;
}

.ops-level-jump {
  display: flex;
  gap: 5px;
  padding: 4px;
  border: 1px solid rgba(159, 188, 218, 0.2);
  border-radius: 8px;
  background: rgba(5, 9, 16, 0.58);
}

.ops-level-jump button {
  width: 34px;
  height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 6px;
  font-weight: 900;
}

.ops-level-jump button.active {
  border-color: rgba(93, 212, 200, 0.62);
  background: rgba(93, 212, 200, 0.14);
  color: var(--accent);
}

.ops-control-pad {
  display: grid;
  grid-template-columns: repeat(4, minmax(42px, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(207, 174, 103, 0.22);
  border-radius: 4px;
  background: rgba(5, 8, 10, 0.68);
}

.ops-control-pad button {
  min-width: 0;
  width: 44px;
  min-height: 34px;
  display: grid;
  grid-template-rows: 13px 12px;
  gap: 1px;
  align-content: center;
  justify-items: center;
  padding: 3px 4px;
  border-radius: 3px;
  text-align: center;
}

.ops-control-pad button b,
.ops-control-pad button span {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-control-pad button b {
  color: #aeb8b4;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0;
}

.ops-control-pad button span {
  color: #e8debe;
  font-size: 9px;
  font-weight: 900;
}

.ops-control-pad button.fire-control {
  border-color: rgba(241, 212, 139, 0.4);
  background: rgba(241, 212, 139, 0.08);
}

.ops-control-pad button.fire-control b,
.ops-control-pad button.fire-control span {
  color: #f1d48b;
}

.ops-layout {
  min-height: 0;
  height: calc(100vh - 148px);
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 340px;
  gap: 12px;
  padding: 12px;
  overflow: hidden;
}

.ops-left-dock,
.ops-right-dock {
  min-height: 0;
  display: grid;
  gap: 12px;
  align-content: start;
  overflow: auto;
  padding-right: 2px;
}

.ops-brief-card,
.ops-registry,
.ops-doctrine,
.ops-mission-board,
.ops-intel-board,
.ops-object-board,
.ops-after-action,
.ops-map-stage,
.ops-command-deck {
  border: 1px solid rgba(159, 188, 218, 0.24);
  border-radius: 8px;
  background: rgba(5, 9, 16, 0.78);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(14px);
}

.ops-brief-card,
.ops-registry,
.ops-doctrine,
.ops-mission-board,
.ops-intel-board,
.ops-object-board,
.ops-after-action {
  padding: 13px;
}

.ops-brief-card > span,
.panel-title span,
.ops-command-deck > div > span,
.ops-map-toolbar span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
}

.ops-brief-card h2 {
  margin: 5px 0 8px;
  font-size: 22px;
}

.ops-brief-card p,
.ops-doctrine p,
.ops-command-deck p {
  color: var(--muted);
  line-height: 1.54;
}

.objective-meter {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.objective-meter div {
  border: 1px solid rgba(159, 188, 218, 0.2);
  border-radius: 6px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.objective-meter span,
.objective-meter strong {
  display: block;
}

.objective-meter span {
  color: var(--muted);
  font-size: 11px;
}

.objective-meter strong {
  margin-top: 3px;
  font-size: 18px;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 10px;
}

.panel-title strong {
  font-size: 15px;
}

.ops-registry {
  display: grid;
  gap: 8px;
}

.ops-registry .mini-object {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.045);
}

.ops-registry .mini-object.active {
  background: rgba(93, 212, 200, 0.11);
}

.doctrine-step {
  border-left: 3px solid var(--accent-2);
  padding: 9px 10px;
  margin: 10px 0;
  background: rgba(247, 201, 72, 0.08);
  color: #ffe8a6;
  line-height: 1.45;
}

.ops-map-stage {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: 54px minmax(0, 1fr) 126px;
  overflow: hidden;
}

.ops-map-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(159, 188, 218, 0.22);
  background: rgba(4, 8, 14, 0.62);
}

.ops-map-toolbar strong {
  display: block;
  margin-top: 2px;
  font-size: 14px;
}

.ops-layer-tabs {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ops-layer-tabs button.active {
  border-color: rgba(93, 212, 200, 0.62);
  background: rgba(93, 212, 200, 0.12);
}

.ops-wargame-map {
  position: relative;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(4, 8, 14, 0.05), rgba(4, 8, 14, 0.34)),
    url("./assets/images/generated/wargame-map.png");
  background-size: cover;
  background-position: center;
  isolation: isolate;
}

.ops-wargame-map::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03), inset 0 -110px 120px rgba(0, 0, 0, 0.28);
}

.ops-wargame-map.theme-route,
.staff-war-map.theme-route,
.execution-war-map.theme-route {
  background:
    linear-gradient(180deg, rgba(28, 18, 7, 0.08), rgba(4, 8, 14, 0.36)),
    radial-gradient(circle at 58% 36%, rgba(247, 201, 72, 0.14), transparent 28%),
    url("./assets/images/generated/wargame-map.png");
  background-size: cover;
  background-position: center;
}

.ops-wargame-map.theme-evidence,
.staff-war-map.theme-evidence,
.execution-war-map.theme-evidence {
  background:
    linear-gradient(180deg, rgba(16, 8, 28, 0.12), rgba(4, 8, 14, 0.38)),
    radial-gradient(circle at 70% 48%, rgba(176, 140, 255, 0.15), transparent 28%),
    url("./assets/images/generated/wargame-map.png");
  background-size: cover;
  background-position: center;
}

.ops-wargame-map.theme-ai,
.staff-war-map.theme-ai,
.execution-war-map.theme-ai {
  background:
    linear-gradient(180deg, rgba(5, 24, 30, 0.12), rgba(4, 8, 14, 0.36)),
    radial-gradient(circle at 48% 42%, rgba(93, 212, 200, 0.16), transparent 30%),
    url("./assets/images/generated/wargame-map.png");
  background-size: cover;
  background-position: center;
}

.ops-wargame-map.theme-action,
.staff-war-map.theme-action,
.execution-war-map.theme-action {
  background:
    linear-gradient(180deg, rgba(32, 18, 10, 0.16), rgba(4, 8, 14, 0.38)),
    radial-gradient(circle at 62% 52%, rgba(255, 122, 122, 0.12), transparent 28%),
    url("./assets/images/generated/wargame-map.png");
  background-size: cover;
  background-position: center;
}

.ops-wargame-map.theme-governance,
.staff-war-map.theme-governance,
.execution-war-map.theme-governance {
  background:
    linear-gradient(180deg, rgba(9, 18, 34, 0.16), rgba(4, 8, 14, 0.38)),
    radial-gradient(circle at 68% 28%, rgba(123, 182, 255, 0.16), transparent 28%),
    url("./assets/images/generated/wargame-map.png");
  background-size: cover;
  background-position: center;
}

.hex-grid {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.052) 1px, transparent 1px),
    linear-gradient(30deg, rgba(255,255,255,0.032) 1px, transparent 1px),
    linear-gradient(150deg, rgba(255,255,255,0.032) 1px, transparent 1px);
  background-size: 54px 54px, 54px 54px, 54px 54px;
  mix-blend-mode: screen;
}

.ops-map-lines {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.ops-route {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ops-route.main {
  stroke: rgba(247, 201, 72, 0.72);
  stroke-width: 0.95;
  stroke-dasharray: 3 2;
  filter: drop-shadow(0 0 5px rgba(247, 201, 72, 0.5));
}

.ops-route.recon {
  stroke: rgba(93, 212, 200, 0.7);
  stroke-width: 0.7;
  stroke-dasharray: 1.6 2.2;
}

.ops-wargame-map .sandbox-line {
  transform: scale(1, 0.64);
  transform-origin: 0 0;
}

.sector-label {
  position: absolute;
  z-index: 5;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  padding: 4px 7px;
  background: rgba(4, 8, 14, 0.54);
  color: rgba(238, 245, 251, 0.78);
  font-size: 11px;
  font-weight: 900;
}

.war-counter {
  position: absolute;
  z-index: 8;
  transform: translate(-50%, -50%);
  width: 92px;
  min-height: 56px;
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 7px;
  align-items: center;
  padding: 8px;
  border: 2px solid rgba(123, 182, 255, 0.76);
  border-radius: 5px;
  background: linear-gradient(145deg, rgba(8, 21, 35, 0.95), rgba(15, 43, 62, 0.88));
  color: var(--text);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.42);
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.war-counter b {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: rgba(123, 182, 255, 0.2);
  color: var(--blue);
  font-weight: 900;
}

.war-counter span,
.war-counter small {
  display: block;
  grid-column: 2;
}

.war-counter span {
  font-size: 12px;
  font-weight: 900;
}

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

.war-counter.objective {
  border-color: rgba(143, 227, 136, 0.76);
}

.war-counter.convoy {
  border-color: rgba(247, 201, 72, 0.78);
}

.war-counter.recon {
  border-color: rgba(93, 212, 200, 0.78);
}

.ops-risk-field {
  position: absolute;
  z-index: 6;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(255, 122, 122, 0.58);
  border-radius: 50%;
  background: rgba(255, 122, 122, 0.08);
  color: #ffd0d0;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.ops-risk-field.rockfall {
  left: 60%;
  top: 32%;
  width: 138px;
  height: 90px;
}

.ops-risk-field.signal {
  left: 43%;
  top: 51%;
  width: 126px;
  height: 76px;
  border-color: rgba(247, 201, 72, 0.5);
  background: rgba(247, 201, 72, 0.07);
  color: #ffefb4;
}

.generated-icon {
  --icon-size: 40px;
  --icon-col: 0;
  --icon-row: 0;
  position: relative;
  display: grid;
  place-items: center;
  width: var(--icon-size);
  height: var(--icon-size);
  min-width: var(--icon-size);
  overflow: hidden;
  border: 1px solid rgba(115, 226, 232, 0.22);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(11, 23, 33, 0.78), rgba(3, 6, 12, 0.86)),
    var(--icon-atlas);
  background-size: 400% 500%;
  background-position: var(--icon-x, 0%) var(--icon-y, 0%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 0 16px rgba(93, 212, 200, 0.14);
}

.generated-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 42%, transparent 42%, rgba(2, 7, 13, 0.1) 70%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent 35%, rgba(93, 212, 200, 0.12));
  mix-blend-mode: screen;
  pointer-events: none;
}

.generated-icon i {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.generated-icon b {
  position: absolute;
  right: 2px;
  top: 2px;
  z-index: 1;
  display: grid;
  place-items: center;
  min-width: 13px;
  height: 13px;
  border-radius: 999px;
  background: rgba(4, 8, 14, 0.88);
  color: #fff;
  font-size: 9px;
  line-height: 1;
}

.object-icon {
  --icon-size: 34px;
  border-color: color-mix(in srgb, var(--obj-color), transparent 38%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 0 18px color-mix(in srgb, var(--obj-color), transparent 62%);
}

.token-icon {
  --icon-size: 34px;
  border-color: rgba(247, 201, 72, 0.32);
}

.queue-icon {
  --icon-size: 24px;
  border-radius: 4px;
}

.war-icon {
  --icon-size: 32px;
  border-radius: 5px;
}

.intel-contact {
  position: absolute;
  z-index: 9;
  transform: translate(-50%, -50%);
  width: 128px;
  min-height: 76px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 8px;
  align-items: center;
  padding: 7px 8px;
  text-align: left;
  border: 1px solid rgba(247, 201, 72, 0.42);
  border-radius: 5px;
  background: rgba(5, 9, 16, 0.86);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.36);
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.intel-contact:hover {
  border-color: rgba(247, 201, 72, 0.72);
  background: rgba(12, 18, 29, 0.94);
  box-shadow: 0 0 0 3px rgba(247, 201, 72, 0.12), 0 14px 30px rgba(0, 0, 0, 0.4);
}

.intel-contact span,
.intel-contact i {
  display: block;
  grid-column: 2;
  color: var(--accent-2);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.intel-contact strong {
  display: block;
  grid-column: 2;
  margin: 2px 0;
  font-size: 12px;
  line-height: 1.18;
}

.intel-contact i {
  color: var(--muted);
}

.intel-contact .token-icon {
  grid-column: 1;
  grid-row: 1 / span 2;
}

.intel-contact.active {
  border-color: #fff;
  background: rgba(93, 212, 200, 0.17);
}

.intel-contact.linked {
  border-color: rgba(143, 227, 136, 0.68);
}

.intel-contact.wrong,
.intel-contact.trap {
  border-color: rgba(255, 122, 122, 0.72);
}

.object-slot {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  text-align: left;
  border-radius: 6px;
  border-color: color-mix(in srgb, var(--obj-color), transparent 30%);
  background: rgba(5, 9, 16, 0.78);
}

.object-slot.active {
  background: color-mix(in srgb, var(--obj-color), transparent 86%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--obj-color), transparent 20%);
}

.object-slot b {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: color-mix(in srgb, var(--obj-color), transparent 72%);
  color: var(--obj-color);
}

.object-slot span,
.object-slot small {
  display: block;
}

.object-slot small {
  color: var(--muted);
}

.ops-map-legend {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(159, 188, 218, 0.22);
  border-radius: 6px;
  background: rgba(5, 9, 16, 0.66);
}

.ops-map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}

.ops-map-legend i {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 2px;
}

.legend-unit { background: var(--blue); }
.legend-contact { background: var(--accent-2); }
.legend-link { background: var(--good); }

.ops-command-deck {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 0;
}

.ops-command-deck strong {
  display: block;
  margin: 3px 0 5px;
}

.ops-command-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.ops-command-cards button {
  min-height: 132px;
  text-align: left;
  display: grid;
  align-content: start;
  gap: 5px;
  border-radius: 6px;
  background: linear-gradient(145deg, rgba(16, 28, 42, 0.88), rgba(8, 13, 22, 0.78));
}

.guided-mode .guide-dimmed {
  opacity: 1;
  filter: none;
  pointer-events: auto;
}

.guided-mode .guide-target {
  z-index: 30;
  opacity: 1;
  filter: none;
  border-color: #fff8c7 !important;
  box-shadow:
    0 0 0 4px rgba(247, 201, 72, 0.22),
    0 0 28px rgba(247, 201, 72, 0.52),
    0 14px 34px rgba(0, 0, 0, 0.46) !important;
}

.guided-mode .ops-command-cards .guide-target,
.guided-mode .contact-queue-list .guide-target,
.guided-mode [data-testid="sandbox-assign-suggested"].guide-target,
.guided-mode [data-testid="sandbox-complete"].guide-target {
  position: relative;
}

.guided-mode .intel-contact.guide-target::after,
.guided-mode .ops-command-cards .guide-target::after,
.guided-mode .contact-queue-list .guide-target::after,
.guided-mode [data-testid="sandbox-assign-suggested"].guide-target::after,
.guided-mode [data-testid="sandbox-complete"].guide-target::after {
  content: "";
  position: absolute;
  right: -7px;
  top: -7px;
  z-index: 35;
  width: 14px;
  height: 14px;
  padding: 0;
  border: 2px solid #f7c948;
  border-radius: 50%;
  background: rgba(247, 201, 72, 0.18);
  box-shadow: 0 0 0 5px rgba(247, 201, 72, 0.12), 0 0 18px rgba(247, 201, 72, 0.42);
}

.ops-tutorial-mask {
  position: fixed;
  inset: 0;
  z-index: 24;
  pointer-events: none;
}

.mask-backdrop {
  display: none;
}

.tutorial-coach {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: min(430px, calc(100vw - 32px));
  padding: 13px 14px;
  border: 1px solid rgba(88, 198, 170, 0.42);
  border-radius: 4px;
  background: rgba(5, 8, 10, 0.88);
  color: var(--text);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42), 0 0 18px rgba(88, 198, 170, 0.14);
  pointer-events: auto;
}

.tutorial-coach.place-bottom {
  bottom: 84px;
}

.tutorial-coach.place-top {
  top: 84px;
}

.tutorial-coach.place-side {
  left: 22px;
  top: 92px;
  transform: none;
  width: min(340px, calc(100vw - 44px));
}

.tutorial-coach.place-side-right {
  left: auto;
  right: 22px;
  top: 92px;
  transform: none;
  width: min(340px, calc(100vw - 44px));
}

.tutorial-coach::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -26px;
  width: 2px;
  height: 26px;
  background: linear-gradient(180deg, transparent, rgba(247, 201, 72, 0.9));
}

.tutorial-coach.place-top::before {
  top: auto;
  bottom: -26px;
  background: linear-gradient(0deg, transparent, rgba(247, 201, 72, 0.9));
}

.tutorial-coach.place-side::before {
  left: auto;
  right: -26px;
  top: 42%;
  width: 26px;
  height: 2px;
  background: linear-gradient(90deg, rgba(247, 201, 72, 0.9), transparent);
}

.tutorial-coach.place-side-right::before {
  left: -26px;
  top: 42%;
  width: 26px;
  height: 2px;
  background: linear-gradient(270deg, rgba(247, 201, 72, 0.9), transparent);
}

.tutorial-coach span {
  color: var(--accent-2);
  font-size: 11px;
  font-weight: 900;
}

.tutorial-coach h3 {
  margin: 5px 0 8px;
  font-size: 16px;
}

.tutorial-coach p {
  color: #d8e5f2;
  line-height: 1.45;
  font-size: 13px;
}

.tutorial-action,
.tutorial-warning {
  margin-top: 10px;
  border-left: 3px solid var(--accent-2);
  padding: 9px 10px;
  background: rgba(247, 201, 72, 0.1);
  color: #ffe8a6;
  font-weight: 800;
}

.tutorial-warning {
  border-left-color: var(--danger);
  background: rgba(255, 122, 122, 0.1);
  color: #ffd3d3;
}

.tutorial-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.tutorial-coach.nudge {
  animation: coachNudge 0.36s ease;
}

@keyframes coachNudge {
  0%, 100% { transform: translateX(-50%); }
  35% { transform: translateX(calc(-50% - 8px)); }
  70% { transform: translateX(calc(-50% + 8px)); }
}

.ops-command-cards button.active {
  border-color: rgba(247, 201, 72, 0.72);
  background: linear-gradient(145deg, rgba(247, 201, 72, 0.16), rgba(8, 13, 22, 0.84));
}

.ops-command-cards span,
.ops-command-cards small,
.ops-command-cards em,
.ops-command-cards i {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  font-style: normal;
}

.ops-command-cards strong {
  margin: 4px 0;
  color: var(--accent-2);
}

.ops-command-cards em {
  color: #d8e5f2;
}

.ops-command-cards i {
  padding-top: 5px;
  border-top: 1px solid rgba(159, 188, 218, 0.16);
  color: #ffe8a6;
}

.relation-remove {
  width: max-content;
  margin-top: 3px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255, 122, 122, 0.12);
  color: #ffd3d3;
  font-size: 11px;
}

.ops-intel-board .inspector-card,
.ops-object-board .inspector-card {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.ops-right-dock .inspector-card p {
  line-height: 1.45;
}

.ops-right-dock .sample-data code {
  font-size: 12px;
}

.contact-queue {
  grid-template-rows: auto minmax(0, 1fr) auto !important;
  gap: 7px;
}

.contact-queue-list {
  min-height: 0;
  display: grid;
  gap: 2px;
  overflow: hidden;
}

.contact-queue-list button {
  min-width: 0;
  min-height: 26px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) minmax(64px, auto);
  gap: 6px;
  align-items: center;
  padding: 4px 6px;
  border: 1px solid rgba(159, 188, 218, 0.16);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.035);
  text-align: left;
}

.contact-queue-list button.active {
  border-color: rgba(88, 198, 170, 0.48);
  background: rgba(88, 198, 170, 0.1);
}

.contact-queue-list button.backup-entry {
  border-style: dashed;
  border-color: rgba(159, 188, 218, 0.26);
  background: rgba(255, 255, 255, 0.02);
}

.contact-queue-list button.backup-entry::after {
  content: attr(data-entry-label);
  justify-self: end;
  align-self: center;
  padding: 2px 6px;
  border: 1px solid rgba(159, 188, 218, 0.22);
  border-radius: 999px;
  color: rgba(210, 224, 240, 0.74);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.contact-queue-list > button > b {
  display: grid;
  place-items: center;
  height: 18px;
  border-radius: 2px;
  background: rgba(241, 212, 139, 0.12);
  color: #f1d48b;
  font-size: 8px;
}

.contact-queue-list span,
.contact-queue-list small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-queue-list span {
  color: #e8debe;
  font-size: 10px;
  font-weight: 900;
}

.contact-queue-list small {
  color: #aeb8b4;
  font-size: 8px;
  text-align: right;
}

.queue-directive {
  min-width: 0;
  overflow: hidden;
  color: #58c6aa;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.25;
  text-overflow: clip;
  white-space: normal;
}

.sim-bars {
  display: grid;
  gap: 10px;
}

.sim-bar div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
}

.sim-bar span {
  color: var(--muted);
}

.sim-bar i {
  height: 7px;
  display: block;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.sim-bar b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.layer-supply .intel-contact:not(.property),
.layer-intel .war-counter,
.layer-risk .object-slot {
  opacity: 0.42;
}

.layer-ontology .war-counter,
.layer-ontology .ops-risk-field {
  opacity: 0.72;
}

.staff-room,
.execution-room {
  display: grid;
  grid-template-columns: minmax(320px, 0.86fr) minmax(0, 1.25fr) 360px;
  gap: 14px;
  align-items: stretch;
}

.execution-room {
  grid-template-columns: minmax(360px, 0.95fr) minmax(0, 1fr) 390px;
}

.staff-map-panel,
.staff-proposals,
.staff-evidence,
.execution-map,
.execution-orders,
.execution-writeback {
  min-width: 0;
  border: 1px solid rgba(159, 188, 218, 0.24);
  border-radius: 8px;
  background: rgba(5, 9, 16, 0.76);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
}

.staff-map-panel,
.execution-map {
  display: grid;
  grid-template-rows: 58px minmax(360px, 1fr) auto;
  overflow: hidden;
}

.staff-map-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid rgba(159, 188, 218, 0.22);
  background: rgba(4, 8, 14, 0.62);
}

.staff-map-header span,
.staff-evidence-card span,
.execution-status span,
.execution-order span {
  display: block;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
}

.staff-map-header strong {
  display: block;
  margin-top: 2px;
}

.staff-grade {
  min-width: 62px;
  text-align: center;
  border: 1px solid rgba(93, 212, 200, 0.35);
  border-radius: 6px;
  padding: 6px 8px;
  background: rgba(93, 212, 200, 0.08);
}

.staff-grade strong {
  font-size: 24px;
}

.staff-war-map,
.execution-war-map {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(4, 8, 14, 0.04), rgba(4, 8, 14, 0.36)),
    url("./assets/images/generated/wargame-map.png");
  background-size: cover;
  background-position: center;
}

.staff-war-map::after,
.execution-war-map::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.035), inset 0 -90px 110px rgba(0,0,0,.32);
}

.staff-context-chain {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 11;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.staff-context-chain span {
  min-height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(93, 212, 200, 0.32);
  border-radius: 5px;
  background: rgba(5, 9, 16, 0.72);
  font-size: 12px;
  font-weight: 900;
}

.staff-context-chain i {
  display: none;
}

.staff-verdict {
  position: absolute;
  right: 14px;
  top: 14px;
  z-index: 12;
  border: 1px solid rgba(143, 227, 136, 0.42);
  border-radius: 5px;
  padding: 8px 10px;
  background: rgba(5, 9, 16, 0.74);
  color: var(--good);
  font-weight: 900;
}

.staff-verdict.failed {
  border-color: rgba(255, 122, 122, 0.48);
  color: var(--danger);
}

.staff-readouts,
.execution-status {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid rgba(159, 188, 218, 0.18);
}

.execution-status {
  grid-template-columns: 1fr 1fr;
}

.execution-status div {
  border: 1px solid rgba(159, 188, 218, 0.2);
  border-radius: 6px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.execution-status strong {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.35;
}

.staff-proposals,
.staff-evidence,
.execution-orders,
.execution-writeback {
  padding: 14px;
}

.staff-proposals {
  display: grid;
  gap: 12px;
  align-content: start;
}

.staff-plan {
  position: relative;
  padding: 14px;
  border-radius: 7px;
  background: linear-gradient(145deg, rgba(16, 28, 42, 0.82), rgba(8, 13, 22, 0.82));
}

.staff-plan.selected {
  box-shadow: inset 0 0 0 1px rgba(93, 212, 200, 0.5), 0 0 24px rgba(93, 212, 200, 0.12);
}

.staff-plan .confidence {
  width: 58px;
  height: 58px;
}

.staff-plan button {
  margin-top: auto;
}

.staff-evidence-card {
  border: 1px solid rgba(93, 212, 200, 0.24);
  border-radius: 7px;
  padding: 12px;
  background: rgba(93, 212, 200, 0.07);
  margin-bottom: 12px;
}

.staff-evidence-card strong {
  display: block;
  margin: 4px 0 6px;
}

.staff-evidence-card p,
.staff-evidence-list p,
.execution-orders p {
  color: var(--muted);
  line-height: 1.5;
}

.staff-evidence-list h4 {
  margin: 14px 0 8px;
}

.staff-evidence-list ul {
  padding-left: 18px;
  color: var(--muted);
}

.execution-command-list {
  display: grid;
  gap: 10px;
}

.order-meter {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(247, 201, 72, 0.28);
  border-radius: 7px;
  padding: 10px;
  margin: 12px 0;
  background: rgba(247, 201, 72, 0.07);
}

.order-meter span {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 6px;
  background: rgba(247, 201, 72, 0.14);
  color: var(--accent-2);
  font-size: 22px;
  font-weight: 900;
}

.order-meter p {
  margin: 0;
  color: var(--muted);
}

.execution-order {
  min-height: 82px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 68px;
  gap: 6px 10px;
  align-items: center;
  text-align: left;
  border-radius: 7px;
  background: linear-gradient(145deg, rgba(15, 27, 42, 0.86), rgba(8, 13, 22, 0.82));
}

.execution-order strong,
.execution-order small {
  grid-column: 1;
}

.execution-order small {
  color: var(--muted);
  line-height: 1.35;
}

.execution-order i {
  grid-column: 2;
  grid-row: 1 / span 3;
  justify-self: end;
  width: 62px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(159, 188, 218, 0.24);
  border-radius: 5px;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.execution-order.selected {
  border-color: rgba(143, 227, 136, 0.62);
  background: linear-gradient(145deg, rgba(143, 227, 136, 0.13), rgba(8, 13, 22, 0.84));
}

.execution-order.selected i {
  border-color: rgba(143, 227, 136, 0.42);
  color: var(--good);
}

.execution-order.risky.selected {
  border-color: rgba(255, 122, 122, 0.62);
}

.execution-tick {
  position: absolute;
  z-index: 14;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid rgba(143, 227, 136, 0.7);
  background: rgba(5, 9, 16, 0.8);
  color: var(--good);
  font-weight: 900;
}

.execution-tick.bad {
  border-color: rgba(255, 122, 122, 0.72);
  color: var(--danger);
}

.execution-writeback .edit-card {
  margin-bottom: 10px;
}

.strategy-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 78px minmax(0, 1fr) 74px;
  background:
    linear-gradient(180deg, rgba(9, 14, 24, 0.95), rgba(9, 14, 24, 0.75)),
    url("./assets/images/tactical-map.svg");
  background-size: cover;
  overflow: hidden;
}

.war-hud,
.war-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 18px;
  background: linear-gradient(90deg, rgba(5, 8, 14, 0.96), rgba(22, 31, 48, 0.9));
  border-bottom: 1px solid rgba(159, 188, 218, 0.24);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.28);
}

.war-footer {
  border-top: 1px solid rgba(159, 188, 218, 0.24);
  border-bottom: 0;
}

.hud-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hud-brand h1 {
  margin: 0;
  font-size: 22px;
}

.hud-stats {
  display: flex;
  gap: 10px;
}

.hud-stats div,
.resource-strip div {
  min-width: 104px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.05);
}

.hud-stats span,
.resource-strip span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.hud-stats strong,
.resource-strip strong {
  font-size: 22px;
}

.hud-actions,
.footer-actions,
.tutorial-controls,
.assign-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.strategy-body {
  min-height: 0;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 320px;
  gap: 12px;
  padding: 12px;
}

.war-left-panel,
.war-right-panel {
  min-height: 0;
  display: grid;
  gap: 12px;
  align-content: start;
}

.operation-card,
.resource-strip,
.mini-object-list,
.tutorial-card,
.inspector-card,
.ontology-map-panel,
.relation-command-bar {
  border: 1px solid rgba(159, 188, 218, 0.24);
  border-radius: 8px;
  background: rgba(8, 13, 22, 0.78);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.28);
}

.operation-card,
.mini-object-list,
.tutorial-card,
.inspector-card {
  padding: 14px;
}

.operation-card span,
.tutorial-step {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.operation-card h2 {
  margin: 6px 0 8px;
}

.operation-card p,
.tutorial-card p,
.inspector-card p,
.relation-command-bar p,
.brief-line span {
  color: var(--muted);
  line-height: 1.55;
}

.resource-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px;
}

.resource-strip div {
  min-width: 0;
}

.mini-object-list {
  display: grid;
  gap: 8px;
}

.mini-object {
  display: flex;
  gap: 10px;
  align-items: center;
  text-align: left;
}

.mini-object span,
.object-title span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--obj-color), transparent 72%);
  border: 1px solid color-mix(in srgb, var(--obj-color), transparent 25%);
  color: var(--obj-color);
  font-weight: 900;
}

.mini-object small,
.object-title small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.mini-object.active {
  border-color: var(--accent);
  background: rgba(93, 212, 200, 0.1);
}

.ontology-map-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: 48px minmax(0, 1fr) 108px;
  overflow: hidden;
}

.map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.map-toolbar span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.map-tabs {
  display: flex;
  gap: 8px;
}

.map-tabs button {
  padding: 8px 10px;
}

.map-tabs button.active {
  background: rgba(93, 212, 200, 0.12);
  border-color: rgba(93, 212, 200, 0.58);
}

.ontology-war-map {
  position: relative;
  min-height: 590px;
  overflow: hidden;
  background:
    radial-gradient(circle at 26% 31%, rgba(93, 212, 200, 0.12), transparent 16%),
    radial-gradient(circle at 70% 68%, rgba(247, 201, 72, 0.1), transparent 18%),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(135deg, rgba(22, 35, 54, 0.96), rgba(14, 20, 31, 0.96));
  background-size: auto, auto, 52px 52px, 52px 52px, auto;
}

.map-raster {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.35));
  opacity: 0.35;
}

.relation-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.sandbox-line {
  stroke-width: 0.65;
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
}

.property-ok {
  stroke: rgba(93, 212, 200, 0.68);
  stroke-dasharray: 2 2;
}

.property-bad {
  stroke: rgba(255, 122, 122, 0.8);
  stroke-dasharray: 3 2;
}

.relation-ok {
  stroke: rgba(247, 201, 72, 0.88);
  stroke-width: 1;
}

.intel-token,
.object-node {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 3;
}

.intel-token {
  width: 130px;
  padding: 8px 10px;
  text-align: left;
  background: rgba(9, 14, 24, 0.88);
  border-color: rgba(159, 188, 218, 0.42);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.intel-token span {
  display: block;
  color: var(--accent-2);
  font-size: 11px;
  margin-bottom: 3px;
}

.intel-token strong {
  display: block;
  font-size: 13px;
  line-height: 1.25;
}

.intel-token.evidence {
  border-color: rgba(176, 140, 255, 0.45);
}

.intel-token.trap {
  border-color: rgba(255, 122, 122, 0.45);
}

.intel-token.active {
  border-color: var(--accent);
  background: rgba(93, 212, 200, 0.15);
  transform: translate(-50%, -50%) scale(1.04);
}

.intel-token.linked {
  border-color: rgba(143, 227, 136, 0.62);
}

.intel-token.wrong {
  border-color: rgba(255, 122, 122, 0.82);
}

.object-node {
  width: 118px;
  height: 106px;
  display: grid;
  place-items: center;
  text-align: center;
  background:
    radial-gradient(circle at 50% 32%, color-mix(in srgb, var(--obj-color), transparent 55%), transparent 58%),
    rgba(8, 13, 22, 0.84);
  border: 1px solid color-mix(in srgb, var(--obj-color), transparent 26%);
  box-shadow: 0 18px 40px rgba(0,0,0,.28);
}

.object-node span {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--obj-color), transparent 70%);
  color: var(--obj-color);
  font-weight: 900;
}

.object-node strong,
.object-node small {
  display: block;
}

.object-node small {
  color: var(--muted);
  margin-top: -6px;
}

.object-node.active {
  transform: translate(-50%, -50%) scale(1.06);
  border-color: #fff;
}

.object-node.object-pick-mode {
  z-index: 14;
  border-width: 2px;
  background:
    radial-gradient(circle at 50% 32%, color-mix(in srgb, var(--obj-color), transparent 42%), transparent 62%),
    rgba(9, 16, 22, 0.92);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--obj-color), transparent 38%),
    0 20px 46px rgba(0, 0, 0, 0.36);
}

.mini-object.object-pick-mode {
  border-color: rgba(92, 214, 177, 0.66);
  background: rgba(92, 214, 177, 0.08);
}

.soft-hidden {
  opacity: 0.16;
  pointer-events: none;
}

.map-legend {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 5;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 13, 22, 0.72);
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.map-legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.legend-token { background: var(--accent-2); }
.legend-object { background: var(--accent); }
.legend-link { background: var(--good); }

.relation-command-bar {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 0;
}

.relation-command-bar p {
  margin: 4px 0 0;
}

.relation-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.relation-buttons button {
  text-align: left;
}

.relation-buttons button.active {
  background: rgba(247, 201, 72, 0.13);
  border-color: rgba(247, 201, 72, 0.58);
}

.relation-buttons span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 3px;
}

.tutorial-card {
  border-color: rgba(247, 201, 72, 0.38);
}

.tutorial-action {
  padding: 10px;
  border-radius: 8px;
  background: rgba(247, 201, 72, 0.1);
  color: var(--accent-2);
  line-height: 1.5;
  margin-bottom: 10px;
}

.inspector-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.inspector-head span {
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 900;
}

.sample-data {
  display: grid;
  gap: 6px;
  margin: 10px 0;
}

.sample-data code {
  display: block;
  padding: 7px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: #dcecff;
  white-space: normal;
}

.hint-box {
  border-left: 3px solid var(--accent);
  padding: 8px 10px;
  background: rgba(93, 212, 200, 0.08);
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 10px;
}

.governance-box {
  display: grid;
  gap: 5px;
  margin-bottom: 10px;
  padding: 9px 10px;
  border-radius: 6px;
  border: 1px solid rgba(247, 201, 72, 0.34);
  background: rgba(247, 201, 72, 0.09);
  color: #ffe8a6;
  line-height: 1.45;
}

.governance-box span {
  color: #d8e5f2;
}

.assign-row {
  flex-wrap: wrap;
  justify-content: space-between;
}

.object-title {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.attached-props {
  display: grid;
  gap: 8px;
}

.attached-props span {
  display: grid;
  gap: 3px;
  border-radius: 6px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
}

.attached-props button {
  justify-self: start;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 11px;
}

.attached-props b,
.attached-props small,
.object-relations b,
.object-relations small {
  display: block;
}

.attached-props small,
.object-relations small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.attached-props .good {
  color: var(--good);
  border-color: rgba(143, 227, 136, 0.42);
}

.attached-props .bad {
  color: var(--danger);
  border-color: rgba(255, 122, 122, 0.42);
}

.object-relations {
  display: grid;
  gap: 8px;
}

.object-relations span {
  display: grid;
  gap: 3px;
  padding: 8px 9px;
  border-radius: 6px;
  border: 1px solid rgba(159, 188, 218, 0.18);
  background: rgba(255, 255, 255, 0.04);
}

.object-relations span.active {
  border-color: rgba(247, 201, 72, 0.48);
  background: rgba(247, 201, 72, 0.09);
}

.brief-line {
  display: flex;
  gap: 10px;
  align-items: center;
}

.brief-line strong {
  color: var(--accent);
}

.ops-history-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.ops-history-line strong {
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #d8e5f2;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: auto;
  }

  .level-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .brief-layout,
  .two-column.wide-left,
  .graph-layout,
  .action-layout,
  .replay-layout,
  .battle-layout,
  .battle-header,
  .ai-layout {
    grid-template-columns: 1fr;
  }

  .battle-sandbox {
    min-height: 540px;
  }

  .strategy-shell {
    overflow: auto;
  }

  .strategy-body {
    grid-template-columns: 1fr;
  }

  .ops-game-shell {
    overflow: auto;
  }

  .ops-topbar,
  .ops-footer,
  .ops-layout,
  .ops-map-stage,
  .ops-command-deck,
  .staff-room,
  .execution-room {
    grid-template-columns: 1fr;
  }

  .ops-topbar,
  .ops-footer {
    grid-template-columns: 1fr;
    height: auto;
  }

  .ops-turn-strip,
  .ops-command-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ops-wargame-map {
    min-height: 660px;
  }

  .staff-map-panel,
  .execution-map {
    grid-template-rows: 58px 520px auto;
  }

  .war-hud,
  .war-footer {
    flex-wrap: wrap;
    height: auto;
  }

  .ontology-war-map {
    min-height: 620px;
  }
}

@media (max-width: 760px) {
  .main-panel,
  .sidebar,
  .stage-card {
    padding: 14px;
  }

  .topbar,
  .topbar-metrics {
    flex-direction: column;
    align-items: stretch;
  }

  .stage-nav {
    grid-template-columns: repeat(2, 1fr);
  }

  .source-grid,
  .card-grid,
  .level-list {
    grid-template-columns: 1fr;
  }

  .command-room,
  .graph-canvas,
  .graph-canvas svg {
    min-height: 440px;
    height: 440px;
  }

  .battle-header,
  .battle-result-card,
  .phase-track,
  .causality-card {
    padding: 12px;
  }

  .battle-header h3 {
    font-size: 24px;
  }

  .battle-metrics,
  .ontology-causal-chain {
    grid-template-columns: 1fr;
  }

  .battle-sandbox {
    min-height: 460px;
  }

  .ops-topbar,
  .ops-footer {
    padding: 12px;
  }

  .ops-layout {
    padding: 10px;
  }

  .ops-turn-strip,
  .objective-meter,
  .ops-command-cards {
    grid-template-columns: 1fr;
  }

  .ops-map-toolbar,
  .ops-layer-tabs,
  .ops-system-buttons,
  .footer-actions {
    flex-wrap: wrap;
  }

  .ops-wargame-map {
    min-height: 620px;
  }

  .staff-map-panel,
  .execution-map {
    grid-template-rows: auto 440px auto;
  }

  .staff-context-chain,
  .execution-status {
    grid-template-columns: 1fr;
  }

  .execution-order {
    grid-template-columns: 1fr;
  }

  .execution-order i {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
  }

  .intel-contact {
    width: 104px;
  }

  .war-counter {
    width: 82px;
  }

  .unit-counter {
    width: 66px;
    grid-template-columns: 24px 1fr;
    padding: 6px;
  }

  .unit-counter b {
    width: 24px;
    height: 24px;
  }

  .risk-zone {
    width: 112px;
    height: 72px;
  }

  .map-chip {
    max-width: 92px;
  }
}

/* v11 operational sand-table upgrade */
.ops-game-shell {
  grid-template-rows: 82px minmax(0, 1fr) 78px;
  background:
    linear-gradient(180deg, rgba(6, 9, 13, 0.94), rgba(11, 13, 16, 0.78)),
    url("./assets/images/generated/wargame-map.png");
  background-size: cover;
  background-position: center;
}

.ops-topbar,
.ops-footer {
  background:
    linear-gradient(90deg, rgba(6, 8, 10, 0.98), rgba(18, 23, 25, 0.96) 48%, rgba(26, 21, 15, 0.94));
  border-color: rgba(207, 174, 103, 0.32);
}

.ops-brand .brand-mark {
  background: linear-gradient(145deg, #d7b66a, #58c6aa);
  color: #0b0d0e;
}

.ops-layout {
  height: calc(100vh - 160px);
  grid-template-columns: 318px minmax(620px, 1fr) 360px;
  gap: 10px;
  padding: 10px;
}

.ops-brief-card,
.ops-registry,
.ops-doctrine,
.ops-intel-board,
.ops-object-board,
.ops-after-action,
.ops-map-stage,
.ops-command-deck {
  border-color: rgba(207, 174, 103, 0.26);
  background:
    linear-gradient(180deg, rgba(14, 17, 18, 0.88), rgba(7, 9, 11, 0.82));
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.42);
}

.ops-map-stage {
  grid-template-rows: 62px minmax(0, 1fr) 156px;
  border-radius: 4px;
}

.ops-map-toolbar {
  padding: 8px 12px;
  background:
    linear-gradient(90deg, rgba(9, 12, 13, 0.94), rgba(19, 26, 25, 0.88));
  border-bottom-color: rgba(207, 174, 103, 0.24);
}

.ops-pulse {
  min-width: 430px;
  display: grid;
  grid-template-columns: repeat(4, minmax(78px, 1fr)) minmax(98px, 1fr);
  gap: 6px;
}

.ops-pulse span,
.ops-pulse strong {
  display: grid;
  min-height: 36px;
  align-content: center;
  border: 1px solid rgba(159, 188, 218, 0.18);
  border-radius: 4px;
  padding: 4px 7px;
  background: rgba(255, 255, 255, 0.045);
  color: #aeb8b4;
  font-size: 10px;
  text-transform: uppercase;
}

.ops-pulse small {
  display: block;
  margin-top: 2px;
  color: #aeb8b4;
  font-size: 9px;
  text-transform: none;
}

.ops-pulse b,
.ops-pulse strong {
  color: #f1d48b;
}

.ops-mission-board {
  display: grid;
  gap: 10px;
  padding: 13px;
}

.battle-pressure {
  display: grid;
  gap: 7px;
}

.battle-pressure div {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: center;
}

.battle-pressure span,
.battle-pressure strong {
  color: #aeb8b4;
  font-size: 11px;
}

.battle-pressure b {
  height: 7px;
  display: block;
  border-radius: 99px;
  background: linear-gradient(90deg, #58c6aa, #f1d48b, #ff7a7a);
}

.mission-objectives {
  display: grid;
  gap: 6px;
}

.mission-objective {
  min-height: 44px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 7px 8px;
  text-align: left;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.035);
}

.mission-objective i {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(241, 212, 139, 0.35);
  border-radius: 3px;
  color: #f1d48b;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.mission-objective strong,
.mission-objective small,
.mission-objective em {
  display: block;
}

.mission-objective small {
  margin-top: 2px;
  color: #aeb8b4;
  font-size: 11px;
}

.mission-objective em {
  grid-column: 2;
  height: 4px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
}

.mission-objective em b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #58c6aa, #f1d48b);
}

.mission-objective.done {
  border-color: rgba(143, 227, 136, 0.46);
  background: rgba(143, 227, 136, 0.08);
}

.mission-objective.done i {
  border-color: rgba(143, 227, 136, 0.55);
  color: #8fe388;
}

.ops-layer-tabs button,
.ops-system-buttons button,
.ops-footer button {
  border-radius: 4px;
  min-height: 34px;
}

.ops-wargame-map {
  background:
    linear-gradient(180deg, rgba(8, 11, 12, 0.08), rgba(8, 11, 12, 0.34)),
    url("./assets/images/generated/wargame-map.png");
  background-size: cover;
  background-position: center;
}

.ops-wargame-map::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(215, 182, 106, 0.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(215, 182, 106, 0.04) 1px, transparent 1px),
    radial-gradient(circle at 70% 28%, rgba(255, 122, 122, 0.12), transparent 20%),
    radial-gradient(circle at 32% 67%, rgba(88, 198, 170, 0.1), transparent 18%);
  background-size: 88px 88px, 88px 88px, auto, auto;
  mix-blend-mode: screen;
}

.ops-wargame-map::after {
  z-index: 3;
  box-shadow:
    inset 0 0 0 1px rgba(225, 209, 160, 0.09),
    inset 0 0 120px rgba(0, 0, 0, 0.5),
    inset 0 -120px 130px rgba(0, 0, 0, 0.42);
}

.hex-grid {
  z-index: 2;
  opacity: 0.88;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(30deg, rgba(215,182,106,0.05) 1px, transparent 1px),
    linear-gradient(150deg, rgba(88,198,170,0.04) 1px, transparent 1px);
  background-size: 48px 48px, 48px 48px, 48px 48px;
}

.terrain-scan {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, transparent 0 10px, rgba(255,255,255,0.025) 10px 11px),
    linear-gradient(120deg, transparent 0 42%, rgba(247,201,72,0.1) 42% 42.5%, transparent 42.5% 100%);
  opacity: 0.72;
}

.map-axis {
  position: absolute;
  z-index: 12;
  pointer-events: none;
  color: rgba(232, 222, 190, 0.66);
  font-size: 10px;
  font-weight: 900;
}

.map-axis-x {
  left: 72px;
  right: 180px;
  top: 8px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
}

.map-axis-y {
  left: 8px;
  top: 62px;
  bottom: 118px;
  display: grid;
  align-content: space-between;
}

.map-compass,
.map-scale {
  position: absolute;
  z-index: 12;
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px solid rgba(232, 222, 190, 0.24);
  border-radius: 4px;
  background: rgba(5, 8, 10, 0.62);
  color: #e8debe;
  pointer-events: none;
}

.map-compass {
  right: 18px;
  top: 18px;
  text-align: center;
}

.map-compass b {
  font-size: 18px;
}

.map-compass span,
.map-scale span {
  font-size: 10px;
  color: #aeb8b4;
}

.map-scale {
  left: 18px;
  bottom: 18px;
  min-width: 118px;
}

.map-scale i {
  height: 8px;
  border-left: 2px solid #e8debe;
  border-right: 2px solid #e8debe;
  border-bottom: 2px solid #e8debe;
}

.ops-map-lines {
  z-index: 5;
}

.ops-route.main {
  stroke: rgba(241, 212, 139, 0.82);
  stroke-width: 1.05;
  stroke-dasharray: 4 2.2;
}

.ops-route.recon {
  stroke: rgba(88, 198, 170, 0.82);
  stroke-width: 0.82;
}

.ops-wargame-map .sandbox-line {
  stroke-width: 0.38;
  filter: drop-shadow(0 0 5px rgba(143, 227, 136, 0.5));
}

.sector-label {
  z-index: 8;
  border-color: rgba(232, 222, 190, 0.24);
  border-radius: 3px;
  background: rgba(8, 10, 11, 0.62);
  color: rgba(232, 222, 190, 0.72);
  letter-spacing: 0;
}

.war-counter {
  z-index: 10;
  width: 88px;
  min-height: 50px;
  grid-template-columns: 28px 1fr;
  border-radius: 3px;
  border-color: rgba(116, 168, 204, 0.78);
  background:
    linear-gradient(180deg, rgba(14, 25, 29, 0.96), rgba(8, 12, 14, 0.92));
  box-shadow: 0 11px 20px rgba(0, 0, 0, 0.44);
}

.war-counter::before {
  content: "";
  position: absolute;
  left: 5px;
  right: 5px;
  top: 4px;
  height: 2px;
  background: currentColor;
  opacity: 0.42;
}

.war-counter b {
  width: 28px;
  height: 28px;
  border-radius: 2px;
  background: rgba(116, 168, 204, 0.16);
}

.ops-risk-field {
  z-index: 7;
  border-width: 2px;
  background:
    repeating-linear-gradient(45deg, rgba(255,122,122,0.12) 0 6px, rgba(255,122,122,0.03) 6px 12px);
}

.intel-contact {
  z-index: 11;
  width: 94px;
  min-height: 50px;
  padding: 7px 8px 7px 10px;
  border-radius: 3px;
  border-color: rgba(241, 212, 139, 0.48);
  background:
    linear-gradient(180deg, rgba(23, 20, 14, 0.94), rgba(8, 9, 10, 0.9));
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.42);
}

.intel-contact::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f1d48b;
  box-shadow: 0 0 10px rgba(241, 212, 139, 0.42);
}

.intel-contact::after {
  content: "";
  position: absolute;
  left: 8px;
  bottom: -8px;
  width: 1px;
  height: 9px;
  background: rgba(241, 212, 139, 0.42);
}

.intel-contact strong {
  margin-left: 7px;
  font-size: 11px;
  line-height: 1.14;
}

.intel-contact span,
.intel-contact i {
  font-size: 9px;
}

.intel-contact span {
  display: flex;
  align-items: center;
  gap: 3px;
  padding-left: 7px;
}

.intel-contact span b {
  min-width: 8px;
  color: #f1d48b;
  font-size: 10px;
}

.intel-contact.linked {
  border-color: rgba(143, 227, 136, 0.78);
  background: linear-gradient(180deg, rgba(15, 36, 24, 0.94), rgba(8, 10, 9, 0.9));
}

.intel-contact.linked::before {
  background: #8fe388;
}

.intel-contact.wrong::before,
.intel-contact.trap::before {
  background: #ff7a7a;
}

.intel-contact.field-pick-mode {
  border-color: rgba(92, 214, 177, 0.78);
  box-shadow:
    0 0 0 1px rgba(92, 214, 177, 0.22),
    0 14px 28px rgba(0, 0, 0, 0.46);
}

.intel-contact.repair-mode {
  border-color: rgba(255, 122, 122, 0.9);
  background: linear-gradient(180deg, rgba(52, 15, 16, 0.94), rgba(12, 8, 9, 0.9));
  box-shadow:
    0 0 0 1px rgba(255, 122, 122, 0.26),
    0 14px 30px rgba(0, 0, 0, 0.5);
}

.tactical-readout {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 13;
  width: min(270px, calc(100% - 32px));
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(232, 222, 190, 0.28);
  border-radius: 4px;
  background: rgba(5, 8, 10, 0.72);
  backdrop-filter: blur(10px);
}

.tactical-readout div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 6px;
  align-items: baseline;
  border-bottom: 1px solid rgba(232, 222, 190, 0.1);
  padding-bottom: 5px;
}

.tactical-readout div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.tactical-readout span {
  color: #58c6aa;
  font-size: 10px;
  font-weight: 900;
}

.tactical-readout strong {
  overflow: hidden;
  color: #f1d48b;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tactical-readout small {
  grid-column: 2;
  color: #aeb8b4;
  font-size: 10px;
}

.ops-map-legend {
  left: 14px;
  top: 34px;
  border-color: rgba(232, 222, 190, 0.22);
  border-radius: 4px;
  background: rgba(5, 8, 10, 0.62);
}

.ops-command-deck {
  grid-template-columns: 270px minmax(0, 1fr);
  align-items: stretch;
  background:
    linear-gradient(180deg, rgba(10, 12, 13, 0.94), rgba(6, 7, 8, 0.9));
}

.ops-command-cards .empty {
  min-height: 92px;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 14px;
  border: 1px dashed rgba(232, 222, 190, 0.28);
  border-radius: 4px;
  color: #aeb8b4;
  text-align: center;
}

.ops-command-cards {
  grid-template-columns: repeat(3, minmax(190px, 1fr));
}

.ops-command-cards button {
  min-height: 130px;
  border-radius: 4px;
  border-color: rgba(207, 174, 103, 0.24);
  background:
    linear-gradient(180deg, rgba(24, 24, 19, 0.86), rgba(7, 9, 10, 0.84));
}

.ops-command-cards button.active {
  border-color: rgba(241, 212, 139, 0.72);
  background: linear-gradient(180deg, rgba(50, 41, 18, 0.72), rgba(8, 9, 10, 0.9));
}

.ops-command-cards code {
  display: block;
  padding: 5px 6px;
  border: 1px solid rgba(88, 198, 170, 0.22);
  border-radius: 3px;
  background: rgba(88, 198, 170, 0.08);
  color: #ccefe7;
  font-size: 10px;
  white-space: normal;
}

.ops-registry .mini-object,
.mini-object {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  border-radius: 4px;
  border-color: rgba(207, 174, 103, 0.2);
  background: rgba(255, 255, 255, 0.035);
}

.mini-object .mini-object-meter {
  display: block;
  height: 5px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
}

.mini-object .mini-object-meter b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #58c6aa, #f1d48b);
}

.objective-meter div {
  border-radius: 4px;
  border-color: rgba(207, 174, 103, 0.2);
}

.object-readiness {
  display: grid;
  gap: 6px;
  margin: 10px 0 12px;
  padding: 9px;
  border: 1px solid rgba(88, 198, 170, 0.22);
  border-radius: 4px;
  background: rgba(88, 198, 170, 0.065);
}

.object-readiness div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.object-readiness span {
  color: #58c6aa;
  font-size: 10px;
  font-weight: 900;
}

.object-readiness strong {
  color: #f1d48b;
}

.object-readiness i {
  height: 7px;
  display: block;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
}

.object-readiness b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #58c6aa, #f1d48b);
}

.object-readiness small {
  color: #aeb8b4;
  font-size: 11px;
}

.attached-props span,
.object-relations span {
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.035);
}

@media (max-width: 1180px) {
  .ops-layout {
    height: auto;
    grid-template-columns: 1fr;
  }

  .ops-map-stage {
    grid-template-rows: auto minmax(660px, 1fr) auto;
  }

  .ops-pulse {
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ops-command-deck,
  .ops-command-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .ops-game-shell {
    grid-template-rows: auto 1fr auto;
  }

  .ops-map-stage {
    grid-template-rows: auto minmax(620px, 1fr) auto;
  }

  .ops-pulse {
    grid-template-columns: 1fr;
  }

  .map-axis,
  .map-compass,
  .map-scale {
    display: none;
  }

  .tactical-readout {
    left: 10px;
    right: 10px;
    width: auto;
  }

  .intel-contact {
    width: 96px;
    min-height: 54px;
  }

  .war-counter {
    width: 78px;
    min-height: 48px;
  }
}

/* v15: production-grade command room pass. Keep the map readable by turning
   large instructional labels into compact military markers and moving status
   panels out of contested map space. */
.ops-game-shell {
  grid-template-rows: 64px minmax(0, 1fr) 56px;
  background:
    linear-gradient(180deg, rgba(3, 6, 9, 0.96), rgba(8, 11, 13, 0.92)),
    url("./assets/images/generated/wargame-map.png");
}

.ops-topbar,
.ops-footer {
  grid-template-columns: 260px minmax(0, 1fr) max-content;
  gap: 10px;
  padding: 8px 12px;
}

.ops-footer {
  grid-template-columns: minmax(0, 1fr) max-content;
}

.ops-brand .brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 3px;
  font-size: 18px;
}

.ops-brand p {
  font-size: 10px;
  letter-spacing: 0.08em;
}

.ops-brand h1 {
  max-width: 210px;
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-turn-strip {
  gap: 6px;
}

.ops-turn-strip div {
  min-width: 0;
  padding: 6px 8px;
  border-radius: 3px;
}

.ops-turn-strip span {
  font-size: 9px;
}

.ops-turn-strip strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-system-buttons {
  gap: 6px;
}

.ops-system-buttons button,
.ops-layer-tabs button,
.ops-footer button {
  min-height: 30px;
  padding: 6px 8px;
  border-radius: 3px;
  font-size: 11px;
}

.ops-level-jump {
  gap: 3px;
  padding: 3px;
  border-radius: 4px;
}

.ops-level-jump button {
  width: 28px;
  height: 28px;
}

.ops-layout {
  height: calc(100vh - 120px);
  grid-template-columns: minmax(238px, 258px) minmax(0, 1fr) minmax(250px, 280px);
  gap: 8px;
  padding: 8px;
  overflow: hidden;
}

.ops-left-dock,
.ops-right-dock {
  gap: 8px;
  padding-right: 0;
}

.ops-brief-card,
.ops-registry,
.ops-doctrine,
.ops-mission-board,
.ops-intel-board,
.ops-object-board,
.ops-after-action {
  padding: 10px;
  border-radius: 4px;
}

.ops-brief-card h2 {
  margin: 4px 0 6px;
  font-size: 17px;
}

.ops-brief-card p,
.ops-doctrine p,
.ops-command-deck p {
  margin: 0;
  font-size: 12px;
  line-height: 1.42;
}

.objective-meter {
  gap: 5px;
  margin-top: 8px;
}

.objective-meter div {
  padding: 6px;
  border-radius: 3px;
}

.objective-meter span {
  font-size: 9px;
}

.objective-meter strong {
  font-size: 14px;
}

.panel-title {
  margin-bottom: 8px;
}

.panel-title span,
.ops-brief-card > span,
.ops-command-deck > div > span,
.ops-map-toolbar span {
  font-size: 9px;
  letter-spacing: 0.08em;
}

.panel-title strong {
  font-size: 13px;
}

.ops-mission-board {
  gap: 7px;
}

.battle-pressure {
  gap: 5px;
}

.battle-pressure div {
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  gap: 6px;
}

.battle-pressure span,
.battle-pressure strong {
  font-size: 9px;
}

.battle-pressure b {
  height: 5px;
}

.mission-objectives {
  gap: 4px;
}

.mission-objective {
  min-height: 34px;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 6px;
  padding: 5px 6px;
}

.mission-objective i {
  width: 22px;
  height: 22px;
  font-size: 9px;
}

.mission-objective strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mission-objective small {
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mission-objective em {
  height: 3px;
}

.ops-registry {
  gap: 6px;
}

.ops-registry .mini-object {
  grid-template-columns: 30px minmax(0, 1fr);
  min-height: 46px;
  padding: 6px;
  border-radius: 3px;
}

.ops-registry .mini-object span {
  width: 28px;
  height: 28px;
  border-radius: 3px;
}

.ops-registry .mini-object strong {
  font-size: 12px;
}

.ops-registry .mini-object small {
  font-size: 9px;
}

.doctrine-step {
  margin: 8px 0;
  padding: 7px 8px;
  font-size: 12px;
}

.tutorial-controls {
  gap: 6px;
}

.ops-map-stage {
  grid-template-rows: 48px minmax(0, 1fr) 96px;
  min-width: 0;
  border-radius: 4px;
}

.ops-map-toolbar {
  min-width: 0;
  gap: 8px;
  padding: 6px 8px;
}

.ops-map-toolbar > div:first-child {
  min-width: 132px;
}

.ops-map-toolbar strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-pulse {
  min-width: 0;
  flex: 1 1 auto;
  grid-template-columns: repeat(4, minmax(52px, 1fr)) minmax(74px, 1fr);
  gap: 4px;
}

.ops-pulse span,
.ops-pulse strong {
  min-height: 30px;
  padding: 3px 5px;
  font-size: 9px;
}

.ops-pulse small {
  font-size: 8px;
}

.ops-layer-tabs {
  flex: 0 0 auto;
  gap: 4px;
}

.ops-layer-tabs button {
  min-height: 28px;
  padding: 5px 7px;
}

.ops-wargame-map {
  min-height: 0;
  overflow: hidden;
}

.map-axis-x {
  left: 54px;
  right: 96px;
}

.map-axis-y {
  top: 54px;
  bottom: 86px;
}

.map-compass {
  right: 10px;
  top: 10px;
  padding: 5px 6px;
}

.map-compass b {
  font-size: 14px;
}

.map-scale {
  left: 10px;
  bottom: 10px;
  min-width: 88px;
  padding: 5px 6px;
}

.ops-map-legend {
  left: auto;
  right: 10px;
  top: auto;
  bottom: 54px;
  z-index: 9;
  gap: 8px;
  padding: 5px 7px;
  opacity: 0.82;
}

.ops-map-legend span {
  font-size: 9px;
}

.sector-label {
  padding: 3px 5px;
  border-radius: 2px;
  font-size: 9px;
  opacity: 0.48;
}

.sector-label.soft-hidden {
  opacity: 0;
}

.war-counter {
  width: 46px;
  min-height: 42px;
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  padding: 4px;
  border-width: 1px;
  border-radius: 2px;
  outline: 1px solid rgba(0, 0, 0, 0.52);
  background:
    linear-gradient(180deg, rgba(17, 30, 34, 0.96), rgba(7, 11, 13, 0.94));
}

.war-counter b {
  width: 24px;
  height: 20px;
  border-radius: 1px;
  font-size: 12px;
}

.war-counter span {
  max-width: 42px;
  margin: 2px 0 0;
  overflow: hidden;
  font-size: 8px;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.war-counter small {
  display: none;
}

.war-counter::before {
  left: 7px;
  right: 7px;
  top: 3px;
}

.object-node {
  width: 74px;
  height: 70px;
  grid-template-rows: 30px 14px 12px;
  gap: 2px;
  padding: 5px;
  border-radius: 3px;
  background:
    radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--obj-color), transparent 54%), transparent 62%),
    rgba(7, 11, 14, 0.86);
}

.object-node span {
  width: 28px;
  height: 28px;
  border-radius: 3px;
  font-size: 14px;
}

.object-node strong {
  overflow: hidden;
  max-width: 64px;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.object-node small {
  margin-top: 0;
  font-size: 9px;
}

.object-node.active {
  transform: translate(-50%, -50%) scale(1.04);
}

.object-node.object-pick-mode {
  border-width: 1px;
}

.intel-contact {
  width: 64px;
  height: 34px;
  min-height: 34px;
  padding: 5px 6px 5px 8px;
  border-radius: 2px;
  overflow: hidden;
}

.intel-contact::after {
  left: 8px;
  bottom: 3px;
  height: 5px;
}

.intel-contact strong {
  max-width: 52px;
  margin: 1px 0 0 3px;
  overflow: hidden;
  font-size: 9px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.intel-contact span,
.intel-contact i {
  font-size: 7px;
  line-height: 1;
}

.intel-contact i {
  display: none;
}

.tactical-readout {
  left: 10px;
  right: 10px;
  bottom: 8px;
  width: auto;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 0;
  border-radius: 3px;
  background: rgba(4, 7, 8, 0.78);
}

.tactical-readout div {
  min-width: 0;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 4px;
  padding: 6px 7px;
  border-right: 1px solid rgba(232, 222, 190, 0.1);
  border-bottom: 0;
}

.tactical-readout div:last-child {
  border-right: 0;
}

.tactical-readout span {
  font-size: 8px;
}

.tactical-readout strong {
  font-size: 10px;
}

.tactical-readout small {
  overflow: hidden;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-command-deck {
  grid-template-columns: 190px minmax(0, 1fr);
  padding: 10px;
}

.ops-command-deck strong {
  font-size: 13px;
}

.ops-command-deck p {
  font-size: 11px;
}

.ops-command-cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.ops-command-cards .empty {
  min-height: 62px;
  padding: 10px;
  font-size: 12px;
}

.ops-command-cards button {
  min-height: 88px;
  padding: 8px;
}

.ops-command-cards button span,
.ops-command-cards button small,
.ops-command-cards button em,
.ops-command-cards button i,
.ops-command-cards button code {
  font-size: 9px;
  line-height: 1.25;
}

.ops-command-cards button strong {
  font-size: 12px;
}

.ops-right-dock {
  width: auto;
}

.ops-right-dock .inspector-card p,
.hint-box,
.governance-box,
.attached-props span,
.object-relations span {
  font-size: 11px;
  line-height: 1.35;
}

.ops-right-dock .sample-data {
  gap: 4px;
}

.ops-right-dock .sample-data code {
  padding: 4px 5px;
  font-size: 10px;
}

.brief-line {
  min-width: 0;
}

.brief-line span,
.ops-history-line {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.footer-actions {
  gap: 6px;
}

.tutorial-coach {
  width: min(190px, calc(100vw - 24px));
  padding: 7px 9px;
  border-radius: 4px;
}

.tutorial-micro {
  border-color: rgba(255, 122, 122, 0.5);
  background: rgba(26, 9, 10, 0.9);
}

.tutorial-coach.place-bottom,
.tutorial-coach.place-top {
  left: auto;
  right: 300px;
  top: 78px;
  bottom: auto;
  transform: none;
}

.tutorial-coach.place-side,
.tutorial-coach.place-side-right {
  right: 300px;
  left: auto;
  top: 78px;
}

.tutorial-coach h3 {
  margin: 2px 0 0;
  font-size: 13px;
}

.tutorial-coach p {
  display: none;
}

.tutorial-coach span {
  font-size: 9px;
  letter-spacing: 0.08em;
}

.tutorial-action,
.tutorial-warning {
  margin-top: 6px;
  padding: 6px 7px;
  font-size: 12px;
}

.tutorial-buttons {
  gap: 6px;
  margin-top: 8px;
}

.tutorial-buttons button {
  min-height: 28px;
  padding: 5px 7px;
  font-size: 11px;
}

@media (max-width: 1180px) {
  .ops-layout {
    height: auto;
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .ops-map-stage {
    grid-template-rows: auto minmax(620px, 1fr) auto;
  }

  .ops-topbar,
  .ops-footer {
    grid-template-columns: 1fr;
  }

  .ops-command-deck,
  .ops-command-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .tactical-readout {
    left: 10px;
    right: 10px;
    grid-template-columns: 1fr 1fr;
  }

  .object-node {
    width: 68px;
    height: 64px;
  }

  .war-counter {
    width: 42px;
  }
}

/* v16: online-readiness pass. The public build needs to survive ordinary
   laptop heights, narrow phones, and late-stage relation cards without clipped
   controls or map labels fighting each other. */
.ops-game-shell {
  grid-template-rows: 58px minmax(0, 1fr) 46px;
}

.ops-topbar,
.ops-footer {
  min-width: 0;
  padding: 6px 10px;
}

.ops-topbar {
  grid-template-columns: 238px minmax(0, 1fr) max-content;
}

.ops-footer {
  grid-template-columns: minmax(240px, 1fr) minmax(150px, 220px) max-content;
  gap: 8px;
}

.ops-brand .brand-mark {
  width: 32px;
  height: 32px;
}

.ops-brand h1 {
  max-width: 188px;
  font-size: 14px;
}

.ops-turn-strip div {
  min-height: 34px;
  padding: 4px 7px;
}

.ops-system-buttons button,
.ops-footer button {
  min-height: 28px;
  padding: 5px 7px;
}

.ops-level-jump button {
  width: 26px;
  height: 26px;
}

.ops-layout {
  height: calc(100vh - 104px);
  padding: 7px;
  gap: 7px;
  grid-template-columns: minmax(232px, 252px) minmax(0, 1fr) minmax(246px, 274px);
}

.ops-left-dock,
.ops-right-dock {
  gap: 7px;
}

.ops-brief-card,
.ops-registry,
.ops-doctrine,
.ops-mission-board,
.ops-intel-board,
.ops-object-board,
.ops-after-action {
  padding: 8px;
}

.ops-brief-card h2 {
  font-size: 15px;
}

.ops-brief-card p,
.ops-doctrine p,
.ops-command-deck p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.objective-meter {
  margin-top: 6px;
}

.objective-meter div {
  padding: 5px;
}

.ops-mission-board .panel-title,
.ops-registry .panel-title,
.ops-doctrine .panel-title,
.ops-intel-board .panel-title,
.ops-object-board .panel-title,
.ops-after-action .panel-title {
  margin-bottom: 6px;
}

.mission-objectives {
  gap: 3px;
}

.mission-objective {
  min-height: 30px;
  padding: 4px 5px;
}

.mission-objective i {
  width: 19px;
  height: 19px;
}

.ops-registry .mini-object {
  min-height: 41px;
  padding: 5px;
}

.ops-doctrine .tutorial-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ops-doctrine .tutorial-controls button {
  min-width: 0;
  min-height: 26px;
  padding: 4px 5px;
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-map-stage {
  grid-template-rows: 42px minmax(0, 1fr) 82px;
}

.ops-map-toolbar {
  padding: 5px 7px;
}

.ops-pulse span,
.ops-pulse strong {
  min-height: 26px;
}

.ops-layer-tabs button {
  min-height: 25px;
  padding: 4px 6px;
}

.ops-wargame-map::after {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03), inset 0 -76px 86px rgba(0, 0, 0, 0.28);
}

.war-counter {
  width: 42px;
  min-height: 38px;
  padding: 3px;
}

.war-counter b {
  width: 22px;
  height: 18px;
  font-size: 11px;
}

.war-counter span {
  max-width: 36px;
  font-size: 0;
}

.war-counter span::first-letter {
  font-size: 8px;
}

.object-node {
  width: 68px;
  height: 64px;
  grid-template-rows: 27px 13px 11px;
}

.object-node strong {
  max-width: 58px;
}

.ops-brand h1,
.object-node strong,
.ops-registry .mini-object strong,
.panel-title strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-registry .mini-object > div {
  min-width: 0;
}

.intel-contact {
  width: 58px;
  height: 30px;
  min-height: 30px;
  padding: 4px 5px 3px 7px;
}

.intel-contact strong {
  max-width: 46px;
  margin-top: 1px;
  font-size: 8px;
}

.tactical-readout {
  bottom: 6px;
}

.tactical-readout div {
  padding: 5px 6px;
  grid-template-columns: 38px minmax(0, 1fr);
}

.ops-map-legend {
  top: 48px;
  bottom: auto;
  padding: 4px 6px;
}

.ops-command-deck {
  grid-template-columns: 168px minmax(0, 1fr);
  padding: 8px;
  gap: 8px;
}

.ops-command-deck strong {
  font-size: 12px;
}

.ops-command-deck p {
  font-size: 10px;
}

.ops-command-cards {
  align-content: stretch;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.ops-command-cards .empty {
  min-height: 52px;
  padding: 8px;
}

.ops-command-cards button {
  min-height: 66px;
  padding: 6px;
  overflow: hidden;
}

.ops-command-cards button em,
.ops-command-cards button code {
  display: none;
}

.ops-command-cards button span,
.ops-command-cards button small,
.ops-command-cards button i {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.ops-command-cards button strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-right-dock .inspector-card p,
.hint-box,
.governance-box,
.attached-props span,
.object-relations span {
  font-size: 10px;
}

.ops-right-dock .sample-data code {
  font-size: 9px;
}

.object-readiness small,
.attached-props small,
.object-relations small {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.attached-props {
  max-height: 154px;
  overflow: auto;
}

.attached-props span {
  padding: 6px;
}

.relation-panel {
  display: grid;
  gap: 8px;
}

.relation-readiness {
  display: grid;
  gap: 6px;
}

.relation-readiness span {
  display: grid;
  gap: 2px;
  padding: 7px 8px;
  border: 1px solid rgba(159, 188, 218, 0.18);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.035);
}

.relation-readiness span.active {
  border-color: rgba(143, 227, 136, 0.45);
  background: rgba(143, 227, 136, 0.08);
}

.relation-readiness b,
.relation-readiness small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.relation-readiness b {
  font-size: 11px;
}

.relation-readiness small {
  color: var(--muted);
  font-size: 9px;
}

.brief-line,
.ops-history-line,
.footer-actions {
  min-width: 0;
}

.brief-line span,
.ops-history-line {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-history-line {
  justify-self: stretch;
  padding: 0;
}

.ops-history-line strong {
  margin-left: 6px;
  white-space: nowrap;
}

.footer-actions {
  display: flex;
  flex-wrap: nowrap;
}

.footer-actions button {
  max-width: 172px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.footer-actions button:not(.primary) {
  max-width: 90px;
}

.footer-actions button {
  min-width: 0;
  min-height: 30px;
  display: grid;
  grid-template-rows: 12px 12px;
  gap: 1px;
  align-content: center;
  justify-items: center;
  border-radius: 3px;
}

.footer-actions button b,
.footer-actions button span {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.footer-actions button b {
  color: #aeb8b4;
  font-size: 8px;
  font-weight: 900;
}

.footer-actions button span {
  color: #e8debe;
  font-size: 9px;
  font-weight: 900;
}

.footer-actions .action-gate {
  width: 112px;
  max-width: 112px;
  border-color: rgba(88, 198, 170, 0.36);
  background: rgba(88, 198, 170, 0.1);
}

.footer-actions .action-gate b,
.footer-actions .action-gate span {
  color: #58c6aa;
}

.footer-actions .action-gate.locked {
  border-color: rgba(241, 212, 139, 0.24);
  background: rgba(241, 212, 139, 0.07);
}

.footer-actions .action-gate.locked b,
.footer-actions .action-gate.locked span {
  color: #dcc386;
}

.footer-actions .audio-key,
.footer-actions .drill-key {
  width: 58px;
  max-width: 58px;
}

@media (max-height: 700px) and (min-width: 1181px) {
  .ops-game-shell {
    grid-template-rows: 52px minmax(0, 1fr) 40px;
  }

  .ops-layout {
    height: calc(100vh - 92px);
  }

  .ops-map-stage {
    grid-template-rows: 38px minmax(0, 1fr) 72px;
  }

  .ops-brief-card p,
  .ops-doctrine p,
  .objective-meter,
  .ops-map-legend {
    display: none;
  }

  .mission-objective {
    min-height: 27px;
  }

  .ops-command-cards button {
    min-height: 56px;
  }
}

@media (max-width: 1180px) {
  .ops-game-shell {
    min-height: 100vh;
    grid-template-rows: auto auto auto;
    overflow: auto;
  }

  .ops-topbar,
  .ops-footer {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .ops-system-buttons,
  .footer-actions {
    flex-wrap: wrap;
  }

  .ops-layout {
    height: auto;
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .ops-left-dock,
  .ops-right-dock {
    overflow: visible;
  }

  .ops-map-stage {
    grid-template-rows: auto minmax(520px, 62vh) auto;
  }

  .ops-command-deck,
  .ops-command-cards {
    grid-template-columns: 1fr;
  }

  .footer-actions button,
  .footer-actions button:not(.primary) {
    max-width: none;
  }
}

@media (max-width: 760px) {
  .ops-topbar {
    gap: 8px;
  }

  .ops-brand h1 {
    max-width: none;
    white-space: normal;
  }

  .ops-turn-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ops-system-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .ops-level-jump {
    grid-column: 1 / -1;
    justify-content: space-between;
  }

  .ops-layout {
    padding: 6px;
  }

  .ops-map-toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .ops-pulse {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ops-layer-tabs {
    justify-content: stretch;
  }

  .ops-layer-tabs button {
    flex: 1 1 44%;
  }

  .ops-map-stage {
    grid-template-rows: auto minmax(480px, 70vh) auto;
  }

  .ops-wargame-map {
    min-height: 480px;
  }

  .object-node {
    width: 62px;
    height: 58px;
  }

  .intel-contact {
    width: 54px;
  }

  .tactical-readout {
    grid-template-columns: 1fr 1fr;
  }

  .tactical-readout div {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .ops-command-cards button {
    min-height: 62px;
  }

  .ops-footer {
    position: relative;
  }

  .brief-line span {
    display: -webkit-box;
    overflow: hidden;
    white-space: normal;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
}

/* v17: make the post-sandbox campaign stages feel like the same command-room
   game. The old campaign stages were content-length driven, so proposal cards
   stretched the tactical map into a long document. These rules give AI,
   action, and replay stages fixed tactical workspaces with internal scrolling. */
.app-shell {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

.sidebar {
  height: 100vh;
  min-height: 0;
  gap: 14px;
  padding: 18px;
  overflow: hidden;
}

.brand .brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  font-size: 20px;
}

.brand h1 {
  font-size: 18px;
}

.brand p {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
}

.level-list {
  min-height: 0;
}

.level-button {
  min-height: 74px;
  padding: 10px;
  border-radius: 4px;
}

.sidebar-footer {
  flex: 0 0 auto;
}

.main-panel {
  height: 100vh;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  padding: 14px;
  overflow: hidden;
}

.topbar {
  min-height: 80px;
  margin: 0;
  gap: 12px;
  align-items: center;
}

.topbar h2 {
  max-width: min(560px, 52vw);
  overflow: hidden;
  margin-bottom: 6px;
  font-size: 28px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar p {
  display: -webkit-box;
  max-width: min(700px, 58vw);
  overflow: hidden;
  margin: 0;
  line-height: 1.42;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.topbar-metrics {
  flex: 0 0 auto;
}

.metric,
.toggle {
  min-width: 84px;
  padding: 9px;
  border-radius: 4px;
}

.metric strong {
  font-size: 24px;
}

.stage-nav {
  margin: 0;
  gap: 7px;
}

.stage-nav button {
  min-height: 44px;
  padding: 8px 7px;
  border-radius: 4px;
}

.stage-card {
  min-height: 0;
  height: 100%;
  padding: 10px;
  overflow: hidden;
  border-radius: 4px;
}

.staff-room,
.execution-room,
.battle-layout {
  height: calc(100vh - 216px);
  min-height: 0;
  overflow: hidden;
}

.staff-room {
  grid-template-columns: minmax(310px, 0.9fr) minmax(270px, 1.08fr) minmax(252px, 0.72fr);
  gap: 10px;
}

.execution-room {
  grid-template-columns: minmax(320px, 0.92fr) minmax(280px, 1fr) minmax(270px, 0.78fr);
  gap: 10px;
}

.staff-map-panel,
.execution-map,
.staff-proposals,
.staff-evidence,
.execution-orders,
.execution-writeback,
.battle-board,
.battle-aar {
  min-height: 0;
  overflow: hidden;
  border-radius: 4px;
}

.staff-map-panel,
.execution-map {
  grid-template-rows: 48px minmax(0, 1fr) auto;
}

.staff-map-header {
  min-height: 48px;
  padding: 8px 10px;
}

.staff-grade {
  min-width: 54px;
  padding: 5px 7px;
  border-radius: 4px;
}

.staff-grade strong {
  font-size: 20px;
}

.staff-war-map,
.execution-war-map {
  min-height: 0;
  height: 100%;
}

.staff-war-map .war-counter,
.execution-war-map .war-counter {
  width: 42px;
  min-height: 38px;
}

.staff-context-chain {
  left: 8px;
  right: 8px;
  bottom: 8px;
  gap: 4px;
}

.staff-context-chain span {
  min-height: 28px;
  padding: 3px;
  border-radius: 3px;
  font-size: 10px;
}

.staff-verdict {
  right: 8px;
  top: 8px;
  padding: 6px 8px;
  border-radius: 3px;
  font-size: 12px;
}

.staff-readouts,
.execution-status {
  gap: 6px;
  padding: 8px;
}

.staff-readouts .sim-bar {
  min-width: 0;
}

.staff-proposals,
.staff-evidence,
.execution-orders,
.execution-writeback {
  padding: 10px;
  overflow: auto;
}

.staff-proposals {
  gap: 8px;
}

.staff-plan {
  padding: 10px;
  border-radius: 4px;
}

.staff-plan .plan-top {
  gap: 8px;
}

.staff-plan .confidence {
  width: 48px;
  height: 48px;
  font-size: 20px;
}

.staff-plan h3 {
  display: -webkit-box;
  overflow: hidden;
  margin-bottom: 6px;
  font-size: 16px;
  line-height: 1.18;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.staff-plan p,
.staff-evidence-card p,
.staff-evidence-list p,
.execution-orders p,
.execution-order small,
.execution-status strong {
  line-height: 1.35;
}

.staff-plan .plan-section {
  margin-top: 8px;
}

.staff-plan .missing ul,
.staff-evidence-list ul {
  margin: 6px 0 0;
  padding-left: 16px;
}

.staff-plan .outcome {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.staff-plan button {
  min-height: 30px;
  padding: 6px 8px;
}

.tag-row {
  gap: 5px;
}

.tag-row span {
  padding: 5px 7px;
  border-radius: 999px;
  font-size: 11px;
}

.chain-text {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.execution-command-list {
  gap: 8px;
}

.order-meter {
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 8px;
  padding: 8px;
  margin: 8px 0;
  border-radius: 4px;
}

.order-meter span {
  width: 46px;
  height: 46px;
  border-radius: 4px;
  font-size: 18px;
}

.execution-order {
  min-height: 68px;
  grid-template-columns: minmax(0, 1fr) 56px;
  padding: 8px;
  border-radius: 4px;
}

.execution-order i {
  width: 52px;
  height: 32px;
}

.execution-status {
  grid-template-columns: 1fr 1fr;
}

.execution-status div {
  padding: 7px;
  border-radius: 4px;
}

.execution-writeback .edit-card {
  padding: 9px;
  border-radius: 4px;
}

.execution-writeback .edit-card ul {
  margin: 6px 0 0;
  padding-left: 16px;
}

.battle-layout {
  grid-template-columns: minmax(0, 1fr) minmax(290px, 350px);
  gap: 10px;
  align-items: stretch;
}

.battle-board {
  display: grid;
  grid-template-rows: minmax(72px, auto) minmax(330px, 1fr) auto;
}

.battle-header {
  min-height: 78px;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.72fr);
  gap: 10px;
  padding: 10px;
  margin-bottom: 8px;
  border-radius: 4px;
}

.battle-header h3 {
  margin-bottom: 5px;
  font-size: 20px;
}

.battle-header p {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.4;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.battle-kicker {
  font-size: 10px;
}

.battle-metrics {
  gap: 6px;
}

.battle-metric {
  padding: 6px;
  border-radius: 4px;
}

.battle-metric strong {
  font-size: 17px;
  margin-bottom: 5px;
}

.battle-metric .bar {
  height: 5px;
}

.battle-sandbox {
  min-height: 0;
  height: 100%;
  border-radius: 4px;
}

.battle-command-bar {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.battle-command-bar button,
.replay-actions button,
.stage-controls button {
  min-height: 30px;
  padding: 6px 9px;
  border-radius: 4px;
}

.battle-aar {
  overflow: auto;
}

.grade-card {
  padding: 12px;
  border-radius: 4px;
}

.grade-card strong {
  font-size: 46px;
}

.timeline {
  gap: 6px;
  margin: 10px 0;
}

.timeline-item {
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 7px;
  padding: 8px;
  border-radius: 4px;
}

.trace-panel,
.battle-score-details {
  margin-top: 10px;
}

.replay-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.stage-controls {
  margin-top: 8px;
}

@media (max-width: 1180px) {
  .app-shell {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .sidebar,
  .main-panel {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .main-panel {
    display: block;
  }

  .topbar h2,
  .topbar p {
    max-width: none;
    white-space: normal;
  }

  .stage-card,
  .staff-room,
  .execution-room,
  .battle-layout {
    height: auto;
    overflow: visible;
  }

  .staff-room,
  .execution-room,
  .battle-layout {
    grid-template-columns: 1fr;
  }

  .staff-proposals,
  .staff-evidence,
  .execution-orders,
  .execution-writeback,
  .battle-aar {
    overflow: visible;
  }

  .staff-map-panel,
  .execution-map {
    grid-template-rows: 48px minmax(420px, 58vh) auto;
  }

  .battle-sandbox {
    min-height: 520px;
  }
}

/* v18: level-specific mechanic readouts */
.mission-objective.mechanic-row {
  border-color: rgba(241, 212, 139, 0.28);
  background: linear-gradient(90deg, rgba(241, 212, 139, 0.1), rgba(88, 198, 170, 0.05));
}

.mission-objective.mechanic-row small {
  display: -webkit-box;
  white-space: normal;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.mechanic-note {
  display: grid;
  gap: 3px;
  margin: 8px 0;
  padding: 8px;
  border: 1px solid rgba(241, 212, 139, 0.2);
  border-radius: 4px;
  background: rgba(241, 212, 139, 0.065);
}

.mechanic-note strong,
.mechanic-note span {
  display: block;
}

.mechanic-note strong {
  overflow: hidden;
  color: #f1d48b;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mechanic-note span {
  display: -webkit-box;
  overflow: hidden;
  color: #aeb8b4;
  font-size: 11px;
  line-height: 1.38;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.ops-command-cards button em,
.ops-command-cards button i,
.ops-command-cards button code {
  overflow: hidden;
  text-overflow: ellipsis;
}

.ops-command-cards button em,
.ops-command-cards button i {
  display: -webkit-box;
  white-space: normal;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* v19: tighter strategic-sandbox feedback */
.ops-turn-strip div {
  position: relative;
  padding-bottom: 13px;
}

.ops-turn-strip div small {
  position: absolute;
  right: 7px;
  bottom: 4px;
  color: #6f7d80;
  font-size: 8px;
  font-weight: 900;
}

.ops-turn-strip div.resolved {
  border-color: rgba(88, 198, 170, 0.36);
}

.ops-turn-strip div.resolved small {
  color: #58c6aa;
}

.ops-turn-strip div.pending {
  opacity: 0.68;
}

.map-status-board {
  position: absolute;
  left: 14px;
  bottom: 46px;
  z-index: 14;
  width: 224px;
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid rgba(232, 222, 190, 0.24);
  border-radius: 4px;
  background: rgba(5, 8, 10, 0.74);
  backdrop-filter: blur(10px);
}

.status-head,
.decision-footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.status-head span,
.decision-footer span {
  color: #aeb8b4;
  font-size: 9px;
  font-weight: 900;
}

.status-head strong,
.decision-footer strong {
  overflow: hidden;
  color: #f1d48b;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.status-grid span {
  display: grid;
  gap: 1px;
  padding: 5px;
  border: 1px solid rgba(159, 188, 218, 0.16);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.045);
}

.status-grid b {
  color: #e8debe;
  font-size: 14px;
}

.status-grid small,
.map-status-board p {
  color: #aeb8b4;
  font-size: 9px;
}

.status-track {
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
}

.status-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff7a7a, #f1d48b, #58c6aa);
}

.map-status-board p {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-after-action {
  min-height: 0;
}

.ops-decision-board {
  display: grid;
  gap: 8px;
}

.decision-ring {
  --ready: 0%;
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  justify-self: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(5, 8, 10, 0.94) 0 53%, transparent 54%),
    conic-gradient(#58c6aa var(--ready), rgba(255, 255, 255, 0.09) 0);
  box-shadow: inset 0 0 0 1px rgba(232, 222, 190, 0.12);
}

.decision-ring strong {
  color: #f1d48b;
  font-size: 28px;
  line-height: 1;
}

.decision-ring span {
  margin-top: -26px;
  color: #aeb8b4;
  font-size: 9px;
  font-weight: 900;
}

.decision-stack {
  display: grid;
  gap: 5px;
}

.decision-stack span {
  display: grid;
  gap: 2px;
  padding: 6px;
  border: 1px solid rgba(159, 188, 218, 0.15);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.035);
}

.decision-stack b,
.decision-stack small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.decision-stack b {
  color: #e8debe;
  font-size: 11px;
}

.decision-stack small {
  color: #aeb8b4;
  font-size: 9px;
}

/* v20: command deck as a tactical order queue */
.ops-command-deck > div:first-child {
  align-content: center;
}

.ops-command-deck > div:first-child p {
  width: max-content;
  max-width: 100%;
  margin-top: 6px;
  padding: 4px 7px;
  border: 1px solid rgba(88, 198, 170, 0.2);
  border-radius: 3px;
  background: rgba(88, 198, 170, 0.08);
  color: #ccefe7;
  font-weight: 800;
}

.ops-command-cards button.command-card {
  min-height: 104px;
  grid-template-rows: auto auto auto 1fr;
  gap: 4px;
  padding: 8px;
  border-color: rgba(207, 174, 103, 0.28);
  background:
    linear-gradient(180deg, rgba(27, 28, 22, 0.9), rgba(7, 9, 10, 0.86));
}

.command-meta {
  display: flex !important;
  justify-content: space-between;
  gap: 6px;
  align-items: center;
}

.command-meta b,
.command-meta i {
  display: inline-grid;
  place-items: center;
  min-height: 18px;
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
}

.command-meta b {
  border: 1px solid rgba(241, 212, 139, 0.28);
  color: #f1d48b;
}

.command-meta i {
  background: rgba(159, 188, 218, 0.12);
  color: #aeb8b4;
}

.ops-command-cards button.command-card.active .command-meta i {
  background: rgba(88, 198, 170, 0.16);
  color: #58c6aa;
}

.ops-command-cards button.command-card small {
  color: #aeb8b4;
}

.ops-command-cards button.command-card em {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 5px;
  align-items: center;
  min-height: 20px;
  padding: 3px 5px;
  border: 1px solid rgba(159, 188, 218, 0.12);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.035);
  color: #cbd4d0;
  -webkit-line-clamp: 1;
}

.ops-command-cards button.command-card em.command-combo {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  min-height: 19px;
  overflow: hidden;
}

.ops-command-cards button.command-card em.command-combo b {
  margin-right: 0;
}

.ops-command-cards button.command-card em.command-combo span {
  min-width: 0;
  overflow: hidden;
  color: #cbd4d0;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-command-cards button.command-card em b {
  color: #58c6aa;
  font-size: 9px;
}

.ops-command-cards button.command-card code {
  display: none;
}

/* v21: locked relation orders stay visible as tactical preplans */
.ops-command-cards button.command-card.locked {
  border-color: rgba(241, 212, 139, 0.18);
  background:
    linear-gradient(180deg, rgba(31, 31, 25, 0.78), rgba(8, 10, 10, 0.82));
  color: rgba(238, 232, 213, 0.84);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
}

.ops-command-cards button.command-card.locked::before {
  opacity: 0.45;
}

.ops-command-cards button.command-card.locked .command-meta i {
  background: rgba(241, 212, 139, 0.11);
  color: #dcc386;
}

.ops-command-cards button.command-card.locked strong,
.ops-command-cards button.command-card.locked small {
  opacity: 0.86;
}

.ops-command-cards button.command-card.locked em {
  border-color: rgba(241, 212, 139, 0.11);
  background: rgba(241, 212, 139, 0.045);
}

@media (min-width: 1181px) {
  .ops-map-stage {
    grid-template-rows: 42px minmax(0, 1fr) 116px;
  }

  .ops-command-cards button.command-card.locked {
    min-height: 82px;
    max-height: 82px;
    grid-template-rows: 18px 15px 13px 18px;
    align-content: stretch;
    overflow: hidden;
  }

  .ops-command-cards button.command-card.locked strong,
  .ops-command-cards button.command-card.locked small,
  .ops-command-cards button.command-card.locked em.command-combo {
    min-height: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ops-command-cards button.command-card.locked strong {
    display: block;
    margin: 0;
    font-size: 11px;
  }

  .ops-command-cards button.command-card.locked small {
    display: block;
    font-size: 9px;
    line-height: 1.15;
  }
}

@media (max-height: 760px) and (min-width: 1181px) {
  .ops-left-dock {
    grid-template-rows: 112px minmax(0, 1fr) 116px 38px;
    align-content: stretch;
    overflow: hidden;
  }

  .ops-brief-card {
    display: grid;
    grid-template-rows: 12px 18px minmax(0, 1fr) 34px;
    gap: 4px;
    overflow: hidden;
  }

  .ops-brief-card h2 {
    margin: 0;
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ops-brief-card p {
    margin: 0;
    line-height: 1.25;
    -webkit-line-clamp: 2;
  }

  .objective-meter {
    margin-top: 0;
  }

  .objective-meter div {
    padding: 4px 5px;
  }

  .objective-meter span {
    font-size: 8px;
  }

  .objective-meter strong {
    margin-top: 0;
    font-size: 14px;
  }

  .ops-mission-board {
    min-height: 0;
    grid-template-rows: 18px 40px minmax(0, 1fr);
    gap: 6px;
    overflow: hidden;
  }

  .battle-pressure {
    grid-template-columns: 1fr 1fr;
    gap: 4px 7px;
  }

  .battle-pressure div {
    grid-template-columns: 36px minmax(0, 1fr) 30px;
    gap: 4px;
  }

  .battle-pressure div:last-child {
    display: none;
  }

  .battle-pressure span,
  .battle-pressure strong {
    font-size: 9px;
  }

  .battle-pressure b {
    height: 4px;
  }

  .mission-objectives {
    min-height: 0;
    align-content: start;
    overflow: hidden;
  }

  .mission-objective {
    grid-template-columns: 20px minmax(0, 1fr);
    min-height: 32px;
    padding: 4px 5px;
    gap: 5px;
  }

  .mission-objective i {
    width: 18px;
    height: 18px;
    font-size: 8px;
  }

  .mission-objective strong,
  .mission-objective small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mission-objective strong {
    font-size: 10px;
  }

  .mission-objective small {
    margin-top: 0;
    font-size: 8px;
  }

  .mission-objective em {
    height: 3px;
  }

  .ops-registry {
    min-height: 0;
    gap: 4px;
    overflow: hidden;
  }

  .ops-registry .mini-object {
    min-height: 33px;
    grid-template-columns: 30px minmax(0, 1fr);
    grid-template-rows: 1fr;
    gap: 5px;
    padding: 3px 5px;
    overflow: hidden;
  }

  .ops-registry .mini-object > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 14px 3px;
    gap: 2px 6px;
    align-content: center;
  }

  .ops-registry .mini-object span {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .ops-registry .mini-object strong,
  .ops-registry .mini-object small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ops-registry .mini-object strong {
    font-size: 10px;
    line-height: 1.05;
  }

  .ops-registry .mini-object small {
    font-size: 8px;
    line-height: 1;
    text-align: right;
  }

  .ops-registry .mini-object .mini-object-meter {
    grid-column: 1 / -1;
    height: 3px;
    margin-top: 0;
  }

  .ops-doctrine {
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px;
    align-items: center;
    overflow: hidden;
  }

  .ops-doctrine .panel-title,
  .ops-doctrine p,
  .ops-doctrine .tutorial-controls {
    display: none;
  }

  .doctrine-step {
    min-width: 0;
    margin: 0;
    padding: 5px 7px;
    overflow: hidden;
    font-size: 10px;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ops-map-stage {
    grid-template-rows: 38px minmax(0, 1fr) 108px;
  }

  .mechanic-note {
    margin: 5px 0;
    padding: 6px;
  }

  .mechanic-note span {
    font-size: 10px;
    -webkit-line-clamp: 1;
  }

  .mission-objective.mechanic-row small {
    -webkit-line-clamp: 1;
  }

  .map-status-board {
    width: 196px;
    bottom: 38px;
    padding: 8px;
    gap: 5px;
  }

  .decision-ring {
    width: 68px;
    height: 68px;
  }

  .decision-ring strong {
    font-size: 22px;
  }

  .decision-stack span {
    padding: 5px;
  }

  .ops-command-cards button.command-card {
    min-height: 76px;
    padding: 6px;
  }

  .ops-command-cards button.command-card.locked {
    min-height: 82px;
    max-height: 82px;
    grid-template-rows: 18px 14px 12px 16px;
    gap: 3px;
  }

  .ops-command-cards button.command-card.locked strong,
  .ops-command-cards button.command-card.locked small,
  .ops-command-cards button.command-card.locked em.command-combo {
    line-height: 1.05;
  }

  .ops-command-cards button.command-card em {
    min-height: 17px;
    padding: 2px 4px;
  }
}

/* v22: right dock becomes a fixed command-console stack */
@media (min-width: 1181px) {
  .ops-right-dock {
    grid-template-rows: minmax(112px, 0.7fr) minmax(198px, 1.08fr) minmax(150px, 0.72fr);
    align-content: stretch;
    overflow: hidden;
  }

  .ops-intel-board,
  .ops-object-board,
  .ops-after-action {
    min-height: 0;
    overflow: hidden;
  }

  .ops-intel-board,
  .ops-object-board {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 5px;
  }

  .ops-intel-board .inspector-card,
  .ops-object-board .inspector-card,
  .ops-after-action .ops-decision-board {
    min-height: 0;
    overflow: hidden;
  }

  .ops-object-board .inspector-card {
    overflow: auto;
  }

  .ops-intel-board .inspector-card,
  .ops-object-board .object-detail {
    display: grid;
  }

  .ops-intel-board .inspector-card {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .ops-intel-board .inspector-card > p,
  .ops-intel-board .hint-box,
  .ops-intel-board .sample-data,
  .ops-intel-board .mechanic-note,
  .ops-intel-board .governance-box,
  .ops-intel-board .assign-row,
  .relation-readiness {
    min-height: 0;
  }

  .ops-intel-board .inspector-card > p {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .ops-intel-board .sample-data,
  .relation-readiness {
    overflow: auto;
  }

  .ops-object-board .object-detail {
    grid-template-rows: auto auto auto auto minmax(0, 1fr) auto minmax(86px, 0.66fr);
  }

  .ops-object-board .object-title {
    margin-bottom: 6px;
  }

  .ops-object-board .object-title span {
    width: 28px;
    height: 28px;
  }

  .ops-object-board .object-readiness {
    margin: 5px 0 6px;
    padding: 6px;
  }

  .ops-object-board .mechanic-note {
    margin: 0 0 6px;
    padding: 6px;
  }

  .ops-object-board h4 {
    margin: 4px 0 5px;
    color: #e8debe;
    font-size: 10px;
    letter-spacing: 0.04em;
  }

  .ops-object-board .attached-props,
  .ops-object-board .object-relations {
    min-height: 0;
    overflow: auto;
  }

  .ops-object-board .attached-props {
    max-height: none;
  }

  .ops-object-board .attached-props span,
  .ops-object-board .object-relations span,
  .relation-readiness span {
    padding: 5px 6px;
  }

  .ops-after-action .ops-decision-board {
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 4px;
  }

  .decision-core {
    min-height: 0;
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr);
    gap: 7px;
    align-items: center;
  }

  .decision-ring {
    width: 48px;
    height: 48px;
  }

  .decision-ring strong {
    font-size: 17px;
  }

  .decision-ring span {
    margin-top: -14px;
    font-size: 8px;
  }

  .decision-stack {
    min-height: 0;
    gap: 4px;
  }

  .decision-stack span {
    min-height: 0;
    padding: 3px 5px;
  }

  .decision-stack b {
    font-size: 10px;
  }

  .decision-footer {
    min-height: 15px;
  }
}

@media (max-height: 760px) and (min-width: 1181px) {
  .ops-right-dock {
    grid-template-rows: minmax(94px, 0.56fr) minmax(176px, 1fr) minmax(142px, 0.74fr);
  }

  .ops-intel-board .inspector-card > p,
  .object-readiness small,
  .ops-object-board .mechanic-note span {
    -webkit-line-clamp: 1;
  }

  .ops-object-board .object-readiness {
    gap: 4px;
  }

  .decision-core {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .decision-ring {
    width: 42px;
    height: 42px;
  }

  .decision-stack span {
    padding: 3px 5px;
  }
}

/* v23: footer becomes a tactical radio event feed */
.ops-footer {
  grid-template-columns: minmax(0, 1fr) minmax(168px, 232px) max-content;
  gap: 8px;
}

.ops-radio-feed {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.ops-radio-feed span {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-rows: 14px 14px;
  gap: 1px 6px;
  align-items: center;
  padding: 5px 7px;
  border: 1px solid rgba(159, 188, 218, 0.16);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.035);
}

.ops-radio-feed span.active {
  border-color: rgba(88, 198, 170, 0.34);
  background: rgba(88, 198, 170, 0.075);
}

.ops-radio-feed b {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  min-height: 28px;
  border-radius: 3px;
  background: rgba(241, 212, 139, 0.1);
  color: #f1d48b;
  font-size: 9px;
  font-weight: 900;
}

.ops-radio-feed strong,
.ops-radio-feed small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-radio-feed strong {
  color: #e8debe;
  font-size: 10px;
}

.ops-radio-feed small {
  color: #aeb8b4;
  font-size: 9px;
}

.ops-history-line {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 5px;
  align-items: center;
}

.ops-history-line span {
  min-width: 0;
  overflow: hidden;
  color: #cbd4d0;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-history-line strong {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  margin-left: 0;
  padding: 3px 5px;
  border-radius: 3px;
  font-size: 9px;
}

@media (max-height: 760px) and (min-width: 1181px) {
  .ops-footer {
    grid-template-columns: minmax(0, 1fr) minmax(156px, 216px) max-content;
  }

  .ops-radio-feed {
    gap: 5px;
  }

  .ops-radio-feed span {
    grid-template-columns: 30px minmax(0, 1fr);
    grid-template-rows: 12px 12px;
    padding: 3px 5px;
  }

.ops-radio-feed b {
    min-height: 24px;
  }
}

/* v24: map layers become tactical readout switches */
.ops-map-toolbar {
  display: grid;
  grid-template-columns: minmax(120px, 0.72fr) minmax(220px, 1fr) minmax(300px, 0.98fr);
  align-items: center;
  min-height: 44px;
}

.ops-map-toolbar > div:first-child {
  min-width: 0;
}

.ops-map-toolbar .ops-pulse {
  width: 100%;
  min-width: 0;
  grid-template-columns: repeat(4, minmax(38px, 1fr)) minmax(52px, 1fr);
  gap: 3px;
}

.ops-map-toolbar .ops-pulse span,
.ops-map-toolbar .ops-pulse strong {
  min-width: 0;
  min-height: 28px;
  padding: 3px 4px;
  overflow: hidden;
}

.ops-map-toolbar .ops-pulse b,
.ops-map-toolbar .ops-pulse small,
.ops-map-toolbar .ops-pulse strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-layer-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(54px, 1fr));
  width: 100%;
  min-width: 0;
  max-width: none;
}

.ops-layer-tabs .layer-switch {
  min-width: 0;
  min-height: 34px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  grid-template-rows: 12px 10px 8px;
  gap: 0 4px;
  align-items: center;
  padding: 3px 4px;
  text-align: left;
}

.layer-switch b {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 24px;
  height: 22px;
  border-radius: 3px;
  background: rgba(159, 188, 218, 0.1);
  color: #aeb8b4;
  font-size: 7px;
  font-weight: 900;
}

.layer-switch span,
.layer-switch small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-switch span {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  color: #e8debe;
  font-size: 8px;
  font-weight: 900;
}

.layer-switch small {
  grid-column: 1 / -1;
  grid-row: 3;
  align-self: end;
  justify-self: stretch;
  color: #aeb8b4;
  font-size: 7px;
  line-height: 1;
  text-align: center;
}

.layer-switch.active b {
  background: rgba(88, 198, 170, 0.17);
  color: #58c6aa;
}

@media (max-height: 760px) and (min-width: 1181px) {
  .ops-map-stage {
    grid-template-rows: 46px minmax(0, 1fr) 108px;
  }

  .ops-map-toolbar {
    grid-template-columns: minmax(96px, 0.52fr) minmax(190px, 0.94fr) minmax(276px, 1fr);
  }

  .ops-map-toolbar .ops-pulse {
    grid-template-columns: repeat(4, minmax(34px, 1fr)) minmax(46px, 1fr);
  }

  .ops-layer-tabs {
    min-width: 0;
    max-width: none;
  }

  .ops-layer-tabs .layer-switch {
    min-height: 32px;
    grid-template-columns: 22px minmax(0, 1fr);
    grid-template-rows: 11px 10px 8px;
    gap: 0 3px;
    padding: 3px;
  }

  .layer-switch b {
    width: 22px;
    height: 21px;
    font-size: 7px;
  }

  .layer-switch span {
    font-size: 8px;
  }

  .layer-switch small {
    font-size: 7px;
  }
}

/* v30: map layer switches become non-clipping layer bus readouts */

/* v31: relation commands become compact tactical order tokens */
.ops-command-cards button.command-card {
  grid-template-rows: 18px 14px 16px 20px;
  min-height: 84px;
  max-height: 84px;
  gap: 4px;
  padding: 6px 7px;
  overflow: hidden;
}

.ops-command-cards button.command-card strong,
.ops-command-cards button.command-card .command-route,
.ops-command-cards button.command-card .command-signals,
.ops-command-cards button.command-card .command-meta {
  min-width: 0;
  overflow: hidden;
}

.ops-command-cards button.command-card strong {
  display: block;
  margin: 0;
  color: #e8debe;
  font-size: 11px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-command-cards button.command-card .command-route,
.ops-command-cards button.command-card.locked .command-route {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 12px minmax(0, 1fr);
  align-items: center;
  gap: 3px;
  color: #aeb8b4;
  font-size: 9px;
  line-height: 1;
}

.ops-command-cards button.command-card .command-route b,
.ops-command-cards button.command-card .command-route i,
.ops-command-cards button.command-card.locked .command-route b,
.ops-command-cards button.command-card.locked .command-route i {
  display: block;
  min-width: 0;
  overflow: hidden;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  line-height: 11px;
  max-height: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-command-cards button.command-card .command-route i,
.ops-command-cards button.command-card.locked .command-route i {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #58c6aa;
  font-size: 8px;
  line-height: 11px;
  text-align: center;
}

.ops-command-cards button.command-card .command-signals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.ops-command-cards button.command-card .command-signals em {
  min-height: 19px;
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr);
  gap: 3px;
  align-items: center;
  padding: 2px 4px;
  border: 1px solid rgba(88, 198, 170, 0.16);
  border-radius: 3px;
  background: rgba(88, 198, 170, 0.06);
  -webkit-line-clamp: initial;
}

.ops-command-cards button.command-card .command-signals em b,
.ops-command-cards button.command-card .command-signals em span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-command-cards button.command-card .command-signals em b {
  color: #58c6aa;
  font-size: 8px;
  font-weight: 900;
}

.ops-command-cards button.command-card .command-signals em span {
  color: #cbd4d0;
  font-size: 8px;
  line-height: 1;
}

.ops-command-cards button.command-card.locked {
  min-height: 84px;
  max-height: 84px;
  grid-template-rows: 18px 14px 16px 20px;
}

.ops-command-cards button.command-card.locked .command-signals em {
  border-color: rgba(241, 212, 139, 0.15);
  background: rgba(241, 212, 139, 0.045);
}

@media (max-height: 760px) and (min-width: 1181px) {
  .ops-command-cards button.command-card,
  .ops-command-cards button.command-card.locked {
    min-height: 84px;
    max-height: 84px;
    grid-template-rows: 17px 13px 15px 18px;
    gap: 3px;
    padding: 5px 6px;
  }

  .ops-command-cards button.command-card .command-signals em {
    min-height: 17px;
    grid-template-columns: 23px minmax(0, 1fr);
    padding: 2px 3px;
  }
}

/* v35: guided queue targets stay reachable and command cards keep width */
@media (max-height: 760px) and (min-width: 1181px) {
  .ops-command-cards button.command-card,
  .ops-command-cards button.command-card.locked {
    padding-inline: 5px;
  }

  .ops-command-cards button.command-card .command-signals {
    gap: 3px;
  }

  .ops-command-cards button.command-card .command-signals em {
    grid-template-columns: 21px minmax(0, 1fr);
    padding-inline: 2px;
  }

  .ops-command-cards button.command-card *,
  .ops-command-cards button.command-card.locked * {
    box-sizing: border-box;
    max-width: 100%;
  }
}

/* v32: mission stack header becomes a stable tactical status strip */
.ops-mission-board .mission-title {
  min-height: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  padding: 3px 5px;
  overflow: hidden;
  border: 1px solid rgba(241, 212, 139, 0.18);
  border-radius: 3px;
  background:
    linear-gradient(90deg, rgba(241, 212, 139, 0.09), rgba(88, 198, 170, 0.045));
}

.ops-mission-board .mission-title span,
.ops-mission-board .mission-title strong {
  min-width: 0;
  overflow: hidden;
  line-height: 12px;
  max-height: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-mission-board .mission-title span {
  color: #f1d48b;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.ops-mission-board .mission-title strong {
  max-width: 102px;
  color: #e8debe;
  font-size: 10px;
  text-align: right;
}

@media (max-height: 760px) and (min-width: 1181px) {
  .ops-mission-board {
    grid-template-rows: 24px 38px minmax(0, 1fr);
  }

  .ops-mission-board .mission-title {
    min-height: 24px;
    margin-bottom: 0;
    padding: 4px 5px;
  }
}

/* v33: object relation ports become tactical in/out port tokens */
.object-relations {
  gap: 6px;
}

.object-relations .relation-port {
  min-height: 38px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) max-content;
  grid-template-rows: 14px 12px;
  gap: 2px 6px;
  align-items: center;
  padding: 5px 6px;
  overflow: hidden;
  border-radius: 3px;
}

.object-relations .relation-port b {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 30px;
  height: 24px;
  border: 1px solid rgba(88, 198, 170, 0.22);
  border-radius: 3px;
  color: #58c6aa;
  font-size: 8px;
  font-weight: 900;
}

.object-relations .relation-port.in b {
  border-color: rgba(241, 212, 139, 0.26);
  color: #f1d48b;
}

.object-relations .relation-port strong,
.object-relations .relation-port small,
.object-relations .relation-port i {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.object-relations .relation-port strong {
  height: 12px;
  color: #e8debe;
  font-size: 10px;
  font-weight: 900;
}

.object-relations .relation-port small {
  height: 11px;
  color: #aeb8b4;
  font-size: 9px;
}

.object-relations .relation-port i {
  grid-column: 3;
  grid-row: 1 / 3;
  justify-self: end;
  padding: 3px 5px;
  border-radius: 3px;
  background: rgba(159, 188, 218, 0.1);
  color: #aeb8b4;
  font-size: 8px;
  font-style: normal;
  font-weight: 900;
  line-height: 8px;
}

.object-relations .relation-port.active i {
  background: rgba(88, 198, 170, 0.14);
  color: #58c6aa;
}

@media (max-height: 760px) and (min-width: 1181px) {
  .ops-object-board .object-relations {
    gap: 5px;
  }

  .ops-object-board .object-relations .relation-port {
    min-height: 38px;
    grid-template-columns: 32px minmax(0, 1fr) max-content;
    padding: 5px 6px;
  }
}

/* v34: right command-console cells stay isolated at launch viewport */
@media (min-width: 1181px) {
  .ops-right-dock {
    grid-template-rows: minmax(94px, 0.54fr) minmax(0, 1fr) minmax(150px, 0.72fr);
    align-content: stretch;
    overflow: hidden;
  }

  .ops-object-board {
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }

  .ops-object-board .inspector-card,
  .ops-object-board .object-detail {
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
  }

  .ops-object-board .object-detail {
    display: grid;
    grid-template-rows: auto auto auto auto minmax(42px, 1fr) auto minmax(0, 86px);
  }

  .ops-object-board .attached-props,
  .ops-object-board .object-relations {
    min-height: 0;
    overflow: auto;
    scrollbar-width: thin;
  }

  .ops-object-board .object-readiness,
  .ops-object-board .mechanic-note {
    flex-shrink: 0;
  }

  .ops-after-action {
    min-height: 0;
    overflow: hidden;
  }

  .ops-after-action .ops-decision-board {
    min-height: 0;
    height: 100%;
  }
}

@media (max-height: 760px) and (min-width: 1181px) {
  .ops-right-dock {
    grid-template-rows: minmax(92px, 0.5fr) minmax(0, 1.16fr) minmax(148px, 0.64fr);
  }

  .ops-object-board .object-detail {
    grid-template-rows: auto auto auto auto 18px auto 82px;
  }

  .ops-object-board .object-title {
    min-height: 28px;
    gap: 7px;
    margin: 0;
  }

  .ops-object-board .object-title span {
    width: 26px;
    height: 26px;
    border-radius: 4px;
    font-size: 13px;
  }

  .ops-object-board .object-title strong {
    display: block;
    overflow: hidden;
    line-height: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ops-object-board .object-title small {
    display: none;
  }

  .ops-object-board .object-readiness {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 13px 5px;
    margin: 3px 0 4px;
    padding: 5px 6px;
    gap: 3px;
  }

  .ops-object-board .object-readiness div {
    min-width: 0;
    line-height: 13px;
  }

  .ops-object-board .object-readiness span,
  .ops-object-board .object-readiness strong {
    line-height: 13px;
  }

  .ops-object-board .object-readiness i {
    height: 5px;
  }

  .ops-object-board .object-readiness small {
    display: none;
  }

  .ops-object-board .mechanic-note {
    grid-template-columns: minmax(0, 1fr);
    margin: 0 0 4px;
    padding: 5px 6px;
    gap: 1px;
  }

  .ops-object-board .mechanic-note strong {
    font-size: 9px;
    line-height: 11px;
  }

  .ops-object-board .mechanic-note span {
    font-size: 9px;
    line-height: 11px;
  }

  .ops-object-board .attached-props .empty {
    overflow: hidden;
    margin: 0;
    line-height: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ops-object-board h4 {
    margin: 3px 0 4px;
  }

  .ops-after-action .ops-decision-board {
    gap: 3px;
  }

  .decision-core {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 6px;
  }

  .decision-ring {
    width: 40px;
    height: 40px;
  }

  .decision-stack {
    gap: 3px;
  }

  .decision-stack span {
    min-height: 30px;
  }

  .decision-stack b {
    font-size: 9px;
  }

  .decision-stack small {
    font-size: 8px;
  }
}

/* v25: map selection gains a tactical focus marker */
.map-focus-marker {
  position: absolute;
  z-index: 16;
  width: 132px;
  min-height: 48px;
  display: grid;
  gap: 2px;
  padding: 6px 8px 6px 10px;
  border: 1px solid rgba(88, 198, 170, 0.42);
  border-radius: 3px;
  background:
    linear-gradient(180deg, rgba(9, 18, 19, 0.92), rgba(5, 8, 9, 0.86));
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.42), inset 3px 0 0 rgba(88, 198, 170, 0.74);
  pointer-events: none;
  transform: translate(0, -50%);
}

.map-focus-marker::after {
  content: "";
  position: absolute;
  left: -18px;
  top: 50%;
  width: 18px;
  height: 1px;
  background: rgba(88, 198, 170, 0.58);
}

.map-focus-marker span,
.map-focus-marker strong,
.map-focus-marker small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-focus-marker span {
  color: #58c6aa;
  font-size: 9px;
  font-weight: 900;
}

.map-focus-marker strong {
  color: #e8debe;
  font-size: 11px;
}

.map-focus-marker small {
  color: #aeb8b4;
  font-size: 9px;
}

@media (max-height: 760px) and (min-width: 1181px) {
  .map-focus-marker {
    width: 116px;
    min-height: 42px;
    padding: 5px 7px 5px 9px;
  }

  .map-focus-marker strong {
    font-size: 10px;
  }
}

/* v36: campaign stages become a fixed strategic sand-table instead of a long
   document. The stage keeps a stable map cockpit, while dense evidence/order
   content scrolls inside its own lane. */
.app-shell {
  background:
    linear-gradient(180deg, rgba(7, 10, 14, 0.98), rgba(14, 18, 20, 0.94)),
    url("./assets/images/generated/wargame-map.png");
  background-size: cover;
  background-position: center;
}

.main-panel {
  background:
    linear-gradient(180deg, rgba(5, 7, 9, 0.94), rgba(9, 11, 13, 0.82));
}

.stage-nav {
  align-items: stretch;
}

.stage-nav button {
  min-width: 0;
  overflow: hidden;
  border-radius: 3px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-card.ai,
.stage-card.action,
.stage-card.replay {
  position: relative;
  border-color: rgba(169, 181, 171, 0.22);
  background:
    linear-gradient(180deg, rgba(10, 13, 13, 0.94), rgba(5, 7, 8, 0.94)),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 42px);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.035),
    0 22px 70px rgba(0, 0, 0, 0.34);
}

.stage-card.ai::before,
.stage-card.action::before,
.stage-card.replay::before {
  content: "";
  position: absolute;
  inset: 8px;
  pointer-events: none;
  border: 1px solid rgba(88, 198, 170, 0.1);
  border-radius: 3px;
}

.staff-room,
.execution-room,
.battle-layout {
  position: relative;
  z-index: 1;
}

.staff-room,
.execution-room {
  grid-template-columns: minmax(290px, 0.88fr) minmax(300px, 1.08fr) minmax(230px, 0.78fr);
  gap: 12px;
}

.staff-map-panel,
.execution-map,
.staff-proposals,
.staff-evidence,
.execution-orders,
.execution-writeback,
.battle-board,
.battle-aar {
  border-radius: 3px;
  border-color: rgba(169, 181, 171, 0.22);
  background:
    linear-gradient(180deg, rgba(14, 18, 18, 0.92), rgba(6, 8, 9, 0.92));
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.028),
    0 18px 42px rgba(0,0,0,0.28);
}

.staff-map-header,
.staff-readouts,
.execution-status {
  border-color: rgba(169, 181, 171, 0.16);
  background: rgba(4, 6, 7, 0.72);
}

.staff-map-header strong,
.panel-title strong {
  color: #e8debe;
}

.staff-grade {
  border-radius: 3px;
  border-color: rgba(88, 198, 170, 0.44);
  background: rgba(88, 198, 170, 0.08);
}

.staff-war-map,
.execution-war-map {
  min-height: 0;
  background:
    linear-gradient(180deg, rgba(5, 8, 8, 0.08), rgba(5, 8, 8, 0.38)),
    url("./assets/images/generated/wargame-map.png");
  background-size: cover;
  background-position: center;
}

.staff-war-map .hex-grid,
.execution-war-map .hex-grid {
  opacity: 0.42;
}

.staff-context-chain {
  bottom: 10px;
  gap: 5px;
}

.staff-context-chain span {
  min-width: 0;
  min-height: 30px;
  overflow: hidden;
  border-radius: 3px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-proposals,
.staff-evidence,
.execution-orders,
.execution-writeback,
.battle-aar {
  scrollbar-width: thin;
  scrollbar-color: rgba(88, 198, 170, 0.55) rgba(255,255,255,0.06);
}

.staff-proposals::-webkit-scrollbar,
.staff-evidence::-webkit-scrollbar,
.execution-orders::-webkit-scrollbar,
.execution-writeback::-webkit-scrollbar,
.battle-aar::-webkit-scrollbar {
  width: 6px;
}

.staff-proposals::-webkit-scrollbar-thumb,
.staff-evidence::-webkit-scrollbar-thumb,
.execution-orders::-webkit-scrollbar-thumb,
.execution-writeback::-webkit-scrollbar-thumb,
.battle-aar::-webkit-scrollbar-thumb {
  background: rgba(88, 198, 170, 0.55);
  border-radius: 999px;
}

.staff-plan,
.execution-order,
.edit-card,
.staff-evidence-card,
.battle-result-card,
.timeline-item,
.trace-item,
.battle-metric,
.grade-card {
  border-radius: 3px;
}

.staff-plan {
  min-width: 0;
  padding: 11px;
  gap: 8px;
}

.staff-plan h3,
.staff-plan p,
.staff-plan li,
.staff-evidence-card p,
.staff-evidence-list p,
.execution-orders p,
.execution-order small,
.execution-writeback p,
.edit-card p,
.edit-card li,
.timeline-item p,
.trace-item p {
  overflow-wrap: anywhere;
}

.staff-plan h3 {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.18;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.staff-plan .plan-top {
  min-width: 0;
}

.staff-plan .plan-top > div {
  min-width: 0;
}

.staff-plan .confidence {
  width: 50px;
  height: 50px;
  border-radius: 3px;
}

.staff-plan .outcome,
.chain-text {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.tag-row span {
  max-width: 100%;
  overflow: hidden;
  border-radius: 3px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.execution-order {
  min-width: 0;
  min-height: 72px;
  padding: 9px;
}

.execution-order i {
  border-radius: 3px;
}

.execution-writeback .edit-card {
  border: 1px solid rgba(169, 181, 171, 0.18);
  background: rgba(255,255,255,0.045);
}

.battle-layout {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 370px);
}

.stage-card.ai,
.stage-card.action,
.stage-card.replay {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 8px;
}

.stage-card.ai .staff-room,
.stage-card.action .execution-room,
.stage-card.replay .battle-layout {
  height: auto;
  min-height: 0;
}

.stage-card.ai .stage-controls,
.stage-card.action .stage-controls,
.stage-card.replay .stage-controls {
  position: relative;
  z-index: 2;
  min-height: 34px;
  margin: 0;
  padding-top: 6px;
  border-top: 1px solid rgba(169, 181, 171, 0.14);
}

.battle-board {
  min-height: 0;
}

.battle-header {
  border-radius: 3px;
  border-color: rgba(169, 181, 171, 0.22);
  background:
    linear-gradient(135deg, rgba(10, 14, 14, 0.94), rgba(21, 24, 18, 0.84));
}

.battle-header h3 {
  color: #e8debe;
}

.battle-sandbox {
  border-radius: 3px;
  border-color: rgba(169, 181, 171, 0.24);
}

.battle-command-bar {
  min-width: 0;
}

.battle-command-bar button,
.replay-actions button,
.stage-controls button {
  border-radius: 3px;
  white-space: nowrap;
}

@media (max-height: 760px) and (min-width: 1181px) {
  .staff-room,
  .execution-room,
  .battle-layout {
    height: auto;
  }

  .stage-card.ai,
  .stage-card.action,
  .stage-card.replay {
    padding: 8px;
  }

  .staff-room {
    grid-template-columns: minmax(282px, 0.9fr) minmax(304px, 1.08fr) minmax(226px, 0.76fr);
  }

  .execution-room {
    grid-template-columns: minmax(282px, 0.92fr) minmax(294px, 1fr) minmax(226px, 0.78fr);
  }

  .staff-map-panel,
  .execution-map {
    grid-template-rows: 44px minmax(0, 1fr) auto;
  }

  .staff-map-header {
    min-height: 44px;
    padding: 7px 9px;
  }

  .staff-map-header strong,
  .panel-title strong {
    font-size: 13px;
  }

  .staff-grade strong {
    font-size: 18px;
  }

  .staff-readouts,
  .execution-status {
    padding: 7px;
  }

  .staff-proposals,
  .staff-evidence,
  .execution-orders,
  .execution-writeback {
    padding: 9px;
  }

  .staff-plan {
    padding: 9px;
  }

  .staff-plan .plan-section {
    margin-top: 5px;
  }

  .staff-plan .confidence {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }

  .execution-order {
    min-height: 64px;
    grid-template-columns: minmax(0, 1fr) 54px;
    gap: 4px 8px;
  }

  .execution-order i {
    width: 50px;
    height: 30px;
  }

  .battle-header {
    min-height: 70px;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.68fr);
  }

  .battle-layout {
    grid-template-columns: minmax(0, 1fr) minmax(286px, 340px);
  }
}

/* v37: campaign shell HUD pass. The sandbox was already tactical; this makes
   the legacy campaign wrapper read as the same operations room. */
.app-shell {
  grid-template-columns: 306px minmax(0, 1fr);
  background:
    linear-gradient(90deg, rgba(5, 7, 8, 0.98), rgba(8, 10, 11, 0.9) 30%, rgba(8, 11, 11, 0.96)),
    url("./assets/images/generated/wargame-map.png");
  background-size: cover;
  background-position: center;
}

.app-shell .sidebar {
  position: relative;
  padding: 14px;
  gap: 12px;
  border-right-color: rgba(169, 181, 171, 0.22);
  background:
    linear-gradient(180deg, rgba(8, 10, 10, 0.96), rgba(12, 15, 13, 0.9));
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.03), 18px 0 48px rgba(0,0,0,0.25);
}

.app-shell .sidebar::before {
  content: "OPS LADDER";
  display: block;
  padding: 6px 8px;
  border: 1px solid rgba(88, 198, 170, 0.18);
  border-radius: 3px;
  background: rgba(88, 198, 170, 0.055);
  color: #58c6aa;
  font-size: 10px;
  font-weight: 900;
}

.app-shell .brand {
  min-height: 54px;
  padding: 8px;
  border: 1px solid rgba(169, 181, 171, 0.16);
  border-radius: 3px;
  background: rgba(255,255,255,0.035);
}

.app-shell .brand .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 3px;
  background: linear-gradient(145deg, #58c6aa, #e8debe);
  font-size: 18px;
}

.app-shell .brand h1 {
  color: #e8debe;
  font-size: 16px;
}

.app-shell .brand p {
  display: -webkit-box;
  overflow: hidden;
  color: #aeb8b4;
  line-height: 1.28;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.app-shell .level-list {
  gap: 7px;
  padding-right: 2px;
}

.app-shell .level-button {
  min-height: 58px;
  grid-template-columns: 34px minmax(0, 1fr) 58px;
  gap: 8px;
  padding: 8px;
  border-radius: 3px;
  border-color: rgba(169, 181, 171, 0.16);
  background: linear-gradient(90deg, rgba(255,255,255,0.035), rgba(255,255,255,0.018));
}

.app-shell .level-button::after {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: rgba(169, 181, 171, 0.18);
}

.app-shell .level-button.active {
  border-color: rgba(88, 198, 170, 0.5);
  background: linear-gradient(90deg, rgba(88, 198, 170, 0.12), rgba(232, 222, 190, 0.04));
}

.app-shell .level-button.active::after {
  background: #58c6aa;
  box-shadow: 0 0 12px rgba(88, 198, 170, 0.4);
}

.app-shell .level-button.complete .level-num {
  color: #8fe388;
  background: rgba(143, 227, 136, 0.12);
}

.app-shell .level-num {
  width: 30px;
  height: 30px;
  border-radius: 3px;
  background: rgba(255,255,255,0.055);
  color: #e8debe;
}

.app-shell .level-button span:nth-child(2) {
  min-width: 0;
}

.app-shell .level-button strong,
.app-shell .level-button small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-shell .level-button strong {
  color: #eef5fb;
  font-size: 13px;
}

.app-shell .level-button small {
  margin-top: 2px;
  font-size: 10px;
}

.app-shell .level-state {
  grid-column: 3;
  align-self: center;
  justify-self: end;
  max-width: 58px;
  overflow: hidden;
  padding: 3px 5px;
  border: 1px solid rgba(88, 198, 170, 0.2);
  border-radius: 3px;
  background: rgba(88, 198, 170, 0.055);
  color: #58c6aa;
  font-size: 9px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-shell .sidebar-footer {
  padding: 9px;
  border: 1px solid rgba(169, 181, 171, 0.16);
  border-radius: 3px;
  background: rgba(255,255,255,0.035);
}

.app-shell .sidebar-footer p {
  margin: 8px 0;
  color: #aeb8b4;
  font-size: 11px;
  line-height: 1.35;
}

.app-shell .side-actions button {
  min-height: 30px;
  border-radius: 3px;
  padding: 6px;
  font-size: 11px;
}

.app-shell .main-panel {
  grid-template-rows: 84px 42px minmax(0, 1fr);
  gap: 8px;
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(5, 7, 8, 0.86), rgba(9, 11, 10, 0.78));
}

.app-shell .topbar {
  min-height: 84px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(169, 181, 171, 0.16);
  border-radius: 3px;
  background:
    linear-gradient(90deg, rgba(10, 13, 13, 0.92), rgba(25, 28, 20, 0.78)),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 42px);
}

.app-shell .topbar .eyebrow {
  margin-bottom: 3px;
  color: #58c6aa;
  font-size: 10px;
}

.app-shell .topbar h2 {
  max-width: none;
  margin-bottom: 4px;
  color: #e8debe;
  font-size: 22px;
  line-height: 1.1;
}

.app-shell .topbar p {
  max-width: min(760px, 58vw);
  color: #aeb8b4;
  font-size: 12px;
  line-height: 1.35;
  -webkit-line-clamp: 2;
}

.app-shell .topbar-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(72px, auto));
  gap: 7px;
}

.app-shell .metric,
.app-shell .toggle,
.app-shell .topbar-metrics button {
  min-width: 0;
  min-height: 52px;
  border-radius: 3px;
  padding: 7px 9px;
  border-color: rgba(169, 181, 171, 0.18);
  background: rgba(255,255,255,0.04);
}

.app-shell .metric strong {
  font-size: 20px;
  line-height: 1.1;
}

.app-shell .toggle {
  align-items: center;
}

.app-shell .stage-nav {
  gap: 6px;
}

.app-shell .stage-nav button {
  min-height: 42px;
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  padding: 6px 7px;
  border-radius: 3px;
  border-color: rgba(169, 181, 171, 0.16);
  background: rgba(255,255,255,0.035);
  color: #aeb8b4;
  font-size: 11px;
  text-align: left;
}

.app-shell .stage-nav button span {
  width: 22px;
  height: 22px;
  margin: 0;
  border-radius: 3px;
  background: rgba(255,255,255,0.06);
  color: #e8debe;
}

.app-shell .stage-nav button.active {
  border-color: rgba(88, 198, 170, 0.5);
  background: rgba(88, 198, 170, 0.1);
  color: #eef5fb;
}

.app-shell .stage-nav button.active::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 4px;
  height: 2px;
  background: #58c6aa;
}

.app-shell .stage-nav button.done span {
  color: #8fe388;
  background: rgba(143, 227, 136, 0.12);
}

.app-shell .stage-card {
  border-radius: 3px;
  padding: 8px;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-shell .main-panel {
    display: block;
  }

  .app-shell .topbar,
  .app-shell .topbar-metrics {
    grid-template-columns: 1fr;
  }

  .app-shell .topbar p {
    max-width: none;
  }
}

@media (max-height: 760px) and (min-width: 1181px) {
  .app-shell {
    grid-template-columns: 292px minmax(0, 1fr);
  }

  .app-shell .sidebar {
    padding: 12px;
  }

  .app-shell .level-button {
    min-height: 52px;
    padding: 7px;
  }

  .app-shell .main-panel {
    grid-template-rows: 76px 38px minmax(0, 1fr);
    padding: 10px;
  }

  .app-shell .topbar {
    min-height: 76px;
    padding: 8px 10px;
  }

  .app-shell .topbar h2 {
    font-size: 20px;
  }

  .app-shell .topbar p {
    font-size: 11px;
    -webkit-line-clamp: 2;
  }

  .app-shell .metric,
  .app-shell .toggle,
  .app-shell .topbar-metrics button {
    min-height: 46px;
    padding: 6px 7px;
  }

  .app-shell .stage-nav button {
    min-height: 38px;
    font-size: 10px;
  }
}

/* v38: early campaign stages join the same tactical workspace. Briefing,
   intel triage, ontology picking, and graph modeling now use fixed stage
   lanes with internal terminals instead of stretching the page. */
.stage-card.brief,
.stage-card.intel,
.stage-card.ontology,
.stage-card.graph {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 8px;
  border-color: rgba(169, 181, 171, 0.22);
  background:
    linear-gradient(180deg, rgba(10, 13, 13, 0.94), rgba(5, 7, 8, 0.94)),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 44px);
}

.stage-card.brief::before,
.stage-card.intel::before,
.stage-card.ontology::before,
.stage-card.graph::before {
  content: "";
  position: absolute;
  inset: 8px;
  pointer-events: none;
  border: 1px solid rgba(88, 198, 170, 0.09);
  border-radius: 3px;
}

.stage-card.brief > :not(.stage-controls),
.stage-card.intel > :not(.stage-controls):not(.tip-banner),
.stage-card.ontology > :not(.stage-controls):not(.tip-banner),
.stage-card.graph > :not(.stage-controls):not(.tip-banner) {
  min-height: 0;
}

.stage-card.brief .stage-controls,
.stage-card.intel .stage-controls,
.stage-card.ontology .stage-controls,
.stage-card.graph .stage-controls {
  position: relative;
  z-index: 2;
  min-height: 34px;
  margin: 0;
  padding-top: 6px;
  border-top: 1px solid rgba(169, 181, 171, 0.14);
}

.brief-layout,
.two-column.wide-left,
.ontology-board,
.graph-layout {
  position: relative;
  z-index: 1;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.brief-layout {
  grid-template-columns: minmax(0, 1.18fr) minmax(300px, 0.62fr);
  gap: 12px;
}

.command-room,
.mission-card,
.source-card,
.task-panel,
.preview-panel,
.graph-canvas,
.ontology-board > section {
  border-radius: 3px;
  border-color: rgba(169, 181, 171, 0.22);
  background:
    linear-gradient(180deg, rgba(14, 18, 18, 0.9), rgba(6, 8, 9, 0.9));
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.026),
    0 18px 42px rgba(0,0,0,0.22);
}

.command-room {
  min-height: 0;
  height: 100%;
}

.mission-card {
  min-height: 0;
  overflow: auto;
  padding: 14px;
  scrollbar-width: thin;
}

.mission-card h3 {
  color: #e8debe;
  font-size: 21px;
}

.mission-card .check-list {
  gap: 7px;
}

.mission-card .check-list li {
  line-height: 1.38;
}

.two-column.wide-left {
  grid-template-columns: minmax(0, 1.25fr) minmax(330px, 0.78fr);
  gap: 12px;
}

.source-grid {
  min-height: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  overflow: hidden;
}

.source-card {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 10px;
  overflow: hidden;
}

.source-head {
  min-height: 26px;
  margin-bottom: 8px;
}

.source-head strong {
  min-width: 0;
  overflow: hidden;
  color: #e8debe;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-wrap {
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
}

table {
  font-size: 12px;
}

th,
td {
  padding: 6px 7px;
}

.text-source {
  overflow: auto;
  scrollbar-width: thin;
}

.task-panel {
  min-height: 0;
  overflow: auto;
  padding: 12px;
  scrollbar-width: thin;
}

.task-panel h3,
.ontology-board h3,
.preview-panel h3 {
  color: #e8debe;
  font-size: 17px;
  line-height: 1.2;
}

.tip-banner {
  position: relative;
  z-index: 2;
  min-height: 40px;
  margin-bottom: 8px;
  padding: 9px 11px;
  border-radius: 3px;
}

.choice-card {
  min-width: 0;
  min-height: 62px;
  border-radius: 3px;
  padding: 10px;
  background: linear-gradient(145deg, rgba(16, 28, 42, 0.72), rgba(8, 13, 22, 0.72));
}

.choice-card strong,
.choice-card small {
  overflow-wrap: anywhere;
}

.choice-card small {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.ontology-board {
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  overflow: hidden;
}

.ontology-board > section {
  min-height: 0;
  padding: 12px;
  overflow: auto;
  scrollbar-width: thin;
}

.ontology-board .card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.preview-panel {
  position: relative;
  z-index: 1;
  min-height: 0;
  max-height: 118px;
  margin-top: 8px;
  overflow: auto;
  padding: 10px 12px;
  scrollbar-width: thin;
}

.object-pill,
.property-preview span,
.tag-row span {
  border-radius: 3px;
}

.graph-layout {
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.72fr);
  gap: 12px;
}

.graph-canvas {
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,0.035) 1px, transparent 1px),
    radial-gradient(circle at 50% 50%, rgba(88, 198, 170, 0.12), transparent 46%),
    linear-gradient(180deg, rgba(14, 18, 18, 0.92), rgba(6, 8, 9, 0.92));
  background-size: 42px 42px, 42px 42px, auto, auto;
}

.graph-canvas svg {
  height: 100%;
  min-height: 0;
}

.graph-node text {
  fill: #e8debe;
}

.stage-card.brief .brief-actions,
.stage-card.intel .stage-controls,
.stage-card.ontology .stage-controls,
.stage-card.graph .stage-controls {
  flex: 0 0 auto;
}

@media (max-height: 760px) and (min-width: 1181px) {
  .brief-layout,
  .two-column.wide-left,
  .ontology-board,
  .graph-layout {
    gap: 9px;
  }

  .mission-card,
  .task-panel,
  .source-card,
  .ontology-board > section,
  .preview-panel {
    padding: 9px;
  }

  .mission-card h3,
  .task-panel h3,
  .ontology-board h3 {
    font-size: 15px;
  }

  .source-grid {
    gap: 8px;
  }

  .choice-card {
    min-height: 58px;
    padding: 8px;
  }

  .stage-hint-meter {
    margin: 7px 0 8px;
    padding: 7px 8px;
  }

  .preview-panel {
    max-height: 96px;
  }
}

/* v39: mobile and narrow-screen hardening. Desktop stages stay fixed like a
   sand table; below tablet width the same rooms become stacked consoles so
   the map, evidence lanes, and command cards never force horizontal overflow. */
@media (max-width: 1180px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .app-shell,
  .ops-game-shell {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .app-shell {
    height: auto;
    min-height: 100vh;
  }

  .app-shell .sidebar,
  .app-shell .main-panel,
  .app-shell .topbar,
  .app-shell .stage-nav,
  .app-shell .stage-card,
  .ops-topbar,
  .ops-layout,
  .ops-map-stage,
  .ops-footer {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  .app-shell .main-panel {
    height: auto;
    min-height: 0;
    overflow-y: visible;
  }

  .app-shell .topbar {
    height: auto;
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .app-shell .topbar-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-shell .stage-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    height: auto;
  }

  .app-shell .stage-nav button {
    min-width: 0;
  }

  .app-shell .stage-card,
  .stage-card.brief,
  .stage-card.intel,
  .stage-card.ontology,
  .stage-card.graph,
  .stage-card.ai,
  .stage-card.action,
  .stage-card.replay {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .brief-layout,
  .two-column.wide-left,
  .ontology-board,
  .graph-layout,
  .staff-room,
  .execution-room,
  .battle-layout {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: auto;
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .staff-map-panel,
  .execution-map {
    min-width: 0;
    grid-template-rows: auto minmax(420px, 56vh) auto;
  }

  .staff-proposals,
  .staff-evidence,
  .execution-orders,
  .execution-writeback,
  .battle-aar,
  .mission-card,
  .source-card,
  .task-panel,
  .ontology-board > section,
  .preview-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .source-grid {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .source-card {
    min-height: 210px;
  }

  .graph-canvas {
    height: min(560px, 64vh);
    min-height: 420px;
  }

  .battle-sandbox {
    min-height: 520px;
  }

  .ops-game-shell {
    grid-template-rows: auto auto auto;
    overflow-y: auto;
  }

  .ops-topbar,
  .ops-footer {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .ops-layout {
    height: auto;
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .ops-map-stage {
    grid-template-rows: auto minmax(520px, 64vh) auto;
  }

  .ops-wargame-map {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .ops-command-deck,
  .ops-command-cards,
  .ops-map-toolbar {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    grid-template-columns: 1fr;
  }

  .ops-system-buttons,
  .footer-actions,
  .ops-layer-tabs,
  .tutorial-controls {
    min-width: 0;
    flex-wrap: wrap;
  }
}

@media (max-width: 760px) {
  .app-shell .sidebar,
  .app-shell .main-panel,
  .app-shell .stage-card {
    padding: 10px;
  }

  .app-shell .topbar {
    padding: 10px;
    gap: 8px;
  }

  .app-shell .topbar h2 {
    font-size: 19px;
    white-space: normal;
  }

  .app-shell .topbar p {
    display: block;
    max-width: none;
    overflow: visible;
  }

  .app-shell .topbar-metrics,
  .app-shell .stage-nav,
  .source-grid,
  .ontology-board .card-grid,
  .ops-turn-strip,
  .ops-system-buttons,
  .ops-command-cards {
    grid-template-columns: 1fr;
  }

  .app-shell .level-list {
    grid-template-columns: 1fr;
  }

  .app-shell .stage-nav button {
    min-height: 36px;
  }

  .stage-card.brief,
  .stage-card.intel,
  .stage-card.ontology,
  .stage-card.graph,
  .stage-card.ai,
  .stage-card.action,
  .stage-card.replay {
    display: block;
  }

  .stage-card.brief::before,
  .stage-card.intel::before,
  .stage-card.ontology::before,
  .stage-card.graph::before,
  .stage-card.ai::before,
  .stage-card.action::before,
  .stage-card.replay::before {
    display: none;
  }

  .brief-layout,
  .two-column.wide-left,
  .ontology-board,
  .graph-layout,
  .staff-room,
  .execution-room,
  .battle-layout {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr !important;
  }

  .command-room,
  .mission-card,
  .source-card,
  .task-panel,
  .preview-panel,
  .ontology-board > section,
  .staff-map-panel,
  .staff-proposals,
  .staff-evidence,
  .execution-map,
  .execution-orders,
  .execution-writeback,
  .battle-board,
  .battle-aar {
    overflow: auto;
  }

  .source-card {
    min-height: 230px;
  }

  .source-head {
    grid-template-columns: 1fr;
  }

  .source-head strong {
    white-space: normal;
  }

  .table-wrap {
    overflow-x: auto;
  }

  .table-wrap table {
    min-width: 560px;
  }

  .command-room,
  .graph-canvas,
  .graph-canvas svg {
    height: 430px;
    min-height: 430px;
  }

  .preview-panel {
    max-height: none;
  }

  .staff-map-panel,
  .execution-map {
    grid-template-rows: auto minmax(380px, 58vh) auto;
  }

  .staff-war-map,
  .execution-war-map,
  .battle-sandbox {
    min-height: 380px;
  }

  .staff-context-chain {
    left: 8px;
    right: 8px;
    grid-template-columns: 1fr;
  }

  .staff-plan .plan-top,
  .execution-order {
    grid-template-columns: 1fr;
  }

  .staff-plan .confidence,
  .execution-order i {
    justify-self: start;
  }

  .battle-header {
    grid-template-columns: 1fr;
  }

  .stage-controls,
  .brief-actions,
  .battle-command-bar,
  .replay-actions {
    flex-wrap: wrap;
  }

  .stage-controls button,
  .brief-actions button,
  .battle-command-bar button,
  .replay-actions button {
    flex: 1 1 150px;
    min-width: 0;
  }

  .ops-topbar,
  .ops-footer {
    padding: 10px;
  }

  .ops-layout {
    padding: 8px;
  }

  .ops-brand {
    align-items: flex-start;
  }

  .ops-brand h1 {
    white-space: normal;
  }

  .ops-level-jump,
  .ops-layer-tabs,
  .footer-actions {
    display: flex;
    width: 100%;
  }

  .ops-level-jump {
    justify-content: space-between;
  }

  .ops-level-jump button {
    flex: 1 1 0;
  }

  .ops-footer {
    gap: 8px;
  }

  .ops-radio-feed {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .ops-radio-feed span {
    min-height: 0;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: start;
  }

  .ops-radio-feed strong,
  .ops-radio-feed small {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: visible;
    line-height: 1.35;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .ops-radio-feed small {
    display: block;
    grid-column: 2;
  }

  .brief-line {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: start;
    gap: 6px;
  }

  .brief-line span,
  .ops-history-line {
    display: block;
    overflow: visible;
    font-size: 11px;
    line-height: 1.35;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .ops-history-line {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 8px;
  }

  .ops-history-line strong {
    margin-left: 0;
  }

  .ops-layer-tabs button,
  .footer-actions button {
    flex: 1 1 130px;
  }

  .ops-map-stage {
    grid-template-rows: auto minmax(460px, 68vh) auto;
  }

  .ops-wargame-map {
    min-height: 460px;
  }

  .ops-pulse,
  .tactical-readout {
    grid-template-columns: 1fr;
  }

  .mission-objectives {
    gap: 6px;
    overflow: visible;
  }

  .mission-objective {
    min-height: 44px;
    align-items: start;
    overflow: visible;
  }

  .mission-objective span {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .mission-objective strong,
  .mission-objective small,
  .mission-objective.mechanic-row small,
  .tactical-readout small {
    white-space: normal;
    overflow-wrap: anywhere;
    text-overflow: clip;
  }

  .mission-objective strong,
  .mission-objective small {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .mission-objective small,
  .mission-objective.mechanic-row small {
    display: block;
    overflow: visible;
    line-height: 1.3;
    -webkit-line-clamp: unset;
  }

  .tactical-readout small {
    display: block;
    overflow: visible;
    line-height: 1.35;
  }

  .ops-footer p,
  .tutorial-controls span {
    overflow-wrap: anywhere;
  }
}

@media (max-width: 430px) {
  .app-shell .metric,
  .app-shell .toggle,
  .app-shell .topbar-metrics button {
    min-height: 44px;
  }

  .app-shell .stage-nav button {
    grid-template-columns: 20px minmax(0, 1fr);
    padding: 6px;
    font-size: 10px;
  }

  .app-shell .stage-nav button span {
    width: 20px;
    height: 20px;
  }

  .choice-card,
  .staff-plan,
  .execution-order,
  .edit-card,
  .staff-evidence-card,
  .battle-result-card,
  .timeline-item,
  .trace-item {
    padding: 9px;
  }

  .ops-map-toolbar,
  .ops-command-deck {
    padding: 8px;
  }

  .tactical-readout {
    left: 8px;
    right: 8px;
  }
}

/* v40: production cockpit polish. Keep the dense war-room layout, but make
   desktop stages read more like a strategic board and make phones reach the
   playable map faster. */
.ops-game-shell,
.app-shell {
  --v40-panel: rgba(6, 10, 10, 0.88);
  --v40-panel-strong: rgba(10, 16, 15, 0.95);
  --v40-line: rgba(199, 212, 173, 0.22);
  --v40-command: #e8debe;
}

@media (min-width: 1181px) {
  .ops-game-shell,
  .app-shell {
    position: relative;
  }

  .ops-game-shell::before,
  .app-shell::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
      linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
      radial-gradient(ellipse at 50% 46%, transparent 0 52%, rgba(0,0,0,0.34) 100%);
    background-size: 100% 5px, auto;
    opacity: 0.58;
  }

  .ops-game-shell > *,
  .app-shell > * {
    position: relative;
    z-index: 1;
  }

  .ops-map-stage,
  .staff-map-panel,
  .execution-map,
  .battle-board {
    border-color: var(--v40-line);
    box-shadow:
      inset 0 0 0 1px rgba(255,255,255,0.035),
      0 22px 70px rgba(0,0,0,0.34);
  }

  .ops-wargame-map,
  .staff-war-map,
  .execution-war-map,
  .battle-sandbox {
    border-color: rgba(232, 222, 190, 0.16);
    box-shadow:
      inset 0 0 0 1px rgba(255,255,255,0.045),
      inset 0 0 120px rgba(0,0,0,0.5),
      0 18px 54px rgba(0,0,0,0.28);
  }

  .hex-grid {
    opacity: 0.56;
  }

  .terrain-scan {
    opacity: 0.48;
  }

  .sector-label,
  .map-chip,
  .risk-zone,
  .map-status-board,
  .tactical-readout,
  .ops-map-legend {
    backdrop-filter: blur(8px);
  }

  .tactical-readout div {
    align-items: start;
  }

  .tactical-readout small {
    display: -webkit-box;
    max-width: 100%;
    overflow: hidden;
    white-space: normal;
    overflow-wrap: anywhere;
    text-overflow: clip;
    line-height: 1.28;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .ops-command-deck {
    grid-template-columns: minmax(164px, 220px) minmax(0, 1fr);
    border-top-color: rgba(232, 222, 190, 0.22);
    background:
      linear-gradient(180deg, rgba(10, 13, 11, 0.94), rgba(4, 6, 6, 0.96)),
      repeating-linear-gradient(90deg, rgba(232,222,190,0.035) 0 1px, transparent 1px 34px);
  }

  .ops-command-cards button,
  .staff-plan,
  .execution-order,
  .edit-card,
  .staff-evidence-card {
    position: relative;
  }

  .ops-command-cards button::before,
  .staff-plan::before,
  .execution-order::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: rgba(169, 181, 171, 0.24);
  }

  .ops-command-cards button:not(.locked)::before,
  .staff-plan.selected::before,
  .execution-order.selected::before {
    background: #58c6aa;
    box-shadow: 0 0 14px rgba(88,198,170,0.45);
  }

  .staff-plan.selected,
  .execution-order.selected {
    border-color: rgba(88,198,170,0.62);
    background:
      linear-gradient(135deg, rgba(88,198,170,0.14), rgba(5,8,8,0.88)),
      repeating-linear-gradient(90deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 28px);
  }

  .staff-plan.selected .confidence,
  .execution-order.selected i {
    box-shadow: 0 0 0 1px rgba(88,198,170,0.32), 0 0 22px rgba(88,198,170,0.18);
  }

  .staff-map-panel::after,
  .execution-map::after {
    content: "TACTICAL MAP";
    position: absolute;
    right: 12px;
    bottom: 10px;
    z-index: 5;
    padding: 4px 6px;
    border: 1px solid rgba(232,222,190,0.18);
    border-radius: 3px;
    background: rgba(4, 6, 6, 0.66);
    color: rgba(232,222,190,0.72);
    font-size: 9px;
    font-weight: 900;
  }

  .battle-verdict {
    letter-spacing: 0.04em;
    box-shadow: 0 0 0 1px rgba(232,222,190,0.15), 0 0 26px rgba(88,198,170,0.16);
  }
}

@media (max-width: 760px) {
  .ops-topbar {
    gap: 6px;
    padding: 8px;
  }

  .ops-brand {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
  }

  .ops-brand .brand-mark {
    width: 32px;
    height: 32px;
  }

  .ops-brand p {
    margin: 0 0 2px;
    font-size: 9px;
    line-height: 1;
  }

  .ops-brand h1 {
    display: -webkit-box;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.15;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .ops-turn-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 4px;
  }

  .ops-turn-strip div {
    min-height: 36px;
    padding: 5px 5px 13px;
  }

  .ops-turn-strip span {
    font-size: 8px;
  }

  .ops-turn-strip strong {
    overflow: hidden;
    margin-top: 1px;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ops-turn-strip div small {
    right: 5px;
    bottom: 3px;
    font-size: 7px;
  }

  .ops-system-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .ops-level-jump {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
    padding: 3px;
  }

  .ops-level-jump button {
    width: auto;
    height: 28px;
  }

  .ops-control-pad {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 3px;
  }

  .ops-control-pad button {
    width: auto;
    max-width: none;
    min-height: 30px;
    grid-template-rows: 11px 11px;
    padding: 3px;
  }

  .ops-layout {
    gap: 8px;
  }

  .ops-brief-card {
    padding: 10px;
  }

  .objective-meter {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .objective-meter div {
    min-height: 40px;
    padding: 6px;
  }

  .objective-meter span {
    font-size: 9px;
  }

  .objective-meter strong {
    font-size: 15px;
  }

  .ops-map-stage {
    grid-template-rows: auto minmax(430px, 64vh) auto;
  }

  .ops-wargame-map {
    min-height: 430px;
  }

  .app-shell .topbar-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-shell .stage-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
  }

  .app-shell .stage-nav button {
    min-height: 34px;
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 5px;
    text-align: center;
  }

  .app-shell .stage-nav button span {
    display: none;
  }
}

@media (max-width: 430px) {
  .ops-topbar {
    padding: 7px;
  }

  .ops-turn-strip div {
    min-height: 34px;
  }

  .ops-control-pad button b {
    font-size: 7px;
  }

  .ops-control-pad button span {
    font-size: 8px;
  }

  .ops-brief-card h2 {
    margin: 4px 0 6px;
    font-size: 18px;
  }

  .ops-brief-card p {
    display: -webkit-box;
    overflow: hidden;
    line-height: 1.42;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
  }
}

/* v41: mobile battlefield-first pass. The public demo should open like a
   wargame table on phones, with the operational map before the support docks. */
@media (max-width: 760px) {
  .ops-layout {
    display: flex;
    flex-direction: column;
  }

  .ops-map-stage {
    order: 1;
    flex: 0 0 auto;
    height: auto;
    grid-template-rows: auto minmax(500px, 62vh) auto;
    border-color: rgba(232, 222, 190, 0.28);
    box-shadow:
      0 0 0 1px rgba(232, 222, 190, 0.08),
      0 18px 48px rgba(0, 0, 0, 0.42);
  }

  .ops-left-dock {
    order: 2;
    flex: 0 0 auto;
    overflow: visible;
    padding-right: 0;
  }

  .ops-right-dock {
    order: 3;
    flex: 0 0 auto;
    overflow: visible;
    padding-right: 0;
  }

  .ops-map-toolbar {
    gap: 5px;
    padding: 6px;
    background:
      linear-gradient(180deg, rgba(8, 12, 11, 0.96), rgba(4, 7, 7, 0.92)),
      repeating-linear-gradient(90deg, rgba(232,222,190,0.045) 0 1px, transparent 1px 28px);
  }

  .ops-map-toolbar > div:first-child {
    display: grid;
    grid-template-columns: minmax(52px, auto) minmax(0, 1fr);
    gap: 7px;
    align-items: center;
    min-height: 24px;
    padding: 3px 6px;
    border: 1px solid rgba(232, 222, 190, 0.16);
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.035);
  }

  .ops-map-toolbar > div:first-child span {
    font-size: 9px;
  }

  .ops-map-toolbar > div:first-child strong {
    margin: 0;
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ops-map-toolbar .ops-pulse {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 3px;
  }

  .ops-map-toolbar .ops-pulse span,
  .ops-map-toolbar .ops-pulse strong {
    min-height: 24px;
    padding: 3px;
    justify-items: center;
    text-align: center;
  }

  .ops-map-toolbar .ops-pulse small {
    display: none;
  }

  .ops-map-toolbar .ops-pulse b,
  .ops-map-toolbar .ops-pulse strong {
    font-size: 9px;
    line-height: 1.05;
  }

  .ops-layer-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 3px;
  }

  .ops-layer-tabs .layer-switch {
    min-height: 28px;
    grid-template-columns: 20px minmax(0, 1fr);
    grid-template-rows: 11px 11px;
    padding: 3px;
  }

  .ops-layer-tabs .layer-switch b {
    grid-row: 1 / 3;
    width: 18px;
    height: 18px;
    font-size: 7px;
  }

  .ops-layer-tabs .layer-switch span {
    font-size: 8px;
  }

  .ops-layer-tabs .layer-switch small {
    display: none;
  }

  .ops-wargame-map {
    min-height: 500px;
  }
}

@media (max-width: 430px) {
  .ops-map-stage {
    grid-template-rows: auto minmax(490px, 60vh) auto;
  }

  .ops-wargame-map {
    min-height: 490px;
  }

  .ops-map-toolbar .ops-pulse b,
  .ops-map-toolbar .ops-pulse strong {
    font-size: 8px;
  }
}

/* v42: mobile staff and execution rooms should still feel like command posts.
   Collapse the campaign sidebar and move the tactical map ahead of long panels. */
@media (max-width: 760px) {
  .app-shell {
    display: flex;
    flex-direction: column;
    background:
      linear-gradient(180deg, rgba(3, 6, 6, 0.96), rgba(8, 12, 12, 0.92)),
      url("./assets/images/generated/wargame-map.png");
    background-size: cover;
    background-position: center;
  }

  .app-shell .sidebar {
    position: relative;
    top: auto;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(126px, 0.72fr) minmax(0, 1fr);
    gap: 8px;
    padding: 8px;
    border-right: 0;
    border-bottom: 1px solid rgba(232, 222, 190, 0.2);
    background:
      linear-gradient(90deg, rgba(4, 7, 7, 0.96), rgba(10, 14, 12, 0.88));
  }

  .app-shell .brand {
    min-width: 0;
    gap: 8px;
  }

  .app-shell .brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    font-size: 16px;
  }

  .app-shell .brand h1 {
    margin: 0;
    font-size: 14px;
    line-height: 1.05;
  }

  .app-shell .brand p {
    display: -webkit-box;
    margin: 2px 0 0;
    overflow: hidden;
    font-size: 9px;
    line-height: 1.2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .app-shell .level-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 0;
    overflow: visible;
  }

  .app-shell .level-button {
    min-height: 42px;
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: center;
    justify-items: stretch;
    gap: 6px;
    padding: 5px 6px;
    border-radius: 4px;
    text-align: left;
  }

  .app-shell .level-num {
    width: 22px;
    height: 22px;
    border-radius: 3px;
    font-size: 11px;
  }

  .app-shell .level-button span:nth-child(2) {
    display: block;
    min-width: 0;
  }

  .app-shell .level-button strong {
    display: block;
    overflow: hidden;
    font-size: 9px;
    line-height: 1.08;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .app-shell .level-button small,
  .app-shell .level-state,
  .app-shell .sidebar-footer {
    display: none;
  }

  .app-shell .main-panel {
    padding: 8px;
  }

  .app-shell .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
    margin-bottom: 5px;
    padding: 6px;
    border: 1px solid rgba(232, 222, 190, 0.16);
    border-radius: 4px;
    background: rgba(5, 8, 8, 0.82);
  }

  .app-shell .topbar .eyebrow {
    margin-bottom: 2px;
    font-size: 8px;
  }

  .app-shell .topbar h2 {
    margin-bottom: 2px;
    font-size: 16px;
    line-height: 1.08;
  }

  .app-shell .topbar p {
    display: -webkit-box;
    overflow: hidden;
    font-size: 11px;
    line-height: 1.24;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
  }

  .app-shell .topbar-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
  }

  .app-shell .metric,
  .app-shell .toggle,
  .app-shell .topbar-metrics button {
    min-width: 0;
    min-height: 30px;
    padding: 3px;
    border-radius: 3px;
    text-align: center;
  }

  .app-shell .metric span,
  .app-shell .toggle span {
    font-size: 8px;
  }

  .app-shell .metric strong {
    font-size: 15px;
  }

  .app-shell .toggle {
    justify-content: center;
  }

  .app-shell .toggle input {
    display: none;
  }

  .app-shell .stage-nav {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 3px;
    margin-bottom: 6px;
  }

  .app-shell .stage-nav button {
    min-height: 30px;
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 4px 2px;
    overflow: hidden;
    border-radius: 3px;
    font-size: 0;
  }

  .app-shell .stage-nav button span {
    width: 20px;
    height: 20px;
    margin: 0;
    font-size: 10px;
  }

  .stage-card.ai,
  .stage-card.action {
    padding: 8px;
  }

  .stage-card.ai .staff-room,
  .stage-card.action .execution-room {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .stage-card.ai .staff-map-panel,
  .stage-card.action .execution-map {
    order: 1;
    grid-template-rows: auto minmax(440px, 56vh) auto;
    border-color: rgba(232, 222, 190, 0.28);
    box-shadow:
      0 0 0 1px rgba(232, 222, 190, 0.08),
      0 16px 44px rgba(0, 0, 0, 0.4);
  }

  .stage-card.ai .staff-proposals,
  .stage-card.action .execution-orders {
    order: 2;
  }

  .stage-card.ai .staff-evidence,
  .stage-card.action .execution-writeback {
    order: 3;
  }

  .staff-map-header {
    min-height: 44px;
    padding: 7px 9px;
  }

  .staff-map-header strong {
    font-size: 13px;
  }

  .staff-grade {
    min-width: 48px;
    padding: 4px 6px;
  }

  .staff-grade strong {
    font-size: 17px;
  }

  .staff-war-map,
  .execution-war-map {
    min-height: 440px;
  }

  .staff-context-chain {
    left: 8px;
    right: 8px;
    bottom: 8px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
  }

  .staff-context-chain span {
    min-height: 28px;
    padding: 3px;
    font-size: 9px;
    text-align: center;
  }

  .staff-verdict {
    top: 8px;
    right: 8px;
    padding: 5px 7px;
    font-size: 10px;
  }
}

@media (max-width: 430px) {
  .app-shell .sidebar {
    grid-template-columns: minmax(114px, 0.68fr) minmax(0, 1fr);
  }

  .app-shell .brand h1 {
    font-size: 13px;
  }

  .app-shell .topbar-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stage-card.ai .staff-map-panel,
  .stage-card.action .execution-map {
    grid-template-rows: auto minmax(420px, 54vh) auto;
  }

  .staff-war-map,
  .execution-war-map {
    min-height: 420px;
  }
}

/* v43: mobile replay pass. The final learning loop should land as a verdict
   table with the battlefield visible immediately, not as a long report header. */
@media (max-width: 760px) {
  .stage-card.replay {
    padding: 8px;
  }

  .stage-card.replay .battle-layout {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .stage-card.replay .battle-board {
    display: grid;
    grid-template-rows: auto minmax(440px, 56vh) auto;
    gap: 8px;
    order: 1;
  }

  .stage-card.replay .battle-header {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(132px, 1fr);
    gap: 7px;
    align-items: stretch;
    margin: 0;
    padding: 7px;
    border-radius: 4px;
    background:
      linear-gradient(135deg, rgba(8, 12, 11, 0.96), rgba(16, 22, 17, 0.88)),
      radial-gradient(circle at 82% 12%, rgba(143, 227, 136, 0.18), transparent 32%);
  }

  .stage-card.replay .battle-kicker {
    font-size: 8px;
  }

  .stage-card.replay .battle-header h3 {
    margin: 2px 0;
    font-size: 18px;
    line-height: 1.05;
  }

  .stage-card.replay .battle-header p {
    display: -webkit-box;
    overflow: hidden;
    font-size: 10px;
    line-height: 1.25;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .stage-card.replay .battle-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  .stage-card.replay .battle-metric {
    min-width: 0;
    padding: 4px;
    border-radius: 3px;
  }

  .stage-card.replay .battle-metric span {
    display: block;
    overflow: hidden;
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .stage-card.replay .battle-metric strong {
    margin: 1px 0 3px;
    font-size: 13px;
    line-height: 1;
  }

  .stage-card.replay .battle-metric .bar {
    height: 4px;
  }

  .stage-card.replay .battle-sandbox {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 440px;
    height: auto;
    overflow: hidden;
    border-color: rgba(232, 222, 190, 0.28);
    box-shadow:
      0 0 0 1px rgba(232, 222, 190, 0.08),
      inset 0 -90px 120px rgba(4, 8, 14, 0.48),
      0 16px 44px rgba(0, 0, 0, 0.4);
  }

  .stage-card.replay .map-chip {
    max-width: 88px;
    overflow: hidden;
    padding: 3px 5px;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .stage-card.replay .unit-counter {
    width: 64px;
    min-height: 38px;
    grid-template-columns: 19px minmax(0, 1fr);
    gap: 4px;
    padding: 4px;
  }

  .stage-card.replay .unit-counter b {
    width: 19px;
    height: 19px;
    font-size: 9px;
  }

  .stage-card.replay .unit-counter span {
    overflow: hidden;
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .stage-card.replay .unit-counter.objective {
    transform: translate(-58%, -50%);
  }

  .stage-card.replay .battle-verdict {
    right: 8px;
    bottom: 8px;
    padding: 6px 8px;
    font-size: 11px;
  }

  .stage-card.replay .battle-command-bar {
    margin: 0;
    gap: 5px;
  }

  .stage-card.replay .battle-command-bar button {
    flex: 1 1 130px;
    min-height: 32px;
    padding: 5px 7px;
  }

  .stage-card.replay .battle-aar {
    order: 2;
    overflow: visible;
  }

  .stage-card.replay .battle-result-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 8px;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 4px;
  }

  .stage-card.replay .battle-result-card strong {
    margin: 0;
    font-size: 24px;
  }

  .stage-card.replay .battle-result-card p {
    grid-column: 1 / -1;
    font-size: 11px;
  }

  .stage-card.replay .phase-track,
  .stage-card.replay .causality-card,
  .stage-card.replay .battle-score-details {
    padding: 10px;
    border-radius: 4px;
  }
}

@media (max-width: 430px) {
  .stage-card.replay .battle-board {
    grid-template-rows: auto minmax(420px, 54vh) auto;
  }

  .stage-card.replay .battle-header {
    grid-template-columns: minmax(0, 1fr);
  }

  .stage-card.replay .battle-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .stage-card.replay .battle-sandbox {
    min-height: 420px;
  }
}

/* v54: replay focus feedback and mobile readability fixes. */
@media (max-width: 760px) {
  .stage-card.replay .map-chip {
    min-width: 86px;
    max-width: 112px;
    padding: 5px 7px;
    font-size: 10px;
    line-height: 1.18;
    white-space: normal;
    word-break: keep-all;
    text-overflow: clip;
  }

  .stage-card.replay .risk-zone {
    width: 132px;
    height: 88px;
    padding: 8px;
  }

  .stage-card.replay .risk-zone.secondary {
    width: 118px;
    height: 76px;
  }

  .stage-card.replay .risk-zone span {
    max-width: 88px;
    font-size: 10px;
    line-height: 1.2;
    white-space: normal;
    word-break: keep-all;
  }

  .stage-card.replay .unit-counter {
    width: 70px;
    min-height: 42px;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 4px;
    padding: 5px;
  }

  .stage-card.replay .unit-counter span {
    font-size: 9px;
    line-height: 1.15;
    white-space: normal;
    word-break: keep-all;
    text-overflow: clip;
  }

  .stage-card.replay .replay-focus-card {
    padding: 10px;
    gap: 5px;
  }

  .stage-card.replay .replay-focus-card strong {
    font-size: 18px;
  }
}

@media (max-width: 430px) {
  .stage-card.replay .battle-header {
    gap: 10px;
  }

  .stage-card.replay .battle-console,
  .stage-card.replay .replay-console {
    gap: 8px;
  }

  .stage-card.replay .replay-console-readout {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .stage-card.replay .replay-console-readout span {
    min-height: 48px;
    grid-template-rows: 18px minmax(18px, auto);
  }

  .stage-card.replay .replay-console-readout small {
    font-size: 10px;
    line-height: 1.15;
    white-space: normal;
    word-break: keep-all;
  }

  .stage-card.replay .replay-key {
    min-height: 42px;
    grid-template-rows: 16px minmax(16px, auto);
    padding: 6px 8px;
  }

  .stage-card.replay .replay-key b {
    font-size: 10px;
  }

  .stage-card.replay .replay-key span {
    font-size: 10px;
    line-height: 1.15;
    white-space: normal;
    word-break: keep-all;
  }

  .ops-level-jump {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .ops-level-jump button {
    width: 100%;
    height: auto;
    min-height: 36px;
    padding: 5px 4px;
    line-height: 1.05;
  }

  .ops-level-jump button::after {
    content: attr(data-short);
    display: block;
    margin-top: 2px;
    color: rgba(217, 232, 255, 0.72);
    font-size: 9px;
    font-weight: 700;
  }
}

/* v44: desktop command titleplate. Long level names should read like a stable
   operation title, not push outside the top bar on production viewports. */
@media (min-width: 1181px) {
  .ops-topbar {
    grid-template-columns: minmax(364px, 430px) minmax(0, 1fr) max-content;
  }

  .ops-brand {
    min-width: 0;
  }

  .ops-brand > div:last-child {
    min-width: 0;
    padding-left: 10px;
    border-left: 1px solid rgba(232, 222, 190, 0.22);
  }

  .ops-brand p {
    display: inline-grid;
    min-height: 15px;
    align-content: center;
    padding: 0 6px;
    border: 1px solid rgba(88, 198, 170, 0.24);
    border-radius: 2px;
    background: rgba(88, 198, 170, 0.08);
    color: #9fe0cd;
    font-size: 9px;
    letter-spacing: 0.12em;
  }

  .ops-brand h1 {
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    color: #f1e5c7;
    font-size: clamp(16px, 1.25vw, 19px);
    line-height: 1.05;
    text-overflow: ellipsis;
    text-shadow: 0 0 18px rgba(207, 174, 103, 0.18);
    white-space: nowrap;
  }
}

/* v45: compact desktop war-room. Keep 1024-1180px projection and narrow
   browser windows as a cockpit instead of falling back to a long mobile page. */
@media (min-width: 1024px) and (max-width: 1180px) {
  .ops-game-shell {
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    display: grid;
    grid-template-rows: 56px minmax(0, 1fr) 46px;
    overflow: hidden;
  }

  .ops-topbar,
  .ops-footer {
    width: 100%;
    max-width: none;
    min-width: 0;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .ops-topbar {
    display: grid;
    grid-template-columns: minmax(248px, 300px) minmax(0, 1fr) max-content;
    gap: 8px;
    align-items: center;
    padding: 6px 8px;
  }

  .ops-brand {
    min-width: 0;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
  }

  .ops-brand .brand-mark {
    width: 30px;
    height: 30px;
  }

  .ops-brand > div:last-child {
    min-width: 0;
  }

  .ops-brand p {
    margin: 0 0 2px;
    font-size: 9px;
    line-height: 1;
  }

  .ops-brand h1 {
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ops-turn-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 4px;
    min-width: 0;
  }

  .ops-turn-strip div {
    min-height: 34px;
    padding: 4px 5px 12px;
  }

  .ops-turn-strip span {
    font-size: 8px;
  }

  .ops-turn-strip strong {
    overflow: hidden;
    font-size: 10px;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ops-turn-strip div small {
    right: 5px;
    bottom: 3px;
    font-size: 7px;
  }

  .ops-system-buttons {
    min-width: 0;
    display: flex;
    flex-wrap: nowrap;
    gap: 5px;
    justify-content: end;
  }

  .ops-level-jump {
    display: grid;
    grid-template-columns: repeat(6, 22px);
    gap: 3px;
    padding: 3px;
    border-radius: 4px;
  }

  .ops-level-jump button {
    width: 22px;
    height: 28px;
    font-size: 10px;
  }

  .ops-control-pad {
    grid-template-columns: repeat(4, 34px);
    gap: 3px;
    padding: 3px;
  }

  .ops-control-pad button {
    width: 34px;
    min-height: 28px;
    grid-template-rows: 11px 10px;
    padding: 2px;
  }

  .ops-control-pad button b {
    font-size: 7px;
  }

  .ops-control-pad button span {
    font-size: 8px;
  }

  .ops-layout {
    width: 100%;
    max-width: none;
    height: auto;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(208px, 230px) minmax(0, 1fr) minmax(216px, 244px);
    gap: 6px;
    padding: 6px;
    overflow: hidden;
  }

  .ops-left-dock {
    grid-template-rows: minmax(74px, 0.48fr) minmax(118px, 0.76fr) minmax(112px, 0.7fr) 36px;
  }

  .ops-right-dock {
    grid-template-rows: minmax(94px, 0.6fr) minmax(178px, 1fr) minmax(126px, 0.66fr);
  }

  .ops-left-dock,
  .ops-right-dock {
    min-height: 0;
    gap: 6px;
    align-content: stretch;
    overflow: hidden;
    padding-right: 0;
  }

  .ops-brief-card,
  .ops-registry,
  .ops-doctrine,
  .ops-mission-board,
  .ops-intel-board,
  .ops-object-board,
  .ops-after-action {
    min-height: 0;
    padding: 7px;
    overflow: hidden;
  }

  .ops-brief-card {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 4px;
  }

  .ops-brief-card h2 {
    margin: 2px 0;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.08;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ops-brief-card p,
  .ops-doctrine p,
  .ops-command-deck p {
    display: -webkit-box;
    overflow: hidden;
    line-height: 1.25;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .objective-meter {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    margin-top: 2px;
  }

  .objective-meter div {
    min-height: 34px;
    min-width: 0;
    padding: 4px;
  }

  .objective-meter span {
    font-size: 8px;
  }

  .objective-meter strong {
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
  }

  .objective-meter div strong,
  .objective-meter div span {
    min-width: 0;
    max-width: 100%;
  }

  .panel-title {
    min-height: 17px;
    margin-bottom: 5px;
  }

  .panel-title span {
    font-size: 8px;
  }

  .panel-title strong {
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mission-objectives,
  .ops-registry,
  .ops-intel-board .inspector-card,
  .ops-object-board .object-detail,
  .ops-after-action .ops-decision-board {
    min-height: 0;
    overflow: hidden;
  }

  .mission-objective {
    min-height: 28px;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 4px;
    padding: 3px 4px;
  }

  .mission-objective i {
    width: 16px;
    height: 16px;
    font-size: 8px;
  }

  .mission-objective strong,
  .mission-objective small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mission-objective strong {
    font-size: 9px;
  }

  .mission-objective small {
    font-size: 8px;
  }

  .ops-registry .mini-object {
    min-height: 31px;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 4px;
    padding: 3px 4px;
  }

  .ops-registry .mini-object span {
    width: 22px;
    height: 22px;
    font-size: 11px;
  }

  .ops-registry .mini-object strong,
  .ops-registry .mini-object small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ops-registry .mini-object strong {
    font-size: 9px;
  }

  .ops-registry .mini-object small {
    font-size: 8px;
  }

  .ops-doctrine {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: center;
  }

  .ops-doctrine .panel-title,
  .ops-doctrine p,
  .ops-doctrine .tutorial-controls {
    display: none;
  }

  .doctrine-step {
    min-width: 0;
    margin: 0;
    padding: 5px 6px;
    overflow: hidden;
    font-size: 9px;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ops-map-stage {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: 38px minmax(0, 1fr) 92px;
    overflow: hidden;
  }

  .ops-map-toolbar {
    min-width: 0;
    min-height: 38px;
    display: grid;
    grid-template-columns: minmax(82px, 0.5fr) minmax(138px, 0.82fr) minmax(162px, 0.82fr);
    gap: 5px;
    padding: 4px 6px;
    overflow: hidden;
  }

  .ops-map-toolbar > div:first-child strong {
    display: none;
  }

  .ops-map-toolbar .ops-pulse {
    min-width: 0;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 3px;
  }

  .ops-map-toolbar .ops-pulse span,
  .ops-map-toolbar .ops-pulse strong {
    min-height: 26px;
    padding: 2px 3px;
  }

  .ops-map-toolbar .ops-pulse small {
    display: none;
  }

  .ops-map-toolbar .ops-pulse span {
    font-size: 0;
  }

  .ops-map-toolbar .ops-pulse b,
  .ops-map-toolbar .ops-pulse strong {
    font-size: 10px;
  }

  .ops-layer-tabs {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 3px;
  }

  .ops-layer-tabs .layer-switch,
  .ops-layer-tabs button {
    min-width: 0;
    min-height: 28px;
    padding: 2px 3px;
  }

  .ops-layer-tabs .layer-switch small {
    display: none;
  }

  .ops-layer-tabs .layer-switch {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    justify-items: center;
    text-align: center;
  }

  .ops-layer-tabs .layer-switch b {
    grid-row: auto;
    width: 100%;
    height: 20px;
  }

  .ops-layer-tabs .layer-switch span {
    display: none;
  }

  .ops-layer-tabs .layer-switch b,
  .ops-layer-tabs .layer-switch span {
    font-size: 8px;
  }

  .ops-wargame-map {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 0;
    height: auto;
  }

  .war-counter {
    width: 36px;
    min-height: 32px;
    padding: 2px;
  }

  .war-counter b {
    width: 20px;
    height: 17px;
    font-size: 10px;
  }

  .war-counter span,
  .war-counter small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .war-counter span {
    max-width: 30px;
    font-size: 0;
  }

  .war-counter span::first-letter {
    font-size: 8px;
  }

  .war-counter small {
    display: none;
  }

  .object-node {
    width: 38px;
    min-width: 38px;
    max-width: 38px;
    min-height: 34px;
    grid-template-columns: 1fr;
    place-items: center;
    padding: 3px;
  }

  .object-node span {
    width: 22px;
    height: 22px;
    font-size: 10px;
  }

  .object-node strong {
    display: none;
  }

  .object-node small {
    display: none;
  }

  .map-chip {
    max-width: 82px;
    padding: 3px 5px;
    overflow: hidden;
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .map-status-board {
    width: 176px;
    bottom: 34px;
    padding: 7px;
  }

  .tactical-readout {
    left: 8px;
    right: 8px;
    bottom: 8px;
    gap: 4px;
  }

  .tactical-readout div {
    min-height: 30px;
    padding: 4px;
  }

  .ops-command-deck {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(108px, 144px) minmax(0, 1fr);
    gap: 5px;
    padding: 6px;
    overflow: hidden;
  }

  .ops-command-cards {
    min-width: 0;
    gap: 4px;
  }

  .ops-command-cards button.command-card,
  .ops-command-cards button.command-card.locked {
    min-height: 74px;
    max-height: 78px;
    padding: 5px;
  }

  .ops-command-cards button.command-card .command-route,
  .ops-command-cards button.command-card .command-signals {
    gap: 3px;
  }

  .ops-command-cards button.command-card .command-signals em {
    min-height: 16px;
    padding: 2px 3px;
  }

  .ops-command-cards button.command-card .command-signals em span {
    display: none;
  }

  .ops-command-cards button.command-card .command-route,
  .ops-command-cards button.command-card.locked .command-route {
    display: none;
  }

  .ops-intel-board,
  .ops-object-board {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .ops-object-board .object-detail {
    grid-template-rows: auto auto auto minmax(0, 1fr) auto minmax(62px, 0.64fr);
    overflow: auto;
  }

  .ops-intel-board .inspector-card > p,
  .ops-right-dock .inspector-card p,
  .ops-right-dock .sample-data code,
  .ops-after-action p {
    display: -webkit-box;
    overflow: hidden;
    line-height: 1.25;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .ops-after-action .ops-decision-board {
    gap: 5px;
  }

  .ops-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(136px, 180px) max-content;
    gap: 6px;
    align-items: center;
    padding: 5px 8px;
  }

  .ops-radio-feed {
    min-width: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }

  .ops-radio-feed span {
    min-width: 0;
    grid-template-columns: 26px minmax(0, 1fr);
    grid-template-rows: 11px 11px;
    padding: 3px 4px;
  }

  .ops-radio-feed b {
    min-height: 22px;
    font-size: 8px;
  }

  .ops-radio-feed strong {
    font-size: 9px;
  }

  .ops-radio-feed small {
    font-size: 8px;
  }

  .ops-history-line {
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    overflow: hidden;
  }

  .ops-history-line span {
    min-width: 0;
    max-width: 100%;
    display: block;
    overflow: hidden;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ops-history-line strong {
    min-width: 36px;
    padding: 3px 4px;
    font-size: 8px;
  }

  .ops-history-line strong:last-child {
    display: none;
  }

  .footer-actions {
    min-width: 0;
    flex-wrap: nowrap;
    gap: 4px;
  }

  .ops-footer button {
    min-height: 28px;
    padding: 4px 6px;
    font-size: 10px;
  }

  .app-shell {
    height: 100vh;
    grid-template-columns: 232px minmax(0, 1fr);
    overflow: hidden;
  }

  .app-shell .sidebar {
    position: relative;
    min-height: 0;
    height: 100vh;
    overflow: hidden;
  }

  .app-shell .brand {
    min-height: 44px;
    padding: 6px;
  }

  .app-shell .brand p {
    -webkit-line-clamp: 1;
  }

  .app-shell .level-list {
    grid-template-columns: 1fr;
    gap: 5px;
    overflow: hidden;
    padding-right: 0;
  }

  .app-shell .level-button {
    min-height: 42px;
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 6px;
    padding: 6px;
    overflow: hidden;
  }

  .app-shell .level-button span:nth-child(2) {
    min-width: 0;
    overflow: hidden;
  }

  .app-shell .level-button .level-num {
    width: 24px;
    height: 24px;
    font-size: 10px;
  }

  .app-shell .level-button small,
  .app-shell .level-state {
    display: none;
  }

  .app-shell .level-button strong {
    font-size: 10px;
    line-height: 1.1;
    max-width: 100%;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .app-shell .level-button:nth-child(3) strong,
  .app-shell .level-button:nth-child(4) strong {
    max-width: 8.5em;
  }

  .app-shell .main-panel {
    min-height: 0;
    height: 100vh;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    overflow: hidden;
  }

  .app-shell .topbar,
  .app-shell .stage-nav,
  .app-shell .stage-card {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .app-shell .topbar {
    min-height: 62px;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.75fr);
    gap: 8px;
    margin-bottom: 6px;
    padding: 8px;
  }

  .app-shell .topbar p {
    -webkit-line-clamp: 1;
  }

  .app-shell .topbar-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  .app-shell .stage-nav {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
    margin-bottom: 6px;
  }

  .app-shell .stage-nav button {
    min-height: 32px;
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 4px;
    font-size: 0;
  }

  .app-shell .stage-nav button span {
    display: grid;
    width: 20px;
    height: 20px;
    margin: 0;
    font-size: 10px;
  }

  .stage-card.ai,
  .stage-card.action,
  .stage-card.replay {
    min-height: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 6px;
    padding: 8px;
  }

  .stage-card.ai .staff-room,
  .stage-card.action .execution-room {
    min-height: 0;
    height: auto;
    display: grid;
    grid-template-columns: minmax(210px, 0.9fr) minmax(238px, 1fr) minmax(190px, 0.72fr);
    gap: 8px;
    overflow: hidden;
  }

  .staff-map-header {
    min-height: 42px;
    padding: 6px 8px;
  }

  .staff-map-header strong {
    max-width: 100%;
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .staff-grade {
    min-width: 42px;
    padding: 4px 5px;
  }

  .staff-grade strong {
    font-size: 16px;
  }

  .stage-card.replay .battle-layout {
    min-height: 0;
    height: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(224px, 260px);
    gap: 8px;
    overflow: hidden;
  }

  .staff-map-panel,
  .execution-map {
    min-height: 0;
    grid-template-rows: 42px minmax(0, 1fr) auto;
  }

  .staff-war-map,
  .execution-war-map,
  .battle-sandbox {
    min-height: 0;
  }

  .staff-proposals,
  .staff-evidence,
  .execution-orders,
  .execution-writeback,
  .battle-aar {
    min-height: 0;
    overflow: auto;
  }

  .battle-board {
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .battle-header {
    min-height: 64px;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 0.72fr);
    padding: 8px;
  }

  .battle-header h3 {
    font-size: 22px;
  }

  .battle-command-bar {
    min-width: 0;
    flex-wrap: nowrap;
    gap: 5px;
  }

  .battle-command-bar button,
  .replay-actions button,
  .stage-controls button {
    min-width: 0;
    min-height: 30px;
    padding: 5px 7px;
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* v45 follow-up: narrow cockpit lanes should show short tactical readouts,
   leaving long explanations to titles and later panels. */
@media (min-width: 1024px) and (max-width: 1180px) {
  .tactical-readout small {
    display: none;
  }

  .tactical-readout span,
  .tactical-readout strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .app-shell .level-button:nth-child(3) strong,
  .app-shell .level-button:nth-child(4) strong {
    max-width: 100%;
  }

  .map-status-board strong,
  .map-status-board span,
  .decision-stack span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .map-status-board strong {
    font-size: 11px;
  }
}

@media (max-height: 760px) and (min-width: 1181px) {
  .ops-command-cards button.command-card .command-signals em span {
    display: none;
  }

  .ops-command-cards button.command-card .command-signals em b {
    font-size: 9px;
  }
}

/* v46: make the final replay controls read like an operations replay console. */
.replay-console {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(4, minmax(58px, 82px));
  align-items: stretch;
  gap: 6px;
  min-width: 0;
  margin-top: 8px;
  padding: 6px;
  border: 1px solid rgba(126, 201, 255, 0.28);
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(6, 16, 28, 0.92), rgba(8, 21, 31, 0.78)),
    repeating-linear-gradient(90deg, rgba(126, 201, 255, 0.08) 0 1px, transparent 1px 24px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.replay-console-readout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  min-width: 0;
}

.replay-console-readout span {
  display: grid;
  grid-template-rows: 16px 12px;
  align-content: center;
  min-width: 0;
  min-height: 34px;
  padding: 4px 6px;
  border: 1px solid rgba(126, 201, 255, 0.2);
  border-radius: 3px;
  background: rgba(7, 17, 25, 0.78);
}

.replay-console-readout b,
.replay-console-readout small,
.replay-key b,
.replay-key span {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.replay-console-readout b {
  color: #d9f0ff;
  font-size: 11px;
  line-height: 1;
}

.replay-console-readout small {
  color: rgba(214, 231, 236, 0.74);
  font-size: 10px;
  line-height: 1.1;
}

.replay-key {
  display: grid;
  grid-template-rows: 14px 12px;
  place-items: center;
  min-width: 0;
  min-height: 34px;
  padding: 4px 5px;
  border-radius: 3px;
  border-color: rgba(126, 201, 255, 0.32);
  background:
    linear-gradient(180deg, rgba(15, 35, 48, 0.94), rgba(8, 20, 29, 0.94)),
    linear-gradient(90deg, rgba(126, 201, 255, 0.08), transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.replay-key.primary {
  border-color: rgba(112, 229, 174, 0.5);
  background:
    linear-gradient(180deg, rgba(31, 79, 65, 0.95), rgba(10, 42, 35, 0.95)),
    linear-gradient(90deg, rgba(112, 229, 174, 0.16), transparent);
}

.replay-key b {
  color: #eef9ff;
  font-size: 9px;
  letter-spacing: 0;
  line-height: 1;
}

.replay-key span {
  color: rgba(229, 241, 239, 0.78);
  font-size: 10px;
  line-height: 1;
}

.replay-console.armed .replay-console-readout span:first-child {
  border-color: rgba(112, 229, 174, 0.55);
  background: rgba(17, 52, 43, 0.88);
  box-shadow: inset 3px 0 0 rgba(112, 229, 174, 0.72);
}

@media (max-width: 760px) {
  .stage-card.replay .replay-console {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 6px;
  }

  .stage-card.replay .replay-console-readout {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stage-card.replay .replay-key {
    min-height: 32px;
    grid-template-rows: 13px 12px;
  }
}

@media (min-width: 1024px) and (max-width: 1180px) {
  .replay-console {
    grid-template-columns: minmax(180px, 1fr) repeat(4, minmax(48px, 64px));
    gap: 5px;
  }

  .replay-console-readout span {
    min-height: 30px;
    padding: 3px 4px;
  }

  .replay-key {
    min-height: 30px;
    padding: 3px 4px;
  }

  .replay-key span {
    font-size: 9px;
  }

  .stage-card.replay .battle-header p {
    display: none;
  }
}

/* v47: tighten the replay page into an AAR console. The verdict should read
   like a tactical replay station, with the map owning the stage. */
@media (min-width: 761px) {
  .stage-card.replay .battle-layout {
    min-height: 0;
    height: 100%;
    grid-template-columns: minmax(0, 1fr) minmax(236px, 276px);
    align-items: stretch;
  }

  .stage-card.replay .battle-board {
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 8px;
  }

  .stage-card.replay .battle-header {
    min-height: 0;
    grid-template-columns: minmax(136px, 0.44fr) minmax(0, 1fr);
    gap: 8px;
    align-items: stretch;
    margin: 0;
    padding: 8px;
    border-radius: 4px;
    background:
      linear-gradient(135deg, rgba(6, 13, 20, 0.96), rgba(13, 25, 31, 0.9)),
      repeating-linear-gradient(90deg, rgba(126, 201, 255, 0.07) 0 1px, transparent 1px 26px);
  }

  .stage-card.replay .battle-kicker {
    display: inline-grid;
    min-height: 16px;
    align-content: center;
    padding: 0 6px;
    border: 1px solid rgba(126, 201, 255, 0.26);
    border-radius: 3px;
    color: rgba(178, 225, 255, 0.86);
    font-size: 8px;
  }

  .stage-card.replay .battle-header h3 {
    margin: 5px 0 0;
    overflow: hidden;
    font-size: 19px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .stage-card.replay .battle-header p {
    display: none;
  }

  .stage-card.replay .battle-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  .stage-card.replay .battle-metric {
    min-width: 0;
    padding: 5px 6px;
    border-radius: 3px;
    background: rgba(7, 17, 25, 0.72);
  }

  .stage-card.replay .battle-metric span,
  .stage-card.replay .battle-metric strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .stage-card.replay .battle-metric span {
    font-size: 8px;
  }

  .stage-card.replay .battle-metric strong {
    margin: 2px 0 4px;
    min-height: 18px;
    font-size: 14px;
    line-height: 1.18;
  }

  .stage-card.replay .battle-metric .bar {
    height: 4px;
  }

  .stage-card.replay .battle-sandbox {
    min-height: 0;
    height: 100%;
    border-radius: 4px;
  }

  .stage-card.replay .battle-aar {
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) minmax(88px, auto) auto auto;
    gap: 8px;
    overflow: hidden;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .stage-card.replay .battle-result-card,
  .stage-card.replay .phase-track,
  .stage-card.replay .causality-card,
  .stage-card.replay .battle-score-details {
    border-radius: 4px;
    background:
      linear-gradient(180deg, rgba(8, 18, 28, 0.9), rgba(8, 14, 21, 0.74)),
      repeating-linear-gradient(90deg, rgba(126, 201, 255, 0.05) 0 1px, transparent 1px 22px);
  }

  .stage-card.replay .battle-result-card {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 8px;
    align-items: center;
    margin: 0;
    padding: 9px;
  }

  .stage-card.replay .battle-result-card span {
    font-size: 8px;
  }

  .stage-card.replay .battle-result-card strong {
    margin: 0;
    overflow: hidden;
    min-height: 22px;
    font-size: 19px;
    line-height: 1.16;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .stage-card.replay .battle-result-card p {
    grid-column: 1 / -1;
    margin: 0;
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .stage-card.replay .phase-track {
    min-height: 0;
    overflow: auto;
    padding: 9px;
  }

  .stage-card.replay .phase-track h3,
  .stage-card.replay .causality-card h3 {
    margin-bottom: 6px;
    color: rgba(178, 225, 255, 0.86);
    font-size: 10px;
    letter-spacing: 0;
  }

  .stage-card.replay .battle-event {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 7px;
    padding: 7px;
    border-radius: 3px;
  }

  .stage-card.replay .battle-event strong,
  .stage-card.replay .battle-event p {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .stage-card.replay .battle-event strong {
    white-space: nowrap;
  }

  .stage-card.replay .battle-event p {
    display: -webkit-box;
    margin: 2px 0 0;
    line-height: 1.25;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .stage-card.replay .causality-card {
    min-height: 0;
    max-height: 136px;
    overflow: hidden;
    padding: 9px;
  }

  .stage-card.replay .causality-card > p,
  .stage-card.replay .causality-card .check-list li,
  .stage-card.replay .causality-card .small-note {
    display: -webkit-box;
    overflow: hidden;
    line-height: 1.25;
    -webkit-box-orient: vertical;
  }

  .stage-card.replay .causality-card > p {
    margin-bottom: 6px;
    -webkit-line-clamp: 1;
  }

  .stage-card.replay .causality-card .check-list {
    gap: 5px;
    margin: 0 0 6px;
  }

  .stage-card.replay .causality-card .check-list li {
    padding-left: 15px;
    font-size: 10px;
    -webkit-line-clamp: 1;
  }

  .stage-card.replay .causality-card .check-list li::before {
    width: 7px;
    height: 7px;
    top: 5px;
  }

  .stage-card.replay .ontology-causal-chain {
    display: none;
  }

  .stage-card.replay .causality-card .small-note {
    margin: 0;
    font-size: 9px;
    -webkit-line-clamp: 1;
  }

  .stage-card.replay .battle-score-details {
    min-height: 0;
    max-height: 32px;
    overflow: hidden;
    padding: 7px 9px;
  }

  .stage-card.replay .battle-score-details[open] {
    max-height: 176px;
    overflow: auto;
  }

  .stage-card.replay .battle-score-details summary {
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .stage-card.replay .replay-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin: 0;
  }

  .stage-card.replay .replay-actions button {
    min-width: 0;
    min-height: 30px;
    padding: 5px 6px;
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* v48: make the sandbox opener map-led instead of panel-led. The learning
   controls stay available, but the first read is the theater map. */
@media (min-width: 1181px) {
  .ops-game-shell {
    grid-template-rows: 66px minmax(0, 1fr) 54px;
  }

  .ops-topbar {
    grid-template-columns: minmax(330px, 430px) minmax(0, 1fr) max-content;
    gap: 10px;
    padding: 8px 12px;
  }

  .ops-footer {
    grid-template-columns: minmax(0, 1fr) minmax(210px, 260px) max-content;
    gap: 8px;
    padding: 6px 12px;
  }

  .ops-layout {
    height: calc(100vh - 120px);
    grid-template-columns: minmax(182px, 194px) minmax(0, 1fr) minmax(194px, 208px);
    gap: 6px;
    padding: 8px;
  }

  .ops-left-dock,
  .ops-right-dock {
    gap: 8px;
    overflow: hidden;
    padding-right: 0;
  }

  .ops-left-dock {
    grid-template-rows: 84px minmax(122px, 0.74fr) minmax(110px, 0.62fr) 34px;
  }

  .ops-right-dock {
    grid-template-rows: minmax(128px, 0.78fr) minmax(154px, 0.92fr) minmax(98px, 0.56fr);
  }

  .ops-brief-card,
  .ops-registry,
  .ops-doctrine,
  .ops-mission-board,
  .ops-intel-board,
  .ops-object-board,
  .ops-after-action {
    min-height: 0;
    overflow: hidden;
    padding: 7px;
    border-radius: 4px;
  }

  .ops-brief-card {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 4px;
  }

  .ops-brief-card > span {
    font-size: 8px;
  }

  .ops-brief-card h2 {
    margin: 0;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ops-brief-card p,
  .ops-doctrine p,
  .ops-command-deck p,
  .ops-right-dock .inspector-card p,
  .ops-right-dock .sample-data code {
    display: -webkit-box;
    overflow: hidden;
    line-height: 1.25;
    -webkit-box-orient: vertical;
  }

  .ops-brief-card p,
  .ops-doctrine p {
    margin: 0;
    font-size: 9px;
    -webkit-line-clamp: 1;
  }

  .objective-meter {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    margin-top: 0;
  }

  .objective-meter div {
    min-height: 28px;
    padding: 3px;
    border-radius: 3px;
  }

  .objective-meter span,
  .objective-meter strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .objective-meter span {
    font-size: 8px;
  }

  .objective-meter strong {
    margin-top: 1px;
    font-size: 11px;
    line-height: 1.05;
  }

  .panel-title {
    min-height: 17px;
    margin-bottom: 5px;
  }

  .panel-title span {
    font-size: 8px;
  }

  .panel-title strong {
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mission-objectives,
  .ops-registry,
  .ops-intel-board .inspector-card,
  .ops-object-board .object-detail,
  .ops-after-action .ops-decision-board {
    min-height: 0;
    overflow: hidden;
  }

  .mission-objective {
    min-height: 27px;
    grid-template-columns: 16px minmax(0, 1fr);
    gap: 3px;
    padding: 2px 4px;
    border-radius: 3px;
  }

  .mission-objective i {
    width: 14px;
    height: 14px;
    font-size: 7px;
  }

  .mission-objective strong,
  .mission-objective small,
  .mission-objective em {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mission-objective strong {
    font-size: 8px;
  }

  .mission-objective small,
  .mission-objective em {
    font-size: 6px;
  }

  .mission-objective.mechanic-row small {
    display: none;
  }

  .ops-registry .mini-object {
    min-height: 29px;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 4px;
    padding: 3px;
    border-radius: 3px;
  }

  .ops-registry .mini-object span {
    width: 20px;
    height: 20px;
    font-size: 10px;
  }

  .ops-registry .mini-object strong,
  .ops-registry .mini-object small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ops-registry .mini-object strong {
    font-size: 8px;
  }

  .ops-registry .mini-object small {
    font-size: 7px;
  }

  .ops-doctrine {
    display: grid;
    align-content: center;
  }

  .ops-doctrine .panel-title,
  .ops-doctrine p,
  .ops-doctrine .tutorial-controls {
    display: none;
  }

  .doctrine-step {
    margin: 0;
    padding: 6px 7px;
    overflow: hidden;
    border-radius: 3px;
    font-size: 9px;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ops-map-stage {
    grid-template-rows: 42px minmax(0, 1fr) 110px;
    border-radius: 4px;
  }

  .ops-map-toolbar {
    min-width: 0;
    min-height: 42px;
    display: grid;
    grid-template-columns: minmax(72px, 0.3fr) minmax(166px, 0.82fr) minmax(210px, 0.86fr);
    gap: 5px;
    padding: 4px 7px;
    overflow: hidden;
  }

  .ops-map-toolbar > div:first-child {
    min-width: 0;
  }

  .ops-map-toolbar strong {
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ops-map-toolbar > div:first-child strong {
    display: none;
  }

  .ops-map-toolbar .ops-pulse {
    min-width: 0;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
  }

  .ops-map-toolbar .ops-pulse span,
  .ops-map-toolbar .ops-pulse strong {
    min-height: 28px;
    padding: 3px 4px;
  }

  .ops-map-toolbar .ops-pulse small {
    display: none;
  }

  .ops-layer-tabs {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
  }

  .ops-layer-tabs .layer-switch,
  .ops-layer-tabs button {
    min-width: 0;
    min-height: 30px;
    padding: 2px 4px;
    border-radius: 3px;
  }

  .ops-layer-tabs .layer-switch small,
  .ops-layer-tabs .layer-switch span {
    display: none;
  }

  .ops-layer-tabs .layer-switch {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .ops-layer-tabs .layer-switch b {
    width: 100%;
    height: 21px;
    font-size: 9px;
  }

  .ops-wargame-map {
    min-width: 0;
    min-height: 0;
    border-radius: 0;
  }

  .ops-map-legend {
    left: 9px;
    top: 9px;
    gap: 5px;
    padding: 5px 7px;
    border-radius: 3px;
  }

  .ops-map-legend span {
    font-size: 9px;
  }

  .intel-contact {
    width: 86px;
    min-height: 48px;
    padding: 5px 6px;
    border-radius: 3px;
  }

  .intel-contact span,
  .intel-contact i {
    font-size: 8px;
  }

  .intel-contact strong {
    overflow: hidden;
    font-size: 10px;
    line-height: 1.08;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .war-counter {
    width: 52px;
    min-height: 34px;
    grid-template-columns: 19px minmax(0, 1fr);
    gap: 4px;
    padding: 3px;
  }

  .war-counter b {
    width: 19px;
    height: 19px;
    font-size: 9px;
  }

  .war-counter span,
  .war-counter small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .war-counter span {
    max-width: 25px;
    font-size: 0;
  }

  .war-counter span::first-letter {
    font-size: 8px;
  }

  .war-counter small {
    display: none;
  }

  .ops-risk-field {
    font-size: 9px;
  }

  .ops-command-deck {
    grid-template-columns: minmax(96px, 124px) minmax(0, 1fr);
    gap: 5px;
    padding: 6px;
  }

  .ops-command-deck strong {
    overflow: hidden;
    margin: 2px 0;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ops-command-deck p {
    margin: 0;
    font-size: 9px;
    -webkit-line-clamp: 2;
  }

  .ops-command-cards {
    gap: 6px;
  }

  .ops-command-cards button.command-card,
  .ops-command-cards button.command-card.locked {
    min-height: 76px;
    max-height: 82px;
    gap: 3px;
    padding: 5px;
    border-radius: 3px;
  }

  .ops-command-cards button.command-card .command-route {
    display: none;
  }

  .ops-command-cards button.command-card .command-signals {
    gap: 3px;
  }

  .ops-command-cards button.command-card .command-signals em {
    min-height: 15px;
    padding: 2px 3px;
  }

  .ops-command-cards button.command-card .command-signals em span {
    display: none;
  }

  .ops-command-cards button.command-card .command-signals em b {
    font-size: 9px;
  }

  .contact-queue-list {
    gap: 4px;
  }

  .contact-queue-list button {
    min-height: 32px;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 5px;
    padding: 4px;
    border-radius: 3px;
  }

  .contact-queue-list b {
    width: 20px;
    height: 20px;
    font-size: 9px;
  }

  .inspector-head {
    min-height: 16px;
  }

  .inspector-head span,
  .inspector-head strong {
    overflow: hidden;
    font-size: 9px;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .contact-queue-list span,
  .contact-queue-list small,
  .object-detail h3,
  .object-detail p,
  .ops-decision-board p,
  .ops-decision-board strong,
  .ops-decision-board span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .contact-queue-list small {
    max-width: 100%;
  }

  .ops-right-dock .inspector-card p,
  .ops-right-dock .sample-data code {
    -webkit-line-clamp: 1;
  }

  .object-readiness small,
  .attached-props .empty,
  .object-relations .relation-port small,
  .object-relations .relation-port i {
    display: none;
  }

  .object-readiness {
    gap: 4px;
  }

  .object-readiness div {
    min-height: 24px;
  }

  .object-readiness span,
  .object-readiness strong {
    line-height: 1.1;
  }

  .ops-after-action .ops-decision-board {
    gap: 5px;
  }

  .ops-radio-feed {
    min-width: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .ops-radio-feed span {
    min-width: 0;
    grid-template-columns: 28px minmax(0, 1fr);
    grid-template-rows: 12px 12px;
    padding: 3px 5px;
  }

  .ops-radio-feed b {
    min-height: 24px;
    font-size: 8px;
  }

  .ops-radio-feed strong,
  .ops-radio-feed small,
  .ops-history-line span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ops-history-line {
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .footer-actions {
    flex-wrap: nowrap;
    gap: 5px;
  }

  .ops-footer button {
    min-height: 31px;
    padding: 4px 7px;
    font-size: 10px;
  }
}

/* v49: COA comparison board for the staff room. */
.staff-proposals {
  display: grid;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
}

.coa-card {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto auto auto minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px;
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(8, 18, 28, 0.92), rgba(6, 10, 16, 0.82)),
    repeating-linear-gradient(90deg, rgba(126, 201, 255, 0.05) 0 1px, transparent 1px 24px);
}

.coa-card.selected {
  border-color: rgba(112, 229, 174, 0.72);
  box-shadow:
    inset 3px 0 0 rgba(112, 229, 174, 0.78),
    0 0 0 1px rgba(112, 229, 174, 0.12);
}

.coa-ribbon,
.coa-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.coa-ribbon {
  grid-template-columns: minmax(56px, auto) minmax(0, 1fr);
  align-items: center;
}

.coa-ribbon span,
.coa-ribbon strong {
  display: inline-grid;
  min-width: 0;
  min-height: 20px;
  align-content: center;
  overflow: hidden;
  border: 1px solid rgba(126, 201, 255, 0.22);
  border-radius: 3px;
  padding: 0 6px;
  color: rgba(198, 232, 255, 0.9);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coa-ribbon strong {
  justify-self: start;
  color: rgba(241, 212, 139, 0.92);
}

.coa-brief {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 8px;
  align-items: start;
}

.coa-brief h3,
.coa-brief p,
.coa-chain,
.coa-outcome p,
.coa-context span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.coa-brief h3 {
  margin-bottom: 3px;
  white-space: nowrap;
}

.coa-brief p,
.coa-outcome p {
  display: -webkit-box;
  line-height: 1.25;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.coa-confidence {
  width: 48px;
  height: 48px;
  border-radius: 3px;
}

.coa-metrics span {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 4px;
  align-items: center;
  padding: 5px;
  border: 1px solid rgba(159, 188, 218, 0.18);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.04);
}

.coa-metrics b,
.coa-metrics strong {
  overflow: hidden;
  font-size: 9px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coa-metrics b {
  color: rgba(178, 225, 255, 0.82);
}

.coa-metrics strong {
  color: #f1d48b;
}

.coa-metrics i {
  grid-column: 1 / -1;
  height: 4px;
  overflow: hidden;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(88, 198, 170, 0.86), rgba(241, 212, 139, 0.86));
}

.coa-context {
  max-height: 56px;
  overflow: hidden;
}

.coa-chain {
  display: block;
  white-space: nowrap;
}

.coa-card .missing ul {
  max-height: 52px;
  overflow: hidden;
  margin-bottom: 0;
}

.coa-card .missing li {
  overflow: hidden;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coa-outcome {
  min-height: 0;
  padding: 7px;
  border: 1px solid rgba(241, 212, 139, 0.18);
  border-radius: 3px;
  background: rgba(241, 212, 139, 0.06);
}

.coa-outcome span {
  display: block;
  margin-bottom: 3px;
  color: rgba(241, 212, 139, 0.9);
  font-size: 9px;
  font-weight: 900;
}

.coa-outcome p {
  margin: 0;
}

.coa-approve {
  min-height: 32px;
  border-radius: 3px;
}

@media (min-width: 1024px) {
  .stage-card.ai .staff-room {
    grid-template-columns: minmax(280px, 0.86fr) minmax(0, 1.28fr) minmax(220px, 0.74fr);
  }
}

@media (min-width: 1024px) and (max-width: 1180px) {
  .stage-card.ai .staff-room {
    grid-template-columns: minmax(220px, 0.78fr) minmax(0, 1.36fr) minmax(188px, 0.62fr);
  }

  .coa-card {
    gap: 5px;
    padding: 7px;
  }

  .coa-brief {
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 5px;
  }

  .coa-confidence {
    width: 42px;
    height: 42px;
    font-size: 16px;
  }

  .coa-context {
    max-height: 42px;
  }

  .coa-card .missing ul {
    max-height: 38px;
  }

  .coa-outcome {
    padding: 5px;
  }
}

@media (max-width: 760px) {
  .coa-card {
    gap: 7px;
    padding: 9px;
  }

  .coa-brief {
    grid-template-columns: minmax(0, 1fr) 46px;
  }
}

/* v49 refinement: AI staff room becomes a compact COA comparison board with
   tactical map effects and a cross-plan evidence ledger. */
.stage-card.ai .staff-room {
  min-height: 0;
}

.stage-card.ai .staff-map-panel,
.stage-card.ai .staff-proposals,
.stage-card.ai .staff-evidence {
  min-height: 0;
  overflow: hidden;
}

.stage-card.ai .staff-map-panel {
  grid-template-rows: 54px minmax(0, 1fr) 96px;
}

.stage-card.ai .staff-proposals {
  grid-template-rows: 34px repeat(3, minmax(116px, 1fr));
  gap: 8px;
  padding: 10px;
  align-content: stretch;
}

.stage-card.ai .staff-proposals .panel-title,
.stage-card.ai .staff-evidence .panel-title {
  min-height: 0;
  margin-bottom: 0;
}

.stage-card.ai .coa-card {
  min-height: 0;
  max-height: 148px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 78px;
  grid-template-rows: 38px 34px 22px 30px;
  gap: 5px 8px;
  align-items: stretch;
  padding: 8px;
  border: 1px solid rgba(159, 188, 218, 0.22);
  border-radius: 3px;
}

.stage-card.ai .coa-card.cleared {
  border-color: rgba(112, 229, 174, 0.58);
}

.stage-card.ai .coa-card.caution {
  border-color: rgba(241, 212, 139, 0.42);
}

.stage-card.ai .coa-card.danger {
  border-color: rgba(255, 122, 122, 0.42);
}

.stage-card.ai .coa-command {
  grid-row: 1 / 4;
  display: grid;
  grid-template-rows: 28px minmax(0, 1fr);
  gap: 5px;
}

.stage-card.ai .coa-command span,
.stage-card.ai .coa-command strong {
  min-width: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(126, 201, 255, 0.24);
  border-radius: 3px;
  padding: 0 4px;
  text-align: center;
  text-overflow: ellipsis;
}

.stage-card.ai .coa-command span {
  color: rgba(241, 212, 139, 0.95);
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.stage-card.ai .coa-command strong {
  color: rgba(198, 232, 255, 0.82);
  font-size: 9px;
  line-height: 1.15;
}

.stage-card.ai .coa-brief {
  grid-column: 2 / 4;
  grid-row: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
  min-width: 0;
}

.stage-card.ai .coa-brief h3,
.stage-card.ai .coa-brief p,
.stage-card.ai .coa-chain,
.stage-card.ai .coa-signal span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stage-card.ai .coa-brief h3 {
  margin: 0 0 2px;
  line-height: 1.12;
  white-space: nowrap;
}

.stage-card.ai .coa-brief p {
  display: block;
  margin: 0;
  color: rgba(198, 205, 198, 0.72);
  line-height: 1.2;
  white-space: nowrap;
}

.stage-card.ai .coa-confidence {
  width: 42px;
  height: 36px;
  border-radius: 3px;
  font-size: 16px;
}

.stage-card.ai .coa-confidence span {
  font-size: 8px;
}

.stage-card.ai .coa-metrics {
  grid-column: 2 / 4;
  grid-row: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.stage-card.ai .coa-metrics span {
  min-height: 0;
  padding: 4px 5px;
  border-radius: 3px;
}

.stage-card.ai .coa-metrics b,
.stage-card.ai .coa-metrics strong {
  font-size: 8px;
}

.stage-card.ai .coa-metrics i {
  height: 3px;
}

.stage-card.ai .coa-signal {
  grid-column: 2 / 4;
  grid-row: 3;
  display: grid;
  grid-template-columns: 1fr 1fr 72px;
  gap: 5px;
}

.stage-card.ai .coa-signal span {
  min-height: 22px;
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(159, 188, 218, 0.14);
  border-radius: 3px;
  padding: 0 5px;
  color: rgba(198, 205, 198, 0.72);
  font-size: 9px;
  white-space: nowrap;
}

.stage-card.ai .coa-signal b {
  color: rgba(126, 201, 255, 0.82);
  font-size: 8px;
}

.stage-card.ai .coa-chain {
  grid-column: 1 / 3;
  grid-row: 4;
  align-self: center;
  margin: 0;
  color: rgba(178, 225, 255, 0.76);
  font-size: 10px;
  line-height: 1.15;
  white-space: nowrap;
}

.stage-card.ai .coa-approve {
  grid-column: 3;
  grid-row: 4;
  min-height: 28px;
  margin: 0;
  border-radius: 3px;
  padding: 0 7px;
  font-size: 10px;
  white-space: nowrap;
}

.coa-map-vector {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.coa-map-vector path {
  fill: none;
  stroke: rgba(241, 212, 139, 0.92);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-dasharray: 5 4;
  filter: drop-shadow(0 0 6px rgba(241, 212, 139, 0.35));
}

.coa-map-vector path.dim {
  opacity: 0.26;
  stroke-width: 1.1;
}

.coa-map-vector path.active {
  opacity: 1;
  stroke-width: 2;
}

.coa-map-vector path.cleared {
  stroke: rgba(112, 229, 174, 0.95);
}

.coa-map-vector path.danger {
  stroke: rgba(255, 122, 122, 0.9);
}

.coa-map-label,
.coa-map-ping {
  position: absolute;
  z-index: 14;
  pointer-events: none;
}

.coa-map-label {
  display: grid;
  gap: 1px;
  min-width: 74px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(241, 212, 139, 0.42);
  border-radius: 3px;
  padding: 5px 7px;
  background: rgba(5, 9, 16, 0.78);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34);
}

.coa-map-label b,
.coa-map-label span {
  line-height: 1;
  white-space: nowrap;
}

.coa-map-label b {
  color: rgba(241, 212, 139, 0.95);
  font-size: 10px;
}

.coa-map-label span {
  color: rgba(198, 232, 255, 0.82);
  font-size: 9px;
}

.coa-map-label.cleared {
  border-color: rgba(112, 229, 174, 0.52);
}

.coa-map-label.danger {
  border-color: rgba(255, 122, 122, 0.52);
}

.coa-map-ping {
  display: grid;
  place-items: center;
  width: 44px;
  height: 20px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(241, 212, 139, 0.48);
  border-radius: 3px;
  background: rgba(5, 9, 16, 0.78);
  color: rgba(241, 212, 139, 0.94);
  font-size: 8px;
  font-weight: 900;
}

.coa-map-ping.cleared {
  border-color: rgba(112, 229, 174, 0.52);
  color: rgba(112, 229, 174, 0.95);
}

.coa-map-ping.danger {
  border-color: rgba(255, 122, 122, 0.52);
  color: rgba(255, 122, 122, 0.95);
}

.stage-card.ai .staff-evidence {
  display: grid;
  grid-template-rows: 34px auto auto minmax(0, 1fr);
  gap: 8px;
  padding: 10px;
}

.stage-card.ai .coa-ledger-summary {
  margin: 0;
  padding: 9px;
}

.stage-card.ai .coa-ledger-summary strong,
.stage-card.ai .coa-ledger-summary p {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stage-card.ai .coa-ledger-summary strong {
  white-space: nowrap;
}

.stage-card.ai .coa-ledger-summary p {
  display: -webkit-box;
  line-height: 1.22;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.stage-card.ai .coa-ledger {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  display: grid;
  gap: 5px;
  overflow: hidden;
}

.stage-card.ai .coa-ledger-row {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  justify-self: stretch;
  display: grid;
  grid-template-columns: 48px 36px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  min-height: 34px;
  border: 1px solid rgba(159, 188, 218, 0.18);
  border-radius: 3px;
  padding: 5px;
  background: rgba(255, 255, 255, 0.035);
  color: rgba(232, 222, 190, 0.9);
  text-align: left;
}

.stage-card.ai .coa-ledger-row.active {
  border-color: rgba(112, 229, 174, 0.58);
  background: rgba(112, 229, 174, 0.08);
}

.stage-card.ai .coa-ledger-row span,
.stage-card.ai .coa-ledger-row strong,
.stage-card.ai .coa-ledger-row i {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-card.ai .coa-ledger-row span {
  color: rgba(241, 212, 139, 0.95);
  font-size: 9px;
  font-weight: 900;
}

.stage-card.ai .coa-ledger-row strong {
  color: rgba(178, 225, 255, 0.86);
  font-size: 10px;
}

.stage-card.ai .coa-ledger-row i {
  color: rgba(198, 205, 198, 0.74);
  font-size: 9px;
  font-style: normal;
}

.stage-card.ai .coa-ledger-detail {
  min-height: 0;
  overflow: auto;
}

.stage-card.ai .coa-ledger-detail h4 {
  margin: 8px 0 5px;
  color: rgba(241, 212, 139, 0.88);
  font-size: 10px;
}

.stage-card.ai .coa-ledger-detail ul {
  margin: 0;
  padding-left: 14px;
}

.stage-card.ai .coa-ledger-detail li,
.stage-card.ai .coa-ledger-detail p {
  min-width: 0;
  overflow: hidden;
  color: rgba(198, 205, 198, 0.76);
  font-size: 10px;
  line-height: 1.32;
  text-overflow: ellipsis;
}

@media (min-width: 1024px) and (max-height: 760px) {
  .stage-card.ai .staff-room {
    grid-template-columns: minmax(320px, 0.96fr) minmax(340px, 1.04fr) minmax(194px, 0.62fr);
    gap: 9px;
  }

  .stage-card.ai .staff-map-panel {
    grid-template-rows: 48px minmax(0, 1fr) 72px;
  }

  .stage-card.ai .staff-map-header {
    padding: 8px 10px;
  }

  .stage-card.ai .staff-readouts {
    gap: 6px;
    padding: 8px;
  }

  .stage-card.ai .staff-context-chain {
    left: 8px;
    right: 8px;
    bottom: 8px;
    gap: 4px;
  }

  .stage-card.ai .staff-context-chain span {
    min-height: 24px;
    font-size: 9px;
  }

  .stage-card.ai .staff-verdict {
    right: 8px;
    top: 8px;
    padding: 5px 7px;
    font-size: 10px;
  }

  .stage-card.ai .war-counter {
    min-width: 62px;
  }

  .stage-card.ai .staff-proposals {
    grid-template-rows: 28px repeat(3, 128px);
    gap: 6px;
    padding: 8px;
  }

  .stage-card.ai .coa-card {
    max-height: 128px;
    grid-template-columns: 52px minmax(0, 1fr) 72px;
    grid-template-rows: 32px 28px 20px 26px;
    gap: 4px 6px;
    padding: 6px;
  }

  .stage-card.ai .coa-command {
    grid-template-rows: 24px minmax(0, 1fr);
  }

  .stage-card.ai .coa-brief {
    grid-template-columns: minmax(0, 1fr) 36px;
  }

  .stage-card.ai .coa-confidence {
    width: 36px;
    height: 32px;
    font-size: 14px;
  }

  .stage-card.ai .coa-signal {
    grid-template-columns: 1fr 1fr 62px;
  }

  .stage-card.ai .coa-signal span {
    min-height: 20px;
    padding: 0 4px;
  }

  .stage-card.ai .coa-chain {
    font-size: 9px;
  }

  .stage-card.ai .coa-approve {
    min-height: 26px;
    padding: 0 5px;
    font-size: 9px;
  }

  .stage-card.ai .staff-evidence {
    grid-template-rows: 28px auto auto minmax(0, 1fr);
    gap: 6px;
    padding: 8px;
  }

  .stage-card.ai .coa-ledger-summary {
    padding: 7px;
  }

  .stage-card.ai .coa-ledger-row {
    grid-template-columns: 42px 30px minmax(0, 1fr);
    min-height: 30px;
    gap: 4px;
    padding: 4px;
  }
}

@media (max-width: 760px) {
  .stage-card.ai .staff-room {
    gap: 10px;
  }

  .stage-card.ai .staff-map-panel {
    grid-template-rows: 38px 168px 42px;
  }

  .stage-card.ai .staff-war-map {
    min-height: 0;
    height: 168px;
  }

  .stage-card.ai .staff-map-header {
    padding: 5px 8px;
  }

  .stage-card.ai .staff-map-header span {
    font-size: 9px;
  }

  .stage-card.ai .staff-map-header strong {
    margin-top: 0;
    font-size: 12px;
    line-height: 1.1;
  }

  .stage-card.ai .staff-grade {
    min-width: 44px;
    padding: 3px 5px;
  }

  .stage-card.ai .staff-grade strong {
    font-size: 16px;
  }

  .stage-card.ai .staff-readouts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    padding: 6px;
  }

  .stage-card.ai .staff-readouts .sim-bar {
    min-width: 0;
  }

  .stage-card.ai .staff-readouts .sim-bar div {
    gap: 3px;
  }

  .stage-card.ai .staff-readouts .sim-bar span,
  .stage-card.ai .staff-readouts .sim-bar strong {
    overflow: hidden;
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .stage-card.ai .staff-context-chain {
    left: 7px;
    right: 7px;
    bottom: 7px;
    gap: 3px;
  }

  .stage-card.ai .staff-context-chain span {
    min-height: 18px;
    font-size: 8px;
  }

  .stage-card.ai .staff-verdict {
    right: 7px;
    top: 7px;
    padding: 4px 6px;
    font-size: 9px;
  }

  .stage-card.ai .staff-proposals {
    grid-template-rows: 24px repeat(3, 96px);
    gap: 6px;
    padding: 7px;
  }

  .stage-card.ai .coa-card {
    max-height: none;
    grid-template-columns: 44px minmax(0, 1fr) 58px;
    grid-template-rows: 28px 24px 20px 20px;
    gap: 3px 5px;
    padding: 5px;
  }

  .stage-card.ai .coa-brief {
    grid-template-columns: minmax(0, 1fr) 30px;
  }

  .stage-card.ai .coa-confidence {
    width: 30px;
    height: 28px;
    font-size: 12px;
  }

  .stage-card.ai .coa-signal {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .stage-card.ai .coa-signal span:last-child {
    display: none;
  }

  .stage-card.ai .coa-command span,
  .stage-card.ai .coa-command strong,
  .stage-card.ai .coa-brief h3,
  .stage-card.ai .coa-brief p,
  .stage-card.ai .coa-signal span,
  .stage-card.ai .coa-chain,
  .stage-card.ai .coa-approve {
    font-size: 8px;
  }

  .stage-card.ai .coa-command {
    grid-template-rows: 20px minmax(0, 1fr);
    gap: 3px;
  }

  .stage-card.ai .coa-metrics {
    gap: 3px;
  }

  .stage-card.ai .coa-metrics span {
    padding: 3px 4px;
  }

  .stage-card.ai .coa-signal span {
    min-height: 20px;
    padding: 0 4px;
  }

  .stage-card.ai .coa-chain {
    display: none;
  }

  .stage-card.ai .coa-approve {
    grid-column: 2 / 4;
    min-height: 20px;
    padding: 0 5px;
  }

  .stage-card.ai .staff-evidence {
    grid-template-rows: 28px auto auto auto;
    padding: 8px;
  }

  .coa-map-label {
    min-width: 58px;
    padding: 4px 5px;
  }

  .coa-map-ping {
    width: 36px;
    height: 17px;
    font-size: 7px;
  }
}

/* v52: visual QA readability pass. Real users need to understand what is
   selected and what to click next without relying on hidden text. */
@media (min-width: 1024px) {
  .app-shell {
    grid-template-columns: 276px minmax(0, 1fr);
  }

  .app-shell .level-list {
    gap: 8px;
    overflow: auto;
    padding-right: 2px;
  }

  .app-shell .level-button {
    min-height: 70px;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 8px 10px 8px 12px;
    overflow: visible;
  }

  .app-shell .level-button span:nth-child(2) {
    display: grid;
    gap: 2px;
    min-width: 0;
    overflow: hidden;
  }

  .app-shell .level-button strong,
  .app-shell .level-button small,
  .app-shell .level-state {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .app-shell .level-button strong {
    font-size: 12px;
    line-height: 1.2;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .app-shell .level-button small {
    margin-top: 0;
    color: rgba(214, 231, 236, 0.72);
    font-size: 10px;
    line-height: 1.2;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .app-shell .level-state {
    max-width: 76px;
    padding: 4px 6px;
    font-size: 10px;
    line-height: 1.15;
    text-align: right;
    white-space: normal;
  }

  .ops-game-shell {
    grid-template-rows: 74px minmax(0, 1fr) 70px;
  }

  .ops-topbar,
  .ops-footer {
    gap: 12px;
    padding: 10px 14px;
  }

  .ops-topbar {
    grid-template-columns: minmax(300px, 380px) minmax(0, 1fr) max-content;
  }

  .ops-footer {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 280px) max-content;
    align-items: stretch;
  }

  .ops-brand h1 {
    max-width: none;
    font-size: 18px;
    line-height: 1.15;
    white-space: normal;
  }

  .ops-brand p {
    font-size: 11px;
  }

  .ops-turn-strip {
    gap: 8px;
  }

  .ops-turn-strip div {
    min-height: 46px;
    padding: 7px 9px;
  }

  .ops-turn-strip span,
  .ops-turn-strip div small {
    font-size: 10px;
  }

  .ops-turn-strip strong {
    font-size: 11px;
    line-height: 1.15;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .ops-system-buttons {
    gap: 8px;
  }

  .ops-level-jump {
    gap: 4px;
    padding: 4px;
  }

  .ops-level-jump button {
    width: 30px;
    height: 30px;
  }

  .ops-control-pad {
    gap: 6px;
  }

  .ops-control-pad button,
  .ops-footer button {
    min-height: 38px;
    padding: 7px 10px;
  }

  .ops-control-pad button b,
  .ops-footer button b {
    font-size: 11px;
  }

  .ops-control-pad button span,
  .ops-footer button span {
    font-size: 10px;
  }

  .ops-layout {
    grid-template-columns: minmax(228px, 244px) minmax(0, 1fr) minmax(272px, 300px);
    gap: 10px;
    padding: 10px;
  }

  .ops-left-dock,
  .ops-right-dock {
    gap: 10px;
    overflow: auto;
    padding-right: 4px;
  }

  .ops-left-dock {
    grid-template-rows: auto auto minmax(170px, 1fr) auto;
    align-content: start;
  }

  .ops-right-dock {
    grid-template-rows: auto minmax(260px, 1fr) minmax(180px, auto);
    align-content: start;
  }

  .ops-brief-card,
  .ops-registry,
  .ops-doctrine,
  .ops-mission-board,
  .ops-intel-board,
  .ops-object-board,
  .ops-after-action {
    padding: 11px 12px;
  }

  .ops-brief-card p,
  .ops-doctrine p {
    display: block;
    line-height: 1.45;
  }

  .ops-map-stage {
    grid-template-rows: 60px minmax(0, 1fr) 154px;
  }

  .ops-map-toolbar > div:first-child strong {
    white-space: normal;
    line-height: 1.2;
  }

  .mission-objective span strong,
  .mission-objective span small,
  .map-focus-marker strong,
  .map-focus-marker small {
    white-space: normal;
    line-height: 1.25;
  }

  .map-focus-marker {
    min-width: 150px;
    padding: 7px 9px;
  }

  .ops-command-deck {
    grid-template-columns: minmax(230px, 260px) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    padding: 14px 16px;
  }

  .ops-command-deck strong {
    margin: 4px 0 6px;
    font-size: 15px;
  }

  .ops-command-deck p {
    display: -webkit-box;
    white-space: normal;
    line-height: 1.35;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
  }

  .ops-command-cards {
    gap: 10px;
    align-items: stretch;
  }

  .ops-command-cards button.command-card,
  .ops-command-cards button.command-card.locked {
    min-height: 112px;
    max-height: none;
    grid-template-rows: auto auto auto auto auto;
    gap: 6px;
    padding: 8px 9px;
  }

  .ops-command-cards button.command-card strong {
    font-size: 12px;
    line-height: 1.2;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .ops-command-cards button.command-card .command-route,
  .ops-command-cards button.command-card.locked .command-route {
    display: grid;
    font-size: 10px;
  }

  .ops-command-cards button.command-card .command-route b,
  .ops-command-cards button.command-card .command-route i,
  .ops-command-cards button.command-card.locked .command-route b,
  .ops-command-cards button.command-card.locked .command-route i {
    font-size: 10px;
    line-height: 1.15;
    max-height: none;
  }

  .ops-command-cards button.command-card .command-signals {
    gap: 6px;
  }

  .ops-command-cards button.command-card .command-signals em {
    min-height: 24px;
    grid-template-columns: 30px minmax(0, 1fr);
    padding: 4px 6px;
  }

  .ops-command-cards button.command-card .command-signals em span {
    display: block;
    font-size: 9px;
  }

  .ops-command-cards button.command-card code,
  .ops-command-cards button.command-card small {
    display: block;
    white-space: normal;
    line-height: 1.25;
  }

  .ops-registry .mini-object,
  .mini-object {
    min-height: 60px;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 8px;
    padding: 8px 9px;
  }

  .ops-registry .mini-object strong,
  .mini-object strong,
  .object-node strong,
  .intel-contact strong {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .ops-registry .mini-object strong,
  .mini-object strong {
    font-size: 13px;
    line-height: 1.15;
  }

  .ops-registry .mini-object small,
  .mini-object small {
    display: block;
    font-size: 10px;
    line-height: 1.25;
    white-space: normal;
  }

  .object-node {
    min-width: 96px;
    min-height: 56px;
    padding: 8px 9px;
  }

  .object-node strong {
    font-size: 13px;
    line-height: 1.15;
  }

  .object-node small {
    display: block;
    font-size: 10px;
    line-height: 1.2;
    white-space: normal;
  }

  .intel-contact {
    min-width: 100px;
    min-height: 54px;
    padding: 7px 8px;
  }

  .intel-contact strong {
    font-size: 12px;
    line-height: 1.15;
  }

  .intel-contact span,
  .intel-contact i {
    font-size: 10px;
  }

  .ops-intel-board,
  .ops-object-board,
  .ops-after-action {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .ops-intel-board .inspector-card,
  .ops-object-board .inspector-card,
  .ops-object-board .object-detail,
  .ops-after-action .ops-decision-board {
    overflow: auto;
  }

  .ops-intel-board .inspector-card > p,
  .ops-right-dock .inspector-card p,
  .ops-after-action p,
  .ops-right-dock .sample-data code {
    display: block;
    overflow: visible;
    white-space: normal;
    line-height: 1.35;
    -webkit-line-clamp: unset;
    -webkit-box-orient: initial;
  }

  .contact-queue-list {
    gap: 8px;
  }

  .contact-queue-list button {
    min-height: 44px;
    padding: 6px 7px;
  }

  .contact-queue-list span,
  .contact-queue-list small,
  .queue-directive {
    white-space: normal;
    line-height: 1.25;
  }

  .assign-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
  }

  .assign-row span {
    font-size: 10px;
    line-height: 1.25;
  }

  .sample-data {
    gap: 6px;
  }

  .ops-right-dock .sample-data code {
    min-height: 38px;
    padding: 6px 7px;
  }

  .ops-object-board .object-detail {
    grid-template-rows: auto auto auto auto minmax(0, 1fr) auto minmax(110px, 0.8fr);
    gap: 8px;
  }

  .ops-object-board .object-title {
    margin-bottom: 0;
  }

  .ops-object-board .object-title strong {
    white-space: normal;
    line-height: 1.2;
  }

  .ops-object-board .object-title small {
    display: block;
    font-size: 10px;
  }

  .ops-object-board .object-readiness,
  .ops-object-board .mechanic-note {
    margin: 0;
    padding: 8px;
  }

  .ops-object-board .object-readiness {
    gap: 4px;
  }

  .ops-object-board .object-readiness small,
  .ops-object-board .mechanic-note span,
  .ops-object-board .attached-props span small,
  .ops-object-board .object-relations span small,
  .relation-readiness span small,
  .decision-stack span small {
    display: block;
    white-space: normal;
    line-height: 1.25;
  }

  .ops-object-board .mechanic-note {
    gap: 3px;
  }

  .ops-object-board .attached-props span,
  .ops-object-board .object-relations span,
  .relation-readiness span,
  .decision-stack span {
    padding: 7px 8px;
  }

  .ops-object-board h4 {
    margin: 0;
    font-size: 11px;
  }

  .decision-core {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
  }

  .decision-ring {
    width: 56px;
    height: 56px;
  }

  .decision-stack {
    gap: 6px;
  }

  .decision-stack span b,
  .decision-footer span {
    white-space: normal;
    line-height: 1.2;
  }

  .ops-radio-feed {
    gap: 6px;
  }

  .ops-radio-feed span {
    min-height: 40px;
    grid-template-columns: 34px minmax(0, 1fr);
    grid-template-rows: auto auto;
    padding: 6px 7px;
  }

  .ops-radio-feed strong,
  .ops-radio-feed small,
  .ops-history-line span {
    white-space: normal;
    line-height: 1.2;
  }

  .ops-history-line {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 6px;
  }

  .ops-history-line strong:last-child {
    display: inline-flex;
  }

  .footer-actions {
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .footer-actions button,
  .footer-actions button:not(.primary) {
    min-width: 74px;
  }

  .footer-actions .action-gate {
    min-width: 108px;
  }

  .staff-room {
    grid-template-columns: minmax(280px, 0.92fr) minmax(350px, 1.18fr) minmax(280px, 0.92fr);
    gap: 12px;
  }

  .execution-room {
    grid-template-columns: minmax(280px, 0.92fr) minmax(320px, 1.08fr) minmax(280px, 0.92fr);
    gap: 12px;
  }

  .battle-layout {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
    gap: 12px;
  }

  .stage-card.ai .staff-proposals,
  .stage-card.ai .staff-evidence,
  .execution-orders,
  .execution-writeback,
  .battle-aar {
    overflow: auto;
    padding: 12px;
  }

  .stage-card.ai .staff-proposals {
    grid-template-rows: 38px repeat(3, minmax(156px, 1fr));
    gap: 10px;
  }

  .stage-card.ai .staff-evidence {
    grid-template-rows: 38px auto auto minmax(0, 1fr);
    gap: 10px;
  }

  .stage-card.ai .coa-card {
    max-height: none;
    min-height: 160px;
    grid-template-columns: 64px minmax(0, 1fr) 92px;
    grid-template-rows: auto auto auto auto;
    gap: 8px 10px;
    padding: 10px;
  }

  .stage-card.ai .coa-command span {
    font-size: 10px;
  }

  .stage-card.ai .coa-command strong {
    font-size: 10px;
    line-height: 1.2;
    white-space: normal;
  }

  .stage-card.ai .coa-brief {
    grid-template-columns: minmax(0, 1fr) 48px;
  }

  .stage-card.ai .coa-brief h3 {
    font-size: 14px;
    line-height: 1.2;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .stage-card.ai .coa-brief p {
    white-space: normal;
    display: -webkit-box;
    line-height: 1.25;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .stage-card.ai .coa-confidence {
    width: 48px;
    height: 42px;
    font-size: 18px;
  }

  .stage-card.ai .coa-metrics span {
    padding: 5px 6px;
  }

  .stage-card.ai .coa-metrics b,
  .stage-card.ai .coa-metrics strong {
    font-size: 9px;
  }

  .stage-card.ai .coa-signal {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .stage-card.ai .coa-signal span {
    min-height: 32px;
    align-items: flex-start;
    padding: 5px 6px;
    font-size: 9px;
    white-space: normal;
    line-height: 1.2;
  }

  .stage-card.ai .coa-chain {
    white-space: normal;
    display: -webkit-box;
    line-height: 1.25;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .stage-card.ai .coa-approve {
    min-height: 34px;
    padding: 0 8px;
    font-size: 11px;
  }

  .stage-card.ai .coa-ledger-summary strong {
    white-space: normal;
  }

  .stage-card.ai .coa-ledger-summary p {
    -webkit-line-clamp: 3;
  }

  .stage-card.ai .coa-ledger-row {
    min-height: 40px;
    grid-template-columns: 52px 44px minmax(0, 1fr);
    padding: 6px;
  }

  .stage-card.ai .coa-ledger-row i {
    white-space: normal;
    line-height: 1.2;
  }

  .execution-order {
    min-height: 88px;
    padding: 10px;
    gap: 6px 8px;
  }

  .execution-order strong,
  .execution-order small,
  .execution-writeback p,
  .edit-card p,
  .edit-card li {
    white-space: normal;
    line-height: 1.25;
  }

  .execution-order i {
    width: auto;
    min-width: 60px;
    height: 32px;
  }

  .replay-console {
    grid-template-columns: minmax(240px, 1fr) repeat(4, minmax(72px, 92px));
    gap: 8px;
    padding: 8px;
  }

  .replay-console-readout span {
    min-height: 42px;
    grid-template-rows: 18px 14px;
    padding: 6px 8px;
  }

  .replay-console-readout b {
    font-size: 12px;
  }

  .replay-console-readout small,
  .replay-key span {
    white-space: normal;
    text-align: center;
    line-height: 1.15;
  }

  .replay-key {
    min-height: 42px;
    grid-template-rows: 16px 14px;
    padding: 6px 8px;
    border-radius: 5px;
  }

  .replay-key b {
    font-size: 11px;
  }

  .replay-key span {
    font-size: 11px;
  }
}

@media (max-width: 760px) {
  .app-shell .topbar {
    gap: 10px;
  }

  .app-shell .topbar > div:first-child p,
  .app-shell .topbar > div:first-child h2,
  .app-shell .topbar > div:first-child > p:last-child {
    white-space: normal;
    line-height: 1.2;
  }

  .app-shell .topbar-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .app-shell .metric,
  .app-shell .toggle,
  .app-shell .topbar-metrics button {
    min-height: 54px;
    padding: 8px 10px;
  }

  .app-shell .metric span,
  .app-shell .toggle span {
    font-size: 10px;
    line-height: 1.15;
    white-space: normal;
  }

  .app-shell .metric strong {
    font-size: 24px;
  }

  .app-shell .stage-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .app-shell .stage-nav button {
    min-height: 46px;
    padding: 8px 10px;
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    color: #d9e4e8;
    font-size: 11px;
    text-align: left;
    white-space: normal;
    line-height: 1.15;
  }

  .app-shell .stage-nav button span {
    display: grid;
    width: 22px;
    height: 22px;
    margin-right: 0;
    place-items: center;
    font-size: 11px;
  }

  .stage-card.ai .staff-proposals,
  .stage-card.ai .staff-evidence,
  .execution-orders,
  .execution-writeback,
  .battle-aar {
    padding: 9px;
  }

  .stage-card.ai .coa-card {
    grid-template-columns: 42px minmax(0, 1fr) 64px;
    grid-template-rows: auto auto auto auto;
    gap: 4px 6px;
    padding: 6px;
  }

  .stage-card.ai .coa-brief h3 {
    font-size: 10px;
    line-height: 1.15;
  }

  .stage-card.ai .coa-brief p,
  .stage-card.ai .coa-signal span,
  .stage-card.ai .coa-approve,
  .stage-card.ai .coa-chain {
    font-size: 9px;
    line-height: 1.15;
  }

  .stage-card.ai .coa-signal span:last-child {
    display: flex;
  }

  .stage-card.ai .coa-chain {
    display: block;
    white-space: normal;
  }

  .stage-card.ai .coa-approve {
    min-height: 24px;
  }

  .execution-order strong,
  .execution-order small,
  .execution-writeback p,
  .edit-card p,
  .edit-card li,
  .battle-metric span,
  .battle-metric strong,
  .replay-console-readout small,
  .replay-key span {
    white-space: normal;
    line-height: 1.15;
  }

  .battle-command-bar {
    gap: 6px;
  }

  .battle-command-bar button,
  .replay-actions button,
  .stage-controls button {
    min-height: 38px;
  }
}

@media (max-width: 760px) {
  .stage-card.replay .map-chip,
  .stage-card.replay .risk-zone,
  .stage-card.replay .unit-counter {
    overflow: visible;
  }

  .stage-card.replay .map-chip {
    min-width: 86px;
    max-width: 112px;
    padding: 5px 7px;
    font-size: 10px;
    line-height: 1.18;
    white-space: normal;
    word-break: keep-all;
    text-overflow: clip;
  }

  .stage-card.replay .risk-zone span,
  .stage-card.replay .unit-counter span {
    white-space: normal;
    word-break: keep-all;
    text-overflow: clip;
    line-height: 1.15;
  }

  .stage-card.replay .unit-counter {
    width: 82px;
    min-height: 44px;
    grid-template-columns: 1fr;
    gap: 0;
    padding: 6px 7px;
    justify-items: center;
  }

  .stage-card.replay .unit-counter b {
    display: none;
  }

  .stage-card.replay .unit-counter span {
    font-size: 9px;
    text-align: center;
  }
}

@media (max-width: 430px) {
  .stage-card.replay .replay-console-readout span {
    min-height: 48px;
    grid-template-rows: 18px minmax(18px, auto);
  }

  .stage-card.replay .replay-key {
    min-height: 42px;
    grid-template-rows: 16px minmax(16px, auto);
    padding: 6px 8px;
  }

  .stage-card.replay .replay-key b,
  .stage-card.replay .replay-key span,
  .stage-card.replay .replay-console-readout small {
    white-space: normal;
    word-break: keep-all;
  }

  .ops-system-buttons {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  .ops-level-jump {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    gap: 6px;
    padding: 6px;
  }

  .ops-level-jump button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 100%;
    height: auto;
    min-height: 42px;
    padding: 6px 4px;
    line-height: 1;
    font-size: 12px;
    font-weight: 900;
  }

  .ops-level-jump button::after {
    content: attr(data-short);
    display: block;
    margin-top: 0;
    color: rgba(217, 232, 255, 0.82);
    font-size: 8px;
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: 0.01em;
  }

  .ops-level-jump button.active::after {
    color: rgba(219, 255, 248, 0.95);
  }
}

@media (max-width: 760px) {
  .app-shell .level-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
    padding-right: 0;
  }

  .app-shell .level-button {
    min-height: 52px;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 6px;
    padding: 6px 7px;
    overflow: hidden;
    align-items: center;
  }

  .app-shell .level-button span:nth-child(2) {
    display: block;
    min-width: 0;
    overflow: hidden;
  }

  .app-shell .level-button strong {
    display: -webkit-box;
    overflow: hidden;
    font-size: 9px;
    line-height: 1.08;
    white-space: normal;
    text-overflow: clip;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .app-shell .level-button small,
  .app-shell .level-state {
    display: none;
  }
}

/* v60: fix object-pick ambiguity and restore real readability on common 720p desktops. */
.mini-object.registry-current {
  border-color: rgba(247, 201, 72, 0.32);
  background:
    linear-gradient(180deg, rgba(247, 201, 72, 0.08), rgba(88, 198, 170, 0.04)),
    rgba(255, 255, 255, 0.03);
  box-shadow: inset 3px 0 0 rgba(247, 201, 72, 0.7);
}

.mini-object.registry-current::after {
  content: attr(data-current-label);
  position: absolute;
  top: 7px;
  right: 8px;
  padding: 2px 6px;
  border: 1px solid rgba(247, 201, 72, 0.38);
  border-radius: 999px;
  background: rgba(36, 28, 8, 0.92);
  color: #f7e1a2;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.02em;
  pointer-events: none;
}

.mini-object.registry-object-list {
  border-color: rgba(159, 188, 218, 0.16);
  background: rgba(255, 255, 255, 0.025);
  box-shadow: none;
}

.mini-object.registry-object-list strong {
  color: rgba(226, 238, 246, 0.84);
}

@media (max-height: 760px) and (min-width: 1181px) {
  .ops-system-buttons {
    gap: 6px;
    flex-wrap: wrap;
  }

  .ops-level-jump {
    gap: 4px;
    padding: 4px;
  }

  .ops-level-jump button {
    width: 24px;
    height: 32px;
    font-size: 11px;
  }

  .ops-control-pad {
    grid-template-columns: repeat(4, 38px);
    gap: 4px;
    padding: 4px;
  }

  .ops-control-pad button {
    width: 38px;
    min-height: 34px;
    grid-template-rows: 12px 12px;
    padding: 3px;
  }

  .ops-control-pad button b {
    font-size: 8px;
  }

  .ops-control-pad button span {
    font-size: 9px;
  }

  .ops-layout {
    grid-template-columns: minmax(220px, 244px) minmax(0, 1fr) minmax(236px, 268px);
    gap: 8px;
    padding: 8px;
  }

  .ops-left-dock {
    grid-template-rows: minmax(84px, 0.52fr) minmax(148px, 0.9fr) minmax(136px, 0.82fr) auto;
  }

  .ops-right-dock {
    grid-template-rows: minmax(112px, 0.68fr) minmax(210px, 1fr) minmax(150px, 0.74fr);
  }

  .ops-brief-card,
  .ops-registry,
  .ops-doctrine,
  .ops-mission-board,
  .ops-intel-board,
  .ops-object-board,
  .ops-after-action {
    padding: 8px 9px;
  }

  .ops-brief-card h2 {
    font-size: 16px;
    line-height: 1.12;
    white-space: normal;
    text-overflow: clip;
  }

  .panel-title {
    min-height: 0;
    align-items: start;
    gap: 6px;
  }

  .panel-title strong {
    font-size: 12px;
    line-height: 1.15;
    white-space: normal;
    text-overflow: clip;
  }

  .mission-objective {
    min-height: 36px;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 6px;
    padding: 4px 6px;
  }

  .mission-objective strong,
  .mission-objective small {
    white-space: normal;
    text-overflow: clip;
  }

  .mission-objective strong {
    font-size: 10px;
    line-height: 1.15;
  }

  .mission-objective small {
    font-size: 8px;
    line-height: 1.15;
  }

  .ops-registry .mini-object {
    min-height: 42px;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 6px;
    padding: 4px 6px;
  }

  .ops-registry .mini-object span {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .ops-registry .mini-object strong,
  .ops-registry .mini-object small {
    white-space: normal;
    text-overflow: clip;
  }

  .ops-registry .mini-object strong {
    font-size: 10px;
    line-height: 1.12;
  }

  .ops-registry .mini-object small {
    font-size: 8px;
    line-height: 1.1;
  }

  .ops-doctrine {
    display: grid;
    align-content: start;
    gap: 7px;
  }

  .ops-doctrine .panel-title {
    display: flex;
  }

  .ops-doctrine p {
    display: block;
    overflow: hidden;
    font-size: 11px;
    line-height: 1.35;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
  }

  .ops-doctrine .tutorial-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .ops-doctrine .tutorial-controls button {
    min-height: 30px;
    padding: 5px 8px;
  }

  .doctrine-step {
    padding: 6px 8px;
    font-size: 10px;
    line-height: 1.2;
    white-space: normal;
    text-overflow: clip;
  }

  .ops-footer button {
    min-height: 34px;
    padding: 6px 9px;
    font-size: 11px;
  }

  .footer-actions {
    gap: 8px;
  }

  .stage-nav button {
    min-height: 42px;
    padding: 6px 8px;
    font-size: 11px;
    white-space: normal;
    text-overflow: clip;
  }

  .stage-card.replay .replay-actions {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .stage-card.replay .replay-actions button {
    min-height: 38px;
    padding: 7px 9px;
    font-size: 11px;
    line-height: 1.15;
    white-space: normal;
    text-overflow: clip;
  }

  .replay-console {
    grid-template-columns: minmax(208px, 1fr) repeat(4, minmax(62px, 88px));
    gap: 8px;
    padding: 7px;
  }

  .replay-console-readout span,
  .replay-key {
    min-height: 40px;
  }

  .replay-key {
    padding: 6px 7px;
  }

  .replay-key b {
    font-size: 10px;
  }

  .replay-key span,
  .replay-console-readout small {
    font-size: 10px;
    line-height: 1.12;
    white-space: normal;
    text-overflow: clip;
  }
}

/* v63 final QA override: this block intentionally stays at the very end so
   older breakpoint rules cannot reintroduce clipped text or cramped controls. */
.ops-game-shell {
  height: auto !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

.ops-layout {
  height: auto !important;
  min-height: calc(100vh - 148px) !important;
  overflow: visible !important;
}

.ops-left-dock,
.ops-right-dock {
  overflow: visible !important;
  padding-right: 0 !important;
}

.ops-brief-card,
.ops-registry,
.ops-doctrine,
.ops-mission-board,
.ops-intel-board,
.ops-object-board,
.ops-after-action,
.ops-intel-board .inspector-card,
.ops-object-board .object-detail,
.ops-after-action .ops-decision-board {
  overflow: visible !important;
}

.ops-brief-card p,
.ops-doctrine p,
.ops-command-deck p,
.ops-right-dock .inspector-card p,
.ops-after-action p,
.ops-right-dock .sample-data code,
.mission-objective strong,
.mission-objective small,
.mission-objective em,
.ops-registry .mini-object strong,
.ops-registry .mini-object small,
.mini-object strong,
.mini-object small,
.object-node strong,
.object-node small,
.intel-contact strong,
.intel-contact span,
.intel-contact i,
.panel-title strong,
.doctrine-step,
.queue-directive,
.contact-queue-list span,
.contact-queue-list small,
.object-detail h3,
.object-detail p,
.ops-decision-board p,
.ops-decision-board strong,
.ops-decision-board span,
.footer-actions button b,
.footer-actions button span,
.stage-nav button,
.execution-order strong,
.execution-order small,
.execution-order i {
  max-width: none !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  -webkit-line-clamp: unset !important;
  -webkit-box-orient: initial !important;
}

.contact-queue-list {
  gap: 10px !important;
  overflow: visible !important;
}

.contact-queue-list button {
  min-height: 50px !important;
  grid-template-columns: 30px minmax(0, 1fr) auto !important;
  gap: 10px !important;
  padding: 8px 10px !important;
  border-radius: 7px !important;
}

.contact-queue-list b {
  width: 26px !important;
  height: 26px !important;
  font-size: 10px !important;
}

.contact-queue-list span {
  font-size: 12px !important;
  line-height: 1.22 !important;
}

.contact-queue-list small {
  font-size: 10px !important;
  line-height: 1.25 !important;
  text-align: left !important;
}

.contact-queue-list button.backup-entry::after {
  align-self: start !important;
  padding: 3px 7px !important;
  font-size: 9px !important;
}

.queue-directive {
  padding: 8px 10px !important;
  border: 1px solid rgba(88, 198, 170, 0.24) !important;
  border-radius: 7px !important;
  background: rgba(88, 198, 170, 0.08) !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
}

.footer-actions {
  flex-wrap: wrap !important;
  align-items: stretch !important;
  justify-content: flex-end !important;
}

.footer-actions button,
.footer-actions button:not(.primary),
.footer-actions .action-gate,
.footer-actions .audio-key,
.footer-actions .drill-key {
  max-width: none !important;
  min-width: 92px !important;
  min-height: 42px !important;
  padding: 8px 12px !important;
  line-height: 1.18 !important;
}

.footer-actions .action-gate {
  min-width: 132px !important;
}

.execution-order.selected.recommended {
  border-color: rgba(88, 198, 170, 0.72) !important;
  background:
    linear-gradient(135deg, rgba(88, 198, 170, 0.18), rgba(12, 24, 22, 0.92)) !important;
  box-shadow:
    inset 4px 0 0 rgba(88, 198, 170, 0.82),
    0 0 0 1px rgba(88, 198, 170, 0.18) !important;
}

.execution-order.selected.recommended span {
  color: #70e5ae !important;
}

.execution-order.selected.recommended i {
  border-color: rgba(88, 198, 170, 0.46) !important;
  background: rgba(88, 198, 170, 0.14) !important;
  color: #dcffef !important;
}

@media (max-height: 760px) and (min-width: 1181px) {
  .ops-layout {
    grid-template-columns: minmax(236px, 260px) minmax(0, 1fr) minmax(292px, 340px) !important;
    gap: 10px !important;
    padding: 10px !important;
  }

  .ops-doctrine .panel-title,
  .ops-doctrine p,
  .ops-doctrine .tutorial-controls {
    display: flex !important;
  }

  .ops-doctrine p {
    display: block !important;
    font-size: 11px !important;
    line-height: 1.35 !important;
  }

  .contact-queue-list button {
    min-height: 46px !important;
    grid-template-columns: 28px minmax(0, 1fr) auto !important;
    padding: 7px 9px !important;
  }
}

@media (max-width: 760px) {
  body {
    overflow-x: hidden !important;
  }

  .ops-game-shell {
    display: block !important;
    min-height: 100vh !important;
  }

  .ops-topbar,
  .ops-footer {
    position: relative !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    padding: 10px !important;
  }

  .ops-brand h1 {
    font-size: 17px !important;
    line-height: 1.16 !important;
  }

  .ops-turn-strip {
    display: flex !important;
    gap: 8px !important;
    overflow-x: auto !important;
    padding-bottom: 2px !important;
    scroll-snap-type: x proximity;
  }

  .ops-turn-strip div {
    min-width: 112px !important;
    scroll-snap-align: start;
  }

  .ops-system-buttons {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .ops-level-jump,
  .ops-control-pad {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .ops-level-jump button,
  .ops-control-pad button {
    width: auto !important;
    min-height: 42px !important;
  }

  .ops-layout {
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    height: auto !important;
    gap: 10px !important;
    padding: 10px !important;
  }

  .ops-left-dock,
  .ops-right-dock {
    display: grid !important;
    gap: 10px !important;
  }

  .ops-map-stage {
    order: -1 !important;
    min-height: 620px !important;
    grid-template-rows: auto minmax(430px, 58vh) auto !important;
    overflow: visible !important;
  }

  .ops-map-toolbar {
    grid-template-columns: 1fr !important;
    min-height: 0 !important;
    gap: 8px !important;
    overflow: visible !important;
  }

  .ops-map-toolbar > div:first-child strong {
    display: block !important;
  }

  .ops-map-toolbar strong,
  .ops-map-toolbar span {
    white-space: normal !important;
  }

  .ops-layer-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .ops-layer-tabs .layer-switch span,
  .ops-layer-tabs .layer-switch small {
    display: block !important;
  }

  .ops-wargame-map {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 430px !important;
    overflow: hidden !important;
  }

  .ops-registry .mini-object,
  .contact-queue-list button {
    min-height: 54px !important;
  }

  .contact-queue-list button {
    grid-template-columns: 30px minmax(0, 1fr) !important;
  }

  .contact-queue-list button.backup-entry::after {
    grid-column: 2 !important;
    justify-self: start !important;
  }

  .footer-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    justify-content: stretch !important;
  }

  .footer-actions button,
  .footer-actions button:not(.primary),
  .footer-actions .action-gate,
  .footer-actions .audio-key,
  .footer-actions .drill-key {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 48px !important;
  }

  .footer-actions .action-gate {
    grid-column: 1 / -1 !important;
  }
}

@media (max-width: 430px) {
  .ops-topbar,
  .ops-footer,
  .ops-layout {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  .ops-brand h1 {
    font-size: 16px !important;
  }

  .ops-map-stage {
    min-height: 590px !important;
    grid-template-rows: auto minmax(410px, 58vh) auto !important;
  }

  .ops-wargame-map {
    min-height: 410px !important;
  }
}

/* v63 final top-control pass: keep UNDO/REDO/JUDGE readable on desktop. */
.ops-system-buttons {
  gap: 10px !important;
}

.ops-control-pad {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(66px, auto)) !important;
  gap: 7px !important;
  padding: 5px !important;
}

.ops-control-pad button {
  width: auto !important;
  min-width: 66px !important;
  min-height: 42px !important;
  grid-template-rows: auto auto !important;
  padding: 6px 9px !important;
}

.ops-control-pad button b,
.ops-control-pad button span {
  max-width: none !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
}

.ops-control-pad button b {
  font-size: 10px !important;
}

.ops-control-pad button span {
  font-size: 11px !important;
}

@media (max-height: 760px) and (min-width: 1181px) {
  .ops-control-pad {
    grid-template-columns: repeat(4, minmax(62px, auto)) !important;
  }

  .ops-control-pad button {
    min-width: 62px !important;
    min-height: 40px !important;
    padding: 6px 8px !important;
  }
}

@media (max-width: 760px) {
  .ops-control-pad {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .ops-control-pad button {
    min-width: 0 !important;
    width: auto !important;
  }
}
/* v64 terminal QA override: kept for inspector/replay compatibility. */
.inspector-card.token-panel {
  max-width: 100% !important;
  min-width: 0 !important;
  overflow: visible !important;
}

.inspector-card.token-panel p,
.inspector-card.token-panel .hint-box,
.inspector-card.token-panel .mechanic-note,
.inspector-card.token-panel .mechanic-note strong,
.inspector-card.token-panel .mechanic-note span {
  display: block !important;
  max-width: 100% !important;
  overflow: visible !important;
  overflow-wrap: anywhere !important;
  text-overflow: clip !important;
  white-space: normal !important;
  -webkit-line-clamp: unset !important;
}

.inspector-card.token-panel .assign-row {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(116px, 1fr)) !important;
  gap: 9px !important;
  align-items: stretch !important;
  justify-content: stretch !important;
}

.inspector-card.token-panel .assign-row button {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  min-height: 42px !important;
  padding: 8px 10px !important;
  overflow: visible !important;
  overflow-wrap: anywhere !important;
  text-align: center !important;
  text-overflow: clip !important;
  white-space: normal !important;
}

.inspector-card.token-panel .assign-row span {
  grid-column: 1 / -1 !important;
  min-width: 0 !important;
  overflow-wrap: anywhere !important;
  line-height: 1.35 !important;
}

.stage-card.replay .battle-sandbox .unit-counter {
  width: 96px !important;
  min-width: 0 !important;
  max-width: 112px !important;
  grid-template-columns: 24px minmax(0, 1fr) !important;
  gap: 6px !important;
  padding: 6px 7px !important;
  overflow: visible !important;
}

.stage-card.replay .battle-sandbox .unit-counter b {
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
}

.stage-card.replay .battle-sandbox .unit-counter span {
  min-width: 0 !important;
  overflow: visible !important;
  overflow-wrap: anywhere !important;
  text-overflow: clip !important;
  white-space: normal !important;
}

@media (max-width: 760px) {
  .inspector-card.token-panel .assign-row {
    grid-template-columns: 1fr !important;
  }

  .stage-card.replay .battle-sandbox .unit-counter {
    width: 88px !important;
    max-width: 96px !important;
    grid-template-columns: 1fr !important;
    justify-items: center !important;
  }

  .stage-card.replay .battle-sandbox .unit-counter b {
    display: none !important;
  }

  .stage-card.replay .battle-sandbox .unit-counter span {
    font-size: 9px !important;
    text-align: center !important;
  }
}

/* v66 terminal mobile QA override: this block intentionally stays at EOF. */
.mobile-field-action {
  display: none;
}

@media (max-width: 760px) {
  .ops-game-shell:has(.mobile-field-action) {
    padding-bottom: 178px !important;
  }

  .mobile-field-action {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 12px !important;
    border: 1px solid rgba(255, 217, 117, 0.55) !important;
    border-radius: 16px !important;
    background:
      linear-gradient(135deg, rgba(255, 217, 117, 0.18), rgba(80, 199, 255, 0.11)),
      rgba(4, 12, 20, 0.94) !important;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.34), inset 0 0 0 1px rgba(255, 255, 255, 0.06) !important;
    position: fixed !important;
    left: 10px !important;
    right: 10px !important;
    bottom: 10px !important;
    z-index: 74 !important;
  }

  .mobile-field-action__copy,
  .mobile-field-action__buttons {
    min-width: 0 !important;
  }

  .mobile-field-action__copy span {
    display: inline-flex !important;
    width: fit-content !important;
    margin-bottom: 4px !important;
    padding: 3px 7px !important;
    border-radius: 999px !important;
    background: rgba(255, 217, 117, 0.18) !important;
    color: #ffd975 !important;
    font-size: 11px !important;
    font-weight: 900 !important;
    letter-spacing: 0.08em !important;
  }

  .mobile-field-action__copy strong,
  .mobile-field-action__copy small {
    display: block !important;
    max-width: 100% !important;
    overflow: visible !important;
    overflow-wrap: anywhere !important;
    text-overflow: clip !important;
    white-space: normal !important;
  }

  .mobile-field-action__copy strong {
    color: #fff7d8 !important;
    font-size: 15px !important;
    line-height: 1.28 !important;
  }

  .mobile-field-action__copy small {
    margin-top: 5px !important;
    color: rgba(229, 240, 249, 0.86) !important;
    font-size: 11px !important;
    line-height: 1.35 !important;
  }

  .mobile-field-action__buttons {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .mobile-field-action__buttons button {
    width: 100% !important;
    min-height: 48px !important;
    padding: 10px 12px !important;
    border-radius: 14px !important;
    font-size: 15px !important;
    font-weight: 900 !important;
    overflow: visible !important;
    overflow-wrap: anywhere !important;
    text-overflow: clip !important;
    white-space: normal !important;
  }

  .tutorial-coach,
  .tutorial-coach.place-bottom,
  .tutorial-coach.place-top,
  .tutorial-coach.place-side,
  .tutorial-coach.place-side-right {
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    top: auto !important;
    bottom: 14px !important;
    width: auto !important;
    max-width: calc(100vw - 24px) !important;
    transform: none !important;
    z-index: 80 !important;
  }

  .ops-game-shell:has(.mobile-field-action) .tutorial-coach,
  .ops-game-shell:has(.mobile-field-action) .tutorial-coach.place-bottom,
  .ops-game-shell:has(.mobile-field-action) .tutorial-coach.place-top,
  .ops-game-shell:has(.mobile-field-action) .tutorial-coach.place-side,
  .ops-game-shell:has(.mobile-field-action) .tutorial-coach.place-side-right {
    bottom: 174px !important;
  }

  .tutorial-coach::before,
  .tutorial-coach.place-bottom::before,
  .tutorial-coach.place-top::before,
  .tutorial-coach.place-side::before,
  .tutorial-coach.place-side-right::before {
    display: none !important;
  }
}

/* v69 terminal mobile level-card readability override: keep this at true EOF. */
@media (max-width: 760px) {
  .app-shell .sidebar {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  .app-shell .level-list {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
    padding: 0 !important;
  }

  .app-shell .level-button {
    display: grid !important;
    grid-template-columns: 34px minmax(0, 1fr) auto !important;
    grid-template-rows: auto !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
    min-height: 78px !important;
    padding: 10px 12px !important;
    overflow: visible !important;
    text-align: left !important;
  }

  .app-shell .level-button .level-num {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    justify-self: center !important;
  }

  .app-shell .level-button > span:nth-child(2) {
    grid-column: 2 !important;
    grid-row: 1 !important;
    display: grid !important;
    gap: 4px !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
  }

  .app-shell .level-button strong,
  .app-shell .level-button small {
    display: block !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
    overflow-wrap: normal !important;
    word-break: keep-all !important;
    text-overflow: clip !important;
    white-space: normal !important;
    writing-mode: horizontal-tb !important;
    -webkit-line-clamp: unset !important;
    -webkit-box-orient: initial !important;
  }

  .app-shell .level-button strong {
    font-size: 15px !important;
    line-height: 1.25 !important;
    letter-spacing: 0.01em !important;
  }

  .app-shell .level-button small {
    display: block !important;
    color: rgba(214, 231, 236, 0.82) !important;
    font-size: 12px !important;
    line-height: 1.25 !important;
  }

  .app-shell .level-state {
    grid-column: 3 !important;
    grid-row: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    justify-self: end !important;
    width: auto !important;
    min-width: 76px !important;
    max-width: 96px !important;
    min-height: 34px !important;
    padding: 6px 9px !important;
    border-radius: 999px !important;
    overflow: visible !important;
    white-space: nowrap !important;
    text-align: center !important;
  }
}
/* v74 growth and reward layer */
.player-profile-hud {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(241, 212, 139, 0.28);
  border-radius: 4px;
  background:
    linear-gradient(135deg, rgba(20, 27, 27, 0.94), rgba(8, 11, 13, 0.86)),
    radial-gradient(circle at 18% 12%, rgba(88, 198, 170, 0.16), transparent 38%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.035), 0 14px 28px rgba(0, 0, 0, 0.24);
}

.player-profile-chip {
  position: relative;
  min-width: 210px;
  display: block;
  padding: 7px 9px;
  border: 1px solid rgba(241, 212, 139, 0.34);
  border-radius: 4px;
  background:
    linear-gradient(135deg, rgba(10, 16, 16, 0.94), rgba(29, 24, 16, 0.86)),
    radial-gradient(circle at 14% 18%, rgba(143, 227, 136, 0.16), transparent 42%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.035);
}

.player-profile-chip summary {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  gap: 2px 7px;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

.player-profile-chip summary::-webkit-details-marker {
  display: none;
}

.player-profile-chip summary::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 7px;
  width: 5px;
  height: 5px;
  border-right: 1px solid rgba(241, 212, 139, 0.8);
  border-bottom: 1px solid rgba(241, 212, 139, 0.8);
  transform: rotate(45deg);
}

.player-profile-chip[open] summary::after {
  transform: translateY(3px) rotate(225deg);
}

.player-profile-chip summary span {
  grid-row: 1 / span 2;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(241, 212, 139, 0.5);
  border-radius: 3px;
  color: #f1d48b;
  font-size: 11px;
  font-weight: 900;
}

.player-profile-chip summary strong,
.player-profile-chip summary em {
  overflow: hidden;
  min-width: 0;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.player-profile-chip summary strong {
  color: #f5ead1;
  font-size: 12px;
}

.player-profile-chip summary b {
  padding-right: 12px;
  color: #8fe388;
  font-size: 11px;
}

.player-profile-chip summary em {
  grid-column: 2 / 4;
  color: #aeb8b4;
  font-size: 10px;
  font-style: normal;
}

.profile-chip-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 40;
  width: min(340px, 92vw);
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid rgba(241, 212, 139, 0.35);
  border-radius: 4px;
  background:
    linear-gradient(145deg, rgba(7, 12, 13, 0.98), rgba(21, 18, 12, 0.96)),
    radial-gradient(circle at 15% 12%, rgba(93, 212, 200, 0.15), transparent 42%);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.42), inset 0 0 0 1px rgba(255, 255, 255, 0.035);
}

.profile-mastery.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.profile-badges.compact {
  max-height: 96px;
  overflow: auto;
}

.profile-rank {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.profile-rank span {
  width: 38px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(241, 212, 139, 0.5);
  border-radius: 3px;
  color: #f1d48b;
  font-weight: 900;
  font-size: 12px;
  background: rgba(241, 212, 139, 0.08);
}

.profile-rank strong {
  overflow: hidden;
  color: #f5ead1;
  font-size: 13px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.profile-rank small {
  color: #8fe388;
  font-size: 11px;
  font-weight: 800;
}

.profile-xp-track {
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
}

.profile-xp-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #58c6aa, #f1d48b);
  box-shadow: 0 0 18px rgba(88, 198, 170, 0.36);
}

.profile-mastery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.profile-mastery span {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 5px;
  border: 1px solid rgba(159, 188, 218, 0.16);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.04);
}

.profile-mastery b,
.profile-mastery i {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-style: normal;
  font-size: 10px;
}

.profile-mastery b {
  color: #aeb8b4;
}

.profile-mastery i {
  color: #f1d48b;
  font-weight: 900;
}

.profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.profile-badges b,
.sidebar-rank {
  border: 1px solid rgba(241, 212, 139, 0.24);
  border-radius: 3px;
  background: rgba(241, 212, 139, 0.08);
}

.profile-badges b {
  padding: 4px 6px;
  color: #f5ead1;
  font-size: 10px;
  font-weight: 800;
}

.sidebar-rank {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  margin-bottom: 8px;
  padding: 7px;
}

.sidebar-rank span {
  color: #f1d48b;
  font-weight: 900;
}

.sidebar-rank strong,
.sidebar-rank small {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sidebar-rank strong {
  color: #f5ead1;
  font-size: 12px;
}

.sidebar-rank small {
  color: #8fe388;
  font-size: 10px;
}

.reward-toast {
  position: fixed;
  right: 18px;
  bottom: 92px;
  z-index: 80;
  width: min(320px, calc(100vw - 28px));
  padding: 12px;
  border: 1px solid rgba(143, 227, 136, 0.5);
  border-radius: 4px;
  background:
    linear-gradient(135deg, rgba(8, 14, 13, 0.97), rgba(25, 34, 26, 0.95)),
    radial-gradient(circle at 10% 10%, rgba(143, 227, 136, 0.18), transparent 40%);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42), 0 0 34px rgba(88, 198, 170, 0.22);
  color: #f5ead1;
  animation: reward-pop 0.34s ease-out both;
}

.reward-toast span,
.reward-toast em {
  display: block;
  color: #8fe388;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0;
}

.reward-toast strong {
  display: block;
  margin-top: 3px;
  font-size: 16px;
}

.reward-toast p {
  margin: 4px 0 0;
  color: #d4ddd8;
  font-size: 12px;
  line-height: 1.35;
}

.reward-toast em {
  margin-top: 7px;
  color: #f1d48b;
}

.command-reward {
  display: inline-grid;
  justify-self: start;
  margin-top: 4px;
  padding: 3px 6px;
  border: 1px solid rgba(143, 227, 136, 0.28);
  border-radius: 3px;
  background: rgba(143, 227, 136, 0.08);
  color: #8fe388;
  font-size: 10px;
  font-weight: 900;
}

.command-card.active .command-reward {
  border-color: rgba(241, 212, 139, 0.36);
  background: rgba(241, 212, 139, 0.1);
  color: #f1d48b;
}

.sandbox-line.relation-ok {
  filter: drop-shadow(0 0 7px rgba(143, 227, 136, 0.72));
  animation: relation-surge 1.4s ease-out both;
}

@keyframes reward-pop {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes relation-surge {
  0% {
    stroke-dashoffset: 34;
    opacity: 0.18;
  }
  100% {
    stroke-dashoffset: 0;
    opacity: 1;
  }
}

@media (max-width: 720px) {
  .player-profile-hud {
    order: -1;
  }

  .reward-toast {
    right: 10px;
    bottom: 84px;
  }

  .player-profile-chip {
    min-width: 0;
    grid-column: 1 / -1;
  }

  .profile-chip-popover {
    left: 0;
    right: auto;
    width: min(100%, 92vw);
  }
}

@media (min-width: 761px) and (max-width: 1100px) {
  .ops-game-shell .ops-topbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .ops-game-shell .ops-topbar .turn-strip,
  .ops-game-shell .ops-topbar .player-profile-chip {
    grid-column: 1 / -1;
  }

  .ops-game-shell .ops-topbar .player-profile-chip {
    justify-self: stretch;
    min-width: 0;
  }
}

@media (min-width: 1101px) {
  .ops-game-shell .ops-topbar {
    grid-template-columns: 260px minmax(260px, 1fr) minmax(190px, 240px) max-content;
  }
}

/* v78 final MiniMax icon override: keep generated icons visible after legacy v-passes. */
.object-node .object-icon,
.mini-object .object-icon,
.object-slot .object-icon,
.intel-contact .token-icon,
.intel-token .token-icon,
.war-counter .war-icon,
.contact-queue-list .queue-icon {
  display: grid;
  background-image:
    linear-gradient(180deg, rgba(11, 23, 33, 0.28), rgba(3, 6, 12, 0.44)),
    var(--icon-atlas);
  background-size: 400% 500%;
  background-position: var(--icon-x, 0%) var(--icon-y, 0%);
}

.object-node .object-icon,
.object-slot .object-icon {
  --icon-size: 34px;
}

.mini-object .object-icon {
  --icon-size: 32px;
}

.war-counter .war-icon {
  --icon-size: 34px;
  margin-bottom: 2px;
}

.intel-contact {
  width: 128px;
  min-height: 76px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 8px;
  align-items: center;
}

.intel-contact .token-icon {
  --icon-size: 36px;
  grid-column: 1;
  grid-row: 1 / span 2;
}

.intel-contact span,
.intel-contact strong,
.intel-contact i {
  grid-column: 2;
}

.intel-token {
  grid-template-rows: 34px auto auto;
}

.intel-token .token-icon {
  --icon-size: 32px;
  justify-self: center;
}

.contact-queue-list button {
  grid-template-columns: 28px minmax(0, 1fr) minmax(64px, auto);
}

.contact-queue-list .queue-icon {
  --icon-size: 24px;
}

@media (max-width: 760px) {
  .object-node .object-icon {
    --icon-size: 26px;
  }

  .war-counter .war-icon {
    --icon-size: 26px;
  }

  .intel-contact {
    width: 92px;
    min-height: 50px;
    grid-template-columns: 28px minmax(0, 1fr);
    column-gap: 5px;
  }

  .intel-contact .token-icon {
    --icon-size: 26px;
  }
}

@media (max-width: 430px) {
  .object-node .object-icon {
    --icon-size: 22px;
  }

  .war-counter .war-icon {
    --icon-size: 22px;
  }

  .intel-contact {
    width: 74px;
    min-height: 38px;
    grid-template-columns: 24px minmax(0, 1fr);
    padding: 4px 5px;
  }

  .intel-contact .token-icon {
    --icon-size: 22px;
  }

  .intel-contact span {
    display: none;
  }
}
