/**
 * Fijate Tools - Guía de pictogramas de peligro químico (CLP/SGA) y frases H/P
 * Estándar canónico, soporte tema oscuro / claro, 100 % responsivo.
 */

:root {
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Tokens corporativos tema oscuro por defecto */
  --bg-primary: #0b0f17;
  --bg-card: #131b2e;
  --bg-card-header: #19243d;
  --bg-surface: #131b26;
  --bg-surface-elevated: #1a2433;
  --bg-input: #0f172a;
  --bg-subtle: #1e293b;
  --bg-hover: #273549;

  --border-color: #1e293b;
  --border-subtle: #243247;
  --border-focus: #ef4444;

  --primary-color: #38bdf8;
  --primary-light: rgba(56, 189, 248, 0.14);
  --accent-emerald: #22c55e;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;

  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-subtle: #94a3b8;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 14px 32px rgba(0, 0, 0, 0.45);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-header: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f8fafc;
  --bg-input: #f1f5f9;
  --bg-subtle: #e2e8f0;
  --bg-hover: #e2e8f0;

  --border-color: #e2e8f0;
  --border-subtle: #cbd5e1;
  --border-focus: #dc2626;

  --primary-color: #0284c7;
  --primary-light: rgba(2, 132, 199, 0.12);
  --accent-emerald: #16a34a;
  --accent-amber: #d97706;
  --accent-red: #dc2626;

  --text-main: #0f172a;
  --text-muted: #334155;
  --text-subtle: #64748b;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 10px 24px rgba(15, 23, 42, 0.1);
}

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

body {
  font-family: var(--font-main);
  background: var(--bg-primary);
  color: var(--text-main);
  margin: 0;
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6,
.brand-title,
.hero-title,
.section-title {
  font-family: var(--font-heading);
}

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

/* Contención y layout principal */
.tool-layout {
  max-width: 1200px;
  width: 100%;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  box-sizing: border-box;
  flex: 1 0 auto;
}

.tool-with-sidebar {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  width: 100%;
}

.tool-main-content {
  flex: 1 1 0%;
  min-width: 0;
  width: 100%;
}

/* Hero introductorio */
.clp-hero {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.1rem;
  box-shadow: var(--shadow-sm);
}

.hero-top {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.hero-badge-icon {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background: rgba(239, 68, 68, 0.14);
  color: #f87171;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

[data-theme="light"] .hero-badge-icon {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

.hero-title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-main);
}

.hero-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.96rem;
}

.hero-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.kpi-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.kpi-value {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-color);
}

.kpi-value.kpi-danger {
  color: #f87171;
}

[data-theme="light"] .kpi-value.kpi-danger {
  color: #dc2626;
}

.kpi-label {
  font-size: 0.82rem;
  color: var(--text-subtle);
}

/* Barra de teléfonos de emergencia */
.emergency-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.32);
  border-radius: var(--radius-md);
  padding: 0.8rem 1rem;
  margin-bottom: 1.2rem;
  font-size: 0.88rem;
  color: var(--text-main);
}

[data-theme="light"] .emergency-strip {
  background: #fef2f2;
  border-color: #fecaca;
  color: #7f1d1d;
}

.emergency-strip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.emergency-tel-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.75rem;
  border-radius: 999px;
  background: #dc2626;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: opacity 0.18s ease;
}

.emergency-tel-pill:hover {
  opacity: 0.9;
}

/* Pestañas principales */
.tool-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.tab-btn {
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  border-radius: var(--radius-md);
  padding: 0.7rem 1rem;
  min-height: 44px;
  font-family: var(--font-main);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: border-color 0.18s ease, color 0.18s ease;
}

.tab-btn:hover {
  background: var(--bg-card-header);
  color: var(--text-main);
}

.tab-btn.active {
  background: var(--primary-light);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.tab-panel {
  display: none;
}

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

.card-main {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.panel-heading {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
}

.panel-lead {
  margin: 0 0 1.2rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* Cuadrícula de 9 pictogramas CLP */
.ghs-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 1.25rem;
}

.ghs-card-btn {
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.7rem 0.4rem;
  min-height: 112px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  color: var(--text-main);
  transition: transform 0.16s ease, border-color 0.2s ease, background-color 0.2s ease;
  position: relative;
}

.ghs-card-btn:hover {
  transform: translateY(-2px);
  border-color: #ef4444;
  background: var(--bg-card-header);
}

.ghs-card-btn.active {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.22);
}

[data-theme="light"] .ghs-card-btn.active {
  background: #fef2f2;
}

.ghs-short-code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
}

.ghs-short-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.2;
}

.ghs-svg {
  display: block;
  flex-shrink: 0;
}

/* Inspector detallado de pictograma */
.ghs-inspector {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.inspector-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.inspector-title-group {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.inspector-symbol-box {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.inspector-code-title {
  margin: 0 0 0.2rem;
  font-size: 1.22rem;
  font-weight: 700;
  color: var(--text-main);
}

.inspector-meta-line {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-subtle);
}

.risk-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.75rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.risk-pill.critical {
  background: rgba(239, 68, 68, 0.16);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.risk-pill.high {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.risk-pill.medium {
  background: rgba(56, 189, 248, 0.16);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

[data-theme="light"] .risk-pill.critical {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}

[data-theme="light"] .risk-pill.high {
  background: #fef3c7;
  color: #b45309;
  border-color: #fcd34d;
}

[data-theme="light"] .risk-pill.medium {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #7dd3fc;
}

.inspector-summary {
  margin: 0 0 0.75rem;
  color: var(--text-main);
  font-size: 0.96rem;
}

.inspector-context {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border-left: 3px solid var(--primary-color);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.inspector-details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 0.9rem;
}

.detail-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.95rem;
}

.detail-box.box-do {
  border-color: rgba(34, 197, 94, 0.35);
}

.detail-box.box-dont {
  border-color: rgba(239, 68, 68, 0.35);
}

.detail-box h4 {
  margin: 0 0 0.5rem;
  font-size: 0.93rem;
  font-weight: 700;
  color: var(--text-main);
}

.detail-box ul {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--text-muted);
  font-size: 0.87rem;
}

.detail-box li {
  margin-bottom: 0.32rem;
}

.h-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.45rem;
}

.h-code-chip {
  appearance: none;
  -webkit-appearance: none;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--primary-color);
  cursor: pointer;
}

.h-code-chip:hover {
  border-color: var(--primary-color);
}

.cross-tool-note {
  margin-top: 0.9rem;
  padding: 0.8rem 0.95rem;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  border: 1px solid rgba(56, 189, 248, 0.3);
  font-size: 0.88rem;
  color: var(--text-main);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.cross-tool-link {
  color: var(--primary-color);
  font-weight: 700;
  text-decoration: none;
}

.cross-tool-link:hover {
  text-decoration: underline;
}

/* Tabla de símbolos antiguos */
.legacy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.legacy-card {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
}

.legacy-orange-badge {
  min-width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #f97316;
  border: 2px solid #111827;
  color: #111827;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.legacy-card h4 {
  margin: 0 0 0.2rem;
  font-size: 0.94rem;
  color: var(--text-main);
}

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

.legacy-clp-tag {
  display: inline-block;
  margin-top: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--primary-color);
}

/* Buscadores y filtros */
.search-bar-box {
  display: flex;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.input-field {
  min-height: 44px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.95rem;
  padding: 0.6rem 0.9rem;
  flex: 1 1 0%;
  width: 0;
  min-width: 0;
}

select.select-field {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0.6rem 40px 0.6rem 0.9rem;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.94rem;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

select.select-field::-ms-expand {
  display: none;
}

select.select-field option {
  background-color: var(--bg-card);
  color: var(--text-main);
}

.input-field:focus,
.select-field:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.btn-secondary {
  min-height: 44px;
  padding: 0.6rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary:hover {
  background: var(--bg-hover);
}

.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.chip-btn {
  appearance: none;
  -webkit-appearance: none;
  min-height: 36px;
  padding: 0.35rem 0.78rem;
  border-radius: 999px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.chip-btn:hover,
.chip-btn.active {
  background: var(--primary-light);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* Tarjetas de códigos H/P */
.hp-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.hp-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.hp-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.hp-code-badge {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 800;
  padding: 0.24rem 0.58rem;
  border-radius: 6px;
}

.hp-code-badge.type-H2 {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
}

.hp-code-badge.type-H3 {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
}

.hp-code-badge.type-H4 {
  background: rgba(34, 197, 94, 0.18);
  color: #4ade80;
}

.hp-code-badge.type-EUH {
  background: rgba(168, 85, 247, 0.18);
  color: #c084fc;
}

.hp-code-badge.type-P {
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
}

[data-theme="light"] .hp-code-badge.type-H2 {
  background: #fef3c7;
  color: #b45309;
}

[data-theme="light"] .hp-code-badge.type-H3 {
  background: #fee2e2;
  color: #b91c1c;
}

[data-theme="light"] .hp-code-badge.type-H4 {
  background: #dcfce7;
  color: #15803d;
}

[data-theme="light"] .hp-code-badge.type-EUH {
  background: #f3e8ff;
  color: #7e22ce;
}

[data-theme="light"] .hp-code-badge.type-P {
  background: #e0f2fe;
  color: #0369a1;
}

.hp-cat-label {
  font-size: 0.78rem;
  color: var(--text-subtle);
  font-weight: 600;
}

.hp-official-text {
  margin: 0;
  font-size: 0.93rem;
  font-weight: 700;
  color: var(--text-main);
}

.hp-plain-text {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.hp-action-text {
  margin: 0.15rem 0 0;
  padding-top: 0.45rem;
  border-top: 1px dashed var(--border-color);
  font-size: 0.83rem;
  color: var(--primary-color);
  font-weight: 600;
}

/* Buscador de productos domésticos */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.product-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.product-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}

.product-name {
  margin: 0;
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--text-main);
}

.product-cat-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  white-space: nowrap;
}

.product-pictos-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.product-picto-mini {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.2rem 0.45rem;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
}

.product-picto-mini:hover {
  border-color: #ef4444;
}

.product-meta-block {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.product-meta-block strong {
  color: var(--text-main);
}

/* Asistente de primeros auxilios */
.emergency-selector-box {
  margin-bottom: 1rem;
}

.emergency-selector-label {
  display: block;
  margin-bottom: 0.55rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
}

.emergency-scenario-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.scenario-btn {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.9rem;
  text-align: left;
  background-color: var(--bg-input);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
  transition: border-color 0.16s ease, color 0.16s ease;
}

.scenario-btn:hover {
  border-color: var(--primary-color);
  background-color: var(--bg-card-header);
}

.scenario-btn.active {
  border-color: #ef4444;
  background-color: rgba(239, 68, 68, 0.12);
  color: var(--text-main);
}

[data-theme="light"] .scenario-btn.active {
  background-color: #fef2f2;
  color: #7f1d1d;
  border-color: #dc2626;
}

.emergency-verdict {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
}

.emergency-verdict-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding-bottom: 0.85rem;
  margin-bottom: 0.9rem;
  border-bottom: 1px solid var(--border-color);
}

.emergency-verdict-title {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Test rápido */
.quiz-box {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.quiz-progress {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-subtle);
  margin-bottom: 0.6rem;
}

.quiz-question {
  margin: 0 0 1rem;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-main);
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.quiz-option-btn {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-height: 46px;
  text-align: left;
  padding: 0.75rem 1rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.93rem;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.quiz-option-btn:hover:not(:disabled) {
  border-color: var(--primary-color);
  background-color: var(--bg-card-header);
}

.quiz-option-btn:disabled {
  background-color: var(--bg-card);
  color: var(--text-muted);
  opacity: 0.84;
  cursor: default;
}

.quiz-option-btn.correct,
.quiz-option-btn.correct:disabled {
  border-color: var(--accent-emerald);
  background-color: rgba(34, 197, 94, 0.16);
  color: var(--text-main);
  opacity: 1;
}

.quiz-option-btn.wrong,
.quiz-option-btn.wrong:disabled {
  border-color: var(--accent-red);
  background-color: rgba(239, 68, 68, 0.16);
  color: var(--text-main);
  opacity: 1;
}

[data-theme="light"] .quiz-option-btn:disabled {
  background-color: #f1f5f9;
  color: #334155;
  border-color: #cbd5e1;
  opacity: 0.9;
}

[data-theme="light"] .quiz-option-btn.correct,
[data-theme="light"] .quiz-option-btn.correct:disabled {
  background-color: #dcfce7;
  color: #14532d;
  border-color: #16a34a;
  opacity: 1;
}

[data-theme="light"] .quiz-option-btn.wrong,
[data-theme="light"] .quiz-option-btn.wrong:disabled {
  background-color: #fee2e2;
  color: #7f1d1d;
  border-color: #dc2626;
  opacity: 1;
}

.quiz-feedback {
  margin-top: 1rem;
  padding: 0.95rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  font-size: 0.91rem;
  color: var(--text-muted);
}

.btn-primary {
  min-height: 44px;
  padding: 0.65rem 1.2rem;
  background: var(--primary-color);
  color: #0b0f17;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 0.93rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 0.85rem;
}

[data-theme="light"] .btn-primary {
  color: #ffffff;
}

/* Guía informativa y FAQ */
.seo-guide-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.seo-guide-card h2 {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
  color: var(--text-main);
}

.seo-guide-card p {
  color: var(--text-muted);
  font-size: 0.94rem;
  margin: 0 0 0.85rem;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1rem;
}

.faq-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  overflow: hidden;
}

.faq-item summary {
  padding: 0.9rem 1rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '+';
  font-family: var(--font-mono);
  font-size: 1.15rem;
  color: var(--primary-color);
}

.faq-item[open] summary::after {
  content: '−';
}

.faq-answer {
  padding: 0 1rem 0.95rem;
  color: var(--text-muted);
  font-size: 0.91rem;
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
}

/* Responsive móvil y tablet */
@media (max-width: 960px) {
  .ghs-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .inspector-details-grid,
  .hp-grid,
  .products-grid,
  .legacy-grid,
  .emergency-scenario-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .tool-layout {
    margin: 1rem auto 2rem;
    padding: 0 0.75rem;
  }

  .clp-hero,
  .card-main,
  .seo-guide-card {
    padding: 1rem;
  }

  .hero-kpis {
    grid-template-columns: 1fr;
  }

  .ghs-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tool-tabs {
    flex-direction: column;
  }

  .tab-btn {
    width: 100%;
    justify-content: flex-start;
  }

  .search-bar-box {
    flex-direction: column;
  }

  .input-field,
  .btn-secondary,
  .btn-primary {
    width: 100%;
  }
}
