/* ICD-11 Differential Assessor — dark "clinician console" theme.
   Adapted from ../myers-briggs/assets/mb.css; shares the suite's design tokens with
   dsm5 / ocean / myers-briggs / profiler. Keep the palette and components in sync. */
:root {
  --clin-bg: #0f1720;
  --clin-panel: #16212e;
  --clin-line: #24313f;
  --clin-ink: #e6edf3;
  --clin-muted: #9fb0c0;
  --clin-accent: #4bb3a3;
  --clin-user: #23405a;
}
* { box-sizing: border-box; }
.clin-body {
  margin: 0; min-height: 100vh;
  background: var(--clin-bg); color: var(--clin-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding-bottom: 80px; line-height: 1.55;
}

/* Header */
.clin-header { border-bottom: 1px solid var(--clin-line); background: var(--clin-panel); position: sticky; top: 0; z-index: 20; }
.clin-header-inner { max-width: 900px; margin: 0 auto; padding: 12px 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.clin-title { font-weight: 650; }
.clin-title .brand-mark { color: var(--clin-accent); }
.clin-sub { color: var(--clin-muted); font-weight: 400; font-size: .85rem; }
.clin-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.clin-ghost { background: transparent; border: 1px solid var(--clin-line); color: var(--clin-muted); padding: 6px 12px; border-radius: 8px; text-decoration: none; font: inherit; font-size: .85rem; cursor: pointer; }
.clin-ghost:hover { color: var(--clin-ink); border-color: var(--clin-accent); }
.app-link { border-color: #2f6f63; color: #cfe6e0; }
.app-link:hover { color: #fff; border-color: var(--clin-accent); }

/* Notice strip */
.notice-strip { background: #0e1a17; border-bottom: 1px solid #1f4a41; color: var(--clin-accent); font-size: .85rem; }
.notice-strip .inner { max-width: 900px; margin: 0 auto; padding: 9px 18px; }
.notice-strip strong { color: #eafbf6; }

/* Chevron stepper */
.stepper { max-width: 900px; margin: 18px auto 6px; padding: 0 18px; display: flex; gap: 4px; overflow-x: auto; }
.step {
  flex: 1 1 0; position: relative; display: flex; align-items: center; gap: 8px;
  padding: 9px 12px 9px 24px; font-size: .84rem; color: var(--clin-muted); white-space: nowrap;
  background: var(--clin-panel); border: 1px solid var(--clin-line);
  clip-path: polygon(0 0, calc(100% - 15px) 0, 100% 50%, calc(100% - 15px) 100%, 0 100%, 15px 50%);
}
.step:first-child { clip-path: polygon(0 0, calc(100% - 15px) 0, 100% 50%, calc(100% - 15px) 100%, 0 100%); padding-left: 14px; }
.step .chev-num { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #0d151e; border: 1px solid var(--clin-line); font-size: .78rem; color: var(--clin-muted); }
.step.is-active { color: var(--clin-ink); background: #1b2b3a; border-color: var(--clin-accent); }
.step.is-active .chev-num { background: var(--clin-accent); color: #06231e; border-color: var(--clin-accent); }
.step.is-done { color: var(--clin-ink); }
.step.is-done .chev-num { font-size: 0; background: #24463f; border-color: #24463f; }
.step.is-done .chev-num::after { content: "✓"; font-size: .8rem; color: var(--clin-accent); }

/* Stage + panels */
.clin-stage { max-width: 900px; margin: 0 auto; padding: 12px 18px; }
.input-panel { background: var(--clin-panel); border: 1px solid var(--clin-line); border-radius: 14px; padding: 26px; margin-top: 12px; }
.input-panel h1 { margin: 0 0 8px; font-size: 1.5rem; }
.panel-lede { color: var(--clin-muted); margin: 0 0 14px; line-height: 1.55; }
.panel-lede strong { color: var(--clin-ink); }
.panel-actions { display: flex; align-items: center; gap: 14px; margin-top: 18px; flex-wrap: wrap; }
.btn-analyse { background: var(--clin-accent); color: #06231e; border: 0; border-radius: 999px; padding: 11px 22px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; display: inline-block; }
.btn-analyse:hover { filter: brightness(1.08); }
.btn-analyse:disabled { opacity: .5; cursor: not-allowed; }
.clin-hint { color: var(--clin-muted); font-size: .84rem; }

/* Disclaimer gate */
.privacy-pill { display: flex; gap: 12px; align-items: flex-start; background: #0e1a17; border: 1px solid #1f4a41; border-left: 4px solid var(--clin-accent); border-radius: 12px; padding: 14px 16px; margin: 4px 0 16px; font-size: .9rem; line-height: 1.5; color: var(--clin-ink); }
.privacy-pill .pp-icon { font-size: 1.2rem; line-height: 1.3; }
.privacy-pill strong { color: #fff; }
.privacy-pill.shield { background: #0e1622; border-color: #22415e; border-left-color: #5a9bd4; }
.privacy-pill a { color: var(--clin-accent); text-decoration: underline; text-underline-offset: 2px; }
.scope-note { font-size: .84rem; color: #e8c983; background: #2a2310; border: 1px solid #5a4a20; border-radius: 8px; padding: 8px 12px; margin: 0 0 18px; line-height: 1.45; }
.disclaimer-checks { display: flex; flex-direction: column; gap: 14px; margin: 6px 0 4px; }
.disclaimer-checks label { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: start; color: var(--clin-ink); font-size: .92rem; line-height: 1.5; cursor: pointer; }
.disclaimer-checks input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--clin-accent); }

/* Subject input */
.subject-input { width: 100%; min-height: 260px; resize: vertical; background: #0d151e; color: var(--clin-ink); border: 1px solid var(--clin-line); border-radius: 12px; padding: 14px 16px; font: inherit; line-height: 1.55; }
.subject-input:focus { outline: none; border-color: var(--clin-accent); }

/* Meta inputs */
.report-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 12px 0 4px; }
.report-meta label { display: flex; flex-direction: column; gap: 5px; font-size: .82rem; color: var(--clin-muted); }
.report-meta input { background: #0d151e; color: var(--clin-ink); border: 1px solid var(--clin-line); border-radius: 8px; padding: 9px 11px; font: inherit; }
.report-meta input:focus { outline: none; border-color: var(--clin-accent); }
@media (max-width: 620px) { .report-meta { grid-template-columns: 1fr; } }

/* Findings / results */
.findings-title { font-size: 1.05rem; color: var(--clin-ink); margin: 18px 0 6px; }
.findings-sub { color: var(--clin-muted); font-size: .85rem; line-height: 1.45; margin: -2px 0 12px; max-width: 74ch; }
.rep-h { color: var(--clin-accent); font-size: 1rem; margin: 22px 0 8px; border-bottom: 1px solid var(--clin-line); padding-bottom: 4px; }

/* Observation cards (evidence review) */
.obs { background: var(--clin-panel); border: 1px solid var(--clin-line); border-left: 3px solid var(--clin-accent); border-radius: 10px; padding: 12px 14px; margin: 10px 0; }
.obs-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.obs-head strong { font-size: 1.02rem; }
.obs-evidence { color: var(--clin-muted); font-size: .86rem; border-left: 2px solid var(--clin-line); padding-left: 10px; margin-top: 6px; font-style: italic; }

/* Candidate / criteria (ICD-11) */
.rep-dx { background: var(--clin-panel); border: 1px solid var(--clin-line); border-left: 3px solid var(--clin-accent); border-radius: 10px; padding: 14px 16px; margin: 10px 0; }
.rep-dx-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.icd-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--clin-accent); font-weight: 700; }
.icd-uri { color: var(--clin-muted); font-size: .74rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow: hidden; text-overflow: ellipsis; }

/* Status pills — SUPPORTED / CONTRADICTED / UNKNOWN / NOT_APPLICABLE */
.band-pill { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 3px 9px; border-radius: 999px; color: #06231e; background: var(--clin-accent); }
.band-pill.supported { background: var(--clin-accent); color: #06231e; }
.band-pill.contradicted { background: #d98a8a; color: #2a0f0f; }
.band-pill.unknown { background: #d9b98a; color: #2a1f0f; }
.band-pill.na { background: #7a8791; color: #fff; }

/* Feature-support table (NO percentages) */
.support-table { width: 100%; border-collapse: collapse; margin: 10px 0 16px; font-size: .9rem; }
.support-table th, .support-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--clin-line); }
.support-table th { color: var(--clin-muted); font-weight: 600; }
.support-table td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Callouts / errors */
.callout-disc { background: #2a2310; border: 1px solid #5a4a20; color: #e8c983; border-radius: 10px; padding: 10px 12px; font-size: .82rem; line-height: 1.45; margin-bottom: 10px; }
.q-error { font-size: .85rem; color: #ffb4b4; background: #3a1a1a; border: 1px solid #6a2a2a; border-radius: 8px; padding: 8px 12px; margin: 10px 0; }

/* Progress bar (assessment run) */
.q-progress-bar { height: 8px; background: #0d151e; border: 1px solid var(--clin-line); border-radius: 999px; overflow: hidden; }
.q-progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #2b5169, #4bb3a3); border-radius: 999px; transition: width .3s ease; }

/* Field label */
.field-label { display: block; font-size: .82rem; color: var(--clin-muted); margin: 6px 0 6px; }

/* Progress / work panel */
#work-panel { margin-top: 14px; }
#progress-stage { margin: 8px 0 0; }

/* Live stream of intermediate results */
.stream-box { margin-top: 14px; background: var(--clin-panel); border: 1px solid var(--clin-line); border-radius: 12px; padding: 14px 16px; }
.stream-line { font-size: .9rem; color: var(--clin-ink); margin: 4px 0; line-height: 1.5; }
.stream-line .icd-code { margin-right: 6px; }
.stream-adj { margin-top: 6px; display: flex; flex-direction: column; gap: 6px; }
.stream-adj-row { font-size: .9rem; color: var(--clin-ink); padding: 7px 10px; background: #0d151e; border: 1px solid var(--clin-line); border-left: 3px solid var(--clin-accent); border-radius: 8px; animation: streamin .25s ease; }
.stream-adj-row .tick-s { color: var(--clin-accent); font-weight: 700; }
.stream-adj-row .tick-c { color: #d98a8a; font-weight: 700; }
.stream-adj-row .tick-u { color: #d9b98a; font-weight: 700; }
@keyframes streamin { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }

/* Requirement list inside candidate cards */
.req-list { list-style: none; margin: 6px 0 0; padding: 0; }
.req-list li { margin: 6px 0; padding-left: 2px; font-size: .9rem; line-height: 1.5; }
.band-pill.tiny { font-size: .64rem; padding: 2px 7px; margin-right: 4px; }
.conf { color: var(--clin-muted); font-size: .82rem; }

/* Ruled lists (missing info / follow-ups) */
.ruled { margin: 6px 0 14px; padding-left: 20px; }
.ruled li { margin: 5px 0; line-height: 1.5; }

/* Follow-up textarea */
.subject-input.followup { min-height: 110px; margin-top: 8px; }

/* Result disclaimer callout spacing */
#results-panel .callout-disc { margin-top: 14px; }
#safety-flags { margin: 4px 0 10px; }

/* Markdown-ish tables (parity with the suite) */
.md-table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: .9rem; }
.md-table th, .md-table td { border: 1px solid var(--clin-line); padding: 6px 9px; text-align: left; }
.md-table th { color: var(--clin-muted); background: #0d151e; }

/* hidden must beat display */
[hidden] { display: none !important; }
