/* HepFe-specific layout; shared applications keep their own presentation. */
.hepfe-body { --app-max: 1180px; }
.hepfe-body .app-main { max-width: 1180px; }
.hepfe-toolbar { display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin-bottom:14px; }
.hepfe-link { font-size:14px; color:var(--accent); text-decoration:underline; padding:10px; }
.hepfe-intro { max-width:88ch; font-size:13px; margin-bottom:24px; color:var(--ink-soft); }
.hepfe-workspace { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:24px; align-items:start; }
.hepfe-workspace > *, .hepfe-inputs, .hepfe-analysis { min-width:0; }
.hepfe-body .app-card-title { line-height:1.6; }
.hepfe-body .app-card > p:not([class]) { font-size:13px; margin-bottom:16px; }
.hepfe-body .field-hint { line-height:1.6; font-size:13px; }
.hepfe-input, .hepfe-import textarea, .hepfe-chart-tools select { font:inherit; color:var(--ink); background:var(--white); border:1px solid var(--neutral-400); border-radius:9px; padding:10px; max-width:100%; }
.hepfe-input { width:100%; min-height:44px; }
.hepfe-body .echo-fill { margin-top:16px; }
.hepfe-body .echo-fill .f { min-width:90px; }
.hepfe-body .echo-fill button { width:100%; }
.hepfe-body .echo-table { table-layout:fixed; }
.hepfe-body .echo-table th:first-child { width:28px; }
.hepfe-body .echo-table th:last-child { width:54px; }
.hepfe-body .echo-table td { padding:4px; }
.hepfe-body .echo-table input { min-height:44px; font-size:16px; min-width:0; padding:9px 6px; }
.hepfe-body .echo-table input[aria-invalid=true] { border:2px solid var(--red); }
.hepfe-body .echo-toggle { width:44px; height:44px; border-radius:10px; }
.hepfe-body .echo-row.is-off input { opacity:0.7; }
.hepfe-body button:focus-visible, .hepfe-body a:focus-visible, .hepfe-body summary:focus-visible, .hepfe-body select:focus-visible, .hepfe-body input:focus-visible, .hepfe-body textarea:focus-visible { outline:3px solid var(--accent); outline-offset:3px; }
.hepfe-row-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:18px; }
.hepfe-row-actions .btn-app { padding:10px 12px; }
.hepfe-import { margin:12px 0 20px; font-size:13px; }
.hepfe-import summary { cursor:pointer; color:var(--accent); font-weight:600; padding:8px 0; }
.hepfe-import label { display:block; margin:12px 0 8px; }
.hepfe-import textarea { width:100%; font-size:16px; }
.hepfe-feedback { font-size:13px; color:var(--ink-soft); margin:8px 0; }
.hepfe-feedback:empty { display:none; }
.hepfe-feedback.is-error { color:var(--red); }
.hepfe-demo { border-left:3px solid var(--accent); background:var(--blue-50); padding:12px 16px; margin-bottom:20px; font-size:13px; }
.hepfe-chart-tools { display:flex; flex-wrap:wrap; align-items:center; gap:10px; font-size:13px; margin-bottom:14px; }
.hepfe-chart-tools select { min-height:44px; font-size:16px; }
.hepfe-body .chart-wrap { min-height:240px; }
.hepfe-body .chart-wrap svg { overflow:hidden; touch-action:manipulation; }
.hepfe-body .chart-axis text, .hepfe-body .chart-label { font-size:12px; }
.hepfe-body .chart-hit, .hepfe-body .chart-pt.on .chart-hit, .hepfe-body .chart-pt.off .chart-hit { fill:transparent; stroke:none; }
.hepfe-body .chart-pt .chart-dot { r:5; stroke-width:2; }
.hepfe-body .chart-pt:focus-visible .chart-dot { stroke:var(--ink); stroke-width:3; r:8; }
.hepfe-body .chart-pt:hover .chart-hit { r:22; }
.hepfe-body .chart-caption { gap:10px 18px; }
.hepfe-quality { border:1px solid var(--neutral-200); border-left:4px solid var(--accent); background:var(--white); border-radius:12px; padding:18px; margin-bottom:18px; }
.hepfe-quality h3 { font-size:16px; color:var(--ink); margin-bottom:8px; }
.hepfe-quality p, .hepfe-quality li { font-size:13px; line-height:1.6; }
.hepfe-quality ul { padding-left:18px; margin-top:8px; }
.hepfe-quality li + li { margin-top:8px; }
.hepfe-quality.is-blocked { border-left-color:var(--red); }
.hepfe-quality.is-review { border-left-color:var(--amber-700); }
.hepfe-body .tr-card.borderline { background:var(--blue-50); border-color:var(--blue-300); }
.hepfe-body .tr-card.borderline .tr-level { color:var(--accent-dark); }
.hepfe-body .tr-card .tr-level { font-family:var(--font-sans); font-variant-numeric:tabular-nums; font-size:clamp(34px,8vw,52px); overflow-wrap:anywhere; }
.hepfe-body .tr-points { color:var(--ink-soft); }
.hepfe-body .report-box { min-height:380px; font-size:14px; margin-top:12px; }
.hepfe-body .app-details a { text-decoration:underline; overflow-wrap:anywhere; }
.hepfe-body .app-details code { white-space:normal; overflow-wrap:anywhere; }
.hepfe-body #methods { scroll-margin-top:85px; }
.hepfe-body .stage-table { font-size:13px; }
.hepfe-body .stage-table td { white-space:normal; }
.hepfe-body .btn-app:disabled { opacity:0.5; cursor:not-allowed; }
.hepfe-sr { position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
@media(max-width:899px) { .hepfe-workspace { grid-template-columns:1fr; gap:0; } .hepfe-body .app-main { max-width:720px; } }
@media(max-width:400px) { .hepfe-body .app-card { padding:14px; } .hepfe-body .echo-fill { padding:10px; } .hepfe-body .echo-fill .f { min-width:80px; } .hepfe-body .app-header { gap:12px; } .hepfe-body .rec-grid { gap:10px; } .hepfe-body .rec-card { padding:12px; } }
.hepfe-export{margin-top:20px;border-top:1px solid var(--neutral-300);padding-top:16px}
.hepfe-export summary{font-size:14px;font-weight:600;cursor:pointer;color:var(--accent);min-height:44px;display:list-item}
.hepfe-export[open] summary{margin-bottom:12px}
.hepfe-export canvas{display:block;width:100%;height:auto;max-width:600px;background:#fff;border:1px solid var(--neutral-300);border-radius:4px;margin:14px 0}
.hepfe-export .report-actions{gap:10px;flex-wrap:wrap}
.hepfe-export #export-status{font-size:13px;line-height:1.6;margin:12px 0}
.hepfe-export #export-status.is-error{color:var(--red)}
.hepfe-export select{max-width:100%}
.hepfe-export canvas[hidden]{display:none}

/* HepFe 2.2: readable steps and protected teaching examples. */
.hepfe-body { font-size:16px; }
.hepfe-body .app-header { margin-bottom:28px; }
.hepfe-body .app-header-icon { width:80px;height:80px;flex-basis:80px; }
.hepfe-body .app-header-icon img { width:100%;height:100%;object-fit:cover; }
.hepfe-body .app-header-text h1 { font-size:clamp(27px,3.5vw,38px);line-height:1.2;letter-spacing:-.035em; }
.hepfe-body .app-header-text p { font-size:16px;line-height:1.6;margin-top:8px; }
.hepfe-section-heading { display:flex;gap:12px;align-items:center;margin-bottom:20px; }
.hepfe-section-heading h2 { font-family:var(--font-sans);font-size:21px;font-weight:600;line-height:1.3;color:var(--ink);letter-spacing:-.025em;margin:0; }
.hepfe-step { display:grid;place-items:center;width:34px;height:34px;flex:0 0 34px;border:1px solid var(--neutral-300);border-radius:10px;font-size:13px;font-weight:700;color:var(--accent);font-variant-numeric:tabular-nums; }
.hepfe-tag { font-size:10px;letter-spacing:.12em;font-weight:700;margin-left:auto;color:var(--ink-soft); }
.hepfe-body .hepfe-examples { background:var(--blue-50);border-color:var(--blue-300);padding:26px; }
.hepfe-example-intro { font-size:16px;line-height:1.6;margin:0 0 20px;color:var(--ink-soft);max-width:75ch; }
.hepfe-example-grid { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px; }
.hepfe-example { position:relative;display:grid;text-align:left;padding:20px;border:1px solid var(--neutral-300);border-radius:16px;background:var(--white);color:var(--ink);cursor:pointer;font:inherit;min-width:0;transition:border-color .18s,box-shadow .18s;touch-action:manipulation; }
.hepfe-example:hover { border-color:var(--accent);box-shadow:0 4px 20px rgba(10,40,70,.09); }
.hepfe-example[aria-pressed=true] { border:2px solid var(--accent);padding:19px;box-shadow:0 0 0 3px var(--blue-100); }
.hepfe-example-name { font-size:18px;font-weight:600;line-height:1.35; }
.hepfe-example-value { font-size:32px;line-height:1.4;font-weight:600;letter-spacing:-.04em;font-variant-numeric:tabular-nums;margin-top:12px; }
.hepfe-example-value small { font-size:14px;font-weight:400;letter-spacing:0;color:var(--ink-soft); }
.hepfe-example-range { font-size:13px;color:var(--ink-soft); }
.hepfe-example svg { width:100%;height:64px;margin:14px 0 8px; }
.hepfe-example .mini-axis { fill:none;stroke:var(--neutral-300);stroke-width:1; }
.hepfe-example .mini-curve { fill:none;stroke:var(--accent);stroke-width:2.5;stroke-linecap:round; }
.hepfe-example-detail { font-size:13px;color:var(--ink-soft);font-variant-numeric:tabular-nums; }
.hepfe-example-action { display:flex;justify-content:space-between;align-items:center;margin-top:18px;padding-top:12px;border-top:1px solid var(--neutral-200);font-size:14px;color:var(--accent);font-weight:600; }
.hepfe-example-method { font-size:14px;line-height:1.7;color:var(--ink-soft);margin:18px 0 8px; }
.hepfe-examples .hepfe-link { display:inline-block;padding:0;min-height:32px; }
.hepfe-toolbar { gap:8px;margin:22px 0; }
.hepfe-toolbar > a { padding:10px 14px;min-height:44px;border:1px solid var(--neutral-300);border-radius:999px;font-size:14px;color:var(--ink-soft);background:var(--white); }
.hepfe-toolbar > a:hover { color:var(--accent);border-color:var(--accent); }
.hepfe-toolbar #btn-reset { margin-left:auto; }
.hepfe-demo { display:flex;align-items:center;justify-content:space-between;gap:20px;border-radius:12px;border:1px solid var(--blue-300);border-left:4px solid var(--accent);padding:20px; }
.hepfe-demo[hidden] { display:none; }
.hepfe-demo strong { font-size:15px;color:var(--accent); }
.hepfe-demo p { font-size:15px;line-height:1.6;margin:8px 0 0;max-width:75ch; }
.hepfe-demo .btn-app { flex-shrink:0; }
.hepfe-demo .hepfe-link { display:inline-block;padding:8px 0 0; }
.hepfe-body .app-card > p:not([class]),.hepfe-body .field-hint,.hepfe-body .chart-hint,.hepfe-quality p,.hepfe-quality li { font-size:15px;line-height:1.7; }
.hepfe-body .field-label { font-size:15px;line-height:1.5; }
.hepfe-body .select-wrap select,.hepfe-body .hepfe-input,.hepfe-body .echo-fill input { font-size:16px;min-height:48px; }
.hepfe-body .echo-fill label { text-transform:none;letter-spacing:0;font-size:13px; }
.hepfe-body .echo-fill button,.hepfe-body .btn-app { min-height:46px;font-size:14px; }
.hepfe-body .echo-table th { font-size:13px;text-transform:none;letter-spacing:0; }
.hepfe-body .chart-wrap { min-height:200px; }
.hepfe-body .chart-wrap:has(svg) { min-height:0; }
.hepfe-body .chart-caption { font-size:14px; }
.hepfe-body .hepfe-quality h3 { font-size:17px;line-height:1.4; }
.hepfe-body .hepfe-quality { padding:20px; }
.hepfe-body .report-box { font-family:var(--font-sans);font-size:16px;line-height:1.75; }
.hepfe-body .app-details summary { font-size:16px;line-height:1.5;min-height:48px; }
.hepfe-body .app-details-body,.hepfe-body .stage-table { font-size:15px;line-height:1.7; }
.hepfe-body #acquisition-card,.hepfe-body #echo-card,.hepfe-body #chart-card,.hepfe-body #result-card,.hepfe-body #report-card,.hepfe-body #examples,.hepfe-body #demo-status { scroll-margin-top:85px; }
.hepfe-mobile-result { display:none; }
@media(max-width:700px) {
 .hepfe-body .hepfe-examples { padding:20px; }
 .hepfe-example-grid { grid-template-columns:1fr;gap:12px; }
 .hepfe-example { grid-template-columns:minmax(0,1fr) 100px;column-gap:12px;padding:16px; }
 .hepfe-example[aria-pressed=true] { padding:15px; }
 .hepfe-example-name { grid-column:1 / -1;font-size:18px; }
 .hepfe-example-value { grid-column:1;grid-row:2;margin-top:8px;font-size:30px; }
 .hepfe-example-range { grid-column:1;grid-row:3; }
 .hepfe-example svg { grid-column:2;grid-row:2 / 4;align-self:center;margin:0; }
 .hepfe-example-detail { grid-column:1 / -1;margin-top:8px; }
 .hepfe-example-action { grid-column:1 / -1;margin-top:12px;padding-top:10px; }
 .hepfe-demo { flex-direction:column;align-items:stretch;gap:14px; }
 .hepfe-demo .btn-app { width:100%; }
 .hepfe-tag { display:none; }
 .hepfe-toolbar #btn-reset { margin-left:0; }
}
@media(max-width:899px) {
 .hepfe-body { padding-bottom:calc(82px + env(safe-area-inset-bottom)); }
 .hepfe-mobile-result { display:flex;align-items:center;gap:12px;position:fixed;bottom:0;left:0;right:0;z-index:40;padding:12px max(16px,env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));background:var(--white);border-top:1px solid var(--neutral-300);box-shadow:0 -4px 20px rgba(0,0,0,.07);color:var(--ink);text-decoration:none; }
 .hepfe-mobile-result > span:first-child { flex:1;min-width:0; }
 .hepfe-mobile-result strong,.hepfe-mobile-result small { display:block; }
 .hepfe-mobile-result strong { font-size:14px; }
 .hepfe-mobile-result small { font-size:12px;line-height:1.5;color:var(--ink-soft); }
 .hepfe-mobile-result b { color:var(--accent);font-size:18px;font-variant-numeric:tabular-nums;white-space:nowrap; }
}
@media(max-width:400px) {
 .hepfe-body .hepfe-examples { padding:16px; }
 .hepfe-section-heading { gap:9px; }
 .hepfe-section-heading h2 { font-size:19px; }
 .hepfe-example { grid-template-columns:minmax(0,1fr) 80px; }
 .hepfe-body .app-header-icon { width:62px;height:62px;flex-basis:62px; }
 .hepfe-body .app-header-text h1 { font-size:25px; }
 .hepfe-body .app-header-text p { font-size:14px; }
}
@media(prefers-reduced-motion:reduce) { .hepfe-example { transition:none; } }
@media print { .hepfe-examples,.hepfe-toolbar,.hepfe-mobile-result,#btn-exit-demo { display:none; } }

/* Local DICOM/OCR import and author links. */
.hf-files { margin-bottom:26px; }
.hf-drop { display:flex;flex-direction:column;gap:10px;padding:26px;text-align:center;border:2px dashed var(--accent-light);border-radius:14px;background:var(--blue-50);cursor:pointer; }
.hf-drop strong { font-size:20px;color:var(--accent); }
.hf-drop span { font-size:15px;color:var(--ink-soft); }
.hf-drop input { max-width:100%;align-self:center;font-size:14px;margin-top:8px; }
.hf-drop.is-over { outline:3px solid var(--accent);outline-offset:3px; }
.hf-file-actions { display:flex;align-items:center;flex-wrap:wrap;gap:16px;margin:18px 0; }
#file-status { font-size:15px;line-height:1.6;flex:1;min-width:200px; }
#file-status.is-error { color:var(--red); }
.hf-view-tools { display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin-bottom:16px; }
.hf-view-tools select { flex:1;min-width:150px;width:auto; }
.hf-view-tools button { font-size:26px!important;min-width:48px; }
.hf-import-grid { display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);gap:24px; }
.hf-import-grid > * { min-width:0; }
.hf-import-grid h3 { font-size:18px;margin:0 0 16px; }
#file-canvas { display:block;width:100%;height:auto;background:#000;border-radius:8px;max-height:650px;object-fit:contain; }
#file-canvas.is-dicom { touch-action:none;cursor:crosshair;max-height:none; }
.hf-roi-numbers { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:12px 0; }
.hf-roi-numbers label { font-size:13px;color:var(--ink-soft); }
.hf-roi-numbers input { width:100%;min-width:0;font:inherit;font-size:16px;padding:8px;border:1px solid var(--neutral-300);border-radius:8px;background:var(--white);color:var(--ink);min-height:44px; }
.hf-measurements { max-height:340px;overflow:auto;margin-bottom:16px; }
#ocr-text { white-space:pre-wrap;overflow-wrap:anywhere;font:13px/1.6 var(--font-sans);max-height:300px;overflow:auto; }
.hf-brands { max-width:1180px;width:calc(100% - 32px);margin:10px auto 30px;display:grid;grid-template-columns:1fr 1fr;gap:20px; }
.hf-brands a { display:flex;align-items:center;gap:20px;padding:20px;background:var(--white);border:1px solid var(--neutral-200);border-radius:16px;color:var(--ink); }
.hf-brands img { width:100px;height:112px;object-fit:contain;background:#fff;border-radius:8px; }
.hf-brands span { display:flex;flex-direction:column;gap:8px; }
.hf-brands strong { font-size:19px; }.hf-brands small { font-size:14px;line-height:1.5;color:var(--ink-soft); }.hf-brands b { font-size:14px;color:var(--accent); }
@media(max-width:800px){.hf-import-grid,.hf-brands{grid-template-columns:1fr}.hf-drop{padding:18px}.hf-roi-numbers{grid-template-columns:repeat(2,minmax(0,1fr))}.hf-brands a{gap:14px;padding:16px}.hf-brands img{width:82px;height:96px}.hf-brands strong{font-size:17px}}
@media print{.hf-files,.hf-brands{display:none}}
.hf-drop input::file-selector-button { border:0;border-radius:8px;padding:10px 14px;background:var(--accent);color:var(--white);font:inherit;font-weight:600;cursor:pointer;margin-right:10px; }
#file-import { scroll-margin-top:85px; }
.hf-view-tools #file-index { min-width:54px;text-align:center; }

.hepfe-input-routes{display:flex;gap:10px;flex-wrap:wrap;margin:20px 0}.hepfe-input-routes button{min-height:48px;padding:12px 16px;border:1px solid var(--neutral-300);border-radius:10px;background:var(--white);color:var(--ink);font:600 15px var(--font-sans);cursor:pointer}.hepfe-input-routes button[aria-pressed=true]{background:var(--blue-50);border-color:var(--accent);color:var(--accent-dark)}.hepfe-validity{background:var(--white);border:1px solid var(--neutral-200);border-radius:14px;padding:18px;margin-bottom:16px;font-size:14px;line-height:1.6}.hepfe-validity h3{font-size:18px;margin-bottom:12px}.hepfe-validity dl>div{padding:8px 0;border-bottom:1px solid var(--neutral-200)}.hepfe-validity dt{font-weight:600}.hepfe-validity dd{margin:0;color:var(--ink-soft)}.hepfe-validity p{margin-top:12px}.hepfe-input-routes button:focus-visible{outline:3px solid var(--accent);outline-offset:3px}@media(max-width:560px){.hepfe-input-routes button{flex:1;min-width:100px;font-size:14px}}
