/* Scoped evidence workspace. Keep authentication, public pages and patient navigation intact. */
.case-detail-page {
  --evidence-blue: #126ac0;
  --evidence-green: #078e83;
  background: radial-gradient(ellipse at 94% 8%, #d9f0ee 0, transparent 44%), linear-gradient(145deg, #edf4fa, #f5f8fb 55%, #eaf4f4);
}
.case-detail-shell { width: min(1360px, calc(100% - 48px)); padding-top: 28px; }
.case-detail-hero { border-radius: 20px; box-shadow: none; border: 1px solid #d4e3eb; padding: 24px; }
.case-detail-hero .eyebrow { color: #167480; font-size: 11px; letter-spacing: .14em; }
.case-detail-brand h1 { font-size: clamp(22px, 2.2vw, 32px); font-weight: 650; letter-spacing: -.035em; overflow-wrap: anywhere; }
.case-detail-page .workspace-card { border-radius: 20px; border: 1px solid #d6e4ec; padding: 24px; box-shadow: 0 8px 32px #183e5610; min-width: 0; }
.case-detail-page .card-head h3 { font-size: 19px; font-weight: 650; letter-spacing: -.025em; }
.case-detail-stats { gap: 12px; }
.case-detail-stats .stat-card { padding: 16px 20px; border-radius: 16px; min-height: 0; box-shadow: none; }
.case-detail-stats .stat-card strong { font-size: 28px; font-weight: 600; }
.case-detail-stats .stat-card p { margin-bottom: 0; font-size: 12px; }
.case-detail-profile { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.case-detail-profile-card { border-radius: 12px; background: #f4f8fa; border-color: #e3edf1; }
.case-detail-profile-card label { font-weight: 500; }
.case-detail-profile-card strong { font-weight: 600; }
.case-detail-grid > .case-evidence-section { grid-row: 3; grid-column: 1 / -1; padding: 0; overflow: hidden; }
.case-detail-grid > .full-width { grid-column: 1 / -1; }
.case-detail-grid > .case-profile-section { grid-row: 1; }
.case-timeline-section > summary { cursor: pointer; margin: 0; }
.case-timeline-section > summary::after { content: "+"; margin-left: auto; color: #178487; font-size: 23px; font-weight: 400; }
.case-timeline-section[open] > summary::after { content: "−"; }
.case-timeline-section #caseTimelinePageBoard { margin-top: 20px; }
.case-evidence-section > .card-head { padding: 24px 24px 0; margin: 0; }
.case-modalities-section { grid-row: 2; }
.case-detail-page :is(.status-list, .timeline-list) > * { flex-shrink: 0; }
.case-detail-page #caseModalityBoard { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 12px; }
.case-modality-tile { position: relative; display: grid; grid-template-columns: 40px 1fr; align-items: center; gap: 12px; width: 100%; padding: 18px; border: 1px solid #c9e0e7; border-radius: 14px; background: linear-gradient(135deg, #edf6fe, #eefaf5); text-align: left; color: #183e56; cursor: pointer; }
.case-modality-tile > strong { padding-right: 12px; font-size: 16px; font-weight: 650; }
.case-modality-arrow { position: absolute; right: 12px; top: 14px; color: #187785; }
.evidence-modality-icon { width: 40px; height: 40px; padding: 9px; background: #ffffffbd; color: #157c9d; border-radius: 12px; border: 1px solid #d1e8ec; }
.evidence-modality-icon svg { width: 100%; height: 100%; }
.case-modality-stages { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; font-size: 11px; color: #617a86; }
.case-modality-stages > span { display: flex; align-items: center; gap: 5px; }
.case-modality-stages .mini-tone { min-height: 0; padding: 4px 8px; font-size: 11px; white-space: normal; }
.case-modality-tile:hover { border-color: #5db7bb; box-shadow: 0 6px 18px #126a8820; }
.case-modality-tile:only-child { grid-column: 1 / -1; }
.case-evidence-console { scroll-margin-top: 24px; }
.evidence-console-intro { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 8px 24px 20px; }
.evidence-console-intro p { margin: 0; color: #64808e; font-size: 13px; line-height: 1.6; }
.evidence-count { display: flex; gap: 10px; align-items: center; flex-shrink: 0; font-size: 12px; color: #537384; }
.evidence-count strong { display: grid; place-items: center; width: 30px; height: 30px; background: #eaf4f8; border-radius: 9px; color: #16768a; }
.evidence-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; padding: 0 24px 20px; }
.evidence-tab { position: relative; display: flex; align-items: center; gap: 10px; min-height: 60px; min-width: 0; padding: 12px; border-radius: 12px; border: 1px solid #d9e6ed; background: #f3f7fa; color: #45687b; cursor: pointer; text-align: left; font-size: 14px; font-weight: 600; transition: background .2s, box-shadow .2s; }
.evidence-tab svg { width: 24px; height: 24px; flex-shrink: 0; }
.evidence-tab span { overflow-wrap: anywhere; }
.evidence-tab small { margin-left: auto; font-size: 11px; font-weight: 500; opacity: .8; }
.evidence-tab:hover { border-color: #58a8b9; }
.evidence-tab.is-active { border-color: transparent; color: #fff; background: linear-gradient(120deg, #126eaf, #07867c); box-shadow: 0 6px 16px #087e862b; }
.evidence-result { border-top: 1px solid #dce8ee; }
.evidence-result-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px; background: #f9fcfd; }
.evidence-kicker { font-size: 11px; letter-spacing: .08em; color: #127e83; font-weight: 650; }
.evidence-result-head h4 { font-size: clamp(19px, 2vw, 24px); color: #183d54; margin: 6px 0 0; font-weight: 600; letter-spacing: -.03em; overflow-wrap: anywhere; }
.evidence-result-head time { color: #66808d; font-size: 12px; }
.evidence-history-select { display: grid; gap: 6px; color: #617c8a; font-size: 11px; min-width: 0; max-width: 100%; }
.evidence-history-select select { width: 100%; max-width: 280px; min-width: 0; min-height: 42px; padding: 8px 28px 8px 12px; border: 1px solid #cfdee6; border-radius: 9px; color: #20465a; background: #fff; font-size: 13px; }
.evidence-result-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, 1fr); gap: 0; }
.evidence-visual { min-width: 0; padding: 24px; color: #d8f0f7; border-right: 1px solid #dce8ee; background: radial-gradient(ellipse at 85% 20%, #12556288, transparent 65%), linear-gradient(#ffffff05 1px, transparent 1px), linear-gradient(90deg, #ffffff05 1px, transparent 1px), #0d2839; background-size: auto, 28px 28px, 28px 28px, auto; }
.evidence-result-info { min-width: 0; padding: 28px; background: linear-gradient(140deg, #fff, #f2f9f8); }
.evidence-score > span { color: #527789; font-size: 13px; }
.evidence-score > strong { display: block; margin: 14px 0; color: #17576b; font-size: 48px; letter-spacing: -.055em; font-weight: 550; line-height: 1.1; }
.evidence-score > strong.evidence-text-value { font-size: 23px; line-height: 1.45; letter-spacing: -.025em; }
.evidence-score-track { height: 7px; border-radius: 6px; overflow: hidden; background: #dcecf0; }
.evidence-score-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #1984bd, #27b795); }
.evidence-technical-note { display: inline-block; font-size: 12px; line-height: 1.6; color: #316d76; background: #e5f4f1; padding: 8px 12px; border-radius: 8px; }
.evidence-provenance { display: grid; gap: 16px; margin: 20px 0; }
.evidence-provenance > div { display: grid; gap: 5px; border-top: 1px solid #ddebed; padding-top: 14px; }
.evidence-provenance dt { font-size: 11px; color: #6e8995; }
.evidence-provenance dd { margin: 0; color: #285468; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.evidence-research-note { font-size: 12px; line-height: 1.7; color: #607c89; margin: 0; }
.evidence-class-probabilities { display: grid; gap: 8px; padding-top: 18px; }
.evidence-class-probabilities > div { display: flex; justify-content: space-between; font-size: 13px; color: #356a7b; }
.evidence-visual .case-face-preview { padding: 0; border: 0; background: none; box-shadow: none; }
.evidence-visual .case-face-preview-head { margin-bottom: 18px; color: #9ec9d7; font-size: 12px; display: flex; justify-content: space-between; gap: 12px; }
.evidence-visual .face-preview-toolbar { justify-content: center; margin: 0 0 18px; gap: 8px; }
.evidence-visual .ghost-btn { color: #c8e6ef !important; background: #173c4e !important; border: 1px solid #356378; box-shadow: none; min-height: 40px; padding: 8px 14px; font-size: 12px; white-space: normal; line-height: 1.45; }
.evidence-visual .ghost-btn.is-active { color: #c9ffee !important; background: #14665e !important; border-color: #3eaa96; }
.evidence-visual .ghost-btn::after { display: none; }
.evidence-visual .face-preview-frame { width: min(100%, calc(320px * var(--face-aspect, 1))); height: auto; min-height: 0; aspect-ratio: var(--face-aspect, 1); border: 0; border-radius: 10px; margin: auto; padding: 0; background: #081b28; }
.evidence-visual .face-preview-frame img { width: 100%; height: auto; object-fit: contain; display: block; }
.evidence-visual .face-preview-frame.has-overlay::after { display: none; }
.evidence-visual .face-overlay-box { border-radius: 4px; }
.evidence-visual .face-overlay-box span { font-size: 10px; top: 0; left: 0; padding: 4px; }
.evidence-visual .face-debug-panel { background: #143749; color: #a9cedb; border-color: #285365; margin-top: 18px; padding: 12px; border-radius: 10px; }
.evidence-visual .face-debug-panel summary { font-size: 12px; color: #a9cedb; }
.evidence-visual .face-debug-grid { grid-template-columns: 1fr; }
.evidence-visual .metric-row { color: #b4d2db; border-color: #285365; font-size: 11px; flex-wrap: wrap; overflow-wrap: anywhere; gap: 8px; }
.evidence-placeholder { min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; padding: 24px 8px; color: #b9dbe4; }
.evidence-placeholder strong { font-size: 14px; font-weight: 500; line-height: 1.6; }
.evidence-placeholder p { margin: 0; color: #9abbc9; font-size: 12px; line-height: 1.7; }
.evidence-reticle { width: 48px; height: 48px; border: 1px solid #57bbb78c; border-radius: 14px; box-shadow: inset 0 0 22px #4cd4c113, 0 0 20px #4cd4c118; position: relative; }
.evidence-reticle::before, .evidence-reticle::after { content: ""; position: absolute; background: #72c6c2; inset: 50% 12px auto; height: 1px; }
.evidence-reticle::after { transform: rotate(90deg); }
.is-loading .evidence-reticle { animation: evidence-pulse 1.6s ease-in-out infinite; }
.evidence-visual-heading { display: flex; align-items: center; gap: 10px; color: #c2e4ed; }
.evidence-visual-heading svg { width: 23px; height: 23px; flex-shrink: 0; color: #55c1bd; }
.evidence-visual-heading h4 { font-size: 14px; font-weight: 550; margin: 0; }
.evidence-mri-slices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 22px; }
.evidence-mri-slices figure { margin: 0; min-width: 0; }
.evidence-mri-slices img { width: 100%; aspect-ratio: 1; object-fit: contain; display: block; background: #061721; border-radius: 8px; border: 1px solid #2b5364; }
.evidence-mri-slices figcaption { color: #9dbfcd; font-size: 10px; text-align: center; padding: 10px 0; }
.evidence-mri-panel > p, .evidence-feature-panel > p { color: #92b9c9; font-size: 12px; line-height: 1.7; margin: 16px 0; }
.evidence-feature-labels, .evidence-feature-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.evidence-feature-labels { font-size: 10px; color: #8caebe; padding: 8px 0; }
.evidence-feature-row { padding: 12px 0; border-top: 1px solid #2b4f61; font-size: 12px; }
.evidence-feature-row strong { font-weight: 500; overflow-wrap: anywhere; }
.evidence-feature-row > span { color: #86deca; font-variant-numeric: tabular-nums; }
.case-detail-page .evidence-visual :is(h4, .evidence-feature-row strong, .evidence-placeholder strong) { color: #d8f0f7 !important; }
.case-detail-page .evidence-visual :is(.evidence-mri-panel > p, .evidence-feature-panel > p, .evidence-feature-labels) { color: #acd0dc !important; }
.evidence-beta-track { grid-column: 1 / -1; height: 3px; background: #1f4556; border-radius: 2px; }
.evidence-beta-track i { display: block; height: 100%; background: linear-gradient(90deg, #409dc5, #5cd5b9); }
.evidence-task-history { border-top: 1px solid #dce8ee; padding: 0 24px; background: #f7fafc; }
.evidence-task-history summary { cursor: pointer; padding: 18px 0; font-size: 13px; color: #466879; }
.evidence-task-history summary span { margin-left: 10px; color: #168186; }
.evidence-task-list { max-height: 400px; overflow: auto; padding-bottom: 14px; }
.evidence-task-row { display: grid; grid-template-columns: 100px 100px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 0; border-top: 1px solid #e0e9ee; font-size: 12px; color: #6a8492; }
.evidence-task-row > strong { color: #345568; font-weight: 600; }
.evidence-task-row .mini-tone { font-size: 11px; padding: 6px 10px; white-space: normal; }
.evidence-no-result { display: grid; place-items: center; padding: 45px 24px; text-align: center; background: linear-gradient(135deg, #edf5fb, #f0faf6); border-top: 1px solid #d7e8ee; }
.evidence-no-result svg { width: 42px; height: 42px; color: #438da4; }
.evidence-no-result h4 { margin: 16px 0 8px; color: #31576c; font-size: 18px; font-weight: 550; }
.evidence-no-result p { color: #66818e; font-size: 13px; line-height: 1.7; margin: 0; }
.case-evidence-console :is(button, select, summary):focus-visible, .case-modality-tile:focus-visible { outline: 3px solid #28a89d; outline-offset: 3px; }
body[data-role-mode="doctor"] :is(#jobList, #resultHistoryList, #reportList) > .status-item { flex-shrink: 0; }
body[data-role-mode="doctor"] :is(.emr-modality-row, .upload-modality-card) { border-color: #cee2e9; background: linear-gradient(135deg, #f0f7fe, #f0faf5); border-radius: 16px; box-shadow: 0 8px 20px #173e5910; }
body[data-role-mode="doctor"] .modality-token { background: #0e7288; color: #fff; border-radius: 8px; padding: 7px 12px; letter-spacing: .06em; }
body[data-role-mode="doctor"] .upload-modality-title { color: #1c576c; font-weight: 600; }
body[data-role-mode="doctor"] :is(.modality-thumb-mri, .medical-viewer-stage) { background: radial-gradient(ellipse at top right, #145164, #0c2435 70%); border-color: #345c6b; }
body[data-role-mode="doctor"] .modality-thumb-mri :is(.modality-chart-meta strong, .modality-chart-meta span, .evidence-empty) { color: #b7d9e4; }
.case-evidence-dock { margin: 18px 0; }
.case-evidence-dock[hidden] { display: none; }
.case-evidence-dock-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 12px; }
.case-evidence-dock-head strong { font-size: 16px; font-weight: 650; color: #28576b; }
.case-evidence-dock-head > span { font-size: 12px; color: #67818f; overflow-wrap: anywhere; }
.case-evidence-dock-links { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.case-evidence-link { display: grid; gap: 10px; min-width: 0; padding: 18px; border: 1px solid #c3dde5; border-radius: 14px; text-decoration: none; background: radial-gradient(ellipse at top right, #c3ede36b, transparent 70%), linear-gradient(135deg, #eff6fe, #f6fbfa); color: #24596f; transition: border-color .2s, box-shadow .2s; }
.case-evidence-link > span:first-child { font-size: 10px; letter-spacing: .12em; color: #147989; font-weight: 650; }
.case-evidence-link strong { font-size: 15px; overflow-wrap: anywhere; font-weight: 650; }
.case-evidence-link .mini-tone { justify-self: start; font-size: 10px; min-height: 0; padding: 4px 8px; white-space: normal; }
.case-evidence-link:hover, .case-evidence-link:focus-visible { border-color: #269997; box-shadow: 0 6px 20px #0f718c1f; outline-offset: 3px; }
@keyframes evidence-pulse { 50% { opacity: .45; box-shadow: 0 0 28px #4cd4c133; } }
.evidence-outcome { margin: 0 24px 24px; padding: 22px; border: 1px solid #cbdfe7; border-left: 3px solid #208aa3; border-radius: 14px; background: linear-gradient(120deg, #f0f7fd, #f1faf6); color: #234d63; overflow-wrap: anywhere; }
.evidence-outcome.tone-error { border-left-color: #c47b30; background: linear-gradient(120deg, #fcf6ed, #f8fafb); }
.evidence-outcome.tone-success { border-left-color: #168d7a; }
.evidence-outcome-heading { display: flex; gap: 14px; align-items: center; }
.evidence-outcome-heading .evidence-modality-icon { flex: 0 0 40px; }
.case-detail-page .evidence-outcome h4 { margin: 4px 0 0; font-size: 19px; font-weight: 600; line-height: 1.5; color: #234d63; }
.evidence-outcome > p, .evidence-outcome-reason p { margin: 12px 0 0; font-size: 13px; line-height: 1.8; color: #56717f; }
.evidence-outcome-reason { margin-top: 16px; padding: 14px; border: 1px solid #e1d6c8; border-radius: 10px; background: #ffffffba; }
.evidence-outcome-reason strong { font-size: 12px; color: #926024; }
.evidence-outcome-reason p { white-space: pre-wrap; max-height: 220px; overflow: auto; }
.evidence-outcome-reason button { margin-top: 12px; }
.evidence-outcome > .evidence-outcome-history { color: #8c5a23; background: #fff4dd; border-radius: 8px; padding: 10px 14px; }
.evidence-outcome-input { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 16px 0 0; font-size: 12px; }
.evidence-outcome-input dt { color: #647f8d; }
.evidence-outcome-input dd { margin: 0; font-weight: 600; color: #267389; }
.evidence-outcome-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 18px; }
.evidence-outcome-actions > span { font-size: 12px; color: #5b7685; }
.evidence-outcome-actions :is(a, button) { white-space: normal; text-align: center; line-height: 1.5; min-height: 44px; height: auto; max-width: 100%; padding: 10px 18px; border-radius: 10px; text-decoration: none; }
.evidence-outcome a:focus-visible { outline: 3px solid #28a89d; outline-offset: 3px; }
@media (max-width: 540px) {
  .evidence-outcome { margin: 0 14px 16px; padding: 16px; }
  .evidence-outcome-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .evidence-outcome-actions > span { grid-column: 1 / -1; }
  .evidence-outcome-actions :is(a, button) { width: 100%; min-width: 0; font-size: 12px; padding: 10px; }
}
@media (max-width: 900px) {
  .case-detail-shell { width: calc(100% - 24px); }
  .evidence-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .evidence-result-grid { grid-template-columns: minmax(0, 1fr); }
  .evidence-visual { border-right: 0; }
  .case-detail-page #caseModalityBoard { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-evidence-dock-links { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .evidence-task-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .evidence-result-info { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
  .evidence-score, .evidence-technical-note, .evidence-class-probabilities { grid-column: 1; }
  .evidence-provenance { grid-column: 2; grid-row: 1 / 4; margin: 0 0 16px; }
  .evidence-research-note { grid-column: 1 / -1; }
}
@media (max-width: 540px) {
  .case-detail-shell { padding-top: 12px; }
  .case-detail-hero { padding: 18px; }
  .case-detail-brand { align-items: flex-start; }
  .case-detail-brand .brand-logo-mark { width: 40px; height: 40px; }
  .case-detail-actions { justify-content: stretch; }
  .case-detail-actions .locale-switcher { width: 100%; }
  .case-detail-actions :is(a, button) { flex: 1; font-size: 12px; min-width: 0; white-space: normal; padding: 10px; }
  .case-detail-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .case-detail-stats .stat-card { padding: 14px; }
  .case-detail-stats .stat-card strong { font-size: 25px; }
  .case-detail-stats .stat-card p { display: none; }
  .case-detail-page .workspace-card { padding: 16px; border-radius: 16px; }
  .case-detail-profile { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .case-detail-profile-card { padding: 12px; }
  .case-detail-profile-card strong { font-size: 13px; }
  .case-detail-profile-card label { font-size: 11px; }
  .case-detail-grid > .case-evidence-section { padding: 0; }
  .case-evidence-section > .card-head { padding: 20px 16px 0; }
  .case-modality-tile { grid-template-columns: 1fr; padding: 12px; gap: 8px; }
  .case-modality-tile > strong { font-size: 13px; }
  .case-modality-stages { display: grid; gap: 6px; }
  .evidence-console-intro { padding: 8px 16px 16px; }
  .evidence-console-intro p { font-size: 12px; }
  .evidence-count { display: none; }
  .evidence-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 16px 16px; gap: 6px; }
  .evidence-tab { min-height: 54px; padding: 10px; gap: 8px; font-size: 12px; }
  .evidence-tab svg { width: 20px; height: 20px; }
  .evidence-result-head { padding: 18px 16px; align-items: flex-start; flex-direction: column; gap: 10px; }
  .evidence-history-select { width: 100%; }
  .evidence-history-select select { max-width: none; }
  .evidence-visual { padding: 18px 16px; }
  .evidence-result-info { padding: 22px 16px; display: block; }
  .evidence-score > strong { font-size: 40px; }
  .evidence-score > strong.evidence-text-value { font-size: 20px; }
  .evidence-provenance { margin: 18px 0; gap: 10px; }
  .evidence-provenance > div { padding-top: 10px; }
  .evidence-placeholder { min-height: 220px; }
  .evidence-task-history { padding: 0 16px; }
  .evidence-mri-slices { gap: 5px; }
  .evidence-mri-slices figcaption { font-size: 9px; line-height: 1.6; }
  .case-evidence-dock-links { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .case-evidence-link { padding: 14px; }
  .case-evidence-dock-head { align-items: flex-start; flex-direction: column; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .evidence-reticle { animation: none !important; }
  .evidence-tab, .case-evidence-link { transition: none; }
}
