:root {
  /* design tokens (v3.2): same palette as the report table and chart */
  --primary: #2F6DB5;
  --primary-soft: #E4EDF8;
  --ink: #1A3A5C;        /* headings, nav */
  --surface: #EEF1F5;    /* page background, alternate rows */
  --line: #D5DAE1;
  --warm: #C2502E;       /* required, danger */
  --warm-soft: #FBE3D6;  /* warnings */
  --text: #1f2328;
  --card: #ffffff;
  --muted: #5d6673;
  --shadow: 0 2px 10px rgba(26, 58, 92, .08);
  --radius: 12px;
  /* older names, mapped onto the tokens */
  --bg: var(--surface);
  --accent: var(--primary);
  --accent-soft: var(--primary-soft);
  --green: #2e7d4f;   --green-soft: #e5f4e9;
  --blue: var(--primary);    --blue-soft: var(--primary-soft);
  --amber: #a36100;   --amber-soft: var(--warm-soft);
  --red: var(--warm);     --red-soft: var(--warm-soft);
  --grey: #6b6f76;    --grey-soft: var(--surface);
  font-size: 17px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family: "Segoe UI", Tahoma, "Geeza Pro", "Noto Sans Arabic", Arial, sans-serif;
  line-height: 1.6;
}
a { color: var(--accent); }
h1, h2, h3, h4 { color: var(--ink); font-weight: 700; }
h1 { font-size: 1.5rem; margin: 0; overflow-wrap: anywhere; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
h2 small, .q-en, .muted { color: var(--muted); font-weight: 400; }
h2 small { font-size: .8rem; margin-inline-start: .5rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem;
  padding: .75rem 1.25rem; background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); font-weight: 600; }
.brand small { display: block; font-weight: 400; color: var(--muted); font-size: .75rem; }
.brand-mark { background: var(--accent); color: #fff; border-radius: 8px; padding: .2rem .5rem; font-size: .85rem; letter-spacing: .05em; }
.nav { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.nav a { text-decoration: none; }
.inline { display: inline; }
button.link { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }

.container { max-width: 960px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 1rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; margin: 0 0 1rem;
  box-shadow: var(--shadow); max-width: 100%; min-width: 0; }
.card.narrow { max-width: 420px; margin: 2rem auto; }
.card.empty { text-align: center; }
.page-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .75rem; margin: .5rem 0 1rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.hint { color: var(--muted); font-size: .9rem; margin: 0 0 1rem; }
.tag { display: inline-block; background: var(--grey-soft); border-radius: 999px; padding: 0 .6rem; font-size: .78rem; margin: .1rem .15rem; color: var(--ink); }

.btn {
  display: inline-block; padding: .55rem 1rem; border-radius: 8px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); text-decoration: none; cursor: pointer; font: inherit; font-size: .95rem;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.danger { background: var(--red); color: #fff; border-color: var(--red); }
.form-actions { display: flex; justify-content: flex-start; margin-top: 1rem; }

label { display: block; margin: .6rem 0; }
input[type=text], input[type=password], input[type=search], input:not([type]), textarea, select {
  width: 100%; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; color: var(--ink);
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

.flash { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.flash-ok { background: var(--green-soft); color: var(--green); }
.flash-error { background: var(--red-soft); color: var(--red); }

/* steps */
.steps { display: flex; gap: .25rem; list-style: none; padding: 0; margin: 0 0 .5rem; flex-wrap: wrap; }
.steps li { flex: 1; min-width: 120px; }
.steps li a, .steps li span { display: block; padding: .45rem .6rem; border-bottom: 3px solid var(--line); text-decoration: none; color: var(--muted); font-size: .9rem; }
.steps li.active a, .steps li.active span { border-color: var(--accent); color: var(--ink); font-weight: 600; }

/* questions */
.q { padding: .8rem 0; border-top: 1px solid var(--grey-soft); }
.q:first-of-type { border-top: 0; }
.q[hidden] { display: none; }
.q-head { margin-bottom: .45rem; }
.q-ar { display: block; font-size: 1.08rem; font-weight: 600; margin: 0; }
.q-en { display: block; font-size: .8rem; direction: ltr; text-align: left; }
.q-clinician .q-ar { font-weight: 500; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); column-gap: 1.25rem; }
.grid .q { border-top: 0; }

.choices { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.choices.col { flex-direction: column; align-items: stretch; }
.choice { display: inline-flex; margin: 0; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice > span {
  display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .9rem; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; min-width: 3.2rem; justify-content: center; user-select: none;
}
.choices.col .choice > span { justify-content: flex-start; width: 100%; }
.choice input:checked + span { background: var(--accent); color: #fff; border-color: var(--accent); }
.choice input:checked + span .muted, .choice input:checked + span .pill { color: inherit; }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice input[type=checkbox] { position: static; opacity: 1; pointer-events: auto; margin-inline-end: .5rem; }
.choice input[type=checkbox] + span { border: 0; padding: 0; background: none; }
.choice input[type=checkbox]:checked + span { background: none; color: var(--ink); }
.clear { border: 0; background: none; color: var(--muted); font-size: 1.1rem; cursor: pointer; padding: 0 .4rem; }
.num-wrap { display: flex; align-items: center; gap: .5rem; max-width: 220px; }
.num { max-width: 140px; direction: ltr; text-align: left; }
.unit { color: var(--muted); font-size: .85rem; direction: ltr; }
.live-metrics { margin-top: .5rem; font-weight: 600; color: var(--accent); }
.module h2 { border-bottom: 2px solid var(--accent-soft); padding-bottom: .4rem; }

/* instruments */
details.card > summary { cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 1rem; list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
.ins-name { font-weight: 600; }
.ins-fields { margin-top: .5rem; }
.ins-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .4rem 0; border-top: 1px solid var(--grey-soft); flex-wrap: wrap; }
.ins-label { flex: 1 1 260px; }
.instrument.status-optional { opacity: .9; }

/* pills & verdict */
.pill { display: inline-block; border-radius: 999px; padding: .05rem .6rem; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.pill-green { background: var(--green-soft); color: var(--green); }
.pill-blue { background: var(--blue-soft); color: var(--blue); }
.pill-amber { background: var(--amber-soft); color: var(--amber); }
.pill-red { background: var(--red-soft); color: var(--red); }
.pill-grey { background: var(--grey-soft); color: var(--grey); }
.verdict { border-width: 2px; }
.verdict-green { border-color: var(--green); background: var(--green-soft); }
.verdict-blue { border-color: var(--blue); background: var(--blue-soft); }
.verdict-amber { border-color: var(--amber); background: var(--amber-soft); }
.verdict-red { border-color: var(--red); background: var(--red-soft); }
.verdict-label { font-size: .85rem; color: var(--muted); }
.verdict-text { font-size: 1.5rem; font-weight: 700; }
.verdict-en { color: var(--muted); }
.reasons { margin: .6rem 0 0; padding-inline-start: 1.1rem; font-size: .9rem; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.two-col .card { margin: 0 0 1rem; }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; } }

.table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: .55rem .7rem; border-bottom: 1px solid var(--grey-soft); text-align: start; vertical-align: top; }
.table th { background: var(--grey-soft); font-size: .85rem; }
.table.compact td { padding: .35rem .5rem; font-size: .9rem; }
.table.compact td:first-child { color: var(--muted); width: 45%; }
@media (max-width: 760px) { .table { display: block; overflow-x: auto; } }

.flags { list-style: none; padding: 0; margin: 0; }
.flag { padding: .55rem .8rem; border-radius: 8px; margin-bottom: .4rem; display: flex; flex-direction: column; }
.flag-en { font-size: .82rem; color: var(--muted); text-align: left; }
.flag-red { background: var(--red-soft); border-inline-start: 4px solid var(--red); }
.flag-amber { background: var(--amber-soft); border-inline-start: 4px solid var(--amber); }
.flag-info { background: var(--grey-soft); border-inline-start: 4px solid var(--grey); }
.plain { padding-inline-start: 1.1rem; margin: 0; }
.plain li { margin-bottom: .35rem; }
.emr { font-family: Consolas, "Courier New", monospace; font-size: .85rem; background: #fbfaf7; }
.research { border: 1px solid var(--line); border-radius: 8px; margin: .8rem 0; }
.danger-zone summary { color: var(--red); }

@media print {
  .topbar, .steps, .no-print, .footer, .danger-zone, .flash { display: none !important; }
  body { background: #fff; }
  .card { border-color: #ccc; break-inside: avoid; }
  textarea.emr { border: 0; height: auto; overflow: visible; }
}

/* ---------- v2: instruments ---------- */
.small { font-size: .82rem; }
.ok { color: var(--green); font-weight: 600; }
.warn { color: var(--amber); font-weight: 600; }
.flash-warn { background: var(--amber-soft); color: var(--amber); }
code { background: var(--grey-soft); padding: 0 .3rem; border-radius: 4px; }
.gap { gap: .6rem; flex-wrap: wrap; }

.hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.hub-card { display: block; text-decoration: none; color: var(--ink); margin: 0; border-inline-start-width: 4px; }
.hub-card:hover { border-color: var(--accent); }
.hub-card.status-required { border-inline-start-color: var(--red); }
.hub-card.status-recommended { border-inline-start-color: var(--amber); }
.hub-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.hub-state { margin-top: .5rem; font-size: .9rem; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg-btn { border: 0; background: var(--card); padding: .5rem .9rem; cursor: pointer; font: inherit; font-size: .9rem; }
.seg-btn.active { background: var(--accent); color: #fff; }

.live-score { background: var(--accent-soft); color: var(--accent); padding: .5rem .8rem; border-radius: 8px; margin-bottom: 1rem; font-weight: 600; }
.instr { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.instr p { margin: 0; font-size: 1.05rem; }

.progress { height: 6px; background: var(--grey-soft); border-radius: 999px; overflow: hidden; margin: .25rem 0 .3rem; }
.progress-bar { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.progress-text { margin-bottom: .8rem; }

.iq { margin-bottom: 1rem; }
.iq[hidden] { display: none; }
.iform[data-mode="one"] .iq.not-current { display: none; }
.iform[data-mode="all"] .pager { display: none; }
.iq-head { display: flex; gap: .8rem; align-items: flex-start; margin-bottom: .9rem; }
.iq-num { background: var(--accent-soft); color: var(--accent); font-weight: 700; border-radius: 8px; min-width: 2.2rem; text-align: center; padding: .15rem .4rem; }
.iq-text { flex: 1; }
.iq-main { margin: 0; font-size: 1.3rem; font-weight: 600; line-height: 1.7; }
.iform[data-mode="all"] .iq-main { font-size: 1.08rem; }
.iq-en { margin: .2rem 0 0; color: var(--muted); font-size: .85rem; text-align: left; }
.say { border: 1px solid var(--line); background: var(--card); border-radius: 50%; width: 2.6rem; height: 2.6rem; cursor: pointer; font-size: 1.15rem; flex-shrink: 0; }
.say:hover, .say.speaking { border-color: var(--accent); background: var(--accent-soft); }

.resp { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.resp-yesno { grid-template-columns: repeat(2, minmax(120px, 220px)); }
.resp-7, .resp-6 { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
.rcard { cursor: pointer; margin: 0; display: block; }
.rcard input { position: absolute; opacity: 0; pointer-events: none; }
.rcard-body {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: .35rem; text-align: center;
  border: 2px solid var(--line); border-radius: 10px; padding: .7rem .5rem; min-height: 4.2rem; background: #fff; height: 100%;
}
.rcard-text { font-weight: 600; line-height: 1.4; }
.rcard-en { font-size: .75rem; color: var(--muted); }
.rcard:hover .rcard-body { border-color: var(--accent); }
.rcard input:checked + .rcard-body { border-color: var(--accent); background: var(--accent); color: #fff; }
.rcard input:checked + .rcard-body .rcard-en { color: #e6eef5; }
.rcard input:checked + .rcard-body .bar { background: #fff; }
.rcard input:focus-visible + .rcard-body { outline: 3px solid var(--accent-soft); }
.resp-yesno .rcard-body { min-height: 3.4rem; font-size: 1.15rem; }
.bar { display: block; width: 60%; max-width: 64px; border-radius: 4px 4px 0 0; background: var(--accent); opacity: .85; }
.num-wrap.big .num { font-size: 1.4rem; max-width: 160px; }
.pager { display: flex; justify-content: space-between; margin: .5rem 0 1rem; }
.clear.small { font-size: .8rem; margin-top: .4rem; padding: 0; }

.lib-item { border-top: 1px solid var(--grey-soft); padding: .8rem 0; }
.lib-num { font-weight: 700; color: var(--accent); }
.lib-opts { display: grid; gap: .4rem; margin-top: .3rem; }
.lib-opt { display: grid; grid-template-columns: 2rem 1fr 1fr 5rem; gap: .4rem; align-items: center; }
.lib-letter { font-weight: 700; text-align: center; }
.num.w { max-width: 5rem; }
@media (max-width: 760px) { .lib-opt { grid-template-columns: 2rem 1fr; } }

.checklists { display: grid; gap: .5rem; }
.ck { border: 1px solid var(--line); border-radius: 8px; padding: .5rem .8rem; }
.ck summary { cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: .5rem; list-style: none; }
.ck summary::-webkit-details-marker { display: none; }
.ck-dx { font-weight: 600; }
.ck-not_met .ck-dx, .ck-unknown .ck-dx { color: var(--muted); font-weight: 500; }
.ck-table { margin-top: .4rem; }
.ck-table td.cr-mark { width: 1.6rem; text-align: center; font-weight: 700; color: var(--muted) !important; }
.ck-table td.cr-code { width: 2.4rem; font-weight: 600; color: var(--ink) !important; }
.cr-met td.cr-mark { color: var(--green) !important; }
.cr-not_met td.cr-mark { color: var(--red) !important; }
.table.compact tr.sub td { font-size: .82rem; padding-top: 0; }
.lvl-0-2 { height: 10px; opacity: 0.35; }
.lvl-1-2 { height: 44px; opacity: 0.95; }
.lvl-0-3 { height: 10px; opacity: 0.35; }
.lvl-1-3 { height: 27px; opacity: 0.65; }
.lvl-2-3 { height: 44px; opacity: 0.95; }
.lvl-0-4 { height: 10px; opacity: 0.35; }
.lvl-1-4 { height: 21px; opacity: 0.55; }
.lvl-2-4 { height: 33px; opacity: 0.75; }
.lvl-3-4 { height: 44px; opacity: 0.95; }
.lvl-0-5 { height: 10px; opacity: 0.35; }
.lvl-1-5 { height: 18px; opacity: 0.5; }
.lvl-2-5 { height: 27px; opacity: 0.65; }
.lvl-3-5 { height: 36px; opacity: 0.8; }
.lvl-4-5 { height: 44px; opacity: 0.95; }
.lvl-0-6 { height: 10px; opacity: 0.35; }
.lvl-1-6 { height: 17px; opacity: 0.47; }
.lvl-2-6 { height: 24px; opacity: 0.59; }
.lvl-3-6 { height: 30px; opacity: 0.71; }
.lvl-4-6 { height: 37px; opacity: 0.83; }
.lvl-5-6 { height: 44px; opacity: 0.95; }
.lvl-0-7 { height: 10px; opacity: 0.35; }
.lvl-1-7 { height: 16px; opacity: 0.45; }
.lvl-2-7 { height: 21px; opacity: 0.55; }
.lvl-3-7 { height: 27px; opacity: 0.65; }
.lvl-4-7 { height: 33px; opacity: 0.75; }
.lvl-5-7 { height: 38px; opacity: 0.85; }
.lvl-6-7 { height: 44px; opacity: 0.95; }

/* ---------- v3: progress note, expectations, MSE ---------- */
.note { text-align: left; }
.note-bar { margin-bottom: .6rem; }
.note-id { color: var(--muted); font-size: .9rem; }
.note-title { text-align: center; letter-spacing: .04em; margin: .2rem 0 1rem; font-size: 1.2rem; }
.note-sec { margin-bottom: .9rem; }
.note-sec h3 { margin: 0 0 .25rem; font-size: 1rem; }
.note-sec h4 { margin: .7rem 0 .2rem; font-style: italic; font-weight: 400; font-size: .95rem; }
.note-sec p { margin: 0 0 .4rem; }
ul.dash { list-style: none; padding: 0; margin: 0; }
ul.dash li { margin-bottom: .2rem; padding-left: 1rem; text-indent: -1rem; }
ul.dash li::before { content: "- "; }
.dx-line { font-weight: 600; }
.chart { margin: .8rem auto; max-width: 410px; }
.chart figcaption { text-align: center; font-style: italic; font-size: .85rem; color: var(--muted); }
/* same palette as the chart (charts.py) and the Word table */
table.scores { border-collapse: collapse; margin: .3rem auto .6rem; font-size: .82rem; width: 100%; max-width: 410px; }
table.scores th { background: #2F6DB5; color: #fff; padding: .3rem .5rem; font-weight: 600; border: 1px solid #1A3A5C; }
table.scores td { border: 1px solid #1A3A5C; padding: .22rem .5rem; text-align: center; }
table.scores td:first-child { text-align: left; }
table.scores tbody tr:nth-child(even) td { background: #EEF1F5; }
table.scores tr.composite td { background: #D5DAE1; font-weight: 600; }
table.scores tr.sub td:first-child { padding-left: 1.4rem; }
.offscreen { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; resize: none; }
.exp-summary p { margin: 0 0 .4rem; }
.points { padding-inline-start: 1.3rem; margin: .3rem 0 .8rem; }
.points li { margin-bottom: .35rem; }
.mse-tools { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; margin-bottom: .5rem; }
.small-btn { font-size: .85rem; padding: .35rem .8rem; }
.opt-block > summary { display: block; cursor: pointer; }
.hub-card.status-covered { border-inline-start-color: var(--green); opacity: .85; }
.gaps { background: var(--amber-soft); border-color: var(--amber); }
.gaps h2 { color: var(--amber); }
.gaps p { margin: 0 0 .4rem; }
@media print {
  .note { border: 0; padding: 0; }
  .exp details { display: none; }
}

/* ---------- v3.2: branding, top bar, mobile layout ---------- */
.topbar { box-shadow: var(--shadow); border-bottom-color: var(--line); }
.brand { color: var(--ink); font-weight: 700; min-width: 0; }
.brand-logo { width: 44px; height: 44px; border-radius: 50%; background: #fff; flex-shrink: 0; object-fit: contain; }
.brand-name { min-width: 0; }
.nav a, .nav button.link { color: var(--ink); font-weight: 600; padding: .35rem 0; border-bottom: 2px solid transparent; white-space: nowrap; }
.nav a:hover { color: var(--primary); }
.nav a[aria-current="page"] { color: var(--primary); border-bottom-color: var(--primary); }
.footer { padding: 1.25rem 1rem 1.5rem; line-height: 1.5; }
.footer p { margin: .15rem 0; }
.footer-copy { color: var(--ink); font-weight: 600; }

.steps li.active a, .steps li.active span { border-color: var(--primary); color: var(--ink); }
.steps-compact { display: none; margin: 0 0 .75rem; }
.steps-compact-text { display: block; font-weight: 700; color: var(--ink); font-size: .95rem; }
.steps-compact-track { display: block; height: 3px; background: var(--line); border-radius: 999px; overflow: hidden; margin-top: .3rem; }
.steps-compact-bar { display: block; height: 100%; background: var(--primary); }
.steps-compact-bar.step-1 { width: 25%; }
.steps-compact-bar.step-2 { width: 50%; }
.steps-compact-bar.step-3 { width: 75%; }
.steps-compact-bar.step-4 { width: 100%; }

/* choice chips: 44 px touch target; selected = primary fill */
.choice { max-width: 100%; }
.choice > span { min-height: 44px; flex-wrap: wrap; overflow-wrap: anywhere; }
.choice input:checked + span { background: var(--primary); color: #fff; border-color: var(--primary); }
.chip { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: .3rem .9rem;
  min-height: 44px; cursor: pointer; font: inherit; font-size: .88rem; }
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip-all { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }
.chip-all:hover { color: #fff; background: #285e9c; }
.mse-tools { gap: .4rem; margin: 0 0 .5rem; }
#f_mse_text { text-align: left; }

/* collapsed intake sections */
details.fold > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-height: 44px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary h2 { margin: 0; }
details.fold > summary::after { content: "+"; font-size: 1.3rem; font-weight: 700; color: var(--primary); }
details.fold[open] > summary::after { content: "−"; }
details.fold[open] > summary { margin-bottom: .5rem; }

/* report: nothing may widen the page */
.container, .page-head > *, .two-col > *, .verdict, .note, .note-sec { min-width: 0; max-width: 100%; }
.note, .verdict, .reasons, .flag, .ck, .exp-summary { overflow-wrap: anywhere; }
.table-scroll { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* tables keep their natural width and scroll inside .table-scroll rather than breaking words */
.table-scroll table, .table-scroll th, .table-scroll td { overflow-wrap: normal; }
.table-scroll table.scores { min-width: 410px; }
.chart svg, .chart img { max-width: 100%; height: auto; }
.anchor { font-style: italic; font-size: .8rem; color: var(--muted); text-align: center; margin: 0 auto .7rem; max-width: 410px; }
.page-head .actions { flex-wrap: wrap; min-width: 0; }

/* clinician approval: two columns on desktop, one on mobile */
.approve-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.5rem; }
.approve-col { min-width: 0; }
.approve .choices.col .choice > span { justify-content: flex-start; text-align: start; }

@media (max-width: 768px) {
  .topbar { padding: .6rem 1rem; gap: .4rem; }
  .brand small { font-size: .7rem; }
  .nav { flex-wrap: nowrap; overflow-x: auto; width: 100%; gap: 1.1rem; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav > * { flex-shrink: 0; }
  .steps { display: none; }
  .steps-compact { display: block; }
  .container { padding: 1rem 1rem 2.5rem; }
  .card { padding: 1rem; }
  .verdict-text { font-size: 1.25rem; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1 1 auto; text-align: center; }
  .approve-grid { grid-template-columns: 1fr; }
}
@media print {
  .steps-compact { display: none !important; }
  .card { box-shadow: none; }
}
