/* AliProf V2.4 — copiloto pedagógico */
.ap2-shell{display:grid;gap:14px}
.ap2-top{display:grid;grid-template-columns:1fr auto;gap:12px;align-items:center}
.ap2-title{display:flex;align-items:center;gap:12px;padding:14px 16px;border:1px solid rgba(91,61,237,.16);border-radius:18px;background:linear-gradient(135deg,rgba(112,67,245,.10),rgba(44,194,190,.10))}
.ap2-avatar{width:46px;height:46px;border-radius:15px;display:grid;place-items:center;font-size:26px;background:linear-gradient(135deg,#7443f5,#42c7bf);box-shadow:0 10px 26px rgba(91,61,237,.16)}
.ap2-title b{display:block;font-size:20px;color:#24164d}.ap2-title span{display:block;margin-top:2px;font-size:12px;color:#6d6482}
.ap2-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.ap2-actions button{border:1px solid #ddd5ff;background:#fff;color:#4b2fc9;font-weight:800;border-radius:12px;padding:9px 12px;cursor:pointer}.ap2-actions button:hover{background:#f6f2ff}
.ap2-context{display:flex;gap:10px;align-items:center;flex-wrap:wrap;padding:10px 12px;border:1px solid #ece8fb;border-radius:14px;background:#fbfaff}
.ap2-context label{font-size:11px;font-weight:900;letter-spacing:.07em;color:#766b92;text-transform:uppercase}.ap2-context select{min-width:120px;border:1px solid #dcd5f8;border-radius:10px;padding:8px 30px 8px 10px;background:#fff;color:#2c2350;font-weight:800}.ap2-context-note{font-size:12px;color:#746c88}.ap2-context-note strong{color:#4f34d7}
.ap2-quick{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px}.ap2-q{border:1px solid #ddd6ff;border-radius:15px;background:#fff;padding:12px;text-align:left;cursor:pointer;min-height:74px;transition:.15s}.ap2-q:hover{transform:translateY(-1px);box-shadow:0 8px 20px rgba(66,45,140,.08);border-color:#8a6aff}.ap2-q i{display:block;font-style:normal;font-size:20px;margin-bottom:6px}.ap2-q b{display:block;color:#272048;font-size:13px}.ap2-q span{display:block;color:#756d88;font-size:11px;margin-top:2px;line-height:1.3}
.ap2-chat{border:1px solid #e8e4f7;border-radius:18px;background:linear-gradient(180deg,#fbfbff,#f7fbfd);overflow:hidden}.ap2-msgs{height:min(44vh,430px);min-height:280px;overflow:auto;padding:14px;display:flex;flex-direction:column;gap:10px;scroll-behavior:smooth}.ap2-row{display:flex}.ap2-row.user{justify-content:flex-end}.ap2-bubble{max-width:min(82%,760px);padding:11px 13px;border-radius:15px;line-height:1.45;white-space:pre-wrap;font-size:13px}.ap2-bubble.ai{background:#fff;border:1px solid #ece8fb;color:#2c2650}.ap2-bubble.user{background:linear-gradient(135deg,#6842ef,#8b5bea);color:#fff;box-shadow:0 6px 16px rgba(93,57,220,.16)}.ap2-who{font-size:10px;font-weight:900;letter-spacing:.08em;text-transform:uppercase;margin-bottom:4px;opacity:.74}
.ap2-md{white-space:normal}.ap2-md-line{margin:0 0 4px}.ap2-md-title{margin:9px 0 5px;font-weight:900;color:#2f245b}.ap2-md-title:first-child{margin-top:0}.ap2-md-gap{height:7px}.ap2-md ul,.ap2-md ol{margin:5px 0 8px;padding-left:22px}.ap2-md li{margin:3px 0}.ap2-md strong{font-weight:900;color:#30245f}.ap2-md em{font-style:italic}.ap2-md code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.93em;background:#f2effc;border:1px solid #e5defb;border-radius:6px;padding:1px 4px;color:#4730a9}.ap2-text{white-space:pre-wrap}
.ap2-compose{display:grid;grid-template-columns:1fr auto;gap:9px;padding:12px;border-top:1px solid #e8e4f7;background:#fff}.ap2-compose textarea{resize:none;min-height:52px;max-height:130px;border:1.5px solid #cfc6ff;border-radius:14px;padding:11px 12px;font:inherit;color:#252044;outline:none}.ap2-compose textarea:focus{border-color:#6d48ee;box-shadow:0 0 0 3px rgba(109,72,238,.08)}.ap2-send{border:0;border-radius:14px;padding:0 20px;background:linear-gradient(135deg,#6c43ef,#8859ea);color:#fff;font-weight:900;cursor:pointer}.ap2-send:disabled{opacity:.55;cursor:wait}
.ap2-foot{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:0 2px;color:#777086;font-size:11px}.ap2-foot strong{color:#4632c7}.ap2-history{display:none;border:1px solid #e8e4f7;border-radius:16px;background:#fff;padding:12px}.ap2-history.open{display:block}.ap2-history-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:9px}.ap2-history-list{display:grid;gap:7px;max-height:210px;overflow:auto}.ap2-history-item{border:1px solid #ebe7f8;border-radius:12px;background:#fbfaff;padding:9px 10px;cursor:pointer;text-align:left}.ap2-history-item:hover{border-color:#a48cf4}.ap2-history-item b{display:block;color:#30265d;font-size:12px}.ap2-history-item span{display:block;color:#847b98;font-size:10px;margin-top:2px}.ap2-empty{text-align:center;color:#8c849c;padding:18px;font-size:12px}.ap2-thinking{display:inline-flex;gap:4px;align-items:center}.ap2-thinking i{width:5px;height:5px;border-radius:50%;background:#7453e8;animation:ap2dot 1s infinite ease-in-out}.ap2-thinking i:nth-child(2){animation-delay:.12s}.ap2-thinking i:nth-child(3){animation-delay:.24s}@keyframes ap2dot{0%,80%,100%{opacity:.25;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}
html.dark .ap2-title,html.dark .ap2-context,html.dark .ap2-history-item{background:rgba(255,255,255,.05)}html.dark .ap2-actions button,html.dark .ap2-q,html.dark .ap2-history{background:#171426;color:#eee;border-color:#383052}html.dark .ap2-title b,html.dark .ap2-q b{color:#f7f5ff}html.dark .ap2-bubble.ai{background:#171426;border-color:#352f4b;color:#f0edf9}html.dark .ap2-md-title,html.dark .ap2-md strong{color:#f3efff}html.dark .ap2-md code{background:#211b34;border-color:#3f3560;color:#d9ceff}html.dark .ap2-compose{background:#14111f}html.dark .ap2-compose textarea{background:#0f0d18;color:#f7f5ff}
@media(max-width:860px){.ap2-quick{grid-template-columns:1fr 1fr}.ap2-top{grid-template-columns:1fr}.ap2-actions{justify-content:flex-start}.ap2-msgs{height:45vh}.ap2-bubble{max-width:92%}}
@media(max-width:560px){.ap2-quick{grid-template-columns:1fr}.ap2-compose{grid-template-columns:1fr}.ap2-send{min-height:44px}.ap2-context select{width:100%}.ap2-context{align-items:stretch}.ap2-context-note{width:100%}}
