/* 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: rgba(var(--info-status-rgb), 0.12);
    border: 1px solid rgba(var(--info-status-rgb), 0.45);
    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: #d4e3b6;
}

.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: #d4e3b6;
    border-color: color-mix(in srgb, #d4e3b6 75%, #98ad73 25%);
}

.checklist-editor--scoped .checklist-editor__group--internal {
    --checklist-group-bg: #f3e4b3;
    border-color: color-mix(in srgb, #f3e4b3 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: 700;
}

.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: 700;
    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(--amber-status);
}

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

.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: #07354f;
    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: #f3e4b3;
}

.form-group-note--warning {
    background-color: #e9d6e3;
}

.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) {
    background-color: #fff8dd;
    border-color: #e6c96b;
}

.form-group-note--warning:not(.form-group-note--card):not(.form-group-note--compact) {
    background-color: #f3e3ec;
    border-color: #dec0d0;
}

.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-note {
    background-color: #f3e4b3;
}

.form-field-warning {
    background-color: #e9d6e3;
}

.form-inline-warning {
    background-color: #e9d6e3;
    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: 700;
}

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;
    }
}

.system-health-placeholder__title,
.system-health-placeholder__state,
.system-health-placeholder__issue-title,
.system-health-placeholder__issue-detail,
.system-health-placeholder__stat,
.system-health-placeholder__link,
.team-switcher-placeholder__label,
.team-switcher-placeholder__control,
.team-switcher-placeholder__link,
.profile-button__health--placeholder::before {
    animation: ticket-workspace-wave 1.7s linear infinite;
    background: linear-gradient(110deg, #edf1f4 8%, #f8fafb 18%, #edf1f4 33%);
    background-size: 220% 100%;
}

.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);
}

body:has(.ticket-workspace-shell.ticket-workspace-shell--has-bar) .aiison-chat-shell {
    bottom: 1.5rem;
    left: 2rem;
    right: auto;
}

body:not(:has(.ticket-workspace-shell.ticket-workspace-shell--has-bar)) .aiison-chat-shell {
    bottom: 1.5rem;
    left: 2rem;
    right: auto;
}

body:has(.ticket-workspace-shell.ticket-workspace-shell--has-bar) .aiison-chat-panel,
body:not(:has(.ticket-workspace-shell.ticket-workspace-shell--has-bar)) .aiison-chat-panel {
    left: 0;
    right: auto;
}

.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);
}

@media (max-width: 991.98px) {
    body:has(.ticket-workspace-shell.ticket-workspace-shell--has-bar) .aiison-chat-shell {
        bottom: 0.8rem;
    }
}

.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;
}

.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;
    }
}
.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: 700;
    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: 700;
    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: 700;
    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: 700;
    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);
    }
}

/* ── 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: 700;
    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;
}

/* SLA report stats placeholder skeleton */
.sla-skeleton {
    animation: agent-activity-skeleton 1.4s ease-in-out infinite;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.05));
    background-size: 200% 100%;
    border-radius: 999px;
    display: inline-block;
}

.sla-skeleton--value {
    height: 22px;
    width: 50px;
    margin-top: 4px;
}

.sla-skeleton--meta {
    height: 12px;
    width: 90px;
    margin-top: 6px;
}

/* 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: 700;
    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;
}

.ce-matrix-dot {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    background: #e1e7ee;
    vertical-align: middle;
}

.ce-matrix-dot--ok { background: var(--green-status); }
.ce-matrix-dot--warning { background: var(--amber-status); }
.ce-matrix-dot--alert { background: var(--red-status); }

.ce-matrix-dot--pending {
    background: transparent;
    border: 2px solid #dfe5ec;
    border-top-color: #7a8a9a;
    border-radius: 50%;
    box-sizing: border-box;
    animation: ce-pending-spin 0.9s linear infinite;
}

/* 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;
}

.ce-drill-row__actions .btn-group {
    flex-shrink: 0;
}

.ce-drill-actions {
    flex-shrink: 0;
}

.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: 700;
    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: 700;
    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: 700;
    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: 700;
}

.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: 700;
    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: 700;
    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; }

/* 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 {
    padding: 1.25rem 1.5rem;
    background: #f5f7fa;
    border-radius: 6px;
    border-left: 4px solid #486581;
}
.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; }
.qbr-counters { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.qbr-counter {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.4rem 0.85rem; border-radius: 999px; font-size: 14px;
    background: #fff; border: 1px solid #d9e2ec;
}

/* --- Sections --- */
.qbr-section {
    padding: 1.25rem 1.5rem;
    background: #fff;
    border: 1px solid #d9e2ec;
    border-radius: 6px;
}
.qbr-section--coming_soon { background: #fafbfc; }
.qbr-section__lead { color: #334155; line-height: 1.5; margin: 0 0 0.75rem; }

/* --- 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 */
.qbr-finding--red    { border-left-color: #b91c1c; background: #fef2f2; }
.qbr-finding--amber  { border-left-color: #b85800; background: #fffaeb; }
.qbr-finding--blue   { border-left-color: #1d4ed8; background: #eff6ff; }
.qbr-finding--green  { border-left-color: #166534; background: #f0fdf4; }

.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 {
    margin: 0.75rem 0 0.5rem; padding: 0.65rem 0.95rem;
    background: #fffaeb; border-left: 3px solid #b85800;
    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;
}

/* 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;
}
.qbr-count--good    { background: #d1fae5; color: #065f46; }
.qbr-count--warning { background: #fef3c7; color: #8a4b00; }
.qbr-count--alert   { background: #fee2e2; color: #991b1b; }
.qbr-count--manual  { background: #e2e8f0; color: #475569; }

/* 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;
}
.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; }

.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;
}
.qbr-feedback--good { background: #f0fdf4; border-left-color: #166534; }
.qbr-feedback--bad  { background: #fef2f2; border-left-color: #b91c1c; }

/* --- 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;
    background: linear-gradient(90deg, #f5f7fa 0%, #edf2f7 50%, #f5f7fa 100%);
    background-size: 200% 100%;
    animation: qbr-shimmer 1.4s ease-in-out infinite;
    border-radius: 4px;
}
.qbr-skeleton-section--headline { height: 90px; }
@keyframes qbr-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 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%;
    padding: 0.4rem 0.75rem;
    margin: 0.4rem 0 0.6rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #5a3a00;
    background: #fff5d6;
    border: 1px solid #d49a1f;
    border-radius: 0.25rem;
    cursor: pointer;
    text-align: center;
}

.demo-mode-toggle:hover {
    background: #ffe7a3;
}

.demo-mode-toggle--on {
    color: #fff;
    background: #c8430a;
    border-color: #a4350a;
}

.demo-mode-toggle--on:hover {
    background: #a4350a;
}
