/* Custom overrides kept separate from legacy custom.css */

.ticket-form-feedback-summary {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-left: auto;
}

.ticket-form-feedback-summary__label {
    color: #5f7085;
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.2;
}

.ticket-form-feedback-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.1;
}

.ticket-form-feedback-pill::before {
    content: '';
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 50%;
    background: currentColor;
    flex: 0 0 auto;
}

.ticket-form-feedback-pill--good {
    background: rgba(var(--green-status-rgb), 0.12);
    color: var(--green-status);
}

.ticket-form-feedback-pill--bad {
    background: rgba(var(--red-status-rgb), 0.12);
    color: var(--red-status);
}

.ticket-timeline-marker-row {
    margin: 0 0 1.4rem;
    width: 100%;
    padding: 1rem 1.4rem;
    gap: 1rem;
}

.ticket-timeline-marker-row.alert.alert-info {
    background: var(--info);
    border: 1px solid var(--info-status);
    border-radius: 1.2rem;
    color: var(--info-status);
}

.ticket-timeline-marker-row.alert.alert-success {
    background: rgba(var(--green-status-rgb), 0.12);
    border: 1px solid rgba(var(--green-status-rgb), 0.45);
    border-radius: 1.2rem;
    color: var(--green-status);
}

.ticket-timeline-marker-row.alert.alert-danger {
    background: rgba(var(--red-status-rgb), 0.12);
    border: 1px solid rgba(var(--red-status-rgb), 0.45);
    border-radius: 1.2rem;
    color: var(--red-status);
}

.ticket-timeline-banner__body {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    min-width: 0;
    flex: 1 1 auto;
}

.ticket-timeline-banner__content {
    display: grid;
    gap: 0.55rem;
    min-width: 0;
    flex: 1 1 auto;
}

.ticket-timeline-banner__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: currentColor;
    margin-top: 0.1rem;
}

.ticket-timeline-banner__icon svg {
    width: 1.75rem;
    height: 1.75rem;
}

.ticket-timeline-banner__text {
    margin: 0;
    min-width: 0;
    color: inherit;
    font-size: 1.4rem;
    line-height: 1.4;
    flex: 1 1 auto;
}

.ticket-timeline-banner__link {
    color: inherit;
    text-decoration: none;
    font-weight: 400;
    transition: opacity 120ms ease, text-decoration-color 120ms ease;
}

.ticket-timeline-banner__link:hover,
.ticket-timeline-banner__link:focus {
    color: inherit;
    opacity: 0.88;
    text-decoration: underline;
}

.ticket-timeline-banner__comment {
    margin: 0;
    min-width: 0;
    color: inherit;
    font-size: 1.35rem;
    line-height: 1.55;
}

.checklist-editor--root-only {
    border-color: #c1d3a3;
    background: var(--private);
}

.checklist-editor--scoped .checklist-editor__header {
    flex-wrap: wrap;
}

.checklist-editor--scoped .checklist-editor__summary {
    display: grid;
    gap: 0.35rem;
}

.checklist-editor__summary {
    display: grid;
    gap: 0.35rem;
}

.checklist-editor__scope {
    color: #5f7085;
    font-size: 1.25rem;
    line-height: 1.4;
}

.checklist-editor--scoped .checklist-editor__actions {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

.checklist-editor__visibility-control {
    display: grid;
    gap: 0.35rem;
    color: #5f7085;
    font-size: 1.2rem;
    font-weight: 600;
}

.checklist-editor__visibility-select {
   /* min-height: 3.8rem;
    padding: 0.8rem 1rem;
    border: 1px solid #c3d0dc;
    border-radius: 0.8rem;
    background: #fff;
    color: #1f3142;*/
}

.checklist-editor--scoped .checklist-editor__group-list {
    display: grid;
    gap: 1rem;
}

.checklist-editor--scoped .checklist-editor__group {
    display: grid;
    gap: 1rem;
    padding: 1.2rem;
    border: 1px solid #d8e2eb;
    border-radius: 1rem;
    background: var(--checklist-group-bg, #fff);
}

.checklist-editor--scoped .checklist-editor__group--private {
    --checklist-group-bg: var(--private);
    border-color: color-mix(in srgb, var(--private) 75%, #98ad73 25%);
}

.checklist-editor--scoped .checklist-editor__group--internal {
    --checklist-group-bg: var(--internal);
    border-color: color-mix(in srgb, var(--internal) 75%, #cda84d 25%);
}

.checklist-editor--scoped .checklist-editor__group--public {
    --checklist-group-bg: #ffffff;
    border-color: #d8e2eb;
}

.checklist-editor--scoped .checklist-editor__group-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.checklist-editor--scoped .checklist-editor__group-summary {
    display: grid;
    gap: 0.25rem;
}

.checklist-editor--scoped .checklist-editor__group-title {
    margin: 0;
    color: #1c3550;
    font-size: 1.35rem;
    font-weight: 900;
}

.checklist-editor--scoped .checklist-editor__group-meta,
.checklist-editor--scoped .checklist-editor__group-note {
    color: #4c5f74;
    font-size: 1.15rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.checklist-editor--scoped .checklist-editor__list {
    gap: 0.8rem;
}

.checklist-editor--scoped .checklist-editor__row {
    grid-template-columns: auto minmax(0, 1fr);
}

.checklist-editor--scoped .checklist-editor__row-body {
    display: grid;
    gap: 0.65rem;
    min-width: 0;
}

.checklist-editor--scoped .checklist-editor__row-actions {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
}

.checklist-editor--scoped .checklist-editor__edit-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(14rem, 16rem) auto;
    gap: 0.9rem;
    align-items: center;
    min-width: 0;
}

.checklist-editor--scoped .checklist-editor__remove-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    white-space: nowrap;
}

.checklist-editor--scoped .checklist-editor__remove-btn svg {
    width: 1.4rem;
    height: 1.4rem;
}

.checklist-editor--scoped .checklist-editor__display {
    gap: 0.3rem;
}

@media (max-width: 640px) {
    .checklist-editor__header {
        align-items: flex-start;
        flex-direction: column;
    }

    .checklist-editor--scoped .checklist-editor__group-header {
        flex-direction: column;
    }

    .checklist-editor--scoped .checklist-editor__actions {
        align-items: stretch;
    }

    .checklist-editor__visibility-control,
    .checklist-editor__visibility-select {
        width: 100%;
    }

    .checklist-editor--scoped .checklist-editor__edit-line {
        grid-template-columns: minmax(0, 1fr);
    }
}

.ticket-comment-notice-row {
    display: flex;
    width: 100%;
}

.ticket-comment-row--agent .ticket-comment-notice-row {
    justify-content: flex-end;
}

.ticket-comment-row--customer .ticket-comment-notice-row {
    justify-content: flex-start;
}

.ticket-comment-notice {
    width: min(72rem, 100%);
    margin: 0;
    padding: 0.9rem 1.2rem;
    border: 1px solid transparent;
    border-radius: 1.2rem;
    gap: 1rem;
}

.ticket-comment-notice .form-group-note__label {
    font-size: 1.2rem;
    line-height: 1.4;
}

.ticket-comment-notice p {
    color: var(--text-grey);
    font-size: 1.3rem;
    line-height: 1.45;
}

.ticket-comment-notice--warning {
    background-color: rgba(var(--amber-status-rgb), 0.18);
    border-color: rgba(var(--amber-status-rgb), 0.55);
}

.ticket-comment-notice--alert {
    background-color: rgba(var(--red-status-rgb), 0.12);
    border-color: rgba(var(--red-status-rgb), 0.4);
}

.ticket-alert-burst-badge {
    background-color: rgba(var(--amber-status-rgb), 0.14);
    border: 1px solid rgba(var(--amber-status-rgb), 0.7);
    border-radius: 999px;
    color: var(--amber-status);
    cursor: help;
    font-size: 1.15rem;
    font-weight: 900;
    line-height: 1;
    margin-left: 0.55rem;
    margin-right: 0;
    margin-top: 0;
    min-width: 0;
    padding: 0.3rem 0.7rem;
    vertical-align: middle;
}

.ticket-dirty-summary--warning {
    background: rgba(var(--amber-status-rgb), 0.14);
    border-color: rgba(var(--amber-status-rgb), 0.55);
}

.ticket-dirty-summary--warning .ticket-dirty-summary__label {
    color: var(--primary-color);
}

.ticket-dirty-summary--warning .ticket-dirty-summary__chip {
    background: rgba(var(--amber-status-rgb), 0.55);
    border-color: rgba(var(--amber-status-rgb), 0.55);
    color: var(--primary-color);
}

.ticket-comments-search {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0;
}

.ticket-comments-search .search-filter-input {
    flex: 1 1 auto;
    min-width: 0;
    margin-bottom: 0;
}

.ticket-comments-search .btn {
    flex: 0 0 auto;
}

.ticket-comments-search + .form-group-note {
    padding: 1rem 1.4rem;
    margin-top: 0;
    margin-bottom: 0;
    font-size: 1.3rem;
}

.comments-wrap .ticket-comments-search {
    margin-bottom: 2rem;
}

.comments-wrap .ticket-comments-search + .form-group-note {
    margin-top: -1.25rem;
    margin-bottom: 2rem;
}

.activity-log-table th:first-child,
.activity-log-table td:first-child {
    width: 13rem;
    min-width: 13rem;
    white-space: nowrap;
}

.activity-log-table th:nth-child(2),
.activity-log-table td:nth-child(2) {
    width: 11rem;
    min-width: 11rem;
}

.activity-log-table th:nth-child(3),
.activity-log-table td:nth-child(3) {
    width: 12rem;
    min-width: 12rem;
}

.activity-log-table th:nth-child(4),
.activity-log-table td:nth-child(4) {
    width: 16rem;
    min-width: 16rem;
}

.activity-log-table th:nth-child(5),
.activity-log-table td:nth-child(5) {
    width: 10rem;
    min-width: 10rem;
}

.activity-date-filter {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.8rem;
    width: 100%;
}

.activity-date-filter .search-filter-input {
    width: 100%;
    min-width: 0;
}

.partner-directory-table {
    width: 100%;
}

.partner-directory-table th,
.partner-directory-table td {
    vertical-align: top;
}

.partner-directory-contact-line + .partner-directory-contact-line {
    margin-top: 0.45rem;
}

.audit-index {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    margin-top: 1rem;
}

.audit-index__card {
    border: 1px solid #d6dde5;
    border-radius: 0.75rem;
    color: inherit;
    display: grid;
    gap: 0.35rem;
    padding: 1rem;
    text-decoration: none;
}

.audit-index__card:hover {
    border-color: #86a4c1;
}

.audit-index__card span {
    color: #5d7288;
}

.report-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    margin-top: 1.5rem;
}

.report-card {
    border: 1px solid rgba(7, 53, 79, 0.12);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 249, 252, 0.96));
    padding: 1.5rem;
    box-shadow: 0 18px 40px rgba(7, 53, 79, 0.08);
}

.report-card h2 {
    margin-bottom: 0.5rem;
}

.report-card p {
    color: #52606d;
}

.report-meta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 1rem 0 1.25rem;
}

.report-meta span {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: rgba(7, 53, 79, 0.08);
    color: var(--primary-color);
    font-size: 0.9rem;
    padding: 0.35rem 0.7rem;
}

.report-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.report-actions form {
    margin: 0;
}

.report-export-btn {
    min-width: 132px;
}

.report-export-btn[disabled] {
    opacity: 0.75;
    cursor: wait;
}

.report-export-btn.is-busy {
    box-shadow: inset 0 0 0 999px rgba(7, 53, 79, 0.08);
}

.report-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.report-hero__scope {
    color: #52606d;
    margin: 0;
}

.user-links__pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.user-links__pill {
    align-items: center;
    background: #f3f7fb;
    border: 1px solid #d6dde5;
    border-radius: 999px;
    color: #17324d;
    display: inline-flex;
    gap: 0.45rem;
    line-height: 1;
    padding: 0.35rem 0.75rem;
}

.user-links__pill:hover {
    background: #e7eef6;
}

.user-links__pill-close {
    font-size: 1rem;
    line-height: 1;
}

.user-links__third-party-panel {
    background: #f6f9fc;
    border: 1px solid #d6dde5;
    border-radius: 0.5rem;
    display: grid;
    gap: 0.55rem;
    margin-top: 0.65rem;
    padding: 0.75rem;
}

.user-links__third-party-row,
.user-links__third-party-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.user-links__preview {
    background: #fff;
    border: 1px solid #d6dde5;
    border-radius: 0.45rem;
    padding: 0.65rem 0.75rem;
}

.user-links__preview p {
    margin: 0.2rem 0;
}

.user-links__muted {
    color: #5f748a;
    display: inline-block;
    font-size: 0.95rem;
}

.audit-tool__filters,
.audit-tool__body,
.audit-tool__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.audit-tool__filters {
    margin-bottom: 1rem;
}

.audit-tool__filter {
    display: grid;
    gap: 0.35rem;
    min-width: 18rem;
}

.audit-tool__list,
.audit-tool__summary {
    flex: 1 1 24rem;
}

.audit-tool__organisations {
    display: grid;
    gap: 0.35rem;
}

.audit-tool__organisation {
    align-items: flex-start;
    display: grid;
    gap: 0.5rem;
    grid-template-columns: 1.25rem minmax(0, 1fr);
    padding: 0.15rem 0;
}

.audit-tool__organisation--selected {
    font-weight: 600;
}

.audit-tool__organisation small {
    color: #5d7288;
    display: block;
    font-weight: 400;
}

.audit-tool__preview {
    background: #f6f9fc;
    border: 1px solid #d6dde5;
    border-radius: 0.5rem;
    margin-top: 1rem;
    padding: 0.75rem;
}

.audit-tool__preview-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.audit-tool__preview p {
    margin: 0.2rem 0;
}

.domain-links__list {
    display: grid;
    gap: 0.2rem;
    margin-top: 0.5rem;
}

.domain-links__list-item {
    align-items: flex-start;
    color: #17324d;
    display: grid;
    gap: 0.5rem;
    grid-template-columns: 1.25rem minmax(0, 1fr);
    padding: 0;
}

.domain-links__list-item-check {
    display: flex;
    justify-content: center;
    padding-top: 0.1rem;
}

.domain-links__list-item input {
    margin-top: 0.2rem;
}

.domain-links__list-item-marker {
    color: #7cb342;
    display: inline-block;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-top: 0.05rem;
}

.domain-links__list-item-body {
    display: grid;
}

.domain-links__list-item--mapped {
    font-weight: 600;
}

.domain-links__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.domain-links__preview {
    background: #f6f9fc;
    border: 1px solid #d6dde5;
    border-radius: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.75rem;
}

.domain-links__preview-header {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    margin-bottom: 0.35rem;
}

.domain-links__preview p {
    margin: 0.2rem 0;
}

.organisation-unassigned__error {
    color: var(--red-status);
}

.ticket-list__sla-beta-notice {
    margin: 18px 0 20px;
    padding: 16px 18px;
    border: 1px solid rgba(var(--amber-status-rgb), 0.55);
    border-radius: 12px;
    background: rgba(var(--amber-status-rgb), 0.12);
    color: #17324d;
    font-size: 14px;
    line-height: 1.65;
}

.ticket-list__sla-beta-notice strong {
    display: block;
    margin-bottom: 10px;
    font-size: 15px;
}

.ticket-list__sla-beta-notice-copy {
    display: block;
}

.ticket-list__sla-beta-notice a {
    color: #6f348f;
    font-weight: 600;
    text-decoration: underline;
}

.ticket-list-title-actions__buttons {
    gap: 12px;
    margin-left: auto;
}

.form-group-note--note {
    background-color: var(--info-status-tint);
}

.form-group-note--warning {
    background-color: var(--amber-status-tint);
}

.form-group-note--description {
    background-color: transparent;
}

.form-group-note--description .form-group-note__subtle {
    font-style: italic;
}

.form-group-note--note:not(.form-group-note--card):not(.form-group-note--compact),
.form-group-note--warning:not(.form-group-note--card):not(.form-group-note--compact) {
    border: 1px solid transparent;
    border-radius: 1.2rem;
    padding: 1.2rem 1.4rem;
}

.form-group-note--note:not(.form-group-note--card):not(.form-group-note--compact).d-flex,
.form-group-note--warning:not(.form-group-note--card):not(.form-group-note--compact).d-flex {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
}

.form-group-note--note:not(.form-group-note--card):not(.form-group-note--compact) {
    border-color: var(--info-status);
}

.form-group-note--warning:not(.form-group-note--card):not(.form-group-note--compact) {
    border-color: var(--amber-status);
}

.form-group-note--note:not(.form-group-note--card):not(.form-group-note--compact) p,
.form-group-note--warning:not(.form-group-note--card):not(.form-group-note--compact) p {
    flex: 1 1 auto;
    min-width: 0;
}

.form-field-description {
    background-color: color-mix(in srgb, var(--grey-status) 40%, white);
}

.form-inline-warning {
    background-color: var(--amber-status-tint);
    padding: 10px;
}

.form-inline-note {
    background-color: var(--info-status-tint);
    padding: 10px;
}

.form-inline-description {
    background-color: color-mix(in srgb, var(--grey-status) 40%, white);
    padding: 10px;
}

.software-table__count,
.wan-table__count {
    text-align: center;
}

.partner-directory-stats-cell {
    min-width: 28rem;
}

.partner-directory-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.partner-directory-stat {
    display: inline-flex;
    align-items: baseline;
    gap: 0.45rem;
    padding: 0.35rem 0.85rem;
    border: 1px solid var(--input-border);
    border-radius: 999px;
    background: var(--input-bg);
    color: var(--text-grey);
    font-size: 1.25rem;
    line-height: 1.3;
}

.partner-directory-stat strong {
    color: var(--tertiary-color-text);
    font-size: 1.4rem;
    font-weight: 900;
}

legend.ticket-reply-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    margin-bottom: 0.6rem;
    padding: 0;
    line-height: 1.2;
}

.partner-directory-stats__subtle {
    margin: 0.7rem 0 0;
    color: var(--text-grey);
    font-size: 1.25rem;
    line-height: 1.45;
}

@media (max-width: 900px) {
    .partner-directory-stats-cell {
        min-width: 22rem;
    }
}

.ticket-workspace-ticket-copy {
    display: inline-flex;
    position: relative;
    transition: color 0.16s ease;
}

.ticket-workspace-ticket-copy__value {
    display: inline-block;
    transition: text-decoration-color 0.18s ease;
}

.ticket-workspace-ticket-copy__toast {
    background: #fff;
    border: 1px solid rgba(25, 39, 52, 0.14);
    border-radius: 999px;
    box-shadow: 0 10px 22px rgba(25, 39, 52, 0.12);
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 600;
    left: 50%;
    line-height: 1;
    padding: 0.35rem 0.65rem;
    pointer-events: none;
    position: absolute;
    top: -0.7rem;
    transform: translate(-50%, -100%);
    white-space: nowrap;
    z-index: 2;
}

.ticket-workspace-ticket-copy.is-copied .ticket-workspace-ticket-copy__value {
    text-decoration: underline;
    text-decoration-color: rgba(var(--green-status-rgb), 0.45);
    text-decoration-thickness: 2px;
    text-underline-offset: 0.14em;
}

.ticket-workspace-pane__title-meta {
    align-items: center;
}

.ticket-workspace-pane__status-badge,
.ticket-workspace-pane__sla-badge {
    align-items: center;
    border-radius: 0.4rem;
    box-sizing: border-box;
    display: inline-flex;
    height: 2.8rem;
    justify-content: center;
    line-height: 1;
    vertical-align: middle;
}

.ticket-workspace-pane__status-badge {
    align-self: center;
    padding: 0 0.8rem;
}

.ticket-workspace-pane__sla-wrap {
    align-self: center;
    margin-left: 0.8rem;
}

.ticket-workspace-pane__sla-badge {
    margin: 0;
    padding: 0 0.8rem;
}

.ticket-workspace-tab__status {
    align-items: center;
    display: inline-flex;
    flex: 0 0 auto;
    height: 1.35rem;
    justify-content: center;
    position: relative;
    width: 1.35rem;
}

.ticket-workspace-tab__status .ticket-workspace-tab__dirty {
    background: var(--amber-status, #D8A927);
    height: 0.9rem;
    left: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 0.9rem;
    z-index: 0;
}

.ticket-workspace-backdrop,
.ticket-workspace-panel {
    transition: opacity 0.18s ease, transform 0.22s ease;
    will-change: opacity, transform;
}

.ticket-workspace-pane .dropup .dropdown-menu > li > .dropdown-item {
    background-color: transparent;
    border: 0;
    color: inherit;
    text-align: left;
    width: 100%;
}

.ticket-workspace-panel {
    transform: translateY(0) scale(1);
    transform-origin: top center;
}

.ticket-workspace-backdrop.is-minimising {
    opacity: 0;
    pointer-events: none;
}

.ticket-workspace-shell--minimising .ticket-workspace-backdrop {
    opacity: 0 !important;
    pointer-events: none;
    visibility: hidden;
}

.ticket-workspace-panel.is-minimising {
    opacity: 0;
    pointer-events: none;
    transform: translateY(2.8rem) scale(0.985);
}

.ticket-workspace-shell--minimising .ticket-workspace-panel {
    opacity: 0 !important;
    pointer-events: none;
    transform: translateY(2.8rem) scale(0.985);
    visibility: hidden;
}

body:has(.ticket-workspace-shell.ticket-workspace-shell--has-bar) {
    overflow-x: hidden;
    padding-bottom: var(--ticket-workspace-bar-height, 6.4rem);
}

body:has(.ticket-workspace-shell):not(:has(.ticket-workspace-shell.ticket-workspace-shell--has-bar)) {
    padding-bottom: 0;
}

@media screen and (min-width: 700px) {
    body:has(.ticket-workspace-shell.ticket-workspace-shell--has-bar) > .d-flex {
        min-height: calc(100vh + var(--ticket-workspace-bar-height, 6.4rem));
        align-items: stretch;
    }

    body:has(.ticket-workspace-shell):not(:has(.ticket-workspace-shell.ticket-workspace-shell--has-bar)) > .d-flex {
        min-height: 100vh;
    }

    body:has(.ticket-workspace-shell.ticket-workspace-shell--has-bar) .sidebar {
        min-height: 100%;
    }
}

body:has(.ticket-workspace-shell.ticket-workspace-shell--has-bar) .toast-container.position-fixed {
    bottom: var(--ticket-workspace-bar-height, 6.4rem) !important;
    left: 0 !important;
    padding: 0.5rem !important;
    right: auto !important;
}

body:has(.ticket-workspace-shell):not(:has(.ticket-workspace-shell.ticket-workspace-shell--has-bar)) .toast-container.position-fixed {
    bottom: 0 !important;
    left: 0 !important;
    padding: 0.5rem !important;
    right: auto !important;
}

.toast-container .toast {
    border-radius: 0.6rem;
    overflow: hidden;
}

.toast-container .toast {
    min-width: 22rem;
}

.toast-container .toast .toast-header {
    align-items: flex-start;
    background-color: var(--primary-color, #07354f);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    display: flex;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
}

.toast-container .toast .toast-header .bi {
    color: #9fb3c8;
    flex-shrink: 0;
    font-size: 1.4rem;
    line-height: 1.2;
}

.toast-container .toast .toast-header strong {
    color: #fff;
    flex: 1 1 auto;
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.2;
    margin: 0;
    padding-right: 0.5rem;
}

.toast-container .toast .toast-header .btn-close {
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center/1rem auto no-repeat;
    border: 0;
    flex-shrink: 0;
    height: 1.2rem;
    margin: 0;
    margin-left: auto;
    opacity: 0.85;
    padding: 0;
    width: 1.2rem;
}

.toast-container .toast .toast-header .btn-close:hover {
    opacity: 1;
}

.toast-container .toast .toast-body {
    font-size: 1.3rem;
    line-height: 1.45;
    padding: 1rem;
}

.toast-container .toast.success .toast-header .bi {
    color: var(--green-status, #79c143);
}

.toast-container .toast.danger .toast-header .bi,
.toast-container .toast.error .toast-header .bi {
    color: var(--red-status, #e50046);
}

.toast-container .toast.warning .toast-header .bi {
    color: var(--amber-status, #D8A927);
}

.toast-container .toast.info .toast-header .bi {
    color: var(--info-status, #00a1d4);
}

/* AIison chat now lives inside .settings-nav as a header item rather than as
   a fixed floating button. All overrides for the legacy chat positioning,
   ticket-workspace-bar-aware variants, and bottom-left clearance paddings
   live here; custom.css and custom_temp.css are left untouched. */

/* position:static disables the inherited `position:fixed`, so the toggle
   flows inline next to the profile button. With position:static, all the
   bottom/left/right declarations on `.aiison-chat-shell` in custom.css
   (including the body:has(...) variants) are ignored. */
.settings-nav .aiison-chat-shell {
    position: static;
    inset: auto;
    width: auto;
    display: inline-flex;
    align-items: center;
    margin-right: 1.2rem;
}

/* Selector specificity (0,3,1) matches the legacy
   `body:has(.ticket-workspace-shell .ticket-workspace-bar) .aiison-chat-panel`
   rules in custom.css; this file loads later so wins on the cascade. */
body.aiison-chat-active .settings-nav .aiison-chat-panel {
    position: absolute;
    top: 57px;
    right: 0;
    bottom: auto;
    left: auto;
    z-index: 1001;
}

/* The floating toggle used to overlap the sidebar; the bottom padding that
   compensated for it is no longer needed now the toggle is in the header. */
.aiison-chat-active .sites-nav {
    padding-bottom: 0;
}

/* The ticket-workspace bar used to leave a 6.7rem left gap (and the mobile
   tabs-wrap a 5.8rem one) to clear the floating chat button. With the toggle
   in the header, the tabs can use that space. */
.ticket-workspace-bar {
    padding-left: 1.2rem;
}

.ticket-workspace-tabs-wrap {
    padding-left: 0;
}

.ticket-workspace-backdrop {
    z-index: 1;
}

.ticket-workspace-bar {
    right: 0;
    z-index: 2;
}

.ticket-workspace-shell:not(.ticket-workspace-shell--has-bar) .ticket-workspace-bar {
    display: none !important;
}

.ticket-workspace-panel {
    z-index: 3;
}

.ticket-workspace-minimise-ghost-backdrop,
.ticket-workspace-minimise-ghost-panel {
    pointer-events: none;
    position: fixed;
    will-change: opacity, transform;
    z-index: 1061;
}

.ticket-workspace-minimise-ghost-backdrop {
    inset: 0;
    transition: opacity 0.18s ease;
}

.ticket-workspace-minimise-ghost-panel {
    transition: opacity 0.18s ease, transform 0.22s ease;
    transform: translateY(0) scale(1);
    transform-origin: top center;
}

.ticket-workspace-minimise-ghost-backdrop.is-animating {
    opacity: 0 !important;
}

.ticket-workspace-minimise-ghost-panel.is-animating {
    opacity: 0;
    transform: translateY(2.8rem) scale(0.985);
}

.ticket-table .ticket-presence-col .eye-idle {
    color: rgba(74, 93, 112, 0.65);
    opacity: 0.8;
}

.ticket-table .ticket-presence-col .eye-idle path {
    fill: currentColor;
}

/* Opt the SLA cell out of `.no-wrap-ellipsis-table`'s td truncation — the cell
   only contains the fixed-size SLA pill (plus a position:fixed popover that's
   already out of flow), so ellipsis has nothing useful to truncate and was
   surfacing as a stray "…" after the pill. */
.ticket-sla-col {
    overflow: visible;
}

.ticket-reference-link {
    cursor: pointer;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

/*
 * Ticket workspace pane: header action buttons + sticky form button-wrap.
 *
 * The header has two action buttons (minimise and close). custom.css originally
 * styled the circle via `.ticket-workspace-pane__header .btn-close`, which only
 * matches the close button. The minimise button no longer carries the btn-close
 * class so we re-target the same circle styling at the shared modifier class.
 *
 * The form button-wrap (Submit/Cancel/Close) was previously commented out in
 * custom.css, leaving the buttons floating at the natural bottom of a long
 * scrolling form. Restore sticky positioning so they stay visible while the
 * pane scrolls.
 */
.ticket-workspace-pane__header .ticket-workspace-pane__action-btn {
    background: transparent;
    border: 1px solid var(--primary-color);
    border-radius: 50%;
    color: var(--primary-color);
    flex: 0 0 auto;
    height: 3.4rem;
    line-height: 1;
    padding: 0;
    width: 3.4rem;
}

.ticket-workspace-pane__action-btn {
    font-size: 1.4rem;
}

.ticket-workspace-pane__action-btn svg {
    height: 1.4rem;
    width: 1.4rem;
}

.ticket-workspace-pane .form-content {
    padding: 1.8rem 2rem 1.2rem;
}

.ticket-workspace-pane .form-content-view,
.ticket-workspace-pane .form-content-edit,
.ticket-workspace-pane .form-content-create {
    padding-bottom: 1.2rem;
}

.ticket-workspace-pane .button-wrap {
    background: #fff;
    bottom: 0;
    box-sizing: border-box;
    box-shadow: 0 -10px 30px 0 rgba(7, 53, 79, 0.15);
    margin-top: auto;
    padding: 1.2rem 2rem;
    position: sticky;
    width: 100%;
    z-index: 5;
}

@media (max-width: 991.98px) {
    .ticket-workspace-pane .button-wrap {
        bottom: var(--ticket-workspace-bar-height);
        margin-bottom: 0;
        margin-right: 0;
        padding-left: 2.4rem;
        padding-right: 2.4rem;
    }
}

@media (max-width: 575.98px) {
    .ticket-workspace-pane .button-wrap {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 0.8rem;
    }
    .ticket-workspace-pane .fixed-div-select {
        min-width: 0;
    }
}

.ticket-form-inline-link[disabled] {
    opacity: 0.7;
    cursor: default;
    text-decoration: none;
    pointer-events: none;
}

.ticket-form-inline-link[disabled]:hover {
    color: var(--text-grey-light);
}

.ticket-settings-card .ticket-settings-field {
    display: grid;
    gap: 1.4rem;
    margin-bottom: 2rem;
}

.ticket-settings-card .ticket-settings-field__main {
    margin-bottom: 0;
    min-width: 0;
}

.ticket-settings-card .ticket-settings-field__info {
    align-content: start;
    border: 1px solid rgba(var(--amber-status-rgb), 0.55);
    border-radius: 1.2rem;
    display: grid;
    gap: 0.75rem;
    margin: 0;
    overflow-wrap: anywhere;
    padding: 1.4rem 1.6rem;
}

.ticket-settings-card .ticket-settings-field__info .form-group-note__label {
    font-size: 1.15rem;
    letter-spacing: 0.05em;
    margin: 0;
    text-transform: uppercase;
}

.ticket-settings-card .ticket-settings-field__info p {
    color: var(--text-grey);
    font-size: 1.3rem;
    line-height: 1.55;
    margin: 0;
}

.ticket-settings-card .ticket-settings-field__info code {
    overflow-wrap: anywhere;
    white-space: normal;
}

@media (min-width: 992px) {
    .ticket-settings-card .ticket-settings-field--with-info {
        align-items: start;
        grid-template-columns: minmax(0, 1fr) minmax(24rem, 30rem);
    }
}

.ticket-comment-stack > .ticket-comment-email-link {
    text-align: left;
}

.gap-050 { gap: 0.5rem; }
.gap-1 { gap: 1rem; }

.btn-sm.btn-outline {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.project-tickets-grid .modal-dialog {
    max-width: 1200px;
}

.project-tickets-grid td {
    vertical-align: top;
}

.project-tickets-grid textarea {
    resize: none;
    min-height: 0;
    height: auto;
    overflow: hidden;
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
    line-height: 1.5;
}

.spin svg,
.spin {
    animation: spin 1s linear infinite;
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ── ID Card (lanyard-style contact card) ── */

.id-card {
    background: var(--white-background);
    border: 1px solid var(--light-grey);
    border-radius: 1.2rem;
    margin-top: 1rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.id-card__main {
    display: flex;
}

.id-card__header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 1.6rem 2rem;
    background: var(--primary-color);
    color: var(--white-text);
    width: 20rem;
    flex-shrink: 0;
    text-align: center;
}

.id-card__avatar-wrap {
    flex-shrink: 0;
    position: relative;
    width: 5.6rem;
    height: 5.6rem;
}

.id-card__avatar {
    width: 5.6rem;
    height: 5.6rem;
    border-radius: 999px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.id-card__avatar--initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    color: var(--white-text);
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.id-card__avatar--photo {
    position: absolute;
    top: 0;
    left: 0;
}

.id-card__identity {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.id-card__name {
    font-size: 1.5rem;
    font-weight: 900;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.id-card__role {
    font-size: 1.2rem;
    opacity: 0.85;
    line-height: 1.4;
    margin-top: 0.1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.id-card__contact-details,
.id-card__manager-details {
    color: var(--text-grey);
    font-size: 1.4rem;
    line-height: 1.5;
    display: grid;
    gap: 0.2rem;
}

.id-card__contact-details > div,
.id-card__manager-details > div {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.id-card__contact-details a,
.id-card__manager-details a {
    color: var(--text-grey);
    text-decoration: none;
}

.id-card__contact-details a:hover,
.id-card__manager-details a:hover {
    text-decoration: underline;
}

.id-card__body {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    align-content: center;
    gap: 0;
    min-width: 0;
    border-left: 1px solid var(--primary-color-tint);
}

.id-card__section {
    padding: 1.2rem 1.6rem;
}

.id-card__section--manager {
    border-left: 1px solid var(--primary-color-tint);
    min-width: 0;
}

.id-card__section-label {
    color: var(--text-grey-mid);
    font-size: 1.05rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 0.3rem;
}

.id-card__contact-details + .id-card__section-label,
.id-card__manager-details + .id-card__section-label {
    margin-top: 0.8rem;
}

.id-card__phone-key {
    color: var(--text-grey-mid);
    display: inline-block;
    font-weight: 900;
    font-size: 1.1rem;
    min-width: 1.6rem;
}

.id-card__manager-name {
    font-weight: 600;
}

/* Notes/warnings inside ID card */
.id-card > .form-group-note {
    margin: 0;
    border-top: 1px solid var(--primary-color-tint);
    border-radius: 0;
    padding: 1rem 1.6rem;
}

/* Override form-group margin for the new id-card */
.form-group > .id-card {
    margin-top: 1rem;
    margin-bottom: 0;
}

.form-group > .id-card + .form-group-note {
    margin-top: 1rem;
}

@media (max-width: 767.98px) {
    .id-card__main {
        flex-direction: column;
    }

    .id-card__header {
        flex-direction: row;
        text-align: left;
        min-width: 0;
    }

    .id-card__body {
        grid-template-columns: 1fr;
        border-top: 1px solid var(--primary-color-tint);
    }

    .id-card__section--manager {
        border-left: 0;
        border-top: 1px solid var(--primary-color-tint);
    }
}

/* ── identity-card: provider-agnostic identity summary card.
   Header is a wrapping horizontal flex row of "label: value" fields
   (UPN, MFA, Last sign-in, account flags); body is a 2-column grid
   for Licences + Devices with an optional full-width Aliases row. */

.identity-card {
    background: var(--white-background);
    border: 1px solid var(--light-grey);
    border-radius: 1.2rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.identity-card__header {
    background: var(--light-grey);
    color: var(--text-grey);
    padding: 0.8rem 1.2rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 1.4rem;
    font-size: 1.3rem;
    line-height: 1.4;
}

/* Override default.css's global `p { margin-bottom: 1.9rem }` for any
   paragraph that ends up inside the identity card. */
.identity-card p {
    margin: 0;
}

.identity-card__field {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.identity-card__field-label {
    color: var(--text-grey-mid);
    font-size: 1.05rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.identity-card__field-value {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.identity-card__field--flags {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 1.1rem;
    opacity: 0.85;
}

.identity-card__view-link {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--secondary-color-link);
    font-size: 1.2rem;
    text-decoration: none;
    white-space: nowrap;
}

.identity-card__view-link:hover {
    text-decoration: underline;
}

.identity-card__view-icon.bi {
    width: 1.2rem;
    height: 1.2rem;
}

.identity-card__mfa-icon.bi {
    width: 1.8rem;
    height: 1.8rem;
}

.identity-card__mfa-icon--ok {
    color: var(--green-status);
}

.identity-card__mfa-icon--warn {
    color: var(--amber-status);
}

.identity-card__mfa-icon--alert {
    color: var(--red-status);
}

.identity-card__body {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    align-content: start;
}

.identity-card__section {
    padding: 1rem 1.2rem;
}

.identity-card__section + .identity-card__section {
    border-left: 1px solid var(--light-grey);
}

.identity-card__section--full {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid var(--light-grey);
}

.identity-card__section-label {
    color: var(--text-grey-mid);
    font-size: 1.05rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 0.4rem;
}

.identity-card__list {
    color: var(--text-grey);
    font-size: 1.3rem;
    line-height: 1.4;
    list-style: disc;
    margin: 0;
    padding-left: 1.4rem;
}

.identity-card__list li {
    padding-left: 0.2rem;
}

.identity-card__device-tick.bi {
    width: 1.2rem;
    height: 1.2rem;
    color: var(--green-status);
    vertical-align: -0.15em;
    margin-left: 0.3rem;
}

.identity-card__aliases {
    color: var(--text-grey);
    font-size: 1.3rem;
    line-height: 1.4;
    word-break: break-word;
}

.identity-card + .identity-card {
    margin-top: 1rem;
}

@media (max-width: 600px) {
    .identity-card__body {
        grid-template-columns: 1fr;
    }

    .identity-card__section + .identity-card__section {
        border-left: 0;
        border-top: 1px solid var(--light-grey);
    }
}

/* ── identity-panel: tabs + heading + MFA status ── */

.identity-panel__heading {
    color: var(--text-grey-mid);
    font-size: 1.05rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin: 1.6rem 0 0.6rem;
}

.identity-panel + .identity-panel {
    margin-top: 1.6rem;
}

.identity-panel__tab-nav {
    margin-bottom: 0;
}

.identity-panel__tab-nav [role="tablist"] {
    margin-bottom: 0.8rem;
}

.identity-panel__tools {
    padding-top: 0.4rem;
}

.identity-panel__tools .button-wrap {
    margin-bottom: 0.8rem;
}

.identity-panel__tools .form-group-note {
    margin-top: 0.8rem;
}

.identity-panel__temp-password {
    font-size: 1.1em;
}

/* ── Radio button group primary colour override ── */

.btn-check:checked + .btn.btn-outline-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white-text);
}

.btn.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: var(--white-text);
}

/* ── Round icon button fix ── */

.icon-btn-round {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icon-btn-round svg {
    width: 1.6rem;
    height: 1.6rem;
}

/* ── Project count badge (muted) ── */

.badge--project {
    background: transparent;
    border: 1px solid var(--text-grey-light);
    color: var(--text-grey-mid);
    font-size: 1.1rem;
    font-weight: 600;
    opacity: 0.8;
}

.badge--project:not(.hidden) + .badge {
    margin-left: 0.3rem;
}

.badge--project:last-child,
.badge--project:has(+ .badge.hidden) {
    margin-right: calc(27px + 0.3rem);
}

.ticket-comment pre,
.ticket-comment code {
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
}

.ticket-comment table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
}

.ticket-row--linkable {
    cursor: pointer;
}

.ticket-row--linkable:hover {
    background-color: var(--input-bg);
}

.tab-separator {
    color: var(--text-grey-light);
    padding: 0 0.2rem;
    pointer-events: none;
    user-select: none;
}

.badge-in-progress {
    background-color: rgba(var(--amber-status-rgb), 0.1);
    color: var(--amber-status);
}

.badge--project-label {
    display: inline-block;
    font-size: inherit;
    font-weight: 600;
    padding: 0.1rem 0.5rem;
    border-radius: 0.3rem;
    border: 1px solid var(--text-grey-light);
    color: var(--text-grey-mid);
    vertical-align: baseline;
    margin-left: 0.4rem;
    white-space: nowrap;
}

/* ── Project task progress bar ── */

.project-task-progress {
    position: relative;
    min-width: 8rem;
    height: 2rem;
    background: var(--primary-color-tint);
    border-radius: 0.4rem;
    overflow: hidden;
}

.project-task-progress .progress-bar {
    background: var(--secondary-color);
    height: 100%;
    min-width: 2px;
    transition: width 0.3s ease;
}

.project-task-progress--empty {
    opacity: 0.4;
}

.project-task-progress::after {
    content: attr(data-label);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-grey);
    pointer-events: none;
}

/* ── Team phone number row ── */

.grid-row-phone-number {
    display: grid;
    grid-template-columns: 1fr 1.5fr auto;
    gap: 0.8rem;
    align-items: start;
    margin-bottom: 0.6rem;
}

.grid-row-phone-number .form-group {
    margin-bottom: 0;
}

/* ── Project overdue indicator ── */

.project-overdue-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.8rem;
    border-radius: 0.4rem;
    background: var(--red-tint);
    color: var(--red-status);
    font-size: 1.2rem;
    font-weight: 600;
}

/* ── Project description & checklist show-mode styling ── */

.project-description-readonly {
    white-space: pre-line;
    background: var(--input-bg);
    border-radius: 0.8rem;
    padding: 1.2rem 1.4rem;
    font-size: 1.5rem;
    line-height: 1.6;
    color: var(--text-grey);
}

.checklist-editor {
    background: var(--input-bg);
    border: none;
}

/* ── Partner name tag in header ── */

.partner-name-tag--header {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--primary-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 20rem;
    margin-left: auto;
    margin-right: 1.2rem;
    flex-shrink: 0;
    line-height: 1.3;
}

/* ── Sticky offcanvas header ── */

.offcanvas {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.offcanvas > .offcanvas-header {
    position: sticky;
    top: 0;
    z-index: 8;
    flex-shrink: 0;
}

.offcanvas > .offcanvas-body,
.offcanvas > .offcanvas-loading-overlay ~ .offcanvas-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

/* Activity log */
.activity-log-wrap {
    margin-top: 0.5rem;
}

.activity-log-wrap .stacked-card-item {
    font-size: 1.3rem;
    line-height: 1.5;
}

.activity-log-wrap .stacked-card-item .form-group-note__subtle {
    font-size: 1.2rem;
}

.activity-log-value {
    font-weight: 500;
}

.activity-log-value--from {
    text-decoration: line-through;
    opacity: 0.65;
}

.activity-log-source {
    font-style: italic;
}

.activity-log-changes {
    list-style: disc;
    margin: 0.25rem 0 0 1.25rem;
    padding: 0;
    font-size: 1.3rem;
}

.activity-log-changes li {
    margin-bottom: 0.15rem;
}

.comments-wrap > [role="tablist"],
.comments-wrap > .d-flex > [role="tablist"] {
    margin-bottom: 0;
}

.comments-wrap > .d-flex {
    margin-bottom: 1.5rem;
}

/* Activity log truncation notice */
.activity-log-truncated-notice {
    text-align: center;
    color: #888;
    font-size: 1.2rem;
    padding: 1rem 0 0;
    margin: 0;
}

/* Activity log pagination (ticket form) */
.activity-log-pagination {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    padding: 1rem 0 0;
}

/* Allow the additional-issue form to wrap onto its own full-width row */
.ticket-comment-actions-row {
    flex-wrap: wrap;
}

/* Additional-issue inline form on a comment action row */
.additional-issue-form {
    flex-basis: 100%;
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #f6f9fc;
    border: 1px solid #d9e2ec;
    border-radius: 6px;
}

.additional-issue-form__label {
    margin: 0 0 0.5rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: #334e68;
}

.additional-issue-form__loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 1.3rem;
    color: #52606d;
}

.additional-issue-form__actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* Ticket export PDF dropdown */
.ticket-export-dropdown {
    position: relative;
}

.ticket-export-dropdown > button.btn {
    font-size: 1.4rem;
    line-height: inherit;
    padding: 0;
    border: none;
    background: none;
    color: var(--text-grey);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    box-shadow: none;
}

.ticket-export-dropdown > button.btn:hover {
    color: var(--text-grey);
    background: none;
    box-shadow: none;
    opacity: 0.7;
}

.ticket-export-menu {
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 1000;
    min-width: 280px;
    margin: 4px 0 0;
    padding: 6px 0;
    list-style: none;
    background: #fff;
    border: 1px solid #d9e2ec;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.ticket-export-menu__item {
    display: block;
    width: 100%;
    padding: 8px 16px;
    border: none;
    background: none;
    text-align: left;
    font-size: 1.3rem;
    color: #24323f;
    cursor: pointer;
    white-space: nowrap;
}

.ticket-export-menu__item:hover {
    background: #eef4f7;
}

/* External change surfacing: banner, per-field markers, new-comment flash. */

.external-change-banner {
    background: rgba(var(--amber-status-rgb), 0.14);
    border: 1px solid rgba(var(--amber-status-rgb), 0.55);
    border-left: 4px solid var(--amber-status);
    color: var(--amber-status);
    border-radius: 4px;
    padding: 0.6rem 0.9rem;
    font-size: 1.3rem;
}

.external-change-banner strong {
    color: var(--amber-status);
}

.external-change-banner__field {
    margin-right: 0.35rem;
}

.external-change-banner__preview {
    color: var(--amber-status);
}


.external-change-field {
    position: relative;
    box-shadow: inset 3px 0 0 0 var(--amber-status);
    transition: box-shadow 150ms ease-out;
}

.external-change-marker {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: 0.4rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: rgba(var(--amber-status-rgb), 0.16);
    border: 1px solid rgba(var(--amber-status-rgb), 0.55);
    color: var(--amber-status);
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.3;
    vertical-align: middle;
}

.external-change-marker--conflict {
    background: rgba(var(--red-status-rgb), 0.12);
    border-color: rgba(var(--red-status-rgb), 0.45);
    color: var(--red-status);
}

.external-change-marker__accept,
.external-change-marker__dismiss {
    color: inherit;
    text-decoration: none;
    font-weight: 500;
}

.external-change-marker__accept:hover,
.external-change-marker__dismiss:hover {
    text-decoration: underline;
}

.new-comment-flash {
    animation: new-comment-flash-fade 10s ease-out forwards;
    box-shadow: inset 3px 0 0 0 var(--amber-status);
    background: rgba(var(--amber-status-rgb), 0.18);
    border-radius: 4px;
}

@keyframes new-comment-flash-fade {
    0% {
        background: rgba(var(--amber-status-rgb), 0.35);
    }
    70% {
        background: rgba(var(--amber-status-rgb), 0.18);
    }
    100% {
        background: transparent;
        box-shadow: none;
    }
}

.badge-new-comment {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.1rem 0.45rem;
    background: var(--amber-status);
    color: #ffffff;
    border-radius: 999px;
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.3;
}

.ticket-feedback-option label {
    padding: 1.5rem 1.25rem;
}

.ticket-feedback-option label strong {
    font-size: 1.35rem;
    margin-bottom: 0;
}

.ticket-secret-card textarea {
    width: 100%;
    min-height: 140px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.95rem;
}

.ticket-secret-payload {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 1rem 0;
    padding: 0.9rem 1rem;
    background: #f6f6f6;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.95rem;
    white-space: pre-wrap;
    word-break: break-all;
}

.ticket-secret-reveal-btn {
    display: inline-block;
    padding: 0.15rem 0.75rem;
    margin: 0 0.15rem;
    background: #111827;
    color: #ffffff;
    border: none;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9em;
    cursor: pointer;
}

.ticket-secret-reveal-btn:hover {
    background: #374151;
}

.ticket-comment-flash {
    animation: ticket-comment-flash-fade 3s ease-out forwards;
}

@keyframes ticket-comment-flash-fade {
    0% {
        background-color: rgba(var(--amber-status-rgb), 0.35);
        box-shadow: 0 0 0 3px rgba(var(--amber-status-rgb), 0.55);
    }
    100% {
        background-color: transparent;
        box-shadow: 0 0 0 3px rgba(var(--amber-status-rgb), 0);
    }
}

/* Cyber Essentials summary stats row */
.ce-summary-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.ce-summary-tile {
    padding: 14px 16px;
    border: 1px solid #d6dee8;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f6fafc 100%);
    box-shadow: 0 8px 20px rgba(7, 53, 79, 0.05);
}

.ce-summary-tile__label {
    margin: 0 0 4px;
    color: #5f7085;
    font-size: 1.15rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ce-summary-tile__value {
    margin: 0;
    color: var(--primary-color);
    font-size: 2.6rem;
    font-weight: 500;
    line-height: 1.1;
}

.ce-summary-tile__meta {
    margin: 4px 0 0;
    color: #5f7085;
    font-size: 1.2rem;
}

.ce-summary-tile--ok .ce-summary-tile__value      { color: var(--green-status); }
.ce-summary-tile--alert .ce-summary-tile__value   { color: var(--red-status); }
.ce-summary-tile--warning .ce-summary-tile__value { color: var(--amber-status); }
.ce-summary-tile--info .ce-summary-tile__value    { color: #04afda; }

/* Cyber Essentials device × component matrix */
.ce-matrix-table th.ce-matrix-cell {
    padding: 8px 6px;
    font-size: 1.2rem;
    text-align: center;
    vertical-align: bottom;
    white-space: normal;
}

.ce-matrix-table td.ce-matrix-cell {
    padding: 6px 0;
    text-align: center;
}

/* Three-state matrix cell: tick / cross / clock. Renders as a glyph
   rather than a coloured square so it reads as "ran / failed / waiting"
   at a glance without the viewer needing to learn a colour key. */
.ce-matrix-dot {
    display: inline-block;
    width: 16px;
    height: 16px;
    line-height: 16px;
    font-size: 14px;
    text-align: center;
    vertical-align: middle;
    background: transparent;
}

.ce-matrix-dot--ok {
    color: var(--green-status);
    font-weight: 900;
}
.ce-matrix-dot--ok::before {
    content: '\2713';   /* ✓ check mark */
    display: block;
}

.ce-matrix-dot--alert {
    color: var(--red-status);
    font-weight: 900;
}
.ce-matrix-dot--alert::before {
    content: '\2715';   /* ✕ light multiplication sign */
    display: block;
}

.ce-matrix-dot--waiting {
    color: #7a8a9a;
    font-size: 14px;
    font-weight: 900;
}
.ce-matrix-dot--waiting::before {
    content: '\29D6'; /* ⧖ white hourglass — script still pending */
    display: block;
}

.ce-matrix-dot--expired {
    color: #7a3b4a;
    font-size: 14px;
    font-weight: 900;
}
.ce-matrix-dot--expired::before {
    content: '\29D7'; /* ⧗ black hourglass — dispatch window passed without running */
    display: block;
}

/* Backwards-compat aliases — earlier classes that other code paths or
   tests may still reference. All collapse to the "waiting" hourglass so the
   matrix never falls back to a blank cell after the simplification. */
.ce-matrix-dot--running,
.ce-matrix-dot--queued,
.ce-matrix-dot--pending,
.ce-matrix-dot--blocked,
.ce-matrix-dot--warning {
    color: #7a8a9a;
    font-size: 14px;
    font-weight: 900;
}
.ce-matrix-dot--running::before,
.ce-matrix-dot--queued::before,
.ce-matrix-dot--pending::before,
.ce-matrix-dot--blocked::before,
.ce-matrix-dot--warning::before {
    content: '\29D6'; /* ⧖ white hourglass */
    display: block;
}

/* Section panel used to wrap action groups */
.ce-action-panel {
    padding: 18px 20px;
    margin: 16px 0;
    border: 1px solid #d6dee8;
    border-radius: 12px;
    background: #ffffff;
}

.ce-action-panel h2 {
    margin: 0 0 6px;
    color: var(--primary-color);
    font-size: 1.8rem;
    font-weight: 500;
}

.ce-action-panel p { margin: 0 0 12px; color: #5f7085; }

.ce-inline-breadcrumb {
    margin: 0 0 4px;
    color: #5f7085;
    font-size: 1.25rem;
}

.ce-inline-breadcrumb a { color: #5f7085; text-decoration: none; }
.ce-inline-breadcrumb a:hover { text-decoration: underline; }

/* Cyber Essentials findings drilldown (offcanvas) */
.ce-drilldown { padding-top: 4px; }

.ce-drill-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
}

.ce-drill-row {
    border: 1px solid #d6dee8;
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
}

.ce-drill-row__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: #f7fafc;
    color: inherit;
    font-size: 1.4rem;
    text-align: left;
    cursor: pointer;
}

.ce-drill-row__header:hover { background: #edf2f7; }

.ce-drill-row__bar {
    display: flex;
    align-items: stretch;
    background: #f7fafc;
    border-bottom: 1px solid transparent;
}

.ce-drill-row__bar .ce-drill-row__header {
    flex: 1;
    background: transparent;
}

.ce-drill-row__actions {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-left: 1px solid #e1e7ee;
}

.ce-drill-row__actions .btn {
    font-size: 1.15rem;
    padding: 4px 10px;
    white-space: nowrap;
}

/* Top toolbar: help text on the left, "Re-run all" + "…" button cluster
   on the right. The CE drilldown lives inside a narrow offcanvas; without
   a `flex-wrap: wrap` the help text collapses into a tall single-column
   tower and the trigger gets squeezed. */
.ce-drill-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
}

.ce-drill-toolbar .help-text {
    flex: 1 1 240px;
    min-width: 0;
}

.ce-drill-actions,
.ce-drill-row-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Floating-popover "More actions" cluster — mirrors the ticket-list
   suspended-more-actions pattern. The popover content is positioned by
   floating-popovers.js (off-screen at -9999px until .is-open flips it in)
   so the menu can escape the narrow offcanvas without being clipped. */
.ce-more-actions {
    position: relative;
    display: inline-flex;
    z-index: 5;
}

.ce-more-actions.is-open {
    z-index: 300;
}

.ce-more-trigger {
    min-width: 36px;
    padding-left: 0.65rem;
    padding-right: 0.65rem;
    text-align: center;
    letter-spacing: 0.06em;
    line-height: 1;
}

.ce-more-menu {
    position: fixed;
    left: -9999px;
    top: -9999px;
    z-index: 301;
    min-width: 220px;
    padding: 8px;
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    background: var(--white-text);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
    display: none;
    flex-direction: column;
    gap: 6px;
}

.ce-more-actions.is-open .ce-more-menu {
    display: flex;
}

.ce-drill-row__chevron {
    color: #5f7085;
    font-size: 1.3rem;
    margin-left: 10px;
}

.ce-drill-panel__body {
    padding: 12px 14px 14px;
    border-top: 1px solid #edf1f5;
}

.ce-drill-panel__meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px 16px;
    margin: 0 0 12px;
}

.ce-drill-panel__meta div { margin: 0; }
.ce-drill-panel__meta dt {
    color: #5f7085;
    font-size: 1.1rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.ce-drill-panel__meta dd { margin: 2px 0 0; color: var(--primary-color); font-size: 1.35rem; }

.ce-drill-panel__heading {
    margin: 14px 0 6px;
    color: var(--primary-color);
    font-size: 1.4rem;
    font-weight: 500;
}

.ce-drill-raw,
.ce-drill-evidence {
    margin: 0;
    padding: 8px 10px;
    max-height: 320px;
    overflow: auto;
    background: #0f1d2b;
    color: #e6eef6;
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1.15rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.ce-drill-evidence {
    max-height: 160px;
    background: #f3f6fa;
    color: #1c3550;
}

.ce-drill-findings {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ce-drill-finding {
    padding: 10px 12px;
    border: 1px solid #e1e7ee;
    border-radius: 8px;
    background: #ffffff;
}

.ce-drill-finding__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.ce-drill-finding__check {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1.25rem;
    color: #1c3550;
    word-break: break-all;
}

.ce-drill-finding__status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.ce-drill-finding__status-meta {
    color: #5f7085;
    font-size: 1.15rem;
    font-style: italic;
}

.ce-drill-finding__row {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 8px 12px;
    align-items: start;
    padding-top: 6px;
    border-top: 1px solid #edf1f5;
    margin-top: 6px;
}

.ce-drill-finding__row:first-of-type {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.ce-drill-finding__label {
    color: #5f7085;
    font-size: 1.1rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding-top: 2px;
}

.ce-drill-finding__value {
    color: #1c3550;
    font-size: 1.3rem;
}

.ce-drill-errors {
    margin: 0;
    padding-left: 18px;
    color: #9f2d2d;
    font-size: 1.3rem;
}

/* Pending badge with spinner (findings tabs + drilldowns) */
.ce-pending-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 2px 10px 2px 6px;
    border-radius: 999px;
    background: rgba(4, 175, 218, 0.12);
    color: #046b88;
    font-size: 1.25rem;
    font-weight: 600;
}

.ce-pending-badge__spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(4, 175, 218, 0.35);
    border-top-color: #046b88;
    border-radius: 50%;
    animation: ce-pending-spin 0.9s linear infinite;
}

@keyframes ce-pending-spin {
    to { transform: rotate(360deg); }
}

.ce-drill-row__connectivity {
    margin-left: 8px;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: lowercase;
}

.ce-drill-row__connectivity--online {
    background: rgba(var(--green-status-rgb), 0.18);
    color: #2f5f1c;
}

.ce-drill-row__connectivity--offline {
    background: #edf1f5;
    color: #5f7085;
}

.ce-unreachable-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    background: #edf1f5;
    color: #5f7085;
    font-size: 1.25rem;
    font-weight: 600;
}

.ce-removed-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    background: #f1e3e7;
    color: #7a3b4a;
    font-size: 1.25rem;
    font-weight: 600;
    text-decoration: line-through;
}

.ce-matrix-dot--removed {
    background: #d8c5cc;
    opacity: 0.5;
}

.ce-device-row--removed td:first-child {
    text-decoration: line-through;
    color: #7a3b4a;
}

.ce-check-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 28px;
    padding: 10px 16px;
    margin: 12px 0 16px;
    border: 1px solid #d6dee8;
    border-radius: 10px;
    background: #f6fafc;
}

.ce-check-bar__item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 140px;
}

.ce-check-bar__label {
    color: #5f7085;
    font-size: 1.1rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ce-check-bar__value {
    color: var(--primary-color);
    font-size: 1.4rem;
}

.ce-check-bar__action {
    margin-left: auto;
}

.table-filter-row th {
    font-weight: normal;
}

[x-cloak] {
    display: none !important;
}

.ticket-bulk-actions-group {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-right: 24px;
    vertical-align: top;
}

.ticket-bulk-actions-group.is-empty {
    display: none;
}

.ticket-bulk-actions-group__count {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-grey);
    white-space: nowrap;
}

/* Cyber Essentials finding cards (agent-friendly view) */
.ce-finding-counts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0 12px;
}

.ce-finding-counts__item {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 4px 10px 4px 8px;
    border-radius: 999px;
    background: #edf1f5;
    color: #1c3550;
    font-size: 1.2rem;
    font-weight: 600;
}

.ce-finding-counts__item--alert {
    background: rgba(var(--red-status-rgb, 212, 78, 78), 0.14);
    color: #8a1f2a;
}

.ce-finding-counts__item--warning {
    background: rgba(var(--amber-status-rgb, 242, 172, 58), 0.18);
    color: #7a4600;
}

.ce-finding-counts__item--ok {
    background: rgba(var(--green-status-rgb, 92, 168, 87), 0.16);
    color: #265c23;
}

.ce-finding-counts__item--unknown {
    background: #e3e7ec;
    color: #4a5b73;
}

.ce-finding-counts__num {
    font-size: 1.5rem;
    font-weight: 900;
}

.ce-finding-list {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ce-finding-card {
    padding: 12px 14px;
    border: 1px solid #dde4ec;
    border-left: 4px solid #c0cad5;
    border-radius: 8px;
    background: #ffffff;
}

.ce-finding-card--fail {
    border-left-color: #d44e4e;
    background: #fff7f7;
}

.ce-finding-card--warning {
    border-left-color: #f2ac3a;
    background: #fffaf1;
}

.ce-finding-card--manual_review {
    border-left-color: #6a7b93;
    background: #f7f9fc;
}

.ce-finding-card--pass {
    border-left-color: #5ca857;
}

.ce-finding-card--not_applicable {
    border-left-color: #b5bec9;
    background: #fafbfd;
}

.ce-finding-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.ce-finding-card__title-block {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.ce-finding-card__title {
    color: #0f2235;
    font-size: 1.4rem;
    font-weight: 600;
}

.ce-finding-card__chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(4, 175, 218, 0.12);
    color: #046b88;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.ce-finding-card__status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.ce-finding-card__status-meta {
    color: #5f7085;
    font-size: 1.15rem;
    font-style: italic;
}

.ce-finding-card__description {
    margin: 0 0 10px;
    color: #34495f;
    font-size: 1.3rem;
    line-height: 1.5;
}

.ce-finding-facts {
    margin: 0 0 10px;
    padding: 10px 12px;
    border: 1px solid #e3e8ef;
    border-radius: 6px;
    background: #fbfcfe;
    display: grid;
    gap: 6px 16px;
}

.ce-finding-facts__row {
    display: grid;
    grid-template-columns: 190px 1fr;
    gap: 8px 16px;
    align-items: start;
    padding: 2px 0;
}

.ce-finding-facts__row dt {
    color: #5f7085;
    font-size: 1.15rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin: 0;
}

.ce-finding-facts__row dd {
    margin: 0;
    color: #1c3550;
    font-size: 1.3rem;
    word-break: break-word;
}

.ce-finding-facts__row--ok dd > span:first-child { color: #265c23; font-weight: 600; }
.ce-finding-facts__row--alert dd > span:first-child { color: #8a1f2a; font-weight: 600; }
.ce-finding-facts__row--warning dd > span:first-child { color: #7a4600; font-weight: 600; }
.ce-finding-facts__row--neutral dd > span:first-child { color: #1c3550; }

.ce-finding-facts__items {
    margin: 4px 0 0;
    padding-left: 16px;
    color: #1c3550;
    font-size: 1.25rem;
    line-height: 1.55;
}

.ce-finding-facts__items li + li { margin-top: 2px; }

.ce-finding-card__note {
    margin: 0 0 10px;
    padding: 8px 10px;
    border-left: 3px solid #c0cad5;
    background: #f4f7fb;
    color: #34495f;
    font-size: 1.2rem;
    line-height: 1.5;
}

.ce-finding-card__remediation {
    margin: 0 0 8px;
    padding: 8px 10px;
    border: 1px dashed #c7a24a;
    border-radius: 6px;
    background: #fff8e5;
}

.ce-finding-card__remediation--done {
    border-style: solid;
    border-color: #5ca857;
    background: #eef8ed;
}

.ce-finding-card__remediation-label {
    color: #7a4600;
    font-size: 1.1rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.ce-finding-card__remediation--done .ce-finding-card__remediation-label {
    color: #265c23;
}

.ce-finding-card__remediation-value {
    display: block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1.25rem;
    color: #1c3550;
    word-break: break-word;
    white-space: pre-wrap;
    background: transparent;
    padding: 0;
}

.ce-finding-card__raw {
    margin: 6px 0 6px;
}

.ce-finding-card__raw > summary {
    cursor: pointer;
    color: #5f7085;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 2px 0;
}

.ce-finding-card__raw[open] > summary { margin-bottom: 4px; }

.ce-finding-card__meta {
    margin-top: 4px;
    color: #7a8698;
    font-size: 1.1rem;
}

.ce-finding-card__meta code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1.1rem;
    color: #5f7085;
    background: transparent;
    padding: 0;
}

.ce-passed-details {
    margin: 8px 0 12px;
    border: 1px solid #dde4ec;
    border-radius: 8px;
    background: #fbfcfe;
}

.ce-passed-details[open] { padding-bottom: 8px; }

.ce-passed-details > summary {
    cursor: pointer;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #1c3550;
    font-size: 1.3rem;
    font-weight: 600;
    list-style: none;
}

.ce-passed-details > summary::-webkit-details-marker { display: none; }

.ce-passed-details__chevron {
    color: #5f7085;
    font-size: 1.2rem;
    transition: transform 0.15s ease;
}

.ce-passed-details[open] .ce-passed-details__chevron {
    transform: rotate(90deg);
}

.ce-passed-details > .ce-finding-list {
    margin: 0 12px 0;
}

.ce-raw-details {
    margin-top: 12px;
}

.ce-raw-details > summary {
    cursor: pointer;
    color: #5f7085;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ce-raw-details[open] > summary { margin-bottom: 6px; }

/* Cyber Essentials environmental-failure statuses (access_denied / timeout /
   error). These are "couldn't run" signals from the audit scripts — distinct
   from pass/fail compliance verdicts. See scripts/datto_rmm/PREFLIGHT_SPEC.md.
   Reuses the existing brand-status palette (amber / info / grey) rather than
   introducing new hues — back-to-basics colour discipline. */

/* Inline status badges on finding cards */
.ce-env-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px 2px 8px;
    border-radius: 999px;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
}

.ce-env-badge__icon {
    display: inline-flex;
    align-items: center;
    font-size: 1.3rem;
    line-height: 1;
}

/* access_denied — amber family (warning, engineer-actionable permissions gap) */
.ce-env-badge--access_denied {
    background: var(--amber-status-tint);
    color: var(--amber-status);
    border: 1px solid var(--amber-status);
}

/* timeout — info family (cyan, investigate daemon / probe health) */
.ce-env-badge--timeout {
    background: var(--info-status-tint);
    color: var(--info-status);
    border: 1px solid var(--info-status);
}

/* error — grey family (no signal, script-side exception worth engineer review) */
.ce-env-badge--error {
    background: color-mix(in srgb, var(--grey-status) 40%, white);
    color: var(--primary-color);
    border: 1px solid var(--grey-status);
}

/* Counts strip variants — match ce-finding-counts__item--ok/alert/warning */
.ce-finding-counts__item--denied {
    background: var(--amber-status-tint);
    color: var(--amber-status);
}

.ce-finding-counts__item--timeout {
    background: var(--info-status-tint);
    color: var(--info-status);
}

.ce-finding-counts__item--error {
    background: color-mix(in srgb, var(--grey-status) 40%, white);
    color: var(--primary-color);
}

/* Finding-card border-left variants — match ce-finding-card--fail/warning */
.ce-finding-card--access_denied {
    border-left-color: var(--amber-status);
    background: var(--amber-status-tint);
}

.ce-finding-card--timeout {
    border-left-color: var(--info-status);
    background: var(--info-status-tint);
}

.ce-finding-card--error {
    border-left-color: var(--grey-status);
    background: color-mix(in srgb, var(--grey-status) 30%, white);
}

/* "Could not assess" details block — uses the amber tint (most env failures
   are permissions-denied, which dominate the section's visual signal). */
.ce-env-details {
    border-color: var(--amber-status);
    background: var(--amber-status-tint);
}

/* Drilldown row status marker — matches existing status-marker-ok/alert
   convention. Driven by the $rowStatus = 'denied' branch in the two
   drilldown blade views. */
.status-marker-denied {
    color: var(--amber-status);
}

.status-marker-denied:before {
    background-color: var(--amber-status);
}

/* Summary tiles — surfaced only when env-status counts are non-zero. */
.ce-summary-tile--denied {
    background: var(--amber-status-tint);
    border-color: var(--amber-status);
}

.ce-summary-tile--denied .ce-summary-tile__value {
    color: var(--amber-status);
}

.ce-summary-tile--timeout {
    background: var(--info-status-tint);
    border-color: var(--info-status);
}

.ce-summary-tile--timeout .ce-summary-tile__value {
    color: var(--info-status);
}

.ce-summary-tile--error {
    background: color-mix(in srgb, var(--grey-status) 40%, white);
    border-color: var(--grey-status);
}

.ce-summary-tile--error .ce-summary-tile__value {
    color: var(--primary-color);
}

/* Software catalogue queue */
.sc-queue-table td {
    vertical-align: middle;
}

.sc-queue-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.sc-queue-actions .form-control-sm {
    font-size: 1.2rem;
    padding: 4px 8px;
}

.sc-status {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 1.15rem;
    font-weight: 600;
    text-transform: capitalize;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.sc-status--ambiguous_review_needed { background: #fff4d6; color: #7a4600; }
.sc-status--no_upstream_data        { background: #edf1f5; color: #5f7085; }
.sc-status--unmapped                { background: #e3e7ec; color: #4a5b73; }
.sc-status--auto_mapped             { background: rgba(var(--green-status-rgb, 92, 168, 87), 0.16); color: #265c23; }
.sc-status--manually_mapped         { background: rgba(4, 175, 218, 0.14); color: #046b88; }

.sc-device-count {
    display: inline-block;
    min-width: 36px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #edf1f5;
    color: #1c3550;
    font-weight: 600;
    text-align: center;
}

.sc-version-row > td {
    background: #f7fafc;
    border-top: 1px solid #d6dee8;
}

.sc-version-editor {
    padding: 8px 4px;
}

.sc-version-table {
    margin-top: 6px;
    background: #ffffff;
}

.sc-version-table th, .sc-version-table td {
    padding: 6px 10px;
}

/* =========================================================================
   QBR — Quarterly Business Review
   ========================================================================= */

.qbr-viewer {
    display: flex; flex-direction: column;
    gap: 1.5rem; max-width: 1100px;
    /* Explicit pixel size so child rem/em values are anchored to a known
       reading size. The previous 1rem fallback was being squashed by a
       smaller body base elsewhere on the page. */
    font-size: 15px;
    line-height: 1.55;
    color: #1f2937;
}
.qbr-viewer h2 { margin: 0 0 0.5rem; font-size: 22px; line-height: 1.3; }
.qbr-viewer h3 { margin: 0; font-size: 16px; font-weight: 600; }
.qbr-viewer h4 { margin: 1rem 0 0.5rem; font-size: 15px; font-weight: 600; }
.qbr-viewer p { font-size: 15px; }
.qbr-viewer li { font-size: 15px; }
.qbr-viewer table { font-size: 15px; }

/* --- Headline block --- */
.qbr-headline {
    /* No card chrome — the Export button, headline narrative and gauges
     * sit flat on the page; each content section below is its own .card. */
    margin-bottom: 1.5rem;
}
.qbr-headline .qbr-meta { color: #627d98; font-size: 13px; margin: 0 0 0.5rem; }
.qbr-headline__text { font-size: 16px; line-height: 1.6; margin: 0.5rem 0 1rem; }
/* Container only sets vertical rhythm — layout (display, gap, wrap)
 * comes from .d-flex .wrap .gap-10 utilities in the blade. */
.qbr-counters { margin-top: 0.75rem; }
.qbr-counter {
    display: inline-flex; align-items: center; gap: 0.45rem;
    padding: 0.35rem 0.9rem 0.35rem 0.7rem; border-radius: 999px; font-size: 13px; color: #334155;
    background: #fff; border: 1px solid #d9e2ec;
}
/* Status dot rendered via ::before keeps the chip composable — the
 * label text and the number are the same flow content, the colour
 * comes from the modifier class. */
.qbr-counter::before {
    content: ""; display: inline-block; width: 10px; height: 10px;
    border-radius: 2px; background: #cbd5e0;
}
.qbr-counter--red::before { background: var(--red-status, #e50046); }
.qbr-counter--amber::before { background: var(--amber-status, #D8A927); }
.qbr-counter--blue::before { background: var(--info-status, #00a1d4); }
.qbr-counter--green::before { background: var(--green-status, #79c143); }
.qbr-counter__num { font-weight: 600; color: #102a43; }

/* --- Sections --- */
.qbr-section {
    /* Chrome (white bg, radius, shadow) comes from the shared .card
     * utility applied in the blade; this only owns the inner padding. */
    padding: 1.25rem 1.5rem;
}
.qbr-section--coming_soon { background: #fafbfc; }
.qbr-section__lead { color: #334155; line-height: 1.5; margin: 0 0 0.75rem; }

/* Group headers split the QBR's 13 sections into three themes so
 * the reading flow has chapters: "At a glance", "Security posture"
 * (matched by the top gauge row), then "Continuity, software &
 * strategy". */
.qbr-group-header {
    margin: 1.5rem 0 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--primary-color, #07354f);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary-color, #07354f);
}
.qbr-group-header:first-of-type { margin-top: 0.5rem; }

/* --- Risk register --- */
.qbr-risk-register ol {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: qbr-risk;
}
.qbr-risk-register li {
    counter-increment: qbr-risk;
    position: relative;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    border-left: 4px solid transparent;
    background: #f5f7fa;
}
.qbr-risk-register li::before {
    content: counter(qbr-risk);
    position: absolute; left: 0.75rem; top: 0.75rem;
    font-weight: 600; color: #627d98; font-size: 0.9rem;
}
.qbr-finding span { display: block; }
.qbr-finding__title { font-weight: 600; margin-bottom: 0.25rem; font-size: 15px; }
.qbr-finding__why { color: #486581; font-size: 14px; margin-bottom: 0.25rem; }
.qbr-finding__recommendation { font-size: 14px; margin-top: 0.4rem; }

/* Severity colours now come from the site-wide status utilities
 * (.critical-bg-tint .critical-border / .warning-bg-tint .warning-border
 * / .info-bg-tint / .ok-bg-tint .ok-border) emitted in the blade. */

.qbr-section__findings {
    list-style: none; padding: 0; margin: 1rem 0 0;
}
.qbr-section__findings li {
    padding: 0.6rem 0.85rem;
    margin-bottom: 0.4rem;
    border-radius: 4px;
    border-left: 4px solid transparent;
    background: #f5f7fa;
}
.qbr-section__findings strong { display: block; margin-bottom: 0.2rem; font-size: 15px; }
.qbr-section__findings em { display: block; font-style: normal; color: #486581; font-size: 14px; margin-bottom: 0.25rem; }
.qbr-section__findings span { display: block; font-size: 14px; }

/* --- Estate at a glance: category icon row --- */
.qbr-estate-grid table { width: 100%; table-layout: fixed; }
.qbr-estate-grid td { padding: 0.5rem; text-align: center; vertical-align: middle; }
/* Force the bootstrap-icons PNGs to their natural 32×32 — they are inheriting
   a generic `img { width: 100% }` from somewhere in the layout otherwise. */
.qbr-estate-grid img {
    display: inline-block;
    width: 32px !important;
    height: 32px !important;
    max-width: 32px !important;
    object-fit: contain;
}
.qbr-estate-missing {
    /* No hardcoded background/border colour here — the band's tint
     * utilities (.critical-bg-tint / .warning-bg-tint + matching
     * *-border) drive the colour so the 14+ band reads red and the
     * 7-14 band reads amber. */
    margin: 0.75rem 0 0.5rem; padding: 0.65rem 0.95rem;
    border-left: 3px solid; border-radius: 4px; font-size: 15px;
}

/* --- CE pillar evidence: gauges, counts, offenders --- */
.qbr-pillar-evidence { display: flex; flex-direction: column; gap: 1rem; margin: 1rem 0 0; }

.qbr-gauges { width: 100%; }
.qbr-gauges .system-audit-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.qbr-gauges td { text-align: center; vertical-align: top; padding: 0.5rem; }
.qbr-gauges h2 { font-size: 26px; margin: 0 0 0.4rem; color: #102a43; font-weight: 600; }
.qbr-gauges h3 { font-size: 14px; color: #486581; font-weight: 500; margin: 0.4rem 0 0; }
/* Hard cap on dial size — without this they inherit no width and blow up */
.qbr-gauges .percentage-dial,
.qbr-pillar-evidence .percentage-dial {
    width: 100% !important;
    max-width: 140px !important;
    height: auto !important;
    display: inline-block;
    margin: 0 auto;
}

/* One-sample trend placeholder: a faded line-chart shape full width with
 * the caption floated over the top — same faded-preview pattern as the
 * M365/Workspace-gated sections, so a pending trend reads as intentional
 * rather than an empty gap. */
.qbr-trend-placeholder {
    position: relative;
    width: 100%;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.qbr-trend-placeholder__line {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.4;
    filter: grayscale(0.5);
    pointer-events: none;
}
.qbr-trend-placeholder__caption {
    position: relative;
    z-index: 1;
    text-align: center;
    font-size: 12px;
    font-style: italic;
    color: #486581;
    padding: 0.3rem 0.8rem;
    background: linear-gradient(180deg, rgba(245,247,250,0.55) 0%, rgba(245,247,250,0.9) 100%);
    border-radius: 4px;
}
.qbr-trend-placeholder--sparkline { height: 40px; }

/* Count chips */
.qbr-pillar-counts { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.75rem 0; }
.qbr-count {
    display: inline-block;
    padding: 0.4rem 0.85rem; border-radius: 4px;
    font-size: 14px; font-weight: 500;
}
/* Count chip colours come from the site-wide tint utilities
 * (.ok-bg-tint / .warning-bg-tint / .critical-bg-tint / .neutral-bg-tint)
 * emitted directly in the blade. .qbr-count above only sets the pill
 * shape (padding, radius, font). */

/* Top offender table */
.qbr-pillar-offenders h4 { margin: 0.5rem 0; }
.qbr-offender-table {
    width: 100%; border-collapse: collapse;
    font-size: 14px;
}
.qbr-offender-table th,
.qbr-offender-table td {
    padding: 0.6rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: top;
}
.qbr-offender-table th {
    background: #f5f7fa;
    font-weight: 600;
    color: #334155;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.qbr-offender-table tbody tr:last-child td { border-bottom: none; }
.qbr-pillar-offenders__more {
    font-size: 13px; color: #627d98;
    margin: 0.5rem 0 0; font-style: italic;
}

/* --- Service & support evidence --- */
.qbr-service-evidence { display: flex; flex-direction: column; gap: 1rem; margin: 1rem 0 0; }

.qbr-stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}
.qbr-stat {
    padding: 1rem 1.25rem;
    background: #f5f7fa; border-radius: 4px;
    text-align: left;
}
/* When .qbr-stat is rendered as a <button> (drill-through), strip
 * the default button chrome so it looks like the static tile but
 * still hovers/focuses like an interactive element. */
button.qbr-stat {
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease;
    font: inherit;
    color: inherit;
    width: 100%;
}
button.qbr-stat:hover,
button.qbr-stat:focus {
    background: #e6ebed;
    border-color: #cbd5e0;
    outline: none;
}
.qbr-stat__value {
    display: block;
    font-size: 28px; font-weight: 600; color: #102a43;
    line-height: 1.1;
}
.qbr-stat__label {
    display: block; margin-top: 0.25rem;
    color: #486581; font-size: 14px;
}

.qbr-service-breakdowns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}
.qbr-service-breakdown ul { list-style: none; padding: 0; margin: 0; }
.qbr-service-breakdown li {
    display: flex; justify-content: space-between;
    padding: 0.45rem 0; border-bottom: 1px solid #edf2f7;
    font-size: 14px;
}
.qbr-service-breakdown li:last-child { border-bottom: none; }
.qbr-breakdown__label { color: #334155; }
.qbr-breakdown__value { font-weight: 600; color: #102a43; }
/* Each row is a button so the partner can open the matching ticket
 * list. Strip button chrome to keep the row visual but interactive. */
button.qbr-breakdown__row {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 0.25rem 0.4rem;
    border: 0;
    background: transparent;
    cursor: pointer;
    font: inherit;
    border-radius: 3px;
    transition: background 0.1s ease;
}
button.qbr-breakdown__row:hover,
button.qbr-breakdown__row:focus { background: #eef2f6; outline: none; }

/* Estate icon-row count cells: same dim-button pattern. */
.qbr-estate-grid__count {
    background: transparent;
    border: 0;
    padding: 0.25rem 0.4rem;
    cursor: pointer;
    font: inherit;
    color: inherit;
    border-radius: 3px;
    transition: background 0.1s ease;
}
.qbr-estate-grid__count:hover,
.qbr-estate-grid__count:focus { background: #eef2f6; outline: none; }

/* Performance dimension count chips when they're buttons (drill into
 * the device-list modal for that band). Inherits the .qbr-count pill
 * shape; adds pointer + tighter focus ring. */
button.qbr-count--button {
    border: 0;
    cursor: pointer;
    font: inherit;
    transition: filter 0.1s ease;
}
button.qbr-count--button:hover,
button.qbr-count--button:focus { filter: brightness(0.95); outline: none; }

.qbr-service-feedback blockquote {
    margin: 0 0 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    border-left: 3px solid transparent;
    font-size: 14px;
}
.qbr-service-feedback blockquote p { margin: 0; }
.qbr-service-feedback blockquote footer {
    margin-top: 0.3rem; font-size: 12px; color: #627d98;
}
/* Feedback chip colours come from .ok-bg-tint .ok-border /
 * .critical-bg-tint .critical-border in the blade. */
.qbr-feedback--clickable { cursor: pointer; transition: filter 0.1s ease; }
.qbr-feedback--clickable:hover,
.qbr-feedback--clickable:focus { filter: brightness(0.97); outline: none; }
.qbr-feedback--clickable code { background: rgba(0, 0, 0, 0.06); padding: 0 4px; border-radius: 3px; }

/* --- Coming-soon cards --- */
.qbr-coming-soon {
    padding: 0.85rem 1rem;
    background: #f5f7fa;
    border: 1px dashed #b8c4cf;
    border-radius: 4px;
    margin: 0.75rem 0;
}
.qbr-coming-soon--partial {
    border-style: dashed;
    border-color: #cbd5e0;
    background: #fafbfc;
}
.qbr-coming-soon__label {
    margin: 0 0 0.35rem;
    font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em;
    color: #627d98; font-weight: 600;
}
.qbr-coming-soon__note { margin: 0 0 0.4rem; font-size: 15px; line-height: 1.5; }
.qbr-coming-soon__integration { margin: 0; font-size: 13px; color: #627d98; }

/* Data freshness annotation reused on System Audit too */
.data-freshness { color: #627d98; font-size: 13px; font-style: italic; margin-bottom: 0.75rem; }

/* --- Lazy-load placeholder ----------------------------------------------- */
.qbr-viewer--loading .qbr-loading {
    text-align: center;
    padding: 2.5rem 1.5rem;
    background: #fff;
    border: 1px solid #d9e2ec;
    border-radius: 6px;
}
.qbr-loading__spinner {
    display: inline-block;
    width: 36px; height: 36px;
    border: 3px solid #d9e2ec;
    border-top-color: #486581;
    border-radius: 50%;
    animation: qbr-spin 0.85s linear infinite;
    margin-bottom: 0.75rem;
}
@keyframes qbr-spin { to { transform: rotate(360deg); } }
.qbr-loading__title { margin: 0 0 0.4rem; font-size: 18px; }
.qbr-loading__note { margin: 0 auto 1.5rem; font-size: 14px; color: #627d98; max-width: 520px; }
.qbr-loading__skeleton { display: flex; flex-direction: column; gap: 0.75rem; max-width: 720px; margin: 0 auto; }
.qbr-skeleton-section {
    height: 60px;
    border-radius: 4px;
}
.qbr-skeleton-section--headline { height: 90px; }

/* Updated-column author indicators (added beyond agent/requester/waiting in custom.css) */
.ticket-updated-indicator--ai {
    color: var(--green-status);
}

.ticket-updated-indicator--partner {
    color: var(--amber-status);
}

.demo-mode-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #5a3a00;
    background: repeating-linear-gradient(
        135deg,
        #ffe7a3,
        #ffe7a3 12px,
        #ffd97a 12px,
        #ffd97a 24px
    );
    border-bottom: 1px solid #d49a1f;
    text-align: center;
    justify-content: center;
}

.demo-mode-banner__dot {
    display: inline-block;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: #c8430a;
    box-shadow: 0 0 0 3px rgba(200, 67, 10, 0.18);
}

.demo-mode-toggle {
    display: block;
    width: 100%;
}

.demo-blur {
    filter: blur(4px);
    pointer-events: none;
}

.home-team-card {
    grid-template-rows: 3rem auto 1fr;
}

.home-team-card__header {
    min-height: 3rem;
}

.home-team-card__meta {
    align-self: end;
}

.home-team-card--add {
    align-content: stretch;
    opacity: 0.5;
    transition: opacity 0.15s ease;
}

.home-team-card--unmapped {
    opacity: 0.5;
    transition: opacity 0.15s ease;
}

.home-team-card--add:hover,
.home-team-card--add:focus,
.home-team-card--add:focus-within,
.home-team-card--unmapped:hover,
.home-team-card--unmapped:focus,
.home-team-card--unmapped:focus-within {
    opacity: 1;
}

.ticket-comment-automation-badge {
    display: inline-block;
    padding: 0.05rem 0.4rem;
    margin-left: 0.25rem;
    border-radius: 0.25rem;
    background: linear-gradient(90deg, #e0d4ff, #c7d8ff);
    color: #3b2c7a;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    vertical-align: 0.05em;
    border: 1px solid #b9a7ee;
    cursor: help;
}

.settings-nav .dropdown-inner .system-health {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
}

.settings-nav .btn-logout {
    margin: 0;
}

/* =================================================================
   Cyber Essentials Assessment Dashboard
   Tabs / section grid / accordion / gap-row
   ================================================================= */

/* Version pill in the dashboard header */
.ce-version-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    margin-left: 8px;
    border-radius: 999px;
    background: #eef2f6;
    color: #5f7085;
    font-size: 1.05rem;
    font-weight: 500;
}

/* Tabs strip */
.ce-tabs {
    list-style: none;
    margin: 16px 0 0;
    padding: 0;
    display: flex;
    gap: 4px;
    border-bottom: 1px solid #d6dee8;
}

.ce-tabs li { margin: 0; }

.ce-tabs__tab {
    display: inline-block;
    padding: 10px 18px;
    color: #5f7085;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-weight: 500;
    transition: color 0.15s, border-color 0.15s;
}

.ce-tabs__tab:hover { color: var(--primary-color); }

.ce-tabs__tab--active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Cultrix-internal tabs (Automation Backlog) — subtle visual cue that this
   isn't a customer-facing tab. */
.ce-tabs__tab--internal { font-style: italic; opacity: 0.85; }
.ce-tabs__tab--internal::before { content: '◆ '; font-style: normal; }

/* Annual-review banner: amber outline so it doesn't read as an alert,
   but is impossible to miss when the user lands on the Gap tab. */
.ce-annual-review-banner {
    border: 1px solid var(--amber-status, #f0d27a);
    background: #fff8e6;
}
.ce-annual-review-banner h2 { color: #8a5a00; margin-top: 0; }

/* Bulk-accept bar — green left edge so it reads as "ready to apply"
   without being shouty. Top-of-Gap-tab variant; per-section sibling sits
   on the accordion header and inherits the section's existing styling. */
.ce-bulk-accept-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 8px 0 12px;
    padding: 10px 14px;
    border-radius: 8px;
    background: #e9f5ec;
    border-left: 3px solid var(--green-status, #1e6b2a);
    font-size: 1.2rem;
}
.ce-section-accordion__bulk-accept { margin-left: 10px; }
.ce-roadmap-section__bulk { margin-left: 6px; }

.ce-tabs__panels { padding-top: 16px; }

.ce-backlog-source { margin-bottom: 14px; }
.ce-backlog-table td { vertical-align: top; }
.ce-backlog-table code {
    background: #f5f8fc;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 1.05rem;
}

/* Section status grid (Overview tab) */
.ce-section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin: 12px 0 24px;
}

.ce-section-card {
    text-align: left;
    padding: 16px;
    border: 1px solid #d6dee8;
    border-left: 4px solid #d6dee8;
    border-radius: 12px;
    background: #ffffff;
    cursor: pointer;
    transition: box-shadow 0.15s, transform 0.05s;
}

.ce-section-card:hover { box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.ce-section-card:active { transform: translateY(1px); }

.ce-section-card--ok { border-left-color: var(--green-status); }
.ce-section-card--warning { border-left-color: var(--amber-status); }
.ce-section-card--alert { border-left-color: var(--red-status); }
.ce-section-card--unknown { border-left-color: #b8c1cc; }

.ce-section-card__label {
    margin: 0 0 4px;
    font-size: 1.2rem;
    font-weight: 600;
    color: #1f2937;
}

.ce-section-card__value {
    margin: 0 0 4px;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--primary-color);
}

.ce-section-card__meta { margin: 0; font-size: 1.1rem; color: #5f7085; }

/* Highlight the active run row in the audit history table */
.ce-row--active { background: #f5f8fc; }

/* Filter strip on Gap Analysis tab */
.ce-filter-strip {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 16px 0 12px;
}

.ce-filter-strip__chip {
    padding: 6px 14px;
    border: 1px solid #d6dee8;
    border-radius: 999px;
    background: #ffffff;
    color: #5f7085;
    font-size: 1.15rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.ce-filter-strip__chip:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.ce-filter-strip__chip--active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
}

/* Section accordion (Gap Analysis tab) */
.ce-section-accordion {
    margin: 0 0 12px;
    border: 1px solid #d6dee8;
    border-radius: 12px;
    background: #ffffff;
    overflow: hidden;
}

.ce-section-accordion__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    cursor: pointer;
    list-style: none;
    border-left: 4px solid #d6dee8;
}

.ce-section-accordion__head::-webkit-details-marker { display: none; }

.ce-section-accordion__head--ok { border-left-color: var(--green-status); }
.ce-section-accordion__head--warning { border-left-color: var(--amber-status); }
.ce-section-accordion__head--alert { border-left-color: var(--red-status); }
.ce-section-accordion__head--unknown { border-left-color: #b8c1cc; }

.ce-section-accordion__head-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ce-section-accordion__title {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
    color: #1f2937;
}

.ce-section-accordion__head-right {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.15rem;
    color: #5f7085;
}

.ce-section-accordion__gaps { color: var(--red-status); font-weight: 500; }

.ce-section-accordion__body {
    padding: 0 18px 14px;
    border-top: 1px solid #eef2f6;
}

/* Per-question row */
.ce-gap-row {
    padding: 14px 0;
    border-bottom: 1px solid #eef2f6;
}

.ce-gap-row:last-child { border-bottom: none; }

.ce-gap-row__head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 6px;
}

.ce-gap-row__number {
    display: inline-block;
    min-width: 56px;
    padding: 2px 8px;
    background: #eef2f6;
    color: #5f7085;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 1.1rem;
    font-weight: 500;
    text-align: center;
}

.ce-gap-row__text {
    margin: 0;
    flex: 1;
    color: #1f2937;
    font-weight: 500;
}

.ce-gap-row__help {
    margin: 0 0 6px 66px;
    color: #5f7085;
    font-size: 1.1rem;
    font-style: italic;
}

.ce-gap-row__answer-block {
    margin: 0 0 8px 66px;
}

.ce-gap-row__answer {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 4px;
}

.ce-gap-row__answer-text {
    margin: 0;
    flex: 1;
    white-space: pre-wrap;
    color: #1f2937;
}

.ce-gap-row__copy-icon {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 2px 6px;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    color: #5f7085;
    transition: background 0.1s, border-color 0.1s;
}

.ce-gap-row__copy-icon:hover {
    background: #eef2f6;
    border-color: #d6dee8;
}

.ce-gap-row__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 1.1rem;
    color: #5f7085;
}

.ce-gap-row__source { color: #5f7085; }
.ce-gap-row__automation-hint { color: #04afda; font-weight: 500; }
.ce-gap-row__review-hint { color: var(--amber-status); font-weight: 500; }
.ce-gap-row__evidence { color: var(--primary-color); }

.ce-gap-row__actions {
    margin: 8px 0 0 66px;
    display: flex;
    gap: 6px;
}

.ce-gap-row__editor {
    margin: 0 0 0 66px;
    padding: 12px;
    background: #f5f8fc;
    border-radius: 8px;
}

.ce-gap-row__notes-label {
    display: block;
    margin-top: 10px;
    font-size: 1.15rem;
    color: #5f7085;
}
.ce-gap-row__notes-label > span:first-child { display: block; margin-bottom: 4px; }

.ce-gap-row__notes {
    margin: 6px 0 0 66px;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 1.15rem;
    color: #5f7085;
    font-style: italic;
}
.ce-gap-row__notes > span:first-child { font-style: normal; }

.ce-gap-row__hardening {
    margin: 8px 0 0 66px;
    font-size: 1.1rem;
}
.ce-gap-row__hardening-summary {
    cursor: pointer;
    color: #5f7085;
    font-weight: 500;
}
.ce-gap-row__hardening-summary:hover { color: var(--primary-color); }
.ce-gap-row__hardening-table {
    width: 100%;
    margin-top: 8px;
    border-collapse: collapse;
}
.ce-gap-row__hardening-table th,
.ce-gap-row__hardening-table td {
    text-align: left;
    padding: 6px 10px;
    border-top: 1px solid #e6ebf1;
    vertical-align: top;
}
.ce-gap-row__hardening-table th {
    color: #5f7085;
    font-weight: 600;
    border-top: none;
}
.ce-gap-row__hardening-title { display: block; }
.ce-gap-row__hardening-why {
    display: block;
    margin-top: 2px;
    color: #8593a3;
}
.ce-gap-row__hardening-table code {
    font-size: 1rem;
    color: var(--primary-color);
    white-space: nowrap;
}

/* ---------- Export tab ---------- */
.ce-export-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 8px;
    margin: 8px 0 16px;
}
.ce-export-banner--draft {
    background: #fff8e6;
    border: 1px solid #f0d27a;
    justify-content: space-between;
}
.ce-export-banner--locked {
    background: #e9f5ec;
    border: 1px solid #a4d3b0;
}
.ce-export-banner strong { display: block; margin-bottom: 4px; }

.ce-export-toolbar {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 12px;
}

.ce-export-section { margin-bottom: 14px; }

.ce-export-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    border-bottom: 1px solid #eef1f5;
}
.ce-export-row:last-child { border-bottom: 0; }

.ce-export-row__head {
    display: flex;
    align-items: baseline;
    gap: 10px;
}
.ce-export-row__number {
    flex: 0 0 auto;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.2rem;
}
.ce-export-row__text {
    margin: 0;
    color: #2d3640;
    font-size: 1.25rem;
}

.ce-export-row__answer {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-left: 56px;
}
.ce-export-row__pasteable {
    flex: 1;
    margin: 0;
    padding: 8px 10px;
    background: #f5f8fc;
    border-radius: 6px;
    font-family: inherit;
    font-size: 1.2rem;
    color: #2d3640;
    white-space: pre-wrap;
}

.ce-export-row__edit-btn {
    flex: 0 0 auto;
}

.ce-export-row__editor {
    margin-left: 56px;
    padding: 12px;
    background: #f5f8fc;
    border-radius: 6px;
}

/* ---------- Overview tab ---------- */
.ce-hero {
    margin: 12px 0;
    padding: 24px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #0c4d6e 100%);
    color: #fff;
}
.ce-hero h2 { color: #fff; margin: 0 0 8px; }
.ce-hero p { color: rgba(255, 255, 255, 0.85); margin: 0 0 12px; max-width: 640px; }
.ce-hero label { color: #fff; }

.ce-overview-bar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 8px 0 12px;
    padding: 12px 14px;
    background: #f5f8fc;
    border-radius: 8px;
}
.ce-overview-bar__picker {
    display: flex;
    flex-direction: column;
    flex: 1 1 320px;
    min-width: 240px;
}
.ce-overview-bar__picker > span {
    font-size: 1.1rem;
    color: #5f7085;
    margin-bottom: 4px;
}
.ce-overview-bar__actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.ce-overview-scope {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
}
.ce-overview-scope__chip {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 1.15rem;
    background: #eef4f7;
    color: var(--primary-color);
}
.ce-overview-scope__chip--ok { background: #dff5e0; color: #1e6b2a; }
.ce-overview-scope__chip--warning { background: #fff3d6; color: #8a5a00; }
.ce-overview-scope__chip--alert { background: #fde0e0; color: #9b1c1c; }

.ce-overview-quicklinks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

/* ---------- Roadmap tab ---------- */
.ce-roadmap-summary {
    margin: 8px 0 12px;
    padding: 10px 14px;
    background: #f5f8fc;
    border-radius: 8px;
    font-size: 1.25rem;
    color: #2d3640;
}

.ce-roadmap-section { margin-bottom: 12px; }
.ce-roadmap-section-select { max-width: 220px; }

.ce-roadmap-item {
    padding: 10px 12px;
    margin: 8px 0;
    border-radius: 8px;
    background: #fff;
    border-left: 3px solid #b8c1cc;
}
.ce-roadmap-item--ok { border-left-color: var(--green-status); background: #f6fbf6; }
.ce-roadmap-item--warning { border-left-color: var(--amber-status); background: #fffbf2; }
.ce-roadmap-item--alert { border-left-color: var(--red-status); background: #fdf6f6; }
.ce-roadmap-item--unknown { border-left-color: #b8c1cc; }

.ce-roadmap-item__head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}
.ce-roadmap-item__question {
    font-weight: 900;
    color: var(--primary-color);
    font-size: 1.2rem;
}
.ce-roadmap-item__summary {
    margin: 0;
    flex: 1 1 60%;
    color: #2d3640;
    font-size: 1.3rem;
}

.ce-rag-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    background: #eef1f5;
    color: #4a5867;
}
.ce-rag-badge--ok { background: #dff5e0; color: #1e6b2a; }
.ce-rag-badge--warning { background: #fff3d6; color: #8a5a00; }
.ce-rag-badge--alert { background: #fde0e0; color: #9b1c1c; }

.ce-roadmap-item__meta {
    margin: 4px 0 8px;
    font-size: 1.1rem;
    color: #5f7085;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.ce-roadmap-item__check-key { font-family: monospace; }

.ce-roadmap-item__controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.ce-roadmap-item__field span {
    display: block;
    font-size: 1.1rem;
    color: #5f7085;
    margin-bottom: 2px;
}
.ce-roadmap-item__field--wide { grid-column: 1 / -1; }

/* RAG-tinted left edge for the gap row to mirror the section accordion */
.ce-gap-row--ok { border-left: 3px solid var(--green-status); padding-left: 11px; margin-left: -14px; }
.ce-gap-row--warning { border-left: 3px solid var(--amber-status); padding-left: 11px; margin-left: -14px; }
.ce-gap-row--alert { border-left: 3px solid var(--red-status); padding-left: 11px; margin-left: -14px; }
.ce-gap-row--unknown { border-left: 3px solid #b8c1cc; padding-left: 11px; margin-left: -14px; }

/* Visually hidden helper for screen-readers */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

.btn-outline-priority-urgent {
    border: 1px solid var(--primary-color);
    color: var(--red-status);
    background-color: var(--white-bg);
    font-weight: 600;
}

.btn-outline-priority-urgent:hover {
    background-color: rgba(var(--red-status-rgb), 0.08);
    color: var(--red-status);
}

.btn-check:checked + .btn-outline-priority-urgent {
    background-color: var(--red-status);
    color: #fff;
}

.btn-outline-priority-high {
    border: 1px solid var(--primary-color);
    color: var(--amber-status);
    background-color: var(--white-bg);
    font-weight: 600;
}

.btn-outline-priority-high:hover {
    background-color: rgba(var(--amber-status-rgb), 0.08);
    color: var(--amber-status);
}

.btn-check:checked + .btn-outline-priority-high {
    background-color: var(--amber-status);
    color: #fff;
}

.ticket-settings-css-editor .CodeMirror {
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    height: auto;
    min-height: 8rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 1rem;
    line-height: 1.5;
}

.ticket-settings-css-editor .CodeMirror-scroll {
    min-height: 8rem;
}

.ticket-filter-field-spinner {
    top: 50%;
    right: 22px;
    width: 14px;
    height: 14px;
    margin-top: -7px;
    border: 2px solid var(--light-grey);
    border-top-color: var(--text-grey);
    border-radius: 50%;
    animation: lw-loading-spin .8s linear infinite;
    pointer-events: none;
    z-index: 2;
}

/* ===== Organisational chart (assets/users → Organisational chart tab) ===== */

.organisation-chart-wrap {
    width: 100%;
    overflow: visible;
    padding: 2rem 1rem;
}

/* Kill the legacy default.css rule that pins overflow-y: scroll on every
   .organisation-chart:first-of-type (which is every nested chart too). */
.organisation-chart-wrap .organisation-chart {
    overflow: visible;
}

.organisation-chart,
.organisation-chart ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.organisation-chart li {
    margin: 0;
    padding: 0;
    font-size: 1.3rem;
    flex: none;
}

.organisation-chart li small {
    display: block;
    margin-top: 2px;
    font-size: 1.2rem;
    color: var(--text-grey, #64748b);
}

.organisation-chart li .card {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 200px;
    max-width: 240px;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin: 0;
    text-align: left;
    position: relative;
    z-index: 1;
}

.organisation-chart li .card > img {
    flex: none;
    width: 40px;
    height: 40px;
    margin: 0;
    border-radius: 50%;
    object-fit: cover;
}

.organisation-chart li .card > span {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.organisation-chart li .card a,
.organisation-chart li .card .tel-link {
    margin-right: 4px;
}

/* Connector line colour (single source of truth) */
.organisation-chart-wrap {
    --org-line: #cbd5e1;
    --org-line-size: 2px;
    --org-line-gap: 1.75rem;
}

/* ----- Outer row: roots ----- */
.organisation-chart-wrap > .organisation-chart {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    gap: 3rem;
    flex-wrap: wrap;
    overflow: visible;
}

.organisation-chart-wrap > .organisation-chart > li {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ----- Level 2: direct reports of a root → horizontal row with connectors ----- */
.organisation-chart-wrap > .organisation-chart > li > .organisation-chart {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: nowrap;
    position: relative;
    padding-top: var(--org-line-gap);
    margin-top: 0;
    max-width: none;
}

/* Vertical drop from parent card into the child row */
.organisation-chart-wrap > .organisation-chart > li > .organisation-chart::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: var(--org-line-size);
    height: var(--org-line-gap);
    background: var(--org-line);
    transform: translateX(-50%);
}

.organisation-chart-wrap > .organisation-chart > li > .organisation-chart > li {
    position: relative;
    padding: var(--org-line-gap) 1rem 0 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Horizontal sibling bar */
.organisation-chart-wrap > .organisation-chart > li > .organisation-chart > li::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: var(--org-line-size);
    background: var(--org-line);
}

.organisation-chart-wrap > .organisation-chart > li > .organisation-chart > li:first-child::before {
    left: 50%;
}

.organisation-chart-wrap > .organisation-chart > li > .organisation-chart > li:last-child::before {
    right: 50%;
}

.organisation-chart-wrap > .organisation-chart > li > .organisation-chart > li:only-child::before {
    display: none;
}

/* Vertical stub from sibling bar down to each card */
.organisation-chart-wrap > .organisation-chart > li > .organisation-chart > li::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: var(--org-line-size);
    height: var(--org-line-gap);
    background: var(--org-line);
    transform: translateX(-50%);
}

/* ----- Level 3+: vertical chain (one card per row, spine + stub) ----- */
.organisation-chart-wrap > .organisation-chart > li > .organisation-chart > li > .organisation-chart,
.organisation-chart-wrap .organisation-chart .organisation-chart .organisation-chart {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    align-self: center;
    flex-wrap: nowrap;
    position: relative;
    margin-top: 0;
    padding: var(--org-line-gap) 0 0 1.5rem;
    max-width: none;
}

/* Top L-connector — vertical drops from the parent card's centre */
.organisation-chart-wrap > .organisation-chart > li > .organisation-chart > li > .organisation-chart::before,
.organisation-chart-wrap .organisation-chart .organisation-chart .organisation-chart::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: var(--org-line-size);
    height: calc(var(--org-line-gap) - 2px);
    background: var(--org-line);
    transform: translateX(-1px);
}

/* Top L-connector — horizontal from the spine across to the parent centre */
.organisation-chart-wrap > .organisation-chart > li > .organisation-chart > li > .organisation-chart::after,
.organisation-chart-wrap .organisation-chart .organisation-chart .organisation-chart::after {
    content: '';
    position: absolute;
    top: calc(var(--org-line-gap) - 2px);
    left: 1.5rem;
    width: calc(50% - 1.5rem);
    height: var(--org-line-size);
    background: var(--org-line);
}

.organisation-chart-wrap > .organisation-chart > li > .organisation-chart > li > .organisation-chart > li,
.organisation-chart-wrap .organisation-chart .organisation-chart .organisation-chart > li {
    position: relative;
    padding: 0.5rem 0 0.5rem 1.5rem;
    display: block;
    align-self: stretch;
}

/* Per-li spine fragment (drawn behind the card so the chain reads as one line) */
.organisation-chart-wrap > .organisation-chart > li > .organisation-chart > li > .organisation-chart > li::after,
.organisation-chart-wrap .organisation-chart .organisation-chart .organisation-chart > li::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--org-line-size);
    background: var(--org-line);
    transform: translateX(-1px);
    z-index: 0;
}

/* Last child (and only child): spine stops at its midpoint so it doesn't overshoot */
.organisation-chart-wrap > .organisation-chart > li > .organisation-chart > li > .organisation-chart > li:last-child::after,
.organisation-chart-wrap .organisation-chart .organisation-chart .organisation-chart > li:last-child::after {
    bottom: calc(50% - 1px);
}

/* Horizontal stub from spine to each card */
.organisation-chart-wrap > .organisation-chart > li > .organisation-chart > li > .organisation-chart > li::before,
.organisation-chart-wrap .organisation-chart .organisation-chart .organisation-chart > li::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 1.5rem;
    height: var(--org-line-size);
    background: var(--org-line);
    transform: translateY(-50%);
    z-index: 0;
}

/* Cards inside a vertical chain — left-aligned, capped width */
.organisation-chart-wrap > .organisation-chart > li > .organisation-chart > li > .organisation-chart > li > .card,
.organisation-chart-wrap .organisation-chart .organisation-chart .organisation-chart > li > .card {
    display: inline-flex;
    width: auto;
    max-width: 240px;
    margin: 0;
}

/* ===== Unlinked users (users with no parent_id and no children) ===== */

.organisation-chart-unlinked {
    margin-top: 3rem;
    padding: 2rem 1rem 0 1rem;
    border-top: 1px solid var(--light-grey, #e2e8f0);
}

.organisation-chart-unlinked__title {
    margin: 0 0 0.25rem 0;
    font-size: 1.6rem;
    font-weight: 600;
}

.organisation-chart-unlinked__hint {
    margin: 0 0 1.25rem 0;
    font-size: 1.3rem;
    color: var(--text-grey, #64748b);
}

.organisation-chart-unlinked__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.organisation-chart-unlinked__list > li {
    margin: 0;
    padding: 0;
}

.organisation-chart-unlinked__list .card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin: 0;
    font-size: 1.3rem;
}

.organisation-chart-unlinked__list .card > img {
    flex: none;
    width: 40px;
    height: 40px;
    margin: 0;
    border-radius: 50%;
    object-fit: cover;
}

.organisation-chart-unlinked__list .card > span {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.organisation-chart-unlinked__list .card small {
    display: block;
    margin-top: 2px;
    font-size: 1.2rem;
    color: var(--text-grey, #64748b);
}

/* --- QBR — top-of-page audit summary ---
 * Two stacked rows: the overall score gauge sits on its own with a
 * short explanation paragraph, then the six-up control breakdown
 * row beneath it. Each breakdown tile links to that pillar's
 * drill-down page so partners can scan + click straight to the
 * offending devices.
 */
.qbr-audit-overall {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.25rem 1.5rem;
    margin: 1.25rem 0 1rem;
    background: #f5f7fa;
    border-radius: 6px;
}
.qbr-audit-overall__copy { flex: 1; min-width: 0; }
.qbr-audit-overall__title {
    margin: 0 0 0.5rem;
    font-size: 18px;
    font-weight: 600;
    color: #102a43;
}
.qbr-audit-overall__lead {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: #486581;
}
@media (max-width: 640px) {
    .qbr-audit-overall { flex-direction: column; align-items: flex-start; gap: 1rem; }
}

/* 5-column breakdown (one gauge per CE pillar). Auto-fit so the
 * layout still balances if a pillar is omitted (e.g. User access
 * gauge skipped when M365 isn't connected). No utility class exists
 * for 5-col, so this is a custom rule. */
.qbr-audit-breakdown {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0 0 1.25rem;
}
@media (max-width: 900px) {
    .qbr-audit-breakdown { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
    .qbr-audit-breakdown { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.qbr-audit-breakdown__tile--placeholder { opacity: 0.7; }
.qbr-audit-breakdown__placeholder {
    font-size: 36px;
    font-weight: 600;
    color: #94a3b8;
    line-height: 1;
}
.qbr-audit-breakdown__tile-sub {
    font-size: 11px;
    color: var(--primary-color, #07354f);
    font-weight: 500;
}
.qbr-audit-breakdown__tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 0.5rem;
    text-decoration: none;
    color: inherit;
    background: #f5f7fa;
    border-radius: 4px;
    transition: background 0.12s ease;
}
.qbr-audit-breakdown__tile:hover,
.qbr-audit-breakdown__tile:focus {
    background: #e6ebed;
    text-decoration: none;
}
.qbr-audit-breakdown__tile-label {
    font-size: 12px;
    font-weight: 500;
    color: #334155;
    text-align: center;
}


/* QBR drill-down modals need much more width than the Jetstream
 * default (.jetstream-modal > div:last-child {max-width: 500px}) to
 * fit the device / ticket / user tables. The :has() override targets
 * only modals whose content slot opts in via .qbr-modal-wide. */
.jetstream-modal:has(.qbr-modal-wide) > div:last-child {
    max-width: min(1100px, 95vw) !important;
}
/* Cap the body height so the panel fits the viewport and scrolls
 * internally. Without this a long table makes the whole panel taller
 * than the screen, and Alpine's focus-trap scrolls the outer overlay
 * down to the footer Close button — so the modal opened scrolled to the
 * bottom. A self-contained scroll area keeps it anchored at the top. */
.qbr-modal-wide { max-width: 100%; max-height: 60vh; overflow-y: auto; }
.qbr-modal-wide table { width: 100%; }

/* --- QBR pillar drill-down (full per-device matrix) --- */
.qbr-pillar-detail { padding: 1.5rem; }
.qbr-pillar-detail__header { margin-bottom: 1.25rem; }
.qbr-pillar-detail__back { margin: 0 0 0.5rem; font-size: 13px; }
.qbr-pillar-detail__sub { color: #486581; margin: 0.25rem 0 0; font-size: 14px; }
.qbr-pillar-detail__row--alert td:first-child { border-left: 3px solid var(--red-status, #e50046); }
.qbr-pillar-detail__row--warning td:first-child { border-left: 3px solid var(--amber-status, #D8A927); }
.qbr-pillar-detail__row--manual td:first-child { border-left: 3px solid #cbd5e0; }
.qbr-pillar-detail__row--good td:first-child { border-left: 3px solid var(--green-status, #79c143); }
.qbr-pillar-detail__cell--alert { color: var(--red-status, #e50046); font-weight: 500; }
.qbr-pillar-detail__cell--warning { color: var(--amber-status, #D8A927); font-weight: 500; }
.qbr-pillar-detail__cell--good { color: var(--green-status, #79c143); }
.qbr-pillar-detail__rec { margin: 0 0 0.25rem; font-size: 12px; color: #486581; }

/* --- QBR Performance & age section --- */
.qbr-performance-evidence {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 0.75rem 0 0;
}
.qbr-performance-evidence__counts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
/* Default grid + gap come from .d-grid .grid-row-3-col .grid-gap-1
 * utilities in the blade. Only the narrow-viewport collapse to one
 * column stays custom (no responsive utility exists). */
@media (max-width: 640px) {
    .qbr-performance-evidence__dimensions { grid-template-columns: 1fr; }
}
.qbr-performance-dimension {
    background: #f5f7fa;
    border-radius: 4px;
    padding: 0.75rem 1rem;
}
.qbr-performance-dimension__label {
    margin: 0 0 0.5rem;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}
.qbr-performance-dimension__counts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

/* --- QBR — sample preview (faded data + connect overlay) ---
 * Used in M365-gated sections to show partners the *shape* of what
 * they'd see if they connected, rather than a passive "Coming soon"
 * sentence. Underlying content is intentionally faded; an overlay
 * carries the CTA and a "Sample preview" chip flags that the numbers
 * are illustrative.
 */
.qbr-sample-preview {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    margin: 0;
    min-height: 220px;
}
.qbr-sample-preview__heading {
    /* Faded section title sits inside the dimmed layer so it dims with
     * everything else. Matches the regular section h2 sizing. */
    margin: 0 0 0.75rem;
    font-size: 22px;
    font-weight: 400;
}
.qbr-sample-preview__faded {
    /* Flatten every descendant to one neutral tone before applying the
     * blanket opacity. Otherwise hard colours (e.g. the bold dark-navy
     * stat numbers) still punch through at 40% opacity and look
     * inconsistent with the surrounding labels. */
    color: #94a3b8 !important;
    opacity: 0.45;
    filter: grayscale(0.5);
    pointer-events: none;
    user-select: none;
}
.qbr-sample-preview__faded *,
.qbr-sample-preview__faded *:hover {
    color: inherit !important;
}
.qbr-sample-preview__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(180deg, rgba(245,247,250,0.4) 0%, rgba(245,247,250,0.85) 50%, rgba(245,247,250,0.95) 100%);
}
.qbr-sample-preview__title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #102a43;
    max-width: 30rem;
}
.qbr-sample-preview__note {
    margin: 0;
    font-size: 13px;
    color: #486581;
    max-width: 34rem;
    line-height: 1.5;
}

/* --- QBR — top-of-page connect-integration banner ---
 * Shown when the team's Microsoft 365 tenant isn't connected. Replaces
 * the per-section "Connect Microsoft 365" buttons so there's one
 * obvious place to act, not five.
 */
.qbr-connect-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1rem 1.25rem;
    margin: 0 0 1.25rem;
    background: #f0f4f8;
    border-left: 4px solid var(--primary-color, #07354f);
    border-radius: 4px;
}
.qbr-connect-banner__body { flex: 1; min-width: 0; }
.qbr-connect-banner__title {
    margin: 0 0 0.25rem;
    font-size: 15px;
    font-weight: 600;
    color: #102a43;
}
.qbr-connect-banner__note {
    margin: 0;
    font-size: 13px;
    color: #486581;
}
@media (max-width: 640px) {
    .qbr-connect-banner { flex-direction: column; align-items: flex-start; }
}

/* --- QBR — User access control evidence ---
 * Four equal-width tiles in one row: MFA-coverage gauge tile + three
 * stat tiles. Tiles share padding, background, and inner spacing so the
 * gauge tile and the number tiles read as the same component family.
 */
.qbr-user-access-evidence {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin: 1rem 0 0;
}
.qbr-user-access-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}
@media (max-width: 900px) {
    .qbr-user-access-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
    .qbr-user-access-grid { grid-template-columns: 1fr; }
}
.qbr-user-access-tile {
    background: #f5f7fa;
    border-radius: 4px;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    min-height: 150px;
}
/* Dormant tile turns amber when there are dormant accounts, matching the
 * amber finding emitted for the same condition. Compound selector so it
 * wins over button.qbr-user-access-tile's transparent border + grey bg. */
button.qbr-user-access-tile.qbr-user-access-tile--warning {
    background: var(--amber-status-tint);
    border-color: var(--amber-status);
}
button.qbr-user-access-tile {
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease;
    font: inherit;
    color: inherit;
    width: 100%;
}
button.qbr-user-access-tile:hover,
button.qbr-user-access-tile:focus {
    background: #e6ebed;
    border-color: #cbd5e0;
    outline: none;
}
.qbr-user-access-tile__figure {
    /* Reserved height matches the gauge so number tiles and the gauge
     * tile line up across the row regardless of label length. */
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.qbr-user-access-tile__number {
    font-size: 42px;
    font-weight: 600;
    color: #102a43;
    line-height: 1;
}
.qbr-user-access-tile__label {
    font-size: 14px;
    color: #486581;
    font-weight: 500;
}
.qbr-user-access-tile__sub {
    font-size: 12px;
    color: #627d98;
}

/* --- QBR — Secure Score header ---
 * Sits above the trend chart inside the user-access section. The 2rem
 * gap from .qbr-user-access-evidence already separates this block from
 * the tile row above; here we just style the head + score.
 */
.qbr-secure-score {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.qbr-secure-score__head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
}
.qbr-secure-score__value {
    font-size: 20px;
    font-weight: 600;
    color: #102a43;
}
.qbr-secure-score__max {
    font-size: 14px;
    font-weight: 500;
    color: #627d98;
    margin-left: 0.25rem;
}

/* Completes the .placeholder-animation utility shipped in default.css, which
   references these keyframes but never defined them (so the wave was a no-op). */
@-webkit-keyframes placeholder-wave {
    100% { -webkit-mask-position: -200% 0; }
}
@keyframes placeholder-wave {
    100% { mask-position: -200% 0; }
}


