.teacher-messenger{--chat-bg:#f7f3ff;--chat-pattern:#7a58d50b;position:relative;display:grid;grid-template-columns:minmax(310px,34%) minmax(0,1fr);height:calc(100vh - 126px);min-height:640px;overflow:hidden;border:1px solid #ddd7eb;border-radius:19px;background:#fff;box-shadow:0 18px 46px #21144814}
.teacher-messenger.theme-blue{--chat-bg:#f1f7ff;--chat-pattern:#4f8fd00c}.teacher-messenger.theme-cream{--chat-bg:#fff8ea;--chat-pattern:#c98b250d}.teacher-messenger.theme-mint{--chat-bg:#effaf6;--chat-pattern:#319b780d}.teacher-messenger.theme-gray{--chat-bg:#f4f5f7;--chat-pattern:#5260700c}
.teacher-messenger svg{width:21px;height:21px;display:block;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.teacher-chat-dialogs{position:relative;min-width:0;display:flex;flex-direction:column;overflow:hidden;border-right:1px solid #ded9e9;background:#fff}
.teacher-chat-dialogs>header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:20px 19px 10px}.teacher-chat-dialogs>header>div{display:flex;align-items:center;gap:9px;flex-wrap:wrap}.teacher-chat-dialogs h2{margin:0;font-size:23px}.teacher-chat-dialogs>header span{padding:5px 8px;border-radius:999px;background:#e9f8f1;color:#218061;font-size:10px;font-weight:850}.teacher-chat-dialogs>header>strong{min-width:24px;height:24px;display:grid;place-items:center;padding:0 7px;border-radius:999px;background:#7b4cdf;color:#fff;font-size:11px}
.teacher-chat-notifications{align-self:flex-start;display:flex;align-items:center;gap:6px;margin:0 19px 11px;padding:7px 10px;border:1px solid #dfd7f1;border-radius:9px;background:#fff;color:#6e43bd;font:inherit;font-size:11px;cursor:pointer}.teacher-chat-notifications svg{width:15px;height:15px}.teacher-chat-notifications.is-enabled{border-color:#cde9df;background:#effaf6;color:#228163}.teacher-chat-notifications:disabled{cursor:default;opacity:.78}
.teacher-chat-forward-help{margin:0 14px 10px;padding:9px 11px;border:1px solid #e3d8fb;border-radius:10px;background:#f7f2ff;color:#6642a4;font-size:11px;line-height:1.4}
.teacher-chat-search{height:47px;display:flex;align-items:center;gap:9px;margin:0 14px 11px;padding:0 13px;border:1px solid #dfd9e9;border-radius:12px;background:#fbfafd;color:#7a7390}.teacher-chat-search:focus-within{border-color:#9c75e9;box-shadow:0 0 0 3px #8857de14}.teacher-chat-search svg{width:18px}.teacher-chat-search input{min-width:0;flex:1;border:0;outline:0;background:transparent;color:#211b35;font:inherit;font-size:13px}
.teacher-chat-dialog-list{min-height:0;flex:1;overflow-x:hidden;overflow-y:scroll;scrollbar-gutter:stable;scrollbar-width:thin;scrollbar-color:#bba4de #f5f1fa;padding-bottom:80px}.teacher-chat-dialog-list::-webkit-scrollbar{width:10px}.teacher-chat-dialog-list::-webkit-scrollbar-track{background:#f5f1fa}.teacher-chat-dialog-list::-webkit-scrollbar-thumb{border:2px solid #f5f1fa;border-radius:99px;background:#bba4de}.teacher-chat-dialog{position:relative;width:100%;min-height:82px;display:grid;grid-template-columns:46px minmax(0,1fr) auto;grid-template-rows:auto auto;align-items:center;gap:0 11px;padding:12px 15px;border:0;border-left:4px solid transparent;border-bottom:1px solid #eeeaf3;background:#fff;color:#1d192d;text-align:left;cursor:pointer}.teacher-chat-dialog:hover{background:#faf8fe}.teacher-chat-dialog.is-active{border-left-color:#8857df;background:#f0e9fb}.teacher-chat-dialog.is-forward-target:after{content:"Переслать сюда";position:absolute;right:12px;bottom:8px;color:#7d4ed3;font-size:9px;font-weight:850}.teacher-chat-dialog>i{grid-row:1/3;width:44px;height:44px;display:grid;place-items:center;border-radius:50%;background:linear-gradient(135deg,#ece5ff,#dcecff);color:#7044c3;font-style:normal;font-size:13px;font-weight:900}.teacher-chat-dialog>span{min-width:0;align-self:end}.teacher-chat-dialog b,.teacher-chat-dialog small,.teacher-chat-dialog em{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.teacher-chat-dialog b{font-size:13px}.teacher-chat-dialog small{margin-top:3px;color:#7a7489;font-size:10px}.teacher-chat-dialog em{grid-column:2/4;margin-top:6px;color:#686277;font-size:11px;font-style:normal}.teacher-chat-dialog time{align-self:start;color:#8a8397;font-size:9px}.teacher-chat-dialog>strong{position:absolute;right:13px;bottom:13px;min-width:21px;height:21px;display:grid;place-items:center;padding:0 6px;border-radius:999px;background:#7c4cda;color:#fff;font-size:9px}.teacher-chat-dialog>u{position:absolute;right:13px;bottom:15px;color:#7851d0;font-size:10px;text-decoration:none}.teacher-chat-empty-list{padding:32px 20px;color:#827b8e;text-align:center}
.teacher-chat-new{position:absolute;z-index:20;right:22px;bottom:18px;width:48px;height:48px;display:grid;place-items:center;border:0;border-radius:50%;background:linear-gradient(135deg,#7847dc,#9a5ee7);color:#fff;box-shadow:0 10px 26px #5f2eba4a;cursor:pointer}.teacher-chat-new:hover{transform:translateY(-1px)}
.teacher-chat-conversation{position:relative;min-width:0;min-height:0;height:100%;display:grid;grid-template-rows:auto auto minmax(0,1fr) auto;overflow:hidden;background:var(--chat-bg)}
.teacher-chat-header{grid-row:1}.teacher-chat-selection{grid-row:2}.teacher-chat-history{grid-row:3}.teacher-chat-composer{grid-row:4}
.teacher-chat-conversation:before{content:"";position:absolute;inset:68px 0 0;pointer-events:none;opacity:.8;background-image:radial-gradient(circle at 12px 12px,var(--chat-pattern) 2px,transparent 2.5px),radial-gradient(circle at 34px 34px,var(--chat-pattern) 1.5px,transparent 2px);background-size:46px 46px}
.teacher-chat-header{position:relative;z-index:8;min-height:70px;display:flex;align-items:center;gap:12px;padding:11px 17px;border-bottom:1px solid #e3ddea;background:#fffffff2;backdrop-filter:blur(10px)}.teacher-chat-header>i{width:45px;height:45px;display:grid;place-items:center;flex:none;border-radius:50%;background:linear-gradient(135deg,#8d62ec,#a875e8);color:#fff;font-style:normal;font-weight:900}.teacher-chat-header>div:not(.teacher-chat-theme-popover){min-width:0;margin-right:auto}.teacher-chat-header h3{margin:0;font-size:16px}.teacher-chat-header p{margin:4px 0 0;overflow:hidden;color:#777184;font-size:10px;text-overflow:ellipsis;white-space:nowrap}.teacher-chat-header>button{height:39px;display:flex;align-items:center;justify-content:center;gap:7px;padding:0 11px;border:1px solid transparent;border-radius:11px;background:transparent;color:#594b6f;font:inherit;font-size:12px;cursor:pointer}.teacher-chat-header>button:hover{border-color:#ded5ed;background:#f7f3fc}.teacher-chat-header>button:first-of-type{width:39px;padding:0}
.teacher-chat-theme-popover{position:absolute;z-index:30;right:14px;top:61px;width:230px;padding:15px;border:1px solid #e0d8eb;border-radius:14px;background:#fff;box-shadow:0 18px 40px #2c1d472d}.teacher-chat-theme-popover>b{display:block;margin-bottom:12px;font-size:13px}.teacher-chat-theme-popover>div{display:flex;gap:11px}.teacher-chat-theme-popover button{width:34px;height:34px;padding:0;border:3px solid #fff;border-radius:50%;box-shadow:0 0 0 1px #ddd5e8;cursor:pointer}.teacher-chat-theme-popover button.is-active{box-shadow:0 0 0 2px #8152de}.teacher-chat-theme-popover .is-lavender{background:#e9dcff}.teacher-chat-theme-popover .is-blue{background:#dcecff}.teacher-chat-theme-popover .is-cream{background:#ffebc6}.teacher-chat-theme-popover .is-mint{background:#d7f2e7}.teacher-chat-theme-popover .is-gray{background:#e4e7eb}
.teacher-chat-selection{position:relative;z-index:7;display:flex;align-items:center;gap:11px;padding:9px 15px;border-bottom:1px solid #dfd7ed;background:#fff}.teacher-chat-selection b{margin-right:auto}.teacher-chat-selection button{display:flex;align-items:center;gap:6px;padding:7px 10px;border:1px solid #e3dce9;border-radius:8px;background:#fff;color:#b3324b;font:inherit;font-size:11px;cursor:pointer}.teacher-chat-selection button:last-child{padding:7px;color:#71697e}.teacher-chat-selection svg{width:16px;height:16px}
.teacher-chat-history{position:relative;z-index:1;min-height:0;overflow:auto;padding:22px 22px 28px;scroll-behavior:smooth}.teacher-chat-day{width:max-content;margin:0 auto 17px;padding:5px 11px;border:1px solid #dfd8e8;border-radius:999px;background:#ffffffd9;color:#686174;font-size:10px;font-weight:850;box-shadow:0 4px 12px #2d1f4310}
.teacher-chat-message-row{position:relative;display:flex;align-items:flex-end;gap:8px;margin:8px 0}.teacher-chat-message-row.is-own{flex-direction:row-reverse}.teacher-chat-message-row.is-selected:before{content:"✓";position:absolute;inset:-4px;z-index:-1;display:grid;align-items:center;padding-left:8px;border-radius:13px;background:#8659df20;color:#7245cf;font-weight:900}.teacher-chat-message-row.is-flashed .teacher-chat-bubble{box-shadow:0 0 0 4px #9a70e92b}.teacher-chat-avatar{width:30px;height:30px;display:grid;place-items:center;flex:none;border-radius:50%;background:#fff;color:#6d43bd;font-style:normal;font-size:9px;font-weight:900;box-shadow:0 3px 10px #2b1b4418}.teacher-chat-message-row.is-own .teacher-chat-avatar{background:#8858df;color:#fff}
.teacher-chat-bubble{position:relative;width:max-content;max-width:min(70%,720px);min-width:140px;padding:10px 12px 7px;border:1px solid #e4deea;border-radius:14px 14px 14px 4px;background:#fff;color:#211d2d;box-shadow:0 4px 13px #2b1d430c}.teacher-chat-message-row.is-own .teacher-chat-bubble{border-color:#cebdf0;border-radius:14px 14px 4px 14px;background:linear-gradient(135deg,#eee5ff,#e5dcfb)}.teacher-chat-bubble>p{margin:0;font-size:13px;line-height:1.48;overflow-wrap:anywhere}.teacher-chat-bubble>footer{display:flex;align-items:center;justify-content:flex-end;gap:6px;margin-top:5px;color:#817a8d;font-size:8px}.teacher-chat-bubble>footer span{max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.teacher-chat-bubble>footer em{color:#7244cc;font-style:normal;font-weight:900}.teacher-chat-more{position:absolute;right:-30px;top:0;width:27px;height:27px;display:none;place-items:center;padding:0;border:0;border-radius:8px;background:#ffffffc9;color:#6d657a;cursor:pointer}.teacher-chat-message-row.is-own .teacher-chat-more{right:auto;left:-30px}.teacher-chat-bubble:hover>.teacher-chat-more,.teacher-chat-more:focus{display:grid}.teacher-chat-more svg{width:17px;height:17px}
.teacher-chat-forwarded{display:flex;align-items:center;gap:6px;margin-bottom:6px;color:#7648ce;font-size:10px}.teacher-chat-forwarded svg{width:14px;height:14px}.teacher-chat-reply-quote{width:100%;display:grid;gap:3px;margin:0 0 7px;padding:6px 8px;border:0;border-left:3px solid #8052d7;border-radius:6px;background:#7e52d90b;color:#4e4560;text-align:left;cursor:pointer}.teacher-chat-reply-quote b{color:#7445c8;font-size:9px}.teacher-chat-reply-quote span{overflow:hidden;font-size:10px;text-overflow:ellipsis;white-space:nowrap}
.teacher-chat-attachments{display:grid;gap:7px;margin-top:7px}.teacher-chat-image{min-width:230px;display:grid;overflow:hidden;border-radius:10px;background:#f2eef7;color:#6f6878;text-decoration:none}.teacher-chat-image>img{width:100%;max-height:270px;display:block;object-fit:cover}.teacher-chat-image>span{min-height:90px;display:grid;place-items:center;font-size:10px}.teacher-chat-image>small{padding:6px 8px;overflow:hidden;background:#ffffffc7;color:#5e5768;font-size:9px;text-overflow:ellipsis;white-space:nowrap}.teacher-chat-image.is-error{border:1px solid #efc6cf;background:#fff4f6;color:#a2384d}.teacher-chat-file{min-width:260px;display:grid;grid-template-columns:38px minmax(0,1fr) 20px;align-items:center;gap:9px;padding:9px;border:1px solid #ded5ed;border-radius:10px;background:#ffffffb8;color:#332b43;text-decoration:none}.teacher-chat-file>i{width:36px;height:36px;display:grid;place-items:center;border-radius:9px;background:#eee7fa;color:#7245c5}.teacher-chat-file>span{min-width:0}.teacher-chat-file b,.teacher-chat-file small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.teacher-chat-file b{font-size:11px}.teacher-chat-file small{margin-top:3px;color:#827b8e;font-size:9px}.teacher-chat-file>svg{width:17px;height:17px;color:#7347c6}
.teacher-chat-context{position:absolute;z-index:40;right:-175px;top:5px;width:170px;overflow:hidden;padding:6px;border:1px solid #ded7e6;border-radius:12px;background:#fff;box-shadow:0 18px 42px #24153e38}.teacher-chat-message-row.is-own .teacher-chat-context{right:auto;left:-175px}.teacher-chat-context button{width:100%;display:flex;align-items:center;gap:9px;padding:8px 9px;border:0;border-radius:7px;background:#fff;color:#312b3c;font:inherit;font-size:11px;text-align:left;cursor:pointer}.teacher-chat-context button:hover{background:#f5f1fa}.teacher-chat-context button.is-danger{color:#d23450}.teacher-chat-context svg{width:16px;height:16px}.teacher-chat-context hr{height:1px;margin:4px 0;border:0;background:#ebe7ef}
.teacher-chat-welcome{min-height:100%;display:grid;place-content:center;justify-items:center;color:#6e6678;text-align:center}.teacher-chat-welcome>span{width:72px;height:72px;display:grid;place-items:center;border-radius:24px;background:#ffffffc4;font-size:32px;box-shadow:0 12px 30px #26163d12}.teacher-chat-welcome>b{margin-top:13px;color:#3c3449;font-size:17px}.teacher-chat-welcome p{margin:6px 0 0;font-size:11px}
.teacher-chat-composer{position:relative;z-index:9;padding:9px 14px 11px;border-top:1px solid #e0d9e7;background:#fffffff2;backdrop-filter:blur(10px)}.teacher-chat-compose-row{position:relative;display:flex;align-items:flex-end;gap:7px}.teacher-chat-compose-row>label,.teacher-chat-compose-row>button:not(.teacher-chat-send){width:39px;height:39px;display:grid;place-items:center;flex:none;border:1px solid #e1dae9;border-radius:11px;background:#fff;color:#7350a7;cursor:pointer}.teacher-chat-compose-row>label:hover,.teacher-chat-compose-row>button:hover{border-color:#aa8bdd;background:#faf7ff}.teacher-chat-compose-row input[type=file]{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}.teacher-chat-compose-row textarea{min-height:42px;max-height:120px;flex:1;resize:none;padding:11px 13px;border:1px solid #ded7e7;border-radius:12px;background:#fff;color:#231e30;font:inherit;font-size:13px;outline:0}.teacher-chat-compose-row textarea:focus{border-color:#966ee1;box-shadow:0 0 0 3px #8554dd12}.teacher-chat-send{width:44px;height:44px;display:grid;place-items:center;flex:none;padding:0;border:0;border-radius:50%;background:linear-gradient(135deg,#7846dd,#9256e4);color:#fff;box-shadow:0 7px 18px #6c38c539;cursor:pointer}.teacher-chat-send:disabled{opacity:.55;cursor:wait}.teacher-chat-composer>small{display:block;margin:6px 54px 0 0;color:#97909f;font-size:8px;text-align:right}
.teacher-chat-compose-banner{display:flex;align-items:center;gap:8px;margin-bottom:7px;padding:7px 9px;border-left:3px solid #8050d7;border-radius:7px;background:#f6f1fd;color:#68439f}.teacher-chat-compose-banner>svg{width:17px;height:17px}.teacher-chat-compose-banner>span{min-width:0;flex:1}.teacher-chat-compose-banner b,.teacher-chat-compose-banner small{display:block}.teacher-chat-compose-banner b{font-size:10px}.teacher-chat-compose-banner small{margin-top:2px;overflow:hidden;color:#7d7489;font-size:9px;text-overflow:ellipsis;white-space:nowrap}.teacher-chat-compose-banner button{width:27px;height:27px;display:grid;place-items:center;border:0;border-radius:7px;background:transparent;color:#746b80;cursor:pointer}.teacher-chat-compose-banner button svg{width:15px;height:15px}
.teacher-chat-file-tray{display:flex;gap:7px;overflow-x:auto;margin-bottom:7px}.teacher-chat-file-tray figure{position:relative;width:92px;height:66px;display:grid;place-items:center;flex:none;overflow:hidden;margin:0;border:1px solid #ded6e8;border-radius:9px;background:#f6f2fa}.teacher-chat-file-tray img{width:100%;height:100%;object-fit:cover}.teacher-chat-file-tray>figure>i{color:#774ac8}.teacher-chat-file-tray figcaption{position:absolute;left:0;right:0;bottom:0;overflow:hidden;padding:3px 5px;background:#24143fa8;color:#fff;font-size:7px;text-overflow:ellipsis;white-space:nowrap}.teacher-chat-file-tray button{position:absolute;right:3px;top:3px;width:21px;height:21px;display:grid;place-items:center;padding:0;border:0;border-radius:50%;background:#2d204bbd;color:#fff;cursor:pointer}.teacher-chat-file-tray button svg{width:12px;height:12px}
.teacher-chat-emoji{position:absolute;z-index:45;left:0;bottom:51px;width:330px;padding:11px;border:1px solid #ddd5e7;border-radius:14px;background:#fff;box-shadow:0 18px 46px #29194238}.teacher-chat-emoji header{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}.teacher-chat-emoji header b{font-size:12px}.teacher-chat-emoji header span{color:#8a8393;font-size:9px}.teacher-chat-emoji>div{display:grid;grid-template-columns:repeat(8,1fr);gap:3px}.teacher-chat-emoji button{width:35px;height:34px;padding:0;border:0;border-radius:7px;background:#fff;font-size:21px;cursor:pointer}.teacher-chat-emoji button:hover{background:#f1ecf8}
.teacher-chat-delete-backdrop{position:absolute;inset:0;z-index:80;display:grid;place-items:center;padding:18px;background:#21163370;backdrop-filter:blur(3px)}.teacher-chat-delete-backdrop section{width:min(330px,100%);display:grid;justify-items:stretch;padding:21px;border-radius:17px;background:#fff;box-shadow:0 24px 60px #1e123b4d;text-align:center}.teacher-chat-delete-backdrop section>span{width:52px;height:52px;display:grid;place-items:center;justify-self:center;border-radius:15px;background:#fff0f3;color:#cc3652}.teacher-chat-delete-backdrop h3{margin:13px 0 5px}.teacher-chat-delete-backdrop p{margin:0 0 14px;color:#7b7485;font-size:12px}.teacher-chat-delete-backdrop button{margin-top:7px;padding:10px;border:1px solid #e2dce8;border-radius:9px;background:#fff;color:#362e40;font:inherit;font-weight:750;cursor:pointer}.teacher-chat-delete-backdrop button.is-danger{border-color:#efbdc6;background:#fff3f5;color:#c72f4b}.teacher-chat-delete-backdrop button.is-cancel{border:0;color:#777080}
@media(max-width:1100px){.teacher-messenger{grid-template-columns:290px minmax(0,1fr)}.teacher-chat-bubble{max-width:78%}.teacher-chat-theme-button span{display:none}.teacher-chat-header>button.teacher-chat-theme-button{width:39px;padding:0}.teacher-chat-context,.teacher-chat-message-row.is-own .teacher-chat-context{right:0;left:auto;top:32px}}
@media(max-width:760px){.teacher-messenger{height:auto;min-height:0;display:block;overflow:visible}.teacher-chat-dialogs{height:340px;border-right:0;border-bottom:1px solid #ded9e9}.teacher-chat-conversation{height:660px}.teacher-chat-header{padding:9px 11px}.teacher-chat-header>i{width:39px;height:39px}.teacher-chat-history{padding:16px 12px}.teacher-chat-bubble{max-width:84%}.teacher-chat-avatar{display:none}.teacher-chat-compose-row>label:nth-of-type(2){display:none}.teacher-chat-composer{padding:8px}.teacher-chat-composer>small{margin-right:0;text-align:center}.teacher-chat-emoji{left:-45px;width:min(330px,calc(100vw - 24px))}}

/* Единая палитра чата: выбранная тема меняет всю панель, а не только фон сообщений. */
.teacher-messenger{
  --chat-accent:#7b4bd1;--chat-accent-strong:#6030b0;--chat-accent-soft:#f0e8fc;--chat-accent-softer:#faf7ff;
  --chat-surface:#ffffff;--chat-surface-glass:#fffffff0;--chat-border:#ddd4eb;--chat-text:#211b31;--chat-muted:#756d82;
  --chat-own-bubble:#e9defb;--chat-incoming-bubble:#ffffff;--chat-input:#ffffff;--chat-scroll-track:#f5f1fa;--chat-scroll-thumb:#bba4de;
  width:100%;max-width:none;color:var(--chat-text);border-color:var(--chat-border);background:var(--chat-surface);box-shadow:0 18px 46px color-mix(in srgb,var(--chat-accent) 12%,transparent)
}
.teacher-messenger.theme-blue{--chat-accent:#397dc2;--chat-accent-strong:#245e9d;--chat-accent-soft:#e2effc;--chat-accent-softer:#f4f9ff;--chat-surface:#fbfdff;--chat-surface-glass:#fbfdfff0;--chat-border:#cbdced;--chat-text:#172b40;--chat-muted:#64788d;--chat-own-bubble:#dcecff;--chat-incoming-bubble:#ffffff;--chat-input:#ffffff;--chat-scroll-track:#eef5fb;--chat-scroll-thumb:#8fb9de}
.teacher-messenger.theme-cream{--chat-accent:#b5741f;--chat-accent-strong:#8b5515;--chat-accent-soft:#fff0d2;--chat-accent-softer:#fffaf0;--chat-surface:#fffdf8;--chat-surface-glass:#fffdf8f0;--chat-border:#ead5ad;--chat-text:#3b2b17;--chat-muted:#83725b;--chat-own-bubble:#ffe8ba;--chat-incoming-bubble:#fffdf9;--chat-input:#fffefb;--chat-scroll-track:#fbf3e3;--chat-scroll-thumb:#d6aa66}
.teacher-messenger.theme-mint{--chat-accent:#2f8b6d;--chat-accent-strong:#1e6951;--chat-accent-soft:#daf2e8;--chat-accent-softer:#f2fbf7;--chat-surface:#fbfffd;--chat-surface-glass:#fbfffdf0;--chat-border:#c6e2d7;--chat-text:#183a2f;--chat-muted:#607d73;--chat-own-bubble:#d5f0e5;--chat-incoming-bubble:#ffffff;--chat-input:#fcfffd;--chat-scroll-track:#edf8f3;--chat-scroll-thumb:#7dbba5}
.teacher-messenger.theme-gray{--chat-accent:#5c6b7a;--chat-accent-strong:#3e4b58;--chat-accent-soft:#e7ebef;--chat-accent-softer:#f6f7f8;--chat-surface:#ffffff;--chat-surface-glass:#fffffff0;--chat-border:#d4d9de;--chat-text:#202a33;--chat-muted:#6d7882;--chat-own-bubble:#e2e7eb;--chat-incoming-bubble:#ffffff;--chat-input:#ffffff;--chat-scroll-track:#f1f3f5;--chat-scroll-thumb:#a3adb6}
.teacher-chat-dialogs{border-color:var(--chat-border);background:var(--chat-surface)}
.teacher-chat-dialogs>header,.teacher-chat-dialog,.teacher-chat-selection{color:var(--chat-text)}
.teacher-chat-dialogs>header span{background:var(--chat-accent-soft);color:var(--chat-accent-strong)}
.teacher-chat-dialogs>header>strong,.teacher-chat-dialog>strong{background:var(--chat-accent);color:#fff}
.teacher-chat-notifications{border-color:var(--chat-border);background:var(--chat-surface);color:var(--chat-accent-strong)}
.teacher-chat-forward-help{border-color:var(--chat-border);background:var(--chat-accent-softer);color:var(--chat-accent-strong)}
.teacher-chat-search{border-color:var(--chat-border);background:var(--chat-accent-softer);color:var(--chat-muted)}
.teacher-chat-search:focus-within{border-color:var(--chat-accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--chat-accent) 14%,transparent)}
.teacher-chat-search input{color:var(--chat-text)}
.teacher-chat-dialog-list{scrollbar-color:var(--chat-scroll-thumb) var(--chat-scroll-track)}
.teacher-chat-dialog-list::-webkit-scrollbar-track{background:var(--chat-scroll-track)}.teacher-chat-dialog-list::-webkit-scrollbar-thumb{border-color:var(--chat-scroll-track);background:var(--chat-scroll-thumb)}
.teacher-chat-dialog{border-bottom-color:var(--chat-border);background:var(--chat-surface);color:var(--chat-text)}
.teacher-chat-dialog:hover{background:var(--chat-accent-softer)}.teacher-chat-dialog.is-active{border-left-color:var(--chat-accent);background:var(--chat-accent-soft)}
.teacher-chat-dialog>i{background:var(--chat-accent-soft);color:var(--chat-accent-strong)}.teacher-chat-dialog small,.teacher-chat-dialog em,.teacher-chat-dialog time{color:var(--chat-muted)}.teacher-chat-dialog>u,.teacher-chat-dialog.is-forward-target:after{color:var(--chat-accent-strong)}
.teacher-chat-new,.teacher-chat-send{background:var(--chat-accent);color:#fff;box-shadow:0 9px 24px color-mix(in srgb,var(--chat-accent) 34%,transparent)}
.teacher-chat-header{border-color:var(--chat-border);background:var(--chat-surface-glass)}.teacher-chat-header>i{background:var(--chat-accent);color:#fff}.teacher-chat-header h3{color:var(--chat-text)}.teacher-chat-header p{color:var(--chat-muted)}
.teacher-chat-header>button{color:var(--chat-accent-strong)}.teacher-chat-header>button:hover{border-color:var(--chat-border);background:var(--chat-accent-soft)}
.teacher-chat-theme-popover,.teacher-chat-context,.teacher-chat-emoji{border-color:var(--chat-border);background:var(--chat-surface);color:var(--chat-text);box-shadow:0 18px 40px color-mix(in srgb,var(--chat-accent) 22%,transparent)}
.teacher-chat-theme-popover button.is-active{box-shadow:0 0 0 2px var(--chat-accent)}
.teacher-chat-selection{border-color:var(--chat-border);background:var(--chat-surface)}.teacher-chat-selection button{border-color:var(--chat-border);background:var(--chat-surface)}
.teacher-chat-day{border-color:var(--chat-border);background:var(--chat-surface-glass);color:var(--chat-muted)}
.teacher-chat-message-row.is-selected:before{background:color-mix(in srgb,var(--chat-accent) 16%,transparent);color:var(--chat-accent-strong)}.teacher-chat-message-row.is-flashed .teacher-chat-bubble{box-shadow:0 0 0 4px color-mix(in srgb,var(--chat-accent) 20%,transparent)}
.teacher-chat-avatar{background:var(--chat-surface);color:var(--chat-accent-strong)}.teacher-chat-message-row.is-own .teacher-chat-avatar{background:var(--chat-accent);color:#fff}
.teacher-chat-bubble{border-color:var(--chat-border);background:var(--chat-incoming-bubble);color:var(--chat-text)}.teacher-chat-message-row.is-own .teacher-chat-bubble{border-color:color-mix(in srgb,var(--chat-accent) 38%,var(--chat-border));background:var(--chat-own-bubble)}
.teacher-chat-bubble>footer{color:var(--chat-muted)}.teacher-chat-bubble>footer em,.teacher-chat-forwarded,.teacher-chat-reply-quote b{color:var(--chat-accent-strong)}
.teacher-messenger .teacher-chat-bubble>p>a.teacher-chat-link{color:var(--chat-text);font-weight:600;text-decoration:underline;text-underline-offset:2px;overflow-wrap:anywhere}
.teacher-messenger .teacher-chat-bubble>p>a.teacher-chat-link:hover{text-decoration-thickness:2px}
.teacher-messenger .teacher-chat-bubble>p>a.teacher-chat-link:focus-visible{outline:2px solid currentColor;outline-offset:3px;border-radius:2px}
.teacher-chat-more{background:var(--chat-surface-glass);color:var(--chat-muted)}.teacher-chat-reply-quote{border-left-color:var(--chat-accent);background:var(--chat-accent-softer);color:var(--chat-muted)}
.teacher-chat-file,.teacher-chat-image{border-color:var(--chat-border);background:var(--chat-surface-glass);color:var(--chat-text)}.teacher-chat-file>i{background:var(--chat-accent-soft);color:var(--chat-accent-strong)}.teacher-chat-file>svg{color:var(--chat-accent-strong)}
.teacher-chat-context button{background:var(--chat-surface);color:var(--chat-text)}.teacher-chat-context button:hover{background:var(--chat-accent-soft)}.teacher-chat-context hr{background:var(--chat-border)}
.teacher-chat-welcome{color:var(--chat-muted)}.teacher-chat-welcome>span{background:var(--chat-surface-glass)}.teacher-chat-welcome>b{color:var(--chat-text)}
.teacher-chat-composer{border-color:var(--chat-border);background:var(--chat-surface-glass)}.teacher-chat-compose-row>label,.teacher-chat-compose-row>button:not(.teacher-chat-send){border-color:var(--chat-border);background:var(--chat-input);color:var(--chat-accent-strong)}
.teacher-chat-compose-row>label:hover,.teacher-chat-compose-row>button:hover{border-color:var(--chat-accent);background:var(--chat-accent-soft)}.teacher-chat-compose-row textarea{border-color:var(--chat-border);background:var(--chat-input);color:var(--chat-text)}.teacher-chat-compose-row textarea:focus{border-color:var(--chat-accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--chat-accent) 13%,transparent)}
.teacher-chat-composer>small,.teacher-chat-compose-banner small{color:var(--chat-muted)}.teacher-chat-compose-banner{border-left-color:var(--chat-accent);background:var(--chat-accent-soft);color:var(--chat-accent-strong)}
.teacher-chat-file-tray figure{border-color:var(--chat-border);background:var(--chat-accent-softer)}.teacher-chat-emoji button{background:var(--chat-surface)}.teacher-chat-emoji button:hover{background:var(--chat-accent-soft)}
@media(max-width:760px){.teacher-messenger{width:100%;border-radius:15px}.teacher-chat-dialogs{width:100%;height:min(340px,42dvh);border-color:var(--chat-border)}.teacher-chat-conversation{width:100%;height:max(560px,calc(100dvh - 120px))}}
@media(max-width:520px){.teacher-messenger{border-radius:12px}.teacher-chat-dialogs{height:min(300px,38dvh)}.teacher-chat-conversation{height:max(520px,calc(100dvh - 90px))}.teacher-chat-header h3{font-size:14px}.teacher-chat-header p{max-width:52vw}.teacher-chat-bubble{max-width:91%;min-width:0}.teacher-chat-compose-row{gap:5px}.teacher-chat-compose-row>label,.teacher-chat-compose-row>button:not(.teacher-chat-send){width:36px;height:36px}.teacher-chat-send{width:40px;height:40px}}

/* Темы чата из утверждённого спектра «Райской птицы». */
.teacher-messenger{--chat-accent:#876ed7;--chat-accent-strong:#412c84;--chat-on-accent:#fff;--chat-accent-soft:#ece8fb;--chat-accent-softer:#f8f6ff}
.teacher-messenger.theme-lavender{--chat-bg:#f7f3ff;--chat-pattern:#6a48d70b}
.teacher-messenger.theme-blue{--chat-bg:#f3f0ff;--chat-pattern:#3914af0c;--chat-accent:#3914af;--chat-accent-strong:#200772;--chat-on-accent:#fff;--chat-accent-soft:#e9e3fb;--chat-accent-softer:#f5f2ff;--chat-surface:#fdfcff;--chat-surface-glass:#fdfcfff0;--chat-border:#d6cdf1;--chat-text:#211247;--chat-muted:#6f6487;--chat-own-bubble:#e5ddfa;--chat-incoming-bubble:#fff;--chat-input:#fff;--chat-scroll-track:#f1edfa;--chat-scroll-thumb:#876ed7}
.teacher-messenger.theme-cream{--chat-bg:#fffde7;--chat-pattern:#a6890012;--chat-accent:#ffd300;--chat-accent-strong:#a68900;--chat-on-accent:#48036f;--chat-accent-soft:#fff2a8;--chat-accent-softer:#fffbe2;--chat-surface:#fffef8;--chat-surface-glass:#fffef8f0;--chat-border:#e8d77c;--chat-text:#3d2844;--chat-muted:#786b55;--chat-own-bubble:#ffe773;--chat-incoming-bubble:#fffefa;--chat-input:#fffefb;--chat-scroll-track:#fff8d7;--chat-scroll-thumb:#bfa730}
.teacher-messenger.theme-mint{--chat-bg:#fbf1ff;--chat-pattern:#7109aa0d;--chat-accent:#7109aa;--chat-accent-strong:#48036f;--chat-on-accent:#fff;--chat-accent-soft:#eeddf7;--chat-accent-softer:#fbf3ff;--chat-surface:#fffaff;--chat-surface-glass:#fffafff0;--chat-border:#dcc4e8;--chat-text:#35133f;--chat-muted:#76617d;--chat-own-bubble:#e8d3f2;--chat-incoming-bubble:#fff;--chat-input:#fffaff;--chat-scroll-track:#f6ecfa;--chat-scroll-thumb:#ad66d5}
.teacher-messenger.theme-gray{--chat-bg:#fff4ff;--chat-pattern:#9f3ed50d;--chat-accent:#9f3ed5;--chat-accent-strong:#5f2580;--chat-on-accent:#fff;--chat-accent-soft:#f1ddfa;--chat-accent-softer:#fff6ff;--chat-surface:#fffbff;--chat-surface-glass:#fffbfff0;--chat-border:#e1c8ec;--chat-text:#35163e;--chat-muted:#77637d;--chat-own-bubble:#ebd3f5;--chat-incoming-bubble:#fff;--chat-input:#fffaff;--chat-scroll-track:#f8effb;--chat-scroll-thumb:#ad66d5}
.teacher-chat-theme-popover .is-lavender{background:#876ed7}.teacher-chat-theme-popover .is-blue{background:#3914af}.teacher-chat-theme-popover .is-cream{background:#ffd300}.teacher-chat-theme-popover .is-mint{background:#7109aa}.teacher-chat-theme-popover .is-gray{background:#9f3ed5}
.teacher-chat-dialogs>header>strong,.teacher-chat-dialog>strong,.teacher-chat-new,.teacher-chat-send,.teacher-chat-header>i,.teacher-chat-message-row.is-own .teacher-chat-avatar{color:var(--chat-on-accent)}

/* Непрочитанные сообщения, подтверждение прочтения и отложенные ответы. */
.teacher-chat-list-filters{display:flex;gap:6px;margin:0 14px 10px;padding:4px;border:1px solid var(--chat-border);border-radius:12px;background:var(--chat-accent-softer)}
.teacher-chat-list-filters button{min-width:0;flex:1;padding:7px 6px;border:0;border-radius:8px;background:transparent;color:var(--chat-muted);font:inherit;font-size:10px;font-weight:800;white-space:nowrap;cursor:pointer}
.teacher-chat-list-filters button:hover{background:var(--chat-surface)}.teacher-chat-list-filters button.is-active{background:var(--chat-accent);color:var(--chat-on-accent);box-shadow:0 4px 12px color-mix(in srgb,var(--chat-accent) 22%,transparent)}
.teacher-chat-dialog.has-unread:not(.is-active){background:color-mix(in srgb,var(--chat-accent-soft) 58%,var(--chat-surface))}.teacher-chat-dialog.has-unread b,.teacher-chat-dialog.has-unread em{font-weight:850;color:var(--chat-text)}
.teacher-chat-dialog.needs-reply{padding-bottom:28px}.teacher-chat-reply-flag{position:absolute;left:72px;bottom:6px!important;padding:3px 7px!important;border-radius:999px!important;background:#fff2cf!important;color:#8b5b00!important;font-size:8px!important;font-weight:900!important;line-height:1.2;white-space:nowrap}
.teacher-chat-receipt{color:var(--chat-muted)!important;font-style:normal;font-weight:900;text-decoration:none}.teacher-chat-receipt.is-read{color:var(--chat-accent-strong)!important}
.teacher-chat-new-divider{display:flex;align-items:center;gap:10px;margin:16px 0 10px;color:var(--chat-accent-strong);font-size:10px;font-weight:900}.teacher-chat-new-divider:before,.teacher-chat-new-divider:after{content:"";height:1px;flex:1;background:color-mix(in srgb,var(--chat-accent) 46%,transparent)}.teacher-chat-new-divider span{padding:4px 9px;border-radius:999px;background:var(--chat-accent-soft);white-space:nowrap}
.teacher-chat-message-row.needs-reply .teacher-chat-bubble{box-shadow:0 0 0 2px #efbd522b,0 4px 13px #2b1d430c}.teacher-chat-needs-reply{width:max-content;margin-top:7px;padding:3px 7px;border-radius:999px;background:#fff2cf;color:#8b5b00;font-size:8px;font-weight:900}
@media(max-width:420px){.teacher-chat-list-filters{gap:3px;margin-inline:9px}.teacher-chat-list-filters button{font-size:9px;padding-inline:3px}}

/* Fit the conversation to its available viewport, not its text's intrinsic size. */
.teacher-messenger{height:var(--teacher-chat-height,calc(100dvh - 126px));min-height:0;display:grid;grid-template-columns:minmax(290px,34%) minmax(0,1fr);overflow:hidden}
.teacher-messenger .teacher-chat-dialogs{width:auto;height:100%;min-height:0}
.teacher-messenger .teacher-chat-conversation{width:100%;height:100%;min-width:0;grid-template-columns:minmax(0,1fr)}
.teacher-chat-header,.teacher-chat-history,.teacher-chat-composer{min-width:0;max-width:100%}
.teacher-chat-header>.teacher-chat-person{flex:1;min-width:0;overflow:hidden}
.teacher-chat-person h3{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.teacher-chat-person>[data-chat-person-info]{display:block;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;margin-top:4px;padding:0;border:0;background:none;color:var(--chat-muted);font:inherit;font-size:11px;cursor:pointer}
.teacher-chat-person>[data-chat-person-info]:hover{text-decoration:underline;color:var(--chat-text)}
.teacher-chat-header>button{flex:none}
.teacher-chat-header>button[data-focus-chat-search]{width:39px;padding:0}
.teacher-chat-header>button.teacher-chat-back{display:none;width:34px;padding:0}
.teacher-chat-return{display:none;margin:0 14px 10px;padding:9px 12px;border:1px solid var(--chat-border);border-radius:9px;background:var(--chat-accent-soft);color:var(--chat-text);font:inherit;font-size:13px;cursor:pointer}
.teacher-chat-person-info{position:absolute;z-index:31;top:calc(100% - 3px);left:12px;right:12px;max-height:min(220px,40dvh);overflow:auto;padding:14px 45px 14px 14px;border:1px solid var(--chat-border);border-radius:12px;background:var(--chat-surface);color:var(--chat-text);box-shadow:0 8px 20px #21144820;overflow-wrap:anywhere}
.teacher-chat-person-info>b{display:block;font-size:14px}
.teacher-chat-header .teacher-chat-person-info p{white-space:normal;max-width:none;font-size:12px;line-height:1.5;color:var(--chat-text)}
.teacher-chat-person-info>button{position:absolute;top:6px;right:6px;padding:5px;border:0;border-radius:7px;background:var(--chat-accent-soft);color:var(--chat-accent-strong);cursor:pointer}
.teacher-chat-compose-row{min-width:0}
.teacher-chat-compose-row textarea{width:0;min-width:0;flex:1 1 0}
.teacher-chat-composer>small{color:var(--chat-muted)}
.teacher-chat-selection{min-width:0;flex-wrap:wrap}
.teacher-chat-history{overscroll-behavior:contain}
.teacher-chat-dialog-list{overscroll-behavior:contain}
.teacher-messenger[data-compact=true]{grid-template-columns:minmax(0,1fr)}
.teacher-messenger[data-compact=true] .teacher-chat-dialogs{border-right:0}
.teacher-messenger[data-compact=true][data-chat-pane=conversation] .teacher-chat-dialogs,
.teacher-messenger[data-compact=true][data-chat-pane=dialogs] .teacher-chat-conversation{display:none}
.teacher-messenger[data-compact=true] .teacher-chat-back,
.teacher-messenger[data-compact=true] .teacher-chat-return{display:flex;align-items:center;justify-content:center}
.teacher-messenger[data-compact=true] .teacher-chat-header{gap:7px;padding:9px 10px}
.teacher-messenger[data-compact=true] .teacher-chat-header>i{width:34px;height:34px;font-size:12px}
.teacher-messenger[data-compact=true] .teacher-chat-header h3{font-size:14px}
.teacher-messenger[data-compact=true] .teacher-chat-theme-button span{display:none}
.teacher-messenger[data-compact=true] .teacher-chat-theme-button{width:34px;padding:0}
.teacher-messenger[data-compact=true] .teacher-chat-history{padding:14px 10px}
.teacher-messenger[data-compact=true] .teacher-chat-bubble{max-width:88%;min-width:0}
.teacher-messenger[data-compact=true] .teacher-chat-composer{padding:8px}
.teacher-messenger button:focus-visible,.teacher-messenger [data-chat-person-info]:focus-visible{outline:2px solid var(--chat-accent-strong);outline-offset:2px}
.teacher-page .parent-main-content:has(>.teacher-messenger){margin-bottom:0}
.teacher-page .parent-workspace:has(.teacher-messenger){padding-bottom:12px}
.teacher-page:has(.teacher-messenger) .teacher-toast{top:12px;bottom:auto;pointer-events:none}
.teacher-messenger[data-short=true] .teacher-chat-header{min-height:58px;padding-block:5px}
.teacher-messenger[data-short=true] .teacher-chat-composer>small{display:none}
.teacher-messenger[data-short=true][data-compact=true] .teacher-chat-dialogs>header,
.teacher-messenger[data-short=true][data-compact=true] .teacher-chat-notifications{display:none}
.teacher-messenger[data-short=true][data-compact=true] .teacher-chat-return{margin:6px 10px 0;padding:6px 10px}
.teacher-messenger[data-short=true][data-compact=true] .teacher-chat-search{margin:6px 10px;padding:7px 10px}
.teacher-messenger[data-short=true][data-compact=true] .teacher-chat-list-filters{margin:0 10px 6px}
@media(max-width:420px){
 .teacher-messenger[data-compact=true] .teacher-chat-header{gap:5px;padding-inline:8px}
 .teacher-messenger[data-compact=true] .teacher-chat-header>button{width:32px}
 .teacher-messenger[data-compact=true] .teacher-chat-header>i{display:none}
 .teacher-chat-compose-row>label:nth-of-type(2){display:none}
}

/* Readable text and touch controls, scoped to the internal parent/teacher chat. */
.teacher-messenger{--chat-muted:#655c76;--chat-accent:#6740b5;--chat-on-accent:#fff}
.teacher-messenger.theme-cream{--chat-accent:#ffd300;--chat-accent-strong:#6d5900;--chat-on-accent:#48036f}
.teacher-messenger.theme-blue{--chat-accent:#3914af}
.teacher-messenger.theme-mint{--chat-accent:#7109aa}
.teacher-messenger.theme-gray{--chat-accent:#9f3ed5}
.teacher-messenger .teacher-chat-bubble>p{font-size:16px;line-height:1.55}
.teacher-messenger .teacher-chat-bubble{max-width:min(82%,720px);padding:11px 14px}
.teacher-messenger .teacher-chat-bubble footer{font-size:12px;line-height:1.4;flex-wrap:wrap;row-gap:4px;color:var(--chat-muted)}
.teacher-messenger .teacher-chat-dialog>span>b{font-size:15px;line-height:1.35}
.teacher-messenger .teacher-chat-dialog>span>small{font-size:12px;line-height:1.4;color:var(--chat-muted)}
.teacher-messenger .teacher-chat-dialog>span>em{font-size:14px;line-height:1.4;color:var(--chat-muted)}
.teacher-messenger .teacher-chat-dialog>time{font-size:11px;color:var(--chat-muted)}
.teacher-messenger .teacher-chat-dialog>strong{font-size:12px;min-width:24px;height:24px}
.teacher-messenger .teacher-chat-dialog{min-height:92px;padding-block:12px}
.teacher-messenger .teacher-chat-search input{font-size:16px;min-height:28px}
.teacher-messenger .teacher-chat-search{min-height:44px;padding-block:7px}
.teacher-messenger .teacher-chat-list-filters button{min-height:44px;font-size:13px;padding:7px 4px;white-space:normal;line-height:1.25}
.teacher-messenger .teacher-chat-reply-flag,.teacher-messenger .teacher-chat-needs-reply{font-size:11px;line-height:1.35}
.teacher-messenger .teacher-chat-day,.teacher-messenger .teacher-chat-new-divider{font-size:12px}
.teacher-messenger .teacher-chat-header h3,.teacher-messenger[data-compact=true] .teacher-chat-header h3{font-size:16px;line-height:1.3}
.teacher-messenger .teacher-chat-header p{font-size:12px;line-height:1.4;color:var(--chat-muted)}
.teacher-messenger .teacher-chat-person{min-width:0;flex:1}
.parent-messenger .teacher-chat-person h3,.parent-messenger .teacher-chat-person p{white-space:normal;overflow-wrap:anywhere}
.parent-messenger .teacher-chat-person h3{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
.parent-messenger .teacher-chat-person p{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
.teacher-messenger .teacher-chat-header>button,.teacher-messenger[data-compact=true] .teacher-chat-header>button{min-width:44px;width:44px;min-height:44px;padding:0;flex-shrink:0}
.teacher-messenger .teacher-chat-header .teacher-chat-theme-button span{display:none}
.teacher-messenger .teacher-chat-back{font-size:30px;line-height:1}
.teacher-messenger .teacher-chat-return{min-height:44px;font-size:14px}
.teacher-messenger .teacher-chat-compose-row{gap:6px}
.teacher-messenger .teacher-chat-compose-row>label,.teacher-messenger .teacher-chat-compose-row>button:not(.teacher-chat-send){width:44px;height:44px;min-width:44px;min-height:44px}
.teacher-messenger .teacher-chat-compose-row textarea{font-size:16px;line-height:1.4;min-height:44px;padding:10px;scroll-margin-block:8px}
.teacher-messenger .teacher-chat-send{width:48px;height:44px;min-width:48px;min-height:44px;flex-shrink:0}
.teacher-messenger .teacher-chat-composer{padding-bottom:max(10px,env(safe-area-inset-bottom,0px));backdrop-filter:none}
.teacher-messenger .teacher-chat-composer>small{font-size:11px;line-height:1.4;color:var(--chat-muted)}
.teacher-messenger .teacher-chat-compose-banner b{font-size:13px}
.teacher-messenger .teacher-chat-compose-banner small{font-size:12px;color:var(--chat-muted)}
.teacher-messenger .teacher-chat-compose-banner button{width:36px;height:36px;flex-shrink:0}
.teacher-messenger .teacher-chat-file{min-width:0;max-width:100%;grid-template-columns:32px minmax(0,1fr) 20px}
.teacher-messenger .teacher-chat-file b{font-size:13px;overflow-wrap:anywhere}
.teacher-messenger .teacher-chat-file small,.teacher-messenger .teacher-chat-image>small{font-size:12px;color:var(--chat-muted)}
.teacher-messenger .teacher-chat-file-tray figcaption{font-size:11px;background:#352448}
.teacher-messenger .teacher-chat-file-tray button{width:32px;height:32px}
.teacher-messenger .teacher-chat-context button{font-size:14px;min-height:44px}
.teacher-messenger .teacher-chat-more{width:32px;height:32px}
.teacher-messenger .teacher-chat-reply-quote b,.teacher-messenger .teacher-chat-forwarded{font-size:12px}
.teacher-messenger .teacher-chat-reply-quote span{font-size:13px}
.teacher-messenger .teacher-chat-empty-list,.teacher-messenger .teacher-chat-welcome p{font-size:14px}
.teacher-messenger .parent-chat-readonly{flex-wrap:wrap}
.teacher-messenger .parent-chat-readonly b{font-size:14px}
.teacher-messenger .parent-chat-readonly span{font-size:12px}
.teacher-messenger[data-compact=true] .teacher-chat-bubble{max-width:calc(100% - 40px);padding:10px 12px}
.teacher-messenger[data-compact=true] .teacher-chat-history{padding:12px 8px}
.teacher-messenger[data-compact=true] .teacher-chat-composer>small{display:none}
.teacher-messenger[data-compact=true] .teacher-chat-header{min-height:70px}
.teacher-messenger[data-short=true] .teacher-chat-header{min-height:54px;padding-block:4px}
.teacher-messenger[data-short=true] .teacher-chat-person>p,.teacher-messenger[data-short=true] .teacher-chat-person>[data-chat-person-info],.teacher-messenger[data-short=true] .teacher-chat-person>.chat-presence{display:none}
.teacher-messenger[data-short=true] .teacher-chat-person h3{-webkit-line-clamp:1}
.teacher-messenger[data-short=true] .teacher-chat-history{padding-block:6px}
@media(max-width:420px){
 .teacher-messenger[data-compact=true] .teacher-chat-header>i{display:none}
 .teacher-messenger .teacher-chat-compose-row>label:nth-of-type(2){display:none}
 .teacher-messenger .teacher-chat-list-filters{margin-inline:8px;gap:3px}
}

/* Keep the picker inside the available chat, even above a mobile keyboard. */
.teacher-messenger .chat-emoji-picker{left:0;max-width:100%;height:min(410px,calc(var(--teacher-chat-height,500px) - 78px));max-height:calc(100dvh - 100px)}
.teacher-messenger .chat-emoji-picker header input{font-size:16px}
.teacher-messenger .chat-emoji-picker h4{font-size:11px;color:var(--chat-muted)}
.teacher-messenger .chat-emoji-picker nav button{min-width:40px;min-height:40px}
.teacher-messenger .chat-emoji-picker main button{min-height:40px}

.teacher-messenger[class*="theme-"]{--chat-muted:#594c66}
