/* AI report summary viewer (wwwroot/js/shared/ui/AiReportSummaryView.js). Staff only. */
/* The run count on the Drive row's AI summary button. */
.pad-pill.pad-pill-ai { padding: 0 6px; margin-left: 2px; color: #1f4f8f; background: #eef3fb; font-size: .72rem; vertical-align: 1px; }
.pad-ai-label { margin-left: 4px; font-size: .78rem; font-weight: 600; vertical-align: 1px; }
.ars-root { position: relative; color: #2c2c2a; }
.ars-state { text-align: center; padding: 48px 16px; }
.ars-intro ul { padding-left: 1.2rem; }
.ars-intro li { margin-bottom: 4px; }

.ars-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 12px; }
.ars-head-main { display: flex; flex-wrap: wrap; gap: 6px; }
.ars-meta { color: #5f5e5a; font-size: .9rem; }
.ars-history { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: .9rem; }
.ars-history select { width: auto; min-width: 220px; }

.ars-pill { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: .8rem; background: #f1efe8; color: #444441; border: 1px solid #e3e1da; }
.ars-pill-ai { background: #eef3fb; color: #1f4f8f; border-color: #cfdcf0; }
.ars-pill-ok { background: #e8f5e8; color: #0a6b0a; border-color: #bfe3bf; }
.ars-pill-draft { background: #fff6e0; color: #7a5500; border-color: #f3dc9e; }

.ars-card { border: 1px solid #e3e1da; border-radius: 10px; padding: 12px 14px; background: #fff; margin-bottom: 14px; }
.ars-summary p { line-height: 1.5; }
.ars-section { margin-bottom: 18px; }
.ars-h { font-size: .95rem; font-weight: 600; margin: 0 0 8px; }
.ars-sub { font-size: .85rem; color: #5f5e5a; margin: 6px 0 0; }
.ars-foot { font-size: .8rem; color: #5f5e5a; margin: 8px 0 0; }

.ars-flag { color: #a42a2a; font-size: .82rem; margin-top: 4px; }
.ars-flag-inline { color: #a42a2a; font-size: .78rem; white-space: nowrap; }

.ars-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.ars-tile { background: #f6f5f1; border-radius: 8px; padding: 8px 12px; }
.ars-tile b { display: block; font-size: 1.25rem; font-weight: 600; }
.ars-tile small { font-size: .75rem; font-weight: 400; color: #5f5e5a; }
.ars-tile span { font-size: .8rem; color: #5f5e5a; }

.ars-seg { display: flex; height: 26px; border-radius: 6px; overflow: hidden; gap: 2px; }
.ars-seg div { display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 600; cursor: default; }
.ars-leg { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: .8rem; color: #5f5e5a; }
.ars-leg i, .ars-chip i, .ars-finding-row i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }

.ars-figure-toggle { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; font-size: .9rem; }
.ars-body { display: block; max-width: 680px; margin: 0 auto; }
.ars-body .ars-o { cursor: pointer; outline: none; }
.ars-body .ars-o:focus-visible .ars-sel { stroke: #0b0b0b; stroke-width: 2.4; }
.ars-svg-name { font-size: 13px; font-weight: 600; fill: #2c2c2a; }
.ars-svg-status { font-size: 11px; fill: #5f5e5a; }

.ars-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 6px 0 12px; }
.ars-chip { display: inline-flex; align-items: center; border: 1px solid #e3e1da; background: #fff; border-radius: 999px; padding: 4px 12px; font-size: .85rem; color: #2c2c2a; }
.ars-chip.is-selected, .ars-finding-row.is-selected { border-color: #0b0b0b; box-shadow: 0 0 0 1px #0b0b0b inset; }

.ars-detail-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ars-swatch { width: 14px; height: 14px; border-radius: 3px; }
.ars-detail-name { font-weight: 600; }
.ars-detail-status { color: #5f5e5a; font-size: .9rem; }
.ars-finding { margin: 0 0 8px; }
.ars-quote-title { font-size: .8rem; color: #5f5e5a; margin: 6px 0 4px; }
.ars-q { border-left: 3px solid #b4b2a9; padding: 4px 10px; margin-bottom: 6px; background: #faf9f6; font-size: .9rem; }
.ars-q-bad { border-left-color: #d03b3b; }

.ars-findings { list-style: none; padding: 0; margin: 0; }
.ars-finding-row { display: block; width: 100%; text-align: left; border: 1px solid #e3e1da; background: #fff; border-radius: 8px; padding: 6px 10px; margin-bottom: 6px; font-size: .9rem; color: #2c2c2a; }
.ars-finding-row span { color: #5f5e5a; }

.ars-labs { display: flex; flex-direction: column; gap: 4px; }
.ars-lab-row { display: grid; grid-template-columns: minmax(110px, 1.2fr) 3fr minmax(110px, 1fr) minmax(90px, .9fr); align-items: center; gap: 8px; font-size: .85rem; }
.ars-lab-name { font-weight: 500; }
.ars-lab-track { position: relative; height: 14px; background: #f1efe8; border-radius: 3px; }
.ars-lab-one { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #2c2c2a; }
.ars-lab-bar { position: absolute; top: 2px; height: 10px; background: #d03b3b; border-radius: 2px; }
.ars-lab-value b { color: #a42a2a; }
.ars-lab-ref { color: #5f5e5a; font-size: .8rem; }
.ars-lab-axis .ars-lab-track { background: none; height: 18px; }
.ars-tick { position: absolute; top: 0; bottom: 0; border-left: 1px solid #d3d1c9; }
.ars-tick em { position: absolute; top: 2px; left: 3px; font-style: normal; font-size: .72rem; color: #77756d; white-space: nowrap; }
.ars-tick-one { border-left-color: #2c2c2a; }

.ars-plan-track { position: relative; height: 40px; margin: 6px 12px 10px; border-bottom: 2px solid #d3d1c9; }
.ars-plan-track .ars-tick { top: auto; height: 8px; bottom: -8px; }
.ars-plan-track .ars-tick em { top: 10px; left: -14px; }
.ars-plan-dot { position: absolute; bottom: -9px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: #1f4f8f; color: #fff; font-size: .65rem; display: flex; align-items: center; justify-content: center; cursor: default; }
.ars-plan { margin: 22px 0 0; padding-left: 1.2rem; font-size: .9rem; }
.ars-due { display: inline-block; min-width: 110px; color: #5f5e5a; margin-right: 6px; }

.ars-tip { position: absolute; display: none; z-index: 5; max-width: 240px; background: #2c2c2a; color: #fff; font-size: .8rem; padding: 6px 8px; border-radius: 6px; pointer-events: none; }

@media (max-width: 640px) {
    .ars-lab-row { grid-template-columns: 1fr 2fr; }
    .ars-lab-ref { grid-column: 1 / -1; }
    .ars-history { margin-left: 0; }
}

/* "Download PDF": a paper layout of the summary, printed alone (AiReportSummaryView._print). */
.ars-print-sheet { display: none; }
.ars-print-head { border-bottom: 2px solid #2c2c2a; padding-bottom: 8px; margin-bottom: 12px; }
.ars-print-head h1 { font-size: 16pt; font-weight: 600; margin: 0 0 6px; }
.ars-print-id { display: flex; flex-wrap: wrap; gap: 2px 24px; font-size: 10.5pt; }
.ars-print-id b { font-weight: 600; margin-right: 6px; }
.ars-print-area { margin-bottom: 8px; }
@media print {
    body.ars-printing > :not(.ars-print-sheet) { display: none !important; }
    body.ars-printing { overflow: visible !important; padding: 0 !important; margin: 0 !important; background: #fff !important; }
    body.ars-printing .ars-print-sheet { display: block; font-size: 10.5pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .ars-print-sheet svg.ars-body { display: block; width: 100%; max-height: 5.6in; }
    .ars-print-sheet .ars-card, .ars-print-sheet .ars-lab-row, .ars-print-sheet .ars-q { break-inside: avoid; }
    .ars-print-sheet .ars-h { break-after: avoid; }
}

/* ============================================================
   AI Assist panel (AiAssistPanel.js): patient, report, summary, chat
   ============================================================ */
.aia-modal { z-index: 1065; }
.aia-modal .modal-content { min-height: min(86vh, 900px); }
.aia-body { display: flex; flex-direction: column; gap: 14px; background: #fbfbfa; }
.aia-pickers { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 14px; }
.aia-step { background: #fff; border: 1px solid #e4e2dc; border-radius: 10px; padding: 12px 14px; min-width: 0; }
.aia-step.is-over { border-color: #1f4f8f; box-shadow: 0 0 0 3px rgba(31, 79, 143, .15); }
.aia-label { display: block; font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: #5f5e5a; margin-bottom: 6px; }
.aia-muted { color: #5f5e5a; font-size: .9rem; }

.aia-chip { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.aia-chip i { font-size: 1.3rem; }
.aia-chip-name { font-weight: 600; }
.aia-chip-meta { color: #5f5e5a; font-size: .88rem; }
.aia-change { padding: 0; margin-left: auto; }

.aia-search { position: relative; }
.aia-search .form-control { padding-left: 34px; }
.aia-search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #77756d; pointer-events: none; }
.aia-results { position: absolute; top: 100%; left: 0; right: 0; z-index: 10; margin-top: 4px; background: #fff; border: 1px solid #e4e2dc; border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .12); max-height: 320px; overflow-y: auto; }
.aia-results .autocomplete-item { padding: 9px 12px; cursor: pointer; border-bottom: 1px solid #efeee9; }
.aia-results .autocomplete-item:last-child { border-bottom: 0; }
.aia-results .autocomplete-item:hover, .aia-results .autocomplete-item.active { background: #eef3fb; }
.aia-result { display: flex; flex-direction: column; }
.aia-result-name { font-weight: 600; }
.aia-result-meta { font-size: .82rem; color: #5f5e5a; }

.aia-report-row { display: flex; gap: 8px; align-items: center; }
.aia-report-row .form-select { min-width: 0; flex: 1; }
.aia-report-row .btn { white-space: nowrap; }

.aia-summary:empty { display: none; }
.aia-summary { background: #fff; border: 1px solid #e4e2dc; border-radius: 10px; padding: 14px; }
.ars-mount-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.ars-mount-foot:empty { display: none; }

.aia-chat { display: flex; flex-direction: column; gap: 12px; }
.aia-empty { display: flex; align-items: center; gap: 10px; color: #77756d; padding: 18px; border: 1px dashed #d3d1c9; border-radius: 10px; justify-content: center; }
.aia-empty i { font-size: 1.3rem; }
.aia-turn { display: flex; flex-direction: column; gap: 6px; }
.aia-bubble { max-width: 82%; padding: 10px 14px; border-radius: 12px; font-size: .93rem; line-height: 1.45; overflow-wrap: anywhere; }
.aia-bubble p { margin: 0 0 6px; }
.aia-bubble p:last-child, .aia-bubble ul:last-child { margin-bottom: 0; }
.aia-bubble ul { margin: 0 0 6px; padding-left: 1.2rem; }
.aia-q-bubble { align-self: flex-end; background: #1f4f8f; color: #fff; border-bottom-right-radius: 4px; }
.aia-q-bubble p { color: #fff; }
.aia-a-bubble { align-self: flex-start; background: #fff; border: 1px solid #e4e2dc; border-bottom-left-radius: 4px; }
.aia-thinking { color: #5f5e5a; }
.aia-quotes { margin-top: 8px; }
.aia-quote-title { font-size: .76rem; font-weight: 600; color: #5f5e5a; margin: 0 0 4px; }
.aia-quote { border-left: 3px solid #1f4f8f; background: #f6f5f1; padding: 6px 10px; margin-bottom: 6px; font-size: .86rem; border-radius: 0 6px 6px 0; }
.aia-quote.is-bad { border-left-color: #a42a2a; }
.aia-general { margin-top: 8px; border-left: 3px solid #b4b2a9; background: #f4f6f9; padding: 6px 10px; border-radius: 0 6px 6px 0; font-size: .88rem; }
.aia-general-title { font-size: .76rem; font-weight: 600; color: #5f5e5a; margin: 0 0 4px; }
.aia-meta { margin-top: 6px; font-size: .75rem; color: #77756d; }
.aia-error { margin: 0; }

.aia-foot { display: flex; flex-direction: column; align-items: stretch; gap: 8px; background: #fff; }
.aia-foot > * { margin: 0; }
.aia-compose { display: flex; gap: 8px; align-items: flex-end; }
.aia-compose textarea { resize: vertical; min-height: 44px; max-height: 200px; }
.aia-compose .btn { height: 44px; }
.aia-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.aia-note { margin-left: auto; font-size: .78rem; color: #77756d; }

/* The "View summary" window: the same chat under the summary, question box fixed at the bottom (2026-11-20). */
.ars-chat-section { margin-top: 18px; padding-top: 14px; border-top: 1px solid #e4e2dc; }
.ars-foot .aia-note { margin-left: 0; flex: 1 1 220px; }
.ars-foot-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.ars-foot-buttons:empty { display: none; }

@media (max-width: 768px) {
    .aia-pickers { grid-template-columns: 1fr; }
    .aia-bubble { max-width: 100%; }
    .aia-note { margin-left: 0; }
    .aia-report-row { flex-wrap: wrap; }
}
