/* Patient Education Readability Checker — app styles (on top of /assets/labs.css) */
.app-page .page-title { margin-bottom: 18px; }
.app-block { margin-top: 20px; min-width: 0; }
.h-sm { font-size: 22px; margin: 0 0 12px; }
.h-xs { font-size: 17px; margin: 18px 0 8px; display: flex; align-items: center; gap: 8px; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.block-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 12px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.field-msg { min-height: 1.4em; margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.field-msg.err { color: var(--danger); font-weight: 600; }
.field-msg.ok { color: var(--ok); font-weight: 600; }
.danger { color: var(--danger) !important; border-color: color-mix(in srgb, var(--danger) 45%, var(--line)) !important; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.linklike:focus-visible, .btn:focus-visible, .file-btn:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }

.layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 940px) { .layout { grid-template-columns: minmax(0, 1fr); } }

.editor label { margin-top: 10px; }
.doc-row { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: end; }
.doc-row .grow { flex: 1 1 220px; margin-top: 0; }
#doc-count { margin: 6px 0 0; }
#text { min-height: 360px; font-size: 16px; line-height: 1.6; resize: vertical; }
#char-count { margin: 6px 0 0; text-align: right; }
.ed-foot { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; justify-content: space-between; margin-top: 8px; }
.ed-foot .target { flex: 1 1 240px; max-width: 320px; }
.file-btn { cursor: pointer; position: relative; }

.headline { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: start; }
.kicker { margin: 0; font-size: 13px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.big { margin: 2px 0 2px; font-size: 56px; line-height: 1.05; font-weight: 780; letter-spacing: -0.03em; }
.big.mid { font-size: 40px; }
.fre-box { text-align: right; max-width: 180px; }
@media (max-width: 480px) { .headline { grid-template-columns: 1fr; } .fre-box { text-align: left; max-width: none; } .big { font-size: 46px; } }
.verdict { display: inline-block; margin: 12px 0 6px; padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: 15px; }
.verdict { color: var(--text); border: 1px solid transparent; }
.verdict::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; background: currentColor; }
.verdict.on { background: color-mix(in srgb, var(--ok) 14%, var(--bg)); border-color: var(--ok); }
.verdict.on::before { background: var(--ok); }
.verdict.close { background: color-mix(in srgb, var(--warn) 14%, var(--bg)); border-color: var(--warn); }
.verdict.close::before { background: var(--warn); }
.verdict.above { background: color-mix(in srgb, var(--danger) 12%, var(--bg)); border-color: var(--danger); }
.verdict.above::before { background: var(--danger); }
.gauge-wrap { margin-top: 6px; }
.gauge { width: 100%; max-width: 460px; height: auto; display: block; }
.g-track { fill: var(--line); }
.g-ok { fill: color-mix(in srgb, var(--ok) 55%, var(--bg)); }
.g-target { stroke: var(--text); stroke-width: 2; }
.g-dot { fill: var(--accent); stroke: var(--bg); stroke-width: 3; }
.g-label { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.gauge-key { margin: 0 0 12px; }

.formulas { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 15px; }
.formulas th, .formulas td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.formulas thead th { font-size: 13px; color: var(--muted); font-weight: 650; }
.formulas tbody th { font-weight: 600; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
@media (max-width: 560px) { .formulas td.small { display: none; } .formulas thead th:last-child { display: none; } }
.counts { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin: 16px 0 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.stat dt { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat dd { margin: 2px 0 0; font-size: 20px; font-weight: 750; font-variant-numeric: tabular-nums; }

.issue-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 28px; }
@media (max-width: 860px) { .issue-grid { grid-template-columns: minmax(0, 1fr); } }
.count { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 750; }
.count.has { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.issues { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; max-height: 520px; overflow: auto; }
.issue { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--bg); }
.issue p { margin: 4px 0 8px; overflow-wrap: anywhere; }
.issue .quote { font-size: 14px; color: var(--text); }
.issue-head { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.issues .none { padding: 6px 0; font-size: 14px; }

.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 12px; }
.preview { font-size: 17px; line-height: 1.75; max-width: 75ch; overflow-wrap: anywhere; }
.preview p { margin: 0 0 12px; }
.pv-heading { font-weight: 750; font-size: 19px; }
.pv-bullet { padding-left: 22px; position: relative; }
.pv-bullet::before { content: "\2022"; position: absolute; left: 6px; color: var(--muted); }
.m-long { background: color-mix(in srgb, var(--warn) 16%, transparent); border-radius: 4px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
mark.m-jargon { background: color-mix(in srgb, var(--accent) 22%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; border-bottom: 2px solid var(--accent); }
mark.m-passive { background: transparent; color: inherit; text-decoration: underline wavy var(--danger); text-underline-offset: 4px; }
.legend .m-long, .legend mark { padding: 0 6px; }

.cmp { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 15px; }
.cmp caption { text-align: left; padding-bottom: 6px; }
.cmp th, .cmp td { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; }
.cmp thead th { font-size: 13px; color: var(--muted); }
.cmp tbody th { font-weight: 600; }
.cmp .better { color: var(--ok); }
.cmp .worse { color: var(--danger); }

.checklist { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 10px; }
.checklist .check { font-weight: 500; font-size: 15px; align-items: flex-start; }
#report-text { margin-top: 10px; font-family: var(--mono); font-size: 13px; }
.disclaimer { margin-top: 24px; }

@media print {
  .top, .foot, .no-print, .skip, #phi-notice, .btn, .btn-row, .file-btn, #issue-msg, .editor { display: none !important; }
  .layout { grid-template-columns: 1fr; }
  .card { box-shadow: none; border: 1px solid #ccc; }
  .issues { max-height: none; overflow: visible; }
  body { background: #fff; color: #000; }
}

.ed-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.ed-meta #char-count { margin-left: auto; }
.live-score { margin: 6px 0 0; font-weight: 700; font-size: 15px; }
.live-score.on { color: var(--ok); }
.live-score.close { color: var(--text); }
.live-score.above { color: var(--danger); }
.print-only { display: none; }
@media print {
  .print-only { display: block; font-weight: 600; margin: 0 0 12px; }
  .field-msg, .live-score, #lang-warn[hidden] { display: none !important; }
  .card { break-inside: auto; }
  .issue, .stat, .cmp tr { break-inside: avoid; }
  .app-page .page-title { font-size: 24px; }
}
