* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: #e8f3ee;
  background: #030607;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

#particles-js {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(3, 7, 10, 0.98), rgba(7, 12, 11, 0.98)),
    linear-gradient(90deg, rgba(36, 142, 118, 0.12), transparent 34%, rgba(214, 145, 42, 0.08) 72%, transparent);
  z-index: 0;
}

.scanline {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 100% 4px;
  mix-blend-mode: screen;
  opacity: 0.32;
  z-index: 2;
}

.cursor-orbit {
  position: fixed;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(109, 249, 219, 0.8);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 20;
  box-shadow: 0 0 18px rgba(109, 249, 219, 0.35);
  transition: width 0.18s ease, height 0.18s ease, border-color 0.18s ease;
}

.cursor-orbit.is-strong {
  width: 46px;
  height: 46px;
  border-color: rgba(241, 185, 91, 0.9);
}

.one-map-shell {
  position: relative;
  z-index: 3;
  height: 100%;
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr) 158px;
  gap: 10px;
  padding: 10px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(109, 249, 219, 0.28);
  background: rgba(2, 8, 9, 0.74);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.38), inset 0 0 28px rgba(54, 176, 146, 0.08);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(110, 232, 202, 0.8);
  background:
    linear-gradient(90deg, transparent 47%, rgba(110, 232, 202, 0.8) 48%, rgba(110, 232, 202, 0.8) 52%, transparent 53%),
    linear-gradient(transparent 47%, rgba(110, 232, 202, 0.8) 48%, rgba(110, 232, 202, 0.8) 52%, transparent 53%);
  box-shadow: 0 0 22px rgba(84, 226, 190, 0.28);
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: 0;
}

.brand p {
  margin: 4px 0 0;
  color: #8bbab0;
  font-size: 12px;
  letter-spacing: 0;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.tenant-switch,
.icon-btn,
.ghost-link,
.ops-strip button,
.chain-search button {
  flex: 0 0 auto;
  min-height: 34px;
  border: 1px solid rgba(109, 249, 219, 0.32);
  border-radius: 8px;
  background: rgba(7, 20, 18, 0.78);
  color: #dffcf3;
  text-decoration: none;
  box-shadow: inset 0 0 18px rgba(70, 220, 177, 0.08);
}

.tenant-switch {
  display: grid;
  grid-template-columns: 34px auto;
  align-items: center;
  overflow: hidden;
}

.tenant-switch span {
  height: 100%;
  display: grid;
  place-items: center;
  background: rgba(224, 159, 55, 0.18);
  color: #f4c36e;
}

.tenant-switch strong {
  padding: 0 12px;
  white-space: nowrap;
}

.icon-btn,
.ghost-link,
.ops-strip button,
.chain-search button {
  padding: 0 12px;
  white-space: nowrap;
}

.icon-btn:hover,
.ghost-link:hover,
.ops-strip button:hover,
.chain-search button:hover,
.scene-tab:hover {
  border-color: rgba(241, 185, 91, 0.72);
  color: #ffe0a4;
}

.workbench {
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr) 332px;
  gap: 10px;
  min-height: 0;
}

.scene-panel,
.detail-panel,
.project-dock,
.chain-dock {
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(109, 249, 219, 0.22);
  background: rgba(4, 11, 12, 0.78);
  box-shadow: 0 16px 46px rgba(0, 0, 0, 0.38), inset 0 0 28px rgba(54, 176, 146, 0.06);
  backdrop-filter: blur(18px);
}

.scene-panel,
.detail-panel {
  padding: 10px;
  display: flex;
  flex-direction: column;
}

.panel-head,
.dock-head,
.detail-head,
.source-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 28px;
  color: #b8eee0;
  font-size: 12px;
}

.panel-head strong,
.dock-head strong,
.quality-row strong {
  color: #f2c56d;
}

.scene-tabs {
  display: grid;
  gap: 7px;
  overflow: auto;
  padding: 3px 1px;
}

.scene-tab {
  position: relative;
  width: 100%;
  height: 44px;
  border: 1px solid rgba(122, 166, 158, 0.32);
  border-radius: 8px;
  background: rgba(5, 18, 18, 0.66);
  color: #cceee5;
  text-align: left;
  padding: 7px 10px;
  overflow: hidden;
}

.scene-tab::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--scene-color, #57dfc2);
  box-shadow: 0 0 16px var(--scene-color, #57dfc2);
}

.scene-tab strong,
.scene-tab span {
  position: relative;
  z-index: 1;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scene-tab strong {
  font-size: 13px;
  line-height: 1.2;
}

.scene-tab span {
  margin-top: 3px;
  color: #7faea3;
  font-size: 11px;
}

.scene-tab.is-active {
  border-color: var(--scene-color, #57dfc2);
  background: linear-gradient(90deg, rgba(42, 99, 88, 0.48), rgba(4, 18, 18, 0.76));
}

.ops-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.ops-strip button {
  padding: 0 6px;
  font-size: 13px;
}

.quality-box {
  margin-top: 10px;
  display: grid;
  gap: 7px;
  border-top: 1px solid rgba(109, 249, 219, 0.16);
  padding-top: 10px;
}

.screen-list {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  border-top: 1px solid rgba(109, 249, 219, 0.16);
  padding-top: 10px;
}

.screen-chip {
  min-width: 0;
  height: 34px;
  border: 1px solid rgba(122, 166, 158, 0.28);
  border-radius: 8px;
  background: rgba(2, 11, 12, 0.68);
  color: #9fcfc4;
  font-size: 11px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.screen-chip.is-active {
  border-color: var(--active-scene, #6df9db);
  color: #f1fffb;
  box-shadow: inset 0 0 18px rgba(109, 249, 219, 0.12);
}

.quality-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #8fbfb4;
  font-size: 12px;
}

.map-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(109, 249, 219, 0.28);
  background:
    linear-gradient(145deg, rgba(3, 11, 13, 0.94), rgba(6, 14, 10, 0.9)),
    linear-gradient(90deg, rgba(64, 197, 170, 0.1), rgba(228, 166, 60, 0.08));
  perspective: 1200px;
}

.stage-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(109, 249, 219, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(109, 249, 219, 0.08) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: 0.34;
  transform: rotateX(58deg) scale(1.35);
  transform-origin: 50% 64%;
}

.stage-grid::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0, rgba(109, 249, 219, 0.14) 48%, rgba(109, 249, 219, 0.28) 50%, rgba(109, 249, 219, 0.14) 52%, transparent 100%);
  transform: translateX(-100%);
  animation: sweep 5.8s linear infinite;
}

.stage-glow {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(130deg, rgba(70, 220, 177, 0.12), transparent 42%),
    linear-gradient(320deg, rgba(223, 157, 56, 0.1), transparent 46%);
  mix-blend-mode: screen;
  pointer-events: none;
}

.scene-visual {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.23;
  filter: saturate(1.15) contrast(1.08);
  z-index: 1;
  pointer-events: none;
}

#mapChart {
  position: absolute;
  inset: 12px 12px 6px;
  z-index: 2;
  transform-style: preserve-3d;
  will-change: transform;
}

.amap-layer {
  position: absolute;
  inset: 12px 12px 6px;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  filter: saturate(1.12) contrast(1.05);
  transition: opacity 0.28s ease;
}

.map-stage.is-amap #mapChart,
.map-stage.is-amap .scene-visual {
  display: none;
  opacity: 0;
  pointer-events: none;
}

.map-stage:not(.is-amap) .amap-layer {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.map-stage.is-amap .amap-layer {
  opacity: 0.96;
  pointer-events: auto;
}

.map-stage.is-amap-dark .amap-layer .amap-layers {
  filter: brightness(0.52) contrast(1.26) saturate(0.86) hue-rotate(155deg);
}

.map-stage.is-amap-dark .amap-layer canvas,
.map-stage.is-amap-dark .amap-layer img {
  filter: brightness(0.52) contrast(1.26) saturate(0.86) hue-rotate(155deg);
}

.map-stage.is-amap-satellite .amap-layer .amap-layers {
  filter: saturate(1.12) contrast(1.08) brightness(0.86);
}

.map-stage.is-amap-satellite .amap-layer canvas,
.map-stage.is-amap-satellite .amap-layer img {
  filter: saturate(1.15) contrast(1.12) brightness(0.78);
}

.map-mode-switch {
  position: absolute;
  left: 14px;
  top: 82px;
  z-index: 5;
  display: flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(122, 166, 158, 0.24);
  border-radius: 8px;
  background: rgba(1, 8, 10, 0.72);
  backdrop-filter: blur(12px);
}

.map-mode-switch button {
  height: 28px;
  border: 1px solid rgba(122, 166, 158, 0.24);
  border-radius: 7px;
  background: rgba(4, 17, 15, 0.68);
  color: #9fcfc4;
  padding: 0 9px;
  font-size: 11px;
}

.map-mode-switch button.is-active {
  border-color: var(--active-scene, #6df9db);
  color: #f3d28d;
  box-shadow: inset 0 0 18px rgba(109, 249, 219, 0.12);
}

.amap-entry-marker {
  position: relative;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--marker-color, #6df9db);
  border-radius: 50%;
  background: rgba(2, 9, 11, 0.78);
  box-shadow: 0 0 18px var(--marker-color, #6df9db), inset 0 0 12px rgba(255, 255, 255, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.amap-entry-marker i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--marker-color, #6df9db);
}

.amap-entry-marker span {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  max-width: 80px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #e8f3ee;
  background: rgba(2, 9, 11, 0.72);
  border: 1px solid rgba(122, 166, 158, 0.22);
  border-radius: 5px;
  padding: 2px 5px;
  font-size: 10px;
}

.amap-entry-marker.is-focus {
  transform: scale(1.35);
  border-color: #fff4c9;
  box-shadow: 0 0 0 6px rgba(243, 197, 111, 0.12), 0 0 28px var(--marker-color, #6df9db), inset 0 0 18px rgba(255, 244, 201, 0.2);
  animation: markerPulse 1.25s ease-in-out infinite;
}

.amap-entry-marker.is-focus span {
  color: #fff4c9;
  border-color: rgba(243, 197, 111, 0.54);
  background: rgba(15, 10, 3, 0.9);
}

.screen-chart {
  position: absolute;
  right: 14px;
  top: 82px;
  width: min(360px, 36%);
  height: 196px;
  z-index: 4;
  border: 1px solid rgba(122, 166, 158, 0.24);
  border-radius: 8px;
  background: rgba(1, 8, 10, 0.64);
  box-shadow: inset 0 0 26px rgba(50, 176, 150, 0.08), 0 16px 34px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(12px);
  overflow: hidden;
  transition: transform 0.24s ease, opacity 0.24s ease, width 0.24s ease;
}

.has-focus .screen-chart {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-14px) scale(0.9);
  pointer-events: none;
}

.focus-popup {
  position: absolute;
  right: 14px;
  bottom: 52px;
  z-index: 6;
  width: min(430px, 48%);
  max-height: min(420px, calc(100% - 160px));
  display: none;
  border: 1px solid rgba(243, 197, 111, 0.38);
  border-radius: 8px;
  background: rgba(2, 9, 11, 0.86);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.36), inset 0 0 28px rgba(243, 197, 111, 0.08);
  backdrop-filter: blur(16px);
  overflow: hidden;
}

.focus-popup.is-open {
  display: block;
}

.focus-popup-head {
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(243, 197, 111, 0.22);
  padding: 0 8px 0 12px;
  color: #f3d28d;
  font-size: 12px;
}

.focus-popup-head button {
  width: 26px;
  height: 26px;
  border: 1px solid rgba(122, 166, 158, 0.28);
  border-radius: 7px;
  background: rgba(1, 8, 10, 0.76);
  color: #dffcf3;
  font-size: 16px;
  line-height: 1;
}

.focus-popup-body {
  max-height: calc(min(420px, 100vh - 220px) - 34px);
  overflow: auto;
  padding: 12px;
}

.focus-popup-body h3 {
  margin: 0 0 6px;
  color: #fff;
  font-size: 16px;
  line-height: 1.25;
}

.focus-popup-body p {
  margin: 0 0 10px;
  color: #b8ded6;
  font-size: 12px;
  line-height: 1.55;
}

.focus-popup-meta,
.popup-actions,
.entry-action-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.focus-popup-meta {
  margin-bottom: 10px;
}

.focus-popup-meta span {
  border: 1px solid rgba(109, 249, 219, 0.22);
  border-radius: 7px;
  background: rgba(4, 17, 15, 0.62);
  color: #a9d7cc;
  padding: 4px 7px;
  font-size: 11px;
}

.entry-gallery {
  position: relative;
  margin: 8px 0 10px;
  border: 1px solid rgba(122, 166, 158, 0.22);
  background: rgba(1, 8, 10, 0.62);
  overflow: hidden;
}

.entry-gallery-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.entry-gallery-track::-webkit-scrollbar {
  display: none;
}

.entry-gallery figure {
  position: relative;
  height: 138px;
  margin: 0;
  scroll-snap-align: start;
  background: rgba(2, 9, 11, 0.72);
}

.entry-gallery.is-compact figure {
  height: 118px;
}

.entry-gallery img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: saturate(0.95) contrast(1.04);
}

.entry-gallery figcaption {
  position: absolute;
  left: 8px;
  bottom: 7px;
  max-width: calc(100% - 16px);
  padding: 3px 6px;
  border: 1px solid rgba(243, 197, 111, 0.3);
  background: rgba(1, 8, 10, 0.72);
  color: #f3d28d;
  font-size: 10px;
}

.entry-profile {
  display: grid;
  gap: 5px;
  margin: 7px 0;
  padding: 7px;
  border: 1px solid rgba(109, 249, 219, 0.2);
  background:
    linear-gradient(90deg, rgba(109, 249, 219, 0.07), rgba(243, 197, 111, 0.04)),
    rgba(1, 8, 10, 0.58);
}

.entry-profile div {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 6px;
  align-items: start;
}

.entry-profile b {
  color: #f3d28d;
  font-size: 10px;
}

.entry-profile span {
  min-width: 0;
  color: #b8ded6;
  font-size: 11px;
  line-height: 1.45;
}

.entry-profile.is-compact {
  max-height: 94px;
  overflow: auto;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 26px;
  height: 34px;
  transform: translateY(-50%);
  border: 1px solid rgba(109, 249, 219, 0.28);
  background: rgba(1, 8, 10, 0.76);
  color: #dffcf3;
  font-size: 18px;
  line-height: 1;
}

.gallery-nav.prev {
  left: 6px;
}

.gallery-nav.next {
  right: 6px;
}

.gallery-nav:hover {
  border-color: rgba(243, 197, 111, 0.66);
  color: #ffe0a4;
}

.popup-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.popup-columns > div,
.content-block {
  border: 1px solid rgba(122, 166, 158, 0.22);
  border-radius: 8px;
  background: rgba(4, 17, 15, 0.58);
  padding: 8px;
}

.popup-columns b,
.content-block strong {
  display: block;
  margin-bottom: 5px;
  color: #f3d28d;
  font-size: 12px;
}

.popup-columns ul,
.content-block ul {
  margin: 0;
  padding-left: 16px;
  color: #cceee5;
  font-size: 12px;
  line-height: 1.45;
}

.content-block {
  margin-top: 8px;
}

.content-block p {
  margin: 0;
  color: #a9d7cc;
  font-size: 12px;
  line-height: 1.55;
}

.popup-actions button,
.entry-action-grid button {
  min-height: 28px;
  border: 1px solid rgba(109, 249, 219, 0.28);
  border-radius: 7px;
  background: rgba(1, 8, 10, 0.76);
  color: #dffcf3;
  padding: 0 9px;
  font-size: 11px;
}

.popup-actions button:hover,
.entry-action-grid button:hover {
  border-color: rgba(243, 197, 111, 0.66);
  color: #ffe0a4;
}

.entry-action-grid {
  margin-top: 10px;
}

.mini-screen-state,
.mini-screen-list {
  height: 100%;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 14px;
  color: #9fcfc4;
  font-size: 12px;
}

.mini-screen-state strong,
.mini-screen-list strong {
  color: #f3d28d;
  font-size: 13px;
}

.mini-screen-list {
  align-content: start;
  overflow: auto;
}

.mini-screen-list span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid rgba(122, 166, 158, 0.14);
  padding-bottom: 5px;
}

.mini-screen-list b {
  color: #f3d28d;
}

.mini-word-cloud {
  height: 100%;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  overflow: auto;
}

.mini-word-cloud button {
  border: 1px solid rgba(122, 166, 158, 0.26);
  border-radius: 999px;
  background: rgba(4, 17, 15, 0.72);
  color: #dffcf3;
  padding: 4px 8px;
  font-size: var(--size, 12px);
  box-shadow: 0 0 calc(var(--glow, 8px)) rgba(109, 249, 219, 0.18);
}

.mini-word-cloud button:nth-child(3n) {
  color: #f3d28d;
  border-color: rgba(243, 197, 111, 0.32);
}

.mini-word-cloud button:nth-child(4n) {
  color: #a9c4ff;
  border-color: rgba(120, 166, 255, 0.34);
}

.company-tile-grid {
  height: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 10px;
  overflow: auto;
}

.company-tile {
  min-height: 64px;
  border: 1px solid rgba(122, 166, 158, 0.22);
  border-radius: 8px;
  background: rgba(2, 9, 11, 0.68);
  color: #cceee5;
  padding: 7px;
  text-align: left;
}

.company-tile strong,
.company-tile span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-tile strong {
  color: #f3d28d;
  font-size: 11px;
}

.company-tile span {
  margin-top: 5px;
  color: #8fbfb4;
  font-size: 10px;
}

.map-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 10px;
  background: rgba(3, 8, 9, 0.64);
  z-index: 5;
  color: #bdf7e8;
  font-style: normal;
}

.map-loading span {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(109, 249, 219, 0.16);
  border-top-color: #6df9db;
  animation: spin 0.8s linear infinite;
}

.map-loading em {
  font-style: normal;
  font-size: 13px;
}

.kpi-ribbon {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 12px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  z-index: 4;
  pointer-events: none;
}

.kpi-item {
  min-height: 58px;
  border: 1px solid rgba(122, 166, 158, 0.32);
  border-radius: 8px;
  padding: 8px;
  background: rgba(2, 9, 11, 0.68);
  overflow: hidden;
}

.kpi-item span,
.metric-row span {
  display: block;
  color: #8fbfb4;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-item strong {
  display: block;
  margin-top: 4px;
  color: #f3d28d;
  font-size: 18px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-legend {
  position: absolute;
  left: 14px;
  bottom: 12px;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  max-width: 65%;
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 8px;
  border: 1px solid rgba(122, 166, 158, 0.28);
  border-radius: 8px;
  background: rgba(2, 9, 11, 0.72);
  color: #b8ded6;
  font-size: 11px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--legend-color, #57dfc2);
  box-shadow: 0 0 12px var(--legend-color, #57dfc2);
}

.map-readout {
  position: absolute;
  right: 14px;
  bottom: 12px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(241, 185, 91, 0.34);
  border-radius: 8px;
  background: rgba(20, 13, 4, 0.58);
  color: #f5d99d;
  font-size: 12px;
}

.detail-panel {
  transform-origin: right center;
}

.detail-head {
  border-bottom: 1px solid rgba(109, 249, 219, 0.16);
  padding-bottom: 8px;
}

.entry-visual-wrap {
  position: relative;
  height: 128px;
  margin-top: 10px;
  border: 1px solid rgba(122, 166, 158, 0.26);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(2, 9, 11, 0.72);
}

.entry-visual-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.entry-actions {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: flex;
  gap: 6px;
}

.entry-actions button,
.entry-tabs button {
  min-height: 28px;
  border: 1px solid rgba(109, 249, 219, 0.28);
  border-radius: 8px;
  background: rgba(1, 8, 10, 0.76);
  color: #dffcf3;
  padding: 0 9px;
  font-size: 12px;
}

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

.entry-tabs button.is-active {
  border-color: var(--active-scene, #6df9db);
  color: #ffe0a4;
}

.detail-head button {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(122, 166, 158, 0.3);
  border-radius: 8px;
  background: rgba(8, 19, 17, 0.86);
  color: #dffcf3;
  font-size: 18px;
  line-height: 1;
}

.detail-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 10px 0;
}

.detail-empty {
  height: 100%;
  display: grid;
  align-content: center;
  gap: 12px;
  color: #799c95;
  font-size: 13px;
}

.detail-title {
  margin: 0 0 6px;
  color: #ffffff;
  font-size: 18px;
  line-height: 1.22;
}

.detail-sub {
  margin: 0 0 10px;
  color: #8fbfb4;
  font-size: 12px;
  line-height: 1.45;
}

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

.metric-row {
  min-height: 58px;
  border: 1px solid rgba(122, 166, 158, 0.26);
  border-radius: 8px;
  padding: 8px;
  background: rgba(4, 17, 15, 0.66);
}

.metric-row strong {
  display: block;
  margin-top: 5px;
  color: #dffcf3;
  font-size: 14px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.tag-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tag-line span {
  max-width: 100%;
  border: 1px solid rgba(109, 249, 219, 0.24);
  border-radius: 8px;
  padding: 4px 7px;
  color: #a9d7cc;
  background: rgba(4, 17, 15, 0.62);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.source-box {
  border-top: 1px solid rgba(109, 249, 219, 0.16);
  padding-top: 8px;
  color: #89aca5;
  font-size: 11px;
  line-height: 1.45;
}

.source-box a {
  color: #9bead8;
}

.source-list {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.source-link {
  display: block;
  border: 1px solid rgba(122, 166, 158, 0.22);
  border-radius: 8px;
  background: rgba(4, 17, 15, 0.58);
  padding: 8px;
  color: #cceee5;
  text-decoration: none;
}

.source-link strong,
.source-link span {
  display: block;
  line-height: 1.4;
}

.source-link strong {
  color: #f3d28d;
  font-size: 12px;
}

.source-link span {
  margin-top: 3px;
  color: #8fbfb4;
  font-size: 11px;
}

.bottom-dock {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.85fr) minmax(280px, 0.55fr);
  gap: 10px;
  min-height: 0;
  overflow: hidden;
}

.project-dock,
.chain-dock,
.cms-dock {
  padding: 10px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.project-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(218px, 248px);
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 1px 2px;
}

.project-card {
  height: 124px;
  border: 1px solid rgba(122, 166, 158, 0.26);
  border-radius: 8px;
  background: rgba(3, 13, 14, 0.74);
  padding: 9px;
  display: grid;
  grid-template-rows: 34px auto 1fr auto;
  gap: 6px;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.project-thumb {
  width: 100%;
  height: 34px;
  border-radius: 6px;
  object-fit: cover;
  opacity: 0.9;
}

.project-card.is-focus {
  border-color: rgba(243, 197, 111, 0.78);
  transform: translateY(-3px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.28), inset 0 0 22px rgba(243, 197, 111, 0.08);
}

.project-card h3 {
  margin: 0;
  color: #e9fff8;
  font-size: 13px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-card p {
  margin: 0;
  color: #8fbfb4;
  font-size: 11px;
  line-height: 1.35;
  overflow: hidden;
}

.project-meta {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  color: #f3d28d;
  font-size: 11px;
}

.chain-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 62px 62px;
  gap: 6px;
  margin-bottom: 8px;
}

.chain-search input {
  min-width: 0;
  height: 34px;
  border: 1px solid rgba(122, 166, 158, 0.32);
  border-radius: 8px;
  background: rgba(1, 8, 10, 0.86);
  color: #e8f3ee;
  padding: 0 10px;
  outline: none;
}

.chain-result {
  flex: 1;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(160px, 0.88fr) minmax(180px, 1.12fr);
  gap: 8px;
}

#chainGraph,
.chain-report {
  height: 100%;
  min-height: 0;
  border: 1px solid rgba(122, 166, 158, 0.22);
  border-radius: 8px;
  background: rgba(2, 9, 11, 0.58);
  overflow: auto;
}

.chain-report {
  padding: 8px;
  color: #a9d7cc;
  font-size: 12px;
  line-height: 1.5;
}

.chain-report p,
.chain-report h1,
.chain-report h2,
.chain-report h3,
.chain-report ul {
  margin-top: 0;
}

.chain-report h1,
.chain-report h2,
.chain-report h3 {
  color: #f3d28d;
  font-size: 13px;
}

.chain-report table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.chain-report th,
.chain-report td {
  border: 1px solid rgba(122, 166, 158, 0.24);
  padding: 4px;
  vertical-align: top;
}

.cms-grid {
  min-height: 0;
  flex: 1;
  display: grid;
  gap: 7px;
  overflow: auto;
}

.cms-lane,
.field-pill {
  border: 1px solid rgba(122, 166, 158, 0.24);
  border-radius: 8px;
  background: rgba(2, 9, 11, 0.62);
  padding: 8px;
}

.cms-workbench {
  background:
    linear-gradient(120deg, rgba(109, 249, 219, 0.11), rgba(2, 9, 11, 0.74)),
    rgba(2, 9, 11, 0.62);
  border-color: rgba(109, 249, 219, 0.34);
}

.cms-lane strong,
.field-pill strong {
  display: block;
  color: #f3d28d;
  font-size: 12px;
}

.cms-lane span,
.field-pill span {
  display: block;
  margin-top: 4px;
  color: #8fbfb4;
  font-size: 11px;
  line-height: 1.35;
}

.admin-layer .map-stage {
  box-shadow: inset 0 0 0 1px rgba(242, 91, 91, 0.48), 0 0 28px rgba(242, 91, 91, 0.16);
}

.admin-layer .stage-grid {
  opacity: 0.58;
}

.is-external .internal-only {
  display: none;
}

/* v5: CAD drawing-sheet density layer */
.one-map-shell {
  grid-template-rows: 52px minmax(0, 1fr) 172px;
  gap: 6px;
  padding: 8px;
}

.topbar {
  padding: 7px 10px;
  background:
    linear-gradient(90deg, rgba(3, 12, 14, 0.92), rgba(5, 12, 10, 0.86)),
    repeating-linear-gradient(90deg, rgba(109, 249, 219, 0.08) 0 1px, transparent 1px 42px);
}

.brand-mark {
  width: 30px;
  height: 30px;
}

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

.brand p,
.tenant-switch strong,
.icon-btn,
.ghost-link {
  font-size: 11px;
}

.tenant-switch,
.icon-btn,
.ghost-link,
.ops-strip button,
.chain-search button {
  min-height: 30px;
  border-radius: 6px;
}

.workbench {
  grid-template-columns: 174px minmax(0, 1fr) 292px;
  gap: 6px;
}

.scene-panel,
.detail-panel,
.project-dock,
.chain-dock,
.cms-dock {
  border-radius: 0;
  background:
    linear-gradient(rgba(2, 9, 11, 0.88), rgba(2, 9, 11, 0.82)),
    repeating-linear-gradient(0deg, transparent 0 23px, rgba(109, 249, 219, 0.07) 23px 24px);
}

.scene-panel,
.detail-panel {
  padding: 8px;
  overflow: hidden;
}

.scene-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  flex: 0 0 auto;
  gap: 5px;
}

.scene-tab {
  height: 34px;
  border-radius: 4px;
  padding: 5px 6px 5px 9px;
}

.scene-tab strong {
  font-size: 11px;
}

.scene-tab span {
  margin-top: 1px;
  font-size: 10px;
}

.ops-strip,
.screen-list {
  gap: 5px;
  margin-top: 7px;
}

.screen-chip {
  height: 30px;
  border-radius: 4px;
  font-size: 10px;
}

.quality-box {
  margin-top: 7px;
  gap: 5px;
  padding-top: 7px;
}

.map-stage {
  background:
    linear-gradient(145deg, rgba(2, 8, 10, 0.98), rgba(3, 12, 10, 0.9)),
    repeating-linear-gradient(0deg, transparent 0 23px, rgba(109, 249, 219, 0.07) 23px 24px),
    repeating-linear-gradient(90deg, transparent 0 23px, rgba(109, 249, 219, 0.06) 23px 24px);
}

.cad-sheet-title,
.cad-resource-matrix,
.cad-index-panel,
.cad-taxonomy-panel,
.cad-atlas-strip {
  position: absolute;
  z-index: 5;
  border: 1px solid rgba(109, 249, 219, 0.26);
  border-radius: 0;
  background: rgba(1, 8, 10, 0.78);
  box-shadow: inset 0 0 20px rgba(109, 249, 219, 0.06);
  backdrop-filter: blur(10px);
}

.cad-sheet-title {
  left: 12px;
  right: 12px;
  top: 10px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 9px;
}

.cad-sheet-title strong {
  color: #f1fffb;
  font-size: 13px;
}

.cad-sheet-title span {
  margin-left: 10px;
  color: #8fbfb4;
  font-size: 10px;
}

.cad-sheet-title dl {
  display: grid;
  grid-template-columns: repeat(3, auto auto);
  gap: 4px 7px;
  margin: 0;
  align-items: center;
  color: #8fbfb4;
  font-size: 10px;
}

.cad-sheet-title dt,
.cad-sheet-title dd {
  margin: 0;
}

.cad-sheet-title dd {
  color: #f3d28d;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kpi-ribbon {
  left: 252px;
  right: 264px;
  top: 44px;
  gap: 5px;
}

.kpi-item {
  min-height: 40px;
  padding: 5px 6px;
  border-radius: 0;
}

.kpi-item span,
.metric-row span {
  font-size: 10px;
}

.kpi-item strong {
  margin-top: 1px;
  font-size: 14px;
}

.map-mode-switch {
  left: 12px;
  top: 44px;
  border-radius: 0;
}

.map-mode-switch button {
  height: 26px;
  border-radius: 0;
  font-size: 10px;
}

.cad-panel-head {
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(109, 249, 219, 0.18);
  padding: 0 7px;
  color: #bdf7e8;
  font-size: 11px;
}

.cad-panel-head b {
  color: #f3d28d;
}

.cad-resource-matrix {
  left: 12px;
  top: 78px;
  width: 232px;
  bottom: 170px;
  overflow: hidden;
}

.cad-matrix-rows {
  height: calc(100% - 24px);
  overflow: auto;
}

.cad-matrix-rows button {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 44px 28px minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  gap: 1px 6px;
  border: 0;
  border-bottom: 1px solid rgba(122, 166, 158, 0.14);
  background: transparent;
  color: #cceee5;
  text-align: left;
  padding: 6px 7px;
}

.cad-matrix-thumb {
  grid-row: 1 / 4;
  width: 42px;
  min-height: 46px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(109, 249, 219, 0.24);
  background-image:
    linear-gradient(rgba(2, 9, 11, 0.18), rgba(2, 9, 11, 0.48)),
    var(--thumb);
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 18px rgba(109, 249, 219, 0.08);
}

.cad-matrix-thumb b {
  position: absolute;
  right: 3px;
  bottom: 2px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  background: rgba(1, 8, 10, 0.82);
  border: 1px solid rgba(243, 197, 111, 0.44);
  color: #f3d28d;
  font-size: 11px;
}

.cad-matrix-rows i {
  grid-row: 1 / 4;
  display: grid;
  place-items: center;
  border: 1px solid rgba(243, 197, 111, 0.36);
  color: #f3d28d;
  font-size: 10px;
  font-style: normal;
}

.cad-matrix-rows strong {
  font-size: 11px;
}

.cad-matrix-rows > button > span:not(.cad-matrix-thumb),
.cad-matrix-rows em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #8fbfb4;
  font-size: 10px;
  font-style: normal;
}

.cad-index-panel {
  right: 12px;
  top: 78px;
  width: 246px;
  height: 276px;
  overflow: hidden;
}

.cad-index-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 10px;
}

.cad-index-table th,
.cad-index-table td {
  border-bottom: 1px solid rgba(122, 166, 158, 0.14);
  padding: 4px 5px;
  color: #a9d7cc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cad-index-table th {
  color: #f3d28d;
  font-weight: 600;
}

.cad-index-table tr {
  cursor: pointer;
}

.cad-index-table tr:hover td {
  color: #fff4c9;
  background: rgba(243, 197, 111, 0.08);
}

.cad-source-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 6px;
  border-top: 1px solid rgba(109, 249, 219, 0.14);
}

.cad-source-grid span {
  min-height: 32px;
  border: 1px solid rgba(122, 166, 158, 0.16);
  padding: 4px;
  color: #a9d7cc;
  font-size: 10px;
  overflow: hidden;
}

.cad-source-grid b {
  color: #f3d28d;
  margin-right: 4px;
}

.cad-source-grid em {
  display: block;
  color: #6ea79b;
  font-style: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cad-taxonomy-panel {
  left: 12px;
  right: 270px;
  bottom: 44px;
  height: 112px;
}

.cad-taxonomy-grid {
  height: calc(100% - 24px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  padding: 6px;
}

.cad-taxonomy-grid button {
  min-width: 0;
  border: 1px solid rgba(122, 166, 158, 0.2);
  background: rgba(4, 17, 15, 0.56);
  color: #cceee5;
  padding: 6px;
  text-align: left;
  overflow: hidden;
}

.cad-taxonomy-grid strong,
.cad-taxonomy-grid span,
.cad-taxonomy-grid em {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cad-taxonomy-grid strong {
  color: #f3d28d;
  font-size: 11px;
}

.cad-taxonomy-grid span {
  margin-top: 4px;
  color: #a9d7cc;
  font-size: 10px;
  white-space: nowrap;
}

.cad-taxonomy-grid em {
  margin-top: 4px;
  color: #75a79d;
  font-size: 10px;
  font-style: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.cad-atlas-strip {
  right: 12px;
  bottom: 44px;
  width: 246px;
  height: 112px;
}

.cad-atlas-grid {
  height: calc(100% - 24px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 4px;
  padding: 5px;
}

.cad-atlas-grid span {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(122, 166, 158, 0.2);
  background: rgba(2, 9, 11, 0.8);
}

.cad-atlas-grid i {
  position: absolute;
  inset: 0;
  background-image: var(--atlas-image);
  background-size: 400% 200%;
  background-position:
    calc(var(--tile-x, 0) * -100%)
    calc(var(--tile-y, 0) * -100%);
  filter: saturate(1.08) contrast(1.08);
  opacity: 0.8;
}

.cad-atlas-grid b {
  position: absolute;
  left: 3px;
  bottom: 2px;
  padding: 1px 3px;
  background: rgba(1, 8, 10, 0.72);
  color: #f3d28d;
  font-size: 9px;
}

.cad-callout-layer {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

.cad-callout {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 174px;
  min-height: 78px;
  transform: translate(-10px, -10px);
  border: 1px solid rgba(243, 197, 111, 0.34);
  border-radius: 0;
  background: rgba(1, 8, 10, 0.82);
  color: #cceee5;
  padding: 7px 8px;
  text-align: left;
  pointer-events: auto;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28), inset 0 0 18px rgba(243, 197, 111, 0.06);
}

.cad-callout::before {
  content: "";
  position: absolute;
  left: -42px;
  top: 16px;
  width: 42px;
  border-top: 1px solid rgba(243, 197, 111, 0.55);
}

.cad-callout::after {
  content: "";
  position: absolute;
  left: -47px;
  top: 12px;
  width: 8px;
  height: 8px;
  border: 1px solid rgba(243, 197, 111, 0.75);
  border-radius: 50%;
  background: rgba(243, 197, 111, 0.18);
}

.cad-callout i,
.cad-callout strong,
.cad-callout span {
  display: block;
}

.cad-callout i {
  color: #f3d28d;
  font-size: 10px;
  font-style: normal;
}

.cad-callout strong {
  margin-top: 2px;
  color: #fff4c9;
  font-size: 12px;
}

.cad-callout span {
  margin-top: 3px;
  color: #a9d7cc;
  font-size: 10px;
  line-height: 1.3;
}

.cad-callout.c1,
.cad-callout.c3 {
  border-color: rgba(109, 249, 219, 0.34);
}

.cad-callout.c1::before,
.cad-callout.c3::before {
  border-color: rgba(109, 249, 219, 0.52);
}

.screen-chart {
  right: 264px;
  top: 90px;
  width: min(270px, 28%);
  height: 176px;
  border-radius: 0;
}

.focus-popup {
  width: min(460px, 52%);
  right: 264px;
  border-radius: 0;
}

.has-focus .cad-index-panel,
.has-focus .cad-resource-matrix,
.has-focus .cad-taxonomy-panel,
.has-focus .cad-atlas-strip {
  opacity: 0.22;
  pointer-events: none;
}

.map-legend {
  bottom: 10px;
  max-width: calc(100% - 290px);
}

.legend-chip,
.metric-row,
.entry-actions button,
.entry-tabs button,
.source-link,
.cms-lane,
.field-pill,
.project-card,
.chain-search input,
#chainGraph,
.chain-report {
  border-radius: 0;
}

.entry-visual-wrap {
  height: 92px;
  margin-top: 7px;
  border-radius: 0;
}

.detail-title {
  font-size: 16px;
}

.metric-grid {
  gap: 5px;
}

.metric-row {
  min-height: 48px;
  padding: 6px;
}

.bottom-dock {
  grid-template-columns: minmax(0, 1.1fr) minmax(350px, 0.86fr) minmax(250px, 0.5fr);
  gap: 6px;
}

.project-dock,
.chain-dock,
.cms-dock {
  padding: 8px;
}

.project-track {
  grid-auto-columns: minmax(190px, 220px);
  gap: 6px;
}

.project-card {
  height: 136px;
  padding: 7px;
  grid-template-rows: 30px auto 1fr auto;
  gap: 4px;
}

.project-thumb {
  height: 30px;
  border-radius: 0;
}

.project-card h3 {
  font-size: 12px;
}

.project-card p,
.project-meta,
.chain-report,
.cms-lane span,
.field-pill span {
  font-size: 10px;
}

/* v6: map-first reader architecture. The AMap canvas stays clean; dense data moves to rails. */
.scene-panel,
.detail-panel,
.project-dock,
.chain-dock,
.cms-dock,
.taxonomy-dock {
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(109, 249, 219, 0.22);
  background:
    linear-gradient(rgba(2, 9, 11, 0.9), rgba(2, 9, 11, 0.82)),
    repeating-linear-gradient(0deg, transparent 0 23px, rgba(109, 249, 219, 0.06) 23px 24px);
  box-shadow: 0 16px 46px rgba(0, 0, 0, 0.38), inset 0 0 28px rgba(54, 176, 146, 0.06);
  backdrop-filter: blur(18px);
}

.workbench {
  grid-template-columns: 236px minmax(0, 1fr) 318px;
}

.map-stage.is-amap #mapChart,
.map-stage.is-amap .scene-visual {
  display: none;
}

.map-stage:not(.is-amap) .amap-layer {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.amap-layer {
  inset: 46px 8px 38px;
}

.cad-sheet-title {
  left: 8px;
  right: 8px;
  top: 8px;
}

.kpi-ribbon {
  left: 12px;
  right: 12px;
  top: auto;
  bottom: 44px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.map-mode-switch {
  left: 12px;
  top: 44px;
}

.screen-chart {
  display: none;
}

.cad-callout-layer {
  display: none;
}

.cad-resource-matrix.side-cad,
.cad-atlas-strip.side-cad,
.cad-index-panel.rail-cad,
.cad-taxonomy-panel.dock-cad {
  position: relative;
  left: auto;
  right: auto;
  top: auto;
  bottom: auto;
  width: auto;
  max-width: none;
  transform: none;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: auto;
  border-radius: 0;
}

.cad-resource-matrix.side-cad {
  flex: 1 1 160px;
  min-height: 156px;
  height: auto;
  margin-top: 7px;
}

.cad-atlas-strip.side-cad {
  flex: 0 0 92px;
  height: 92px;
  margin-top: 7px;
}

.cad-matrix-rows button {
  min-height: 56px;
}

.cad-atlas-grid {
  gap: 3px;
  padding: 4px;
}

.cad-index-panel.rail-cad {
  height: 198px;
  margin-top: 8px;
  flex: 0 0 auto;
}

.taxonomy-dock {
  padding: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cad-taxonomy-panel.dock-cad {
  height: 100%;
  flex: 1;
}

.cad-taxonomy-panel.dock-cad .cad-taxonomy-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bottom-dock {
  grid-template-columns: minmax(0, 0.98fr) minmax(260px, 0.72fr) minmax(330px, 0.88fr) minmax(218px, 0.48fr);
}

.has-focus .cad-index-panel,
.has-focus .cad-resource-matrix,
.has-focus .cad-taxonomy-panel,
.has-focus .cad-atlas-strip {
  opacity: 1;
  pointer-events: auto;
}

.focus-popup {
  right: 18px;
  bottom: 56px;
  width: min(420px, 48%);
}

.map-legend {
  max-width: calc(100% - 34px);
}

.detail-body {
  flex: 0 1 auto;
  max-height: 260px;
}

@keyframes sweep {
  to {
    transform: translateX(100%);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes markerPulse {
  0%,
  100% {
    box-shadow: 0 0 0 4px rgba(243, 197, 111, 0.12), 0 0 24px var(--marker-color, #6df9db), inset 0 0 18px rgba(255, 244, 201, 0.16);
  }

  50% {
    box-shadow: 0 0 0 10px rgba(243, 197, 111, 0.04), 0 0 34px var(--marker-color, #6df9db), inset 0 0 22px rgba(255, 244, 201, 0.24);
  }
}

/* v11: readability hardening. No low-contrast pale text on translucent panels. */
.one-map-shell {
  color: #102e35;
}

.topbar,
.scene-panel,
.detail-panel,
.project-dock,
.taxonomy-dock,
.chain-dock,
.cms-dock,
.focus-popup,
.entry-profile,
.detail-body .content-block,
.source-box,
.quality-box,
.cad-metric-board,
.cad-resource-matrix,
.cad-atlas-strip,
.cad-index-panel,
.cad-taxonomy-panel,
.panel-screen-chart,
.chain-report {
  background: #ffffff;
  color: #102e35;
  border-color: rgba(20, 94, 105, 0.34);
  box-shadow: 0 10px 26px rgba(31, 72, 82, 0.1);
}

.brand h1,
.panel-head span,
.dock-head span,
.detail-head span,
.cad-panel-head span,
.detail-title,
.project-card h3,
.focus-popup-body h3,
.cad-metric-rows strong,
.cad-matrix-rows strong,
.cad-taxonomy-grid strong,
.company-tile strong,
.cms-lane strong,
.field-pill strong,
.entry-profile b,
.detail-body b,
.content-block b,
.chain-report strong {
  color: #0f2f37;
}

.brand p,
.scene-tab small,
.detail-sub,
.project-card p,
.cad-metric-rows em,
.cad-matrix-rows em,
.cad-taxonomy-grid span,
.source-link span,
.focus-popup-body p,
.focus-popup-body li,
.entry-profile span,
.content-block p,
.content-block li,
.project-meta span,
.tag-line span,
.legend-chip,
.source-box,
.chain-report,
.cms-lane,
.field-pill,
.company-tile,
.metric-row,
.quality-row,
.cad-source-grid span {
  color: #284a52;
}

.scene-tab,
.screen-list button,
.ops-strip button,
.entry-tabs button,
.entry-actions button,
.map-mode-switch button,
.cad-metric-rows button,
.cad-matrix-rows button,
.cad-taxonomy-grid button,
.project-card,
.cms-lane,
.field-pill,
.company-tile,
.metric-row,
.quality-row,
.source-link,
.focus-popup-meta span,
.tag-line span,
.legend-chip,
.chain-search input,
.chain-search button {
  background: #ffffff;
  color: #14363e;
  border-color: rgba(20, 94, 105, 0.34);
}

.scene-tab:hover,
.screen-list button:hover,
.ops-strip button:hover,
.entry-tabs button:hover,
.entry-actions button:hover,
.map-mode-switch button:hover,
.cad-metric-rows button:hover,
.cad-matrix-rows button:hover,
.cad-taxonomy-grid button:hover,
.project-card:hover,
.cms-lane:hover,
.company-tile:hover {
  background: #f2fbfb;
  color: #0d2a31;
  border-color: rgba(198, 79, 46, 0.72);
}

.scene-tab.is-active,
.screen-list button.is-active,
.entry-tabs button.is-active,
.map-mode-switch button.is-active,
.project-card.is-focus,
.cad-matrix-rows button.is-focus,
.cad-taxonomy-grid button.is-focus {
  background: #fff2e8;
  color: #0d2a31;
  border-color: #c64f2e;
}

.kpi-item strong,
.metric-row strong,
.quality-row strong,
.dock-head strong,
.panel-head strong,
.cad-panel-head b,
.focus-popup-body b,
.entry-profile b,
.chain-state,
#chainState,
#cmsState,
#projectTotal {
  color: #9f3414;
}

.cad-source-grid span,
.source-link,
.focus-popup-meta span,
.tag-line span,
.legend-chip,
.project-meta span {
  background: #f6fbfc;
  border-color: rgba(20, 94, 105, 0.28);
  color: #203f47;
}

.chain-search input::placeholder {
  color: #59727a;
}

.map-stage {
  border-color: rgba(20, 94, 105, 0.42);
}

.map-loading {
  background: rgba(255, 255, 255, 0.96);
  color: #102e35;
  border: 1px solid rgba(20, 94, 105, 0.34);
}

.amap-entry-marker span {
  color: #0d2a31;
  background: #ffffff;
  border-color: rgba(20, 94, 105, 0.36);
  font-weight: 700;
}

.cad-title-strip,
.cad-title-strip span,
.cad-title-strip strong {
  color: #f8fffd;
}

.entry-tabs button,
.entry-actions button,
.map-mode-switch button {
  font-weight: 700;
}

@media (max-width: 1280px) {
  .workbench {
    grid-template-columns: 198px minmax(0, 1fr) 300px;
  }

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

  .bottom-dock {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.78fr) minmax(230px, 0.45fr);
  }
}

@media (max-width: 980px) {
  html,
  body {
    overflow: auto;
  }

  .one-map-shell {
    min-height: 100%;
    height: auto;
    grid-template-rows: auto auto auto;
  }

  .topbar,
  .workbench,
  .bottom-dock {
    grid-template-columns: 1fr;
  }

  .topbar {
    gap: 10px;
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
    overflow-x: visible;
    flex-wrap: wrap;
  }

  .workbench {
    min-height: 920px;
  }

  .map-stage {
    min-height: 720px;
  }

  #mapChart,
  .amap-layer {
    inset: 292px 10px 54px;
  }

  .kpi-ribbon {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .screen-chart {
    left: 14px;
    right: 14px;
    top: 222px;
    width: auto;
    height: 126px;
  }

  .focus-popup {
    left: 14px;
    right: 14px;
    bottom: 48px;
    width: auto;
    max-height: 285px;
  }

  .popup-columns {
    grid-template-columns: 1fr;
  }

  .map-mode-switch {
    left: 14px;
    right: 14px;
    top: 176px;
    overflow-x: auto;
  }

  .map-legend {
    max-width: calc(100% - 28px);
  }

  .scene-panel,
  .detail-panel,
  .project-dock,
  .chain-dock,
  .cms-dock {
    min-height: 220px;
  }

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

  .cad-sheet-title {
    left: 10px;
    right: 10px;
    top: 10px;
    height: auto;
    min-height: 42px;
    align-items: flex-start;
    padding: 7px;
    display: grid;
  }

  .cad-sheet-title span,
  .cad-sheet-title dl {
    display: none;
  }

  .cad-resource-matrix,
  .cad-index-panel,
  .cad-atlas-strip,
  .cad-callout-layer {
    display: none;
  }

  .cad-taxonomy-panel {
    left: 10px;
    right: 10px;
    bottom: 48px;
    height: 118px;
  }

  .cad-taxonomy-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-ribbon {
    left: 10px;
    right: 10px;
    top: 60px;
  }

  .map-mode-switch {
    top: 206px;
  }

  #mapChart,
  .amap-layer {
    inset: 250px 10px 176px;
  }

  .focus-popup {
    left: 10px;
    right: 10px;
    width: auto;
  }
}

/* v7: map-first reader. AMap is the single default canvas; data density lives in rails. */
.one-map-shell {
  grid-template-rows: 52px minmax(0, 1fr) 168px;
}

.workbench {
  grid-template-columns: 248px minmax(0, 1fr) 330px;
}

.bottom-dock {
  grid-template-columns: minmax(0, 1.05fr) minmax(260px, 0.72fr) minmax(330px, 0.9fr) minmax(220px, 0.48fr);
}

.scene-panel,
.detail-panel {
  overflow: auto;
}

.map-stage {
  isolation: isolate;
}

#mapChart,
.amap-layer {
  inset: 42px 8px 34px;
}

.cad-sheet-title {
  left: 8px;
  right: 8px;
  top: 8px;
  height: 28px;
  z-index: 4;
}

.cad-sheet-title span {
  max-width: 360px;
  display: inline-block;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-mode-switch {
  left: 12px;
  top: 46px;
  z-index: 4;
}

.map-legend {
  left: 12px;
  bottom: 8px;
  max-width: calc(100% - 154px);
}

.map-readout {
  right: 12px;
  bottom: 8px;
}

.kpi-ribbon.side-kpi {
  position: relative;
  left: auto;
  right: auto;
  top: auto;
  bottom: auto;
  z-index: auto;
  pointer-events: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin-top: 7px;
}

.side-kpi .kpi-item {
  min-height: 42px;
  padding: 6px;
}

.side-kpi .kpi-item strong {
  font-size: 13px;
}

.cad-metric-board {
  position: relative;
  flex: 0 0 132px;
  min-height: 132px;
  margin-top: 7px;
  border: 1px solid rgba(109, 249, 219, 0.26);
  background: rgba(1, 8, 10, 0.78);
  box-shadow: inset 0 0 20px rgba(109, 249, 219, 0.06);
  overflow: hidden;
}

.cad-metric-rows {
  height: calc(100% - 24px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 5px;
  overflow: auto;
}

.cad-metric-rows button {
  min-width: 0;
  min-height: 44px;
  border: 1px solid rgba(122, 166, 158, 0.18);
  background: rgba(4, 17, 15, 0.54);
  color: #cceee5;
  padding: 5px;
  text-align: left;
}

.cad-metric-rows strong,
.cad-metric-rows span,
.cad-metric-rows em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cad-metric-rows strong {
  color: #f3d28d;
  font-size: 10px;
}

.cad-metric-rows span {
  margin-top: 2px;
  color: #e8f3ee;
  font-size: 12px;
}

.cad-metric-rows em {
  margin-top: 2px;
  color: #75a79d;
  font-size: 9px;
  font-style: normal;
}

.cad-resource-matrix.side-cad {
  flex: 0 0 150px;
  min-height: 150px;
}

.cad-atlas-strip.side-cad {
  flex: 0 0 82px;
  height: 82px;
}

.cad-index-panel.rail-cad {
  flex: 0 0 176px;
  height: 176px;
}

.panel-screen-chart {
  display: block;
  position: relative;
  left: auto;
  right: auto;
  top: auto;
  bottom: auto;
  width: 100%;
  height: 158px;
  flex: 0 0 158px;
  margin-top: 8px;
  z-index: auto;
}

.has-focus .panel-screen-chart {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
}

.detail-body {
  flex: 1 1 auto;
  max-height: none;
}

.focus-popup {
  right: 12px;
  bottom: 44px;
  width: min(390px, 44%);
  max-height: min(360px, calc(100% - 104px));
}

.focus-popup-body {
  max-height: calc(min(360px, 100vh - 230px) - 34px);
}

.amap-entry-marker {
  width: 24px;
  height: 24px;
}

.amap-entry-marker i {
  width: 14px;
  height: 14px;
  display: grid;
  place-items: center;
  color: #07100f;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.amap-entry-marker span {
  opacity: 0;
  transform: translate(4px, -50%);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.amap-entry-marker:hover span,
.amap-entry-marker.is-focus span {
  opacity: 1;
  transform: translate(0, -50%);
}

.focus-beam {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  width: 82px;
  height: 82px;
  display: none;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.focus-beam.is-on {
  display: block;
}

.focus-beam::before,
.focus-beam::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(243, 197, 111, 0.74);
  box-shadow: 0 0 26px rgba(243, 197, 111, 0.34);
}

.focus-beam::before {
  border-radius: 50%;
  animation: focusRing 1.25s ease-out infinite;
}

.focus-beam::after {
  inset: 31px;
  border-radius: 2px;
  transform: rotate(45deg);
  background:
    linear-gradient(90deg, transparent 45%, rgba(243, 197, 111, 0.85) 46% 54%, transparent 55%),
    linear-gradient(transparent 45%, rgba(243, 197, 111, 0.85) 46% 54%, transparent 55%);
}

.cad-matrix-rows button.is-focus,
.cad-taxonomy-grid button.is-focus,
.cad-index-table tr.is-focus td,
.cad-metric-rows button:hover {
  color: #fff4c9;
  border-color: rgba(243, 197, 111, 0.58);
  background: rgba(243, 197, 111, 0.08);
  box-shadow: inset 0 0 18px rgba(243, 197, 111, 0.08);
}

.cad-matrix-rows button.is-focus i {
  border-color: rgba(255, 244, 201, 0.82);
  color: #fff4c9;
}

@keyframes focusRing {
  0% {
    opacity: 0.92;
    transform: scale(0.42);
  }

  100% {
    opacity: 0;
    transform: scale(1.22);
  }
}

@media (max-width: 1280px) {
  .workbench {
    grid-template-columns: 236px minmax(0, 1fr) 318px;
  }

  .cad-sheet-title dl {
    display: none;
  }
}

@media (max-width: 980px) {
  #mapChart,
  .amap-layer {
    inset: 74px 10px 48px;
  }

  .map-mode-switch {
    top: 48px;
  }

  .panel-screen-chart {
    height: 142px;
    flex-basis: 142px;
  }

  .cad-metric-board,
  .cad-resource-matrix.side-cad,
  .cad-atlas-strip.side-cad,
  .cad-index-panel.rail-cad {
    display: block;
  }
}

/* v9: stable AMap reader. Keep the default AMap tile readable, then style it lightly. */
.map-stage.is-amap-dark .amap-layer,
.map-stage.is-amap-dark .amap-layer .amap-layers {
  filter: none !important;
}

.map-stage.is-amap-dark .amap-layer canvas,
.map-stage.is-amap-dark .amap-layer img {
  filter: invert(0.92) hue-rotate(180deg) brightness(0.82) contrast(1.04) saturate(0.72) !important;
}

.map-stage.is-amap-dark .amap-layer {
  opacity: 1;
  background:
    linear-gradient(90deg, rgba(109, 249, 219, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(109, 249, 219, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  box-shadow:
    inset 0 0 0 1px rgba(109, 249, 219, 0.22),
    inset 0 0 80px rgba(0, 0, 0, 0.28);
}

.cad-matrix-rows button {
  grid-template-columns: 44px 28px minmax(0, 1fr);
  min-height: 58px;
}

.cad-matrix-rows button.is-focus .cad-matrix-thumb,
.cad-matrix-rows button:hover .cad-matrix-thumb {
  border-color: rgba(243, 197, 111, 0.62);
  box-shadow: inset 0 0 18px rgba(243, 197, 111, 0.08), 0 0 18px rgba(243, 197, 111, 0.12);
}

/* v10: bureau-facing report board. Lighter surface, stronger category markers. */
body {
  background: #f4f7fb;
  color: #1d3137;
}

#particles-js,
.scanline,
.cursor-orbit {
  opacity: 0.22;
}

.one-map-shell {
  background:
    linear-gradient(90deg, rgba(15, 147, 146, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(15, 147, 146, 0.05) 1px, transparent 1px),
    #f4f7fb;
  background-size: 40px 40px;
}

.topbar,
.scene-panel,
.detail-panel,
.project-dock,
.taxonomy-dock,
.chain-dock,
.cms-dock {
  border-color: rgba(36, 120, 128, 0.2);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 28px rgba(22, 65, 76, 0.08);
  color: #1d3137;
}

.brand h1,
.panel-head span,
.dock-head span,
.detail-head span,
.cad-panel-head span,
.detail-title,
.project-card h3,
.focus-popup-body h3 {
  color: #16373d;
}

.brand p,
.scene-tab small,
.detail-sub,
.project-card p,
.cad-metric-rows em,
.cad-matrix-rows em,
.cad-taxonomy-grid span,
.source-link span {
  color: #4c7278;
}

.tenant-switch,
.icon-btn,
.ghost-link,
.ops-strip button,
.screen-list button,
.entry-tabs button,
.entry-actions button,
.map-mode-switch button,
.chain-search input,
.chain-search button,
.cms-lane,
.field-pill,
.company-tile,
.project-card,
.quality-box,
.source-box,
.cad-metric-board,
.cad-resource-matrix,
.cad-atlas-strip,
.cad-index-panel,
.cad-taxonomy-panel,
.panel-screen-chart,
.detail-body .content-block,
.entry-profile,
.focus-popup {
  border-color: rgba(36, 120, 128, 0.2);
  background: rgba(255, 255, 255, 0.88);
  color: #1d3137;
}

.scene-tab.is-active,
.screen-list button.is-active,
.entry-tabs button.is-active,
.map-mode-switch button.is-active,
.project-card.is-focus,
.cad-matrix-rows button.is-focus,
.cad-taxonomy-grid button.is-focus,
.cms-lane:hover {
  border-color: rgba(224, 91, 46, 0.68);
  background: linear-gradient(135deg, rgba(255, 244, 232, 0.96), rgba(232, 250, 248, 0.92));
  box-shadow: 0 10px 24px rgba(224, 91, 46, 0.12);
}

.scene-tab,
.screen-list button,
.cad-metric-rows button,
.cad-matrix-rows button,
.cad-taxonomy-grid button,
.project-card,
.cms-lane,
.field-pill,
.company-tile,
.metric-row {
  background: rgba(255, 255, 255, 0.92);
  color: #203b42;
}

.cad-metric-rows span,
.cad-matrix-rows strong,
.cad-taxonomy-grid strong,
.project-card h3,
.company-tile strong,
.cms-lane strong,
.field-pill strong,
.detail-body,
.focus-popup-body,
.source-box,
.chain-report {
  color: #203b42;
}

.focus-popup-body p,
.focus-popup-body li,
.entry-profile span,
.content-block p,
.content-block li,
.source-link span,
.detail-sub,
.project-card p {
  color: #466970;
}

.focus-popup-meta span,
.tag-line span,
.legend-chip,
.project-meta span {
  color: #24474d;
}

.screen-list button.is-active,
.cad-metric-rows button:hover,
.cad-matrix-rows button:hover,
.project-card:hover {
  color: #16373d;
}

.map-stage {
  border-color: rgba(36, 120, 128, 0.26);
  background:
    linear-gradient(90deg, rgba(23, 114, 124, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(23, 114, 124, 0.08) 1px, transparent 1px),
    #edf4f4;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72), 0 14px 34px rgba(31, 74, 84, 0.12);
}

.stage-grid,
.stage-glow {
  opacity: 0.18;
}

.map-stage.is-amap-dark .amap-layer canvas,
.map-stage.is-amap-dark .amap-layer img {
  filter: saturate(1.02) contrast(1.01) brightness(1.01) !important;
}

.map-stage.is-amap-dark .amap-layer {
  background:
    linear-gradient(90deg, rgba(15, 147, 146, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(15, 147, 146, 0.08) 1px, transparent 1px);
  background-size: 54px 54px;
  box-shadow:
    inset 0 0 0 1px rgba(36, 120, 128, 0.24),
    inset 0 0 60px rgba(255, 255, 255, 0.18);
}

.kpi-item,
.metric-row,
.quality-row,
.cad-source-grid span,
.source-link,
.focus-popup-meta span,
.tag-line span,
.legend-chip {
  border-color: rgba(36, 120, 128, 0.18);
  background: rgba(247, 252, 253, 0.86);
  color: #24474d;
}

.kpi-item strong,
.metric-row strong,
.quality-row strong,
.dock-head strong,
.panel-head strong,
.cad-panel-head b,
.focus-popup-body b,
.entry-profile b {
  color: #c64f2e;
}

.amap-entry-marker {
  width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.amap-entry-marker img {
  width: 42px;
  height: 42px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(18, 43, 50, 0.24));
  transform-origin: 50% 82%;
  animation: markerPulse 2.2s ease-in-out infinite;
}

.amap-entry-marker i {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 16px rgba(18, 43, 50, 0.2);
}

.amap-entry-marker span {
  left: 36px;
  color: #17363d;
  border-color: rgba(36, 120, 128, 0.24);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 18px rgba(18, 43, 50, 0.12);
}

.amap-entry-marker.is-focus img {
  transform: scale(1.16);
  filter: drop-shadow(0 10px 18px rgba(198, 79, 46, 0.42));
}

.focus-beam::before,
.focus-beam::after {
  border-color: rgba(198, 79, 46, 0.8);
  box-shadow: 0 0 30px rgba(198, 79, 46, 0.26);
}

@keyframes markerPulse {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-2px) scale(1.04);
  }
}

/* v12: leadership-screen contrast pass. Decorative glow stays decorative; data text must read first. */
.one-map-shell,
.one-map-shell button,
.one-map-shell input,
.one-map-shell table,
.one-map-shell th,
.one-map-shell td {
  color: #102e35 !important;
}

.topbar,
.scene-panel,
.detail-panel,
.project-dock,
.taxonomy-dock,
.chain-dock,
.cms-dock,
.focus-popup,
.entry-profile,
.detail-body .content-block,
.source-box,
.quality-box,
.cad-metric-board,
.cad-resource-matrix,
.cad-atlas-strip,
.cad-index-panel,
.cad-taxonomy-panel,
.panel-screen-chart,
.chain-report {
  background: #fff !important;
  color: #102e35 !important;
  border-color: rgba(15, 73, 84, .42) !important;
}

.topbar *,
.scene-panel *,
.detail-panel *,
.project-dock *,
.taxonomy-dock *,
.chain-dock *,
.cms-dock *,
.focus-popup *,
.entry-profile *,
.detail-body .content-block *,
.source-box *,
.quality-box *,
.cad-metric-board *,
.cad-resource-matrix *,
.cad-atlas-strip *,
.cad-index-panel *,
.cad-taxonomy-panel *,
.panel-screen-chart *,
.chain-report * {
  color: #102e35 !important;
}

.brand p,
.detail-sub,
.scene-tab small,
.project-card p,
.content-block p,
.content-block li,
.focus-popup-body p,
.focus-popup-body li,
.entry-profile span,
.source-link span,
.cad-metric-rows em,
.cad-matrix-rows em,
.cad-taxonomy-grid span,
.project-meta span,
.tag-line span,
.legend-chip {
  color: #274b54 !important;
}

.kpi-item strong,
.metric-row strong,
.quality-row strong,
.panel-head strong,
.detail-head strong,
.dock-head strong,
.cad-panel-head b,
.cad-panel-head strong,
.focus-popup-body b,
.entry-profile b,
.project-card strong,
.project-meta strong,
.cad-source-grid b,
.cad-source-grid strong,
.source-title strong,
.detail-title,
.project-card h3,
.focus-popup-body h3,
th,
.project-table th {
  color: #8f2f13 !important;
}

.panel-head,
.detail-head,
.dock-head,
.cad-panel-head,
.source-title {
  background: #f5fbfc !important;
  color: #102e35 !important;
  border-bottom: 1px solid rgba(15, 73, 84, .28) !important;
}

.cad-sheet-title {
  background: #16373d !important;
  color: #fff !important;
  border-color: #16373d !important;
}

.cad-sheet-title * {
  color: #fff !important;
}

.map-readout {
  background: #16373d !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, .86) !important;
  box-shadow: 0 8px 18px rgba(15, 47, 55, .22) !important;
}

.map-readout * {
  color: #fff !important;
}

.cad-source-grid span,
.source-link,
.focus-popup-meta span,
.tag-line span,
.legend-chip,
.project-meta span,
.metric-row,
.quality-row {
  background: #f7fbfc !important;
  color: #203f47 !important;
  border-color: rgba(15, 73, 84, .3) !important;
}

.project-meta strong,
.cad-source-grid b,
.cad-source-grid strong {
  color: #8f2f13 !important;
}

.project-table td,
.cad-source-grid td,
.cad-resource-matrix td,
.cad-resource-matrix th {
  color: #102e35 !important;
}

.project-table td,
.cad-source-grid td {
  background: #fff !important;
}

.scene-tab,
.screen-list button,
.ops-strip button,
.entry-tabs button,
.entry-actions button,
.map-mode-switch button,
.cad-metric-rows button,
.cad-matrix-rows button,
.cad-taxonomy-grid button,
.project-card,
.cms-lane,
.field-pill,
.company-tile,
.chain-search input,
.chain-search button {
  background: #fff !important;
  color: #102e35 !important;
  border-color: rgba(15, 73, 84, .36) !important;
}

.scene-tab.is-active,
.screen-list button.is-active,
.entry-tabs button.is-active,
.map-mode-switch button.is-active,
.project-card.is-focus,
.cad-matrix-rows button.is-focus,
.cad-taxonomy-grid button.is-focus {
  background: #fff0e5 !important;
  color: #102e35 !important;
  border-color: #b9441c !important;
}

.chain-search input::placeholder {
  color: #5c737b !important;
}

.amap-entry-marker span {
  background: #fff !important;
  color: #0d2a31 !important;
  border-color: rgba(15, 73, 84, .42) !important;
  font-weight: 700 !important;
}

.map-loading {
  background: #fff !important;
  color: #102e35 !important;
  border-color: rgba(15, 73, 84, .42) !important;
}

.cad-atlas-grid span,
.cad-atlas-grid b {
  color: #fff !important;
}

#chainGraph {
  background: #f7fbfc !important;
  border-color: rgba(15, 73, 84, .32) !important;
}

/* v13: mobile is a field reader, not a shrunken wall display. */
@media (max-width: 980px) {
  html,
  body {
    width: 100%;
    min-width: 0;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
  }

  #particles-js,
  .cursor-orbit {
    display: none;
  }

  .one-map-shell {
    width: 100%;
    min-width: 0;
    min-height: 100dvh;
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    overflow-x: hidden;
    box-sizing: border-box;
  }

  .topbar,
  .workbench,
  .bottom-dock,
  .scene-panel,
  .detail-panel,
  .project-dock,
  .taxonomy-dock,
  .chain-dock,
  .cms-dock,
  .map-stage {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 9px;
  }

  .brand {
    width: 100%;
  }

  .brand h1 {
    font-size: 17px;
  }

  .top-actions {
    width: 100%;
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .top-actions::-webkit-scrollbar {
    display: none;
  }

  .tenant-switch,
  .icon-btn,
  .ghost-link {
    min-height: 32px;
    padding-inline: 10px;
  }

  .tenant-switch {
    grid-template-columns: 32px auto;
  }

  .workbench {
    display: flex;
    flex-direction: column;
    min-height: 0;
    gap: 8px;
  }

  .map-stage {
    order: 1;
    height: clamp(460px, 68vh, 620px);
    min-height: 460px !important;
    overflow: hidden;
  }

  .scene-panel {
    order: 2;
  }

  .detail-panel {
    order: 3;
  }

  .scene-panel,
  .detail-panel {
    min-height: 0 !important;
    max-height: none;
    overflow: visible;
    padding: 9px;
  }

  #mapChart,
  .amap-layer {
    inset: 82px 6px 44px !important;
    width: auto !important;
    height: auto !important;
  }

  .cad-sheet-title {
    left: 6px !important;
    right: 6px !important;
    top: 6px !important;
    min-height: 36px;
    height: auto !important;
    display: flex !important;
    align-items: center !important;
    padding: 6px 8px !important;
    gap: 6px;
  }

  .cad-sheet-title strong {
    font-size: 12px;
    line-height: 1.25;
  }

  .cad-sheet-title span,
  .cad-sheet-title dl {
    display: none !important;
  }

  .map-mode-switch {
    left: 6px !important;
    right: 6px !important;
    top: 48px !important;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    overflow: hidden;
  }

  .map-mode-switch button {
    min-width: 0;
    padding-inline: 4px;
    font-size: 11px;
  }

  .map-legend {
    left: 6px !important;
    right: auto !important;
    bottom: 6px !important;
    max-width: calc(100% - 118px) !important;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }

  .map-legend::-webkit-scrollbar {
    display: none;
  }

  .map-readout {
    right: 6px !important;
    bottom: 6px !important;
    max-width: 108px;
  }

  .focus-popup {
    left: 8px !important;
    right: 8px !important;
    bottom: 44px !important;
    width: auto !important;
    max-height: min(360px, 58%) !important;
    overflow: auto;
  }

  .amap-entry-marker span {
    display: none;
  }

  .amap-entry-marker.is-focus span {
    display: block;
    max-width: 116px;
  }

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

  .scene-tab {
    min-height: 48px;
  }

  .ops-strip,
  .screen-list,
  .entry-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .screen-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-ribbon.side-kpi,
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .cad-resource-matrix,
  .cad-atlas-strip,
  .cad-index-panel,
  .cad-taxonomy-panel {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    width: 100% !important;
    margin-top: 8px;
  }

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

  .entry-visual-wrap {
    height: 140px;
  }

  .panel-screen-chart {
    height: 150px !important;
    flex-basis: 150px !important;
  }

  .bottom-dock {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    overflow: visible;
  }

  .project-dock,
  .taxonomy-dock,
  .chain-dock,
  .cms-dock {
    min-height: 0 !important;
    height: auto;
    overflow: visible;
    padding: 9px;
  }

  .project-track {
    grid-auto-columns: minmax(210px, 78vw);
    overflow-x: auto;
  }

  .chain-search {
    grid-template-columns: minmax(0, 1fr) 58px 58px;
  }

  .chain-result {
    height: auto;
    display: grid;
    grid-template-columns: 1fr;
  }

  #chainGraph,
  .chain-report {
    min-height: 180px;
    height: 180px;
  }
}

@media (max-width: 520px) {
  .one-map-shell {
    padding: 6px;
    gap: 6px;
  }

  .topbar {
    padding: 8px;
  }

  .brand-mark {
    width: 28px;
    height: 28px;
  }

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

  .brand p {
    font-size: 11px;
  }

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

  .scene-panel,
  .detail-panel,
  .project-dock,
  .taxonomy-dock,
  .chain-dock,
  .cms-dock {
    padding: 8px;
  }

  .cad-metric-rows,
  .cad-matrix-rows,
  .cad-taxonomy-grid {
    grid-template-columns: 1fr !important;
  }

  .cad-resource-matrix.side-cad,
  .cad-atlas-strip.side-cad,
  .cad-index-panel.rail-cad {
    display: none !important;
  }

  .entry-visual-wrap {
    height: 124px;
  }

  .project-card {
    height: 132px;
  }
}
