.k24-room [hidden],.k24-incoming[hidden],.k24-toast[hidden]{display:none!important}
.k24-room{height:auto!important;min-height:75vh}
.k24-room .container{align-items:stretch}
.k24-room .chat_block{min-height:650px}
.k24-room .chat_dialog{min-height:240px;flex:1;height:auto}
.k24-room .chat_dialog_content{height:420px;overflow-y:auto}
.k24-room .message p{white-space:pre-wrap;overflow-wrap:anywhere}
.k24-room .chat_form{align-items:center}
.k24-room .chat_form input{min-width:0}
.k24-room .chat_form button{display:block;border:0;border-radius:12px;background:#00b783;color:white;padding:12px;cursor:pointer}
.k24-room button:disabled{opacity:.5;cursor:default}
.k24-room .chat_close{display:block;border:0;background:none;cursor:pointer}
.k24-room .chat_info_block .button{width:100%;box-sizing:border-box;cursor:pointer}
.k24-room .chat_dialog_end{padding:20px;position:static}
.k24-room-actions{display:flex;gap:12px;padding:16px}
.k24-error{color:#b32323;margin:10px 20px;overflow-wrap:anywhere}
.k24-error:empty{display:none}
.k24-call{flex:1;min-height:460px;display:flex;flex-direction:column;align-items:stretch}
.k24-call [data-daily-frame]{flex:1;min-height:450px}
.k24-call [data-daily-join]{margin:20px;cursor:pointer}
.k24-call [data-daily-frame]{position:relative}
.k24-audio-call{position:absolute;inset:0;display:flex;flex-direction:column;gap:20px;padding:24px;background:#131e2c;color:#fff;overflow:auto;box-sizing:border-box}
.k24-audio-tiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;flex:1;min-height:150px}
.k24-audio-tile{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:12px;padding:16px;background:#283d56;border-radius:12px;min-width:0}
.k24-audio-initial{display:grid;place-items:center;width:64px;height:64px;flex-shrink:0;border-radius:50%;background:#3b5575;font-size:30px}
.k24-audio-tile .k24-audio-name{margin:0;color:#fff;font-size:18px;font-weight:600;line-height:1.4;overflow-wrap:anywhere}
.k24-audio-tile .k24-audio-status{margin:0;color:#d0dbe7;font-size:13px;line-height:1.4}
.k24-audio-controls{display:flex;align-items:center;justify-content:center;gap:12px;flex-wrap:wrap}
.k24-audio-controls .button{min-height:44px;max-width:100%;padding:10px 16px;white-space:normal;cursor:pointer}
.k24-audio-device{display:flex;align-items:center;gap:8px;font-size:13px;max-width:100%;min-width:0}
.k24-audio-device select{min-width:0;max-width:210px;width:100%;padding:10px;background:#fff;color:#252525;border-radius:8px}
@media(max-width:600px){
    .k24-audio-call{padding:12px;gap:12px}
    .k24-audio-tiles{gap:8px}
    .k24-audio-tile{padding:10px;gap:8px}
    .k24-audio-tile .k24-audio-name{font-size:16px}
    .k24-audio-initial{width:48px;height:48px;font-size:24px}
}
.k24-attach{padding:10px;cursor:pointer}
.k24-attach img{width:24px}
.k24-room .chat_form .k24-attach{display:flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;height:48px;padding:10px;background:#fff;border:1px solid #DB6460;box-sizing:border-box}
.k24-room .chat_form input[name="text"]{flex:1;width:0}
.k24-room .chat_form button[type="submit"]{flex-shrink:0}
.k24-room .chat_form button:focus-visible{outline:2px solid #424248;outline-offset:2px}
.k24-room .k24-file-help{margin:0;padding:8px 20px;font-size:13px;color:#686772;background:#f5f4fa}
.k24-file-selection{display:flex;align-items:center;gap:10px;padding:12px 20px;background:#f5f4fa;min-width:0}
.k24-file-selection .k24-file-preview,.k24-file-icon{flex:0 0 48px;width:48px;height:48px;border-radius:6px;object-fit:cover}
.k24-file-icon{display:grid;place-items:center;font-size:28px;background:#fff}
.k24-file-details{flex:1;min-width:0}
.k24-file-details [data-file-name]{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere;font-size:14px;line-height:1.4}
.k24-file-details [data-file-status]{display:block;font-size:13px;color:#686772}
.k24-file-remove{flex:0 0 44px;width:44px;height:44px;display:grid;place-items:center;border:0;border-radius:8px;background:none;color:#424248;font-size:28px;cursor:pointer}
.k24-file-remove:focus-visible{outline:2px solid #424248;outline-offset:2px}
.k24-room .message.k24-image-message{width:100%;max-width:100%;box-sizing:border-box}
.k24-file-info{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px 16px;margin:8px 0}
.k24-file-name{min-width:0;overflow-wrap:anywhere;font-size:14px}
.k24-file-download{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:8px 16px;box-sizing:border-box;border:1px solid #176c55;border-radius:8px;background:white;color:#176c55;text-decoration:none;font-size:14px;line-height:1.4;cursor:pointer}
.k24-room .message .k24-image-link{display:block;width:100%;max-width:100%;padding:0;border:0;background:none;margin-bottom:12px;cursor:zoom-in}
.k24-room .message .k24-chat-image{display:block;width:100%;height:auto;max-width:100%;max-height:none;border-radius:8px}
.k24-image-error{display:block;padding:16px;line-height:1.4;color:#b32323}
.k24-image-viewer{position:fixed;inset:0;width:100%;height:100%;height:100dvh;max-width:none;max-height:none;margin:0;padding:16px;box-sizing:border-box;border:0;background:#14141a;color:white;overflow:hidden}
.k24-image-viewer[open]{display:flex;flex-direction:column;gap:12px}
html:has(.k24-image-viewer[open]){overflow:hidden}
.k24-image-viewer::backdrop{background:#000d}
.k24-image-toolbar{display:flex;align-items:center;justify-content:flex-end;gap:16px;flex-shrink:0}
.k24-image-full{display:block;flex:1;min-height:0;width:100%;height:0;object-fit:contain}
.k24-image-close{display:grid;place-items:center;width:44px;height:44px;padding:0;border:0;border-radius:8px;background:#ffffff20;color:white;font-size:32px;cursor:pointer}
.k24-image-link:focus-visible,.k24-file-download:focus-visible,.k24-image-close:focus-visible{outline:3px solid #5588e2;outline-offset:3px}
.k24-incoming,.k24-toast{position:fixed;right:16px;bottom:20px;max-width:340px;background:white;border:1px solid #ccc;border-radius:12px;padding:16px;z-index:99999;box-shadow:0 4px 20px #0002}
.k24-incoming a{display:block;padding:8px;color:#10995f}
.k24-toast{bottom:110px;color:#b32323}
.k24-table-scroll{overflow-x:auto}
.k24-history{border-collapse:collapse;width:100%;background:white}
.k24-history th,.k24-history td{padding:14px;text-align:left;border-bottom:1px solid #e2e1e8}
.k24-history a{color:#10995f}
.k24-payout-form{display:flex;gap:12px;flex-wrap:wrap;align-items:center;margin:20px 0}
.k24-payout-form input{padding:12px;border:1px solid #ccc;border-radius:10px}
@media(max-width:800px){.k24-room .container{flex-direction:column}.k24-room .chat_block,.k24-room .chat_info_block{width:100%}.k24-room .chat_block{min-height:550px}.k24-room .chat_form{padding:10px;gap:8px}.k24-room .chat_form input{padding:10px;font-size:16px}.k24-room .chat_dialog_content{height:350px}.k24-room .chat_info_block{margin-top:12px}}
@media(max-width:700px){.k24-incoming,.k24-toast{left:12px;right:12px;max-width:none}}

.k24-typing{padding:0 20px 10px;color:#9594a0;font-size:14px}
.k24-room .chat_form button img{width:24px;height:24px}
.k24-room .chat_head .avatar img{width:44px;height:44px;object-fit:cover}
.k24-room .chat_block,.k24-room .chat_info_block{box-sizing:border-box;min-width:0}
@media(max-width:800px){
    section.k24-room{padding:20px 0}
    .k24-room .chat_block{position:static;height:auto;border:1px solid #cccbd5;border-radius:12px;z-index:auto}
    .k24-room .chat_head{padding:12px;gap:8px}
    .k24-room .chat_head_side{min-width:0;gap:8px}
    .k24-room .avatar_info{overflow-wrap:anywhere}
    .k24-room .chat_close{flex-shrink:0}
}

/* Окна запроса адаптированы из заготовки чата к кнопкам и цветам темы. */
.k24-consultation-modal{box-sizing:border-box;position:fixed;inset:0;margin:auto;width:calc(100% - 32px);max-width:460px;max-height:90dvh;overflow-y:auto;border:0;border-radius:24px;padding:40px 24px 24px;background:#fff;color:#232323;text-align:center;font:inherit}
.k24-consultation-modal::backdrop{background:#0006;backdrop-filter:blur(4px)}
.k24-consultation-modal h2{font-size:24px;line-height:1.3;margin:0 0 16px}
.k24-consultation-modal p{margin:12px 0;overflow-wrap:anywhere}
.k24-modal-close{position:absolute;right:14px;top:8px;border:0;background:none;font:inherit;font-size:30px;cursor:pointer}
.k24-modal-buttons,.k24-notification-buttons{display:flex;flex-wrap:wrap;gap:12px;justify-content:center;margin-top:20px}
.k24-modal-buttons .button{flex:1;min-width:140px;box-sizing:border-box;cursor:pointer}
.k24-modal-countdown{font-size:28px;font-weight:600;font-variant-numeric:tabular-nums}
.k24-consultation-modal button:disabled{opacity:.5;cursor:wait}
.k24-paid-notice,.k24-low-balance{padding:12px 20px;background:#fff4d4;line-height:1.5}
.k24-low-balance{background:#fde6e6;color:#8e2424}
.k24-message-retry{margin:8px 20px;cursor:pointer}
.k24-notification-settings{margin:24px 0;padding:20px;border:1px solid #cccbd5;border-radius:12px}
.k24-notification-settings [hidden]{display:none!important}
.k24-notification-settings p{margin:12px 0;overflow-wrap:anywhere}
.k24-notification-settings button{cursor:pointer;box-sizing:border-box}
.k24-notification-settings a{color:#10995f;text-decoration:underline}
.k24-notification-buttons{justify-content:flex-start}
@media(max-width:540px){.k24-notification-buttons .button{width:100%}.k24-consultation-modal{padding:40px 16px 20px}}
.k24-room-profile{display:flex;align-items:center;gap:12px;color:inherit;text-decoration:none;min-width:0}
.k24-room-profile:hover .avatar_info p:first-child{text-decoration:underline}
/* Те же цвета, что у ссылок .button в основной вёрстке. */
button.button.green_button{background:#33B06A;color:#fff;cursor:pointer}
button.button.green_button:hover:not(:disabled){background:#29B868;box-shadow:0 -3px 4px 0 rgba(19,79,21,.25) inset}
button.button.blue_button{background:#5588E2;color:#fff;cursor:pointer}
button.button.blue_button:hover:not(:disabled){background:#4C84E7;box-shadow:0 -3px 4px 0 rgba(19,45,79,.25) inset}
button.button.button_white{border:1px solid #DB6460;background:#fff;color:#424248;cursor:pointer}
button.button.button_white:hover:not(:disabled){background:#FFF8F8;box-shadow:0 -3px 8px 0 rgba(230,129,125,.25) inset}
button.button.red_button{background:#DB6460;color:#fff;cursor:pointer}
button.button.red_button:hover:not(:disabled){background:#DE544F;box-shadow:0 -3px 4px 0 rgba(79,21,19,.25) inset}
button.button:disabled{cursor:default;box-shadow:none}
button.button:focus-visible{outline:2px solid #424248;outline-offset:3px}

.k24-room .button,.k24-consultation-modal .button,.k24-notification-settings .button{justify-content:center;text-align:center}
.k24-notification-settings details{margin-top:12px;line-height:1.6}
.k24-notification-settings summary{cursor:pointer;color:#424248;text-decoration:underline}
.k24-notification-settings [data-push-settings-address]{display:block;max-width:100%;overflow-wrap:anywhere;user-select:all}

/* Call room: keep the call and billing panel in normal document flow on
   tablets/phones, overriding the legacy fixed .chat_block at <=800px. */
.k24-call-room .chat_head_side,.k24-call-room .avatar_info{min-width:0}
.k24-call-room .chat_head_side>.avatar,.k24-call-room .k24-room-profile>.avatar,.k24-call-room .chat_head_side>a:first-child{flex-shrink:0}
.k24-call-room .avatar_info{overflow-wrap:anywhere}
.k24-call-room .chat_close{flex-shrink:0;min-height:44px}
.k24-call-room:has([data-room-end]:not([hidden])) .k24-call{display:none}
@media(max-width:1000px){
    section.k24-call-room{min-height:0}
    section.k24-call-room>.container{flex-direction:column;gap:16px;height:auto}
    .k24-call-room .chat_block{position:static;inset:auto;z-index:auto;width:100%;height:auto;min-height:0;border:1px solid #cccbd5;border-radius:12px}
    .k24-call-room .chat_info_block{width:100%;margin-top:0;padding:16px}
    .k24-call-room .k24-call{flex:none;min-height:0}
    .k24-call-room [data-daily-frame]{flex:none;min-height:0;height:clamp(320px,calc(100vh - 240px),620px);height:clamp(320px,calc(100svh - 240px),620px)}
    .k24-call-room .chat_head{padding:12px;gap:8px}
    .k24-call-room .chat_head_side{gap:8px;flex:1}
    .k24-call-room .k24-room-profile{gap:8px}
    .k24-call-room .chat_session_info{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 12px;align-items:center;text-align:left;padding-bottom:12px;margin-bottom:12px}
    .k24-call-room .chat_session_info p:nth-child(2){grid-column:2;grid-row:1 / 3;font-size:32px}
    .k24-call-room .chat_session_info p:nth-child(3){grid-column:1}
    .k24-call-room .table_chat_session{margin:12px 0 16px;table-layout:fixed}
    .k24-call-room .table_chat_session td{overflow-wrap:anywhere}
}
/* The footer wave extends 50px above the footer. Reserve that height as well
   as a 24px gap, in active and ended rooms, so it cannot cover the last card. */
@media(max-width:1000px){
    section.k24-room{padding-bottom:74px!important}
    section.k24-room+footer{padding-top:40px}
}
@media(max-width:800px){
    /* Account header is 64px high; leave room for it and the WP admin bar. */
    section.k24-call-room:first-of-type{padding-top:calc(76px + var(--wp-admin--admin-bar--height,0px))}
    section.k24-call-room>.container{width:100%}
    .k24-call-room .chat_block{border-left:0;border-right:0;border-radius:0}
    .k24-call-room .chat_info_block{width:calc(100% - 24px);margin:0 12px}
    .k24-call-room .besplatno_info{padding:8px 12px;gap:8px;font-size:12px}
    .k24-call-room .besplatno_info>p{flex-shrink:0}
    .k24-call-room .k24-paid-notice,.k24-call-room .k24-low-balance{padding:8px 12px;font-size:14px}
}
@media(max-width:1000px) and (max-height:500px){
    .k24-call-room [data-daily-frame]{height:320px;height:max(260px,calc(100svh - 100px))}
}
.expert_buttons button[data-start-consultation] {
    border: 0;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

.expert_buttons button[data-start-consultation]:disabled {
    background: #CCCBD5;
    color: #fff;
    cursor: default;
    opacity: 1;
}

.k24-audio-initial.k24-audio-photo{background-color:#E9E7EF;background-size:cover;background-position:center;width:96px;height:96px;box-shadow:0 0 0 3px rgba(255,255,255,.85)}
@media(max-width:800px){.k24-audio-initial.k24-audio-photo{width:72px;height:72px}}
