:root{font-family:"Segoe UI",Arial,sans-serif;color:#111827;background:#F6F7F9;font-size:16px;color-scheme:light}*{box-sizing:border-box}body{margin:0}button,input,textarea,select{font:inherit}button{border:0;border-radius:10px;padding:12px 18px;background:#0B78F0;color:white;font-weight:600;cursor:pointer}button:hover{filter:brightness(.95)}button:disabled{opacity:.5;cursor:wait}button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:3px solid #8aacfa;outline-offset:3px}.secondary{background:#EAF3FF;color:#0A68D1}[hidden]{display:none!important}h1{font-size:30px;margin:8px 0 16px}h2{font-size:21px;margin:0 0 18px}p{line-height:1.6}small,.muted{color:#637087;line-height:1.6}.login{max-width:480px;margin:48px auto;padding:0 20px}.login>.brand{margin-bottom:20px}.brand{display:inline-grid;place-items:center;width:64px;height:64px;background:#ffc83d;color:#224b9b;border-radius:18px;font-weight:900;font-size:42px}.brand.small{width:44px;height:44px;font-size:30px;border-radius:12px}.card{background:white;border:1px solid #e0e7f1;border-radius:16px;padding:22px;margin-bottom:16px}.login form{display:grid;gap:12px}label{display:grid;gap:8px;font-size:14px;font-weight:600;margin-bottom:12px}input,textarea,select{width:100%;padding:12px;border:1px solid #cbd5e5;border-radius:9px;background:white;color:#111827}textarea{resize:vertical;min-height:70px}input[type=checkbox]{width:20px;height:20px;accent-color:#0B78F0}.workspace{display:flex;height:100vh}aside{width:230px;flex-shrink:0;background:#fff;border-right:1px solid #e0e7f1;padding:28px 18px;display:flex;flex-direction:column}.wordmark{display:flex;align-items:center;gap:12px;padding:0 8px 35px}nav{display:grid;gap:7px}.nav{background:transparent;color:#59677d;text-align:left;padding:15px}.nav.active{background:#EAF3FF;color:#0B78F0}.account{margin-top:auto;display:grid;gap:8px;padding:20px 8px 0;overflow-wrap:anywhere}main{flex:1;min-width:0;display:flex;flex-direction:column}header{display:flex;align-items:center;justify-content:space-between;padding:28px 36px 18px;background:#fff;border-bottom:1px solid #e0e7f1}header h1{margin:6px 0}.eyebrow{font-size:10px;letter-spacing:2px;color:#0B78F0;font-weight:800}.sync{display:flex;align-items:center;gap:18px}.notice{padding:14px 36px;background:#fff0cf;color:#76511b;line-height:1.5}#content{padding:28px 36px;overflow:auto;flex:1}.hero{background:#0B78F0;color:white;padding:30px;border-radius:18px;margin-bottom:20px}.hero h2{font-size:29px}.hero p{margin-bottom:0;color:#e0eaff}.stats{display:flex;gap:16px;margin-bottom:22px}.stat{background:white;padding:22px;border-radius:15px;flex:1}.stat strong{display:block;color:#0B78F0;font-size:32px;margin-bottom:5px}.actions{display:flex;gap:10px;align-items:center;margin-bottom:20px;flex-wrap:wrap}.filters{display:flex;gap:8px}.filters button{border-radius:25px}.post{white-space:pre-wrap;overflow-wrap:anywhere;margin:8px 0}.meta{font-size:12px;color:#64748b;line-height:1.7}.task-title{display:flex;align-items:center;gap:12px;font-size:17px}.done{text-decoration:line-through;color:#68778d}.bubble{background:white;border:1px solid #e0e7f1;border-radius:15px;padding:16px 20px;margin-bottom:13px;max-width:80%;width:fit-content;min-width:180px}.bubble.mine{background:#DDEEFF;margin-left:auto;border-color:#cdddf8}.composer{display:flex;gap:12px;align-items:center;padding:18px 36px;background:white;border-top:1px solid #e0e7f1}.composer textarea{flex:1}.empty{padding:35px;text-align:center;color:#64748b;background:#eaf0f8;border-radius:14px}.person{display:flex;align-items:center;gap:15px}.avatar{display:grid;place-items:center;background:#e7effb;color:#0B78F0;width:46px;height:46px;border-radius:14px;font-weight:700}.error{color:#a52a25;white-space:pre-wrap}.error:empty{display:none}dialog{width:540px;max-width:90vw;max-height:90vh;border:1px solid #dce3ed;border-radius:18px;padding:26px;color:#111827}dialog::backdrop{background:#15223b80}.dialog-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:20px}.dialog-heading h2{margin:0}.invitation{white-space:pre-wrap;background:#f0f4fa;padding:18px;border-radius:12px;overflow-wrap:anywhere;user-select:text}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}@media(max-width:900px){aside{width:180px;padding:20px 12px}header,#content{padding:22px}.sync small{display:none}.composer{padding:15px 22px}}
.chat-image {display:block;max-width:min(100%,420px);max-height:320px;object-fit:contain;cursor:zoom-in;border-radius:12px;margin:12px 0}
.reactions {display:flex;gap:6px;flex-wrap:wrap;margin-top:10px}
.reactions button {padding:5px 9px;font-size:16px}
#chat-list {max-width:420px;flex:1}
#attachment {max-width:180px;font-size:12px;overflow-wrap:anywhere}
#picture {max-width:95vw;max-height:95vh}
#full-picture {display:block;max-width:85vw;max-height:80vh;object-fit:contain}
.account label {font-size:13px}
.account input[type=checkbox] {width:auto}

.install-hint{padding:14px;background:#EAF3FF;border-radius:12px;font-size:14px}
@media(max-width:650px){
.workspace{height:auto;min-height:100dvh;display:block;padding-bottom:env(safe-area-inset-bottom)}
aside{width:100%;padding:12px;border-right:0;border-bottom:1px solid #e0e7f1}
.wordmark{padding:0 0 10px}.wordmark br{display:none}.brand.small{width:32px;height:32px;font-size:24px}
nav{display:flex;gap:4px;overflow:auto}.nav{font-size:13px;padding:12px 9px;white-space:nowrap}
.account{padding:10px 0 0;gap:6px}.account>strong,.account>small:first-of-type{display:none}
.account label{display:flex;align-items:center;margin:0}.account>small{font-size:12px}
.account button{font-size:13px;padding:9px}header{padding:14px;gap:8px}header h1{font-size:23px}.eyebrow{display:none}
#content{padding:14px;overflow:visible}.hero{padding:20px}.hero h2{font-size:23px}.stats{gap:8px}.stat{padding:14px}
.bubble{max-width:95%;min-width:0;padding:12px}.composer{position:sticky;bottom:0;flex-wrap:wrap;padding:10px;padding-bottom:max(10px,env(safe-area-inset-bottom));gap:8px}
.composer textarea{flex-basis:100%;min-height:50px}.composer button{font-size:14px;padding:10px}.filters{flex-wrap:wrap}
dialog{padding:18px;max-width:95vw}.login{margin:20px auto}.card{padding:16px}input,textarea,select{font-size:16px}
}

.avatar-photo{width:46px;height:46px;border-radius:14px;object-fit:cover;background:#e7effb;flex:0 0 auto}


.chat-avatar{display:inline-flex;width:48px;height:48px;flex-shrink:0;align-items:center;justify-content:center;border-radius:14px;background:#dfeaff;color:#2456a6;font-size:24px;font-weight:700;overflow:hidden;vertical-align:middle}.chat-avatar img{width:100%;height:100%;object-fit:cover}

/* 0.7 messenger refresh */
.card,.bubble,dialog{box-shadow:0 1px 2px rgba(17,24,39,.04)}
.nav.active{border-radius:14px}.person-info{flex:1;min-width:0}.danger-link{background:#FFF1F1!important;color:#C62828!important}.danger-button{background:#C62828!important}
.composer{gap:8px}.composer textarea{border-radius:22px;background:#F3F5F7;border-color:#E7E9ED;min-height:44px;max-height:120px}.composer-icon,.send-button{width:44px;height:44px;border-radius:22px;padding:0;flex:0 0 auto}.send-button{font-size:20px}
#chat-list{border-radius:18px;background:#F3F5F7;border-color:#E7E9ED}.bubble{border-radius:18px;max-width:72%}.bubble.mine{border-bottom-right-radius:6px}.bubble:not(.mine){border-bottom-left-radius:6px}
@media(max-width:650px){.composer{flex-wrap:nowrap}.composer textarea{flex-basis:auto;min-width:0}.composer #paste{padding:10px 9px;font-size:13px}.bubble{max-width:88%}}
/* Azbuka conversation surface: supplied artwork, opaque readable bubbles. */
#content.chat-surface{background-color:#d6effa;background-image:linear-gradient(#ffffff70,#ffffff70),url("chat-background.jpg");background-size:auto,432px 768px;background-repeat:repeat}
.chat-surface>.actions{position:sticky;top:-28px;z-index:2;background:#fffffff5;border:1px solid #e7eef5;border-radius:20px;padding:12px;box-shadow:0 3px 15px #193b6210}
.chat-surface .bubble{background:#fff;border:0;box-shadow:0 2px 5px #28578015;padding:12px 16px}
.chat-surface .bubble.mine{background:#c9cde8;box-shadow:0 2px 5px #28578026}
.bubble.mine strong{color:#30416b}.bubble.mine .meta{color:#46516b}
.bubble.notification-target{outline:3px solid #6658b8;outline-offset:3px;scroll-margin-block:110px}
.bubble .post{font-size:16px;line-height:1.5}.bubble strong{color:#1671c5;font-size:14px}
.avatar,.avatar-photo,.chat-avatar{border-radius:50%}
.composer textarea{user-select:text;-webkit-user-select:text;-webkit-touch-callout:default}
.person{flex-wrap:wrap}.person-info{min-width:150px}
@media(max-width:650px){.chat-surface>.actions{position:static;padding:10px;gap:8px}.chat-surface>.actions button{padding:9px;font-size:13px}#content.chat-surface{background-size:auto,360px 640px}.composer{padding-bottom:max(10px,env(safe-area-inset-bottom))}}

/* Chat directory with visible conversation names (web and desktop). */
.chat-layout{display:flex;gap:18px;min-height:100%;align-items:stretch}
.chat-directory{width:310px;min-width:250px;max-width:38%;border-radius:20px;background:#ffffffed;border:1px solid #e5ebf3;padding:16px;overflow:auto;flex-shrink:0}
.chat-directory h2{margin:0 0 14px;font-size:21px}
.chat-directory-actions{display:flex;gap:7px;flex-wrap:wrap;margin-bottom:13px}
.chat-directory-actions button{padding:9px 11px;font-size:13px}
.chat-section-label{font-size:13px;color:#606d81;padding:12px 4px 3px;margin:0;font-weight:700}
.chat-entry{display:flex;align-items:stretch;border:1px solid transparent;border-bottom-color:#ebeff5;border-radius:13px;margin-bottom:4px;gap:4px}
.chat-entry.active,.chat-entry:hover{background:#eaf3ff;border-color:#dce8fc}
.chat-open-button{display:block;text-align:left;flex:1;min-width:0;overflow-wrap:anywhere;background:transparent;color:#15243b;font-size:15px;padding:12px;border-radius:13px}
.chat-preview{display:block;font-size:11px;color:#6a788d;margin-top:4px;font-weight:400}
.chat-star{align-self:center;flex:0 0 auto;background:transparent;color:#c78b19;font-size:24px;padding:9px 13px}
.chat-privacy{font-size:12px;line-height:1.6;color:#65738a;border-top:1px solid #e8eef5;padding-top:12px;margin-top:18px}
.chat-thread{display:flex;flex:1;flex-direction:column;min-width:0;min-height:360px}
.chat-thread[hidden]{display:none}
.chat-thread #chat-controls{position:static;margin-bottom:12px}
.chat-thread #chat-list{min-width:120px;max-width:240px}
.chat-thread #chat-messages{min-height:260px;max-height:calc(100vh - 340px);overflow:auto;flex:1;padding:12px;border-radius:16px;scroll-behavior:auto}
#admin-review{background:#ffffffec;border-radius:16px;padding:18px;overflow:auto;max-height:calc(100vh - 300px)}
#admin-review[hidden]{display:none}
#admin-review .bubble{max-width:100%}
.direct-list{display:flex;flex-direction:column;gap:8px;margin:12px 0}
.direct-list button{text-align:left;background:#eaf3ff;color:#164e89;white-space:normal}
@media(max-width:850px){
 .chat-layout{display:block}
 .chat-directory{max-width:none;width:100%;min-width:0;max-height:none}
 .chat-layout.chat-open .chat-directory{display:none}
 .chat-thread{min-height:56dvh}
 .chat-thread #chat-controls{gap:6px}
 .chat-thread #chat-controls button{font-size:12px;padding:9px}
 .chat-thread #chat-messages{max-height:58dvh;min-height:45dvh}
 #admin-review{max-height:62dvh}
}

/* Message lifecycle: quotation, views and soft deletion */
.reply-preview{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:11px 16px;background:#eef5ff;border-left:3px solid #3b82c4;border-radius:9px;margin:10px 0 2px;color:#213d60}
.reply-preview[hidden]{display:none}
.reply-label{overflow-wrap:anywhere;flex:1;font-size:13px;line-height:1.45}
.reply-preview button{flex-shrink:0;font-size:12px;padding:7px 10px}
.quoted-message{background:#edf4fd;border-left:3px solid #6d9cc7;border-radius:8px;color:#274664;display:flex;flex-direction:column;gap:3px;text-align:left;max-width:100%;white-space:normal;overflow-wrap:anywhere;padding:9px 12px;font-size:13px}
.quoted-message strong{font-size:12px}
.quoted-message span{font-size:12px}
.deleted-post{color:#647386;font-style:italic}
.readers-button{display:inline-flex;align-self:flex-start;background:transparent;color:#4c6686;padding:4px 0;font-size:12px;text-align:left}
.deleted-message-dialog{width:min(690px,95vw);max-height:82vh;overflow:auto}
.deleted-archive-list{display:grid;gap:12px;margin:14px 0;max-height:54vh;overflow:auto}
.archive-entry{border:1px solid #d9e4f0;border-radius:12px;background:#f9fbff;padding:12px;overflow-wrap:anywhere}
.archive-entry .post{white-space:pre-wrap}

/* 0.7.4 — message-rich chat directory */
.chat-directory{background:#ffffffed}
.chat-entry{display:flex;align-items:center;min-height:78px;padding:4px 3px;gap:2px}
.chat-entry.unread{background:#eef6ff;border-bottom-color:#cfe6fc}
.chat-entry>.chat-avatar{margin:0 9px 0 4px;flex:0 0 46px;width:46px;height:46px;font-size:21px}
.chat-open-button{background:transparent;padding:9px 3px;flex:1;min-width:0}
.chat-open-button:hover{background:transparent}
.chat-headline{display:flex;align-items:center;justify-content:space-between;gap:6px}
.chat-headline .chat-name{text-align:left;font-size:14px;line-height:1.35;min-width:0;overflow-wrap:anywhere}
.chat-headline .chat-time{font-size:11px;line-height:1.3;white-space:nowrap;color:#8090a5;flex:0 0 auto}
.chat-entry.unread .chat-name{font-weight:800;color:#0d3c69}
.chat-entry.unread .chat-time{color:#147bd0}
.chat-summary{display:flex;align-items:center;gap:7px;min-width:0;margin-top:4px}
.chat-summary .chat-preview{font-size:12px;color:#6a788d;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;word-break:break-word;text-align:left;flex:1;min-width:0}
.chat-entry.unread .chat-preview{font-weight:600;color:#365c85}
.unread-bubble{background:#087be8;color:white;font-size:11px;min-width:21px;height:21px;padding:2px 6px;border-radius:13px;display:inline-flex;justify-content:center;align-items:center;font-weight:700;flex:0 0 auto}
.chat-star{font-size:22px;align-self:center;padding:7px;min-width:35px}
.message-link{color:#1370d3;text-decoration:underline;text-underline-offset:2px;overflow-wrap:anywhere;font-weight:600}
.message-link:hover{text-decoration-thickness:2px}
@media(max-width:650px){
  .chat-directory{padding:14px 11px}
  .chat-entry>.chat-avatar{flex-basis:44px;height:44px;width:44px;margin-left:2px;margin-right:6px}
  .chat-headline .chat-name{font-size:14px}
  .chat-star{padding:5px;min-width:31px}
}

/* 0.7.5: turquoise author bubble and compact pictogram actions. */
.chat-surface .bubble.mine{
  background:#4EAEF8;
  border:1px solid #3E9CE7;
  color:#14293E;
  box-shadow:0 2px 7px rgba(26,101,158,.19);
}
.chat-surface .bubble.mine strong,
.chat-surface .bubble.mine .meta,
.chat-surface .bubble.mine .post,
.chat-surface .bubble.mine .readers-button{
  color:#17314B;
}
.chat-surface .bubble.mine .message-link{color:#073D75;text-decoration-thickness:2px}
.chat-surface .bubble.mine .quoted-message{background:#D9F1FF;border-left-color:#1B78C4}
.reactions{align-items:center;gap:7px}
.reactions .message-action{
  width:40px;height:40px;min-width:40px;min-height:40px;
  display:inline-flex;align-items:center;justify-content:center;
  padding:0;background:#EEF7FF;color:#235B86;border:1px solid #D5EAFB;
  border-radius:12px;font-size:20px;line-height:1;
}
.reactions .message-action svg{width:21px;height:21px;pointer-events:none}
.reactions .message-action:hover{background:#DBECFC}
.reactions .message-action-delete{color:#B02D31;background:#FFF0F1;border-color:#FBD9DA}
.reactions .message-action-delete:hover{background:#FFE1E2}
.bubble.mine .reactions .message-action{background:#D6F0FF;border-color:#C0E5FF;color:#174D7D}
.bubble.mine .reactions .message-action-delete{background:#FFE9EB;color:#AE292E;border-color:#FFD3D7}
.reactions .message-action:focus-visible{outline:3px solid #135FA3;outline-offset:2px}

/* 0.7.6: soft pastel outgoing messages, compact chat toolbar and named read views. */
.chat-surface .bubble.mine {
  background:#ACDDF9;
  border:1px solid #91CBEA;
  box-shadow:0 2px 5px rgba(32,94,137,.12);
  color:#1B3144;
}
.chat-surface .bubble.mine strong,
.chat-surface .bubble.mine .post,
.chat-surface .bubble.mine .meta,
.chat-surface .bubble.mine .readers-button {color:#213B52}
.chat-surface .bubble.mine .quoted-message{background:#E4F5FF;border-left-color:#80BEE6}
.chat-thread #chat-controls button.chat-tool-icon{
  width:40px;height:40px;min-width:40px;min-height:40px;
  display:inline-flex;align-items:center;justify-content:center;
  padding:0;background:#EDF7FF;color:#235E87;
  border:1px solid #D5E8F6;border-radius:12px;
}
.chat-thread #chat-controls .chat-tool-icon svg{
  width:21px;height:21px;pointer-events:none
}
.chat-thread #chat-controls .chat-tool-icon:hover{background:#DDF0FF}
.chat-thread #chat-controls .chat-tool-icon:focus-visible{
  outline:3px solid #317DC1;outline-offset:2px
}
.readers-button {
  display:flex;flex-direction:column;align-items:flex-start;
  text-align:left;white-space:normal;max-width:100%;
  gap:2px;padding:5px 2px;border-radius:7px;
  background:transparent;color:#264661;line-height:1.4;
}
.readers-button:hover{background:#FFFFFF55}
.readers-names{font-weight:700;font-size:12px;overflow-wrap:anywhere}
.readers-count{font-size:11px;opacity:.86}
.reader-people{display:grid;gap:8px;max-height:48vh;overflow:auto;margin:14px 0}
.reader-person{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;
 gap:6px;padding:10px 12px;border:1px solid #E1EBF4;border-radius:10px;background:#F7FBFF}
.reader-person strong{font-size:14px;color:#26425D}
@media(max-width:650px){
 .chat-thread #chat-controls{gap:5px}
 .chat-thread #chat-controls button.chat-tool-icon{width:38px;height:38px;min-width:38px;min-height:38px;padding:0}
}

.message-gallery{display:grid;grid-template-columns:repeat(auto-fit,minmax(105px,1fr));gap:8px;width:min(100%,480px);margin:10px 0}
.message-gallery .chat-image{width:100%;height:160px;max-height:160px;max-width:100%;object-fit:cover;margin:0;border-radius:10px}
.composer{flex-wrap:wrap;gap:8px}
.composer textarea{flex:1 1 210px;min-width:150px}
#attachment{display:flex;gap:5px;flex-wrap:wrap;max-width:100%;width:100%;order:3}
#attachment span{font-size:12px;overflow-wrap:anywhere}
#attachment button{font-size:12px;padding:3px 7px}
.composer #paste,.composer #schedule,.composer #reminders{display:inline-grid;place-items:center;width:44px;height:44px;padding:0;font-size:22px;line-height:1;flex:0 0 44px}
dialog form{overflow-y:auto;max-height:78vh}
@media(max-width:700px){.composer{padding:9px}.composer textarea{order:2;width:100%;flex-basis:75%}.composer .send-button{order:2}.message-gallery{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Revision, acknowledgement and compact direct-message controls. */
.direct-message-icon{width:40px;height:40px;padding:0!important;border-radius:13px;font-size:21px!important;display:inline-grid;place-items:center;flex:0 0 auto}
.message-edited{font-size:11px;color:#60768e;display:block;padding:0 0 4px}
.policy-text{white-space:pre-wrap;line-height:1.65;font-size:14px;max-height:45vh;overflow:auto}
.policy-accept-label{display:flex;align-items:flex-start;gap:13px;font-size:14px;line-height:1.5;margin:17px 0}
.policy-accept-label input{width:22px;height:22px;flex:0 0 22px;margin-top:1px}
#policy-dialog{width:min(640px,96vw);max-height:95dvh;overflow:auto}
#policy-dialog #policy-submit{width:100%}
.edited-archive-list{max-height:52vh;overflow:auto}
.edited-archive-list button{text-align:left;white-space:normal}


/* Shared pinned-message strip: compact at the top of each conversation. */
.chat-pins{margin:0 12px 8px;padding:9px 11px;border:1px solid #c8e3f5;
  border-radius:15px;background:#f4faff;box-shadow:0 2px 8px #163c6714;flex:0 0 auto;max-height:36vh;overflow:auto}
.chat-pins .pin-header{border:0;background:transparent;color:#245c89;
  font-size:13px;font-weight:750;text-align:left;padding:5px 7px;width:100%}
.chat-pins .pin-preview{background:transparent;border:0;color:#243c54;font-size:13px;
  font-weight:500;text-align:left;overflow-wrap:anywhere;padding:6px 8px;width:100%;white-space:normal}
.chat-pins .pin-items{display:flex;flex-direction:column;gap:5px;max-height:23vh;overflow-y:auto}
.chat-pins .pin-item{display:flex;align-items:center;gap:7px;border-radius:10px;background:#fff}
.chat-pins .pin-item button:first-child{flex:1;background:transparent;color:#253f5b;
  font-size:13px;font-weight:500;min-width:0;text-align:left;white-space:normal;overflow-wrap:anywhere;padding:9px}
.chat-pins .pin-item .pin-unpin{flex:0 0 32px;height:32px;padding:0;border-radius:9px;
  background:#fff0ee;color:#9a3d3d;font-size:20px;margin-right:4px}
.chat-pins .pin-back{display:block;width:100%;margin-top:7px;padding:8px 12px;border-radius:10px;
  background:#e4f2ff;color:#205c97;font-size:13px}
.message-action-pin.pinned-active{background:#d5eefe!important;color:#005b98!important}
@media(max-width:700px){.chat-pins{margin:0 5px 6px;padding:6px 8px;max-height:30vh}}

/* The staff app uses its actual Azbuka Team mascot icon at login and in the mobile header. */
.brand.brand-icon{display:block;object-fit:cover;padding:0;background:#fff;box-shadow:0 2px 8px #16416b1c}
.login>.brand.brand-icon{width:88px;height:88px;border-radius:21px;margin-bottom:20px}
.brand.small.brand-icon{width:44px;height:44px;border-radius:12px;flex:0 0 auto}
@media(max-width:650px){.brand.small.brand-icon{width:36px;height:36px;border-radius:10px}}


/* Nested chats retain separate permissions and membership. */
.chat-children{margin:1px 0 10px 12px;border-left:2px solid #cce1f6;padding-left:8px}
.chat-children>summary{cursor:pointer;padding:8px 5px;color:#286192;font-size:13px;font-weight:700}
.chat-children-list{display:grid;gap:3px}
.chat-children .subchat-entry{min-height:60px;background:#f4f9ff}
.chat-children .subchat-entry>.chat-avatar{width:35px;height:35px;flex-basis:35px;font-size:17px;margin:0 4px}
.chat-children .subchat-entry .chat-name{font-size:13px}

/* Message actions appear after selecting a bubble (or on desktop hover). */
.chat-surface .bubble,.bubble{position:relative}
.bubble .message-more{display:none;position:absolute;top:6px;right:7px;z-index:4}
.bubble.message-selected .message-more,.bubble:focus-within .message-more,
.bubble:hover .message-more{display:block}
.message-more>summary{list-style:none;cursor:pointer;width:33px;height:33px;background:#e9f4ff;
 color:#1c5787;border:1px solid #c8dff5;border-radius:11px;display:flex;align-items:center;
 justify-content:center;font-size:26px;font-weight:750;line-height:1}
.message-more>summary::-webkit-details-marker{display:none}
.message-more[open]{z-index:12}
.message-more-actions{position:absolute;right:0;top:37px;display:flex;flex-direction:column;gap:4px;
 min-width:196px;padding:8px;background:#fff;box-shadow:0 10px 35px #1b466c42;border:1px solid #d8e7f6;
 border-radius:14px;max-height:65dvh;overflow-y:auto}
.message-more-actions button{white-space:nowrap;text-align:left;display:flex;justify-content:flex-start;
 width:100%;background:transparent;color:#284565;border:0;border-radius:8px;font-size:14px;padding:10px 12px}
.message-more-actions button:hover{background:#eaf4ff}
.forward-targets{display:grid;gap:6px;margin:10px 0;max-height:46vh;overflow-y:auto}
.forward-targets button{text-align:left;white-space:normal}
.forward-label{display:block;font-size:12px;color:#506c8b;margin-top:4px}
.composer #dictate{display:inline-grid;place-items:center;width:44px;height:44px;
 padding:0;font-size:22px;flex:0 0 44px}
.composer #dictate[aria-pressed="true"]{background:#cdeaff;border-color:#7eb8ea}

/* Attachments preserve their original bytes and are saved, never executed inline. */
.message-files{display:flex;flex-direction:column;gap:6px;margin:10px 0;max-width:100%}
.message-file-download{display:flex;align-items:center;gap:8px;text-align:left;background:#edf5ff;
 color:#214b74;border:1px solid #cadef1;border-radius:12px;padding:10px 12px;
 font-size:13px;font-weight:600;max-width:100%;white-space:normal;overflow-wrap:anywhere}
.message-file-download:hover{background:#dceeff}
.attachment-file-pill{display:flex;align-items:center;gap:5px;border-radius:10px;
 padding:4px 6px;background:#eaf3ff;color:#1b4b78;font-size:12px;max-width:100%;overflow-wrap:anywhere}
#attachment .attachment-file-pill button{width:27px;height:27px;padding:2px;border-radius:8px}
.composer #attach-files{display:inline-grid;place-items:center;width:44px;height:44px;
 padding:0;font-size:22px;flex:0 0 44px}

/* Show a complete photo in a true viewport-filling dark viewer; never crop. */
dialog#picture{position:fixed;inset:0;margin:0;border:0;border-radius:0;
 width:100vw;height:100dvh;max-width:100vw;max-height:100dvh;
 padding:0;background:#0d121a;color:#fff;overflow:hidden}
#picture::backdrop{background:#0d121a}
#picture-toolbar{height:60px;padding:8px 16px;background:#17212c;
 display:flex;align-items:center;justify-content:space-between;gap:10px;z-index:2}
#picture-toolbar button{background:#29394b;color:white;border-radius:10px;
 min-width:42px;min-height:42px;padding:8px 12px;font-size:15px}
#picture-toolbar .picture-zoom{display:flex;align-items:center;gap:7px}
#picture-stage{width:100%;height:calc(100dvh - 60px);display:flex;justify-content:center;
 align-items:center;overflow:auto;overscroll-behavior:contain;touch-action:pan-x pan-y}
#picture-stage #full-picture{display:block;width:auto;height:auto;max-width:100%;max-height:100%;
 object-fit:contain;object-position:center;transform-origin:center center;
 border-radius:0;margin:auto;cursor:zoom-in}
@media(max-width:700px){
 .composer{flex-wrap:wrap!important;gap:7px}
 .composer #attach,.composer #attach-files,.composer #paste,.composer #dictate,
 .composer #schedule,.composer #reminders{order:1;flex:0 0 42px;width:42px;height:42px}
 .composer textarea{order:2;flex:1 1 calc(100% - 75px);min-width:0}
 .composer .send-button{order:2;flex:0 0 46px}
 #picture-toolbar{padding:7px 10px}
}

/* Show/hide password without moving focus or submitting the form. */
.password-entry{display:flex;align-items:center;position:relative;gap:0;width:100%}
.password-entry input{min-width:0;flex:1;padding-right:55px}
.password-entry .password-toggle{position:absolute;right:5px;top:50%;transform:translateY(-50%);
 display:flex;justify-content:center;align-items:center;width:44px;height:40px;
 background:#edf4fe;color:#2b577e;border:1px solid #d2e4f3;border-radius:8px;
 padding:2px;font-size:19px;line-height:1}
.password-entry .password-toggle:focus-visible{outline:3px solid #0b78f0;outline-offset:2px}

.mention-suggestions:not([hidden]){display:flex;position:absolute;bottom:100%;left:5%;width:min(420px,90%);max-height:235px;overflow:auto;flex-direction:column;background:var(--panel,#fff);padding:7px;z-index:25;box-shadow:0 5px 20px #0003;border-radius:12px}.mention-suggestions button{text-align:left;padding:9px 12px;white-space:normal}.post{white-space:pre-wrap;overflow-wrap:anywhere}

/* Clear autocomplete anchored to the editor and highlight only verified mentions. */
.composer{position:relative}
.post .chat-mention{font-weight:750;color:#145f9d;background:#ddf2ff;padding:1px 4px;border-radius:5px}
.mention-suggestions button:focus-visible{outline:2px solid #2c83cb;outline-offset:2px}

/* Six-month-plus history, attachment browser and minimal receipt indicators. */
.older-messages-button{display:block;margin:8px auto 18px;padding:9px 16px;border-radius:18px;background:#E9F4FE;color:#225D91;font-size:13px}
.chat-media-dialog{width:min(780px,96vw);max-height:88vh;overflow:auto}
.chat-media-dialog .actions{gap:6px;display:flex;flex-wrap:wrap}
.chat-media-dialog .actions button[aria-pressed="true"]{background:#0B78F0;color:#fff}
.chat-media-items{display:grid;gap:9px;margin:14px 0}
.chat-media-item{border:1px solid #DDE7F1;border-radius:12px;padding:11px;display:flex;flex-direction:column;gap:7px;background:#FAFCFF}
.chat-media-item p{margin:0}
.chat-media-item>button{width:fit-content;max-width:100%;text-align:left;overflow-wrap:anywhere}
.chat-media-thumbnails{display:flex;gap:9px;flex-wrap:wrap}
.chat-media-thumbnail{width:104px;height:104px;object-fit:cover;border-radius:10px;background:#E4F2FC;cursor:zoom-in}
.chat-media-thumbnail:focus-visible{outline:3px solid #4B9EEA;outline-offset:3px}
.message-ticks{display:block;width:fit-content!important;min-width:0!important;margin:3px 0 0 auto!important;
 padding:0 2px!important;border:none!important;background:transparent!important;font-size:12px!important;
 font-weight:700!important;line-height:1.1!important;letter-spacing:-2px!important;box-shadow:none!important}
.message-ticks-delivered{color:#1377D1!important}
.message-ticks-read{color:#19995A!important}
.reaction-blue-check{display:inline-grid;place-items:center;vertical-align:middle;
 width:17px;height:17px;background:#1979DF;color:white;border-radius:4px;font-weight:900;font-size:13px;line-height:1}
.reaction-emoji{display:inline-block;vertical-align:middle}

/* Compact sent-message delivery marks and confirmed unique reader counts. */
.message-receipts{display:flex;align-items:center;justify-content:flex-end;gap:7px;margin:3px 0 0 auto;min-height:16px}
.message-receipts .message-ticks{margin:0!important;display:inline-flex!important}
.message-eye-count{border:0!important;background:transparent!important;padding:0 3px!important;min-width:0!important;
 color:#1377D1!important;font-size:11px!important;font-weight:650!important;line-height:1.4!important;box-shadow:none!important}
.message-eye-count:hover{text-decoration:underline}
.presence-status,.chat-peer-presence{font-size:12px;color:#4D6786;margin-top:3px}
.presence-status.is-online,.chat-peer-presence.is-online{color:#168152}
.chat-peer-presence[hidden]{display:none}


/* 0.8.7 mobile navigation: single-line icon toolbars with accessible labels. */
.chat-title-slot{display:flex;flex-direction:column;justify-content:center;min-width:115px;flex:1}
.chat-thread #chat-list{width:100%;max-width:100%;min-width:0;margin:0;height:42px}
.chat-thread #chat-controls button.chat-header-icon{
  display:inline-flex;align-items:center;justify-content:center;
  flex:0 0 40px;min-width:40px;width:40px;height:40px;
  border-radius:12px;border:1px solid #d5e8f6;background:#edf7ff;color:#245e8c;
  font-size:22px;padding:0;font-weight:700;
}
.chat-thread #chat-controls #favorite-toggle[aria-pressed="true"]{color:#d08f12;background:#fff6dc}
.chat-thread #chat-controls #chat-back{font-size:30px;line-height:1}
.chat-peer-presence{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:10px;line-height:1.2}
.message-more-actions{
  display:flex!important;flex-direction:row!important;align-items:center;gap:4px!important;
  width:max-content;min-width:0!important;max-width:calc(100vw - 20px);
  padding:6px!important;max-height:none!important;overflow-x:auto;overflow-y:hidden;
  -webkit-overflow-scrolling:touch;scrollbar-width:thin;
}
.message-more-actions .message-menu-icon{
  display:inline-flex!important;flex:0 0 42px!important;align-items:center!important;justify-content:center!important;
  width:42px!important;min-width:42px!important;height:42px!important;
  background:#edf6ff!important;border:1px solid #d7e8f7!important;color:#235784!important;
  border-radius:11px!important;padding:0!important;text-align:center!important;
  font-size:22px!important;line-height:1!important;font-weight:600;
}
.message-more-actions .message-menu-icon:hover{background:#d9edff!important}
.message-more-actions .message-menu-icon svg{width:23px;height:23px;pointer-events:none}
.message-more-actions .message-action-reaction{color:#0878df!important}
.bubble:not(.mine) .message-more-actions{left:0;right:auto}
.bubble.mine .message-more-actions{right:0;left:auto}
.message-more>summary:focus-visible,.message-more-actions .message-menu-icon:focus-visible{outline:3px solid #1b78cb;outline-offset:1px}
.reaction-picker{display:flex;flex-wrap:nowrap!important;gap:6px!important;overflow-x:auto;overscroll-behavior-x:contain;max-width:100%;padding:8px 2px;-webkit-overflow-scrolling:touch}
.reaction-picker button{flex:0 0 40px;width:40px;height:40px;display:inline-flex;justify-content:center;align-items:center;padding:4px}
.reaction-picker .reaction-blue-check{width:28px;height:28px;color:#fff!important;font-size:22px;border-radius:6px;background:#1979DF}
@media(max-width:700px){
  .workspace.chat-conversation-active{
    position:fixed;left:0;right:0;top:var(--azbuka-visual-top,0px);
    width:100%;height:var(--azbuka-visual-height,100dvh);min-height:0;
    padding:0;display:block;overflow:hidden;
  }
  .workspace.chat-conversation-active>aside,
  .workspace.chat-conversation-active>main>header{display:none!important}
  .workspace.chat-conversation-active>main{display:flex;flex-direction:column;height:100%;min-height:0;overflow:hidden}
  .workspace.chat-conversation-active #notice{padding:6px 10px;flex:0 0 auto;font-size:12px}
  .workspace.chat-conversation-active #content.chat-surface{
    display:flex;flex:1 1 auto;min-height:0;overflow:hidden;
    padding:max(4px,env(safe-area-inset-top)) 5px 4px;
  }
  .workspace.chat-conversation-active .chat-layout{
    display:flex;flex-direction:column;gap:0;flex:1 1 auto;
    height:100%;min-height:0;min-width:0;align-items:stretch;
  }
  .workspace.chat-conversation-active .chat-directory{display:none}
  .workspace.chat-conversation-active .chat-thread{
    display:flex;flex-direction:column;flex:1 1 auto;height:100%;min-height:0;min-width:0;overflow:hidden
  }
  .workspace.chat-conversation-active #chat-controls{
    position:relative;flex:0 0 auto;display:flex;align-items:center;flex-wrap:nowrap;
    gap:4px;margin:0 0 4px;padding:5px 3px;max-width:100%;
    overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;scrollbar-width:none;
    background:#e8f6ffed;border-radius:13px;overscroll-behavior-x:contain;
  }
  .workspace.chat-conversation-active #chat-controls::-webkit-scrollbar{display:none}
  .workspace.chat-conversation-active #chat-controls .chat-back-button{
    position:sticky;left:0;z-index:4;flex:0 0 41px;width:41px;min-width:41px;height:41px;
    background:#dceeff;border-color:#badcf7;
  }
  .workspace.chat-conversation-active #chat-controls > #chat-avatar{
    width:34px;height:34px;flex:0 0 34px;font-size:17px
  }
  .workspace.chat-conversation-active #chat-controls .chat-title-slot{flex:1 0 130px;min-width:130px;max-width:180px}
  .workspace.chat-conversation-active #chat-controls #chat-list{height:38px;font-size:14px;padding:5px 8px}
  .workspace.chat-conversation-active #chat-controls button.chat-tool-icon,
  .workspace.chat-conversation-active #chat-controls button.chat-header-icon{
    flex:0 0 40px;min-width:40px;width:40px;height:40px;padding:0!important;
    display:inline-flex;align-items:center;justify-content:center;
  }
  .workspace.chat-conversation-active .chat-pins{flex:0 0 auto;max-height:100px;overflow-y:auto;margin:0 4px 4px;padding:6px 8px}
  .workspace.chat-conversation-active #chat-messages{
    display:block;flex:1 1 auto;min-height:0!important;max-height:none!important;
    overflow-y:auto;overflow-x:hidden;padding:9px 6px 16px;
    -webkit-overflow-scrolling:touch;overscroll-behavior-y:contain;
  }
  .workspace.chat-conversation-active #admin-review{min-height:0;flex:1 1 auto;max-height:none;overflow:auto}
  .workspace.chat-conversation-active #reply-preview{flex:0 0 auto;margin:0;max-height:74px;overflow:hidden}
  .workspace.chat-conversation-active #composer{
    position:relative;bottom:auto;z-index:5;flex:0 0 auto;
    display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr));
    column-gap:6px;row-gap:6px;padding:7px 8px max(8px,env(safe-area-inset-bottom));
    margin:0;align-items:center;background:#fff;box-shadow:0 -3px 10px #1a436a12;
  }

  .workspace.chat-conversation-active #composer[hidden]{display:none!important}
  .workspace.chat-conversation-active #reply-preview[hidden]{display:none!important}
  .workspace.chat-conversation-active #composer .composer-icon{
    order:0;grid-row:1;width:100%;max-width:46px;height:40px;padding:0!important;
    border-radius:20px;place-self:center;display:inline-flex;align-items:center;justify-content:center;
  }
  .workspace.chat-conversation-active #composer #attach{grid-column:1}
  .workspace.chat-conversation-active #composer #attach-files{grid-column:2}
  .workspace.chat-conversation-active #composer #paste{grid-column:3}
  .workspace.chat-conversation-active #composer #dictate{grid-column:4}
  .workspace.chat-conversation-active #composer #schedule{grid-column:5}
  .workspace.chat-conversation-active #composer #reminders{grid-column:6}
  .workspace.chat-conversation-active #composer #message{
    order:0;grid-column:1/6;grid-row:2;flex:none;min-width:0;min-height:44px;
    width:100%;max-height:120px;height:44px;resize:none;overflow-y:auto;
    padding:10px 12px;font-size:16px;line-height:1.35;border-radius:18px;
  }
  .workspace.chat-conversation-active #composer .send-button{
    order:0;grid-column:6;grid-row:2;flex:none;width:46px;height:46px;padding:0;
    border-radius:50%;place-self:center;font-size:20px;
  }
  .workspace.chat-conversation-active #composer #attachment{order:0;grid-column:1/-1;grid-row:3;max-height:68px;overflow:auto}
  .workspace.chat-conversation-active #composer #attachment:empty{display:none}
  .workspace.chat-conversation-active #composer #mention-suggestions{bottom:100%;left:2%;width:96%}
  .workspace.chat-conversation-active.chat-keyboard-visible #composer{padding-bottom:7px}
  .workspace.chat-conversation-active.chat-keyboard-visible .chat-pins{max-height:50px;overflow:hidden}
  .workspace.chat-conversation-active.chat-keyboard-visible .chat-pins .pin-preview{display:none}
  .workspace.chat-conversation-active .bubble{max-width:90%}
}

.message-more:not([open])>.message-more-actions{display:none!important}
.message-more[open]>.message-more-actions{display:flex!important}
.reaction-picker-close{display:flex;align-items:center;justify-content:center;margin:8px 0 0 auto;
 width:40px;height:40px;padding:0;border-radius:12px;background:#edf7ff;color:#245e8c;font-size:20px}

/* Version 0.8.8: external link share chooser and short-lived typing cue. */
.chat-share-incoming{
  display:flex;flex-direction:column;gap:7px;padding:12px 14px;margin:8px 8px 12px;
  border-radius:14px;background:#eaf6ff;border:1px solid #c0e2f9;color:#234e75;
  font-size:13px;overflow-wrap:anywhere;
}
.chat-share-incoming[hidden],.chat-typing-status[hidden]{display:none!important}
.chat-share-incoming strong{font-size:14px}
.chat-share-incoming p{margin:0;max-height:80px;overflow:auto;white-space:pre-wrap}
.chat-share-incoming small{font-size:12px;color:#386787}
.chat-share-incoming button{align-self:flex-start;padding:7px 12px;font-size:12px}
.chat-typing-status{
  flex:0 0 auto;padding:7px 15px 6px;color:#20608c;background:#e7f5ff;
  font-size:12px;line-height:1.45;font-weight:600;border-radius:9px;margin:0 6px 5px;
  min-height:29px;
}
@media(max-width:700px){
 .chat-share-incoming{margin:6px 4px 10px;padding:10px}
 .chat-typing-status{margin:0 3px 3px;padding:5px 10px}
}

/* 0.8.9 — at-a-glance chat directory presence and sent-message receipts. */
.chat-entry>.chat-list-avatar-wrap{
  position:relative;display:inline-flex;align-items:center;justify-content:center;
  width:46px;height:46px;flex:0 0 46px;margin:0 9px 0 4px;align-self:center;
}
.chat-list-avatar-wrap>.chat-avatar{width:46px;height:46px;margin:0;flex:0 0 46px}
.chat-list-presence-dot,.chat-list-presence-mini{
  display:inline-block;border-radius:50%;flex:0 0 auto;
}
.chat-list-presence-dot{
  position:absolute;right:0;bottom:0;width:14px;height:14px;
  border:2px solid #fff;box-shadow:0 0 0 1px #ffffffbb;
}
.chat-list-presence-mini{width:8px;height:8px;box-shadow:0 0 0 1px #fff}
.chat-list-presence-dot.is-online,.chat-list-presence-mini.is-online{background:#1EA765}
.chat-list-presence-dot.is-offline,.chat-list-presence-mini.is-offline{background:#E9B735}
.chat-list-presence{
  display:flex;align-items:center;gap:5px;min-width:0;
  text-align:left;margin:4px 0 0;color:#69788c;font-size:11px;line-height:1.25;
}
.chat-list-presence-label{
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.chat-list-read-mark{
  flex:0 0 auto;margin-left:auto;font-size:11px;font-weight:800;
  letter-spacing:-.6px;white-space:nowrap;line-height:1.4;
}
.chat-list-read-mark.read{color:#19995A}
.chat-list-read-mark.partial,.chat-list-read-mark.delivered{color:#1377D1}
.chat-list-read-mark.sent{color:#8B99A9}
.chat-summary .chat-preview{min-width:0;flex:1}
@media(max-width:700px){
  .chat-entry .chat-list-presence{font-size:10.5px}
  .chat-list-read-mark{font-size:11px}
}

/* 0.8.9: action sheet belongs to the top layer rather than the message bubble.
   Long messages and scroll containers cannot clip these controls. */
.bubble .message-more-trigger{
  list-style:none;cursor:pointer;width:34px;height:34px;min-width:34px;
  display:inline-flex;align-items:center;justify-content:center;
  padding:0;background:#E9F4FF;color:#1C5787;border:1px solid #C8DFF5;
  border-radius:11px;font-size:25px;font-weight:750;line-height:1;
}
.bubble .message-more-trigger:focus-visible{outline:3px solid #317DC1;outline-offset:2px}
dialog.azbuka-actions-sheet,dialog.azbuka-reaction-people{
  position:fixed;inset:auto 8px max(10px,env(safe-area-inset-bottom)) 8px;
  margin:0 auto;box-sizing:border-box;
  width:min(510px,calc(100vw - 16px));max-width:calc(100vw - 16px);
  padding:12px;overflow:hidden;background:#fff;color:#20384F;
  border:1px solid #C6E1F5;border-radius:20px;
  box-shadow:0 12px 45px #1A446748;
}
dialog.azbuka-actions-sheet{max-height:min(355px,82dvh)}
dialog.azbuka-actions-sheet::backdrop,dialog.azbuka-reaction-people::backdrop{
  background:#172F4B88
}
.azbuka-sheet-heading{
  display:flex;align-items:center;justify-content:space-between;
  gap:10px;margin:0 0 5px;font-size:14px;color:#285374;
}
.azbuka-sheet-heading button{
  background:#EAF5FE;color:#245F8C;border:1px solid #D1E5F7;
  width:38px;height:38px;min-width:38px;padding:0;
  display:inline-flex;align-items:center;justify-content:center;font-size:20px
}
.azbuka-sheet-preview{
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  color:#6A7890;font-size:12px;margin:0 0 10px
}
.azbuka-sheet-actions,.azbuka-sheet-reactions{
  display:grid;align-items:center;gap:7px;margin:6px 0
}
.azbuka-sheet-actions{grid-template-columns:repeat(4,minmax(0,1fr))}
.azbuka-sheet-reactions{grid-template-columns:repeat(5,minmax(0,1fr))}
.azbuka-sheet-actions button,.azbuka-sheet-reactions button{
  display:inline-flex;align-items:center;justify-content:center;
  min-height:43px;min-width:0;width:100%;border:1px solid #D1E6F8;
  border-radius:12px;padding:2px 4px;background:#EAF5FE;
  color:#235E88;font-size:22px;line-height:1.2
}
.azbuka-sheet-reactions button{height:44px;font-size:26px}
.azbuka-sheet-reactions .reaction-blue-check{
  width:27px;height:27px;font-size:21px;border-radius:6px;color:white;background:#1979DF
}
.azbuka-reaction-people{max-height:min(480px,70dvh)}
.azbuka-reaction-people-list{
  overflow-y:auto;max-height:55dvh;display:flex;flex-direction:column;
  gap:11px;padding:8px 3px;-webkit-overflow-scrolling:touch
}
.azbuka-reaction-people-group{
  border-bottom:1px solid #E4ECF4;padding:0 4px 7px
}
.azbuka-reaction-people-heading{
  display:flex;align-items:center;gap:6px;color:#235A82;font-size:18px;margin-bottom:6px
}
.azbuka-reaction-person{padding:5px 7px;font-size:14px;color:#24384F}
@media(max-width:700px){
  dialog.azbuka-actions-sheet{max-height:min(355px,78dvh)}
  .azbuka-sheet-actions button{min-height:46px}
  .azbuka-sheet-reactions button{min-height:46px}
}

/* In narrow screens, the dots are at the bottom of each message. Users may
   also tap anywhere on a long message to open the fixed bottom action sheet. */
@media(max-width:700px){
  .chat-surface .bubble .message-more {top:auto;bottom:8px}
}


/* Separate, always reachable bottom controls. Sticky within tall messages. */
.chat-surface .bubble .message-more,
.bubble .message-more{display:flex;position:sticky;top:auto;bottom:0;left:auto;right:auto;
 justify-content:space-between;align-items:center;gap:12px;margin-top:8px;width:100%;z-index:4}
.bubble.message-selected .message-more,.bubble:focus-within .message-more,.bubble:hover .message-more{display:flex}
.bubble .message-reactions-trigger{cursor:pointer;width:34px;height:34px;min-width:34px;
 display:inline-flex;align-items:center;justify-content:center;padding:0;background:#E9F4FF;
 color:#1C5787;border:1px solid #C8DFF5;border-radius:11px;font-size:25px;font-weight:750;line-height:1}
.bubble .message-reactions-trigger:focus-visible{outline:3px solid #317DC1;outline-offset:2px}


/* 0.9.0: images readable at a glance; compact message and compose layout. */
#chat-search{display:block;width:100%;height:43px;margin:0 0 12px;
  background:#f4faff;border:1px solid #cce2f4;border-radius:14px;
  color:#173b5c;padding:9px 13px;font-size:16px}
.saved-chat-entry{background:#fff9e7;border:1px solid #f5e3b9}
.chat-saved-avatar{background:#fff0ba;color:#926400;font-size:26px}
.forward-to-saved{background:#fff5d9!important;color:#825a09!important;font-weight:750!important}
.chat-surface .bubble{padding:8px 11px;margin-bottom:6px;min-width:0}
.chat-surface .bubble>strong{font-size:13px;line-height:1.3}
.chat-surface .bubble .post{margin:4px 0;line-height:1.35;white-space:pre-wrap}
.chat-surface .bubble .meta{font-size:10.5px;line-height:1.3;margin:3px 0}
.chat-surface .bubble .quoted-message{margin:4px 0;padding:6px 8px}
.chat-surface .bubble .message-more,.bubble .message-more{
  margin-top:3px;gap:8px;min-height:29px}
.chat-surface .bubble .message-more-trigger,
.chat-surface .bubble .message-reactions-trigger{
  width:29px;height:29px;min-width:29px;font-size:21px;border-radius:9px}
.message-gallery{margin:5px 0;gap:5px;max-width:100%}
.message-gallery.single-photo{grid-template-columns:minmax(0,1fr)}
.message-gallery .chat-image-frame{min-width:0;border-radius:10px;overflow:hidden}
.message-gallery .chat-image{display:block;width:100%;height:auto;max-height:310px;
  max-width:100%;object-fit:contain;margin:0;border-radius:10px}
.chat-file-photo{max-width:100%;display:flex;flex-direction:column;align-items:stretch}
.chat-file-photo .chat-image{display:block;width:100%;height:auto;max-height:310px;
  max-width:100%;object-fit:contain;margin:0 auto;cursor:zoom-in}
.chat-photo-loading{display:flex;align-items:center;justify-content:center;
  min-height:68px;padding:14px;border-radius:10px;background:#e9f4ff;
  color:#426789;font-size:12px;text-align:center}
.message-files{margin:5px 0;gap:5px}
.message-file-download{padding:7px 9px;font-size:12px}
.composer #attach-files{display:none!important}
/* Only two icon buttons appear over +; no dialog, cancel row or screen dimming. */
.azbuka-attach-icons{
  position:fixed;z-index:9500;display:flex;align-items:center;justify-content:center;
  gap:8px;width:max-content;max-width:calc(100vw - 16px);
  padding:0;margin:0;border:0;box-shadow:none;background:transparent
}
.azbuka-attach-icons button{
  display:grid;place-items:center;flex:0 0 49px;width:49px;height:49px;
  margin:0;padding:0;border:1px solid #cfe2f6;border-radius:15px;
  background:#edf7ff;color:#20547e;box-shadow:0 2px 9px #19436526;
  font-size:25px;line-height:1;cursor:pointer
}
.azbuka-attach-icons button:focus-visible{
  outline:3px solid #82a6ff;outline-offset:2px
}
@media(max-width:700px){
  .workspace.chat-conversation-active .bubble{max-width:88%}
  .workspace.chat-conversation-active #chat-messages{padding:5px 5px 8px}
  .workspace.chat-conversation-active #composer{
    grid-template-columns:repeat(5,minmax(0,1fr));row-gap:4px;column-gap:5px;
    padding:5px 7px max(6px,env(safe-area-inset-bottom))}
  .workspace.chat-conversation-active #composer .composer-icon{
    height:37px;max-width:43px;width:43px}
  .workspace.chat-conversation-active #composer #attach{grid-column:1}
  .workspace.chat-conversation-active #composer #paste{grid-column:2}
  .workspace.chat-conversation-active #composer #dictate{grid-column:3}
  .workspace.chat-conversation-active #composer #schedule{grid-column:4}
  .workspace.chat-conversation-active #composer #reminders{grid-column:5}
  .workspace.chat-conversation-active #composer #message{
    grid-column:1/5;grid-row:2;min-height:42px;height:42px;
    max-height:104px;padding:9px 11px;border-radius:18px}
  .workspace.chat-conversation-active #composer .send-button{
    grid-column:5;grid-row:2;width:43px;height:43px}
  .workspace.chat-conversation-active #composer #attachment{grid-row:3}
  .chat-file-photo .chat-image,.message-gallery .chat-image{max-height:280px}
}

/* Picture-only messages keep enough width for an immediately readable preview. */
.chat-surface .bubble:has(.message-gallery),.chat-surface .bubble:has(.chat-file-photo){width:min(88%,410px)}


/* Standalone photographs: no message bubble, frame, or padded attachment card.
   Captions retain their own conventional colored message pill. */
.chat-surface .bubble.media-message,
.chat-surface .bubble.media-message.mine {
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  padding:0!important;
  border-radius:0!important;
  width:min(88%,410px);
  max-width:88%;
  margin-bottom:9px;
}
.chat-surface .bubble.media-message.media-no-author > strong{display:none}
.chat-surface .bubble.media-message > strong{
  display:block;margin:0 0 4px 5px;font-size:12px
}
.chat-surface .bubble.media-message .forward-label{
  display:table;max-width:100%;padding:4px 8px;margin:0 0 4px;
  border-radius:9px;background:#fffffff0
}
.chat-surface .bubble.media-message .quoted-message{margin:0 0 5px;max-width:100%}
.chat-surface .bubble.media-message .message-gallery{
  width:100%;max-width:100%;margin:0;gap:4px
}
.chat-surface .bubble.media-message .message-gallery.single-photo{
  display:flex;justify-content:flex-start
}
.chat-surface .bubble.media-message.mine .message-gallery.single-photo{
  justify-content:flex-end
}
.chat-surface .bubble.media-message .chat-image-frame,
.chat-surface .bubble.media-message .chat-file-photo{
  position:relative;display:inline-flex;flex-direction:column;
  width:max-content;max-width:100%;min-width:0;
  margin:0;padding:0;background:transparent;
  border:0;box-shadow:none;border-radius:9px;overflow:hidden
}
.chat-surface .bubble.media-message .message-gallery .chat-image,
.chat-surface .bubble.media-message .chat-file-photo .chat-image{
  display:block;width:auto;height:auto;max-width:100%;
  max-height:min(62dvh,510px);object-fit:contain;
  margin:0;padding:0;border:0;box-shadow:none;border-radius:9px
}
.chat-surface .bubble.media-message .message-gallery:not(.single-photo){
  grid-template-columns:repeat(2,minmax(0,1fr))
}
.chat-surface .bubble.media-message .message-gallery:not(.single-photo) .chat-image-frame{
  width:100%;align-items:center
}
.chat-surface .bubble.media-message .message-gallery:not(.single-photo) .chat-image{
  max-height:290px
}
.chat-surface .bubble.media-message .message-files{
  width:100%;max-width:100%;margin:0;gap:4px;align-items:flex-start
}
.chat-surface .bubble.media-message.mine .message-files{align-items:flex-end}
.chat-surface .bubble.media-message .media-caption{
  display:table;max-width:100%;width:fit-content;
  margin:5px 0 0;padding:8px 11px;border-radius:15px;
  background:#fff;color:#20384f;box-shadow:0 1px 2px #28578012
}
.chat-surface .bubble.media-message.mine .media-caption{
  background:#acddf9;color:#1b3144;margin-left:auto
}
.chat-surface .bubble.media-message .media-photo-time{
  position:absolute;right:6px;bottom:42px;z-index:2;
  pointer-events:none;background:#17212b99;color:#fff;
  border-radius:16px;padding:3px 7px;font-size:12px;line-height:1.25;
  font-weight:500;font-variant-numeric:tabular-nums
}
.chat-surface .bubble.media-message .media-photo-save{
  position:absolute;top:6px;right:6px;z-index:2;display:grid;place-items:center;
  width:29px;height:29px;min-width:29px;padding:0;border-radius:50%;
  color:white;background:#182a3b9c;border:1px solid #ffffff66;
  font-size:21px;line-height:1;box-shadow:none
}
.chat-surface .bubble.media-message.photo-only .message-more{
  position:absolute;bottom:6px;left:6px;right:6px;top:auto;
  width:auto;margin:0;z-index:4;pointer-events:none
}
.chat-surface .bubble.media-message.photo-only .message-more button{
  pointer-events:auto;background:#f0f7ffee;border-color:#d1e5f6ee;
  box-shadow:0 1px 4px #152c3b30
}
.chat-surface .bubble.media-message:not(.photo-only) .message-more{
  margin-top:5px
}
@media(max-width:700px){
  .workspace.chat-conversation-active .bubble.media-message{max-width:88%;padding:0!important}
  .chat-surface .bubble.media-message .chat-image-frame .chat-image,
  .chat-surface .bubble.media-message .chat-file-photo .chat-image{
    max-height:min(62dvh,450px)
  }
}


/* Inline photo and history gallery save/select controls */
.chat-surface .bubble.media-message .chat-image-frame{position:relative}
.chat-media-selection-bar{display:flex;align-items:center;flex-wrap:wrap;
  gap:12px;padding:9px 0}
.chat-media-selection-bar button{font-size:14px;padding:9px 13px}
.chat-media-selection-bar button:disabled{opacity:.55;cursor:not-allowed}
.chat-media-selection-bar .media-selected-count{font-size:13px;color:#436884}
.chat-media-tile{display:flex;flex-direction:column;align-items:start;
  gap:4px;max-width:110px}
.chat-media-tile-actions{display:flex;align-items:center;justify-content:space-between;
  gap:8px;width:100%}
.chat-media-tile-actions button{padding:4px 9px;font-size:17px;
  color:#235e87;background:#e7f3ff;border-radius:8px}
.media-select-check{display:inline-flex;align-items:center;gap:5px;
  cursor:pointer;font-size:12px;color:#315b7c}
.media-select-check input{width:17px;height:17px;accent-color:#1178d4}
.media-select-check .media-select-caption{font-size:12px}
.chat-media-file-entry{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.chat-media-file-entry>button{max-width:100%;word-break:break-word;
  padding:8px 10px;text-align:left}
#picture-toolbar #save-picture{display:inline-flex;align-items:center;
  gap:5px;padding:7px 9px;font-size:13px}
#picture-toolbar #save-picture[hidden]{display:none}
@media(max-width:700px){
  .chat-media-selection-bar{position:sticky;top:0;z-index:10;background:#fff;
    border-radius:10px;padding:9px}
}


/* Shift-based attendance */
.shift-toolbar,.shift-summary{display:flex;gap:10px;flex-wrap:wrap;margin:12px 0}
.shift-summary>div{flex:1;min-width:160px}.shift-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:12px;margin:16px 0}
.shift-day{margin:0}.shift-day p{margin:6px 0}.shift-day form{display:grid;gap:8px;margin-top:12px}
.shift-day select,.shift-access select{width:100%;min-height:40px}.shift-pending{border:2px solid #d98c15}.shift-status{color:#8b5600}
.shift-access{max-width:720px;width:90%;max-height:85vh;overflow:auto}.shift-access form{display:grid;gap:8px}

.shift-overview{width:100%;border-collapse:collapse;font-size:13px;margin:12px 0}.shift-overview th,.shift-overview td{padding:7px 3px;text-align:left;border-bottom:1px solid #d8e4f2;overflow-wrap:anywhere}.shift-overview button{padding:7px;font-size:13px;white-space:normal}
.shift-table-scroll{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.shift-table-scroll .shift-overview{min-width:650px}.shift-awaiting{padding:8px 12px;background:#fff7e8;color:#75501b;border-left:3px solid #d98c15}.shift-awaiting-cell{color:#825100;font-weight:700}

.shift-calendar{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px;max-width:560px;margin:18px 0}.shift-calendar span{text-align:center;font-size:13px;color:#637087}.shift-calendar button{padding:9px 2px;white-space:pre-line;font-size:14px;line-height:1.45}.shift-calendar button.active{background:#1759a8;color:#fff}.shift-grid{display:block;max-width:560px}

/* Staff scores */
.score-thread{display:grid;gap:8px;margin:12px 0}.score-note{padding:10px;border-left:3px solid #bfd5ee;background:#f4f8ff;white-space:pre-wrap;overflow-wrap:anywhere}.score-note p{margin:4px 0}#content label{display:grid;gap:6px;min-width:0}#content textarea{min-height:65px;width:100%;box-sizing:border-box}#content details p{overflow-wrap:anywhere}
.score-report-scroll{max-width:100%;overflow:auto;max-height:70vh;border:1px solid #cddced;border-radius:12px;margin-top:14px}
.score-report-table{border-collapse:separate;border-spacing:0;width:max-content;min-width:100%;font-size:14px}
.score-report-table th,.score-report-table td{border-right:1px solid #d8e4f2;border-bottom:1px solid #d8e4f2;padding:10px;min-width:145px;max-width:230px;vertical-align:top;background:#fff;overflow-wrap:anywhere}
.score-report-table thead th{position:sticky;top:0;background:#eaf2fc;z-index:2;color:#15365e;text-align:center}
.score-report-table thead tr:nth-child(2) th{top:42px}
.score-report-table tbody th,.score-report-table thead th[rowspan]{position:sticky;left:0;min-width:180px;text-align:left;z-index:1;background:#f6f9fd}
.score-report-table thead th[rowspan]{z-index:3}
.score-report-table td small{display:block;color:#526781;margin-top:5px}
.score-report-table td button{max-width:200px;margin:0 0 5px;padding:9px;font-size:14px;white-space:normal}


/* Fast mouse hover actions stay next to the three-dot button. */
.azbuka-message-popover{
  position:fixed;z-index:9999;box-sizing:border-box;
  width:max-content;max-width:min(285px,calc(100vw - 12px));
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));
  gap:3px;padding:5px;border:1px solid #bbd6ec;border-radius:12px;
  background:#fff;box-shadow:0 5px 18px #142e4936
}
.azbuka-message-popover .azbuka-popover-action{
  min-width:0;min-height:45px;width:76px;
  border:0;border-radius:8px;padding:4px 3px;
  background:#f1f7ff;color:#214f78;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:2px;font-size:20px;line-height:1
}
.azbuka-message-popover .azbuka-popover-action small{
  font-size:9px;line-height:1.2;white-space:nowrap;
  font-weight:600;color:#385b76
}
.azbuka-message-popover .azbuka-popover-action:hover{
  background:#dcefff
}
.azbuka-message-popover .azbuka-popover-action:focus-visible{
  outline:2px solid #1680e0
}
.message-phone{font-weight:650;text-decoration:underline;text-underline-offset:2px}


/* Compact Telegram-style conversation density, preserving touch targets. */
/* Preserve left/right placement after compact chat spacing.
    The shorthand margin above otherwise cancels .bubble.mine's auto margin. */
.chat-surface .bubble{padding:8px 11px;border-radius:16px;max-width:86%;margin:3px 0}
.chat-surface .bubble.mine{margin-left:auto;margin-right:0}
.chat-surface .bubble:not(.mine){margin-left:0;margin-right:auto}
.chat-surface #chat-messages{direction:ltr}
.chat-surface .bubble .post{direction:ltr;text-align:left}
.chat-surface #composer textarea{direction:ltr;text-align:left}
.chat-surface .bubble .post{font-size:15px;line-height:1.34;margin:3px 0}
.chat-surface .bubble strong{font-size:12px;line-height:1.25}
.chat-surface .bubble .meta{font-size:11px;line-height:1.3}
.chat-thread #chat-messages{padding:8px}
.chat-entry{min-height:62px;margin-bottom:1px;border-radius:10px}
.chat-entry>.chat-avatar{width:41px;height:41px;flex-basis:41px}
.chat-entry .chat-open-button{padding:7px 4px}
.chat-section-label{padding:8px 3px 2px}
.chat-summary .chat-preview{margin-top:2px;line-height:1.3}
@media(max-width:650px){
 .chat-surface .bubble{max-width:94%;padding:7px 10px}
 .chat-thread #chat-messages{padding:5px}
 .chat-entry{min-height:58px}
}
.work-header,.work-section{background:#fff;border:1px solid #e3edf7;border-radius:14px;
 padding:12px;margin:8px 0;max-width:960px;box-shadow:0 1px 3px #1f344810}
.work-header h2,.work-section h3{font-size:17px;margin:3px 0 10px}
.work-section h4{font-size:14px;margin:10px 0 7px}
.work-row{display:flex;gap:7px;align-items:center;flex-wrap:wrap;margin:5px 0}
.work-row>input[type=text],.work-row>input[type=number]{flex:1;min-width:145px}
.work-row>input[type=checkbox]{flex:0 0 auto;width:19px;height:19px}
.work-row>textarea.work-task-input{flex:1 1 320px;min-width:160px;max-width:100%;min-height:56px;resize:vertical;font:inherit}
.work-task-count{white-space:nowrap}
.work-task-error{font-size:12px;line-height:1.4}
.work-row>span{flex:1;min-width:100px;overflow-wrap:anywhere}
.work-row button{padding:7px 10px;font-size:13px}
.work-day{display:flex;flex-direction:column;gap:4px;background:#f7faff;
 border-radius:9px;padding:8px 10px;margin:5px 0}
.work-day .work-row{margin:0;padding:3px 0;border-bottom:1px solid #e5edf7}
.work-day .work-row:last-child{border:0}
.work-muted{color:#6a7988;font-size:12px;line-height:1.35}
.work-completed{color:#7c8898;text-decoration:line-through}
.work-month-area{padding:10px;background:#f8fbfe;border-radius:10px;margin:9px 0}
.work-goal,.work-kpi-row,.work-report-person{padding:9px;border-radius:9px;
 background:#fff;border:1px solid #e7edf6;margin:6px 0;overflow-wrap:anywhere}
.work-goal textarea,.work-new-goal{display:block;width:100%;min-height:92px!important;max-height:none;
  field-sizing:content;resize:vertical;overflow-wrap:anywhere;white-space:pre-wrap}
.work-goal-title,.work-readonly{white-space:pre-wrap;overflow-wrap:anywhere;margin:6px 0;
  font-size:15px;line-height:1.5}
.work-goal-title{font-weight:600}
.work-save-status{display:block;color:#35627f;font-size:12px;margin:6px 0}
.work-new-goal{flex:1 1 100%;min-width:0}
@supports not (field-sizing:content){.work-goal textarea,.work-new-goal{height:112px;overflow-y:auto}}
.work-goal .work-row input[type=text]{min-width:120px}
.work-subtitle{font-size:12px;color:#335b76;font-weight:650;margin-top:6px}
.work-report{padding:8px 0;border-top:1px solid #e7edf6}
.work-report summary,.work-kpi summary,.work-section summary{font-size:14px;
 cursor:pointer;font-weight:700;color:#204d76;padding:7px 0}
.work-report-person p{font-size:13px;margin:5px 0}
.work-warning{color:#a14a23}
.work-kpi-row strong{display:block;font-size:13px;line-height:1.4}
.work-kpi-row .work-row input[type=number]{max-width:130px}
@media(max-width:650px){
 .work-section,.work-header{padding:9px}
 .work-row>input[type=text]{flex:1 1 100%}
 .work-row{gap:5px}
 .work-month-area{padding:7px}
}

/* Message styling toolbar occupies one scrollable row in the mobile grid composer. */
@media(max-width:700px){
 .workspace.chat-conversation-active #composer .chat-format-toolbar{grid-column:1/-1;grid-row:3;min-width:0;flex-wrap:nowrap!important;overflow-x:auto}
 .workspace.chat-conversation-active #composer .chat-format-toolbar button{flex-shrink:0}
 .workspace.chat-conversation-active #composer #attachment{grid-row:4}
}


.chat-poll{min-width:220px;max-width:100%}.chat-poll-option{margin:8px 0}.chat-poll-option button{text-align:left;width:100%;white-space:normal}.chat-poll progress{width:100%;height:8px;accent-color:#1565c0}.chat-poll>button{margin:3px;font-size:12px}

.message-search-dialog{width:min(720px,95vw);max-height:88dvh;overflow:auto}.message-search-dialog form{display:grid;gap:10px}.message-search-dialog .card p{white-space:pre-wrap;overflow-wrap:anywhere}.shift-day textarea{width:100%;min-height:70px;box-sizing:border-box}


/* One bounded messenger: the directory and thread scroll independently. */
@media(min-width:851px){
  .workspace:has(.chat-surface){height:100dvh;overflow:hidden}
  .workspace:has(.chat-surface)>aside{width:200px;padding:20px 14px;overflow:auto}
  .workspace:has(.chat-surface) .wordmark{padding-bottom:22px}
  .workspace:has(.chat-surface) .nav{padding:12px}
  .workspace:has(.chat-surface)>main>header{padding:12px 24px;flex-shrink:0}
  .workspace:has(.chat-surface) header h1{font-size:24px;margin:3px 0}
  .workspace:has(.chat-surface) .account{font-size:14px}
  .workspace:has(.chat-surface) .account button{padding:10px}
}
#content.chat-surface{padding:0;min-height:0;overflow:hidden;background:#f2f7fc}
.chat-surface .chat-layout{height:100%;min-height:0;gap:0}
.chat-surface .chat-directory{width:300px;min-width:250px;max-width:34%;border:0;border-right:1px solid #dfe7f0;border-radius:0;background:#fff;padding:18px 12px}
.chat-surface .chat-thread{min-height:0;height:100%;overflow:hidden;background-color:#edf5fb;background-image:linear-gradient(#ffffffcc,#ffffffcc),url('chat-background.jpg');background-size:auto,432px 768px}
.chat-thread #chat-controls{margin:0;padding:12px;gap:6px;flex:0 0 auto;flex-wrap:wrap;background:#fff;border-bottom:1px solid #e0e7f1;border-radius:0}
.chat-thread .chat-title-slot{flex:1;min-width:120px}
.chat-thread #chat-list{width:100%;max-width:none;min-width:0;font-size:15px;padding:10px;background:#f3f6fa;border-radius:10px}
.chat-thread #chat-messages{min-height:0;max-height:none;flex:1 1 0;overflow:auto;padding:20px;border-radius:0}
.chat-directory-actions{gap:6px}
.chat-directory-actions button{padding:8px;font-size:12px}
.chat-admin-menu{width:100%;border-bottom:1px solid #e5ebf3;padding:6px 2px 10px;color:#52677d;font-size:13px}
.chat-admin-menu summary{cursor:pointer;padding:5px}
.chat-admin-menu[open]{display:grid;gap:5px}
.chat-admin-menu button{display:block;width:100%;text-align:left;margin-top:5px}
.chat-thread #composer,.workspace.chat-conversation-active #composer{position:relative;display:flex!important;flex-wrap:wrap;flex:0 0 auto;align-items:center;gap:6px;padding:10px 12px max(10px,env(safe-area-inset-bottom));margin:0;background:#fff;box-shadow:none}
.chat-thread #composer[hidden],.workspace.chat-conversation-active #composer[hidden]{display:none!important}
.chat-thread #composer #message,.workspace.chat-conversation-active #composer #message{order:0;flex:1 1 80px;width:auto;min-width:0;height:44px;min-height:44px;max-height:120px;padding:11px 14px;resize:none;line-height:1.4;font-size:16px;border-radius:18px}
.chat-thread #composer .composer-icon,.workspace.chat-conversation-active #composer .composer-icon{flex:0 0 38px;width:38px;min-width:38px;height:38px;max-width:38px;padding:0;border-radius:12px;font-size:20px}
.chat-thread #composer .send-button,.workspace.chat-conversation-active #composer .send-button{order:0;flex:0 0 40px;width:40px;height:40px;padding:0}
.chat-thread #attachment:empty{display:none}
.chat-thread #composer #attachment{order:1;flex-basis:100%;max-width:none;max-height:90px;overflow:auto}
.composer-tools{position:relative;flex:0 0 34px;align-self:center}
.composer-tools>summary{display:grid;place-items:center;width:34px;height:38px;border-radius:12px;background:#eaf3ff;color:#0a68d1;cursor:pointer;list-style:none;font-size:24px}
.composer-tools>summary::-webkit-details-marker{display:none}
.composer-tools>summary:focus-visible{outline:3px solid #8aacfa}
.composer-tools-menu{position:absolute;bottom:48px;left:0;z-index:20;display:flex;gap:6px;padding:10px;background:#fff;border:1px solid #dce6f0;border-radius:14px;box-shadow:0 8px 28px #20395326}
.composer-tools:not([open])>.composer-tools-menu{display:none}
.chat-thread #reply-preview{flex:0 0 auto;margin:0;border-radius:0;max-height:90px;overflow:auto}
@media(max-width:850px){
  .chat-surface .chat-directory{width:100%;max-width:none;border-right:0;height:100%;overflow:auto}
  .chat-surface .chat-layout:not(.chat-open){display:block}
  .chat-surface .chat-layout.chat-open{display:flex;flex-direction:column}
  .chat-surface .chat-thread{flex:1;min-height:0}
  .workspace:has(.chat-surface){height:100dvh;min-height:0;overflow:hidden;display:flex;flex-direction:column}
  .workspace:has(.chat-surface)>main{flex:1;min-height:0}
  .workspace:has(.chat-surface)>aside{max-height:36dvh;overflow:auto}
  .workspace.chat-conversation-active #content.chat-surface{padding:0}
  .workspace.chat-conversation-active #chat-controls{border-radius:0;margin:0;flex-wrap:nowrap;padding:8px 6px}
  .chat-thread #chat-messages{padding:12px 8px}
}


.chat-format-menu{position:relative;flex:0 0 34px}
.chat-format-menu>summary{list-style:none;display:grid;place-items:center;width:34px;height:38px;border-radius:12px;background:#eaf3ff;color:#0a68d1;cursor:pointer;font-size:14px;font-weight:650}
.chat-format-menu>summary::-webkit-details-marker{display:none}
.chat-format-menu>summary:focus-visible{outline:3px solid #8aacfa}
.chat-format-menu:not([open])>.chat-format-toolbar{display:none!important}
.chat-format-menu>.chat-format-toolbar{position:absolute;bottom:48px;left:0;z-index:21;display:flex;flex-wrap:wrap;width:250px;gap:6px;padding:10px;background:#fff;border:1px solid #dce6f0;border-radius:14px;box-shadow:0 8px 28px #20395326}

/* iPhone keyboard and chat composer final cascade guard.
   Keep this AFTER the desktop-like chat overrides above: those rules otherwise
   change the mobile chat shell back to 100dvh and hide the composer under iOS
   keyboard. The message list alone scrolls, not the entire conversation. */
@media (max-width:700px){
  html.azbuka-chat-ios,body.azbuka-chat-ios{
    overflow:hidden!important;
    overscroll-behavior:none;
  }
  .workspace.chat-conversation-active:has(.chat-surface){
    position:fixed!important;
    inset:auto 0 auto 0!important;
    top:var(--azbuka-visual-top,0px)!important;
    width:100%!important;
    height:var(--azbuka-visual-height,100dvh)!important;
    max-height:var(--azbuka-visual-height,100dvh)!important;
    min-height:0!important;
    display:block!important;
    overflow:hidden!important;
    padding:0!important;
  }
  /* In iOS home-screen mode an absolute shell follows the visual viewport's
     pageTop instead of relying on WebKit's keyboard-shifted fixed element. */
  .workspace.chat-conversation-active.azbuka-ios-layout{
    position:absolute!important;
  }
  .workspace.chat-conversation-active>main{
    display:flex!important;
    flex-direction:column!important;
    height:100%!important;
    min-height:0!important;
    overflow:hidden!important;
  }
  .workspace.chat-conversation-active #content.chat-surface{
    flex:1 1 0!important;
    min-height:0!important;
    overflow:hidden!important;
  }
  .workspace.chat-conversation-active .chat-layout,
  .workspace.chat-conversation-active .chat-thread{
    min-height:0!important;
    height:100%!important;
  }
  .workspace.chat-conversation-active .chat-thread #chat-messages{
    flex:1 1 0!important;
    min-height:0!important;
    max-height:none!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overscroll-behavior-y:contain;
    -webkit-overflow-scrolling:touch;
  }
  .workspace.chat-conversation-active .chat-thread #reply-preview{flex:0 0 auto!important}
  .workspace.chat-conversation-active .chat-thread #composer{
    display:flex!important;
    flex-flow:row wrap!important;
    flex:0 0 auto!important;
    align-items:center!important;
    gap:5px!important;
    width:100%!important;
    max-width:100%!important;
    padding:6px 8px max(6px,env(safe-area-inset-bottom))!important;
    box-sizing:border-box;
    background:#fff!important;
  }
  .workspace.chat-conversation-active.chat-keyboard-visible .chat-thread #composer{
    padding-bottom:6px!important;
  }
  .workspace.chat-conversation-active .chat-thread #composer #attach{
    order:0!important;
    flex:0 0 38px!important;
    width:38px!important;
    min-width:38px!important;
    height:40px!important;
    max-width:38px!important;
  }
  .workspace.chat-conversation-active .chat-thread #composer .composer-tools,
  .workspace.chat-conversation-active .chat-thread #composer .chat-format-menu{
    order:0!important;
    flex:0 0 34px!important;
    min-width:34px!important;
  }
  .workspace.chat-conversation-active .chat-thread #composer #message{
    order:0!important;
    flex:1 1 80px!important;
    width:auto!important;
    min-width:0!important;
    min-height:42px!important;
    height:42px;
    max-height:104px!important;
    font-size:16px!important;
    resize:none!important;
  }
  .workspace.chat-conversation-active .chat-thread #composer .send-button{
    order:0!important;
    flex:0 0 40px!important;
    width:40px!important;
    height:40px!important;
    min-width:40px!important;
    margin:0!important;
  }
  .workspace.chat-conversation-active .chat-thread #composer #attachment:not(:empty){
    order:2!important;
    flex:0 0 100%!important;
    max-width:100%!important;
  }
}


/* Native fragment selection in messages and editable fields. */
.post,.post *,input,textarea{user-select:text;-webkit-user-select:text;-webkit-touch-callout:default}

/* Russian work planning always reads and types left-to-right. */
.work-planner-shell{direction:ltr;text-align:left}
.work-planner-shell input:not([type=checkbox]),.work-planner-shell textarea{direction:ltr;text-align:left}


/* Employee help center, text only to prevent internal HTML injection. */
.guide-shell{direction:ltr;text-align:left;max-width:970px;display:grid;gap:12px}
.guide-header,.guide-questions{background:#fff;padding:18px;border:1px solid #e1e9f4;border-radius:15px;display:grid;gap:10px}
.guide-header h2{margin:0;font-size:20px}
.guide-muted{color:#607187;font-size:13px;line-height:1.55}
.guide-filters{display:flex;gap:7px;flex-wrap:wrap}
.guide-filters button,.guide-header button,.guide-question-card button{padding:9px 12px;font-size:13px}
.guide-items,.guide-question-list{display:grid;gap:9px}
.guide-article,.guide-question-card{border:1px solid #e1e9f3;border-radius:12px;padding:13px;background:#fff;overflow-wrap:anywhere}
.guide-article summary{cursor:pointer;display:flex;flex-direction:column;gap:5px}
.guide-article summary strong{font-size:15px}
.guide-body{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.6;margin:9px 0}
.guide-question-card{display:flex;flex-direction:column;gap:7px}
.guide-question-form{display:grid;gap:8px}
.guide-question-form textarea,.guide-question-card textarea{min-height:82px}
.guide-editor{max-width:94vw;width:640px}
.guide-edit-form{display:grid;gap:12px}
.guide-published{display:flex;align-items:center;gap:10px}
.guide-published input{width:19px;height:19px}
@media(max-width:650px){.guide-header,.guide-questions{padding:11px}.guide-shell{gap:9px}}


/* iPhone photo message thumbnails, at most 2cm by 2cm without framing. */
.chat-surface .bubble.media-message:has(.message-gallery,.chat-file-photo){width:fit-content;max-width:88%}
.chat-surface .bubble.media-message .message-gallery,
.chat-surface .bubble.media-message .message-gallery.single-photo,
.chat-surface .bubble.media-message .file-photo-gallery{
 display:flex;flex-wrap:wrap;justify-content:flex-start;gap:4px;width:fit-content;max-width:100%;margin:0
}
.chat-surface .bubble.media-message.mine .message-gallery,
.chat-surface .bubble.media-message.mine .file-photo-gallery{justify-content:flex-end}
.chat-surface .bubble.media-message .chat-image-frame,
.chat-surface .bubble.media-message .chat-file-photo{
 width:min(2cm,75px)!important;height:min(2cm,75px)!important;max-width:min(2cm,75px)!important;
 max-height:min(2cm,75px)!important;border:0!important;border-radius:0!important;
 background:transparent!important;box-shadow:none!important;padding:0!important;overflow:hidden
}
.chat-surface .bubble.media-message .chat-image-frame .chat-image,
.chat-surface .bubble.media-message .chat-file-photo .chat-image{
 width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important;
 object-fit:contain!important;border:0!important;border-radius:0!important;box-shadow:none!important;margin:0!important;padding:0!important
}
.chat-surface .bubble.media-message .message-files{width:fit-content;max-width:100%}
.chat-surface .bubble.media-message .media-photo-save{
 top:0;right:0;width:24px;height:24px;min-width:24px;border:0;border-radius:0;font-size:16px
}
.chat-surface .bubble.media-message .media-photo-time{display:none}
.message-photos-download-all{display:block;width:fit-content;margin:5px 0;padding:6px 10px;border:0;border-radius:9px;background:#e9f4ff;color:#205c8d;font-size:12px}
.chat-media-thumbnail{width:min(2cm,75px);height:min(2cm,75px);border-radius:0;border:0;object-fit:contain}


/* Chief administrator dashboard and nested unread indicators. */
.chat-entry.unread-children{border-left:3px solid #2383d3;background:#f1f7ff}
.subchat-unread-count{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;
  background:#dcf0ff;color:#075a9b;font-weight:800;font-size:11px;border:1px solid #b4dcfa;
  border-radius:12px;padding:3px 8px;white-space:nowrap}
.chat-children-summary{display:flex;align-items:center;justify-content:space-between;gap:8px}
#chat-unread-filter[aria-pressed="true"]{background:#0b70cb;color:white}
.admin-dashboard-hero{border-radius:20px;background:linear-gradient(125deg,#153e6c,#2479b6);color:#fff;
  padding:25px 28px;margin-bottom:17px}
.admin-dashboard-eyebrow{letter-spacing:1.5px;font-size:11px;font-weight:800;opacity:.8}
.admin-dashboard-hero h2{font-size:25px;margin:8px 0}
.admin-dashboard-hero p{color:#e9f4fc;margin:0;font-size:14px}
.admin-dashboard-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:18px}
.admin-dashboard-metric{border:1px solid #dfe9f3;border-radius:15px;background:#fff;color:#28435d;
  display:flex;flex-direction:column;align-items:flex-start;gap:7px;padding:17px;text-align:left}
.admin-dashboard-metric strong{font-size:29px;color:#1c6197}
.admin-dashboard-metric span{font-size:13px;line-height:1.3}
.admin-dashboard-metric.needs-attention{border-color:#efc6ad;background:#fff9f4}
.admin-dashboard-metric.needs-attention strong{color:#aa4d29}
.admin-dashboard-section{background:#fff;border:1px solid #e0eaf3;border-radius:16px;padding:18px;margin-bottom:15px}
.admin-dashboard-section h3{margin:0 0 13px;font-size:17px}
.admin-dashboard-actions{display:flex;gap:9px;flex-wrap:wrap}
.admin-dashboard-actions button{font-size:13px;padding:10px 14px}
.admin-dashboard-task{display:flex;gap:10px;align-items:center;justify-content:space-between;
  border-top:1px solid #ecf0f6;padding:11px 0}
.admin-dashboard-task>div{display:grid;gap:4px;min-width:0}
.admin-dashboard-task strong{font-size:14px;overflow-wrap:anywhere}
.admin-dashboard-task span,.admin-dashboard-empty,.admin-dashboard-note{font-size:12px;color:#61748c}
.admin-dashboard-task button{flex-shrink:0;font-size:12px;padding:8px 11px}
@media(max-width:1000px){.admin-dashboard-stats{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:480px){.admin-dashboard-hero{padding:20px}.admin-dashboard-stats{gap:8px}
  .admin-dashboard-metric{padding:12px}.admin-dashboard-metric strong{font-size:24px}}


/* Adaptive role workspaces - same visual language for web and desktop. */
.nav-section-label{font-size:10px;line-height:1.4;font-weight:800;letter-spacing:1.3px;color:#8796a9;
  padding:15px 10px 6px;pointer-events:none}
.role-home-hero{background:linear-gradient(125deg,#173f64,#2878a8);border-radius:20px;padding:24px 27px;color:#fff;margin-bottom:16px}
.role-home-hero h2{margin:7px 0 8px;font-size:25px;line-height:1.2}
.role-home-kicker{font-size:10px;font-weight:800;letter-spacing:1.6px;color:#d1e7fa;margin:0}
.role-home-subtitle{font-size:14px;color:#edf7ff;line-height:1.5;margin:0;max-width:680px}
.role-home-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:16px}
.role-home-metric{background:#fff;border:1px solid #dce7f1;border-radius:15px;display:flex;
  flex-direction:column;align-items:flex-start;justify-content:center;text-align:left;gap:7px;
  padding:16px;min-height:105px;color:#28445e}
.role-home-number{font-size:29px;color:#155b92;line-height:1.1}
.role-home-metric-label{font-size:12px;line-height:1.3}
.role-home-danger{background:#fff7f3;border-color:#f0d2c2}
.role-home-danger .role-home-number{color:#a84625}
.role-home-grid{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(240px,1fr);gap:15px;align-items:start}
.role-home-panel{background:#fff;border:1px solid #dce7f1;border-radius:17px;padding:18px;min-width:0}
.role-home-panel h3{font-size:17px;margin:0 0 13px}
.role-home-task{display:flex;gap:10px;align-items:center;justify-content:space-between;
  border-top:1px solid #eaf0f6;padding:12px 0}
.role-home-task>div{display:grid;gap:6px;min-width:0}
.role-home-task strong{font-size:13px;overflow-wrap:anywhere}
.role-home-task-meta{font-size:11px;color:#6b798b}
.role-home-task-action{font-size:12px;padding:8px 10px;flex-shrink:0}
.role-home-action-list{display:grid;gap:8px}
.role-home-link{background:#eef5fb;color:#195b88;text-align:left;padding:11px 13px;font-size:13px}
.role-home-create{background:#155f94;font-size:13px;padding:11px 13px;text-align:left}
.role-home-unread{display:flex;align-items:center;gap:11px;border-top:1px solid #e5ebf2;padding-top:13px;margin-top:14px}
.role-home-unread strong{font-size:27px;color:#155b92}
.role-home-unread span{font-size:12px;color:#64788d;line-height:1.45}
.role-home-disclaimer{font-size:11px;color:#64748b;line-height:1.5;margin:16px 0}
.role-home-empty{color:#677a8e;font-size:13px}
@media(max-width:1050px){.role-home-grid{grid-template-columns:1fr}}
@media(max-width:700px){.role-home-metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.role-home-hero{padding:20px}.role-home-hero h2{font-size:21px}
.role-home-metric{padding:12px;min-height:92px}.role-home-number{font-size:24px}
.nav-section-label{display:none}}


/* Larger readable attachments, constrained to narrow phone screens. */
.work-attachments{margin:8px 0;padding:12px;border:1px solid #dce7f2;border-radius:12px}
.work-attachments summary{cursor:pointer;font-weight:600;padding:6px 0}
.work-file{margin-top:12px;padding:14px;background:#f4f8fd;border-radius:12px;min-width:0}
.work-file>button{font-size:16px;min-height:52px;white-space:normal;overflow-wrap:anywhere;text-align:left}
.work-file-image{display:block;width:min(100%,420px);max-height:380px;object-fit:contain;margin:10px 0;cursor:pointer}
.work-discussion{display:grid;gap:8px;margin-top:10px}.work-discussion textarea{width:100%;box-sizing:border-box}
.work-comment{border-left:3px solid #bdd5ed;padding-left:10px}.work-comment p{white-space:pre-wrap;overflow-wrap:anywhere;margin:4px 0}
.chat-surface .bubble.media-message .message-gallery.single-photo,.chat-surface .bubble.media-message .file-photo-gallery{max-width:420px;width:min(420px,100%)}
.chat-surface .bubble.media-message .chat-image-frame .chat-image,.chat-surface .bubble.media-message .chat-file-photo .chat-image{max-height:380px}
.message-file-download{font-size:16px;min-height:52px;white-space:normal;overflow-wrap:anywhere}
@media(max-width:600px){.work-file-image{max-height:320px}.chat-surface .bubble.media-message .chat-image-frame .chat-image{max-height:320px}}

.chat-surface .bubble.media-message .chat-image-frame,
.chat-surface .bubble.media-message .chat-file-photo{
 width:140px!important;height:140px!important;max-width:100%!important;max-height:140px!important;
}
.chat-media-thumbnail{width:140px;height:140px;max-width:100%}


/* Азбука педагога: compact, accessible methodological materials. */
.pedagogy-shell{display:grid;gap:13px;max-width:990px;padding-bottom:32px}
.pedagogy-shell h2{margin:0;color:#173f64}
.pedagogy-shell h3{margin:5px 0;color:#173f64}
.pedagogy-intro,.pedagogy-meta{color:#66768b;font-size:13px;line-height:1.55;margin:0}
.pedagogy-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.pedagogy-actions button{font-size:13px;padding:9px 13px}
.pedagogy-actions label{display:flex;align-items:center;gap:7px;margin:0}
.pedagogy-actions select{width:auto;min-width:160px}
.pedagogy-actions input[type=text],.pedagogy-actions input:not([type]){min-width:210px;flex:1}
.pedagogy-actions input[type=checkbox]{width:19px;height:19px}
.pedagogy-card{padding:17px;border:1px solid #e1e9f3;background:#fff;border-radius:14px;display:grid;gap:10px;overflow-wrap:anywhere}
.pedagogy-card p{margin:0;line-height:1.6}
.pedagogy-body{white-space:pre-wrap}
.pedagogy-age-tip{background:#edf6fc;border-radius:9px;color:#284c63;font-size:13px;padding:12px;line-height:1.5}
.pedagogy-edit{border-top:1px solid #e1e9f3;padding-top:9px}
.pedagogy-edit summary{cursor:pointer;color:#22577a;font-weight:600}
.pedagogy-edit textarea,.pedagogy-card textarea{min-height:85px}
.pedagogy-row{display:flex;gap:12px;align-items:baseline;padding:12px 14px;background:#fff;border:1px solid #e1e9f3;border-radius:10px}
.pedagogy-row strong{white-space:nowrap;color:#235474}
.pedagogy-empty,.pedagogy-error{padding:14px;border-radius:10px;background:#edf6fc}
@media(max-width:650px){.pedagogy-row{display:grid;gap:4px}.pedagogy-actions{gap:5px}.pedagogy-actions button{padding:8px 10px}.pedagogy-card{padding:12px}}

/* Compact task attachments. Never show full comments/files until the user opens the icon. */
.work-task-item{border-bottom:1px solid #e5edf7}
.work-task-item .work-row{display:flex;flex-wrap:wrap;gap:7px}
.work-task-item .work-row>span{flex:1;min-width:100px}
.work-task-highlight{font-weight:800!important;color:#162b45}
.work-attachments{display:block;flex:0 0 auto;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;min-width:30px}
.work-attachments>summary{list-style:none;display:inline-flex;align-items:center;justify-content:center;gap:5px;min-width:32px;min-height:36px;margin:0!important;padding:3px 5px!important;border-radius:9px;background:#edf5ff;color:#1d5d9f;cursor:pointer}
.work-attachments>summary::-webkit-details-marker{display:none}
.work-attachment-icon{font-size:15px;white-space:nowrap;font-weight:700;line-height:1.3}
.work-attachments:not([open])>div{display:none!important}
.work-attachments[open]{flex-basis:100%;width:100%;order:10;min-width:0}
.work-attachments[open]>div{padding:10px 2px 12px;display:grid;gap:9px;min-width:0}
.work-attachments[open]>summary{margin-bottom:4px!important}
.work-attachments:focus-within>summary,.work-attachments>summary:focus-visible{outline:2px solid #2772da;outline-offset:2px}
.work-day .work-task-item .work-row:last-child{border-bottom:0}
.work-goal .work-attachments{width:max-content}
.work-goal .work-attachments[open]{width:100%}
/* Dialog close is always available at the top even when the content is long. */
dialog{scrollbar-gutter:stable}
dialog .dialog-top-close{position:sticky;top:0;float:right;z-index:35;width:42px;height:42px;min-width:42px;border:1px solid #d5e1ef;border-radius:50%;padding:0!important;display:grid;place-items:center;background:#edf5ff;color:#21538d;font-size:28px;line-height:1;box-shadow:0 2px 7px #24395522;margin:0 0 4px 8px}
dialog .dialog-heading{position:sticky;top:0;z-index:20;background:white;padding:4px 0}
dialog .dialog-heading .dialog-top-close{float:none;position:relative}
@media(max-width:650px){dialog .dialog-top-close{width:44px;height:44px;min-width:44px}}
