:root {
  --bg-main: #0c1017;
  --bg-card: #141b24;
  --bg-card-hover: #1b2431;
  --border-color: #263345;
  --text-main: #e2e8f0;
  --text-muted: #8b9bb4;
  --accent-cyan: #06b6d4;
  --accent-blue: #3b82f6;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --accent-purple: #8b5cf6;
  --gas-color: #38bdf8;
  --heat-color: #f97316;
  --elec-color: #fbbf24;
  --glycol-color: #a855f7;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  line-height: 1.4;
  overflow-x: hidden;
}

/* Header */
.top-header {
  background-color: #0f1620;
  border-bottom: 1px solid var(--border-color);
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
}

.abb-header-logo {
  height: 28px;
  width: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(255, 0, 15, 0.25));
  transition: transform 0.2s ease, filter 0.2s ease;
}

.abb-header-logo:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 0 12px rgba(255, 0, 15, 0.45));
}

.brand-badge {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #fff;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.plant-title {
  font-size: 16px;
  font-weight: 600;
  color: #f8fafc;
}

.plant-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

.controls-section {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mode-selector {
  display: flex;
  background: #090d14;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 2px;
}

.mode-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}

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

.btn {
  background: #1e293b;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn:hover {
  background: #2d3d54;
  border-color: #475569;
}

.btn-primary {
  background: #0284c7;
  border-color: #0369a1;
  color: #fff;
}
.btn-primary:hover {
  background: #0369a1;
}

.btn-success {
  background: #059669;
  border-color: #047857;
  color: #fff;
}
.btn-success:hover {
  background: #047857;
}

.btn-danger {
  background: #dc2626;
  border-color: #b91c1c;
  color: #fff;
}
.btn-danger:hover {
  background: #b91c1c;
}

/* KPI Banner */
.kpi-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  padding: 14px 20px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 14px;
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border-color);
}

.kpi-card.cyan::before { background: var(--accent-cyan); }
.kpi-card.green::before { background: var(--accent-green); }
.kpi-card.amber::before { background: var(--accent-amber); }
.kpi-card.red::before { background: var(--accent-red); }
.kpi-card.purple::before { background: var(--accent-purple); }

.kpi-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.kpi-value {
  font-size: 20px;
  font-weight: 700;
  color: #f8fafc;
  margin: 4px 0;
  font-variant-numeric: tabular-nums;
}

.kpi-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.kpi-sub .badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
}
.badge-green { background: #064e3b; color: #34d399; }
.badge-amber { background: #78350f; color: #fbbf24; }
.badge-red { background: #7f1d1d; color: #f87171; }

/* Main Grid Layout */
.main-layout {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 16px;
  padding: 0 20px 20px 20px;
}

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

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
}

.panel-header {
  background: #111721;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-title {
  font-size: 13px;
  font-weight: 600;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-body {
  padding: 16px;
}

/* Process Flow Diagram (PFD) */
.pfd-container {
  background: #080d14;
  border: 1px solid #1a2332;
  border-radius: 6px;
  position: relative;
  min-height: 480px;
  overflow: visible;
}

svg.pfd-svg {
  width: 100%;
  height: 520px;
  display: block;
}

/* Pipe animation */
.pipe-gas {
  stroke: var(--gas-color);
  stroke-width: 3.5;
  fill: none;
  stroke-dasharray: 8, 4;
  animation: flowAnimation 1.2s linear infinite;
}

.pipe-heat {
  stroke: var(--heat-color);
  stroke-width: 3;
  fill: none;
  stroke-dasharray: 6, 4;
  animation: flowAnimation 1.5s linear infinite;
}

.pipe-elec {
  stroke: var(--elec-color);
  stroke-width: 2.5;
  fill: none;
  stroke-dasharray: 5, 5;
  animation: flowAnimation 0.8s linear infinite;
}

.pipe-glycol {
  stroke: var(--glycol-color);
  stroke-width: 2.5;
  fill: none;
  stroke-dasharray: 6, 4;
  animation: flowAnimation 2s linear infinite;
}

@keyframes flowAnimation {
  from { stroke-dashoffset: 24; }
  to { stroke-dashoffset: 0; }
}

.unit-node {
  cursor: pointer;
  transition: all 0.2s;
}

.unit-node:hover rect {
  stroke: var(--accent-cyan);
  stroke-width: 2;
  filter: drop-shadow(0 0 6px rgba(6, 182, 212, 0.4));
}

/* Agent Harness & Broker Console */
.agent-console {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.status-approved {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--accent-green);
  color: var(--accent-green);
}
.status-rejected {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--accent-red);
  color: var(--accent-red);
}
.status-pending {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid var(--accent-amber);
  color: var(--accent-amber);
}

.checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #0d131c;
  border: 1px solid var(--border-color);
  padding: 12px;
  border-radius: 6px;
}

.checklist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.checklist-icon {
  font-size: 14px;
}
.check-pass { color: var(--accent-green); }
.check-fail { color: var(--accent-red); }

.reasoning-box {
  background: #0a0f16;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 12px;
  font-family: "SFMono-Regular", Consolas, Menlo, monospace;
  font-size: 11px;
  color: #cbd5e1;
  max-height: 160px;
  overflow-y: auto;
  line-height: 1.5;
}

.setpoint-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin: 8px 0;
}

.setpoint-table th, .setpoint-table td {
  padding: 6px 10px;
  text-align: left;
  border-bottom: 1px solid #1e293b;
}

.setpoint-table th {
  color: var(--text-muted);
  font-weight: 600;
}

.setpoint-table td.delta-pos { color: var(--accent-green); font-weight: 600; }
.setpoint-table td.delta-neg { color: var(--accent-red); font-weight: 600; }

/* Scenario Presets */
.scenario-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.scenario-btn {
  background: #16202c;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 10px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-main);
}

.scenario-btn:hover {
  background: #202d3e;
  border-color: var(--accent-blue);
}

.scenario-btn.active {
  border-color: var(--accent-cyan);
  background: #162a3a;
}

.scenario-title {
  font-size: 11px;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 2px;
}

.scenario-desc {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Charts */
.chart-container {
  position: relative;
  height: 180px;
  width: 100%;
  margin-top: 10px;
}

canvas.trend-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Lower Panel Tabs & Compressor Map Styling */
.lower-panel-tabs {
  display: flex;
  gap: 6px;
  background: #0f172a;
  padding: 3px;
  border-radius: 6px;
  border: 1px solid #1e293b;
}

.panel-tab-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.panel-tab-btn:hover {
  color: #f1f5f9;
  background: #1e293b;
}

.panel-tab-btn.active {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.stage-pill-group {
  display: flex;
  gap: 4px;
  background: #0c131f;
  padding: 2px;
  border-radius: 4px;
  border: 1px solid #1e293b;
}

.stage-pill-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 3px 9px;
  font-size: 10.5px;
  font-weight: 600;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
}

.stage-pill-btn:hover {
  color: #f8fafc;
}

.stage-pill-btn.active {
  background: #0369a1;
  color: #ffffff;
}

.map-legend-pills {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 10.5px;
}

.legend-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #94a3b8;
}

.legend-line {
  display: inline-block;
  width: 14px;
  height: 2px;
}

.line-sll {
  background: #ef4444;
  border-top: 2px dashed #ef4444;
}

.line-ascl {
  background: #f59e0b;
  border-top: 2px dashed #f59e0b;
}

.line-speed {
  background: #0284c7;
}

.line-bep {
  background: #10b981;
  border-top: 2px dotted #10b981;
}

.line-choke {
  background: #a855f7;
  border-top: 2px dashed #a855f7;
}

.compressor-metrics-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  background: #080d14;
  border: 1px solid #1e293b;
  border-radius: 6px;
  padding: 8px 12px;
  margin-top: 8px;
}

.comp-strip-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.strip-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #64748b;
  text-transform: uppercase;
}

.strip-val {
  font-size: 11.5px;
  font-weight: 700;
  color: #e2e8f0;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
}

.strip-val.highlight-cyan {
  color: #38bdf8;
}

.strip-val.highlight-yellow {
  color: #facc15;
}

.strip-val.status-green {
  color: #34d399;
}

.strip-val.status-yellow {
  color: #fbbf24;
}

.strip-val.status-red {
  color: #ef4444;
}

.status-pill-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  width: fit-content;
}

.status-pill-badge.alarm-recycle {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.4);
}

.status-pill-badge.alarm-surge {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.5);
  animation: pulseAlarm 1.2s infinite;
}

@keyframes pulseAlarm {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.map-tooltip {
  position: absolute;
  background: rgba(11, 19, 32, 0.95);
  border: 1px solid #38bdf8;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 10.5px;
  color: #f8fafc;
  pointer-events: none;
  z-index: 50;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
}

/* 3-Layer Autonomous Architecture Workflow Modal Overlay (Isolated full overlay) */
.workflow-modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(4, 8, 14, 0.78);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.workflow-modal-overlay.open { display: flex; }

/* In dedicated tab view, unwrap cleanly into full-width workspace */
#view-main-workflows .workflow-modal-overlay {
  display: flex !important;
  position: static !important;
  background: transparent !important;
  backdrop-filter: none !important;
  z-index: 1 !important;
  padding: 14px 20px !important;
}

#view-main-workflows .workflow-modal-content {
  width: 100% !important;
  max-width: 100% !important;
  max-height: none !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}

/* ==========================================================================
   Cartoon Talk Bubble Telemetry Callout (Pointing to equipment)
   ========================================================================== */
.telemetry-bubble {
  position: absolute;
  width: 350px;
  background: linear-gradient(160deg, #0e1828 0%, #070f1a 100%);
  border: 2.5px solid #38bdf8;
  border-radius: 18px;
  box-shadow: 
    0 16px 36px rgba(0, 0, 0, 0.75),
    0 0 24px rgba(56, 189, 248, 0.28),
    4px 5px 0px rgba(0, 0, 0, 0.8);
  color: #f8fafc;
  z-index: 60;
  padding: 14px 16px;
  pointer-events: auto;
  user-select: none;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.5));
}

/* Cartoon Squash-and-Stretch Pop-in Animation */
@keyframes cartoonPopUp {
  0% {
    opacity: 0;
    transform: scale(0.18) translateY(var(--pop-offset-y, 18px));
  }
  50% {
    opacity: 1;
    transform: scale(1.08) translateY(calc(var(--pop-offset-y, 18px) * -0.15));
  }
  75% {
    transform: scale(0.96) translateY(2px);
  }
  90% {
    transform: scale(1.02) translateY(-1px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.telemetry-bubble.pop-animate {
  animation: cartoonPopUp 0.38s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

/* Pointer Tail (Speech bubble beak) */
.bubble-tail-wrapper {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.bubble-tail {
  position: absolute;
  left: var(--tail-x, 50%);
  transform: translateX(-50%);
  display: none;
}

.telemetry-bubble[data-placement="bottom"] .tail-up {
  display: block;
  top: -15px;
}

.telemetry-bubble[data-placement="top"] .tail-down {
  display: block;
  bottom: -15px;
}

.telemetry-bubble[data-placement="bottom"] {
  transform-origin: var(--tail-x, 50%) 0%;
  --pop-offset-y: -20px;
}

.telemetry-bubble[data-placement="top"] {
  transform-origin: var(--tail-x, 50%) 100%;
  --pop-offset-y: 20px;
}

/* Bubble Header */
.bubble-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #1a2a40;
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.bubble-title-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
}

.bubble-avatar {
  font-size: 22px;
  line-height: 1;
  display: inline-block;
}

.telemetry-bubble.pop-animate .bubble-avatar {
  animation: avatarBounce 0.45s ease-out;
}

@keyframes avatarBounce {
  0%, 100% { transform: rotate(0deg) scale(1); }
  35% { transform: rotate(-14deg) scale(1.25); }
  70% { transform: rotate(10deg) scale(1.1); }
}

.bubble-tag {
  font-size: 10.5px;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 0.5px;
  font-family: monospace;
}

.bubble-title {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

.bubble-close-btn {
  background: #142132;
  border: 1.5px solid #283e58;
  color: #94a3b8;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.bubble-close-btn:hover {
  background: #ef4444;
  border-color: #f87171;
  color: #ffffff;
  transform: scale(1.12);
}

/* Bubble Body & Metric Cards */
.bubble-body {
  font-size: 11.5px;
  line-height: 1.45;
}

.bubble-subtext {
  font-size: 10px;
  color: #94a3b8;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}

.bubble-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 8px;
  margin-bottom: 8px;
}

.bubble-metric {
  background: #08111d;
  border: 1px solid #162438;
  border-radius: 6px;
  padding: 5px 8px;
  display: flex;
  flex-direction: column;
}

.bubble-metric.full-span {
  grid-column: 1 / -1;
}

.bubble-metric .m-label {
  font-size: 9px;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin-bottom: 2px;
}

.bubble-metric .m-val {
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
}

.bubble-metric .m-val.cyan { color: #38bdf8; }
.bubble-metric .m-val.green { color: #34d399; }
.bubble-metric .m-val.amber { color: #fbbf24; }
.bubble-metric .m-val.orange { color: #fb923c; }

.bubble-status-banner {
  margin-top: 6px;
  padding: 6px 9px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bubble-status-banner.pass {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.45);
  color: #34d399;
}

.bubble-status-banner.warn {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: #fbbf24;
}

.bubble-status-banner.alert {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.45);
  color: #f87171;
}

/* Active equipment highlight on PFD */
.unit-node.active rect {
  stroke: #38bdf8 !important;
  stroke-width: 2.8 !important;
  filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.85)) !important;
}

/* ==========================================================================
   3-Layer Autonomous Architecture Workflow Modal Styling
   ========================================================================== */

.btn-workflow {
  background: linear-gradient(135deg, #1e3a8a, #0369a1);
  border: 1px solid #38bdf8;
  color: #fff;
  font-weight: 700;
  padding: 6px 14px;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
  animation: pulse-glow 3s infinite ease-in-out;
}
.btn-workflow:hover {
  background: linear-gradient(135deg, #2563eb, #0284c7);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.45);
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 8px rgba(56, 189, 248, 0.25); }
  50% { box-shadow: 0 0 16px rgba(56, 189, 248, 0.55); }
}

.workflow-modal-content {
  background: #0b111a;
  border: 1px solid #23344d;
  border-radius: 12px;
  width: 1020px;
  max-width: 95vw;
  max-height: 92vh;
  overflow-y: auto;
  padding: 22px 24px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.85);
  color: #f1f5f9;
}

.wf-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid #1e293b;
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.wf-badge-stack {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.wf-arch-tag {
  font-size: 10.5px;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.wf-title {
  font-size: 18px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -0.2px;
}

.wf-subtitle {
  font-size: 11.5px;
  color: #38bdf8;
  margin-top: 2px;
}

/* Workflow Selector Tabs */
.wf-tabs-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.wf-tab {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  gap: 10px;
  align-items: center;
  transition: all 0.2s;
}

.wf-tab:hover {
  background: #162032;
  border-color: #374151;
}

.wf-tab.active {
  background: #132238;
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.wf-tab-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #1e293b;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.wf-tab.active .wf-tab-num {
  background: #38bdf8;
  color: #0b111a;
}

.wf-tab-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.3;
}

.wf-tab-sub {
  font-size: 9.5px;
  color: var(--text-muted);
  line-height: 1.3;
  margin-top: 2px;
}

/* 3-Layer Visual Architecture Strip */
.layers-visual-strip {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: #080d14;
  border: 1px solid #192433;
  border-radius: 8px;
}

.layer-tier-card {
  background: #0f172a;
  border: 1.5px solid #1e293b;
  border-radius: 6px;
  padding: 10px 12px;
  position: relative;
  transition: all 0.3s;
}

.layer-tier-card.active {
  border-color: #38bdf8;
  background: #0c1a2e;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.25);
}

.layer-tier-card.active.tier-extended {
  border-color: #c084fc;
  background: #1c142b;
  box-shadow: 0 0 16px rgba(192, 132, 252, 0.25);
}

.layer-tier-card.active.tier-core {
  border-color: #10b981;
  background: #0d231a;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.25);
}

.layer-tier-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
}

.layer-tier-card.tier-enterprise .layer-tier-header { color: #38bdf8; }
.layer-tier-card.tier-extended .layer-tier-header { color: #c084fc; }
.layer-tier-card.tier-core .layer-tier-header { color: #34d399; }

.layer-tier-sub {
  font-size: 9.5px;
  color: #94a3b8;
  margin-top: 3px;
}

.layer-status-pill {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 8.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 3px;
  background: #1e293b;
  color: #64748b;
  letter-spacing: 0.5px;
}

.layer-tier-card.active .layer-status-pill {
  background: #0284c7;
  color: #fff;
  animation: pulse-badge 1.5s infinite;
}
.layer-tier-card.active.tier-extended .layer-status-pill {
  background: #9333ea;
  color: #fff;
}
.layer-tier-card.active.tier-core .layer-status-pill {
  background: #059669;
  color: #fff;
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

.layer-arrow {
  color: #334155;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
}

/* Step Progress Dots */
.wf-step-track {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0f1622;
  border: 1px solid #1b2636;
  border-radius: 6px;
  padding: 8px 14px;
  margin-bottom: 14px;
}

.wf-step-dots {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wf-dot-item {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.wf-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #1e293b;
  border: 1.5px solid #334155;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 700;
  transition: all 0.2s;
}

.wf-dot-item.active .wf-dot {
  background: #0284c7;
  border-color: #38bdf8;
  color: #fff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.wf-dot-item.completed .wf-dot {
  background: #064e3b;
  border-color: #10b981;
  color: #34d399;
}

.wf-dot-label {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
}

.wf-dot-item.active .wf-dot-label { color: #f8fafc; }

/* Main Step Detail Card */
.wf-step-detail-card {
  background: #111927;
  border: 1px solid #1f2b3e;
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 14px;
}

.wf-step-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.wf-step-title {
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
}

.wf-sys-tag {
  font-size: 10.5px;
  font-weight: 600;
  color: #94a3b8;
  background: #090e17;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid #1e293b;
}

.wf-step-desc {
  font-size: 12.5px;
  line-height: 1.6;
  color: #cbd5e1;
}

/* Automated Operator Interaction Gate Box */
.wf-operator-gate-box {
  background: #1b160c;
  border: 1.5px solid #d97706;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 14px;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.15);
}

.gate-header {
  border-bottom: 1px solid rgba(245, 158, 11, 0.25);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.gate-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gate-title {
  font-size: 12px;
  font-weight: 800;
  color: #fbbf24;
  letter-spacing: 0.5px;
}

.gate-sub {
  font-size: 11px;
  color: #fde68a;
  margin-top: 2px;
}

.gate-body {
  margin-bottom: 12px;
}

.gate-rationale-title {
  font-size: 10px;
  font-weight: 700;
  color: #fbbf24;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.gate-rationale-text {
  font-size: 12px;
  line-height: 1.5;
  color: #fef3c7;
  background: #110e07;
  border: 1px solid #78350f;
  border-radius: 5px;
  padding: 10px 12px;
}

.gate-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Payload Accordion */
.wf-payload-accordion {
  margin-bottom: 14px;
}

.wf-payload-summary {
  font-size: 11.5px;
  font-weight: 600;
  color: #94a3b8;
  cursor: pointer;
  padding: 6px 0;
  display: flex;
  justify-content: space-between;
}

.wf-payload-code {
  background: #070c14;
  border: 1px solid #1a2536;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #38bdf8;
  max-height: 160px;
  overflow-y: auto;
  margin-top: 6px;
}

/* Impact Banner */
.wf-impact-banner {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  background: #0c131d;
  border: 1px solid #1b283b;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 16px;
}

.wf-impact-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.impact-label {
  font-size: 9.5px;
  color: #8b9bb4;
  text-transform: uppercase;
  font-weight: 600;
}

.impact-val {
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
}

/* Footer Controls */
.wf-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #1e293b;
  padding-top: 14px;
}

.wf-footer-left {
  display: flex;
  gap: 10px;
  align-items: center;
}

.wf-footer-right {
  display: flex;
  align-items: center;
}

/* 24h Linepack Arbitrage Timeline Scrubber & Controls */
.timeline-scrubber-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #080d14;
  border: 1px solid #1a2536;
  border-radius: 6px;
  padding: 4px 10px;
  margin-top: 6px;
  margin-bottom: 4px;
}

.scrubber-label {
  font-size: 10.5px;
  font-weight: 700;
  color: #94a3b8;
  white-space: nowrap;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.scrubber-hours {
  display: flex;
  gap: 3px;
  flex: 1;
  overflow-x: auto;
  padding-bottom: 2px;
}

.hour-pill-btn {
  background: #111b27;
  border: 1px solid #1e2c3f;
  color: #94a3b8;
  padding: 2px 7px;
  font-size: 10px;
  font-family: monospace;
  font-weight: 600;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.hour-pill-btn:hover {
  background: #1c2b3d;
  color: #f1f5f9;
  border-color: #38bdf8;
}

.hour-pill-btn.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #38bdf8;
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.5);
  font-weight: 800;
}

.hour-pill-btn.valley {
  border-bottom: 2px solid #10b981;
}

.hour-pill-btn.peak {
  border-bottom: 2px solid #ef4444;
}

.hour-pill-btn.shoulder {
  border-bottom: 2px solid #f59e0b;
}

/* ==========================================================================
   Goal #3: Top-Level Tabbed Navigation Bar & Dedicated Workspaces
   ========================================================================== */
.main-nav-bar {
  background: #0d141f;
  border-bottom: 1px solid var(--border-color);
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 57px;
  z-index: 99;
}

.nav-tabs-group {
  display: flex;
  gap: 4px;
}

.nav-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-muted);
  padding: 11px 16px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  position: relative;
  white-space: nowrap;
}

.nav-tab-btn:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.03);
}

.nav-tab-btn.active {
  color: #38bdf8;
  border-bottom-color: #38bdf8;
  background: rgba(56, 189, 248, 0.06);
}

.nav-tab-badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  background: #1e293b;
  color: #94a3b8;
  font-weight: 700;
  font-family: monospace;
}

.nav-tab-btn.active .nav-tab-badge {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
}

.nav-tab-badge.badge-green {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.nav-tab-badge.badge-amber {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.nav-tab-badge.badge-blue {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.nav-tab-badge.badge-cyan {
  background: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
}

.nav-quick-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--text-muted);
  font-family: monospace;
}

.nav-status-item {
  color: #cbd5e1;
}

.nav-status-divider {
  color: #475569;
}

/* View Container Visibility */
.main-view-container {
  display: none !important;
  width: 100%;
}

.main-view-container.active {
  display: block !important;
}

/* ==========================================================================
   2D Geographic Subsea Pipeline & Power Grid Map Workspace
   ========================================================================== */
.geo-map-workspace {
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.geo-map-toolbar {
  background: #0f1724;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.geo-toolbar-section {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.geo-toolbar-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.geo-preset-group, .geo-layers-group {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.geo-preset-btn {
  background: #16202e;
  border: 1px solid #223246;
  color: #cbd5e1;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.geo-preset-btn:hover {
  background: #1e2c3f;
  color: #f8fafc;
  border-color: #38bdf8;
}

.geo-preset-btn.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}

.geo-layer-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #94a3b8;
  background: #0a0f18;
  border: 1px solid #1c2738;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.geo-layer-pill:hover {
  color: #f1f5f9;
  border-color: #334155;
}

.geo-layer-pill input {
  accent-color: #38bdf8;
  cursor: pointer;
}

.layer-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.geo-map-canvas-wrapper {
  position: relative;
  width: 100%;
  height: calc(100vh - 230px);
  min-height: 560px;
  background: #050911;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.geo-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

.geo-canvas:active {
  cursor: grabbing;
}

.geo-map-hud {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 320px;
  background: rgba(11, 17, 26, 0.94);
  backdrop-filter: blur(8px);
  border: 1px solid #23354b;
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  z-index: 10;
  pointer-events: auto;
}

.geo-hud-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #1e2c3e;
}

.geo-hud-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #f8fafc;
}

.geo-hud-sub {
  font-size: 10.5px;
  color: #94a3b8;
  margin-top: 2px;
}

.geo-hud-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.geo-hud-metric {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
}

.geo-hud-metric .m-label {
  color: #94a3b8;
}

.geo-hud-metric .m-val {
  font-weight: 600;
  color: #f1f5f9;
}

.geo-hud-metric .m-val.green { color: #34d399; }
.geo-hud-metric .m-val.amber { color: #fbbf24; }
.geo-hud-metric .m-val.cyan { color: #38bdf8; }

.geo-map-legend {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: rgba(11, 17, 26, 0.88);
  backdrop-filter: blur(6px);
  border: 1px solid #1e2c3e;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 10.5px;
  pointer-events: none;
}

.geo-legend-title {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.geo-legend-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.geo-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #cbd5e1;
}

.geo-legend-line {
  width: 18px;
  border-radius: 2px;
  display: inline-block;
}

/* ==========================================================================
   Dedicated Workspaces (Arbitrage, Compressors, Workflows)
   ========================================================================== */
.dedicated-workspace {
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
}

.workspace-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0f1724;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 18px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 12px;
}

.workspace-title-group {
  display: flex;
  flex-direction: column;
}

.workspace-title {
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
}

.workspace-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.workspace-controls-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.workspace-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.economic-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.economic-table th {
  text-align: left;
  padding: 6px 8px;
  color: var(--text-muted);
  border-bottom: 1px solid #1e2c3f;
  font-weight: 600;
}

.economic-table td {
  padding: 7px 8px;
  border-bottom: 1px solid #15202e;
}

/* ==========================================================================
   Demoer Explanatory Tooltip Popups (Cheat Sheets for Scenarios & Terms)
   ========================================================================== */
.demo-tooltip-popup {
  position: fixed;
  z-index: 10000;
  width: 360px;
  max-width: calc(100vw - 32px);
  background: linear-gradient(165deg, rgba(14, 23, 38, 0.98) 0%, rgba(8, 14, 25, 0.98) 100%);
  border: 1px solid #38bdf8;
  border-radius: 10px;
  padding: 13px 15px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 18px rgba(56, 189, 248, 0.22);
  backdrop-filter: blur(12px);
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.16s ease, transform 0.16s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #f1f5f9;
}

.demo-tooltip-popup.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.demo-tt-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 13px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s ease;
}

.demo-tt-close:hover {
  color: #f87171;
}

.demo-tt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 7px;
}

.demo-tt-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.14);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.demo-tt-icon {
  font-size: 14px;
}

.demo-tt-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 5px;
  line-height: 1.35;
}

.demo-tt-desc {
  font-size: 11px;
  color: #cbd5e1;
  line-height: 1.45;
  margin-bottom: 8px;
}

.demo-tt-section {
  border-radius: 6px;
  padding: 7px 9px;
  margin-bottom: 7px;
}

.demo-tt-talking-point {
  border-left: 3px solid #38bdf8;
  background: rgba(56, 189, 248, 0.07);
  border-top: 1px solid rgba(56, 189, 248, 0.15);
  border-right: 1px solid rgba(56, 189, 248, 0.15);
  border-bottom: 1px solid rgba(56, 189, 248, 0.15);
}

.demo-tt-mechanism {
  border-left: 3px solid #f59e0b;
  background: rgba(245, 158, 11, 0.06);
  border-top: 1px solid rgba(245, 158, 11, 0.15);
  border-right: 1px solid rgba(245, 158, 11, 0.15);
  border-bottom: 1px solid rgba(245, 158, 11, 0.15);
}

.demo-tt-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.demo-tt-talking-point .demo-tt-label {
  color: #38bdf8;
}

.demo-tt-mechanism .demo-tt-label {
  color: #fbbf24;
}

.demo-tt-text {
  font-size: 10.5px;
  line-height: 1.38;
  color: #e2e8f0;
}

.demo-tt-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9px;
  color: #64748b;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  margin-top: 4px;
}

.demo-tt-layer-tag {
  color: #38bdf8;
  font-weight: 600;
}

.demo-tt-tip-hint {
  color: #fbbf24;
  font-weight: 600;
}

/* Interactive Technical Term Badge / Pill */
.demo-term-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #cbd5e1;
  border-bottom: 1px dotted #38bdf8;
  padding: 1px 3px;
  border-radius: 3px;
  cursor: help;
  transition: all 0.15s ease;
  font-weight: 600;
  white-space: nowrap;
}

.demo-term-pill:hover {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.16);
  border-bottom: 1px solid #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.25);
}

/* Tooltip Affordance Icon */
.demo-help-indicator {
  font-size: 8.5px;
  opacity: 0.65;
  transition: opacity 0.15s;
}

.demo-term-pill:hover .demo-help-indicator {
  opacity: 1;
}

.wf-tab {
  position: relative;
}

.wf-tab[data-demo-tip] {
  cursor: pointer;
}

.scenario-btn[data-demo-tip] {
  position: relative;
}

.layer-tier-card[data-demo-tip] {
  cursor: help;
}

.layer-tier-card[data-demo-tip]:hover {
  transform: translateY(-1px);
}

/* ==========================================================================
   Energy & VoR Demo Splash / Codeword Login Gate
   ========================================================================== */
.demo-login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 38%, rgba(15, 27, 48, 0.98) 0%, rgba(5, 9, 17, 0.99) 100%);
  backdrop-filter: blur(20px);
  padding: 20px;
  opacity: 1;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.demo-login-overlay.fade-out {
  opacity: 0;
  transform: scale(1.02);
  pointer-events: none;
}

.demo-login-card {
  width: 460px;
  max-width: calc(100vw - 32px);
  background: linear-gradient(170deg, rgba(17, 28, 48, 0.96) 0%, rgba(9, 15, 26, 0.98) 100%);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(2, 132, 199, 0.18);
  padding: 32px 34px;
  text-align: center;
  color: #f1f5f9;
  position: relative;
  overflow: hidden;
}

.demo-login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #e00010 0%, #38bdf8 50%, #f59e0b 100%);
}

.demo-login-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.demo-login-logo {
  height: 32px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(255, 0, 15, 0.3));
}

.demo-login-badge {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.14);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  text-transform: uppercase;
}

.demo-login-title {
  font-size: 23px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.3px;
  margin-bottom: 4px;
}

.demo-login-subtitle {
  font-size: 12.5px;
  font-weight: 600;
  color: #93c5fd;
  margin-bottom: 2px;
}

.demo-login-scope {
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 16px;
}

.demo-login-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 20px;
}

.demo-login-tag {
  font-size: 10px;
  font-weight: 600;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 3px 8px;
  border-radius: 12px;
}

.demo-login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.demo-login-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #94a3b8;
  text-transform: uppercase;
}

.demo-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.demo-input-icon {
  position: absolute;
  left: 12px;
  font-size: 14px;
  pointer-events: none;
  opacity: 0.7;
}

.demo-code-input {
  width: 100%;
  padding: 10px 40px 10px 36px;
  background: rgba(8, 14, 25, 0.85);
  border: 1px solid #334155;
  border-radius: 6px;
  color: #ffffff;
  font-size: 13.5px;
  font-family: inherit;
  letter-spacing: 0.5px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.demo-code-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}

.demo-pwd-toggle {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  line-height: 1;
  transition: color 0.15s ease;
}

.demo-pwd-toggle:hover {
  color: #f1f5f9;
}

.demo-remember-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: #94a3b8;
}

.demo-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}

.demo-checkbox-label input {
  accent-color: #0284c7;
  cursor: pointer;
}

.demo-unlock-btn {
  width: 100%;
  padding: 11px 16px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: 1px solid rgba(56, 189, 248, 0.5);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.demo-unlock-btn:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #0369a1 0%, #0284c7 100%);
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.5);
}

.demo-unlock-btn:active {
  transform: translateY(1px);
}

.demo-login-error {
  padding: 7px 10px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 6px;
  color: #fca5a5;
  font-size: 11.5px;
  font-weight: 600;
  animation: shake 0.35s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.demo-login-footer {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 10px;
  color: #64748b;
  line-height: 1.4;
}

.demo-login-hint {
  font-size: 9.5px;
  color: #475569;
  margin-top: 3px;
}

/* Locking state handling on body */
html.demo-locked body > *:not(#demo-login-gate) {
  filter: blur(8px);
  pointer-events: none;
  user-select: none;
}



