:root {
  --clinical: #92d8cb;
  --clinical-muted: #b6c9c6;
  --imaging: #a9c4fa;
}
.topbar { gap: 17px; }
.workspace-nav { display: flex; align-self: stretch; align-items: stretch; gap: 2px; }
.workspace-nav button { display: flex; align-items: center; position: relative; gap: 7px; padding: 0 11px; font-size: 13px; font-weight: 600; white-space: nowrap; color: var(--muted); }
.workspace-nav button:hover { background: #1c1b26; color: var(--text); }
.workspace-nav button[aria-current] { color: var(--accent); }
.workspace-nav button[aria-current]::after { content: ""; position: absolute; height: 2px; background: var(--accent-strong); inset: auto 9px 0; border-radius: 2px 2px 0 0; }
.workspace-nav svg { width: 16px; height: 16px; }
.export-trigger { color: #d9cff4; }
.atlas-stats { align-items: center; }
.intro-clinical, .secondary-action { display: flex; flex-shrink: 0; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 7px 11px; color: #e4d8ff; background: #292139; border: 1px solid #514066; border-radius: 8px; font-size: 12px; font-weight: 625; white-space: nowrap; }
.intro-clinical { margin-left: 15px; }
.intro-clinical span { margin: 0; font-size: inherit; color: inherit; }
.intro-clinical svg, .secondary-action svg { width: 15px; height: 15px; }
.intro-clinical:hover, .secondary-action:hover { background: #372b4a; border-color: #765d94; }
.entity-clinical { display: grid; grid-template-columns: 16px 1fr 13px; align-items: center; width: 100%; gap: 8px; margin-bottom: 7px; padding: 5px 8px; border: 1px solid #354841; color: #b0e6d9; background: #1c2928; border-radius: 7px; text-align: left; font-size: 11px; }
.entity-clinical:hover { background: #293e39; }
.entity-clinical svg { width: 14px; height: 14px; }
.slice-panel { position: absolute; z-index: 2; top: 56px; right: 14px; width: min(220px, calc(100% - 28px)); padding: 9px 10px; border-radius: 9px; background: #1f1a2cef; border: 1px solid #554462; box-shadow: 0 8px 24px #07061080; color: #ddd3eb; }
.slice-panel div, .slice-panel label { display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.slice-panel strong, .slice-panel label, .slice-position { font-size: 11px; }
.slice-position { font-variant-numeric: tabular-nums; color: var(--accent); }
.slice-panel label { margin-top: 7px; }
.slice-panel select { min-width: 0; width: 124px; border: 1px solid #4b3a5a; color: #e3daea; background: #2b2339; border-radius: 5px; font-size: 11px; padding: 3px; }
.slice-panel input { display: block; width: 100%; margin: 8px 0 3px; accent-color: var(--accent); }
.clinical-workspace { padding-bottom: 22px; }
.clinical-intro { align-items: end; }
#clinical-workspace .section-label { color: var(--clinical); }
#imaging-workspace .section-label { color: var(--imaging); }
.case-layout, .imaging-layout { display: grid; grid-template-columns: clamp(186px, 19vw, 274px) minmax(0, 1fr) clamp(225px, 23vw, 330px); gap: 14px; align-items: start; }
.case-sidebar, .imaging-sidebar { min-width: 0; overflow: hidden; }
.clinical-panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 14px 13px 11px; }
.clinical-panel-heading h2 { font-size: 14px; font-weight: 680; }
.count { color: var(--quiet); font-size: 11px; font-variant-numeric: tabular-nums; }
.catalog-input { display: flex; align-items: center; gap: 6px; margin: 0 10px 9px; min-height: 37px; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; background: #1c1b27; color: var(--muted); }
.catalog-input:focus-within { border-color: #72618c; }
.catalog-input svg { width: 15px; height: 15px; }
.catalog-input input { min-width: 0; width: 100%; border: 0; padding: 4px 0; background: transparent; color: var(--text); font-size: 12px; outline: none; }
.catalog-select { display: grid; gap: 6px; margin: 0 10px 10px; color: var(--muted); font-size: 11px; }
.catalog-select select { min-width: 0; width: 100%; padding: 7px; color: #e8e2f0; border: 1px solid var(--line); background: #1c1b27; border-radius: 8px; font-size: 12px; }
.case-list { display: grid; align-content: start; gap: 4px; overflow: hidden auto; max-height: min(560px, 58dvh); padding: 0 8px 8px; scrollbar-color: #4a425c transparent; scrollbar-width: thin; }
.case-list-item { display: grid; width: 100%; gap: 3px; padding: 8px 10px; text-align: left; color: #e3dfed; border: 1px solid transparent; border-radius: 8px; overflow-wrap: anywhere; }
.case-list-item:hover { background: #211f2c; }
.case-list-item[aria-current] { color: #f3f0fb; background: #282235; border-color: #58446c; }
.case-list-item strong { font-size: 12px; font-weight: 650; }
.case-list-item small { color: var(--muted); font-size: 10px; }
.case-list-empty { padding: 8px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.case-content { min-height: 555px; overflow: hidden; }
.case-title-block { padding: clamp(15px, 2vw, 27px); border-bottom: 1px solid #2d2c36; background: radial-gradient(ellipse at 90% 0%, #23343a 0, transparent 75%), #181923; }
.case-title-block .mode-chip { margin-bottom: 10px; }
.mode-chip { display: inline-flex; align-items: center; gap: 5px; width: max-content; max-width: 100%; padding: 5px 7px; border: 1px solid #395049; border-radius: 6px; color: #b3e4da; background: #20322ef0; font-size: 11px; font-weight: 600; }
.mode-chip svg { width: 13px; height: 13px; }
.case-title-block h2 { font-size: clamp(23px, 3vw, 39px); letter-spacing: -.047em; line-height: 1.1; overflow-wrap: anywhere; }
.case-title-block p { color: #b7c8cb; font-size: 13px; margin-top: 8px; line-height: 1.45; }
.case-tabs, .modality-tabs { display: flex; overflow: auto; align-items: stretch; gap: 4px; padding: 0 12px; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.case-tabs button { padding: 10px 8px; white-space: nowrap; color: var(--muted); border-bottom: 2px solid transparent; font-size: 12px; }
.case-tabs button[aria-pressed="true"] { color: var(--clinical); border-bottom-color: var(--clinical); }
.case-tabs button:hover { color: var(--text); }
.case-body { padding: clamp(13px, 2vw, 25px); }
.case-section + .case-section { margin-top: 17px; }
.case-section h3 { font-size: 14px; letter-spacing: -.01em; margin: 0 0 7px; }
.case-section p, .case-section li, .case-context p, .test-card dd, .flow-step p { color: #c2becf; font-size: 13px; line-height: 1.54; }
.case-section ul { margin: 0; padding-left: 17px; }
.case-section li { margin: 3px 0; }
.case-reading { display: block; margin-top: 15px; padding: 10px 12px; border-radius: 8px; border: 1px solid #3a4d49; background: #1b2828; color: #c1e4dc; font-size: 13px; }
.case-reading summary { cursor: pointer; font-weight: 620; }
.case-reading p { margin: 8px 0 0; font-size: 13px; line-height: 1.5; color: #caddd9; }
.case-context { padding: 14px; display: grid; gap: 15px; }
.context-section { min-width: 0; }
.context-section h2, .context-section h3 { margin: 0 0 8px; font-size: 14px; }
.context-section ul { display: grid; gap: 6px; list-style: none; padding: 0; margin: 0; }
.context-link { display: flex; align-items: center; gap: 7px; width: 100%; padding: 7px 8px; text-align: left; border: 1px solid #393448; border-radius: 7px; background: #1d1b29; color: #ded0f4; font-size: 11px; line-height: 1.35; }
.context-link:hover, .context-link[data-active="true"] { background: #322842; border-color: #735f91; }
.context-link svg { width: 13px; height: 13px; margin-left: auto; }
.context-section a { color: #c8b8ea; text-decoration-thickness: 1px; text-underline-offset: 3px; font-size: 11px; overflow-wrap: anywhere; }
.context-section p { font-size: 12px; }
.method-guide { border-top: 1px solid var(--line); padding-top: 10px; }
.method-guide summary { cursor: pointer; color: var(--imaging); font-size: 12px; font-weight: 650; overflow-wrap: anywhere; }
.method-guide > p { margin: 8px 0; }
.method-guide .case-section { margin-top: 9px; }
.method-guide .case-section h3 { font-size: 12px; margin-bottom: 4px; }
.method-guide .case-section p, .method-guide li, .method-guide a { font-size: 11.5px; }
.method-guide a { display: block; margin-top: 5px; }
.test-grid { display: grid; gap: 9px; margin-top: 10px; }
.test-card { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #1b1b26; }
.test-card h3 { margin-top: 6px; font-size: 14px; }
.test-card dl { margin: 8px 0 0; display: grid; grid-template-columns: minmax(60px, 118px) 1fr; gap: 4px 8px; }
.test-card dt { color: #e1d8ed; font-size: 11px; margin-top: 2px; }
.test-card dd { margin: 0; }
.flow-list { margin: 0; padding: 0; list-style: none; counter-reset: stage; }
.flow-step { counter-increment: stage; position: relative; padding: 2px 0 15px 38px; min-height: 53px; }
.flow-step::before { content: counter(stage); position: absolute; top: 1px; left: 0; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; color: #d3f0e8; background: #253c38; border: 1px solid #42665b; font-size: 11px; z-index: 1; }
.flow-step:not(:last-child)::after { content: ""; position: absolute; top: 13px; bottom: -13px; left: 12px; width: 1px; background: #3d514e; }
.flow-step h3 { color: #e6efec; font-size: 14px; margin-bottom: 4px; }
.clinical-notice { margin-top: 11px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.modality-tabs { border: 0; padding: 0; margin-bottom: 12px; }
.modality-tabs button, .small-action { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 7px 9px; border: 1px solid #363348; border-radius: 7px; color: var(--muted); background: #1b1a25; font-size: 12px; white-space: nowrap; }
.modality-tabs button:hover, .modality-tabs button[aria-pressed="true"], .small-action:hover, .small-action[aria-pressed="true"] { color: #dbd0f6; background: #2c233d; border-color: #584669; }
.small-action svg { width: 13px; height: 13px; }
.image-entry { grid-template-columns: 38px minmax(0, 1fr); align-items: center; gap: 7px; padding: 6px; }
.image-entry > span { display: grid; gap: 4px; }
.scan-thumb { width: 38px; height: 38px; object-fit: cover; border-radius: 5px; background: #0a0a0e; border: 1px solid var(--line); }
.scan-panel { min-height: 500px; display: flex; flex-direction: column; overflow: hidden; background: #101117; }
.scan-top, .scan-bottom { min-height: 45px; background: #191a24; display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 6px 11px; }
.scan-top { border-bottom: 1px solid var(--line); }
.scan-bottom { border-top: 1px solid var(--line); }
.scan-top .mode-chip { color: #c8d9f7; border-color: #435675; background: #243044; }
.scan-controls { display: flex; align-items: center; gap: 2px; color: #c3bdcf; }
.scan-controls .icon-btn { width: 29px; height: 29px; }
.scan-controls output { min-width: 40px; text-align: center; font-size: 11px; font-variant-numeric: tabular-nums; }
.scan-controls svg { width: 15px; height: 15px; }
.scan-stage { display: flex; min-height: 410px; height: min(53dvh, 560px); padding: 12px; overflow: auto; scrollbar-width: thin; background: radial-gradient(#161923, #0e0e14 76%); }
.scan-stage figure { margin: auto; position: relative; display: inline-flex; flex: none; max-width: none; }
.scan-stage img { display: block; width: 100%; height: auto; max-width: none; border-radius: 3px; }
#scan-markers { position: absolute; inset: 0; pointer-events: none; }
.scan-pin { position: absolute; transform: translate(-50%, -50%); width: 21px; height: 21px; padding: 0; display: grid; place-items: center; color: #e8fbff; background: #1d5069; border: 1px solid #a4e7f0; border-radius: 50%; font-size: 10px; font-weight: 700; cursor: pointer; pointer-events: auto; box-shadow: 0 0 0 3px #0a1017b0; }
.scan-pin[data-active="true"] { color: #0d2636; background: #b4f4fa; }
.scan-range { display: flex; align-items: center; color: var(--muted); font-size: 11px; gap: 8px; }
.scan-range input { accent-color: var(--imaging); width: clamp(66px, 9vw, 135px); }
.export-body { display: grid; gap: 9px; padding: 15px; }
.export-body .catalog-select { margin: 0; }
.export-note { font-size: 12px; color: var(--muted); line-height: 1.45; min-height: 34px; }
.export-download { max-width: 240px; }
.print-report { display: none; }
@media print {
  body > * { display: none !important; }
  body > .print-report:not([hidden]) { display: block !important; background: white; color: #171921; }
  .print-report { padding: 0 10mm; font: 10.5pt/1.45 system-ui, sans-serif; }
  .print-report h1 { font-size: 23pt; }
  .print-report h2 { font-size: 16pt; margin-top: 13pt; }
  .print-report h3 { font-size: 12pt; margin-top: 10pt; }
  .print-report img { display: block; max-width: min(100%, 145mm); max-height: 145mm; object-fit: contain; }
  .print-report a { color: #213d79; overflow-wrap: anywhere; }
  .print-report .report-item { break-inside: avoid; }
}
@media (max-width: 1130px) {
  .top-actions { gap: 7px; }
  .top-search { width: 36px; padding: 0; justify-content: center; }
  .top-search > span:not([data-icon]), .top-search kbd { display: none; }
  .top-plain:not(.export-trigger) .action-text { display: none; }
}
@media (max-width: 925px) {
  .intro-clinical { display: none; }
  .case-layout, .imaging-layout { grid-template-columns: 175px minmax(0, 1fr); gap: 10px; }
  .case-context { grid-column: 1 / -1; }
  .imaging-layout > .case-context { grid-column: 2; }
  .case-content { min-height: 0; }
}
@media (max-width: 680px) {
  .topbar { height: auto; min-height: 56px; gap: 0 7px; flex-wrap: wrap; }
  .topbar .brand, .top-actions { height: 52px; }
  .topbar .top-divider { display: none; }
  .workspace-nav { order: 3; width: 100%; min-height: 36px; }
  .workspace-nav button { justify-content: center; flex: 1; }
  .top-plain .action-text { display: none; }
  .top-plain, .top-search { width: 34px; padding: 0; justify-content: center; }
  .clinical-intro { align-items: start; }
  .clinical-intro .secondary-action { font-size: 0; min-width: 36px; padding-inline: 8px; }
  .clinical-intro .secondary-action svg { width: 18px; height: 18px; }
  .case-layout, .imaging-layout { display: flex; flex-direction: column; gap: 10px; }
  .case-layout > *, .imaging-layout > * { width: 100%; }
  .case-list { max-height: 205px; }
  .case-content { min-height: 0; }
  .scan-stage { min-height: 340px; }
  .scan-panel { min-height: 420px; }
}
