/* PathoPod Consult: one stylesheet, system fonts, nothing from other sites. The LIS's palette (haematoxylin and eosin). */
:root {
  --bg: #f6f5fa; --surface: #ffffff; --surface-2: #f3f2fa; --surface-3: #e8e7f6;
  --ink: #1c1b2e; --ink-2: #44435c; --muted: #5f6075; --line: #dedeeb; --line-strong: #c3c2d9;
  --hema: #38358c; --hema-hover: #2d2b73; --hema-soft: #e8e7f6; --on-hema: #ffffff;
  --eosin: #a7365a; --ok: #1f7a4d; --ok-bg: #e1f3e9; --warn: #8f5209; --warn-bg: #fbebd0; --bad: #b3322c; --bad-bg: #fbe3e1; --info-bg: #e0eaf8;
  --focus: #2a6bd6; --shadow: 0 1px 2px rgba(28,27,46,.07), 0 2px 8px rgba(28,27,46,.05); --radius: 8px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
html { font-size: 14px; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.45; }
h1, h2, h3 { margin: 0 0 .3em; line-height: 1.2; font-weight: 650; } h1 { font-size: 1.4rem; } h2 { font-size: 1.05rem; } h3 { font-size: .9rem; color: var(--ink-2); }
p { margin: 0 0 .6em; } a { color: var(--hema); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.app { display: flex; flex-direction: column; height: 100%; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px; background: #25235f; color: #e9e8f7; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; font-size: 1.05rem; }
.brand-wrap { display: flex; align-items: center; gap: 12px; min-width: 0; }
.site-tag { display: flex; flex-direction: column; line-height: 1.2; padding-left: 12px; border-left: 1px solid rgba(233,232,247,.35); min-width: 0; }
.site-org { font-weight: 600; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-campus { font-size: .8rem; color: #b9b8e0; white-space: nowrap; }
.site-banner { text-align: center; padding: 10px 8px 14px; margin: -4px 0 4px; border-bottom: 1px solid var(--line); }
.site-banner-org { font-size: 1.15rem; font-weight: 700; color: var(--hema); line-height: 1.3; }
.site-banner-campus { margin-top: 4px; display: inline-block; font-weight: 600; font-size: .92rem; color: var(--eosin); background: #f8e8ee; border-radius: 12px; padding: 2px 12px; }
.brand > span { white-space: nowrap; }
@media (max-width: 720px) { .site-org { max-width: 46vw; } }
@media (max-width: 480px) { .brand > span { display: none; } .site-tag { padding-left: 10px; } .site-org { max-width: 70vw; } }
.top-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.top .muted { color: #b9b8e0; }
.nav { display: flex; gap: 14px; } .nav a { color: #e9e8f7; text-decoration: none; font-weight: 600; } .nav a:hover { text-decoration: underline; }
.who { display: inline-flex; align-items: center; gap: 6px; }
.main { flex: 1; min-height: 0; overflow: auto; }
.page { max-width: 1180px; margin: 0 auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.center { display: grid; place-items: start center; padding: 40px 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card.narrow { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 10px; } .row > * { flex: 1; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.field { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .9rem; } .field > span { color: var(--ink-2); }
.input { font: inherit; font-weight: 400; padding: 7px 9px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--ink); width: 100%; }
textarea.input { resize: vertical; } .input.code { font: 600 1.4rem var(--mono); letter-spacing: .3em; text-align: center; } .mono { font-family: var(--mono); }
.btn { display: inline-flex; align-items: center; gap: 6px; font: 600 .9rem var(--font); padding: 7px 12px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; }
.btn:hover:not(:disabled) { background: var(--surface-2); } .btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--hema); border-color: var(--hema); color: var(--on-hema); } .btn.primary:hover:not(:disabled) { background: var(--hema-hover); }
.btn.danger { color: var(--bad); border-color: var(--bad); } .btn.ghost { background: none; border-color: transparent; color: inherit; } .btn.ghost:hover { background: rgba(255,255,255,.12); }
.btn.wide { justify-content: center; width: 100%; } .btn.small { padding: 3px 8px; font-size: .8rem; }
.icon-btn { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 3px; border-radius: 4px; display: inline-grid; place-items: center; } .icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.linkish { border: 0; background: none; color: var(--hema); cursor: pointer; padding: 0; font: inherit; display: inline-flex; align-items: center; gap: 4px; text-align: left; } .linkish:hover { text-decoration: underline; }
.small { font-size: .82rem; } .muted { color: var(--muted); } .error { color: var(--bad); } .ok { color: var(--ok); } .pre { white-space: pre-wrap; }
.warn { background: var(--warn-bg); color: var(--warn); border-radius: 6px; padding: 8px 10px; font-size: .88rem; }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 1px 6px; border-radius: 10px; background: var(--surface-3); color: var(--ink-2); margin-left: 6px; vertical-align: middle; }
.empty { padding: 24px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--line-strong); border-top-color: var(--hema); border-radius: 50%; animation: spin .8s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } }
.table { width: 100%; border-collapse: collapse; background: var(--surface); } .table th, .table td { text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--line); vertical-align: top; } .table th { font-size: .8rem; color: var(--muted); font-weight: 600; }
.table tr.clickable { cursor: pointer; } .table tr.clickable:hover { background: var(--surface-2); } .row-actions { display: inline-flex; gap: 8px; margin-left: 6px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; } .facts dt { color: var(--muted); } .facts dd { margin: 0; font-weight: 600; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
ul.plain { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
/* toasts and modals */
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { display: flex; align-items: center; gap: 8px; background: #1f2937; color: #fff; padding: 9px 12px; border-radius: 8px; box-shadow: var(--shadow); max-width: 420px; }
.toast.ok { background: var(--ok); } .toast.error { background: var(--bad); }
.modal-back { position: fixed; inset: 0; background: rgba(20,18,40,.45); display: grid; place-items: center; z-index: 40; padding: 16px; }
.modal { background: var(--surface); border-radius: 10px; width: 100%; max-width: 520px; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 10px 40px rgba(0,0,0,.25); } .modal.wide { max-width: 760px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 6px; } .modal-body { padding: 6px 16px; overflow: auto; } .modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px 16px; }
/* the case page */
.case { display: flex; flex-direction: column; height: 100%; }
.case-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.case-head p { margin: 0; }
.case-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 170px minmax(0, 1fr) 360px; }
.left { border-right: 1px solid var(--line); overflow: auto; background: var(--surface); }
.strip { display: flex; flex-direction: column; gap: 6px; padding: 8px; }
.slide { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); cursor: pointer; text-align: left; font: inherit; }
.slide.on { border-color: var(--hema); box-shadow: 0 0 0 2px var(--hema-soft); } .slide:disabled { cursor: default; opacity: .8; }
.thumb { width: 100%; height: 90px; object-fit: contain; background: #f4f2ee; border-radius: 4px; } .thumb.pending { display: grid; place-items: center; color: var(--muted); }
.slide-label { font-weight: 700; }
.centre { min-width: 0; min-height: 0; display: flex; } .vw-fs { flex: 1; display: flex; min-height: 0; } .stage-wrap { flex: 1; position: relative; min-height: 0; background: #1b1f23; }
.panel { border-left: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.tabs { display: flex; border-bottom: 1px solid var(--line); } .tab { flex: 1; border: 0; background: none; padding: 9px 4px; font: 600 .86rem var(--font); color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; } .tab.on { color: var(--hema); border-bottom-color: var(--hema); }
.pane { flex: 1; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.comments { display: flex; flex-direction: column; gap: 10px; }
.comment { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--surface); } .comment .comment { margin-top: 8px; margin-left: 10px; background: var(--surface-2); }
.comment header { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; margin-bottom: 4px; } .comment .body { white-space: pre-wrap; margin: 0 0 4px; }
.comment.withdrawn .body, .comment.withdrawn > p { text-decoration: line-through; } .comment.flash { box-shadow: 0 0 0 3px #22d3ee; }
.comment-actions { display: flex; gap: 12px; }
.composer { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; position: sticky; bottom: 0; background: var(--surface); }
.composer-row { display: flex; justify-content: space-between; align-items: center; } .context { font-size: .82rem; background: var(--info-bg); padding: 4px 8px; border-radius: 6px; display: flex; justify-content: space-between; }
.author-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
ul.shapes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
ul.shapes li { display: flex; align-items: center; gap: 6px; padding: 3px 4px; border-radius: 5px; flex-wrap: wrap; } ul.shapes li.on { background: var(--hema-soft); } ul.shapes li.withdrawn .linkish { text-decoration: line-through; color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.share { border: 1px solid var(--line); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 4px; } .share .btn { align-self: flex-start; } .share.ended { opacity: .6; }
/* upload */
.drop { border: 2px dashed var(--line-strong); border-radius: 10px; padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; color: var(--ink-2); } .drop.over { border-color: var(--hema); background: var(--hema-soft); }
.progress { position: relative; height: 22px; background: var(--surface-3); border-radius: 6px; overflow: hidden; } .progress .bar { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--hema); transition: width .2s; } .progress span { position: relative; padding: 0 8px; line-height: 22px; color: #fff; mix-blend-mode: difference; }
/* the viewer (the LIS's) */
.vw-stage { position: relative; overflow: hidden; }
.vw-canvas { display: block; width: 100%; height: 100%; outline: none; cursor: grab; touch-action: none; }
.vw-canvas.dragging { cursor: grabbing; }
.vw-canvas:not([data-tool="pan"]) { cursor: crosshair; }
.vw-bar { position: absolute; top: 10px; left: 10px; right: 120px; display: flex; gap: 8px; flex-wrap: wrap; pointer-events: none; }
.vw-group { display: flex; gap: 2px; background: rgba(20,24,28,.84); border-radius: 8px; padding: 3px; pointer-events: auto; }
.vw-btn { min-width: 32px; height: 30px; display: inline-grid; place-items: center; border: 0; border-radius: 6px; background: none; color: #e8eaed; cursor: pointer; font: 600 .82rem var(--font); padding: 0 6px; }
.vw-btn:hover:not(:disabled) { background: rgba(255,255,255,.14); } .vw-btn.on { background: #16a394; color: #fff; } .vw-btn:disabled { opacity: .4; cursor: default; }
.vw-swatches { align-items: center; padding: 3px 6px; gap: 5px; }
.vw-swatch { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); cursor: pointer; padding: 0; } .vw-swatch.on { border-color: #fff; box-shadow: 0 0 0 2px #22d3ee; }
.vw-mag.digital:not(.on) { color: #f2c14e; }
.vw-readout { position: absolute; top: 10px; right: 12px; background: rgba(20,24,28,.84); color: #fff; border-radius: 6px; padding: 5px 10px; font: 700 .9rem var(--font); } .vw-readout:empty { display: none; }
.vw-scale { position: absolute; left: 12px; bottom: 12px; color: #fff; font: 600 .78rem var(--font); background: rgba(20,24,28,.72); padding: 4px 8px 3px; border-radius: 6px; }
.vw-scale-rule { height: 5px; border: 2px solid #fff; border-top: 0; margin-bottom: 2px; }
.vw-mini { position: absolute; right: 12px; bottom: 12px; width: 200px; height: 140px; background: rgba(20,24,28,.84); border: 1px solid rgba(255,255,255,.25); border-radius: 6px; cursor: crosshair; }
.vw-msg { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: 60%; background: rgba(20,24,28,.92); color: #fff; padding: 12px 16px; border-radius: 8px; text-align: center; }
.vw-hint { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); max-width: 50%; background: rgba(20,24,28,.86); color: #fff; padding: 4px 10px; border-radius: 6px; font-size: .8rem; }
.vw-status { position: absolute; right: 12px; bottom: 160px; color: #e8eaed; font-size: .75rem; background: rgba(20,24,28,.72); padding: 2px 8px; border-radius: 6px; }
.vw-status:empty { display: none; }
.vw-fs:fullscreen { background: #1b1f23; width: 100vw; height: 100vh; }
@media (max-width: 1000px) {
  .case-body { grid-template-columns: 1fr; grid-template-rows: auto minmax(360px, 60vh) auto; }
  .left { border-right: 0; border-bottom: 1px solid var(--line); } .strip { flex-direction: row; overflow-x: auto; } .slide { min-width: 130px; }
  .panel { border-left: 0; border-top: 1px solid var(--line); min-height: 50vh; }
}
.card.narrow form { display: flex; flex-direction: column; gap: 10px; }
