/* Заявки: оставляем шапке только необходимую высоту, чтобы таблица занимала экран. */
.service-desk-workspace:not(.reports-catalog-page):not(.reports-dashboard-page) > .service-desk-workspace-head {
    align-items: center;
    gap: 12px;
    padding: 9px 12px 8px;
}

.service-desk-workspace:not(.reports-catalog-page):not(.reports-dashboard-page) .service-desk-eyebrow {
    font-size: .64rem;
    line-height: 1;
}

.service-desk-workspace:not(.reports-catalog-page):not(.reports-dashboard-page) .service-desk-workspace-head h1 {
    font-size: 1.05rem;
    line-height: 1.15;
    margin: 2px 0 0;
}

.service-desk-workspace:not(.reports-catalog-page):not(.reports-dashboard-page) .service-desk-workspace-head p {
    font-size: .74rem;
    line-height: 1.2;
    margin: 3px 0 0;
}

.service-desk-workspace:not(.reports-catalog-page):not(.reports-dashboard-page) .service-desk-workspace-actions {
    gap: 6px;
}

.service-desk-workspace:not(.reports-catalog-page):not(.reports-dashboard-page) .service-desk-workspace-actions .primary-action-compact {
    min-height: 29px;
    padding: .35rem .55rem;
}

.service-desk-workspace:not(.reports-catalog-page):not(.reports-dashboard-page) > .service-desk-workspace-head:has(.service-desk-breadcrumbs) {
    padding-bottom: 7px;
    padding-top: 7px;
}

.service-desk-workspace:not(.reports-catalog-page):not(.reports-dashboard-page) .service-desk-breadcrumbs {
    font-size: .72rem;
    line-height: 1.1;
    margin-top: 2px;
}


.admin-check,
.admin-action-grid a,
.settings-health-list a {
    background: var(--color-surface-muted);
    border: 1px solid var(--color-line);
    border-radius: 8px;
    color: inherit;
    display: grid;
    gap: .25rem;
    padding: .8rem;
    text-decoration: none;
}

.admin-check {
    grid-template-columns: minmax(0, 1fr) auto;
}

.admin-check strong,
.admin-check span {
    grid-column: 1;
}

.admin-check em {
    align-self: center;
    background: #fff;
    border: 1px solid var(--color-line);
    border-radius: 999px;
    color: var(--color-brand-dark);
    font-size: .82rem;
    font-style: normal;
    font-weight: 800;
    grid-column: 2;
    grid-row: 1 / span 2;
    padding: .25rem .55rem;
}

.admin-check-warning {
    background: #fff7d7;
    border-color: #e6cf7b;
}

.admin-check strong,
.admin-action-grid strong,
.settings-health-list strong {
    color: var(--color-ink);
}

.admin-check span,
.admin-action-grid span,
.settings-health-list span,
.settings-health-list em {
    color: var(--color-muted);
    font-size: .86rem;
    font-style: normal;
}

.admin-action-grid a:hover,
.settings-health-list a:hover,
.admin-check:hover {
    border-color: var(--color-brand-bright);
}

.modal-backdrop-panel {
    align-items: center;
    background: rgba(5, 7, 6, .38);
    bottom: 0;
    display: flex;
    justify-content: center;
    left: 0;
    padding: 1.25rem;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 1100;
}

.modal-panel {
    background: var(--color-surface);
    border: 1px solid var(--color-line);
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(5, 7, 6, .22);
    max-height: calc(100vh - 2.5rem);
    overflow: auto;
    padding: 1rem;
    width: min(680px, 100%);
}

.modal-panel-narrow {
    width: min(480px, 100%);
}

.modal-panel-wide {
    width: min(1040px, 100%);
}

.modal-heading {
    align-items: flex-start;
    border-bottom: 1px solid var(--color-line);
    display: flex;
    justify-content: space-between;
    margin: -1rem -1rem 1rem;
    padding: 1rem;
}

.modal-heading h2 {
    font-size: 1.2rem;
    margin: 0;
}

.icon-button {
    align-items: center;
    background: #fff;
    border: 1px solid var(--color-line);
    border-radius: 6px;
    color: var(--color-ink);
    display: inline-flex;
    font-size: 1.15rem;
    font-weight: 800;
    height: 34px;
    justify-content: center;
    line-height: 1;
    width: 34px;
}

.modal-actions {
    border-top: 1px solid var(--color-line);
    display: flex;
    gap: .5rem;
    justify-content: flex-end;
    margin: 1rem -1rem -1rem;
    padding: 1rem;
}

.modal-warning-text {
    color: var(--color-muted);
    line-height: 1.5;
    margin: 0;
}

.modal-warning-text strong {
    color: var(--color-ink);
}

.full-width {
    justify-content: center;
    width: 100%;
}

.toolbar {
    display: flex;
    gap: .75rem;
    margin-bottom: 1rem;
}

.toolbar input {
    border: 1px solid #cfd8df;
    border-radius: 6px;
    flex: 1;
    padding: .75rem .9rem;
}

.toolbar button {
    background: var(--color-button-primary);
    border: 0;
    border-radius: 6px;
    color: #fff;
    font-weight: 700;
    padding: .75rem 1rem;
}

.split {
    display: grid;
    gap: 1rem;
    grid-template-columns: 280px minmax(0, 1fr);
}

.panel {
    box-shadow: none;
    padding: 1rem;
}

.panel h2 {
    font-size: 1rem;
    margin-bottom: .75rem;
}

.editor-placeholder {
    align-items: center;
    background: var(--color-surface-muted);
    border: 1px dashed #aab6c2;
    border-radius: 6px;
    color: #6b7785;
    display: flex;
    height: 260px;
    justify-content: center;
}

.chat-box {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    margin-bottom: 1rem;
}

.ai-chat-layout {
    display: grid;
    flex: 1 1 auto;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr) 300px;
    height: auto;
    min-height: 460px;
}

.ai-chat-surface {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    padding: 1rem;
}

.ai-chat-box {
    flex: 1;
    margin-bottom: 1rem;
    min-height: 0;
    overscroll-behavior: contain;
    overflow-y: auto;
    padding: .15rem;
}

.message {
    border-radius: 8px;
    max-width: 760px;
    padding: .85rem 1rem;
    white-space: pre-wrap;
}

.message.user {
    align-self: flex-end;
    background: var(--color-brand-soft);
}

.message.assistant {
    align-self: flex-start;
    background: #eef2f7;
}

.ai-welcome-message,
.ai-loading-message {
    align-items: flex-start;
    display: flex;
    gap: .75rem;
}

.ai-welcome-message {
    flex-direction: column;
    gap: .25rem;
}

.ai-welcome-message span,
.ai-loading-message span {
    color: var(--color-muted);
}

.ai-chat-input {
    align-items: center;
    background: #fff;
    border: 1px solid var(--color-line);
    border-radius: 8px;
    display: grid;
    gap: .65rem;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: .6rem;
}

.ai-chat-input input {
    border: 0;
    min-height: 42px;
    min-width: 0;
    outline: 0;
    padding: 0 .25rem;
    width: 100%;
}

.ai-chat-input button {
    align-items: center;
    background: var(--color-brand);
    border: 1px solid var(--color-brand);
    border-radius: 6px;
    color: #fff;
    display: inline-flex;
    font-weight: 700;
    gap: .45rem;
    justify-content: center;
    min-height: 40px;
    min-width: 104px;
    padding: .55rem .9rem;
}

.ai-chat-input button:disabled {
    cursor: wait;
    opacity: .72;
}

.ai-spinner {
    animation: ai-spin .8s linear infinite;
    border: 2px solid rgba(30, 7, 170, .22);
    border-top-color: var(--color-brand);
    border-radius: 50%;
    display: inline-block;
    flex: 0 0 auto;
    height: 18px;
    margin-top: .1rem;
    width: 18px;
}

.ai-spinner-button {
    border-color: rgba(255, 255, 255, .35);
    border-top-color: #fff;
    height: 15px;
    margin-top: 0;
    width: 15px;
}

@keyframes ai-spin {
    to {
        transform: rotate(360deg);
    }
}

.answer-mode {
    background: rgba(255, 255, 255, .78);
    border: 1px solid var(--color-line);
    border-left: 4px solid var(--color-brand);
    border-radius: 8px;
    color: var(--color-ink-soft);
    display: grid;
    gap: .2rem;
    font-size: .86rem;
    line-height: 1.35;
    margin-bottom: .65rem;
    padding: .6rem .75rem;
    white-space: normal;
}

.answer-mode strong,
.answer-mode span {
    display: block;
}

.answer-mode strong {
    color: var(--color-brand-dark);
    font-size: .88rem;
}

.answer-mode span {
    color: var(--color-muted);
}

.answer-mode-sources-only {
    border-left-color: #9b5c00;
}

.answer-mode-sources-only strong {
    color: #7a4b00;
}

.answer-mode-warning {
    border-left-color: #a43f3f;
}

.answer-mode-warning strong {
    color: #8e2f2f;
}

.ai-inline-sources {
    background: rgba(255, 255, 255, .72);
    border: 1px solid var(--color-line);
    border-radius: 8px;
    display: grid;
    gap: .45rem;
    margin-top: .75rem;
    padding: .65rem;
    white-space: normal;
}

.ai-inline-sources-title {
    color: var(--color-muted);
    font-size: .76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.ai-inline-source-item {
    border-top: 1px solid var(--color-line);
    display: grid;
    gap: .22rem;
    padding-top: .45rem;
}

.ai-inline-source-item:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.ai-inline-source-item a {
    color: var(--color-brand-dark);
    font-weight: 800;
    text-decoration: none;
}

.ai-inline-source-item a:hover {
    text-decoration: underline;
}

.ai-inline-source-item span {
    color: var(--color-muted);
    font-size: .8rem;
}

.ai-inline-source-item p {
    color: var(--color-ink-soft);
    font-size: .86rem;
    margin: .15rem 0 0;
}

.ai-inline-sources-empty {
    color: var(--color-muted);
    font-size: .86rem;
}

.ai-search-terms-inline {
    margin-top: .55rem;
}

.ai-sources-panel {
    margin-top: 1rem;
}

.ai-history-panel {
    margin-bottom: 1rem;
}

.ai-history-list {
    display: grid;
    gap: .6rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.ai-history-item {
    background: #ffffff;
    border: 1px solid var(--color-line);
    border-radius: 8px;
    color: var(--color-ink);
    cursor: pointer;
    min-height: 76px;
    padding: .75rem .85rem;
    text-align: left;
}

.ai-history-item:hover {
    border-color: var(--color-brand);
}

.ai-history-item span,
.ai-history-item small {
    display: block;
}

.ai-history-item span {
    font-weight: 700;
    line-height: 1.25;
}

.ai-history-item small {
    color: var(--color-muted);
    margin-top: .35rem;
}

.ai-gap-panel {
    margin-bottom: 1rem;
}

.ai-gap-list {
    display: grid;
    gap: .55rem;
}

.ai-gap-list button {
    background: var(--color-surface-muted);
    border: 1px solid var(--color-line);
    border-radius: 6px;
    color: inherit;
    padding: .7rem .8rem;
    text-align: left;
}

.ai-gap-list button:hover {
    border-color: var(--color-brand-bright);
}

.ai-gap-list strong,
.ai-gap-list span {
    display: block;
}

.ai-gap-list span {
    color: var(--color-muted);
    font-size: .84rem;
    margin-top: .2rem;
}

.ai-log-table {
    display: flex;
    flex-direction: column;
    overflow-x: auto;
    padding-bottom: .15rem;
    scrollbar-color: var(--color-line) transparent;
}

.ai-log-table-head,
.ai-log-row {
    display: grid;
    gap: 0;
    grid-template-columns: minmax(0, 1.7fr) 170px 120px 150px 120px;
}

.ai-log-table-head {
    background: var(--color-surface);
    color: var(--color-muted);
    font-size: .78rem;
    font-weight: 800;
    padding: 0;
    position: sticky;
    top: 0;
    text-transform: uppercase;
    z-index: 2;
}

.ai-log-table-head,
.ai-log-row {
    min-width: 760px;
}

.ai-log-row {
    align-items: center;
    border-top: 1px solid var(--color-line);
    padding: .48rem 0;
}

.ai-log-row span {
    min-width: 0;
}

.ai-log-row strong,
.ai-log-row em {
    display: block;
}

.ai-log-row strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ai-log-row em {
    color: var(--color-muted);
    font-size: .84rem;
    font-style: normal;
    margin-top: .2rem;
}

.audit-filter-row {
    align-items: center;
    background: var(--color-surface-muted);
    border: 1px solid var(--color-line);
    border-radius: 8px;
    display: grid;
    gap: .5rem;
    grid-template-columns: minmax(0, 1fr) 220px auto;
    margin-bottom: 1rem;
    padding: .55rem;
}

.audit-filter-row input,
.audit-filter-row select {
    border: 1px solid var(--color-line);
    border-radius: 6px;
    font-size: .84rem;
    min-height: 32px;
    min-width: 0;
    padding: .38rem .5rem;
}

.notification-log-filter-row {
    grid-template-columns: minmax(240px, 1fr) repeat(3, minmax(150px, 220px));
}

.audit-table {
    display: flex;
    flex-direction: column;
    overflow-x: auto;
    padding-bottom: .15rem;
    scrollbar-color: var(--color-line) transparent;
}

.audit-table-head,
.audit-row {
    display: grid;
    gap: 0;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) 160px 150px;
}

.audit-table-head {
    background: var(--color-surface);
    color: var(--color-muted);
    font-size: .78rem;
    font-weight: 800;
    padding-bottom: 0;
    position: sticky;
    top: 0;
    text-transform: uppercase;
    z-index: 2;
}

.audit-table-head,
.audit-row {
    min-width: 720px;
}

.audit-row {
    border-top: 1px solid var(--color-line);
    padding: .48rem 0;
}

.audit-row strong,
.audit-row em {
    display: block;
}

.audit-row em {
    color: var(--color-muted);
    font-style: normal;
    margin-top: .2rem;
}

/* Длинные Telegram-идентификаторы не должны вылезать в соседние колонки. */
.audit-table-head > *,
.audit-row > *,
.audit-row strong,
.audit-row em {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.audit-row > span {
    display: block;
    white-space: normal;
}

.audit-row > span[class*="status"] {
    overflow-wrap: normal;
    word-break: normal;
}

.article-table-head,
.article-row,
.company-table-head,
.company-row,
.user-table-head,
.user-row,
.ai-log-table-head,
.ai-log-row,
.audit-table-head,
.audit-row,
.backup-table-head,
.backup-row {
    align-items: center;
    column-gap: 0;
}

.article-table-head > *,
.article-row > *,
.company-table-head > *,
.company-row > *,
.user-table-head > *,
.user-row > *,
.ai-log-table-head > *,
.ai-log-row > *,
.audit-table-head > *,
.audit-row > *,
.backup-table-head > *,
.backup-row > * {
    min-width: 0;
    padding-inline: .75rem;
}

.article-table-head > *:not(:first-child),
.article-row > *:not(:first-child),
.company-table-head > *:not(:first-child),
.company-row > *:not(:first-child),
.user-table-head > *:not(:first-child),
.user-row > *:not(:first-child),
.ai-log-table-head > *:not(:first-child),
.ai-log-row > *:not(:first-child),
.audit-table-head > *:not(:first-child),
.audit-row > *:not(:first-child),
.backup-table-head > *:not(:first-child),
.backup-row > *:not(:first-child) {
    border-left: 1px solid var(--color-line);
}

.article-table-head,
.company-table-head,
.user-table-head,
.ai-log-table-head,
.audit-table-head,
.backup-table-head {
    min-height: 40px;
    padding-bottom: 0;
}

.article-row,
.company-row,
.user-row,
.ai-log-row,
.audit-row,
.backup-row {
    min-height: 48px;
    padding-block: .48rem;
}

.article-row em,
.company-row em,
.user-row em,
.ai-log-row em,
.audit-row em,
.backup-row em {
    margin-top: .08rem;
}

.article-table-head > span:last-child,
.company-table-head > span:last-child,
.user-table-head > span:last-child,
.ai-log-table-head > span:last-child,
.audit-table-head > span:last-child,
.backup-table-head > span:last-child {
    align-items: center;
    display: flex;
    height: 100%;
    justify-content: flex-end;
}

.article-table-head > *,
.company-table-head > *,
.user-table-head > *,
.ai-log-table-head > *,
.audit-table-head > *,
.backup-table-head > * {
    align-items: center;
    align-self: stretch;
    display: flex;
}

.row-actions {
    padding-right: 0;
}

.user-table-head > span:last-child,
.company-table-head > span:last-child,
.article-table-head > span:last-child,
.ai-log-table-head > span:last-child,
.audit-table-head > span:last-child,
.backup-table-head > span:last-child,
.user-row > .row-actions,
.company-row > .row-actions,
.article-row > .row-actions,
.ai-log-row > .row-actions,
.audit-row > .row-actions,
.backup-row > .row-actions {
    justify-content: center;
    padding-inline: .55rem;
}

.user-row > .row-actions,
.company-row > .row-actions,
.article-row > .row-actions,
.ai-log-row > .row-actions,
.audit-row > .row-actions,
.backup-row > .row-actions {
    align-self: stretch;
    height: 100%;
}

.ai-log-details {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    max-height: 70vh;
    overflow: auto;
    padding: 1rem;
}

.kb-office-head {
    margin-bottom: .7rem;
}

.kb-office-head .page-route {
    margin-bottom: .28rem;
}

.kb-office-head .page-title-inline {
    align-items: baseline;
    border-bottom: 1px solid var(--color-line);
    display: flex;
    gap: .8rem;
    padding-bottom: .55rem;
}

.kb-office-head .page-title-inline h1 {
    font-size: 1.42rem;
    line-height: 1.15;
}

.kb-office-head .page-title-inline p {
    color: var(--color-muted);
    font-size: .86rem;
    margin: 0;
}

.kb-office-search {
    border-radius: 6px;
    box-shadow: none;
    margin-bottom: .75rem;
    padding: .72rem .82rem;
}

.kb-office-search .kb-search {
    gap: .45rem;
}

.kb-office-search .kb-search input {
    font-size: .88rem;
    min-height: 34px;
    padding: .46rem .65rem;
}

.kb-office-search .kb-search button,
.kb-office-search .secondary-button {
    font-size: .82rem;
    min-height: 34px;
    padding: .4rem .62rem;
}

.kb-office-search .quick-filter-row {
    gap: .32rem;
    margin-top: .55rem;
    padding-top: .55rem;
}

.kb-office-search .article-filter-panel {
    gap: .45rem;
    grid-template-columns: repeat(4, minmax(140px, 1fr)) auto;
    margin-top: .55rem;
    padding-top: .55rem;
}

.kb-office-search .article-filter-panel label span {
    font-size: .7rem;
}

.kb-office-search .article-filter-panel select {
    font-size: .82rem;
    min-height: 32px;
    padding: .36rem .48rem;
}

.kb-office-search .article-filter-panel button {
    min-height: 32px;
}

.kb-office-search .quick-filter-button,
.kb-office-search .kb-metric-chip {
    border-radius: 6px;
    font-size: .78rem;
    min-height: 26px;
    padding: .24rem .44rem;
}

.kb-office-search .kb-metric-chip strong {
    font-size: .86rem;
}

.kb-office-search .active-filter {
    border-radius: 6px;
    margin-top: .55rem;
    min-height: 34px;
    padding: .38rem .5rem;
}

.kb-office-search .active-filter span,
.kb-office-search .active-filter strong {
    font-size: .84rem;
}

.kb-office-search .active-filter button {
    min-height: 28px;
    padding: .24rem .48rem;
}

.kb-office-layout {
    gap: .75rem;
    grid-template-columns: 310px minmax(0, 1fr);
}

.kb-office-sidebar,
.kb-office-articles {
    border-radius: 6px;
    box-shadow: none;
}

.kb-office-sidebar {
    align-self: start;
    max-height: calc(100vh - 86px);
    overflow: auto;
    padding: .75rem;
    position: sticky;
    top: 72px;
}

.kb-office-sidebar > .panel-heading,
.kb-office-articles > .panel-heading {
    background: #f8f9fd;
    margin: -.75rem -.75rem .65rem;
    min-height: 42px;
    padding: .58rem .75rem;
}

.kb-office-sidebar .panel-heading h2,
.kb-office-articles .panel-heading h2 {
    font-size: .96rem;
}

.kb-office-sidebar .full-width {
    min-height: 32px;
}

.kb-office-sidebar .category-list-spaced {
    border: 1px solid var(--color-line);
    border-radius: 6px;
    gap: 0;
    margin-top: .65rem;
    overflow: hidden;
}

.kb-office-sidebar .category-item {
    background: #fff;
    border: 0;
    border-bottom: 1px solid var(--color-line);
    border-radius: 0;
    box-shadow: none;
    gap: .35rem;
    min-height: 46px;
    padding: .45rem .52rem;
    transform: none;
}

.kb-office-sidebar .category-item:last-child {
    border-bottom: 0;
}

.kb-office-sidebar .category-item:hover,
.kb-office-sidebar .category-item:focus-within {
    background: #f8f9fd;
    border-color: var(--color-line);
    box-shadow: none;
    transform: none;
}

.kb-office-sidebar .category-item-active {
    background: #f1f3ff;
    box-shadow: inset 3px 0 0 var(--color-brand);
}

.kb-office-sidebar .category-filter-button strong {
    font-size: .88rem;
    line-height: 1.2;
}

.kb-office-sidebar .category-filter-button-active strong {
    font-size: .9rem;
}

.kb-office-sidebar .category-item em,
.kb-office-sidebar .category-filter-button em {
    color: var(--color-muted);
    font-size: .76rem;
    line-height: 1.25;
}

.kb-office-sidebar .category-collapse-button {
    flex-basis: 22px;
    font-size: .82rem;
    height: 22px;
    width: 22px;
}

.kb-office-sidebar .row-action-button {
    font-size: .78rem;
    min-height: 28px;
    padding: .24rem .42rem;
}

.kb-office-sidebar .sidebar-tag-block {
    border-top: 1px solid var(--color-line);
    margin-top: .75rem;
    padding-top: .6rem;
}

.kb-office-sidebar .sidebar-tag-block .panel-heading {
    border: 0;
    margin: 0 0 .45rem;
    min-height: 0;
    padding: 0;
}

.kb-office-sidebar .tag-list {
    gap: .25rem;
}

.kb-office-articles {
    padding: .75rem;
}

.kb-office-articles .kb-office-table-heading {
    align-items: center;
    gap: .55rem;
}

.kb-office-articles .article-heading-actions {
    gap: .35rem;
}

.kb-office-articles .secondary-action-compact,
.kb-office-articles .secondary-button-compact,
.kb-office-articles .primary-action-compact {
    border-radius: 5px;
    font-size: .78rem;
    min-height: 30px;
    padding: .31rem .5rem;
}

.kb-office-articles .article-create-action {
    margin-left: auto;
}

.kb-office-articles .bulk-action-bar {
    background: #fafaff;
    border-radius: 6px;
    gap: .35rem;
    margin-bottom: .5rem;
    padding: .38rem;
}

.kb-office-articles .bulk-action-bar select,
.kb-office-articles .bulk-action-bar input {
    font-size: .78rem;
    min-height: 28px;
    padding: .24rem .38rem;
}

.kb-office-articles .bulk-select-all {
    font-size: .78rem;
    min-height: 28px;
    padding: .2rem .38rem;
}

.kb-office-articles .table-pagination {
    font-size: .78rem;
    gap: .45rem;
}

.kb-office-articles .table-pagination-top {
    background: #fafaff;
    border: 1px solid var(--color-line);
    border-radius: 6px;
    margin-bottom: .45rem;
    padding: .38rem .5rem;
}

.kb-office-articles .table-pagination-bottom {
    margin-top: .45rem;
    padding-top: .45rem;
}

.kb-office-articles .table-pagination select,
.kb-office-articles .table-pagination .secondary-button {
    min-height: 28px;
}

.kb-office-articles .article-table {
    border: 1px solid var(--color-line);
    border-radius: 6px;
    overflow: auto;
}

.kb-office-articles .article-table-head {
    background: #f8f9fd;
    border-bottom: 1px solid var(--color-line);
    min-height: 38px;
    padding: 0;
}

.kb-office-articles .article-table-head .table-filter-cell > button {
    font-size: .74rem;
    min-height: 36px;
    width: 100%;
}

/* #ADG Компактная строка Wiki показывает только основные поля статьи, без служебных тегов и файлов. */
.kb-office-articles .article-row {
    border-top: 0;
    border-bottom: 1px solid var(--color-line);
    min-height: 40px;
    padding-block: 0;
}

.kb-office-articles .article-row:last-child {
    border-bottom: 0;
}

.kb-office-articles .article-row:hover {
    background: #f8f9fd;
}

.kb-office-articles .article-row > *,
.kb-office-articles .article-table-head > * {
    padding-inline: .58rem;
}

/* Центрируем чекбоксы выбора относительно узкой первой колонки Wiki. */
.kb-office-articles .article-row > :first-child,
.kb-office-articles .article-table-head > :first-child {
    align-items: center;
    display: flex;
    justify-content: center;
    padding-inline: 0;
}

.kb-office-articles .article-row > :first-child input[type="checkbox"],
.kb-office-articles .article-table-head > :first-child input[type="checkbox"] {
    display: block;
    margin: 0;
}

.kb-office-articles .article-title-link {
    font-size: .9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kb-office-articles .article-title-cell {
    display: block;
    overflow: hidden;
}

.kb-office-articles .tag-pill {
    font-size: .7rem;
    padding: .18rem .34rem;
}

.kb-office-articles .status-badge {
    font-size: .72rem;
    padding: .2rem .4rem;
}

.ai-log-message {
    background: var(--color-surface-muted);
    border: 1px solid var(--color-line);
    border-radius: 8px;
    padding: .9rem 1rem;
}

.ai-log-message > div:first-child {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.ai-log-message span {
    color: var(--color-muted);
    font-size: .84rem;
}

.ai-log-message p {
    margin: .65rem 0 0;
    white-space: pre-wrap;
}

.ai-log-sources {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin-top: .75rem;
}

.ai-gap-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .75rem;
}

.ai-gap-item {
    align-items: center;
    border-top: 1px solid var(--color-line);
    display: grid;
    gap: .75rem;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: .65rem 0;
}

.ai-gap-item:first-child {
    border-top: 0;
}

.ai-gap-item button {
    background: transparent;
    border: 0;
    color: inherit;
    padding: 0;
    text-align: left;
}

.ai-log-sources a {
    background: #fff;
    border: 1px solid var(--color-line);
    border-radius: 6px;
    color: var(--color-brand-dark);
    font-size: .84rem;
    padding: .35rem .5rem;
    text-decoration: none;
}

.ai-maintenance-bar {
    align-items: center;
    background: var(--color-surface-muted);
    border: 1px solid var(--color-line);
    border-radius: 8px;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-top: 1rem;
    padding: .85rem;
}

.ai-maintenance-bar span {
    color: var(--color-muted);
    font-size: .9rem;
}

.ai-source-list {
    display: flex;
    flex-direction: column;
}

.ai-search-terms {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin-top: .85rem;
}

.ai-search-terms span {
    color: var(--color-muted);
    font-size: .88rem;
}

.ai-search-terms strong {
    background: #fff7d7;
    border: 1px solid #e6cf7b;
    border-radius: 999px;
    color: #765b0d;
    font-size: .84rem;
    padding: .25rem .5rem;
}

.answer-mode-warning {
    background: #fff7d7;
    border-color: #e6cf7b;
    color: #765b0d;
    margin-top: .75rem;
}

.ai-source-item {
    border-top: 1px solid var(--color-line);
    padding: .9rem 0;
}

.ai-source-item:first-child {
    border-top: 0;
    padding-top: 0;
}

.ai-source-item span {
    color: var(--color-muted);
    display: block;
    font-size: .84rem;
    margin-top: .2rem;
}

.ai-source-item p {
    color: var(--color-ink-soft);
    margin: .55rem 0 0;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

@media (max-width: 1100px) {
    .hero,
    .split,
    .kb-layout,
    .kb-list-layout,
    .dashboard-overview,
    .dashboard-work-grid,
    .kb-metrics,
    .users-layout,
    .access-summary-grid,
    .route-access-grid,
    .access-policy-list,
    .admin-overview-grid,
    .admin-layout,
    .version-workspace {
        grid-template-columns: 1fr;
    }

    .start-hints {
        grid-template-columns: 1fr;
    }

    .admin-section-row {
        align-items: flex-start;
        grid-template-columns: 1fr;
    }

    .admin-settings-row {
        align-items: flex-start;
        grid-template-columns: 1fr;
    }

    .admin-settings-row-action {
        justify-content: flex-start;
    }

    .release-notes-current {
        align-items: flex-start;
        flex-direction: column;
    }

    .release-notes-checks {
        text-align: left;
    }

    .release-history-row {
        grid-template-columns: 1fr;
    }

    .start-hints-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .module-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

.style-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
}

.role-check-list {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    grid-column: 1 / -1;
    align-items: center;
}

.role-check-list label {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: .35rem;
    min-height: 32px;
    padding: .25rem .55rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    font-weight: 600;
}

.article-form .role-check-list input[type="checkbox"] {
    flex: 0 0 auto;
    height: 16px;
    min-width: 16px;
    padding: 0;
    width: 16px;
}

.article-form .role-check-list label > span {
    font-size: .86rem;
    font-weight: 700;
    line-height: 1.2;
}

@media (max-width: 700px) {
    .content {
        padding: 1rem;
    }

    .ai-chat-layout {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 420px;
    }

    .ai-diagnostics-aside {
        order: -1;
    }

    .module-grid {
        grid-template-columns: 1fr;
    }

    .start-hints-actions {
        grid-template-columns: 1fr;
    }

    .style-strip {
        grid-template-columns: 1fr;
    }

    .page-head-actions,
    .article-view-head,
    .article-meta-strip,
    .article-quality-panel,
    .article-workflow-panel,
    .edit-save-panel,
    .article-form,
    .bulk-action-bar,
    .settings-grid,
    .settings-test-panel,
    .settings-index-issue-columns,
    .version-item,
    .article-table-head,
    .article-row,
    .company-table-head,
    .company-row,
    .ai-log-table-head,
    .ai-log-row,
    .audit-filter-row,
    .audit-table-head,
    .audit-row,
    .user-table-head,
    .user-row {
        grid-template-columns: 1fr;
    }

    .page-head-actions {
        display: grid;
    }

    .article-table-head,
    .article-row,
    .company-table-head,
    .company-row,
    .user-table-head,
    .user-row,
    .ai-log-table-head,
    .ai-log-row,
    .audit-table-head,
    .audit-row {
        min-width: 0;
    }

    .panel-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .panel-heading-actions {
        justify-content: flex-start;
        width: 100%;
    }

    .kb-search {
        grid-template-columns: 1fr;
    }

    .article-filter-panel,
    .kb-office-search .article-filter-panel {
        grid-template-columns: 1fr;
    }

    .article-filter-panel button {
        align-self: stretch;
        width: 100%;
    }

    .version-detail {
        border-left: 0;
        padding-left: 0;
    }

    .version-detail-head,
    .version-compare-title,
    .version-compare-controls label {
        align-items: flex-start;
        flex-direction: column;
    }

    .version-summary-strip,
    .version-meta-grid,
    .version-diff-row {
        grid-template-columns: 1fr;
    }
}

