/* Colours sampled from the reference worklist. Dark chrome only: the mock imitates a fixed
   product, so it has no light theme. */
:root {
  --ui-scale: 1;
  --tabbar: #22252d; --chrome: #2e313b; --gold: #d7a34c; --gold-text: #d09840; --gold-bar: #d89d49;
  --content: #7894bb; --card: #fefefe; --chip: #f9f2d9; --badge: #f20809;
  --search: #dce6fa; --start: #f7eed3; --colhdr: #cccccc; --colhdr-ink: #383848;
  --band: #999999; --band-tab: #737373; --left: #a6c0e5; --left-ink: #1c2f4d; --left-held-ink: #253a58;
  --navy: #3e557b; --navy-sep: #7e95bb; --navy-shadow: #2f476a; --navy-hi: #b1cbef; --navy-sel: #4e6894;
  --ink-hi: #f3f8f7; --ink-2: #b7c7de; --flag-ink: #e2c48e;
  --btn: #e5ebfb; --btn-border: #a8bbdb; --btn-r: #d9e5f1;
  --stat: #ed1e24; --urgent: #f16b6c; --modality: #868581; --ai: #f6eb13; --chip-c: #7892b4;
  --sidebar-sub: #909098; --scroll: #767674; --muted-ink: #686868; --muted-ink-2: #787880;

  --sr-tabstrip: #38393d; --sr-pt-tab: #47484c; --banner: #404348; --banner-ink: #edf1f4;
  --banner-label: #a3a4a8; --pill-code: #f5cec7; --pill-hm: #d5fccd; --sr-header: #d4d5da;
  --sr-rail: #42424c; --sr-rail-tile: #595d66; --sr-rail-active: #d5d6da; --sr-bg: #292a2e;
  --sr-sep: #4d4e52; --rel-heading: #4cc5fe; --prior-ink: #ffffdf; --compare: #999999;
  --sr-tab-active: #494a4e; --sr-tab: #c8c9cd; --summary-bg: #282a2d; --summary-heading: #07c3ee;
  --proc-orange: #d6832d; --warn: #ff4b40; --report-btn-active: #94e6d7;
  color-scheme: dark;
}
/* A booth screen is 1440-1920 px wide; the source design is about 1000 px. */
@media (min-width: 1400px) { :root { --ui-scale: 1.25; } }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--tabbar); }
body {
  font: 13px/1.25 Tahoma, Verdana, "Segoe UI", Geneva, sans-serif;
  color: #f8f8f8;
  zoom: var(--ui-scale);
}
button, input { font: inherit; }
button { cursor: pointer; }
svg { display: block; }

#app {
  display: grid;
  grid-template-rows: 29px 14px minmax(0, 1fr);
  height: calc(100vh / var(--ui-scale));
  width: calc(100vw / var(--ui-scale));
}

/* ---- top tab bar ---- */
#tabbar { display: flex; align-items: stretch; background: var(--tabbar); min-width: 0; }
#tabs { display: flex; min-width: 0; overflow: hidden; }
.tab {
  width: 95px; flex: none; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 0 6px; font-size: 14px; color: #e0e0e4; border: 0; border-top: 3px solid transparent;
  background: transparent; white-space: nowrap;
}
.tab.active { background: var(--chrome); border-top-color: var(--gold); color: #f8f8f8; font-weight: bold; }
.tab.patient { width: auto; max-width: 190px; padding-right: 4px; }
.tab.patient .label { overflow: hidden; text-overflow: ellipsis; }
.tab .x { width: 16px; height: 16px; border: 0; background: none; color: #c8c8cc; padding: 0; font-size: 14px; line-height: 16px; }
.tab .x:hover { color: #fff; }
#tabbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; padding-right: 8px; white-space: nowrap; }
#who { font-size: 13px; color: #f8f8f8; }
.round-icon {
  width: 20px; height: 20px; border-radius: 50%; border: 1px solid #9a9aa0; background: transparent;
  color: #e0e0e4; display: grid; place-items: center; padding: 0;
}
.linkish { background: none; border: 0; color: #9aa0ab; font-size: 11px; padding: 0; text-decoration: underline; }
.cast { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: #9aa0ab; }
.cast::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #6b707c; }
.cast.ok::before { background: #4fbf6a; }
.cast.failed::before { background: #e5484d; }
.cast.failed { color: #f0a0a0; }
#strip { background: var(--chrome); }
#main { min-height: 0; min-width: 0; overflow: hidden; }

/* ---- sign in ---- */
.signin-wrap { height: 100%; background: var(--content); display: grid; place-items: center; }
form.signin {
  width: 320px; background: var(--card); color: #202028; border: 1px solid #333; padding: 18px 20px;
  display: grid; gap: 9px;
}
form.signin h1 { margin: 0; font-size: 15px; }
form.signin label { display: grid; gap: 3px; font-size: 12px; color: var(--muted-ink); }
form.signin input { padding: 3px 6px; border: 1px solid #333; background: var(--search); color: #202028; }
.start-btn {
  height: 21px; background: var(--start); border: 2px solid #333; border-radius: 4px;
  font-weight: bold; font-size: 12px; color: #202020; padding: 0 10px;
}
.error { color: #b3261e; font-size: 12px; }
.note { color: var(--muted-ink-2); font-size: 12px; }

/* ---- reading view ---- */
.reading { display: grid; grid-template-columns: 178px minmax(0, 1fr); height: 100%; }
.sidebar { background: var(--chrome); display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; min-height: 0; }
.sidebar h2 {
  margin: 0; padding: 4px 2px 0; display: flex; justify-content: space-between; align-items: center;
  font-size: 15px; color: var(--gold-text);
}
.sidebar h2 .chev { color: #fff; font-size: 16px; padding-right: 6px; }
.side-tools { display: flex; gap: 7px; justify-content: flex-end; padding: 5px 22px 6px 0; }
.side-list { overflow-y: scroll; padding-bottom: 6px; scrollbar-color: var(--scroll) var(--chrome); }
.tree-root { display: flex; align-items: center; gap: 8px; padding: 0 0 3px 6px; font-weight: bold; font-size: 14px; }
.filter { display: grid; grid-template-columns: 11px 1fr; column-gap: 4px; padding: 3px 0 4px 15px; cursor: pointer; }
.filter .box {
  width: 11px; height: 11px; background: #fff; margin-top: 2px; display: grid; place-items: center;
  color: #111; font-size: 10px; line-height: 1;
}
.filter .name { font-weight: bold; font-size: 13px; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filter.on .name { border-left: 3px solid var(--gold-bar); padding-left: 5px; margin-left: 1px; }
.filter .sub { grid-column: 2; font-style: italic; font-size: 12px; color: var(--sidebar-sub); }
.side-foot { padding: 6px 0 8px; }
.side-foot div { padding: 0 2px; font-size: 14px; line-height: 21px; color: #f8f8f8; }

.content { background: var(--content); padding: 15px 12px 0 12px; display: grid; grid-template-rows: auto auto minmax(0, 1fr); min-height: 0; min-width: 0; }
.card-row1 { display: flex; height: 27px; }
.card-row1 .white { background: var(--card); display: flex; align-items: center; color: #202028; }
.card-row1 .title { width: 210px; text-align: center; font-weight: bold; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-row1 .icons { display: flex; gap: 6px; padding: 0 22px 0 14px; }
.lifering { width: 20px; height: 20px; }
.refresh-btn { width: 20px; height: 20px; border-radius: 50%; background: #e8e8e8; border: 1px solid #555; color: #333; display: grid; place-items: center; padding: 0; }
.badge { width: 19px; height: 27px; background: var(--badge); color: #fff; font-weight: bold; display: grid; place-items: center; font-size: 13px; min-width: 19px; padding: 0 3px; width: auto; }
.card-row2 { background: var(--card); color: #303030; display: flex; align-items: center; padding: 4px 10px; gap: 10px; min-height: 38px; }
.card-row2 .filters-text { flex: 1; min-width: 0; }
.card-row2 .l1 { font-size: 13px; color: var(--muted-ink); white-space: nowrap; }
.card-row2 .l2 { font-size: 12px; color: var(--muted-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip { background: var(--chip); font-weight: bold; color: #303030; padding: 0 4px; }
.search { width: 144px; height: 20px; background: var(--search); border: 1px solid #333; border-radius: 0; padding: 0 4px; color: #202028; font-size: 12px; }
.sq-btn { width: 18px; height: 18px; background: #fff; border: 1px solid #222; border-radius: 3px; color: #222; display: grid; place-items: center; padding: 0; }
.tools-right { display: flex; align-items: center; gap: 4px; }
.tools-right .start-btn { width: 120px; margin-left: 40px; }

.list { min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-color: var(--scroll) var(--content); }
.grid-cols { display: grid; grid-template-columns: 188px 170px minmax(220px, 1fr) 150px 110px 130px; }
.colhdr { background: var(--colhdr); color: var(--colhdr-ink); font-weight: bold; font-size: 13px; height: 21px; align-items: center; position: sticky; top: 0; z-index: 2; }
.colhdr > div { padding-left: 8px; white-space: nowrap; overflow: hidden; }
.band { height: 21px; background: var(--band); border-top: 3px solid #8e919c; position: relative; }
.band .tab-shape {
  position: absolute; left: 0; top: 0; bottom: 0; width: 190px; background: var(--band-tab);
  clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 100%, 0 100%);
  font-weight: bold; font-size: 14px; text-transform: uppercase; color: #f8f8f8; padding-left: 5px; line-height: 18px;
}

.row { height: 40px; cursor: default; user-select: none; }
.row > .cell { background: var(--navy); border-bottom: 1px solid var(--navy-sep); box-shadow: inset 0 1px 0 var(--navy-shadow); padding: 2px 6px; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.row > .left { background: var(--left); border-bottom: 1px solid #7c96bb; box-shadow: inset 0 1px 0 #b1cbef; padding: 0; flex-direction: row; justify-content: flex-start; color: var(--left-ink); }
.row.sel > .cell:not(.left) { background: var(--navy-sel); }
.row.sel { outline: 2px solid var(--gold); outline-offset: -2px; position: relative; z-index: 1; }
.l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 17px; }
.split { display: flex; justify-content: space-between; gap: 4px; }
.split > :first-child { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.b13 { font-weight: bold; font-size: 13px; color: #f0f8f8; }
.b14 { font-weight: bold; font-size: 14px; color: var(--ink-hi); }
.r13 { font-size: 13px; color: #fff; }
.i12 { font-style: italic; font-size: 12px; color: var(--ink-2); }
.i125 { font-style: italic; font-size: 12.5px; color: var(--ink-2); }
.n12 { font-style: normal; font-size: 12px; color: var(--ink-2); }
.row.flagged .flaggable { color: var(--flag-ink); }
.ai-badge { display: inline-block; width: 15px; height: 15px; background: var(--ai); color: #303000; font-weight: bold; font-size: 10px; line-height: 15px; text-align: center; margin-right: 4px; vertical-align: 1px; }

.status-letter { width: 17px; flex: none; display: grid; place-items: center; font-weight: bold; font-size: 17px; color: var(--left-ink); }
.status-letter.stat { background: var(--stat); color: #101010; }
.status-letter.urgent { background: var(--urgent); color: #101010; }
.mod-glyph { width: 17px; flex: none; background: var(--modality); display: grid; place-items: center; }
.mod-glyph.call { background: #000; }
.wait { width: 34px; flex: none; text-align: center; font-size: 20px; line-height: 18px; color: var(--left-ink); display: grid; place-items: center; }
.clock { width: 62px; flex: none; font-weight: bold; font-size: 12px; display: grid; place-items: center; white-space: nowrap; }
.held-avatar { width: 36px; height: 36px; margin: 2px; flex: none; position: relative; background: #f0f0f0; }
.held-avatar .lock { position: absolute; right: 1px; bottom: 1px; }
.held-mid { flex: 1; display: flex; flex-direction: column; justify-content: center; padding-left: 4px; min-width: 0; }
.held-top { display: flex; align-items: center; gap: 4px; font-weight: bold; font-size: 12px; }
.chip-c { width: 16px; height: 18px; background: var(--chip-c); display: grid; place-items: center; font-weight: bold; font-size: 15px; color: var(--left-ink); }
.chip-c.stat { background: #e00000; color: #101010; }
.chip-c.urgent { background: var(--urgent); color: #101010; }
.held-sub { font-size: 12px; color: var(--left-held-ink); white-space: nowrap; }
.btns { margin-left: auto; display: flex; gap: 2px; align-items: center; padding-right: 4px; }
.btn-col { display: flex; flex-direction: column; gap: 2px; }
.rbtn { width: 36px; height: 17px; background: var(--btn); border: 1px solid var(--btn-border); border-radius: 3px; font-size: 12px; color: #202838; padding: 0; line-height: 15px; }
.rbtn:hover { background: #fff; }
.rsq { width: 16px; height: 17px; background: var(--btn-r); border: 1px solid var(--btn-border); border-radius: 3px; font-size: 12px; color: #202838; padding: 0; display: grid; place-items: center; line-height: 1; }
.rsq.drop { background: #dce8f3; }
.empty { padding: 24px; color: #fff; font-style: italic; }

/* ---- study review ---- */
.study { height: 100%; display: grid; grid-template-rows: auto 30px 24px minmax(0, 1fr); background: var(--sr-bg); min-width: 0; }
.banner { background: var(--banner); padding: 6px 8px; display: grid; grid-template-columns: minmax(200px, 300px) 170px 200px minmax(0, 1fr) 240px; gap: 14px; font-size: 12px; color: var(--banner-ink); min-height: 64px; }
.banner .pname { font-weight: bold; font-size: 15px; color: #fff; }
.banner .lab { color: var(--banner-label); }
.banner .right { grid-column: 5; }
.banner .right div { line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill-code { background: var(--pill-code); color: #222; padding: 0 4px; }
.pill-hm { background: var(--pill-hm); color: #222; padding: 0 4px; }
.study-head { background: var(--sr-header); color: #1a1a1a; display: flex; align-items: center; padding: 0 6px; gap: 8px; }
.study-head .t { font-size: 19px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; font-family: "Segoe UI", Tahoma, sans-serif; }
.study-head button { background: none; border: 0; color: #333; font-size: 16px; width: 18px; padding: 0; }
.toolbar { background: var(--sr-header); border-top: 1px solid #b8b9be; display: flex; align-items: center; gap: 2px; padding: 0 4px; color: #1a1a1a; font-size: 12px; white-space: nowrap; overflow: hidden; }
.toolbar button { display: inline-flex; align-items: center; gap: 3px; background: none; border: 1px solid transparent; color: #1a1a1a; padding: 1px 4px; font-size: 12px; }
.toolbar button:hover { border-color: #9a9ba0; background: #e4e5ea; }
.toolbar button:disabled { color: #808080; cursor: default; }
.toolbar .sep { width: 1px; height: 16px; background: #9a9ba0; margin: 0 4px; }
.toolbar u { text-decoration: underline; }
.study-body { display: grid; grid-template-columns: 125px minmax(0, 45fr) minmax(0, 55fr); gap: 0; min-height: 0; }
.rail { background: var(--sr-rail); padding: 6px 0; display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.rail .tile { height: 96px; background: var(--sr-rail-tile); margin: 0 4px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px; font-weight: bold; font-size: 12px; color: #fff; text-align: center; }
.rail .open { background: var(--sr-rail-active); color: #000; font-weight: bold; font-size: 12px; padding: 3px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 4px; }
.priors { background: var(--sr-bg); display: grid; grid-template-rows: 26px minmax(0, 1fr); min-height: 0; border-right: 6px solid #1e1f22; }
.subtabs { display: flex; gap: 2px; padding: 4px 6px 0; }
.subtabs button { height: 22px; border: 0; border-radius: 0; padding: 0 16px; background: var(--sr-tab); color: #222; font-size: 13px; }
.subtabs button.on { background: var(--sr-tab-active); color: #fff; }
.prior-list { overflow-y: auto; padding: 4px 8px 10px; border-top: 2px solid var(--sr-tab-active); }
.rel-h { font-weight: bold; font-style: italic; font-size: 14px; color: var(--rel-heading); padding: 4px 0 2px 18px; }
.prior { min-height: 22px; border-bottom: 1px solid var(--sr-sep); display: flex; align-items: center; gap: 6px; cursor: pointer; }
.prior:hover, .prior.on { background: #36383d; }
.prior .pt { flex: 1; font-weight: bold; font-size: 13px; color: var(--prior-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prior .pt .st { font-weight: normal; font-style: italic; color: #b8b8a0; font-size: 12px; }
.prior.noreport .pt { color: #b9b9a8; }
.prior .doc { width: 14px; height: 14px; flex: none; color: #e8e8d0; }
.compare { width: 72px; height: 18px; background: var(--compare); color: #fff; border: 0; font-size: 12px; padding: 0; flex: none; }
.snippet { font-size: 13px; color: var(--prior-ink); padding: 4px 4px 6px 18px; border-bottom: 1px solid var(--sr-sep); }
.overview { padding: 8px 4px; font-size: 13px; color: var(--prior-ink); }
.overview td { padding: 2px 12px 2px 0; }
.muted-note { color: #9a9ba0; font-style: italic; font-size: 12px; padding: 8px 4px; }

.summary { display: grid; grid-template-rows: 24px 26px minmax(0, 1fr); min-height: 0; background: var(--summary-bg); }
.sum-tabs { display: flex; gap: 2px; padding: 2px 4px 0; background: #c8c9cd; }
.sum-tabs span { padding: 3px 10px 0; font-size: 12px; background: #dcdde1; color: #444; white-space: nowrap; }
.sum-tabs span.on { background: #5c6065; color: #fff; }
.sum-bar { background: var(--sr-header); display: flex; align-items: center; gap: 4px; padding: 0 4px; font-size: 12px; color: #1a1a1a; white-space: nowrap; overflow: hidden; }
.sum-bar .on { background: var(--report-btn-active); border: 1px solid #5ab; }
.sum-bar span { padding: 1px 5px; border: 1px solid transparent; }
.sum-bar .find { margin-left: auto; display: flex; align-items: center; background: #fff; border: 1px solid #999; height: 18px; width: 150px; padding: 0 3px; color: #555; justify-content: space-between; }
.sum-body { overflow-y: auto; padding: 6px 10px 16px; font-size: 12px; color: #fff; }
.sum-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 1px solid var(--proc-orange); padding-bottom: 2px; gap: 10px; }
.sum-head .proc { color: var(--proc-orange); font-weight: bold; font-size: 13px; }
.sum-head .ids { text-align: right; color: var(--proc-orange); font-size: 12px; }
.warnline { color: var(--warn); font-weight: bold; font-size: 12px; text-align: right; padding: 2px 0; }
.sum-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; margin-top: 6px; }
.sec { margin-top: 10px; }
.sec h3 { margin: 0 0 3px; font-size: 13px; color: var(--summary-heading); text-decoration: underline; border-bottom: 1px solid var(--summary-heading); font-weight: bold; padding-bottom: 1px; }
.sec .body { padding-left: 12px; line-height: 1.35; }
.sec .kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px; }
.sec .kv .lab { color: #b8b9be; }
table.pcp { border-collapse: collapse; width: 100%; margin-top: 2px; }
table.pcp th { background: #3b3e42; font-weight: normal; text-align: left; color: #ccc; padding: 1px 4px; }
table.pcp td { padding: 1px 4px; }

.report { overflow-y: auto; padding: 8px 12px 16px; color: #f0f0f0; font-size: 13px; }
.report .rh { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--proc-orange); padding-bottom: 4px; }
.report .rh .proc { color: var(--proc-orange); font-weight: bold; }
.report .meta { display: grid; grid-template-columns: auto 1fr; gap: 1px 10px; margin: 6px 0 10px; font-size: 12px; }
.report .meta .lab { color: #9a9ba0; }
.report pre { white-space: pre-wrap; font: 13px/1.45 Tahoma, Verdana, "Segoe UI", sans-serif; margin: 0; }
.report pre b { color: #fff; }
.report .close { background: #d4d5da; border: 1px solid #888; color: #222; font-size: 12px; padding: 0 8px; height: 20px; }
