html,
body {
    background: #eef2f6;
    color: #1f2937;
    font-family: "Microsoft YaHei UI", "Segoe UI", Arial, sans-serif;
    margin: 0;
}

a {
    color: inherit;
}

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

.workspace-header h1 {
    color: #101828;
    font-size: 2rem;
    margin: 0 0 0.35rem;
}

.eyebrow {
    color: #1f6f78;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    margin: 0 0 0.3rem;
    text-transform: uppercase;
}

.muted,
.empty-state {
    color: #667085;
    margin: 0;
}

.status-strip {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    justify-content: flex-end;
}

.status-strip span,
.soft-badge,
.chip {
    background: rgba(31, 111, 120, 0.08);
    border: 1px solid rgba(31, 111, 120, 0.14);
    border-radius: 999px;
    color: #24545b;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.38rem 0.72rem;
}

.diagnosis-page-grid,
.dashboard-main-grid,
.support-grid,
.workspace-grid,
.stats-grid,
.dashboard-kpi-grid,
.dashboard-deep-grid,
.dashboard-bottom-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
}

.diagnosis-page-grid,
.dashboard-main-grid,
.support-grid {
    grid-template-columns: minmax(0, 1.3fr) minmax(360px, 1fr);
}

.workspace-grid--split,
.workspace-grid--workorder,
.workspace-grid--cases,
.workspace-grid--devices {
    grid-template-columns: minmax(0, 1.35fr) minmax(360px, 1fr);
}

.workspace-grid--admin {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stats-grid,
.dashboard-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-deep-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.95fr) minmax(0, 0.85fr);
}

.dashboard-bottom-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
}

.column-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.column-stack--narrow {
    max-width: 460px;
}

.column-stack--fixed {
    max-width: 440px;
}

.panel {
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    box-shadow: 0 16px 42px rgba(15, 23, 42, 0.06);
    padding: 1.15rem 1.15rem 1.1rem;
}

.panel h2 {
    color: #101828;
    font-size: 1.06rem;
    margin: 0 0 0.95rem;
}

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

.panel-heading-actions {
    align-items: center;
    display: flex;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

.centered-copy {
    margin: 0 auto;
    max-width: 560px;
    text-align: center;
}

.hero-panel {
    background:
        radial-gradient(circle at top right, rgba(122, 185, 199, 0.18), transparent 24%),
        linear-gradient(135deg, #172033 0%, #22314a 58%, #29405c 100%);
    border: 1px solid rgba(41, 64, 92, 0.4);
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
    color: #ffffff;
    overflow: hidden;
    padding: 1.4rem;
}

.hero-panel h1 {
    color: #ffffff;
    font-size: 2.1rem;
    margin: 0.2rem 0 0.55rem;
}

.hero-panel .muted,
.hero-panel p {
    color: #d0d7e3;
}

.hero-panel-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.9fr);
}

.hero-metric-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hero-metric-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 0.9rem 0.95rem;
}

.hero-metric-card strong {
    display: block;
    font-size: 1.45rem;
    margin-top: 0.15rem;
}

.hero-metric-card span {
    color: #d0d7e3;
    font-size: 0.8rem;
}

.hero-side-panel {
    background: rgba(7, 12, 24, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    padding: 1rem;
}

.hero-side-panel h2 {
    color: #ffffff;
    margin-bottom: 0.3rem;
}

.hero-side-panel ul {
    color: #d0d7e3;
    margin: 0;
    padding-left: 1.1rem;
}

.hero-side-panel li {
    margin-bottom: 0.45rem;
}

.stat-panel {
    min-height: 136px;
    position: relative;
}

.stat-panel::after {
    background: linear-gradient(180deg, rgba(31, 111, 120, 0.14), transparent);
    border-radius: 14px;
    content: "";
    inset: 0;
    opacity: 0.55;
    pointer-events: none;
    position: absolute;
}

.stat-panel > * {
    position: relative;
    z-index: 1;
}

.stat-label {
    color: #667085;
    display: block;
    font-size: 0.8rem;
    margin-bottom: 0.35rem;
}

.stat-value {
    color: #101828;
    display: block;
    font-size: 2.05rem;
    font-weight: 800;
}

.stat-trend {
    color: #24545b;
    font-size: 0.82rem;
    font-weight: 600;
    margin-top: 0.55rem;
}

.action-grid {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.action-tile {
    background: linear-gradient(180deg, #fcfdff 0%, #f7fafc 100%);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    gap: 0.38rem;
    min-height: 126px;
    padding: 1rem;
    text-decoration: none;
}

.action-tile strong {
    color: #101828;
    font-size: 0.98rem;
}

.action-tile span {
    color: #667085;
    font-size: 0.88rem;
    line-height: 1.5;
}

.home-action-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 1rem;
}

.home-action-card {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    box-shadow: 0 16px 42px rgba(15, 23, 42, 0.06);
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    min-height: 190px;
    padding: 1.15rem;
    text-decoration: none;
    transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.home-action-card:hover {
    border-color: rgba(31, 111, 120, 0.28);
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.1);
    transform: translateY(-2px);
}

.home-action-card span {
    align-items: center;
    background: rgba(31, 111, 120, 0.08);
    border-radius: 12px;
    color: #24545b;
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 800;
    height: 34px;
    justify-content: center;
    width: 44px;
}

.home-action-card strong {
    color: #101828;
    display: block;
    font-size: 1.24rem;
}

.home-action-card p {
    color: #667085;
    line-height: 1.55;
    margin: 0;
}

.home-action-card--primary {
    background:
        radial-gradient(circle at top right, rgba(126, 213, 223, 0.24), transparent 30%),
        linear-gradient(135deg, #172033 0%, #203d59 100%);
    color: #ffffff;
}

.home-action-card--primary span {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.home-action-card--primary strong,
.home-action-card--primary p {
    color: #ffffff;
}

.text-link {
    color: #1f6f78;
    font-size: 0.9rem;
    font-weight: 800;
    text-decoration: none;
}

.field-row {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 1fr 1fr;
}

label {
    color: #344054;
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.85rem;
}

label .form-control {
    margin-top: 0.35rem;
}

.field-helper {
    color: #7b8794;
    display: block;
    font-size: 0.76rem;
    font-weight: 500;
    margin-top: 0.35rem;
}

.issue-box {
    min-height: 170px;
    resize: vertical;
}

.chip-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.chip-row-label {
    color: #667085;
    font-size: 0.78rem;
    font-weight: 700;
    margin-right: 0.1rem;
}

.primary-action {
    align-items: center;
    background: linear-gradient(180deg, #1f6f78 0%, #245d72 100%);
    border: 0;
    border-radius: 12px;
    box-shadow: 0 12px 24px rgba(31, 111, 120, 0.18);
    color: #fff;
    display: inline-flex;
    font-size: 0.94rem;
    font-weight: 700;
    gap: 0.5rem;
    justify-content: center;
    min-height: 46px;
    padding: 0 1rem;
    width: 100%;
}

.primary-action:disabled {
    cursor: default;
    opacity: 0.7;
}

.primary-action:not(button) {
    text-decoration: none;
}

.evidence-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.summary-card {
    background: #ffffff;
}

.summary-copy {
    background: linear-gradient(180deg, #effaf4 0%, #edf7f2 100%);
    border: 1px solid rgba(28, 91, 67, 0.08);
    border-left: 4px solid #24845c;
    border-radius: 10px;
    color: #1c5b43;
    margin: 0 0 1rem;
    padding: 0.95rem;
}

.result-meta-grid {
    display: grid;
    gap: 0.65rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 0.85rem;
}

.result-meta-grid div {
    background: #f8fafc;
    border: 1px solid #e4e9f1;
    border-radius: 10px;
    padding: 0.72rem 0.78rem;
}

.result-meta-grid span {
    color: #667085;
    display: block;
    font-size: 0.76rem;
    margin-bottom: 0.18rem;
}

.result-meta-grid strong {
    color: #101828;
    display: block;
    font-size: 1.2rem;
}

.query-footnote {
    color: #667085;
    font-size: 0.78rem;
    line-height: 1.5;
    margin: 0.7rem 0 0;
    word-break: break-word;
}

.warning-panel {
    background: linear-gradient(180deg, #fff8f1 0%, #fff4ed 100%);
    border-color: #fed7aa;
}

.dropzone-panel {
    align-items: center;
    background:
        linear-gradient(180deg, rgba(31, 111, 120, 0.04), rgba(31, 111, 120, 0.02)),
        rgba(255, 255, 255, 0.84);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 280px;
    text-align: center;
}

.dropzone-icon {
    align-items: center;
    background: linear-gradient(180deg, #dff2f4 0%, #d4ecef 100%);
    border-radius: 999px;
    color: #1f6f78;
    display: flex;
    font-size: 1.35rem;
    font-weight: 800;
    height: 68px;
    justify-content: center;
    margin-bottom: 1rem;
    width: 68px;
}

.queue-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.queue-item {
    align-items: flex-start;
    background: #f9fafb;
    border: 1px solid #eaecf0;
    border-radius: 10px;
    display: flex;
    gap: 0.8rem;
    min-height: 60px;
    overflow: hidden;
    padding: 0.8rem 0.9rem;
}

.queue-item strong {
    color: #101828;
    display: block;
    font-size: 0.98rem;
    line-height: 1.35;
    min-width: 0;
    overflow-wrap: anywhere;
}

.queue-item span {
    color: #344054;
    display: block;
    font-size: 0.88rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.queue-item.active {
    background: linear-gradient(180deg, #f4fbfc 0%, #f1f7f8 100%);
    border-color: #bcdde2;
    box-shadow: inset 0 0 0 1px rgba(31, 111, 120, 0.08);
}

.workspace-grid--documents-top {
    grid-template-columns: minmax(360px, 0.9fr) minmax(0, 1.1fr);
}

.workspace-grid--documents-review {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
}

.upload-stack {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.form-control--file {
    align-items: center;
    display: flex;
    min-height: 44px;
    padding: 0.45rem 0.6rem;
}

.queue-stack--scroll {
    max-height: 620px;
    overflow: auto;
    padding-right: 0.2rem;
}

.queue-stack--published {
    max-height: 360px;
}

.queue-item--draft,
.queue-item--document,
.queue-item--chunk,
.queue-item--published {
    cursor: pointer;
    min-height: 96px;
    transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
}

.queue-item--draft:hover,
.queue-item--document:hover,
.queue-item--chunk:hover,
.queue-item--published:hover {
    border-color: #bfd7dd;
    transform: translateY(-1px);
}

.queue-item-body {
    flex: 1;
    min-width: 0;
}

.queue-item-body p {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.queue-item--published .detail-block {
    display: -webkit-box;
    line-height: 1.45;
    margin-top: 0.28rem;
    max-height: 2.9em;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.review-meta-grid,
.review-field-grid {
    display: grid;
    gap: 0.8rem;
}

.review-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 1rem;
}

.review-field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.review-field-card {
    background: #f8fafc;
    border: 1px solid #e4e9f1;
    border-radius: 12px;
    padding: 0.9rem;
}

.review-field-card span {
    color: #667085;
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.review-field-card p {
    color: #101828;
    line-height: 1.55;
    margin: 0;
    white-space: pre-line;
}

.review-chunk {
    background: #f8fafc;
    border: 1px solid #e4e9f1;
    border-radius: 12px;
    max-height: 420px;
    overflow: auto;
    padding: 0.9rem;
}

.review-alert {
    border-radius: 12px;
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
}

.review-alert strong {
    color: #9a3412;
    display: block;
    font-size: 0.88rem;
    margin-bottom: 0.45rem;
}

.review-alert--warning {
    background: #fff7ed;
    border: 1px solid #fed7aa;
}

.review-alert--success {
    background: #ecfdf3;
    border: 1px solid #bbf7d0;
}

.review-alert--success strong {
    color: #166534;
}

.review-alert--danger {
    background: #fff1f2;
    border: 1px solid #fecdd3;
}

.review-alert--danger strong {
    color: #9f1239;
}

.secondary-chip {
    background: #ffffff;
    border: 1px solid #d7dde6;
    border-radius: 999px;
    color: #344054;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    min-height: 34px;
    padding: 0 0.85rem;
}

.secondary-chip--active {
    background: rgba(31, 111, 120, 0.1);
    border-color: #a8ccd1;
    color: #24545b;
}

.secondary-action {
    align-items: center;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    color: #344054;
    display: inline-flex;
    font-size: 0.94rem;
    font-weight: 700;
    justify-content: center;
    min-height: 46px;
    padding: 0 1rem;
    width: 100%;
}

.secondary-action:disabled,
.secondary-chip:disabled {
    cursor: default;
    opacity: 0.65;
}

.action-grid--review {
    margin-top: 0.9rem;
}

.compact-list {
    color: #344054;
    line-height: 1.55;
    margin-bottom: 0;
    padding-left: 1.2rem;
}

.compact-list li {
    margin-bottom: 0.45rem;
}

.detail-block {
    color: #344054;
    line-height: 1.6;
    margin: 0;
    white-space: pre-line;
}

.success-panel {
    background: linear-gradient(180deg, #f1faf5 0%, #edf8f2 100%);
    border-color: #b9ddcb;
}

.success-copy {
    color: #1c5b43;
    line-height: 1.55;
    margin: 0;
}

.form-showcase-grid {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 1rem;
}

.field-card {
    display: flex;
    flex-direction: column;
    gap: 0.38rem;
}

.field-title {
    color: #344054;
    font-size: 0.8rem;
    font-weight: 700;
}

.field-box,
.text-card {
    background: #f9fafb;
    border: 1px solid #d7dde6;
    border-radius: 10px;
}

.field-box {
    align-items: center;
    color: #101828;
    display: flex;
    min-height: 40px;
    padding: 0.58rem 0.72rem;
}

.text-card {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 1rem;
    padding: 0.82rem 0.88rem;
}

.text-card p {
    color: #101828;
    line-height: 1.5;
    margin: 0;
}

.case-card,
.hit-item,
.feed-item,
.data-row {
    border-top: 1px solid #eaecf0;
    padding-top: 0.85rem;
}

.case-card:first-of-type,
.hit-item:first-of-type,
.feed-item:first-of-type,
.data-row:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.case-card {
    background: #f9fafb;
    border: 1px solid #eaecf0;
    border-radius: 12px;
    padding: 0.85rem;
}

.case-card p,
.hit-item p {
    margin: 0.4rem 0 0;
}

.hit-item span,
.feed-item span {
    color: #667085;
    display: block;
    font-size: 0.8rem;
    margin-top: 0.15rem;
}

.feed-item strong {
    color: #101828;
}

.form-control {
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid #cfd8e3;
    border-radius: 12px;
    padding: 0.72rem 0.86rem;
}

.form-control:focus {
    border-color: #6fa5ab;
    box-shadow: 0 0 0 0.15rem rgba(31, 111, 120, 0.12);
    outline: 0;
}

.home-section-title {
    color: #101828;
    font-size: 1rem;
    font-weight: 800;
    margin: 0 0 0.85rem;
}

.dense-list {
    display: grid;
    gap: 0.75rem;
}

.dense-list-item {
    align-items: flex-start;
    background: #f8fafc;
    border: 1px solid #e3e8ef;
    border-radius: 12px;
    display: grid;
    gap: 0.8rem;
    grid-template-columns: 92px minmax(0, 1fr);
    padding: 0.85rem 0.9rem;
}

.dense-list-item strong {
    color: #101828;
}

.dense-list-item p {
    color: #667085;
    line-height: 1.5;
    margin: 0.15rem 0 0;
}

.dense-tag {
    align-items: center;
    background: rgba(31, 111, 120, 0.08);
    border-radius: 10px;
    color: #24545b;
    display: inline-flex;
    font-size: 0.76rem;
    font-weight: 800;
    justify-content: center;
    min-height: 30px;
    padding: 0 0.75rem;
}

.data-grid-two {
    display: grid;
    gap: 0.8rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.data-card {
    background: #f8fafc;
    border: 1px solid #e4e9f1;
    border-radius: 12px;
    padding: 0.9rem;
}

.data-card span {
    color: #667085;
    display: block;
    font-size: 0.78rem;
}

.data-card strong {
    color: #101828;
    display: block;
    font-size: 1.25rem;
    margin-top: 0.2rem;
}

.kpi-note {
    color: #24545b;
    font-size: 0.78rem;
    font-weight: 600;
    margin-top: 0.4rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: #b32121;
    color: white;
    padding: 1rem;
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* Diagnosis page: loading spinner */
.spinner {
    animation: spin 0.8s linear infinite;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    display: inline-block;
    height: 16px;
    width: 16px;
}

.spinner--large {
    border-width: 3px;
    border-color: rgba(31, 111, 120, 0.2);
    border-top-color: #1f6f78;
    height: 28px;
    width: 28px;
}

.spinner--teal {
    border-color: rgba(31, 111, 120, 0.2);
    border-top-color: #1f6f78;
}

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

/* Diagnosis page: error panel */
.error-panel {
    background: linear-gradient(180deg, #fff1f2 0%, #ffe4e6 100%);
    border-color: #fecdd3;
}

.error-panel h2 {
    color: #9f1239;
}

.error-panel p {
    color: #881337;
    line-height: 1.55;
    margin: 0 0 0.85rem;
}

/* Diagnosis page: loading overlay */
.loading-overlay {
    display: flex;
    justify-content: center;
    padding: 2rem 0;
}

.loading-card {
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 2rem 3rem;
}

.loading-card p {
    color: #667085;
    margin: 0;
}

.inline-loading {
    align-items: center;
    background: #f4fbfc;
    border: 1px solid #d7ecef;
    border-radius: 10px;
    color: #24545b;
    display: flex;
    font-size: 0.9rem;
    font-weight: 700;
    gap: 0.6rem;
    margin: 0;
    padding: 0.92rem;
}

/* Diagnosis page: empty hint box */
.empty-hint-box {
    background: #f9fafb;
    border: 1px dashed #d7dde6;
    border-radius: 12px;
    padding: 1rem;
}

.empty-hint-box .empty-state {
    margin-bottom: 0.5rem;
}

.empty-hint-box .muted {
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
}

/* Diagnosis page: variant cards */
.variant-grid {
    display: grid;
    gap: 0.6rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0.5rem 0 0.75rem;
    padding-left: 0.5rem;
}

.variant-card {
    background: #f8fafc;
    border: 1px solid #e4e9f1;
    border-radius: 10px;
    padding: 0.75rem 0.85rem;
}

.variant-card-header {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.variant-card-header strong {
    color: #101828;
    font-size: 0.88rem;
}

.variant-meta {
    color: #667085;
    font-size: 0.78rem;
}

/* Diagnosis page: collapsible excerpt */
.excerpt-collapse {
    margin-top: 0.4rem;
}

.excerpt-collapse summary {
    color: #1f6f78;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
}

.excerpt-collapse summary:hover {
    text-decoration: underline;
}

.excerpt-text {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #334155;
    font-size: 0.82rem;
    line-height: 1.65;
    margin: 0.4rem 0 0;
    max-height: 320px;
    overflow: auto;
    padding: 0.7rem 0.8rem;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Diagnosis page: single source line */
.single-source-line {
    color: #667085;
    display: flex;
    flex-direction: column;
    font-size: 0.82rem;
    gap: 0.3rem;
    margin: 0.25rem 0 0.5rem 0.5rem;
}

/* Diagnosis page: knowledge hit cards */
.hit-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.hit-card {
    background: #f9fafb;
    border: 1px solid #eaecf0;
    border-radius: 10px;
    padding: 0.85rem 0.9rem;
}

.hit-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
}

.hit-card-header strong {
    color: #101828;
    font-size: 0.92rem;
}

.hit-meta {
    color: #667085;
    font-size: 0.78rem;
    flex-shrink: 0;
}

.hit-content {
    color: #344054;
    font-size: 0.85rem;
    line-height: 1.6;
    margin: 0.4rem 0 0;
    white-space: pre-line;
}

.hit-score-bar {
    align-items: center;
    display: flex;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.hit-score-label {
    color: #667085;
    font-size: 0.75rem;
}

.hit-score-value {
    background: rgba(31, 111, 120, 0.08);
    border-radius: 6px;
    color: #24545b;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
}

/* Diagnosis page: similar cases */
.case-result-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.case-result-card {
    background: #f9fafb;
    border: 1px solid #e4e9f1;
    border-radius: 12px;
    padding: 0.9rem;
}

.case-result-header {
    border-bottom: 1px solid #e4e9f1;
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    margin-bottom: 0.65rem;
    padding-bottom: 0.55rem;
}

.case-result-header strong {
    color: #101828;
    font-size: 0.95rem;
}

.case-result-header span {
    color: #667085;
    font-size: 0.78rem;
}

.case-result-card p {
    color: #344054;
    font-size: 0.86rem;
    line-height: 1.55;
    margin: 0.35rem 0 0;
}

/* Diagnosis assistant refresh */
.diagnosis-hero {
    align-items: flex-end;
    background: linear-gradient(135deg, #ffffff 0%, #f3f8fa 100%);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    box-shadow: 0 16px 42px rgba(15, 23, 42, 0.06);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding: 1.25rem;
}

.diagnosis-hero-copy {
    max-width: 760px;
}

.diagnosis-hero h1 {
    color: #101828;
    font-size: clamp(1.65rem, 2.8vw, 2.35rem);
    margin: 0 0 0.45rem;
}

.diagnosis-hero p {
    color: #536170;
    line-height: 1.7;
    margin: 0;
}

.diagnosis-hero-status {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

.diagnosis-hero-status span {
    background: rgba(31, 111, 120, 0.08);
    border: 1px solid rgba(31, 111, 120, 0.14);
    border-radius: 999px;
    color: #24545b;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.42rem 0.72rem;
}

.diagnosis-workspace {
    align-items: start;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
}

.diagnosis-search-panel,
.diagnosis-summary-panel,
.diagnosis-tabs-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    box-shadow: 0 16px 42px rgba(15, 23, 42, 0.06);
}

.diagnosis-search-panel {
    padding: 1.1rem;
    position: sticky;
    top: 1rem;
}

.diagnosis-issue-box {
    min-height: 132px;
}

.diagnosis-chip-row {
    margin-bottom: 0.85rem;
}

.secondary-chip,
.primary-action,
.secondary-action,
.diagnosis-tab {
    transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, color 140ms ease, transform 140ms ease;
}

.secondary-chip:hover:not(:disabled),
.diagnosis-tab:hover {
    border-color: rgba(31, 111, 120, 0.32);
    transform: translateY(-1px);
}

.diagnosis-run-button:hover:not(:disabled) {
    box-shadow: 0 16px 30px rgba(31, 111, 120, 0.22);
    transform: translateY(-1px);
}

.diagnosis-safety-card {
    background: #fff8f1;
    border: 1px solid #fed7aa;
    border-radius: 14px;
    margin-top: 1rem;
    padding: 0.9rem;
}

.diagnosis-safety-card strong {
    color: #9a3412;
    display: block;
    font-size: 0.88rem;
    margin-bottom: 0.45rem;
}

.diagnosis-safety-card p,
.diagnosis-safety-card li {
    color: #7c2d12;
    font-size: 0.86rem;
    line-height: 1.6;
}

.diagnosis-safety-card p,
.diagnosis-safety-card ul {
    margin: 0;
}

.diagnosis-safety-card ul {
    padding-left: 1.1rem;
}

.diagnosis-result-area {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.diagnosis-summary-panel {
    min-height: 246px;
    overflow: hidden;
    padding: 1.25rem;
    position: relative;
}

.diagnosis-summary-panel::before {
    background: linear-gradient(180deg, rgba(31, 111, 120, 0.16), transparent);
    content: "";
    height: 5px;
    inset: 0 0 auto;
    position: absolute;
}

.diagnosis-summary-topline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.9rem;
}

.diagnosis-pill {
    background: #f4f7fa;
    border: 1px solid #e4e9f1;
    border-radius: 999px;
    color: #536170;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.36rem 0.68rem;
}

.diagnosis-pill--strong {
    background: #eaf6f2;
    border-color: #c7e8dc;
    color: #1c5b43;
}

.diagnosis-pill--medium {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}

.diagnosis-pill--weak {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #9f1239;
}

.diagnosis-copy-button {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    color: #344054;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 800;
    min-height: 32px;
    padding: 0 0.75rem;
    transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.diagnosis-copy-button:hover {
    border-color: rgba(31, 111, 120, 0.32);
    color: #1f6f78;
    transform: translateY(-1px);
}

.diagnosis-summary-panel h2 {
    color: #101828;
    font-size: clamp(1.35rem, 2.2vw, 1.9rem);
    line-height: 1.28;
    margin: 0 0 0.7rem;
}

.diagnosis-summary-text {
    color: #344054;
    font-size: 1rem;
    line-height: 1.75;
    margin: 0;
    max-width: 920px;
}

.diagnosis-confidence-note {
    color: #667085;
    font-size: 0.86rem;
    line-height: 1.6;
    margin: 0.65rem 0 0;
}

.copy-status {
    border-radius: 10px;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.45;
    margin: 0.7rem 0 0;
    padding: 0.62rem 0.75rem;
}

.copy-status--success {
    background: #ecfdf3;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.copy-status--error {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #9f1239;
}

.diagnosis-metric-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 1.1rem;
}

.diagnosis-metric-grid div {
    background: #f8fafc;
    border: 1px solid #e4e9f1;
    border-radius: 14px;
    padding: 0.85rem 0.9rem;
}

.diagnosis-metric-grid span {
    color: #667085;
    display: block;
    font-size: 0.78rem;
    margin-bottom: 0.2rem;
}

.diagnosis-metric-grid strong {
    color: #101828;
    display: block;
    font-size: 1.45rem;
}

.diagnosis-empty-start {
    align-items: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 200px;
    text-align: center;
}

.diagnosis-empty-icon {
    align-items: center;
    background: rgba(31, 111, 120, 0.08);
    border-radius: 999px;
    color: #24545b;
    display: inline-flex;
    font-size: 1.15rem;
    font-weight: 800;
    height: 52px;
    justify-content: center;
    margin-bottom: 0.8rem;
    width: 52px;
}

.diagnosis-empty-start h2 {
    margin-bottom: 0.35rem;
}

.diagnosis-empty-start p {
    color: #667085;
    line-height: 1.6;
    margin: 0;
}

.diagnosis-loading-state {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    justify-content: center;
    min-height: 200px;
}

.diagnosis-skeleton {
    animation: shimmer 1.2s ease-in-out infinite;
    background: linear-gradient(90deg, #eef2f6 0%, #f8fafc 48%, #eef2f6 100%);
    background-size: 220% 100%;
    border-radius: 12px;
    height: 18px;
}

.diagnosis-skeleton--title {
    height: 34px;
    width: 58%;
}

.diagnosis-skeleton--short {
    width: 72%;
}

@keyframes shimmer {
    0% { background-position: 120% 0; }
    100% { background-position: -120% 0; }
}

.diagnosis-tabs-card {
    padding: 0.75rem;
}

.diagnosis-tabs {
    background: #f4f7fa;
    border: 1px solid #e4e9f1;
    border-radius: 14px;
    display: grid;
    gap: 0.4rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 0.35rem;
}

.diagnosis-tab {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    color: #536170;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 800;
    min-height: 42px;
    padding: 0 0.75rem;
}

.diagnosis-tab--active {
    background: #ffffff;
    border-color: rgba(31, 111, 120, 0.18);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
    color: #1f6f78;
}

.diagnosis-tab-panel {
    animation: fadeInUp 180ms ease both;
    padding: 1rem 0.25rem 0.25rem;
}

.diagnosis-overview-grid,
.diagnosis-evidence-layout {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.diagnosis-insight-card,
.diagnosis-fault-card {
    background: #f8fafc;
    border: 1px solid #e4e9f1;
    border-radius: 14px;
    padding: 1rem;
}

.diagnosis-no-result-card {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 14px;
    display: grid;
    gap: 1rem;
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.7fr);
    padding: 1rem;
}

.diagnosis-no-result-card h3 {
    color: #9a3412;
    font-size: 1rem;
    margin: 0.35rem 0 0.3rem;
}

.diagnosis-no-result-card p {
    color: #7c2d12;
    line-height: 1.6;
    margin: 0;
}

.diagnosis-no-result-label {
    color: #c2410c;
    font-size: 0.76rem;
    font-weight: 900;
}

.diagnosis-suggestion-grid {
    display: grid;
    gap: 0.5rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.diagnosis-suggestion-grid button {
    background: #ffffff;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    color: #9a3412;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 800;
    min-height: 38px;
}

.diagnosis-insight-card--wide {
    grid-column: 1 / -1;
}

.diagnosis-section-heading,
.diagnosis-section-title-row {
    align-items: center;
    display: flex;
    gap: 0.6rem;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.diagnosis-section-heading {
    justify-content: flex-start;
}

.diagnosis-section-heading span {
    align-items: center;
    background: rgba(31, 111, 120, 0.1);
    border-radius: 10px;
    color: #24545b;
    display: inline-flex;
    font-size: 0.76rem;
    font-weight: 900;
    height: 30px;
    justify-content: center;
    width: 34px;
}

.diagnosis-section-heading h3,
.diagnosis-section-title-row h3 {
    color: #101828;
    font-size: 1rem;
    margin: 0;
}

.diagnosis-clean-list {
    color: #344054;
    line-height: 1.68;
    margin: 0;
    padding-left: 1.2rem;
}

.diagnosis-clean-list li {
    margin-bottom: 0.55rem;
}

.diagnosis-clean-list li:last-child {
    margin-bottom: 0;
}

.diagnosis-clean-list--columns {
    columns: 2;
}

.diagnosis-check-item {
    align-items: flex-start;
    break-inside: avoid;
    display: flex;
    gap: 0.5rem;
    list-style: none;
    margin-bottom: 0.65rem;
}

.diagnosis-check-item input {
    accent-color: #1f6f78;
    margin-top: 0.22rem;
}

.diagnosis-check-item label {
    color: #344054;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.5;
    margin: 0;
}

.diagnosis-step-list {
    counter-reset: steps;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.diagnosis-step-list li {
    align-items: flex-start;
    background: #f8fafc;
    border: 1px solid #e4e9f1;
    border-radius: 14px;
    display: grid;
    gap: 0.85rem;
    grid-template-columns: 36px minmax(0, 1fr);
    padding: 0.9rem;
}

.diagnosis-step-list span {
    align-items: center;
    background: #1f6f78;
    border-radius: 999px;
    color: #ffffff;
    display: inline-flex;
    font-size: 0.82rem;
    font-weight: 900;
    height: 32px;
    justify-content: center;
    width: 32px;
}

.diagnosis-step-list p {
    color: #344054;
    line-height: 1.65;
    margin: 0.2rem 0 0;
}

.diagnosis-fault-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.diagnosis-fault-card strong {
    color: #101828;
    display: block;
    font-size: 0.98rem;
    line-height: 1.35;
}

.diagnosis-fault-card span {
    color: #667085;
    display: block;
    font-size: 0.8rem;
    margin-top: 0.22rem;
}

.diagnosis-fault-card p {
    color: #344054;
    line-height: 1.65;
    margin: 0.75rem 0 0;
    white-space: pre-line;
}

.diagnosis-fade-in {
    animation: fadeInUp 220ms ease both;
}

.diagnosis-assistant-status {
    background: #f8fafc;
    border: 1px solid #e4e9f1;
    border-radius: 14px;
    margin-top: 1rem;
    padding: 0.9rem;
}

.diagnosis-assistant-status strong,
.diagnosis-assistant-status span {
    display: block;
}

.diagnosis-assistant-status strong {
    color: #101828;
    font-size: 0.88rem;
    margin-bottom: 0.35rem;
}

.diagnosis-assistant-status span {
    color: #24545b;
    font-size: 0.84rem;
    font-weight: 800;
    margin-bottom: 0.35rem;
}

.diagnosis-assistant-status p {
    color: #667085;
    font-size: 0.82rem;
    line-height: 1.55;
    margin: 0;
}

.hit-collapse .hit-content {
    margin-top: 0.45rem;
}

.secondary-action--compact {
    min-height: 38px;
    width: auto;
}

.history-metric-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 1rem;
}

.history-item {
    cursor: pointer;
    justify-content: space-between;
}

.history-item--active {
    background: #f4fbfc;
    border-color: #a8ccd1;
}

.history-item--empty {
    border-style: dashed;
}

.history-badge {
    background: #eaf6f2;
    border: 1px solid #c7e8dc;
    border-radius: 999px;
    color: #1c5b43;
    flex-shrink: 0;
    font-size: 0.76rem;
    font-weight: 900;
    padding: 0.26rem 0.58rem;
}

.history-badge--warning {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}

.history-detail-panel {
    align-self: start;
    position: sticky;
    top: 1rem;
}

.history-detail-stack {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1280px) {
    .stats-grid,
    .dashboard-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-deep-grid,
    .dashboard-bottom-grid {
        grid-template-columns: 1fr;
    }

    .hero-panel-grid {
        grid-template-columns: 1fr;
    }

    .home-action-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1080px) {
    .diagnosis-page-grid,
    .dashboard-main-grid,
    .support-grid,
    .workspace-grid--split,
    .workspace-grid--workorder,
    .workspace-grid--cases,
    .workspace-grid--devices,
    .workspace-grid--admin {
        grid-template-columns: 1fr;
    }

    .workspace-grid--documents-top,
    .workspace-grid--documents-review {
        grid-template-columns: 1fr;
    }

    .diagnosis-workspace {
        grid-template-columns: 1fr;
    }

    .diagnosis-search-panel {
        position: static;
    }

    .diagnosis-overview-grid,
    .diagnosis-evidence-layout,
    .diagnosis-no-result-card {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .workspace-header,
    .diagnosis-hero,
    .panel-heading,
    .field-row {
        display: block;
    }

    .panel-heading-actions {
        justify-content: flex-start;
        margin-top: 0.75rem;
    }

    .diagnosis-hero-status {
        justify-content: flex-start;
        margin-top: 0.85rem;
    }

    .status-strip {
        justify-content: flex-start;
        margin-top: 0.75rem;
    }

    .action-grid,
    .home-action-grid,
    .stats-grid,
    .dashboard-kpi-grid,
    .form-showcase-grid,
    .data-grid-two,
    .review-meta-grid,
    .review-field-grid,
    .variant-grid,
    .result-meta-grid,
    .case-result-grid {
        grid-template-columns: 1fr;
    }

    .diagnosis-tabs,
    .diagnosis-metric-grid,
    .history-metric-grid,
    .diagnosis-suggestion-grid {
        grid-template-columns: 1fr;
    }

    .diagnosis-clean-list--columns {
        columns: 1;
    }

    .diagnosis-step-list li {
        grid-template-columns: 1fr;
    }

    .queue-item,
    .dense-list-item {
        align-items: flex-start;
        grid-template-columns: 1fr;
    }
}

/* ──────────────────────────────────────────────
   V2 Diagnosis Workbench
   ────────────────────────────────────────────── */

.workbench-hero {
    align-items: flex-end;
    background: linear-gradient(135deg, #ffffff 0%, #f0f7f8 100%);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    box-shadow: 0 16px 42px rgba(15, 23, 42, 0.06);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding: 1.25rem;
}

.workbench-hero-copy {
    max-width: 760px;
}

.workbench-hero h1 {
    color: #101828;
    font-size: clamp(1.65rem, 2.8vw, 2.35rem);
    margin: 0 0 0.45rem;
}

.workbench-hero p {
    color: #536170;
    line-height: 1.7;
    margin: 0;
}

.workbench-hero-status {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

.workbench-hero-status span {
    background: rgba(31, 111, 120, 0.08);
    border: 1px solid rgba(31, 111, 120, 0.14);
    border-radius: 999px;
    color: #24545b;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.42rem 0.72rem;
}

.workbench-ai-status--ready {
    background: rgba(6, 118, 71, 0.08) !important;
    border-color: rgba(6, 118, 71, 0.2) !important;
    color: #067647 !important;
}

.workbench-ai-status--incomplete {
    background: rgba(181, 71, 8, 0.08) !important;
    border-color: rgba(181, 71, 8, 0.2) !important;
    color: #b54708 !important;
}

/* Three-column layout */
.workbench-layout {
    align-items: start;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr) minmax(300px, 380px);
}

@media (max-width: 1560px) {
    .workbench-layout {
        grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    }

    .workbench-evidence-panel {
        grid-column: 1 / -1;
    }
}

/* Input panel */
.workbench-input-panel {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
    padding: 1.25rem;
    position: sticky;
    top: 1rem;
}

.workbench-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.workbench-form label {
    color: #344054;
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
    font-weight: 600;
    gap: 0.3rem;
}

.workbench-form .form-control {
    font-size: 0.9rem;
    padding: 0.55rem 0.75rem;
}

.workbench-symptom-input {
    min-height: 72px;
    resize: vertical;
}

/* Result area */
.workbench-result-area {
    min-height: 400px;
}

.workbench-empty-start,
.workbench-evidence-empty {
    align-items: center;
    color: #667085;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 300px;
    text-align: center;
}

.workbench-empty-icon {
    align-items: center;
    background: rgba(31, 111, 120, 0.08);
    border-radius: 50%;
    color: #1f6f78;
    display: flex;
    font-size: 2.5rem;
    font-weight: 700;
    height: 64px;
    justify-content: center;
    margin-bottom: 1rem;
    width: 64px;
}

.workbench-empty-start h2 {
    color: #344054;
    font-size: 1.35rem;
    margin: 0 0 0.5rem;
}

.workbench-empty-start p {
    color: #667085;
    margin: 0;
    max-width: 360px;
}

/* Insufficient evidence state */
.workbench-insufficient {
    background: #fff;
    border: 2px solid #fda29b;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(240, 68, 56, 0.06);
    padding: 2rem;
}

.workbench-insufficient-badge {
    background: #fef3f2;
    border: 1px solid #fecdca;
    border-radius: 999px;
    color: #b42318;
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding: 0.35rem 0.85rem;
}

.workbench-insufficient h2 {
    color: #101828;
    font-size: 1.2rem;
    line-height: 1.6;
    margin: 0 0 1.5rem;
}

/* Result content */
.workbench-result-content {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
    padding: 1.5rem;
}

.workbench-result-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.workbench-result-header h2 {
    color: #101828;
    font-size: 1.35rem;
    margin: 0;
}

.workbench-confidence-pill {
    background: rgba(31, 111, 120, 0.1);
    border: 1px solid rgba(31, 111, 120, 0.2);
    border-radius: 999px;
    color: #1f6f78;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.35rem 0.85rem;
}

.workbench-summary {
    color: #344054;
    font-size: 1.05rem;
    line-height: 1.7;
    margin: 0 0 1.5rem;
}

.workbench-section {
    margin-bottom: 1.5rem;
}

.workbench-section h3 {
    color: #101828;
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.workbench-causes,
.workbench-steps {
    color: #344054;
    font-size: 0.9rem;
    line-height: 1.7;
    margin: 0;
    padding-left: 1.25rem;
}

.workbench-causes li,
.workbench-steps li {
    margin-bottom: 0.5rem;
}

.workbench-actions-list {
    color: #344054;
    font-size: 0.9rem;
    line-height: 1.7;
    list-style: none;
    margin: 0;
    padding: 0;
}

.workbench-actions-list li {
    background: #f8f9fb;
    border-left: 3px solid #1f6f78;
    border-radius: 0 8px 8px 0;
    margin-bottom: 0.5rem;
    padding: 0.6rem 0.85rem;
}

/* Evidence panel */
.workbench-evidence-panel {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
    padding: 1.25rem;
    position: sticky;
    top: 1rem;
}

.workbench-evidence-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: calc(100vh - 12rem);
    overflow-y: auto;
}

.workbench-evidence-card {
    background: #f8f9fb;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 12px;
    padding: 0.85rem;
}

.workbench-evidence-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.35rem;
}

.workbench-evidence-header strong {
    color: #1f6f78;
    font-size: 0.95rem;
}

.workbench-evidence-confidence {
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
}

.workbench-evidence-confidence.confidence-high {
    background: #ecfdf3;
    border: 1px solid #abefc6;
    color: #067647;
}

.workbench-evidence-confidence.confidence-medium {
    background: #fffaeb;
    border: 1px solid #fedf89;
    color: #b54708;
}

.workbench-evidence-confidence.confidence-low {
    background: #fef3f2;
    border: 1px solid #fecdca;
    color: #b42318;
}

.workbench-evidence-title {
    color: #344054;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0 0 0.4rem;
}

.workbench-evidence-meta {
    color: #667085;
    display: flex;
    flex-wrap: wrap;
    font-size: 0.78rem;
    gap: 0.35rem 0.85rem;
    margin-bottom: 0.4rem;
}

.workbench-excerpt {
    font-size: 0.82rem;
    margin-top: 0.4rem;
}

.workbench-excerpt summary {
    color: #1f6f78;
    cursor: pointer;
    font-weight: 600;
}

.workbench-excerpt p {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 8px;
    color: #344054;
    font-size: 0.82rem;
    line-height: 1.65;
    margin: 0.4rem 0 0;
    padding: 0.65rem;
    white-space: pre-wrap;
}

/* Workbench responsive */
@media (max-width: 1280px) {
    .workbench-layout {
        grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    }

    .workbench-evidence-panel {
        grid-column: 1 / -1;
    }
}

/* Source bar — diagnosis result source indicator */
.workbench-source-bar {
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding: 0.45rem 1rem;
    text-align: center;
}

.workbench-source-bar--rule {
    background: #f0f4f8;
    border: 1px solid #d0d5dd;
    color: #344054;
}

.workbench-source-bar--ai {
    background: #ecfdf3;
    border: 1px solid #abefc6;
    color: #067647;
}

.workbench-source-bar--fallback {
    background: #fffaeb;
    border: 1px solid #fedf89;
    color: #b54708;
}

.workbench-source-bar--exploratory {
    background: #eef6ff;
    border: 1px solid #b9d9ff;
    color: #15579c;
}

/* Export action buttons */
.workbench-export-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.workbench-export-btn {
    background: rgba(31, 111, 120, 0.06);
    border: 1px solid rgba(31, 111, 120, 0.18);
    border-radius: 8px;
    color: #1f6f78;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.4rem 0.85rem;
    transition: background 0.15s, border-color 0.15s;
}

.workbench-export-btn:hover {
    background: rgba(31, 111, 120, 0.12);
    border-color: rgba(31, 111, 120, 0.3);
}

.workbench-export-btn:active {
    background: rgba(31, 111, 120, 0.18);
}

/* V2 workbench density refresh */
.workbench-hero {
    align-items: center;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: none;
    padding: 1rem 1.1rem;
}

.workbench-hero h1 {
    font-size: 1.55rem;
    letter-spacing: 0;
    margin-bottom: 0.25rem;
}

.workbench-hero p {
    line-height: 1.55;
}

.workbench-layout {
    gap: 0.85rem;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr) minmax(280px, 360px);
}

@media (max-width: 1560px) {
    .workbench-layout {
        grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    }

    .workbench-evidence-panel {
        grid-column: 1 / -1;
    }
}

.workbench-input-panel,
.workbench-result-content,
.workbench-evidence-panel,
.workbench-insufficient {
    border-radius: 12px;
    box-shadow: none;
}

.workbench-input-panel,
.workbench-evidence-panel {
    padding: 1rem;
}

.workbench-field-group {
    align-items: center;
    display: flex;
    gap: 0.5rem;
    margin-bottom: -0.2rem;
}

.workbench-field-group span {
    color: #475467;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.workbench-inline-fields {
    display: grid;
    gap: 0.65rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.workbench-advanced-input {
    border-top: 1px solid #edf1f5;
    padding-top: 0.75rem;
}

.workbench-advanced-input summary {
    color: #1f6f78;
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 800;
    list-style-position: outside;
}

.workbench-advanced-grid {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.workbench-result-content {
    animation: fadeInUp 180ms ease both;
    padding: 1.1rem;
}

.workbench-result-topline {
    align-items: flex-start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.workbench-result-topline h2 {
    color: #101828;
    font-size: 1.18rem;
    line-height: 1.25;
    margin: 0;
}

.workbench-kicker {
    color: #667085;
    display: block;
    font-size: 0.76rem;
    font-weight: 800;
    margin-bottom: 0.2rem;
}

.workbench-verdict {
    background: #f7fbfb;
    border-left: 4px solid #1f6f78;
    border-radius: 8px;
    margin-bottom: 0.9rem;
    padding: 0.8rem 0.9rem;
}

.workbench-verdict p {
    color: #182230;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.65;
    margin: 0;
}

.expanded-diagnosis-main {
    background: #ffffff;
    border: 1px solid #d7e8ea;
    border-radius: 10px;
    margin-bottom: 1rem;
    padding: 1rem;
}

.expanded-diagnosis-main__header {
    align-items: flex-start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.expanded-diagnosis-main__header h3 {
    color: #102a43;
    font-size: 1.05rem;
    line-height: 1.35;
    margin: 0;
}

.expanded-diagnosis-main__summary {
    background: #f7fbfb;
    border-left: 3px solid #1f6f78;
    border-radius: 7px;
    color: #184e55;
    font-size: 0.92rem;
    font-weight: 650;
    line-height: 1.65;
    margin: 0 0 0.9rem;
    padding: 0.75rem 0.85rem;
}

.expanded-hypothesis-grid {
    display: grid;
    gap: 0.7rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 1rem;
}

.expanded-hypothesis-card {
    background: #fbfcfd;
    border: 1px solid #e5edf0;
    border-radius: 8px;
    padding: 0.75rem;
}

.expanded-hypothesis-card__top {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: space-between;
    margin-bottom: 0.45rem;
}

.expanded-hypothesis-card__top strong {
    color: #102a43;
    font-size: 0.9rem;
}

.expanded-hypothesis-card p {
    color: #344054;
    font-size: 0.86rem;
    line-height: 1.6;
    margin: 0;
}

.expanded-hypothesis-card__verify {
    border-top: 1px solid #edf1f5;
    margin-top: 0.65rem;
    padding-top: 0.55rem;
}

.expanded-hypothesis-card__verify span {
    color: #1f6f78;
    display: block;
    font-size: 0.74rem;
    font-weight: 800;
    margin-bottom: 0.2rem;
}

.expanded-flow {
    border-top: 1px solid #edf1f5;
    padding-top: 0.85rem;
}

.expanded-flow h3 {
    color: #344054;
    font-size: 0.9rem;
    margin: 0 0 0.65rem;
}

.expanded-flow ol {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.expanded-flow li {
    align-items: flex-start;
    display: grid;
    gap: 0.65rem;
    grid-template-columns: 1.65rem minmax(0, 1fr);
}

.expanded-flow li > span {
    align-items: center;
    background: #1f6f78;
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 800;
    height: 1.65rem;
    justify-content: center;
    width: 1.65rem;
}

.expanded-flow strong {
    color: #102a43;
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

.expanded-flow p {
    color: #475467;
    font-size: 0.85rem;
    line-height: 1.55;
    margin: 0;
}

.workbench-result-utilities {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.workbench-result-utilities .workbench-source-bar,
.workbench-result-utilities .workbench-export-actions {
    margin-bottom: 0;
}

.workbench-source-bar {
    border-radius: 8px;
    text-align: left;
}

.workbench-priority-grid {
    border-bottom: 1px solid #edf1f5;
    border-top: 1px solid #edf1f5;
    display: grid;
    gap: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 1rem;
}

.workbench-priority-panel {
    padding: 0.85rem 0.85rem 0.85rem 0;
}

.workbench-priority-panel + .workbench-priority-panel {
    border-left: 1px solid #edf1f5;
    padding-left: 0.85rem;
}

.workbench-priority-panel span {
    color: #667085;
    display: block;
    font-size: 0.76rem;
    font-weight: 800;
    margin-bottom: 0.28rem;
}

.workbench-priority-panel strong {
    color: #182230;
    display: block;
    font-size: 0.92rem;
    line-height: 1.55;
}

.workbench-priority-panel--action strong {
    color: #1f5f49;
}

.workbench-section {
    margin-bottom: 1.1rem;
}

.workbench-section h3 {
    border-bottom: 0;
    color: #344054;
    font-size: 0.92rem;
    margin-bottom: 0.55rem;
    padding-bottom: 0;
}

.workbench-causes,
.workbench-steps,
.workbench-actions-list {
    font-size: 0.88rem;
    line-height: 1.65;
}

.workbench-actions-list li {
    background: #f7faf8;
    border-left-color: #2e7d5b;
}

.workbench-evidence-list {
    gap: 0.55rem;
}

.workbench-evidence-card {
    background: #ffffff;
    border-color: #e7ecf2;
    border-radius: 10px;
    padding: 0.75rem;
    transition: border-color 150ms ease, transform 150ms ease;
}

.workbench-evidence-card:hover {
    border-color: #b7d6da;
    transform: translateY(-1px);
}

.workbench-evidence-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

@media (max-width: 860px) {
    .expanded-hypothesis-grid {
        grid-template-columns: 1fr;
    }
}

.workbench-excerpt summary {
    font-size: 0.8rem;
}

.workbench-excerpt p {
    max-height: 180px;
    overflow: auto;
}

@media (max-width: 960px) {
    .workbench-hero {
        display: block;
    }

    .workbench-hero-status {
        justify-content: flex-start;
        margin-top: 0.85rem;
    }

    .workbench-layout {
        grid-template-columns: 1fr;
    }

    .workbench-input-panel,
    .workbench-evidence-panel {
        position: static;
    }

    .workbench-priority-grid,
    .workbench-inline-fields {
        grid-template-columns: 1fr;
    }

    .workbench-priority-panel + .workbench-priority-panel {
        border-left: 0;
        border-top: 1px solid #edf1f5;
        padding-left: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

/* ── Operator Quick Start Cards ── */

.operator-quick-start {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    margin-top: 1.5rem;
}

.operator-quick-card {
    align-items: center;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
    color: inherit;
    display: flex;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    text-decoration: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.operator-quick-card:hover {
    border-color: rgba(31, 111, 120, 0.28);
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.1);
}

.operator-quick-icon {
    align-items: center;
    background: linear-gradient(180deg, rgba(31, 111, 120, 0.12), rgba(31, 111, 120, 0.04));
    border-radius: 12px;
    color: #1f6f78;
    display: flex;
    font-size: 1.35rem;
    height: 52px;
    justify-content: center;
    width: 52px;
}

.operator-quick-card strong {
    color: #0f172a;
    display: block;
    font-size: 1.05rem;
    margin-bottom: 0.2rem;
}

.operator-quick-card p {
    color: #667085;
    font-size: 0.85rem;
    margin: 0;
}

/* ── Operator History ── */

.operator-history {
    margin-top: 1.5rem;
}

.operator-history-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.operator-history-card {
    align-items: center;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    transition: border-color 0.18s ease;
}

.operator-history-card:hover {
    border-color: rgba(31, 111, 120, 0.18);
}

.operator-history-main {
    min-width: 0;
    flex: 1;
}

.operator-history-header {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.operator-history-header strong {
    color: #0f172a;
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.operator-history-badge {
    background: rgba(31, 111, 120, 0.1);
    border-radius: 8px;
    color: #1f6f78;
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.15rem 0.55rem;
}

.operator-history-badge--warning {
    background: rgba(180, 130, 20, 0.1);
    color: #92700c;
}

.operator-history-badge--info {
    background: rgba(21, 87, 156, 0.1);
    color: #15579c;
}

.operator-history-meta {
    color: #667085;
    display: flex;
    flex-wrap: wrap;
    font-size: 0.78rem;
    gap: 0.35rem;
}

.operator-history-meta span::after {
    content: " ·";
    color: #aab7c9;
    margin-left: 0.35rem;
}

.operator-history-meta span:last-child::after {
    content: "";
}

/* ── Login Page ── */

.login-shell {
    align-items: center;
    background:
        radial-gradient(circle at top left, rgba(49, 83, 122, 0.18), transparent 22%),
        linear-gradient(180deg, #eef2f6 0%, #e9edf3 100%);
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.login-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 20px;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.1);
    max-width: 420px;
    padding: 2.5rem 2rem;
    width: 100%;
}

.login-brand {
    align-items: center;
    display: flex;
    gap: 0.95rem;
    margin-bottom: 1.5rem;
}

.login-brand .brand-mark {
    background: linear-gradient(180deg, #2e5579 0%, #203d59 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
    color: #ffffff;
    display: flex;
    font-size: 0.95rem;
    font-weight: 800;
    height: 46px;
    justify-content: center;
    width: 46px;
}

.login-brand .brand-name {
    color: #0f172a;
    font-size: 1.35rem;
    font-weight: 800;
}

.login-brand .brand-subtitle {
    color: #667085;
    font-size: 0.78rem;
}

.login-card h1 {
    color: #0f172a;
    font-size: 1.25rem;
    margin: 0 0 0.35rem;
}

.login-card > .muted {
    color: #667085;
    font-size: 0.85rem;
    margin: 0 0 1.5rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.login-role-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.login-role-option {
    cursor: pointer;
    display: block;
}

.login-role-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.login-role-card {
    border: 2px solid rgba(15, 23, 42, 0.1);
    border-radius: 14px;
    display: block;
    padding: 1rem 1.25rem;
    transition: border-color 0.18s ease, background 0.18s ease;
}

.login-role-option input[type="radio"]:checked + .login-role-card {
    background: rgba(31, 111, 120, 0.06);
    border-color: #1f6f78;
}

.login-role-card:hover {
    border-color: rgba(31, 111, 120, 0.3);
}

.login-role-card strong {
    color: #0f172a;
    display: block;
    font-size: 0.95rem;
    margin-bottom: 0.15rem;
}

.login-role-card small {
    color: #667085;
    font-size: 0.78rem;
}

/* Operator console polish */
.operator-shell .shell-sidebar {
    background:
        linear-gradient(180deg, rgba(28, 43, 65, 0.98) 0%, rgba(18, 31, 45, 0.98) 100%);
}

.operator-topbar .topbar-main {
    align-items: center;
}

.operator-topbar-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.operator-content {
    padding-top: 1.25rem;
}

.operator-sidebar-card {
    margin-top: 0.2rem;
}

.operator-sidebar-flow {
    background: rgba(255, 255, 255, 0.03);
}

.operator-page-header {
    margin-bottom: 1rem;
}

.operator-command-panel {
    margin-bottom: 1rem;
}

.operator-hero-panel {
    border-radius: 16px;
    padding: 1.25rem;
}

.operator-hero-panel .hero-panel-grid {
    align-items: stretch;
}

.operator-hero-panel h1 {
    font-size: clamp(1.7rem, 2.4vw, 2.15rem);
}

.operator-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 1.1rem;
}

.operator-primary-link,
.operator-secondary-link {
    min-width: 140px;
    width: auto;
}

.operator-secondary-link {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

.operator-action-grid {
    grid-template-columns: minmax(220px, 0.9fr) minmax(220px, 0.9fr) minmax(360px, 1.2fr);
}

.operator-home-panel {
    min-height: 190px;
}

.operator-home-panel h2 {
    margin-bottom: 0.85rem;
}

.operator-history-stats {
    margin-bottom: 1rem;
}

.operator-history-panel {
    margin-bottom: 1rem;
}

.operator-history {
    margin-top: 0;
}

.operator-history-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: none;
}

.operator-history-card:hover {
    border-color: rgba(31, 111, 120, 0.28);
}

.operator-history-header strong {
    font-size: 1rem;
}

.operator-history-meta {
    gap: 0.35rem 0.5rem;
}

.operator-history-meta span::after {
    content: "·";
    margin-left: 0.5rem;
}

.operator-history-meta span:last-child::after {
    content: "";
    margin-left: 0;
}

.operator-history-action {
    flex-shrink: 0;
}

.operator-history-card--session {
    align-items: flex-start;
}

.operator-history-summary {
    color: #344054;
    font-size: 0.9rem;
    line-height: 1.55;
    margin: 0 0 0.55rem;
}

.operator-history-actions {
    align-items: flex-end;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.operator-history-badge--success {
    background: rgba(22, 101, 52, 0.1);
    color: #166534;
}

.operator-session-strip {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #dbe4ef;
    border-radius: 12px;
    color: #475467;
    display: flex;
    flex-wrap: wrap;
    font-size: 0.84rem;
    gap: 0.6rem;
    justify-content: space-between;
    margin: 0.85rem 0;
    padding: 0.7rem 0.85rem;
}

.operator-session-strip a {
    color: #1f6f78;
    font-weight: 700;
    text-decoration: none;
}

.workbench-export-link {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    text-decoration: none;
}

.workbench-followup-card {
    background: #f8fafc;
    border: 1px solid #dbe4ef;
    border-radius: 12px;
    display: grid;
    gap: 0.75rem;
    margin: 0.85rem 0 1rem;
    padding: 0.9rem;
}

.workbench-followup-card h3 {
    color: #0f172a;
    font-size: 0.95rem;
    margin: 0 0 0.2rem;
}

.workbench-followup-input {
    align-items: stretch;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 96px;
    gap: 0.75rem;
}

.workbench-followup-input textarea {
    min-height: 64px;
    min-width: 0;
    resize: vertical;
    width: 100%;
}

.workbench-followup-input .primary-action {
    align-self: stretch;
    min-height: 44px;
    min-width: 0;
    padding-inline: 0.85rem;
    width: 96px;
}

.operator-detail-loading {
    margin: 1rem 0;
    padding: 1.5rem;
}

.operator-detail-header {
    align-items: flex-start;
}

.operator-detail-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.75fr);
    margin-bottom: 1rem;
}

.operator-detail-panel {
    min-width: 0;
}

.operator-detail-panel--wide {
    min-height: 100%;
}

.operator-detail-columns {
    display: grid;
    gap: 0.85rem;
    margin-top: 1rem;
}

.operator-detail-list {
    display: grid;
    gap: 0.75rem;
    margin: 0;
}

.operator-detail-list div {
    border-bottom: 1px solid #eef2f7;
    display: grid;
    gap: 0.25rem;
    padding-bottom: 0.65rem;
}

.operator-detail-list dt {
    color: #667085;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.operator-detail-list dd {
    color: #0f172a;
    font-size: 0.92rem;
    margin: 0;
    overflow-wrap: anywhere;
}

.operator-detail-repeat,
.operator-feedback-submit {
    margin-top: 1rem;
    width: 100%;
}

.operator-detail-evidence {
    max-height: none;
}

.operator-feedback-current {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    color: #166534;
    margin-bottom: 1rem;
    padding: 0.85rem;
}

.operator-feedback-current span {
    display: block;
    font-weight: 800;
}

.operator-feedback-current small {
    color: #3f8f5f;
    display: block;
    margin-top: 0.2rem;
}

.operator-feedback-current p {
    color: #14532d;
    margin: 0.55rem 0 0;
}

.operator-feedback-options {
    display: grid;
    gap: 0.5rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 1rem;
}

.operator-feedback-choice {
    background: #ffffff;
    border: 1px solid #d0d7e2;
    border-radius: 10px;
    color: #344054;
    cursor: pointer;
    font-weight: 800;
    min-height: 42px;
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.operator-feedback-choice:hover,
.operator-feedback-choice--selected {
    background: rgba(31, 111, 120, 0.08);
    border-color: #1f6f78;
    color: #1f6f78;
}

.operator-feedback-note {
    color: #344054;
    display: grid;
    font-size: 0.85rem;
    font-weight: 700;
    gap: 0.45rem;
}

.operator-feedback-status {
    color: #1f6f78;
    font-size: 0.85rem;
    font-weight: 700;
    margin: 0.75rem 0 0;
}

.diagnosis-feedback-header {
    margin-bottom: 1rem;
}

.diagnosis-feedback-stats {
    margin-bottom: 1rem;
}

.diagnosis-feedback-panel {
    margin-bottom: 1rem;
}

.diagnosis-feedback-list {
    display: grid;
    gap: 0.75rem;
}

.diagnosis-feedback-card {
    align-items: flex-start;
    background: #ffffff;
    border: 1px solid #e4e9f2;
    border-radius: 12px;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 1rem;
}

.diagnosis-feedback-main {
    min-width: 0;
}

.diagnosis-feedback-title-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
}

.diagnosis-feedback-title-row strong {
    color: #0f172a;
    font-size: 1rem;
}

.diagnosis-feedback-card p {
    color: #344054;
    line-height: 1.55;
    margin: 0 0 0.5rem;
}

.diagnosis-feedback-note {
    background: #f8fafc;
    border: 1px solid #e4e9f2;
    border-radius: 10px;
    margin-top: 0.75rem;
    padding: 0.75rem;
}

.diagnosis-feedback-note span {
    color: #667085;
    display: block;
    font-size: 0.76rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.diagnosis-feedback-note p {
    margin: 0;
}

.operator-empty-state {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    min-height: 260px;
    padding: 1.5rem;
}

.operator-empty-action {
    margin-top: 1rem;
    max-width: 180px;
    text-decoration: none;
}

@media (max-width: 1280px) {
    .operator-action-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .operator-home-panel {
        grid-column: 1 / -1;
    }
}

@media (max-width: 960px) {
    .operator-topbar-meta,
    .operator-action-grid,
    .operator-history-stats {
        grid-template-columns: 1fr;
    }

    .operator-history-card {
        align-items: stretch;
        flex-direction: column;
    }

    .operator-history-actions {
        align-items: stretch;
        width: 100%;
    }

    .operator-history-action {
        width: 100%;
    }

    .operator-detail-grid {
        grid-template-columns: 1fr;
    }

    .diagnosis-feedback-card {
        flex-direction: column;
    }

    .diagnosis-feedback-card .operator-history-action {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .operator-feedback-options {
        grid-template-columns: 1fr;
    }

    .operator-session-strip {
        align-items: stretch;
        flex-direction: column;
    }
}

/* ── External Reference Cards ── */

.external-ref-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.external-ref-card {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-left: 3px solid rgba(31, 111, 120, 0.3);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    transition: border-color 0.18s ease;
}

.external-ref-card:hover {
    border-left-color: #1f6f78;
}

.external-ref-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.35rem;
}

.external-ref-domain {
    color: #667085;
    font-size: 0.72rem;
    font-weight: 600;
}

.external-ref-badge {
    background: rgba(180, 130, 20, 0.1);
    border-radius: 6px;
    color: #92700c;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.12rem 0.45rem;
}

.external-ref-title {
    color: #1f6f78;
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.3rem;
    text-decoration: none;
}

.external-ref-title:hover {
    text-decoration: underline;
}

.external-ref-snippet {
    color: #475467;
    font-size: 0.78rem;
    line-height: 1.5;
    margin: 0 0 0.45rem;
}

.external-ref-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.external-ref-relevance {
    color: #667085;
    font-size: 0.7rem;
}

.external-ref-type {
    color: #667085;
    font-size: 0.7rem;
}

.external-ref-conflict {
    color: #b45309;
    font-size: 0.7rem;
    font-weight: 600;
}

.external-ref-disclaimer {
    background: rgba(180, 130, 20, 0.06);
    border-left: 3px solid rgba(180, 130, 20, 0.4);
    border-radius: 6px;
    color: #92700c;
    font-size: 0.75rem;
    line-height: 1.5;
    margin: 0.5rem 0 0.75rem;
    padding: 0.5rem 0.75rem;
}

.external-analysis-card {
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(31, 111, 120, 0.12);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1rem;
}

.external-analysis-summary {
    background: rgba(31, 111, 120, 0.06);
    border-left: 3px solid #1f6f78;
    border-radius: 7px;
    color: #184e55;
    font-size: 0.84rem;
    font-weight: 650;
    line-height: 1.55;
    padding: 0.7rem 0.85rem;
}

.external-analysis-section {
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    padding-top: 0.75rem;
}

.external-analysis-section h3 {
    color: #102a43;
    font-size: 0.84rem;
    margin: 0 0 0.45rem;
}

.external-analysis-section ol {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin: 0;
    padding-left: 1.15rem;
}

.external-analysis-section li {
    color: #22354d;
    font-size: 0.8rem;
    line-height: 1.55;
    padding-left: 0.15rem;
}

.external-analysis-section li small {
    color: #1f6f78;
    display: inline-block;
    font-weight: 700;
    margin-left: 0.35rem;
    white-space: nowrap;
}

.external-analysis-sources {
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    padding-top: 0.75rem;
}

.external-analysis-sources summary {
    color: #1f6f78;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
}

/* ── Conversation / Follow-up ── */

.operator-conversation {
    margin-top: 1.5rem;
}

.operator-conversation-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.operator-conversation-msg {
    border-radius: 14px;
    padding: 1rem 1.25rem;
}

.operator-conversation-msg--user {
    background: rgba(31, 111, 120, 0.08);
    border: 1px solid rgba(31, 111, 120, 0.15);
    margin-left: 2rem;
}

.operator-conversation-msg--assistant {
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(15, 23, 42, 0.08);
    margin-right: 2rem;
}

.operator-conversation-meta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.operator-conversation-meta strong {
    color: #0f172a;
    font-size: 0.85rem;
}

.operator-conversation-meta span {
    color: #667085;
    font-size: 0.72rem;
}

.operator-conversation-ref {
    background: rgba(31, 111, 120, 0.1);
    border-radius: 6px;
    color: #1f6f78;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.1rem 0.4rem;
}

.operator-conversation-ref--ext {
    background: rgba(180, 130, 20, 0.1);
    color: #92700c;
}

.operator-conversation-msg p {
    color: #374151;
    font-size: 0.88rem;
    line-height: 1.6;
    margin: 0;
    white-space: pre-wrap;
}

.operator-conversation-input {
    align-items: stretch;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 104px;
    gap: 0.75rem;
    margin-top: 1rem;
}

.operator-conversation-input textarea {
    min-height: 68px;
    min-width: 0;
    resize: vertical;
    width: 100%;
}

.operator-conversation-input .primary-action {
    align-self: stretch;
    min-height: 44px;
    min-width: 0;
    padding-inline: 0.85rem;
    width: 104px;
}

.operator-conversation-error {
    color: #b45309;
    font-size: 0.82rem;
    margin-top: 0.5rem;
}

@media (max-width: 720px) {
    .operator-conversation-msg--user {
        margin-left: 0.5rem;
    }

    .operator-conversation-msg--assistant {
        margin-right: 0.5rem;
    }

    .operator-conversation-input {
        align-items: stretch;
        grid-template-columns: 1fr;
    }

    .operator-conversation-input .primary-action {
        min-height: 42px;
        min-width: 0;
        width: 100%;
    }

    .workbench-followup-input {
        align-items: stretch;
        grid-template-columns: 1fr;
    }

    .workbench-followup-input .primary-action {
        min-height: 42px;
        min-width: 0;
        width: 100%;
    }
}

/* ── External Reference Review Button ── */

.operator-ext-review-btn {
    margin-top: 0.5rem;
    width: 100%;
}

.operator-ext-review-btn:disabled {
    cursor: default;
    opacity: 0.6;
}
