/* Schülerchat inline: dieselbe Chat-API und derselbe Verlauf wie /app/chat.php.
   Sämtliche Regeln sind auf #studentChatPanel beschränkt. */
#studentChatPanel[hidden]{display:none!important}
#studentChatPanel{margin:24px 0 16px;scroll-margin-top:18px;background:#fff;border-radius:18px;box-shadow:0 7px 24px #173b6115;padding:14px 16px 17px;color:#17304d;font:13px system-ui,Arial,sans-serif}
#studentChatPanel *{box-sizing:border-box}
#studentChatPanel .student-chat-panel-head{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:10px}
#studentChatPanel .student-chat-panel-head h2{color:#193d68;font-size:1.24rem;margin:0}
#studentChatPanel .student-chat-close{border:1px solid #c8d6e8;background:#f2f6fb;border-radius:9px;padding:8px 12px;color:#234a78;cursor:pointer;font-size:12px;font-weight:700}
#studentChatPanel .student-chat-shell{max-width:none;margin:0;background:#fff;border:1px solid #d9e2ee;border-radius:12px;overflow:hidden}
#studentChatPanel .chat-grid{display:grid;grid-template-columns:minmax(170px,27%) minmax(0,1fr);min-height:285px}
#studentChatPanel .chat-grid aside{border-right:1px solid #e0e5ef;min-width:0}
#studentChatPanel .aside-head{padding:10px 12px;border-bottom:1px solid #e9edf3}
#studentChatPanel #threads{max-height:360px;overflow-y:auto}
#studentChatPanel .thread{display:block;width:100%;text-align:left;border:0;border-bottom:1px solid #ecf0f6;background:#fff;padding:9px 11px;cursor:pointer;color:inherit}
#studentChatPanel .thread:hover{background:#f1f6fd}
#studentChatPanel .thread.active{background:#dceafe;border-left:3px solid #3876b8}
#studentChatPanel .thread strong{display:block;font-size:12px}
#studentChatPanel .thread small{display:block;font-size:10px;color:#63758e}
#studentChatPanel .conversation{display:flex;flex-direction:column;min-width:0}
#studentChatPanel .conv-head{font-weight:750;padding:11px 12px;border-bottom:1px solid #e9edf3;min-height:42px}
#studentChatPanel .messages{height:250px;overflow:auto;padding:8px 13px;overscroll-behavior:contain}
#studentChatPanel .hint{color:#697a90;margin:10px}
#studentChatPanel .bubble{padding:8px 11px;max-width:84%;width:max-content;background:#f0f3f8;border-radius:10px;margin:8px 0;overflow-wrap:anywhere;white-space:pre-wrap}
#studentChatPanel .bubble.mine{margin-left:auto;background:#dcebe8}
#studentChatPanel .bubble small{display:block;font-size:10px;margin-bottom:4px;color:#586f83}
#studentChatPanel #compose{display:flex;gap:8px;padding:9px;border-top:1px solid #e9edf3}
#studentChatPanel #body{flex:1;min-width:0;min-height:42px;max-height:95px;resize:vertical;padding:9px;border:1px solid #cbd5e1;border-radius:8px;font:inherit}
#studentChatPanel #send{border:0;border-radius:8px;background:#ad0e2e;color:#fff;padding:8px 13px;cursor:pointer;font:inherit}
#studentChatPanel button:disabled{opacity:.5;cursor:not-allowed}
#studentChatPanel .error{color:#a11b33;margin:8px 12px}
#studentChatPanel .error[hidden]{display:none}
#studentChatPanel .sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
.student-chat-trigger{font:inherit;border:0;cursor:pointer;width:100%;min-width:0}
.student-chat-trigger:focus-visible{outline:3px solid #4188d2;outline-offset:3px}
@media(max-width:650px){#studentChatPanel{padding:12px 8px;margin-top:18px}#studentChatPanel .chat-grid{grid-template-columns:minmax(115px,36%) minmax(0,1fr)}#studentChatPanel .thread{padding:8px 6px}#studentChatPanel .messages{height:235px;padding:7px}#studentChatPanel #compose{gap:5px;padding:6px}#studentChatPanel #send{padding:7px}#studentChatPanel .bubble{max-width:96%}}

/* Gruppenchats: diskrete, aufklappbare Teilnehmerliste im Gesprächskopf. */
#studentChatPanel .chat-member-list{position:relative;margin-left:auto;font:inherit;font-weight:400;flex:0 0 auto}
#studentChatPanel .chat-member-list summary{list-style:none;cursor:pointer;border:1px solid #cbd5e1;background:#f3f7ff;border-radius:6px;padding:5px 8px;font-size:11px;color:#25466b;white-space:nowrap}
#studentChatPanel .chat-member-list summary::-webkit-details-marker{display:none}
#studentChatPanel .chat-member-list summary:focus-visible{outline:2px solid #3876b8;outline-offset:2px}
#studentChatPanel .chat-member-list ul{position:absolute;z-index:15;right:0;top:calc(100% + 3px);margin:0;padding:5px 0;list-style:none;min-width:195px;width:max-content;max-width:min(280px,70vw);max-height:240px;overflow:auto;box-shadow:0 9px 22px #14254224;background:#fff;border:1px solid #cbd5e1;border-radius:8px}
#studentChatPanel .chat-member-list li{padding:5px 10px;border-bottom:1px solid #eef1f5;white-space:normal;overflow-wrap:anywhere}
#studentChatPanel .chat-member-list li:last-child{border-bottom:0}
#studentChatPanel .chat-member-list li strong{font-size:11px;display:block;font-weight:600}
#studentChatPanel .chat-member-list li small{font-size:10px;color:#63758e;display:block}

/* Group chat: discreet one-to-one entry and compact polls. */
.chat-member-list .chat-member-direct{font:inherit;font-size:11px;display:block;width:100%;text-align:left;color:#24588b;background:transparent;border:0;padding:1px 0;cursor:pointer;font-weight:650}
.chat-member-list .chat-member-direct:hover{text-decoration:underline}
.chat-member-list .chat-member-direct:focus-visible{outline:2px solid #3876b8;outline-offset:2px}
.chat-poll-trigger{font:inherit;font-size:11px!important;background:#fff!important;color:#25466b!important;border:1px solid #cbd5e1!important;border-radius:6px!important;padding:5px 8px!important;white-space:nowrap;cursor:pointer}
.chat-poll-trigger[aria-expanded=true]{background:#e5efff!important}
.chat-poll-panel[hidden]{display:none!important}
.chat-poll-panel{background:#fbfcff;border-bottom:1px solid #d9e2ed;padding:9px 11px;max-height:260px;overflow-y:auto;font:12px system-ui,Arial,sans-serif;color:#17304d;flex:none}
.chat-poll-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:7px}
.chat-poll-heading strong{font-size:12px}
.chat-poll-close,.chat-poll-end{font:inherit;border:1px solid #cbd5e1;border-radius:5px;background:#fff;color:#31506f;cursor:pointer;padding:3px 7px}
.chat-poll-create{border:1px solid #dae3ef;border-radius:7px;padding:7px 9px;margin-bottom:9px;background:#fff}
.chat-poll-create>summary{cursor:pointer;color:#305987;font-weight:600;font-size:11px}
.chat-poll-form{display:grid;gap:6px;margin-top:8px}
.chat-poll-form>input,.chat-poll-form>textarea,.chat-poll-form select,.chat-poll-form input[type=datetime-local]{font:inherit;font-size:12px;min-width:0;max-width:100%;border:1px solid #cbd5e1;border-radius:5px;background:#fff;padding:6px}
.chat-poll-settings{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:center;gap:6px}
.chat-poll-form>button,.chat-poll-vote>button{border:0;border-radius:5px;background:#a71635;color:#fff;font:inherit;font-size:11px;padding:6px 10px;cursor:pointer;justify-self:start}
.chat-poll-item{border:1px solid #dce4ef;border-radius:7px;background:#fff;padding:8px 10px;margin-bottom:7px}
.chat-poll-question{display:block;font-size:12px;margin-bottom:2px}
.chat-poll-meta{display:block;color:#60758c;font-size:10px;margin:3px 0}
.chat-poll-vote{display:grid;gap:4px;margin:6px 0}
.chat-poll-vote>label{display:flex;gap:4px;align-items:center;font-size:11px;cursor:pointer}
.chat-poll-count{margin-left:auto;background:#edf2fb;border-radius:10px;padding:1px 6px}
.chat-poll-empty{margin:8px 0;color:#60758c;font-size:11px}
@media(max-width:650px){.chat-poll-panel{max-height:230px}.chat-poll-settings{grid-template-columns:1fr}}
