.bitrix-workspace-host { margin: 10px 0 16px; padding: 12px; border: 1px solid var(--reference-line, rgba(102,175,220,.2)); border-radius: 12px; background: var(--reference-surface, #0a1424); }
.bitrix-workspace-host[hidden] { display: none !important; }
.reference-shell-active #leftSidebar > #bitrixWorkspaceHost:not([hidden]), .lead-summary-panel > #bitrixWorkspaceHost:not([hidden]) { display: block !important; }
.bw-launcher { display: flex; align-items: end; gap: 8px; }
.bw-launcher label { min-width: 0; flex: 1; }
.bw-launcher label span, .bw-dialog label > span { display: block; margin-bottom: 6px; font-size: 12px; color: #aec2d8; }
.bw-launcher select { width: 100%; min-width: 0; }
.bw-launcher .project-secondary-button { padding: 9px 10px; font-size: 12px; }
.bw-dialog { width: min(1080px, calc(100vw - 32px)); max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px); margin: auto; padding: 0; border: 1px solid var(--reference-line, #294156); border-radius: 18px; color: #e8f3ff; background: #091323; box-shadow: 0 28px 100px #0009; }
.bw-dialog::backdrop { background: #010713bc; backdrop-filter: blur(5px); }
.bw-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 26px 16px; border-bottom: 1px solid var(--reference-line, #294156); }
.bw-header h2 { margin: 4px 0 0; font-size: 22px; }
.bw-header .auth-kicker { margin: 0; color: var(--reference-cyan, #23d7ff); font-size: 11px; letter-spacing: .12em; }
.bw-content { padding: 20px 26px 26px; }
.bw-list-bar, .bw-name-row, .bw-sort { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.bw-list-bar > label { flex: 1; min-width: 160px; }
.bw-list-bar select { width: 100%; }
.bw-dialog select, .bw-dialog input:not([type=checkbox]), .bw-launcher select { min-height: 38px; border: 1px solid #28415b; border-radius: 8px; padding: 8px 10px; background: #0d1c30; color: #e8f3ff; font: inherit; font-size: 13px; color-scheme: dark; }
.bw-dialog input[type=checkbox] { accent-color: var(--reference-cyan, #23d7ff); }
.bw-dialog button { cursor: pointer; }
.bw-dialog .project-secondary-button { font-size: 12px; line-height: 1.35; padding: 9px 12px; }
.bw-dialog button:disabled { cursor: default; opacity: .45; }
.bw-dialog :focus-visible, .bitrix-workspace-host :focus-visible { outline: 2px solid var(--reference-cyan, #23d7ff); outline-offset: 3px; }
.bw-scope, .bw-hint { margin: 9px 0 0; color: #9cb3cb; font-size: 12px; line-height: 1.5; }
.bw-message { margin: 12px 0 0; color: #84dec4; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.bw-message:empty { display: none; }
.bw-message.is-error { color: #ffb9b9; }
.bw-editor { padding: 18px; margin-top: 18px; background: #0c192b; border: 1px solid #21364d; border-radius: 12px; }
.bw-name-row > label:first-child { flex: 1; min-width: 180px; }
.bw-name-row input:not([type=checkbox]) { width: 100%; box-sizing: border-box; }
.bw-check { display: flex; align-items: center; gap: 7px; min-height: 38px; color: #b7c8dc; font-size: 12px; }
.bw-section-title, .bw-result-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 20px; }
.bw-dialog h3 { margin: 0; font-size: 14px; font-weight: 600; }
.bw-filters { display: grid; gap: 8px; margin: 12px 0; }
.bw-filter { display: grid; grid-template-columns: minmax(115px,1fr) minmax(120px,1fr) minmax(140px,1.35fr) 34px; gap: 8px; }
.bw-filter > * { min-width: 0; }
.bw-filter .icon-button { min-height: 38px; }
.bw-empty-filter { margin: 0; padding: 12px; border-radius: 8px; background: #071221; color: #a7bdd3; font-size: 13px; }
.bw-columns { margin: 16px 0; border-top: 1px solid #21364d; padding-top: 14px; }
.bw-columns summary { width: fit-content; cursor: pointer; font-size: 13px; color: #c1d7ed; }
.bw-column-options { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; margin-top: 12px; }
.bw-column { display: flex; align-items: center; gap: 3px; min-width: 0; padding: 4px; border-radius: 6px; background: #091527; }
.bw-column label { display: flex; flex: 1; align-items: center; gap: 6px; min-width: 0; font-size: 12px; }
.bw-column label { overflow-wrap: anywhere; }
.bw-column .icon-button { width: 26px; min-width: 26px; height: 28px; }
.bw-sort label { flex: 1; min-width: 150px; }
.bw-sort select { width: 100%; }
.bw-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.bw-actions button { min-height: 40px; }
.bw-delete { margin-left: auto; color: #ebb3b7 !important; }
.bw-results { margin-top: 22px; }
.bw-result-heading { margin-top: 0; margin-bottom: 12px; flex-wrap: wrap; }
.bw-result-heading > span { color: #9fb6cf; font-size: 12px; }
.bw-table-wrap { overflow: auto; max-width: 100%; max-height: 380px; border: 1px solid #21364d; border-radius: 10px; }
.bw-table-wrap:has(tbody:empty) { display: none; }
.bw-dialog table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: left; }
.bw-dialog th { position: sticky; top: 0; background: #10243a; color: #bad0e8; font-weight: 500; white-space: nowrap; }
.bw-dialog th, .bw-dialog td { padding: 11px 13px; border-bottom: 1px solid #203248; }
.bw-dialog td { max-width: 320px; overflow-wrap: anywhere; vertical-align: top; }
.bw-dialog tbody tr:last-child td { border-bottom: 0; }
.bw-dialog tbody tr:hover { background: #102238; }
.bw-pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; }
.bw-pager span { color: #a9bfd6; font-size: 12px; }
@media (max-width: 700px) {
  .bw-dialog { width: calc(100vw - 16px); max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); border-radius: 12px; }
  .bw-header { padding: 16px; }
  .bw-header h2 { font-size: 19px; }
  .bw-content { padding: 14px; }
  .bw-editor { padding: 12px; }
  .bw-filter { grid-template-columns: 1fr 1fr 32px; }
  .bw-filter > :first-child { grid-column: 1 / 3; }
  .bw-filter > :nth-child(2) { grid-column: 1; grid-row: 2; }
  .bw-filter > :nth-child(3) { grid-column: 2; grid-row: 2; }
  .bw-filter > :last-child { grid-column: 3; grid-row: 1 / 3; align-self: center; }
  .bw-column-options { grid-template-columns: 1fr 1fr; }
  .bw-actions button { flex: 1 1 150px; }
  .bw-list-bar > button { flex: 1; }
  .bw-delete { margin-left: 0; }
}
@media (max-width: 420px) { .bw-column-options { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .bw-dialog::backdrop { backdrop-filter: none; } }
