/**
 * Telematric Pre-Silicon Hardware Simulator & Digital Twin Studio
 * Standalone Theme & Component Styles
 */

:root {
  --bg-app: #080C14;
  --bg-card: #0F172A;
  --bg-card-hover: #162036;
  --bg-card-subtle: #1E293B;
  --border-subtle: rgba(148, 163, 184, 0.12);
  --border-focus: rgba(14, 165, 233, 0.5);
  
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  
  --brand-cyan: #0EA5E9;
  --brand-cyan-glow: rgba(14, 165, 233, 0.25);
  --brand-cyan-light: #38BDF8;
  
  --status-emerald: #10B981;
  --status-emerald-glow: rgba(16, 185, 129, 0.25);
  --status-amber: #F59E0B;
  --status-amber-glow: rgba(245, 158, 11, 0.25);
  --status-rose: #EF4444;
  --status-rose-glow: rgba(239, 68, 68, 0.25);
  --status-violet: #8B5CF6;
  
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
}

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

body {
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Header & Top Bar */
.app-header {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: #fff;
  text-decoration: none;
}

.brand-badge svg {
  color: var(--brand-cyan);
}

.simulator-tag {
  background: rgba(14, 165, 233, 0.15);
  color: var(--brand-cyan-light);
  border: 1px solid rgba(14, 165, 233, 0.3);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Tab Navigation */
.nav-tabs {
  display: flex;
  gap: 0.25rem;
  background: var(--bg-card);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.tab-btn {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  background: var(--brand-cyan);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px var(--brand-cyan-glow);
}

/* Mode & Status Badges */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-mono);
}

.status-pill.online {
  background: rgba(16, 185, 129, 0.12);
  color: var(--status-emerald);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.status-pill.paused {
  background: rgba(245, 158, 11, 0.12);
  color: var(--status-amber);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.status-pill.standby {
  background: rgba(14, 165, 233, 0.12);
  color: var(--brand-cyan-light);
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.status-pill.fault {
  background: rgba(239, 68, 68, 0.12);
  color: var(--status-rose);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.status-pill.offline {
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-secondary);
  border: 1px solid rgba(100, 116, 139, 0.25);
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
  animation: pulse-anim 1.8s infinite;
}

@keyframes pulse-anim {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1); }
}

/* Master Controls */
.engine-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn {
  background: var(--bg-card-subtle);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}

.btn:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-primary {
  background: var(--brand-cyan);
  border-color: var(--brand-cyan);
  color: #fff;
}

.btn-primary:hover {
  background: var(--brand-cyan-light);
  border-color: var(--brand-cyan-light);
  box-shadow: 0 2px 10px var(--brand-cyan-glow);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #FCA5A5;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: var(--status-rose);
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

/* Main Workspace Container */
.workspace-container {
  flex: 1;
  padding: 1.25rem;
  max-width: 1680px;
  width: 100%;
  margin: 0 auto;
}

/* Tab Panels */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Grid Layout for Cockpit */
.cockpit-grid {
  display: grid;
  grid-template-columns: 320px 1fr 380px;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 1300px) {
  .cockpit-grid {
    grid-template-columns: 300px 1fr;
  }
  .telemetry-column {
    grid-column: span 2;
  }
}

@media (max-width: 860px) {
  .cockpit-grid {
    grid-template-columns: 1fr;
  }
  .telemetry-column {
    grid-column: span 1;
  }
}

/* Cards & Surfaces */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  box-shadow: var(--shadow-card);
  margin-bottom: 1.15rem;
}

.card:last-child {
  margin-bottom: 0;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border-subtle);
}

.card-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card-title svg {
  color: var(--brand-cyan);
}

/* Inputs & Form Elements */
.form-group {
  margin-bottom: 0.85rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.form-control {
  width: 100%;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.45rem 0.65rem;
  font-size: 0.82rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}

.form-control:focus {
  border-color: var(--brand-cyan);
  box-shadow: 0 0 0 2px var(--brand-cyan-glow);
}

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

select.form-control {
  cursor: pointer;
}

/* Slider Controls */
.slider-container {
  margin-bottom: 0.85rem;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  margin-bottom: 0.25rem;
}

.slider-label {
  color: var(--text-secondary);
}

.slider-value {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--brand-cyan-light);
}

input[type="range"] {
  width: 100%;
  height: 6px;
  background: var(--bg-card-subtle);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--brand-cyan);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 0 8px var(--brand-cyan-glow);
  transition: transform 0.1s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* Toggle Switches */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.toggle-row:last-child {
  border-bottom: none;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--bg-card-subtle);
  transition: 0.2s;
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: var(--brand-cyan);
  border-color: var(--brand-cyan);
}

input:checked + .toggle-slider:before {
  transform: translateX(18px);
}

/* Circular Gauges and Metric Widgets */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.15rem;
}

.metric-tile {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.metric-tile::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--brand-cyan);
}

.metric-tile.warn::before {
  background: var(--status-amber);
}

.metric-tile.fault::before {
  background: var(--status-rose);
}

.metric-tile-title {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.metric-tile-value {
  font-size: 1.35rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #fff;
}

.metric-tile-unit {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  margin-left: 0.15rem;
  font-weight: 400;
}

/* Live Waveform Canvas */
.waveform-card {
  position: relative;
}

.chart-canvas {
  width: 100%;
  height: 220px;
  background: var(--bg-app);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  display: block;
}

/* Event & Telemetry Stream Log */
.log-container {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  height: 380px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-card-subtle) transparent;
}

.log-entry {
  padding: 0.35rem 0.45rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  line-height: 1.4;
  word-break: break-all;
}

.log-entry:last-child {
  border-bottom: none;
}

.log-time {
  color: var(--text-muted);
  margin-right: 0.4rem;
}

.log-tag {
  font-size: 0.7rem;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-weight: 600;
  margin-right: 0.4rem;
}

.log-tag.tx {
  background: rgba(14, 165, 233, 0.2);
  color: var(--brand-cyan-light);
}

.log-tag.ack {
  background: rgba(16, 185, 129, 0.2);
  color: var(--status-emerald);
}

.log-tag.err {
  background: rgba(239, 68, 68, 0.2);
  color: var(--status-rose);
}

.log-tag.buffer {
  background: rgba(245, 158, 11, 0.2);
  color: var(--status-amber);
}

/* Pre-Silicon Hardware Profiler Visualizer */
.profiler-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 1024px) {
  .profiler-grid {
    grid-template-columns: 1fr;
  }
}

.partition-bar {
  display: flex;
  height: 32px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 1rem 0 0.5rem;
  border: 1px solid var(--border-subtle);
}

.partition-segment {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
  white-space: nowrap;
  padding: 0 0.25rem;
  transition: width 0.3s ease;
}

.partition-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.5rem;
  font-size: 0.75rem;
  margin-top: 0.75rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-secondary);
}

.legend-color {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

/* Heap Gauge Meter */
.heap-meter-container {
  margin: 1rem 0;
}

.heap-meter-bar {
  height: 14px;
  background: var(--bg-app);
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  position: relative;
}

.heap-meter-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-cyan), var(--status-emerald));
  border-radius: 7px;
  transition: width 0.3s ease;
}

.heap-meter-fill.warn {
  background: linear-gradient(90deg, var(--status-amber), var(--status-rose));
}

/* Battery Projection Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin-top: 0.75rem;
}

.data-table th, .data-table td {
  padding: 0.5rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table th {
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.7rem;
}

.data-table td {
  color: var(--text-primary);
  font-family: var(--font-mono);
}

/* Code Snippet Box (Wokwi / C++) */
.code-box {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #E2E8F0;
  max-height: 480px;
  overflow: auto;
  position: relative;
  white-space: pre;
}

.copy-btn {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
}

/* Modal Window */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  width: 90%;
  max-width: 520px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  padding: 1.5rem;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.25rem;
}

.modal-close:hover {
  color: #fff;
}

.modal-footer {
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Ring Buffer Table */
.buffer-table-wrap {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-app);
}

/* Wokwi Virtual Hardware Workbench & Serial Monitor */
.wokwi-workbench-panel {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.workbench-circuit {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-around;
  flex-wrap: wrap;
}

.workbench-board-wrap {
  background: #0b1120;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 180px;
}

.workbench-controls-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
  min-width: 200px;
}

.workbench-component-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
}

.component-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  font-family: var(--font-mono);
}

.component-visual {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.badge-tag {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.badge-tag.active {
  background: rgba(14, 165, 233, 0.2);
  color: var(--brand-cyan-light);
  border-color: rgba(14, 165, 233, 0.4);
}

.badge-tag.danger {
  background: rgba(239, 68, 68, 0.2);
  color: var(--status-rose);
  border-color: rgba(239, 68, 68, 0.4);
}

.serial-console-wrap {
  flex: 1;
  min-height: 250px;
  max-height: 290px;
  overflow-y: auto;
  background: #050810;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.5;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  color: #e2e8f0;
}

.serial-line {
  margin-bottom: 0.2rem;
  word-break: break-all;
}

.serial-line.system {
  color: #64748b;
}

.serial-line.info {
  color: #38bdf8;
}

.serial-line.success {
  color: #10b981;
}

.serial-line.warn {
  color: #f59e0b;
}

.serial-line.error {
  color: #ef4444;
}

/* Custom Native Hardware Visuals (Zero CDN Dependencies) */
.hardware-led {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #0f172a;
  border: 2px solid #334155;
  transition: all 0.12s ease-in-out;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.7);
  display: inline-block;
}

.hardware-led.cyan {
  border-color: rgba(14, 165, 233, 0.4);
}

.hardware-led.cyan.active {
  background: #0ea5e9;
  border-color: #38bdf8;
  box-shadow: 0 0 16px #0ea5e9, 0 0 28px rgba(14, 165, 233, 0.8), inset 0 2px 3px rgba(255, 255, 255, 0.8);
}

.hardware-led.red {
  border-color: rgba(239, 68, 68, 0.4);
}

.hardware-led.red.active {
  background: #ef4444;
  border-color: #f87171;
  box-shadow: 0 0 16px #ef4444, 0 0 28px rgba(239, 68, 68, 0.8), inset 0 2px 3px rgba(255, 255, 255, 0.8);
}

.hardware-switch {
  width: 52px;
  height: 28px;
  background: #1e293b;
  border-radius: 14px;
  position: relative;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1.5px solid #475569;
  user-select: none;
  display: inline-block;
}

.hardware-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #94a3b8;
  border-radius: 50%;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.hardware-switch.active {
  background: #dc2626;
  border-color: #ef4444;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
}

.hardware-switch.active::after {
  transform: translateX(24px);
  background: #ffffff;
}

.hardware-switch:focus-visible {
  outline: 2px solid var(--brand-cyan);
  outline-offset: 2px;
}

/* Documentation Tab Styling */
#tab-docs h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 0.75rem;
  margin-bottom: 0.35rem;
}

#tab-docs table td, #tab-docs table th {
  border-color: var(--border-subtle);
}

#tab-docs .card {
  scroll-margin-top: 5.5rem;
}

/* Cockpit Setup & Standby Bar */
.setup-bar {
  background: rgba(14, 165, 233, 0.06);
  border: 1px solid rgba(14, 165, 233, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.15rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.setup-bar.standby {
  border-left: 4px solid var(--status-amber);
}

.setup-bar.running {
  background: rgba(16, 185, 129, 0.05);
  border-color: rgba(16, 185, 129, 0.25);
  border-left: 4px solid var(--status-emerald);
}

.setup-bar-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.setup-bar-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--status-amber);
  text-transform: uppercase;
}

.setup-bar.running .setup-bar-badge {
  color: var(--status-emerald);
}

.setup-bar-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.setup-bar-text strong {
  color: var(--text-primary);
}

.setup-bar-text kbd {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  padding: 0.1rem 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--brand-cyan);
}

/* Interactive Board & Silicon Package */
.interactive-chip {
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.2s ease;
}

.interactive-chip:hover {
  transform: scale(1.02);
  filter: drop-shadow(0 0 10px rgba(14, 165, 233, 0.5));
}

.interactive-chip:hover rect#chip-mcu-shield {
  stroke: var(--brand-cyan);
  stroke-width: 2px;
}

.interactive-chip:active {
  transform: scale(0.99);
}

.interactive-board-btn {
  cursor: pointer;
  transition: transform 0.1s ease;
}

.interactive-board-btn:hover {
  filter: brightness(1.25);
}

.interactive-board-btn:active,
.interactive-board-btn.pressed {
  transform: translateY(1.5px);
  filter: brightness(1.4);
}

/* Interactive Pin Testing & Multimeter Probe */
.interactive-pin {
  cursor: pointer;
  transition: all 0.15s ease;
}

.interactive-pin:hover {
  filter: drop-shadow(0 0 6px #F59E0B) brightness(1.35);
}

.interactive-pin.selected {
  stroke: #38BDF8 !important;
  stroke-width: 1.5px !important;
  filter: drop-shadow(0 0 8px #38BDF8) brightness(1.4);
}

.interactive-pin.active-tx {
  fill: #38BDF8 !important;
  filter: drop-shadow(0 0 6px #38BDF8);
}

.interactive-pin.active-fault {
  fill: #EF4444 !important;
  filter: drop-shadow(0 0 6px #EF4444);
}

.interactive-sensor {
  cursor: pointer;
  transition: all 0.15s ease;
}

.interactive-sensor:hover {
  filter: drop-shadow(0 0 8px #38BDF8) brightness(1.25);
}

/* Pin Tester HUD */
.pin-tester-hud {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-top: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.pin-tester-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.45rem;
}

.pin-tester-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.pin-probe-readout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.pin-readout-item {
  display: flex;
  flex-direction: column;
}

.pin-readout-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.pin-readout-value {
  font-size: 0.88rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--brand-cyan);
}

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

/* Board Switch Animations */
.board-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeInBoard 0.25s ease-in-out;
}

@keyframes fadeInBoard {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.az3166-oled-screen {
  background: #020617;
  border: 1px solid #1E293B;
  box-shadow: inset 0 0 8px rgba(56, 189, 248, 0.2);
}


