@font-face { font-family:"Cabinet Roboto"; src:url("/assets/site/fonts/roboto.woff2") format("woff2"); font-weight:400 700; font-style:normal; font-display:swap; }
:root { --chat-font-family:"Cabinet Roboto",system-ui,sans-serif; --chat-font-size:17px; --chat-line-height:22px; --chat-font-weight:400; --chat-meta-size:12px; --chat-text:#171b19; --chat-outgoing-text:#171b19; --chat-bg:#f7f7f8; --chat-outgoing-bg:#d2ecdc; --chat-incoming-bg:transparent; --chat-muted:#505b54; --chat-accent:#53b559; --chat-composer-bg:#fff; --chat-radius:16px; --chat-pad-y:6px; --chat-pad-x:10px; --chat-message-gap:14px; --chat-wallpaper-image:none; --chat-wallpaper-size:320px; --cabinet-content-width:728px; }
:root{--green:#27724c;--green2:#e7f4ec;--danger:#b42318;--danger2:#fef3f2;--warn:#8a641c;--shadow:0 12px 34px rgba(31,41,55,.12);}*{box-sizing:border-box;}html,body{height:100%;}body{margin:0;font:16px/1.42 "Cabinet Roboto",system-ui,sans-serif;color:var(--ink);background:var(--bg);}button,input,select,textarea{font:inherit;}button,.btn,.button-link{border:0;border-radius:11px;background:var(--accent);color:#fff;padding:10px 14px;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:6px;}.secondary{background:var(--accent2);color:var(--accent);}.ghost{background:transparent;color:var(--accent);border:1px solid transparent;}.danger{background:var(--danger);color:#fff;}.hidden{display:none!important;}.muted{color:var(--muted);}.error{color:var(--danger);min-height:20px;}.login-screen{min-height:100%;display:grid;place-items:center;padding:20px;}.login-card{width:min(430px,100%);background:#fff;border:1px solid var(--line);border-radius:20px;padding:24px;box-shadow:var(--shadow);}.login-card h1{margin:0 0 5px;}.login-card form,.settings-card form{display:grid;gap:12px;}.login-card label,.settings-card label{display:grid;gap:6px;font-weight:500;}.login-card input,.settings-card input,.settings-card select,.settings-card textarea,.side-primary select,.composer textarea{width:100%;border:1px solid var(--line);border-radius:12px;padding:10px 12px;background:#fff;color:var(--ink);outline:none;}.login-legal{display:flex;gap:12px;flex-wrap:wrap;margin-top:15px;}.login-legal a{color:var(--accent);}.app{height:100dvh;display:grid;grid-template-rows:58px minmax(0,1fr);}.topbar{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;padding:7px 12px;background:#fff;border-bottom:1px solid var(--line);z-index:35;}.topbrand{display:flex;align-items:center;gap:10px;min-width:0;}.topbrand>div{display:grid;min-width:0;}.topbrand strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.role{font-size:12px;color:var(--muted);}.brand-logo{width:40px;height:40px;object-fit:contain;border-radius:10px;}.app-menu{position:relative;justify-self:end;}.app-menu:not([open])>.top-actions{display:none;}.app-menu>summary{list-style:none;width:40px;height:40px;padding:9px;cursor:pointer;}.app-menu>summary::-webkit-details-marker{display:none;}.app-menu>summary::marker{content:"";}.app-menu>summary svg{width:22px;height:22px;fill:currentColor;stroke:none;}.top-actions{position:absolute;right:0;top:calc(100% + 5px);z-index:1;display:flex;flex-direction:column;gap:2px;min-width:220px;max-width:calc(100vw - 24px);padding:6px;border-radius:12px;background:var(--card);box-shadow:var(--shadow);}.top-actions .nav-btn{width:100%;justify-content:flex-start;text-align:left;white-space:nowrap;background:transparent;color:var(--ink);border:0;padding:10px 12px;border-radius:8px;}
.top-actions .nav-btn:hover:not(:disabled){background:var(--control-hover);}.nav-icon{display:block;width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:0 0 auto;}.layout{min-height:0;display:grid;grid-template-columns:340px minmax(0,1fr);background:#fff;}.sidebar{min-height:0;border-right:1px solid var(--line);display:grid;grid-template-rows:auto minmax(0,1fr);background:#fff;}.side-tools{padding:10px;border-bottom:1px solid var(--line);}.side-primary{gap:7px;}.filters{display:flex;gap:5px;flex-wrap:wrap;margin-top:8px;}.filter{padding:6px 9px;border-radius:9px;background:#f7f8fa;color:var(--muted);font-size:12px;}.filter.active{background:var(--accent2);color:var(--accent);}.dialogs{overflow:auto;padding:4px;}.dialog{display:block;width:100%;text-align:left;background:transparent;color:var(--ink);border:0;border-radius:12px;padding:10px 11px;margin:1px 0;}.dialog:hover,.dialog.active{background:#f2f5f8;}.dialog-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.badge{min-width:22px;height:22px;border-radius:12px;background:var(--accent);color:#fff;display:grid;place-items:center;font-size:11px;}.dialog-preview{color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:12px;}.dialog-meta{display:flex;gap:8px;justify-content:space-between;color:var(--muted);font-size:11px;margin-top:4px;}.workspace{min-width:0;min-height:0;position:relative;background:#fff;}.placeholder{height:100%;display:grid;place-items:center;color:var(--muted);}.dialog-view{height:100%;min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr) auto;}.dialog-head{position:relative;border-bottom:1px solid var(--line);background:#fff;}.dialog-head-main{min-height:58px;padding:8px 12px;display:flex;align-items:center;gap:9px;}.back{display:none;}.dialog-identity{min-width:0;flex:1;}.dialog-head h2{font-size:18px;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}.route{font-size:12px;color:var(--muted);margin-top:2px;}.dialog-menu-btn{font-size:22px;padding:8px 12px;}.dialog-details{border-top:1px solid var(--line);padding:10px 12px;display:grid;gap:8px;}.client-card{display:flex;gap:7px 14px;flex-wrap:wrap;color:var(--muted);font-size:12px;}.client-card strong{color:var(--ink);}.dialog-actions button{font-size:12px;}.messages-pane{position:relative;min-width:0;min-height:0;}.messages{height:100%;min-width:0;overflow:auto;padding:18px;background:var(--bg);background-image:var(--chat-wallpaper-image);background-size:var(--chat-wallpaper-size) auto;background-repeat:repeat;}.message{--message-fill:var(--chat-incoming-bg);font-family:var(--chat-font-family);color:var(--chat-text);width:fit-content;max-width:min(720px,88%);margin:9px 0;padding:11px 13px;border-radius:var(--message-radius);background:var(--message-fill);border:0;}.message.inbound{border-top-left-radius:0;}.message.outbound{--message-fill:var(--chat-outgoing-bg);margin-left:auto;color:var(--chat-outgoing-text);background:var(--message-fill);border-bottom-right-radius:0;}.message.system{margin-left:auto;margin-right:auto;background:#f7f8fa;color:var(--muted);font-size:13px;}.message-text{--font-base:var(--chat-font-size);font-size:var(--chat-font-size);font-weight:var(--chat-font-weight);line-height:var(--chat-line-height);white-space:pre-wrap;word-break:break-word;}.message-meta{display:flex;gap:7px;justify-content:flex-end;align-items:center;color:var(--muted);font-size:11px;margin-top:6px;}.delivery.failed{color:var(--danger);}.delivery.pending{color:var(--warn);}.media{min-width:0;max-width:100%;margin-top:8px;}.media img,.media video{display:block;max-width:100%;max-height:440px;border-radius:12px;background:#000;}.media audio{display:block;width:min(420px,100%);max-width:100%;min-width:0;}.file-link{display:inline-flex;max-width:100%;min-width:0;overflow-wrap:anywhere;word-break:break-word;align-items:center;gap:7px;padding:8px 10px;border:1px solid var(--line);border-radius:10px;background:#fff;color:var(--accent);text-decoration:none;}.retry-btn{margin-top:7px;padding:6px 9px;font-size:12px;}.composer{padding:8px 10px max(8px,env(safe-area-inset-bottom));border-top:0;background:var(--bg);}.compose-row{display:flex;align-items:center;gap:7px;}.compose-main{border:1px solid var(--line);display:flex;flex-direction:column;overflow:hidden;gap:4px;flex:1;min-width:0;background:var(--chat-composer-bg);border-radius:23px;padding:4px 6px;}
.compose-input-row{display:flex;align-items:flex-end;gap:4px;width:100%;min-width:0;}.compose-input-row>#attachFile{order:1;flex:none;}.composer textarea{order:2;flex:1;min-width:0;width:auto;min-height:36px;max-height:252px;resize:none;line-height:24px;border:0;border-radius:16px;background:transparent;box-shadow:none;}.composer textarea:focus{outline:0;box-shadow:none;}.compose-actions{order:3;display:flex;position:static;align-items:center;flex-wrap:nowrap;flex:none;gap:1px;margin:0;}.attach-btn,.record-btn{padding:6px 8px;font-size:18px;}.file-name{font-size:11px;color:var(--muted);max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.send-btn{width:44px;height:44px;padding:0;border-radius:50%;font-size:18px;}.composer-note{padding:7px 10px;border-radius:10px;background:#faf3dc;color:#765a18;margin-bottom:6px;}.notice{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);width:min(520px,calc(100% - 28px));background:#20262e;color:#fff;padding:11px 15px;border-radius:12px;box-shadow:var(--shadow);z-index:60;text-align:center;pointer-events:none;}.notice.notice-success{background:#245f43;}.notice.notice-error{background:#8f2f2a;}.settings-page{overflow:auto;background:var(--bg);}.settings-grid{display:grid;grid-template-columns:1fr;gap:14px;}.settings-card{background:#fff;border:1px solid var(--line);border-radius:17px;margin-bottom:14px;}.settings-card h2{margin:0 0 13px;font-size:18px;}.subform{margin-top:14px;}.form-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;}.inline-actions,.staff-controls,.channel-controls{display:flex;gap:7px;flex-wrap:wrap;align-items:center;}.settings-row{display:grid;gap:10px;align-items:center;padding:10px 0;border-top:1px solid var(--line);}.channel-check-status{font-size:12px;line-height:1.35;}.channel-check-status.ok{color:var(--green);}.channel-check-status.error{color:var(--danger);}.metric-grid{display:grid;gap:7px;}.metric{padding:10px;border:1px solid var(--line);border-radius:12px;display:grid;}.metric strong{font-size:20px;}.settings-card pre{white-space:pre-wrap;word-break:break-word;background:#f4f6f8;border-radius:12px;padding:12px;}.owner-label{font-weight:600;}.recorder-backdrop{position:fixed;inset:0;background:rgba(17,24,39,.58);display:grid;place-items:center;padding:18px;z-index:40;}.recorder-card{width:min(470px,100%);max-height:calc(100dvh - 36px);overflow:auto;background:#fff;border-radius:18px;padding:18px;box-shadow:0 18px 50px rgba(23,33,43,.24);}.recorder-head{display:flex;align-items:center;justify-content:space-between;}.recorder-head h3{margin:0;}.record-stage{margin-top:15px;border:1px solid var(--line);border-radius:16px;padding:14px;text-align:center;background:#f8fafc;}.record-preview{width:100%;max-height:360px;border-radius:12px;background:#111;}.record-audio{width:100%;margin-top:10px;}.record-status{font-size:17px;font-weight:600;margin-top:10px;}.recorder-actions{display:flex;gap:7px;justify-content:center;flex-wrap:wrap;margin-top:13px;}
@media(max-width:900px){.topbar{grid-template-columns:minmax(0,1fr) auto;}.settings-grid{grid-template-columns:1fr;}.form-grid{grid-template-columns:repeat(2,minmax(0,1fr));}.layout{grid-template-columns:310px minmax(0,1fr);}}
@media(max-width:720px){.app{grid-template-rows:50px minmax(0,1fr);}.topbar{padding:4px 6px;gap:3px;}.brand-logo{width:34px;height:34px;}.role{display:none;}.top-actions{gap:2px;}.top-actions .nav-label{display:inline;}.top-actions .nav-icon{display:block;}.top-actions .nav-btn.active{box-shadow:inset 0 -2px 0 var(--accent);}.layout{grid-template-columns:1fr;}.sidebar{border-right:0;}.filters{overflow-x:auto;flex-wrap:nowrap;padding-bottom:2px;}.filter{flex:0 0 auto;}.workspace{position:fixed;inset:50px 0 0;z-index:10;}.workspace.mobile-hidden{display:none;}.back{display:inline-flex;}.dialog-head-main{min-height:50px;padding:5px 7px;}.dialog-head h2{font-size:15px;}.dialog-details{display:none;position:absolute;top:50px;left:7px;right:7px;max-height:62dvh;overflow:auto;border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow);z-index:14;}.dialog-head.details-open .dialog-details{display:grid;}.messages{padding:7px;}.message{max-width:96%;margin:4px 0;padding:8px 10px;}.composer{padding:6px;}.form-grid{grid-template-columns:1fr;}.settings-row{grid-template-columns:1fr;}}

/* Компактная геометрия кабинета диалогов. Цвета и базовые компоненты выше остаются из stable. */
.side-secondary{margin-top:7px;}.side-secondary select{width:100%;border:1px solid var(--line);border-radius:12px;padding:10px 12px;background:#fff;color:var(--ink);outline:none;}
@media(min-width:721px){

  .layout{grid-template-columns:300px minmax(0,1fr);}
  .side-tools{padding:9px 10px;}.side-primary{grid-template-columns:minmax(0,1fr) 116px;gap:7px;}.side-secondary{margin-top:7px;}
  .dialogs{padding:4px 6px 8px;}.dialog{padding:9px 10px;}.dialog-meta{margin-top:3px;}
  .dialog-head-main{min-height:56px;padding:6px 9px;}.dialog-head h2{font-size:16px;}
  .dialog-details{display:none;position:absolute;top:52px;right:9px;max-height:min(68dvh,600px);overflow:auto;padding:12px;background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow);z-index:14;}
  .dialog-head.details-open .dialog-details{display:grid;}.client-card{gap:8px;}.dialog-actions{gap:6px;}
  .messages{padding:10px 12px;overscroll-behavior:contain;}.message{margin:5px 0;padding:9px 11px;}.message-meta{margin-top:4px;}
  .composer{padding:7px 9px max(7px,env(safe-area-inset-bottom));}.compose-row{align-items:center;gap:5px;}.composer textarea{order:2;flex:1;min-width:0;width:auto;height:auto;min-height:36px;overflow-y:hidden;resize:none;padding:6px 8px;}.attach-btn,.record-btn{width:40px;height:40px;padding:0;}.send-btn{width:42px;height:42px;}
}
@media(min-width:721px) and (max-width:var(--cabinet-content-width)){.layout{grid-template-columns:280px minmax(0,1fr);}}
@media(max-width:720px){
  .side-tools{padding:7px 8px;}.side-primary{gap:6px;}.side-secondary{margin-top:6px;}.side-secondary select{height:38px;padding:8px 10px;}
  .dialogs{padding:3px 5px 8px;}.dialog{padding:9px 10px;}.dialog-meta{margin-top:3px;}
  .compose-row{align-items:center;gap:4px;}.composer textarea{order:2;flex:1;min-width:0;width:auto;height:auto;min-height:36px;overflow-y:hidden;resize:none;padding:6px 8px;}.attach-btn,.record-btn{width:38px;height:38px;padding:0;}.send-btn{width:40px;height:40px;}
}
@media(max-width:380px){.side-primary{grid-template-columns:minmax(0,1fr) 104px;}.attach-btn,.record-btn{width:34px;}}
.brand-color-toggle{display:flex!important;grid-template-columns:none!important;align-items:center;gap:8px;}.brand-color-toggle input{width:auto!important;margin:0;}

/* Solo-режим: первый запуск и простые настройки одного владельца. */
.setup-page{min-height:0;overflow:auto;background:var(--bg);padding:24px;display:grid;place-items:center;}.setup-shell{width:min(680px,100%);background:#fff;border:1px solid var(--line);border-radius:20px;padding:26px;box-shadow:var(--shadow);}.setup-kicker{font-size:12px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);}.setup-shell h1{margin:5px 0 7px;font-size:28px;}.setup-lead{margin:0 0 20px;max-width:580px;}.setup-form{display:grid;gap:13px;}.setup-form label{display:grid;gap:6px;font-weight:500;}.setup-form input,.setup-form select{width:100%;border:1px solid var(--line);border-radius:12px;padding:11px 12px;background:#fff;color:var(--ink);outline:none;}.setup-channel-grid{display:grid;grid-template-columns:180px minmax(0,1fr);gap:10px;}.setup-foot{margin:14px 0 0;}.advanced-settings{margin-top:4px;}.advanced-settings>h2{margin:0 0 14px;font-size:18px;}.settings-row{grid-template-columns:minmax(0,1fr) auto;}.metric-grid{grid-template-columns:repeat(3,1fr);}
@media(max-width:720px){.setup-page{padding:10px;place-items:start center;}.setup-shell{padding:18px;border-radius:16px;}.setup-shell h1{font-size:23px;}.setup-channel-grid{grid-template-columns:1fr;}.advanced-settings>h2{font-size:17px;}.metric-grid{grid-template-columns:repeat(2,1fr);}}

/* r10: мастер первого запуска с несколькими каналами. */
.setup-channels{border:0;padding:0;margin:0;display:grid;gap:10px;}.setup-channels legend{font-weight:600;margin-bottom:7px;}.setup-channel-card{border:1px solid var(--line);border-radius:14px;padding:13px;background:#fff;display:grid;gap:9px;}.setup-channel-head{display:flex!important;grid-template-columns:none!important;align-items:center;gap:9px;font-size:16px;font-weight:600;}.setup-channel-head input{width:auto!important;margin:0;}.setup-token-label{font-size:13px;}.setup-channel-card input:disabled{background:#f5f6f7;color:var(--muted);}.setup-channel-status{min-height:18px;font-size:12px;line-height:1.35;}.setup-channel-status.ok{color:var(--green);}.setup-channel-status.error{color:var(--danger);}

/* r11: меню обращения содержит только действия; счёт выставляется из диалога. */
.dialog-details{background:#fff;}.dialog-actions{grid-template-columns:1fr;}.invoice-backdrop{position:fixed;inset:0;background:rgba(17,24,39,.58);display:grid;place-items:center;padding:18px;z-index:45;}.invoice-card{width:min(470px,100%);max-height:calc(100dvh - 36px);overflow:auto;background:#fff;border-radius:18px;padding:18px;box-shadow:0 18px 50px rgba(23,33,43,.24);}.invoice-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;}.invoice-head h3{margin:0 0 3px;font-size:20px;}.invoice-field{display:grid;gap:6px;margin-top:14px;font-weight:500;}.invoice-field input,.invoice-field select{width:100%;border:1px solid var(--line);border-radius:12px;padding:10px 12px;background:#fff;color:var(--ink);}.price-box,.invoice-last{margin-top:12px;padding:11px 12px;border:1px solid var(--line);border-radius:12px;background:#f8fafc;}.invoice-actions-row{display:flex;gap:7px;flex-wrap:wrap;margin-top:13px;}.invoice-active .invoice-actions-row .btn{flex:1 1 auto;}@media(min-width:721px){.dialog-details{width:min(300px,calc(100% - 18px));}}

#bookingView{--soft:var(--bg);--border:var(--line);--accent-soft:#ededeb;--work:#e8f1e8;--work-border:#b8cfb9;--booking:#f4f0df;--booking-border:#d8ca95;--selected:#d2d2ce;--danger:#a33131;--ok:#39704a;--warn:#8a641f;--shadow:0 2px 10px rgba(0,0,0,.045);}
#bookingView *{box-sizing:border-box;}#bookingView{color:var(--text);font-family:"Cabinet Roboto",system-ui,sans-serif;}#bookingView{margin:0;}#bookingView button,#bookingView input,#bookingView select,#bookingView textarea{font:inherit;}#bookingView button{color:var(--text);}#bookingView .hidden{display:none!important;}
#bookingView .wrap{width:min(1080px,100%);margin:0 auto;padding:18px 18px 155px;}#bookingView .card{border:1px solid var(--border-soft);padding:16px;}#bookingView h1{font-size:24px;margin:4px 0 4px;}#bookingView h2{font-size:19px;margin:0 0 14px;}#bookingView .muted{color:var(--muted);}#bookingView .small{font-size:13px;}#bookingView .back{color:#555;text-decoration:none;}#bookingView .head-card{display:flex;justify-content:space-between;gap:18px;align-items:center;margin-bottom:14px;}#bookingView .login-card{display:grid;gap:12px;max-width:430px;margin:10vh auto 0;}
#bookingView .button{appearance:none;border:1px solid var(--accent);border-radius:9px;min-height:40px;padding:8px 13px;background:var(--accent);color:#fff;font-weight:500;cursor:pointer;}#bookingView .button.secondary{background:#fff;color:#333;border-color:#cfcfca;}#bookingView .button.danger{background:#fff;color:var(--danger);border-color:#ddb3b3;}#bookingView .button.ok{background:#fff;color:var(--ok);border-color:#b7d1be;}#bookingView .button.warn{background:#fff;color:var(--warn);border-color:#ddca9e;}#bookingView .button:disabled{opacity:.45;cursor:not-allowed;}#bookingView .field{display:grid;gap:5px;margin:10px 0;}#bookingView .field label{font-size:13px;color:var(--muted);font-weight:500;}#bookingView .field input,#bookingView .field select,#bookingView textarea,#bookingView .calendar-toolbar input{width:100%;min-height:40px;border:1px solid var(--border);border-radius:9px;background:#fff;padding:8px 10px;outline:0;}#bookingView textarea{resize:vertical;}#bookingView .notice{border:1px solid #ddd;border-radius:10px;padding:10px;}#bookingView .notice.error{color:#8f2929;background:#fff2f2;border-color:#e3b3b3;}
#bookingView .tabs{display:flex;overflow:auto;margin-bottom:4px;}#bookingView .tabs button{white-space:nowrap;cursor:pointer;}#bookingView .tabs button.active{border-color:#292929;}#bookingView .calendar-toolbar-card{padding:0;margin-bottom:15px;}#bookingView .calendar-toolbar{display:grid;gap:8px;align-items:center;}
#bookingView .days{display:grid;}#bookingView .day{background:transparent;}#bookingView .day-title{font-size:17px;font-weight:600;margin:0 0 9px;}#bookingView .today-label{font-size:14px;color:var(--muted);font-weight:600;margin-left:6px;}#bookingView .slots{display:grid;}#bookingView .slot{appearance:none;border:1px solid var(--border);min-height:40px;border-radius:9px;background:#fff;color:var(--text);font-weight:500;cursor:pointer;display:grid;place-items:center;}#bookingView .slot.available{background:var(--work);border-color:var(--work-border);}#bookingView .slot.unavailable{background:#fff;}#bookingView .slot-time{font-size:14px;}#bookingView .empty-day{grid-column:1/-1;background:var(--soft);border:1px solid var(--border-soft);border-radius:10px;padding:11px;color:var(--muted);text-align:center;}
#bookingView .booking-card{grid-column:1/-1;border:1px solid var(--booking-border);border-radius:11px;background:var(--booking);padding:11px 100px 11px 13px;display:grid;gap:5px;position:relative;cursor:pointer;}#bookingView .booking-card.selected{box-shadow:0 0 0 2px #8d8050 inset;}#bookingView .booking-card.terminal{background:#f7f7f5;border-color:var(--border);}#bookingView .booking-status{font-size:13px;font-weight:500;color:#666;}#bookingView .booking-status.paid{color:var(--ok);}#bookingView .booking-status.unpaid{color:var(--danger);}#bookingView .booking-toggle{border:0;background:transparent;font-size:17px;cursor:pointer;color:#555;}#bookingView .booking-time,#bookingView .booking-name{font-weight:600;}#bookingView .booking-meta{font-size:13px;color:#555;display:grid;gap:2px;}#bookingView .booking-details{display:none;border-top:1px solid rgba(0,0,0,.08);padding-top:7px;font-size:13px;}#bookingView .booking-card.expanded .booking-details{display:grid;gap:4px;}#bookingView .detail-row{display:grid;grid-template-columns:120px minmax(0,1fr);gap:8px;}#bookingView .detail-row span:first-child{color:var(--muted);}
#bookingView .actions{position:fixed;left:0;right:0;bottom:0;z-index:15;padding:10px 12px calc(10px + env(safe-area-inset-bottom,0));background:rgba(255,255,255,.96);backdrop-filter:blur(12px);border-top:1px solid var(--border-soft);box-shadow:0 -7px 24px rgba(0,0,0,.06);display:grid;gap:8px;}#bookingView .selected-text{width:min(1080px,100%);margin:auto;color:#555;font-size:14px;}#bookingView .actions-row{gap:7px;margin:auto;}#bookingView .booking-actions{justify-content:center;}
#bookingView .grid2{display:grid;grid-template-columns:1fr 1fr;gap:16px;}#bookingView .inline-fields{display:grid;grid-template-columns:1fr 1fr;gap:12px;}#bookingView .check-line{display:flex;gap:8px;align-items:center;margin:13px 0;}#bookingView .check-line input{width:auto;}#bookingView .service-row{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:10px 0;border-bottom:1px solid var(--border-soft);}#bookingView .service-row:last-child{border-bottom:0;}#bookingView .service-row .meta{font-size:13px;color:var(--muted);margin-top:3px;}#bookingView hr{border:0;border-top:1px solid var(--border-soft);margin:18px 0;}
#bookingView .modal-backdrop{position:fixed;inset:0;z-index:30;background:rgba(0,0,0,.32);display:grid;place-items:center;padding:18px;}#bookingView .modal{width:min(480px,100%);max-height:calc(100vh - 36px);overflow:auto;background:#fff;border:1px solid var(--border-soft);border-radius:16px;padding:18px;box-shadow:0 18px 50px rgba(0,0,0,.18);}#bookingView .modal-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px;}#bookingView .duration-buttons{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;}#bookingView .duration-btn{min-height:42px;border:1px solid var(--border);border-radius:10px;background:#fff;font-weight:500;cursor:pointer;}#bookingView .duration-btn.selected{background:var(--accent-soft);border-color:#777;box-shadow:0 0 0 2px #888 inset;}#bookingView .duration-btn:disabled{opacity:.35;}#bookingView .price-box{padding:10px 12px;border-radius:10px;background:var(--soft);font-weight:500;margin-top:10px;}#bookingView .decision-text{white-space:pre-line;line-height:1.45;}#bookingView .toast{position:fixed;z-index:50;left:50%;bottom:120px;transform:translateX(-50%);width:min(430px,calc(100% - 24px));background:#292929;color:#fff;border-radius:11px;padding:11px 14px;text-align:center;}
@media(max-width:760px){#bookingView .wrap{padding:12px 10px 150px;}#bookingView .head-card{align-items:flex-start;}#bookingView .grid2,#bookingView .inline-fields{grid-template-columns:1fr;}#bookingView .slots{gap:5px;}#bookingView .actions-row{display:grid;grid-template-columns:1fr 1fr;}#bookingView .calendar-toolbar{grid-template-columns:1fr auto;}#bookingView .detail-row{grid-template-columns:105px 1fr;}}
@media(max-width:390px){#bookingView .slots{grid-template-columns:repeat(4,minmax(0,1fr));}}


/* Встроенный модуль услуг и записи и модульные настройки. */
.booking-module{min-height:0;overflow:auto;background:var(--bg);padding:18px;}.booking-root{width:100%;padding-bottom:150px;}.booking-view-head{margin:0 0 12px;}.booking-view-head h1{margin:0 0 3px;font-size:22px;}.module-card{overflow:hidden;}.module-head{display:flex;justify-content:space-between;gap:14px;margin:-2px 0 0;}.module-switch{display:flex!important;grid-template-columns:auto minmax(0,1fr)!important;align-items:center;gap:11px;flex:1;}.module-switch input{width:19px!important;height:19px;margin:0;}.module-switch span{display:grid;gap:2px;}.module-switch small{color:var(--muted);font-weight:500;}.module-switch.static{cursor:default;}.module-core-mark{width:21px;height:21px;border-radius:7px;background:var(--green2);color:var(--green);display:grid!important;place-items:center!important;font-weight:600;}.module-state{font-weight:600;border-radius:999px;background:var(--accent2);color:var(--muted);white-space:nowrap;}.module-state.on{background:var(--green2);color:var(--green);}.module-body{border-top:1px solid var(--line);margin-top:14px;padding-top:14px;}.module-body>button{margin-top:10px;}
@media(max-width:720px){.booking-module{padding:9px;}.module-head{align-items:flex-start;}.module-state{margin-top:2px;}}
.settings-divider{border:0;border-top:1px solid var(--line);margin:20px 0;}


/* r22: компактная рабочая страница «Записи». */
.top-actions .nav-btn.active{color:var(--ink);box-shadow:none;}
#bookingView .tabs{justify-content:center;gap:4px;padding:0 0 12px;margin:0 auto 4px;}
#bookingView .tabs button{border:0;background:transparent;border-radius:9px;padding:8px 11px;color:var(--muted);}
#bookingView .tabs button:hover{background:#f7f8fa;color:var(--ink);}
#bookingView .tabs button.active{background:#f2f4f7;color:var(--ink);border:0;box-shadow:none;}
#bookingView .calendar-toolbar-card{width:min(560px,100%);margin:0 0 15px;}
#bookingView .calendar-toolbar{grid-template-columns:minmax(150px,210px) auto;justify-content:start;}
#bookingView .days{width:100%;margin:0;gap:21px;}
#bookingView .day-title{text-align:left;}
#bookingView .slots{grid-template-columns:repeat(auto-fit,minmax(min(82px,100%),1fr));justify-content:start;gap:7px;}
#bookingView .booking-card{width:min(520px,100%);justify-self:center;}
#bookingView .empty-day{width:min(520px,100%);justify-self:center;}
#bookingView .actions-row{display:flex;grid-template-columns:none;flex-wrap:nowrap;justify-content:center;overflow-x:auto;width:min(760px,100%);padding:1px 0;}
#bookingView .actions-row>.button,#bookingView .actions-row>button{flex:0 0 auto;white-space:nowrap;}
@media(max-width:560px){
  #bookingView .slots{grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;}
  #bookingView .booking-card,#bookingView .empty-day{width:100%;}
  #bookingView .actions-row{display:flex;grid-template-columns:none;flex-wrap:nowrap;justify-content:flex-start;overflow-x:auto;}
}
@media(max-width:390px){#bookingView .actions-row{display:flex;grid-template-columns:none;flex-wrap:nowrap;}}

/* r23: единая типографика, компактные настройки и карточки каналов. */
:root{--font-base:16px;--font-title:16px;}
body,button,input,select,textarea{font-size:var(--font-base);}
h1,h2,h3,.dialog-head h2,.settings-card h2,.booking-view-head h1,.module-switch strong,.metric strong,.record-status,.recorder-head h3,.invoice-head h3{font-size:var(--font-title);line-height:1.35;}
.role,.filter,.dialog-preview,.dialog-meta,.badge,.route,.client-card,.dialog-actions button,.message.system,.message-meta,.retry-btn,.file-name,.channel-check-status,.module-switch small,.module-state,.booking-root,.booking-root button,.booking-root input,.booking-root select,.booking-root textarea,.booking-root label,.booking-root .muted,.booking-root .day-title,.booking-root .slot,.booking-root .booking-card,.booking-root .selected-text,.booking-root .price-box{font-size:var(--font-base);}
.dialog-menu-btn,.attach-btn,.record-btn,.send-btn{font-size:var(--font-title);}
.login-card h1,.dialog-title,.owner-label,.topbrand strong,.settings-card h2,.module-switch strong,.booking-root h1,.booking-root h2,.booking-root h3{font-weight:600;}

.settings-page{padding:18px 12px;}
.settings-grid,.advanced-settings{width:min(580px,100%);margin-left:auto;margin-right:auto;}
.settings-grid{margin-bottom:14px;}
.advanced-settings>.settings-card{width:100%;}
.settings-page .form-grid{grid-template-columns:1fr;}
.settings-card{padding:15px;}
.settings-card h2{margin-bottom:11px;}
.module-head{align-items:flex-start;}
.module-switch strong{font-size:var(--font-title);}
.module-switch small{font-size:var(--font-base);}
.module-state{font-size:var(--font-base);padding:4px 7px;}

.channel-list{display:grid;gap:8px;margin-top:10px;}
.channel-card{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center;padding:11px 12px;border:1px solid var(--line);border-radius:12px;background:#fff;}
.channel-card-info{min-width:0;display:grid;gap:2px;}
.channel-card-info strong{font-weight:600;}
.channel-card-info .muted{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.channel-controls{display:flex;gap:5px;align-items:center;justify-content:flex-end;flex-wrap:nowrap;}
.channel-action{border-radius:9px;white-space:nowrap;}
.channel-action svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:0 0 auto;}
.channel-action-label{font-weight:500;}
.channel-check-status{min-height:0;margin-top:1px;}

.channel-config-form form{display:grid;gap:12px;}
.channel-config-form label{display:grid;gap:6px;font-weight:500;}
.channel-config-form input{width:100%;border:1px solid var(--line);border-radius:12px;padding:10px 12px;background:#fff;color:var(--ink);outline:none;}
.icon-only{width:36px;height:36px;padding:0;}

@media(max-width:720px){
  .settings-page{padding:9px 7px;}
  .settings-grid,.advanced-settings{width:100%;}
  .settings-card{padding:13px;}
  .topbrand strong{font-size:var(--font-base);}
  .channel-card{grid-template-columns:minmax(0,1fr) auto;padding:10px;gap:7px;}
  .channel-controls{gap:3px;}
  .channel-action{width:36px;height:36px;min-height:36px;padding:0;}
  .channel-action-label{display:none;}
  .channel-action svg{width:18px;height:18px;}
  .channel-card-info .muted{white-space:normal;line-height:1.25;}
}
/* r23: текстовые элементы кабинета используют только базовый и заголовочный размер. */

body :where(h1,h2,h3),body .module-switch strong,body .record-status{font-size:var(--font-title);}
/* r23: окончательный приоритет типографики над унаследованными локальными размерами. */
body :where(p,span,div,label,a,button,input,select,textarea,summary,small,strong,pre){font-size:var(--font-base)!important;}
body :where(h1,h2,h3),body .module-switch strong,body .record-status,body .dialog-menu-btn,body .attach-btn,body .record-btn,body .send-btn{font-size:var(--font-title)!important;}

/* r24: единая иконографика навигации и действий каналов. */
.top-actions .nav-btn{gap:7px;}
.channel-action{width:36px;height:36px;min-height:36px;padding:0;display:inline-grid;place-items:center;}
.channel-action-label{display:none!important;}
.logo-upload{display:grid;gap:8px;justify-items:start;}
.logo-upload-button{width:auto;}
.logo-upload-button input{display:none!important;}


/* r25: спокойная типографика — 400 основной текст, 500 мягкий акцент, 600 только заголовки. */
body{font-weight:400;}
button,.btn,.button-link{font-weight:500;}
strong,b{font-weight:500;}
.login-card label,.settings-card label,.channel-config-form label{font-weight:400;}
.login-card h1,.dialog-head h2,.settings-card h2,.recorder-head h3,#bookingView h1,#bookingView h2,#bookingView h3{font-weight:600;}
.topbrand strong,.dialog-title,.owner-label,.module-switch strong,.channel-card-info strong{font-weight:500;}
.top-actions .nav-btn{font-weight:400;}
.top-actions .nav-btn.active{font-weight:500;}
.filter{font-weight:400;}.filter.active{font-weight:500;}
.module-state,.record-status{font-weight:500;}
#bookingView .tabs button{font-weight:400;}
#bookingView .tabs button.active{font-weight:500;}
#bookingView .day-title,#bookingView .booking-time,#bookingView .booking-name,#bookingView .booking-status,#bookingView .duration-btn,#bookingView .price-box{font-weight:500;}
#bookingView .slot,#bookingView .booking-meta,#bookingView .booking-details{font-weight:400;}
.channel-action{font-weight:400;}


/* r26: чистый список обращений — имя и время в одной строке, без номера/категории/канала. */
.dialog{position:relative;}
.dialog.unread{background:#f7f9fb;}
.dialog.unread:hover,.dialog.unread.active{background:#f0f4f7;}
.dialog-row{display:flex;align-items:center;gap:8px;min-width:0;}
.dialog-title{min-width:0;flex:1;font-weight:500;}
.dialog-time-wrap{display:inline-flex;align-items:center;gap:6px;flex:0 0 auto;color:var(--muted);font-weight:400;}
.dialog-time{font-variant-numeric:tabular-nums;white-space:nowrap;}
.unread-dot{width:7px;height:7px;border-radius:50%;background:var(--accent);display:inline-block;flex:0 0 auto;}
.dialog-preview{margin-top:3px;font-weight:400;}


/* r27: компактный выбор слота и единая горизонтальная панель действий календаря. */

#bookingView .selected-text{text-align:center;}
#bookingView .actions-controls{display:flex;align-items:center;justify-content:center;gap:7px;width:min(760px,100%);margin:0 auto;overflow-x:auto;overflow-y:hidden;padding:1px 0;}
#bookingView .actions-controls .actions-row{display:flex;align-items:center;justify-content:center;gap:7px;flex:0 0 auto;width:auto;margin:0;padding:0;overflow:visible;flex-wrap:nowrap;}
#bookingView .actions-controls .actions-row>.button,#bookingView .actions-controls .actions-row>button{flex:0 0 auto;white-space:nowrap;}
@media(max-width:560px){#bookingView .actions-controls{justify-content:flex-start;}}


/* r29: дата один раз на день и полупрозрачный sticky-разделитель при прокрутке диалога. */
.message-day{position:relative;display:flex;justify-content:center;align-items:center;margin:8px 0;pointer-events:none;}
.message-day-label{display:inline-flex;align-items:center;justify-content:center;padding:4px 10px;border:1px solid rgba(223,227,232,.72);border-radius:999px;background:rgba(255,255,255,.78);color:var(--muted);font-weight:500;box-shadow:0 2px 8px rgba(31,41,55,.06);backdrop-filter:blur(7px);-webkit-backdrop-filter:blur(7px);}
.message-time{font-variant-numeric:tabular-nums;white-space:nowrap;}
@media(max-width:720px){.message-day{margin:6px 0;}.message-day-label{padding:3px 9px;}}

.archive-invoice-actions{display:grid;grid-template-columns:1fr;gap:8px;}.archive-invoice-actions .btn{width:100%;}

/* r39: четыре рабочих раздела и постоянные иконки действий обращения. */
.side-primary{display:block;grid-template-columns:none;}
.dialog-filters{margin-top:8px;overflow-x:auto;overflow-y:hidden;padding-bottom:2px;scrollbar-width:thin;}
.dialog-filter{flex:0 0 auto;border:0;background:transparent;color:var(--muted);border-radius:8px;padding:7px 9px;white-space:nowrap;font-weight:400;}
.dialog-filter:hover{background:#f7f8fa;color:var(--ink);}
.dialog-filter.active{background:var(--accent2);color:var(--accent);font-weight:500;}
.deleted-bulk{display:flex;align-items:center;gap:8px;margin-top:7px;padding-top:7px;border-top:1px solid var(--line);}
.deleted-select-all{display:flex;align-items:center;gap:6px;min-width:0;color:var(--muted);cursor:pointer;white-space:nowrap;}
.deleted-select-all input,.deleted-dialog-check{width:16px;height:16px;margin:0;accent-color:var(--accent);flex:0 0 auto;}
.deleted-selected-count{margin-left:auto;min-width:20px;text-align:right;color:var(--muted);font-variant-numeric:tabular-nums;}
.bulk-purge-btn,.dialog-action-icon{width:36px;height:36px;min-width:36px;padding:0;border-radius:9px;display:inline-grid;place-items:center;background:transparent;color:var(--accent);border:1px solid transparent;}
.bulk-purge-btn:hover,.dialog-action-icon:hover{background:var(--accent2);border-color:var(--line);}
.bulk-purge-btn:disabled,.dialog-action-icon:disabled{opacity:.38;cursor:default;}
.bulk-purge-btn svg,.dialog-action-icon svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;}
.bulk-purge-btn{color:var(--danger);}
.dialog-action-icon.danger{background:transparent;color:var(--danger);}
.dialog-action-icon.danger:hover{background:var(--danger2);border-color:#f4c7c3;}
.dialog-actions{display:flex;flex:0 0 auto;gap:2px;flex-wrap:nowrap;margin-left:auto;align-items:center;}
.dialog-actions button{width:36px;height:36px;padding:0;justify-content:center;}
.dialog-head-main{padding-right:8px;}
.dialog-row .deleted-dialog-check{margin-right:1px;}
@media(max-width:720px){
  .side-primary{display:block;grid-template-columns:none;}
  .dialog-filters{margin-top:6px;gap:2px;}
  .dialog-filter{padding:6px 8px;}
  .dialog-actions{gap:0;}
  .dialog-action-icon{width:34px;height:34px;min-width:34px;}
  .dialog-actions button{width:34px;height:34px;}
  .dialog-action-icon svg{width:18px;height:18px;}
  .dialog-head-main{gap:5px;padding-left:6px;padding-right:5px;}
}
.queue-indicator{width:100%;margin-top:7px;min-height:34px;padding:6px 9px;border:1px solid #e6d6a8;border-radius:9px;background:#fffaf0;color:#765a18;display:flex;align-items:center;justify-content:space-between;gap:8px;font-weight:400;}
.queue-indicator:hover{background:#fff5dc;}.queue-indicator strong{min-width:22px;height:22px;border-radius:999px;background:#f3e5bb;color:#765a18;display:grid;place-items:center;font-variant-numeric:tabular-nums;}
/* r39: все четыре категории видны одновременно в узкой колонке. */
.dialog-filters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));overflow:visible;gap:4px;}
.dialog-filter{width:100%;min-width:0;text-align:center;overflow:hidden;text-overflow:ellipsis;}
@media(max-width:720px){.dialog-filters{grid-template-columns:repeat(2,minmax(0,1fr));overflow:visible;}}
/* r40: пять рабочих фильтров; «Все» занимает отдельную строку. */
.dialog-filter-all{grid-column:1/-1;}
.dialog-section-title{padding:10px 10px 5px;color:var(--muted);font-size:12px;font-weight:600;text-transform:none;letter-spacing:0;}
.dialog-section-title:first-child{padding-top:4px;}
.finish-appeal-actions{display:flex;gap:8px;flex-wrap:wrap;}

/* r43: публичные документы — компактные карточки как у подключённых мессенджеров. */
.legal-document-card{align-items:start;}
.legal-version-list{grid-column:1/-1;display:grid;gap:6px;border-top:1px solid var(--line);padding-top:8px;margin-top:2px;}
.legal-version-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center;padding:7px 0;}
.legal-version-row+.legal-version-row{border-top:1px solid var(--line);}
.legal-version-info{min-width:0;display:grid;gap:2px;}
.legal-version-info>span:first-child{font-weight:500;}
.legal-version-info .muted{white-space:normal;line-height:1.25;}
@media(max-width:720px){.legal-version-row{grid-template-columns:minmax(0,1fr) auto;gap:5px;}.legal-version-list{padding-top:7px;}}

/* r44: управление приёмом находится непосредственно на странице обращений. */
.reception-strip{display:grid;gap:5px;margin:0 0 9px;padding:0;border:0;background:transparent;}
.reception-actions{display:flex;align-items:center;flex-wrap:wrap;gap:12px;}
.reception-status{display:inline-flex;align-items:center;gap:8px;color:var(--muted);}
.reception-state-btn{min-height:36px;padding:7px 12px;border:0;border-radius:9px;}
.reception-strip>.muted{display:block;text-align:left;line-height:1.25;font-size:12px;}


/* r50: модули включаются явными кнопками вместо чекбоксов. */
.module-controls{display:flex;align-items:center;gap:8px;flex:0 0 auto;}.module-toggle-btn{min-width:96px;border:1px solid var(--line);background:#fff;color:var(--ink);border-radius:9px;padding:7px 10px;cursor:pointer;}.module-toggle-btn.on{background:#fff;}.module-toggle-btn:disabled{opacity:.45;cursor:not-allowed;}.module-switch{cursor:default;}.module-switch>span{display:grid;gap:2px;}
@media(max-width:720px){.module-controls{flex-direction:column;align-items:flex-end;}.module-toggle-btn{min-width:92px;}}
.security-code{white-space:pre-wrap;min-height:0;margin:.65rem 0 0;font:inherit;background:transparent;border:0;padding:0;color:inherit;}

/* r53: список услуг в стиле карточек подключённых мессенджеров. */
#bookingView #bk-tab-services{width:100%;margin:0;}
#bookingView .service-list-card{margin:0;}
#bookingView .service-list-toolbar{display:flex;justify-content:flex-start;margin-bottom:10px;}
#bookingView .service-list-toolbar .button{width:auto;min-height:38px;padding:8px 12px;}
#bookingView .service-list{margin-top:0;}

#bookingView .service-card .channel-card-info .muted{white-space:normal;}
#bookingView .service-card .channel-action{width:36px;height:36px;min-height:36px;padding:0;}
#bookingView .service-card .channel-action.danger{background:var(--danger2);color:var(--danger);}
#bookingView .service-card .channel-action.danger:hover{background:#fde7e5;}
#bookingView .service-card .channel-action svg{width:18px;height:18px;}
#bookingView #bk-serviceModal h2{margin:0 0 13px;}
@media(max-width:720px){#bookingView #bk-tab-services{width:100%;}#bookingView .service-list-toolbar .button{width:100%;}}

/* r58: финансовый реестр */
.payments-page{overflow:auto;padding:18px;background:var(--bg);}
.payments-shell{width:min(1080px,100%);margin:0 auto;}
.payments-registry-card{margin-bottom:0;}
.payments-head h2{margin:0 0 4px;}
.payments-head p{margin:0 0 14px;}
.payments-toolbar{display:grid;grid-template-columns:minmax(0,1fr) 220px;gap:9px;margin-bottom:12px;}
.payments-toolbar select{width:100%;height:36px;border:1px solid var(--line);border-radius:12px;padding:6px 12px;background:#fff;color:var(--ink);}
.payments-list{display:grid;gap:8px;}
.payment-card{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:center;padding:12px;border:1px solid var(--line);border-radius:13px;background:#fff;}
.payment-card-info{min-width:0;display:grid;gap:3px;}
.payment-card-top{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.payment-card-top strong{font-weight:600;}
.payment-status{display:inline-flex;align-items:center;min-height:24px;padding:3px 8px;border-radius:999px;background:var(--accent2);color:var(--accent);font-size:12px;}
.payment-status.status-paid{background:var(--green2);color:var(--green);}
.payment-status.status-cancelled{background:var(--danger2);color:var(--danger);}
.payment-status.refund-partial{background:#faf3dc;color:#765a18;}
.payment-status.refund-refunded{background:#eef1f4;color:#475467;}
.payment-money{font-size:13px;}
.payment-meta{font-size:12px;}
.payment-card-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end;}
.payment-card-actions .btn{padding:7px 10px;font-size:12px;}
.payments-empty{padding:20px 4px;text-align:center;}
@media(max-width:720px){.payments-page{padding:10px;}.payments-toolbar{grid-template-columns:1fr;}.payment-card{grid-template-columns:1fr;}.payment-card-actions{justify-content:flex-start;}.payment-card-actions .btn{flex:1 1 auto;}}

/* r61: карточка записи — статус результата и финансовое состояние без наложения на данные. */
#bookingView .booking-card{padding-right:13px;}
#bookingView .booking-head{position:static;right:auto;top:auto;display:flex;justify-content:flex-end;align-items:center;gap:5px;flex-wrap:wrap;min-width:0;}
#bookingView .booking-status{max-width:100%;text-align:right;white-space:normal;}
#bookingView .booking-status.warn{color:#765a18;}
#bookingView .booking-status.refunded{color:#475467;}
@media(max-width:760px){#bookingView .booking-card{padding-right:13px;}}
@media(max-width:390px){#bookingView .booking-card{padding-right:13px;}}

/* Общий принцип разделов: навигация слева, рабочая область справа. */
.section-shell { display:grid; grid-template-columns:280px minmax(0,1fr); gap:0; align-items:start; min-height:calc(100dvh - 100px); }
.section-shell .section-sidebar { display:flex; flex-direction:column; align-items:stretch; gap:6px; padding:16px; border-right:1px solid var(--line); min-height:100%; background:var(--card); margin:0; }
.section-sidebar button { text-align:left; padding:12px 14px; border:0; border-radius:8px; color:var(--ink); background:transparent; }
.section-sidebar button.active { background:var(--accent2); font-weight:600; }
.section-content { min-width:0; padding:16px; }
.section-settings { padding:16px; min-width:0; }
.section-settings-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
#appealsSettingsPane { overflow:auto; height:100%;  }
#appealsSettingsPane .form-grid { margin-top:16px; }
#bookingView .booking-root.section-shell { max-width:none; padding:0; }
#paymentsView.payments-page { padding:0; }
#paymentsView .payments-shell.section-shell { width:100%; max-width:none; margin:0; }
#paymentsSettingsPane { display:grid; gap:16px; }
#paymentsSettingsPane.hidden { display:none; }
.reception-actions { flex-wrap:wrap; }
@media(max-width:720px){
 .section-shell { grid-template-columns:1fr; min-height:0; }
 .section-shell .section-sidebar { flex-direction:row; flex-wrap:wrap; min-height:0; padding:8px; border-right:0; border-bottom:1px solid var(--line); }
 .section-sidebar button { flex:1 1 auto; padding:10px; }
 .section-content,.section-settings { padding:10px; }
}

/* Общие настройки: список категорий и отдельная рабочая панель. */
#settingsView.settings-page { padding:0; }
.general-settings-shell { min-height:100%; }
.general-settings-nav h2 { margin:0 0 8px; font-size:18px; }
.general-settings-nav .settings-nav-label { color:var(--muted); font-size:12px; font-weight:600; padding:8px 12px; }
.general-settings-nav .settings-search { margin:0 0 4px; }

.general-settings-nav button[hidden] { display:none; }
.general-settings-content { padding:28px 24px; }
.general-settings-content>h1 { margin:0 auto 26px; max-width:820px; font-size:24px; }
.general-settings-content .settings-grid,.general-settings-content .advanced-settings { display:grid; grid-template-columns:1fr; width:100%; max-width:820px; gap:16px; margin:0 auto; }
.general-settings-content .advanced-settings { margin-top:16px; }
.general-settings-content .settings-card { border-radius:16px; box-shadow:none; }
.general-settings-content [data-settings-category][hidden],.general-settings-content [data-settings-category].hidden { display:none; }
@media(min-width:721px){.general-settings-nav { position:sticky; top:0; max-height:calc(100dvh - 64px); overflow-y:auto; }}
@media(max-width:720px){
 .general-settings-nav h2,.general-settings-nav .settings-search { flex-basis:100%; }
 .general-settings-nav .settings-nav-label { display:none; }
 .general-settings-content { padding:18px 12px; }
 .general-settings-content>h1 { margin-bottom:18px; font-size:22px; }
}

/* Единое оформление рабочих панелей и навигации разделов. */
.section-shell .section-sidebar,
#bookingView .tabs.section-sidebar {
 justify-content:flex-start; align-content:start; align-items:stretch;
 margin:0; padding:16px; gap:6px;
}
.section-shell .section-sidebar button,
#bookingView .tabs.section-sidebar button {
 justify-content:flex-start; text-align:left; width:100%;
 border:0; border-radius:8px; padding:12px 14px;
 background:transparent; color:var(--ink); white-space:normal;
}
.section-shell .section-sidebar button.active,
#bookingView .tabs.section-sidebar button.active { background:var(--accent2); color:var(--ink); }
#bookingView .tabs.section-sidebar { border-right:1px solid var(--line); }
#bookingView .section-content>.section-settings { padding:12px 8px; }
.section-settings>h1 { margin:0 0 24px; }
.section-settings .settings-card { background:var(--card); border:1px solid var(--line); border-radius:16px; box-shadow:none; padding:16px; }
.section-settings .form-grid { grid-template-columns:1fr; }
#bookingSettingsPanel { max-width:820px; }
#bookingSettingsPanel .module-body { border-top:0; margin-top:0; padding-top:0; }

#appealsSettingsPane { background:var(--bg); }
#appealsSettingsPane .section-settings-head { margin-bottom:20px; }
#bookingView .card { background:var(--card); border-color:var(--line); border-radius:16px; box-shadow:none; }
@media(max-width:720px){
 .section-shell .section-sidebar,#bookingView .tabs.section-sidebar { flex-direction:row; flex-wrap:wrap; padding:8px; border-right:0; border-bottom:1px solid var(--line); }
 .section-shell .section-sidebar button,#bookingView .tabs.section-sidebar button { width:auto; flex:1 1 auto; padding:10px; }
 #bookingView .section-content>.section-settings { padding:8px 0; }
}

/* Обращения по принципу мессенджера: категории, список, переписка. */
#dialogsView { grid-template-columns:180px minmax(0,1fr); }
.appeals-work-area { display:grid; grid-template-columns:300px minmax(0,1fr); min-width:0; min-height:0; }
#dialogsView.is-settings .appeals-work-area { grid-template-columns:minmax(0,1fr); }
#dialogsView .appeals-back { display:none; }
#dialogsView #sidebar { display:flex; flex-direction:column; padding:12px; overflow:hidden; }
#dialogsView .side-tools { display:flex; flex-direction:column; flex:1; min-height:0; padding:0; border:0; }
#dialogsView .dialog-filters { display:flex; flex-direction:column; flex:1; min-height:0; gap:6px; margin:0; overflow:auto; }
#dialogsView .dialog-filters button,#dialogsView #appealsSettingsBtn { width:100%; flex:none; justify-content:flex-start; text-align:left; padding:12px 10px; border:0; border-radius:8px; background:transparent; color:var(--ink); white-space:normal; }
#dialogsView .dialog-filters button.active,#dialogsView #appealsSettingsBtn.active { background:var(--accent2); }
#dialogsView #workspace { position:relative; inset:auto; z-index:auto; display:block; min-width:0; background:var(--bg); overflow:hidden; }
#dialogsView .dialog-head-main { flex-wrap:wrap; }
#dialogsView .dialog-view { background:var(--bg); }
#dialogsView .appeals-list-pane { display:flex; flex-direction:column; min-width:0; min-height:0; padding:16px 10px 0; border-right:1px solid var(--line); background:var(--card); }
#dialogsView .side-primary { display:block; padding:0; margin:0 0 12px; }
#dialogsView .appeals-list-pane>h1 { margin:0 0 12px; }
.appeals-list-body { display:flex; flex-direction:column; min-height:0; flex:1; }
#dialogsView .dialogs { min-height:0; padding:0; flex:1; }
#dialogsView .dialog { margin-bottom:4px; padding:12px 8px; background:transparent; border:0; border-radius:10px; }
#dialogsView .dialog.active { background:var(--accent2); }
#dialogsView .dialog-preview { overflow:hidden; text-overflow:ellipsis; }
#dialogsView #deletedBulk { flex:none; margin-bottom:12px; }
#appealsSettingsPane .reception-strip {     margin-bottom:16px; }
.reception-dot { width:9px; height:9px; border-radius:50%; flex:0 0 9px; }
.reception-dot-open { background:#608b72; }
.reception-dot-closed { background:#ad7373; }
@media(min-width:721px) and (max-width:1100px){#dialogsView { grid-template-columns:150px minmax(0,1fr); } .appeals-work-area { grid-template-columns:250px minmax(0,1fr); }}
@media(max-width:720px){
 #dialogsView {  grid-template-rows:auto auto minmax(0,1fr); overflow:hidden; }
 #dialogsView #sidebar,#dialogsView .side-tools,#dialogsView .appeals-list-pane,#dialogsView .appeals-work-area { display:contents; }
 #dialogsView .side-primary { grid-column:1/-1; grid-row:1; padding:8px 10px 0; margin:0; }
 #dialogsView .dialog-filters { grid-column:1/-1; grid-row:2; flex-direction:row; flex-wrap:nowrap; overflow-x:auto; overflow-y:hidden; min-width:0; padding:8px 10px; gap:4px; scrollbar-width:thin; touch-action:pan-x; cursor:grab; }
 #dialogsView .dialog-filters.dragging { cursor:grabbing; user-select:none; }
 #dialogsView .appeals-list-pane>h1 { display:none; }
 #dialogsView .appeals-list-body { grid-column:1; grid-row:3; min-width:0; border-right:1px solid var(--line); overflow:hidden; padding:0 4px; }
 #dialogsView #workspace { display:none; grid-column:1; grid-row:3; min-width:0; min-height:0; }
 #dialogsView.is-settings #workspace { display:block; }
 #dialogsView.is-conversation { grid-template-rows:minmax(0,1fr); }
 #dialogsView.is-conversation #sidebar,#dialogsView.is-conversation #appealsListPane { display:none; }
 #dialogsView.is-conversation #workspace { display:block; grid-row:1; }
 #dialogsView.is-conversation .appeals-back { display:inline-flex; flex:none; }
 #dialogsView .dialog-view { min-height:0; height:100%; }
 #dialogsView #appealsSettingsBtn { width:auto; }
 #dialogsView .appeals-reception-summary { padding:0; }
 #dialogsView .dialog-row { flex-wrap:wrap; }
 #dialogsView .dialog-time-wrap { margin-left:auto; }
 #dialogsView .dialog-head { padding:8px; }
 #dialogsView .dialog-actions { flex-wrap:wrap; }
 #dialogsView .composer { padding:6px; min-width:0; }
 #dialogsView .section-settings { padding:8px; }
 #dialogsView .section-settings-head { flex-wrap:wrap; }

}

.appeals-reception-summary { display:grid; place-items:center; flex:none; width:44px; height:44px; padding:10px; color:var(--muted); border-radius:8px; }
.appeals-reception-summary .reception-dot { display:block; width:20px; height:20px; flex:none; }
.appeals-reception-summary .reception-dot svg { display:block; width:100%; height:100%; fill:none; stroke:#fff; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.visually-hidden { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
.appeals-reception-summary .reception-dot { background-color:#98a2b3; }
.appeals-reception-summary .reception-dot-open { background-color:#608b72; }
.appeals-reception-summary .reception-dot-closed { background-color:#ad7373; }

/* Единая навигация всех разделов и формы без внешних карточек. */
:root { --section-nav-width:180px; }
.section-shell,#bookingView .booking-root.section-shell,#dialogsView { grid-template-columns:var(--section-nav-width) minmax(0,1fr); }
.section-shell>.section-sidebar,#bookingView .tabs.section-sidebar,#dialogsView #sidebar { padding:12px; background:var(--card); border-right:1px solid var(--line); }
.section-shell>.section-sidebar,#bookingView .tabs.section-sidebar { display:flex; flex-direction:column; align-items:stretch; min-height:0; height:100%; position:static; max-height:none; }
.section-nav-items { display:flex; flex-direction:column; flex:1; min-height:0; gap:6px; overflow:auto; }
.section-nav-footer { margin-top:auto; padding-top:12px; border-top:1px solid var(--line); }
.section-shell .section-sidebar button,#bookingView .tabs.section-sidebar button,#dialogsView .dialog-filters button,#dialogsView #appealsSettingsBtn { width:100%; flex:none; justify-content:flex-start; text-align:left; padding:12px 10px; border:0; border-radius:8px; background:transparent; color:var(--ink); white-space:normal; }
.section-shell .section-sidebar button.active,#bookingView .tabs.section-sidebar button.active,#dialogsView .dialog-filters button.active,#dialogsView #appealsSettingsBtn.active { background:var(--accent2); font-weight:600; }
.settings-card,.general-settings-content .settings-card,.section-settings .settings-card,#bookingView .card { border:0; border-radius:0; box-shadow:none; background:transparent; }
.general-settings-content .settings-card,.section-settings .settings-card { padding:0; }
#appealsSettingsPane .reception-strip { border:0; border-radius:0; background:transparent; padding:0; }
#paymentsSettingsPane>.settings-card:first-child>h3,#appealsSettingsPane .section-settings-head:empty,[data-settings-category="documents"]>h2,#appealsSettingsCard>.module-head { display:none; }
#paymentsView .payments-registry-card { padding:0; }
#bookingView #bk-tab-settings { padding-top:0; }
.category-strip.dragging { cursor:grabbing; user-select:none; }
@media(max-width:720px){
 .section-shell,#bookingView .booking-root.section-shell { grid-template-columns:minmax(0,1fr); grid-template-rows:auto minmax(0,1fr) auto; min-height:0; height:100%; }
 .section-shell>.section-sidebar,#bookingView .tabs.section-sidebar { display:contents; }
 .section-nav-items { grid-column:1; grid-row:1; flex-direction:row; flex-wrap:nowrap; overflow-x:auto; overflow-y:hidden; gap:4px; padding:8px 10px; min-width:0; touch-action:pan-x; cursor:grab; scrollbar-width:thin; }
 .section-shell .section-sidebar .section-nav-items button,#bookingView .tabs.section-sidebar .section-nav-items button,#dialogsView .dialog-filters button { flex:0 0 auto; width:auto; white-space:nowrap; padding:9px 12px; }
 .section-shell>.section-content { grid-column:1; grid-row:2; overflow:auto; min-height:0; }
 .section-shell .section-nav-footer { grid-column:1; grid-row:3; margin:0; padding:8px 10px max(8px,env(safe-area-inset-bottom)); border-top:1px solid var(--line); background:var(--card); }
 .section-shell .section-nav-footer button,#bookingView .tabs .section-nav-footer button { width:auto; }
 .general-settings-shell.section-shell { grid-template-rows:auto auto minmax(0,1fr); }
 .general-settings-nav>h2 { display:none; }
 .general-settings-nav .settings-search { grid-column:1; grid-row:1; margin:0; padding:8px 10px 0; }
 .general-settings-nav .section-nav-items { grid-row:2; }
 .general-settings-shell>.section-content { grid-row:3; }
 #generalSettingsSearchEmpty { grid-column:1; grid-row:2; padding:8px 10px; }
 #dialogsView { grid-template-columns:minmax(0,1fr); }
}

/* Записи списков разделяются линией, без вложенных рамок-карточек. */
.channel-card,.payment-card { border:0; border-bottom:1px solid var(--line); border-radius:0; box-shadow:none; background:transparent; padding:12px 0; }
[data-settings-category="security"]>h2 { display:none; }

/* Прокручивается содержимое справа; навигация и нижние настройки остаются на месте. */
#settingsView,#bookingView.booking-module,#paymentsView { padding:0; min-height:0; overflow:hidden; }
#settingsView .section-shell,#bookingView .booking-root.section-shell,#paymentsView .section-shell { height:100%; min-height:0; overflow:hidden; align-items:stretch; }
#settingsView .section-content,#bookingView .section-content,#paymentsView .section-content { height:100%; min-height:0; overflow:auto; }

/* Спокойные нейтральные элементы управления, единая существующая типографика. */
:root { --bg:#f7f7f8; --card:#fff; --ink:#202123; --muted:#6b6b6b; --line:#e5e5e5; --accent:#303030; --accent2:#ececec; }
#bookingView { --surface:var(--bg); --text:var(--ink); --border-soft:var(--line); background:var(--bg); padding:0; }
#bookingView .tabs.section-sidebar { padding:12px; gap:6px; margin:0; }
#bookingView .service-card { background:transparent; }
#appView :is(.section-content,.section-settings,.settings-page) :is(hr,.settings-divider) { display:none; }
#appView :is(.module-body,.subform,.channel-card,.payment-card,.legal-document-versions,.legal-document-version),#bookingView .service-row { border-top:0; border-bottom:0; }
#appView :is(.module-body,.subform) { padding-top:0; }
#appView :is(button,.btn,.button-link) { font-weight:400; transition:background-color .15s ease,color .15s ease; }

#appView :is(button,.btn,.button-link):focus-visible { outline:2px solid #8b8b8b; outline-offset:2px; }

#appView input:is([type=checkbox],[type=radio]) { accent-color:#303030; }

#appView .section-sidebar button:hover:not(:disabled),#bookingView .tabs.section-sidebar button:hover:not(:disabled) { background:#f0f0f0; color:var(--ink); }
#appView .section-sidebar button.active,#bookingView .tabs.section-sidebar button.active { font-weight:500; }
@media(min-width:721px){
 #appView :is(.settings-card,.module-body,.section-settings) form>button,
 #appView :is(.settings-card,.module-body,.section-settings)>.inline-actions>button,
 #appView .module-body>button,#appView .archive-invoice-actions .btn,
 #appView .invoice-actions-row .btn,#appView .payment-card-actions .btn,
 #bookingView .service-list-toolbar .button { width:auto; max-width:100%; flex:0 0 auto; justify-self:start; align-self:start; }
}
@media(max-width:720px){ #bookingView .tabs.section-sidebar { padding:0; } }
#appView :is(.settings-row,.dialog-head,.dialog-details,.composer,.deleted-bulk,.legal-version-list,.legal-version-row),#bookingView :is(.booking-details,.actions) { border-top:0; border-bottom:0; }


/* Общие компоненты кабинета: поиск, поля, кнопки и заголовки. */
:root { --control-bg:#ececec; --control-hover:#e2e2e2; --search-border:#d8d8d8; }
#appView :is(.search,#generalSettingsSearch) {
 width:100%; height:36px; margin:0; border:1px solid var(--search-border); border-radius:20px;
 padding:6px 12px 6px 38px; background-color:#fff; color:var(--ink); font:inherit;
 background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23777777' stroke-width='1.5'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m15.5 15.5 5 5'/%3E%3C/svg%3E");
 background-repeat:no-repeat; background-size:20px 20px; background-position:12px center;
}
#appView :is(input,textarea)::placeholder { color:var(--muted); opacity:1; }
#appView :is(input,textarea,select):is(:focus,:focus-visible) { outline:0; box-shadow:none; }
#appView :is(button,.btn,.button-link):not(:where(.section-sidebar *, .top-actions *, .calendar-services *, .slot,.dialog,.danger,.channel-action,.dialog-action-icon)),#appView #bookingView .button:not(.danger):not(:where(.calendar-services *)),#loginView button {
 background:var(--control-bg); color:var(--ink); font-weight:400; border:0;
}
#appView :is(button,.btn,.button-link):not(:where(.section-sidebar *, .top-actions *, .calendar-services *, .slot,.dialog,.danger,.channel-action,.dialog-action-icon)):hover:not(:disabled),#appView #bookingView .button:not(.danger):not(:where(.calendar-services *)):hover:not(:disabled),#loginView button:hover:not(:disabled) {
 background:var(--control-hover); color:var(--ink);
}
#appView :is(h1,h2,h3),#appView .module-switch strong { font-weight:500; }
#appView :is(h1,h2,h3) :is(strong,b) { font-size:inherit!important; font-weight:inherit; }
#securitySettingsCard .inline-actions { gap:8px; margin-bottom:8px; }
#bookingView .section-content { text-align:left; }
#bookingView :is(.calendar-toolbar,.slots,.service-list-toolbar) { justify-content:start; }

/* Большие формы открываются внутри рабочей панели, без оверлея. */
.has-panel-screen > :not(.panel-screen-active,.toast,.modal-backdrop) { display:none!important; }
.panel-screen { min-width:0; }
.panel-form { width:min(720px,100%); margin:0; padding:0; border:0; background:transparent; box-shadow:none; }
.panel-head { display:flex; align-items:center; gap:12px; margin-bottom:20px; }
.panel-head :is(h2,h3) { margin:0; }
#appView .panel-back { flex:none; width:36px; height:36px; padding:8px; background:transparent; }
#appView .panel-back:hover { background:var(--control-hover); }
.panel-back svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
#dialogsView #workspace.has-panel-screen { padding:16px; overflow:auto; }

/* Выбор услуги и короткая подпись в полной сетке времени. */
.calendar-services { position:sticky; top:0; z-index:8; background:var(--bg); padding:0 0 8px; display:flex; flex-wrap:nowrap; gap:6px; overflow-x:auto; min-width:0; margin-bottom:16px; touch-action:pan-x; }
#bookingView .calendar-services button { display:inline-flex; align-items:center; flex:none; border:0; background:transparent; color:var(--ink); font-weight:400; }
#bookingView .calendar-services button.active { background:var(--control-bg); font-weight:500; }
#bookingView .slot { min-width:0; flex-direction:column; gap:2px; }
#bookingView .slot-service { display:block; min-width:0; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; font-weight:400; }
#bookingView .slot.occupied,#bookingView .slot.assigned { background:var(--accent2); color:var(--muted); cursor:default; }

.settings-search-results { display:grid; gap:4px; }
#appView .settings-search-result { width:100%; flex-direction:column; align-items:flex-start; text-align:left; background:transparent; }
#appView .settings-search-result:hover { background:var(--control-hover); }
.settings-search-match { background:var(--accent2); }

#bookingView .calendar-services button:hover:not(:disabled) { background:var(--control-hover); }

.service-color-dot { display:inline-block; width:10px; height:10px; flex:none; border-radius:50%; margin-right:7px; }
#bookingView .slot.service-colored { border-color:var(--line); }
#bookingView .service-colored .slot-service { background:#ffffffe6; color:var(--ink); border-radius:4px; padding:2px 5px; }
#bookingView .booking-card.service-colored { color:var(--ink); }
#bookingView .booking-card.service-colored > :not(.booking-time) { background:#ffffffe6; border-radius:4px; }
#bookingView input[type=color] { width:64px; padding:3px; cursor:pointer; }

#bookingView .service-colored :is(.slot-time,.booking-time) { background:transparent; color:var(--service-time-ink,var(--ink)); text-shadow:var(--service-time-shadow,none); }

#bookingView .section-content:has(>#bk-tab-calendar:not(.hidden)) { padding-top:0; }
.booking-child-toggle { margin-top:16px; }
#bk-integrationPanel .field { display:grid; gap:8px; margin-top:16px; }
#bk-integrationPanel textarea { width:100%; resize:vertical; }

.message { min-width:0; overflow-wrap:anywhere; }
.dialog-head-main,.dialog-identity,.record-stage { min-width:0; }
.recorder-back { display:none; }
.record-preview,.record-audio { min-width:0; max-width:100%; }
.recorder-card { min-width:0; }
.record-stage,.dialog-identity h2 { overflow-wrap:anywhere; }
.recorder-panel { position:static; inset:auto; display:block; padding:0; z-index:auto; background:transparent; width:100%; min-width:0; }
.recorder-panel .recorder-card { width:100%; max-width:none; max-height:none; overflow:visible; padding:0; border-radius:0; background:transparent; box-shadow:none; }
.recorder-panel .recorder-head { justify-content:flex-start; gap:12px; margin-bottom:20px; }
.recorder-panel .recorder-back { display:inline-grid; }
.recorder-panel #recorderClose { display:none; }
.recorder-panel .record-stage { padding:0; border:0; background:transparent; }
.recorder-panel .record-preview { max-height:45dvh; object-fit:contain; }
.recorder-panel .recorder-actions { justify-content:flex-start; padding-bottom:env(safe-area-inset-bottom); }

.reply-attachment { display:flex; align-items:center; gap:8px; min-width:0; width:100%; margin-bottom:8px; }
.reply-attachment .file-name { display:block; flex:1; min-width:0; max-width:none; white-space:normal; overflow-wrap:anywhere; }
.reply-attachment button { flex:none; }

#recordPermission { margin:0; }
.reply-attachment { flex-wrap:wrap; }
.reply-file-list { flex:1 0 100%; display:grid; gap:6px; min-width:0; }
.reply-file-row { display:flex; align-items:center; gap:8px; min-width:0; font-size:12px; }
.reply-file-name { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.reply-file-size { flex:none; white-space:nowrap; color:var(--muted); }
.draft-file-icon { --font-base:8px; display:grid; place-items:center; flex:none; width:26px; height:30px; font-size:8px; font-weight:500; border-radius:4px; color:#496f9e; background:#e7edf6; }
.draft-file-icon[data-type=image] { color:#39704a; background:#e7f4ec; }
.draft-file-icon[data-type=audio],.draft-file-icon[data-type=video] { color:#79548e; background:#f1e9f6; }
.media-placeholder { display:block; width:100%; padding:14px; background:var(--control-bg); border-radius:10px; }

/* Медиа без имён файлов и изменения геометрии при загрузке. */
.message-with-media { padding:6px; }
.message-with-media .media { margin:0; }
.message>.message-text+.media { margin-top:12px; }
.message-with-media .message-text { padding:6px 4px 0; }
body .message .message-meta,body .message .message-meta span { font-size:var(--chat-meta-size)!important; font-weight:400; }
.video-frame { position:relative; max-width:100%; max-height:440px; overflow:hidden; border-radius:12px; background:var(--control-bg); }
.media .video-frame video { position:absolute; inset:0; display:block; width:100%; height:100%; max-height:none; object-fit:contain; border-radius:inherit; background:transparent; }
body .video-duration { position:absolute; top:7px; left:7px; padding:2px 5px; border-radius:6px; font-size:11px!important; color:#fff; background:#0008; pointer-events:none; }
.media-play { display:grid; place-items:center; flex:none; width:40px; height:40px; border:0; border-radius:50%; padding:10px; background:var(--green); color:#fff; cursor:pointer; }
.media-play:hover { filter:brightness(.93); }
.media-play svg { width:20px; height:20px; fill:currentColor; }
.video-play { position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); background:#0007; width:52px; height:52px; }
.media-play[hidden] { display:none; }
.media-audio { width:280px; display:flex; gap:10px; align-items:center; padding:2px; }
.message-with-voice { padding:9px 10px; }
#appView .media-audio .voice-play { background:var(--green); color:#fff; width:44px; height:44px; padding:11px; }
.media-audio audio { display:none; }
.voice-body { flex:1; min-width:0; }
.voice-track { position:relative; height:26px; }
.voice-wave { display:flex; align-items:center; justify-content:space-between; gap:2px; height:100%; color:var(--green); }
.voice-wave i { display:block; flex:1; max-width:3px; border-radius:2px; background:currentColor; opacity:.65; }
.voice-seek { position:absolute; inset:0; margin:0; width:100%; height:100%; opacity:0; cursor:pointer; }
.voice-track:has(.voice-seek:focus-visible) { outline:2px solid var(--green); outline-offset:3px; border-radius:4px; }
body .voice-duration { display:block; font-size:11px!important; font-variant-numeric:tabular-nums; color:var(--muted); }
#replyError:empty { display:none; }
#replyError { margin:6px 0 0; }
@media(max-width:720px){
 #dialogsView .composer { padding:6px 8px max(6px,env(safe-area-inset-bottom)); }
 .media-audio { width:260px; }
}

/* Файлы: скачивание по значку, имя и нижняя строка с размером и статусом. */
.message.message-with-file { padding:9px; }
.media-file { display:flex; align-items:center; gap:10px; width:330px; margin:0; }
.document-icon { display:block; text-decoration:none; cursor:pointer; position:relative; flex:0 0 38px; width:38px; height:46px; --document-color:#6b7280; color:var(--document-color); }
.document-icon svg { position:absolute; inset:0 3px 0; width:32px; height:34px; fill:currentColor; fill-opacity:.15; }
.document-icon .document-fold { fill:none; stroke:currentColor; stroke-opacity:.2; }
.document-icon .document-arrow { fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
body .document-extension { position:absolute; bottom:0; left:0; width:38px; padding:1px 2px; border-radius:4px; background:var(--document-color); color:#fff; text-align:center; font-size:10px!important; line-height:15px; }
.document-icon[data-type=pdf] { --document-color:#b95454; }
.document-icon[data-type=archive] { --document-color:#9563a6; }
.document-icon[data-type=word] { --document-color:#557ca8; }
.document-details { min-width:0; flex:1; }
.document-name { display:block; min-width:0; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-weight:400; }
.document-footer,.voice-footer { display:flex; align-items:baseline; gap:6px; min-width:0; margin-top:3px; }
body .document-size,body .document-download-status { font-size:11px!important; color:var(--muted); }
.document-size { flex:none; white-space:nowrap; }
.document-download-status { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.document-download-status.error { color:var(--danger); }
/* Explain rejected incoming files in full; never hide the actual size limit. */
.media-file .document-download-status[data-unavailable="true"] {
  display:block; flex-basis:100%; white-space:normal; overflow:visible;
  text-overflow:clip; overflow-wrap:anywhere; line-height:1.35;
}
.media-file:has(.document-download-status[data-unavailable="true"]) .document-footer {
  flex-wrap:wrap; align-items:baseline; row-gap:4px;
}
.media-file .document-icon[aria-disabled="true"] { opacity:.5; cursor:default; }

.document-footer .message-meta,.voice-footer .message-meta { margin:0 0 0 auto; padding:0; flex:none; }
.voice-footer .voice-duration { color:var(--green); }
.voice-footer .message-meta { color:var(--green); }
.message-meta .delivery.sent { color:var(--green); }
.document-icon:hover { opacity:.8; }
.document-icon:focus-visible { outline:2px solid var(--muted); outline-offset:3px; border-radius:5px; }
.message.message-with-video { position:relative; padding:0; border:1px solid #fff; background:transparent; overflow:hidden; }
.message-with-video .video-frame { border-radius:0; }
.message-with-video>.message-text { padding:7px 9px 0; background:var(--message-fill); }
.message-with-video>.message-meta { margin:0; padding:3px 9px 5px; background:var(--message-fill); }
.message-with-video:not(:has(>.message-text))>.message-meta { position:absolute; bottom:7px; right:7px; padding:1px 5px; border-radius:5px; color:#fff; background:#0008; pointer-events:none; }
#attachmentPolicyForm { margin-top:10px; }
#blockedExtensions { display:block; width:100%; margin-top:7px; padding:10px 12px; border:1px solid var(--line); border-radius:12px; color:var(--ink); background:var(--card); font:inherit; resize:vertical; outline:none; }
[data-settings-category=files]>h3:not(:first-child) { margin-top:24px; }

.messages-down { position:absolute; right:12px; bottom:10px; width:40px; height:40px; padding:9px; border:0; border-radius:50%; background:var(--card); box-shadow:0 2px 9px #00000012; z-index:5; }
.messages-down svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
@media(max-width:720px){
 .app.chat-conversation { grid-template-rows:minmax(0,1fr); }
 .app.chat-conversation>.topbar { display:none; }
 .app.chat-conversation #workspace { inset:0; }
}

/* Палитра переписки и общий радиус однострочного сообщения/поля ввода. */
:is(#dialogsView,.appearance-preview) { --green:var(--chat-accent); --message-radius:var(--chat-radius); --muted:var(--chat-muted); --bg:var(--chat-bg); }
:is(#dialogsView,.appearance-preview) .message { margin-block:var(--chat-message-gap); }
:is(#dialogsView,.appearance-preview) .message-text-only { padding:var(--chat-pad-y) var(--chat-pad-x); }
:is(#dialogsView,.appearance-preview) .message-text-only .message-text { display:flow-root; }
:is(#dialogsView,.appearance-preview) .message-text-only .message-meta { display:inline-flex; float:right; clear:none; margin:max(1px,calc(var(--chat-line-height) - var(--chat-meta-size) - 6px)) 0 0 8px; line-height:calc(var(--chat-meta-size) + 4px); white-space:nowrap; }
.message.inbound.message-with-video { border:1px solid #fff; }
.message.outbound .document-name { color:inherit; }

/* Полноэкранная компоновка кабинета: общая ширина навигации и центр содержимого. */
#appView { --cabinet-nav-width:clamp(320px,29vw,440px); --content-inset:24px; position:relative; overflow:hidden; width:100%; height:100dvh; margin:0; border:0; border-radius:0; box-shadow:none; grid-template-rows:58px minmax(0,1fr); }
#appView .section-inner { width:calc(100% - var(--content-inset) - var(--content-inset)); max-width:var(--cabinet-content-width); margin-inline:auto; }
#appView .section-content>.panel-screen { width:100%; max-width:none; margin:0; }
#appView .section-heading { position:sticky; top:0; z-index:25; display:flex; align-items:center; gap:10px; min-height:64px; width:100%; margin:0 0 20px; padding:14px max(var(--content-inset),calc((100% - var(--cabinet-content-width))/2)); background:var(--card); border-bottom:1px solid var(--line); }
#appView .section-heading :is(h1,h2,h3),#appView #contactName { margin:0; font-size:18px!important; font-weight:500; }
#appView .section-heading :is(h1,h2,h3) { flex:1; }
#appView .general-settings-content :is(.settings-grid,.advanced-settings) { max-width:none; }
#appView .module-settings-page .section-settings { max-width:none; padding:0; }
#appView .module-controls { flex-wrap:wrap; gap:8px; }
#dialogsView .composer { background:transparent; }
@media(min-width:721px){
 #appView { grid-template-rows:minmax(0,1fr); }
 #appView>.topbar { position:absolute; top:0; left:0; width:var(--cabinet-nav-width); height:72px; border:0; border-right:1px solid var(--line); }
 #appView .topbrand { min-width:0; }
 #appView .topbrand>div { min-width:0; }
 #appView #brandName { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
 #appView>:is(#dialogsView,#settingsView,#bookingView,#paymentsView,#setupView,#bootstrapErrorView,#moduleUnavailableView) { grid-column:1; grid-row:1; min-height:0; height:100%; }
 #appView .section-shell,#appView #bookingView .booking-root.section-shell,#appView #dialogsView { grid-template-columns:var(--cabinet-nav-width) minmax(0,1fr); height:100%; }
 #appView .section-shell>.section-sidebar { padding:84px 16px 16px; }
 #appView #dialogsView #sidebar { display:grid; grid-template-columns:minmax(106px,.45fr) minmax(0,1fr); grid-template-rows:minmax(0,1fr); padding:84px 8px 8px; gap:8px; }
 #appView #dialogsView .side-tools { display:flex; flex-direction:column; min-height:0; padding:0; overflow:hidden; }
 #appView #dialogsView .dialog-filters { overflow:auto; flex:none; }
 #appView #dialogsView .appeals-list-pane { padding:0; border:0; }
 #appView #dialogsView .side-primary { padding:0 0 8px; }
 #appView #dialogsView .appeals-work-area { display:block; min-height:0; height:100%; }
 #appView #dialogsView #workspace { height:100%; background:var(--bg); }
 #appView #dialogsView .dialog-view { width:100%; max-width:none; margin:0; }
 #appView #dialogsView .dialog-head { padding:14px max(var(--content-inset),calc((100% - var(--cabinet-content-width))/2)); background:var(--card); border-bottom:1px solid var(--line); }
 #appView #setupView,#appView #bootstrapErrorView,#appView #moduleUnavailableView { margin-left:var(--cabinet-nav-width); }
}
@media(max-width:720px){
 #appView { grid-template-rows:50px minmax(0,1fr); }
 #appView.chat-conversation { grid-template-rows:minmax(0,1fr); }
 #appView { --content-inset:12px; }

 #appView .section-shell:not(.general-settings-shell) { grid-template-rows:auto minmax(0,1fr); }
 #appView #dialogsView:not(.is-conversation) #sidebar { display:contents; }
 #appView #dialogsView .appeals-list-pane { display:contents; }
}

/* Общая рабочая ширина, одинаковые интервалы и светлая шапка на всю панель. */
#appView .section-content>.panel-screen .panel-form,#appView .module-settings-page { width:calc(100% - var(--content-inset) - var(--content-inset)); max-width:var(--cabinet-content-width); margin:0 auto; }
#appView .general-settings-content .advanced-settings { margin-top:0; }
#appView .section-inner>:first-child,#appView .settings-card>:first-child { margin-top:0; }
#bookingView :is(.service-list-card,.calendar-toolbar-card) { padding:0; }
#bookingView .service-card { padding:0; margin:0 0 16px; }
#bookingView #bk-actionsPanel { position:sticky; left:auto; right:auto; bottom:0; width:100%; max-width:var(--cabinet-content-width); margin:0; border-radius:16px 16px 0 0; }
#bookingView .actions-controls,#bookingView .actions-controls .actions-row { justify-content:flex-start; }
#bookingView .calendar-services { top:0; }
#appView #dialogsView .composer { width:100%; max-width:var(--cabinet-content-width); margin-inline:auto; }
#appView #dialogsView .messages-pane { width:100%; overflow:hidden; }
#appView #dialogsView .messages { padding:18px max(var(--content-inset),calc((100% - var(--cabinet-content-width))/2)); }
#appView .compose-main textarea { min-height:36px; resize:none; line-height:24px; padding:6px 8px; border-radius:16px; }
#appView :is(.attach-btn,.compose-actions) { align-self:flex-end; }
#appView :is(#sendBtn,#recordVoice,#recordVideo) { width:36px; height:36px; min-width:36px; padding:8px; border:0; border-radius:50%; color:#fff; background:var(--chat-accent); }
#appView :is(#sendBtn,#recordVoice,#recordVideo):hover:not(:disabled) { background:color-mix(in srgb,var(--chat-accent),black 10%); color:#fff; }
#appView :is(#sendBtn,#recordVoice,#recordVideo) svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.7; }
#appView :is(.panel-back,.appeals-back) { border:0; background:transparent; }
#appView :is(.panel-back,.appeals-back) svg { display:block; width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
#appView .reply-file-remove { flex:none; width:36px; height:36px; font-size:25px!important; line-height:1; }
.filter-icon { display:none; width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
@media(min-width:721px){
 #appView #dialogsView #sidebar { grid-template-columns:52px minmax(0,1fr); grid-template-rows:minmax(0,1fr); }
 #appView #dialogsView .side-tools { display:contents; }
 #appView #dialogsView .dialog-filters { grid-column:1; grid-row:1; }
 #appView #dialogsView .appeals-list-pane { grid-column:2; grid-row:1; }
 #appView #dialogsView .dialog-filter { display:grid; place-items:center; width:44px; min-height:44px; padding:10px; }
 #appView .dialog-filter .filter-label { display:none; }
 .filter-icon { display:block; }
}
/* Изображения используют такую же простую границу, как видеопревью. */
.message.message-with-image { padding:0; background:transparent; overflow:hidden; }
.message-with-image>.message-text { padding:7px 9px; background:var(--message-fill); }
.media-image>.message-meta { position:absolute; bottom:7px; right:7px; margin:0; padding:1px 5px; border-radius:5px; color:#fff; background:#0008; pointer-events:none; }
.media-image { position:relative; width:fit-content; max-width:min(330px,100%); overflow:hidden; border:1px solid #fff; border-radius:inherit; }
#appView .media-image .image-open { display:block; max-width:100%; margin:0; padding:0; border:0; border-radius:inherit; background:transparent; cursor:zoom-in; }
.media-image img { width:auto; height:auto; max-width:100%; max-height:440px; object-fit:contain; border-radius:inherit; background:transparent; }
.message-image-viewer { position:fixed; inset:0; width:100vw; height:100dvh; max-width:none; max-height:none; margin:0; padding:0; border:0; border-radius:0; background:transparent; }
.message-image-viewer[open] { display:grid; place-items:center; }
.message-image-viewer::backdrop { background:#0009; }
.message-image-viewer img { display:block; max-width:100%; max-height:100dvh; width:auto; height:auto; margin:auto; object-fit:contain; }
.message-image-viewer .image-viewer-close { position:fixed; top:max(8px,env(safe-area-inset-top)); right:max(8px,env(safe-area-inset-right)); z-index:2; width:40px; height:40px; padding:0; border:0; border-radius:50%; color:#fff; background:#0008; font-size:30px!important; cursor:pointer; }

#appView #dialogsView .dialog-head { border-bottom:1px solid var(--line); }
#appView #dialogsView .dialog-head-main { width:100%; padding:0; }

#appView .section-shell>.section-content { padding:0 0 24px; }

#appView .module-body>h3:first-of-type,#appView [data-settings-category="documents"]>h2+p { margin-top:0; }

#appealsSettingsCard>.module-body,#appView .module-settings-page>.module-body { margin-top:0; }
#appView [data-settings-category="security"]>h2+p { margin-top:0; }
#appView .settings-card p:empty,#appView .security-code:empty { display:none; }

/* Подсказка вынесена из прокручиваемых панелей и не обрезается их границами. */
.cabinet-tooltip { position:fixed; z-index:100; max-width:min(260px,calc(100vw - 16px)); padding:7px 10px; border:1px solid var(--line); border-radius:9px; background:var(--card); color:var(--ink); font-size:13px; line-height:1.35; font-weight:400; box-shadow:0 3px 14px #00000012; pointer-events:none; white-space:normal; overflow-wrap:anywhere; word-break:normal; opacity:0; transform:translateY(3px); transition:opacity .12s,transform .12s; }
.cabinet-tooltip.is-visible { opacity:1; transform:none; }
@media(prefers-reduced-motion:reduce){.cabinet-tooltip { transition:none; }}

/* Компактные категории; стрелки вложенных форм остаются без отдельной шапки. */
#appView .section-content>.section-heading { display:none; }
#appView .section-content>.section-inner { padding-top:20px; }
#appView .panel-screen>.section-heading { position:static; min-height:0; margin:0 0 20px; background:transparent; border:0; }
#appView #dialogMeta { --font-base:12px; font-size:12px; }
/* Переписка продолжается за плавающим полем; резерв зависит от его реальной высоты. */
#dialogsView .dialog-view { position:relative; grid-template-rows:auto minmax(0,1fr); }
#appView #dialogsView .composer { position:absolute; z-index:6; bottom:0; left:50%; transform:translateX(-50%); pointer-events:none; }
#dialogsView .composer :is(.compose-main,.composer-note,#replyError) { pointer-events:auto; }
#appView #dialogsView .messages { padding-bottom:calc(var(--composer-space,64px) + 16px); scroll-padding-bottom:calc(var(--composer-space,64px) + 16px); }
#dialogsView .messages-down { bottom:calc(var(--composer-space,64px) + 10px); }
#replyAttachment { --font-base:12px; width:100%; min-width:0; margin:0; padding:4px 8px; border:0; background:transparent; }
#replyAttachment .file-name { display:block; max-width:none; margin-bottom:4px; font-size:11px; }
.record-status { display:flex; align-items:center; justify-content:center; gap:10px; }
.record-status svg { width:28px; height:28px; color:var(--green); fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.record-stage[data-record-state=recording] .record-status svg { color:#bb4b4b; fill:currentColor; animation:record-pulse 1.3s ease-in-out infinite; }
.record-stage[data-record-state=recording] .record-status { color:#a43e3e; }
.record-stage[data-record-state=ready] .record-status { color:var(--green); }
.recorder-actions #recordStart { display:inline-flex; align-items:center; gap:8px; }
.recorder-actions #recordStart svg { width:18px; height:18px; fill:currentColor; }
.recorder-actions #recordStart[data-recording=true] { background:#f7e5e5; color:#a43e3e; }
@keyframes record-pulse { 50% { opacity:.4; } }
@media(prefers-reduced-motion:reduce){.record-stage[data-record-state=recording] .record-status svg { animation:none; }}

.message-day-covered { visibility:hidden; }
.message-day-sticky { position:absolute; top:8px; left:0; right:0; z-index:4; display:flex; justify-content:center; pointer-events:none; }
#appView #attachFile { border-radius:50%; width:36px; height:36px; padding:8px; }
#appView #bookingView .section-content { padding-bottom:0; }
#bookingView .section-inner:has(#bk-tab-calendar:not(.hidden)) { display:flex; flex-direction:column; min-height:100%; }
#bookingView .section-inner:has(#bk-tab-calendar:not(.hidden))>#bk-tab-calendar { flex:1 0 auto; }
#bookingView #bk-actionsPanel { flex:none; margin-top:auto; }
@media(max-width:720px){
 #dialogsView #workspace.has-panel-screen:has(.recorder-panel) { padding:12px 12px 0; overflow:hidden; }
 .recorder-panel { height:100%; }
 .recorder-panel .recorder-card { height:100%; display:flex; flex-direction:column; overflow:hidden; }
 .recorder-panel .recorder-head { flex:none; margin:0; }
 .recorder-panel .record-stage { flex:1; min-height:0; display:flex; flex-direction:column; align-items:center; justify-content:center; overflow:auto; }
 .recorder-panel .recorder-actions { flex:none; display:flex; flex-wrap:nowrap; align-items:stretch; gap:7px; margin:0; padding:10px 0 max(12px,env(safe-area-inset-bottom)); }
 .recorder-panel .recorder-actions button { flex:1 1 0; min-width:0; min-height:56px; padding:10px 6px; }
 .recorder-panel #recordStart { gap:5px; }
 .recorder-panel #recordStart svg { flex:none; }
 .recorder-panel #recordStart span { min-width:0; }
 .recorder-panel #recordHint { margin-top:8px; }
}
@media(display-mode:standalone){body { padding-top:env(safe-area-inset-top); }#appView { height:calc(100dvh - env(safe-area-inset-top)); }}
/* Установка предлагается вне активной переписки; никаких перекрытий поля ответа. */
.pwa-install-banner { position:fixed; left:50%; transform:translateX(-50%); bottom:max(12px,env(safe-area-inset-bottom)); z-index:45; width:min(420px,calc(100% - 24px)); display:flex; align-items:center; gap:10px; padding:10px 12px; background:var(--card); border:1px solid var(--line); border-radius:14px; box-shadow:0 3px 18px #00000012; }
.pwa-install-banner p { flex:1; margin:0; }
.pwa-install-banner button { flex:none; }
.pwa-install-banner .pwa-dismiss { width:32px; height:32px; padding:0; background:transparent; color:var(--muted); }
body:has(#appView.chat-conversation:not(.hidden)) .pwa-install-banner,body:has(#recorderBackdrop:not(.hidden)) .pwa-install-banner { display:none; }
.pwa-install-dialog { width:min(440px,calc(100% - 24px)); max-height:85dvh; overflow:auto; padding:20px; border:1px solid var(--line); border-radius:16px; color:var(--ink); background:var(--card); }
.pwa-install-dialog::backdrop { background:#0006; }
.pwa-install-dialog h2 { margin:0 0 14px; }
.pwa-install-dialog ol { padding-left:22px; }
.pwa-install-dialog li { margin:10px 0; }
.pwa-install-dialog .inline-actions { margin-top:16px; }

body:has(#appView:not(.hidden) #settingsView:not(.hidden)) .pwa-install-banner,body:has(#appView:not(.hidden) #bookingView:not(.hidden)) .pwa-install-banner,body:has(#appView:not(.hidden) #paymentsView:not(.hidden)) .pwa-install-banner { display:none; }

@media(max-width:720px){#dialogsView:not(.is-conversation) .appeals-list-body { padding-bottom:var(--pwa-banner-space,0px); }}

/* Параметры внешнего вида используют те же токены, что и переписка. */
.appearance-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px 20px; }
#appearanceForm h3 { margin:20px 0 12px; font-weight:500; }
#appearanceForm label { min-width:0; }
#appearanceForm .appearance-check { display:flex; align-items:center; gap:8px; }
#appearanceForm input[type=checkbox] { width:auto; }
#appearanceForm input[type=color] { width:100%; min-height:40px; padding:4px; }
.appearance-preview { position:relative; isolation:isolate; margin-top:20px; padding:14px; border-radius:12px; background:var(--chat-bg); background-image:var(--chat-background-gradient,none); overflow:hidden; }
.appearance-preview::before,.messages-pane::before { content:""; position:absolute; inset:0; pointer-events:none; background-image:var(--chat-wallpaper-image); background-size:var(--chat-wallpaper-size) auto; background-repeat:repeat; opacity:var(--chat-wallpaper-opacity,1); }
.appearance-preview>* { position:relative; }
#dialogsView .messages-pane { isolation:isolate; background-color:var(--chat-bg); background-image:var(--chat-background-gradient,none); }
#appView #dialogsView .messages { position:relative; background:transparent; }
.appearance-preview .message { max-width:100%; }
.appearance-preview .appearance-input { padding:10px 14px; border:1px solid var(--line); border-radius:23px; background:var(--chat-composer-bg); color:var(--chat-muted); font-family:var(--chat-font-family); font-size:var(--chat-font-size); }

/* Общая навигация и боковая панель открытой страницы. */
#appView .topbrand { display:flex; align-items:center; gap:10px; text-align:left; padding:0; background:transparent; color:var(--ink); border:0; }
#appView .page-nav-title { flex:none; margin:0 0 16px; font-size:18px!important; font-weight:500; }
#appView .section-content>.section-heading { position:relative; display:flex; align-items:center; z-index:1; }
#appView .section-description { min-height:2.84em; margin:5px 0 0; font-size:14px!important; font-weight:400; }
.home-page { min-width:0; overflow:auto; background:var(--chat-bg); }
.home-content { width:calc(100% - 48px); max-width:var(--cabinet-content-width); margin:40px auto; }
.home-content h1 { font-size:18px!important; }
.navigation-profile { display:flex; align-items:center; justify-content:flex-start; gap:10px; padding:12px; font-size:14px; }
.navigation-status { display:flex; align-items:center; }
#appView .navigation-status .appeals-reception-summary { display:flex; gap:10px; width:auto; }
#appView[data-section=home] .navigation-status #appealsReceptionLabel { position:static; width:auto; height:auto; margin:0; clip-path:none; white-space:normal; }
@media(min-width:721px){
 #appView { --global-nav-width:68px; padding-left:var(--global-nav-width); }
 #appView[data-section=home] { --global-nav-width:280px; }
 #appView>.topbar { display:flex; flex-direction:column; align-items:stretch; gap:20px; width:var(--global-nav-width); height:100%; padding:20px 10px; }
 #appView .topbrand { justify-content:flex-start; min-height:40px; }
 #appView .topbrand img { width:36px; height:36px; }
 #appView:not([data-section=home]) .topbrand>div { display:none; }
 #appView .topbrand:has(img.hidden)::before { content:'ОД'; display:grid; place-items:center; width:36px; height:36px; color:var(--accent); font-weight:600; }
 #appView #appMenu { display:flex; flex-direction:column; flex:1; min-height:0; width:100%; }
 #appView #appMenuToggle { display:none; }
 #appView #appNavigation { position:static; display:flex; flex-direction:column; align-items:stretch; flex:1; width:100%; min-width:0; gap:6px; padding:0; background:transparent; border:0; box-shadow:none; }
 #appView #appNavigation .nav-btn { display:flex; align-items:center; justify-content:center; min-width:0; width:100%; min-height:44px; padding:10px; }
 #appView:not([data-section=home]) #appNavigation .nav-label,#appView:not([data-section=home]) .navigation-profile>span { display:none; }
 #appView[data-section=home] #appNavigation .nav-btn { justify-content:flex-start; gap:12px; }
 #appView .navigation-status { margin-top:auto; justify-content:center; }
 #appView[data-section=home] .navigation-status,#appView[data-section=home] .navigation-profile { justify-content:flex-start; }
 #appView>:is(#homeView,#dialogsView,#settingsView,#bookingView,#paymentsView) { grid-row:1; grid-column:1; height:100%; min-height:0; }
 #appView .section-shell>.section-sidebar { padding:24px 16px 16px; }
 #appView #dialogsView #sidebar { display:flex; flex-direction:column; padding:24px 12px 0; gap:0; }
 #appView #dialogsView .appeals-list-pane { display:flex; flex:1; flex-direction:column; min-height:0; width:100%; }
 #appView #dialogsView .side-tools { display:block; flex:none; overflow:hidden; padding:0 0 8px; border:0; }
 #appView #dialogsView .dialog-filters { display:flex; flex-direction:row; flex-wrap:nowrap; overflow-x:auto; gap:4px; margin:0; padding:0 0 4px; }
 #appView #dialogsView .dialog-filter { display:flex; flex:none; justify-content:center; width:44px; min-height:40px; padding:8px; }
 #appView #dialogsView .appeals-list-body { flex:1; min-height:0; }
 #appView #setupView,#appView #bootstrapErrorView,#appView #moduleUnavailableView { margin-left:0; }
}
@media(max-width:720px){
 #appView .page-nav-title { margin:12px 12px 6px; }
 #appView #dialogsView:not(.is-conversation) #sidebar>.page-nav-title { display:none; }
 #appView .section-shell:not(.general-settings-shell) .section-sidebar>.page-nav-title { display:none; }
 #appView .general-settings-nav>.page-nav-title { display:none; }
 #appView #dialogsView .side-tools { grid-row:2; }
 #appView #dialogsView .side-primary { grid-row:1; }
 .cabinet-tooltip { display:none!important; }
}
#appearanceStatus { min-height:20px; margin:8px 0 0; }
@media(max-width:480px){.appearance-fields { grid-template-columns:minmax(0,1fr); }}

/* Локальные состояния плеера не наследуют серые состояния обычных кнопок. */
#appView .media-audio button.voice-play { border-radius:50%; background:var(--chat-accent,#53b559); color:#fff; -webkit-tap-highlight-color:transparent; }
#appView .media-audio button.voice-play:hover:not(:disabled) { background:var(--chat-accent,#53b559); color:#fff; filter:brightness(1.08); }
#appView .media-audio button.voice-play:active:not(:disabled) { background:var(--chat-accent,#53b559); filter:brightness(.94); }
#appView .media-play { -webkit-tap-highlight-color:transparent; border-radius:50%; }
#appView .media-image .image-open img { background:#fff; }
#appView .deleted-bulk { justify-content:flex-start; }
#appView .deleted-bulk .deleted-select-all { margin:0; padding:0; width:auto; justify-content:flex-start; text-align:left; flex:0 1 auto; }
.message-text a { color:var(--chat-accent,#328a40); text-decoration:underline; overflow-wrap:anywhere; }
.message-link-cards { display:grid; gap:7px; margin-top:8px; white-space:normal; }
.message-text .message-link-card,.message-link-card { display:flex; flex-direction:column; gap:4px; padding:8px 10px; border-left:3px solid var(--chat-accent,#53b559); border-radius:5px; background:#ffffff70; color:inherit; text-decoration:none; min-width:0; overflow-wrap:anywhere; }
.message-link-card strong { font-weight:500; }
.message-link-card span { font-size:14px; line-height:1.35; }
.message-link-card small { color:var(--chat-muted,#505b54); font-size:12px; }
.reply-link-description { position:relative; padding:8px 40px 0 12px; min-width:0; }
.link-description-remove { position:absolute; top:7px; right:8px; width:30px; height:30px; border:0; background:transparent; font-size:26px; cursor:pointer; }

.voice-seek { touch-action:none; }

/* Preview mode is local UI state and does not change saved chat colors. */
.appearance-preview-tools{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:10px;margin-top:20px}
.appearance-preview-mode{display:flex;gap:5px;flex-wrap:wrap}.appearance-preview-mode button{font-size:12px;padding:6px 9px;border-radius:12px}.appearance-preview-mode button[aria-pressed=true]{background:var(--accent);color:#fff}
.appearance-preview[data-mode=floating]{position:fixed;right:20px;bottom:20px;z-index:70;width:min(360px,calc(100vw - 40px));max-height:min(50vh,440px);overflow:auto;box-shadow:0 10px 35px #0004;border:1px solid var(--line)}
.appearance-preview[data-mode=bottom]{position:fixed;bottom:0;left:var(--global-nav-width,0px);right:0;z-index:70;width:auto;margin:0;max-height:min(38vh,300px);overflow:auto;box-shadow:0 -6px 26px #0003;border-radius:12px 12px 0 0;border:1px solid var(--line)}
.appearance-composer-sample{display:flex;align-items:center;gap:8px;margin-top:10px}.appearance-composer-sample .appearance-input{flex:1;min-width:0}.appearance-send-sample{display:grid;place-items:center;width:42px;height:42px;border:0;border-radius:50%;background:var(--chat-accent);color:white;opacity:1}
.appearance-sample-voice{display:flex;align-items:center;gap:10px;padding:9px 12px;margin:12px 0 0 auto;max-width:240px;border-radius:var(--chat-radius,16px);background:var(--chat-outgoing-bg);color:var(--chat-outgoing-text);font-size:13px}.appearance-sample-voice button{border:0;border-radius:50%;background:var(--chat-accent);color:#fff;width:34px;height:34px;opacity:1}.appearance-sample-wave{flex:1;min-width:0;letter-spacing:2px;color:var(--chat-accent)}
@media(max-width:720px){.appearance-preview[data-mode=floating]{right:8px;bottom:10px;width:min(340px,calc(100vw - 16px))}.appearance-preview[data-mode=bottom]{left:0;max-height:32vh}}

/* No placeholder line above manual booking/apply controls. */
#bk-actionsPanel #bk-selectedText:empty{display:none}

.appearance-preview .appearance-preview-tools{margin:0 0 12px;position:relative;z-index:1}
.appearance-preview[data-mode=floating] .appearance-preview-tools,.appearance-preview[data-mode=bottom] .appearance-preview-tools{position:sticky;top:-14px;padding:8px 0;z-index:5;background:var(--chat-bg)}

/* Custom accessible confirmation for deleting a single chat message. */
.message-delete-dialog{box-sizing:border-box;max-width:min(420px,calc(100vw - 28px));width:100%;padding:24px;border:1px solid var(--line,#e0e0e5);border-radius:18px;background:var(--card,#fff);color:var(--ink,#17201b);box-shadow:0 18px 52px #0003;font:inherit}
.message-delete-dialog::backdrop{background:rgba(20,15,30,.44)}
.message-delete-dialog h2{margin:0 0 12px;font-size:18px;font-weight:500}
.message-delete-dialog p{margin:0 0 22px;font-size:14px;line-height:1.5}
.message-delete-actions{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap}
.message-delete-actions button{min-height:40px;padding:9px 18px;border-radius:12px}
.message-delete-actions .message-delete-danger{background:var(--danger,#b42318);color:#fff}
@media(max-width:480px){.message-delete-dialog{padding:18px}.message-delete-actions button{flex:1}}

/* A video bubble may have masked media, but its exterior action button
   must never be clipped by the outer message surface. */
#appView #dialogsView #messages .message.message-with-video{overflow:visible}
#appView #dialogsView #messages .message-with-video .video-frame{overflow:hidden;border-radius:inherit}
#appView #dialogsView #messages .message-with-video .telegram-video-note{overflow:hidden;border-radius:50%}

/* The preview is a distinct panel below the settings form. */
.appearance-preview-panel{clear:both;margin:24px 0 0;padding:18px;border:1px solid var(--line);border-radius:16px;background:var(--card,#fff)}
.appearance-preview-panel>h3{font-size:18px;font-weight:500;margin:0 0 10px}
.appearance-preview-panel .appearance-preview{margin-top:0}
.appearance-preview-messages{position:relative;display:flow-root;min-width:0}
.appearance-preview .message{max-width:min(580px,80%);margin-block:var(--chat-message-gap,14px)}
.appearance-preview .message-with-voice{width:fit-content;padding:9px 10px;overflow:visible}
.appearance-preview .media-audio{width:260px;max-width:100%;margin:0;display:flex;align-items:center;gap:8px}
.appearance-preview .media-audio .voice-play{display:grid;place-items:center;width:44px;height:44px;padding:11px;flex:none;border:0;border-radius:50%;background:var(--chat-accent);color:#fff;opacity:1}
.appearance-preview .media-audio .voice-play svg{width:19px;height:19px;fill:currentColor}
.appearance-preview .media-audio .voice-wave{height:100%;display:flex;gap:2px;align-items:center;color:var(--chat-accent)}
.appearance-preview .media-audio .voice-wave i{flex:1;min-width:1px;max-width:3px;border-radius:2px;background:currentColor}
.appearance-preview .media-audio .voice-footer{display:flex;align-items:baseline;gap:6px}
.appearance-preview .media-audio .voice-footer .message-meta{margin:0 0 0 auto}
.appearance-preview .appearance-composer-sample{display:block;margin:14px 0 0;width:100%;position:relative}
.appearance-preview .appearance-composer-sample .compose-main{width:100%;display:flex;flex-direction:column;min-width:0;border:1px solid var(--line);border-radius:23px;background:var(--chat-composer-bg);padding:4px 6px;overflow:hidden}
.appearance-preview .appearance-composer-sample .compose-input-row{display:flex;align-items:center;gap:4px;width:100%;min-width:0}
.appearance-preview .appearance-composer-placeholder{order:2;flex:1;min-width:0;padding:6px 8px;line-height:24px;color:var(--chat-muted);font-size:var(--chat-font-size)}
.appearance-preview .appearance-composer-sample .attach-btn{order:1}
.appearance-preview .appearance-composer-sample .compose-actions{order:3;display:flex;align-items:center;gap:1px;flex:none}
.appearance-preview .appearance-composer-sample .dialog-action-icon{display:grid;place-items:center;flex:none;width:38px;height:38px;padding:7px;background:transparent;border:0;border-radius:50%;opacity:1;color:var(--chat-accent)}
.appearance-preview .appearance-composer-sample .record-btn{background:var(--chat-accent);color:#fff}
.appearance-preview .appearance-composer-sample .dialog-action-icon svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.appearance-preview .appearance-composer-sample .dialog-action-icon:disabled{opacity:1;cursor:default}
@media(max-width:480px){.appearance-preview-panel{padding:12px}.appearance-preview .appearance-composer-sample .dialog-action-icon{width:34px;height:34px}.appearance-preview .media-audio{width:250px}}

/* Media remains clipped inside its own frame, but action buttons live outside
   the message bubble and must never be cut off by the parent. */
#appView #dialogsView #messages .message.message-with-image{overflow:visible}
#appView #dialogsView #messages .message-with-image .media-image{overflow:hidden;border-radius:inherit}
#appView #dialogsView #messages .message-with-image .image-open{overflow:hidden;border-radius:inherit}

/* Restore the cabinet's own visible ring around Telegram round video notes.
   The provider's baked-in outline remains masked within the circular player. */
#appView #dialogsView #messages .message-with-video .telegram-video-note{
  box-sizing:border-box;
  overflow:hidden;
  border-radius:50%;
  border:2px solid #fff;
  box-shadow:0 0 0 1px rgba(76,74,99,.22);
}
#appView #dialogsView #messages .message-with-video .telegram-video-note video{border-radius:50%}

/* Media surface, not the message wrapper, clips the video/photo. Restore the
   rounded rectangular Telegram video-note frame and remove white outlines. */
#appView #dialogsView #messages .message.message-with-video,
#appView #dialogsView #messages .message.message-with-image{
  overflow:visible;
  border:0;
  background:transparent;
}
#appView #dialogsView #messages .message-with-video .video-frame,
#appView #dialogsView #messages .message-with-video .telegram-video-note{
  overflow:hidden;
  box-sizing:border-box;
  border:0;
  box-shadow:none;
  border-radius:var(--chat-radius,16px);
  background:transparent;
}
#appView #dialogsView #messages .message-with-video .video-frame video,
#appView #dialogsView #messages .message-with-video .telegram-video-note video{
  border-radius:inherit;
}
#appView #dialogsView #messages .message-with-image .media-image{
  border:0;
  box-shadow:none;
  border-radius:var(--chat-radius,16px);
  overflow:hidden;
}
#appView #dialogsView #messages .message-with-image .media-image img{
  border-radius:inherit;
}
/* The cleanup panel uses the same neutral page surface as other workspace pages. */
#appView #dialogsView #workspace.has-panel-screen:has(#conversationCleanup.panel-screen-active),
#appView #dialogsView #workspace.has-panel-screen #conversationCleanup.panel-screen-active{
  background:var(--page-bg,#fafafa);
}
#appView #dialogsView #conversationCleanup .cleanup-panel{background:transparent;}
/* Paint the area below a PWA's mobile status bar with the page-header color. */
@media(max-width:720px){html{background:var(--browser-chrome-bg,#fafafa)}}
@media(max-width:720px) and (display-mode:standalone){body{background:var(--browser-chrome-bg,#fafafa)}}
.message-action-result-dialog{
  box-sizing:border-box;
  width:min(440px,calc(100vw - 28px));
  max-width:100%;
  padding:22px;
  background:var(--card,#fff);
  color:var(--ink,#17201b);
  border:1px solid var(--line,#ddd);
  border-radius:18px;
  box-shadow:0 18px 52px #0003;
  font:inherit;
}
.message-action-result-dialog::backdrop{background:#14101e70}
.message-action-result-dialog h2{font-size:18px;font-weight:500;margin:0 0 12px}
.message-action-result-dialog p{font-size:14px;line-height:1.5;margin:0 0 20px;white-space:pre-wrap;overflow-wrap:anywhere}
.message-action-result-dialog .message-result-close{min-height:42px;padding:10px 18px}
.message-action-result-dialog .message-result-actions{display:flex;justify-content:flex-end}
@media(max-width:480px){.message-action-result-dialog{padding:18px}}

/* Video bubble corners follow ordinary chat messages: one short corner.
   The Telegram video note keeps the same whole rectangular surface. */
#appView #dialogsView #messages .message.inbound.message-with-video .video-frame{
  border-radius:4px var(--chat-radius,16px) var(--chat-radius,16px) var(--chat-radius,16px);
}
#appView #dialogsView #messages .message.outbound.message-with-video .video-frame{
  border-radius:var(--chat-radius,16px) var(--chat-radius,16px) 4px var(--chat-radius,16px);
}
#appView #dialogsView #messages .message-with-video .telegram-video-note{
  isolation:isolate;
  background:transparent;
}
#appView #dialogsView #messages .message-with-video .telegram-video-note::after{
  content:"";
  position:absolute;
  inset:0;
  z-index:1;
  border-radius:inherit;
  pointer-events:none;
  background:linear-gradient(to bottom,rgba(0,0,0,.16) 0%,rgba(0,0,0,.10) 35%,rgba(0,0,0,.65) 100%);
}
#appView #dialogsView #messages .message-with-video .telegram-video-note .video-controls{
  background:transparent;
}
/* Photo attachments use the same directional corners as ordinary messages.
   Clip the media surface, leaving the external action-menu gutter visible. */
#appView #dialogsView #messages .message.inbound.message-with-image .media-image{
  border-radius:min(4px,var(--chat-radius,16px)) var(--chat-radius,16px) var(--chat-radius,16px) var(--chat-radius,16px);
}
#appView #dialogsView #messages .message.outbound.message-with-image .media-image{
  border-radius:var(--chat-radius,16px) var(--chat-radius,16px) min(4px,var(--chat-radius,16px)) var(--chat-radius,16px);
}
/* Controls remain over the full-size gradient, never obscured. */
#appView #dialogsView #messages .message-with-video .telegram-video-note .video-controls{z-index:3}
#appView #dialogsView #messages .message-with-video .telegram-video-note .video-play{z-index:2}
.message-action-result-dialog .message-result-actions{gap:10px;flex-wrap:wrap}
.message-action-result-dialog .message-result-local-delete{
  min-height:42px;padding:9px 14px;border-radius:11px;
  background:var(--danger,#b42318);color:#fff;
}
@media(max-width:480px){
 .message-action-result-dialog .message-result-actions button{flex:1 1 auto}
}
