/* ════════════════════════════════════════════════════════════════
   BIOMAGNETISMO PARA TODOS — Advanced Features v12.0 "Hyperdrive"
   Command Palette · Accessibility Panel · Guided Session Timer ·
   Body Explorer · Progress Journal · Compare Mode · QR Share ·
   PWA Install Banner · Smart Search corrections
   ════════════════════════════════════════════════════════════════ */

/* ═══════════ NEW GRADIENTS ═══════════ */
:root {
    --gradient-explorer: linear-gradient(135deg, #2F80ED 0%, #56CCF2 100%);
    --gradient-journal: linear-gradient(135deg, #F2994A 0%, #F2C94C 100%);
}
.hero-explorer::before { background: var(--gradient-explorer); }
.hero-journal::before { background: var(--gradient-journal); }
.hero-explorer .section-hero-icon { background: var(--gradient-explorer); }
.hero-journal .section-hero-icon { background: var(--gradient-journal); }

/* ═══════════ SIDEBAR TOOL LINKS ═══════════ */
.sidebar-tool-link {
    display: flex; align-items: center; gap: 11px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.86rem; font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    text-align: left; width: 100%;
}
.sidebar-tool-link:hover { background: var(--bg-surface); color: var(--text); }
.sidebar-tool-link i:first-child { width: 20px; text-align: center; font-size: 0.82rem; color: var(--primary); }

/* ═══════════ RESULTS INFO ACTIONS ═══════════ */
.results-info-actions { display: flex; gap: 8px; }

/* ═══════════ SEARCH CORRECTION BAR ═══════════ */
.search-correction-bar {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 9px 14px; margin-top: 10px;
    background: var(--amber-bg);
    border: 1px solid var(--amber);
    border-radius: var(--radius-sm);
    font-size: 0.78rem; font-weight: 600; color: var(--amber);
    animation: slideDown 0.2s ease;
}
.search-correction-bar button {
    background: rgba(255,255,255,0.35); color: var(--amber);
    padding: 3px 10px; border-radius: var(--radius-full);
    font-weight: 700; font-size: 0.76rem;
}
[data-theme="dark"] .search-correction-bar button { background: rgba(0,0,0,0.25); }

/* ══════════════════════════════════════════════════════════════
   COMMAND PALETTE (Ctrl+K)
   ══════════════════════════════════════════════════════════════ */
.command-palette-overlay {
    position: fixed; inset: 0; z-index: 400;
    display: none;
    background: rgba(10,14,26,0.55);
    backdrop-filter: blur(6px);
    padding: 10vh 16px 0;
}
.command-palette-overlay.active { display: block; animation: fadeIn 0.15s ease; }
.command-palette {
    max-width: 560px; margin: 0 auto;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: suggestIn 0.18s var(--ease);
}
.command-palette-input-wrap {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-light);
}
.command-palette-input-wrap i { color: var(--primary); font-size: 1rem; }
.command-palette-input-wrap input {
    flex: 1; border: none; background: none; outline: none;
    font-size: 1.02rem; color: var(--text); font-weight: 500;
}
.command-palette-input-wrap input::placeholder { color: var(--text-muted); }
.command-palette-results { max-height: 50vh; overflow-y: auto; padding: 6px; }
.cmd-group-label {
    padding: 10px 12px 4px;
    font-size: 0.64rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.1em; color: var(--text-muted);
}
.cmd-item {
    display: flex; align-items: center; gap: 12px;
    width: 100%; text-align: left; padding: 11px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem; color: var(--text);
}
.cmd-item i:first-child { width: 20px; text-align: center; color: var(--text-muted); }
.cmd-item .cmd-sub { font-size: 0.72rem; color: var(--text-muted); margin-left: 2px; }
.cmd-item .cmd-tag {
    margin-left: auto; font-size: 0.6rem; font-weight: 700;
    padding: 2px 8px; border-radius: var(--radius-full);
    background: var(--primary-bg); color: var(--primary); flex-shrink: 0;
}
.cmd-item:hover, .cmd-item.highlighted { background: var(--primary-bg); color: var(--primary); }
.cmd-item:hover i:first-child, .cmd-item.highlighted i:first-child { color: var(--primary); }
.command-palette-footer {
    display: flex; gap: 16px; padding: 10px 16px;
    border-top: 1px solid var(--border-light);
    font-size: 0.68rem; color: var(--text-muted);
}
.command-palette-empty { padding: 30px 12px; text-align: center; color: var(--text-muted); font-size: 0.84rem; }

/* ══════════════════════════════════════════════════════════════
   ACCESSIBILITY PANEL
   ══════════════════════════════════════════════════════════════ */
.a11y-overlay {
    position: fixed; inset: 0; z-index: 400; display: none;
    background: rgba(10,14,26,0.5);
}
.a11y-overlay.active { display: block; }
.a11y-panel {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: min(360px, 92vw);
    background: var(--bg-elevated);
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow-xl);
    display: flex; flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s var(--ease);
}
.a11y-overlay.active .a11y-panel { transform: translateX(0); }
.a11y-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px; border-bottom: 1px solid var(--border-light);
}
.a11y-panel-header h3 { font-size: 1.02rem; font-weight: 800; display: flex; align-items: center; gap: 9px; }
.a11y-panel-body { padding: 18px 20px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 18px; }
.a11y-option { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.a11y-option label { font-size: 0.88rem; font-weight: 600; color: var(--text); }
.a11y-stepper { display: flex; align-items: center; gap: 10px; }
.a11y-stepper button {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--bg-surface); color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.a11y-stepper button:hover { background: var(--primary-bg); color: var(--primary); }
.a11y-stepper span { min-width: 44px; text-align: center; font-family: var(--font-mono); font-size: 0.8rem; font-weight: 700; }
.a11y-switch {
    width: 46px; height: 26px; border-radius: var(--radius-full);
    background: var(--bg-surface); border: 1px solid var(--border);
    position: relative; transition: var(--transition); flex-shrink: 0;
}
.a11y-switch span {
    position: absolute; top: 2px; left: 2px;
    width: 20px; height: 20px; border-radius: 50%;
    background: var(--text-muted);
    transition: transform 0.25s var(--ease-spring), background 0.2s ease;
}
.a11y-switch[aria-checked="true"] { background: var(--primary); border-color: var(--primary); }
.a11y-switch[aria-checked="true"] span { transform: translateX(20px); background: white; }

/* Applied accessibility states */
html.a11y-contrast { filter: contrast(1.18) saturate(1.1); }
html.a11y-underline a, html.a11y-underline .sidebar-nav-link, html.a11y-underline .cat-chip { text-decoration: underline !important; }
html.a11y-dyslexia, html.a11y-dyslexia * { font-family: 'Comic Sans MS', 'Comic Sans', cursive, var(--font) !important; letter-spacing: 0.02em !important; }
html.a11y-reduce-motion *, html.a11y-reduce-motion *::before, html.a11y-reduce-motion *::after {
    animation-duration: 0.01ms !important; transition-duration: 0.01ms !important;
}

/* ══════════════════════════════════════════════════════════════
   GUIDED SESSION TIMER
   ══════════════════════════════════════════════════════════════ */
.session-overlay {
    position: fixed; inset: 0; z-index: 450; display: none;
    background: rgba(6,9,18,0.72); backdrop-filter: blur(8px);
    align-items: center; justify-content: center; padding: 20px;
}
.session-overlay.active { display: flex; animation: fadeIn 0.2s ease; }
.session-panel {
    position: relative;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 34px 26px 26px;
    max-width: 380px; width: 100%;
    text-align: center;
    animation: slideUp 0.25s var(--ease);
}
.session-close-btn { position: absolute; top: 14px; right: 14px; }
.session-pair-name { font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; margin-bottom: 18px; color: var(--text); }
.session-ring-wrap { position: relative; width: 180px; height: 180px; margin: 0 auto 18px; }
.session-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.session-ring-bg { fill: none; stroke: var(--bg-surface); stroke-width: 8; }
.session-ring-fg {
    fill: none; stroke: var(--primary); stroke-width: 8; stroke-linecap: round;
    stroke-dasharray: 326.7; stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear, stroke 0.3s ease;
}
.session-ring-fg.warning { stroke: var(--red); }
.session-time {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-family: var(--font-mono); font-size: 1.9rem; font-weight: 700; color: var(--text);
}
.session-poles { display: flex; gap: 10px; margin-bottom: 18px; }
.session-pole {
    flex: 1; padding: 10px; border-radius: var(--radius-sm);
    background: var(--bg-surface); font-size: 0.76rem;
}
.session-pole span {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; border-radius: 50%; color: white; font-weight: 800; font-size: 0.62rem;
    margin-right: 6px;
}
.session-pole.neg span { background: var(--gradient-neg); }
.session-pole.pos span { background: var(--gradient-pos); }
.session-pole small { color: var(--text-secondary); font-weight: 600; }
.session-presets { display: flex; gap: 8px; justify-content: center; margin-bottom: 18px; }
.session-presets button {
    padding: 7px 14px; border-radius: var(--radius-full);
    background: var(--bg-surface); color: var(--text-secondary);
    font-size: 0.76rem; font-weight: 600; transition: var(--transition);
}
.session-presets button.active { background: var(--primary); color: white; }
.session-controls { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 14px; }
.session-ctrl-btn {
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--bg-surface); color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; transition: var(--transition);
}
.session-ctrl-btn:hover { background: var(--primary-bg); color: var(--primary); }
.session-ctrl-main {
    width: 60px; height: 60px; font-size: 1.3rem;
    background: var(--gradient-primary); color: white;
    box-shadow: 0 8px 20px rgba(91,91,214,0.4);
}
.session-hint { font-size: 0.72rem; color: var(--text-muted); line-height: 1.5; }

/* Mini floating session badge when minimized */
.session-mini-badge {
    position: fixed; left: 18px; bottom: calc(var(--bottom-nav-h) + 18px + env(safe-area-inset-bottom, 0px));
    z-index: 90;
    display: none;
    align-items: center; gap: 10px;
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius-full); padding: 8px 14px 8px 8px;
    box-shadow: var(--shadow-lg); cursor: pointer;
}
.session-mini-badge.visible { display: flex; animation: slideDown 0.25s ease; }
.session-mini-badge .session-mini-ring {
    width: 30px; height: 30px; border-radius: 50%;
    background: conic-gradient(var(--primary) calc(var(--pct, 0) * 1%), var(--bg-surface) 0);
    display: flex; align-items: center; justify-content: center;
}
.session-mini-badge .session-mini-ring::after {
    content: ''; width: 22px; height: 22px; border-radius: 50%; background: var(--bg-elevated);
}
.session-mini-badge .session-mini-time { font-family: var(--font-mono); font-size: 0.8rem; font-weight: 700; }

/* ══════════════════════════════════════════════════════════════
   BODY EXPLORER (interactive hotspot map)
   ══════════════════════════════════════════════════════════════ */
.explorer-view-toggle { display: flex; gap: 8px; margin-bottom: 14px; }
.explorer-view-btn {
    flex: 1; padding: 10px; border-radius: var(--radius-sm);
    background: var(--bg-card); border: 1px solid var(--border);
    font-size: 0.78rem; font-weight: 600; color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center; gap: 7px;
    transition: var(--transition);
}
.explorer-view-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.explorer-stage {
    position: relative; max-width: 340px; margin: 0 auto 16px;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
    overflow: hidden;
}
.explorer-stage img { width: 100%; display: block; }
.explorer-hotspots { position: absolute; inset: 0; }
.explorer-hotspot {
    position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px;
    border-radius: 50%; background: rgba(91,91,214,0.28);
    border: 2px solid var(--primary); cursor: pointer;
    transition: var(--transition); animation: hotspotPulse 2.4s infinite;
}
.explorer-hotspot:hover, .explorer-hotspot.active { background: var(--primary); transform: scale(1.25); }
@keyframes hotspotPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(91,91,214,0.4); } 50% { box-shadow: 0 0 0 8px rgba(91,91,214,0); } }
.explorer-zone-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 20px; }
.explorer-zone-chip {
    padding: 10px 12px; border-radius: var(--radius-sm);
    background: var(--bg-card); border: 1px solid var(--border);
    font-size: 0.76rem; font-weight: 600; color: var(--text-secondary);
    text-align: left; transition: var(--transition);
}
.explorer-zone-chip:hover, .explorer-zone-chip.active { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }
.explorer-results-title {
    display: flex; align-items: center; gap: 9px;
    font-size: 0.86rem; font-weight: 700; color: var(--text); margin: 6px 2px 12px;
}

/* ══════════════════════════════════════════════════════════════
   PROGRESS JOURNAL
   ══════════════════════════════════════════════════════════════ */
.journal-streak-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.journal-streak-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 16px 10px; text-align: center;
}
.journal-streak-num {
    font-family: var(--font-display); font-size: 1.6rem; font-weight: 800;
    background: var(--gradient-journal); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.journal-streak-label { font-size: 0.66rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 4px; font-weight: 600; }
.journal-heatmap-wrap { overflow-x: auto; padding-bottom: 6px; }
.journal-heatmap { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 3px; width: max-content; }
.journal-heatmap-cell {
    width: 13px; height: 13px; border-radius: 3px; background: var(--bg-surface);
}
.journal-heatmap-cell[data-level="1"] { background: rgba(91,91,214,0.3); }
.journal-heatmap-cell[data-level="2"] { background: rgba(91,91,214,0.55); }
.journal-heatmap-cell[data-level="3"] { background: var(--primary); }
.journal-chart-container { height: 240px; position: relative; margin-top: 4px; }
.journal-stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 6px 0 18px; }
.journal-stat-box {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 14px; text-align: center;
}
.journal-stat-box .num { font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; color: var(--primary); }
.journal-stat-box .lbl { font-size: 0.68rem; color: var(--text-muted); margin-top: 4px; font-weight: 600; }
.journal-backup-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.empty-state-btn-outline {
    background: transparent !important; color: var(--primary) !important;
    border: 1.5px solid var(--primary); box-shadow: none !important;
    cursor: pointer;
}
.empty-state-btn-outline:hover { background: var(--primary-bg) !important; }

/* ══════════════════════════════════════════════════════════════
   COMPARE MODE
   ══════════════════════════════════════════════════════════════ */
.pair-card.compare-mode { position: relative; }
.pair-compare-check {
    position: absolute; top: 12px; right: 12px;
    width: 24px; height: 24px; border-radius: 7px;
    border: 2px solid var(--border-strong); background: var(--bg-card);
    display: flex; align-items: center; justify-content: center;
    color: transparent; font-size: 0.7rem; z-index: 3;
}
.pair-compare-check.checked { background: var(--primary); border-color: var(--primary); color: white; }

.compare-overlay {
    position: fixed; inset: 0; z-index: 420; display: none;
    background: rgba(10,14,26,0.6); backdrop-filter: blur(6px);
    align-items: center; justify-content: center; padding: 16px;
}
.compare-overlay.active { display: flex; animation: fadeIn 0.2s ease; }
.compare-panel {
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius-xl); box-shadow: var(--shadow-xl);
    max-width: 720px; width: 100%; max-height: 84vh;
    display: flex; flex-direction: column;
    animation: slideUp 0.25s var(--ease);
}
.compare-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px; border-bottom: 1px solid var(--border-light);
}
.compare-header h3 { font-size: 1.02rem; font-weight: 800; display: flex; align-items: center; gap: 9px; }
.compare-body { overflow-y: auto; padding: 18px 20px; }
.compare-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.compare-table th, .compare-table td {
    padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--border-light);
    vertical-align: top;
}
.compare-table th { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); white-space: nowrap; }
.compare-table td:first-child, .compare-table th:first-child { color: var(--text-secondary); font-weight: 700; width: 110px; }
.compare-pair-title { font-weight: 800; color: var(--text); font-size: 0.88rem; }
.compare-empty { text-align: center; padding: 40px 12px; color: var(--text-muted); font-size: 0.86rem; }
.compare-remove-btn { color: var(--red); margin-left: 8px; }
.compare-floating-bar {
    position: fixed; left: 50%; bottom: calc(var(--bottom-nav-h) + 18px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    z-index: 95; display: none;
    align-items: center; gap: 12px;
    background: var(--bg-dark, #0F172A); color: white;
    padding: 10px 10px 10px 18px; border-radius: var(--radius-full);
    box-shadow: var(--shadow-xl);
}
.compare-floating-bar.visible { display: flex; animation: slideDown 0.2s ease; }
.compare-floating-bar span { font-size: 0.8rem; font-weight: 600; }
.compare-floating-bar button {
    background: var(--primary); color: white; padding: 8px 16px;
    border-radius: var(--radius-full); font-size: 0.78rem; font-weight: 700;
}

/* ══════════════════════════════════════════════════════════════
   QR SHARE MODAL
   ══════════════════════════════════════════════════════════════ */
.qr-overlay {
    position: fixed; inset: 0; z-index: 430; display: none;
    background: rgba(10,14,26,0.6); backdrop-filter: blur(6px);
    align-items: center; justify-content: center; padding: 16px;
}
.qr-overlay.active { display: flex; animation: fadeIn 0.2s ease; }
.qr-panel {
    position: relative;
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius-xl); box-shadow: var(--shadow-xl);
    padding: 32px 26px 24px; text-align: center; max-width: 320px; width: 100%;
    animation: slideUp 0.25s var(--ease);
}
.qr-panel h3 { font-size: 0.98rem; font-weight: 800; margin-bottom: 18px; display: flex; align-items: center; gap: 8px; justify-content: center; }
.qr-code-box { display: flex; justify-content: center; margin-bottom: 16px; background: white; padding: 14px; border-radius: var(--radius-sm); }
.qr-hint { font-size: 0.74rem; color: var(--text-muted); line-height: 1.5; }

/* ══════════════════════════════════════════════════════════════
   PWA INSTALL BANNER
   ══════════════════════════════════════════════════════════════ */
.pwa-install-banner {
    position: fixed; left: 12px; right: 12px;
    bottom: calc(var(--bottom-nav-h) + 12px + env(safe-area-inset-bottom, 0px));
    z-index: 150;
    display: none;
    align-items: center; gap: 12px;
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-xl);
    padding: 12px 12px 12px 14px;
    max-width: 420px; margin: 0 auto;
}
.pwa-install-banner.visible { display: flex; animation: slideDown 0.3s var(--ease); }
.pwa-install-icon {
    width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
    background: var(--gradient-primary); color: white;
    display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.pwa-install-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pwa-install-text strong { font-size: 0.84rem; color: var(--text); }
.pwa-install-text span { font-size: 0.7rem; color: var(--text-muted); line-height: 1.3; }
.pwa-install-btn {
    background: var(--primary); color: white; padding: 8px 14px;
    border-radius: var(--radius-full); font-size: 0.76rem; font-weight: 700; flex-shrink: 0;
}
.pwa-install-dismiss { color: var(--text-muted); padding: 4px; flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════════
   MISC: search kbd reuse tweaks + responsive
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
    .journal-stats-grid { grid-template-columns: 1fr 1fr; }
    .compare-table th:first-child, .compare-table td:first-child { width: 84px; }
}

@media print {
    .command-palette-overlay, .a11y-overlay, .session-overlay, .compare-overlay,
    .qr-overlay, .pwa-install-banner, .session-mini-badge, .compare-floating-bar { display: none !important; }
}

/* ════════════════════════════════════════════════════════════════
   v13.0 "Clinic" — Pair Notes · Search History · Presentation Mode ·
   Print Session Sheet
   ════════════════════════════════════════════════════════════════ */

/* ═══════════ PAIR NOTES ═══════════ */
.pair-notes-textarea {
    width: 100%;
    margin-top: 8px;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.86rem;
    line-height: 1.55;
    resize: vertical;
    min-height: 74px;
    transition: var(--transition);
}
.pair-notes-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}
.pair-notes-textarea::placeholder { color: var(--text-muted); }
.pair-notes-status { margin-left: auto; font-size: 0.68rem; font-weight: 700; }
.pair-notes-status.typing { color: var(--text-muted); }
.pair-notes-status.saved { color: var(--green); }
.pair-note-dot {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; border-radius: 50%;
    background: var(--amber-bg); color: var(--amber);
    font-size: 0.55rem; flex-shrink: 0; margin-left: 4px;
}

/* ═══════════ SEARCH HISTORY ═══════════ */
.search-history-clear {
    font-size: 0.62rem; font-weight: 700; color: var(--red);
    padding: 2px 8px; border-radius: var(--radius-full);
    text-transform: none; letter-spacing: 0;
}
.search-history-clear:hover { background: var(--red-bg); }
.search-history-item { position: relative; }
.search-history-remove {
    margin-left: auto; color: var(--text-muted);
    width: 24px; height: 24px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 0.7rem;
}
.search-history-remove:hover { background: var(--red-bg); color: var(--red); }

/* ═══════════ FAVORITES TOOLBAR ═══════════ */
.fav-toolbar { margin-bottom: 16px; display: flex; flex-wrap: wrap; gap: 10px; }

/* ═══════════ PRESENTATION MODE ═══════════ */
.presentation-overlay {
    position: fixed; inset: 0; z-index: 500; display: none;
    flex-direction: column;
    background: #0B1020;
    color: #F1F5F9;
}
.presentation-overlay.active { display: flex; animation: fadeIn 0.2s ease; }
.presentation-topbar {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}
.presentation-title {
    flex: 1; text-align: center;
    font-family: var(--font-display);
    font-size: clamp(1.05rem, 3vw, 1.7rem);
    font-weight: 800; color: white;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.presentation-topbar-actions { display: flex; gap: 8px; }
.presentation-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 14px; border-radius: var(--radius-full);
    background: rgba(255,255,255,0.08); color: #E2E8F0;
    font-size: 0.8rem; font-weight: 600;
    transition: background 0.2s ease;
}
.presentation-btn:hover { background: rgba(255,255,255,0.18); }
.presentation-body {
    flex: 1; overflow-y: auto;
    display: flex; flex-direction: column; align-items: center;
    padding: 18px 16px 8px; gap: 16px;
}
.presentation-diagrams {
    display: flex; gap: 18px; justify-content: center;
    width: 100%; max-width: 760px;
}
.presentation-diagram { flex: 1; max-width: 340px; }
.presentation-diagrams.two-views .presentation-diagram { max-width: 300px; }
.presentation-view-label {
    text-align: center; font-size: 0.72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.1em; color: #94A3B8;
    margin-bottom: 8px;
}
.presentation-diagram-stage {
    position: relative; border-radius: 14px; overflow: hidden;
    background: #131A30; border: 1px solid rgba(255,255,255,0.08);
}
.presentation-diagram-stage img { width: 100%; display: block; }
.presentation-magnet {
    position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 800; font-size: 0.9rem;
    border: 3px solid white;
    box-shadow: 0 0 0 4px rgba(0,0,0,0.35), 0 4px 14px rgba(0,0,0,0.5);
    animation: presPulse 1.8s infinite;
}
.presentation-magnet.neg { background: #1D4ED8; }
.presentation-magnet.pos { background: #DC2626; }
@keyframes presPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.12); }
}
.presentation-info { width: 100%; max-width: 760px; }
.presentation-poles {
    display: flex; align-items: stretch; gap: 12px;
}
.presentation-pole {
    flex: 1; padding: 16px; border-radius: 16px; text-align: center;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
}
.presentation-pole.neg { border-top: 4px solid #3B82F6; }
.presentation-pole.pos { border-top: 4px solid #EF4444; }
.presentation-pole-badge {
    display: inline-block; padding: 3px 12px; border-radius: 999px;
    font-size: 0.72rem; font-weight: 800; margin-bottom: 8px;
}
.presentation-pole.neg .presentation-pole-badge { background: rgba(59,130,246,0.22); color: #93C5FD; }
.presentation-pole.pos .presentation-pole-badge { background: rgba(239,68,68,0.22); color: #FCA5A5; }
.presentation-pole-name {
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 3.4vw, 1.7rem);
    font-weight: 800; color: white; line-height: 1.2;
}
.presentation-pole-loc { font-size: 0.8rem; color: #94A3B8; margin-top: 6px; }
.presentation-pole-arrow {
    display: flex; align-items: center; color: #475569; font-size: 1.2rem;
}
.presentation-meta {
    display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px;
}
.presentation-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: 999px;
    background: rgba(255,255,255,0.08); color: #CBD5E1;
    font-size: 0.78rem; font-weight: 600;
}
.presentation-nav {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 18px calc(14px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}
.presentation-nav-btn {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 12px 22px; border-radius: var(--radius-full);
    background: var(--gradient-primary); color: white;
    font-size: 0.88rem; font-weight: 700;
    box-shadow: 0 6px 18px rgba(91,91,214,0.35);
    transition: transform 0.15s ease;
}
.presentation-nav-btn:hover { transform: translateY(-2px); }
.presentation-counter { font-family: var(--font-mono); font-size: 0.82rem; color: #94A3B8; font-weight: 700; }

@media (max-width: 640px) {
    .presentation-poles { flex-direction: column; }
    .presentation-pole-arrow { justify-content: center; transform: rotate(90deg); }
    .presentation-diagrams { flex-direction: column; align-items: center; }
    .presentation-diagrams.two-views .presentation-diagram { max-width: 260px; }
}

/* ═══════════ PRINT SESSION SHEET ═══════════ */
.print-sheet { display: none; }

@media print {
    /* When a session sheet is being printed, hide the whole app */
    body.printing-sheet > *:not(.print-sheet) { display: none !important; }
    body.printing-sheet { background: white !important; }
    body.printing-sheet .print-sheet {
        display: block !important;
        color: #111; font-family: Georgia, 'Times New Roman', serif;
        padding: 6mm 2mm;
    }
    .print-header { text-align: center; border-bottom: 2.5px solid #111; padding-bottom: 10px; margin-bottom: 12px; }
    .print-logo { font-size: 11pt; letter-spacing: 0.06em; }
    .print-header h1 { font-size: 16pt; margin: 6px 0 2px; }
    .print-date { font-size: 9.5pt; color: #444; text-transform: capitalize; }
    .print-patient { font-size: 10.5pt; margin-bottom: 14px; }
    .print-pair {
        border: 1px solid #999; border-radius: 6px;
        padding: 10px 12px; margin-bottom: 10px;
        page-break-inside: avoid;
    }
    .print-pair-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 11.5pt; margin-bottom: 6px; }
    .print-pair-type { font-size: 8.5pt; text-transform: uppercase; letter-spacing: 0.08em; color: #555; }
    .print-points { width: 100%; border-collapse: collapse; font-size: 10.5pt; margin-bottom: 6px; }
    .print-points td { padding: 4px 6px; border: 1px solid #ccc; }
    .print-pole-n, .print-pole-s { font-weight: 700; width: 40px; text-align: center; }
    .print-pole-n { background: #E8EEFF; }
    .print-pole-s { background: #FFE9E9; }
    .print-line { font-size: 9.5pt; margin: 4px 0; }
    .print-note { font-size: 9.5pt; margin: 4px 0; background: #FFFBE6; padding: 5px 8px; border-radius: 4px; }
    .print-obs { font-size: 9.5pt; color: #333; margin-top: 8px; }
    .print-footer {
        margin-top: 16px; padding-top: 8px; border-top: 1px solid #999;
        font-size: 8.5pt; color: #555; text-align: center;
    }
    .presentation-overlay { display: none !important; }
}

/* ════════════════════════════════════════════════════════════════
   v14.0 "Arsenal" — Session Builder · Symptom Assistant ·
   Daily Pair · Swipe Gestures · Keyboard Shortcuts Help
   ════════════════════════════════════════════════════════════════ */

:root { --gradient-assistant: linear-gradient(135deg, #A855F7 0%, #EC4899 100%); }
.hero-assistant::before { background: var(--gradient-assistant); }
.hero-assistant .section-hero-icon { background: var(--gradient-assistant); }

/* ═══════════ SESSION BUILDER (plan queue) ═══════════ */
.plan-badge {
    position: absolute; top: -3px; right: -3px;
    min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 999px; background: var(--red); color: white;
    font-size: 0.58rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
}
#sessionPlanBtn { position: relative; }
#detailAddPlanBtn.in-plan { color: var(--primary); background: var(--primary-bg); }

.plan-overlay {
    position: fixed; inset: 0; z-index: 440; display: none;
    background: rgba(10,14,26,0.6); backdrop-filter: blur(6px);
    align-items: center; justify-content: center; padding: 16px;
}
.plan-overlay.active { display: flex; animation: fadeIn 0.2s ease; }
.plan-panel {
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius-xl); box-shadow: var(--shadow-xl);
    max-width: 520px; width: 100%; max-height: 84vh;
    display: flex; flex-direction: column;
    animation: slideUp 0.25s var(--ease);
}
.plan-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px; border-bottom: 1px solid var(--border-light);
}
.plan-header h3 { font-size: 1.02rem; font-weight: 800; display: flex; align-items: center; gap: 9px; }
.plan-body { overflow-y: auto; padding: 12px 16px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.plan-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    background: var(--bg-card); border: 1px solid var(--border);
}
.plan-item-num {
    width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
    background: var(--primary-bg); color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.74rem; font-weight: 800;
}
.plan-item-info { flex: 1; min-width: 0; }
.plan-item-name { font-size: 0.84rem; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-item-points { font-size: 0.68rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-item-actions { display: flex; gap: 4px; flex-shrink: 0; }
.plan-item-actions button {
    width: 28px; height: 28px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-surface); color: var(--text-secondary); font-size: 0.68rem;
    transition: var(--transition);
}
.plan-item-actions button:hover:not([disabled]) { background: var(--primary-bg); color: var(--primary); }
.plan-item-actions button[disabled] { opacity: 0.35; }
.plan-item-actions .plan-remove:hover { background: var(--red-bg) !important; color: var(--red) !important; }
.plan-footer { padding: 12px 16px 16px; border-top: 1px solid var(--border-light); }
.plan-summary { font-size: 0.76rem; color: var(--text-muted); font-weight: 600; margin-bottom: 10px; text-align: center; }
.plan-footer-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ═══════════ SESSION RUN WIZARD ═══════════ */
.plan-run-overlay {
    position: fixed; inset: 0; z-index: 460; display: none;
    background: #0B1020; color: #F1F5F9;
    overflow-y: auto;
}
.plan-run-overlay.active { display: block; animation: fadeIn 0.2s ease; }
.plan-run-panel {
    max-width: 560px; margin: 0 auto; padding: 0 18px 30px;
    display: flex; flex-direction: column; align-items: center; text-align: center;
}
.run-progressbar { width: 100vw; margin-left: calc(50% - 50vw); height: 5px; background: rgba(255,255,255,0.08); }
.run-progressbar-fill { height: 100%; background: var(--gradient-primary); transition: width 0.4s var(--ease); }
.run-topbar { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 14px 0; }
.run-step-label { font-size: 0.76rem; font-weight: 700; color: #94A3B8; text-transform: uppercase; letter-spacing: 0.08em; }
.run-pair-name { font-family: var(--font-display); font-size: clamp(1.2rem, 4vw, 1.7rem); font-weight: 800; color: white; margin-bottom: 12px; }
.run-poles { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 16px; }
.run-pole { padding: 8px 16px; border-radius: 999px; font-size: 0.8rem; background: rgba(255,255,255,0.06); color: #CBD5E1; }
.run-pole.neg b { color: #93C5FD; margin-right: 5px; }
.run-pole.pos b { color: #FCA5A5; margin-right: 5px; }
.run-diagrams { display: flex; gap: 14px; justify-content: center; width: 100%; margin-bottom: 16px; }
.run-diagram { flex: 1; max-width: 250px; }
.run-diagrams.two .run-diagram { max-width: 220px; }
.run-timer { font-family: var(--font-mono); font-size: 2.6rem; font-weight: 700; color: white; margin-bottom: 12px; }
.run-controls { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.plan-run-overlay .session-ctrl-btn { background: rgba(255,255,255,0.08); color: #E2E8F0; }
.plan-run-overlay .session-hint { color: #64748B; max-width: 380px; }

/* ═══════════ SYMPTOM ASSISTANT ═══════════ */
.assistant-groups { display: flex; flex-direction: column; gap: 16px; margin-bottom: 18px; }
.assistant-group {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 14px 16px;
}
.assistant-group-title {
    display: flex; align-items: center; gap: 10px;
    font-size: 0.86rem; font-weight: 700; color: var(--text); margin-bottom: 11px;
}
.assistant-group-icon {
    width: 30px; height: 30px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center; font-size: 0.8rem;
}
.assistant-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.assistant-chip {
    padding: 8px 14px; border-radius: var(--radius-full);
    background: var(--bg-surface); border: 1.5px solid var(--border);
    font-size: 0.78rem; font-weight: 600; color: var(--text-secondary);
    transition: var(--transition);
}
.assistant-chip:hover { border-color: var(--primary); color: var(--primary); }
.assistant-chip.active {
    background: var(--primary); border-color: var(--primary); color: white;
    box-shadow: 0 4px 12px rgba(91,91,214,0.3);
}
.assistant-action-bar {
    position: sticky; bottom: calc(var(--bottom-nav-h) + 10px + env(safe-area-inset-bottom, 0px));
    z-index: 50;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    padding: 10px 14px; margin-bottom: 16px; flex-wrap: wrap;
}
.assistant-count { font-size: 0.78rem; font-weight: 700; color: var(--text-secondary); }
.assistant-action-btns { display: flex; gap: 8px; }
.assistant-action-btns .empty-state-btn { padding: 9px 16px; font-size: 0.78rem; }
.assistant-disclaimer {
    font-size: 0.72rem; color: var(--text-muted);
    background: var(--bg-surface); border-radius: var(--radius-sm);
    padding: 9px 12px; margin-bottom: 14px;
}
.assistant-result-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 14px; cursor: pointer;
    transition: var(--transition);
}
.assistant-result-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.assistant-result-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.assistant-match {
    font-size: 0.68rem; font-weight: 800; color: var(--primary);
    background: var(--primary-bg); padding: 3px 10px; border-radius: 999px; flex-shrink: 0;
}
.assistant-match-bar {
    height: 5px; border-radius: 999px; background: var(--bg-surface);
    overflow: hidden; margin: 8px 0 10px;
}
.assistant-match-bar div { height: 100%; background: var(--gradient-assistant); border-radius: 999px; }
.assistant-result-actions { display: flex; gap: 8px; margin-top: 10px; }
.assistant-mini-btn {
    flex: 1; padding: 7px 10px; border-radius: var(--radius-sm);
    background: var(--bg-surface); color: var(--text-secondary);
    font-size: 0.72rem; font-weight: 700; transition: var(--transition);
    display: flex; align-items: center; justify-content: center; gap: 6px;
}
.assistant-mini-btn:hover { background: var(--primary-bg); color: var(--primary); }

/* ═══════════ DAILY PAIR CARD ═══════════ */
.daily-pair-card {
    border-radius: var(--radius-lg); overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-card);
    margin-bottom: 16px;
    box-shadow: var(--shadow-md);
    animation: slideDown 0.3s var(--ease);
}
.daily-pair-ribbon {
    background: var(--gradient-primary); color: white;
    font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em;
    padding: 8px 16px; display: flex; align-items: center; gap: 7px;
}
.daily-pair-body { padding: 14px 16px; }
.daily-pair-name { font-family: var(--font-display); font-size: 1.1rem; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.daily-pair-points { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 8px; }
.daily-pair-points .dp-n, .daily-pair-points .dp-s {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; border-radius: 50%; color: white; font-size: 0.58rem; margin-right: 5px;
}
.daily-pair-points .dp-n { background: var(--gradient-neg, #1D4ED8); }
.daily-pair-points .dp-s { background: var(--gradient-pos, #DC2626); }
.daily-pair-symptoms { font-size: 0.76rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 12px; }
.daily-pair-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 18px; border-radius: var(--radius-full);
    background: var(--primary-bg); color: var(--primary);
    font-size: 0.78rem; font-weight: 700; transition: var(--transition);
}
.daily-pair-btn:hover { background: var(--primary); color: white; }

/* ═══════════ SWIPE FEEDBACK ═══════════ */
.detail-panel.swipe-left { animation: swipeLeft 0.25s ease; }
.detail-panel.swipe-right { animation: swipeRight 0.25s ease; }
@keyframes swipeLeft { 0% { transform: translateX(0); } 40% { transform: translateX(-14px); } 100% { transform: translateX(0); } }
@keyframes swipeRight { 0% { transform: translateX(0); } 40% { transform: translateX(14px); } 100% { transform: translateX(0); } }

/* ═══════════ SHORTCUTS HELP ═══════════ */
.shortcuts-overlay {
    position: fixed; inset: 0; z-index: 470; display: none;
    background: rgba(10,14,26,0.6); backdrop-filter: blur(6px);
    align-items: center; justify-content: center; padding: 16px;
}
.shortcuts-overlay.active { display: flex; animation: fadeIn 0.2s ease; }
.shortcuts-panel {
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius-xl); box-shadow: var(--shadow-xl);
    max-width: 420px; width: 100%;
    animation: slideUp 0.25s var(--ease);
}
.shortcuts-body { padding: 14px 20px 20px; display: flex; flex-direction: column; gap: 4px; }
.shortcut-row {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 9px 0; border-bottom: 1px solid var(--border-light);
    font-size: 0.82rem; color: var(--text-secondary);
}
.shortcut-row:last-child { border-bottom: none; }

@media print {
    .plan-overlay, .plan-run-overlay, .shortcuts-overlay, .daily-pair-card,
    .assistant-action-bar { display: none !important; }
}

/* ════════════════════════════════════════════════════════════════
   v15.0 "Sin Límites" — Modo Estudio (Flashcards + Quiz) ·
   Insights · Tour de Bienvenida · Plantillas de Protocolo
   ════════════════════════════════════════════════════════════════ */

:root { --gradient-study: linear-gradient(135deg, #0EA5E9 0%, #6366F1 100%); }
.hero-study::before { background: var(--gradient-study); }
.hero-study .section-hero-icon { background: var(--gradient-study); }

/* ═══════════ STUDY: stats + mode toggle ═══════════ */
.study-stats-row {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 12px; margin-bottom: 18px;
}
.study-mode-toggle {
    display: flex; gap: 8px; margin-bottom: 22px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-full); padding: 5px; width: fit-content;
    margin-left: auto; margin-right: auto;
}
.study-mode-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 22px; border-radius: var(--radius-full);
    font-size: 0.82rem; font-weight: 700; color: var(--text-secondary);
    transition: var(--transition);
}
.study-mode-btn.active { background: var(--gradient-study); color: white; box-shadow: var(--shadow-md); }

/* ═══════════ STUDY: flashcard 3D ═══════════ */
.study-card-wrap { max-width: 560px; margin: 0 auto; }
.study-flashcard {
    perspective: 1200px; cursor: pointer; outline: none;
    height: 320px; margin-bottom: 16px;
}
.study-flashcard:focus-visible .study-flashcard-inner { box-shadow: 0 0 0 3px var(--primary); }
.study-flashcard-inner {
    position: relative; width: 100%; height: 100%;
    transition: transform 0.55s cubic-bezier(0.4, 0.2, 0.2, 1);
    transform-style: preserve-3d;
    border-radius: var(--radius-xl);
}
.study-flashcard.flipped .study-flashcard-inner { transform: rotateY(180deg); }
.study-face {
    position: absolute; inset: 0;
    backface-visibility: hidden; -webkit-backface-visibility: hidden;
    border-radius: var(--radius-xl);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 14px; padding: 26px; text-align: center;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}
.study-front { background: var(--bg-elevated); }
.study-back { background: var(--bg-card); transform: rotateY(180deg); }
.study-face-label {
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--text-muted);
    display: flex; align-items: center; gap: 8px;
}
.study-pair-name {
    font-family: var(--font-display); font-size: 1.5rem; font-weight: 800;
    color: var(--text); line-height: 1.25;
}
.study-lvl { display: flex; gap: 6px; }
.study-lvl-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--border); transition: var(--transition);
}
.study-lvl-dot.on { background: var(--gradient-study); }
.study-flip-hint {
    font-size: 0.74rem; color: var(--text-muted);
    display: flex; align-items: center; gap: 7px; margin-top: 6px;
}
.study-answer-poles { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.study-answer-pole {
    padding: 12px 16px; border-radius: var(--radius-lg);
    font-size: 0.95rem; color: var(--text); text-align: left;
    display: flex; flex-direction: column; gap: 3px;
}
.study-answer-pole small { color: var(--text-muted); font-size: 0.72rem; }
.study-answer-pole.neg { background: rgba(29,78,216,0.10); border: 1px solid rgba(29,78,216,0.30); }
.study-answer-pole.pos { background: rgba(220,38,38,0.10); border: 1px solid rgba(220,38,38,0.30); }
.study-answer-extra {
    font-size: 0.78rem; color: var(--text-secondary);
    display: flex; align-items: center; gap: 8px;
}

/* ═══════════ STUDY: card actions ═══════════ */
.study-card-actions { display: flex; gap: 12px; justify-content: center; margin-bottom: 12px; }
.study-act-btn {
    display: inline-flex; align-items: center; gap: 9px;
    padding: 11px 26px; border-radius: var(--radius-full);
    font-size: 0.84rem; font-weight: 700; transition: var(--transition);
}
.study-act-btn.fail { background: var(--amber-bg); color: var(--amber); }
.study-act-btn.fail:hover { background: var(--amber); color: white; }
.study-act-btn.ok { background: var(--green-bg, rgba(16,185,129,0.12)); color: var(--green, #10B981); }
.study-act-btn.ok:hover { background: var(--green, #10B981); color: white; }
.study-deck-info { text-align: center; font-size: 0.76rem; color: var(--text-muted); }
.study-link-btn { color: var(--primary); font-weight: 600; font-size: 0.76rem; }
.study-link-btn:hover { text-decoration: underline; }

/* ═══════════ STUDY: quiz ═══════════ */
.study-quiz-intro {
    max-width: 480px; margin: 0 auto; text-align: center;
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius-xl); padding: 34px 28px;
    box-shadow: var(--shadow-md);
}
.study-quiz-icon {
    width: 64px; height: 64px; border-radius: 50%;
    background: var(--gradient-study); color: white; font-size: 1.6rem;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
}
.study-quiz-intro h3 { font-family: var(--font-display); font-size: 1.3rem; margin-bottom: 10px; color: var(--text); }
.study-quiz-intro p { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.6; margin-bottom: 14px; }
.study-quiz-meta { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 20px; }
.study-quiz-score {
    font-family: var(--font-display); font-size: 2.6rem; font-weight: 800;
    background: var(--gradient-study); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}
.study-quiz-hud {
    display: flex; justify-content: center; gap: 22px;
    font-size: 0.8rem; font-weight: 700; color: var(--text-secondary);
    margin-bottom: 18px;
}
.study-quiz-question {
    max-width: 560px; margin: 0 auto 20px; text-align: center;
    font-size: 1.05rem; color: var(--text); line-height: 1.55;
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius-xl); padding: 22px 24px;
}
.study-quiz-options {
    max-width: 560px; margin: 0 auto;
    display: flex; flex-direction: column; gap: 10px;
}
.study-quiz-option {
    display: flex; align-items: center; gap: 14px;
    padding: 13px 16px; border-radius: var(--radius-lg);
    background: var(--bg-card); border: 1px solid var(--border);
    font-size: 0.88rem; color: var(--text); text-align: left;
    transition: var(--transition);
}
.study-quiz-option:hover:not(:disabled) { border-color: var(--primary); transform: translateX(4px); }
.study-quiz-option:disabled { cursor: default; }
.study-quiz-letter {
    width: 28px; height: 28px; flex-shrink: 0; border-radius: 8px;
    background: var(--bg-elevated); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.74rem; font-weight: 800; color: var(--text-secondary);
}
.study-quiz-option.correct {
    background: var(--green-bg, rgba(16,185,129,0.12));
    border-color: var(--green, #10B981); color: var(--green, #10B981); font-weight: 700;
}
.study-quiz-option.correct .study-quiz-letter { background: var(--green, #10B981); color: white; border-color: transparent; }
.study-quiz-option.wrong {
    background: var(--red-bg); border-color: var(--red); color: var(--red); font-weight: 700;
    animation: shakeX 0.4s ease;
}
.study-quiz-option.wrong .study-quiz-letter { background: var(--red); color: white; border-color: transparent; }
@keyframes shakeX { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* ═══════════ INSIGHTS: top consultados + recordatorios ═══════════ */
.insights-card {
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius-xl); padding: 20px; margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}
.insights-card h3 {
    font-family: var(--font-display); font-size: 1rem; color: var(--text);
    display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
.insights-card h3 i { color: var(--primary); }
.insights-top-list { display: flex; flex-direction: column; gap: 8px; }
.insights-top-item {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 12px; border-radius: var(--radius-lg);
    background: var(--bg-card); border: 1px solid var(--border-light);
    font-size: 0.82rem; color: var(--text); cursor: pointer;
    transition: var(--transition); width: 100%; text-align: left;
}
.insights-top-item:hover { border-color: var(--primary); transform: translateX(4px); }
.insights-rank {
    width: 24px; height: 24px; flex-shrink: 0; border-radius: 50%;
    background: var(--gradient-study); color: white;
    font-size: 0.68rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
}
.insights-count { margin-left: auto; font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; }
.insights-reminder {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 12px 14px; border-radius: var(--radius-lg);
    background: var(--amber-bg); border: 1px solid var(--amber);
    font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5;
    margin-bottom: 10px;
}
.insights-reminder i { color: var(--amber); margin-top: 2px; }
.insights-reminder b { color: var(--text); }
.insights-reminder-btn {
    margin-left: auto; flex-shrink: 0; align-self: center;
    padding: 7px 14px; border-radius: var(--radius-full);
    background: var(--amber); color: white; font-size: 0.72rem; font-weight: 700;
    transition: var(--transition);
}
.insights-reminder-btn:hover { filter: brightness(1.1); }
.insights-empty { font-size: 0.8rem; color: var(--text-muted); padding: 6px 0; }

/* ═══════════ TOUR DE BIENVENIDA ═══════════ */
.tour-backdrop {
    position: fixed; inset: 0; z-index: 520;
    background: rgba(10,14,26,0.55);
    animation: fadeIn 0.25s ease;
}
.tour-spotlight {
    position: fixed; z-index: 521; pointer-events: none;
    border-radius: 14px;
    box-shadow: 0 0 0 4px var(--primary), 0 0 0 9999px rgba(10,14,26,0.62);
    transition: all 0.4s var(--ease);
}
.tour-tooltip {
    position: fixed; z-index: 522;
    max-width: 340px; width: calc(100vw - 32px);
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius-xl); box-shadow: var(--shadow-xl);
    padding: 18px 20px;
    animation: slideUp 0.3s var(--ease);
}
.tour-step-num {
    font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--primary); margin-bottom: 7px;
}
.tour-tooltip h4 {
    font-family: var(--font-display); font-size: 1.02rem; color: var(--text);
    display: flex; align-items: center; gap: 9px; margin-bottom: 8px;
}
.tour-tooltip p { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.55; margin-bottom: 14px; }
.tour-actions { display: flex; align-items: center; gap: 10px; }
.tour-skip-btn { font-size: 0.76rem; color: var(--text-muted); font-weight: 600; }
.tour-skip-btn:hover { color: var(--text); }
.tour-next-btn {
    margin-left: auto; display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 20px; border-radius: var(--radius-full);
    background: var(--gradient-study); color: white;
    font-size: 0.78rem; font-weight: 700; transition: var(--transition);
}
.tour-next-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.tour-dots { display: flex; gap: 5px; }
.tour-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border); transition: var(--transition); }
.tour-dot.on { background: var(--primary); }

/* ═══════════ PLAN: plantillas de protocolo ═══════════ */
.plan-templates-toggle {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 16px; border-radius: var(--radius-full);
    background: var(--primary-bg); color: var(--primary);
    font-size: 0.76rem; font-weight: 700; transition: var(--transition);
}
.plan-templates-toggle:hover { background: var(--primary); color: white; }
.plan-templates-list {
    display: none; flex-direction: column; gap: 8px;
    margin-top: 12px; max-height: 260px; overflow-y: auto;
}
.plan-templates-list.open { display: flex; }
.plan-template-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: var(--radius-lg);
    background: var(--bg-card); border: 1px solid var(--border-light);
    font-size: 0.8rem; color: var(--text); text-align: left;
    transition: var(--transition); width: 100%;
}
.plan-template-item:hover { border-color: var(--primary); }
.plan-template-item i { color: var(--primary); flex-shrink: 0; }
.plan-template-count { margin-left: auto; font-size: 0.7rem; color: var(--text-muted); white-space: nowrap; }

@media (max-width: 640px) {
    .study-stats-row { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .study-flashcard { height: 300px; }
    .study-pair-name { font-size: 1.25rem; }
}

@media print {
    .tour-backdrop, .tour-tooltip, .tour-spotlight { display: none !important; }
}
