/* Shared technical contract for EVERY CRM. Brand themes cannot redefine these tokens.
   Breakpoints: phone <=767px; tablet 768-1279px; desktop >=1280px.
   Keep explicit media queries: CSS custom properties do not work as media conditions. */
html[data-crm-ui][data-workspace-quality] {
  --ui-space-0:0px; --ui-space-1:4px; --ui-space-2:8px;
  --ui-space-3:12px; --ui-space-4:16px; --ui-space-5:20px;
  --ui-space-6:24px; --ui-space-7:28px; --ui-space-8:32px;
  --ui-type-body-size:16px; --ui-type-body-line:24px;
  --ui-type-label-size:15px; --ui-type-label-line:20px;
  --ui-type-title-size:17px; --ui-type-title-line:22px;
  --ui-type-control-size:15px; --ui-type-control-line:20px;
  --ui-type-weight-regular:400; --ui-type-weight-medium:500;
  --ui-type-weight-semibold:600; --ui-type-weight-bold:700;
  --ui-control-compact:36px; --ui-control-default:40px;
  --ui-control-touch:44px; --ui-control-auth:48px;
  --ui-panel-padding:var(--ui-space-5);
  --ui-panel-padding-compact:var(--ui-space-4);
  --ui-panel-gap:var(--ui-space-5);
  --ui-header-base-height:72px; --ui-header-phone-height:64px;
  --ui-table-row-height:45px; --ui-table-cell-block:4px;
  --ui-table-cell-inline:10px; --ui-table-type-size:15px; --ui-table-type-line:21px;
  --ui-calendar-regular-meta-size:14px; --ui-calendar-regular-title-size:15px;
  --ui-calendar-day-gap:3px; --ui-calendar-canvas-padding:var(--ui-space-2);
  --ui-calendar-day-radius:var(--ui-radius-sm);
  --ui-calendar-time-axis:56px; --ui-calendar-regular-time-axis:80px;
  --ui-calendar-month-entry-size:12px;
  --ui-forms-nav-width:220px;
  --ui-forms-preview-width:300px;
  --ui-forms-columns:var(--ui-forms-nav-width) minmax(0,1fr) var(--ui-forms-preview-width);
  --ui-radius:10px;
  --ui-radius-none:0px;
  --ui-radius-xs:calc(var(--ui-radius) / 3);
  --ui-radius-half:calc(var(--ui-radius) / 2);
  --ui-radius-sm:calc(var(--ui-radius) * 2 / 3);
  --ui-radius-md:var(--ui-radius);
  --ui-radius-lg:calc(var(--ui-radius) * 4 / 3);
  --ui-radius-xl:calc(var(--ui-radius) * 2);
  --ui-radius-2xl:calc(var(--ui-radius) * 8 / 3);
  --ui-radius-pill:calc(var(--ui-radius) * 1000);
  --ui-radius-circle:min(50%, var(--ui-radius-pill));
  --radius-sm:var(--ui-radius-sm);
  --radius-md:var(--ui-radius-md);
  --radius-lg:var(--ui-radius-lg);
  --radius-xl:var(--ui-radius-xl);
  --radius-2xl:var(--ui-radius-2xl);
  --radius-3xl:calc(var(--ui-radius) * 4);
  --ui-nav-icon-scale:.84;
  --ui-nav-icon-selected-scale:1;
  --ui-nav-icon-hover-scale:1.12;
  --ui-font:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-sans:var(--ui-font);
  --font-head:var(--ui-font);
}
@media(max-width:767px){
 html[data-crm-ui][data-workspace-quality]{--ui-panel-gap:var(--ui-space-4);--ui-calendar-month-entry-size:10px}
}
/* Existing wrappers are adapters to this contract, not independent designs. */
/* One page gutter for every CRM workspace and its loading state. */
html[data-crm-ui][data-workspace-quality]{--ui-content-gutter:var(--ui-space-6)}
@media(max-width:767px){html[data-crm-ui][data-workspace-quality]{--ui-content-gutter:var(--ui-space-3)}}

/* Page canvases. Card, field and message padding remain component spacing. */
html[data-crm-ui][data-workspace-quality] #root :is(
 [data-contact-panel]>main,
 .role-access:not(.ra-member-only)>.ra-layout,
 .staff-workspace>.sw-layout,
 .workspace-settings-content,
 [data-appointment-content],
 [data-mobile-section-body="party"],
 .crm-party-page-skeleton,
 [data-workspace-section-host="party"] .flex-grow.overflow-y-auto.p-6,
 [data-workspace-section-host="profile"] .max-w-5xl.overflow-y-auto,
 .crm-profile-settings-skeleton .max-w-5xl
):not([data-form-preview-viewport] *){
 padding:var(--ui-content-gutter)!important;box-sizing:border-box;min-width:0
}
html[data-crm-ui][data-crm-home-rebuild][data-workspace-quality] #root .dashboard-ui:not([data-mobile-dashboard-details])>[data-workspace-section-body="dashboard"].dashboard-content{
 padding:var(--ui-content-gutter)!important;max-width:none!important;box-sizing:border-box
}

/* Use the page gutter once, instead of nesting another padded page inside it. */
html[data-crm-ui][data-workspace-quality] #root .workspace-settings-content>.workspace-settings-profile{
 padding:0!important;max-width:none!important;width:100%;margin-inline:0!important
}
html[data-crm-ui][data-workspace-quality] #root :is(
 [data-workspace-section-host="profile"] .max-w-5xl.overflow-y-auto,
 .crm-profile-settings-skeleton .max-w-5xl
){max-width:none!important;margin-inline:0!important}

/* Identity bars and secondary tools share the content's horizontal alignment. */
html[data-crm-ui][data-workspace-quality] #root :is(
 [data-section-header], [data-section-tools],
 .role-access-chrome>.ra-toolbar, .workspace-settings-nav
):not([data-form-preview-viewport] *){
 padding-inline:var(--ui-content-gutter)!important;box-sizing:border-box
}

/* Authenticated section headers reuse account navigation and one support dialog. */
html[data-crm-ui][data-workspace-quality] #root [data-crm-header-account-actions]{display:inline-flex;align-items:center;gap:4px;flex:none;}
html[data-crm-ui][data-workspace-quality] #root [data-crm-header-profile]{
  display:inline-flex;align-items:center;justify-content:center;flex:none;width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;
  padding:0;border:0;border-radius:var(--ui-radius-pill);background:transparent;color:var(--ui-brand-ink);cursor:pointer;
}
html[data-crm-ui][data-workspace-quality] #root .crm-header-account-avatar{
  position:relative;display:grid;place-items:center;flex:none;width:36px;height:36px;overflow:hidden;border-radius:50%;
  font-size:14px;font-weight:600;background:var(--ui-brand);color:var(--ui-on-brand);
}
html[data-crm-ui][data-workspace-quality] #root .crm-header-account-avatar img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;}
html[data-crm-ui][data-workspace-quality] #root [data-crm-header-support]{
  display:inline-flex;align-items:center;justify-content:center;flex:none;gap:6px;
  width:auto!important;height:36px!important;min-width:36px!important;min-height:36px!important;padding:8px;
  border:0;border-radius:var(--ui-radius-lg);background:transparent;color:var(--ui-brand-ink);cursor:pointer;
}
html[data-crm-ui][data-workspace-quality] #root [data-crm-header-support] [data-support-label]{font-size:14px;line-height:20px;font-weight:600;white-space:nowrap;}
html[data-crm-ui][data-workspace-quality] #root [data-crm-header-support] svg{width:20px!important;height:20px!important;flex:none;}
html[data-crm-ui][data-workspace-quality] #root .workspace-mobile-home-actions [data-crm-header-support]{color:var(--ui-gold);}
@media(hover:hover){html[data-crm-ui][data-workspace-quality] #root [data-crm-header-support]:hover{background:var(--ui-selected);}}
html[data-crm-ui][data-workspace-quality] #root [data-crm-support-dialog]{
  box-sizing:border-box;width:min(440px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow-y:auto;
  padding:24px;border:1px solid var(--ui-border);border-radius:var(--ui-radius-lg);margin:auto;
  background:var(--ui-surface);color:var(--ui-text);box-shadow:0 12px 40px rgb(0 0 0 / .2);
}
html[data-crm-ui][data-workspace-quality] #root [data-crm-support-dialog]::backdrop{background:rgb(0 0 0 / .32);}
html[data-crm-ui][data-workspace-quality] #root [data-crm-support-heading]{display:flex;align-items:center;justify-content:space-between;gap:16px;}
html[data-crm-ui][data-workspace-quality] #root [data-crm-support-heading] h2{margin:0;font-size:18px!important;line-height:24px;font-weight:700;}
html[data-crm-ui][data-workspace-quality] #root [data-crm-support-close]{display:grid;place-items:center;flex:none;width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;padding:0;border:0!important;border-radius:var(--ui-radius);background:transparent;color:inherit;box-shadow:none!important;cursor:pointer;}
html[data-crm-ui][data-workspace-quality] #root :is([data-crm-support-close],[data-crm-header-profile],[data-crm-header-support]):focus-visible{outline:2px solid var(--ui-focus);outline-offset:2px;}
html[data-crm-ui][data-workspace-quality] #root [data-crm-support-dialog] p{margin:16px 0;font-size:16px;line-height:24px;}
html[data-crm-ui][data-workspace-quality] #root [data-crm-support-contact]{color:var(--ui-brand-ink);font-weight:600;text-decoration:underline;text-underline-offset:3px;}
html[data-crm-ui][data-workspace-quality] #root [data-info-profile-action]{
  display:inline-flex!important;align-items:center!important;justify-content:center!important;flex:none;
  width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;padding:0!important;
}
html[data-crm-ui][data-workspace-quality] #root [data-info-profile-action] svg{width:22px!important;height:22px!important;}
/* Conversation tools use one centerline across the chat and its profile pane.
   Resolve the token on each owner so its header padding/safe area stays local. */
html[data-crm-ui][data-workspace-quality] #root :is(
 [data-crm-chat]>[data-crm-toolbar],.crm-chat-loading-frame>[data-crm-toolbar],
 [data-info-profile-header],[data-info-profile-shell]
){--ui-conversation-action-center:calc(var(--ui-header-safe-top,0px) + (var(--ui-header-height,72px) - var(--ui-header-border,1px)) / 2);}
html[data-crm-ui][data-workspace-quality] #root [data-chat-header-actions]{
  display:flex;align-items:center;align-self:flex-start;flex:none;
  height:44px;min-height:44px;
  margin-block-start:calc((var(--ui-header-height,72px) - var(--ui-header-border,1px)) / 2 - var(--ui-header-padding,12px) - 22px);
}
html[data-crm-ui][data-workspace-quality] #root [data-info-profile-header]>[data-info-profile-action],
html[data-crm-ui][data-workspace-quality] #root [data-info-profile-shell]>[data-info-profile-action="close"]{
  position:absolute;top:calc(var(--ui-conversation-action-center) - 22px)!important;margin-block:0;
}
html[data-crm-ui][data-workspace-quality] #root [data-info-profile-shell]>[data-info-profile-action="close"]{
  right:12px;z-index:50;
}
html[data-crm-ui][data-workspace-quality] #root [data-info-profile-action="close"][data-docked="true"]{display:none!important;}
@media(max-width:767px){
  html[data-crm-ui][data-workspace-quality]:not(.telegram-mini-app) #root [data-mobile-workspace-content]:not([hidden]) :is([data-info-profile-header],[data-info-profile-shell]){
    --ui-header-safe-top:env(safe-area-inset-top,0px);
  }
}
html[data-crm-ui][data-workspace-quality] #root .crm-info-profile-avatar{
  width:112px!important;height:112px!important;min-width:112px!important;min-height:112px!important;flex-shrink:0;
}
html[data-crm-ui][data-workspace-quality] #root .crm-info-profile-avatar>img{width:100%;height:100%;object-fit:cover;border-radius:inherit;}
@media(max-width:767px){
 html[data-crm-ui][data-workspace-quality] #root :is([data-section-header],.workspace-mobile-home-header) :is([data-refresh-label],[data-support-label],[data-mobile-form-action="create"] [data-mobile-action-label],[data-appointment-book]>span):not([data-form-preview-viewport] *),
 html[data-crm-ui][data-workspace-quality] #root [data-mobile-form-toolbar] [data-mobile-form-action] [data-mobile-action-label]:not([data-form-preview-viewport] *){display:none!important;}
 html[data-crm-ui][data-workspace-quality] #root :is([data-section-header],.workspace-mobile-home-header) :is(button[data-section-refresh],button[data-crm-header-support],button[data-crm-header-profile],button[data-mobile-form-action="create"],button[data-appointment-book],button[data-section-menu],button.workspace-mobile-profile):not([data-form-preview-viewport] *),
 html[data-crm-ui][data-workspace-quality] #root [data-section-header][data-uniform-section-header] button[data-appointment-book]:not([data-form-preview-viewport] *),
 html[data-crm-ui][data-workspace-quality] #root [data-mobile-form-toolbar] :is(button[data-mobile-form-action],a[data-mobile-form-action]):not([data-form-preview-viewport] *){
  width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;gap:0!important;flex:none;justify-content:center;
 }
}

/* Forms are a split workspace: apply the gutter to each pane, not the grid. */
html[data-crm-ui][data-workspace-quality] #root :is(
 .crm-forms-nav-pane,.crm-forms-editor-pane,
 .crm-form-skeleton-nav,.crm-form-skeleton-editor
):not([data-form-preview-viewport] *){
 padding:var(--ui-content-gutter)!important;box-sizing:border-box;min-width:0
}
html[data-crm-ui][data-workspace-quality] #root :is(
 .crm-forms-preview-pane>div,.crm-form-skeleton-analytics>div
):not([data-form-preview-viewport] *){padding-inline:var(--ui-content-gutter)!important;box-sizing:border-box}
html[data-crm-ui][data-workspace-quality] #root :is(.crm-forms-editor-pane,.crm-form-skeleton-editor)>[data-form-toolbar]{margin-inline:0!important;background:transparent!important;border-color:transparent!important}

/* Lists keep their pane boundaries; text and tools use the same page gutter. */
html[data-crm-ui][data-workspace-quality] #root .appeal-list-toolbar:not([data-form-preview-viewport] *){background:var(--ui-surface,#fff)!important}
html[data-crm-ui][data-workspace-quality] #root :is(
 .appeal-list-toolbar,.appeals-list-ui .appeal-list-row:not([data-layout-skeleton-row]),
 .appeals-list-ui [role="status"].text-center,
 .agenda-inbox-tabs,.agenda-inbox-detail-header
):not([data-form-preview-viewport] *){padding-inline:var(--ui-content-gutter)!important;box-sizing:border-box}
html[data-crm-ui][data-workspace-quality] #root .appeals-list-ui .appeal-list-row:not([data-layout-skeleton-row]){padding-block:var(--ui-space-3)!important}

/* The inline mobile dashboard already sits inside the home page gutter. */
@media(max-width:767px){
 html[data-crm-ui][data-workspace-quality] #root main.workspace-mobile-home{--ui-mobile-gutter:var(--ui-content-gutter)}
 html[data-crm-ui][data-workspace-quality] #root .workspace-mobile-dashboard-details{margin-inline:var(--ui-content-gutter)!important}
 html[data-crm-ui][data-workspace-quality] #root .dashboard-ui[data-mobile-dashboard-details]>.dashboard-content{padding:0!important}
}

/* System settings are embedded in the already padded settings canvas. */
html[data-crm-ui][data-workspace-quality] #root .workspace-system-settings>div>.flex-grow.overflow-y-auto{
 padding-inline:0!important;padding-top:0!important
}

/* Match every contact header to the table's existing outer top corners.
   Keep overflow unchanged so sorting and resize handles remain interactive. */
html[data-crm-ui][data-workspace-quality] #root [data-contact-column-layout][data-contact-flat-table] thead th[data-contact-column] {
  background-clip:padding-box!important;
  border-top-left-radius:var(--ui-radius-lg,13.333px)!important;
  border-top-right-radius:var(--ui-radius-lg,13.333px)!important;
}

/* A fixed selection column shares the table's row and sticky-header geometry. */
html[data-crm-ui][data-workspace-quality] #root [data-contact-table-viewport] {min-width:0;position:relative}
html[data-crm-ui][data-workspace-quality] #root [data-contact-flat-table] :is(th,td)[data-contact-selection-cell]:not([data-form-preview-viewport] *) {
 position:sticky!important;left:0;z-index:1;width:var(--contact-selection-width,44px)!important;
 padding:0!important;border-right:3px solid transparent!important;background:var(--ui-surface)!important;background-clip:padding-box!important;
}
html[data-crm-ui][data-workspace-quality] #root [data-contact-flat-table] th[data-contact-selection-cell]:not([data-form-preview-viewport] *) {
 top:0;z-index:4;background-clip:padding-box!important;background-color:color-mix(in srgb,var(--ui-brand) 10%,var(--ui-surface))!important;
 border-radius:var(--ui-radius-lg) var(--ui-radius-lg) 0 0;
}
html[data-crm-ui][data-workspace-quality] #root [data-contact-selection-cell] [data-contact-select] {
 display:flex!important;align-items:center;justify-content:center;box-sizing:border-box;
 width:100%!important;height:44px;margin:0;padding:0;gap:0;
}
html[data-crm-ui][data-workspace-quality] #root [data-contact-selection-cell] input[type="checkbox"] {
 width:17px!important;height:17px!important;min-width:17px!important;max-width:17px!important;
 min-height:17px!important;max-height:17px!important;flex:0 0 17px!important;box-sizing:border-box;margin:0!important;padding:0!important;
}
html[data-crm-ui][data-workspace-quality] #root [data-contact-surface="filters"][data-contact-filters-open]:not([data-form-preview-viewport] *) {
 padding:0!important;border:0!important;background:transparent!important;
}
html[data-crm-ui][data-workspace-quality] #root [data-contact-search-actions] {display:flex;align-items:center;gap:6px;min-width:0}
html[data-crm-ui][data-workspace-quality] #root [data-contact-search-actions] [data-broadcast-primary] {
 margin-left:auto!important;display:inline-flex;align-items:center;justify-content:center;gap:5px;
 background:var(--ui-brand);color:var(--ui-on-brand);border:1px solid transparent;border-radius:var(--ui-radius-md);
 min-height:var(--ui-control-default);padding:8px 12px;font:inherit;cursor:pointer;
}
@media(max-width:767px){
 html[data-crm-ui][data-workspace-quality] #root [data-contact-search-actions] {flex-wrap:nowrap!important}
 html[data-crm-ui][data-workspace-quality] #root [data-contact-search-actions] [data-contact-filter-toggle] {margin-left:0!important;width:36px;min-width:36px;padding:0!important}
 html[data-crm-ui][data-workspace-quality] #root [data-contact-search-actions] [data-contact-filter-toggle] span {display:none}
}

/* Inert loading spacers retain table scroll geometry without offscreen cells. */
html[data-crm-ui][data-workspace-quality] #root [data-contact-flat-table] [data-contact-row-spacer] > td {
  height:var(--contact-spacer-height)!important;padding:0!important;border:0!important;
  background:transparent!important;line-height:0!important;
}

/* Calendar toolbar controls reuse the search field's radius; joined groups
   round only their outside corners so adjacent segments remain seamless. */
html[data-crm-ui][data-workspace-quality] #root [data-appointment-search] input{
  border-radius:var(--ui-radius)!important;
}
html[data-crm-ui][data-workspace-quality] #root [data-appointment-period-navigation] {
  display:grid;grid-template-columns:var(--ui-control-compact) minmax(0,1fr) var(--ui-control-compact);
  align-items:center;min-width:0;gap:0;
}
html[data-crm-ui][data-workspace-quality] #root [data-appointment-current-period] {
  display:flex;align-items:center;justify-content:center;min-width:0;min-height:var(--ui-control-compact);
  padding:var(--ui-space-1) var(--ui-space-2);border-radius:var(--ui-radius)!important;
  background:var(--ui-surface);color:var(--ui-text);text-align:center;white-space:normal;
  font-size:var(--ui-type-label-size);line-height:var(--ui-type-label-line);font-weight:var(--ui-type-weight-semibold);
}
html[data-crm-ui][data-workspace-quality] #root [data-appointment-calendar-tools] :is([data-appointment-unit],[data-appointment-view]) {
  display:flex;align-items:center;box-sizing:border-box;
  height:var(--ui-control-compact);min-height:var(--ui-control-compact);padding:0!important;
  border-radius:var(--ui-radius)!important;
}
html[data-crm-ui][data-workspace-quality] #root [data-appointment-calendar-tools] :is([data-appointment-unit],[data-appointment-view]) > button {
  display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;
  height:var(--ui-control-compact);min-height:var(--ui-control-compact)!important;
  padding:0 var(--ui-space-2)!important;line-height:var(--ui-type-control-line)!important;
  border-radius:0!important;
}
html[data-crm-ui][data-workspace-quality] #root [data-appointment-calendar-tools] :is([data-appointment-unit],[data-appointment-view]) > button:first-child{
  border-start-start-radius:var(--ui-radius)!important;border-end-start-radius:var(--ui-radius)!important;
}
html[data-crm-ui][data-workspace-quality] #root [data-appointment-calendar-tools] :is([data-appointment-unit],[data-appointment-view]) > button:last-child{
  border-start-end-radius:var(--ui-radius)!important;border-end-end-radius:var(--ui-radius)!important;
}
html[data-crm-ui][data-workspace-quality] #root [data-appointment-calendar-tools]>:not([data-appointment-unit],[data-appointment-view])>button {
  border-radius:var(--ui-radius)!important;
}
html[data-crm-ui][data-workspace-quality] #root [data-appointment-calendar-tools] [data-appointment-view] > button {
  width:var(--ui-control-compact);min-width:var(--ui-control-compact)!important;
}
html[data-crm-ui][data-workspace-quality] #root [data-appointment-calendar-tools] [data-appointment-view] > button svg {
  width:var(--ui-space-4)!important;height:var(--ui-space-4)!important;flex:none;
}
@media(max-width:767px){
  html[data-crm-ui][data-workspace-quality] #root [data-appointment-period-navigation] {
    width:100%;flex-basis:100%;grid-column:1 / -1;
  }
  html[data-crm-ui][data-workspace-quality] #root [data-section-tools="appointments"] [data-appointment-calendar-tools] {
    display:flex!important;flex-wrap:wrap;grid-column:1 / -1;
  }
}

/* Hover enlarges only the sidebar artwork, preserving labels and badges. */
@media(min-width:768px) and (hover:hover) and (pointer:fine){
  html[data-crm-ui][data-workspace-quality] #root [data-crm-navigation] .workspace-nav-item:is(:hover,:focus-visible) .workspace-nav-art>img {
    transform:translateX(-50%) scale(calc(var(--ui-nav-icon-scale) * var(--ui-nav-icon-hover-scale)));
  }
  html[data-crm-ui][data-workspace-quality] #root [data-crm-navigation] .workspace-nav-item[aria-current="page"]:is(:hover,:focus-visible) .workspace-nav-art>img {
    transform:translateX(-50%) scale(calc(var(--ui-nav-icon-selected-scale) * var(--ui-nav-icon-hover-scale)));
  }
}

/* Destructive actions use the same semantic ink as notification counters. */
html[data-crm-ui][data-workspace-quality] #root :is(
  [data-workspace-logout],.workspace-mobile-account-logout,
  [data-access-action="delete"],[data-destructive-action],
  button[aria-label^="Удалить"],button[title^="Удалить"],
  button:has(svg:is(.lucide-trash,.lucide-trash-2,.lucide-trash2)),
  button:is(.text-red-500,.text-red-600,.text-red-700,.text-red-800,.text-red-900,
    .text-rose-500,.text-rose-600,.text-rose-700,.text-rose-800,.text-rose-900)
):not([data-form-preview-viewport] *) {
  color:var(--ui-notification,#e8554e)!important;
}

/* Shared controlled filters/sorting for appeal and chat lists, including reload trigger. */
html[data-crm-ui][data-workspace-quality] #root .crm-list-filter-toggle {
  position:relative;display:flex;align-items:center;justify-content:center;flex-shrink:0;
  width:var(--ui-control-touch);height:var(--ui-control-touch);min-width:var(--ui-control-touch);min-height:var(--ui-control-touch);
  padding:var(--ui-space-2);border:1px solid transparent;border-radius:var(--ui-radius-md);background:transparent;color:var(--ui-secondary);cursor:pointer;
}
html[data-crm-ui][data-workspace-quality] #root .crm-list-filter-toggle:is([aria-expanded=true],[data-active=true]) {background:var(--ui-selected);color:var(--ui-brand-ink);border-color:var(--ui-control-border)}
html[data-crm-ui][data-workspace-quality] #root .crm-list-filter-toggle__count {position:absolute;inset-block-start:0;inset-inline-end:0;display:flex;align-items:center;justify-content:center;min-width:16px;height:16px;padding-inline:2px;box-sizing:border-box;border-radius:var(--ui-radius-pill);background:var(--ui-brand-ink);color:var(--ui-on-brand);font-size:11px!important;line-height:16px!important;font-weight:var(--ui-type-weight-semibold)!important}
html[data-crm-ui][data-workspace-quality] #root .crm-list-filters {
  display:flex;flex-direction:column;flex-shrink:0;min-width:0;gap:6px;padding:8px;
  box-sizing:border-box;border-bottom:1px solid var(--ui-control-border);background:var(--ui-surface-well);color:var(--ui-text);
}
html[data-crm-ui][data-workspace-quality] #root .crm-list-filters :is(button,input,select,label,legend,p,span,h3) {font-family:var(--ui-font);text-transform:none;letter-spacing:normal}
html[data-crm-ui][data-workspace-quality] #root .crm-list-filters__choices {display:flex;flex-wrap:wrap;gap:4px;min-width:0}
html[data-crm-ui][data-workspace-quality] #root :is(.crm-list-filters__tag,.crm-list-filters__order,.crm-list-filters__sort,.crm-list-filters__reset) {
  box-sizing:border-box;min-width:0;min-height:28px;padding:4px 6px;border:1px solid transparent;
  border-radius:var(--ui-radius-pill);background:var(--ui-surface);color:var(--ui-text);
  font-size:13px!important;line-height:18px!important;font-weight:var(--ui-type-weight-regular)!important;cursor:pointer;
}
html[data-crm-ui][data-workspace-quality] #root .crm-list-filters__tag {white-space:nowrap;max-width:100%}
html[data-crm-ui][data-workspace-quality] #root .crm-list-filters__tag[aria-pressed=true] {border-color:var(--ui-brand);background:var(--ui-brand);color:var(--ui-on-brand)}
html[data-crm-ui][data-workspace-quality] #root .crm-list-filters__sorting {display:flex;align-items:center;gap:4px;min-width:0}
html[data-crm-ui][data-workspace-quality] #root .crm-list-filters__order {flex:none}
html[data-crm-ui][data-workspace-quality] #root .crm-list-filters__sort {flex:1;width:0;border-color:var(--ui-control-border);padding-right:20px}
html[data-crm-ui][data-workspace-quality] #root .crm-list-filters__reset {align-self:flex-end;background:transparent;color:var(--ui-brand-ink)}
html[data-crm-ui][data-workspace-quality] #root .crm-list-filters__hint {margin:0;font-size:13px!important;line-height:18px!important;color:var(--ui-secondary)}
html[data-crm-ui][data-workspace-quality] #root :is(.crm-list-filter-toggle,.crm-list-filters button,.crm-list-filters select):focus-visible {outline:2px solid var(--ui-focus);outline-offset:2px}
html[data-crm-ui][data-workspace-quality] #root .crm-list-filters__sr {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(pointer:coarse) {html[data-crm-ui][data-workspace-quality] #root :is(.crm-list-filters__tag,.crm-list-filters__order,.crm-list-filters__sort,.crm-list-filters__reset) {min-height:36px}}
@media(hover:hover) {html[data-crm-ui][data-workspace-quality] #root .crm-list-filters__tag:hover {border-color:var(--ui-brand-ink)}}

/* One appointment booking view in appeal information, including loading geometry. */
html[data-crm-ui][data-workspace-quality] #root [data-appointment-booking] {
  padding:var(--ui-space-3);min-width:0;background:var(--ui-surface);color:var(--ui-text);
  border-block:1px solid var(--ui-control-border);text-align:start;
}
html[data-crm-ui][data-workspace-quality] #root [data-appointment-booking] :is(button,input,label,legend,p,span,time) {
  font-family:var(--ui-font);letter-spacing:normal;text-transform:none;
}
html[data-crm-ui][data-workspace-quality] #root [data-appointment-booking] :is(button,input) {
  font-size:var(--ui-type-control-size)!important;line-height:var(--ui-type-control-line)!important;font-weight:var(--ui-type-weight-medium)!important;
}
html[data-crm-ui][data-workspace-quality] #root .crm-appointment-booking__toggle {
  display:flex;align-items:center;gap:var(--ui-space-2);width:100%;min-width:0;
  min-height:var(--ui-control-touch);padding:0;border:0;background:transparent;color:var(--ui-text);text-align:start;cursor:pointer;
}
html[data-crm-ui][data-workspace-quality] #root .crm-appointment-booking__title {flex:1;min-width:0;font-weight:var(--ui-type-weight-semibold);overflow-wrap:normal;word-break:normal}
html[data-crm-ui][data-workspace-quality] #root [data-appointment-booking] :is(.crm-appointment-booking__icon,.crm-appointment-booking__chevron) {width:16px;height:16px;flex-shrink:0;color:var(--ui-brand-ink)}
html[data-crm-ui][data-workspace-quality] #root .crm-appointment-booking__toggle[aria-expanded=true] .crm-appointment-booking__chevron {transform:rotate(180deg)}
html[data-crm-ui][data-workspace-quality] #root .crm-appointment-booking__body {display:flex;flex-direction:column;gap:var(--ui-space-4);padding-top:var(--ui-space-3);margin-top:var(--ui-space-2);border-top:1px solid var(--ui-control-border);min-width:0}
html[data-crm-ui][data-workspace-quality] #root .crm-appointment-booking__field {display:block;min-width:0;padding:0;margin:0;border:0}
html[data-crm-ui][data-workspace-quality] #root .crm-appointment-booking__label {display:block;padding:0;margin-bottom:var(--ui-space-2);font-size:var(--ui-type-label-size);line-height:var(--ui-type-label-line);font-weight:var(--ui-type-weight-medium);color:var(--ui-secondary)}
html[data-crm-ui][data-workspace-quality] #root .crm-appointment-booking__topic {
  width:100%;min-width:0;box-sizing:border-box;min-height:var(--ui-control-touch);padding:var(--ui-space-2) var(--ui-space-3);
  border:1px solid var(--ui-control-border);border-radius:var(--ui-radius-md);background:var(--ui-field);color:var(--ui-text);
}
html[data-crm-ui][data-workspace-quality] #root :is(.crm-appointment-booking__days,.crm-appointment-booking__times) {display:grid;min-width:0;gap:var(--ui-space-2)}
html[data-crm-ui][data-workspace-quality] #root .crm-appointment-booking__days {grid-template-columns:repeat(auto-fit,minmax(min(88px,100%),1fr))}
html[data-crm-ui][data-workspace-quality] #root .crm-appointment-booking__times {grid-template-columns:repeat(auto-fit,minmax(min(64px,100%),1fr))}
html[data-crm-ui][data-workspace-quality] #root .crm-appointment-booking__option {position:relative;display:flex;min-width:0;margin:0;cursor:pointer}
html[data-crm-ui][data-workspace-quality] #root .crm-appointment-booking__option>input {position:absolute;width:1px;height:1px;opacity:0;margin:0;pointer-events:none}
html[data-crm-ui][data-workspace-quality] #root .crm-appointment-booking__option-body {
  display:flex;flex:1;flex-direction:column;align-items:center;justify-content:center;gap:var(--ui-space-1);
  min-width:0;box-sizing:border-box;min-height:var(--ui-control-touch);padding:var(--ui-space-2);
  border:1px solid var(--ui-control-border);border-radius:var(--ui-radius-md);background:var(--ui-field);color:var(--ui-text);
  font-size:var(--ui-type-control-size)!important;line-height:var(--ui-type-control-line)!important;
  font-weight:var(--ui-type-weight-medium)!important;font-variant-numeric:tabular-nums;white-space:nowrap;overflow-wrap:normal;word-break:normal;
}
html[data-crm-ui][data-workspace-quality] #root .crm-appointment-booking__option-body>:is(span,time) {font-size:inherit!important;line-height:inherit!important;white-space:nowrap;overflow-wrap:normal;word-break:normal}
html[data-crm-ui][data-workspace-quality] #root .crm-appointment-booking__day .crm-appointment-booking__option-body {min-height:64px}
html[data-crm-ui][data-workspace-quality] #root .crm-appointment-booking__date {color:var(--ui-secondary)}
html[data-crm-ui][data-workspace-quality] #root .crm-appointment-booking__option[data-selected=true] .crm-appointment-booking__option-body {border-color:var(--ui-brand-ink);background:var(--ui-selected);color:var(--ui-brand-ink);box-shadow:inset 0 0 0 1px var(--ui-brand-ink)}
html[data-crm-ui][data-workspace-quality] #root .crm-appointment-booking__option[data-selected=true] .crm-appointment-booking__date {color:inherit}
html[data-crm-ui][data-workspace-quality] #root .crm-appointment-booking__option:focus-within .crm-appointment-booking__option-body {outline:2px solid var(--ui-focus);outline-offset:2px}
html[data-crm-ui][data-workspace-quality] #root [data-appointment-booking] :is(button,input.crm-appointment-booking__topic):focus-visible {outline:2px solid var(--ui-focus);outline-offset:2px}
html[data-crm-ui][data-workspace-quality] #root .crm-appointment-booking__submit {
  display:flex;align-items:center;justify-content:center;min-height:var(--ui-control-touch);width:100%;padding:var(--ui-space-2) var(--ui-space-3);
  border:0;border-radius:var(--ui-radius-md);background:var(--ui-brand-ink);color:var(--ui-on-brand);cursor:pointer;
}
html[data-crm-ui][data-workspace-quality] #root [data-appointment-booking] :is(button:disabled,.crm-appointment-booking__option[data-disabled=true]) {cursor:default;opacity:.55}
html[data-crm-ui][data-workspace-quality] #root .crm-appointment-booking__feedback {margin:var(--ui-space-2) 0 0;color:var(--ui-secondary);font-size:var(--ui-type-label-size);line-height:var(--ui-type-label-line);overflow-wrap:normal}
html[data-crm-ui][data-workspace-quality] #root .crm-appointment-booking__feedback[role=alert] {color:var(--ui-brand-ink);border-inline-start:3px solid var(--ui-notification);padding-inline-start:var(--ui-space-2)}
html[data-crm-ui][data-workspace-quality] #root .crm-appointment-booking__placeholder {display:inline-block;height:1em;max-width:100%;vertical-align:middle}
@media(hover:hover) {
 html[data-crm-ui][data-workspace-quality] #root .crm-appointment-booking__option:not([data-disabled=true]):hover .crm-appointment-booking__option-body {border-color:var(--ui-brand-ink)}
 html[data-crm-ui][data-workspace-quality] #root .crm-appointment-booking__submit:not(:disabled):hover {background:var(--ui-brand-ink);filter:brightness(.94)}
}
@media(prefers-reduced-motion:no-preference) {
 html[data-crm-ui][data-workspace-quality] #root .crm-appointment-booking__option-body {transition:border-color 120ms cubic-bezier(.22,1,.36,1),background-color 120ms cubic-bezier(.22,1,.36,1)}
}

/* The public renderer owns the same answer geometry in the CRM preview and on the site. */
#root [data-form-intro]{display:flex;align-items:center;gap:12px;box-sizing:border-box;max-width:768px;min-width:0;margin:0 auto 16px}
#root [data-form-intro]>img{display:block;width:48px;height:48px;flex:0 0 48px;object-fit:contain}
#root [data-form-intro]>div{min-width:0}
#root [data-form-intro] h2{margin:0;font:700 30px/1.25 var(--ui-font,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif);color:var(--ui-form-muted,#0f172a);overflow-wrap:anywhere}
#root [data-form-intro] p{margin:4px 0 0;font:400 14px/20px var(--ui-font,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif);color:var(--ui-form-muted,#0f172a);overflow-wrap:anywhere}
#root [data-form-intro][data-form-intro-size="mobile"]{padding-inline:20px}
#root [data-form-intro][data-form-intro-size="mobile"] h2{font-size:18px}
#root [data-form-canvas] input[type="checkbox"]{accent-color:var(--ui-form-check,#00529b)!important}
#root [data-form-canvas] input[type="checkbox"]:focus-visible{outline:2px solid var(--ui-form-check,#00529b)!important;outline-offset:3px}
#root [data-public-form-heading] {--crm-focus:var(--ui-form-title,#000)}
#root [data-public-form-heading] :is(h1,textarea[aria-label="Название формы"]) {
  color:var(--ui-form-title,#000);text-shadow:none;text-align:center;
}
#root [data-public-form-heading] textarea[aria-label="Название формы"]::placeholder {color:var(--ui-form-title,#000);opacity:.8}
#root [data-public-form-heading] textarea[aria-label="Название формы"]:focus {background:transparent;border-color:var(--ui-form-title,#000)}
#root [data-public-form-heading] p {color:var(--ui-form-muted,#dcecff)}
#root [data-form-canvas] > [data-collective-controls],
#root [data-form-canvas] > [data-collective-controls] :is(label,span,a) {color:var(--ui-form-muted,#dcecff)!important}
#root [data-form-layout-root] {
  border-radius:32px!important;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  font-size:14px;line-height:1.5;
}
@media(max-width:767px){
 #root [data-form-intro]{padding-inline:20px}
 #root [data-form-intro] h2{font-size:18px}
 #root [data-public-form-page] [data-form-content-main]{padding-inline:0}
 html[data-crm-ui][data-workspace-quality] #root :is(.crm-forms-editor-pane>[data-form-preview-viewport],.crm-form-skeleton-editor>.crm-form-skeleton-preview){
  width:calc(100% + var(--ui-content-gutter) * 2)!important;max-width:none!important;margin-inline:calc(var(--ui-content-gutter) * -1)!important;
 }
}
#root [data-form-layout-root] [data-collective-layout-block]{margin-block:0}
#root [data-form-layout-root] [data-form-layout-field]:not([data-form-question-id]) {
  display:grid;gap:8px;min-width:0;
}
#root [data-form-layout-root] [data-form-layout-field]:not([data-form-question-id])>* {margin-block:0!important}

#root [data-form-layout-root] [data-form-submit] {
  display:inline-flex;align-items:center;justify-content:center;gap:12px;
  width:fit-content;max-width:100%;min-height:54px;padding:12px 24px;
  border:0;border-radius:16px;box-sizing:border-box;font:700 24px/30px -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
}
#root [data-form-layout-root] [data-form-submit] input[aria-label="Текст кнопки отправки"] {
  min-width:1ch;max-width:calc(100% + 12px);min-height:0;height:32px;padding:0 5px!important;margin:0;
  border:1px solid rgb(255 255 255 / .7)!important;border-radius:4px;background:transparent!important;color:inherit!important;
  font:inherit;line-height:30px;box-shadow:none!important;outline-offset:3px;
}
#root [data-form-layout-root] [data-form-submit] [data-form-send-icon] {
  width:1.33ex!important;height:1.33ex!important;min-width:0!important;min-height:0!important;flex-shrink:0;order:1;
  /* Match the painted lowercase centre rather than the font line box. */
  transform:translateY(.167em);
}
@media(max-width:767px){#root [data-form-layout-root] [data-form-submit]{width:100%}}

/* Editor controls belong to CRM even when they surround a public-form preview. */
html[data-crm-ui][data-workspace-quality] #root .crm-form-block-toolbar .crm-form-block-controls button.is-danger,
html[data-crm-ui][data-workspace-quality] #root .crm-form-image-actions .crm-form-image-remove,
html[data-crm-ui][data-workspace-quality] #root [data-image-clipboard-scope="form-image"] button[aria-label="Убрать фото из описания формы"] {
  color:var(--ui-notification,#e8554e)!important;
}

/* Existing appeal AI material controls keep each icon beside its label.
   Whole controls wrap together in a narrow info pane; labels do not split. */
html[data-crm-ui][data-workspace-quality] #root .refinement-info__sections:not([data-form-preview-viewport] *) {
  display:flex;flex-wrap:wrap;min-width:0;gap:var(--ui-space-1)!important;
  padding-inline:var(--ui-space-3)!important;grid-template-columns:none;
}
html[data-crm-ui][data-workspace-quality] #root .refinement-info__sections > button:not([data-form-preview-viewport] *) {
  display:inline-flex;flex:1 0 auto;flex-direction:row;align-items:center;justify-content:center;
  box-sizing:border-box;min-width:max-content;min-height:var(--ui-control-touch);
  gap:var(--ui-space-1)!important;padding:6px var(--ui-space-2)!important;
  border-radius:var(--ui-radius-md)!important;white-space:nowrap;
  font-size:var(--ui-type-label-size)!important;line-height:var(--ui-type-label-line);
  font-weight:var(--ui-type-weight-semibold);
}
html[data-crm-ui][data-workspace-quality] #root .refinement-info__sections > button > svg:not([data-form-preview-viewport] *) {
  width:var(--ui-space-4)!important;height:var(--ui-space-4)!important;flex:none;
}
html[data-crm-ui][data-workspace-quality] #root .refinement-info__sections > button > span:not([data-form-preview-viewport] *) {
  white-space:nowrap;overflow:visible;text-overflow:clip;
}

/* One static viewport backdrop, shared by every CRM section. */
/* Backdrop values are provided by crm-themes.css. */
html[data-crm-ui][data-workspace-quality] body {
  background:var(--ui-canvas) !important;
}
#root :is([data-public-form-page],[data-form-canvas]) {
  background:var(--ui-form-backdrop),var(--ui-form-presswall) left top / var(--ui-form-presswall-size) repeat fixed!important;
  background-color:var(--ui-form-canvas)!important;
}
#root [data-form-canvas] [data-form-canvas] {background:transparent!important}
html[data-crm-ui][data-workspace-quality] #root {
  background:var(--crm-pearl-background),
    var(--ui-presswall) left top / var(--ui-presswall-size) repeat fixed !important;
}
html[data-crm-ui][data-workspace-quality] #root :is(
  main,main>div,main>section,
  .bg-press-wall,.bg-chat-press-wall,[data-workspace-canvas],
  .appeals-list-ui,[data-crm-chat],.crm-chat-loading-frame,
  .role-access,.staff-workspace,
  [data-mobile-layout="forms"],.crm-section-skeleton[data-skeleton-section],
  .crm-profile-settings-skeleton,.crm-skeleton--shell,
  .workspace-mobile-overview,[data-workspace-section-exiting],
  [data-workspace-auth],[data-role-access-chrome] .ra-toolbar,
  :has(>[data-section-header])
):not(.workspace-mobile-home-header):not([data-public-form-page]):not([data-form-canvas]):not([data-form-preview-viewport]):not([data-form-preview-viewport] *):not([data-form-layout-root]) {
  background-color:transparent !important;
  background-image:none !important;
}
html[data-crm-ui][data-workspace-quality] #root canvas[data-workspace-rays-canvas] {
  display:none !important;
}

/* One contact card renderer owns loaded, editing and pending geometry. */
html[data-crm-ui][data-workspace-quality] #root [role="dialog"]:has([data-contact-card]){
 width:min(100%,900px)!important;max-height:calc(100dvh - 32px)!important;
 border-radius:var(--ui-radius-xl)!important;scroll-padding-block:80px var(--ui-space-5);overscroll-behavior:contain
}
html[data-crm-ui][data-workspace-quality] #root [role="dialog"]:has([data-contact-card])>div:first-of-type{
 padding:var(--ui-space-3) var(--ui-space-5)!important;min-height:68px;box-sizing:border-box;gap:var(--ui-space-3)
}
html[data-crm-ui][data-workspace-quality] #root [role="dialog"]:has([data-contact-card])>div:first-of-type h2{
 margin:0;font-size:var(--ui-type-title-size)!important;line-height:var(--ui-type-title-line);font-weight:var(--ui-type-weight-semibold)!important
}
html[data-crm-ui][data-workspace-quality] #root [role="dialog"]:has([data-contact-card])>div:first-of-type button{
 display:inline-flex;align-items:center;justify-content:center;flex:none;width:var(--ui-control-touch);height:var(--ui-control-touch);min-height:var(--ui-control-touch);padding:0!important
}
html[data-crm-ui][data-workspace-quality] #root [role="dialog"]:has([data-contact-card])>div:last-child{padding:0!important}
html[data-crm-ui][data-workspace-quality] #root [data-contact-card]{min-width:0;background:var(--ui-surface);color:var(--ui-text)}
html[data-crm-ui][data-workspace-quality] #root [data-contact-card-status]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
html[data-crm-ui][data-workspace-quality] #root [data-contact-card-hero]{
 display:grid;grid-template-columns:48px minmax(0,1fr) auto;align-items:start;gap:var(--ui-space-3);padding:var(--ui-space-5)
}
html[data-crm-ui][data-workspace-quality] #root [data-contact-portrait]{display:grid;place-items:center;width:48px;height:48px;flex:none;background:var(--ui-selected);color:var(--ui-brand-ink);border-radius:var(--ui-radius)}
html[data-crm-ui][data-workspace-quality] #root [data-contact-card-identity]{min-width:0}
html[data-crm-ui][data-workspace-quality] #root [data-contact-card-identity]>h3{font-size:18px!important;line-height:24px!important;font-weight:var(--ui-type-weight-semibold)!important;margin:0;overflow-wrap:anywhere}
html[data-crm-ui][data-workspace-quality] #root [data-contact-card-department]{margin:var(--ui-space-1) 0 var(--ui-space-2);font-size:13px;line-height:18px;color:var(--ui-secondary);overflow-wrap:anywhere}
html[data-crm-ui][data-workspace-quality] #root [data-contact-card-badges]{display:flex;flex-wrap:wrap;gap:var(--ui-space-1);min-height:24px;align-items:center}
html[data-crm-ui][data-workspace-quality] #root [data-contact-membership]{display:inline-flex;align-items:center;min-height:24px;padding:2px var(--ui-space-2);border-radius:var(--ui-radius-sm);font-size:12px;line-height:18px;color:var(--ui-brand-ink);background:var(--ui-selected)}
html[data-crm-ui][data-workspace-quality] #root [data-contact-membership="member"]{color:#087944;background:#e1f7ec}
html[data-crm-ui][data-workspace-quality] #root [data-contact-card-actions]{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:var(--ui-space-2)}
html[data-crm-ui][data-workspace-quality] #root .contact-card-action{
 display:inline-flex;align-items:center;justify-content:center;gap:var(--ui-space-2);min-height:var(--ui-control-touch);padding:var(--ui-space-2) var(--ui-space-3);box-sizing:border-box;
 border:1px solid var(--ui-control-border);font:inherit;font-size:var(--ui-type-control-size);font-weight:var(--ui-type-weight-semibold);line-height:var(--ui-type-control-line);
 background:var(--ui-surface);color:var(--ui-brand-ink);border-radius:var(--ui-radius)
}
html[data-crm-ui][data-workspace-quality] #root .contact-card-action[data-contact-primary]{background:var(--ui-brand-ink);border-color:var(--ui-brand-ink);color:var(--ui-on-brand)}
html[data-crm-ui][data-workspace-quality] #root .contact-card-action:disabled{opacity:.55;cursor:default}
html[data-crm-ui][data-workspace-quality] #root .contact-card-action svg{color:inherit;flex:none}
html[data-crm-ui][data-workspace-quality] #root [data-contact-card] :is(button,input,summary,[tabindex="0"],a):focus-visible{outline:2px solid var(--ui-focus)!important;outline-offset:2px}
html[data-crm-ui][data-workspace-quality] #root [data-contact-card-body]{display:grid;grid-template-columns:minmax(0,1fr);gap:var(--ui-space-6);border:0;padding:0 var(--ui-space-5) var(--ui-space-6);margin:0;min-width:0}
html[data-crm-ui][data-workspace-quality] #root [data-contact-card-section]{min-width:0;margin:0;padding:0;background:transparent;border:0;box-shadow:none}
html[data-crm-ui][data-workspace-quality] #root [data-contact-card-section]>h3{font-size:var(--ui-type-label-size);line-height:var(--ui-type-label-line);font-weight:var(--ui-type-weight-semibold);margin:0 0 var(--ui-space-3)}
html[data-crm-ui][data-workspace-quality] #root [data-contact-card-fields]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--ui-space-4);margin:0}
html[data-crm-ui][data-workspace-quality] #root [data-contact-slot]{min-width:0}
html[data-crm-ui][data-workspace-quality] #root :is([data-contact-slot-wide],[data-contact-detail-wide]){grid-column:1 / -1}
html[data-crm-ui][data-workspace-quality] #root [data-contact-slot]>:is([data-contact-slot-view],[data-contact-slot-editor]){min-width:0;min-inline-size:0;margin:0;padding:0;border:0}
html[data-crm-ui][data-workspace-quality] #root [data-contact-detail]{min-width:0;margin:0}
html[data-crm-ui][data-workspace-quality] #root [data-contact-detail]>dt{margin:0 0 var(--ui-space-2);color:var(--ui-secondary);font-size:var(--ui-type-label-size);line-height:var(--ui-type-label-line)}
html[data-crm-ui][data-workspace-quality] #root [data-contact-detail]>dd{display:flex;align-items:flex-start;min-width:0;margin:0;font-size:var(--ui-type-body-size);line-height:var(--ui-type-body-line);min-height:24px;overflow-wrap:anywhere}
html[data-crm-ui][data-workspace-quality] #root [data-contact-channel-list]{display:grid;gap:var(--ui-space-2)}
html[data-crm-ui][data-workspace-quality] #root [data-contact-channel]{display:inline-flex;align-items:flex-start;gap:var(--ui-space-2);width:fit-content;max-width:100%;color:var(--ui-brand-ink);text-decoration:none}
html[data-crm-ui][data-workspace-quality] #root a[data-contact-channel]:hover{text-decoration:underline}
html[data-crm-ui][data-workspace-quality] #root [data-contact-channel]>svg{flex:none;margin-top:3px}
html[data-crm-ui][data-workspace-quality] #root [data-contact-channel="telegram"]{color:#168acd}
html[data-crm-ui][data-workspace-quality] #root [data-contact-channel]>span{overflow-wrap:anywhere;min-width:0}
html[data-crm-ui][data-workspace-quality] #root [data-contact-topics]{display:flex;align-items:flex-start;flex-wrap:wrap;gap:var(--ui-space-2);min-height:24px}
html[data-crm-ui][data-workspace-quality] #root [data-contact-topics]>span:not(.contact-card-mask){padding:var(--ui-space-1) var(--ui-space-2);font-size:13px;line-height:18px;border-radius:var(--ui-radius-sm);color:var(--ui-brand-ink);background:var(--ui-selected);max-width:100%;overflow-wrap:anywhere}
html[data-crm-ui][data-workspace-quality] #root [data-contact-empty]{margin:0;color:var(--ui-secondary);font-size:14px;line-height:20px}
html[data-crm-ui][data-workspace-quality] #root [data-contact-card]>[data-contact-card-section="history"]{padding:0 var(--ui-space-5) var(--ui-space-6)}
html[data-crm-ui][data-workspace-quality] #root [data-contact-history]{max-height:164px;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding-right:var(--ui-space-2)}
html[data-crm-ui][data-workspace-quality] #root [data-contact-history-row]{display:grid;gap:var(--ui-space-1);padding:var(--ui-space-2) 0;border-bottom:1px solid var(--ui-border);min-height:52px;box-sizing:border-box}
html[data-crm-ui][data-workspace-quality] #root [data-contact-history-row]>strong{font-size:14px;line-height:20px;font-weight:var(--ui-type-weight-semibold);overflow-wrap:anywhere}
html[data-crm-ui][data-workspace-quality] #root [data-contact-history-row]>p{font-size:12px;line-height:18px;color:var(--ui-secondary);margin:0;overflow-wrap:anywhere}
html[data-crm-ui][data-workspace-quality] #root [data-contact-card-error]{margin:0 var(--ui-space-5) var(--ui-space-5);padding:var(--ui-space-3);background:#fff0f2;color:#9b1831;border-radius:var(--ui-radius);overflow-wrap:anywhere}
html[data-crm-ui][data-workspace-quality] #root [data-contact-card-error]>:is(h3,p){margin:0 0 var(--ui-space-2)}
html[data-crm-ui][data-workspace-quality] #root [data-contact-edit-field]{min-width:0}
html[data-crm-ui][data-workspace-quality] #root [data-contact-slot-editor] :is(label,.crm-topics-field__label){font-size:var(--ui-type-label-size)!important;line-height:var(--ui-type-label-line);font-weight:var(--ui-type-weight-medium)!important}
html[data-crm-ui][data-workspace-quality] #root [data-contact-edit-field] label{gap:var(--ui-space-2)!important}
html[data-crm-ui][data-workspace-quality] #root [data-contact-slot-editor] :is(input:not([type="checkbox"]),.crm-topics-field__control),
html[data-crm-ui][data-workspace-quality] #root [data-contact-topics-placeholder]{
 height:var(--ui-control-touch)!important;min-height:var(--ui-control-touch)!important;padding:var(--ui-space-2) var(--ui-space-3)!important;box-sizing:border-box;
 font-size:var(--ui-type-body-size)!important;line-height:var(--ui-type-body-line)!important
}
html[data-crm-ui][data-workspace-quality] #root [data-contact-slot-editor] .crm-topics-field__search>input{padding-left:34px!important}
html[data-crm-ui][data-workspace-quality] #root [data-contact-slot-editor] .crm-topics-field{gap:var(--ui-space-2)}
html[data-crm-ui][data-workspace-quality] #root .contact-card-field-placeholder{display:flex;flex-direction:column;gap:var(--ui-space-2);font-size:var(--ui-type-label-size);line-height:var(--ui-type-label-line)}
html[data-crm-ui][data-workspace-quality] #root [data-contact-retained-values]{margin-top:var(--ui-space-2);font-size:12px;line-height:18px;color:var(--ui-secondary);overflow-wrap:anywhere}
html[data-crm-ui][data-workspace-quality] #root [data-contact-retained-values]>[data-contact-value-list]{display:inline!important}
html[data-crm-ui][data-workspace-quality] #root [data-contact-card-section="topics"] :is([data-contact-detail]>dt,.crm-topics-field__label){position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
html[data-crm-ui][data-workspace-quality] #root [data-contact-card] .contact-card-mask{display:inline-block;max-width:100%;height:1em;min-height:14px;border-radius:var(--ui-radius-sm);vertical-align:middle}
@media(min-width:768px) and (max-width:1279px){
 html[data-crm-ui][data-workspace-quality] #root [data-contact-card-fields]{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:767px){
 html[data-crm-ui][data-workspace-quality] #root [role="dialog"]:has([data-contact-card]){max-height:calc(100dvh - 24px)!important;border-radius:var(--ui-radius-lg)!important}
 html[data-crm-ui][data-workspace-quality] #root [role="dialog"]:has([data-contact-card])>div:first-of-type{padding:var(--ui-space-2) var(--ui-space-4)!important;min-height:60px}
 html[data-crm-ui][data-workspace-quality] #root [data-contact-card-hero]{grid-template-columns:48px minmax(0,1fr);padding:var(--ui-space-4)}
 html[data-crm-ui][data-workspace-quality] #root [data-contact-card-actions]{grid-column:1 / -1}
 html[data-crm-ui][data-workspace-quality] #root [data-contact-card-body]{gap:var(--ui-space-6);padding:0 var(--ui-space-4) var(--ui-space-6)}
 html[data-crm-ui][data-workspace-quality] #root [data-contact-card-fields]{grid-template-columns:minmax(0,1fr)}
 html[data-crm-ui][data-workspace-quality] #root [data-contact-card]>[data-contact-card-section="history"]{padding:0 var(--ui-space-4) var(--ui-space-6)}
 html[data-crm-ui][data-workspace-quality] #root [data-contact-card-error]{margin-inline:var(--ui-space-4)}
}

/* Public forms stay outside this contract. Existing components migrate through adapters. */
html[data-crm-ui][data-workspace-quality] #root [data-ui-panel]:not([data-form-preview-viewport] *){
 min-width:0;box-sizing:border-box;padding:var(--ui-panel-padding);
 border-radius:var(--ui-radius-lg);background:var(--ui-surface);color:var(--ui-text)
}
html[data-crm-ui][data-workspace-quality] #root [data-ui-panel="compact"]:not([data-form-preview-viewport] *){padding:var(--ui-panel-padding-compact)}
html[data-crm-ui][data-workspace-quality] #root [data-ui-stack]:not([data-form-preview-viewport] *){display:flex;flex-direction:column;gap:var(--ui-panel-gap);min-width:0}
