/* Air-ground last-mile simulation view, isolated from shared sand-table styles. */

.app-shell[data-active-view="simulation"] .air-ground-terminal-view,
.app-shell[data-active-view="inbound"] .air-ground-terminal-view,
.app-shell[data-active-view="twin"] .air-ground-terminal-view,
.app-shell[data-active-view="sorting"] .air-ground-terminal-view,
.app-shell[data-active-view="packing"] .air-ground-terminal-view,
.app-shell[data-active-view="route-opt"] .air-ground-terminal-view,
.app-shell[data-active-view="multi-agent"] .air-ground-terminal-view,
.app-shell[data-active-view="v2x"] .air-ground-terminal-view {
  display: none;
}

.app-shell[data-active-view="air-ground"] .decision-grid,
.app-shell[data-active-view="air-ground"] .insight-grid,
.app-shell[data-active-view="air-ground"] .digital-twin-view,
.app-shell[data-active-view="air-ground"] .inbound-identity-view,
.app-shell[data-active-view="air-ground"] .visual-sorting-view,
.app-shell[data-active-view="air-ground"] .flexible-packaging-view,
.app-shell[data-active-view="air-ground"] .route-optimization-view,
.app-shell[data-active-view="air-ground"] .multi-agent-dispatch-view,
.app-shell[data-active-view="air-ground"] .v2x-transport-view {
  display: none;
}

.air-ground-terminal-view {
  margin-top: 16px;
}

.airground-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(56, 189, 248, 0.24);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(239, 249, 255, 0.96)),
    #ffffff;
  box-shadow: 0 14px 36px rgba(9, 24, 44, 0.1);
}

.airground-hero h2 {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: clamp(1.5rem, 2vw, 2rem);
  letter-spacing: 0;
}

.airground-hero p:last-child {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

.airground-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid rgba(56, 189, 248, 0.38);
  border-radius: var(--radius);
  background: #eff9ff;
  color: #0369a1;
  font-weight: 950;
  white-space: nowrap;
}

.airground-status-pill span {
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 999px;
  background: #38bdf8;
  box-shadow: 0 0 0 6px rgba(56, 189, 248, 0.14);
}

.airground-status-pill.is-blocked {
  border-color: rgba(225, 75, 75, 0.28);
  background: #fff1f0;
  color: #a62626;
}

.airground-status-pill.is-blocked span {
  background: var(--alert);
  box-shadow: 0 0 0 6px rgba(225, 75, 75, 0.12);
}

.airground-layout {
  display: grid;
  grid-template-columns: minmax(760px, 1fr) 390px;
  gap: 16px;
  align-items: start;
}

.airground-stage-card,
.airground-console .panel {
  border: 1px solid rgba(9, 24, 44, 0.1);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.airground-stage-card {
  min-width: 0;
  padding: 16px;
}

.airground-stage-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 12px;
}

.airground-stage-head h2,
.airground-console h2 {
  margin-bottom: 6px;
  font-size: 1.1rem;
}

.airground-score {
  display: grid;
  min-width: 136px;
  padding: 10px 12px;
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: var(--radius);
  background: #eff9ff;
}

.airground-score span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.airground-score strong {
  color: #0369a1;
  font-size: 1.8rem;
  line-height: 1;
}

.airground-scene {
  position: relative;
  min-height: 590px;
  overflow: hidden;
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: var(--radius);
  background: #dff4ff;
}

.airground-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(4, 28, 44, 0.1), rgba(4, 28, 44, 0) 48%, rgba(255, 255, 255, 0.1)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(12, 74, 110, 0.1));
  pointer-events: none;
}

.airground-scene-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

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

.airground-svg marker path {
  fill: currentColor;
}

.airground-path,
.airground-link {
  fill: none;
  opacity: 0;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity 180ms ease, stroke-width 180ms ease;
}

.airground-path {
  stroke-width: 4;
}

.airground-link {
  stroke-width: 4;
  stroke-dasharray: 7 10;
}

.airground-ground-path {
  color: #34d399;
  stroke: currentColor;
  marker-end: url("#airgroundArrow");
}

.airground-air-path {
  color: #38bdf8;
  stroke: currentColor;
  marker-end: url("#airgroundArrow");
}

.airground-handoff-path {
  color: #fbbf24;
  stroke: currentColor;
  marker-end: url("#airgroundArrow");
}

.airground-blocked-path {
  color: var(--alert);
  stroke: currentColor;
  stroke-dasharray: 12 10;
}

.airground-link {
  color: #93c5fd;
  stroke: currentColor;
}

.airground-scene:not(.waiting) .airground-path,
.airground-scene:not(.waiting) .airground-link {
  opacity: 0.48;
}

.airground-scene.airground-dispatch .airground-path,
.airground-scene.airground-handoff .airground-path,
.airground-scene.airground-takeoff .airground-path,
.airground-scene.airground-deliver .airground-path,
.airground-scene.airground-review .airground-path,
.airground-scene.airground-dispatch .airground-link,
.airground-scene.airground-handoff .airground-link,
.airground-scene.airground-takeoff .airground-link,
.airground-scene.airground-deliver .airground-link,
.airground-scene.airground-review .airground-link {
  opacity: 0.82;
}

.airground-scene.case-campus .airground-air-path,
.airground-scene.case-community .airground-handoff-path,
.airground-scene.case-urgent .airground-air-path,
.airground-scene.case-weather .airground-ground-path {
  opacity: 1;
  stroke-width: 7;
  filter: url("#airgroundGlow");
}

.airground-scene.airground-blocked .airground-blocked-path {
  opacity: 1;
  stroke-width: 8;
  filter: url("#airgroundGlow");
}

.airground-pulse {
  fill: #ffffff;
  opacity: 0;
  stroke: #38bdf8;
  stroke-width: 4;
  filter: url("#airgroundGlow");
}

.airground-scene.airground-takeoff .airground-pulse,
.airground-scene.airground-deliver .airground-pulse,
.airground-scene.airground-review .airground-pulse,
.airground-scene.airground-blocked .airground-pulse {
  opacity: 1;
}

.airground-sky-zone,
.airground-card,
.airground-node {
  position: absolute;
  z-index: 5;
}

.airground-sky-zone {
  left: 45%;
  top: 10%;
  width: 34%;
  height: 24%;
  border-radius: 50%;
  border: 2px dashed rgba(56, 189, 248, 0.72);
  background:
    radial-gradient(circle at 50% 50%, rgba(56, 189, 248, 0.16), rgba(56, 189, 248, 0.06) 48%, rgba(56, 189, 248, 0) 72%);
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 180ms ease, transform 180ms ease, border-color 180ms ease;
}

.airground-sky-zone span {
  position: absolute;
  left: 31%;
  top: -10px;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.9);
  color: #0369a1;
  font-size: 0.74rem;
  font-weight: 950;
  white-space: nowrap;
}

.airground-scene.airground-takeoff .airground-sky-zone,
.airground-scene.airground-deliver .airground-sky-zone,
.airground-scene.airground-review .airground-sky-zone,
.airground-scene.airground-blocked .airground-sky-zone {
  opacity: 1;
}

.airground-scene.airground-blocked .airground-sky-zone {
  border-color: rgba(225, 75, 75, 0.76);
  transform: scale(1.08);
}

.airground-card {
  width: 220px;
  padding: 12px;
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 28px rgba(9, 24, 44, 0.12);
}

.airground-command-card {
  left: 28px;
  top: 26px;
}

.airground-sky-card {
  right: 28px;
  top: 26px;
  border-color: rgba(56, 189, 248, 0.36);
  background: rgba(239, 249, 255, 0.92);
}

.airground-reason-card {
  left: 28px;
  bottom: 30px;
  border-color: rgba(244, 165, 28, 0.36);
  background: rgba(255, 249, 235, 0.92);
}

.airground-card p {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.airground-card strong {
  color: var(--ink);
  font-size: 1rem;
}

.airground-node {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.76);
  border-radius: 50%;
  background: #0369a1;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 950;
  box-shadow: 0 8px 22px rgba(9, 24, 44, 0.22);
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 180ms ease, transform 180ms ease;
}

.airground-scene:not(.waiting) .airground-node {
  opacity: 1;
  transform: scale(1);
}

.airground-node-vehicle {
  left: 55%;
  bottom: 23%;
  background: #2563eb;
}

.airground-node-drone {
  right: 18%;
  top: 12%;
  background: #38bdf8;
}

.airground-node-locker {
  left: 39%;
  bottom: 32%;
  background: #10b981;
}

.airground-node-cloud {
  left: 19%;
  top: 17%;
  background: #7c3aed;
}

.airground-node-pad {
  right: 26%;
  bottom: 16%;
  background: #f59e0b;
}

.airground-flow {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.airground-flow li {
  min-height: 74px;
  padding: 10px;
  border: 1px solid rgba(9, 24, 44, 0.09);
  border-radius: var(--radius);
  background: #f7fbff;
  color: #31516b;
}

.airground-flow li.is-active {
  border-color: rgba(56, 189, 248, 0.38);
  background: #eff9ff;
  box-shadow: inset 0 0 0 2px rgba(56, 189, 248, 0.08);
}

.airground-flow li.is-done {
  border-color: rgba(39, 189, 117, 0.28);
  background: #f0fbf5;
}

.airground-flow li.is-error {
  border-color: rgba(225, 75, 75, 0.32);
  background: #fff5f3;
}

.airground-flow span {
  display: block;
  margin-bottom: 6px;
  color: #0369a1;
  font-size: 0.74rem;
  font-weight: 950;
}

.airground-flow strong {
  display: block;
  font-size: 0.86rem;
  line-height: 1.35;
}

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

.airground-lesson-grid article {
  min-height: 104px;
  padding: 12px;
  border: 1px solid rgba(9, 24, 44, 0.08);
  border-radius: var(--radius);
  background: #fbfdff;
}

.airground-lesson-grid span {
  display: block;
  margin-bottom: 6px;
  color: #0369a1;
  font-size: 0.78rem;
  font-weight: 950;
}

.airground-lesson-grid p {
  margin: 0;
  color: var(--dock-slate);
  font-size: 0.9rem;
  line-height: 1.5;
}

.airground-console {
  display: grid;
  gap: 12px;
}

.airground-console .panel {
  padding: 14px;
}

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

.airground-data-grid article {
  display: grid;
  min-height: 82px;
  align-content: center;
  padding: 10px;
  border: 1px solid rgba(9, 24, 44, 0.08);
  border-radius: var(--radius);
  background: #f7fbff;
}

.airground-data-grid span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
}

.airground-data-grid strong {
  margin-top: 4px;
  color: var(--ink);
  font-size: 1.02rem;
}

.airground-fleet-head,
.airground-weight-head,
.airground-reason-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

#airgroundModeBadge,
#airgroundReasonBadge,
#airgroundPlanBadge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eff9ff;
  color: #0369a1;
  font-size: 0.74rem;
  font-weight: 950;
  white-space: nowrap;
}

.airground-weight-panel.is-risk #airgroundReasonBadge,
.airground-reason-panel.is-risk #airgroundPlanBadge {
  background: #fff4e5;
  color: #9a5400;
}

.airground-weight-panel.is-blocked #airgroundReasonBadge,
.airground-reason-panel.is-blocked #airgroundPlanBadge {
  background: #fff1f0;
  color: #a62626;
}

.airground-fleet {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.airground-fleet article {
  display: grid;
  gap: 5px;
  min-height: 78px;
  padding: 10px;
  border: 1px solid rgba(9, 24, 44, 0.08);
  border-radius: var(--radius);
  background: #fbfdff;
}

.airground-fleet span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
}

.airground-fleet strong {
  color: var(--ink);
  font-size: 0.96rem;
}

.airground-fleet i {
  display: block;
  width: var(--load, 0%);
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #38bdf8, #34d399);
  transition: width 260ms ease;
}

.airground-formula {
  margin-bottom: 10px;
  padding: 9px 10px;
  border-radius: var(--radius);
  background: #f4f8fd;
  color: #31516b;
  font-size: 0.84rem;
  font-weight: 900;
}

.airground-weight-list {
  display: grid;
  gap: 9px;
}

.airground-weight-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 88px 42px;
  gap: 8px;
  align-items: center;
  padding: 9px;
  border: 1px solid rgba(9, 24, 44, 0.08);
  border-radius: var(--radius);
  background: #fbfdff;
}

.airground-weight-row strong,
.airground-weight-row span,
.airground-weight-row em {
  display: block;
}

.airground-weight-row strong {
  color: var(--ink);
  font-size: 0.86rem;
}

.airground-weight-row span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.25;
}

.airground-weight-row em {
  color: #0369a1;
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 950;
  text-align: right;
}

.airground-weight-meter {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbe8f4;
}

.airground-weight-meter i {
  display: block;
  width: var(--weight, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #38bdf8, #34d399);
  transition: width 260ms ease;
}

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

.airground-check-list li {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid rgba(9, 24, 44, 0.08);
  border-radius: var(--radius);
  background: #fbfdff;
  color: var(--dock-slate);
  font-size: 0.88rem;
  font-weight: 800;
}

.airground-check-list span {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #b8c5d2;
}

.airground-check-list li.is-pass span {
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(39, 189, 117, 0.1);
}

.airground-check-list li.is-fail span {
  background: var(--alert);
  box-shadow: 0 0 0 5px rgba(225, 75, 75, 0.1);
}

#airgroundReasonText {
  margin: 0;
  padding: 10px 12px;
  border-left: 4px solid var(--amber);
  border-radius: var(--radius);
  background: #fff9eb;
  color: #684608;
  font-size: 0.9rem;
  font-weight: 850;
  line-height: 1.45;
}

.airground-reason-panel.is-blocked #airgroundReasonText {
  border-left-color: var(--alert);
  background: #fff5f3;
  color: #8b1e1e;
}

@media (max-width: 1180px) {
  .airground-layout {
    grid-template-columns: 1fr;
  }

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

  .airground-fleet-panel,
  .airground-weight-panel,
  .airground-reason-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .airground-hero,
  .airground-stage-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .airground-scene {
    min-height: 620px;
  }

  .airground-flow,
  .airground-lesson-grid,
  .airground-console,
  .airground-fleet {
    grid-template-columns: 1fr;
  }

  .airground-card {
    width: 190px;
  }

  .airground-reason-card {
    bottom: 24px;
  }
}

@media (max-width: 520px) {
  .airground-data-grid,
  .airground-weight-row {
    grid-template-columns: 1fr;
  }

  .airground-weight-row em {
    text-align: left;
  }
}
