/* ==========================================================================
   Drill Sergeant — Small-Office Wi-Fi Router Lab Stylesheet
   "Secure a small-office Wi-Fi router" — Operations Blueprint + BRAND.md
   Local brand fonts base: /assets/fonts/ (becomes /assets/fonts/ on website)
   ========================================================================== */

@font-face {
  font-family: 'Saira Stencil One';
  src: url('/assets/fonts/saira-stencil-one-400.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Public Sans';
  src: url('/assets/fonts/public-sans-400.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Public Sans';
  src: url('/assets/fonts/public-sans-600.woff') format('woff');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Public Sans';
  src: url('/assets/fonts/public-sans-700.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Public Sans';
  src: url('/assets/fonts/public-sans-700.woff') format('woff');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/assets/fonts/ibm-plex-mono-500.woff') format('woff');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/assets/fonts/ibm-plex-mono-500.woff') format('woff');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Single CSS asset path tokens (website equivalents: /assets/brand/ and /assets/fonts/) */
  --brand-asset-base: '/assets/brand/';
  --font-asset-base: '/assets/fonts/';

  --font-display: 'Saira Stencil One', 'Arial Black', 'Impact', sans-serif;
  --font-body: 'Public Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', 'SFMono-Regular', Consolas, monospace;

  /* Command chrome & headers — dark in BOTH light and dark schemes per BRAND.md */
  --command: #1F2717;
  --command-raised: #2A3420;
  --command-line: #3B4730;
  --command-text: #EEF1E6;
  --command-muted: #B7C1A6;

  /* Signal */
  --signal: #F08C3C;
  --signal-hover: #FFA759;
  --on-signal: #161A11;

  /* Light theme working surfaces (BRAND.md) */
  --bg: #ECEEE5;
  --surface: #F7F8F3;
  --surface-raised: #FFFFFF;
  --line: #CBD2BE;
  --text: #1A2013;
  --text-muted: #4C5840;
  --accent: #4D662B;
  --action: #A44D0E;
  --action-hover: #8B400B;
  --on-action: #FFFFFF;

  --ok-bg: #E5EEDB;
  --ok-border: #4D662B;
  --ok-text: #273812;
  --err-bg: #FCE9E2;
  --err-border: #A4301E;
  --err-text: #6D1D11;
  --warn-bg: #F9EFD8;
  --warn-border: #9B5C0F;
  --warn-text: #5D3607;

  --focus-ring: var(--action);

  --radius: 8px;
  --radius-sm: 5px;
}

[data-theme='dark'] {
  --bg: #12150E;
  --surface: #1A1F14;
  --surface-raised: #232B1B;
  --line: #36422A;
  --text: #EEF1E6;
  --text-muted: #B7C1A6;
  --accent: #9DB86A;
  --action: #F08C3C;
  --action-hover: #FFA759;
  --on-action: #161A11;

  --ok-bg: #202C16;
  --ok-border: #9DB86A;
  --ok-text: #D7E8B6;
  --err-bg: #351B16;
  --err-border: #E57A66;
  --err-text: #FFD5CC;
  --warn-bg: #322613;
  --warn-border: #F08C3C;
  --warn-text: #FCDCB8;

  --focus-ring: var(--signal);
}

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

[hidden] {
  display: none !important;
}

html {
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  overflow-x: hidden;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: rgba(77, 102, 43, 0.14);
  padding: 0.08em 0.32em;
  border-radius: 4px;
  overflow-wrap: anywhere;
}

[data-theme='dark'] code {
  background: rgba(157, 184, 106, 0.16);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--signal);
  color: var(--on-signal);
  font-weight: 700;
  padding: 0.7rem 1.1rem;
  text-decoration: none;
}

.skip-link:focus {
  left: 0.65rem;
  top: 0.65rem;
  border-radius: var(--radius-sm);
}

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.skip-link,
.command-header,
.workorder-bar,
.stage-bar,
.blueprint-scroll-cue,
.svg-wrap,
.lab-footer,
.spotlight-callout {
  --focus-ring: var(--signal);
}

.svg-wrap:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: -3px;
}

.eyebrow {
  margin: 0 0 0.2rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow-spaced {
  margin-top: 0.65rem;
}

.eyebrow-signal {
  color: var(--action);
}

.command-header .eyebrow-signal,
.workorder-bar .eyebrow-signal {
  color: var(--signal);
}

.muted {
  margin: 0.25rem 0;
  font-size: 0.84rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Compact Command Header & 6-Step Strip
   -------------------------------------------------------------------------- */

.command-header {
  background: var(--command);
  color: var(--command-text);
  border-bottom: 2px solid var(--command-line);
}

.header-bar {
  max-width: 1760px;
  margin: 0 auto;
  padding: 0.45rem 0.9rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  border-bottom: 1px solid var(--command-line);
}

.brand-lockup {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.brand-mark {
  height: 28px;
  width: auto;
  max-width: 100%;
  display: block;
  flex-shrink: 0;
  object-fit: contain;
}

.brand-wordmark {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  color: var(--command-text);
  line-height: 1;
}

.brand-divider {
  font-family: var(--font-mono);
  color: var(--command-muted);
}

.header-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--command-text);
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.step-strip {
  max-width: 1760px;
  margin: 0 auto;
  padding: 0.42rem 0.9rem;
}

.step-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 0.38rem;
}

.step-pill {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.5rem;
  border: 1px solid var(--command-line);
  border-radius: var(--radius-sm);
  background: var(--command-raised);
  color: var(--command-text);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.step-pill:hover:not(:disabled) {
  border-color: var(--signal);
}

.step-pill:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.step-pill.is-current {
  border-color: var(--signal);
  box-shadow: inset 0 0 0 1px var(--signal);
}

.step-num {
  width: 1.32rem;
  height: 1.32rem;
  border-radius: 50%;
  background: var(--command-line);
  color: var(--command-text);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-pill.is-current .step-num {
  background: var(--signal);
  color: var(--on-signal);
}

.step-pill.is-done .step-num {
  background: #9DB86A;
  color: #12150E;
}

.workorder-bar {
  background: var(--command-raised);
  border-bottom: 1px solid var(--command-line);
  color: var(--command-text);
}

.workorder-inner {
  max-width: 1760px;
  margin: 0 auto;
  padding: 0.45rem 0.9rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  font-size: 0.8rem;
}

.workorder-inner .eyebrow { margin: 0; }
.wo-chip code { background: rgba(240, 140, 60, 0.16); color: var(--command-text); }

/* --------------------------------------------------------------------------
   Buttons & Inputs
   -------------------------------------------------------------------------- */

.btn-primary,
.btn-secondary,
.btn-cmd,
.btn-signal,
.seg-btn {
  min-height: 36px;
  padding: 0.36rem 0.72rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.81rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.btn-sm { min-height: 34px; padding: 0.28rem 0.62rem; font-size: 0.78rem; }
.full-btn { width: 100%; margin-top: 0.5rem; }

.btn-primary { background: var(--action); color: var(--on-action); }
.btn-primary:hover:not(:disabled) { background: var(--action-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary { background: var(--surface-raised); color: var(--text); border-color: var(--line); }
.btn-secondary:hover:not(:disabled) { border-color: var(--accent); }
.btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-cmd { background: var(--command-raised); color: var(--command-text); border-color: var(--command-line); }
.btn-cmd:hover { border-color: var(--signal); }

.btn-signal { background: var(--signal); color: var(--on-signal); }
.btn-signal:hover { background: var(--signal-hover); }

.segmented {
  display: inline-flex;
  border-radius: var(--radius-sm);
  overflow: visible;
  border: 1px solid var(--line);
}

.seg-btn { border: 0; border-radius: 0; background: var(--surface-raised); color: var(--text); min-height: 34px; padding: 0.28rem 0.6rem; }
.seg-btn:first-child { border-top-left-radius: calc(var(--radius-sm) - 1px); border-bottom-left-radius: calc(var(--radius-sm) - 1px); }
.seg-btn:last-child { border-top-right-radius: calc(var(--radius-sm) - 1px); border-bottom-right-radius: calc(var(--radius-sm) - 1px); }
.seg-btn:focus-visible { position: relative; z-index: 2; }
.seg-btn + .seg-btn { border-left: 1px solid var(--line); }
.seg-btn.is-active { background: var(--command); color: var(--command-text); }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.4rem; }

/* --------------------------------------------------------------------------
   Main Grid Shell (1280x800 first-screen fit, 390px zero scroll)
   -------------------------------------------------------------------------- */

.sim-grid {
  max-width: 1760px;
  margin: 0 auto;
  padding: 0.6rem 0.85rem 0.85rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.7rem;
  align-items: start;
}

.main-column {
  order: -1;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: 0;
  max-width: 100%;
}

.left-rail {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: 0;
  max-width: 100%;
}

@media (min-width: 1024px) {
  .sim-grid { grid-template-columns: 304px minmax(0, 1fr); }
  .main-column { order: 0; }
}

@media (min-width: 1400px) {
  .sim-grid { grid-template-columns: 312px minmax(0, 1fr); }
}

@media (min-width: 1680px) {
  .sim-grid { grid-template-columns: 320px minmax(0, 1fr); }
}

.panel-card,
.canvas-stage,
.blueprint-frame,
.svg-wrap,
.device-drawer,
.drawer-pane,
.portal-pane,
.event-table-wrap,
.inspector-pane {
  min-width: 0;
  max-width: 100%;
}

.panel-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.75rem;
}

.panel-title { margin: 0; font-size: 0.96rem; line-height: 1.2; }

/* --------------------------------------------------------------------------
   Left Rail: Checklist + Router Label Card
   -------------------------------------------------------------------------- */

.checklist-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.42rem;
  margin-bottom: 0.4rem;
}

.step-goal { margin: 0 0 0.55rem; font-size: 0.81rem; color: var(--text-muted); }

.hint-box {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  color: var(--warn-text);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.6rem;
  margin-bottom: 0.55rem;
  font-size: 0.79rem;
}

.hint-box ol { margin: 0.2rem 0 0; padding-left: 1.15rem; }

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.36rem;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 0.42rem;
  font-size: 0.79rem;
  padding: 0.36rem 0.46rem;
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  border: 1px solid var(--line);
}

.check-item.is-done { background: var(--ok-bg); border-color: var(--ok-border); color: var(--ok-text); }
.check-mark { font-family: var(--font-mono); font-weight: 700; flex-shrink: 0; }
.step-next-wrap { margin-top: 0.6rem; }
.step-next-wrap .btn-primary { width: 100%; }

.complete-box {
  background: var(--ok-bg);
  border: 1px solid var(--ok-border);
  color: var(--ok-text);
  border-radius: var(--radius-sm);
  padding: 0.6rem;
  font-size: 0.8rem;
}

.complete-box p { margin: 0.15rem 0 0.45rem; }
.fault-replay-controls { display: flex; flex-direction: column; gap: 0.38rem; }

.sticker-kv {
  margin: 0.45rem 0 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.25rem 0.55rem;
  font-size: 0.78rem;
}

.sticker-kv dt { color: var(--text-muted); font-weight: 600; }
.sticker-kv dd { margin: 0; text-align: right; }
.sticker-kv .sticker-label-full { grid-column: 1 / -1; }
.sticker-kv .sticker-value-full { grid-column: 1 / -1; text-align: left; }
.nowrap-code { white-space: nowrap; font-size: 0.78rem; }

/* --------------------------------------------------------------------------
   Blueprint Stage & SVG Art
   -------------------------------------------------------------------------- */

.canvas-stage {
  background: var(--command);
  border: 1px solid var(--command-line);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--command-text);
}

.stage-bar {
  background: var(--command-raised);
  border-bottom: 1px solid var(--command-line);
  padding: 0.45rem 0.8rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.stage-bar-left { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.55rem; }
.stage-title { margin: 0; font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--command-text); }
.stage-status { font-size: 0.81rem; color: var(--signal-hover); font-weight: 600; }

.led-legend { display: flex; flex-wrap: wrap; gap: 0.65rem; font-family: var(--font-mono); font-size: 0.71rem; color: var(--command-muted); }
.legend-item { display: inline-flex; align-items: center; gap: 0.3rem; }
.led-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.led-green { background: #9DB86A; }
.led-amber { background: #F0B43C; }
.led-red { background: #E5534B; }

.canvas-toast { padding: 0.42rem 0.8rem; font-size: 0.81rem; border-bottom: 1px solid var(--command-line); }
.canvas-toast.is-ok { background: #202C16; color: #D7E8B6; }
.canvas-toast.is-error { background: #3A1915; color: #FFD5CC; }
.canvas-toast.is-info { background: #252E1C; color: #FCDCB8; }

.blueprint-frame {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.svg-wrap { position: relative; background: #12150E; }

.blueprint-svg {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
}

@media (min-width: 1024px) {
  .blueprint-svg {
    max-height: clamp(420px, calc(100vh - 255px), 760px);
  }
}

.bp-coord { fill: #7B8E69; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.08em; }
.wall-text { fill: #B7C1A6; font-family: var(--font-mono); font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; }

/* Animated Wi-Fi Radio Rings (lightweight opacity/stroke pulse; static on reduced motion) */
.radio-ring {
  fill: none;
  stroke: #9DB86A;
  stroke-width: 1.4;
  stroke-dasharray: 6 6;
  opacity: 0.24;
  animation: radio-pulse 3.2s ease-in-out infinite;
}
.radio-ring.ring-2 { animation-delay: 0.9s; opacity: 0.18; }
.radio-ring.ring-3 { animation-delay: 1.8s; opacity: 0.12; }

.cable-wired { fill: none; stroke: #9DB86A; stroke-width: 3.4; stroke-linecap: round; }
.link-wifi { fill: none; stroke: #9DB86A; stroke-width: 2.6; stroke-dasharray: 6 5; stroke-linecap: round; }
.link-wifi.is-idle { stroke: #445237; opacity: 0.55; }
.link-probe { fill: none; stroke: #E5534B; stroke-width: 2.6; stroke-dasharray: 5 5; stroke-linecap: round; }
.link-probe.is-hidden-probe { opacity: 0; }
.link-probe.is-blocked { stroke: #9DB86A; }

.port-label { fill: #C7D1B8; font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; }

.led-halo { pointer-events: none; opacity: 0.34; }
.led-halo.is-up { fill: #9DB86A; }
.link-led { stroke: #12150E; stroke-width: 1.4; }
.link-led.is-up { fill: #9DB86A; }

.device-node { cursor: pointer; outline: none; }
.device-node.is-dormant { opacity: 1; }
.device-node.is-dormant .device-card-outside {
  fill: #181C15;
  stroke: #8A9382;
  stroke-width: 1.8;
  stroke-dasharray: 6 4;
}
.device-node.is-dormant rect[stroke],
.device-node.is-dormant line[stroke] { stroke: #8A9382; }
.device-node.is-dormant polygon { fill: #4A5244; }
.device-node.is-dormant .device-name,
.device-node.is-dormant .ip-pill-text { fill: #A9B2A0; }
.device-node.is-dormant .ip-pill { fill: #161A12; stroke: #7E8776; stroke-dasharray: 4 3; }
.device-card { stroke: #4A5A3A; stroke-width: 1.6; }
.device-card-outside { stroke: #914B40; stroke-width: 1.6; }
.device-node:hover .device-card,
.device-node.is-selected .device-card { stroke: #F08C3C; stroke-width: 2.4; }
.device-node:focus-visible .device-card,
.device-node.is-dormant:focus-visible .device-card-outside { stroke: var(--focus-ring); stroke-width: 3; stroke-dasharray: none; }

.device-name { fill: #EEF1E6; font-family: var(--font-body); font-size: 13.5px; font-weight: 700; }
.chassis-micro { fill: #B7C1A6; font-family: var(--font-mono); font-size: 11.5px; }

.ip-pill { fill: #1D2615; stroke: #4A5A3A; stroke-width: 1.2; }
.ip-pill.is-ok { stroke: #9DB86A; }
.ip-pill.is-signal { stroke: #F08C3C; }
.ip-pill.is-warn { stroke: #E5534B; fill: #351814; }
.ip-pill-text { fill: #E8ECDD; font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; }

.hop-glow { fill: none; stroke: transparent; stroke-width: 3.5; pointer-events: none; }
.hop-glow.is-orange { stroke: #F08C3C; fill: rgba(240, 140, 60, 0.13); }
.hop-glow.is-olive { stroke: #9DB86A; fill: rgba(157, 184, 106, 0.13); }
.hop-glow.is-red { stroke: #E5534B; fill: rgba(229, 83, 75, 0.16); }

.packet-token { pointer-events: none; }
.packet-token.is-orange .pkt-bg { fill: #F08C3C; stroke: #161A11; stroke-width: 1.4; }
.packet-token.is-orange .pkt-flap { stroke: #161A11; }
.packet-token.is-orange .pkt-pill-bg { fill: #251B10; stroke: #F08C3C; stroke-width: 1.2; }
.packet-token.is-olive .pkt-bg { fill: #9DB86A; stroke: #161A11; stroke-width: 1.4; }
.packet-token.is-olive .pkt-flap { stroke: #161A11; }
.packet-token.is-olive .pkt-pill-bg { fill: #1A2413; stroke: #9DB86A; stroke-width: 1.2; }
.packet-token.is-red .pkt-bg { fill: #E5534B; stroke: #161A11; stroke-width: 1.4; }
.packet-token.is-red .pkt-flap { stroke: #FFFFFF; }
.packet-token.is-red .pkt-pill-bg { fill: #3C1614; stroke: #E5534B; stroke-width: 1.2; }
.pkt-pill-text { fill: #EEF1E6; font-family: var(--font-mono); font-size: 11.5px; font-weight: 700; }

.audit-icon-text { fill: #FFFFFF; font-family: var(--font-mono); font-size: 13px; font-weight: 700; }
.audit-pill-text { fill: #EEF1E6; font-family: var(--font-mono); font-size: 11.5px; font-weight: 700; }

/* --------------------------------------------------------------------------
   Device / Router Portal Drawer (Docked desktop >=960px; Bottom Sheet <=959px)
   -------------------------------------------------------------------------- */

.drawer-backdrop { position: fixed; inset: 0; background: rgba(10, 12, 8, 0.58); z-index: 50; }

.device-drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  max-height: 80vh;
  overflow-y: auto;
  background: var(--surface);
  color: var(--text);
  border-top: 3px solid var(--signal);
  border-radius: 14px 14px 0 0;
  padding: 0.65rem 0.85rem 1rem;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.45);
}

.sheet-handle { width: 42px; height: 4px; border-radius: 99px; background: var(--line); margin: 0 auto 0.55rem; }

@media (min-width: 1024px) {
  .drawer-backdrop { display: none !important; }
  .sheet-handle { display: none; }
  .device-drawer {
    position: static;
    width: 100%;
    max-height: none;
    overflow-y: visible;
    border-top: 2px solid var(--signal);
    border-left: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0.72rem 0.9rem 0.85rem;
  }
  .device-drawer.is-expanded {
    min-height: 420px;
  }
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-bottom: 0.48rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.6rem;
}

.drawer-head-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.sim-collapsed-summary {
  margin: 0;
  padding: 0.45rem 0.78rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-title { margin: 0; font-size: 0.95rem; }
.portal-lead { margin: 0 0 0.55rem; font-size: 0.82rem; color: var(--text-muted); }

.portal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.65rem;
}

.tab-btn {
  min-height: 32px;
  padding: 0.24rem 0.52rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.tab-btn.is-active { background: var(--command); color: var(--command-text); border-color: var(--signal); }

.field-wrap { display: flex; flex-direction: column; gap: 0.18rem; font-size: 0.76rem; font-weight: 600; margin-bottom: 0.48rem; }
.field-note { margin: -0.2rem 0 0.5rem; font-size: 0.74rem; color: var(--text-muted); }
.btn-row ~ .field-note { margin-top: 0.55rem; } /* under buttons or a message box, not under its own field */

.text-input,
.select-input,
.select-sm {
  width: 100%;
  min-height: 35px;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.82rem;
}

.mono-input { font-family: var(--font-mono); }

.check-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  cursor: pointer;
}

.check-row input { accent-color: var(--action); width: 1rem; height: 1rem; }

.sub-box {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.55rem;
  margin-bottom: 0.5rem;
}

.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem; }

.strength-list { list-style: none; margin: 0.3rem 0 0.5rem; padding: 0; font-size: 0.76rem; color: var(--text-muted); }
.strength-list li.is-ok { color: var(--accent); font-weight: 600; }

.mini-kv { margin: 0 0 0.5rem; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.25rem 0.65rem; font-size: 0.8rem; }
.mini-kv dt { color: var(--text-muted); font-weight: 600; }
.mini-kv dd { margin: 0; font-family: var(--font-mono); font-weight: 600; }

.progress-wrap { margin-top: 0.55rem; }
.progress-track { width: 100%; height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; margin-bottom: 0.25rem; }
.progress-fill { height: 100%; width: 0%; background: var(--action); transition: width 0.15s linear; }

.client-list,
.pf-list {
  list-style: none;
  margin: 0.3rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  font-size: 0.76rem;
}

.client-list li,
.pf-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  font-family: var(--font-mono);
}

.feedback-box {
  margin-top: 0.55rem;
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  font-size: 0.79rem;
}

.feedback-box p { margin: 0.12rem 0; }
.feedback-box ul { margin: 0.2rem 0 0; padding-left: 1.1rem; }
.feedback-box.is-ok { background: var(--ok-bg); border-color: var(--ok-border); color: var(--ok-text); }
.feedback-box.is-error { background: var(--err-bg); border-color: var(--err-border); color: var(--err-text); }
.feedback-box.is-warn,
.feedback-box.is-info { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn-text); }

/* --------------------------------------------------------------------------
   Docked Simulation Panel
   -------------------------------------------------------------------------- */

.sim-panel { padding: 0; overflow: hidden; }

.sim-bar {
  background: var(--surface-raised);
  border-bottom: 1px solid var(--line);
  padding: 0.46rem 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}

.sim-bar-left { display: flex; flex-wrap: wrap; align-items: center; gap: 0.48rem; }
.sim-bar-left .eyebrow { margin: 0; }
.sim-title { margin: 0; font-size: 0.9rem; }
.sim-pill { font-family: var(--font-mono); font-size: 0.67rem; font-weight: 700; padding: 0.12rem 0.45rem; border-radius: 999px; background: var(--command); color: var(--signal); }
.sim-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }

.sim-body-grid { display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) {
  .sim-body-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
}

.event-table-wrap {
  overflow-x: auto;
  max-height: 192px;
  overflow-y: auto;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 960px) {
  .event-table-wrap { border-bottom: 0; border-right: 1px solid var(--line); }
}

.event-table { width: 100%; border-collapse: collapse; font-size: 0.79rem; }
.event-table th {
  text-align: left;
  padding: 0.4rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.67rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface-raised);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
}

.event-row { border-bottom: 1px solid var(--line); cursor: pointer; }
.event-row:hover { background: rgba(157, 184, 106, 0.1); }
.event-row.is-active { background: var(--ok-bg); box-shadow: inset 3px 0 0 var(--action); }
.event-row td { padding: 0.38rem 0.55rem; }
.event-row-btn { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; width: 100%; }
.event-time { font-family: var(--font-mono); white-space: nowrap; color: var(--text-muted); }

.type-tag { display: inline-block; font-family: var(--font-mono); font-size: 0.67rem; font-weight: 700; padding: 0.1rem 0.4rem; border-radius: 999px; }
.type-tag.is-ok { background: var(--ok-bg); color: var(--ok-text); border: 1px solid var(--ok-border); }
.type-tag.is-warn { background: var(--warn-bg); color: var(--warn-text); border: 1px solid var(--warn-border); }
.type-tag.is-err { background: var(--err-bg); color: var(--err-text); border: 1px solid var(--err-border); }

.inspector-pane { padding: 0.58rem 0.72rem; max-height: 192px; overflow-y: auto; }
.inspector-title { margin: 0 0 0.42rem; font-size: 0.85rem; }

.pdu-layer {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  padding: 0.42rem 0.52rem;
  margin-bottom: 0.42rem;
}

.pdu-layer-title { margin: 0 0 0.25rem; font-family: var(--font-mono); font-size: 0.67rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.pdu-row { padding: 0.18rem 0; border-top: 1px solid var(--line); font-size: 0.76rem; }
.pdu-row:first-of-type { border-top: 0; padding-top: 0; }
.pdu-field { display: block; font-family: var(--font-mono); font-weight: 600; }
.pdu-plain { display: block; color: var(--text-muted); font-size: 0.73rem; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.lab-footer {
  background: var(--command);
  color: var(--command-muted);
  border-top: 2px solid var(--command-line);
  padding: 0.8rem 0.9rem;
  font-size: 0.8rem;
}

.footer-inner {
  max-width: 1760px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.1rem;
}

.footer-logo {
  height: 80px;
  width: auto;
  max-width: 100%;
  display: block;
  flex-shrink: 0;
  object-fit: contain;
}

.footer-copy {
  flex: 1 1 240px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.footer-brand { margin: 0; font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.08em; color: var(--command-text); }
.footer-follow { margin: 0; color: var(--command-text); text-wrap: pretty; }
.footer-follow a { color: var(--signal); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.footer-follow a:hover { color: var(--signal-hover); }
.footer-follow a:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; border-radius: 2px; }
.footer-legal { margin: 0; }

@keyframes radio-pulse {
  0%, 100% { opacity: 0.28; }
  50% { opacity: 0.08; }
}

/* --------------------------------------------------------------------------
   "Show me" Guided Spotlight & Help Counter (CSP-safe CSSOM positioning)
   -------------------------------------------------------------------------- */

.checklist-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.help-usage {
  margin: 0.5rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.spot-shade {
  position: fixed;
  z-index: 75;
  background: rgba(10, 12, 8, 0.72);
}

.spotlight-ring {
  position: fixed;
  z-index: 80;
  pointer-events: none;
  border: 2.5px solid var(--signal);
  border-radius: 8px;
  box-shadow: 0 0 0 2px rgba(240, 140, 60, 0.38);
  animation: spot-pulse 1.5s ease-in-out infinite;
}

.spotlight-callout {
  position: fixed;
  z-index: 90;
  width: min(300px, calc(100vw - 1.5rem));
  max-width: calc(100vw - 1.25rem);
  background: var(--command);
  color: var(--command-text);
  border: 2px solid var(--signal);
  border-radius: var(--radius);
  padding: 0.7rem 0.8rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.58);
}

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

.spotlight-callout .eyebrow-signal {
  color: var(--signal);
  margin: 0;
}

.spotlight-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--command-muted);
}

.spotlight-text {
  margin: 0 0 0.65rem;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--command-text);
}

.spotlight-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
}

@keyframes spot-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(240, 140, 60, 0.42); }
  50% { box-shadow: 0 0 0 6px rgba(240, 140, 60, 0.16); }
}

.blueprint-scroll-cue {
  display: none;
}

.scroll-cue-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--command-muted);
}

.scroll-cue-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.scroll-cue-btn {
  font-size: 1.25rem;
  line-height: 1;
  padding: 0;
}

@media (max-width: 1023px) {
  /* Phone reading order: Step (title, Hint, Show me) -> Blueprint -> Router Label & Open Portal -> Simulation */
  .left-rail,
  .main-column {
    display: contents;
  }

  .checklist-card { order: 1; }
  .canvas-stage   { order: 2; }
  .sticker-card   { order: 3; }
  .sim-panel      { order: 4; }

  .blueprint-scroll-cue {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.35rem 0.65rem;
    background: var(--command-raised);
    border-bottom: 1px solid var(--command-line);
    color: var(--command-text);
  }

  .svg-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-color: var(--signal) var(--command);
    scrollbar-width: thin;
  }

  /* Keep blueprint readable (>= 11px on-canvas text) inside its own scrollable frame */
  .blueprint-svg {
    width: 900px;
    min-width: 900px;
    height: 468px;
    max-height: none;
  }

  /* >= 44x44 CSS px touch targets for every interactive phone control */
  .btn-primary,
  .btn-secondary,
  .btn-cmd,
  .btn-signal,
  .seg-btn,
  .btn-sm,
  .tab-btn,
  .step-pill,
  .scroll-cue-btn {
    min-height: 44px;
    min-width: 44px;
  }

  .text-input,
  .select-input,
  .select-sm {
    min-height: 44px;
    font-size: 16px;
  }

  .check-row,
  .event-row-btn {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .radio-ring { animation: none; opacity: 0.18; }
  .progress-fill { transition: none; }
  .spotlight-ring { animation: none; }
}
