:root {
  color-scheme: dark;
  --screen-bg: #030810;
  --screen-bg-soft: #08121f;
  --screen-panel: rgba(5, 17, 31, 0.82);
  --screen-panel-strong: rgba(5, 16, 28, 0.94);
  --screen-border: rgba(74, 188, 255, 0.22);
  --screen-border-strong: rgba(74, 214, 255, 0.5);
  --screen-text: #ecf8ff;
  --screen-text-soft: rgba(220, 240, 255, 0.78);
  --screen-text-dim: rgba(145, 184, 209, 0.66);
  --screen-cyan: #45dcff;
  --screen-green: #31efab;
  --screen-warn: #ffbf63;
  --screen-danger: #ff6f8f;
  --screen-shadow: 0 28px 72px rgba(0, 0, 0, 0.42);
  --screen-radius-xl: 28px;
  --screen-radius-lg: 20px;
  --screen-radius-md: 14px;
  --screen-title-font: "Noto Sans SC", "Microsoft YaHei UI", sans-serif;
  --screen-body-font: "Inter", "Noto Sans SC", "Microsoft YaHei UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 50% 0%, rgba(35, 127, 190, 0.16), transparent 24%),
    radial-gradient(circle at 100% 18%, rgba(0, 185, 196, 0.14), transparent 18%),
    radial-gradient(circle at 0% 100%, rgba(20, 77, 129, 0.14), transparent 22%),
    linear-gradient(180deg, #06101a 0%, #02070d 100%);
  color: var(--screen-text);
  font-family: var(--screen-body-font);
}

body {
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

#app {
  min-height: 100vh;
}

.screen-shell {
  position: relative;
  min-height: 100vh;
  padding: 12px;
  padding-bottom: 88px;
  overflow: visible;
}

.screen-shell::before,
.screen-shell::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(28px);
}

.screen-shell::before {
  width: 40vw;
  height: 40vw;
  left: 26vw;
  top: -18vw;
  background: rgba(37, 148, 224, 0.14);
}

.screen-shell::after {
  width: 30vw;
  height: 30vw;
  right: -12vw;
  bottom: -14vw;
  background: rgba(24, 189, 171, 0.1);
}

.screen-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 340px;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
  align-items: start;
}

.screen-topbar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr) 430px;
  gap: 12px;
  align-items: center;
}

.screen-topmeta,
.screen-topstats {
  display: flex;
  gap: 12px;
}

.screen-titlebar {
  position: relative;
  padding: 12px 26px 14px;
  border-radius: 999px;
  text-align: center;
  background: linear-gradient(180deg, rgba(10, 24, 38, 0.92), rgba(4, 10, 20, 0.96));
  border: 1px solid rgba(64, 199, 255, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03), 0 18px 36px rgba(0, 0, 0, 0.24);
}

.screen-titlebar::before,
.screen-titlebar::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 52px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(83, 210, 255, 0.5), transparent);
}

.screen-titlebar::before {
  left: 12px;
}

.screen-titlebar::after {
  right: 12px;
}

.screen-kicker,
.panel-kicker,
.kicker-inline,
.meta-label,
.stat-label,
.stage-focus-kicker {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--screen-text-dim);
}

.screen-title {
  margin-top: 4px;
  font-family: var(--screen-title-font);
  font-size: clamp(28px, 2vw, 38px);
  font-weight: 900;
  letter-spacing: 0.05em;
}

.screen-subtitle,
.meta-hint,
.stat-hint,
.panel-meta,
.hero-caption {
  margin-top: 4px;
  font-size: 12px;
  color: var(--screen-text-soft);
}

.meta-card,
.stat-card,
.panel,
.nav-pill,
.trend-card,
.barrel-board {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(7, 19, 32, 0.94), rgba(4, 10, 18, 0.96));
  border: 1px solid var(--screen-border);
  box-shadow: var(--screen-shadow);
}

.meta-card,
.stat-card {
  flex: 1 1 0;
  min-width: 0;
  border-radius: var(--screen-radius-lg);
  padding: 12px 14px;
}

.meta-value,
.stat-value {
  margin-top: 6px;
  font-size: 24px;
  font-weight: 800;
}

.screen-column {
  display: grid;
  gap: 12px;
  align-content: start;
}

.screen-main {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.panel {
  border-radius: var(--screen-radius-xl);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px 0;
}

.panel-title {
  margin-top: 4px;
  font-size: 18px;
  font-weight: 800;
}

.panel-body {
  padding: 16px 18px 18px;
}

.tone-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.tone-pill.ok {
  color: var(--screen-green);
  border-color: rgba(49, 239, 171, 0.32);
}

.tone-pill.warn {
  color: var(--screen-warn);
  border-color: rgba(255, 191, 99, 0.32);
}

.tone-pill.danger {
  color: var(--screen-danger);
  border-color: rgba(255, 111, 143, 0.32);
}

.tone-pill.neutral {
  color: var(--screen-cyan);
  border-color: rgba(69, 220, 255, 0.28);
}

.hero-number {
  font-size: 44px;
  font-weight: 900;
  line-height: 1;
}

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

.mini-card {
  padding: 12px;
  border-radius: var(--screen-radius-md);
  background: rgba(8, 24, 41, 0.72);
  border: 1px solid rgba(96, 170, 227, 0.14);
}

.mini-card span,
.mini-card strong,
.focus-item span,
.focus-item strong,
.glass-metric span,
.glass-metric strong,
.facility-tag span {
  display: block;
}

.mini-card span,
.focus-item span,
.glass-metric span {
  font-size: 12px;
  color: var(--screen-text-dim);
}

.mini-card strong {
  margin-top: 8px;
  font-size: 22px;
}

.glass-metric strong,
.focus-item strong {
  margin-top: 6px;
  font-size: 16px;
}

.metric-list,
.device-output-list,
.signal-list,
.event-list,
.log-list,
.barrel-row-list {
  display: grid;
  gap: 10px;
}

.metric-row,
.device-output,
.signal-item,
.log-item,
.event-card,
.barrel-row {
  padding: 10px 12px;
  border-radius: var(--screen-radius-md);
  background: rgba(8, 24, 41, 0.68);
  border: 1px solid rgba(96, 170, 227, 0.12);
}

.metric-row,
.device-output {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.signal-item small,
.log-item p,
.event-card p {
  margin: 4px 0 0;
  color: var(--screen-text-soft);
  line-height: 1.6;
}

.progress-ring-shell {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
}

.progress-ring {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, rgba(7, 18, 31, 1) 48%, transparent 49%),
    conic-gradient(var(--screen-cyan) calc(var(--progress, 0) * 3.6deg), rgba(69, 220, 255, 0.16) 0deg);
  border: 1px solid rgba(69, 220, 255, 0.22);
}

.progress-ring span {
  font-size: 24px;
  font-weight: 900;
}

.progress-meta {
  display: grid;
  gap: 10px;
}

.progress-meta div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.progress-meta span {
  color: var(--screen-text-dim);
}

.device-output b.is-on {
  color: var(--screen-green);
}

.device-output b.is-off {
  color: var(--screen-warn);
}

.stage-shell {
  position: relative;
  min-height: 760px;
  padding: 16px;
  border-radius: var(--screen-radius-xl);
  background: linear-gradient(180deg, rgba(7, 18, 31, 0.8), rgba(5, 12, 21, 0.92));
  border: 1px solid rgba(72, 183, 255, 0.2);
  box-shadow: var(--screen-shadow);
  overflow: hidden;
}

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

.stage-topline h2 {
  margin: 6px 0 8px;
  font-size: 32px;
  line-height: 1.15;
}

.stage-topline p {
  margin: 0;
  max-width: 620px;
  color: var(--screen-text-soft);
  line-height: 1.7;
}

.stage-topline-right {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-width: 300px;
}

.glass-metric {
  padding: 12px 14px;
  border-radius: var(--screen-radius-md);
  background: rgba(8, 25, 42, 0.72);
  border: 1px solid rgba(72, 183, 255, 0.16);
}

.glass-metric small {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: var(--screen-text-dim);
}

.factory-stage {
  position: relative;
  min-height: 620px;
  height: clamp(620px, 64vh, 820px);
  overflow: hidden;
  border-radius: 26px;
  background: #081018;
  border: 1px solid rgba(72, 183, 255, 0.18);
}

.factory-background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.02) brightness(0.72) contrast(1.06);
  opacity: 0.94;
  pointer-events: none;
}

.factory-stage-note {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(3, 15, 26, 0.72);
  border: 1px solid rgba(72, 183, 255, 0.24);
  backdrop-filter: blur(8px);
  font-size: 11px;
  color: var(--screen-text-soft);
}

.factory-stage-note a {
  color: var(--screen-cyan);
  font-weight: 700;
  text-decoration: none;
}

.factory-runtime-chip {
  position: absolute;
  left: 18px;
  bottom: 16px;
  z-index: 8;
  display: grid;
  gap: 3px;
  max-width: min(520px, calc(100% - 320px));
  padding: 10px 13px;
  border-radius: 16px;
  background: rgba(3, 15, 26, 0.78);
  border: 1px solid rgba(49, 239, 171, 0.24);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(10px);
  pointer-events: none;
}

.factory-runtime-chip strong {
  color: var(--screen-green);
  font-size: 12px;
  letter-spacing: 0.12em;
}

.factory-runtime-chip span {
  color: var(--screen-text-soft);
  font-size: 12px;
  line-height: 1.45;
}

.stage-action-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}

.factory-enter-cta {
  grid-column: span 2;
}

.factory-enter-cta,
.stage-action-button {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 4px;
  min-height: 66px;
  padding: 12px 16px;
  border-radius: 18px;
  color: var(--screen-text);
  text-align: left;
  text-decoration: none;
  background:
    linear-gradient(135deg, rgba(49, 239, 171, 0.22), rgba(69, 220, 255, 0.2)),
    rgba(3, 15, 26, 0.84);
  border: 1px solid rgba(69, 220, 255, 0.46);
  box-shadow: 0 20px 58px rgba(0, 0, 0, 0.34), 0 0 40px rgba(69, 220, 255, 0.14);
  backdrop-filter: blur(12px);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.stage-action-button {
  cursor: pointer;
  font: inherit;
  background:
    linear-gradient(180deg, rgba(7, 26, 43, 0.9), rgba(5, 16, 28, 0.96)),
    rgba(3, 15, 26, 0.86);
  border-color: rgba(72, 183, 255, 0.22);
}

.factory-enter-cta:hover,
.stage-action-button:hover {
  transform: translateY(-2px);
  border-color: rgba(49, 239, 171, 0.72);
  box-shadow: 0 22px 64px rgba(0, 0, 0, 0.4), 0 0 52px rgba(49, 239, 171, 0.18);
}

.factory-enter-cta span,
.stage-action-button span {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.stage-action-button span {
  font-size: 14px;
}

.factory-enter-cta strong,
.stage-action-button strong {
  color: var(--screen-text-soft);
  font-size: 12px;
  font-weight: 600;
}

.stage-shadow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 22%, rgba(43, 184, 255, 0.18), transparent 20%),
    linear-gradient(180deg, rgba(4, 10, 18, 0.12), rgba(4, 10, 18, 0.62));
}

.stage-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(68, 211, 255, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(68, 211, 255, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.26;
}

.facility-layer,
.hotspot-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.hotspot-layer {
  pointer-events: auto;
}

.facility-tag {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 6px 10px;
  border-radius: 16px;
  background: rgba(3, 15, 26, 0.72);
  border: 1px solid rgba(72, 183, 255, 0.16);
  backdrop-filter: blur(6px);
  display: grid;
  gap: 2px;
}

.facility-tag span {
  font-size: 11px;
  color: rgba(226, 245, 255, 0.82);
  white-space: nowrap;
}

.facility-tag small {
  font-size: 10px;
  color: var(--screen-text-dim);
  white-space: nowrap;
}

.facility-tag.warn {
  border-color: rgba(255, 191, 99, 0.26);
}

.facility-tag.ok {
  border-color: rgba(49, 239, 171, 0.26);
}

.pond-hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 124px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(95, 185, 255, 0.28);
  background: linear-gradient(180deg, rgba(9, 35, 54, 0.92), rgba(6, 18, 28, 0.94));
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.32);
  color: var(--screen-text);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.pond-hotspot::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 1px;
  height: 18px;
  background: linear-gradient(180deg, rgba(72, 214, 255, 0.8), transparent);
}

.pond-hotspot::after {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(100% + 18px);
  width: 10px;
  height: 10px;
  margin-left: -5px;
  border-radius: 50%;
}

.pond-hotspot.ok::after {
  background: var(--screen-green);
  box-shadow: 0 0 0 6px rgba(49, 239, 171, 0.14);
}

.pond-hotspot.warn::after {
  background: var(--screen-warn);
  box-shadow: 0 0 0 6px rgba(255, 191, 99, 0.14);
}

.pond-hotspot.danger::after {
  background: var(--screen-danger);
  box-shadow: 0 0 0 6px rgba(255, 111, 143, 0.14);
}

.pond-hotspot.active,
.pond-hotspot:hover {
  border-color: var(--screen-border-strong);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(74, 214, 255, 0.28);
  transform: translate(-50%, -50%) scale(1.035);
}

.pond-hotspot-code,
.pond-hotspot small {
  display: block;
  font-size: 11px;
  color: var(--screen-text-dim);
}

.pond-hotspot strong {
  display: block;
  margin: 5px 0 4px;
  font-size: 15px;
}

.stage-dock-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
  gap: 12px;
  margin-top: 12px;
  align-items: stretch;
}

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

.zone-summary-card {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(5, 15, 28, 0.76);
  border: 1px solid rgba(72, 183, 255, 0.16);
  backdrop-filter: blur(8px);
}

.zone-summary-card span,
.zone-summary-card strong,
.zone-summary-card small {
  display: block;
}

.zone-summary-card span {
  font-size: 11px;
  color: var(--screen-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.zone-summary-card strong {
  margin-top: 6px;
  font-size: 16px;
}

.zone-summary-card small {
  margin-top: 6px;
  line-height: 1.5;
  color: var(--screen-text-soft);
}

.zone-summary-card.warn {
  border-color: rgba(255, 191, 99, 0.26);
}

.zone-summary-card.danger {
  border-color: rgba(255, 111, 143, 0.3);
}

.stage-focus-panel {
  position: relative;
  width: 100%;
  min-height: 220px;
  border-radius: 22px;
  overflow: hidden;
  background: rgba(4, 14, 25, 0.82);
  border: 1px solid rgba(72, 183, 255, 0.22);
  box-shadow: 0 20px 38px rgba(0, 0, 0, 0.36);
}

.stage-focus-panel.warn {
  border-color: rgba(255, 191, 99, 0.34);
}

.stage-focus-panel.danger {
  border-color: rgba(255, 111, 143, 0.38);
}

.stage-focus-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  filter: saturate(1.02) contrast(1.02);
}

.stage-focus-fallback {
  position: relative;
}

.stage-focus-video-shell {
  position: relative;
  width: 100%;
  height: 220px;
  background: #040a12;
}

.stage-focus-video {
  width: 100%;
  height: 220px;
  object-fit: cover;
  background: #02060c;
}

.stage-live-badge {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.08em;
  background: rgba(4, 14, 25, 0.78);
  border: 1px solid rgba(72, 183, 255, 0.18);
}

.stage-live-badge.is-live {
  color: var(--screen-green);
  border-color: rgba(49, 239, 171, 0.26);
}

.stage-live-badge.is-stale {
  color: var(--screen-warn);
  border-color: rgba(255, 191, 99, 0.26);
}

.stage-live-badge.is-fallback {
  color: var(--screen-cyan);
  border-color: rgba(69, 220, 255, 0.26);
}

.stage-focus-empty {
  display: grid;
  place-items: center;
  width: 100%;
  height: 220px;
  color: var(--screen-text-dim);
  background: linear-gradient(180deg, rgba(8, 22, 37, 0.8), rgba(4, 12, 22, 0.96));
}

.stage-focus-overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 16px 16px 14px;
  background: linear-gradient(180deg, rgba(3, 10, 18, 0.02), rgba(3, 10, 18, 0.94));
}

.stage-focus-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stage-focus-head strong {
  font-size: 18px;
  line-height: 1.2;
}

.stage-focus-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.stage-focus-meta span {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(7, 24, 40, 0.72);
  color: var(--screen-text-soft);
}

.stage-focus-overlay p {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--screen-text-soft);
}

.focus-ribbon {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.focus-item {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(5, 15, 28, 0.76);
  border: 1px solid rgba(72, 183, 255, 0.16);
  backdrop-filter: blur(6px);
}

.stage-route-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.route-step {
  min-height: 70px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(4, 13, 24, 0.82);
  border: 1px solid rgba(72, 183, 255, 0.16);
  backdrop-filter: blur(6px);
}

.route-step span,
.route-step strong {
  display: block;
}

.route-step span {
  font-size: 11px;
  color: var(--screen-text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.route-step strong {
  margin-top: 8px;
  line-height: 1.45;
  font-size: 13px;
}

.stage-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.9fr);
  gap: 12px;
  margin-top: 12px;
}

.trend-card,
.barrel-board {
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(5, 14, 24, 0.78);
  border: 1px solid rgba(72, 183, 255, 0.14);
}

.subpanel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.subpanel-head span {
  color: var(--screen-text-dim);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.trend-chart {
  height: 190px;
  border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(7, 25, 40, 0.72), rgba(4, 12, 21, 0.86)),
    linear-gradient(90deg, rgba(68, 211, 255, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(68, 211, 255, 0.04) 1px, transparent 1px);
  background-size: auto, 20% 100%, 100% 25%;
}

.trend-chart svg {
  width: 100%;
  height: 100%;
}

.video-proof-card {
  display: grid;
  gap: 12px;
}

.video-proof-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid rgba(72, 183, 255, 0.16);
}

.video-proof-empty {
  min-height: 180px;
}

.video-proof-meta {
  display: grid;
  gap: 6px;
}

.video-proof-meta strong {
  font-size: 16px;
}

.video-proof-meta span,
.video-proof-meta small {
  color: var(--screen-text-soft);
}

.metric-list.compact {
  margin-top: 4px;
}

.audit-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
}

.audit-chip {
  flex: 1 1 0;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(6, 18, 31, 0.82);
  border: 1px solid rgba(72, 183, 255, 0.14);
}

.audit-chip strong,
.audit-chip span {
  display: block;
}

.audit-chip strong {
  font-size: 13px;
}

.audit-chip span {
  margin-top: 4px;
  font-size: 12px;
  color: var(--screen-text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audit-chip.warn {
  border-color: rgba(255, 191, 99, 0.26);
}

.audit-chip.danger {
  border-color: rgba(255, 111, 143, 0.3);
}

.bottom-nav-shell {
  display: grid;
  gap: 10px;
}

.bottom-nav {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.nav-detail-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.ops-link-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.nav-detail-item {
  min-height: 56px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(6, 18, 31, 0.82);
  border: 1px solid rgba(72, 183, 255, 0.14);
  color: var(--screen-text-soft);
  line-height: 1.6;
}

.ops-link-button {
  min-height: 72px;
  padding: 12px 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(7, 26, 43, 0.9), rgba(5, 16, 28, 0.96));
  border: 1px solid rgba(72, 183, 255, 0.18);
  color: var(--screen-text);
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.ops-link-button strong,
.ops-link-button span {
  display: block;
}

.ops-link-button strong {
  font-size: 14px;
}

.ops-link-button span {
  margin-top: 6px;
  font-size: 12px;
  color: var(--screen-text-soft);
  line-height: 1.5;
}

.ops-link-button:hover {
  transform: translateY(-1px);
  border-color: rgba(72, 214, 255, 0.36);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.24);
}

.nav-pill {
  padding: 12px 10px;
  border-radius: 18px;
  cursor: pointer;
  color: var(--screen-text-soft);
  transition: border-color 140ms ease, transform 140ms ease, background 140ms ease;
}

.nav-pill span,
.nav-pill small {
  display: block;
}

.nav-pill span {
  font-size: 14px;
  font-weight: 700;
}

.nav-pill small {
  margin-top: 5px;
  color: var(--screen-text-dim);
  font-size: 11px;
}

.nav-pill.active,
.nav-pill:hover {
  border-color: rgba(68, 211, 255, 0.34);
  transform: translateY(-1px);
}

.empty-slot {
  display: grid;
  place-items: center;
  min-height: 80px;
  color: var(--screen-text-dim);
  font-size: 13px;
}

.screen-runtime-note {
  position: absolute;
  left: 18px;
  bottom: 18px;
  max-width: 520px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(32, 42, 8, 0.92);
  border: 1px solid rgba(255, 191, 99, 0.22);
  color: #ffe9bd;
  z-index: 21;
}

.error-toast {
  position: absolute;
  right: 18px;
  bottom: 18px;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(88, 16, 26, 0.92);
  border: 1px solid rgba(255, 110, 136, 0.28);
  color: #ffdce3;
  z-index: 22;
}

@media (max-width: 1480px) {
  .screen-grid {
    grid-template-columns: 290px minmax(0, 1fr) 300px;
  }

  .stage-action-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .factory-enter-cta {
    grid-column: 1 / -1;
  }

  .stage-zone-summary {
    grid-template-columns: 1fr;
  }

  .stage-focus-panel {
    min-height: 220px;
  }

  .stage-route-strip {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}

@media (max-width: 1100px) {
  body {
    overflow: auto;
  }

  .screen-grid,
  .screen-topbar,
  .stage-topline,
  .stage-action-bar,
  .stage-dock-grid,
  .stage-bottom,
  .focus-ribbon,
  .bottom-nav,
  .nav-detail-board,
  .ops-link-board {
    grid-template-columns: 1fr;
  }

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

  .factory-stage {
    height: auto;
    min-height: 560px;
    padding-bottom: 12px;
  }

  .factory-background,
  .stage-shadow,
  .stage-grid,
  .facility-layer,
  .hotspot-layer {
    min-height: 560px;
  }

  .factory-stage-note {
    position: relative;
    right: auto;
    bottom: auto;
    width: max-content;
    max-width: calc(100% - 24px);
    margin: 12px;
    z-index: 8;
  }

  .stage-zone-summary,
  .stage-route-strip,
  .focus-ribbon {
    width: auto;
  }

  .stage-focus-panel {
    width: auto;
  }

  .audit-strip {
    flex-direction: column;
  }
}
