:root {
  color-scheme: dark;
  --bg: #030706;
  --surface: #0d1513;
  --surface-2: #111d1a;
  --surface-3: #162622;
  --ink: #eef8f3;
  --muted: #96aaa3;
  --line: rgba(173, 214, 202, 0.18);
  --green: #35d18d;
  --green-soft: rgba(53, 209, 141, 0.16);
  --blue: #4aa3ff;
  --cyan: #21d4c2;
  --amber: #f4b84a;
  --red: #ff6b62;
  --shadow: 0 20px 55px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
  min-width: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: env(safe-area-inset-top);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
  background:
    radial-gradient(circle at 12% -8%, rgba(33, 212, 194, 0.16), transparent 32rem),
    radial-gradient(circle at 84% 0%, rgba(74, 163, 255, 0.12), transparent 34rem),
    linear-gradient(180deg, rgba(53, 209, 141, 0.08), transparent 31rem),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
input,
select,
textarea {
  font: inherit;
  font-size: max(16px, 1em);
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.brand-mark {
  display: block;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  overflow: hidden;
  background: #061411;
  box-shadow: 0 0 0 3px rgba(53, 209, 141, 0.12);
  flex-shrink: 0;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dashboard {
  display: grid;
  gap: 20px;
  align-content: start;
  padding: 24px;
}

.topbar,
.hero-strip,
.panel,
.metric-tile {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 21, 19, 0.88);
  box-shadow: var(--shadow);
}

.topbar {
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(53, 209, 141, 0.15), transparent 44%),
    linear-gradient(90deg, rgba(33, 212, 194, 0.13), transparent 70%),
    var(--surface);
}

.hero-strip {
  position: relative;
  display: flex;
  min-height: 176px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid var(--line);
  box-shadow: none;
  padding: 28px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(13, 21, 19, 0.94), rgba(13, 21, 19, 0.76)),
    repeating-linear-gradient(90deg, rgba(238, 248, 243, 0.05) 0 1px, transparent 1px 48px);
  animation: heroBreathe 5s ease-in-out infinite;
}

@keyframes heroBreathe {
  0%, 100% { box-shadow: none; border-color: var(--line); }
  50% { box-shadow: 0 0 34px -6px var(--green-soft); border-color: rgba(53, 209, 141, 0.3); }
}

.hero-strip::after {
  content: "";
  position: absolute;
  inset: -20px;
  z-index: 0;
  background-image:
    linear-gradient(rgba(53, 209, 141, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(53, 209, 141, 0.06) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(ellipse 100% 100% at 20% 0%, black 20%, transparent 75%);
  pointer-events: none;
  animation: heroDrift 18s linear infinite;
}

@keyframes heroDrift {
  0% { background-position: 0 0, 0 0; }
  100% { background-position: 34px 34px, 34px 34px; }
}

.hero-scan,
.hero-scan-b {
  position: absolute;
  pointer-events: none;
}

.hero-scan {
  top: 0;
  left: -30%;
  width: 55%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--green), var(--cyan), transparent);
  filter: drop-shadow(0 0 6px var(--green-soft));
  animation: heroScan 4.5s ease-in-out infinite;
}

@keyframes heroScan {
  0%, 100% { left: -30%; }
  50% { left: 75%; }
}

.hero-scan-b {
  bottom: 0;
  right: -30%;
  width: 40%;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  filter: drop-shadow(0 0 5px rgba(33, 212, 194, 0.35));
  opacity: 0.7;
  animation: heroScanB 7s ease-in-out infinite;
}

@keyframes heroScanB {
  0%, 100% { right: -30%; }
  50% { right: 90%; }
}

.hero-corner {
  position: absolute;
  width: 18px;
  height: 18px;
  pointer-events: none;
  animation: heroFlicker 3s ease-in-out infinite;
}

.hero-corner.tl {
  top: 12px;
  left: 12px;
  border-top: 2px solid var(--green);
  border-left: 2px solid var(--green);
  border-radius: 3px 0 0 0;
}

.hero-corner.br {
  bottom: 12px;
  right: 12px;
  border-bottom: 2px solid var(--cyan);
  border-right: 2px solid var(--cyan);
  border-radius: 0 0 3px 0;
  animation-delay: 1.5s;
}

@keyframes heroFlicker {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.9; }
}

.hero-strip > div {
  position: relative;
  z-index: 1;
}

.hero-status-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 7px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--green);
  animation: heroPulse 2s infinite;
}

@keyframes heroPulse {
  0% { box-shadow: 0 0 0 0 rgba(53, 209, 141, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(53, 209, 141, 0); }
  100% { box-shadow: 0 0 0 0 rgba(53, 209, 141, 0); }
}

.hero-strip .eyebrow {
  margin: 0;
  font-family: "JetBrains Mono", ui-monospace, monospace;
}

.hero-strip h1 {
  font-family: "Orbitron", sans-serif;
  font-weight: 800;
  letter-spacing: 0.01em;
  background: linear-gradient(100deg, #ffffff 20%, var(--green) 45%, var(--cyan) 60%, #ffffff 80%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 22px var(--green-soft));
  animation: heroShimmer 6s ease-in-out infinite;
}

@keyframes heroShimmer {
  0%, 100% { background-position: 0% 0; }
  50% { background-position: 100% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-strip,
  .hero-strip::after,
  .hero-scan,
  .hero-scan-b,
  .hero-corner,
  .pulse-dot,
  .hero-strip h1 {
    animation: none;
  }
}

.eyebrow,
.tiny-label,
.metric-label {
  margin: 0 0 7px;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.05;
}

h1 {
  max-width: 760px;
  font-size: clamp(2rem, 4vw, 4.2rem);
}

h2 {
  font-size: 1.25rem;
}

.hero-copy {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.connection-panel {
  display: grid;
  min-width: 180px;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 29, 26, 0.78);
}

.connection-panel .tiny-label {
  margin-bottom: 3px;
  font-size: 0.62rem;
}

.connection-panel .status-pill {
  grid-column: 1 / 2;
}

.gateway-status-stack {
  grid-column: 1 / 2;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.gateway-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.gateway-status-row .gateway-status-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  min-width: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  color: var(--green);
}

.status-pill span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px 0 currentColor;
}

.status-pill.offline {
  color: var(--red);
}

.icon-button,
.text-button,
.segment-control button,
.connection-form button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
}

.icon-button {
  grid-row: 1 / 3;
  grid-column: 2 / 3;
  width: 32px;
  height: 32px;
}

.button-icon {
  font-size: 0.66rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.metric-tile {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.metric-tile strong {
  font-size: 1.9rem;
  line-height: 1;
}

.metric-tile small {
  color: var(--muted);
}

.metric-tile.warning {
  border-color: rgba(189, 122, 19, 0.32);
  background: rgba(244, 184, 74, 0.09);
}

.metric-tile.trip {
  border-color: rgba(190, 59, 59, 0.34);
  background: rgba(255, 107, 98, 0.1);
}

.time-tile {
  border-color: rgba(33, 212, 194, 0.34);
  background: rgba(33, 212, 194, 0.08);
}

.tws-clock-tile {
  border-color: rgba(53, 209, 141, 0.36);
  background: rgba(53, 209, 141, 0.08);
}

.tws-clock-tile strong {
  color: var(--green);
}

.tws-clock-tile.offline {
  border-color: rgba(255, 107, 98, 0.34);
  background: rgba(255, 107, 98, 0.08);
}

.tws-clock-tile.offline strong {
  color: var(--red);
}

.time-tile strong {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.time-tile small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bay-overview {
  overflow: hidden;
}

.gi-submenu {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
  gap: 8px;
  margin: 0 0 16px;
  padding: 2px 0;
}

.gi-submenu button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 9px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    rgba(7, 22, 19, 0.78);
  color: var(--muted);
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.gi-submenu button strong {
  display: grid;
  min-width: 23px;
  height: 21px;
  place-items: center;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--ink);
  font-size: 0.68rem;
}

.gi-submenu button:hover {
  border-color: rgba(53, 209, 141, 0.44);
  color: var(--ink);
}

.gi-submenu button.active {
  border-color: rgba(53, 209, 141, 0.68);
  background:
    linear-gradient(135deg, rgba(53, 209, 141, 0.2), rgba(33, 212, 194, 0.07)),
    rgba(7, 26, 21, 0.9);
  color: #eafff6;
  box-shadow: inset 0 0 0 1px rgba(53, 209, 141, 0.12);
}

.gi-submenu button.active strong {
  background: rgba(53, 209, 141, 0.2);
  color: #71efb0;
}

.measurement-group-list {
  display: grid;
  gap: 18px;
}

.measurement-gi-group {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(53, 209, 141, 0.18);
  border-radius: 10px;
  background:
    linear-gradient(145deg, rgba(53, 209, 141, 0.055), transparent 48%),
    rgba(4, 17, 14, 0.55);
}

.td-measurement-group {
  border-color: rgba(74, 163, 255, 0.2);
  background:
    linear-gradient(145deg, rgba(74, 163, 255, 0.065), transparent 48%),
    rgba(5, 16, 23, 0.6);
}

.combined-measurement-group {
  display: grid;
  gap: 16px;
}

.measurement-type-section {
  display: grid;
  gap: 11px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(53, 209, 141, 0.13);
  border-radius: 9px;
  background: rgba(3, 15, 12, 0.38);
}

.measurement-type-section > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.measurement-type-section > header span {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.measurement-type-section > header strong {
  color: var(--green);
  font-size: 0.72rem;
}

.td-type-section {
  border-color: rgba(74, 163, 255, 0.16);
  background: rgba(4, 14, 22, 0.44);
}

.td-type-section > header strong {
  color: var(--blue);
}

.measurement-type-empty {
  padding: 18px;
  border: 1px dashed rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.measurement-gi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 0 2px 11px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.measurement-gi-header > div:first-child {
  min-width: 0;
}

.measurement-gi-header span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.measurement-gi-header h3 {
  overflow: hidden;
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 1.02rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.measurement-gi-stats {
  display: grid;
  flex: 0 0 auto;
  gap: 3px;
  text-align: right;
}

.measurement-gi-stats strong {
  color: var(--green);
  font-size: 0.78rem;
}

.td-measurement-group .measurement-gi-stats strong {
  color: var(--blue);
}

.measurement-gi-stats span {
  letter-spacing: 0;
  text-transform: none;
}

.measurement-gi-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
}

.measurement-gi-group .bay-grid {
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
}

.measurement-group-empty {
  padding: 28px;
  border: 1px dashed rgba(148, 163, 184, 0.24);
  border-radius: 9px;
  color: var(--muted);
  text-align: center;
}

.transmission-sld-panel {
  overflow: hidden;
  border-color: var(--line);
  background:
    linear-gradient(180deg, rgba(53, 209, 141, 0.06), transparent 42%),
    rgba(13, 21, 19, 0.88);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.transmission-sld-panel .tiny-label {
  color: var(--green);
  margin-left: auto;
}

.sld-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.sld-kpi-card {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 86px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    var(--surface-2);
  box-shadow: inset 0 0 0 1px rgba(53, 209, 141, 0.04);
}

.sld-kpi-card > span {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background: #1e67d1;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 900;
}

.sld-kpi-card.purple > span {
  background: #7c3fd6;
}

.sld-kpi-card.cyan > span {
  background: #0fa7bd;
}

.sld-kpi-card.orange > span {
  background: #f47611;
}

.sld-kpi-card.green > span,
.sld-kpi-card.shield > span {
  background: #24a85a;
}

.sld-kpi-card small,
.sld-kpi-card em {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
}

.sld-kpi-card strong {
  display: block;
  margin: 4px 0;
  color: var(--ink);
  font-size: 1.32rem;
  line-height: 1;
}

.sld-canvas-wrap {
  overflow: hidden;
  max-height: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent),
    #07100e;
  box-shadow: inset 0 0 0 1px rgba(53, 209, 141, 0.03);
  user-select: none;
}

.sld-canvas-wrap.dragging {
  cursor: default;
}

.sld-canvas-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 4;
  padding: 14px 16px 0;
  background: linear-gradient(180deg, rgba(7, 16, 14, 0.98), rgba(7, 16, 14, 0.74));
}

.sld-canvas-head small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.sld-canvas-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  margin-left: auto;
}

.sld-station-time {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.sld-station-time strong {
  color: var(--ink);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.sld-station-time small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}

.sld-diagram {
  display: grid;
  gap: 14px;
}

.sld-svg {
  display: block;
  min-width: 1020px;
  max-width: none;
  height: auto;
  font-family: inherit;
}

.sld-reference-image {
  display: block;
  width: 100%;
  height: auto;
  background: #ffffff;
  user-select: none;
}

.sld-reference-stage {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.sld-pdf-svg {
  display: block;
  width: 100%;
  height: auto;
  background: #050d14;
  font-family: "Segoe UI Variable", "Segoe UI", Inter, Arial, sans-serif;
  user-select: none;
}

.sld-pdf-bg {
  fill: url("#sldPdfBackground");
}

.sld-pdf-grid {
  fill: url("#sldPdfGrid");
  opacity: 0.28;
}

.sld-pdf-grid-line {
  fill: none;
  stroke: rgba(88, 196, 179, 0.11);
  stroke-width: 1;
}

.sld-pdf-title {
  fill: #f7fbfc;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 1px;
}

.sld-pdf-subtitle {
  fill: #88b8b2;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2.1px;
}

.sld-pdf-legend text {
  fill: #9db9b3;
  font-size: 9px;
  font-weight: 700;
}

.sld-pdf-legend .legend-line {
  stroke-width: 4;
  stroke-linecap: round;
}

.sld-pdf-legend .legend-line.live {
  stroke: #21d4c2;
}

.sld-pdf-legend .legend-line.blue {
  stroke: #4ea9ff;
}

.sld-pdf-legend .legend-line.offline {
  stroke: #73838b;
}

.sld-pdf-legend .legend-line.padam {
  stroke: #ff6b62;
  stroke-dasharray: 2.5 3.5;
}

.sld-pdf-legend .legend-line.terputus {
  stroke: #f0a63f;
  stroke-dasharray: 1 4;
}

.sld-pdf-legend .legend-line.mirrored {
  stroke: #39dbc7;
  stroke-dasharray: 9 3;
}

.sld-pdf-route {
  cursor: pointer;
}

.sld-pdf-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3.4;
  transition: stroke 0.6s ease, opacity 0.6s ease;
}

.sld-pdf-route.online .sld-pdf-line {
  stroke: #39dbc7;
}

.sld-pdf-route.online.mirrored .sld-pdf-line {
  stroke-dasharray: 9 3;
}

.sld-pdf-route.online.mirrored .sld-pdf-value {
  fill: #8fe6da;
}

.sld-pdf-route.blue.online .sld-pdf-line {
  stroke: #55aaff;
}

.sld-pdf-route.unmapped .sld-pdf-line {
  stroke: #667982;
  stroke-dasharray: 7 6;
  opacity: 0.76;
}

.sld-pdf-route.padam .sld-pdf-line {
  stroke: #ff6b62;
  stroke-dasharray: 2.5 3.5;
  opacity: 0.92;
}

.sld-pdf-route.terputus .sld-pdf-line {
  stroke: #f0a63f;
  stroke-dasharray: 1 4;
  opacity: 0.85;
}

.sld-pdf-copy {
  pointer-events: none;
}

.sld-pdf-copy-bg {
  fill: rgba(5, 13, 20, 0.9);
  stroke: rgba(57, 219, 199, 0.34);
  stroke-width: 0.8;
  transition: fill 0.6s ease, stroke 0.6s ease, x 0.4s ease, width 0.4s ease;
}

.sld-pdf-route.blue .sld-pdf-copy-bg {
  stroke: rgba(85, 170, 255, 0.4);
}

.sld-pdf-route.unmapped .sld-pdf-copy-bg {
  fill: rgba(7, 16, 22, 0.92);
  stroke: rgba(148, 163, 184, 0.24);
}

.sld-pdf-route.padam .sld-pdf-copy-bg {
  fill: rgba(58, 22, 19, 0.92);
  stroke: rgba(255, 107, 98, 0.45);
}

.sld-pdf-route.terputus .sld-pdf-copy-bg {
  fill: rgba(51, 37, 16, 0.92);
  stroke: rgba(240, 166, 63, 0.45);
}

.sld-pdf-copy.vertical .sld-pdf-copy-bg {
  fill: rgba(5, 13, 20, 0.94);
  stroke-width: 0.8;
}

.sld-pdf-copy.vertical .sld-pdf-label {
  font-size: 10px;
  letter-spacing: 0.05px;
}

.sld-pdf-copy.vertical .sld-pdf-value {
  font-size: 9.5px;
}

.sld-pdf-label {
  fill: #f4f8f8;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.05px;
  paint-order: stroke;
  stroke: #050d14;
  stroke-width: 4.5px;
  stroke-linejoin: round;
}

.sld-pdf-value {
  fill: #55e8d1;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0;
  paint-order: stroke;
  stroke: #050d14;
  stroke-width: 4.5px;
  stroke-linejoin: round;
  transition: fill 0.6s ease;
}

.sld-pdf-route.blue .sld-pdf-value {
  fill: #83c5ff;
}

.sld-pdf-route.unmapped .sld-pdf-value {
  fill: #a5b4ba;
}

.sld-pdf-route.padam .sld-pdf-value {
  fill: #ff9a92;
  font-weight: 800;
}

.sld-pdf-route.terputus .sld-pdf-value {
  fill: #f6c581;
  font-weight: 800;
}

.sld-pdf-cap line {
  stroke: #6b7f8a;
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke 0.4s ease;
}

.sld-pdf-cap line.plate {
  stroke-width: 4;
}

.sld-pdf-cap text {
  fill: #6b7f8a;
  font-size: 12px;
  font-weight: 800;
}

.sld-pdf-cap.closed text {
  fill: #19d27a;
}

.sld-pdf-cap.open text {
  fill: #ff2d3d;
}

.sld-pdf-cap.closed line {
  stroke: #19d27a;
}

.sld-pdf-cap.open line {
  stroke: #ff2d3d;
}

.sld-pdf-cap.blink {
  animation: sldCbBlink 1s steps(2, start) infinite;
}

@media (prefers-reduced-motion: reduce) {
  .sld-pdf-cap.blink {
    animation: none;
  }
}

.sld-pdf-cb {
  fill: #6b7f8a;
  stroke-width: 2;
  stroke: #6b7f8a;
  transition: stroke 0.4s ease;
}

.sld-pdf-cb.closed {
  fill: #19d27a;
  stroke: #19d27a;
}

.sld-pdf-cb.open {
  fill: #ff2d3d;
  stroke: #ff2d3d;
}

.sld-pdf-cb.blink {
  animation: sldCbBlink 1s steps(2, start) infinite;
}

@keyframes sldCbBlink {
  50% {
    opacity: 0.2;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sld-pdf-cb.blink {
    animation: none;
  }
}

.sld-pdf-flow-dot {
  fill: #23e0c3;
  stroke: #ffffff;
  stroke-width: 1.4;
  filter: url("#sldPdfGlow");
}

.sld-pdf-route.online .sld-pdf-flow-dot {
  fill: #39dbc7;
}

.sld-pdf-route.blue.online .sld-pdf-flow-dot {
  fill: #55aaff;
}

.sld-pdf-node {
  filter: url("#sldPdfNodeShadow");
}

.sld-pdf-node[data-gi] {
  cursor: pointer;
}

.sld-pdf-node rect {
  fill: url("#sldPdfNodeRed");
  stroke: #ff7080;
  stroke-width: 1.2;
  transition: filter 0.15s ease;
}

.sld-pdf-node[data-gi]:hover rect {
  filter: brightness(1.3);
}

.sld-pdf-node.generator[data-gi]:hover circle {
  filter: brightness(1.25);
}

.sld-pdf-node.blue rect {
  fill: url("#sldPdfNodeBlue");
  stroke: #6fc6f5;
}

.sld-pdf-node text {
  fill: #ffffff;
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 1.8px;
}

.sld-pdf-node.generator circle {
  fill: url("#sldPdfGeneratorRed");
  stroke: #6fc6f5;
  stroke-width: 2;
}

.sld-pdf-node.generator.blue circle {
  fill: url("#sldPdfGeneratorBlue");
  stroke: #79c8f5;
}

.sld-pdf-node.generator .generator-symbol {
  fill: #000000;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 58px;
  font-style: italic;
  font-weight: 900;
  letter-spacing: 0;
}

.sld-pdf-node.generator .generator-dot {
  fill: #ffffff;
  stroke: #2aa3f4;
  stroke-width: 1;
}

.sld-pdf-node.generator .generator-label {
  fill: #f3f8fa;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0;
}

.sld-animation-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.sld-reference-flow-path {
  fill: none;
  stroke: var(--flow-color);
  stroke-dasharray: 10 16;
  stroke-linecap: round;
  stroke-width: 4;
  opacity: 0.42;
  filter: url("#sldReferenceGlow");
  animation: sldReferenceDash 1.6s linear infinite;
}

.sld-reference-flow-dot {
  opacity: 0.94;
  stroke: rgba(255, 255, 255, 0.95);
  stroke-width: 1.4;
  filter: url("#sldReferenceGlow");
}

.sld-reference-flow-dot.secondary {
  opacity: 0.72;
}

@keyframes sldReferenceDash {
  to {
    stroke-dashoffset: -26;
  }
}

.sld-bg {
  fill: #07100e;
}

.sld-node[data-gi] {
  cursor: pointer;
}

.sld-node rect {
  fill: #e40716;
  stroke: #f51f2c;
  stroke-width: 2;
  transition: filter 0.15s ease;
}

.sld-node[data-gi]:hover rect {
  filter: brightness(1.25);
}

.sld-node.blue rect {
  fill: #0a72b8;
  stroke: #2aa3f4;
}

.sld-node.generator[data-gi]:hover circle {
  filter: brightness(1.2);
}

.sld-node.generator circle {
  fill: #e40716;
  stroke: #2aa3f4;
  stroke-width: 2;
}

.sld-node.generator.blue circle {
  fill: #5b9bd5;
  stroke: #2f75b5;
}

.sld-node text {
  fill: #ffffff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.sld-node.generator .generator-symbol {
  fill: #050908;
  stroke: rgba(255, 255, 255, 0.75);
  stroke-width: 1.4px;
  paint-order: stroke;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 58px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0;
  text-transform: none;
}

.sld-node.generator .generator-dot {
  fill: #ffffff;
  opacity: 0.95;
}

.sld-node.generator .generator-label {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sld-node:not(.tall) text {
  font-size: 9px;
  letter-spacing: 2px;
}

.sld-node.generator:not(.tall) text {
  letter-spacing: 0;
}

.sld-route {
  cursor: pointer;
}

.sld-route-line,
.sld-route-halo {
  fill: none;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.sld-route-halo {
  stroke: #07100e;
  stroke-width: 13;
  opacity: 0.95;
}

.sld-route.energized .sld-route-halo {
  stroke: rgba(33, 212, 194, 0.18);
  stroke-width: 15;
  opacity: 1;
}

.sld-route-line {
  stroke: #8d9aa3;
  stroke-width: 7;
}

.sld-route.energized .sld-route-line {
  stroke: #21d4c2;
}

.sld-route.deenergized .sld-route-line {
  stroke: #8d9aa3;
}

.sld-route:hover .sld-route-line {
  stroke: #9af7df;
  stroke-width: 7;
}

.sld-route.deenergized .sld-route-line {
  opacity: 0.95;
}

.sld-flow-dot {
  fill: #22c55e;
  filter: url("#sldGlow");
  stroke: #ffffff;
  stroke-width: 1.8;
}

.sld-route.reverse .sld-flow-dot {
  fill: var(--amber);
}

.sld-line-label,
.sld-line-value {
  paint-order: stroke;
  stroke: #07100e;
  stroke-linejoin: round;
  stroke-width: 7px;
}

.sld-line-label {
  fill: var(--ink);
  font-size: 8px;
  font-weight: 900;
}

.sld-line-value {
  fill: var(--green);
  font-size: 8px;
  font-weight: 900;
}

.sld-route.deenergized .sld-line-value,
.sld-route.open .sld-line-value {
  fill: #9aa8b2;
}

.sld-footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.15fr) minmax(280px, 0.85fr);
  align-items: stretch;
  gap: 12px;
}

.sld-info-card {
  display: grid;
  align-content: start;
  gap: 9px;
  min-height: 148px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    var(--surface-2);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(53, 209, 141, 0.04);
}

.sld-info-card h3 {
  margin: 0 0 5px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.sld-legend-row,
.sld-summary-row,
.sld-event-row,
.sld-hotspot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 24px;
  color: var(--muted);
  font-size: 0.78rem;
}

.sld-summary-row strong,
.sld-event-row strong,
.sld-hotspot-row strong {
  color: var(--ink);
}

.sld-summary-row .good {
  color: #16a34a;
}

.sld-summary-row .warn {
  color: #ea580c;
}

.gi-load-list {
  display: grid;
  gap: 5px;
}

.gi-load-card {
  min-width: 0;
}

.ultg-load-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  align-items: start;
  gap: 10px;
}

.ultg-load-group {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(53, 209, 141, 0.16);
  border-radius: 8px;
  background: rgba(3, 17, 14, 0.4);
}

.ultg-load-group > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(53, 209, 141, 0.2);
}

.ultg-load-group h4 {
  margin: 0;
  color: var(--accent);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
}

.ultg-load-group > header strong {
  color: #35d18d;
  font-size: 0.76rem;
  white-space: nowrap;
}

.ultg-gi-list {
  display: grid;
  gap: 4px;
}

.gi-load-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 9px;
  min-height: 25px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.gi-load-row span {
  overflow: hidden;
  color: var(--ink);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gi-load-row strong {
  color: #35d18d;
  font-size: 0.82rem;
}

.gi-load-row em {
  min-width: 78px;
  color: var(--muted);
  font-size: 0.68rem;
  font-style: normal;
  text-align: right;
}

.gi-load-row.unavailable span,
.gi-load-row.unavailable strong,
.gi-load-row.unavailable em {
  color: rgba(148, 163, 184, 0.62);
}

.sld-event-row,
.sld-hotspot-row {
  border-bottom: 1px solid var(--line);
}

.sld-event-row em,
.sld-hotspot-row em {
  min-width: 68px;
  padding: 3px 6px;
  border-radius: 999px;
  background: #e8f7ee;
  color: #16a34a;
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.sld-hotspot-row span {
  flex: 0 0 106px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sld-hotspot-row strong {
  overflow: hidden;
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sld-hotspot-row.attention em,
.sld-hotspot-row.planned em {
  background: rgba(244, 184, 74, 0.16);
  color: #f4b84a;
}

.sld-hotspot-row.immediate em {
  background: rgba(249, 115, 22, 0.16);
  color: #fb923c;
}

.sld-hotspot-row.critical em {
  background: rgba(255, 107, 98, 0.16);
  color: var(--red);
}

.venom-card {
  gap: 8px;
}

.venom-health-panel {
  min-width: 0;
}

.venom-health-list {
  margin-top: 14px;
}

.venom-list {
  display: grid;
  gap: 8px;
}

.venom-device {
  display: grid;
  gap: 7px;
  padding: 9px 10px;
  border: 1px solid rgba(33, 212, 194, 0.22);
  border-radius: 8px;
  background: rgba(3, 17, 14, 0.46);
}

.venom-device.offline {
  border-color: rgba(239, 68, 68, 0.26);
  background: rgba(55, 22, 22, 0.35);
}

.venom-device-head,
.venom-metrics {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.venom-device-head strong {
  color: var(--ink);
  font-size: 0.82rem;
}

.venom-device-head em {
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(33, 212, 194, 0.12);
  color: #35d18d;
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.venom-device.offline .venom-device-head em {
  background: rgba(239, 68, 68, 0.14);
  color: #ff8a80;
}

.venom-metrics span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.venom-metrics small {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 900;
  text-transform: uppercase;
}

.venom-metrics b {
  color: var(--accent);
  font-size: 0.76rem;
  white-space: nowrap;
}

.venom-empty {
  display: grid;
  min-height: 86px;
  place-items: center;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.sld-legend-row i {
  display: inline-block;
  flex: 0 0 auto;
}

.sld-legend-row .line {
  width: 54px;
  height: 5px;
  border-radius: 999px;
  background: var(--ink);
}

.sld-legend-row .line.medium {
  height: 4px;
  background: var(--muted);
}

.sld-legend-row .line.low {
  height: 3px;
  background: rgba(150, 170, 163, 0.55);
}

.sld-legend-row .flow {
  width: 54px;
  height: 14px;
  background:
    linear-gradient(135deg, transparent 43%, #22c55e 43% 58%, transparent 58%) 0 0 / 14px 14px repeat-x;
}

.bay-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 14px;
}

.td-overview {
  border-color: rgba(74, 163, 255, 0.26);
}

.td-grid .bay-card {
  min-height: 214px;
  background:
    linear-gradient(180deg, rgba(74, 163, 255, 0.06), transparent),
    var(--surface-2);
}

.thermovisi-panel {
  gap: 9px;
  padding: 12px;
}

.thermovisi-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.thermovisi-kpis article,
.thermo-hotspot,
.thermo-line,
.thermo-empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    rgba(8, 24, 20, 0.68);
}

.thermovisi-kpis article {
  display: grid;
  gap: 3px;
  min-height: 62px;
  padding: 8px 10px;
}

.thermovisi-kpis span,
.thermo-values small,
.thermo-empty span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.thermovisi-kpis strong {
  color: var(--ink);
  overflow-wrap: anywhere;
  font-size: clamp(0.94rem, 1.2vw, 1.16rem);
  line-height: 1;
}

.thermovisi-kpis small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thermovisi-kpis article.good strong {
  color: var(--green);
}

.thermovisi-kpis article.warn strong {
  color: #f4b84a;
}

.thermovisi-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 9px;
}

.thermovisi-layout section {
  display: grid;
  align-content: start;
  gap: 6px;
}

.thermovisi-layout h3 {
  margin: 0;
  color: var(--ink);
  font-size: 0.86rem;
  text-transform: uppercase;
}

.thermovisi-hotspot-list,
.thermovisi-line-list {
  display: grid;
  gap: 5px;
  max-height: 190px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
  scrollbar-color: rgba(53, 209, 141, 0.65) rgba(7, 16, 14, 0.8);
  scrollbar-width: thin;
}

.thermo-hotspot {
  display: grid;
  gap: 5px;
  padding: 8px;
}

.thermo-hotspot header,
.thermo-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.thermo-hotspot strong,
.thermo-line strong,
.thermo-empty strong {
  color: var(--ink);
}

.thermo-hotspot em {
  min-width: 72px;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(150, 170, 163, 0.18);
  color: var(--muted);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 900;
  text-align: center;
}

.thermo-hotspot.attention em,
.thermo-line.attention b,
.thermo-hotspot.planned em,
.thermo-line.planned b {
  background: rgba(244, 184, 74, 0.15);
  color: #f4b84a;
}

.thermo-hotspot.immediate em,
.thermo-line.immediate b {
  background: rgba(249, 115, 22, 0.16);
  color: #fb923c;
}

.thermo-hotspot.critical em,
.thermo-line.critical b {
  background: rgba(255, 107, 98, 0.16);
  color: var(--red);
}

.thermo-hotspot.good em,
.thermo-line.good b {
  background: rgba(53, 209, 141, 0.15);
  color: var(--green);
}

.thermo-hotspot p,
.thermo-hotspot footer,
.thermo-line span {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
}

.thermo-values {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.thermo-values span {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 5px 6px;
  border-radius: 6px;
  background: rgba(3, 7, 6, 0.28);
}

.thermo-values b {
  overflow: hidden;
  color: var(--green);
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thermo-line {
  min-height: 38px;
  padding: 7px 8px;
}

.form-upload {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 10px;
}

.form-group {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: auto repeat(4, minmax(100px, 1fr)) minmax(210px, auto);
  align-items: end;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(8, 24, 20, 0.54);
}

.double-ended-controls {
  grid-template-columns: auto repeat(4, minmax(96px, 1fr));
}

.form-group-title {
  align-self: center;
  color: #75b9ff;
  font-size: 0.7rem;
  font-weight: 900;
}

.form-group label:not(.form-group-force) {
  display: grid;
  gap: 4px;
}

.form-group label > span {
  color: var(--muted);
  font-size: 0.63rem;
  font-weight: 800;
}

.form-group input[type="number"] {
  min-width: 0;
  width: 100%;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
  background: #071611;
  color: var(--ink);
  font: inherit;
  font-size: 0.72rem;
}

.form-group input[type="number"]:focus {
  border-color: #75b9ff;
}

.form-group-force {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
}

.form-group-force input {
  width: 16px;
  height: 16px;
  accent-color: #75b9ff;
}

.form-submit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 128px;
  border: 1px solid rgba(53, 209, 141, 0.54);
  border-radius: 7px;
  background: rgba(53, 209, 141, 0.14);
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 950;
  text-decoration: none;
  cursor: pointer;
}

.form-submit-button:hover {
  background: var(--green);
  color: #03110d;
}

.fault-point-table-wrap {
  max-height: 390px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.fault-point-table-wrap.digital {
  max-height: 290px;
}

.bay-list-manager {
  display: grid;
  gap: 6px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(7, 22, 17, 0.74);
}

.bay-list-manager > header,.bay-list-header-actions {
  display: flex;
  align-items: center;
}

.bay-list-manager > header {
  justify-content: space-between;
  gap: 10px;
}

.bay-list-manager > header > div:first-child {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  gap: 8px;
}

.bay-list-manager > header span {
  color: var(--green);
  font-size: 0.56rem;
  font-weight: 900;
}

.bay-list-manager h3 {
  margin: 0;
  color: var(--ink);
  font-size: 0.8rem;
}

.bay-list-header-actions {
  gap: 6px;
}

.bay-list-header-actions strong {
  color: var(--muted);
  font-size: 0.62rem;
}

.bay-list-header-actions button {
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #0b211a;
  color: var(--ink);
  font-size: 0.62rem;
  font-weight: 850;
  cursor: pointer;
}

.form-submit-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.result-box[hidden]  {
  display: none;
}

.result-box {
  display: grid;
  gap: 10px;
}

.combined-fault-snapshot th:nth-child(5),
.combined-fault-snapshot td:nth-child(5) {
  border-left: 2px solid rgba(53, 209, 141, 0.32);
}

.result-error {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(255, 107, 98, 0.35);
  border-radius: 7px;
  background: rgba(255, 107, 98, 0.08);
  color: var(--red);
}

.result-error span {
  color: var(--muted);
  font-size: 0.74rem;
}

.thermo-line div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.thermo-line strong,
.thermo-line span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thermo-line b {
  min-width: 72px;
  padding: 5px 7px;
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.76rem;
  text-align: center;
}

.thermo-empty {
  display: grid;
  gap: 5px;
  padding: 14px;
}

.bay-card {
  display: grid;
  gap: 12px;
  min-height: 228px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    var(--surface-2);
}

.bay-card {
  cursor: pointer;
}

.bay-card.selected {
  border-color: rgba(53, 209, 141, 0.76);
  box-shadow: inset 0 0 0 1px rgba(53, 209, 141, 0.26), var(--shadow);
}

.bay-card.event-blink {
  animation: bayEventBlink 1s steps(2, start) infinite;
}

@keyframes bayEventBlink {
  50% {
    border-color: var(--red);
    box-shadow:
      inset 0 0 0 2px rgba(255, 107, 98, 0.45),
      0 0 24px rgba(255, 107, 98, 0.38);
  }
}

.bay-card.trip {
  border-color: rgba(255, 107, 98, 0.58);
  box-shadow: inset 0 0 0 1px rgba(255, 107, 98, 0.12);
}

.bay-card.alarm {
  border-color: rgba(244, 184, 74, 0.5);
}

.bay-card.offline {
  border-color: rgba(150, 170, 163, 0.34);
  opacity: 0.78;
}

.bay-card header,
.bay-reading,
.mini-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.bay-card-actions {
  display: grid;
  flex: 0 0 auto;
  justify-items: end;
  gap: 7px;
}

.group-history-button {
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid rgba(74, 163, 255, 0.38);
  border-radius: 7px;
  background:
    linear-gradient(135deg, rgba(74, 163, 255, 0.18), rgba(33, 212, 194, 0.08)),
    rgba(5, 19, 25, 0.9);
  color: #a9d4ff;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-transform: uppercase;
}

.group-history-button:hover {
  border-color: rgba(74, 163, 255, 0.72);
  color: #e7f4ff;
}

.power-plant-history-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.power-plant-history-button {
  min-height: 34px;
  padding-inline: 13px;
}

.bay-card h3 {
  margin: 0;
  font-size: 1rem;
}

.bay-card small,
.bay-reading span {
  color: var(--muted);
}

.weather-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 52px;
  padding: 10px;
  border: 1px solid rgba(74, 163, 255, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(74, 163, 255, 0.14), rgba(33, 212, 194, 0.08)),
    rgba(3, 7, 6, 0.28);
}

.weather-strip div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.weather-strip span,
.weather-strip small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weather-strip strong {
  color: var(--blue);
  font-size: 1.3rem;
  line-height: 1;
}

.weather-strip.offline {
  border-color: rgba(150, 170, 163, 0.22);
  background: rgba(3, 7, 6, 0.22);
}

.weather-strip.offline strong,
.weather-strip.pending strong {
  color: var(--muted);
}

.bay-badge.tws-sync.ok {
  color: var(--green);
  background: rgba(53, 209, 141, 0.16);
}

.bay-badge.tws-sync.fail {
  color: var(--red);
  background: rgba(255, 107, 98, 0.16);
}

.bay-reading.ocr span,
.bay-reading.ocr strong {
  color: var(--green);
}

.bay-reading.ocr.alarm span,
.bay-reading.ocr.alarm strong {
  color: var(--red);
}

.history-dialog {
  width: min(1480px, calc(100vw - 24px));
  max-height: min(820px, calc(100vh - 20px));
  max-height: min(820px, calc(100dvh - 20px));
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(53, 209, 141, 0.34);
  border-radius: 14px;
  background: #071411;
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.62);
}

.history-dialog::backdrop {
  background: rgba(1, 7, 6, 0.78);
  backdrop-filter: blur(5px);
}

.history-dialog-shell {
  display: grid;
  max-height: min(820px, calc(100vh - 20px));
  max-height: min(820px, calc(100dvh - 20px));
  grid-template-rows: auto minmax(0, 1fr);
  background:
    radial-gradient(circle at 85% 5%, rgba(74, 163, 255, 0.13), transparent 34%),
    linear-gradient(145deg, rgba(53, 209, 141, 0.08), transparent 48%),
    #071411;
}

.history-dialog-shell > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px 11px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.history-dialog-shell > header span {
  color: var(--green);
  font-size: 0.84rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.history-dialog-shell h2 {
  margin: 2px 0;
  font-size: 1.55rem;
}

.history-dialog-shell p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.history-dialog-shell p:empty {
  display: none;
}

.history-dialog-shell > header button {
  display: grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font-size: 1.3rem;
  cursor: pointer;
}

.history-content {
  overflow: hidden;
  padding: 10px 14px 14px;
}

.history-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.96rem;
}

.history-summary strong {
  flex: 0 0 auto;
  color: var(--green);
}

.history-pagination-only {
  justify-content: flex-end;
}

.history-pagination {
  display: flex;
  align-items: center;
  gap: 7px;
}

.history-pagination button {
  display: grid;
  width: 28px;
  height: 28px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(74, 163, 255, 0.32);
  border-radius: 7px;
  background: rgba(74, 163, 255, 0.09);
  color: var(--ink);
  font-size: 1.05rem;
  cursor: pointer;
}

.history-pagination button:disabled {
  cursor: default;
  opacity: 0.34;
}

.history-measurement-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.history-measurement {
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.17);
  border-radius: 11px;
  background:
    linear-gradient(145deg, rgba(74, 163, 255, 0.045), transparent 44%),
    rgba(4, 16, 14, 0.72);
}

.history-measurement.aggregate {
  border-color: rgba(53, 209, 141, 0.3);
  background:
    linear-gradient(135deg, rgba(53, 209, 141, 0.1), rgba(74, 163, 255, 0.045)),
    rgba(4, 18, 14, 0.82);
}

.history-measurement > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding: 7px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.13);
}

.history-measurement > header div {
  min-width: 0;
}

.history-measurement > header span {
  display: block;
  margin-bottom: 1px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.history-measurement > header h3 {
  overflow: hidden;
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-measurement > header > strong {
  flex: 0 0 auto;
  color: var(--green);
  font-size: 0.82rem;
}

.history-measurement .history-day-list {
  padding: 5px;
}

.history-day-list {
  display: grid;
  gap: 3px;
}

.history-day-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 3px 6px;
  min-height: 34px;
  padding: 4px 6px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.035), transparent),
    rgba(5, 20, 17, 0.76);
}

.history-day-card.latest {
  border-color: rgba(53, 209, 141, 0.36);
}

.history-day-copy,
.history-day-value {
  display: grid;
  gap: 1px;
}

.history-day-copy span {
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 850;
}

.history-day-copy small,
.history-day-value span {
  color: var(--muted);
  font-size: 0.7rem;
}

.history-day-value {
  text-align: right;
}

.history-day-value strong {
  color: var(--green);
  font-size: 0.94rem;
}

.history-day-card.negative .history-day-value strong {
  color: #ff8f86;
}

.history-extrema-card {
  grid-template-columns: minmax(72px, 0.7fr) minmax(0, 1.8fr);
}

.history-extrema-values {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
}

.history-extreme {
  display: grid;
  min-width: 0;
  gap: 0;
  padding: 3px 5px;
  border-left: 2px solid rgba(148, 163, 184, 0.28);
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.055);
}

.history-extreme > small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.65rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-extreme > strong {
  font-size: 0.94rem;
  font-variant-numeric: tabular-nums;
}

.history-extreme.positive {
  border-left-color: rgba(53, 209, 141, 0.72);
}

.history-extreme.positive > strong {
  color: #6ce9aa;
}

.history-extreme.negative {
  border-left-color: rgba(255, 107, 98, 0.74);
}

.history-extreme.negative > strong {
  color: #ff8f86;
}

.history-extreme.wbp {
  border-left-color: rgba(245, 189, 66, 0.75);
}

.history-extreme.wbp > strong {
  color: #f5c453;
}

.history-direction {
  min-width: 52px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.11);
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.history-direction.positive {
  background: rgba(53, 209, 141, 0.14);
  color: #6ce9aa;
}

.history-direction.negative {
  background: rgba(255, 107, 98, 0.14);
  color: #ff8f86;
}

.history-peak-track {
  grid-column: 1 / -1;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
}

.history-peak-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f80ed, #21d4c2, #35d18d);
}

.history-day-card.negative .history-peak-track span {
  background: linear-gradient(90deg, #d24658, #ff7c70, #ffb14a);
}

.history-item-empty {
  padding: 18px;
  color: var(--muted);
  font-size: 0.86rem;
  text-align: center;
}

.history-loading,
.history-empty {
  display: grid;
  min-height: 190px;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.history-loading span {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(53, 209, 141, 0.2);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: historySpin 0.85s linear infinite;
}

.history-empty strong {
  color: var(--ink);
}

.history-empty.error strong {
  color: var(--red);
}

@keyframes historySpin {
  to {
    transform: rotate(360deg);
  }
}

.bay-reading.couple-ocr.normal span,
.bay-reading.couple-ocr.normal strong {
  color: var(--green);
}

.bay-reading.couple-ocr.warning span,
.bay-reading.couple-ocr.warning strong {
  color: var(--amber);
}

.bay-reading.couple-ocr.critical span,
.bay-reading.couple-ocr.critical strong {
  color: var(--red);
}

.bay-reading.couple-ocr.unset span,
.bay-reading.couple-ocr.unset strong {
  color: var(--muted);
}

.bay-badge {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 900;
}

.bay-badge-stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.bay-badge.alarm {
  background: rgba(244, 184, 74, 0.13);
  color: var(--amber);
}

.bay-badge.trip {
  background: rgba(255, 107, 98, 0.14);
  color: var(--red);
}

.bay-badge.sync-ok {
  background: rgba(53, 209, 141, 0.18);
  color: var(--green);
}

.bay-badge.ar-ready {
  background: rgba(74, 163, 255, 0.16);
  color: var(--blue);
}

.bay-badge.ar-inprog {
  background: rgba(244, 184, 74, 0.18);
  color: var(--amber);
}

.bay-badge.ar-inprog.blink {
  animation: arBlink 1s steps(2, start) infinite;
}

@keyframes arBlink {
  50% {
    opacity: 0.25;
  }
}

.bay-badge.offline {
  background: rgba(150, 170, 163, 0.13);
  color: var(--muted);
}

.mini-single-line {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  min-height: 48px;
}

.mini-line {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
}

.mini-breaker {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 3px solid var(--green);
  border-radius: 50%;
}

.mini-breaker span {
  width: 24px;
  height: 4px;
  border-radius: 999px;
  background: var(--green);
}

.mini-breaker.open {
  border-color: var(--red);
}

.mini-breaker.open span {
  background: var(--red);
  transform: rotate(-34deg);
}

.bay-reading strong {
  font-size: 1.35rem;
  line-height: 1.05;
}

.mini-status {
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.84rem;
}

.bay-detail-layout {
  display: grid;
  grid-template-columns: minmax(190px, 0.36fr) minmax(0, 1fr);
  gap: 16px;
}

.bay-selector {
  display: grid;
  align-content: start;
  gap: 8px;
  max-height: 460px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.bay-selector button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  text-align: left;
}

.bay-selector button.active {
  border-color: rgba(53, 209, 141, 0.64);
  background: rgba(53, 209, 141, 0.14);
}

.bay-selector button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.bay-selector button strong {
  color: var(--muted);
  font-size: 0.72rem;
}

.bay-detail-main {
  display: grid;
  gap: 14px;
}

.detail-meter-grid,
.indicator-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.detail-meter-grid div,
.indicator-item,
.indicator-column {
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.detail-meter-grid div {
  min-height: 104px;
}

.indicator-column {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 240px;
}

.indicator-column h3 {
  margin: 0;
  color: var(--green);
  font-size: 0.86rem;
  text-transform: uppercase;
}

.indicator-column-list {
  display: grid;
  gap: 8px;
}

.indicator-column .indicator-item {
  min-height: 52px;
  padding: 10px;
  background: rgba(3, 7, 6, 0.3);
}

.detail-meter-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.detail-meter-grid strong {
  display: block;
  margin-top: 10px;
  font-size: 1rem;
  line-height: 1.05;
}

.detail-meter-grid .detail-value {
  font-size: 3.2rem;
  line-height: 0.95;
}

.detail-meter-grid .detail-unit {
  font-size: 1.45rem;
  line-height: 1;
}

.detail-meter-grid div:nth-child(1) .detail-value {
  color: var(--red);
}

.detail-meter-grid div:nth-child(2) .detail-value {
  color: var(--amber);
}

.detail-meter-grid div:nth-child(3) .detail-value {
  color: var(--blue);
}

.indicator-panel {
  display: grid;
  gap: 12px;
}

.indicator-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.indicator-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.indicator-actions button {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 900;
}

.indicator-actions button:hover {
  border-color: rgba(53, 209, 141, 0.58);
}

.indicator-header span {
  color: var(--muted);
  font-weight: 800;
}

.indicator-header strong.good {
  color: var(--green);
}

.indicator-header strong.offline {
  color: var(--red);
}

.record-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(4, 13, 11, 0.74);
}

.record-header,
.record-grid {
  display: grid;
  gap: 12px;
}

.record-header {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.record-header span,
.record-grid h3 {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.record-header strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 0.95rem;
}

.record-header button {
  height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(53, 209, 141, 0.42);
  border-radius: 8px;
  background: rgba(53, 209, 141, 0.14);
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 950;
}

.record-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.record-grid section {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

.record-grid h3 {
  margin: 0;
}

.record-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  margin: 0;
  padding: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  list-style: none;
}

.record-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  align-items: center;
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(157, 185, 175, 0.18);
  border-radius: 8px;
  background: rgba(3, 7, 6, 0.34);
}

.record-list li strong,
.record-list li time {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-list li strong {
  color: var(--ink);
  font-size: 0.82rem;
}

.record-list li time {
  color: var(--muted);
  font-size: 0.72rem;
}

.record-list li a {
  grid-row: 1 / span 2;
  grid-column: 2;
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 900;
  text-decoration: none;
}

.record-list li.empty {
  grid-template-columns: 1fr;
}

.indicator-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.indicator-item > span {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(150, 170, 163, 0.42);
  box-shadow: none;
}

.indicator-item.color-green > span {
  background: var(--green);
  box-shadow: 0 0 14px rgba(53, 209, 141, 0.44);
}

.indicator-item.color-red > span {
  background: var(--red);
  box-shadow: 0 0 14px rgba(255, 107, 98, 0.38);
}

.indicator-item.color-red strong,
.indicator-item.color-red small {
  color: var(--red);
}

.indicator-item.blink {
  animation: indicationBlink 1s steps(2, start) infinite;
}

@keyframes indicationBlink {
  50% {
    opacity: 0.32;
  }
}

.indicator-item.color-green strong {
  color: var(--ink);
}

.indicator-item strong,
.indicator-item small {
  display: block;
}

.indicator-item small {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 800;
}

.work-area {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.panel {
  padding: 20px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.panel-header.compact {
  margin-bottom: 14px;
}

.segment-control {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #07100e;
}

.segment-control button {
  min-width: 72px;
  height: 34px;
  border: 0;
  background: transparent;
}

.segment-control button.active {
  background: var(--green);
  color: #04100d;
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.comparison-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.comparison-header,
.comparison-values {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.comparison-header {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, auto));
  align-items: flex-start;
}

.comparison-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.comparison-values div {
  display: grid;
  gap: 8px;
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(3, 7, 6, 0.28);
}

.comparison-panel span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.comparison-panel strong {
  white-space: nowrap;
  font-size: 2.35rem;
  line-height: 1.05;
}

.comparison-panel strong > span {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.comparison-values strong {
  color: var(--ink);
  font-size: 3.6rem;
}

.frequency-panel .comparison-values div:first-child strong,
.voltage-panel .comparison-values div:first-child strong {
  color: var(--green);
}

.frequency-panel .comparison-values div:last-child strong {
  color: var(--blue);
}

.voltage-panel .comparison-values div:last-child strong {
  color: var(--amber);
}

.bar-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(226, 233, 230, 0.12);
}

.bar-track span {
  display: block;
  width: 50%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--cyan));
  transition: width 280ms ease;
}

canvas {
  display: block;
  width: 100%;
  height: 240px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(13, 33, 29, 0.9), rgba(6, 16, 14, 0.98));
  box-shadow: inset 0 0 0 1px rgba(53, 209, 141, 0.05);
}

.trend-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.trend-meta-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(173, 214, 202, 0.14);
  border-radius: 8px;
  background: rgba(3, 7, 6, 0.28);
}

.trend-meta-item span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--trend-color);
  box-shadow: 0 0 14px var(--trend-color);
}

.trend-meta-item strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trend-meta-item em {
  color: var(--trend-color);
  font-style: normal;
  font-size: 0.88rem;
  font-weight: 900;
  white-space: nowrap;
}

.trend-meta-item small {
  grid-column: 2 / 4;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.bay-panel {
  display: grid;
  align-content: start;
}

.health-score {
  color: var(--green);
  font-size: 1.35rem;
  font-weight: 900;
}

.single-line {
  position: relative;
  display: grid;
  min-height: 376px;
  justify-items: center;
  align-content: start;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(var(--surface-2), var(--surface-2)) padding-box,
    repeating-linear-gradient(0deg, transparent 0 35px, rgba(74, 163, 255, 0.09) 35px 36px);
}

.busbar {
  width: 86%;
  height: 10px;
  border-radius: 999px;
  background: var(--blue);
}

.vertical-line {
  width: 6px;
  height: 46px;
  border-radius: 999px;
  background: #75837f;
}

.vertical-line.load {
  height: 58px;
  background: var(--green);
}

.bay-device,
.load-node {
  display: grid;
  min-width: 118px;
  gap: 3px;
  justify-items: center;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.bay-device span {
  color: var(--muted);
  font-size: 0.78rem;
}

.breaker {
  display: grid;
  width: 78px;
  height: 78px;
  place-items: center;
  border: 4px solid var(--green);
  border-radius: 50%;
  background: rgba(53, 209, 141, 0.06);
}

.breaker span {
  display: block;
  width: 44px;
  height: 6px;
  border-radius: 999px;
  background: var(--green);
  transform: rotate(0deg);
  transition: transform 240ms ease, background 240ms ease;
}

.breaker.open {
  border-color: var(--red);
  background: rgba(255, 107, 98, 0.08);
}

.breaker.open span {
  background: var(--red);
  transform: rotate(-34deg);
}

.relay-meta,
.quality-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.relay-meta div,
.quality-list div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.relay-meta span,
.quality-list span {
  color: var(--muted);
}

.bottom-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
  gap: 20px;
}

.dc-clip-panel {
  min-width: 0;
}

.dc-clip-list {
  display: grid;
  gap: 8px;
  max-height: 440px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.dc-clip-device {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(33, 212, 194, 0.24);
  border-radius: 9px;
  background: rgba(3, 17, 14, 0.48);
}

.dc-clip-device.offline {
  border-color: rgba(239, 68, 68, 0.26);
  background: rgba(55, 22, 22, 0.34);
}

.dc-clip-device-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dc-clip-device-head > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.dc-clip-device-head strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dc-clip-device-head small {
  color: var(--muted);
  font-size: 0.58rem;
}

.dc-clip-device-head em {
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(33, 212, 194, 0.12);
  color: #35d18d;
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.dc-clip-device.offline .dc-clip-device-head em {
  background: rgba(239, 68, 68, 0.14);
  color: #ff8a80;
}

.dc-clip-group {
  display: grid;
  gap: 4px;
}

.dc-clip-group > small {
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 900;
  text-transform: uppercase;
}

.dc-clip-channels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.dc-clip-channels span {
  display: grid;
  min-width: 0;
  gap: 2px;
  padding: 5px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}

.dc-clip-channels em {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.56rem;
  font-style: normal;
  font-weight: 900;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.dc-clip-channels b {
  overflow: hidden;
  color: var(--accent);
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dc-clip-error {
  color: #ff8a80;
  font-size: 0.72rem;
  font-weight: 700;
}

.dc-clip-empty {
  display: grid;
  min-height: 96px;
  place-items: center;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-align: center;
}

.fault-mail-panel {
  min-width: 0;
}

.power-plant-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.power-plant-card {
  gap: 10px;
}

.plant-reading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
}

.plant-reading span {
  font-size: 0.82rem;
}

.plant-reading strong {
  color: var(--text);
  font-size: 1.05rem;
}

.plant-reading.primary {
  margin-top: 4px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.plant-reading.primary strong {
  color: var(--green);
  font-size: 1.32rem;
}

.fault-mail-subject {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 24, 20, 0.66);
}

.fault-mail-subject span {
  overflow: hidden;
  color: var(--text);
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fault-mail-subject small {
  flex: 0 1 auto;
  min-width: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.fault-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 10px;
}

.fault-grid div {
  display: grid;
  min-height: 74px;
  align-content: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.fault-grid span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.fault-grid strong {
  overflow-wrap: anywhere;
  color: var(--green);
  font-size: 1.2rem;
}

.fault-list {
  display: grid;
  max-height: 440px;
  gap: 10px;
  margin-top: 12px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.fault-item {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 24, 20, 0.58);
}

.fault-item header {
  display: grid;
  grid-template-columns: minmax(160px, 0.42fr) minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.fault-item header strong {
  color: var(--blue);
  font-size: 1rem;
}

.fault-item header span {
  overflow: hidden;
  color: var(--muted);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fault-empty {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.fault-empty span {
  color: var(--muted);
}

.whatsapp-action {
  display: inline-grid;
  min-width: 44px;
  height: 30px;
  place-items: center;
  padding: 0 10px;
  border: 1px solid rgba(39, 211, 142, 0.52);
  border-radius: 8px;
  background: rgba(39, 211, 142, 0.16);
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  text-decoration: none;
}

.whatsapp-action:hover {
  border-color: rgba(39, 211, 142, 0.9);
  background: rgba(39, 211, 142, 0.26);
  color: var(--text);
}

.whatsapp-action.compact {
  min-width: 38px;
  height: 26px;
  padding: 0 8px;
  font-size: 0.72rem;
}

.text-button {
  min-width: 94px;
  height: 36px;
  padding: 0 12px;
}

.event-list {
  display: grid;
  max-height: 246px;
  gap: 10px;
  margin: 0;
  padding: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  list-style: none;
}

.event-list li {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-left: 4px solid var(--green);
  border-radius: 8px;
  background: var(--surface-2);
}

.event-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.event-list li.alarm {
  border-left-color: var(--amber);
}

.event-list li.trip {
  border-left-color: var(--red);
}

.event-list li.empty {
  border-left-color: var(--muted);
  color: var(--muted);
}

.event-list time {
  color: var(--muted);
  font-size: 0.78rem;
}

.connection-form {
  display: grid;
  gap: 12px;
}

.connection-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.connection-form .checkbox-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.connection-form .checkbox-line input {
  width: 18px;
  min-height: 18px;
}

.connection-form input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #07100e;
  color: var(--ink);
}

.connection-form button {
  min-height: 42px;
  background: var(--green);
  color: #04100d;
}

.map-output {
  max-height: 180px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  margin: 14px 0 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #07100e;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

@media (max-width: 1120px) {
  .work-area,
  .bottom-grid {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bay-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .history-measurement-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sld-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sld-footer-grid {
    grid-template-columns: 1fr;
  }

  .ultg-load-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .thermovisi-layout {
    grid-template-columns: 1fr;
  }

  .thermovisi-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  

  

  

  

  

  .form-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-group-title,
  .form-group-force {
    grid-column: 1 / -1;
  }

  

  .bay-list-header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

@media (max-width: 760px) {
  .dashboard {
    padding: 14px;
  }

  .hero-strip {
    align-items: stretch;
    flex-direction: column;
    padding: 20px;
  }

  .connection-panel {
    min-width: 0;
  }

  .summary-grid,.comparison-grid,.record-grid,.sld-kpi-grid,.thermovisi-kpis,.thermo-values,.bay-grid {
    grid-template-columns: 1fr;
  }

  .comparison-panel strong {
    font-size: 1.7rem;
  }

  .comparison-values strong {
    font-size: 2rem;
  }

  .comparison-header {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .measurement-gi-group {
    padding: 11px;
  }

  .gi-submenu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .measurement-gi-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .measurement-gi-stats {
    text-align: left;
  }

  .measurement-gi-actions {
    width: 100%;
    justify-content: space-between;
  }

  .power-plant-history-actions {
    flex-wrap: wrap;
  }

  .history-day-card {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .history-measurement-list {
    grid-template-columns: 1fr;
  }

  .history-content {
    overflow-y: auto;
  -webkit-overflow-scrolling: touch;
    -webkit-overflow-scrolling: touch;
  }

  .history-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .history-summary > strong {
    align-self: flex-end;
  }

  .history-extrema-card {
    grid-template-columns: 1fr;
  }

  .history-direction {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .form-upload {
    grid-template-columns: 1fr;
  }

  

  .form-group {
    grid-template-columns: 1fr;
  }

  
  .bay-list-manager > header  {
    align-items: stretch;
    flex-direction: column;
  }

  

  

  .bay-list-header-actions {
    align-items: stretch;
  }

  

  .form-submit-button {
    min-height: 42px;
  }

  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .metric-tile strong {
    font-size: 1.55rem;
  }

  .sld-kpi-card {
    min-height: 76px;
  }

  .ultg-load-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .connection-panel {
    grid-template-columns: 1fr;
  }

  .icon-button {
    grid-column: auto;
    grid-row: auto;
  }
}

.indicator-item.invalid {
  opacity: 0.72;
}

.indicator-item.invalid > span {
  background: transparent;
  border: 1px dashed rgba(150, 170, 163, 0.7);
  box-shadow: none;
}

.indicator-item.invalid small {
  color: #f5b13d;
}

.induced-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.induced-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.induced-header > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.induced-header span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.induced-header strong {
  overflow-wrap: anywhere;
  font-size: 0.82rem;
}

.induced-header button,
.induced-form-actions button {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(53, 209, 141, 0.45);
  border-radius: 8px;
  background: rgba(53, 209, 141, 0.12);
  color: var(--green);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.induced-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.induced-grid > div {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.induced-grid span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.induced-grid strong {
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
}

.induced-grid small {
  color: var(--muted);
}

.induced-form {
  display: grid;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.induced-form[hidden],
.induced-form label[hidden] {
  display: none;
}

.induced-form-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.induced-form-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 0.8fr);
  gap: 8px;
}

.induced-form label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.induced-form label span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.induced-form input {
  min-width: 0;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--ink);
  font: inherit;
}

.induced-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.induced-form-actions span {
  margin-right: auto;
  color: #f5b13d;
  font-size: 0.8rem;
}

@media (max-width: 720px) {
  .induced-grid,
  .induced-form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .induced-form-meta {
    grid-template-columns: 1fr;
  }
}
