/* ==========================================================================
   PHM WORKBENCH — A BANCADA DIGITAL DO TÉCNICO DE INFORMÁTICA
   Design System Institucional Nobre com suporte a Claro, Sépia e Escuro
   Prof. Paulo Henrique Maciel · PHM Tech
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TOKENS DE CORES POR TEMA
   -------------------------------------------------------------------------- */

/* TEMA CLARO (LIGHT THEME) */
:root, [data-theme="light"] {
  --wb-bg: #f8fafc;
  --wb-surface: #ffffff;
  --wb-surface-card: #f1f5f9;
  --wb-surface-hover: #e2e8f0;
  --wb-border: #cbd5e1;
  --wb-border-light: rgba(0, 0, 0, 0.08);
  
  --wb-cyan: #0d9488;
  --wb-cyan-glow: rgba(13, 148, 136, 0.2);
  --wb-emerald: #059669;
  --wb-amber: #b45309;
  --wb-rose: #be123c;
  --wb-purple: #6d28d9;
  
  --wb-text: #0f172a;
  --wb-text-muted: #475569;
  --wb-text-dim: #64748b;
  --wb-code-bg: #0f172a;
  --wb-code-text: #2dd4bf;
  --wb-card-title: #0f172a;
}

/* TEMA SÉPIA */
[data-theme="sepia"] {
  --wb-bg: #fbf5e8;
  --wb-surface: #f4ecdc;
  --wb-surface-card: #ede3ce;
  --wb-surface-hover: #e3d6bc;
  --wb-border: #d4c5a9;
  --wb-border-light: rgba(60, 40, 23, 0.12);
  
  --wb-cyan: #b45309;
  --wb-cyan-glow: rgba(180, 83, 9, 0.2);
  --wb-emerald: #059669;
  --wb-amber: #b45309;
  --wb-rose: #be123c;
  --wb-purple: #6d28d9;
  
  --wb-text: #2c1d11;
  --wb-text-muted: #57402c;
  --wb-text-dim: #785c42;
  --wb-code-bg: #2d1f14;
  --wb-code-text: #fde68a;
  --wb-card-title: #2c1d11;
}

/* TEMA ESCURO (DARK / CYBER LAB) */
[data-theme="dark"] {
  --wb-bg: #060b17;
  --wb-surface: #0b1329;
  --wb-surface-card: #111c3a;
  --wb-surface-hover: #17264c;
  --wb-border: #1e293b;
  --wb-border-light: rgba(255, 255, 255, 0.08);
  
  --wb-cyan: #2dd4bf;
  --wb-cyan-glow: rgba(45, 212, 191, 0.25);
  --wb-emerald: #10b981;
  --wb-amber: #f59e0b;
  --wb-rose: #f43f5e;
  --wb-purple: #a855f7;
  
  --wb-text: #f8fafc;
  --wb-text-muted: #94a3b8;
  --wb-text-dim: #64748b;
  --wb-code-bg: #030712;
  --wb-code-text: #a5f3fc;
  --wb-card-title: #ffffff;
}

/* ==========================================================================
   HERO BANNER ELEGANTE
   ========================================================================== */
.wb-hero-banner {
  background: var(--wb-surface);
  border-bottom: 1px solid var(--wb-border);
  padding: 2.75rem 0 2.25rem 0;
  text-align: center;
}

.wb-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(13, 148, 136, 0.08);
  color: var(--wb-cyan);
  border: 1px solid rgba(13, 148, 136, 0.3);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm, 4px);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.85rem;
}

.wb-hero-title {
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  font-weight: 900;
  color: var(--wb-card-title);
  letter-spacing: -0.03em;
  margin-bottom: 0.6rem;
}

.wb-cyan-text {
  color: var(--wb-cyan);
}

.wb-hero-subtitle {
  color: var(--wb-text-muted);
  font-size: 1.05rem;
  max-width: 820px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ==========================================================================
   MENU DOS MÓDULOS (PILL BUTTONS SEM SCROLLBAR)
   ========================================================================== */
.wb-subnav-bar {
  background: var(--wb-surface);
  border-bottom: 1px solid var(--wb-border);
  padding: 0.85rem 0;
  position: sticky;
  top: 60px;
  z-index: 900;
  backdrop-filter: blur(10px);
}

.wb-tabs-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
  overflow: visible;
}

.wb-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--wb-surface-card);
  border: 1px solid var(--wb-border);
  color: var(--wb-text);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-sm, 4px);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  user-select: none;
}

.wb-nav-btn:hover {
  background: var(--wb-surface-hover);
  color: var(--wb-cyan);
  border-color: var(--wb-cyan);
  transform: translateY(-1px);
}

.wb-nav-btn.active {
  background: var(--wb-cyan);
  border-color: var(--wb-cyan);
  color: #ffffff !important;
  box-shadow: 0 2px 8px var(--wb-cyan-glow);
}

/* ==========================================================================
   SEÇÕES DOS MÓDULOS
   ========================================================================== */
.wb-module-section {
  display: none;
  padding: 2.75rem 0 3.75rem 0;
}

.wb-module-section.active {
  display: block;
  animation: wbFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes wbFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.wb-section-title-box {
  margin-bottom: 2rem;
}

.wb-section-title-box h2 {
  font-size: 1.85rem;
  font-weight: 900;
  color: var(--wb-card-title);
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.wb-section-title-box p {
  color: var(--wb-text-muted);
  font-size: 0.96rem;
}

/* ==========================================================================
   ALERT BOX & BADGES
   ========================================================================== */
.wb-alert-box {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.95rem 1.25rem;
  border-radius: var(--radius-md, 6px);
  margin-bottom: 1.25rem;
  font-size: 0.86rem;
  line-height: 1.55;
}

.wb-alert-warning {
  background: rgba(217, 119, 6, 0.1);
  border: 1px solid rgba(217, 119, 6, 0.35);
  color: var(--wb-amber);
}

.wb-alert-info {
  background: rgba(13, 148, 136, 0.1);
  border: 1px solid rgba(13, 148, 136, 0.35);
  color: var(--wb-cyan);
}

.wb-alert-icon {
  flex-shrink: 0;
  margin-top: 1px;
}

.wb-badge-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--wb-cyan);
  background: rgba(13, 148, 136, 0.08);
  border: 1px solid rgba(13, 148, 136, 0.25);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm, 4px);
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.35rem !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  line-height: 1.2 !important;
}

/* ==========================================================================
   BOTÕES DE AÇÃO
   ========================================================================== */
.wb-btn-primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: var(--wb-cyan);
  color: #ffffff;
  border: 1px solid var(--wb-cyan);
  font-size: 0.88rem;
  font-weight: 800;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm, 4px);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px var(--wb-cyan-glow);
}

.wb-btn-primary-action:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.wb-btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--wb-surface-card);
  color: var(--wb-text);
  border: 1px solid var(--wb-border);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm, 4px);
  cursor: pointer;
  transition: all 0.2s ease;
}

.wb-btn-outline:hover {
  background: var(--wb-surface-hover);
  color: var(--wb-cyan);
  border-color: var(--wb-cyan);
  transform: translateY(-1px);
}

/* ==========================================================================
   MÓDULO 1: HARDWARE LAB CARDS
   ========================================================================== */
.wb-hardware-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
  gap: 1.5rem;
  min-width: 0;
}

.wb-tool-card {
  background: var(--wb-surface);
  border: 1px solid var(--wb-border);
  border-radius: var(--radius-md, 6px);
  padding: 1.65rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-width: 0;
  max-width: 100%;
}

.wb-tool-card:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.wb-tool-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.15rem;
}

.wb-tool-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--wb-card-title);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* TECLADO */
.kb-keyboard-layout {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: var(--wb-surface-card);
  border: 1px solid var(--wb-border);
  padding: 8px;
  border-radius: var(--radius-sm, 4px);
  margin-bottom: 1rem;
  overflow-x: auto;
}

.kb-row {
  display: flex;
  gap: 3px;
  width: 100%;
}

.kb-visual-matrix {
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  gap: 4px;
  background: var(--wb-surface-card);
  border: 1px solid var(--wb-border);
  padding: 10px;
  border-radius: var(--radius-sm, 4px);
  margin-bottom: 1rem;
}

.kb-key {
  flex: 1;
  min-width: 20px;
  height: 30px;
  background: var(--wb-surface);
  border: 1px solid var(--wb-border);
  border-radius: 4px;
  font-size: 0.64rem;
  font-weight: 600;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--wb-text-muted);
  user-select: none;
  transition: all 0.08s ease;
  padding: 0 2px;
  box-sizing: border-box;
}

.kb-key.w-1-2 { flex: 1.2; }
.kb-key.w-1-5 { flex: 1.5; }
.kb-key.w-1-8 { flex: 1.8; }
.kb-key.w-2   { flex: 2; }
.kb-key.w-2-2 { flex: 2.2; }
.kb-key.w-2-5 { flex: 2.5; }
.kb-key.w-space { flex: 5.5; }

.kb-key.active {
  background: var(--wb-cyan) !important;
  color: #ffffff !important;
  font-weight: 900;
  border-color: var(--wb-cyan);
}

.kb-key.pressed-history {
  background: rgba(5, 150, 105, 0.15);
  border-color: var(--wb-emerald);
  color: var(--wb-emerald);
}

.kb-history-pill {
  display: inline-block;
  background: var(--wb-surface);
  border: 1px solid var(--wb-border);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.76rem;
  margin: 2px;
  color: var(--wb-text);
  font-family: var(--font-mono);
}

/* MOUSE PAD */
.mouse-pad {
  height: 210px;
  background: var(--wb-surface-card);
  border: 2px dashed var(--wb-border);
  border-radius: var(--radius-md, 6px);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: crosshair;
  user-select: none;
}

.mouse-ripple {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(1);
  animation: mouseShockwave 0.6s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
  pointer-events: none;
}

.ripple-left {
  background: rgba(13, 148, 136, 0.6);
  border: 2px solid var(--teal, #0d9488);
  box-shadow: 0 0 20px var(--teal, #0d9488);
}

.ripple-right {
  background: rgba(217, 119, 6, 0.6);
  border: 2px solid #d97706;
  box-shadow: 0 0 20px #d97706;
}

.ripple-middle {
  background: rgba(124, 58, 237, 0.6);
  border: 2px solid #7c3aed;
  box-shadow: 0 0 20px #7c3aed;
}

@keyframes mouseShockwave {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(5.5); opacity: 0; }
}

.mouse-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.dot-left { background: var(--teal, #0d9488); box-shadow: 0 0 8px var(--teal, #0d9488); }
.dot-right { background: #d97706; box-shadow: 0 0 8px #d97706; }
.dot-middle { background: #7c3aed; box-shadow: 0 0 8px #7c3aed; }

/* DEAD PIXEL CARD */
.dead-pixel-center-card {
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(14px);
  padding: 1.85rem 3.25rem;
  border-radius: var(--radius-md, 6px);
  text-align: center;
  pointer-events: none;
  z-index: 10000000;
}

.dead-pixel-close-badge {
  position: fixed;
  top: 24px;
  right: 24px;
  background: rgba(0, 0, 0, 0.8);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 6px 14px;
  border-radius: var(--radius-sm, 4px);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  z-index: 10000001;
  display: inline-flex;
  align-items: center;
}

/* ==========================================================================
   MÓDULO 2: BSOD & BIPS CARDS
   ========================================================================== */
.wb-search-bar {
  background: var(--wb-surface);
  border: 1px solid var(--wb-border);
  border-radius: var(--radius-sm, 4px);
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.wb-search-input {
  background: transparent;
  border: none;
  color: var(--wb-text);
  font-size: 1rem;
  width: 100%;
  outline: none;
}

.wb-bsod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.5rem;
}

.wb-bsod-card {
  background: var(--wb-surface);
  border: 1px solid var(--wb-border);
  border-radius: var(--radius-md, 6px);
  padding: 1.65rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.wb-bsod-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.wb-bsod-code {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--wb-cyan);
}

.wb-bsod-hex {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--wb-text-dim);
}

.wb-bsod-component {
  font-size: 0.85rem;
  color: var(--wb-amber);
  margin-bottom: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.wb-bsod-desc {
  font-size: 0.9rem;
  color: var(--wb-text-muted);
  margin-bottom: 1rem;
  line-height: 1.55;
}

.wb-bsod-steps {
  background: var(--wb-surface-card);
  border: 1px solid var(--wb-border);
  padding: 1rem;
  border-radius: var(--radius-sm, 4px);
  font-size: 0.85rem;
  color: var(--wb-text);
}

.wb-bsod-steps ul {
  padding-left: 1.2rem;
  margin-top: 0.35rem;
}

/* TABELA DE BIPS */
.wb-table-wrap {
  overflow-x: auto;
  background: var(--wb-surface);
  border: 1px solid var(--wb-border);
  border-radius: var(--radius-md, 6px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.wb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.wb-table th, .wb-table td {
  padding: 1.05rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--wb-border);
  color: var(--wb-text);
}

.wb-table th {
  background: var(--wb-surface-card);
  color: var(--wb-text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wb-btn-play-beep {
  background: rgba(13, 148, 136, 0.1);
  border: 1px solid var(--wb-cyan);
  color: var(--wb-cyan);
  padding: 0.38rem 0.85rem;
  border-radius: var(--radius-sm, 4px);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}

.wb-btn-play-beep:hover {
  background: var(--wb-cyan);
  color: #ffffff;
}

/* CÓDIGOS DO WINDOWS UPDATE */
.wb-win-error-card {
  background: var(--wb-surface);
  border: 1px solid var(--wb-border);
  border-radius: var(--radius-md, 6px);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.wb-win-error-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
}

.wb-win-hex-badge {
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 1.05rem;
  color: var(--wb-cyan);
  background: rgba(13, 148, 136, 0.1);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm, 4px);
  border: 1px solid rgba(13, 148, 136, 0.25);
}

.wb-win-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--wb-amber);
  background: rgba(217, 119, 6, 0.1);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm, 4px);
}

.wb-win-error-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--wb-card-title);
  margin-bottom: 0.4rem;
  font-family: var(--font-mono);
}

.wb-win-error-desc {
  font-size: 0.86rem;
  color: var(--wb-text-muted);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.wb-win-solution-box {
  background: var(--wb-surface-card);
  border: 1px solid var(--wb-border);
  border-radius: var(--radius-sm, 4px);
  padding: 0.95rem;
  font-size: 0.84rem;
  color: var(--wb-text);
}

.wb-win-solution-title {
  font-weight: 800;
  color: var(--wb-cyan);
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.wb-win-quick-cmd {
  margin-top: 0.5rem;
  background: var(--wb-code-bg);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm, 4px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.wb-win-quick-cmd code {
  color: var(--wb-code-text);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  overflow-x: auto;
}

/* ==========================================================================
   MÓDULO 3: SCRIPTS & GERADOR DE .BAT
   ========================================================================== */
.wb-generator-card {
  background: var(--wb-surface);
  border: 1px solid var(--wb-border);
  border-radius: var(--radius-md, 6px);
  padding: 1.85rem;
  margin-bottom: 2.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.wb-checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  cursor: pointer;
  color: var(--wb-text);
  padding: 0.4rem 0.6rem;
  background: var(--wb-surface-card);
  border: 1px solid var(--wb-border);
  border-radius: var(--radius-sm, 4px);
  transition: border-color 0.15s ease;
}

.wb-checkbox-item:hover {
  border-color: var(--wb-cyan);
}

.wb-scripts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.5rem;
}

.wb-script-card {
  background: var(--wb-surface);
  border: 1px solid var(--wb-border);
  border-radius: var(--radius-md, 6px);
  padding: 1.65rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.wb-script-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.wb-script-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--wb-cyan);
  background: rgba(13, 148, 136, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm, 4px);
}

.wb-btn-copy {
  background: var(--wb-surface-hover);
  border: 1px solid var(--wb-border);
  color: var(--wb-text);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm, 4px);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.15s ease;
}

.wb-btn-copy.copied {
  background: var(--wb-emerald);
  color: #ffffff;
  border-color: var(--wb-emerald);
}

.wb-code-block {
  background: var(--wb-code-bg);
  padding: 1rem;
  border-radius: var(--radius-sm, 4px);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--wb-code-text);
  overflow-x: auto;
  margin-top: 0.75rem;
  border: 1px solid var(--wb-border);
}

/* ==========================================================================
   MÓDULO 4: DIAGNÓSTICO SINTOMÁTICO
   ========================================================================== */
.wb-diag-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.wb-diag-head h3 {
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0;
}

.wb-diag-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.88rem;
  color: var(--wb-text-muted);
}

.wb-diag-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  line-height: 1.45;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm, 4px);
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.wb-diag-item:hover {
  background: var(--wb-surface-hover);
  border-color: var(--wb-border);
}

.wb-diag-item:focus-visible {
  outline: 2px solid var(--wb-cyan);
  outline-offset: 1px;
}

.wb-diag-item.is-done {
  background: rgba(5, 150, 105, 0.08);
  border-color: rgba(5, 150, 105, 0.25);
}

.wb-diag-item.is-done .wb-diag-check-icon svg {
  color: var(--wb-emerald) !important;
}

.wb-diag-item.is-done .wb-diag-step-text {
  text-decoration: line-through;
  color: var(--wb-text-dim);
}

.wb-diag-check-icon {
  flex-shrink: 0;
  margin-top: 2px;
  display: flex;
  align-items: center;
  color: var(--wb-cyan);
}

.wb-diag-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.wb-diag-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm, 4px);
  background: var(--wb-surface-card);
  border: 1px solid var(--wb-border);
  color: var(--wb-text-muted);
  transition: all 0.2s ease;
}

.wb-diag-badge.all-done {
  background: rgba(5, 150, 105, 0.15);
  border-color: var(--wb-emerald);
  color: var(--wb-emerald);
}

.wb-btn-diag-reset {
  background: transparent;
  border: none;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--wb-text-dim);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.wb-btn-diag-reset:hover {
  color: var(--wb-rose);
  background: rgba(225, 29, 72, 0.08);
}

/* ==========================================================================
   MÓDULO 5: LAUDO EXPRESS
   ========================================================================== */
.wb-laudo-paper {
  background: #ffffff;
  color: #0f172a;
  padding: 3.25rem;
  border-radius: var(--radius-md, 6px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12);
  max-width: 900px;
  margin: 0 auto;
  border: 1px solid #cbd5e1;
}

.wb-laudo-header {
  border-bottom: 2px solid var(--teal, #0d9488);
  padding-bottom: 1.25rem;
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.wb-laudo-title {
  font-size: 1.6rem;
  font-weight: 900;
  color: #0f766e;
}

.wb-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.wb-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.wb-field-group label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #475569;
}

.wb-input-light {
  border: 1px solid #cbd5e1;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm, 4px);
  font-size: 0.92rem;
  font-family: inherit;
  line-height: 1.5;
  outline: none;
  background: #ffffff;
  color: #0f172a;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input.wb-input-light {
  height: 42px;
}

textarea.wb-input-light {
  min-height: 70px;
  resize: none;
  overflow-y: hidden;
  white-space: pre-wrap;
  word-break: break-word;
}

.wb-input-light:focus {
  border-color: var(--teal, #0d9488);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

/* ==========================================================================
   PINOUTS
   ========================================================================== */
.wb-pinout-card {
  background: var(--wb-surface);
  border: 1px solid var(--wb-border);
  border-radius: var(--radius-md, 6px);
  padding: 1.85rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.wb-pinout-card h3 {
  color: var(--wb-card-title);
  margin-bottom: 0.4rem;
  font-size: 1.2rem;
  font-weight: 800;
}

.wb-pinout-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.88rem;
}

.wb-pinout-table th, .wb-pinout-table td {
  padding: 0.75rem 0.95rem;
  border-bottom: 1px solid var(--wb-border);
  color: var(--wb-text);
}

.wb-pinout-table th {
  background: var(--wb-surface-card);
  color: var(--wb-text-muted);
}

.wb-pinout-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 1rem 0;
}

.wb-pinout-col-card {
  background: var(--wb-surface-card);
  border: 1px solid var(--wb-border);
  padding: 1.15rem;
  border-radius: var(--radius-md, 6px);
  color: var(--wb-text);
}

.wb-pinout-notes {
  background: rgba(217, 119, 6, 0.1);
  border-left: 3px solid var(--wb-amber);
  padding: 0.85rem 1.15rem;
  border-radius: 0 var(--radius-sm, 4px) var(--radius-sm, 4px) 0;
  color: var(--wb-amber);
  font-size: 0.86rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* IMPRESSÃO */

@media (max-width: 768px) {
  .wb-hero-title { font-size: 1.8rem; }
  .wb-tabs-grid { justify-content: flex-start; }
  .wb-nav-btn { flex: 1 1 calc(50% - 0.55rem); justify-content: center; font-size: 0.8rem; padding: 0.5rem; }
  .wb-form-grid, .wb-pinout-columns { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .header-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .header-actions > *,
  .btn-header-action,
  .nav-pref-trigger {
    min-width: 0;
    width: 100%;
  }

  .wb-hardware-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .wb-tool-card {
    padding: 1rem;
  }

  .wb-tool-header {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.65rem;
  }

  .kb-visual-matrix {
    grid-template-columns: repeat(14, minmax(0, 1fr));
    gap: 2px;
    padding: 6px;
  }
}

/* ==========================================================================
   ASSINATURAS ESPAÇOSAS DO LAUDO EXPRESS
   ========================================================================== */
.wb-signatures-container {
  margin-top: 4.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
  text-align: center;
}

.wb-signature-box {
  display: flex;
  flex-direction: column;
}

.wb-signature-space {
  height: 65px;
}

.wb-signature-line {
  border-top: 1.5px solid #64748b;
  padding-top: 0.6rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #334155;
}

/* ==========================================================================
   AJUSTES CRÍTICOS DE IMPRESSÃO / SALVAR EM PDF (SEM CORTES DE TEXTO)
   ========================================================================== */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .site-header, .app-header, .site-footer, .wb-hero-banner, .wb-subnav-bar, .wb-no-print, .btn-back-to-top {
    display: none !important;
  }
  .wb-laudo-paper {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  .wb-module-section {
    display: none !important;
  }
  #sec-laudo {
    display: block !important;
  }
  /* Garante que campos de texto grandes expandam 100% sem barras de rolagem ou cortes */
  .wb-input-light, textarea.wb-input-light {
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    color: #0f172a !important;
    font-size: 10.5pt !important;
    line-height: 1.45 !important;
    height: auto !important;
    min-height: 50px !important;
    overflow: visible !important;
    resize: none !important;
    white-space: pre-wrap !important;
    word-break: break-word !important;
    display: block !important;
    width: 100% !important;
  }
  .wb-signatures-container {
    margin-top: 3.5rem !important;
    page-break-inside: avoid !important;
  }
  .wb-signature-space {
    height: 70px !important;
  }
}
/* ==========================================================================
   ESTILOS DE ESPELHO DE IMPRESSÃO / PDF PERFEITO
   ========================================================================== */
.wb-print-only {
  display: none !important;
}

@media print {
  body {
    background: #ffffff !important;
    color: #0f172a !important;
    font-size: 10pt !important;
  }
  .site-header, .app-header, .site-footer, .wb-hero-banner, .wb-subnav-bar, .wb-no-print, .btn-back-to-top {
    display: none !important;
  }
  .wb-laudo-paper {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
  }
  .wb-module-section {
    display: none !important;
  }
  #sec-laudo {
    display: block !important;
  }
  
  /* Oculta inputs e textareas do navegador que causam scrollbars fixas */
  .wb-screen-only, input.wb-input-light, textarea.wb-input-light {
    display: none !important;
  }
  
  /* Exibe os blocos espelho que expandem naturalmente 100% do texto */
  .wb-print-only {
    display: block !important;
  }
  .wb-print-inline, strong.wb-print-only, span.wb-print-only {
    display: inline-block !important;
  }
  
  .wb-print-line {
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    color: #0f172a !important;
    padding: 0.5rem 0.85rem !important;
    border-radius: 4px !important;
    font-size: 10.5pt !important;
    min-height: 38px !important;
    line-height: 1.4 !important;
    box-sizing: border-box !important;
    word-break: break-word !important;
  }
  
  .wb-print-block {
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    color: #0f172a !important;
    padding: 0.65rem 0.85rem !important;
    border-radius: 4px !important;
    font-size: 10.5pt !important;
    line-height: 1.5 !important;
    min-height: 55px !important;
    white-space: pre-wrap !important;
    word-break: break-word !important;
    box-sizing: border-box !important;
  }
  
  .wb-signatures-container {
    margin-top: 4rem !important;
    page-break-inside: avoid !important;
  }
  
  .wb-signature-space {
    height: 75px !important;
  }
}

/* P1-10 — contraste WCAG AA em superfícies claras */
:root:not([data-theme="dark"]) .wb-hero-badge,
:root:not([data-theme="dark"]) #kb-count-badge,
:root:not([data-theme="dark"]) .wb-badge-pill,
:root:not([data-theme="dark"]) #cam-resolution,
:root:not([data-theme="dark"]) #kb-latency,
:root:not([data-theme="dark"]) #m-btn-last { color: #0f766e !important; }
:root:not([data-theme="dark"]) .wb-alert-text { color: #92400e !important; }
:root:not([data-theme="dark"]) .wb-nav-btn.active,
:root:not([data-theme="dark"]) .wb-btn-primary-action { background: #0f766e !important; border-color: #0f766e !important; }
:root:not([data-theme="dark"]) #m-polling-rate { color: #047857 !important; }
:root:not([data-theme="dark"]) #kb-pressed-keys span { color: #475569 !important; }
:root:not([data-theme="dark"]) #mouse-test-pad p { color: #0f766e !important; }
:root:not([data-theme="dark"]) .brand-accent-gold { color: #7a5a0a !important; }
:root:not([data-theme="dark"]) .footer-brand-sep { color: #64748b !important; }
:root[data-theme="sepia"] .wb-badge-pill { color: #b45309 !important; }
:root[data-theme="sepia"] #m-polling-rate { color: #059669 !important; }
[data-theme="dark"] .wb-nav-btn.active,
[data-theme="dark"] .wb-btn-primary-action { background: #0d9488 !important; border-color: #0d9488 !important; }
[data-theme="dark"] #kb-pressed-keys span,
[data-theme="dark"] #m-coords,
[data-theme="dark"] #audio-tone-status,
[data-theme="dark"] #mic-status-label,
[data-theme="dark"] .wb-tool-card p[style*="--wb-text-dim"] { color: #cbd5e1 !important; }

/* ==========================================================================
   CABEÇALHO CANÔNICO DO ECOSSISTEMA PHM TECH — BOTÕES GHOST & NAVEGAÇÃO
   ========================================================================== */
.phm-ecosystem-header .phm-ecosystem-header__inner,
.phm-ecosystem-header .nav-wrap {
  justify-content: flex-start !important;
}

.phm-ecosystem-header .phm-projects-menu > summary,
.phm-ecosystem-header .phm-hub-back {
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid transparent !important;
  border-radius: 4px !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--text-soft, #475569) !important;
  transition: all 0.15s ease;
}

.phm-ecosystem-header .phm-projects-menu > summary::-webkit-details-marker {
  display: none !important;
}

.phm-ecosystem-header .phm-projects-menu > summary span,
.phm-ecosystem-header .phm-projects-menu > summary svg:last-child,
.phm-ecosystem-header .phm-hub-back span {
  display: none !important;
}

.phm-ecosystem-header .phm-projects-menu > summary svg:first-child,
.phm-ecosystem-header .phm-hub-back svg {
  margin: 0 !important;
}

.phm-ecosystem-header .phm-projects-menu > summary:hover,
.phm-ecosystem-header .phm-projects-menu[open] > summary,
.phm-ecosystem-header .phm-hub-back:hover {
  border-color: var(--line, #e2e8f0) !important;
  background: var(--surface-soft, #f1f5f9) !important;
  color: var(--teal, #0d9488) !important;
}

[data-theme="dark"] .phm-ecosystem-header .phm-projects-menu > summary,
[data-theme="dark"] .phm-ecosystem-header .phm-hub-back {
  color: #94a3b8 !important;
}

[data-theme="dark"] .phm-ecosystem-header .phm-projects-menu > summary:hover,
[data-theme="dark"] .phm-ecosystem-header .phm-projects-menu[open] > summary,
[data-theme="dark"] .phm-ecosystem-header .phm-hub-back:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #2dd4bf !important;
}

[data-theme="sepia"] .phm-ecosystem-header .phm-projects-menu > summary,
[data-theme="sepia"] .phm-ecosystem-header .phm-hub-back {
  color: #715842 !important;
}

[data-theme="sepia"] .phm-ecosystem-header .phm-projects-menu > summary:hover,
[data-theme="sepia"] .phm-ecosystem-header .phm-projects-menu[open] > summary,
[data-theme="sepia"] .phm-ecosystem-header .phm-hub-back:hover {
  background: rgba(67, 52, 34, 0.08) !important;
  border-color: rgba(67, 52, 34, 0.15) !important;
  color: #78350f !important;
}

.phm-ecosystem-header .menu-toggle {
  display: none !important;
}

@media (max-width: 900px) {
  .phm-ecosystem-header .menu-toggle {
    display: inline-flex !important;
    width: 34px !important;
    min-width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid transparent !important;
    border-radius: 4px !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--text-soft, #475569) !important;
    cursor: pointer;
    transition: all 0.15s ease;
  }
  .phm-ecosystem-header .menu-toggle:hover {
    border-color: var(--line, #e2e8f0) !important;
    background: var(--surface-soft, #f1f5f9) !important;
    color: var(--teal, #0d9488) !important;
  }
  [data-theme="dark"] .phm-ecosystem-header .menu-toggle {
    color: #94a3b8 !important;
  }
  [data-theme="dark"] .phm-ecosystem-header .menu-toggle:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #2dd4bf !important;
  }
  [data-theme="sepia"] .phm-ecosystem-header .menu-toggle {
    color: #715842 !important;
  }
  [data-theme="sepia"] .phm-ecosystem-header .menu-toggle:hover {
    background: rgba(67, 52, 34, 0.08) !important;
    border-color: rgba(67, 52, 34, 0.15) !important;
    color: #78350f !important;
  }
  .phm-ecosystem-header .header-editorial-nav {
    display: none !important;
  }
  .phm-ecosystem-header .header-editorial-nav.open {
    display: flex !important;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--wb-surface, #0f172a);
    border-bottom: 1px solid var(--wb-border, rgba(255, 255, 255, 0.1));
    padding: 1rem 1.25rem;
    gap: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    z-index: 999;
  }
  .phm-ecosystem-header .header-editorial-nav.open .header-nav-link {
    padding: 0.65rem 0.85rem !important;
    font-size: 0.85rem !important;
    border-radius: 4px !important;
  }
  [data-theme="light"] .phm-ecosystem-header .header-editorial-nav.open {
    background: #ffffff;
    border-bottom-color: var(--wb-border, #cbd5e1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  }
  [data-theme="sepia"] .phm-ecosystem-header .header-editorial-nav.open {
    background: #f4ecdc;
    border-bottom-color: var(--wb-border, #cbd5e1);
    box-shadow: 0 10px 25px rgba(67, 52, 34, 0.12);
  }
}

body.app-body {
  overflow-x: hidden;
}

.phm-ecosystem-header {
  width: 100% !important;
  max-width: 100vw !important;
  box-sizing: border-box !important;
}

@media (max-width: 640px) {
  .phm-ecosystem-header .phm-ecosystem-header__inner {
    padding-inline: 0.35rem !important;
    gap: 0.2rem !important;
  }
  .phm-ecosystem-header .nav-left-cluster {
    flex-shrink: 1 !important;
    min-width: 0 !important;
  }
  .phm-ecosystem-header .app-logo-wordmark {
    height: 20px !important;
    max-width: 85px !important;
    width: auto !important;
  }
  .phm-ecosystem-header .nav-cluster-divider {
    display: none !important;
  }
  .phm-ecosystem-header .phm-ecosystem-header__actions {
    gap: 0.15rem !important;
    flex-shrink: 0 !important;
  }
  .phm-ecosystem-header .nav-pref-trigger,
  .phm-ecosystem-header .phm-projects-menu > summary,
  .phm-ecosystem-header .phm-hub-back,
  .phm-ecosystem-header .menu-toggle {
    width: 30px !important;
    min-width: 30px !important;
    height: 30px !important;
    min-height: 30px !important;
    padding: 0 !important;
    border-radius: 4px !important;
    justify-content: center !important;
  }
}

/* Salvaguarda de Acessibilidade: Skip Link fora do fluxo visual quando não focado */
.phm-skip-link {
  position: absolute !important;
  top: -9999px !important;
  left: 1rem !important;
  z-index: 999999 !important;
  padding: 0.5rem 1rem !important;
  background: #0b1329 !important;
  color: #2dd4bf !important;
  border: 1px solid #2dd4bf !important;
  border-radius: 4px !important;
  font-family: var(--font-body, system-ui, sans-serif) !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.phm-skip-link:focus,
.phm-skip-link:focus-visible {
  top: 1rem !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  outline: 2px solid #2dd4bf !important;
}
