
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
:root{--bg:#07111f;--card:#fff;--text:#111827;--muted:#64748b;--line:#e5e7eb;--primary:#2563eb;--primary2:#dbeafe;--ok:#166534;--okbg:#dcfce7;--bad:#991b1b;--badbg:#fee2e2;--soft:#f8fafc}
html,body{margin:0;min-height:100%;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;color:var(--text);background:linear-gradient(180deg,#07111f 0,#0f172a 250px,#eef2f7 250px)}
.app{max-width:960px;margin:0 auto;padding:calc(12px + env(safe-area-inset-top)) 10px calc(30px + env(safe-area-inset-bottom))}
.hero{display:flex;justify-content:space-between;align-items:flex-start;gap:10px;color:#fff;padding:12px 6px 16px}
.hero h1{font-size:1.45rem;line-height:1.1;margin:0 0 6px;font-weight:900}.hero p{margin:0;color:#cbd5e1;font-size:.92rem}
.pill{font-size:.72rem;background:#dcfce7;color:#166534;border-radius:999px;padding:6px 8px;white-space:nowrap;font-weight:800}
.tabs{display:grid;grid-template-columns:repeat(4,1fr);gap:7px;margin:0 0 12px}.tabs button{border:1px solid rgba(255,255,255,.35);background:rgba(255,255,255,.12);color:#fff;border-radius:14px;padding:10px 6px;font-weight:850}.tabs button.active{background:#fff;color:#0f172a}
.card{background:#fff;border-radius:22px;padding:15px;margin-bottom:13px;box-shadow:0 18px 45px rgba(2,6,23,.16);border:1px solid rgba(255,255,255,.7)}
.grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}.tile{background:#f8fafc;border:1px solid #e5e7eb;border-radius:18px;padding:14px;text-align:left;min-height:90px}.tile b{display:block;font-size:1.05rem;margin-bottom:6px}.tile span{color:#64748b;font-size:.9rem;line-height:1.35}
button{appearance:none;border:0;border-radius:16px;padding:13px;font-size:1rem;font-weight:850;cursor:pointer}.primary{background:#2563eb;color:#fff}.secondary{background:#e2e8f0;color:#0f172a}.danger{background:#fee2e2;color:#991b1b}button:disabled{opacity:.48}
.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.stat{background:#f8fafc;border:1px solid #e5e7eb;border-radius:16px;padding:10px 6px;text-align:center}.stat b{display:block;font-size:1.14rem}.stat span{font-size:.74rem;color:#64748b}
.progress{height:10px;background:#e2e8f0;border-radius:999px;overflow:hidden;margin-top:12px}.progress div{height:100%;width:0;background:linear-gradient(90deg,#2563eb,#38bdf8)}
.qtop{display:flex;justify-content:space-between;gap:8px;align-items:center;border-bottom:1px solid #e5e7eb;padding-bottom:11px;margin-bottom:13px}.qnum{font-weight:900;color:#2563eb}.mode{font-size:.78rem;color:#475569;background:#f1f5f9;border:1px solid #e2e8f0;border-radius:999px;padding:6px 9px}
.badge{display:inline-block;font-size:.72rem;background:#eef2ff;color:#3730a3;border:1px solid #c7d2fe;border-radius:999px;padding:5px 8px;margin:0 5px 6px 0}.question{font-size:1.12rem;font-weight:850;line-height:1.42;margin:10px 0 15px}
.options{display:grid;gap:10px}.option{width:100%;text-align:left;border:1.5px solid #e5e7eb;border-radius:17px;padding:13px 12px;background:#fff;display:grid;grid-template-columns:32px 1fr;gap:10px;align-items:start;color:#111827;font-weight:650;line-height:1.36}.letter{display:inline-grid;place-items:center;width:29px;height:29px;border-radius:999px;background:#f1f5f9;color:#334155;font-weight:900;border:1px solid #cbd5e1}.option.selected{border-color:#2563eb;background:#dbeafe}.option.correct{border-color:#22c55e;background:#dcfce7}.option.incorrect{border-color:#ef4444;background:#fee2e2}
.actions{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:12px}.feedback{display:none;margin-top:13px;border:1px solid #e5e7eb;border-radius:18px;overflow:hidden;background:#fff}.feedback.show{display:block}.fhead{padding:13px 14px;font-weight:900}.fhead.ok{background:#dcfce7;color:#166534}.fhead.bad{background:#fee2e2;color:#991b1b}.block{padding:13px 14px;border-top:1px solid #e5e7eb}.just{border:1px solid #e5e7eb;border-radius:13px;padding:10px;margin:8px 0;background:#fafafa;line-height:1.42}.just.ok{background:#dcfce7;border-color:#86efac}
.label{font-weight:900;margin:14px 0 6px}.official{border-left:5px solid #2563eb;background:#eff6ff}.ai{border-left:5px solid #7c3aed;background:#f5f3ff}.study{border-left:5px solid #16a34a;background:#f0fdf4}.section-card{padding:12px;border-radius:15px;margin:10px 0;border:1px solid #e5e7eb}.toc button{display:block;width:100%;margin:8px 0;text-align:left;background:#f8fafc;border:1px solid #e5e7eb;color:#111827}
.footer{text-align:center;color:#64748b;font-size:.78rem;line-height:1.35;margin:16px 4px 0}
@media(max-width:620px){.tabs{grid-template-columns:repeat(2,1fr)}.stats,.grid{grid-template-columns:repeat(2,1fr)}.actions{grid-template-columns:1fr}.card{border-radius:19px;padding:12px}.hero h1{font-size:1.25rem}.question{font-size:1.06rem}}

/* v5: multi-standard + auth additions */
.userBar{display:flex;justify-content:flex-end;align-items:center;gap:10px;color:#e2e8f0;font-size:.82rem;padding:0 6px 8px;flex-wrap:wrap}
.userBar:empty{display:none}
.ub-name{font-weight:800}.ub-role{color:#94a3b8;font-weight:600}
.ub-link{background:rgba(255,255,255,.14);color:#fff;border:1px solid rgba(255,255,255,.3);border-radius:999px;padding:6px 11px;font-size:.78rem;font-weight:800}
.std-tile.disabled{opacity:.55;cursor:not-allowed}
.std-tile .soon{display:inline-block;margin-top:6px;font-size:.7rem;background:#fef3c7;color:#92400e;border-radius:999px;padding:3px 8px;font-weight:800}
.secondary.small,.ub-link,button.small{padding:9px 12px;font-size:.85rem;border-radius:12px}
.dom-tabs{display:flex;flex-wrap:wrap;gap:7px;margin:8px 0}
.dom-tab{background:#f1f5f9;border:1px solid #e2e8f0;color:#334155;padding:8px 12px;border-radius:999px;font-size:.85rem;font-weight:800}
.dom-tab.active{background:#2563eb;color:#fff;border-color:#2563eb}
.toc button.active{border-color:#2563eb;background:#eff6ff;color:#1e3a8a}
.user-form{display:grid;gap:9px;grid-template-columns:1fr;margin-top:8px}
.user-form input,.user-form select{padding:12px;border-radius:12px;border:1px solid #e5e7eb;font-size:1rem}
.users-table{width:100%;border-collapse:collapse;font-size:.85rem;margin-top:8px}
.users-table th,.users-table td{text-align:left;padding:8px;border-bottom:1px solid #e5e7eb}
#newUserMsg.ok{color:#166534;font-weight:800;margin-top:6px}
#newUserMsg.bad{color:#991b1b;font-weight:800;margin-top:6px}
@media(min-width:520px){.user-form{grid-template-columns:1fr 1fr 140px 110px}}
