/* ICD FINDER. Same look as the other BioPharma Foundry tools: black ground, one amber accent. */
:root {
  --bg: #000000;
  --surface: #0a0a0b;
  --raised: #111113;
  --line: #232326;
  --line-strong: #3a3a3f;
  --ink: #f4f4f1;
  --soft: #b9b9bd;
  --muted: #8e8e93;
  --amber: #f2a93b;
  --amber-hi: #ffd08a;
  --amber-soft: rgba(242, 169, 59, 0.12);
  --ok: #7fcf93;
  --danger: #ff8a65;
  --danger-soft: rgba(255, 138, 101, 0.1);
  --proj: rgba(255, 255, 255, 0.045);
  --font-display: lft-etica, sans-serif;
  --font-body: myriad-variable, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --on-amber: #000000;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-stretch: 95%;
  font-variation-settings: "wdth" 95;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--amber); text-decoration: none; }
a:hover { color: var(--amber-hi); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
h1, h2, h3 { font-stretch: 100%; font-variation-settings: normal; font-family: var(--font-display); font-weight: 600; letter-spacing: -0.025em; margin: 0; text-wrap: balance; }
p { margin: 0; }
code, .mono { font-family: var(--font-mono); }

.wrap {
  max-width: 1296px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px), 4vw);
  padding-right: max(16px, env(safe-area-inset-right, 0px), 4vw);
}
@media (min-width: 1400px) { .wrap { padding-left: 48px; padding-right: 48px; } }

/* Header */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 32px; padding-top: 16px; padding-bottom: 16px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); min-width: 0; }
.brand:hover { color: var(--ink); }
.brand svg { flex: none; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -0.02em; }
.brand-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.brand-name { line-height: 1.1; }
.brand-full { font-family: var(--font-mono); font-size: 11px; line-height: 1.25; color: var(--muted); }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--soft); font-size: 15px; font-weight: 500; padding: 10px 14px; min-height: 44px; display: inline-flex; align-items: center; border-radius: 4px; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--amber); }

/* Page head */
.page-head { padding-top: clamp(28px, 5vw, 56px); padding-bottom: clamp(20px, 3vw, 32px); display: flex; flex-direction: column; gap: 12px; }
.eyebrow { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--amber); }
.page-head h1 { font-size: 34px; line-height: 1.1; }
.lede { color: var(--soft); font-size: 17px; max-width: 62ch; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); }
.site-footer .wrap { padding-top: 28px; padding-bottom: 40px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 40px; color: var(--muted); font-size: 13px; }
.site-footer p { max-width: 70ch; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.site-footer nav a { color: var(--soft); }


/* Help page */
.help { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; padding-bottom: 72px; align-items: start; }
@media (max-width: 860px) { .help { grid-template-columns: minmax(0, 1fr); gap: 24px; } }
.toc { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 860px) { .toc { position: static; flex-direction: row; flex-wrap: wrap; gap: 4px 6px; } }
.toc a { color: var(--soft); font-size: 14px; padding: 8px 10px; border-radius: 4px; min-height: 40px; display: inline-flex; align-items: center; }
.toc a:hover { color: var(--amber); background: var(--raised); }
.doc { font-family: myriad-variable, sans-serif; display: flex; flex-direction: column; gap: 44px; min-width: 0; max-width: 78ch; }
.doc section { scroll-margin-top: 16px; display: flex; flex-direction: column; gap: 14px; }
.doc h2 { font-size: 28px; line-height: 1.1; }
.doc h3 { font-size: 18px; margin-top: 8px; }
.doc p, .doc li { color: var(--soft); font-size: 17px; line-height: 1.6; }
.doc ul, .doc ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.doc strong { color: var(--ink); font-weight: 600; }
.doc code { font-size: 13px; background: var(--raised); border: 1px solid var(--line); border-radius: 3px; padding: 1px 6px; color: var(--ink); }
details { border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
details summary { cursor: pointer; padding: 14px 16px; min-height: 48px; color: var(--ink); font-weight: 500; }
details[open] summary { border-bottom: 1px solid var(--line); }
details p { padding: 14px 16px; }

/* Light background. Chosen with the toggle in the header; Method and Help open light the first time. */
html[data-theme="light"] {
  --bg: #fafaf8;
  --surface: #ffffff;
  --raised: #f1f1ee;
  --line: #e3e3de;
  --line-strong: #c8c8c1;
  --ink: #111113;
  --soft: #46464c;
  --muted: #6a6a72;
  --amber: #a85f00;
  --amber-hi: #7a4400;
  --amber-soft: rgba(168, 95, 0, 0.1);
  --ok: #2f6b3f;
  --danger: #b3401a;
  --danger-soft: rgba(179, 64, 26, 0.08);
  --proj: rgba(0, 0, 0, 0.04);
  --on-amber: #ffffff;
  color-scheme: light;
}
.themebtn { font: inherit; color: var(--soft); background: transparent; border: 1px solid var(--line-strong); border-radius: 4px; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; margin-left: 8px; }
.themebtn:hover { color: var(--amber); border-color: var(--amber); }

/* The finder */
.search { position: relative; flex: none; width: 100%; }
.search input { width: 100%; min-height: 44px; padding: 0 14px; font-size: 15px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 6px; }
.search input::placeholder { color: var(--muted); }
.hits { position: absolute; z-index: 20; left: 0; right: 0; top: 48px; max-height: 60vh; overflow: auto; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 6px; box-shadow: 0 12px 32px rgba(0,0,0,.25); }
.hit { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 9px 14px; cursor: pointer; }
.hit:last-child { border-bottom: 0; }
.hit:hover, .hit[aria-selected="true"] { background: var(--amber-soft); }
.hit b { font: 500 13px var(--font-mono); color: var(--amber); margin-right: 8px; }
.hit span.in { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.hit mark { background: var(--amber-soft); color: var(--ink); border-radius: 2px; }
.nohit { padding: 12px 14px; color: var(--muted); }

.panes { flex: 1 1 auto; min-height: 0; display: grid; gap: 12px; grid-template-columns: minmax(380px, 560px) minmax(0, 1fr); }
.pane { min-height: 0; min-width: 0; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.phead { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-right: 12px; border-bottom: 1px solid var(--line); min-height: 44px; }
.phead h2 { margin: 0; padding: 11px 14px; font: 500 11px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.scroll { overflow: auto; min-height: 0; flex: 1 1 auto; }
.strip { flex: 1; width: 100%; background: none; border: 0; cursor: pointer; display: flex; align-items: flex-start; justify-content: center; padding: 14px 0; color: var(--soft); }
.strip:hover { background: var(--amber-soft); color: var(--ink); }
.strip span { writing-mode: vertical-rl; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-height: 100%; font-size: 13px; }
.strip b { color: var(--amber); font: 500 12px var(--font-mono); }

.chap, .sec { display: block; width: 100%; text-align: left; padding: 10px 14px; background: none; border: 0; border-left: 3px solid transparent; border-bottom: 1px solid var(--line); cursor: pointer; color: var(--soft); }
.chap:hover, .sec:hover { background: var(--raised); color: var(--ink); }
.chap[aria-current="true"], .sec[aria-current="true"] { border-left-color: var(--amber); background: var(--amber-soft); color: var(--ink); }
.chap .nick { display: block; font: 500 11px var(--font-mono); letter-spacing: .05em; text-transform: uppercase; color: var(--amber); }
.chap .off { color: var(--muted); font: 11.5px var(--font-mono); }
.chap .rng, .sec .c { display: block; font: 12px var(--font-mono); color: var(--muted); margin-top: 2px; }
.sec .c { color: var(--amber); font-weight: 500; margin: 0 0 1px; }
.chap.dim { opacity: .55; }

.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--soft); cursor: pointer; white-space: nowrap; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 32px; height: 18px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); transition: transform .15s; }
.switch input:checked + .track { background: var(--amber); }
.switch input:checked + .track::after { transform: translateX(14px); background: var(--on-amber); }
.switch input:focus-visible + .track { outline: 2px solid var(--amber); outline-offset: 2px; }
.count { padding: 8px 14px; font: 12px var(--font-mono); color: var(--muted); border-bottom: 1px solid var(--line); }

.outline, .outline ul { list-style: none; margin: 0; padding: 0; }
.chaprow { display: flex; align-items: flex-start; width: 100%; text-align: left; background: var(--surface); border: 0; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; padding: 11px 14px 11px 11px; cursor: pointer; color: var(--soft); gap: 8px; }
.chaprow:hover { background: var(--raised); color: var(--ink); }
.chaprow .arr { flex: none; width: 14px; color: var(--muted); font: 12px var(--font-mono); margin-top: 2px; }
.chaprow .nick { display: block; font: 500 11px var(--font-mono); letter-spacing: .05em; text-transform: uppercase; color: var(--amber); }
.chaprow .nm { color: var(--ink); font-weight: 500; }
.chaprow .rng { display: block; font: 12px var(--font-mono); color: var(--muted); margin-top: 1px; }
.chaprow.dim { opacity: .55; }
li.on > .chaprow { border-left-color: var(--amber); background: linear-gradient(var(--amber-soft), var(--amber-soft)), var(--surface); position: sticky; top: 0; z-index: 3; }
li.on > .chaprow.sel { box-shadow: inset 0 -2px 0 var(--amber); }
.groups { background: var(--bg); }
.grouprow { display: flex; align-items: flex-start; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 9px 14px 9px 30px; gap: 8px; cursor: pointer; color: var(--soft); }
.grouprow:hover { background: var(--raised); color: var(--ink); }
.grouprow .arr { flex: none; width: 14px; color: var(--muted); font: 12px var(--font-mono); margin-top: 2px; }
.grouprow .c { font: 500 12.5px var(--font-mono); color: var(--amber); display: block; }
li.on2 > .grouprow { background: var(--raised); color: var(--ink); border-left: 3px solid var(--amber); padding-left: 27px; position: sticky; top: var(--chapH, 0px); z-index: 2; }
li.on2 > .grouprow.sel { background: linear-gradient(var(--amber-soft), var(--amber-soft)), var(--raised); }
.codes { padding: 4px 0 8px 36px; background: var(--bg); }
.codes .row { }
.notin { padding: 12px 14px 14px 34px; color: var(--muted); font-size: 13px; background: var(--bg); border-bottom: 1px solid var(--line); }
.tree { list-style: none; margin: 0; padding: 4px 0; }
.tree ul { list-style: none; margin: 0 0 4px 17px; padding: 0; border-left: 1px solid var(--line-strong); }
.tree > li + li { margin-top: 2px; }
.tree ul .row { padding-left: 4px; }
.tree ul .tog { width: 30px; }
.tree ul .node { padding-top: 6px; padding-bottom: 6px; font-size: 13.5px; }
.tree ul .node .c { font-size: 12.5px; }
.row { display: flex; align-items: flex-start; }
.tog { flex: none; width: 34px; min-height: 36px; background: none; border: 0; color: var(--muted); cursor: pointer; font: 12px var(--font-mono); }
.tog:hover { color: var(--amber); }
.tog.leaf { cursor: default; }
.node { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 7px 10px 7px 0; cursor: pointer; border-radius: 4px; color: var(--soft); }
.node:hover { color: var(--ink); }
.node .c { font: 500 13px var(--font-mono); color: var(--amber); margin-right: 8px; }
.node .d { overflow-wrap: anywhere; }
.row.sel { background: var(--amber-soft); }
.row.sel .node { color: var(--ink); }
.lv2 > .row .node .d { font-weight: 500; color: var(--ink); }
.flat { list-style: none; margin: 0; padding: 4px 0; }
.flat .node { padding-left: 14px; }

.detail { padding: 24px 22px 24px; }
.path { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 4px; font-size: 12.5px; color: var(--muted); max-width: 95ch; }
.path button { background: none; border: 0; padding: 2px 0; color: var(--soft); cursor: pointer; text-align: left; }
.path button:hover { color: var(--amber); }
.path .sep { color: var(--line-strong); padding: 0 3px; }
.path .m { font-family: var(--font-mono); color: var(--amber); }
.codeline { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-top: 12px; }
.bigcode { font: 500 30px var(--font-mono); color: var(--amber); letter-spacing: -.02em; }
.desc { font-size: 19px; font-weight: 500; margin: 6px 0 0; max-width: 62ch; text-wrap: balance; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag { font: 500 11px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border: 1px solid var(--line-strong); border-radius: 3px; color: var(--soft); }
.tag.yes { color: var(--ok); border-color: var(--ok); }
.group { margin-top: 28px; padding-top: 28px; border-top: 1px dashed var(--line); }
.group h3 { margin: 0 0 16px; display: flex; align-items: center; gap: 10px; font: 500 12px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.group h3 i { font-style: normal; text-transform: none; letter-spacing: 0; color: var(--soft); font-family: var(--font-body); font-size: 12px; }
.group.stop h3 { color: var(--danger); }
.group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; max-width: 78ch; }
.group li { padding: 0; overflow-wrap: anywhere; line-height: 1.5; }
.group li .from { display: block; font: 11px var(--font-mono); color: var(--muted); margin-top: 2px; }
.ref { background: none; border: 0; padding: 0; font: 500 13px var(--font-mono); color: var(--amber); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.ref.dim { color: var(--muted); cursor: default; text-decoration: none; }
.none { color: var(--muted); font-size: 13px; }
.empty { padding: 24px 18px; color: var(--muted); }
.note { font-size: 12px; color: var(--muted); margin: 28px 0 0; padding-top: 24px; border-top: 1px dashed var(--line); }
.sibs { margin-top: 22px; }
.sibs h3 { margin: 0 0 8px; font: 500 12px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.sibs h3 i { font-style: normal; text-transform: none; letter-spacing: 0; color: var(--soft); font-family: var(--font-body); font-size: 12px; margin-left: 8px; }
.sibbox { border: 1px solid var(--line); border-radius: 6px; max-height: 190px; overflow: auto; max-width: 78ch; }
.sib { display: flex; gap: 10px; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 7px 12px; cursor: pointer; color: var(--soft); }
.sib:last-child { border-bottom: 0; }
.sib:hover { background: var(--amber-soft); color: var(--ink); }
.sib b { font: 500 12.5px var(--font-mono); color: var(--amber); min-width: 62px; }
.sib.me { background: var(--amber-soft); color: var(--ink); cursor: default; }
.sib .d { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 900px) { body.finder { height: auto; display: block; } body.finder .app { display: flex; } .panes { grid-template-columns: minmax(0, 1fr); } .pane { max-height: 70vh; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* Full-height layout for the finder page */
body.finder { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
body.finder .app { flex: 1 0 auto; display: flex; flex-direction: column; gap: 12px; padding-top: 14px; padding-bottom: 16px; max-width: 1560px; }
@media (max-width: 900px) { body.finder { height: auto; display: block; } }
body.finder .site-header .wrap, body.finder .site-footer .wrap { max-width: 1560px; }
body.finder .page-head { padding-top: 16px; padding-bottom: 6px; flex: none; }
body.finder .page-head h1 { font-size: 28px; }
body.finder .panes { flex: none; height: clamp(460px, calc(100dvh - 440px), 900px); }
@media (max-width: 900px) { body.finder .panes { height: auto; } }
body { font-weight: 450; }
