/* Orduril Industries — Anduril-inspired sensor command UI
   Typography: Helvetica Now Display family stack (same as anduril.com) */

@font-face {
  font-family: "Helvetica Now Display";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local("Helvetica Now Display"), local("HelveticaNowDisplay-Regular"),
    local("Helvetica Neue"), local("HelveticaNeue");
}

@font-face {
  font-family: "Helvetica Now Display";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: local("Helvetica Now Display Medium"), local("HelveticaNowDisplay-Medium"),
    local("Helvetica Neue Medium"), local("HelveticaNeue-Medium");
}

@font-face {
  font-family: "Helvetica Now Display";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: local("Helvetica Now Display Bold"), local("HelveticaNowDisplay-Bold"),
    local("Helvetica Neue Bold"), local("HelveticaNeue-Bold");
}

:root {
  --bg: #000000;
  --bg-elev: #0a0a0a;
  --bg-panel: #111111;
  --line: #222222;
  --line-strong: #333333;
  --text: #ffffff;
  --muted: #8a8a8a;
  --muted-2: #555555;
  --accent: #dff140;
  --warn: #f5a623;
  --danger: #ff4d4d;
  --ok: #dff140;
  --font: "Helvetica Now Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "Helvetica Now Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --nav-h: 56px;
  --max: 1280px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

@media (min-width: 900px) {
  :root {
    --nav-h: 64px;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--text);
  text-decoration: none;
}
a:hover {
  color: var(--accent);
}

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

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--text);
  background: transparent;
  color: var(--text);
  padding: 0.85rem 1.4rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:hover {
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
}
.btn-solid {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.btn-solid:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}
.btn-line {
  background: transparent;
}
.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.7rem;
}
.btn-block {
  width: 100%;
}

/* —— Logo —— */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  text-decoration: none;
  min-width: 0;
}
.logo:hover {
  color: var(--text);
  text-decoration: none;
}
.logo-mark {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  background: var(--text);
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}
.logo-word {
  font-weight: 700;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
}
.logo-sub {
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  color: var(--muted);
  font-weight: 500;
  margin-left: 0.15rem;
}

/* —— Shared app nav —— */
.app-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 0.65rem 1rem;
  min-height: var(--nav-h);
  height: auto;
  padding: max(0.45rem, var(--safe-top)) max(0.75rem, var(--safe-right)) 0.45rem
    max(0.75rem, var(--safe-left));
  background: rgba(0, 0, 0, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.app-nav-left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.app-nav-links {
  display: none;
  align-items: center;
  gap: 0.15rem;
}

.app-nav-links a {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
  padding: 0.45rem 0.7rem;
  border: 1px solid transparent;
}

.app-nav-links a:hover {
  color: var(--text);
  text-decoration: none;
}

.app-nav-links a.is-active {
  color: var(--text);
  border-color: var(--line-strong);
  background: #0c0c0c;
}

.app-nav-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  min-width: 0;
}

.app-nav-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.app-nav-right .live-pill,
.app-nav-right .cmd-clock {
  display: none;
}

.nav-burger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  background: transparent;
  cursor: pointer;
}

.nav-burger span {
  display: block;
  height: 1.5px;
  background: var(--text);
  width: 100%;
}

.nav-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.65);
}

.nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 210;
  width: min(300px, 86vw);
  height: 100%;
  background: #050505;
  border-right: 1px solid var(--line);
  padding: max(1rem, var(--safe-top)) 1rem max(1rem, var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Author `display:flex` would otherwise override the hidden attribute */
.nav-drawer[hidden],
.nav-drawer-backdrop[hidden] {
  display: none !important;
}

.nav-drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-drawer-close {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.nav-drawer-links {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-drawer-links a {
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
  padding: 0.85rem 0.75rem;
  border: 1px solid var(--line);
}

.nav-drawer-links a.is-active {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(223, 241, 64, 0.06);
}

.nav-drawer-meta {
  margin-top: auto;
  display: grid;
  gap: 0.65rem;
}

body.nav-open {
  overflow: hidden;
}

.map-filters-mobile {
  display: none;
}

@media (min-width: 900px) {
  .nav-burger {
    display: none;
  }
  .app-nav-links {
    display: flex;
  }
  .app-nav {
    grid-template-columns: auto auto 1fr auto;
  }
  .app-nav-right .live-pill,
  .app-nav-right .cmd-clock {
    display: inline-flex;
  }
  .app-nav-right .cmd-clock {
    display: inline;
  }
}

@media (max-width: 899px) {
  .logo-sub {
    display: none;
  }
  .app-nav-center {
    display: none;
  }
  .app-nav {
    grid-template-columns: 1fr auto;
  }
  .app-nav-right .btn {
    padding: 0.4rem 0.65rem;
    font-size: 0.65rem;
  }
  .op-chip {
    display: none !important;
  }
  .map-filters-mobile {
    display: flex;
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 400;
    gap: 0.3rem;
    max-width: calc(100% - 24px);
    overflow-x: auto;
    padding: 0.25rem;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid var(--line);
  }
  .map-filters-mobile .map-chip {
    flex-shrink: 0;
  }
}

/* —— Marketing nav —— */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  padding: 0 1.5rem;
  background: rgba(0, 0, 0, 0.85);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.nav-minimal {
  border-bottom-color: transparent;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}
.nav-links a {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.nav-links a:hover {
  color: var(--text);
}

/* —— Hero —— */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 5.5rem 1.5rem 4rem;
  border-bottom: 1px solid var(--line);
}
.hero-kicker {
  margin: 0 0 1.25rem;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.hero-title {
  margin: 0 0 1.5rem;
  font-size: clamp(3.2rem, 10vw, 7rem);
  line-height: 0.95;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}
.hero-or {
  color: var(--accent);
}
.hero-sub {
  max-width: 36rem;
  margin: 0 0 2rem;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--muted);
  font-weight: 400;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 3.5rem;
}
.hero-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 140px));
  gap: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.meta-n {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.meta-l {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* —— Capability bands —— */
.band {
  max-width: var(--max);
  margin: 0 auto;
  padding: 4.5rem 1.5rem;
  border-bottom: 1px solid var(--line);
}
.band-dark {
  background: var(--bg-elev);
  max-width: none;
  padding-left: max(1.5rem, calc((100% - var(--max)) / 2));
  padding-right: max(1.5rem, calc((100% - var(--max)) / 2));
}
.band-head {
  max-width: 40rem;
  margin-bottom: 2.5rem;
}
.band-head h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.band-head p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}
.cap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.cap {
  background: var(--bg);
  padding: 1.75rem 1.5rem;
}
.cap-num {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin-bottom: 1rem;
  font-weight: 500;
}
.cap h3 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.cap p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.lattice-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: var(--line-strong);
  border: 1px solid var(--line-strong);
  margin-bottom: 2.5rem;
}
.lattice-cell {
  background: var(--bg);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.lattice-label {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.lattice-code {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.band-cta {
  display: flex;
}

.site-foot {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-end;
}
.foot-brand {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.foot-ind {
  font-size: 0.65rem;
  letter-spacing: 0.28em;
  color: var(--muted);
  font-weight: 500;
}
.foot-note {
  margin: 0;
  font-size: 0.7rem;
  color: var(--muted-2);
  max-width: 28rem;
  letter-spacing: 0.02em;
}

/* —— Access granted transition (scramble decode) —— */
.page-access {
  min-height: 100vh;
  background: #000;
  overflow: hidden;
}

.access-stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
  background:
    radial-gradient(ellipse 80% 50% at 50% 45%, rgba(223, 241, 64, 0.05), transparent 60%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(255, 255, 255, 0.015) 2px,
      rgba(255, 255, 255, 0.015) 3px
    ),
    #000;
}

.access-inner {
  width: min(720px, 100%);
  text-align: center;
}

.access-title {
  margin: 0;
  font-size: clamp(2rem, 8vw, 4.25rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.05;
  color: var(--text);
  min-height: 1.15em;
  white-space: nowrap;
}

.access-title.is-resolved {
  color: #57c84d;
  text-shadow: 0 0 48px rgba(87, 200, 77, 0.45);
  transition: color 0.12s ease, text-shadow 0.12s ease;
}

.scramble-char {
  display: inline-block;
  min-width: 0.45em;
}

.scramble-char.is-space {
  min-width: 0.35em;
}

/* —— Secure access gate —— */
.page-home,
.page-login,
.page-register {
  min-height: 100vh;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(255, 255, 255, 0.012) 2px,
      rgba(255, 255, 255, 0.012) 3px
    ),
    var(--bg);
}

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
}

.gate-frame {
  width: min(440px, 100%);
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  box-shadow: 0 0 0 1px #000, 0 24px 80px rgba(0, 0, 0, 0.65);
}

.gate-top {
  padding: 1.75rem 1.5rem 1.25rem;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.logo-center {
  justify-content: center;
  margin-bottom: 0.85rem;
}

.gate-org {
  margin: 0 0 0.5rem;
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

.gate-classif {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

.gate-warn {
  margin: 0;
  padding: 1.1rem 1.35rem;
  border-bottom: 1px solid rgba(255, 77, 77, 0.35);
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(255, 77, 77, 0.06),
      rgba(255, 77, 77, 0.06) 8px,
      rgba(255, 77, 77, 0.02) 8px,
      rgba(255, 77, 77, 0.02) 16px
    ),
    #120808;
  border-left: 3px solid var(--danger);
}

.gate-warn-title {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--danger);
}

.gate-warn-body {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  line-height: 1.5;
  color: #c4b0b0;
  letter-spacing: 0.02em;
}

.gate-warn-body:last-child {
  margin-bottom: 0;
}

.gate-auth {
  padding: 1.5rem 1.5rem 1.25rem;
}

.gate-heading {
  margin: 0 0 1.15rem;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.gate-foot {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.75rem 1.35rem;
  border-top: 1px solid var(--line);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 500;
}
.gate-foot-link {
  color: var(--muted);
  letter-spacing: 0.12em;
}
.gate-foot-link:hover {
  color: #57c84d;
}

/* —— LettuceOS platform page —— */
.page-lettuceos {
  min-height: 100vh;
  background: var(--bg);
}

.lettuce-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.lettuce-hero {
  text-align: center;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2rem;
}

.lettuce-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.lettuce-logo {
  display: block;
  filter: drop-shadow(0 0 18px rgba(87, 200, 77, 0.25));
}

.lettuce-kicker {
  margin: 0 0 0.75rem;
  font-size: 0.65rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

.lettuce-title {
  margin: 0 0 0.85rem;
  font-size: clamp(2.25rem, 7vw, 3.5rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
}

.lettuce-word {
  color: #7fd65a;
}

.lettuce-os {
  color: var(--text);
}

.lettuce-tagline {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.55;
}

.lettuce-body {
  display: grid;
  gap: 1.1rem;
}

.lettuce-body p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.65;
  color: #c8c8c8;
}

.lettuce-body strong {
  color: var(--text);
  font-weight: 700;
}

.lettuce-body em {
  color: #9be15d;
  font-style: normal;
  font-weight: 500;
}

.lettuce-note {
  padding: 1rem 1.1rem;
  border-left: 2px solid #57c84d;
  background: rgba(87, 200, 77, 0.06);
  color: var(--muted) !important;
  font-size: 0.85rem !important;
}

.lettuce-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.25rem;
}

.lettuce-foot {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.lettuce-foot-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #7fd65a;
  font-weight: 700;
}

.nav-lettuce {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin-right: 0.35rem;
}
.nav-lettuce:hover {
  color: #7fd65a;
  text-decoration: none;
}
.nav-lettuce-icon {
  display: block;
  flex-shrink: 0;
}

/* —— Auth forms —— */
.auth-shell {
  min-height: calc(100vh - var(--nav-h));
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem 4rem;
}
.auth-panel {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  background: var(--bg-elev);
  padding: 2rem 1.75rem;
}
.auth-kicker {
  margin: 0 0 0.75rem;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
}
.auth-panel h1 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}
.auth-lede {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.auth-form {
  display: grid;
  gap: 1rem;
}
.auth-form label,
.field {
  display: grid;
  gap: 0.4rem;
}
.auth-form label span,
.field > span {
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.auth-form input,
.field input,
.field select,
.auth-form select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.75rem 0.85rem;
  border-radius: 0;
}
.auth-form input:focus,
.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
}
.auth-foot {
  margin: 1.25rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.auth-foot a {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.form-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin: 0;
}

/* —— Command dashboard —— */
.cmd-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--nav-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 0 1.25rem;
  background: #000;
  border-bottom: 1px solid var(--line);
}
.cmd-nav-center {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.cmd-nav-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  font-weight: 700;
  color: var(--accent);
}
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(223, 241, 64, 0.6);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(223, 241, 64, 0.55);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(223, 241, 64, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(223, 241, 64, 0);
  }
}
.cmd-clock {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.op-chip {
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.cmd {
  min-height: calc(100vh - var(--nav-h));
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-bottom: 1px solid var(--line);
}
.kpi-row-cmd {
  grid-template-columns: repeat(8, 1fr);
}
@media (max-width: 1100px) {
  .kpi-row-cmd {
    grid-template-columns: repeat(4, 1fr);
  }
}
.kpi {
  padding: 1.1rem 1.25rem;
  border-right: 1px solid var(--line);
  background: var(--bg-elev);
}
.kpi:last-child {
  border-right: none;
}
.kpi-n {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.kpi-l {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.kpi-online .kpi-n {
  color: var(--accent);
}
.kpi-degraded .kpi-n {
  color: var(--warn);
}
.kpi-alert .kpi-n {
  color: var(--danger);
}
.kpi-offline .kpi-n {
  color: var(--muted);
}

.cmd-body {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - var(--nav-h) - 88px);
}

.cmd-side {
  border-right: 1px solid var(--line);
  background: var(--bg-elev);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.side-block {
  padding: 1.25rem;
  border-bottom: 1px solid var(--line);
}
.side-title {
  margin: 0 0 1rem;
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.side-block .field {
  margin-bottom: 0.85rem;
}
.event-feed {
  max-height: 42vh;
  overflow: auto;
  display: grid;
  gap: 0.65rem;
}
.event-item {
  border-left: 2px solid var(--line-strong);
  padding: 0.35rem 0 0.35rem 0.75rem;
}
.event-item.sev-warning {
  border-left-color: var(--warn);
}
.event-item.sev-critical {
  border-left-color: var(--danger);
}
.event-item.sev-info {
  border-left-color: var(--accent);
}
.event-time {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  color: var(--muted-2);
  margin-bottom: 0.15rem;
}
.event-msg {
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--muted);
}
.event-msg strong {
  color: var(--text);
  font-weight: 500;
}

.cmd-main {
  padding: 1.25rem 1.5rem 2.5rem;
  min-width: 0;
}
.main-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1.25rem;
}
.main-toolbar h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.main-toolbar .muted {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
}

.table-wrap {
  border: 1px solid var(--line);
  overflow: auto;
  background: var(--bg-elev);
}
.sensor-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  min-width: 900px;
}
.sensor-table th {
  text-align: left;
  padding: 0.7rem 0.75rem;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  border-bottom: 1px solid var(--line);
  background: #0d0d0d;
  position: sticky;
  top: 0;
  white-space: nowrap;
}
.sensor-table td {
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
.sensor-table tbody tr {
  cursor: pointer;
  transition: background 0.1s ease;
}
.sensor-table tbody tr:hover,
.sensor-table tbody tr.is-selected {
  background: #151515;
}
.sensor-table tbody tr.is-selected {
  outline: 1px solid var(--line-strong);
  outline-offset: -1px;
}
.mono {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.code-cell {
  font-weight: 700;
  letter-spacing: 0.04em;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}
.status-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.status-online {
  color: var(--accent);
}
.status-degraded {
  color: var(--warn);
}
.status-alert {
  color: var(--danger);
}
.status-offline {
  color: var(--muted);
}

.detail-panel {
  margin-top: 1.25rem;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  padding: 1.25rem;
}
.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.detail-code {
  margin: 0 0 0.25rem;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--accent);
  font-weight: 700;
}
.detail-head h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-bottom: 1rem;
}
.detail-stat {
  background: var(--bg);
  padding: 0.85rem 0.9rem;
}
.detail-stat .l {
  display: block;
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.detail-stat .v {
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 0.75rem;
}
.field.inline {
  min-width: 160px;
}
.detail-notes {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
}

/* Command asset board extras */
.stat-bars {
  display: grid;
  gap: 0.55rem;
}
.stat-bar-row .stat-bar-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.72rem;
  margin-bottom: 0.2rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.stat-bar-track {
  height: 3px;
  background: #1a1a1a;
  border: 1px solid #222;
}
.stat-bar-track > span {
  display: block;
  height: 100%;
  background: var(--accent);
}
.stat-bar-row.is-war .stat-bar-track > span {
  background: #ff4d4d;
}
.stat-bar-row.domain-air .stat-bar-track > span {
  background: var(--accent);
}
.stat-bar-row.domain-sea .stat-bar-track > span {
  background: #4db8ff;
}
.stat-bar-row.domain-land .stat-bar-track > span {
  background: #999;
}

.domain-pill {
  display: inline-block;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border: 1px solid #333;
}
.domain-pill.domain-air {
  color: var(--accent);
  border-color: rgba(223, 241, 64, 0.35);
}
.domain-pill.domain-sea {
  color: #4db8ff;
  border-color: rgba(77, 184, 255, 0.35);
}
.domain-pill.domain-land {
  color: #ccc;
}

.mode-pill {
  display: inline-block;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border: 1px solid #333;
  color: #bbb;
}
.mode-pill.mode-war {
  color: #ffb4b4;
  border-color: rgba(255, 77, 77, 0.45);
  background: rgba(255, 77, 77, 0.08);
}

.detail-head-row {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}
.detail-thumb {
  width: 88px;
  height: 56px;
  flex-shrink: 0;
  border: 1px solid #333;
  background: #050505;
  overflow: hidden;
}
.detail-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.detail-sub {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
}
.detail-mode-block {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}
.page-dashboard .detail-panel .asset-mode-toggles {
  margin-top: 0.5rem;
}

@media (max-width: 960px) {
  .cmd-body {
    grid-template-columns: 1fr;
  }
  .cmd-side {
    border-right: none;
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: 1fr;
  }
  .kpi-row,
  .kpi-row-cmd {
    grid-template-columns: repeat(4, 1fr);
  }
  .kpi {
    padding: 0.75rem 0.65rem;
  }
  .kpi-n {
    font-size: clamp(1rem, 4vw, 1.5rem);
  }
  .main-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .main-toolbar h1 {
    font-size: 1.15rem;
  }
  .table-wrap {
    margin: 0 -0.25rem;
    border-left: none;
    border-right: none;
  }
  .sensor-table {
    min-width: 720px;
  }
  .cmd-main {
    padding: 1rem 0.85rem 2rem;
  }
  .detail-panel {
    padding: 1rem;
  }
  .detail-head {
    flex-direction: column;
  }
  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .kpi-row,
  .kpi-row-cmd {
    grid-template-columns: repeat(2, 1fr);
  }
  .kpi:nth-child(odd) {
    border-right: 1px solid var(--line);
  }
  .gate {
    padding: 1rem 0.85rem;
    align-items: flex-start;
    padding-top: max(1.5rem, var(--safe-top));
  }
  .gate-frame {
    width: 100%;
  }
  .gate-title,
  .access-title {
    white-space: normal;
    font-size: clamp(1.5rem, 8vw, 2.5rem);
    letter-spacing: 0.08em;
  }
  .lettuce-page {
    padding: 1.5rem 1rem 3rem;
  }
  .lettuce-cta {
    flex-direction: column;
  }
  .lettuce-cta .btn {
    width: 100%;
  }
  .asset-mode-toggles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mode-btn {
    width: 100%;
    text-align: center;
  }
  .asset-card {
    top: 52px;
    left: 8px;
    width: calc(100% - 16px);
    max-height: min(70vh, 520px);
    overflow: auto;
  }
  .map-kpis {
    grid-template-columns: repeat(2, 1fr);
  }
  .map-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(42vh, 48vh) minmax(0, 1fr);
    height: calc(100dvh - var(--nav-h));
  }
  .map-hud {
    border-left: none;
    border-top: 1px solid var(--line);
    max-height: none;
    overflow: auto;
  }
  .map-list-wrap {
    min-height: 180px;
  }
  .page-map,
  .page-dashboard {
    overflow-x: hidden;
  }
  .page-dashboard .cmd {
    min-height: calc(100dvh - var(--nav-h));
  }
}

/* —— Theatre map (COP) —— */
.page-map {
  height: 100vh;
  overflow: hidden;
  background: #000;
}

.page-map .app-nav {
  /* shared app-nav grid */
}

.map-filters {
  display: flex;
  gap: 0.35rem;
}

.map-chip {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
}

.map-chip:hover {
  color: var(--text);
  border-color: #555;
}

.map-chip.active {
  color: #000;
  background: var(--accent);
  border-color: var(--accent);
}

.nav-link-quiet {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin-right: 0.25rem;
}

.nav-link-quiet:hover {
  color: var(--text);
  text-decoration: none;
}

.map-layout {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 340px);
  height: calc(100vh - var(--nav-h));
}

.map-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.theatre-map {
  width: 100%;
  height: 100%;
  background: #050505;
  z-index: 1;
}

/* Top-left inspect card */
.asset-card {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 500;
  width: min(340px, calc(100% - 24px));
  background: rgba(0, 0, 0, 0.92);
  border: 1px solid #2a2a2a;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(223, 241, 64, 0.08);
  backdrop-filter: blur(8px);
  pointer-events: auto;
}

.asset-card[data-domain="air"] {
  border-color: rgba(223, 241, 64, 0.35);
}
.asset-card[data-domain="sea"] {
  border-color: rgba(77, 184, 255, 0.35);
}
.asset-card[data-domain="land"] {
  border-color: rgba(200, 200, 200, 0.3);
}

.asset-card-close {
  position: absolute;
  top: 6px;
  right: 8px;
  z-index: 2;
  border: none;
  background: transparent;
  color: #888;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  font-family: inherit;
}
.asset-card-close:hover {
  color: #fff;
}

.asset-card-media {
  border-bottom: 1px solid #222;
  background: #050505;
  line-height: 0;
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}
.asset-card-media svg,
.asset-card-media .asset-photo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}
.asset-card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55) 0%, transparent 45%);
}

.asset-card-body {
  padding: 0.85rem 1rem 1rem;
}

.asset-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.asset-card-kicker {
  margin: 0;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}
.asset-card[data-domain="sea"] .asset-card-kicker {
  color: #4db8ff;
}
.asset-card[data-domain="land"] .asset-card-kicker {
  color: #c8c8c8;
}

.asset-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border: 1px solid #333;
  color: #999;
  background: #0a0a0a;
}

.asset-status-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 transparent;
}

.asset-status-badge.status-online {
  color: #57c84d;
  border-color: rgba(87, 200, 77, 0.45);
  background: rgba(87, 200, 77, 0.1);
}

.asset-status-badge.status-online::before {
  background: #57c84d;
  box-shadow: 0 0 8px rgba(87, 200, 77, 0.7);
}

.asset-status-badge.status-degraded {
  color: #f5a623;
  border-color: rgba(245, 166, 35, 0.45);
  background: rgba(245, 166, 35, 0.1);
}

.asset-status-badge.status-alert {
  color: #ff4d4d;
  border-color: rgba(255, 77, 77, 0.45);
  background: rgba(255, 77, 77, 0.1);
}

.asset-status-badge.status-offline {
  color: #777;
  border-color: #333;
}

.asset-card[data-status="online"] {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(87, 200, 77, 0.18);
}

.asset-card-callsign {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.asset-card-role {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.35;
}

.asset-id-grid {
  display: grid;
  gap: 1px;
  background: #222;
  border: 1px solid #222;
  margin-bottom: 0.75rem;
}

.asset-id-grid .id-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  background: #0a0a0a;
}

.asset-id-grid .l {
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #666;
}

.asset-id-grid .v {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: right;
}

.asset-id-grid .mono {
  font-variant-numeric: tabular-nums;
  font-family: var(--font);
}

.asset-telem {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.telem-chip {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid #333;
  color: #bbb;
  padding: 0.25rem 0.45rem;
  font-weight: 600;
}

.asset-mode-block {
  border-top: 1px solid #222;
  padding-top: 0.75rem;
}

.asset-mode-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.55rem;
  gap: 0.5rem;
}

.asset-mode-label {
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #666;
  font-weight: 700;
}

.asset-mode-active {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

.asset-mode-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.mode-btn {
  border: 1px solid #333;
  background: #0c0c0c;
  color: #999;
  font-family: inherit;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 0.4rem 0.5rem;
  cursor: pointer;
}

.mode-btn:hover:not(:disabled) {
  border-color: #666;
  color: #fff;
}

.mode-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}

.mode-btn.is-war-mode.is-active {
  background: #ff4d4d;
  border-color: #ff4d4d;
  color: #fff;
}

.mode-btn.is-war-mode:not(.is-active):hover:not(:disabled) {
  border-color: #ff4d4d;
  color: #ffb4b4;
}

.mode-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

.asset-marker.is-war .asset-core {
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.8), 0 0 12px rgba(255, 77, 77, 0.65);
}

/* Leaflet dark chrome */
.page-map .leaflet-container {
  background: #050505;
  font-family: var(--font);
}

.page-map .leaflet-control-zoom a {
  background: #111 !important;
  color: #eee !important;
  border-color: #333 !important;
  width: 30px;
  height: 30px;
  line-height: 30px;
  border-radius: 0 !important;
}

.page-map .leaflet-control-zoom a:hover {
  background: #1a1a1a !important;
  color: var(--accent) !important;
}

.page-map .leaflet-control-attribution {
  background: rgba(0, 0, 0, 0.65) !important;
  color: #555 !important;
  font-size: 10px !important;
  max-width: 50%;
}

.page-map .leaflet-control-attribution a {
  color: #777 !important;
}

.asset-icon-wrap {
  background: transparent !important;
  border: none !important;
}

.asset-icon-wrap {
  background: transparent !important;
  border: none !important;
}

.asset-marker {
  width: 24px;
  height: 24px;
  position: relative;
  display: grid;
  place-items: center;
  transform-origin: center center;
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--c) 55%, transparent));
}

.asset-core {
  display: block;
  width: 10px;
  height: 10px;
  background: var(--c);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.8), 0 0 10px color-mix(in srgb, var(--c) 40%, transparent);
}

.asset-marker.shape-circle .asset-core {
  border-radius: 50%;
  width: 9px;
  height: 9px;
}

.asset-marker.shape-square .asset-core {
  width: 9px;
  height: 9px;
}

.asset-marker.shape-hex .asset-core {
  width: 10px;
  height: 10px;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

/* Directional chevron: tip = nose. Default points north (0°). */
.asset-marker .asset-tri {
  display: block;
  width: 18px;
  height: 18px;
  transform-origin: center center;
  overflow: visible;
}

.asset-marker.is-moving {
  transform: rotate(var(--h, 0deg));
}

.asset-marker.is-selected .asset-core {
  outline: 1px solid #fff;
  outline-offset: 3px;
}

.asset-marker.is-selected .asset-tri {
  filter: drop-shadow(0 0 0 1px #fff) drop-shadow(0 0 8px var(--c));
}

.asset-marker.is-static .asset-core {
  opacity: 0.9;
}

/* ring for static sensors */
.asset-marker.is-static::after {
  content: "";
  position: absolute;
  inset: 2px;
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  border-radius: 50%;
  pointer-events: none;
}

.asset-marker.shape-square.is-static::after {
  border-radius: 0;
}

.map-hud {
  border-left: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  z-index: 2;
}

.map-hud-block {
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--line);
}

.map-hud-title {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
}

.map-hud-note {
  margin: 0 0 0.85rem;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--muted-2);
  text-transform: uppercase;
}

.map-hud-h {
  margin: 0 0 0.65rem;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.map-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
}

.map-kpi {
  border: 1px solid var(--line);
  padding: 0.45rem 0.35rem;
  text-align: center;
}

.map-kpi .n {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.map-kpi .l {
  display: block;
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.15rem;
}

.map-kpi.land .n {
  color: #c8c8c8;
}
.map-kpi.air .n {
  color: var(--accent);
}
.map-kpi.sea .n {
  color: #4db8ff;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.lg-icon {
  width: 10px;
  height: 10px;
  background: #c8c8c8;
  flex-shrink: 0;
}

.lg-icon.air {
  background: var(--accent);
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  width: 11px;
  height: 10px;
}

.lg-icon.sea {
  background: #4db8ff;
  transform: rotate(45deg);
  width: 8px;
  height: 8px;
}

.lg-trail {
  width: 18px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent));
  flex-shrink: 0;
}

.map-empty {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted-2);
}

.detail-callsign {
  margin: 0 0 0.2rem;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.detail-platform {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.detail-grid-mini {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-bottom: 0.65rem;
}

.detail-grid-mini .dg {
  background: #0a0a0a;
  padding: 0.4rem 0.55rem;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.detail-grid-mini .l {
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.detail-grid-mini .v {
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.detail-role {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
}

.map-list-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-bottom: none;
}

.map-list {
  overflow: auto;
  display: grid;
  gap: 0.3rem;
  flex: 1;
  min-height: 0;
  padding-right: 0.15rem;
}

.map-list-item {
  text-align: left;
  border: 1px solid var(--line);
  background: #080808;
  color: var(--text);
  font-family: inherit;
  padding: 0.5rem 0.55rem;
  cursor: pointer;
  border-left: 2px solid #444;
}

.map-list-item.domain-air {
  border-left-color: var(--accent);
}
.map-list-item.domain-sea {
  border-left-color: #4db8ff;
}
.map-list-item.domain-land {
  border-left-color: #888;
}

.map-list-item:hover,
.map-list-item.is-selected {
  background: #121212;
  border-color: #444;
}

.map-list-item.is-selected {
  box-shadow: inset 0 0 0 1px rgba(223, 241, 64, 0.25);
}

.mli-top {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.mli-call {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.mli-dom {
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.mli-sub {
  display: block;
  font-size: 0.65rem;
  color: var(--muted);
}

@media (max-width: 900px) {
  .map-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 55vh 1fr;
  }
  .map-hud {
    border-left: none;
    border-top: 1px solid var(--line);
    max-height: 45vh;
  }
  .page-map .cmd-nav {
    grid-template-columns: 1fr auto;
  }
  .map-filters {
    display: none;
  }
  .asset-card {
    max-height: calc(55vh - 24px);
    overflow: auto;
  }
}


/* ── Lattice / Objects pages (LettuceOS) ── */
.lattice-page { max-width: 1280px; margin: 0 auto; padding: 1.25rem 1.25rem 3rem; }
.lattice-page-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem;
}
.lattice-page-head h1 { margin: 0 0 0.35rem; font-size: 1.65rem; letter-spacing: -0.02em; }
.lattice-page .eyebrow {
  font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: #dff140; margin: 0 0 0.5rem;
}
.lattice-page .lede { max-width: 42rem; }
.lattice-cards { margin-bottom: 1.25rem; }
.lattice-page .card {
  background: #0c0c0c; border: 1px solid #222; border-radius: 8px; padding: 1.1rem 1.2rem;
}
.lattice-page .card-kicker {
  font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: #dff140; margin-bottom: 0.35rem;
}
.lattice-page .card h3 { margin: 0 0 0.45rem; font-size: 1.05rem; }
.lattice-page .grid-3 {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
}
.lattice-page .grid-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
}
.lattice-split {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 1rem; margin-bottom: 1.25rem;
}
@media (max-width: 900px) {
  .lattice-page .grid-3, .lattice-page .grid-2, .lattice-split { grid-template-columns: 1fr; }
}
.lattice-page .kv {
  display: grid; grid-template-columns: 110px 1fr; gap: 0.35rem 0.75rem;
  margin: 0.75rem 0; font-size: 0.8rem;
}
.lattice-page .kv dt { color: #8a8a8a; }
.lattice-page .kv dd { margin: 0; word-break: break-all; color: #dff140; }
.lattice-page .out, .lattice-page .code-block {
  background: #080808; border: 1px solid #222; border-radius: 6px;
  padding: 0.75rem 0.9rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem; line-height: 1.5; overflow: auto; color: #c8c8c8;
  margin: 0; white-space: pre-wrap; word-break: break-word;
}
.lattice-page .out.tall { min-height: 220px; max-height: 420px; }
.lattice-page .mt { margin-top: 0.85rem; }
.lattice-page .mb { margin-bottom: 0.65rem; }
.lattice-page .row { display: flex; align-items: center; }
.lattice-page .gap { gap: 0.5rem; flex-wrap: wrap; }
.lattice-page .chk { font-size: 0.8rem; color: #8a8a8a; display: flex; align-items: center; gap: 0.35rem; cursor: pointer; }
.lattice-page .input {
  width: 100%; background: #050505; border: 1px solid #222; color: #f2f2f2;
  font: inherit; font-size: 0.88rem; padding: 0.45rem 0.6rem; border-radius: 6px; margin-top: 0.2rem;
}
.lattice-page .input:focus { outline: none; border-color: #dff140; }
.lattice-page .input.code, .lattice-page textarea.input {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.78rem; resize: vertical;
}
.lattice-page .full { width: 100%; justify-content: center; }
.lattice-page .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.lattice-page .hidden { display: none !important; }
.lattice-page .block { display: block; }
.lattice-page label { display: block; font-size: 0.78rem; color: #8a8a8a; margin-bottom: 0.15rem; }
.lattice-page code {
  font-family: ui-monospace, Menlo, monospace; font-size: 0.85em;
  background: #1a1a1a; padding: 0.1em 0.3em; border-radius: 3px;
}

/* Media badge on map markers */
.asset-marker.has-media::after {
  content: "M";
  position: absolute; top: -4px; right: -6px;
  width: 12px; height: 12px; border-radius: 2px;
  background: #dff140; color: #111; font-size: 8px; font-weight: 700;
  font-family: ui-monospace, monospace; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 1px #000;
  line-height: 1;
}
.asset-marker.is-pulse {
  animation: marker-pulse 0.9s ease 3;
}
@keyframes marker-pulse {
  0%, 100% { filter: drop-shadow(0 0 0 transparent); }
  50% { filter: drop-shadow(0 0 10px #dff140); }
}
.map-media-rail {
  display: flex; gap: 0.4rem; overflow-x: auto; padding: 0.35rem 0;
}
.map-media-card {
  flex-shrink: 0; display: flex; align-items: center; gap: 0.4rem;
  background: #0e0e0e; border: 1px solid #222; border-radius: 6px;
  padding: 0.25rem 0.45rem 0.25rem 0.25rem; cursor: pointer; color: inherit; font: inherit;
  max-width: 180px;
}
.map-media-card img { width: 36px; height: 26px; object-fit: cover; background: #111; border: 1px solid #222; }
.map-media-card strong { font-size: 0.7rem; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-media-card span { font-size: 0.6rem; color: #8a8a8a; font-family: ui-monospace, monospace; }
.map-hud-note .lattice-tag { color: #dff140; }


/* ═══════════════════════════════════════════════════════════
   OBJECT STORE · dual pane (GUI + CLI)
   ═══════════════════════════════════════════════════════════ */
.obj-schema-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}
.osb-item {
  font-size: 0.68rem;
  font-family: var(--mono);
  color: var(--muted);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  padding: 0.28rem 0.5rem;
  border-radius: 999px;
}
.osb-item strong {
  color: var(--accent);
  font-weight: 600;
  margin-right: 0.25rem;
}

.obj-dual {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 0.85rem;
  min-height: 640px;
  align-items: stretch;
}
@media (max-width: 1100px) {
  .obj-dual { grid-template-columns: 1fr; }
}

.card-flat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.obj-pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #12120c 0%, #0c0c0c 100%);
}
.oph-left { display: flex; align-items: center; gap: 0.6rem; }
.oph-mark {
  width: 18px; height: 18px;
  border: 1.5px solid var(--accent);
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
  background: var(--accent-dim);
}
.oph-title {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  font-weight: 700;
}
.oph-sub { font-size: 0.68rem; color: var(--muted); }
.oph-stats { font-size: 0.72rem; color: var(--muted); font-family: var(--mono); }

.oph-cli-dots { display: flex; gap: 5px; }
.oph-cli-dots i {
  width: 9px; height: 9px; border-radius: 50%;
  background: #333; display: block;
}
.oph-cli-dots i:nth-child(1) { background: #ff5f57; }
.oph-cli-dots i:nth-child(2) { background: #febc2e; }
.oph-cli-dots i:nth-child(3) { background: #28c840; }

.cli-head { background: #0a0a0a; }

.obj-gui-body {
  display: grid;
  grid-template-columns: 280px 1fr;
  flex: 1;
  min-height: 520px;
}
@media (max-width: 700px) {
  .obj-gui-body { grid-template-columns: 1fr; }
}

.obj-sidebar {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #0a0a0a;
}
.obj-toolbar {
  display: flex;
  gap: 0.35rem;
  padding: 0.55rem;
  border-bottom: 1px solid var(--border);
}
.obj-tree {
  flex: 1;
  overflow: auto;
  min-height: 160px;
  max-height: 280px;
  padding: 0.35rem;
}
.obj-empty {
  padding: 1rem;
  color: var(--dim);
  font-size: 0.8rem;
  text-align: center;
}
.obj-folder {
  padding: 0.35rem 0.45rem 0.15rem;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}
.of-name { color: var(--muted); }
.obj-row {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  font: inherit;
  padding: 0.4rem 0.45rem;
  border-radius: var(--radius);
  cursor: pointer;
  margin-bottom: 2px;
}
.obj-row:hover { background: #111; border-color: var(--border); }
.obj-row.active {
  background: var(--accent-dim);
  border-color: var(--accent);
}
.obj-ico {
  width: 18px; height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  border-radius: 3px;
  background: #222;
  border: 1px solid #333;
  position: relative;
}
.obj-ico::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 1px;
  background: var(--muted);
  opacity: 0.5;
}
.obj-ico.img { border-color: #60a5fa; }
.obj-ico.img::after { background: #60a5fa; opacity: 0.7; }
.obj-ico.json { border-color: var(--accent); }
.obj-ico.json::after { background: var(--accent); opacity: 0.6; }
.obj-ico.csv { border-color: #4ade80; }
.obj-ico.csv::after { background: #4ade80; opacity: 0.55; }
.obj-ico.txt { border-color: #94a3b8; }
.obj-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.obj-row-name { font-size: 0.8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.obj-row-path { font-size: 0.62rem; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.obj-row-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.obj-size { font-size: 0.62rem; font-family: var(--mono); color: var(--muted); }
.obj-node {
  font-size: 0.58rem;
  font-family: var(--mono);
  color: #f5a623;
  border: 1px solid #3a2a10;
  padding: 0 0.25rem;
  border-radius: 2px;
}
.obj-link-badge {
  font-size: 0.58rem;
  color: var(--accent);
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.obj-upload-box {
  border-top: 1px solid var(--border);
  padding: 0.65rem;
  overflow: auto;
  max-height: 340px;
}
.btn.full { width: 100%; justify-content: center; }

.obj-main {
  padding: 0.85rem;
  overflow: auto;
  min-height: 0;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(223, 241, 64, 0.04), transparent 50%),
    var(--bg-card);
}
.obj-detail-empty {
  height: 100%;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-align: center;
  gap: 0.35rem;
}
.ode-icon {
  width: 48px; height: 48px;
  border: 2px solid var(--border-hi);
  margin-bottom: 0.5rem;
  position: relative;
  background: #0a0a0a;
}
.ode-icon::before {
  content: "";
  position: absolute;
  left: 8px; right: 8px; top: 14px; height: 2px;
  background: var(--accent);
  opacity: 0.5;
  box-shadow: 0 8px 0 var(--border-hi), 0 16px 0 var(--border-hi);
}
.hidden { display: none !important; }

.obj-detail-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}
.od-path { font-size: 1rem; font-weight: 600; color: var(--accent); word-break: break-all; }
.od-api { font-size: 0.72rem; margin-top: 0.15rem; }

.obj-meta-grid {
  display: grid;
  grid-template-columns: minmax(140px, 200px) 1fr;
  gap: 0.3rem 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #080808;
  margin-bottom: 0.85rem;
  font-size: 0.75rem;
}
.omg-k { color: var(--muted); font-family: var(--mono); font-size: 0.68rem; }
.omg-v { color: var(--text); word-break: break-all; font-size: 0.72rem; }

.obj-preview-wrap { margin-bottom: 0.85rem; }
.obj-preview {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #050505;
  min-height: 120px;
  max-height: 280px;
  overflow: auto;
  padding: 0.65rem;
}
.od-img {
  max-width: 100%;
  max-height: 240px;
  display: block;
  margin: 0 auto;
  background: #111;
  border: 1px solid var(--border);
}
.od-text, .od-hex {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.45;
  color: #c8c8c8;
  white-space: pre-wrap;
  word-break: break-word;
}
.od-hex { color: #8ab4f8; white-space: pre; }
.err { color: var(--danger); font-size: 0.85rem; }

.obj-link-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  background: #0a0a0a;
}
.danger-btn { color: #fca5a5 !important; border-color: #4a2020 !important; }
.danger-btn:hover { border-color: var(--danger) !important; }

/* CLI terminal */
.obj-cli { background: #050505; }
.cli-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 420px;
  max-height: 640px;
  padding: 0.65rem 0.75rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  background:
    linear-gradient(rgba(223, 241, 64, 0.02) 1px, transparent 1px),
    #050505;
  background-size: 100% 4px;
  outline: none;
}
.cli-output {
  flex: 1;
  overflow: auto;
  color: #c8c8c8;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.cli-block { margin-bottom: 0.55rem; }
.cli-echo { color: #e8e8e8; }
.cli-prompt {
  color: var(--accent);
  font-weight: 600;
  margin-right: 0.4rem;
  user-select: none;
}
.cli-line {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid #151515;
  margin-top: 0.25rem;
}
.cli-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font: inherit;
  outline: none;
  caret-color: var(--accent);
  min-width: 0;
}
.cli-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0.45rem 0.65rem;
  border-top: 1px solid var(--border);
  background: #0a0a0a;
}
.cli-hints button {
  font-family: var(--mono);
  font-size: 0.65rem;
  background: #111;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  cursor: pointer;
}
.cli-hints button:hover {
  color: var(--accent);
  border-color: #3a3a20;
}

.obj-activity { max-height: 180px; overflow: hidden; }
.obj-activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 120px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 0.72rem;
}
.obj-activity-list li {
  display: flex;
  gap: 0.65rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid #161616;
  color: var(--muted);
}
.oa-kind { color: var(--accent); min-width: 120px; }
.oa-detail { flex: 1; word-break: break-all; }
.oa-time { color: var(--dim); }

/* ── Manufacturing dashboard ── */
/* Layout is size-stable: reserve slots, tabular nums, ellipsis — no jump on fault/LIVE text */
.mfg-page {
  max-width: 1280px; margin: 0 auto; padding: 1.25rem 1.25rem 3rem;
  font-variant-numeric: tabular-nums;
}

/* Source provenance strip — labels only, no IPs / creds / hostnames */
.mfg-source-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1rem;
  padding: 0.7rem 0.95rem;
  border-radius: 10px;
  border: 1px solid #2a2a18;
  background: linear-gradient(135deg, #0e1008 0%, #0c0c0c 55%, #0a0c10 100%);
  box-sizing: border-box;
  min-height: 3.4rem;
}
.mfg-source-strip[data-state="live"] {
  border-color: #3a4a20;
  box-shadow: 0 0 0 1px rgba(223, 241, 64, 0.08);
}
.mfg-source-strip[data-state="sim"] {
  border-color: #3a3a20;
}
.mfg-source-strip[data-state="offline"] {
  border-color: #4a2020;
  background: linear-gradient(135deg, #120808 0%, #0c0c0c 100%);
}
.mfg-source-strip[data-state="lost"] {
  border-color: #5a4020;
  background: linear-gradient(135deg, #141008 0%, #0c0c0c 60%, #100c08 100%);
  box-shadow: 0 0 0 1px rgba(245, 166, 35, 0.12);
}
.mfg-source-main {
  display: flex; align-items: center; gap: 0.7rem; min-width: 0;
}
.mfg-source-dot {
  width: 0.65rem; height: 0.65rem; border-radius: 50%;
  background: #555; flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(85, 85, 85, 0.2);
}
.mfg-source-strip[data-state="live"] .mfg-source-dot {
  background: #dff140;
  box-shadow: 0 0 0 3px rgba(223, 241, 64, 0.2);
  animation: mfg-pulse 1.8s ease-in-out infinite;
}
.mfg-source-strip[data-state="sim"] .mfg-source-dot {
  background: #c8c8a0;
  box-shadow: 0 0 0 3px rgba(200, 200, 160, 0.15);
}
.mfg-source-strip[data-state="offline"] .mfg-source-dot {
  background: #f44;
  box-shadow: 0 0 0 3px rgba(255, 68, 68, 0.15);
}
.mfg-source-strip[data-state="lost"] .mfg-source-dot {
  background: #f5a623;
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.2);
  animation: mfg-pulse 1.2s ease-in-out infinite;
}
.mfg-source-strip[data-state="lost"] .mfg-source-title {
  color: #f5d08a;
}
@keyframes mfg-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.mfg-source-copy {
  display: flex; flex-direction: column; gap: 0.12rem; min-width: 0;
}
.mfg-source-title {
  font-size: 0.92rem; font-weight: 650; color: #f2f2f2;
  letter-spacing: -0.01em; line-height: 1.25;
}
.mfg-source-strip[data-state="live"] .mfg-source-title { color: #eef5b0; }
.mfg-source-sub {
  font-size: 0.72rem; color: #8a8a8a; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mfg-source-badges {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem;
  flex-shrink: 0;
}
.mfg-badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.68rem; letter-spacing: 0.04em;
  border: 1px solid #333; border-radius: 999px;
  padding: 0.28rem 0.55rem 0.28rem 0.4rem;
  background: #0a0a0a; color: #c8c8c8;
  white-space: nowrap;
}
.mfg-badge-ico {
  width: 14px; height: 14px; flex-shrink: 0;
}
.mfg-badge-ts {
  color: #b8c4ff;
  border-color: #2a3050;
  background: #0a0c14;
}
.mfg-badge-ts .mfg-ts-mark { color: #7a8cff; }
.mfg-badge-ignition { color: #d8e8a0; border-color: #2a3020; }
.mfg-badge-site { color: #c8c8c8; }
@media (max-width: 640px) {
  .mfg-source-strip { align-items: flex-start; }
  .mfg-source-sub { white-space: normal; }
}
.mfg-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem;
  min-height: 3.5rem;
}
.mfg-head h1 { margin: 0; font-size: 1.65rem; letter-spacing: -0.02em; line-height: 1.2; }
.mfg-head .eyebrow {
  font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: #dff140; margin: 0 0 0.45rem; min-height: 1em;
}
.mfg-title-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.mfg-how-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.22rem 0.55rem 0.22rem 0.28rem;
  border: 1px solid #333;
  border-radius: 999px;
  background: #0c0c0c;
  color: #a0a0a0;
  font: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.mfg-how-btn:hover,
.mfg-how-btn:focus-visible {
  border-color: #4a4a28;
  color: #dff140;
  background: #12140c;
  outline: none;
}
.mfg-how-btn[aria-expanded="true"] {
  border-color: #4a4a28;
  color: #dff140;
}
.mfg-how-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  border: 1px solid currentColor;
  font-size: 0.68rem;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1;
  flex-shrink: 0;
}
.mfg-how-label {
  text-transform: uppercase;
  opacity: 0.92;
}
.mfg-head-actions { display: flex; flex-wrap: wrap; gap: 0.55rem; align-items: center; flex-shrink: 0; justify-content: flex-end; }

/* Ignition trial notice */
.mfg-trial-note {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin: 0 0 0.9rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid #5a4020;
  border-radius: 10px;
  background: linear-gradient(135deg, #141008 0%, #0c0c0c 70%);
  color: #d4b896;
  font-size: 0.82rem;
  line-height: 1.45;
}
.mfg-trial-note p {
  margin: 0;
  min-width: 0;
}
.mfg-trial-note strong {
  color: #f5d4a0;
  font-weight: 650;
}
.mfg-trial-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.05rem;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  border: 1px solid #8a6020;
  background: #1a1408;
  color: #f5a623;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* How this works dialog */
.mfg-how-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.55);
  border: none;
  cursor: pointer;
}
.mfg-how-dialog {
  position: fixed;
  z-index: 110;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(36rem, calc(100vw - 1.5rem));
  max-height: min(88vh, 40rem);
  flex-direction: column;
  background: #0a0a0a;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  padding: 0;
  color: #c4c4c4;
}
/* Native <dialog>: must not force display when closed (breaks Close / Escape) */
.mfg-how-dialog:not([open]) {
  display: none;
}
.mfg-how-dialog[open] {
  display: flex;
}
.mfg-how-dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
  cursor: pointer;
}
.mfg-how-inner {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: min(88vh, 40rem);
}
.mfg-how-inner > header,
.mfg-how-dialog > form > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.1rem 0.85rem;
  border-bottom: 1px solid #1e1e1e;
  flex-shrink: 0;
}
.mfg-how-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.1rem 0.85rem;
  border-bottom: 1px solid #1e1e1e;
  flex-shrink: 0;
}
.mfg-how-head h2 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #e8e8e8;
}
.mfg-how-head .eyebrow {
  margin: 0 0 0.2rem;
  color: #888;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.mfg-how-body {
  padding: 1rem 1.15rem 1.25rem;
  overflow: auto;
  font-size: 0.88rem;
  line-height: 1.55;
  color: #c4c4c4;
}
.mfg-how-lead {
  margin: 0 0 1rem;
  color: #e0e0e0;
  font-size: 0.95rem;
  line-height: 1.5;
}
.mfg-how-steps {
  margin: 0 0 1.1rem;
  padding: 0;
  list-style: none;
  counter-reset: how;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.mfg-how-steps li {
  counter-increment: how;
  display: grid;
  grid-template-columns: 1.5rem 1fr;
  column-gap: 0.55rem;
  align-items: start;
}
.mfg-how-steps li::before {
  content: counter(how);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  border: 1px solid #3a3a20;
  background: #12140c;
  color: #dff140;
  font-size: 0.7rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  margin-top: 0.1rem;
}
.mfg-how-steps strong {
  display: block;
  grid-column: 2;
  color: #f0f0f0;
  font-size: 0.86rem;
  margin-bottom: 0.15rem;
  letter-spacing: 0.02em;
}
.mfg-how-steps span {
  grid-column: 2;
  color: #a8a8a8;
  font-size: 0.84rem;
}
.mfg-how-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}
@media (max-width: 560px) {
  .mfg-how-grid { grid-template-columns: 1fr; }
  .mfg-how-label { display: none; }
  .mfg-how-btn { padding: 0.28rem; }
}
.mfg-how-grid h3 {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #888;
}
.mfg-how-grid ul {
  margin: 0;
  padding: 0 0 0 1rem;
  color: #b0b0b0;
  font-size: 0.82rem;
}
.mfg-how-grid li { margin-bottom: 0.3rem; }
.mfg-how-footnote {
  margin: 0;
  padding-top: 0.65rem;
  border-top: 1px solid #1a1a1a;
}
body.mfg-how-open {
  overflow: hidden;
}
.mfg-mode-toggle {
  display: inline-flex;
  border: 1px solid #333;
  border-radius: 999px;
  background: #080808;
  padding: 0.15rem;
  gap: 0.1rem;
}
.mfg-mode-btn {
  border: none;
  background: transparent;
  color: #8a8a8a;
  font: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.mfg-mode-btn:hover { color: #f2f2f2; }
.mfg-mode-btn.is-active {
  background: #1a1a10;
  color: #dff140;
  box-shadow: inset 0 0 0 1px #3a3a20;
}
.mfg-mode-btn[data-mode="simulation"].is-active {
  background: #12140c;
  color: #c8c8a0;
  box-shadow: inset 0 0 0 1px #3a3a20;
}
.mfg-mqtt-pill {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.72rem;
  letter-spacing: 0;
  border: 1px solid #333; border-radius: 999px; padding: 0.28rem 0.5rem;
  background: #0c0c0c; color: #8a8a8a;
  /* Hug content — slot widths hold the numbers stable */
  width: max-content;
  max-width: 100%;
  justify-content: flex-start;
  white-space: nowrap;
  box-sizing: border-box;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", SFMono-Regular, Menlo, Consolas, monospace;
  flex-shrink: 0;
}
.mfg-mqtt-pill .mfg-pill-text,
.mfg-mqtt-pill #mqtt-pill-text {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}
/* One slot per site: CA LIVE 12.3s  — age column holds max "119.9s" */
.mfg-mqtt-pill .pill-slot {
  display: inline-grid;
  grid-template-columns: 2ch 4ch 6ch;
  column-gap: 0.28rem;
  align-items: baseline;
}
.mfg-mqtt-pill .pill-site,
.mfg-mqtt-pill .msp-status,
.mfg-mqtt-pill .msp-age {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}
.mfg-mqtt-pill .pill-site {
  text-align: left;
  opacity: 0.85;
}
.mfg-mqtt-pill .msp-status {
  text-align: left;
}
.mfg-mqtt-pill .msp-age {
  text-align: right;
}
.mfg-mqtt-pill .pill-sep {
  display: inline-block;
  width: 0.75ch;
  text-align: center;
  opacity: 0.45;
  letter-spacing: 0;
  flex-shrink: 0;
}
/* Shared age/status slots for CA/OH panel pills */
.msp-pill .msp-status,
.msp-pill .msp-age {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}
.msp-pill .msp-status {
  text-align: left;
}
.msp-pill .msp-age {
  text-align: right;
}
.mfg-mqtt-pill .live-dot {
  width: 0.45rem; height: 0.45rem; border-radius: 50%;
  background: #555; flex-shrink: 0;
}
.mfg-mqtt-pill.is-live { border-color: #dff140; color: #dff140; }
.mfg-mqtt-pill.is-live .live-dot {
  background: #dff140;
  box-shadow: 0 0 0 3px rgba(223, 241, 64, 0.2);
  animation: mfg-pulse 1.8s ease-in-out infinite;
}
.mfg-mqtt-pill.is-sim { border-color: #3a3a20; color: #c8c8a0; }
.mfg-mqtt-pill.is-sim .live-dot { background: #c8c8a0; }
.mfg-mqtt-pill.is-lost {
  border-color: #5a4020; color: #f5a623;
}
.mfg-mqtt-pill.is-lost .live-dot {
  background: #f5a623;
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.2);
  animation: mfg-pulse 1.2s ease-in-out infinite;
}
.mfg-mqtt-pill.is-offline { border-color: #4a2020; color: #fca5a5; }
.mfg-mqtt-pill.is-offline .live-dot { background: #f44; }
.mfg-mqtt-pill.is-waiting { border-color: #333; color: #a0a0a0; }
.mfg-mqtt-pill.is-waiting .live-dot { background: #666; }
.mfg-source-strip[data-state="waiting"] {
  border-color: #2a2a2a;
}
.mfg-source-strip[data-state="waiting"] .mfg-source-dot {
  background: #666;
}
.mfg-source-strip[data-state="sim"] .mfg-source-title {
  color: #c8c8a0;
}

/* Hidden lab config page */
.mfg-config-downloads {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 0.65rem;
}
.mfg-config-downloads li {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem;
}
.mfg-config-pre {
  margin: 0;
  padding: 0.75rem;
  background: #050505;
  border: 1px solid #1a1a1a;
  border-radius: 6px;
  max-height: 420px;
  overflow: auto;
  font-size: 0.72rem;
  color: #c8c8c8;
  white-space: pre-wrap;
  word-break: break-word;
}
.mfg-status-bar {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.5rem;
  margin-bottom: 1.1rem;
}
@media (max-width: 900px) {
  .mfg-status-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.msb-item {
  background: #0c0c0c; border: 1px solid #222; border-radius: 8px; padding: 0.55rem 0.7rem;
  min-height: 3.35rem; box-sizing: border-box; overflow: hidden;
}
.msb-l { display: block; font-size: 0.65rem; letter-spacing: 0.1em; text-transform: uppercase; color: #666; line-height: 1.2; }
.msb-v {
  display: block; font-size: 0.85rem; color: #f2f2f2; line-height: 1.25; min-height: 1.25em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.mfg-line-card {
  background: #0c0c0c; border: 1px solid #222; border-radius: 10px; padding: 1rem 1.1rem;
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  box-sizing: border-box;
  min-width: 0;
  /* reserve alarm ring so is-alarm does not change outer size */
  box-shadow: 0 0 0 1px transparent;
}
.mfg-line-card .mlc-detail {
  flex: 1 1 auto;
  min-height: 0;
}
.mfg-line-card.is-open {
  cursor: default;
}
.mfg-line-card.is-running { border-color: #2a2a18; }
.mfg-line-card.is-alarm {
  border-color: #5a2020;
  box-shadow: 0 0 0 1px rgba(255, 77, 77, 0.15);
}
.mlc-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 0.5rem; margin-bottom: 0.75rem; min-height: 3.4rem;
}
.mlc-head h2 { margin: 0; font-size: 1.2rem; letter-spacing: 0.04em; }
.mlc-titles { min-width: 0; flex: 1; }
.mlc-titles h2 {
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
}
.mlc-titles .muted {
  margin: 0.1rem 0 0; line-height: 1.25; min-height: 1.25em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mfg-state {
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-family: ui-monospace, monospace; letter-spacing: 0.06em;
  padding: 0.25rem 0.5rem; border-radius: 4px; border: 1px solid #333;
  min-width: 5.75rem; min-height: 1.55rem; box-sizing: border-box;
  text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mfg-state.st-run { color: #111; background: #dff140; border-color: #dff140; font-weight: 700; }
.mfg-state.st-fault { color: #fff; background: #a11; border-color: #f44; }
.mfg-state.st-hold { color: #f5a623; border-color: #f5a623; }
.mfg-state.st-idle { color: #8a8a8a; }
.mlc-progress { margin-bottom: 0.75rem; }
.mlc-bar {
  height: 10px; background: #1a1a1a; border-radius: 999px; overflow: hidden; border: 1px solid #222;
}
.mlc-bar i {
  display: block; height: 100%; background: linear-gradient(90deg, #8a9a20, #dff140);
  border-radius: 999px; transition: width 0.6s ease;
}
.mlc-prog-meta {
  display: flex; justify-content: space-between; gap: 0.5rem;
  font-size: 0.78rem; color: #8a8a8a; margin-top: 0.3rem;
  min-height: 1.2em; font-variant-numeric: tabular-nums;
}
.mlc-prog-meta span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mlc-kpis {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.4rem;
  margin-bottom: 0.65rem;
}
.mlc-kpis > div {
  min-width: 0; overflow: hidden;
  background: #080808; border: 1px solid #1a1a1a; border-radius: 6px;
  padding: 0.35rem 0.4rem; min-height: 2.6rem; box-sizing: border-box;
}
.mlc-kpis .k {
  display: block; font-size: 0.62rem; color: #666; letter-spacing: 0.08em;
  text-transform: uppercase; line-height: 1.2;
}
.mlc-kpis .v {
  display: block; font-family: ui-monospace, monospace; font-size: 0.95rem;
  line-height: 1.25; min-height: 1.25em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.mlc-stations { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.mfg-station {
  font-size: 0.68rem; font-family: ui-monospace, monospace;
  border: 1px solid #333; border-radius: 4px; padding: 0.15rem 0.4rem; color: #666;
}
.mfg-station.on { color: #dff140; border-color: #3a3a20; background: rgba(223,241,64,0.06); }
/* Always-present alarm slot — does not grow/shrink the card when faults toggle */
.mlc-alarm {
  margin-top: 0.65rem;
  font-size: 0.78rem;
  line-height: 1.3;
  min-height: 2.35rem;
  max-height: 2.35rem;
  box-sizing: border-box;
  border-radius: 6px;
  padding: 0.4rem 0.55rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid transparent;
  background: transparent;
  color: transparent;
}
.mlc-alarm.is-on {
  color: #fca5a5;
  background: #1a0a0a;
  border-color: #4a2020;
}
.mlc-alarm.is-off {
  visibility: hidden; /* keep layout space */
  pointer-events: none;
}
.mfg-split {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 1rem;
  align-items: start;
}
@media (max-width: 900px) { .mfg-split { grid-template-columns: 1fr; } }
.mfg-card {
  background: #0c0c0c; border: 1px solid #222; border-radius: 10px; padding: 0.85rem 1rem;
  min-width: 0; box-sizing: border-box;
}
.mfg-card-h {
  display: flex; justify-content: space-between; align-items: center; gap: 0.5rem;
  margin-bottom: 0.55rem; min-height: 1.75rem;
}
.mfg-card-h h2 {
  margin: 0; font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase; color: #8a8a8a;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mfg-filter { max-width: 200px; width: 100%; font-size: 0.8rem !important; box-sizing: border-box; }
.mfg-tag-table-wrap { max-height: 420px; min-height: 420px; overflow: auto; }
.mfg-tag-table {
  width: 100%; border-collapse: collapse; font-size: 0.78rem;
  table-layout: fixed;
}
.mfg-tag-table th {
  text-align: left; position: sticky; top: 0; background: #111;
  color: #666; font-weight: 500; padding: 0.35rem 0.4rem; border-bottom: 1px solid #222;
  font-size: 0.65rem; letter-spacing: 0.08em; text-transform: uppercase;
}
.mfg-tag-table th:nth-child(1), .mfg-tag-table td:nth-child(1) { width: 38%; }
.mfg-tag-table th:nth-child(2), .mfg-tag-table td:nth-child(2) { width: 18%; }
.mfg-tag-table th:nth-child(3), .mfg-tag-table td:nth-child(3) { width: 14%; }
.mfg-tag-table th:nth-child(4), .mfg-tag-table td:nth-child(4) { width: 12%; }
.mfg-tag-table th:nth-child(5), .mfg-tag-table td:nth-child(5) { width: 18%; }
.mfg-tag-table td {
  padding: 0.3rem 0.4rem; border-bottom: 1px solid #161616;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  height: 1.7rem; box-sizing: border-box;
  font-variant-numeric: tabular-nums;
}
.mfg-tag-table .path { color: #c8c8c8; }
.mfg-tag-table .val { color: #dff140; }
.mfg-tag-table .src-mqtt { color: #4ade80; }
.mfg-tag-table .src-sim { color: #94a3b8; }
/* Event feed — right drawer */
.mfg-events-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.mfg-events-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.15rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: #2a2a10;
  border: 1px solid #3a3a20;
  color: #dff140;
  font-size: 0.65rem;
  font-variant-numeric: tabular-nums;
}
.mfg-events-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.45);
  border: none;
  cursor: pointer;
}
.mfg-events-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 90;
  width: min(22rem, 92vw);
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #0a0a0a;
  border-left: 1px solid #2a2a2a;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.45);
  transform: translateX(100%);
  transition: transform 0.22s ease;
  pointer-events: none;
}
.mfg-events-drawer.is-open {
  transform: translateX(0);
  pointer-events: auto;
}
.mfg-events-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid #1e1e1e;
  flex-shrink: 0;
}
.mfg-events-drawer-head h2 {
  margin: 0 0 0.2rem;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c8c8c8;
}
.mfg-events-drawer-head .muted {
  margin: 0;
}
#mfg-events-source[data-feed="simulation"] {
  color: #c8c8a0;
}
#mfg-events-source[data-feed="ignition"] {
  color: #a8b88a;
}
.mfg-events {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0.85rem 1.5rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  font-size: 0.75rem;
}
.mfg-events li {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) minmax(2.8rem, auto) 2.8rem;
  gap: 0.35rem;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid #161616;
  min-height: 1.75rem;
  box-sizing: border-box;
}
.mfg-events li > * {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.mfg-events .accent { color: #dff140; font-variant-numeric: tabular-nums; }
body.mfg-events-open {
  overflow: hidden;
}
.mfg-connect {
  font-size: 0.8rem; line-height: 1.7; background: #080808;
  border: 1px solid #222; border-radius: 6px; padding: 0.65rem 0.8rem;
}
.mfg-connect .dim { color: #666; display: inline-block; min-width: 5.5rem; }
.mfg-page .mt { margin-top: 0.85rem; }
.mfg-page .input {
  background: #050505; border: 1px solid #222; color: #f2f2f2;
  font: inherit; padding: 0.35rem 0.5rem; border-radius: 6px;
}

/* MFG product lines v2 */
.mfg-toolbar {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 0.85rem; flex-wrap: wrap; margin-bottom: 0.85rem;
  min-height: 2rem;
}
.mfg-filter-groups {
  display: flex; flex-direction: column; gap: 0.4rem;
}
.mfg-domain-filters,
.mfg-site-filters { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.mfg-site-badge {
  font-size: 0.55rem; letter-spacing: 0.08em; font-weight: 700;
  border: 1px solid #333; border-radius: 3px; padding: 0.1rem 0.3rem;
  font-family: ui-monospace, monospace; flex-shrink: 0;
}
.mfg-site-badge.site-california,
.mfg-site-badge.site-homelab { color: #8ab4f8; border-color: #1a2a4a; }
.mfg-site-badge.site-arsenal1 { color: #f5a623; border-color: #5a4020; }

/* Dual site connection panels — always 50% / 50% */
.mfg-site-status-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
  width: 100%;
  align-items: stretch;
}
@media (max-width: 720px) {
  .mfg-site-status-grid { grid-template-columns: 1fr; }
}
.mfg-site-panel {
  display: flex;
  flex-direction: column;
  text-align: left;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 100%;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  background: #0c0c0c;
  padding: 0.75rem 0.9rem;
  color: inherit;
  font: inherit;
  cursor: pointer;
  box-sizing: border-box;
  /* Shared footprint so CA (many lines) and OH (one line) match */
  min-height: 9.5rem;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.mfg-site-panel:hover { border-color: #3a3a30; }
.mfg-site-panel.is-selected {
  box-shadow: 0 0 0 1px rgba(223, 241, 64, 0.25);
  border-color: #4a4a28;
}
.mfg-site-panel.site-california,
.mfg-site-panel.site-homelab { border-left: 3px solid #4a7ab8; }
.mfg-site-panel.site-arsenal1 { border-left: 3px solid #c47a20; }
.mfg-site-panel.conn-live { background: linear-gradient(135deg, #0e1208 0%, #0c0c0c 70%); }
.mfg-site-panel.conn-lost { background: linear-gradient(135deg, #141008 0%, #0c0c0c 70%); }
.mfg-site-panel.conn-sim { background: linear-gradient(135deg, #12140c 0%, #0c0c0c 70%); }
.msp-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.55rem;
  margin-bottom: 0.45rem;
  min-width: 0;
  width: 100%;
}
.msp-title {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
.msp-region {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #666;
  margin-bottom: 0.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.msp-name {
  display: block;
  font-size: 1rem;
  font-weight: 650;
  color: #f2f2f2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.msp-pill {
  display: inline-grid;
  grid-template-columns: 0.4rem max-content 6ch;
  align-items: baseline;
  column-gap: 0.35rem;
  font-size: 0.68rem;
  letter-spacing: 0;
  border: 1px solid #333; border-radius: 999px; padding: 0.22rem 0.45rem;
  white-space: nowrap;
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", SFMono-Regular, Menlo, Consolas, monospace;
  color: #8a8a8a;
  width: max-content;
  max-width: 100%;
  box-sizing: border-box;
}
.msp-pill.conn-live { border-color: #3a4a20; color: #dff140; }
.msp-pill.conn-lost { border-color: #5a4020; color: #f5a623; }
.msp-pill.conn-sim { border-color: #3a3a20; color: #c8c8a0; }
.msp-pill.conn-waiting { border-color: #333; color: #888; }
.msp-dot {
  width: 0.4rem; height: 0.4rem; border-radius: 50%; background: #555;
  flex-shrink: 0;
}
.msp-pill.conn-live .msp-dot {
  background: #dff140;
  box-shadow: 0 0 0 2px rgba(223, 241, 64, 0.2);
  animation: mfg-pulse 1.8s ease-in-out infinite;
}
.msp-pill.conn-lost .msp-dot {
  background: #f5a623;
  animation: mfg-pulse 1.2s ease-in-out infinite;
}
.msp-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  font-size: 0.7rem;
  color: #8a8a8a;
  margin-bottom: 0.35rem;
  min-width: 0;
  width: 100%;
}
.msp-meta > span {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Product line list — wrap fully so CA’s long roster stays readable */
.msp-lines {
  margin-bottom: 0.35rem;
  min-width: 0;
  width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.4;
  font-size: 0.72rem;
  flex: 1 1 auto;
}
.msp-last {
  font-size: 0.68rem;
  min-width: 0;
  width: 100%;
  margin-top: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mfg-tags-full {
  margin-bottom: 0.85rem;
}
.mfg-tags-full .mfg-tag-table-wrap {
  min-height: 280px;
  max-height: 420px;
}
/* MQTT: always California | Ohio at 50% each; filter hides one panel */
.mfg-mqtt-dual {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.85rem;
  margin-top: 0.85rem;
  width: 100%;
}
.mfg-mqtt-dual.show-only-ca {
  grid-template-columns: minmax(0, 1fr);
}
.mfg-mqtt-dual.show-only-oh {
  grid-template-columns: minmax(0, 1fr);
}
.mfg-mqtt-dual .mfg-card {
  min-width: 0;
}
@media (max-width: 900px) {
  .mfg-mqtt-dual {
    grid-template-columns: 1fr;
  }
  .mfg-mqtt-dual.show-only-ca,
  .mfg-mqtt-dual.show-only-oh {
    grid-template-columns: 1fr;
  }
}
.mfg-mqtt-dual .mqtt-log {
  min-height: 280px;
  max-height: 360px;
}
.mqtt-site-tag {
  font-size: 0.55rem; font-weight: 700; letter-spacing: 0.06em;
  border: 1px solid #333; border-radius: 3px; padding: 0.05rem 0.25rem;
  color: #8ab4f8;
}
.mqtt-row.site-arsenal1 .mqtt-site-tag { color: #f5a623; border-color: #5a4020; }
.mqtt-row.site-california .mqtt-site-tag,
.mqtt-row.site-homelab .mqtt-site-tag { color: #8ab4f8; border-color: #1a2a4a; }
.mfg-expand-controls {
  display: flex; flex-direction: column; align-items: flex-end; gap: 0.4rem;
  max-width: min(28rem, 100%);
}
.mfg-expand-hint {
  margin: 0; text-align: right; line-height: 1.35; color: #8a8a8a;
  white-space: normal;
}
.mfg-expand-toggle {
  display: inline-flex; align-items: center; gap: 0.55rem;
  border: 1px solid #333; background: #0c0c0c; color: #c8c8c8;
  border-radius: 999px; padding: 0.35rem 0.75rem 0.35rem 0.4rem;
  font: inherit; font-size: 0.78rem; cursor: pointer;
  white-space: nowrap;
}
.mfg-expand-toggle:hover { border-color: #4a4a30; color: #f2f2f2; }
.mfg-expand-knob {
  width: 2rem; height: 1.15rem; border-radius: 999px;
  background: #1a1a1a; border: 1px solid #333; position: relative;
  flex-shrink: 0; transition: background 0.15s ease, border-color 0.15s ease;
}
.mfg-expand-knob::after {
  content: "";
  position: absolute; top: 1px; left: 2px;
  width: 0.85rem; height: 0.85rem; border-radius: 50%;
  background: #666; transition: transform 0.15s ease, background 0.15s ease;
}
.mfg-expand-toggle.is-on {
  border-color: #3a3a20; color: #dff140;
}
.mfg-expand-toggle.is-on .mfg-expand-knob {
  background: #2a2a10; border-color: #5a5a20;
}
.mfg-expand-toggle.is-on .mfg-expand-knob::after {
  transform: translateX(0.8rem); background: #dff140;
}
.mfg-lines {
  display: flex; flex-direction: column;
  gap: 0.85rem; margin-bottom: 1.1rem;
}
.mfg-line-row {
  display: grid;
  grid-template-columns: repeat(var(--mfg-cols, 2), minmax(0, 1fr));
  gap: 0.85rem;
  align-items: stretch;
}
.mfg-line-row.is-open .mfg-line-card:not(.is-filler) {
  height: 100%;
}
.mfg-line-card.is-filler {
  visibility: hidden; pointer-events: none; border: none; background: transparent;
  box-shadow: none; min-height: 0; padding: 0;
}
.mfg-line-card .mlc-toggle {
  display: flex; align-items: flex-start; gap: 0.5rem;
  background: none; border: none; color: inherit; font: inherit;
  text-align: left; cursor: pointer; padding: 0; flex: 1; min-width: 0;
}
.mfg-line-card .mlc-toggle:hover .mlc-titles h2 { color: #dff140; }
.mfg-line-card .chev {
  color: #dff140; font-size: 0.9rem; line-height: 1.4;
  width: 0.9rem; flex-shrink: 0; text-align: center;
}
.mlc-head-right {
  display: flex; flex-direction: column; align-items: flex-end; gap: 0.35rem;
  flex-shrink: 0;
}
.mlc-details-btn {
  display: inline-flex; align-items: center; gap: 0.3rem;
  border: 1px solid #333; background: #080808; color: #8a8a8a;
  border-radius: 999px; padding: 0.2rem 0.5rem;
  font: inherit; font-size: 0.65rem; letter-spacing: 0.06em;
  text-transform: uppercase; cursor: pointer;
  white-space: nowrap;
}
.mlc-details-btn:hover,
.mfg-line-card.is-open .mlc-details-btn {
  border-color: #3a3a20; color: #dff140;
}
.mlc-details-chev { font-size: 0.7rem; line-height: 1; }
.mfg-line-card h2 {
  font-size: 1.0rem; margin: 0 0 0.15rem;
  display: flex; flex-wrap: nowrap; gap: 0.35rem; align-items: center;
  min-width: 0;
}
.mfg-dom {
  font-size: 0.58rem; letter-spacing: 0.08em; font-weight: 700;
  border: 1px solid #333; border-radius: 3px; padding: 0.1rem 0.3rem;
  font-family: ui-monospace, monospace;
  flex-shrink: 0; min-width: 2.6rem; text-align: center; box-sizing: border-box;
}
.mfg-dom.dom-air { color: #dff140; border-color: #3a3a20; }
.mfg-dom.dom-sea { color: #4db8ff; border-color: #1a3a4a; }
.mfg-dom.dom-land { color: #c8c8c8; border-color: #333; }
.mlc-sec {
  margin: 0.75rem 0 0.4rem; font-size: 0.65rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: #666; min-height: 1em;
}
.mfg-steps {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem;
  align-items: stretch;
}
@media (max-width: 500px) { .mfg-steps { grid-template-columns: 1fr; } }
.mfg-step {
  background: #080808; border: 1px solid #1e1e1e; border-radius: 6px; padding: 0.4rem 0.45rem;
  min-height: 3.85rem; box-sizing: border-box; overflow: hidden;
}
.mfg-step.on { border-color: #3a3a20; }
.ms-top { display: flex; align-items: center; gap: 0.3rem; font-size: 0.72rem; min-height: 1.1em; }
.ms-ico { width: 1rem; text-align: center; opacity: 0.8; flex-shrink: 0; }
.ms-name {
  flex: 1; font-weight: 600; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ms-pct {
  color: #dff140; font-size: 0.68rem; flex-shrink: 0;
  min-width: 2.4rem; text-align: right; font-variant-numeric: tabular-nums;
}
.ms-bar {
  height: 4px; background: #1a1a1a; border-radius: 99px; margin: 0.3rem 0 0.2rem; overflow: hidden;
}
.ms-bar i { display: block; height: 100%; background: #dff140; border-radius: 99px; }
.ms-meta {
  font-size: 0.62rem; min-height: 1.5em; line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mfg-partials { display: flex; flex-direction: column; gap: 0.3rem; }
.mfg-partial {
  display: grid; grid-template-columns: 100px minmax(0, 1fr) minmax(5.5rem, auto);
  gap: 0.4rem; align-items: center;
  font-size: 0.72rem; min-height: 1.35rem;
}
.mp-name {
  font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mp-bar {
  height: 4px; background: #1a1a1a; border-radius: 99px; overflow: hidden;
}
.mp-bar i { display: block; height: 100%; background: #8ab4f8; }
.mp-n {
  color: #8a8a8a; font-size: 0.65rem; text-align: right;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.mfg-printers {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem;
  align-items: stretch;
}
.mfg-printer {
  background: #080808; border: 1px solid #1e1e1e; border-radius: 6px; padding: 0.4rem;
  font-size: 0.72rem; min-height: 4.1rem; box-sizing: border-box; overflow: hidden;
}
.mfg-printer.st-printing { border-color: #3a3a20; }
.mfg-printer.st-fault { border-color: #5a2020; }
.mpr-head {
  display: flex; justify-content: space-between; gap: 0.35rem;
  margin-bottom: 0.25rem; min-height: 1.1em;
}
.mpr-head .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mpr-st {
  color: #dff140; font-family: ui-monospace, monospace; font-size: 0.65rem;
  flex-shrink: 0; min-width: 4.5rem; text-align: right;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mfg-printer .muted {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  min-height: 1.1em;
}
.mfg-split-3 {
  display: grid; grid-template-columns: 1.2fr 0.9fr 1.1fr; gap: 0.85rem;
  align-items: start;
}
.mfg-split-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem;
  align-items: stretch;
}
.mfg-split-2 > .mfg-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.mfg-split-2 .mfg-tag-table-wrap,
.mfg-split-2 .mqtt-log {
  flex: 1;
  min-height: 420px;
  max-height: 520px;
}
@media (max-width: 900px) {
  .mfg-split-2 { grid-template-columns: 1fr; }
  .mfg-split-3 { grid-template-columns: 1fr; }
}
.mqtt-log {
  max-height: 360px; min-height: 360px; overflow: auto; background: #050505;
  border: 1px solid #1a1a1a; border-radius: 6px; padding: 0.4rem;
  font-size: 0.72rem; box-sizing: border-box;
}
.mqtt-row {
  padding: 0.45rem 0.4rem; border-bottom: 1px solid #141414;
  min-height: 3.4rem; box-sizing: border-box;
}
.mqtt-row.kind-sparkplug .mqtt-kind,
.mqtt-row.kind-summary .mqtt-kind,
.mqtt-row.kind-mapped .mqtt-kind {
  color: #111; background: #8ab4f8; border-color: #8ab4f8;
}
.mqtt-row.kind-binary .mqtt-kind {
  color: #f5a623; border-color: #5a4020; background: #1a1408;
}
.mqtt-row.kind-text .mqtt-kind {
  color: #4ade80; border-color: #1a3a28; background: #0a1610;
}
.mqtt-meta {
  display: flex; flex-wrap: nowrap; align-items: center; gap: 0.4rem;
  margin-bottom: 0.2rem; min-width: 0;
}
.mqtt-kind {
  flex-shrink: 0;
  font-size: 0.58rem; font-weight: 700; letter-spacing: 0.06em;
  font-family: ui-monospace, monospace;
  border: 1px solid #333; border-radius: 3px;
  padding: 0.05rem 0.28rem; color: #8a8a8a;
  min-width: 2rem; text-align: center;
}
.mqtt-topic {
  color: #8ab4f8; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mqtt-payload {
  color: #e8e8d0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.7rem;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
  max-height: 2.7em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.mqtt-row.kind-mapped .mqtt-payload,
.mqtt-row.kind-summary .mqtt-payload,
.mqtt-row.kind-sparkplug .mqtt-payload {
  color: #dff140;
}
.mqtt-hex {
  margin-top: 0.15rem;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  color: #555;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-height: 1.1em;
  opacity: 1;
}
.mfg-mqtt-diag .row { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }

/* Hack / breach gate */
.gate-hack { text-align: center; }
.gate-hack-sub { margin: 0 0 1rem; font-size: 0.9rem; }
.gate-hack-hint { margin: 1rem 0 0; font-size: 0.72rem; letter-spacing: 0.04em; }
.btn-hack {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  padding: 1.1rem 1.5rem 0.95rem;
  border: 1px solid #dff140;
  background: #0a0a00;
  color: #dff140;
  cursor: pointer;
  font-family: inherit;
  overflow: hidden;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
  box-shadow: 0 0 0 1px rgba(223, 241, 64, 0.15), 0 0 24px rgba(223, 241, 64, 0.08);
}
.btn-hack:hover {
  background: rgba(223, 241, 64, 0.08);
  box-shadow: 0 0 0 1px #dff140, 0 0 32px rgba(223, 241, 64, 0.18);
}
.btn-hack:active { transform: scale(0.98); }
.btn-hack:disabled { opacity: 0.7; cursor: wait; }
.btn-hack-label {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: 0.35em;
  padding-left: 0.35em;
  line-height: 1;
}
.btn-hack-sub {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: #8a9a40;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.btn-hack-glitch {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: 0.35em;
  padding-left: 0.35em;
  color: #f44;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}
.btn-hack:hover .btn-hack-glitch,
.btn-hack.is-hacking .btn-hack-glitch {
  opacity: 0.55;
  animation: hack-glitch 0.35s steps(2) infinite;
}
.btn-hack.is-hacking .btn-hack-label { animation: hack-pulse 0.4s ease infinite; }
@keyframes hack-glitch {
  0% { transform: translate(0, 0); clip-path: inset(0 0 60% 0); }
  50% { transform: translate(-3px, 1px); clip-path: inset(40% 0 20% 0); color: #4db8ff; }
  100% { transform: translate(2px, -1px); clip-path: inset(70% 0 0 0); }
}
@keyframes hack-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.access-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: #666;
  margin: 0 0 1rem;
  text-align: center;
}
.access-load {
  margin: 1.25rem 0 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: #8a8a8a;
  text-align: center;
  min-height: 1.2em;
}
.access-title.is-resolved + .access-load,
.access-inner:has(.access-title.is-resolved) .access-load {
  color: #dff140;
}

/* Helios Energy SCADA — KPI cards & definition lists */
.energy-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 1.25rem;
}
.energy-kpi-grid.compact { margin-top: 0.5rem; }
.energy-kpi {
  background: #0d0d0d;
  border: 1px solid #222;
  border-radius: 6px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.energy-kpi.wide { grid-column: span 2; }
.energy-kpi .ek-l {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #888;
}
.energy-kpi .ek-v {
  font-size: 1.55rem;
  font-weight: 500;
  color: #dff140;
  line-height: 1.1;
}
.energy-kpi .ek-s {
  font-size: 0.72rem;
  color: #666;
}
.energy-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.energy-dl {
  display: grid;
  gap: 0.35rem;
  margin: 0;
}
.energy-dl .edl-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid #181818;
}
.energy-dl dt { color: #888; font-size: 0.82rem; margin: 0; }
.energy-dl dd { margin: 0; color: #e8e8e8; font-size: 0.85rem; }
.energy-cmds {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-end;
}
.energy-sp {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: #aaa;
}
.energy-chart {
  width: 100%;
  max-width: 100%;
  height: auto;
  background: #0a0a0a;
  border: 1px solid #1a1a1a;
  border-radius: 4px;
}

/* Dual-site HeliosPod campus panels */
.energy-sites {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.energy-site-panel {
  background: #0a0a0a;
  border: 1px solid #1f1f1f;
  border-radius: 8px;
  padding: 1rem 1.1rem 1.15rem;
}
.energy-site-h {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.9rem;
}
.energy-site-h h2 {
  margin: 0.1rem 0 0;
  font-size: 1.25rem;
  font-weight: 550;
  color: #f2f2f2;
}
.energy-site-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  font-size: 0.78rem;
  color: #888;
}
.energy-site-kpis em {
  font-style: normal;
  color: #666;
  margin-right: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.68rem;
}
.energy-site-kpis b {
  color: #dff140;
  font-weight: 500;
}
.energy-pod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 0.65rem;
}
.energy-pod-card {
  background: #101010;
  border: 1px solid #262626;
  border-radius: 6px;
  padding: 0.65rem 0.7rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.energy-pod-card .epc-h {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.energy-pod-card .epc-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #555;
  box-shadow: 0 0 0 1px #222;
  flex: 0 0 auto;
}
.energy-pod-card.is-online .epc-led {
  background: #3ddc97;
  box-shadow: 0 0 8px rgba(61, 220, 151, 0.45);
}
.energy-pod-card.is-degraded .epc-led {
  background: #f5a623;
  box-shadow: 0 0 8px rgba(245, 166, 35, 0.4);
}
.energy-pod-card.is-alarm .epc-led {
  background: #ff5c5c;
  box-shadow: 0 0 8px rgba(255, 92, 92, 0.45);
}
.energy-pod-card .epc-id {
  font-size: 0.9rem;
  color: #eee;
  font-weight: 550;
}
.energy-pod-card .epc-status {
  margin-left: auto;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #777;
}
.energy-pod-card.is-online .epc-status { color: #3ddc97; }
.energy-pod-card.is-degraded .epc-status { color: #f5a623; }
.energy-pod-card.is-alarm .epc-status { color: #ff5c5c; }
.energy-pod-card .epc-dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.2rem 0.5rem;
  margin: 0;
}
.energy-pod-card .epc-dl div {
  display: flex;
  justify-content: space-between;
  gap: 0.35rem;
  border-bottom: 1px solid #181818;
  padding: 0.12rem 0;
}
.energy-pod-card .epc-dl dt {
  margin: 0;
  color: #666;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.energy-pod-card .epc-dl dd {
  margin: 0;
  color: #ddd;
  font-size: 0.78rem;
}
.energy-site-select {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-right: 0.5rem;
}
.energy-site-select select {
  min-width: 9rem;
  background: #111;
  color: #eee;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 0.35rem 0.5rem;
  font-size: 0.85rem;
}
@media (max-width: 720px) {
  .energy-pod-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
  .energy-site-h {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ── Pod graphic (cabinet plan) ─────────────────────────────────────────── */
.energy-back { color: #a8b88a; text-decoration: none; }
.energy-back:hover { color: #dff140; }
.energy-kpi-grid--pod {
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
}
.energy-pod-stage {
  margin: 1rem 0 1.25rem;
  padding: 1rem 1.1rem 1.25rem;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  background: linear-gradient(180deg, #0e0e0e 0%, #0a0a0a 100%);
}
.energy-pod-stage-h {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.energy-pod-stage-title {
  margin: 0.15rem 0 0;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
}
.energy-train-row {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.energy-train-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  height: 1.6rem;
  padding: 0 0.4rem;
  border-radius: 4px;
  border: 1px solid #333;
  font-size: 0.68rem;
  font-family: ui-monospace, monospace;
  color: #888;
  background: #111;
}
.energy-train-chip.is-ok {
  border-color: #3a4a20;
  color: #dff140;
  background: #12140c;
}
.energy-train-chip.is-bad {
  border-color: #5a2020;
  color: #ff5c5c;
  background: #140c0c;
}
.energy-pod-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}
.ep-swatch {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 2px;
  margin-right: 0.25rem;
  vertical-align: middle;
}
.ep-swatch--ok { background: #3ddc97; }
.ep-swatch--warn { background: #f5a623; }
.ep-swatch--fault { background: #ff5c5c; }
.energy-pod-floor {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.ep-aisle {
  text-align: center;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #666;
  padding: 0.35rem;
}
.ep-aisle--hot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.85rem;
  border: 1px dashed #5a4020;
  border-radius: 6px;
  background: linear-gradient(90deg, #1a1008, #120e08 40%, #1a1008);
  color: #c8a070;
  letter-spacing: 0.14em;
}
.ep-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(4.2rem, 1fr));
  gap: 0.4rem;
}
.ep-cab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 5.2rem;
  padding: 0.35rem;
  border: 1px solid #333;
  border-radius: 6px;
  background: #0c0c0c;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.ep-cab:hover,
.ep-cab.is-selected {
  border-color: #dff140;
  box-shadow: 0 0 0 1px rgba(223, 241, 64, 0.25);
}
.ep-cab.is-online { border-color: #2a3a28; }
.ep-cab.is-warning { border-color: #5a4020; }
.ep-cab.is-fault,
.ep-cab.is-offline { border-color: #5a2020; opacity: 0.85; }
.ep-cab-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--load, 40%);
  background: linear-gradient(180deg, rgba(223, 241, 64, 0.15), rgba(223, 241, 64, 0.05));
  pointer-events: none;
  border-radius: 0 0 5px 5px;
}
.ep-cab.is-warning .ep-cab-fill {
  background: linear-gradient(180deg, rgba(245, 166, 35, 0.25), rgba(245, 166, 35, 0.06));
}
.ep-cab.is-fault .ep-cab-fill,
.ep-cab.is-offline .ep-cab-fill {
  background: linear-gradient(180deg, rgba(255, 92, 92, 0.2), rgba(255, 92, 92, 0.05));
}
.ep-cab-id {
  position: relative;
  z-index: 1;
  font-size: 0.72rem;
  font-weight: 650;
  font-family: ui-monospace, monospace;
  color: #f0f0f0;
}
.ep-cab-kw {
  position: relative;
  z-index: 1;
  margin-top: auto;
  font-size: 0.78rem;
  font-family: ui-monospace, monospace;
  color: #dff140;
}
.ep-cab-temp {
  position: relative;
  z-index: 1;
  font-size: 0.62rem;
  color: #888;
  font-family: ui-monospace, monospace;
}
.energy-pod-card {
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.energy-pod-card:hover {
  border-color: #4a4a28;
}
.energy-site-pick {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.energy-site-pick select {
  min-width: 6.5rem;
  background: #111;
  color: #eee;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 0.3rem 0.45rem;
}
@media (max-width: 720px) {
  .ep-row { grid-template-columns: repeat(auto-fit, minmax(3.6rem, 1fr)); }
  .ep-cab { min-height: 4.4rem; }
}
