/* ============================================================
   THE WIRING CLOSET — STYLES
   PublicEdTech aesthetic family. Inspector's-notebook character.
   ============================================================ */

:root {
  --pet-blue:    #2250d5;
  --pet-yellow:  #fbc442;
  --pet-dark:    #1a1f2e;
  --pet-dark-2:  #252e42;
  --bg:          #f5f6fa;
  --paper:       #ffffff;
  --ink:         #1a1f2e;
  --ink-soft:    #4a5670;
  --ink-fade:    #8794a8;
  --rule:        rgba(0,0,0,0.08);
  --accent-red:  #e05a20;
  --accent-grn:  #4ade80;
  --sev-low:     #4ade80;
  --sev-mid:     #fbc442;
  --sev-hi:      #e05a20;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font-family: inherit; cursor: pointer; }
em { font-style: italic; }

/* ============================================================
   VIEW VISIBILITY
   ============================================================ */

.pet-landing,
.pet-boot,
.pet-app {
  display: none;
  width: 100%;
  height: 100%;
}
.pet-landing.active,
.pet-boot.active,
.pet-app.active {
  display: flex;
  flex-direction: column;
}

/* ============================================================
   LANDING PAGE
   ============================================================ */

.pet-landing { background: var(--bg); }

.landing-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 36px;
  background: var(--pet-dark);
  color: white;
  flex-shrink: 0;
}
.landing-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.landing-brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: var(--pet-yellow);
  color: var(--pet-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
}
.landing-brand-name { font-size: 15px; }
.landing-nav-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
}

.landing-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 32px;
}
.landing-hero {
  max-width: 880px;
  width: 100%;
}
.landing-kicker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--pet-blue);
  font-weight: 700;
  margin-bottom: 14px;
}
.landing-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.05;
  color: var(--ink);
  margin: 0 0 12px;
}
.landing-tagline {
  font-size: 18px;
  color: var(--ink-soft);
  margin: 0 0 24px;
  font-style: italic;
}
.landing-desc {
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 0 0 32px;
  max-width: 720px;
}
.landing-cta-row { margin-bottom: 48px; }
.landing-cta-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--pet-yellow);
  color: var(--pet-dark);
  border: none;
  padding: 16px 32px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 14px rgba(251,196,66,0.3);
}
.landing-cta-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(251,196,66,0.5);
}

.landing-mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 32px;
}
.landing-mode-card {
  padding: 22px 24px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.landing-mode-card:hover {
  transform: translateY(-2px);
  border-color: var(--pet-blue);
  box-shadow: 0 12px 28px rgba(34,80,213,0.15);
}
.landing-mode-card-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--pet-blue);
  font-weight: 700;
  margin-bottom: 8px;
}
.landing-mode-card-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}
.landing-mode-card-desc {
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.landing-foot {
  background: var(--pet-dark);
  color: rgba(255,255,255,0.55);
  padding: 18px 36px;
  flex-shrink: 0;
}
.landing-foot-inner {
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.04em;
}

/* ============================================================
   BOOT SCREEN
   ============================================================ */

.pet-boot {
  background: var(--pet-dark);
  color: white;
  align-items: center;
  justify-content: center;
}
.boot-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}
.boot-spinner {
  display: flex;
  gap: 8px;
}
.boot-spinner span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--pet-yellow);
  animation: bootBounce 1.2s infinite ease-in-out;
}
.boot-spinner span:nth-child(2) { animation-delay: 0.15s; }
.boot-spinner span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bootBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40%           { transform: scale(1);   opacity: 1; }
}
.boot-status {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
}
.boot-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: rgba(255,255,255,0.4);
}

/* ============================================================
   APP CHROME
   ============================================================ */

.pet-app {
  background: var(--bg);
}

.app-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: var(--pet-dark);
  color: white;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(0,0,0,0.4);
}
.app-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'DM Sans', sans-serif;
}
.app-brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 3px;
  background: var(--pet-yellow);
  color: var(--pet-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
}
.app-brand-name { font-weight: 700; font-size: 14px; }
.app-brand-divider { color: rgba(255,255,255,0.3); }
.app-module-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--pet-yellow);
  font-weight: 700;
}

.app-bar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: rgba(255,255,255,0.7);
}
.app-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-grn);
  box-shadow: 0 0 8px rgba(74,222,128,0.6);
}

.app-exit {
  background: transparent;
  color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 6px 14px;
  border-radius: 3px;
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  transition: all 0.15s;
}
.app-exit:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.4);
}

.app-body {
  flex: 1;
  display: flex;
  min-height: 0;
}

/* ============================================================
   RAIL (left specimen list)
   ============================================================ */

.rail {
  width: 280px;
  flex-shrink: 0;
  background: var(--paper);
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.rail-head {
  padding: 22px 22px 14px;
  border-bottom: 1px solid var(--rule);
}
.rail-kicker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--pet-blue);
  font-weight: 700;
  margin-bottom: 4px;
}
.rail-count {
  font-size: 13px;
  color: var(--ink-soft);
}

.rail-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}
.rail-item {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  padding: 14px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
  border-left: 3px solid transparent;
  align-items: start;
}
.rail-item:hover { background: rgba(0,0,0,0.03); }
.rail-item.active {
  background: rgba(34,80,213,0.06);
  border-left-color: var(--pet-blue);
}
.rail-item-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  font-weight: 800;
  color: var(--ink-fade);
  letter-spacing: 0.04em;
}
.rail-item.active .rail-item-num { color: var(--pet-blue); }
.rail-item-cat {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-fade);
  margin-bottom: 3px;
  font-weight: 700;
}
.rail-item-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: 6px;
}
.rail-item-tag {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 2px;
}
.rail-item-tag.sev-foundational {
  background: rgba(224,90,32,0.12);
  color: var(--sev-hi);
}
.rail-item-tag.sev-compounding {
  background: rgba(251,196,66,0.18);
  color: #b88300;
}

.rail-foot {
  padding: 14px;
  border-top: 1px solid var(--rule);
}
.rail-walk-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--pet-dark);
  color: white;
  border: none;
  padding: 12px 16px;
  border-radius: 3px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: background 0.15s;
}
.rail-walk-btn:hover { background: #2c354c; }
.rail-walk-icon { color: var(--pet-yellow); }

/* ============================================================
   INSPECTOR (main panel)
   ============================================================ */

.inspector {
  flex: 1;
  overflow-y: auto;
  padding: 32px 44px 80px;
  min-width: 0;
}

.insp-head { margin-bottom: 28px; }
.insp-kicker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--pet-blue);
  font-weight: 700;
  margin-bottom: 8px;
}
.insp-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin: 0 0 14px;
  color: var(--ink);
}
.insp-found-in {
  font-size: 14px;
  color: var(--ink-soft);
  font-style: italic;
  line-height: 1.5;
  max-width: 720px;
}
.insp-fi-label {
  font-style: normal;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--pet-blue);
  text-transform: uppercase;
  margin-right: 6px;
}

/* --- Exhibit (annotated visual) --- */
.exhibit {
  margin-bottom: 32px;
}
.exhibit-frame {
  position: relative;
  background: var(--pet-dark);
  border: 1px solid rgba(0,0,0,0.4);
  border-radius: 8px;
  overflow: hidden;
  box-shadow:
    0 18px 40px rgba(0,0,0,0.18),
    0 0 0 8px rgba(0,0,0,0.04);
  aspect-ratio: 2 / 1;
  width: 100%;
  max-width: 980px;
}
.exhibit-stamp {
  position: absolute;
  top: 14px;
  left: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  font-weight: 800;
  color: var(--accent-red);
  border: 1.5px solid var(--accent-red);
  padding: 4px 10px;
  border-radius: 3px;
  background: rgba(0,0,0,0.4);
  z-index: 5;
  transform: rotate(-2deg);
}
.exhibit-svg {
  display: block;
  width: 100%;
  height: 100%;
}
.exhibit-blank {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: rgba(255,255,255,0.3);
  font-style: italic;
}
.exhibit-annotations {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.exhibit-caption {
  margin-top: 12px;
  font-size: 13px;
  color: var(--ink-soft);
  font-style: italic;
  max-width: 880px;
  line-height: 1.5;
}

/* --- Annotation pins --- */
.anno-pin {
  position: absolute;
  pointer-events: auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-red);
  color: white;
  border: 2px solid white;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4), 0 0 0 2px var(--accent-red);
  font-family: 'DM Sans', sans-serif;
  font-weight: 800;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: all 0.18s ease;
  animation: pinPulse 2.2s ease-in-out infinite;
}
.anno-pin:hover {
  transform: translate(-50%, -50%) scale(1.15);
  box-shadow: 0 6px 16px rgba(0,0,0,0.5), 0 0 0 3px var(--accent-red);
}
.anno-pin.active {
  background: var(--pet-yellow);
  color: var(--pet-dark);
  box-shadow: 0 6px 16px rgba(251,196,66,0.6), 0 0 0 3px var(--pet-yellow);
  animation: none;
  transform: translate(-50%, -50%) scale(1.2);
}
@keyframes pinPulse {
  0%, 100% { box-shadow: 0 4px 10px rgba(0,0,0,0.4), 0 0 0 2px var(--accent-red), 0 0 0 6px rgba(224,90,32,0); }
  50%      { box-shadow: 0 4px 10px rgba(0,0,0,0.4), 0 0 0 2px var(--accent-red), 0 0 0 8px rgba(224,90,32,0.18); }
}

/* --- Annotation popup --- */
#anno-popup {
  position: fixed;
  z-index: 80;
  display: none;
  max-width: 360px;
  pointer-events: none;
}
#anno-popup.show {
  display: block;
  pointer-events: auto;
}
.anno-popup-inner {
  background: var(--paper);
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 6px;
  box-shadow:
    0 18px 40px rgba(0,0,0,0.18),
    0 4px 12px rgba(0,0,0,0.08);
  overflow: hidden;
  animation: popupIn 0.18s cubic-bezier(0.2,1.2,0.4,1);
}
@keyframes popupIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.anno-popup-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--accent-red);
  color: white;
}
.anno-popup-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  color: var(--accent-red);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Sans', sans-serif;
  font-weight: 800;
  font-size: 12px;
  flex-shrink: 0;
}
.anno-popup-title {
  font-size: 13.5px;
  font-weight: 700;
  flex: 1;
}
.anno-popup-close {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.anno-popup-close:hover { color: white; }
.anno-popup-body {
  padding: 14px 16px;
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-soft);
}

/* ============================================================
   DIAGNOSIS (flags + why-it-fails)
   ============================================================ */

.diagnosis {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 32px;
  margin-bottom: 36px;
  align-items: start;
}
.diag-h {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--pet-blue);
  margin-bottom: 10px;
}

.flag-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.flag-item {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent-red);
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  transition: all 0.15s;
}
.flag-item:hover {
  background: rgba(224,90,32,0.04);
  transform: translateX(2px);
}
.flag-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-red);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Sans', sans-serif;
  font-weight: 800;
  font-size: 11px;
}
.flag-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}

.diag-prose {
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 0;
  max-width: 720px;
  text-wrap: pretty;
}

/* ============================================================
   COMPOUND (year-by-year cost)
   ============================================================ */

.compound {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent-red);
  border-radius: 0 6px 6px 0;
  padding: 22px 26px;
  margin-bottom: 36px;
  max-width: 880px;
}
.compound-h {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 16px;
}
.compound-list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: compound;
}
.compound-list li {
  position: relative;
  padding: 10px 14px 10px 56px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
  counter-increment: compound;
  border-bottom: 1px solid var(--rule);
}
.compound-list li:last-child { border-bottom: none; }
.compound-list li::before {
  content: counter(compound);
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(224,90,32,0.1);
  color: var(--accent-red);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 12px;
}

/* ============================================================
   WHAT WORKS (proper version)
   ============================================================ */

.works {
  background: var(--pet-dark);
  color: white;
  border-radius: 8px;
  padding: 28px 32px;
  margin-bottom: 36px;
  max-width: 880px;
  position: relative;
  overflow: hidden;
}
.works::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--pet-yellow);
}
.works-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--pet-yellow);
  margin-bottom: 8px;
}
.works-headline {
  font-family: 'DM Sans', sans-serif;
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
.works-intro {
  font-size: 14.5px;
  line-height: 1.6;
  color: rgba(255,255,255,0.7);
  margin: 0 0 20px;
  font-style: italic;
}
.works-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.works-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.04);
  border-left: 3px solid var(--pet-yellow);
  border-radius: 0 4px 4px 0;
}
.works-name {
  font-size: 14px;
  font-weight: 700;
  color: white;
}
.works-role {
  font-size: 13px;
  color: rgba(255,255,255,0.72);
  line-height: 1.5;
}
.works-cost {
  padding: 12px 14px;
  background: rgba(251,196,66,0.1);
  border-left: 3px solid var(--pet-yellow);
  border-radius: 0 4px 4px 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255,255,255,0.85);
}

/* ============================================================
   REALITY CHECK (closing editorial)
   ============================================================ */

.reality {
  margin-bottom: 32px;
  padding: 22px 26px;
  background: rgba(34,80,213,0.04);
  border-left: 3px solid var(--pet-blue);
  border-radius: 0 6px 6px 0;
  max-width: 880px;
}
.reality-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--pet-blue);
  margin-bottom: 8px;
}
.reality-prose {
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 0;
  text-wrap: pretty;
}

/* ============================================================
   SPECIMEN NAVIGATION
   ============================================================ */

.insp-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
  border-top: 1px solid var(--rule);
  max-width: 880px;
}
.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule);
  padding: 12px 22px;
  border-radius: 4px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s;
}
.nav-btn:hover:not(:disabled) {
  border-color: var(--pet-blue);
  color: var(--pet-blue);
}
.nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.nav-btn.primary {
  background: var(--pet-blue);
  color: white;
  border-color: var(--pet-blue);
}
.nav-btn.primary:hover:not(:disabled) {
  background: #1a40a8;
  border-color: #1a40a8;
  color: white;
}
.nav-progress {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--ink-fade);
  letter-spacing: 0.06em;
}

/* ============================================================
   WALKTHROUGH OVERLAY
   ============================================================ */

.walk-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,31,46,0.96);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: none;
  flex-direction: column;
}
.walk-overlay.open { display: flex; }

.walk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}
.walk-breadcrumb {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--pet-yellow);
  font-weight: 700;
}
.walk-counter {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: rgba(255,255,255,0.6);
}
.walk-close {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 28px;
  cursor: pointer;
  padding: 0 8px;
  line-height: 1;
}
.walk-close:hover { color: white; }

.walk-stage {
  flex: 1;
  overflow-y: auto;
  padding: 40px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.walk-card {
  max-width: 880px;
  width: 100%;
  color: white;
}
.walk-kicker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--pet-blue);
  font-weight: 700;
  margin-bottom: 10px;
}
.walk-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 24px;
  text-wrap: balance;
}
.walk-visual {
  margin-bottom: 24px;
  background: var(--pet-dark-2);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  aspect-ratio: 2 / 1;
}
.walk-prose {
  font-size: 16px;
  line-height: 1.65;
  color: rgba(255,255,255,0.85);
  margin: 0 0 18px;
  text-wrap: pretty;
}
.walk-reality {
  padding: 18px 22px;
  background: rgba(34,80,213,0.18);
  border-left: 3px solid var(--pet-yellow);
  border-radius: 0 4px 4px 0;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255,255,255,0.9);
  font-style: italic;
}

.walk-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  border-top: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
  gap: 16px;
}
.walk-nav-btn {
  background: transparent;
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.25);
  padding: 12px 22px;
  border-radius: 4px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s;
}
.walk-nav-btn:hover:not(:disabled) {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.5);
}
.walk-nav-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.walk-nav-btn.primary {
  background: var(--pet-yellow);
  color: var(--pet-dark);
  border-color: var(--pet-yellow);
  font-weight: 800;
}
.walk-nav-btn.primary:hover {
  background: #ffd054;
  border-color: #ffd054;
}
.walk-dots {
  display: flex;
  gap: 8px;
}
.walk-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  transition: all 0.2s;
}
.walk-dot.active {
  background: var(--pet-yellow);
  box-shadow: 0 0 8px rgba(251,196,66,0.55);
}

/* ============================================================
   SLIDESHOW (replaces the long-scroll inspector layout)
   ============================================================ */

.inspector {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

/* Slide bar (top of inspector) */
.slide-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
  gap: 24px;
}
.slide-bar-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--ink-fade);
  letter-spacing: 0.06em;
}
.slide-bar-spec {
  color: var(--pet-blue);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 10px;
}
.slide-bar-divider { color: var(--ink-fade); }
.slide-bar-pos { color: var(--ink-soft); font-weight: 600; }

.slide-bar-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}
.slide-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(0,0,0,0.1);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.18s;
}
.slide-dot:hover { background: rgba(34,80,213,0.35); transform: scale(1.15); }
.slide-dot.active {
  background: var(--pet-blue);
  box-shadow: 0 0 0 3px rgba(34,80,213,0.18);
  transform: scale(1.2);
}
.slide-dot.done { background: rgba(34,80,213,0.4); }

/* Slide stage (the slide itself) */
.slide-stage {
  flex: 1;
  overflow-y: auto;
  padding: 36px 44px 24px;
  background: var(--bg);
  min-height: 0;
}

.slide {
  max-width: 980px;
  margin: 0 auto;
  animation: slideIn 0.32s cubic-bezier(0.2,1,0.4,1);
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}

.slide-h-tag {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--pet-blue);
  font-weight: 800;
  margin-bottom: 12px;
  padding: 4px 10px;
  background: rgba(34,80,213,0.08);
  border-radius: 3px;
}
.slide-h-tag.tag-light {
  background: rgba(251,196,66,0.18);
  color: #b88300;
}
.slide-h {
  font-family: 'DM Sans', sans-serif;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 18px;
  text-wrap: balance;
}
.slide-h-light { color: white; }
.slide-h-sub {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 760px;
  margin: 0 0 24px;
  text-wrap: pretty;
}

/* Slide nav (footer of inspector) */
.slide-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 28px;
  background: var(--paper);
  border-top: 1px solid var(--rule);
  flex-shrink: 0;
}
.slide-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule);
  padding: 11px 20px;
  border-radius: 4px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s;
}
.slide-nav-btn:hover:not(:disabled) {
  border-color: var(--pet-blue);
  color: var(--pet-blue);
}
.slide-nav-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.slide-nav-btn.primary {
  background: var(--pet-blue);
  color: white;
  border-color: var(--pet-blue);
}
.slide-nav-btn.primary:hover:not(:disabled) {
  background: #1a40a8;
  border-color: #1a40a8;
}
.slide-nav-progress {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-fade);
  font-weight: 700;
}

/* ============================================================
   SLIDE TYPES
   ============================================================ */

/* Title slide */
.slide-title {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 55vh;
}
.slide-title-inner {
  max-width: 760px;
  text-align: left;
}
.slide-title-kicker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--pet-blue);
  font-weight: 700;
  margin-bottom: 16px;
}
.slide-title-headline {
  font-family: 'DM Sans', sans-serif;
  font-size: 56px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0 0 24px;
  color: var(--ink);
  text-wrap: balance;
}
.slide-title-severity {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 100px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 32px;
}
.slide-title-severity .sev-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.slide-title-severity.sev-foundational {
  background: rgba(224,90,32,0.1);
  color: var(--sev-hi);
}
.slide-title-severity.sev-foundational .sev-dot { background: var(--sev-hi); box-shadow: 0 0 8px rgba(224,90,32,0.55); }
.slide-title-severity.sev-compounding {
  background: rgba(251,196,66,0.18);
  color: #b88300;
}
.slide-title-severity.sev-compounding .sev-dot { background: var(--sev-mid); box-shadow: 0 0 8px rgba(251,196,66,0.6); }

.slide-title-found {
  background: var(--paper);
  border-left: 3px solid var(--pet-blue);
  border-radius: 0 6px 6px 0;
  padding: 18px 22px;
  margin-bottom: 28px;
}
.slide-title-found .found-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--pet-blue);
  font-weight: 700;
  margin-bottom: 6px;
}
.slide-title-found .found-prose {
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-soft);
  font-style: italic;
}
.slide-title-hint {
  font-size: 13px;
  color: var(--ink-fade);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.04em;
}
.slide-title-hint strong { color: var(--pet-blue); }

/* Exhibit slide tweaks */
.slide-exhibit-head { margin-bottom: 18px; }
.exhibit-flags-row {
  margin-top: 24px;
  padding: 18px 20px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 6px;
}
.exhibit-flags-row .diag-h { margin-bottom: 12px; }
.flag-list-h {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 8px;
}
.flag-list-h .flag-item {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent-red);
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  transition: all 0.15s;
}
.flag-list-h .flag-item:hover {
  background: rgba(224,90,32,0.04);
  transform: translateX(2px);
}

/* Why slide */
.slide-why .why-prose {
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink-soft);
  text-wrap: pretty;
  max-width: 760px;
  margin: 0;
}
.why-reality-callout {
  margin-top: 22px;
  padding: 18px 22px;
  background: rgba(34,80,213,0.05);
  border-left: 3px solid var(--pet-blue);
  border-radius: 0 6px 6px 0;
  max-width: 760px;
}
.why-reality-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--pet-blue);
  font-weight: 800;
  margin-bottom: 8px;
}
.why-reality-callout p {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--ink-soft);
  font-style: italic;
  text-wrap: pretty;
}

/* Compound slide */
.compound-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 760px;
}
.compound-yr {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 18px;
  align-items: center;
  padding: 16px 20px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent-red);
  border-radius: 0 6px 6px 0;
}
.compound-yr-num {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(224,90,32,0.1);
  color: var(--accent-red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 18px;
}
.compound-yr-text {
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
}

/* Works slide — dark inverted background */
.slide-works {
  background: var(--pet-dark);
  color: white;
  padding: 32px 40px 28px;
  margin: -36px -44px -24px;
  border-radius: 0;
  position: relative;
}
.slide-works::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--pet-yellow);
}
.slide-works .slide-h-tag.tag-light {
  background: rgba(251,196,66,0.2);
  color: var(--pet-yellow);
}
.slide-works .works-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}
.slide-works .works-row {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  padding: 20px 24px;
  background: rgba(255,255,255,0.05);
  border-left: 4px solid var(--pet-yellow);
  border-radius: 0 6px 6px 0;
}
.slide-works .works-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.005em;
}
.slide-works .works-role {
  font-size: 14.5px;
  color: rgba(255,255,255,0.78);
  line-height: 1.6;
}
.slide-works .works-cost {
  margin-top: 14px;
  padding: 14px 18px;
  background: rgba(251,196,66,0.1);
  border-left: 4px solid var(--pet-yellow);
  border-radius: 0 6px 6px 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  line-height: 1.6;
  color: rgba(255,255,255,0.9);
  max-width: 760px;
}

/* Reality slide */
.slide-reality .reality-prose {
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink-soft);
  font-style: italic;
  text-wrap: pretty;
  max-width: 760px;
  padding: 22px 26px;
  background: rgba(34,80,213,0.05);
  border-left: 3px solid var(--pet-blue);
  border-radius: 0 6px 6px 0;
  margin: 0;
}


/* ============================================================
   WIFI SIMULATOR (sim_before / sim_after slides)
   ============================================================ */

.slide-sim { max-width: 1180px; }

.sim-slide-head {
  margin-bottom: 14px;
}
.sim-slide-head .slide-h {
  font-size: 24px;
  margin: 0 0 8px;
}
.sim-slide-head .slide-h-sub {
  font-size: 13.5px;
  margin: 0;
  line-height: 1.5;
}
.sim-slide-head .slide-h-sub strong { color: var(--pet-blue); font-weight: 700; }

.sim-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 18px;
}

.sim-canvas { display: flex; flex-direction: column; }
.sim-canvas-frame {
  background: var(--pet-dark);
  border: 1px solid rgba(0,0,0,0.4);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.16);
  aspect-ratio: 1 / 1;
  position: relative;
}
.sim-svg { display: block; width: 100%; height: 100%; }

/* HUD overlay — status pill + network speed gauge, top-right of canvas */
.sim-hud {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(13, 19, 32, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 5px;
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 168px;
  z-index: 4;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
.sim-hud-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.sim-hud-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  font-weight: 700;
}
.sim-hud-gauge {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.sim-hud-gauge-track {
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
  box-shadow: inset 0 1px 1px rgba(0,0,0,0.2);
}
.sim-hud-gauge-fill {
  height: 100%;
  background: var(--accent-grn);
  border-radius: 3px;
  transition: width 0.5s cubic-bezier(0.2,0.9,0.4,1), background 0.4s;
}
.sim-hud-gauge-readout {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: white;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: right;
}

.sim-status {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 2px;
}
.sim-status.state-idle { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.7); }
.sim-status.state-good { background: rgba(74,222,128,0.18); color: #6df097; }
.sim-status.state-mid  { background: rgba(251,196,66,0.22); color: #fbc442; }
.sim-status.state-bad  { background: rgba(224,90,32,0.22); color: #ff8552; }

/* Right-side control panel */
.sim-panel {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}
.sim-panel-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--pet-blue);
  font-weight: 800;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}
.sim-panel-count { color: var(--ink-fade); font-weight: 700; }

.sim-device-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 80px;
  max-height: 340px;
}
.sim-list-empty {
  padding: 16px 10px;
  font-size: 12.5px;
  color: var(--ink-fade);
  text-align: center;
  line-height: 1.5;
}
.sim-list-empty strong { color: var(--pet-blue); }

/* Card grid: [icon] [body+speed] [actions] */
.sim-dev-card {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 9px;
  align-items: center;
  padding: 6px 9px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  background: var(--paper);
  animation: cardIn 0.3s cubic-bezier(0.2,1.1,0.4,1);
  position: relative;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateX(8px); }
  to   { opacity: 1; transform: translateX(0); }
}
.sim-dev-card:hover {
  background: rgba(34,80,213,0.03);
  border-color: rgba(34,80,213,0.4);
  transform: translateX(-1px);
}
.sim-dev-card.running {
  background: rgba(34,80,213,0.05);
  border-color: var(--pet-blue);
  box-shadow: 0 0 0 2px rgba(34,80,213,0.15);
}
.sim-dev-card.running.heavy {
  background: rgba(224,90,32,0.07);
  border-color: var(--accent-red);
  box-shadow: 0 0 0 2px rgba(224,90,32,0.2);
}
.sim-dev-card.conn-wired { border-left: 3px solid var(--accent-grn); }
.sim-dev-card.conn-wifi  { border-left: 3px solid var(--pet-yellow); }
.sim-dev-card.heavy.conn-wired,
.sim-dev-card.heavy.conn-wifi { border-left-color: var(--accent-red); }
.sim-dev-icon {
  font-size: 17px;
  text-align: center;
  line-height: 1;
}
.sim-dev-body { min-width: 0; }
.sim-dev-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.005em;
}
.sim-dev-conn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--ink-fade);
  font-weight: 600;
  margin-bottom: 3px;
}

/* Per-device live speed bar */
.sim-dev-speed {
  height: 3px;
  background: rgba(0,0,0,0.07);
  border-radius: 2px;
  overflow: hidden;
  box-shadow: inset 0 1px 1px rgba(0,0,0,0.04);
}
.sim-dev-speed-fill {
  height: 100%;
  background: var(--accent-grn);
  border-radius: 2px;
  transition: width 0.5s cubic-bezier(0.2,0.9,0.4,1), background 0.4s;
}

/* Right-side actions stack: pill on top, heavy button below */
.sim-dev-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex-shrink: 0;
}
.sim-dev-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 2px 5px;
  border-radius: 2px;
}
.sim-dev-pill.live  { color: var(--pet-blue);   background: rgba(34,80,213,0.12); }
.sim-dev-pill.heavy { color: var(--accent-red); background: rgba(224,90,32,0.14); }
.sim-dev-pill .live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: livePulse 1.1s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

.sim-dev-heavy {
  background: transparent;
  color: var(--accent-red);
  border: 1px solid rgba(224,90,32,0.4);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'DM Sans', sans-serif;
  font-size: 9.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.sim-dev-heavy:hover {
  background: rgba(224,90,32,0.1);
  border-color: var(--accent-red);
}
.sim-dev-heavy.active {
  background: var(--accent-red);
  color: white;
  border-color: var(--accent-red);
  box-shadow: 0 0 0 2px rgba(224,90,32,0.18);
}

/* Add device + reset row */
.sim-panel-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
}
.sim-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--pet-blue);
  color: white;
  border: none;
  padding: 9px 12px;
  border-radius: 4px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.sim-add-btn:hover:not(:disabled) {
  background: #1a40a8;
  transform: translateY(-1px);
}
.sim-add-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.sim-add-icon { font-size: 14px; font-weight: 800; line-height: 1; }
.sim-reset-btn {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--rule);
  padding: 9px 12px;
  border-radius: 4px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
}
.sim-reset-btn:hover {
  background: rgba(0,0,0,0.04);
  border-color: var(--ink-fade);
  color: var(--ink);
}

/* SVG element styles */
.sim-dev-marker { cursor: pointer; }
.sim-dev-marker circle {
  transition: stroke-width 0.18s, filter 0.18s;
}
.sim-dev-marker:hover circle {
  stroke-width: 0.7;
  filter: drop-shadow(0 0 1.8px rgba(255,255,255,0.65));
}
.sim-dev-marker.just-added circle { animation: deviceDrop 0.55s cubic-bezier(0.2,1.4,0.4,1); }
.sim-dev-marker.running circle:last-of-type {
  filter: drop-shadow(0 0 2px rgba(255,255,255,0.6));
}
.sim-dev-marker.heavy circle:last-of-type {
  filter: drop-shadow(0 0 3px rgba(224,90,32,0.85));
}
.sim-dev-pulse {
  animation: simPulse 1.6s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
.sim-dev-marker.heavy .sim-dev-pulse {
  animation: simPulse 0.9s ease-in-out infinite;
}
@keyframes simPulse {
  0%   { r: 3;   opacity: 0.7; }
  70%  { r: 5.5; opacity: 0; }
  100% { r: 5.5; opacity: 0; }
}

.sim-heat-zone { transition: fill 0.6s; }
.sim-cable { transition: opacity 0.4s; }
.sim-traffic-line { stroke-dashoffset: 0; }
.sim-traffic-line.heavy { stroke-width: 0.7; }

/* AP load badges + AP-to-AP steering arc (AFTER state) */
.sim-ap-load { pointer-events: none; }
.sim-ap-balance {
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.45s;
}
.sim-ap-balance.show { opacity: 1; }
.sim-ap-balance .sim-ap-balance-path {
  animation: balanceFlow 1.8s linear infinite;
}
.sim-ap-balance text {
  animation: balanceTextPulse 2.4s ease-in-out infinite;
}
@keyframes balanceFlow {
  from { stroke-dashoffset: 0; }
  to   { stroke-dashoffset: -10.4; }
}
@keyframes balanceTextPulse {
  0%, 100% { opacity: 0.65; }
  50%      { opacity: 1; }
}

/* QoS callout (AFTER state, shown when any device is heavy) */
.sim-qos {
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.sim-qos.show { opacity: 1; }
.sim-qos-pulse { animation: qosPulse 1.1s ease-in-out infinite; }
@keyframes qosPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.3; }
}

/* Takeaway — lives inside the panel as a compact footer */
.sim-takeaway {
  margin-top: auto;
  padding: 10px 12px;
  border-radius: 0 4px 4px 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.sim-takeaway strong {
  display: block;
  margin-bottom: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 800;
}
.sim-takeaway-warn {
  background: rgba(224,90,32,0.06);
  border-left: 3px solid var(--accent-red);
}
.sim-takeaway-warn strong { color: var(--accent-red); }
.sim-takeaway-good {
  background: rgba(74,222,128,0.08);
  border-left: 3px solid var(--accent-grn);
}
.sim-takeaway-good strong { color: #14a050; }


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 980px) {
  .app-body { flex-direction: column; }
  .rail {
    width: 100%;
    max-height: 220px;
    border-right: none;
    border-bottom: 1px solid var(--rule);
  }
  .slide-stage { padding: 22px 20px; }
  .slide-h { font-size: 24px; }
  .slide-title-headline { font-size: 38px; }
  .landing-title { font-size: 38px; }
  .landing-mode-grid { grid-template-columns: 1fr; }
  .sim-layout { grid-template-columns: 1fr; }
  .sim-panel { max-height: none; }
  .sim-device-list { max-height: 220px; }
  .slide-works .works-row { grid-template-columns: 1fr; gap: 4px; }
  .slide-works { margin: -22px -20px -24px; padding: 24px 20px; }
}
