/* Shared tutor composition for daily homes and canonical puzzle pages. */
.home-v2 #tutorMount { margin:.82rem 0 .18rem; }
.ficha-page #tutorMount { margin:.9rem 0 1.1rem; }
.educational-tutor { border-top:1px solid hsl(var(--border)/.58); }
.educational-tutor__toggle { display:flex; align-items:center; justify-content:space-between; width:100%; min-height:46px; padding:.62rem .08rem; color:hsl(var(--foreground)/.76); text-align:left; }
.educational-tutor[data-state="open"] > .educational-tutor__toggle { display:none; }
.educational-tutor__closed-copy { font-size:.78rem; font-weight:650; }
.educational-tutor__arrow { color:hsl(var(--muted-foreground)); font-size:1.08rem; line-height:1; }
.educational-tutor__panel { padding:.48rem .02rem .76rem; animation:tutor-panel-in .18s ease both; }
.educational-tutor__header { display:flex; min-height:44px; align-items:center; justify-content:space-between; gap:.75rem; }
.educational-tutor h2 { margin:0; color:hsl(var(--foreground)); font-family:"Crimson Pro",Georgia,serif; font-size:1.18rem; font-weight:600; line-height:1.2; }
.educational-tutor__collapse { display:grid; width:44px; height:44px; flex:0 0 44px; place-items:center; border-radius:50%; color:hsl(var(--muted-foreground)); font-size:1rem; line-height:1; }
.educational-tutor__collapse:hover { background:hsl(var(--secondary)/.48); color:hsl(var(--foreground)); }
.educational-tutor__description { max-width:42rem; margin:.05rem 0 0; color:hsl(var(--muted-foreground)); font-size:.74rem; line-height:1.45; }
.educational-tutor__field-label { position:absolute!important; width:1px!important; height:1px!important; padding:0!important; margin:-1px!important; overflow:hidden!important; clip:rect(0,0,0,0)!important; white-space:nowrap!important; border:0!important; }
.educational-tutor__form { margin-top:.68rem; }
.educational-tutor__composer { display:flex; align-items:flex-end; gap:.52rem; }
.educational-tutor textarea { display:block; box-sizing:border-box; width:100%; min-width:0; min-height:44px; max-height:calc(8.7em + 1.28rem + 2px); flex:1 1 auto; resize:none; overflow-y:hidden; padding:.66rem .96rem; border:1.5px solid hsl(var(--border)); border-radius:14px; background:hsl(var(--card)); color:hsl(var(--foreground)); font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; font-size:16px; font-style:normal; font-weight:440; line-height:1.45; outline:none; box-shadow:inset 0 1px 2px rgba(0,0,0,.03),0 1px 3px rgba(0,0,0,.02); transition:border-color .16s ease,box-shadow .16s ease,background .16s ease; }
.educational-tutor textarea::placeholder { color:hsl(var(--muted-foreground)/.68); font-style:normal; font-weight:400; opacity:1; }
.educational-tutor__send { min-height:44px; flex:0 0 auto; padding:.58rem .94rem; border-radius:12px; background:hsl(var(--primary)); color:hsl(var(--primary-foreground)); font-size:.75rem; font-weight:700; letter-spacing:.005em; box-shadow:0 1px 2px hsl(var(--primary)/.16); transition:filter .16s ease,transform .16s ease,box-shadow .16s ease; }
.educational-tutor__send:not(:disabled):hover { filter:brightness(1.045); box-shadow:0 2px 6px hsl(var(--primary)/.2); }
.educational-tutor__send:not(:disabled):active { transform:translateY(1px); }
.educational-tutor button:disabled,.educational-tutor textarea:disabled { cursor:not-allowed; opacity:.44; }
.educational-tutor button:focus-visible { outline:2px solid hsl(var(--primary)); outline-offset:2px; }
.educational-tutor textarea:focus,.educational-tutor textarea:focus-visible { border-color:hsl(var(--primary)/.42); outline:none; box-shadow:0 0 0 3px hsl(var(--primary)/.09); }
.educational-tutor__meta { min-height:.82rem; margin-top:.2rem; }
.educational-tutor__remaining { color:hsl(var(--muted-foreground)); font-size:.66rem; }
.educational-tutor__conversation { margin-top:.66rem; }
.educational-tutor__conversation ol { display:grid; gap:.78rem; margin:0; padding:0; list-style:none; }
.educational-tutor__conversation ol[hidden] { display:none; }
.educational-tutor__recent { margin-top:.5rem!important; }
.educational-tutor__exchange { display:grid; gap:.46rem; }
.educational-tutor__exchange > div { display:grid; grid-template-columns:2.7rem minmax(0,1fr); gap:.5rem; align-items:start; }
.educational-tutor__exchange > div > span { padding-top:.11rem; color:hsl(var(--muted-foreground)); font-size:.66rem; font-weight:650; line-height:1.35; }
.educational-tutor__exchange > div[data-author="tutor"] > span { color:hsl(var(--primary)); }
.educational-tutor__exchange p { min-width:0; margin:0; color:hsl(var(--foreground)/.86); font-size:.8rem; line-height:1.52; white-space:pre-wrap; overflow-wrap:anywhere; }
.educational-tutor__exchange div[data-author="tutor"] p { font-family:"Crimson Pro",Georgia,serif; font-size:1rem; line-height:1.5; }
.educational-tutor__math { white-space:normal; overflow-wrap:normal; }
.educational-tutor__math--inline { display:inline-block; margin:0 .025em; vertical-align:-.08em; }
.educational-tutor__math--display { display:block; max-width:100%; margin:.3rem 0; overflow-x:auto; overflow-y:hidden; text-align:center; }
.educational-tutor__math--display > .katex-display { margin:0; }
.educational-tutor__history-toggle,.educational-tutor__new,.educational-tutor__status button { color:hsl(var(--muted-foreground)); font-size:.68rem; font-weight:650; text-decoration:underline; text-underline-offset:3px; }
.educational-tutor__history-toggle { margin:0 0 .12rem; }
.educational-tutor__conversation-actions { display:flex; justify-content:flex-end; min-height:0; margin-top:.38rem; }
.educational-tutor__conversation-actions[hidden] { display:none; }
.educational-tutor__status { min-height:1.05rem; margin-top:.32rem; color:hsl(var(--muted-foreground)); font-size:.69rem; line-height:1.45; }
.educational-tutor__status[role="alert"] { color:hsl(4 58% 43%); font-weight:620; }
.educational-tutor[data-loading="true"] { cursor:progress; }
@keyframes tutor-panel-in { from { opacity:0; transform:translateY(-3px); } to { opacity:1; transform:none; } }
[data-theme="dark"] .educational-tutor textarea { background:hsl(242 12% 15%); border-color:rgba(120,100,180,.3); }
[data-theme="dark"] .educational-tutor textarea:focus { border-color:hsl(var(--primary)/.5); box-shadow:0 0 0 3px hsl(var(--primary)/.12); }
[data-theme="dark"] .educational-tutor__status[role="alert"] { color:hsl(4 72% 70%); }
@media (max-width:600px) {
  .home-v2 #tutorMount { margin-top:.7rem; }
  .ficha-page #tutorMount { margin-top:.78rem; }
  .educational-tutor__send { padding-inline:.72rem; }
  .educational-tutor__exchange > div { grid-template-columns:2.35rem minmax(0,1fr); gap:.42rem; }
}
@media (prefers-reduced-motion:reduce) { .educational-tutor__panel { animation:none!important; } }
@media (forced-colors:active) {
  .educational-tutor { border-color:CanvasText; }
  .educational-tutor textarea,.educational-tutor__send,.educational-tutor__collapse { border:1px solid ButtonText; }
  .educational-tutor__send { background:ButtonFace; color:ButtonText; }
}
