.check-progress { position:relative; isolation:isolate; overflow:hidden; display:flex; flex-direction:column; align-items:flex-start; justify-content:center; min-height:422px; padding:42px 50px; border:1px solid #293944; border-radius:6px; background:#111820; color:#eaf3f6; }
.check-progress.hidden { display:none; }
#app-shell.app-shell:has(#view-check.active-view) #result-panel { animation:none; }
.app-shell:has(#view-check.active-view) #check-progress { grid-column:2; grid-row:2; }
.app-shell:has(#view-check.is-checking) .clinical-outcome-empty { display:none; }
.check-progress h2 { margin:20px 0 10px; font-size:27px; letter-spacing:-.7px; }
.check-progress p { margin:0; max-width:40ch; color:#91a6b0; line-height:1.7; font-size:13px; }
.check-progress-scan { position:absolute; z-index:-1; top:0; left:0; width:100%; height:80px; border-bottom:1px solid #00b8d4; background:linear-gradient(transparent,rgba(0,184,212,.09)); animation:prescription-scan 1.8s ease-in-out infinite; }
.check-progress-indicator { width:26px; height:26px; border:2px solid #293944; border-top-color:#00b8d4; border-radius:50%; animation:prescription-turn 1s linear infinite; }
.app-shell:has(#view-check.active-view) #result-panel.result-arriving .minimal-ddi-card.is-primary { --result-accent:#91a6b0; position:relative; border-left:3px solid var(--result-accent); animation:prescription-result-reveal .55s ease-out, prescription-result-highlight 1.8s ease-out; }
.app-shell:has(#view-check.active-view) #result-panel.result-arriving .minimal-ddi-card.is-primary:after { content:""; position:absolute; top:0; left:0; width:100%; height:2px; pointer-events:none; background:linear-gradient(90deg,transparent,var(--result-accent),transparent); transform-origin:left; animation:prescription-result-sweep .9s ease-out both; }
.app-shell:has(#view-check.active-view) #result-panel .minimal-ddi-card.is-primary.severity-contraindicated { --result-accent:#ff8999; }
.app-shell:has(#view-check.active-view) #result-panel .minimal-ddi-card.is-primary.severity-major { --result-accent:#ffb36e; }
.app-shell:has(#view-check.active-view) #result-panel .minimal-ddi-card.is-primary.severity-moderate { --result-accent:#edcf76; }
.app-shell:has(#view-check.active-view) #result-panel .minimal-ddi-card.is-primary.severity-minor { --result-accent:#79bfff; }
.app-shell:has(#view-check.active-view) #result-panel .minimal-ddi-card.is-primary.severity-safe { --result-accent:#8ad9b8; }
@keyframes prescription-scan { from { transform:translateY(-80px); } to { transform:translateY(422px); } }
@keyframes prescription-turn { to { transform:rotate(360deg); } }
@keyframes prescription-result-reveal { from { transform:translateY(7px); } to { transform:translateY(0); } }
@keyframes prescription-result-highlight { from { box-shadow:inset 0 0 26px color-mix(in srgb,var(--result-accent) 18%,transparent); } to { box-shadow:inset 0 0 0 transparent; } }
@keyframes prescription-result-sweep { from { transform:scaleX(0); opacity:1; } to { transform:scaleX(1); opacity:0; } }
@media(max-width:720px) {
  .app-shell:has(#view-check.active-view) #check-progress { grid-column:1; grid-row:auto; min-height:270px; padding:28px 24px; }
}
@media(prefers-reduced-motion:reduce) {
  .check-progress-scan,.check-progress-indicator,
  .app-shell:has(#view-check.active-view) #result-panel.result-arriving .minimal-ddi-card.is-primary { animation:none; }
  .app-shell:has(#view-check.active-view) #result-panel.result-arriving .minimal-ddi-card.is-primary:after { display:none; animation:none; }
  .check-progress-scan { display:none; }
}

/* ZooDDI clinical case sheet
   Kept separate from legacy workbench CSS so this clinical surface has one
   intentional cascade boundary. */
.app-shell,
.app-shell:has(#view-check.active-view) {
  --case-ink:#eaf3f6;
  --case-muted:#91a6b0;
  --case-paper:#111820;
  --case-rule:#293944;
  --case-teal:#00b8d4;
  --case-teal-deep:#22c9e0;
  --case-teal-wash:#12343e;
  --ink:var(--case-ink);
  --muted:var(--case-muted);
  --paper:var(--case-paper);
  --line:var(--case-rule);
  --soft:#16232d;
  --teal:var(--case-teal);
  --teal-soft:var(--case-teal-wash);
  --amber:#edbf76;
  --amber-soft:#332a1e;
  --red:#ff8999;
  --red-soft:#38212a;
  --green:#8ad9b8;
  --green-soft:#18332c;
  --shadow:none;
}
.app-shell:has(#view-check.active-view) .main-content { background:#0a0c10; }
.app-shell:has(#view-check.active-view) .topbar { border-color:#263742; background:rgba(10,12,16,.96); }
.app-shell:has(#view-check.active-view) .top-actions .icon-btn,
.app-shell:has(#view-check.active-view) .breadcrumbs { color:#91a6b0; }
.app-shell:has(#view-check.active-view) .breadcrumbs strong { color:var(--case-ink); }
.app-shell:has(#view-check.active-view) .content-wrap { max-width:1350px; padding:36px 42px 68px; }
.app-shell:has(#view-check.active-view) #view-check { grid-template-columns:minmax(320px,405px) minmax(0,1fr); grid-template-rows:auto auto 1fr; column-gap:62px; row-gap:24px; align-items:start; }
.app-shell:has(#view-check.active-view) .query-page-intro { grid-column:1 / -1; grid-row:1; }
.app-shell:has(#view-check.active-view) .clinical-check-panel { grid-column:1; grid-row:2 / 4 !important; }
.app-shell:has(#view-check.active-view) .clinical-outcome-empty,
.app-shell:has(#view-check.active-view) #result-panel { grid-column:2; grid-row:2; }
.app-shell:has(#view-check.active-view) #chat-panel { grid-column:2; grid-row:3 !important; align-self:start; }
.app-shell:has(#view-check.active-view) .query-page-intro { align-items:start; margin:0; padding:0 0 25px; border-bottom:1px solid var(--case-rule); }
.app-shell:has(#view-check.active-view) .query-page-intro h1 { color:var(--case-ink); font-family:"DM Sans","Noto Sans SC",sans-serif; font-size:31px; font-weight:700; letter-spacing:-1.15px; }
.app-shell:has(#view-check.active-view) .query-page-intro p { max-width:620px; margin-top:9px; color:var(--case-muted); font-size:13px; line-height:1.75; }
.app-shell:has(#view-check.active-view) .clinical-check-panel { padding:0; color:var(--case-ink); border:0; border-radius:0; background:transparent; box-shadow:none; }
.clinical-case-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:20px; padding:0 0 20px; border-bottom:1px solid var(--case-rule); }
.clinical-case-heading .check-form-eyebrow { margin:0 0 9px; color:var(--case-teal); font:700 10px "DM Sans","Noto Sans SC",sans-serif; letter-spacing:.02em; text-transform:none; }
.clinical-case-heading h2 { margin:0; color:var(--case-ink); font-family:"DM Sans","Noto Sans SC",sans-serif; font-size:20px; font-weight:700; letter-spacing:-.45px; }
.clinical-case-heading p { margin:6px 0 0; color:var(--case-muted); font-size:12px; }
.clinical-case-status { display:inline-flex; flex:none; align-items:center; gap:7px; margin-top:4px; color:#91a6b0; font-size:11px; white-space:nowrap; }
.clinical-case-status i { width:7px; height:7px; border-radius:50%; background:var(--case-teal); }
.app-shell:has(#view-check.active-view) .clinical-check-panel > .regimen-section-primary { display:block !important; margin:0; padding:24px 0 22px; border:0; }
.app-shell:has(#view-check.active-view) .clinical-check-panel > .regimen-section-primary .section-label-row { margin-bottom:8px; }
.app-shell:has(#view-check.active-view) .clinical-check-panel .field-label { color:var(--case-ink); font:700 12px "DM Sans","Noto Sans SC",sans-serif; letter-spacing:0; text-transform:none; }
.app-shell:has(#view-check.active-view) .required-hint { color:#91a6b0; border:0; background:transparent; font-size:10px; }
.app-shell:has(#view-check.active-view) .clinical-check-panel .search-input { min-height:56px; border:1px solid #37505d; border-radius:4px; background:#111b24; box-shadow:none; }
.app-shell:has(#view-check.active-view) .clinical-check-panel .search-input:focus-within { border-color:var(--case-teal); box-shadow:0 0 0 3px rgba(8,127,120,.12); }
.app-shell:has(#view-check.active-view) .clinical-check-panel .search-input input { color:var(--case-ink); font-size:14px; }
.app-shell:has(#view-check.active-view) .clinical-check-panel .search-input input::placeholder { color:#8197a2; }
.app-shell:has(#view-check.active-view) .clinical-check-panel .add-drug-btn { width:35px; height:35px; margin-right:5px; border-radius:3px; color:#fff; background:var(--case-teal); }
#app-shell .clinical-check-panel .regimen-drug-field .search-input { display:flex; align-items:center; gap:8px; padding:6px 8px; }
#app-shell .clinical-check-panel .regimen-drug-field .search-input input { flex:1 1 0; min-width:0; width:0; padding:10px 4px; border:0; background:transparent; }
#app-shell .clinical-check-panel .regimen-drug-field .add-drug-btn { position:static; flex:0 0 35px; width:35px; height:35px; margin:0; }
#app-shell .clinical-check-panel .regimen-drug-field .add-drug-btn svg { margin:0; }
#app-shell .clinical-check-panel .regimen-drug-field .add-drug-btn span { font:400 23px/1 sans-serif; }
.result-query-context { display:grid; gap:7px; margin:0 0 24px; padding:0; overflow-wrap:anywhere; }
.result-query-context > span { color:#91a6b0; font-size:11px; }
.result-query-context strong { color:#eaf3f6; font-size:14px; line-height:1.6; }
.result-query-context small { color:#a6bbc6; font-size:12px; }
.app-shell:has(#view-check.active-view) .clinical-check-panel .input-hint { margin:10px 0 0; color:#91a6b0; font-size:11px; }
.app-shell:has(#view-check.active-view) .clinical-check-panel .input-hint svg,
.app-shell:has(#view-check.active-view) .species-input-hint svg { display:none; }
.app-shell:has(#view-check.active-view) .drug-chips { gap:7px; }
.app-shell:has(#view-check.active-view) .drug-chips .regimen-chip { color:#9ce5f2; border-color:#22505e; border-radius:3px; background:var(--case-teal-wash); }
.app-shell:has(#view-check.active-view) .regimen-coverage { margin-top:11px; padding:0; color:#91a6b0; border:0; border-radius:0; background:transparent; font-size:11px; }
.app-shell:has(#view-check.active-view) .query-support-tools { display:block !important; }
.app-shell:has(#view-check.active-view) #check-species-details { margin:0; padding:21px 0 0; border-top:1px solid var(--case-rule); }
.app-shell:has(#view-check.active-view) #check-species-details > summary { display:none; }
.app-shell:has(#view-check.active-view) #check-species-details input { min-height:52px; margin-top:5px; color:var(--case-ink); border:1px solid #37505d; border-radius:4px; background:#111b24; }
.app-shell:has(#view-check.active-view) #check-species-details input:focus { border-color:var(--case-teal); box-shadow:0 0 0 3px rgba(8,127,120,.12); }
.app-shell:has(#view-check.active-view) .species-input-hint { color:#91a6b0; font-size:10px; line-height:1.65; }
.app-shell:has(#view-check.active-view) .species-phase1 { border-color:#293944; border-radius:3px; background:#111820; }
.app-shell:has(#view-check.active-view) .patient-conditions-details { margin-top:11px; border:1px solid #293944; border-radius:3px; background:#111820; }
.app-shell:has(#view-check.active-view) .patient-conditions-details > summary { min-height:42px; padding:0 12px; }
.app-shell:has(#view-check.active-view) .patient-conditions-details > summary > span { display:flex; align-items:center; gap:8px; width:auto; }
.app-shell:has(#view-check.active-view) .patient-conditions-details > summary > span svg { width:15px; height:15px; }
.app-shell:has(#view-check.active-view) .patient-conditions-details > summary strong { color:var(--case-ink); font-size:11px; }
.app-shell:has(#view-check.active-view) .prescription-import-details { margin-top:16px; border-top:1px solid var(--case-rule); }
.app-shell:has(#view-check.active-view) .prescription-import-details > summary { min-height:50px; color:#b8cbd3; }
.app-shell:has(#view-check.active-view) .prescription-import-details > summary strong { color:#b8cbd3; font-size:12px; }
.app-shell:has(#view-check.active-view) .clinical-search-surface { min-height:130px; border:1px solid #37505d; border-radius:4px; background:#111b24; }
.app-shell:has(#view-check.active-view) .clinical-search-surface:focus-within { border-color:var(--case-teal); box-shadow:0 0 0 3px rgba(8,127,120,.1); }
.app-shell:has(#view-check.active-view) #clinical-search-input { min-height:90px; color:var(--case-ink); }
.app-shell:has(#view-check.active-view) .clinical-check-panel .check-action-area { margin-top:23px; padding:18px 0 0; border-top:1px solid var(--case-rule); }
.app-shell:has(#view-check.active-view) .clinical-check-panel .check-btn { min-height:52px; border-radius:4px; color:white; background:var(--case-teal); box-shadow:none; }
.app-shell:has(#view-check.active-view) .clinical-check-panel .check-btn:hover { background:var(--case-teal-deep); transform:none; }
.app-shell:has(#view-check.active-view) .check-readiness { color:#91a6b0; font-size:11px; }
.app-shell:has(#view-check.active-view) .clinical-outcome-empty { display:flex; flex-direction:column; justify-content:center; align-items:flex-start; min-height:422px; padding:54px 62px; border:0; border-radius:0; background:var(--case-paper); box-shadow:inset 0 0 0 1px #263742; }
.app-shell:has(#view-check.active-view) .clinical-outcome-empty .idle-hud-scanline { display:none; }
.outcome-empty-label { color:var(--case-teal); font:700 11px "DM Sans","Noto Sans SC",sans-serif; letter-spacing:.02em; }
.outcome-empty-copy { max-width:460px; margin-top:19px; }
.app-shell:has(#view-check.active-view) .clinical-outcome-empty h2 { margin:0; color:var(--case-ink); font-family:"DM Sans","Noto Sans SC",sans-serif; font-size:34px; font-weight:700; letter-spacing:-1.2px; }
.app-shell:has(#view-check.active-view) .clinical-outcome-empty p { max-width:400px; margin:12px 0 0; color:var(--case-muted); font-size:13px; line-height:1.8; }
.outcome-empty-readiness { display:grid; gap:10px; width:100%; max-width:418px; margin-top:37px; padding:15px 0 0 16px; border-left:2px solid var(--case-teal); color:#91a6b0; font-size:12px; }
.outcome-empty-readiness > span { display:flex; align-items:center; gap:9px; }
.outcome-empty-readiness i { width:7px; height:7px; border:1px solid #8197a2; border-radius:50%; }
.outcome-empty-readiness .is-complete { color:#8de5ee; }
.outcome-empty-readiness .is-complete i { border-color:var(--case-teal); background:var(--case-teal); }
.app-shell:has(#view-check.active-view) #result-panel,
.app-shell:has(#view-check.active-view) #result-panel:not(.hidden) { min-height:0; margin:0; border:0; border-radius:6px; overflow:hidden; background:var(--case-paper); box-shadow:inset 0 0 0 1px #263742; }
.app-shell:has(#view-check.active-view) #result-panel .result-body { padding:0; }
.app-shell:has(#view-check.active-view) #result-panel .minimal-ddi-card,
.app-shell:has(#view-check.active-view) #result-panel .minimal-ddi-card.is-primary { padding:42px 50px 35px; border-radius:0; background:transparent; box-shadow:none; }
.app-shell:has(#view-check.active-view) #result-panel .minimal-ddi-card.is-primary .minimal-ddi-conclusion { color:var(--case-ink); font-family:"DM Sans","Noto Sans SC",sans-serif; font-size:clamp(27px,2.5vw,39px); letter-spacing:-1.25px; }
.app-shell:has(#view-check.active-view) #result-panel .minimal-ddi-mechanism { color:#becdd4; }
.app-shell:has(#view-check.active-view) #result-panel .minimal-evidence-list { border-top-color:#293944; }
.app-shell:has(#view-check.active-view) .chat-panel { border-color:#263742; border-radius:0; background:#111820; box-shadow:none; }
.app-shell:has(#view-check.active-view) #result-panel .result-header { position:relative; top:auto; right:auto; display:flex; justify-content:flex-end; padding:12px 16px 0; }
.app-shell:has(#view-check.active-view) #result-panel:before,
.app-shell:has(#view-check.active-view) .clinical-check-panel:after { display:none; animation:none; }
.app-shell:has(#view-check.active-view) #result-panel .result-actions { margin-left:auto; }
.app-shell:has(#view-check.active-view) #result-panel .result-footer { padding:14px 24px; }
.app-shell:has(#view-check.active-view) #result-panel .minimal-ddi-conclusion { padding-right:0; overflow-wrap:anywhere; }
.app-shell:has(#view-check.active-view) #result-panel .minimal-ddi-card.is-evidence-gap { padding:18px 32px 28px; border:0; background:transparent; }
.app-shell:has(#view-check.active-view) #result-panel .is-evidence-gap .minimal-ddi-conclusion { font-size:26px; letter-spacing:-.6px; line-height:1.4; }
.app-shell:has(#view-check.active-view) #result-panel .is-evidence-gap .minimal-ddi-subject { margin:18px 0 5px; color:var(--case-ink); font-size:16px; font-weight:600; overflow-wrap:anywhere; }
.minimal-query-species { margin:0; color:#91a6b0; font-size:12px; overflow-wrap:anywhere; }
.minimal-evidence-boundary { margin:18px 0 0; padding-top:15px; border-top:1px solid #263742; color:#91a6b0; font-size:12px; line-height:1.8; }
@media (max-width:960px) {
  .app-shell:has(#view-check.active-view) .content-wrap { padding:24px 22px 58px; }
  .app-shell:has(#view-check.active-view) #view-check { grid-template-columns:minmax(285px,360px) minmax(0,1fr); column-gap:32px; }
  .app-shell:has(#view-check.active-view) .clinical-outcome-empty { padding:42px; }
}
@media (max-width:1100px) {
  .app-shell:has(#view-check.active-view) .content-wrap { padding:18px 16px 52px; }
  .app-shell:has(#view-check.active-view) #view-check { grid-template-columns:1fr; grid-template-rows:none; gap:24px; }
  .app-shell:has(#view-check.active-view) .query-page-intro { grid-column:1; grid-row:1 !important; padding-bottom:19px; }
  .app-shell:has(#view-check.active-view) .clinical-check-panel,
  .app-shell:has(#view-check.active-view) .clinical-outcome-empty,
  .app-shell:has(#view-check.active-view) #chat-panel,
  .app-shell:has(#view-check.active-view) #result-panel,
  .app-shell:has(#view-check.active-view) #result-panel:not(.hidden) { grid-column:1; grid-row:3 !important; min-width:0; }
  .app-shell:has(#view-check.active-view) .clinical-check-panel { grid-row:2 !important; }
  .app-shell:has(#view-check.active-view) #chat-panel { grid-row:4 !important; }
  .app-shell:has(#view-check.active-view) .clinical-outcome-empty { min-height:300px; padding:33px 26px; }
  .app-shell:has(#view-check.active-view) .clinical-outcome-empty h2 { font-size:29px; }
  .app-shell:has(#view-check.active-view) #result-panel .minimal-ddi-card,
  .app-shell:has(#view-check.active-view) #result-panel .minimal-ddi-card.is-primary { padding:22px 24px; }
}

/* Clinical decision surface
   The empty state is a waiting clinical instrument: restrained ECG-like lines
   establish purpose without imitating a generic dashboard. */
.app-shell:has(#view-check.active-view) .clinical-outcome-empty {
  position:relative;
  isolation:isolate;
  overflow:hidden;
  color:#edf8f4;
  background:linear-gradient(142deg,#101c27 0%,#112c39 56%,#103a45 100%);
  box-shadow:0 20px 45px rgba(9,49,52,.16);
}
.app-shell:has(#view-check.active-view) .clinical-outcome-empty:before {
  content:"";
  position:absolute;
  z-index:-1;
  inset:auto -80px -160px auto;
  width:430px;
  height:430px;
  border-radius:50%;
  background:radial-gradient(circle,rgba(106,227,202,.24),rgba(53,169,156,.06) 43%,transparent 70%);
}
.app-shell:has(#view-check.active-view) .clinical-outcome-empty:after {
  content:"";
  position:absolute;
  z-index:-1;
  inset:0;
  opacity:.42;
  background:linear-gradient(90deg,transparent 0 7%,rgba(215,255,244,.14) 7.15% 7.32%,transparent 7.5% 18%,rgba(215,255,244,.1) 18.1% 18.23%,transparent 18.4% 100%);
  mask:linear-gradient(to bottom,transparent,black 28%,black 73%,transparent);
}
.app-shell:has(#view-check.active-view) .outcome-empty-label { color:#7cf0d3; }
.app-shell:has(#view-check.active-view) .clinical-outcome-empty h2 { color:#f0fbf7; max-width:430px; }
.app-shell:has(#view-check.active-view) .clinical-outcome-empty p { color:rgba(229,248,242,.75); }
.app-shell:has(#view-check.active-view) .outcome-empty-readiness {
  padding:16px 18px;
  border:0;
  border-radius:7px;
  color:rgba(225,246,240,.72);
  background:rgba(255,255,255,.06);
  box-shadow:inset 0 0 0 1px rgba(220,255,247,.12);
}
.app-shell:has(#view-check.active-view) .outcome-empty-readiness i { border-color:rgba(221,255,247,.62); }
.app-shell:has(#view-check.active-view) .outcome-empty-readiness .is-complete { color:#a7f5df; }
.app-shell:has(#view-check.active-view) .outcome-empty-readiness .is-complete i { border-color:#8cf1d5; background:#8cf1d5; }
.app-shell:has(#view-check.active-view) #result-panel,
.app-shell:has(#view-check.active-view) #result-panel:not(.hidden) {
  background:#111820;
  box-shadow:0 18px 42px rgba(23,50,58,.12),inset 0 0 0 1px #263742;
}
.app-shell:has(#view-check.active-view) #result-panel .minimal-ddi-card.is-primary {
  background:linear-gradient(135deg,#111820, #13242e);
}
/* Shared clinical HUD, matching the homepage safety preview. */
.app-shell:has(#view-check.active-view) #drug-chips { padding:10px 0 0; border:0; background:transparent; box-shadow:none; }
.app-shell .main-content { color:var(--case-ink); background:#0a0c10; }
.app-shell .topbar { background:#0e141c; border-color:var(--case-rule); }
.app-shell .breadcrumbs, .app-shell .topbar .icon-btn { color:var(--case-muted); }
.app-shell .breadcrumbs strong, .app-shell .user-chip strong { color:var(--case-ink); }
.workspace-home { display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; min-height:36px; margin:0; padding:0 12px; border:1px solid #397080; border-radius:5px; color:#b9dce5; background:#12343e; font-size:12px; font-weight:600; white-space:nowrap; text-decoration:none; }
.workspace-home:hover { color:#fff; border-color:var(--case-teal); background:#11252e; }
.workspace-home:focus-visible, .app-shell a:focus-visible, .app-shell button:focus-visible { outline:2px solid var(--case-teal); outline-offset:3px; }
.app-shell:has(#view-check.active-view) .content-wrap { max-width:1440px; }
.app-shell:has(#view-check.active-view) #view-check { column-gap:40px; }
.app-shell:has(#view-check.active-view) .clinical-check-panel .check-btn { color:#04151c; font-weight:700; }
.app-shell:has(#view-check.active-view) .clinical-check-panel .check-btn:disabled { color:#8aa0ab; background:#23333f; opacity:1; }
.app-shell:has(#view-check.active-view) #result-panel.hidden { display:none; }
.app-shell:has(#view-check.active-view) #result-panel { border:1px solid #2c414e; border-radius:8px; box-shadow:none; }
.app-shell:has(#view-check.active-view) #result-panel .result-header,
.app-shell:has(#view-check.active-view) #result-panel .result-findings { background:transparent; }
.app-shell:has(#view-check.active-view) #result-panel .minimal-ddi-card { border:0; border-left:3px solid #526a78; }
.app-shell:has(#view-check.active-view) #result-panel .minimal-ddi-card.severity-contraindicated { border-left-color:#ff677b; background:linear-gradient(110deg,#301b26,#111820 70%); }
.app-shell:has(#view-check.active-view) #result-panel .minimal-ddi-card.severity-major { border-left-color:#f4a16a; background:linear-gradient(110deg,#2c241f,#111820 70%); }
.app-shell:has(#view-check.active-view) #result-panel .minimal-ddi-card.severity-moderate { border-left-color:#e7cb72; }
.app-shell:has(#view-check.active-view) #result-panel .minimal-ddi-card.severity-minor { border-left-color:#7bbcf5; }
.app-shell:has(#view-check.active-view) #result-panel .minimal-ddi-card.severity-safe { border-left-color:#7adbb4; }
.app-shell:has(#view-check.active-view) #result-panel .minimal-ddi-subject { color:#cfdee5; }
.app-shell:has(#view-check.active-view) #result-panel .minimal-ddi-mechanism { color:#bfced6; font-size:15px; line-height:1.8; }
.app-shell:has(#view-check.active-view) #result-panel .minimal-evidence-list { margin-top:25px; padding-top:18px; }
.app-shell:has(#view-check.active-view) #result-panel .minimal-evidence-list a { color:#91d9eb; }
.app-shell:has(#view-check.active-view) #result-panel .minimal-evidence-copy b { color:#91d9eb; }
.app-shell:has(#view-check.active-view) #result-panel .minimal-evidence-list a:hover .minimal-evidence-copy b { color:#c4f4ff; }
.app-shell:has(#view-check.active-view) #result-panel .minimal-evidence-list h4 { color:#9cafb9; }
.app-shell:has(#view-check.active-view) #result-panel .minimal-evidence-number { color:#98e0ee; background:#18323f; border-color:#315867; }
.app-shell:has(#view-check.active-view) #result-panel .minimal-evidence-list span,
.app-shell:has(#view-check.active-view) #result-panel .minimal-ddi-secondary-note { color:#91a6b0; }
.app-shell:has(#view-check.active-view) .minimal-ddi-expanded { background:#101820; border-color:#2c414e; }
.app-shell:has(#view-check.active-view) .minimal-ddi-expanded > summary { color:#bcd6e0; }
.app-shell:has(#view-check.active-view) .minimal-severity-line { background:#1b2a35; color:#c5d7df; border-color:#3a5060; }
.app-shell:has(#view-check.active-view) .minimal-severity-line.severity-major { color:#ffc28e; background:#3c2a22; border-color:#6f4832; }
.app-shell:has(#view-check.active-view) .minimal-severity-line.severity-contraindicated { color:#ffb0bb; background:#44202b; border-color:#793746; }
.app-shell:has(#view-check.active-view) .minimal-severity-line.severity-moderate { color:#f3dc94; background:#373221; border-color:#645a36; }
.app-shell:has(#view-check.active-view) .minimal-severity-line.severity-minor { color:#a9d8ff; background:#1d3046; border-color:#355a79; }
.app-shell:has(#view-check.active-view) .minimal-severity-line.severity-safe { color:#9de9c9; background:#19372f; border-color:#305c4d; }
.app-shell:has(#view-check.active-view) .minimal-ddi-alternative { color:#c4d6dd; background:#162b32; border-color:#31515a; }
.app-shell:has(#view-check.active-view) .suggestions,
.app-shell:has(#view-check.active-view) .species-suggestions { color:#eaf3f6; background:#15232e; border-color:#37505d; box-shadow:0 12px 35px #0008; }
.app-shell:has(#view-check.active-view) .suggestion-item { color:#eaf3f6; border-color:#2a3d49; }
.app-shell:has(#view-check.active-view) .suggestion-item:hover,
.app-shell:has(#view-check.active-view) .suggestion-item.active { background:#204453; }
.app-shell:has(#view-check.active-view) #chat-panel { color:#becdd4; border-color:#293944; border-radius:6px; }
.app-shell:has(#view-check.active-view) #chat-panel h3 { color:#eaf3f6; }
.app-shell .page-intro h1 { color:#eaf3f6; }
.app-shell .page-intro p { color:#91a6b0; }
.app-shell .activity-card, .app-shell .evidence-detail-card { color:#becdd4; background:#111820; border-color:#293944; box-shadow:none; }
.app-shell .activity-card-main > p { white-space:normal; overflow-wrap:anywhere; color:#d3e4eb; line-height:1.7; }
.app-shell .activity-card h3, .app-shell .activity-card strong { color:#eaf3f6; }
.app-shell .evidence-detail-heading, .app-shell .evidence-detail-facts,
.app-shell .evidence-detail-facts > div { border-color:#293944; }
.app-shell .evidence-detail-heading h1, .app-shell .evidence-detail-error h1,
.app-shell .evidence-detail-facts dd { color:#eaf3f6; }
.app-shell .evidence-detail-citation, .app-shell .evidence-detail-section p,
.app-shell .evidence-detail-section h2 { color:#becdd4; }
.app-shell .evidence-detail-source { color:#91d9eb; }
.app-shell .evidence-detail-quotation { color:#c4d6dd; background:#162b32; border-color:#31515a; }
@media(max-width:1100px) {
 .app-shell:has(#view-check.active-view) #view-check { column-gap:0; }
}
@media(max-width:480px) {
 .app-shell:has(#view-check.active-view) .query-page-intro h1 { font-size:27px; }
 .clinical-case-heading { gap:12px; }
 .clinical-case-status { font-size:10px; }
 .app-shell:has(#view-check.active-view) #result-panel .minimal-ddi-card.is-primary { padding:24px 20px; }
}

.app-shell { color:var(--case-ink); background:#0a0c10; color-scheme:dark; }
#app-shell.app-shell:not(.hidden) .sidebar { width:220px; background:#0e141c; border-color:var(--case-rule); }
#app-shell.app-shell:not(.hidden) { font-family:"Inter","Noto Sans SC",sans-serif; }
#app-shell.app-shell:not(.hidden) .sidebar { padding:22px 12px; border-right:1px solid var(--case-rule); }
#app-shell.app-shell:not(.hidden) .sidebar-brand { padding:0 10px 28px; }
#app-shell.app-shell:not(.hidden) .sidebar-brand .brand-mark { width:32px; height:32px; color:#07151c; background:var(--case-teal); box-shadow:none; }
#app-shell.app-shell:not(.hidden) .sidebar-brand sup { color:var(--case-teal); }
#app-shell.app-shell:not(.hidden) .workspace-label { padding:0 10px 10px; color:#91a6b0; font:600 10px "Inter","Noto Sans SC",sans-serif; letter-spacing:0; text-transform:none; }
#app-shell.app-shell:not(.hidden) .nav-item { min-height:42px; padding:10px; gap:10px; color:#a2b6c1; font-size:12px; }
#app-shell.app-shell:not(.hidden) .nav-item svg { width:16px; height:16px; }
#app-shell.app-shell:not(.hidden) .nav-item kbd { color:#738d9c; font-size:9px; }
#app-shell.app-shell:not(.hidden) .nav-item:hover { color:#eaf3f6; background:#152932; }
#app-shell.app-shell:not(.hidden) .nav-item.active { color:#dcf7ff; background:#12343e; box-shadow:inset 2px 0 var(--case-teal); }
#app-shell.app-shell:not(.hidden) .coverage-note { color:#91a6b0; background:#111820; border-color:var(--case-rule); }
#app-shell.app-shell:not(.hidden) .coverage-note strong { color:#c6d8e1; }
#app-shell.app-shell:not(.hidden) .coverage-note span { color:#91a6b0; }
#app-shell.app-shell:not(.hidden) .breadcrumbs { color:var(--case-muted); font:500 12px "Inter","Noto Sans SC",sans-serif; }
#app-shell.app-shell:not(.hidden) .user-chip strong { color:var(--case-ink); font:600 12px "Inter","Noto Sans SC",sans-serif; }
#app-shell.app-shell:not(.hidden) .user-chip span { color:var(--case-muted); }
#app-shell.app-shell:not(.hidden) .language-toggle.compact { color:#91a6b0; background:#15232e; border:1px solid #344c59; box-shadow:none; }
#app-shell.app-shell:not(.hidden) .language-toggle.compact .lang-current { color:#80dfed; }
#app-shell.app-shell:not(.hidden) .avatar { color:#a3e7f2; background:#173642; }
#app-shell.app-shell:not(.hidden) .workbench-status-bar { left:220px; }
#app-shell.app-shell:not(.hidden) .topbar { position:sticky; top:0; z-index:15; height:72px; padding:0 28px; background:#0e141c; border-color:var(--case-rule); }
.app-shell .topbar .top-actions { gap:16px; }
#app-shell.app-shell:not(.hidden) .content-wrap { width:100%; max-width:1440px; padding:28px 34px 64px; }
.app-shell .view:not(#view-check) { max-width:none; margin:0; }
.app-shell .page-intro { align-items:flex-start; gap:20px; margin:0 0 28px; padding:0 0 24px; border-bottom:1px solid var(--case-rule); }
.app-shell .page-intro h1 { margin:6px 0 8px; font-family:"DM Sans","Noto Sans SC",sans-serif; font-size:31px; font-weight:700; letter-spacing:-1px; }
.app-shell .page-intro p { max-width:640px; color:var(--case-muted); font-size:13px; line-height:1.75; }
.app-shell .eyebrow { color:var(--case-teal); text-transform:none; letter-spacing:0; }
.app-shell .page-intro > button { flex-shrink:0; }
.app-shell :is(.account-card,.drug-card,.retained-prescriptions-card,.retained-prescription,.activity-panel,.review-queue-card,.admin-card,.admin-metric,.admin-source-card,.taxonomy-summary-card,.taxonomy-record,.admin-entity-card) {
  color:var(--case-ink); background:var(--case-paper); border:1px solid var(--case-rule); border-radius:8px; box-shadow:none;
}
.app-shell :is(.account-card,.retained-prescriptions-card,.admin-card) { padding:24px; }
.app-shell :is(.account-grid,.admin-overview-grid,.admin-database-grid) { gap:20px; }
.app-shell :is(.admin-card-heading,.account-identifiers,.admin-toolbar,.record-pagination,.review-queue-card-footer,.review-queue-card-heading,.review-queue-facts section) { border-color:var(--case-rule); }
.app-shell :is(.admin-card-heading h2,.drug-card h3,.review-queue-card h2,.admin-summary-list strong,.admin-metric strong,.account-identifiers dd,.admin-detail-facts dd) { color:var(--case-ink); }
.app-shell :is(.admin-card-heading p,.account-copy,.drug-card p,.admin-workspace-note,.admin-result-count,.account-form label,.account-identifiers dt,.admin-empty,.admin-loading,.review-queue-task-meta,.review-queue-facts section > span) { color:var(--case-muted); }
.app-shell .admin-card-heading h2 { font-size:20px; letter-spacing:-.4px; }
.app-shell :is(input:not([type=checkbox]):not([type=radio]),select,textarea) { color:var(--case-ink); background:#0d151e; border-color:#37505d; border-radius:5px; }
.app-shell :is(input,textarea)::placeholder { color:#8097a4; opacity:1; }
.app-shell :is(input,select,textarea):focus-visible { outline:2px solid var(--case-teal); outline-offset:2px; }
.app-shell input:is([type=checkbox],[type=radio]) { accent-color:var(--case-teal); }
.app-shell .account-form input { min-height:44px; }
.app-shell :is(.secondary-btn,.library-filter,.taxonomy-status-filter,.admin-workspace-tab) { color:#c2d7e1; background:#15232e; border:1px solid #344c59; border-radius:5px; box-shadow:none; }
.app-shell .secondary-btn:hover { color:#fff; background:#203744; border-color:var(--case-teal); transform:none; }
.app-shell .primary-btn { color:#04151c; background:var(--case-teal); border-radius:5px; box-shadow:none; }
.app-shell .primary-btn:hover { background:var(--case-teal-deep); transform:none; }
.app-shell :is(.primary-btn,.secondary-btn):disabled { color:#8aa0ab; background:#23333f; border-color:#30434f; opacity:1; }
.app-shell :is(.icon-btn:hover,.admin-workspace-tab.active) { color:var(--case-ink); background:#203744; border-color:#37505d; }
.app-shell :is(.library-filter,.library-filter select) { color:#bcd0db; }
.app-shell .library-filter { display:flex; flex-direction:row; align-items:center; gap:12px; height:44px; min-height:44px; padding:0 12px; font-size:12px; }
.app-shell .library-filter > svg { display:none; }
.app-shell .library-filter > span { flex-shrink:0; }
.app-shell .library-filter select { flex:1; width:160px; max-width:none; min-width:0; height:42px; min-height:0; padding:0 6px; border:0; background:transparent; font-size:12px; }
.app-shell .library-toolbar { align-items:center; gap:12px; margin-bottom:20px; padding:0; border:0; }
.app-shell .wide-search { min-width:0; }
.app-shell .wide-search input { height:44px; min-height:44px; }
.app-shell :is(.library-empty,.retained-prescriptions-empty,.admin-empty,.admin-loading) { background:transparent; border-color:var(--case-rule); }
.app-shell .drug-card { padding:22px; }
.app-shell .drug-card h3 { overflow-wrap:anywhere; }
.app-shell .drug-card .drug-tags span { color:#a2dfe9; background:#15333e; }
.app-shell :is(.activity-card-icon,.retained-prescription-icon,.admin-metric-icon) { color:var(--case-teal); background:var(--case-teal-wash); }
.app-shell .activity-card summary { color:#91d9eb; }
.app-shell :is(.activity-card pre,.admin-detail-json,.admin-detail-activity pre) { color:#b7cbd5; background:#0d151e; border-color:var(--case-rule); }
.app-shell .retained-prescription strong { color:var(--case-ink); }
.app-shell :is(.retained-prescription p,.retained-prescriptions-empty p,.record-pagination) { color:var(--case-muted); }
.app-shell :is(.review-queue-notice,.review-queue-disclaimer,.admin-source-access,.admin-bulk-boundary) { color:#edc68c; background:#2b261e; border-color:#5b4b31; }
.app-shell :is(.review-queue-access,.review-queue-tags b,.admin-summary-row,.admin-audit-item,.admin-source-meta,.admin-record-controls,.admin-workspace-tabs) { color:#bed1dc; background:#14212b; border-color:var(--case-rule); }
.app-shell :is(.admin-table th,.admin-table td,.admin-table-wrap,.admin-source-meta > div,.admin-summary-list > div) { color:#bed1dc; border-color:var(--case-rule); }
.app-shell .admin-table thead { background:#15232e; }
.app-shell :is(.admin-table tbody tr:hover,.admin-summary-list a:hover) { background:#192b37; }
.app-shell .admin-table a { color:#91d9eb; }
.app-shell :is(.admin-workspace-tab:hover,.taxonomy-tab) { color:#bcd2df; background:#15232e; border-color:#344c59; }
.app-shell :is(.admin-workspace-tab.active,.taxonomy-tab.active) { color:#a3e7f2; background:#173642; border-color:#397080; }
.app-shell :is(.condition-option,.medication-card,.result-details,.result-findings,.evidence-provenance,.candidate-rule,.candidate-review-task,.review-queue-instructions,.review-queue-task-meta,.admin-textbook-card,.admin-textbook-progress) { color:#b9ced8; background:#14212b; border-color:var(--case-rule); }
.app-shell .condition-option:has(input:checked) { color:#b5edf4; background:#173642; border-color:#397080; }
.app-shell :is(.condition-option strong,.medication-card h3,.candidate-rule h3,.review-queue-notice strong) { color:var(--case-ink); }
.app-shell :is(.condition-option small,.review-queue-facts p,.review-queue-mechanism p,.candidate-rule p) { color:#a6bbc6; }
.app-shell :is(.result-footer,.chat-toggle,.chat-panel[open] .chat-toggle,.chat-message.from-assistant) { color:#a6bbc6; background:#14212b; border-color:var(--case-rule); }
.app-shell .account-identifiers dd { white-space:normal; overflow-wrap:anywhere; }
.app-shell .avatar { color:#a3e7f2; background:#173642; }
.app-shell .breadcrumbs { min-width:0; }
.app-shell .breadcrumbs strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
body:has(.app-shell:not(.hidden)) dialog {
  --ink:#eaf3f6; --muted:#91a6b0; --line:#293944; --soft:#16232d;
  --teal:#00b8d4; --teal-soft:#12343e;
  color:#eaf3f6; background:#111820; border:1px solid #37505d; color-scheme:dark;
}
body:has(.app-shell:not(.hidden)) dialog::backdrop { background:#020609c9; }
body:has(.app-shell:not(.hidden)) dialog :is(h2,h3,label,strong) { color:#eaf3f6; }
body:has(.app-shell:not(.hidden)) dialog :is(p,dt) { color:#a6bbc6; }
body:has(.app-shell:not(.hidden)) dialog :is(input,select,textarea,.vote-row button) { color:#dcebf1; background:#0d151e; border-color:#37505d; }
body:has(.app-shell:not(.hidden)) dialog .vote-row button.selected { color:#9ae4ef; background:#173642; border-color:#00b8d4; }
#auth-screen {
  --ink:#eaf3f6; --muted:#91a6b0; --line:#293944; --soft:#16232d;
  --teal:#00b8d4; --teal-soft:#12343e;
  color:#eaf3f6; background:#0a0c10; color-scheme:dark;
}
#auth-screen .auth-panel { color:#eaf3f6; background:#111820; border-color:#293944; border-radius:8px; box-shadow:none; }
#auth-screen :is(input,select,textarea) { color:#eaf3f6; background:#0d151e; border-color:#37505d; }
#auth-screen :is(.panel-heading h2,label) { color:#eaf3f6; }
#auth-screen :is(.panel-heading p,.auth-switch,.input-note,.field-hint) { color:#91a6b0; }
#auth-screen .primary-btn { color:#04151c; background:#00b8d4; border-radius:5px; box-shadow:none; }
#auth-screen :is(input,select,textarea,button):focus-visible { outline:2px solid #00b8d4; outline-offset:3px; }
@media(max-width:1100px) {
  #app-shell.app-shell:not(.hidden) .content-wrap { padding:24px 22px 58px; }
  .app-shell .topbar .top-actions { gap:10px; }
}
@media(max-width:720px) {
  #app-shell.app-shell:not(.hidden) .content-wrap { padding:20px 16px 56px; }
  #app-shell.app-shell:not(.hidden) .sidebar { width:250px; }
  #app-shell.app-shell:not(.hidden) .workbench-status-bar { left:0; }
  #app-shell.app-shell:not(.hidden) .topbar { height:62px; padding:0 14px; }
  .app-shell .topbar .breadcrumbs { display:none; }
  .app-shell .topbar .top-actions { margin-left:auto; gap:8px; }
  .app-shell .topbar .workspace-home { min-height:34px; padding:0 9px; font-size:11px; }
  .app-shell .library-toolbar { align-items:stretch; }
  .app-shell .page-intro { gap:16px; padding-bottom:20px; margin-bottom:22px; }
  .app-shell .page-intro h1 { font-size:27px; }
  .app-shell :is(.account-card,.retained-prescriptions-card,.admin-card) { padding:18px; }
  .app-shell :is(.account-grid,.library-results,.admin-overview-grid) { grid-template-columns:minmax(0,1fr); }
  .app-shell .activity-card-heading { align-items:flex-start; }
}
