.broadcast-form{display:grid;gap:20px}
.broadcast-form [hidden],.bc-modal [hidden]{display:none!important}
.broadcast-form .card{min-width:0}
.bc-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:8px}
.bc-heading h2,.bc-heading h3,.bc-heading h4{margin:0}
.bc-audience .eyebrow{margin:0 0 7px}
.bc-compose-grid{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:20px;align-items:start}
.broadcast-filters{margin-top:18px;border-top:1px solid #e5edf4}
.broadcast-filters summary{cursor:pointer;padding:14px 0;font-weight:600}
.broadcast-filters summary span{color:#678092;font-size:13px;font-weight:400}
.broadcast-filters .checkbox-grid{max-height:260px;overflow:auto;padding:4px}
.broadcast-toolbar{display:flex;gap:8px;flex-wrap:wrap;padding:10px;background:#f3f7fb;border:1px solid #ccdae7;border-radius:14px 14px 0 0}
.bc-tool-group{display:flex;gap:4px;align-items:center;flex-wrap:wrap}
.bc-tool-group+.bc-tool-group{border-left:1px solid #d9e4ed;padding-left:8px}
.bc-tool{min-width:38px;min-height:40px;padding:7px 9px;border:1px solid transparent;border-radius:8px;background:transparent;color:#2b485e;font:15px system-ui;cursor:pointer}
.bc-tool span{font-size:12px}
.bc-tool:hover,.bc-tool:focus-visible{background:white;border-color:#b4cfdf;outline:none}
.bc-tool[aria-pressed=true]{background:#dceefd;border-color:#b3d8f1;color:#066ea9}
.broadcast-editor{min-height:240px;max-height:560px;overflow:auto;overflow-wrap:anywhere;white-space:pre-wrap;padding:18px;border:1px solid #ccdae7;border-top:0;border-bottom:0;background:white;color:#18364a;font:16px/1.65 system-ui}
.broadcast-editor:focus{outline:none;box-shadow:inset 3px 0 #1686c7}
.broadcast-editor p{margin:0}.broadcast-editor{position:relative}
.broadcast-editor[data-empty=true]:before{content:'Напишите сообщение исполнителям…';position:absolute;color:#889ba9;pointer-events:none}
.broadcast-editor blockquote,.bc-message blockquote{margin:8px 0;padding:7px 12px;border-left:3px solid #1686c7;background:#edf6fd;border-radius:4px;white-space:pre-wrap}
.broadcast-editor pre,.bc-message pre{margin:8px 0;white-space:pre-wrap;overflow-wrap:anywhere;padding:10px;border-radius:8px;background:#e9f0f6;font:14px/1.6 monospace}
.broadcast-editor code,.bc-message code{background:#e9f0f6;border-radius:4px;padding:1px 3px;font:14px/1.6 monospace}
.broadcast-editor .tg-spoiler{background:#dde7ef;text-decoration:underline dotted #6d879c;text-underline-offset:4px}
.bc-editor-footer{display:flex;gap:10px;align-items:center;justify-content:space-between;flex-wrap:wrap;padding:9px 12px;border:1px solid #ccdae7;border-radius:0 0 14px 14px;background:#fafcfe}
.bc-emoji-trigger{display:flex;align-items:center;gap:7px;font:26px system-ui;border:0;background:transparent;color:#1379ae;padding:3px 8px;min-height:40px;cursor:pointer;border-radius:8px}
.bc-emoji-trigger span{font:600 13px system-ui}.bc-emoji-trigger:hover,.bc-emoji-trigger[aria-expanded=true]{background:#e0edf6}
.bc-emoji-panel{width:min(440px,calc(100vw - 20px));max-width:none;height:min(540px,calc(100dvh - 24px));max-height:calc(100dvh - 24px);padding:0;border:1px solid #dbe7f0;border-radius:20px;background:#fff;color:#18364a;box-shadow:0 18px 70px #173f4f50;overflow:hidden}
.bc-emoji-panel[open]{display:flex;flex-direction:column}.bc-emoji-panel::backdrop{background:#183a5155}.bc-emoji-panel [hidden]{display:none!important}
.bc-emoji-panel header{display:flex;justify-content:space-between;align-items:center;padding:16px 18px 10px}.bc-emoji-panel h3{margin:0;font-size:20px}.bc-emoji-panel header p{margin:3px 0 0;font-size:12px}
.bc-emoji-search{display:flex;align-items:center;gap:8px;margin:0 14px 10px;padding:0 12px;background:#f2f6fa;border:1px solid #dce7ef;border-radius:12px}.bc-emoji-search input{min-width:0;width:100%;border:0;background:transparent;box-shadow:none;padding:10px 0;font:16px system-ui}.bc-emoji-search input:focus{outline:none;box-shadow:none}
.bc-emoji-categories{display:flex;gap:4px;overflow-x:auto;flex-shrink:0;padding:0 12px 8px;scrollbar-width:thin}
.bc-emoji-categories button{flex:0 0 37px;height:38px;border:1px solid transparent;background:transparent;border-radius:9px;font:23px 'Segoe UI Emoji',system-ui;cursor:pointer}.bc-emoji-categories button[aria-pressed=true]{background:#e0f1ff;border-color:#a9cfe9}
.bc-emoji-caption{font:600 13px system-ui;margin:0;padding:8px 18px;color:#688091;background:#f8fafc;flex-shrink:0}
.bc-emoji-grid{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));align-content:start;gap:3px;padding:9px 12px;overflow:auto;overscroll-behavior:contain;min-height:0;flex:1;scrollbar-width:thin}
.bc-emoji-grid button{min-width:0;min-height:40px;padding:2px 0;border:0;border-radius:9px;background:transparent;font:27px 'Apple Color Emoji','Segoe UI Emoji','Noto Color Emoji',sans-serif;cursor:pointer}.bc-emoji-grid button:hover,.bc-emoji-grid button:focus-visible{background:#e8f3fa;outline:2px solid #b3d8ef}.bc-emoji-grid p{grid-column:1/-1;text-align:center;padding:20px}
.bc-emoji-panel footer{font:11px system-ui;color:#7c92a0;text-align:center;padding:10px 14px max(12px,env(safe-area-inset-bottom));border-top:1px solid #e7eef4;flex-shrink:0}.bc-emoji-retry{margin:14px}
.bc-emoji-grid img{display:block;width:28px;height:28px;margin:auto;pointer-events:none}.bc-emoji-categories img{display:block;width:24px;height:24px;margin:auto;pointer-events:none}
@media(max-width:600px){.bc-emoji-panel{margin:auto auto 10px;height:min(520px,calc(100dvh - 20px))}.bc-emoji-grid{grid-template-columns:repeat(7,minmax(0,1fr))}}
.bc-editor-footer output{font-variant-numeric:tabular-nums;white-space:nowrap}
.bc-link-panel{display:grid;gap:10px;margin-top:14px;border:1px solid #c9dfed;border-radius:14px;padding:16px;background:#f6faff}
.bc-link-panel h4{margin:0}.bc-link-panel input{min-width:0;width:100%}
.bc-upload{display:flex;flex-direction:column;gap:5px;border:1px dashed #94bdd6;background:#f5faff;border-radius:14px;padding:16px;margin-top:22px;text-align:center;cursor:pointer;color:#1379ae}
.bc-upload span{font-weight:700}.bc-upload small{color:#6e8494;font-size:12px}
.bc-file-input{width:100%;margin-top:8px;font-size:13px}
#broadcast-images{display:flex;flex-wrap:wrap;gap:10px;margin-top:12px}
.broadcast-image{position:relative}.broadcast-image img{width:94px;height:88px;object-fit:cover;border-radius:12px;border:1px solid #dce6ed}
.broadcast-image button{position:absolute;right:2px;top:2px;background:#fff;color:#314d60;border:1px solid #d4e3ef;border-radius:50%;width:28px;height:28px;font-size:20px;cursor:pointer}
.bc-preview-panel{position:sticky;top:20px}.bc-live-badge{font:700 11px system-ui;letter-spacing:1px;color:#249478;background:#e8f7f0;padding:6px 9px;border-radius:20px}
.bc-chat{display:grid;align-content:start;gap:12px;background:#e7f0ed;background-image:radial-gradient(#a8c3b833 .8px,transparent .8px);background-size:14px 14px;padding:18px 12px;border-radius:16px;min-height:200px;max-height:560px;overflow:auto;overflow-wrap:anywhere}
.bc-chat[aria-busy=true]{opacity:.7}
.bc-bubble{min-width:0;background:white;border-radius:14px 14px 14px 3px;box-shadow:0 2px 5px #20473812;overflow:hidden;max-width:100%}
.bc-message{padding:12px 14px 6px;white-space:pre-wrap;font:15px/1.55 system-ui;color:#1e3341;overflow-wrap:anywhere}
.bc-message:empty{display:none}.bc-message a{color:#097bb3;text-decoration:underline}
.bc-bubble footer{padding:4px 14px 9px;text-align:right;font:10px system-ui;color:#8c9b9e}
.bc-message tg-spoiler{background:#82979d;color:transparent;border-radius:4px;cursor:pointer;user-select:none;box-decoration-break:clone;-webkit-box-decoration-break:clone}
.bc-message tg-spoiler.revealed{color:inherit;background:#e0e9ec;user-select:auto}
.bc-message tg-spoiler:not(.revealed) *{color:transparent!important}
.bc-gallery{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px;background:#dce6e2}.bc-gallery[data-count="1"]{grid-template-columns:1fr}
.bc-gallery img{width:100%;height:160px;object-fit:cover;display:block}.bc-gallery[data-count="1"] img{height:auto;max-height:280px;object-fit:contain}
.bc-gallery[data-count="3"] img:first-child,.bc-gallery[data-count="5"] img:first-child{grid-column:span 2}
.bc-preview-empty{align-self:center;text-align:center;color:#749188;padding:30px 10px}.bc-preview-empty>span{font-size:32px}.bc-preview-empty p{font-weight:600}.bc-preview-empty small{font-size:12px}
.bc-actions .button-row{margin-top:16px}.bc-actions .button-row>*{flex:1}.bc-error{color:#b3473e;font-size:14px;line-height:1.5;overflow-wrap:anywhere}.bc-error:empty{display:none}
.broadcast-history-item{border-top:1px solid #e2ebf1;padding:18px 0;overflow-wrap:anywhere}.broadcast-history-item p{line-height:1.7}
.bc-modal{width:min(640px,calc(100vw - 24px));max-width:none;max-height:calc(100dvh - 24px);padding:0;border:0;border-radius:24px;background:#fff;color:#1e3648;box-shadow:0 24px 90px #102c4566;overflow:hidden}
.bc-modal[open]{display:flex;flex-direction:column}.bc-modal::backdrop{background:#12283999;backdrop-filter:blur(3px)}
.bc-modal-header{display:flex;gap:12px;align-items:center;padding:22px 24px;border-bottom:1px solid #e9eff4;flex-shrink:0}.bc-modal-header h2{margin:4px 0 0;font-size:21px}.bc-modal-header .eyebrow{margin:0;font-size:10px}.bc-modal-header .icon-button{margin-left:auto;flex-shrink:0}
.bc-modal-icon{display:grid;place-items:center;width:44px;height:44px;background:#e5f4fd;border-radius:14px;color:#147ec5;font-size:24px;flex-shrink:0}
.bc-modal-body{padding:20px 24px;overflow:auto;overscroll-behavior:contain;min-height:0}.bc-modal-body>.bc-chat{max-height:none;min-height:0}
#broadcast-modal-question{font-size:19px;font-weight:700;line-height:1.5;margin:0 0 8px}
.bc-modal-actions{display:flex;gap:12px;padding:16px 24px max(18px,env(safe-area-inset-bottom));border-top:1px solid #e6edf3;background:#fff;flex-shrink:0}.bc-modal-actions>*{flex:1;min-height:46px}
@media(max-width:1100px){.bc-compose-grid{grid-template-columns:1fr}.bc-preview-panel{position:static}.bc-chat{max-height:480px}}
@media(max-width:600px){
  .broadcast-form .card-pad{padding:20px 16px}.bc-compose-grid{gap:18px}.bc-heading>.form-note{font-size:11px}.bc-heading>.eyebrow{font-size:10px}
  .broadcast-form .form-grid{grid-template-columns:1fr}.broadcast-toolbar{gap:6px;padding:8px}.bc-tool-group+.bc-tool-group{border:0;padding-left:0}.bc-tool{min-height:42px;padding:7px 9px}
  .broadcast-editor{min-height:210px;padding:14px}.bc-editor-footer{padding:8px}.bc-editor-footer output{margin-left:auto}
  .broadcast-form input,.broadcast-form select{max-width:100%;min-width:0}.bc-actions .button-row{flex-direction:column-reverse}.bc-actions .button-row>*{width:100%}
  .bc-modal{border-radius:20px;width:calc(100vw - 20px);max-height:calc(100dvh - 20px)}.bc-modal-header{padding:16px;gap:10px}.bc-modal-header h2{font-size:18px}.bc-modal-icon{width:36px;height:36px;font-size:20px}
  .bc-modal-body{padding:16px}#broadcast-modal-question{font-size:17px}.bc-modal-actions{padding:12px 16px max(16px,env(safe-area-inset-bottom));gap:8px;flex-direction:column-reverse}.bc-modal-actions>*{width:100%}
}
