:root{
  /* Shared Vesper token set — see econsent/styles.css for the full
     rationale comment; keep this block byte-identical across all three
     apps' styles.css files. */
  --vesper-bg:#f8f9fa;
  --vesper-ink:#212529;
  --vesper-accent:#495057;
  --vesper-warn:#6b4cc8;
  --vesper-warn-bg:#fff3bf;
  --vesper-danger:#c92a2a;
  --vesper-danger-bg:#ffe3e3;
  --vesper-focus:#1a56db;
  --vesper-width-flow:600px;
  --vesper-width-console:900px;
}
*{margin:0;padding:0;box-sizing:border-box}body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;background:var(--vesper-bg);color:var(--vesper-ink);line-height:1.6}#app{max-width:var(--vesper-width-flow);margin:0 auto;padding:16px}header{display:flex;justify-content:space-between;align-items:center;padding:16px 0;border-bottom:2px solid var(--vesper-accent)}h1{font-size:1.1rem;color:var(--vesper-accent)}h2{font-size:1rem;margin-bottom:12px}section{background:#fff;border-radius:8px;padding:24px;margin-top:16px;box-shadow:0 1px 3px rgba(0,0,0,0.08)}form{display:flex;flex-direction:column;gap:12px}label{display:flex;flex-direction:column;gap:4px;font-size:0.9rem}input,select,textarea{padding:10px;border:1px solid #ced4da;border-radius:6px;font-size:1rem;font-family:inherit;width:100%}button{padding:12px;border:none;border-radius:6px;background:var(--vesper-accent);color:#fff;font-size:1rem;cursor:pointer}button:disabled{background:#adb5bd;cursor:not-allowed}.error{color:var(--vesper-danger);font-size:0.85rem}.status{color:#2b8a3e;font-weight:600;margin-top:8px}.hidden{display:none}
/* --- tabs ------------------------------------------------------------- */
nav#tabs{display:flex;gap:4px;margin-top:16px}
nav#tabs button{flex:1;padding:10px 6px;font-size:0.85rem;background:#e9ecef;color:var(--vesper-accent);border-radius:6px 6px 0 0}
nav#tabs button[aria-selected="true"]{background:var(--vesper-accent);color:#fff;font-weight:600}
/* --- summary strip ---------------------------------------------------- */
.summary{display:flex;gap:8px;margin-bottom:16px}
.summary .stat{flex:1;background:#f1f3f5;border-radius:6px;padding:10px;text-align:center}
.summary .stat b{display:block;font-size:1.3rem;color:#212529;line-height:1.2}
.summary .stat span{font-size:0.7rem;color:#6c757d;text-transform:uppercase;letter-spacing:0.03em}
/* --- inline field rows ------------------------------------------------ */
.row{display:flex;gap:12px}
.row label{flex:1}
.checks{display:flex;flex-direction:column;gap:6px;font-size:0.9rem}
.checks label{flex-direction:row;align-items:center;gap:8px}
.checks input{width:auto}
.hint{font-size:0.78rem;color:#6c757d;font-weight:400}
/* --- history lists ---------------------------------------------------- */
.entries{list-style:none;margin-top:8px;font-size:0.85rem}
.entries li{padding:8px 0;border-bottom:1px solid #e9ecef;display:flex;justify-content:space-between;gap:8px}
.entries li:last-child{border-bottom:none}
.entries .when{color:#6c757d}
.empty{color:#868e96;font-size:0.85rem;font-style:italic}
/* --- assessments ------------------------------------------------------ */
.qitem{border-bottom:1px solid #e9ecef;padding:10px 0}
.qitem p{font-size:0.9rem;margin-bottom:6px}
/* Groups the radio options under their question text via native
   fieldset/legend so a screen reader announces the question before each
   option (a11y remediation Phase D) while keeping the same look as the
   plain <p> question text used elsewhere in .qitem. border/min-width
   reset because fieldset ships browser chrome the universal `*` reset
   (margin/padding) doesn't touch. */
.qitem fieldset{border:0;min-width:0}
.qitem legend{font-size:0.9rem;margin-bottom:6px;width:100%;float:none}
.qopts{display:flex;flex-wrap:wrap;gap:6px}
.qopts label{flex-direction:row;align-items:center;gap:4px;font-size:0.8rem;background:#f1f3f5;border-radius:4px;padding:12px 14px;min-height:44px;cursor:pointer}
.qopts input{width:auto}
.flag{display:inline-block;font-size:0.72rem;font-weight:700;padding:2px 8px;border-radius:10px;text-transform:uppercase;letter-spacing:0.03em}
.flag-ok{background:#d3f9d8;color:#2b8a3e}
/* Darkened from #845ef7 (~3.96:1 on #fff3bf, below WCAG AA) to #6b4cc8
   (~5.4:1) — same purple hue family, used to flag screening results
   directly to patients. Now the canonical --vesper-warn (Phase C): pi's
   .pill-warn previously rendered this same semantic state in orange
   (#e67700) and has been switched to match. */
.flag-warn{background:var(--vesper-warn-bg);color:var(--vesper-warn)}
.flag-alert{background:var(--vesper-danger-bg);color:var(--vesper-danger)}
.boundary{font-size:0.75rem;color:#868e96;margin-top:14px;line-height:1.4}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
:focus-visible{outline:3px solid var(--vesper-focus);outline-offset:2px}
/* --- header: the signed-in patient's email is unbreakable text sitting in
   a flex row next to the page title — without this it can force the whole
   header (and page) to overflow horizontally on a narrow phone screen. */
#user-info{flex-shrink:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:0.8rem;color:#6c757d}
/* --- responsive: stack two-up rows and shrink the tab bar below 480px so
   nothing is cramped or clipped on a phone (e.g. 375px-wide iPhone SE). */
@media (max-width:480px){
  .row{flex-direction:column;gap:8px}
  nav#tabs button{font-size:0.72rem;padding:10px 4px}
}
