/* ============================================================
   FYZIO — Outcome-measure library & read-only detail
   "Measure reference sheet" — therapist previews structure
   and scoring; never fills the questionnaire.
   Calm, premium, soft-clinical. Navy accent, warm-cool
   neutrals, subtle borders. Consistent with styles.css.
   ============================================================ */

/* ============================================================
   LIST — 3 measures as cards
   ============================================================ */
.md-list { display: flex; flex-direction: column; gap: 14px; }
.md-card {
  display: flex; align-items: center; gap: 20px; width: 100%; text-align: left;
  padding: 19px 22px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-1);
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease), transform .16s var(--ease);
}
.md-card:hover { border-color: var(--accent-tint-2); box-shadow: var(--sh-2); transform: translateY(-1px); }
.md-card-mark {
  flex: none; width: 56px; height: 56px; border-radius: 15px;
  background: var(--accent-tint); color: var(--accent-text);
  display: grid; place-items: center;
}
.md-abbr { font-family: var(--font-display); font-weight: 800; font-size: 15px; letter-spacing: .02em; }
.md-card-main { flex: 1; min-width: 0; }
.md-card-name { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -.01em; color: var(--ink); }
.md-card-en { font-size: 13px; color: var(--faint); margin-top: 1px; }
.md-card-meta { display: flex; align-items: center; gap: 13px; margin-top: 12px; flex-wrap: wrap; }
.md-meta { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; color: var(--ink-soft); }
.md-meta-k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--faint); font-weight: 700; }
.md-meta-sep { width: 1px; height: 13px; background: var(--border-2); }
.md-card-cats { display: flex; gap: 6px; margin-top: 11px; flex-wrap: wrap; }
.md-card-go { flex: none; color: var(--faint); width: 22px; height: 22px; transition: color .16s, transform .16s; }
.md-card-go svg { width: 22px; height: 22px; }
.md-card:hover .md-card-go { color: var(--accent); transform: translateX(2px); }

/* ============================================================
   DETAIL — read-only reference sheet
   ============================================================ */
.md-detail { max-width: 760px; margin: 0 auto; }

.page-title.md-title { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.1; }
.md-abbr-tag {
  display: inline-flex; align-items: center; height: 24px; padding: 0 11px; border-radius: 7px;
  background: var(--accent-tint); color: var(--accent-text);
  font-family: var(--font-display); font-weight: 800; font-size: 12.5px; letter-spacing: .03em;
  vertical-align: middle; margin-left: 12px; position: relative; top: -3px;
}

/* metadata pills — centered row, centered content */
.md-metarow { display: flex; justify-content: center; flex-wrap: wrap; gap: 9px; margin-bottom: 22px; }
.md-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 34px; padding: 0 15px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--border);
  font-size: 13px; font-weight: 600; color: var(--ink-soft);
}
.md-pill-k { font-size: 10px; text-transform: uppercase; letter-spacing: .09em; color: var(--faint); font-weight: 700; }
.md-pill-dir { padding-left: 12px; }
.md-pill .om-dir { font-size: 13px; }

/* read-only banner — calm, centered */
.md-banner {
  display: flex; align-items: center; justify-content: center; gap: 13px; padding: 14px 20px;
  max-width: 600px; margin: 0 auto 22px;
  background: var(--accent-tint); border: 1px solid var(--accent-tint-2); border-radius: var(--r-lg);
}
.md-banner-ico {
  flex: none; width: 32px; height: 32px; border-radius: 9px; background: #fff; color: var(--accent);
  display: grid; place-items: center;
}
.md-banner-ico svg { width: 17px; height: 17px; }
.md-banner-tx { font-size: 13px; line-height: 1.55; color: var(--accent-text); text-align: left; text-wrap: pretty; }
.md-banner-tx b { font-weight: 700; }

.md-summary { font-size: 15px; line-height: 1.65; color: var(--ink-soft); max-width: 600px; margin: 0 auto 8px; text-align: center; text-wrap: pretty; }

/* block heading — centered */
.md-secblock-h {
  font-family: var(--font-display); font-weight: 700; font-size: 12.5px; text-transform: uppercase;
  letter-spacing: .12em; color: var(--faint); text-align: center; margin: 32px 0 16px;
}
.md-secs { display: flex; flex-direction: column; gap: 12px; }

/* collapsible section card — light, airy, premium; collapsed by default */
.md-sec {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  margin: 0; box-shadow: var(--sh-1); overflow: hidden;
  transition: border-color .16s var(--ease);
}
.md-sec[open] { box-shadow: var(--sh-2); border-color: var(--accent-tint-2); }
.md-sec-special { border-style: dashed; }
.md-sec-head {
  display: flex; align-items: center; gap: 16px; padding: 16px 22px;
  cursor: pointer; list-style: none; user-select: none;
  transition: background .14s var(--ease);
}
.md-sec-head::-webkit-details-marker { display: none; }
.md-sec-head:hover { background: var(--raise); }
.md-sec-titles { flex: 1; min-width: 0; }
.md-sec-title { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -.01em; color: var(--ink); }
.md-sec-kind { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-text); opacity: .8; margin-top: 5px; }
.md-sec-count { flex: none; font-size: 12.5px; font-weight: 600; color: var(--faint); white-space: nowrap; }
.md-sec-chev { flex: none; width: 20px; height: 20px; color: var(--faint); display: grid; place-items: center; transition: transform .2s var(--ease); }
.md-sec-chev svg { width: 18px; height: 18px; transform: rotate(90deg); }
.md-sec[open] .md-sec-chev { transform: rotate(180deg); }
.md-sec-body { padding: 6px 22px 20px; }
@keyframes mdSecReveal { from { opacity: 0; } to { opacity: 1; } }
.md-sec-intro { font-size: 13.5px; line-height: 1.55; color: var(--muted); text-align: left; max-width: none; margin: 2px 0 14px; text-wrap: pretty; }

/* answer legend (passive) — centered, airy */
.md-legend {
  padding: 14px 16px; margin: 0 0 16px; max-width: none;
  background: var(--field); border: 1px solid var(--border); border-radius: var(--r-md);
  text-align: left;
}
.md-legend-k {
  display: block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--faint); margin-bottom: 11px;
}
.md-legend-chips { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 7px; }
.md-chip {
  display: inline-flex; align-items: center; justify-content: center; height: 28px; padding: 0 13px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border-2); color: var(--ink-soft);
  font-size: 12.5px; font-weight: 600; text-align: center; cursor: default;
}
.md-chip.na { color: var(--faint); border-style: dashed; }
.md-legend-note { font-size: 12.5px; line-height: 1.5; color: var(--muted); margin: 12px 0 0; text-wrap: pretty; }

/* numeric scale reference (passive) */
.md-ticks { display: flex; gap: 5px; justify-content: flex-start; }
.md-tick {
  flex: 1; min-width: 24px; height: 34px; border-radius: 7px;
  background: var(--surface); border: 1px solid var(--border-2); color: var(--muted);
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums;
}
.md-num-anchors { display: flex; justify-content: space-between; gap: 12px; margin-top: 9px; font-size: 12px; font-weight: 600; color: var(--muted); max-width: 420px; }

/* question list — compact rows */
.md-qs { list-style: none; margin: 0; padding: 0; }
.md-q { display: block; padding: 11px 0; border-top: 1px solid var(--border); }
.md-q:first-child { border-top: none; }
.md-q-row { display: flex; align-items: flex-start; gap: 13px; }
.md-q-n {
  flex: none; width: 23px; height: 23px; border-radius: 7px; margin-top: 0;
  background: var(--field); border: 1px solid var(--border); color: var(--muted);
  display: grid; place-items: center; line-height: 1;
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.md-q-t { font-size: 14px; line-height: 1.45; font-weight: 500; color: var(--ink); padding-top: 3px; text-wrap: pretty; }

/* per-question answer options — passive, aligned under the question text */
.md-q-opts { padding-left: 37px; margin-top: 11px; }
.md-opts { display: flex; flex-wrap: wrap; gap: 7px; }
.md-opt {
  display: inline-flex; align-items: center; justify-content: center; height: 28px; padding: 0 13px; border-radius: 999px;
  background: var(--field); border: 1px solid var(--border-2); color: var(--ink-soft);
  font-size: 12.5px; font-weight: 600; text-align: center; cursor: default; white-space: nowrap;
}
.md-opt.na { color: var(--faint); border-style: dashed; }
.md-opt-input { background: var(--accent-tint); border-color: var(--accent-tint-2); color: var(--accent-text); font-weight: 700; }
.md-opt-num { min-width: 34px; height: 32px; padding: 0; font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums; }
.md-opts-num { display: block; }
.md-opts-num-row { display: flex; flex-wrap: wrap; gap: 6px; }
.md-opts-anchors { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; max-width: 380px; font-size: 11.5px; font-weight: 600; color: var(--muted); }

.md-sec-note { font-size: 12.5px; line-height: 1.5; color: var(--muted); text-align: center; max-width: 540px; margin: 0 auto 14px; text-wrap: pretty; }

/* info blocks — scoring & interpretation */
.md-info {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 22px 24px; margin-bottom: 14px; box-shadow: var(--sh-1);
}
.md-info-head { display: flex; align-items: center; gap: 11px; margin-bottom: 16px; }
.md-info-head > svg { width: 20px; height: 20px; color: var(--accent); flex: none; }
.md-info-title { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--ink); }
.md-info-dir { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.md-bullets { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.md-bullets li { position: relative; padding-left: 22px; font-size: 14px; line-height: 1.55; color: var(--ink-soft); }
.md-bullets li::before { content: ""; position: absolute; left: 5px; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* interpretation ranges */
.md-ranges { display: flex; flex-direction: column; }
.md-range { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border); }
.md-range:first-child { border-top: none; }
.md-range-dot { flex: none; width: 11px; height: 11px; border-radius: 50%; background: var(--accent); }
.md-range-r { font-family: var(--font-display); font-weight: 800; font-size: 14px; color: var(--ink); width: 92px; flex: none; font-variant-numeric: tabular-nums; }
.md-range-l { font-size: 14px; font-weight: 500; color: var(--ink-soft); }
/* calm clinical severity tones (best → worst) — supports up to 5 bands */
.md-range-dot.t0 { background: #2E7D5B; }
.md-range-dot.t1 { background: #6F9A3E; }
.md-range-dot.t2 { background: #B7902F; }
.md-range-dot.t3 { background: #C0673A; }
.md-range-dot.t4 { background: #A6492F; }

/* footer */
.md-footer { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--border); display: flex; }
.md-footer .btn svg { width: 16px; height: 16px; transform: rotate(180deg); }

/* responsive */
@media (max-width: 720px) {
  .md-card { gap: 14px; padding: 16px; }
  .md-card-mark { width: 48px; height: 48px; }
  .md-q-opts { padding-left: 0; }
}

/* ============================================================
   LIBRARY LIST — redesigned card grid (count + names)
   ============================================================ */
.oml-count { margin-left: auto; align-self: center; font-size: 13px; font-weight: 600;
  color: var(--muted); font-variant-numeric: tabular-nums; }
.oml-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.oml-card { display: flex; flex-direction: column; align-items: stretch; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--sh-1); padding: 18px 18px 16px; cursor: pointer;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease), transform .16s var(--ease); }
.oml-card:hover { border-color: var(--accent-tint-2); box-shadow: var(--sh-2); transform: translateY(-2px); }
.oml-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.oml-mark { height: 40px; min-width: 56px; padding: 0 13px; border-radius: 11px; background: var(--accent);
  color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800;
  font-size: 15px; letter-spacing: .02em; }
.oml-name { font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -.01em;
  color: var(--ink); line-height: 1.25; }
.oml-en { font-size: 12.5px; color: var(--faint); margin-top: 2px; }
.oml-meta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.oml-meta-i { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.oml-meta-ico { width: 15px; height: 15px; color: var(--accent); display: grid; place-items: center; }
.oml-meta-ico > svg { width: 15px; height: 15px; }
.oml-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.oml-go { display: inline-flex; align-items: center; gap: 5px; margin-top: 14px; color: var(--accent-text);
  font-size: 12.5px; font-weight: 700; opacity: .68; transition: opacity .16s, gap .16s; }
.oml-go > svg { width: 15px; height: 15px; }
.oml-card:hover .oml-go { opacity: 1; gap: 8px; }
@media (max-width: 720px){ .oml-grid { grid-template-columns: 1fr; } }

/* ============================================================
   LIBRARY LIST — reference-index rows (alt style)
   ============================================================ */
.oml-list { display: flex; flex-direction: column; gap: 10px; }
.omr { display: flex; align-items: center; gap: 18px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--sh-1); padding: 14px 18px; cursor: pointer;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease); }
.omr:hover { border-color: var(--accent-tint-2); box-shadow: var(--sh-2); }
.omr-mark { flex: none; align-self: center; height: 56px; min-width: 72px; padding: 0 14px;
  display: grid; place-items: center; border-radius: var(--r-md);
  background: var(--accent); color: #fff;
  font-family: var(--font-display); font-weight: 800; font-size: 17px; letter-spacing: .02em; }
.omr-body { flex: 1 1 auto; min-width: 0; }
.omr-name { font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -.01em;
  color: var(--ink); line-height: 1.25; }
.omr-en { font-size: 12.5px; color: var(--faint); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.omr-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.omr-stats { flex: none; display: flex; align-items: stretch; gap: 0; }
.omr-stat { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 76px; padding: 0 14px; }
.omr-stat + .omr-stat { border-left: 1px solid var(--border); }
.omr-stat-v { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.omr-stat-k { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.omr-dir { flex: none; }
.omr-chev { flex: none; color: var(--faint); display: grid; place-items: center; transition: transform .16s var(--ease), color .16s; }
.omr-chev > svg { width: 18px; height: 18px; }
.omr:hover .omr-chev { color: var(--accent); transform: translateX(3px); }
@media (max-width: 1080px){
  .omr { flex-wrap: wrap; gap: 12px 16px; }
  .omr-body { flex-basis: calc(100% - 88px); }
  .omr-stats { order: 3; margin-left: 88px; }
  .omr-dir { order: 4; }
  .omr-chev { display: none; }
}
@media (max-width: 560px){
  .omr-stats { margin-left: 0; }
  .omr-stat { min-width: 64px; padding: 0 10px; align-items: flex-start; }
  .omr-stat:first-child { padding-left: 0; }
  .omr-stat + .omr-stat { border-left: none; }
}

/* ============================================================
   OUTCOME-MEASURE TABLE (reference style)
   ============================================================ */
.omtbl .omtbl-acr { width: 170px; }
.omtbl .omtbl-lang { width: 170px; }
.omtbl tbody .omtbl-name { font-weight: 600; font-size: 14.5px; color: var(--ink); letter-spacing: -.005em; }
.omtbl tbody .omtbl-acr { font-weight: 700; font-size: 13.5px; color: var(--ink-soft); letter-spacing: .02em; }
.lang-badge { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 10px;
  border: 1px solid var(--border-2); border-radius: var(--r-sm); background: var(--surface);
  font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.lang-flag { width: 20px; height: 14px; border-radius: 2px; flex: none; border: 1px solid var(--border); overflow: hidden; display: block; }
