/* Vehicle-road cooperative transport view, isolated from the shared sand-table styles. */

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

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

.v2x-transport-view {
  margin-top: 16px;
}

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

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

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

.v2x-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid rgba(20, 184, 166, 0.34);
  border-radius: var(--radius);
  background: #ecfdf8;
  color: #0f766e;
  font-weight: 950;
  white-space: nowrap;
}

.v2x-status-pill span {
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 999px;
  background: #14b8a6;
  box-shadow: 0 0 0 6px rgba(20, 184, 166, 0.13);
}

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

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

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

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

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

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

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

.v2x-score {
  display: grid;
  min-width: 136px;
  padding: 10px 12px;
  border: 1px solid rgba(20, 184, 166, 0.28);
  border-radius: var(--radius);
  background: #ecfdf8;
}

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

.v2x-score strong {
  color: #0f766e;
  font-size: 1.8rem;
  line-height: 1;
}

.v2x-scene {
  position: relative;
  min-height: 590px;
  overflow: hidden;
  border: 1px solid rgba(20, 184, 166, 0.18);
  border-radius: var(--radius);
  background: #e7f5fb;
}

.v2x-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(4, 28, 44, 0.16), rgba(4, 28, 44, 0) 44%, rgba(255, 255, 255, 0.1)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(8, 47, 73, 0.12));
  pointer-events: none;
}

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

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

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

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

.v2x-route {
  stroke-width: 4;
}

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

.v2x-route-green {
  color: #34d399;
  stroke: currentColor;
  marker-end: url("#v2xArrow");
}

.v2x-route-safe {
  color: #38bdf8;
  stroke: currentColor;
  marker-end: url("#v2xArrow");
}

.v2x-route-priority {
  color: #fbbf24;
  stroke: currentColor;
  marker-end: url("#v2xArrow");
}

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

.v2x-link {
  color: #7dd3fc;
  stroke: currentColor;
}

.v2x-scene:not(.waiting) .v2x-route,
.v2x-scene:not(.waiting) .v2x-link {
  opacity: 0.5;
}

.v2x-scene.v2x-negotiate .v2x-route,
.v2x-scene.v2x-release .v2x-route,
.v2x-scene.v2x-drive .v2x-route,
.v2x-scene.v2x-review .v2x-route,
.v2x-scene.v2x-connect .v2x-link,
.v2x-scene.v2x-negotiate .v2x-link,
.v2x-scene.v2x-release .v2x-link,
.v2x-scene.v2x-drive .v2x-link,
.v2x-scene.v2x-review .v2x-link {
  opacity: 0.82;
}

.v2x-scene.case-greenwave .v2x-route-green,
.v2x-scene.case-intersection .v2x-route-safe,
.v2x-scene.case-weather .v2x-route-safe,
.v2x-scene.case-emergency .v2x-route-priority {
  opacity: 1;
  stroke-width: 7;
  filter: url("#v2xGlow");
}

.v2x-scene.v2x-blocked .v2x-route-blocked {
  opacity: 1;
  stroke-width: 8;
  filter: url("#v2xGlow");
}

.v2x-pulse {
  fill: #ffffff;
  opacity: 0;
  stroke: #14b8a6;
  stroke-width: 4;
  filter: url("#v2xGlow");
}

.v2x-scene.v2x-drive .v2x-pulse,
.v2x-scene.v2x-review .v2x-pulse,
.v2x-scene.v2x-blocked .v2x-pulse {
  opacity: 1;
}

.v2x-risk-zone,
.v2x-card,
.v2x-node {
  position: absolute;
  z-index: 5;
}

.v2x-risk-zone {
  left: 36%;
  top: 44%;
  width: 24%;
  height: 18%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(225, 75, 75, 0.5), rgba(244, 165, 28, 0.32) 42%, rgba(244, 165, 28, 0) 72%);
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 180ms ease, transform 180ms ease;
}

.v2x-risk-zone span {
  position: absolute;
  left: 22%;
  top: -8px;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.9);
  color: #9a3412;
  font-size: 0.74rem;
  font-weight: 950;
  white-space: nowrap;
}

.v2x-scene.v2x-negotiate .v2x-risk-zone,
.v2x-scene.v2x-blocked .v2x-risk-zone,
.v2x-scene.case-weather .v2x-risk-zone {
  opacity: 1;
}

.v2x-scene.v2x-blocked .v2x-risk-zone {
  transform: scale(1.14);
}

.v2x-card {
  width: 220px;
  padding: 12px;
  border: 1px solid rgba(20, 184, 166, 0.26);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 28px rgba(9, 24, 44, 0.12);
}

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

.v2x-signal-card {
  right: 28px;
  top: 26px;
  border-color: rgba(244, 165, 28, 0.36);
  background: rgba(255, 249, 235, 0.92);
}

.v2x-reason-card {
  left: 28px;
  bottom: 30px;
  border-color: rgba(59, 130, 246, 0.32);
  background: rgba(239, 246, 255, 0.92);
}

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

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

.v2x-node {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.76);
  border-radius: 50%;
  background: #0f766e;
  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;
}

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

.v2x-node-car {
  left: 48%;
  bottom: 28%;
  background: #2563eb;
}

.v2x-node-road {
  left: 56%;
  top: 22%;
  background: #0891b2;
}

.v2x-node-light {
  right: 23%;
  top: 43%;
  background: #f59e0b;
}

.v2x-node-cloud {
  right: 9%;
  top: 10%;
  background: #7c3aed;
}

.v2x-node-station {
  right: 12%;
  bottom: 25%;
  background: #10b981;
}

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

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

.v2x-flow li.is-active {
  border-color: rgba(20, 184, 166, 0.36);
  background: #ecfdf8;
  box-shadow: inset 0 0 0 2px rgba(20, 184, 166, 0.08);
}

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

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

.v2x-flow span {
  display: block;
  margin-bottom: 6px;
  color: #0f766e;
  font-size: 0.74rem;
  font-weight: 950;
}

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

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

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

.v2x-lesson-grid span {
  display: block;
  margin-bottom: 6px;
  color: #0f766e;
  font-size: 0.78rem;
  font-weight: 950;
}

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

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

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

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

.v2x-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;
}

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

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

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

#v2xModeBadge,
#v2xReasonBadge,
#v2xPlanBadge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #ecfdf8;
  color: #0f766e;
  font-size: 0.74rem;
  font-weight: 950;
  white-space: nowrap;
}

.v2x-weight-panel.is-risk #v2xReasonBadge,
.v2x-reason-panel.is-risk #v2xPlanBadge {
  background: #fff4e5;
  color: #9a5400;
}

.v2x-weight-panel.is-blocked #v2xReasonBadge,
.v2x-reason-panel.is-blocked #v2xPlanBadge {
  background: #fff1f0;
  color: #a62626;
}

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

.v2x-infra 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;
}

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

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

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

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

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

.v2x-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;
}

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

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

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

.v2x-weight-row em {
  color: #0f766e;
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 950;
  text-align: right;
}

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

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

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

.v2x-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;
}

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

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

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

#v2xReasonText {
  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;
}

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

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

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

  .v2x-infra-panel,
  .v2x-weight-panel,
  .v2x-reason-panel {
    grid-column: 1 / -1;
  }
}

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

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

  .v2x-flow,
  .v2x-lesson-grid,
  .v2x-console,
  .v2x-infra {
    grid-template-columns: 1fr;
  }

  .v2x-card {
    width: 190px;
  }

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

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

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