*{box-sizing:border-box}body{margin:0;background:#f4f6f8;color:#172033;font-family:system-ui,-apple-system,"Segoe UI",sans-serif}
header{height:64px;background:#fff;border-bottom:1px solid #e5e7eb;display:flex;align-items:center;gap:8px;padding:0 24px}
header span{color:#667085}header a{margin-left:auto;text-decoration:none;color:#344054}
main{max-width:1000px;margin:auto;padding:28px 18px 60px}.hero{padding:35px 0}.hero small{font-weight:800;letter-spacing:.12em;color:#667085}
h1{font-size:clamp(34px,6vw,52px);margin:8px 0}h2{line-height:1.4}
.btn{display:inline-block;border:0;border-radius:10px;background:#1d2939;color:white;padding:12px 18px;text-decoration:none;font-weight:700;cursor:pointer}
.card{background:white;border:1px solid #e5e7eb;border-radius:16px;padding:20px;margin-bottom:16px}
.topics{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:10px}.topic{padding:15px;border:1px solid #e5e7eb;border-radius:12px;text-decoration:none;color:inherit}
.topic small{display:block;color:#667085;margin-top:5px}.question{margin-bottom:18px}.option{display:flex;gap:10px;padding:12px;border:1px solid #e5e7eb;border-radius:10px;margin:8px 0;cursor:pointer}
.explanation{margin-top:14px;padding:14px;border-radius:10px;background:#f2f4f7}
@media(max-width:600px){header{padding:0 14px}main{padding:18px 12px 45px}}

.section-head{display:flex;justify-content:space-between;align-items:center;gap:1rem}.badge,.status{display:inline-block;padding:.35rem .65rem;border-radius:999px;background:#eef2ff;color:#3730a3;font-size:.82rem}.topic{display:flex;justify-content:space-between;align-items:center;gap:1rem}.topic div{display:flex;flex-direction:column;gap:.25rem}.topic small{white-space:nowrap}.hero.compact{padding-bottom:1.5rem}.secondary{background:#fff!important;color:#111827!important;border:1px solid #d1d5db}.breadcrumbs{margin:1rem 0}.breadcrumbs a{color:inherit}.question-card{border:1px solid #e5e7eb;border-radius:14px;padding:1.2rem;margin:1rem 0;background:#fff}.question-top{display:flex;justify-content:space-between;align-items:center}.question-number{font-weight:700;color:#6b7280}.question-card h3{margin:.8rem 0}.question-card ol{padding-left:1.5rem}.question-card li{padding:.45rem}.question-card li.correct{font-weight:700;background:#ecfdf5;border-radius:8px}.question-meta{display:flex;gap:1rem;flex-wrap:wrap;color:#6b7280;font-size:.85rem;border-top:1px solid #eee;padding-top:.8rem}.explanation{background:#f9fafb;padding:.8rem;border-radius:8px}.actions{display:flex;gap:.6rem;align-items:center;margin-top:1rem}.btn.small{padding:.45rem .8rem;font-size:.9rem}.btn.danger{background:#fee2e2!important;color:#991b1b!important}.form-card form{display:flex;flex-direction:column;gap:1rem}.form-card label{display:flex;flex-direction:column;gap:.4rem;font-weight:600}.form-card input,.form-card textarea,.form-card select{font:inherit;padding:.7rem;border:1px solid #d1d5db;border-radius:8px}.form-card textarea{min-height:100px;resize:vertical}.form-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:1rem}.form-grid label{min-width:0}@media(max-width:700px){.form-grid{grid-template-columns:1fr}.section-head{align-items:flex-start}.topic{align-items:flex-start;flex-direction:column}}

.history { margin-top: 14px; padding-top: 10px; border-top: 1px solid #e5e7eb; }
.history summary { cursor: pointer; font-weight: 600; }
.history-list { margin-top: 10px; display: grid; gap: 8px; }
.history-item { padding: 9px 11px; border-radius: 8px; background: #f8fafc; font-size: .9rem; }

/* Corrección visual del test */
.option{transition:background-color .15s ease,border-color .15s ease,box-shadow .15s ease}
.option-correct{background:#ecfdf3!important;border-color:#22c55e!important;color:#166534}
.option-correct span{font-weight:700}
.option-incorrect{background:#fef2f2!important;border-color:#ef4444!important;color:#991b1b}
.option-incorrect span{font-weight:700}
.option-correct input,.option-incorrect input{accent-color:currentColor}
.explanation{border-left:4px solid #d1d5db}
.reinforcement-form{display:flex;flex-direction:column;gap:1rem}.reinforcement-toolbar{display:flex;gap:.6rem;flex-wrap:wrap}.topic-selector{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:9px;max-height:560px;overflow:auto;padding-right:4px}.topic-check{display:flex!important;flex-direction:row!important;align-items:flex-start;gap:10px!important;padding:12px;border:1px solid #e5e7eb;border-radius:10px;cursor:pointer;background:#fff}.topic-check:has(input:checked){background:#eefdf5;border-color:#22c55e}.topic-check input{margin-top:4px}.topic-check span{display:flex;flex-direction:column;gap:3px;font-weight:400!important}.topic-check span strong{font-weight:800}.number-label{display:flex;flex-direction:column;gap:.4rem;font-weight:700}.number-label select{font:inherit;padding:.7rem;border:1px solid #d1d5db;border-radius:8px;max-width:180px}

.weak-dashboard{border-left:4px solid #f59e0b}.progress-list{display:grid;gap:10px;margin:14px 0 18px}.progress-row{display:grid;grid-template-columns:130px 1fr 55px;align-items:center;gap:10px}.progress-row div:first-child{display:flex;flex-direction:column;gap:2px}.progress-row small{color:#667085}.progress{height:10px;background:#e5e7eb;border-radius:999px;overflow:hidden}.progress span{display:block;height:100%;background:#f59e0b;border-radius:999px}.success-note{color:#166534;font-weight:600}@media(max-width:600px){.progress-row{grid-template-columns:95px 1fr 45px}}
.exam-bar{display:flex;justify-content:space-between;align-items:center;position:sticky;top:8px;z-index:5}.timer{font-size:1.5rem;font-weight:800;font-variant-numeric:tabular-nums}.timer.warning{font-weight:900}.reserve-section{margin-top:28px}.reserve-question{padding:18px 0;border-top:1px solid #ddd}.danger{margin-top:20px}.tribunal-question{scroll-margin-top:80px}.muted{opacity:.72}

.user-pill{margin-left:auto!important;color:#667085}header nav{display:flex;align-items:center;gap:14px;margin-left:auto}header nav a{margin-left:0}.user-create-form{align-items:end}.user-row{display:flex;justify-content:space-between;gap:1rem;padding:16px 0;border-top:1px solid #e5e7eb}.user-row:first-of-type{border-top:0}.user-row .actions{margin-top:0;flex-wrap:wrap;justify-content:flex-end}.user-row form{display:flex;gap:.45rem;align-items:center}.user-row input,.user-row select{font:inherit;padding:.55rem;border:1px solid #d1d5db;border-radius:8px}@media(max-width:700px){header{height:auto;min-height:64px;padding:12px 14px;align-items:flex-start}header nav{flex-wrap:wrap;justify-content:flex-end}.user-row{flex-direction:column}.user-row .actions{justify-content:flex-start}}

.auth-shell{min-height:70vh;display:grid;place-items:center;padding:2rem 1rem}.auth-card{width:min(100%,460px);background:var(--card,#fff);border:1px solid var(--border,#ddd);border-radius:18px;padding:2rem;box-shadow:0 12px 35px rgba(0,0,0,.08)}.auth-card h1{margin:.25rem 0 .75rem}.auth-card form{display:grid;gap:1rem;margin-top:1.5rem}.auth-card label{display:grid;gap:.4rem;font-weight:600}.auth-card input{width:100%;box-sizing:border-box;padding:.75rem;border:1px solid var(--border,#ccc);border-radius:10px}.auth-card button{padding:.8rem 1rem;border:0;border-radius:10px;cursor:pointer}.auth-card .primary{background:#111;color:#fff}.eyebrow{text-transform:uppercase;font-size:.75rem;font-weight:800;letter-spacing:.08em;opacity:.65}.small{font-size:.82rem}.muted{opacity:.72}.flash{margin-top:1rem;padding:.75rem;border-radius:10px}.flash.error{background:#fee}.flash.success{background:#efe}

/* ===== Convocalia Study · sistema visual ===== */
:root{--accent:#4f46e5;--accent-strong:#4338ca;--accent-soft:#eef2ff;--bg:#f4f6f8;--surface:#fff;--surface-2:#f8fafc;--text:#172033;--muted:#667085;--border:#e5e7eb;--shadow:0 10px 30px rgba(15,23,42,.07)}
html{background:var(--bg)} body{background:var(--bg);color:var(--text);transition:background .2s,color .2s}header{background:var(--surface);border-bottom-color:var(--border);box-shadow:0 1px 0 rgba(15,23,42,.02);position:sticky;top:0;z-index:20}header a{color:var(--text)}header span{color:var(--muted)}
.brand{font-size:1.08rem;display:flex;gap:.35rem;align-items:baseline}.brand b{color:var(--text)}.brand span{color:var(--accent);font-weight:800}
.card,.question-card,.topic,.option,.topic-check{background:var(--surface);border-color:var(--border);box-shadow:0 1px 2px rgba(15,23,42,.02)}.card,.question-card{box-shadow:var(--shadow)}.topic:hover{border-color:var(--accent);transform:translateY(-1px);transition:.16s}.topic{transition:.16s}.topic small,.muted,.question-number,.question-meta{color:var(--muted)}
.btn{background:var(--accent);box-shadow:0 5px 14px color-mix(in srgb,var(--accent) 22%,transparent)}.btn:hover{background:var(--accent-strong)}.secondary{background:var(--surface)!important;color:var(--text)!important;border-color:var(--border)}.badge,.status{background:var(--accent-soft);color:var(--accent-strong)}.explanation{background:var(--surface-2);border-left-color:var(--accent)}.history{border-top-color:var(--border)}.history-item{background:var(--surface-2)}.progress{background:var(--border)}.progress span{background:var(--accent)}.weak-dashboard{border-left-color:var(--accent)}
.form-card input,.form-card textarea,.form-card select,.number-label select,.user-row input,.user-row select{background:var(--surface);color:var(--text);border-color:var(--border)}.option:hover,.topic-check:hover{border-color:var(--accent)}.topic-check:has(input:checked){background:var(--accent-soft);border-color:var(--accent)}
.theme-toggle,.settings-toggle{margin:0!important;border:1px solid var(--border);background:var(--surface);color:var(--text);border-radius:9px;width:34px;height:34px;cursor:pointer;font-size:1rem;display:grid;place-items:center}.theme-toggle:hover,.settings-toggle:hover{border-color:var(--accent);color:var(--accent)}
.appearance-panel{position:fixed;inset:0;background:rgba(15,23,42,.28);backdrop-filter:blur(3px);z-index:50}.appearance-panel-inner{position:absolute;right:18px;top:76px;width:min(360px,calc(100vw - 28px));background:var(--surface);border:1px solid var(--border);border-radius:18px;padding:18px;box-shadow:0 24px 60px rgba(15,23,42,.2)}.appearance-head{display:flex;justify-content:space-between;align-items:center;font-size:1.05rem}.appearance-head button{border:0;background:transparent;color:var(--muted);font-size:1.5rem;cursor:pointer}.appearance-section{margin-top:18px}.appearance-label{display:block;font-weight:800;font-size:.88rem;margin-bottom:9px}.mode-buttons{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}.mode-buttons button{border:1px solid var(--border);background:var(--surface-2);color:var(--text);border-radius:10px;padding:9px 6px;cursor:pointer;font:inherit;font-size:.82rem}.mode-buttons button.active{border-color:var(--accent);background:var(--accent-soft);color:var(--accent-strong);font-weight:800}.accent-grid{display:grid;grid-template-columns:repeat(8,1fr);gap:9px}.accent-choice{border:2px solid transparent;background:transparent;padding:2px;border-radius:50%;cursor:pointer}.accent-choice span{display:block;width:29px;height:29px;border-radius:50%;background:var(--swatch);box-shadow:inset 0 0 0 1px rgba(0,0,0,.1)}.accent-choice.active{border-color:var(--text)}
[data-accent="indigo"]{--accent:#4f46e5;--accent-strong:#4338ca;--accent-soft:#eef2ff}[data-accent="blue"]{--accent:#2563eb;--accent-strong:#1d4ed8;--accent-soft:#eff6ff}[data-accent="cyan"]{--accent:#0891b2;--accent-strong:#0e7490;--accent-soft:#ecfeff}[data-accent="green"]{--accent:#16a34a;--accent-strong:#15803d;--accent-soft:#f0fdf4}[data-accent="teal"]{--accent:#0d9488;--accent-strong:#0f766e;--accent-soft:#f0fdfa}[data-accent="orange"]{--accent:#ea580c;--accent-strong:#c2410c;--accent-soft:#fff7ed}[data-accent="rose"]{--accent:#e11d48;--accent-strong:#be123c;--accent-soft:#fff1f2}[data-accent="purple"]{--accent:#9333ea;--accent-strong:#7e22ce;--accent-soft:#faf5ff}
.accent-choice[data-accent="indigo"]{--swatch:#4f46e5}.accent-choice[data-accent="blue"]{--swatch:#2563eb}.accent-choice[data-accent="cyan"]{--swatch:#0891b2}.accent-choice[data-accent="green"]{--swatch:#16a34a}.accent-choice[data-accent="teal"]{--swatch:#0d9488}.accent-choice[data-accent="orange"]{--swatch:#ea580c}.accent-choice[data-accent="rose"]{--swatch:#e11d48}.accent-choice[data-accent="purple"]{--swatch:#9333ea}
html[data-theme="dark"]{--bg:#0b1020;--surface:#121a2b;--surface-2:#182235;--text:#e8edf7;--muted:#9aa7bd;--border:#27344b}html[data-theme="dark"] header{box-shadow:0 1px 0 rgba(255,255,255,.03)}html[data-theme="dark"] .option-correct{background:#0d2b1b!important;color:#86efac}html[data-theme="dark"] .option-incorrect{background:#35151b!important;color:#fda4af}html[data-theme="dark"] .danger{background:#35151b!important;color:#fda4af!important}.flash.error{background:#fee2e2;color:#991b1b}.flash.success{background:#dcfce7;color:#166534}
@media(max-width:600px){.appearance-panel-inner{right:10px;top:70px}.accent-grid{grid-template-columns:repeat(4,1fr);gap:10px}.accent-choice span{margin:auto}}

/* Test corregido: mantiene la respuesta elegida visible y bloquea cambios. */
.option-selected{box-shadow:inset 0 0 0 2px currentColor;}
.option-selected input:disabled{opacity:1;}
#quiz button[type="submit"]:disabled{opacity:.75;cursor:not-allowed;}
#quiz.submitted .option{cursor:default;}
