html, body { height: 100%; margin: 0; padding: 0; background-color: #020617; color: #E2E8F0; overflow: hidden; }
        .lab-panel { background: rgba(30, 41, 59, 0.95); backdrop-filter: blur(12px); border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5); border-radius: 0.5rem; }
        input[type=range] { -webkit-appearance: none; background: transparent; height: 6px; border-radius: 3px; background: #475569; cursor: pointer; }
        input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; height: 16px; width: 16px; border-radius: 50%; background: #3B82F6; border: 2px solid #fff; box-shadow: 0 0 10px rgba(59, 130, 246, 0.5); margin-top: -5px; transition: transform 0.1s; }
        .toggle-checkbox { right: auto; left: 0; transition: all 0.3s ease; border-color: #cbd5e1; }
        .toggle-checkbox:checked { left: 1.25rem; border-color: #3B82F6; background-color: #3B82F6; }
        .toggle-label { width: 2.5rem; height: 1.25rem; background-color: #94a3b8; transition: background-color 0.3s ease; }
        .toggle-checkbox:checked + .toggle-label { background-color: #93C5FD; }
        .custom-scrollbar::-webkit-scrollbar { width: 6px; height: 6px; }
        .custom-scrollbar::-webkit-scrollbar-track { background: #0f172a; }
        .custom-scrollbar::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }
        .activity-drawer { position: fixed; z-index: 50; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); display: flex; flex-direction: column; box-shadow: 0 -5px 25px rgba(0,0,0,0.2); background-color: #ffffff; color: #1e293b; visibility: hidden; }
        .drawer-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); z-index: 49; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
        .drawer-overlay.is-visible { opacity: 1; pointer-events: auto; }
        @media (max-width: 767px) { .activity-drawer { left: 0; width: 100%; height: 85vh; bottom: 0; transform: translateY(100%); border-radius: 1rem 1rem 0 0; } .activity-drawer.is-open { transform: translateY(0); visibility: visible; } }
        @media (min-width: 768px) { .activity-drawer { top: 0; right: -100%; width: 500px; height: 100%; border-left: 1px solid #cbd5e1; border-radius: 0; position: fixed; } .activity-drawer.is-open { right: 0; visibility: visible; } .activity-drawer.is-expanded { width: 65%; } }
        .activity-header { padding: 1rem; border-bottom: 1px solid #e2e8f0; display: flex; justify-content: space-between; align-items: center; background: #f8fafc; }
        .drawer-content { flex-grow: 1; overflow-y: auto; padding: 1.5rem; }
        .modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 100; display: flex; justify-content: center; align-items: center; opacity: 0; pointer-events: none; transition: opacity 0.3s; backdrop-filter: blur(4px); }
        .modal-overlay.is-visible { opacity: 1; pointer-events: auto; }
        .modal-content { background: #1e293b; border: 1px solid #334155; border-radius: 0.75rem; width: 90%; max-width: 600px; max-height: 90vh; overflow-y: auto; transform: scale(0.95); transition: transform 0.3s; }
        .modal-overlay.is-visible .modal-content { transform: scale(1); }
        .math-block { background: #f8fafc; padding: 1rem; border-radius: 0.5rem; border: 1px solid #e2e8f0; margin-bottom: 1rem; }
        .formula-box { font-family: 'JetBrains Mono', monospace; font-size: 0.9rem; color: #334155; background: #ffffff; padding: 0.5rem; border-radius: 0.25rem; border: 1px dashed #cbd5e1; margin-top: 0.5rem; text-align: center; }
        .history-table-wrapper { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 6px; border: 1px solid #334155; margin-bottom: 10px; max-height: 200px; }
        .history-table { width: 100%; border-collapse: collapse; font-size: 0.7rem; white-space: nowrap; }
        .history-table th { background: #0f172a; color: #94a3b8; font-weight: 600; text-transform: uppercase; padding: 8px 12px; border-bottom: 2px solid #334155; text-align: center; position: sticky; top: 0; z-index: 10; }
        .history-table td { padding: 6px 12px; border-bottom: 1px solid #1e293b; text-align: center; color: #e2e8f0; font-family: 'JetBrains Mono', monospace; }
        .history-table tr:last-child td { border-bottom: none; }
        .history-table tr:nth-child(even) { background: rgba(30, 41, 59, 0.5); }
        .dual-cell { display: flex; flex-direction: column; gap: 2px; }
        .val-b1 { color: #60a5fa; } .val-b2 { color: #fb923c; }

/* V2 — Interruptores táctiles accesibles. IDs y semántica nativa conservados. */
.aq-display-section { padding: 12px; border: 1px solid #334155; border-radius: 14px; background: rgba(30,41,59,.45); }
.aq-display-heading { color: #e2e8f0; font-weight: 800; font-size: 12px; margin-bottom: 10px; }
.aq-display-heading span { color: #94a3b8; font-weight: 500; font-size: 10px; margin-left: 5px; }
.aq-display-toggles { display: grid; grid-template-columns: 1fr; gap: 6px; }
.aq-visual-toggle { position: relative; min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 10px; background: rgba(15,23,42,.65); border: 1px solid #334155; border-radius: 10px; color: #e2e8f0; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; }
.aq-visual-toggle:has(input:checked) { border-color: rgba(59,130,246,.55); background: rgba(30,58,100,.36); }
.aq-visual-copy { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.aq-visual-copy strong { font-size: 12px; font-weight: 700; }
.aq-visual-copy small { font-size: 10px; color: #94a3b8; margin-top: 2px; }
.aq-visual-toggle input { position: absolute; width: 44px; height: 44px; right: 7px; opacity: 0; cursor: pointer; z-index: 2; }
.aq-switch-track { position: relative; width: 42px; height: 25px; flex: 0 0 42px; border-radius: 20px; background: #475569; border: 1px solid #64748b; transition: background .15s; }
.aq-switch-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: white; box-shadow: 0 1px 3px #0005; transition: transform .15s; }
.aq-visual-toggle input:checked + .aq-switch-track { background: #2563eb; border-color: #60a5fa; }
.aq-visual-toggle input:checked + .aq-switch-track::after { transform: translateX(17px); }
.aq-visual-toggle input:focus-visible + .aq-switch-track { outline: 3px solid #93c5fd; outline-offset: 3px; }
#slider-height, #slider-drag { min-height: 34px; touch-action: pan-x; }
#slider-height::-webkit-slider-thumb, #slider-drag::-webkit-slider-thumb { width: 24px; height: 24px; margin-top: -9px; }
#btn-h-minus, #btn-h-plus { min-width: 44px; min-height: 44px; touch-action: manipulation; }
#simCanvas { touch-action: pan-y; }
@media (max-width: 767px) {
  .aq-display-section { padding: 10px; }
  .aq-display-toggles { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .aq-visual-toggle { min-height: 60px; gap: 5px; padding: 7px; }
  .aq-visual-copy strong { font-size: 11px; }
  .aq-visual-copy small { font-size: 9px; }
  .aq-switch-track { width: 35px; height: 23px; flex-basis: 35px; }
  .aq-switch-track::after { width: 15px; height: 15px; }
  .aq-visual-toggle input:checked + .aq-switch-track::after { transform: translateX(12px); }
  #energy-panel { left: 8px !important; bottom: 8px !important; transform: scale(.67); transform-origin: bottom left; max-width: 50vw; }
  #charts-container canvas { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
 .aq-switch-track, .aq-switch-track::after { transition: none; }
}
