body {
    background: var(--app-body-bg);
    color: var(--app-body-color, inherit);
}

body .queue-detail-hero-card,
body .queue-sidebar-card,
body .case-page-timeline-card,
body .queue-detail-conversation-card,
body .case-live-actions-panel {
    border: 1px solid var(--app-card-border);
    border-radius: 18px;
    box-shadow: var(--app-card-shadow);
    background: var(--app-card-bg);
}

body .case-workspace-layout,
body .queue-detail-grid {
    align-items: start;
}

body .case-workspace-hero-card {
    position: relative;
    z-index: 4 !important;
    overflow: visible !important;
    border-top: 3px solid #2f6fed;
}

body .case-page-timeline-card,
body .queue-detail-conversation-card {
    position: relative;
    z-index: 1 !important;
}

body .case-workspace-hero-main {
    display: grid;
    gap: 1rem;
}

body .case-workspace-hero-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.85rem 1rem;
    flex-wrap: wrap;
}

body .queue-detail-hero-title-link {
    color: var(--app-strong-text);
    text-decoration: none;
}

body .queue-detail-hero-title-link:hover,
body .queue-detail-hero-title-link:focus-visible {
    color: #1d4ed8;
}

body .case-workspace-hero-title-row {
    row-gap: 0.55rem;
}

body .case-workspace-hero-actions {
    align-items: center;
}

body .case-paylinks-launch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    min-height: 2.25rem;
    padding-inline: 0.7rem;
    border-radius: 999px;
    border-color: #198754;
    background: #198754;
    color: #ffe082;
    box-shadow: 0 0.15rem 0.45rem rgba(25, 135, 84, 0.24);
    font-weight: 700;
}

body .case-paylinks-launch .bi {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffe082;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45), 0 0 0.45rem rgba(255, 224, 130, 0.2);
}

body .case-paylinks-launch:hover,
body .case-paylinks-launch:focus {
    border-color: #157347;
    background: #157347;
    color: #fff0b3;
}

body .case-paylinks-launch:focus-visible {
    box-shadow: 0 0 0 0.2rem rgba(244, 197, 66, 0.25);
}

body .case-paylinks-modal-dialog {
    width: min(96vw, 1200px);
    max-width: min(96vw, 1200px);
}

body .case-paylinks-modal-content {
    min-height: min(88vh, 860px);
}

body .case-paylinks-modal-body {
    padding: 0;
}

body .case-paylinks-iframe {
    display: block;
    width: 100%;
    min-height: min(80vh, 780px);
    border: 0;
    background: #fff;
}

body .case-tracking-modal-dialog {
    width: min(96vw, 1200px);
    max-width: min(96vw, 1200px);
}

body .case-tracking-modal-content {
    min-height: min(88vh, 860px);
}

body .case-tracking-modal-body {
    padding: 0;
}

body .case-tracking-iframe {
    display: block;
    width: 100%;
    min-height: min(80vh, 780px);
    border: 0;
    background: #fff;
}

body .case-ai-conversation-modal-dialog {
    width: min(96vw, 1280px);
    max-width: min(96vw, 1280px);
}

body .case-ai-conversation-modal-content {
    min-height: min(88vh, 900px);
}

body .case-ai-conversation-modal-body {
    padding: 0;
}

body .case-ai-conversation-iframe {
    display: block;
    width: 100%;
    min-height: min(82vh, 820px);
    border: 0;
    background: #fff;
}

body .case-header-contact-pill,
body .case-contact-phone-link.case-contact-phone-link-sm {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.25rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    border: 1px solid #d7e3fb;
    background: #f7faff;
    color: #18408b;
    font-size: 0.88rem;
    font-weight: 600;
}

body .case-contact-phone-link.case-contact-phone-link-sm {
    box-shadow: none;
}

body .badge-soft,
body .case-header-order-badge {
    background: #eef2ff;
    color: #4338ca;
    border: 1px solid #dbe4ff;
    border-radius: 999px;
}

body button.case-header-order-badge {
    appearance: none;
    -webkit-appearance: none;
    box-shadow: none;
    cursor: pointer;
}

body .case-header-order-popover {
    position: relative;
    display: inline-flex;
}

body .case-order-panel {
    position: absolute;
    top: calc(100% + 0.45rem);
    left: 0;
    z-index: 45;
    width: min(58rem, calc(100vw - 2rem));
    padding: 0.9rem;
    border: 1px solid #dbe4ff;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
}

body .case-order-panel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

body .case-order-panel-close {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    z-index: 1;
}

html[data-bs-theme="dark"] body .case-order-panel {
    border-color: #334155;
    background: #111c31;
    color: #d3deea;
    box-shadow: 0 18px 40px rgba(2, 6, 23, 0.5);
}

html[data-bs-theme="dark"] body .case-order-panel-close {
    filter: invert(1) grayscale(100%) brightness(1.8);
    opacity: 0.9;
}

body .case-order-panel-body {
    padding-right: 2rem;
}

body .case-order-panel-subtitle,
body .case-order-panel-hint,
body .case-order-panel-section-label {
    color: #64748b;
    font-size: 0.79rem;
}

body .case-order-panel-hint {
    margin-bottom: 0.7rem;
}

body .case-order-panel-subtitle {
    display: block;
    margin-top: 0.18rem;
}

body .case-order-panel-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
}

body .case-order-panel-row,
body .case-order-panel-item {
    width: 100%;
    padding: 0.7rem 0.8rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    text-align: left;
    color: #0f172a;
}

body .case-order-panel-row:hover,
body .case-order-panel-row:focus,
body .case-order-panel-item:hover,
body .case-order-panel-item:focus {
    border-color: #c7d2fe;
    background: #eef2ff;
}

body .case-order-panel-row-full {
    grid-column: 1 / -1;
}

body .case-order-panel-label {
    display: block;
    margin-bottom: 0.18rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
}

body .case-order-panel-value,
body .case-order-panel-item-title {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
}

body .case-order-panel-items {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.45rem;
}

body .case-order-panel-item-grid {
    display: grid;
    grid-template-columns: minmax(9rem, 11rem) minmax(0, 1fr);
    gap: 0.5rem;
}

body .case-order-panel-item-meta {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.8rem;
    color: #475569;
}

body .case-order-panel-section-label {
    margin-top: 0.9rem;
    margin-bottom: 0.45rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

body .case-order-panel-item.is-copied {
    border-color: #6366f1;
    background: #e0e7ff;
}

@media (max-width: 767.98px) {
    body .case-order-panel {
        width: min(32rem, calc(100vw - 1.5rem));
    }

    body .case-order-panel-grid {
        grid-template-columns: 1fr;
    }

    body .case-order-panel-item-grid {
        grid-template-columns: 1fr;
    }
}

body .case-workspace-hero-subline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
    margin-left: auto;
    color: #64748b;
    font-size: 0.86rem;
}

body .case-workspace-company {
    font-weight: 600;
    color: #334155;
}

body .case-workspace-address {
    min-width: 0;
}

body .case-workspace-hero-controls {
    flex: 1 1 28rem;
    padding-bottom: 0.1rem;
}

body .case-workspace-hero-controls .case-workflow-inline,
body .queue-detail-tagged-user-editor .case-workflow-inline,
body .queue-detail-issue-label-editor .case-workflow-inline {
    z-index: 1;
}

body .case-workspace-hero-controls .case-workflow-inline:has([aria-expanded="true"]),
body .queue-detail-tagged-user-editor .case-workflow-inline:has([aria-expanded="true"]),
body .queue-detail-issue-label-editor .case-workflow-inline:has([aria-expanded="true"]) {
    z-index: 25 !important;
}

body .case-workspace-summary-strip {
    display: grid;
    gap: 1px;
    border: 1px solid #e7d9b3;
    border-radius: 16px;
    overflow: hidden;
    background: #e7d9b3;
}

body .case-workspace-summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.04rem;
    padding: 0.3rem 0.8rem;
    min-height: 0;
    background: #faf6ea;
}

body .case-workspace-summary-item.response-target {
    background: #f6e9bf;
}

body .case-workspace-summary-item.response-target.tone-good {
    background: #e9f6de;
}

body .case-workspace-summary-item.response-target.tone-danger {
    background: #fde7e5;
}

body .case-workspace-summary-label {
    font-size: 0.61rem;
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

body .case-workspace-summary-value {
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.15;
    color: #0f172a;
}

body .case-workspace-summary-response-line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem;
}

body .case-workspace-summary-help {
    font-size: 0.72rem;
    line-height: 1.05;
    color: #6b7280;
}

body .case-timeline-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-bottom: 1rem;
}

body .case-timeline-toolbar-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.85rem 1rem;
    flex-wrap: wrap;
}

body .case-timeline-filter-bar,
body .case-order-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

body .case-timeline-toolbar-header .case-timeline-filter-bar {
    justify-content: flex-end;
    margin-left: auto;
}

body .case-timeline-toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-left: auto;
}

body .case-timeline-search-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid #d6dfec;
    border-radius: 999px;
    background: #f8fafc;
    color: #475569;
}

body .case-timeline-search-box {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    max-width: min(32rem, 100%);
}

body .case-timeline-search-box .form-control {
    width: 13rem;
}

body .timeline-search-current {
    outline: 2px solid #2563eb;
    outline-offset: 3px;
}

body .timeline-deep-link-target {
    outline: 3px solid #f59e0b;
    outline-offset: 4px;
    scroll-margin-block: 2rem;
}

html[data-bs-theme="dark"] body .case-timeline-search-toggle {
    border-color: #3b475f;
    background: #101a2d;
    color: #cbd5e1;
}

body .case-order-filter-bar {
    justify-content: flex-start;
}

body .case-timeline-filter-btn,
body .case-order-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2rem;
    padding: 0.42rem 0.82rem;
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid #d6dfec;
    border-radius: 999px;
    background-color: #f8fafc;
    background-image: none;
    color: #475569;
    font-size: 0.82rem;
    font-weight: 600;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

body .case-timeline-filter-btn:hover,
body .case-order-filter-btn:hover,
body .case-timeline-filter-btn:focus-visible,
body .case-order-filter-btn:focus-visible {
    border-color: #b9c9e3;
    background-color: #f1f5f9;
    background-image: none;
    color: #1f2937;
    box-shadow: none;
}

body .case-timeline-filter-btn.is-active,
body .case-order-filter-btn.is-active {
    background-color: #255dd0;
    background-image: linear-gradient(135deg, #2f6fed, #255dd0);
    border-color: #255dd0;
    color: #fff;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.18);
}

body .case-timeline-filter-count {
    min-width: 1.4rem;
    padding: 0.05rem 0.35rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.18);
    text-align: center;
    font-size: 0.72rem;
}

body .case-timeline-filter-btn.is-active .case-timeline-filter-count {
    background: rgba(255, 255, 255, 0.2);
}

html[data-bs-theme="dark"] body .case-timeline-filter-btn,
html[data-bs-theme="dark"] body .case-order-filter-btn {
    background-color: #172338 !important;
    background-image: none !important;
    border-color: #41536d !important;
    color: #d3deea !important;
    box-shadow: none !important;
}

html[data-bs-theme="dark"] body .case-timeline-filter-btn:hover,
html[data-bs-theme="dark"] body .case-order-filter-btn:hover,
html[data-bs-theme="dark"] body .case-timeline-filter-btn:focus-visible,
html[data-bs-theme="dark"] body .case-order-filter-btn:focus-visible {
    background-color: #1d3456;
    background-image: none;
    border-color: #60a5fa;
    color: #eff6ff;
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.16);
}

html[data-bs-theme="dark"] body .case-timeline-filter-btn.is-active,
html[data-bs-theme="dark"] body .case-order-filter-btn.is-active {
    background-color: #255dd0;
    background-image: linear-gradient(135deg, #2f6fed, #255dd0);
    border-color: #255dd0;
    color: #eff6ff;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.24);
}

html[data-bs-theme="dark"] body .case-timeline-filter-count {
    background: rgba(148, 163, 184, 0.22);
    color: inherit;
}

html[data-bs-theme="dark"] body .case-timeline-filter-btn.is-active .case-timeline-filter-count {
    background: rgba(255, 255, 255, 0.2);
}

html[data-bs-theme="dark"] body .timeline-item :is(.badge.text-bg-light.border, a.badge.text-bg-light.border) {
    background: #172338;
    border-color: #41536d;
    color: #dbeafe;
}

html[data-bs-theme="dark"] body .timeline-item .bg-body-tertiary {
    background: #172338 !important;
    border-color: #334155 !important;
    color: #d3deea;
}

body .case-page-timeline-scroll,
body .queue-detail-timeline {
    gap: 0.9rem !important;
}

body .timeline-item-row {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 0.9rem;
}

body .timeline-item-row.timeline-item-align-start {
    padding-right: 20%;
}

body .timeline-item-row.timeline-item-align-end {
    padding-left: 20%;
}

body .timeline-item {
    width: 100% !important;
    max-width: 100%;
    margin: 0 !important;
    border: 1px solid #e2e8f0;
    border-left-width: 1px;
    border-radius: 16px !important;
    background: #fff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.03);
    overflow-wrap: anywhere;
    word-break: break-word;
}

body .timeline-item-row.timeline-item-align-start,
body .timeline-item-row.timeline-item-align-end {
    justify-content: stretch;
}

body .timeline-item.direction-outbound,
body .timeline-item.direction-internal {
    background: #fcfdff;
}

html[data-bs-theme="dark"] body .timeline-item {
    background: #101a2d;
    border-color: #304661;
    color: #d3deea;
    box-shadow: 0 14px 30px rgba(2, 6, 23, 0.34);
}

html[data-bs-theme="dark"] body .timeline-item.direction-outbound {
    background: #111c31;
    border-color: #3b475f;
    border-left-color: #3b475f;
}

html[data-bs-theme="dark"] body .timeline-item.direction-internal,
html[data-bs-theme="dark"] body .timeline-item.private {
    border-color: #9d174d;
    border-left-color: #ec4899;
    background: linear-gradient(180deg, #2b1222 0%, #22101c 100%);
}

body .timeline-entry-kind {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 999px;
    background: #eff6ff;
    color: #2563eb;
}

body .timeline-order-event-row {
    padding-right: 20%;
}

body .timeline-order-event {
    border-color: #bbf7d0;
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
}

body .timeline-order-event-icon {
    background: #fef3c7;
    color: #15803d;
    box-shadow: inset 0 0 0 1px #facc15;
    flex: 0 0 auto;
    width: 2.6rem;
    height: 2.6rem;
    font-size: 1.35rem;
    margin-top: 0.12rem;
}

body .timeline-order-event-number {
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
    color: #166534;
}

body .timeline-order-event-number-button {
    cursor: pointer;
    font: inherit;
}

body .timeline-order-event-total {
    color: #166534;
    white-space: nowrap;
}

body .timeline-order-event-item {
    color: #475569;
}

html[data-bs-theme="dark"] body .timeline-order-event {
    border-color: #166534;
    background: linear-gradient(135deg, #10281e 0%, #101a2d 100%);
}

html[data-bs-theme="dark"] body .timeline-order-event-icon {
    background: #854d0e;
    color: #86efac;
    box-shadow: inset 0 0 0 1px #eab308;
}

html[data-bs-theme="dark"] body .timeline-order-event-number {
    background: #163b29;
    border-color: #166534;
    color: #bbf7d0;
}

html[data-bs-theme="dark"] body .timeline-order-event-total {
    color: #86efac;
}

html[data-bs-theme="dark"] body .timeline-order-event-item {
    color: #cbd5e1;
}

body .timeline-email-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
}

body .timeline-item .badge.text-bg-light.border {
    background: #f8fafc !important;
    border-color: #dbe4ef !important;
    color: #475569 !important;
}

body .timeline-image-preview-modal .timeline-image-preview-dialog {
    width: fit-content;
    max-width: calc(100vw - 1rem);
    margin: 0.5rem auto;
}

body .timeline-image-preview-modal .modal-content {
    width: fit-content;
    max-width: 100%;
    border-radius: 20px;
    overflow: hidden;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    border-color: var(--bs-border-color);
}

body .timeline-image-preview-modal .modal-header,
body .timeline-image-preview-modal .modal-footer {
    padding-left: 1rem;
    padding-right: 1rem;
}

body .timeline-image-preview-modal .modal-body {
    padding: 0.5rem;
}

body .timeline-image-preview-wrap {
    width: fit-content;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 0;
    background: var(--bs-tertiary-bg);
}

body .timeline-image-preview-image {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 10rem);
    width: auto;
    height: auto;
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

html[data-bs-theme="dark"] body .timeline-image-preview-modal .modal-content {
    background: #08111f;
    color: #d3deea;
    border-color: rgba(148, 163, 184, 0.28);
}

html[data-bs-theme="dark"] body .timeline-image-preview-wrap {
    background: #0d1728;
}

body .queue-sidebar-card {
    font-size: 0.88rem;
}

body .case-workspace-sidebar-card .queue-sidebar-heading,
body .queue-sidebar-card .queue-sidebar-heading {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #94a3b8;
}

body .queue-sidebar-contact-name {
    margin-top: 0.2rem;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

body .case-workspace-contact-meta {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin: 0.85rem 0 1rem;
}

body .queue-sidebar-phone {
    width: 100%;
    justify-content: flex-start;
}

body .case-workspace-email {
    padding: 0 0.1rem;
    font-size: 0.9rem;
    color: #334155;
    word-break: break-word;
}

body .case-workspace-address-block,
body .case-workspace-payment-panel {
    margin-top: 0.9rem;
    padding: 0.95rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
}

body .queue-sidebar-facts {
    display: grid;
    gap: 0.6rem;
    margin-top: 0.85rem;
}

body .queue-sidebar-fact {
    display: grid;
    gap: 0.15rem;
    align-items: flex-start;
}

body .queue-sidebar-fact-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
}

body .queue-sidebar-fact-value {
    color: #0f172a;
    word-break: break-word;
}

body .case-workspace-payment-list {
    display: grid;
    gap: 0.55rem;
}

body .case-workspace-payment-row {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
    padding: 0.75rem 0.85rem;
}

body .case-workspace-payment-main {
    display: grid;
    gap: 0.35rem;
}

body .case-workspace-payment-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.84rem;
    flex-wrap: wrap;
}

body .case-workspace-payment-order {
    color: #2563eb;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    text-decoration: none;
}

body .case-workspace-payment-order:hover,
body .case-workspace-payment-order:focus-visible {
    color: #1d4ed8;
}

body .case-workspace-payment-summary {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 600;
}

body .case-workspace-payment-method {
    color: #64748b;
    font-size: 0.78rem;
}

body .case-workspace-opt-out-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

body .queue-sidebar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

body .case-workspace-focus-card {
    display: grid;
    gap: 0.6rem;
    padding: 1rem;
    border: 1px solid #f5c97a;
    border-radius: 16px;
    background: linear-gradient(180deg, #fff8eb 0%, #fffdf8 100%);
}

body .case-workspace-focus-title {
    font-size: 0.96rem;
    font-weight: 700;
    color: #0f172a;
}

body .case-workspace-focus-copy {
    color: #64748b;
    font-size: 0.84rem;
    line-height: 1.5;
}

body .case-workspace-focus-meta {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 600;
}

body .case-workspace-controls-card {
    display: grid;
    gap: 0.85rem;
}

body .case-workspace-controls-sla {
    padding: 0.95rem 1rem;
    border: 1px solid #f5d694;
    border-radius: 14px;
    background: linear-gradient(180deg, #fff8eb 0%, #fffdf7 100%);
}

body .case-workspace-controls-sla-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #8a5a00;
}

body .case-workspace-label-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

body .case-workspace-label-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.75rem;
    padding: 0.18rem 0.6rem;
    border-radius: 999px;
    background: #f4f7fb;
    border: 1px solid #dbe4ef;
    color: #475569;
    font-size: 0.76rem;
    font-weight: 700;
}

body .case-workspace-note-form textarea,
body .case-workspace-note-item {
    border-radius: 14px;
}

body .case-workspace-customer-notes [data-customer-note-toggle] {
    white-space: nowrap;
}

body .case-workspace-note-editor {
    margin-bottom: 0.75rem;
}

body .case-workspace-note-form textarea {
    border-color: #d9e1ec;
    min-height: 88px;
}

body .case-workspace-note-form {
    margin-bottom: 0;
}

body .case-workspace-note-item {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    padding: 0.9rem 1rem;
}

body .case-workspace-note-item:nth-child(odd) {
    background: linear-gradient(180deg, #eefbf0 0%, #f8fafc 100%);
}

body .case-workspace-note-item:nth-child(even) {
    background: linear-gradient(180deg, #fff8e8 0%, #f8fafc 100%);
}

body .case-live-actions-panel,
body .queue-sidebar-card:not(.case-workspace-sidebar-card) {
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
    border-color: #e5ebf3;
}

body .queue-sidebar-card:not(.case-workspace-sidebar-card) .queue-sidebar-heading,
body .case-live-actions-panel .text-muted.small:first-child {
    color: #94a3b8 !important;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

body .case-workspace-note-list {
    display: grid;
    gap: 0.7rem;
}

body .case-route-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 74px;
    padding: 0.26rem 0.6rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}

body .case-route-pill.tone-default {
    background: #e2e8f0;
    color: #0f172a;
}

body .case-route-pill.tone-good {
    background: #dcfce7;
    color: #166534;
}

body .case-route-pill.tone-warning {
    background: #fef3c7;
    color: #92400e;
}

body .case-route-pill.tone-danger {
    background: #fee2e2;
    color: #b91c1c;
}

body .case-route-pill.tone-info {
    background: #ede9fe;
    color: #6d28d9;
}

body .case-route-pill.tone-muted {
    background: #e2e8f0;
    color: #475569;
}

body .agent-config-card {
    border-color: var(--app-card-border) !important;
    border-radius: 18px;
    background: var(--app-card-bg);
    box-shadow: var(--app-card-shadow);
}

body .agent-config-label {
    letter-spacing: 0.08em;
    font-size: 0.68rem;
    font-weight: 700;
}

body .agent-config-clamp {
    display: -webkit-box;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
    white-space: pre-line;
    line-height: 1.45;
    color: var(--app-body-color, inherit);
}

body .agent-config-empty {
    color: var(--bs-secondary-color) !important;
}

body .agent-config-field-help {
    color: var(--bs-secondary-color);
    font-size: 0.78rem;
}

body .agent-config-modal .modal-content {
    background: var(--app-card-bg);
    color: var(--app-body-color, inherit);
    border-color: var(--app-card-border);
    max-height: calc(100vh - 1.5rem);
}

body .agent-config-modal {
    z-index: 2010;
}

body .agent-config-modal .modal-header,
body .agent-config-modal .modal-footer {
    border-color: var(--app-card-border);
}

body .agent-config-modal .modal-dialog {
    max-width: min(1140px, calc(100vw - 1rem));
    margin: 0.75rem auto;
}

body .agent-config-modal .modal-body {
    overflow-y: auto;
}

body .agent-config-modal .agent-config-instructions-input {
    min-height: min(22rem, 42vh);
    white-space: pre-wrap;
}

body .new-case-flow-card .new-case-step + .new-case-step {
    border-top: 1px solid var(--app-card-border);
    padding-top: 1.5rem;
}

body .new-case-match {
    background: var(--app-card-bg);
    color: var(--app-body-color, inherit);
    border: 1px solid var(--app-card-border);
}

body .new-case-match .card-body {
    background: transparent;
}

body .case-response-template-menu {
    min-width: min(22rem, 82vw);
    max-height: min(24rem, calc(2.25rem * 10 + 3rem));
    overflow-y: auto;
    overflow-x: hidden;
}

body .case-response-template-menu .dropdown-item {
    white-space: normal;
}

body .case-response-template-menu-back {
    font-weight: 600;
}

@media (min-width: 992px) {
    body .case-response-template-menu.case-response-template-menu-submenu-open {
        display: grid;
        grid-template-columns: minmax(0, 14rem) minmax(0, 20rem);
        gap: 0.5rem;
        min-width: min(36rem, 88vw);
        max-width: min(40rem, 88vw);
        overflow: hidden;
    }

    body .case-response-template-menu.case-response-template-menu-submenu-open > [data-case-template-menu-panel] {
        min-height: 0;
        max-height: min(24rem, calc(2.25rem * 10 + 3rem));
        overflow-y: auto;
        overflow-x: hidden;
    }

    body .case-response-template-menu.case-response-template-menu-submenu-open > [data-case-template-menu-panel="root"] {
        padding-right: 0.5rem;
        border-right: 1px solid rgba(33, 37, 41, 0.1);
    }

    body .case-response-template-menu.case-response-template-menu-submenu-open .case-response-template-menu-back {
        display: none !important;
    }
}

body .supplier-enquiry-cc-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.55rem;
    border: 1px solid rgba(33, 37, 41, 0.15);
    border-radius: 999px;
    background: #fff;
    font-size: 0.875rem;
    line-height: 1.2;
}

body .supplier-enquiry-cc-chip-label {
    word-break: break-all;
}

body .supplier-enquiry-cc-chip-remove {
    border: 0;
    background: transparent;
    color: #6c757d;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
}

@media (min-width: 992px) {
    body .case-workspace-summary-strip {
        grid-template-columns: minmax(0, 0.95fr) minmax(0, 0.95fr) minmax(0, 0.95fr) minmax(0, 0.95fr) minmax(0, 1.8fr);
    }
}

@media (max-width: 1199.98px) {
    body .case-page-sidebar-column,
    body .queue-detail-sidebar {
        max-width: none;
    }
}

@media (max-width: 767.98px) {
    body .case-workspace-hero-meta-row {
        flex-direction: column;
        align-items: stretch;
    }

    body .case-workspace-hero-subline {
        justify-content: flex-start;
        margin-left: 0;
    }

    body .case-timeline-toolbar-header .case-timeline-filter-bar {
        justify-content: flex-start;
        margin-left: 0;
    }

    body .case-workspace-summary-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body .case-workspace-focus-meta,
    body .case-workspace-payment-row,
    body .case-workspace-opt-out-row {
        grid-auto-flow: row;
        flex-direction: column;
        align-items: flex-start;
    }

    body .timeline-item-row.timeline-item-align-start {
        padding-right: 10%;
    }

    body .timeline-item-row.timeline-item-align-end {
        padding-left: 10%;
    }
}
