/* Шапки и категории используют отдельные непрокручиваемые строки. */
.mobile-page-heading { display:none; }
.category-switcher { position:relative; display:grid; grid-template-columns:minmax(0,1fr) 40px; gap:4px; flex:none; min-width:0; width:100%; }
#appView .category-switcher>.category-strip { grid-column:1; grid-row:1; display:flex; flex-direction:row; flex-wrap:nowrap; min-width:0; width:100%; margin:0; padding:0; gap:4px; overflow-x:auto; overflow-y:hidden; scrollbar-width:none; overflow-anchor:none; }
.category-switcher>.category-strip::-webkit-scrollbar { display:none; }
#appView .category-switcher .category-strip>button { display:inline-flex; align-items:center; flex:none; justify-content:flex-start; width:auto; max-width:100%; min-height:40px; padding:8px 10px; white-space:nowrap; }
#appView .category-switcher .category-label { display:block; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#appView #dialogFilters .filter-icon { display:none; }
#appView #dialogFilters .filter-label { display:block; }
#appView #dialogsView #dialogFilters>button { width:auto; max-width:100%; padding:8px 10px; }
#appView .category-switcher>.category-overflow-toggle { grid-column:2; grid-row:1; display:grid; place-items:center; flex:none; width:40px; min-width:40px; height:40px; padding:9px; border:0; background:transparent; }
.category-overflow-toggle svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; }
#appView .category-description { display:none; grid-column:1/-1; grid-row:2; margin:4px 10px 10px; font-size:14px!important; line-height:1.4; }
.category-overflow-menu { position:fixed; z-index:90; min-width:210px; max-width:calc(100vw - 16px); overflow:auto; padding:6px; border:1px solid var(--line); border-radius:12px; background:var(--card); box-shadow:0 5px 20px #0002; }
.category-overflow-menu[hidden] { display:none; }
.category-overflow-menu button { display:block; width:100%; padding:10px 12px; text-align:left; background:transparent; color:var(--ink); border:0; border-radius:7px; overflow-wrap:anywhere; }
.category-overflow-menu button[aria-checked=true] { background:var(--accent2); font-weight:500; }
.category-overflow-menu button:hover { background:var(--control-hover); }
#appView #dialogMeta { display:none; }
#appView #dialogsView .dialog-head { padding-block:6px; }
#appView #dialogHead { z-index:20; }
#appView #dialogsView .dialog-head-main { min-height:40px; }
.conversation-menu { position:relative; flex:none; }
.conversation-menu>summary { display:grid; place-items:center; width:40px; height:40px; list-style:none; cursor:pointer; }
.conversation-menu>summary::marker,.conversation-menu>summary::-webkit-details-marker { display:none; }
.conversation-menu>summary svg { width:22px; height:22px; fill:currentColor; stroke:none; }
#appView .conversation-menu .dialog-actions { position:absolute; top:calc(100% + 5px); right:0; z-index:40; display:grid; gap:3px; min-width:230px; max-width:calc(100vw - 24px); padding:6px; background:var(--card); border:1px solid var(--line); border-radius:12px; box-shadow:0 5px 20px #0002; }
#appView .conversation-menu:not([open]) .dialog-actions { display:none; }
#appView .conversation-menu .dialog-actions button { display:flex; align-items:center; flex-direction:row; justify-content:flex-start; gap:10px; width:100%; height:auto; padding:10px; text-align:left; white-space:normal; border-radius:7px; }
#appView .conversation-menu .action-label { display:block; font-size:14px; }
#appView #bookingView .section-content { display:flex; flex-direction:column; overflow:hidden; }
#bookingView .section-content>.section-heading { flex:none; }
#appView #bookingView .section-content>.section-inner { order:1; flex:1; min-height:0; overflow:auto; padding-bottom:16px; }
#appView #bookingView .section-content>.panel-screen-active { flex:1; min-height:0; overflow:auto; padding-bottom:max(24px,env(safe-area-inset-bottom)); scroll-padding-bottom:24px; }
#appView #bookingView #bk-actionsPanel { order:2; position:relative; bottom:auto; width:calc(100% - 2*var(--content-inset)); max-width:var(--cabinet-content-width); flex:none; margin:0 auto; padding:10px 12px max(10px,env(safe-area-inset-bottom)); }
#bookingView #bk-actionsPanel .calendar-services { position:static; margin:0; padding:0 0 4px; background:transparent; }
#bookingView .slot.selected,#bookingView .slot.selected.service-colored { border-color:#285c3c; outline:1px solid #285c3c; outline-offset:0; box-shadow:none; border-color:transparent; }
@media(min-width:721px){
 #appView #bookingView .section-content { overflow:auto; }
 #appView #bookingView .section-content>.section-inner { flex:1 0 auto; overflow:visible; }
 #appView #bookingView .section-content>.panel-screen-active { flex:1 0 auto; overflow:visible; }
 #appView #bookingView #bk-actionsPanel { position:sticky; bottom:0; z-index:5; }
 #appView:not([data-section=home]) .topbrand { justify-content:center; }
 #appView .section-sidebar .category-switcher:not(:has(#dialogFilters)) { display:contents; }
 #appView .section-sidebar .category-switcher:not(:has(#dialogFilters))>.category-strip { flex-direction:column; overflow:visible; }
 #appView .section-sidebar .category-switcher:not(:has(#dialogFilters)) .category-strip>button { width:100%; }
 #appView .section-sidebar .category-switcher:not(:has(#dialogFilters))>.category-overflow-toggle { display:none; }
}
@media(max-width:720px){
 #appView { grid-template-rows:auto minmax(0,1fr); }
 #appView>.topbar { display:flex; min-height:60px; height:auto; padding:10px 12px; border-bottom:0; gap:8px; }
 #appView .topbrand { justify-content:flex-start; min-width:0; margin-right:auto; }
 #appView .topbrand>div { min-width:0; }
 #appView:not([data-section=home]) .mobile-page-heading { display:block; flex:1; min-width:0; text-align:left; }
 .mobile-page-heading h1 { margin:0; font-size:18px!important; font-weight:500; }
 .mobile-page-heading p { margin:3px 0 0; font-size:13px; line-height:1.35; color:var(--muted); }
 #appView:not([data-section=home]) .topbrand { flex:none; margin:0; order:1; }
 #appView:not([data-section=home]) .topbrand>div { display:none; }
 #appView #appMenu { order:2; flex:none; }
 #appView .brand-logo { width:32px; height:32px; }
 #appView .topbrand:has(img.hidden)::before { content:'ОД'; color:var(--accent); font-weight:600; }
 #appView .navigation-profile { justify-content:flex-start; padding:10px 12px; gap:7px; }
 #appView .section-shell,#appView #bookingView .booking-root.section-shell { display:flex; flex-direction:column; min-height:0; }
 #appView .section-shell>.section-sidebar,#appView #bookingView .tabs.section-sidebar { display:contents; }
 #appView .section-shell>.section-content { flex:1; min-height:0; overflow:auto; }
 #appView .section-content>.section-heading { display:none; }
 #appView .category-description { display:block; }
 #appView .category-switcher { padding:6px 10px 0; background:var(--card); }
 #appView .general-settings-nav .settings-search { flex:none; margin:0; padding:0 10px; background:var(--card); }
 #appView #generalSettingsSearchEmpty { margin:4px 20px; }
 #appView #dialogsView .side-tools { display:block; grid-row:2; grid-column:1/-1; padding:0; overflow:visible; }
 #appView.chat-conversation { grid-template-rows:minmax(0,1fr); }
 #appView.chat-conversation>.topbar { display:none; }
 #appView #appNavigation { max-height:calc(100dvh - 90px); overflow:auto; }
}

/* Служебные подсказки читаются независимо от выбранного фона переписки. */
.panel-notice { padding:20px 24px; border:1px solid #e5e5e5; border-radius:14px; background:#fff; color:#202123; line-height:1.5; overflow-wrap:anywhere; }
.panel-notice .muted { color:#505852; }
#emptyDialog { padding:24px; }
#emptyDialog .panel-notice { max-width:100%; text-align:center; }

/* Варианты select используют то же оформление, что и полный список категорий. */
.select-option-menu { z-index:200; overscroll-behavior:contain; }
.select-option-menu button[aria-selected=true] { background:var(--accent2); font-weight:500; }
.select-option-menu button:focus-visible { outline:2px solid #53b559; outline-offset:-2px; background:var(--control-hover,#f1f1f1); }
.select-option-menu button:disabled { opacity:.45; cursor:default; }
.select-option-group { margin:0; padding:8px 12px; font-size:13px; color:#616161; overflow-wrap:anywhere; }
.message-image-viewer .image-viewer-close { display:grid; place-items:center; line-height:1; }
.image-viewer-close svg { display:block; width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; }
@media(min-width:721px){ #dialogsView .messages-down { right:30px; } }
@media(max-width:720px){
 #appView #dialogsView #workspace.has-panel-screen:has(.recorder-panel) { --bg:#f7f7f8; --muted:#6b6b6b; background:#f7f7f8; color:#202123; }
}

/* Главная показывает статичный бренд; на остальных страницах логотип ведёт домой. */
#appView .topbrand { text-decoration:none; }
#appView[data-section=home] .topbrand { cursor:default; }
@media(max-width:720px){
 #appView:not([data-section=home])>.topbar { align-items:flex-start; }
 #appView:not([data-section=home]) .topbrand { min-height:40px; }
}
