/* ===========================================================================
   Care Thread — treating-site surface (site.js). Prefix: .st-
   Colours and type are app.css / care.css tokens only; the boards (05–09)
   govern layout. Light only.
   =========================================================================== */

.st-page { padding-bottom: 24px; }
.st-h1 { margin-top: 8px; }
.st-titleline { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.st-titleline .st-h1 { margin-top: 0; }
.st-opt { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--faint); }
.st-eyebrow-muted { color: var(--faint); }
.st-card-sub { margin: -6px 0 14px; }
.st-loading { opacity: .55; transition: opacity .2s; }
.st-btn-line { background: var(--paper); color: var(--ink); border: 1px solid var(--ink); }
.st-btn-line:hover:not(:disabled) { background: var(--cream); }
.st-ico {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  display: inline-grid; place-items: center;
}
.st-ico--green { background: var(--green-wash); color: var(--green); }
.st-ico--amber { background: var(--amber-wash); color: var(--amber); }
.st-ico--blue  { background: var(--blue-wash);  color: var(--blue); }
.st-ico--red   { background: var(--red-wash);   color: var(--red); }
.st-ico--grey  { background: var(--line-soft);  color: var(--muted); }
.st-submit { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 6px; }
.st-submit .ct-hint { flex: 1 1 220px; }
.st-fs { border: 0; margin: 0 0 14px; min-width: 0; }
.st-legend { font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-bottom: 10px; padding: 0; }
.st-radio {
  display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px; margin-bottom: 9px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; background: var(--paper);
}
.st-radio:has(input:checked) { border-color: var(--blue); background: var(--blue-wash); }
.st-radio input { accent-color: var(--blue); width: 17px; height: 17px; margin-top: 3px; flex: none; }
.st-radio b { display: block; font-weight: 600; }
.st-radio .ct-sub { display: block; }

/* ── S1 / In treatment ───────────────────────────────────────────────────── */
.st-head { margin-bottom: 30px; }
.st-head .eyebrow { margin-bottom: 4px; }
.st-cta { flex: none; }
.st-filters { margin-bottom: 22px; }
.st-tabs { display: flex; gap: 10px; flex-wrap: wrap; }
.st-tabs:empty { display: none; }
.st-filters .ct-search { color: var(--faint); }
.st-filters .ct-search input { color: var(--ink); }

.st-cols, .st-row {
  display: grid; align-items: center; gap: 20px;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) 200px 140px;
}
.st-cols {
  padding: 0 22px 10px; font-size: 12px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--faint);
}
.st-row {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 18px 22px; margin-bottom: 10px; cursor: pointer;
  transition: border-color .16s, box-shadow .16s;
}
.st-row:hover { border-color: #d8cfc1; box-shadow: var(--shadow); }
.st-pname { display: inline-block; font-weight: 700; font-size: 17px; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.st-pname:hover { text-decoration: underline; }
.st-practice > div:first-child { font-size: 15px; }
.st-pcount { font-size: 14.5px; font-weight: 600; margin-bottom: 7px; }
.st-waiting { font-size: 14.5px; color: var(--muted); }
.st-latest { font-size: 14.5px; font-weight: 600; }
.st-act { justify-self: end; }
.st-status { min-width: 0; }

@media (max-width: 860px) {
  .st-cols { display: none; }
  .st-row { grid-template-columns: minmax(0, 1fr) auto; gap: 12px 16px; padding: 16px 18px; }
  .st-who, .st-practice, .st-packet { grid-column: 1 / -1; }
  .st-status { grid-column: 1; }
  .st-act { grid-column: 2; }
  .st-status .ct-chip { white-space: normal; }
}
@media (max-width: 620px) {
  .st-cta { width: 100%; }
  .st-filters .ct-search { flex-basis: 100%; }
  .st-tabs .ct-pill { padding: 8px 13px; font-size: 14px; }
}

/* ── S3 packet review ────────────────────────────────────────────────────── */
.st-rhead { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 30px; }
.st-rhead-main { flex: 1 1 520px; min-width: 0; }
.st-packet-head { flex: 0 0 220px; text-align: right; }
.st-packet-big { font-family: var(--font-display); font-size: 38px; font-weight: 600; line-height: 1.05; margin: 2px 0 10px; }
.st-grid-3 { grid-template-columns: minmax(0, .84fr) minmax(0, 1fr); align-items: stretch; }
@media (max-width: 980px) { .st-grid-3 { grid-template-columns: 1fr; } }

.st-checklist { display: flex; flex-direction: column; }
.st-items { list-style: none; margin: 0 -24px; }
.st-items li { border-bottom: 1px solid var(--line-soft); }
.st-item {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 14px; align-items: start;
  width: 100%; text-align: left; padding: 16px 24px;
}
.st-item:hover { background: #fdfbf7; }
.st-item[aria-pressed="true"] { background: var(--blue-wash); }
.st-item .st-ico { margin-top: 2px; }
.st-item .ct-chip { font-size: 12.5px; padding: 3px 10px; }
.st-item-body { display: flex; flex-direction: column; min-width: 0; }
.st-item-label { font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.st-optional { margin-left: 8px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.st-item-prov { font-size: 13.5px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.st-item-prov.st-warn { color: var(--amber); }
.st-fax {
  display: flex; align-items: center; gap: 14px; margin-top: 18px; padding: 14px 16px;
  border: 1px dashed var(--line); border-radius: var(--radius-sm); background: #fdfbf7;
}
.st-fax .st-item-body { flex: 1; }
.st-note { margin-top: auto; padding-top: 22px; }
.st-note::before { content: ""; display: block; border-top: 1px solid var(--line); margin-bottom: 18px; }
.st-note .eyebrow { margin-bottom: 8px; }
.st-note p:last-child { font-family: var(--font-serif); font-size: 17px; line-height: 1.5; }

.st-right { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.st-right > .ct-card { margin: 0; }
.st-viewer { flex: 1 1 auto; min-height: 360px; }
.st-viewer-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.st-open { padding: 4px 8px; font-weight: 600; }
.st-kv { margin: 0; }
.st-kv > div { display: flex; justify-content: space-between; gap: 24px; padding: 13px 0; border-bottom: 1px solid var(--line-soft); font-size: 15px; }
.st-kv dt { color: var(--muted); flex: none; }
.st-kv dd { margin: 0; text-align: right; }
.st-impression { margin-top: 18px; }
.st-impression .eyebrow { margin-bottom: 8px; }
.st-impression p:last-child { font-family: var(--font-serif); font-size: 16.5px; line-height: 1.6; white-space: pre-line; }
.st-prov { margin-top: 18px; font-size: 13px; color: var(--faint); }
.st-wait { font-family: var(--font-serif); font-size: 18px; line-height: 1.5; margin-bottom: 10px; }

.st-actions .st-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.st-accept { flex: 1 1 220px; }
.st-foot { margin-top: 14px; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.st-done { font-size: 15.5px; margin-bottom: 14px; }
@media (max-width: 620px) {
  .st-packet-head { flex-basis: 100%; text-align: left; }
  .st-actions .st-btns .btn { flex: 1 1 100%; }
  .st-item { grid-template-columns: 22px minmax(0, 1fr); }
  .st-item .ct-chip { grid-column: 2; justify-self: start; }
}

/* ── S2 + S4: form left, aside right ─────────────────────────────────────── */
.st-grid-side { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 40px; align-items: start; }
@media (max-width: 980px) { .st-grid-side { grid-template-columns: 1fr; gap: 28px; } }
.st-lede-tight { margin-bottom: 26px; }
.st-grid-side .ct-lede { margin-bottom: 24px; }

.st-match {
  display: flex; align-items: center; gap: 14px; margin: -2px 0 18px; padding: 15px 20px;
  border: 1.5px solid var(--green); border-radius: var(--radius-sm); background: var(--green-wash);
}
.st-match--bad { border-color: var(--red); background: var(--red-wash); }
.st-match-body { flex: 1; min-width: 0; }
.st-match-name { font-weight: 700; font-size: 15.5px; }
.st-match-tag { flex: none; font-size: 13px; font-weight: 600; color: var(--muted); }
.st-match-slot > .ct-hint { margin: -6px 0 14px; }
@media (max-width: 620px) { .st-match { flex-wrap: wrap; } .st-match-tag { margin-left: 36px; } }
.st-attach { margin-top: 4px; }
.st-file { margin: 10px 0 0 28px; font-size: 14px; }
.st-send svg { margin-left: 14px; }
.st-next .ct-card-title { margin-bottom: 18px; }
.st-next-foot { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 4px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.st-track { display: flex; gap: 8px; margin: 12px 0 10px; }
.st-track input {
  flex: 1; min-width: 0; padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: #fdfbf7; font-size: 14px;
}

/* S4 tiles + preview */
.st-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 22px; }
.st-tile {
  display: flex; align-items: center; gap: 16px; text-align: left; padding: 17px 20px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color .16s, background .16s;
}
.st-tile:hover:not(:disabled) { border-color: var(--blue-pale); }
.st-tile[aria-checked="true"] { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); background: var(--blue-wash); }
.st-tile:disabled { opacity: .45; cursor: not-allowed; }
.st-tile-ico { color: var(--blue); flex: none; display: grid; }
.st-tile-t { display: block; font-weight: 600; font-size: 16px; }
.st-tile-s { display: block; font-size: 13.5px; color: var(--muted); margin-top: 1px; }
@media (max-width: 620px) { .st-tiles { grid-template-columns: 1fr; } }
.st-mfields { margin-bottom: 0; }
.st-one { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 620px) { .st-one { grid-template-columns: 1fr; } }
.st-mform .field textarea { min-height: 76px; }

.st-aside { display: grid; gap: 18px; }
.st-aside > .ct-card { margin: 0; }
.st-preview .eyebrow { margin-bottom: 8px; }
.st-pv-title { font-family: var(--font-display); font-size: 24px; font-weight: 600; line-height: 1.2; }
.st-pv-note { margin-top: 10px; font-size: 15px; line-height: 1.5; color: #dbe7fa; }
.st-pv-rule { border-top: 1px solid rgba(255,255,255,.22); margin: 14px 0 10px; }
.st-pv-patient { font-size: 13px; color: #c9dcf7; }
.st-posted { list-style: none; }
.st-posted li { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); font-size: 15px; }
.st-posted li:last-child { border-bottom: 0; }
.st-posted-d { color: var(--muted); flex: none; }
.st-aside-foot { font-size: 13.5px; line-height: 1.5; color: var(--muted); }

/* ── S5 site profile ─────────────────────────────────────────────────────── */
.st-phead { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; margin-bottom: 26px; }
.st-phead > div:first-child { flex: 1 1 520px; min-width: 0; }
.st-dir-note { margin-top: 6px; }
.st-accepting { flex: 0 1 400px; padding: 18px 22px; }
.st-accept-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.st-accept-t { font-weight: 700; font-size: 16px; }
.st-paused { margin: 14px 0 0; }
.st-switch-off { background: #d9d2c7; }
.st-readonly { background: var(--amber-wash); color: var(--amber); font-weight: 600; font-size: 14px; padding: 10px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; }
.st-grid-prof { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 980px) { .st-grid-prof { grid-template-columns: 1fr; } }
.st-therapy { border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 18px; }
.st-therapy-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 4px; }
.st-therapy-name { font-family: var(--font-ui); font-size: 16.5px; font-weight: 700; }
.st-cl { list-style: none; }
.st-cl li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.st-cl li:last-child { border-bottom: 0; }
.st-cl label { display: flex; align-items: center; gap: 12px; font-size: 15px; cursor: pointer; min-width: 0; }
.st-cl input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--blue); flex: none; }
.st-mode { display: inline-flex; gap: 2px; flex: none; }
.st-mode button, .st-mode-off {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--faint); padding: 4px 8px; border-radius: 999px;
}
.st-mode-off { flex: none; }
.st-mode button[aria-pressed="true"] { color: var(--ink); background: var(--line-soft); }
.st-mode button:hover:not(:disabled) { color: var(--blue); }
.st-mode button:disabled { cursor: default; }
.st-prof-fields { margin-top: 6px; }
.st-days { position: relative; }
.st-days input { padding-right: 64px; }
.st-days span { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 15px; pointer-events: none; }
.st-prof-right { display: grid; gap: 18px; }
.st-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.st-card-head .ct-card-title { margin: 0; }
.st-people { list-style: none; }
.st-people li { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.st-people li:last-child { border-bottom: 0; }
.st-av {
  flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 14px; letter-spacing: .02em;
}
.st-av--a { background: var(--blue-ink); }
.st-av--b { background: var(--teal); }
.st-av--c { background: var(--amber); }
.st-av--d { background: var(--green); }
.st-person { flex: 1; min-width: 0; }
.st-pname2 { font-weight: 700; }
.st-scopes { font-size: 14px; color: var(--muted); text-align: right; }
.st-save { display: flex; justify-content: flex-end; align-items: center; gap: 14px; flex-wrap: wrap; }
.st-save .ct-error { margin: 0; flex: 1 1 200px; }
@media (max-width: 620px) {
  .st-people li { flex-wrap: wrap; }
  .st-scopes { flex-basis: 100%; text-align: left; padding-left: 54px; }
  .st-cl li { flex-wrap: wrap; }
  .st-mode, .st-mode-off { margin-left: 30px; }
}

/* ── Settings ────────────────────────────────────────────────────────────── */
.st-settings > .ct-card { max-width: 720px; }
.st-settings .ct-h1 { margin-bottom: 26px; }

/* care.css stacks adjacent cards with margin-top; inside a grid that offsets the second column. */
.ct-grid > .ct-card + .ct-card { margin-top: 0; }

/* Home */
.st-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; border-left: 4px solid var(--blue, #1b56ab); }
.st-htiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.st-htile { position: relative; display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 4px; text-decoration: none; color: inherit; margin: 0; }
.st-home-grid > .ct-card, .st-htiles > .ct-card.st-htile { margin: 0; }
.st-htile-n { font-size: 30px; font-weight: 600; }
.st-htile-l { font-weight: 600; }
.st-htile-s { font-size: 13px; opacity: .75; }
.st-hbadge { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: var(--blue, #1b56ab); color: #fff; font-size: 11px; font-weight: 600; }
.st-htile > .st-hbadge { position: absolute; top: 14px; right: 14px; margin: 0; }
.st-home-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; }
@media (max-width: 760px) { .st-home-grid { grid-template-columns: minmax(0, 1fr); } }
.st-tasks { list-style: none; margin: 8px 0 0; padding: 0; }
.st-task { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; text-decoration: none; color: inherit; border-top: 1px solid rgba(0,0,0,.07); }
.st-task > span:first-child { display: flex; flex-direction: column; }
.st-task-t { font-weight: 600; }
.st-week { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 10px; }
.st-week-l { font-size: 13px; opacity: .75; }
.st-week-n { font-size: 24px; font-weight: 600; }
/* A document, read in place */
.st-doc { margin-top: 14px; }
.st-doc-frame { width: 100%; height: 520px; border: 1px solid rgba(0,0,0,.12); border-radius: 8px; }
.st-doc-img { display: block; max-width: 100%; border-radius: 8px; }

/* What the reader found in a fax */
.st-read-card { margin: 12px 0 18px; }
.st-read-items { list-style: none; margin: 10px 0 0; padding: 0; }
.st-read-items li { padding: 6px 0; }
