:root{--bg:#f4f8fd;--surface:#fff;--line:#dce8f4;--text:#112d5f;--muted:#6d809d;--blue:#176fdd;--blue2:#0d5fc3;--green:#0f9b74;--green-bg:#edf9f4;--amber:#d98612;--amber-bg:#fff6e7;--red:#d94b4b;--purple:#7547d7;--shadow:0 12px 34px rgba(20,62,110,.08);--radius:16px}
*{box-sizing:border-box}html{scroll-behavior:smooth;max-width:100%}body{margin:0;max-width:100%;background:linear-gradient(#f8fbff,#f2f7fc 48%,#fff);color:var(--text);font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;font-size:15px}.page-shell{width:100%;max-width:1680px;margin:0 auto}.topbar{height:76px;background:rgba(255,255,255,.95);border-bottom:1px solid #e7eef6;display:flex;align-items:center;justify-content:space-between;padding:0 5vw;position:sticky;top:0;z-index:30;backdrop-filter:blur(14px)}.brand{display:flex;gap:12px;align-items:center;color:var(--text);text-decoration:none;min-width:220px}.brand-icon{width:44px;height:44px;color:#0c68cd}.brand-copy{display:flex;flex-direction:column}.brand-copy strong{font-size:22px;line-height:1.05}.brand-copy small{font-size:13px;color:#7487a4;margin-top:4px}.desktop-nav{display:flex;gap:38px;height:100%;align-items:center}.desktop-nav a{height:100%;display:flex;align-items:center;color:#334e78;text-decoration:none;position:relative;font-weight:500}.desktop-nav a.active,.desktop-nav a:hover{color:var(--blue)}.desktop-nav a.active:after{content:"";position:absolute;left:0;right:0;bottom:0;height:3px;background:var(--blue);border-radius:5px}.primary,.secondary{border-radius:10px;padding:13px 20px;border:1px solid transparent;font-weight:700;font-size:14px;cursor:pointer;transition:.2s}.primary{background:linear-gradient(135deg,#1576e8,#0d5cc4);color:white;box-shadow:0 7px 18px rgba(17,103,211,.19)}.primary:hover{transform:translateY(-1px)}.primary.compact{padding:13px 22px}.secondary{background:#fff;border-color:#cbdced;color:var(--blue)}.hero{margin:18px 3vw 0;background:linear-gradient(110deg,#fff 0%,#f6fbff 56%,#edf6ff 100%);border:1px solid #e4eef8;border-radius:18px;min-height:150px;display:flex;align-items:center;overflow:hidden;box-shadow:var(--shadow)}.hero-copy{padding:26px 28px;max-width:790px;z-index:2}.hero h1{margin:0 0 9px;font-size:31px;line-height:1.12;letter-spacing:-.4px}.hero p{margin:0;color:#627795;font-size:17px;line-height:1.45}.hero-visual{margin-left:auto;width:520px;align-self:stretch;display:flex;align-items:center;justify-content:center;background:radial-gradient(circle at 80% 50%,rgba(70,151,240,.14),transparent 52%)}.hero-visual svg{width:100%;height:100%}.step-strip{margin:18px 3vw 0;display:grid;grid-template-columns:repeat(5,1fr);gap:0}.step-tab{border:0;background:transparent;color:#6d7f9b;display:flex;flex-direction:column;align-items:center;gap:8px;padding:8px 8px 15px;position:relative;cursor:pointer}.step-tab:before{content:"";height:2px;background:#d5e2f1;position:absolute;top:25px;left:0;right:0;z-index:0}.step-tab:first-child:before{left:50%}.step-tab:last-child:before{right:50%}.step-tab span{width:34px;height:34px;border-radius:50%;background:#e9f0f8;color:#7c8da6;display:grid;place-items:center;font-weight:800;z-index:1;border:4px solid var(--bg)}.step-tab b{font-size:14px}.step-tab.active{color:var(--blue)}.step-tab.active span{background:var(--blue);color:white}.workspace{display:grid;grid-template-columns:minmax(0,1fr) 430px;gap:18px;margin:0 3vw 24px;align-items:start}.main-column{min-width:0}.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:0 5px 20px rgba(23,70,120,.045)}.section-card{padding:24px}.section-title{display:flex;align-items:flex-start;gap:14px;margin-bottom:22px}.section-title .num{width:35px;height:35px;border-radius:50%;background:var(--blue);color:white;display:grid;place-items:center;font-weight:800;flex:none}.section-title h2{font-size:21px;margin:0 0 3px}.section-title p{margin:0;color:var(--muted)}.grid{display:grid;gap:15px}.grid.cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid.cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.compact-grid{max-width:680px}.field{display:flex;flex-direction:column;gap:8px;color:#314d76;font-weight:600}.field>span{font-size:14px}.field input,.field select,.field textarea{width:100%;border:1px solid #cbd9e9;border-radius:9px;background:#fbfdff;padding:12px 13px;color:#17345f;font:inherit;outline:none}.field input:focus,.field select:focus,.field textarea:focus{border-color:#6da8ec;box-shadow:0 0 0 3px rgba(34,122,222,.1)}.segmented{display:flex;gap:8px}.segmented label{flex:1}.segmented input{position:absolute;opacity:0}.segmented span{border:1px solid #ccdceb;border-radius:9px;display:block;text-align:center;padding:11px;background:#fff}.segmented input:checked+span{background:#e9f4ff;border-color:#77afea;color:#0f65c7}.top-gap{margin-top:18px}.event-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:9px}.radio-card{position:relative}.radio-card input{position:absolute;opacity:0}.radio-card span{display:block;border:1px solid #ccdceb;border-radius:10px;padding:13px 14px;background:#fff;color:#28466f;font-weight:650}.radio-card input:checked+span{border-color:#71a9e8;background:#eaf4ff;color:#0d64c6;box-shadow:0 0 0 2px rgba(46,128,222,.08)}.branch{display:none}.branch.active{display:block}.info-banner{border-radius:11px;padding:13px 15px;display:flex;gap:10px;align-items:flex-start;line-height:1.4}.info-banner b{white-space:nowrap}.info-banner.amber{background:var(--amber-bg);border:1px solid #f2c36e;color:#8c5b12}.info-banner.blue{background:#edf6ff;border:1px solid #c4e0ff;color:#285e9c}.info-banner.gray{background:#f2f5f8;border:1px solid #dde5ee;color:#5c6f88}.hidden{display:none!important}.factor-panel{background:#f7faff;border:1px solid #e1eaf4;border-radius:12px;padding:15px}.factor-title{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.factor-title span{font-size:12px;color:#8796aa}.toggle-field{display:flex;flex-direction:column;gap:6px;color:#415a7b;font-size:13px}.toggle-field select{border:1px solid #d2dfec;border-radius:8px;padding:10px;background:#fff;color:#26456d}.subheading{font-weight:800;font-size:15px;margin-bottom:10px}.anatomy-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.check-card{border:1px solid #d7e2ee;border-radius:11px;padding:14px;display:flex;gap:11px;align-items:flex-start;background:#fcfeff}.check-card input{margin-top:4px;accent-color:var(--blue)}.check-card span{display:flex;flex-direction:column;gap:3px}.check-card small{color:#7a8ba4}.form-step{display:none}.form-step.active{display:block}.form-nav{display:flex;justify-content:space-between;margin-top:14px}.results-column{position:sticky;top:94px}.results-card{padding:20px}.results-head h2{font-size:20px;margin:0}.results-head small{color:#7d8ca2}.metric-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:15px}.metric{border-radius:12px;padding:14px;border:1px solid #dce6f1;min-height:138px;position:relative}.metric.blue{background:#f1f7ff}.metric.green{background:#effaf5}.metric.purple{background:#f6f2ff}.metric.neutral{background:#f7f9fc}.metric.red-soft{background:#fff4f4;border-color:#f3d1d1;margin-top:10px;min-height:auto}.metric-label{font-weight:800;font-size:15px}.metric-label span{font-size:12px;color:#477ebf}.metric-value{display:flex;align-items:baseline;gap:3px;margin:7px 0}.metric-value strong{font-size:36px;color:#0c66cb}.metric-value small{font-size:18px;color:#416994}.metric-word{font-size:25px;font-weight:850;margin:9px 0;color:#128264}.metric-word.small{font-size:17px;color:#4f6685}.metric p{font-size:12.5px;line-height:1.35;color:#61758f;margin:7px 0 0}.mini-bar{height:6px;background:#dce9f8;border-radius:99px;overflow:hidden}.mini-bar span{height:100%;display:block;width:0;background:#146fd9;border-radius:99px;transition:.25s}.status-chip{position:absolute;right:10px;top:10px;border-radius:99px;padding:4px 8px;font-size:11px;font-weight:800}.status-chip.amber{background:#fff0cf;color:#a96707;border:1px solid #f2c66e}.interpretation{margin-top:12px;border:1px solid #cfe6de;background:#f0faf6;border-radius:12px;padding:14px;display:flex;gap:12px}.interp-icon{width:34px;height:34px;border-radius:50%;background:#149a76;color:#fff;display:grid;place-items:center;font-weight:900;flex:none}.interpretation h3{margin:0 0 4px;font-size:15px}.interpretation p{margin:0;color:#507069;font-size:13px;line-height:1.4}.completion{margin-top:12px;border:1px solid #dce7f1;border-radius:12px;padding:14px}.completion h3{margin:0 0 8px;font-size:15px}.completion ul{list-style:none;padding:0;margin:0;display:grid;gap:7px}.completion li{font-size:12.5px;color:#536a88;display:flex;gap:8px}.completion li:before{content:"○";color:#7f92aa}.completion li.done:before{content:"✓";color:#0b9b72;font-weight:900}.completion li.warn:before{content:"!";color:#e1901c;font-weight:900}.result-actions{display:grid;grid-template-columns:1fr 1.4fr;gap:10px;margin-top:12px}.score-detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.score-detail-grid article{border:1px solid #dbe6f1;border-radius:12px;padding:16px;background:#fbfdff}.score-detail-grid .label{font-weight:800}.score-detail-grid .big{font-size:34px;font-weight:900;color:#0f67ca;margin:8px 0}.score-detail-grid .big.text{font-size:25px}.score-detail-grid .big.small{font-size:20px;color:#6a7c96}.score-detail-grid p{margin:0;color:#657994;line-height:1.45}.conclusion-box{display:flex;gap:14px;border:1px solid #cde8dd;background:#effaf6;border-radius:13px;padding:18px}.conclusion-icon{width:42px;height:42px;border-radius:50%;background:#139c74;color:white;display:grid;place-items:center;font-size:22px;font-weight:900}.conclusion-box h3{margin:0 0 4px}.conclusion-box p{margin:0;color:#58726c;line-height:1.45}.checklist-block{margin-top:16px}.checklist-block h3{font-size:16px}.checklist-block ul{list-style:none;padding:0;display:grid;gap:8px}.checklist-block li{padding:9px 11px;background:#f8fbfe;border-radius:9px;color:#526985}.checklist-block li.done:before{content:"✓ ";color:#119a71;font-weight:900}.checklist-block li.warn:before{content:"! ";color:#e0901d;font-weight:900}.final-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:18px}.info-section{margin:26px 3vw 36px;display:grid;grid-template-columns:repeat(3,1fr);gap:14px}.info-card{background:#fff;border:1px solid #e0e9f3;border-radius:14px;padding:20px}.info-card h2{font-size:17px;margin:0 0 8px}.info-card p{margin:0;color:#677b95;line-height:1.5}footer{border-top:1px solid #e4ebf3;background:#fff;min-height:75px;display:flex;align-items:center;justify-content:space-between;padding:0 4vw;color:#667b96}footer div{display:flex;gap:12px;align-items:center}footer span{color:#8898aa}.modal-backdrop{position:fixed;inset:0;background:rgba(12,32,58,.45);display:none;align-items:center;justify-content:center;padding:20px;z-index:100}.modal-backdrop.open{display:flex}.modal{width:min(760px,100%);max-height:90vh;overflow:auto;background:#fff;border-radius:18px;padding:26px;box-shadow:0 30px 90px rgba(10,35,70,.28);position:relative}.modal-close{position:absolute;right:14px;top:10px;border:0;background:none;font-size:28px;color:#66809f;cursor:pointer}.modal-kicker{font-size:12px;text-transform:uppercase;letter-spacing:.08em;color:#1670d8;font-weight:800}.modal h2{margin:6px 0 8px}.modal-lead{color:#667a94;line-height:1.45}.modal-section{border-top:1px solid #e7eef5;margin-top:18px;padding-top:16px}.modal-section h3{font-size:15px}.consent{display:flex;gap:10px;align-items:flex-start;margin-top:18px;color:#536b89;font-size:13px}.consent input{margin-top:3px;accent-color:var(--blue)}.modal-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:18px}
.topbar,.hero,.step-strip,.workspace,.info-section,footer{max-width:100%}.topbar{gap:20px}.desktop-nav{min-width:0;flex-shrink:1}.desktop-nav a{white-space:nowrap}.hero-copy,.main-column,.results-column,.card{min-width:0}img,svg{max-width:100%}
@media(max-width:1050px){.desktop-nav{display:none}.topbar .primary.compact{margin-left:auto}}
@media(max-width:1180px){.desktop-nav{gap:18px}.workspace{grid-template-columns:1fr}.results-column{position:static}.results-card{display:grid;grid-template-columns:1fr 1fr;gap:12px}.results-head,.metric-grid,.interpretation,.completion,.result-actions,.metric.wide{grid-column:1/-1}.hero-visual{width:420px}.grid.cols-4{grid-template-columns:repeat(2,1fr)}}
@media(max-width:800px){body{font-size:14px}.topbar{height:66px;padding:0 16px}.brand{min-width:auto}.brand-copy strong{font-size:18px}.brand-copy small{font-size:11px}.desktop-nav{display:none}.topbar .primary.compact{font-size:0;padding:10px 12px}.topbar .primary.compact:after{content:"Направить";font-size:12px}.hero{margin:12px 12px 0;min-height:auto}.hero-copy{padding:20px}.hero h1{font-size:24px}.hero p{font-size:14px}.hero-visual{display:none}.step-strip{margin:12px 12px 0;overflow:auto;grid-template-columns:repeat(5,135px);justify-content:start}.workspace{margin:0 12px 18px}.section-card{padding:17px}.grid.cols-2,.grid.cols-4,.event-grid,.anatomy-grid,.score-detail-grid,.metric-grid{grid-template-columns:1fr}.results-card{display:block}.metric{margin-top:9px}.info-section{margin:20px 12px;grid-template-columns:1fr}.result-actions{grid-template-columns:1fr}.form-nav{gap:10px}.form-nav button{flex:1}.final-actions{flex-direction:column}.modal{padding:20px}.modal .grid.cols-2{grid-template-columns:1fr}footer{padding:16px 20px;gap:10px;align-items:flex-start;flex-direction:column}.factor-title{align-items:flex-start;gap:5px;flex-direction:column}}
@media print{.topbar,.step-strip,.form-nav,.info-section,footer,.result-actions,.final-actions{display:none!important}.workspace{grid-template-columns:1fr}.results-column{position:static}.form-step{display:none!important}.form-step[data-step="5"]{display:block!important}.results-card{box-shadow:none}.hero{box-shadow:none}.modal-backdrop{display:none!important}}

/* v0.4 — hard horizontal-overflow fix, including Safari trackpad/rubber-band edge cases */
html,body{
  width:100%;
  min-width:0;
  max-width:100%;
  overflow-x:clip !important;
  overscroll-behavior-x:none;
}
body{position:relative;touch-action:pan-y pinch-zoom}
.page-shell{
  width:100%;
  min-width:0;
  max-width:100%;
  overflow-x:clip !important;
  position:relative;
}
.topbar,.hero,.step-strip,.workspace,.info-section,footer{
  min-width:0;
  max-width:100%;
}
.topbar{width:100%;}
.topbar>*{min-width:0}
.brand{min-width:0;flex:0 1 auto}
.brand-copy{min-width:0}
.brand-copy strong,.brand-copy small{overflow-wrap:anywhere}
.desktop-nav{min-width:0;flex:0 1 auto}
.primary.compact{flex:0 0 auto}
.hero{width:auto}
.hero-copy,.hero-visual,.workspace>*,.grid>*,.event-grid>*,.anatomy-grid>*,.metric-grid>*,.score-detail-grid>*{min-width:0}
.hero h1,.hero p,.field,.radio-card span,.metric,.info-banner,.section-title,.completion li{overflow-wrap:anywhere}
.info-banner b{white-space:normal}
input,select,textarea,button{max-width:100%}

/* Hide the full desktop nav a little earlier so its min-content width can never widen the page. */
@media(max-width:1200px){
  .desktop-nav{display:none}
  .topbar .primary.compact{margin-left:auto}
}

@media(max-width:800px){
  .step-strip{
    width:calc(100% - 24px);
    max-width:calc(100% - 24px);
    overscroll-behavior-x:contain;
    -webkit-overflow-scrolling:touch;
  }
}

/* v0.5 — approved visual language */
.brand{min-width:250px;max-width:320px;height:58px;overflow:hidden}
.brand-logo{display:block;width:100%;height:100%;object-fit:contain;object-position:left center}
.hero{min-height:172px}
.hero-copy{max-width:850px}
.hero h1{font-size:34px;line-height:1.12}
.hero p{font-size:17px;line-height:1.55;max-width:820px}
.hero-visual{width:500px;min-width:380px;padding:0;background:linear-gradient(90deg,rgba(240,248,255,0),rgba(230,244,255,.35))}
.hero-visual img{width:100%;height:100%;object-fit:cover;object-position:center center;display:block}
.factor-title{justify-content:flex-start}

/* Unified custom dropdowns. Native select stays in DOM for form logic/accessibility. */
.select-enhanced{position:relative;width:100%;min-width:0}
.select-enhanced>select{position:absolute!important;inset:0!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none!important;padding:0!important;border:0!important}
.select-trigger{width:100%;min-height:45px;border:1px solid #c9d9ea;border-radius:11px;background:linear-gradient(#fff,#f8fbff);color:#17345f;font:600 15px/1.2 Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;padding:11px 42px 11px 14px;text-align:left;cursor:pointer;position:relative;box-shadow:0 1px 1px rgba(17,55,96,.02);transition:border-color .15s,box-shadow .15s,background .15s}
.select-trigger:after{content:"";position:absolute;right:15px;top:50%;width:8px;height:8px;border-right:2px solid #57779c;border-bottom:2px solid #57779c;transform:translateY(-65%) rotate(45deg);transition:transform .15s}
.select-enhanced.open .select-trigger{border-color:#5a9eea;box-shadow:0 0 0 3px rgba(36,122,220,.10);background:#fff}
.select-enhanced.open .select-trigger:after{transform:translateY(-35%) rotate(225deg)}
.select-menu{position:absolute;z-index:120;left:0;right:0;top:calc(100% + 7px);margin:0;padding:6px;list-style:none;background:#fff;border:1px solid #d3e0ee;border-radius:13px;box-shadow:0 18px 42px rgba(20,58,100,.16);max-height:300px;overflow:auto;display:none}
.select-enhanced.open .select-menu{display:block;animation:dropdownIn .12s ease-out}
@keyframes dropdownIn{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}
.select-option{width:100%;border:0;background:transparent;border-radius:9px;padding:10px 11px 10px 36px;text-align:left;color:#244466;font:500 14px/1.3 Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;cursor:pointer;position:relative}
.select-option:hover,.select-option.focused{background:#eef6ff;color:#0e64c7}
.select-option.selected{background:#e7f2ff;color:#0d63c5;font-weight:700}
.select-option.selected:before{content:"✓";position:absolute;left:12px;top:9px;font-size:15px;font-weight:900}
.toggle-field .select-trigger{min-height:42px;font-size:14px;padding-top:10px;padding-bottom:10px}

.etiology-summary-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.summary-card{border:1px solid #d7e6f5;background:linear-gradient(135deg,#f8fbff,#edf6ff);border-radius:13px;padding:15px 16px}
.summary-card .summary-kicker{font-size:12px;font-weight:850;letter-spacing:.03em;color:#5c78a0;margin-bottom:6px}
.summary-card strong{display:block;font-size:17px;color:#194f8f;line-height:1.25}
.summary-card p{margin:6px 0 0;color:#6a7f99;font-size:12.5px;line-height:1.4}
.metric-value.af strong{color:#6847c9}
.score-detail-grid article:nth-child(5){grid-column:1/-1;background:linear-gradient(135deg,#faf8ff,#f4f0ff)}

@media(max-width:1200px){
  .brand{max-width:280px}
}
@media(max-width:800px){
  .brand{min-width:0;max-width:190px;height:48px}
  .hero h1{font-size:25px}
  .etiology-summary-grid{grid-template-columns:1fr}
  .select-menu{position:fixed;left:12px;right:12px;top:auto;bottom:16px;max-height:52vh;border-radius:16px;z-index:250;padding:8px}
  .select-option{padding:13px 12px 13px 38px;font-size:15px}
}

/* v0.6 — refinement pass after clinical review */
.hero{min-height:148px}
.hero-copy{max-width:900px;padding:24px 28px}
.hero h1{font-size:29px;line-height:1.14;letter-spacing:-.25px;margin-bottom:8px}
.hero p{font-size:15.5px;line-height:1.5;max-width:860px}
.hero-visual{width:450px;min-width:330px;padding:10px 16px;background:linear-gradient(90deg,rgba(240,248,255,0),rgba(230,244,255,.24))}
.hero-visual img{width:100%;height:100%;object-fit:contain;object-position:center center}

.context-banner{margin-top:18px}
.info-banner{column-gap:18px}
.info-banner b{flex:0 0 220px;white-space:nowrap;word-break:normal;overflow-wrap:normal}
.info-banner span{min-width:0}

.select-enhanced.placeholder .select-trigger{color:#8292aa;font-weight:550}
.select-enhanced.disabled .select-trigger{background:#f2f5f8;color:#99a7b8;border-color:#dce4ed;cursor:not-allowed;box-shadow:none}
.select-enhanced.disabled .select-trigger:after{opacity:.45}
.select-trigger:disabled{opacity:1}

.help-dot{display:inline-flex;align-items:center;justify-content:center;margin-left:5px;color:#4e83bf;font-size:13px;cursor:help}
.disabled-card{opacity:.48;background:#f7f9fb}
.disabled-card input{cursor:not-allowed}

.completion li{display:grid;grid-template-columns:18px 1fr;column-gap:8px;align-items:start}
.completion li:before{grid-column:1;text-align:center;margin:0}
.completion li{padding-left:0}

.info-card h3{font-size:14px;margin:16px 0 8px;color:#28466f}
.security-list{margin:0;padding-left:20px;color:#667b95;line-height:1.5}
.security-list li{margin:4px 0}
.security-note{display:block;margin-top:12px;color:#8493a7;line-height:1.45}
.info-card p+p{margin-top:10px}
.expert-line{margin-top:14px!important;color:#365372!important}
.text-link{margin-top:14px;padding:0;border:0;background:none;color:var(--blue);font-family:inherit;font-size:13px;font-weight:700;line-height:1.2;cursor:pointer}

.metric.green .metric-word{font-size:20px;line-height:1.18}
.metric.green p{line-height:1.4}

@media(max-width:1180px){
  .hero-visual{width:390px;min-width:300px}
}
@media(max-width:800px){
  .hero h1{font-size:23px}
  .hero p{font-size:14px}
  .context-banner{margin-top:14px}
  .info-banner{flex-direction:column;gap:5px}
  .info-banner b{flex:0 0 auto;white-space:normal}
}
.security-intro{margin:0 0 6px!important;color:#667b95!important;font-size:13px}

/* v0.8 refinements inherited from prior build */
.hero{min-height:0;align-items:stretch;padding:0;gap:22px}
.hero-copy{flex:1;max-width:none;padding:30px 34px;display:flex;flex-direction:column;justify-content:center}
.hero h1{font-size:28px;line-height:1.13;max-width:980px;margin-bottom:10px}
.hero p{font-size:15px;line-height:1.5;max-width:980px}
.hero-visual{width:520px;min-width:420px;align-self:center;height:232px;margin:16px 18px 16px 0;padding:0;background:#f3f9ff;border:1px solid #e1edf8;border-radius:16px;overflow:hidden;box-shadow:0 8px 24px rgba(31,91,153,.06)}
.hero-visual img{width:100%;height:100%;object-fit:contain;object-position:center;display:block}
.form-nav.first-step{justify-content:flex-end}
.invalid-field .select-trigger,.invalid-field input{border-color:#d95757!important;box-shadow:0 0 0 3px rgba(217,87,87,.08)!important}
.validation-message{font-size:12px;font-weight:700;color:#c94747;margin-top:6px}
.info-card-link{display:block;text-decoration:none;color:inherit;transition:.2s;position:relative}
.info-card-link:hover{transform:translateY(-1px);border-color:#c8dcf0;box-shadow:0 10px 28px rgba(34,83,132,.08)}
.info-card-link p+p{margin-top:10px}
.info-accent{font-size:13px;color:#4d6f96!important}
.signature{font-style:italic;font-weight:700;color:#355a86!important}
.more-link{display:inline-block;margin-top:14px;color:#0f6fd5;font-weight:800;font-size:13px}

.content-page{margin:26px 3vw 50px}
.page-hero{background:linear-gradient(110deg,#fff,#f5faff);border:1px solid #e1ebf5;border-radius:18px;padding:28px 32px;box-shadow:var(--shadow)}
.page-hero h1{margin:0 0 8px;font-size:30px}.page-hero p{margin:0;color:#647a96;line-height:1.55;max-width:900px}
.page-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-top:18px}.page-grid.one{grid-template-columns:1fr}.page-card{background:#fff;border:1px solid #dfe9f3;border-radius:15px;padding:22px}.page-card h2{margin:0 0 10px;font-size:20px}.page-card h3{margin:18px 0 8px;font-size:16px}.page-card p{color:#617791;line-height:1.58;margin:8px 0}.page-card ul{color:#617791;line-height:1.55}.page-signature{margin-top:18px;font-style:italic;font-weight:800;color:#355a86}.publication-list{display:grid;gap:12px;margin-top:14px}.publication{border:1px solid #e1eaf3;border-radius:12px;padding:15px 16px;background:#fbfdff}.publication a{color:#153a68;text-decoration:none;font-weight:800;line-height:1.35}.publication a:hover{color:#0d6fd7}.publication small{display:block;color:#7387a1;margin-top:7px;line-height:1.45}.back-home{display:inline-flex;margin-top:18px;color:#0f6fd5;text-decoration:none;font-weight:800}
@media(max-width:1180px){.hero-visual{width:420px;min-width:350px;height:210px}.hero h1{font-size:26px}.page-grid{grid-template-columns:1fr}}
@media(max-width:800px){.hero{display:block}.hero-copy{padding:22px 20px}.hero h1{font-size:23px}.hero p{font-size:14px}.hero-visual{display:block;width:auto;min-width:0;height:auto;aspect-ratio:2.1/1;margin:0 18px 18px}.content-page{margin:18px 12px 36px}.page-hero{padding:22px}.page-hero h1{font-size:26px}}

/* v0.8 refinements */
.card-bottom{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin-top:14px}
.card-bottom .more-link,.card-bottom .signature{margin-top:0}
.card-bottom .signature{text-align:right;margin-left:auto}
.help-dot{display:inline-grid;place-items:center;cursor:pointer;color:#2d78c9;font-size:.88em;line-height:1;vertical-align:middle;user-select:none;outline:none}
.help-dot:focus-visible{box-shadow:0 0 0 3px rgba(30,119,214,.16);border-radius:50%}
.help-popover{position:fixed;z-index:250;background:#17365f;color:#fff;border-radius:11px;padding:11px 13px;font-size:13px;line-height:1.45;box-shadow:0 14px 35px rgba(10,35,70,.24);opacity:0;pointer-events:none;transform:translateY(-3px);transition:.14s}
.help-popover.open{opacity:1;transform:translateY(0)}
.context-banner,.info-banner.blue{margin-top:18px}
.hero-visual{background:#f7fbff}
.hero-visual img{padding:3px}
@media(max-width:800px){.card-bottom{align-items:center}.card-bottom .signature{font-size:12px}}


/* v0.9 — top-aligned analytic results + approved hero banner */
.assessment-layout{display:grid;grid-template-columns:minmax(0,1fr) 430px;gap:18px;margin:18px 3vw 24px;align-items:start}
.assessment-main{min-width:0}
.assessment-main .hero{margin:0}
.assessment-main .step-strip{margin:18px 0 0}
.assessment-main .main-column{min-width:0}
.hero-final{display:block;min-height:0;padding:0;border:0;background:transparent;box-shadow:none;overflow:hidden;border-radius:18px}
.hero-final .hero-banner{display:block;width:100%;height:auto;border-radius:18px}
.results-column{position:sticky;top:94px;align-self:start;margin:0}
.results-card{padding:18px;border-radius:16px;box-shadow:0 10px 28px rgba(23,70,120,.07)}
.result-head-modern{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:4px}
.result-head-modern h2{font-size:19px}
.metric-grid-modern{gap:10px;margin-top:13px}
.metric-grid-modern .metric{min-height:0;padding:14px 14px 13px}
.metric-topline{display:flex;align-items:center;justify-content:space-between;gap:7px}
.metric-topline .status-chip{position:static;white-space:nowrap}
.rope-attribution{display:grid;grid-template-columns:1fr auto;align-items:baseline;gap:2px 8px;margin-top:9px;color:#54718f;font-size:11.5px}
.rope-attribution strong{font-size:20px;color:#1268cc;line-height:1}
.rope-attribution small{grid-column:1/-1;color:#71849c;font-size:10.5px}
.pascal-meter{display:flex;align-items:flex-end;gap:3px;height:28px;margin:8px 0 6px}
.pascal-meter i{display:block;flex:1;border-radius:3px 3px 1px 1px;background:#cdebdc;height:24%}
.pascal-meter i:nth-child(2){height:39%}.pascal-meter i:nth-child(3){height:55%}.pascal-meter i:nth-child(4){height:75%}.pascal-meter i:nth-child(5){height:100%}
.pascal-meter.probable i{background:#38b986}.pascal-meter.possible i:nth-child(-n+3){background:#5bc59a}.pascal-meter.unlikely i:nth-child(-n+1){background:#83cdb1}.pascal-meter.na i{background:#dfe8e4}
.af-mini-bar{height:5px;border-radius:5px;background:#e9e2fa;overflow:hidden;margin:4px 0 9px}.af-mini-bar span{display:block;height:100%;width:0;background:#7650d8;border-radius:5px;transition:width .25s}
.toast-status{display:flex;align-items:center;gap:9px;margin:8px 0 4px}.toast-status>span{width:24px;height:24px;border-radius:50%;display:grid;place-items:center;background:#e6f6ef;color:#0f9b74;font-weight:900}.toast-track{display:flex;gap:3px;flex:1}.toast-track i{height:6px;flex:1;border-radius:5px;background:#dfe8f2}.toast-card.good .toast-status>span{background:#ddf5e9;color:#0d986f}.toast-card.good .toast-track i{background:#57c9a0}.toast-card.warn .toast-status>span{background:#fff1db;color:#d98612}.toast-card.warn .toast-track i:nth-child(-n+2){background:#e9a84a}.toast-card.alert .toast-status>span{background:#fee9e9;color:#d44f4f}.toast-card.alert .toast-track i{background:#e16a6a}
.ccs-card{margin-top:10px;background:linear-gradient(135deg,#fff7f7,#fff0f0);border-color:#f0d2d2}
.ccs-line{display:flex;align-items:flex-end;justify-content:space-between;gap:12px}.ccs-line .metric-word{max-width:68%}
.ccs-bars{display:flex;align-items:flex-end;gap:3px;height:32px;width:95px}.ccs-bars i{width:14px;border-radius:3px 3px 1px 1px;background:#f0c4c4;height:20%}.ccs-bars i:nth-child(2){height:38%}.ccs-bars i:nth-child(3){height:55%}.ccs-bars i:nth-child(4){height:73%}.ccs-bars i:nth-child(5){height:100%}.ccs-card.low .ccs-bars i:nth-child(-n+1){background:#e8a5a5}.ccs-card.mid .ccs-bars i:nth-child(-n+3){background:#e47474}.ccs-card.high .ccs-bars i{background:#d94b4b}
.metric p{font-size:11.5px;line-height:1.35;margin-top:6px}.metric-word.small{font-size:16px;line-height:1.18}.metric-value strong{font-size:34px}.metric-value small{font-size:17px}.metric-label{font-size:14px}
.interpretation{margin-top:10px}.completion{margin-top:10px}.result-actions{margin-top:11px}
@media(max-width:1180px){.assessment-layout{grid-template-columns:1fr;margin:14px 18px 22px}.results-column{position:static}.assessment-main .step-strip{margin-top:14px}.results-card{display:block}.hero-final .hero-banner{width:100%}}
@media(max-width:800px){.assessment-layout{margin:12px}.hero-final{border-radius:14px;overflow:hidden}.hero-final .hero-banner{min-width:760px;width:760px;transform:translateX(-18px);max-width:none}.assessment-main{overflow:hidden}.results-column{margin-top:0}.metric-grid-modern{grid-template-columns:1fr 1fr}.ccs-line .metric-word{max-width:62%}}
@media(max-width:560px){.metric-grid-modern{grid-template-columns:1fr}.hero-final .hero-banner{min-width:650px;width:650px;transform:translateX(-22px)}.ccs-line .metric-word{max-width:100%}.ccs-bars{display:none}}

/* v0.10 — publication library */
.publications-card{padding:24px}
.publications-head{display:flex;align-items:flex-start;justify-content:space-between;gap:24px}
.publications-head h2{margin-bottom:6px}
.publications-head p{margin:0;max-width:820px}
.pdf-note{display:inline-flex;align-items:center;max-width:310px;padding:9px 12px;border-radius:10px;background:#f2f7fc;color:#67809c;font-size:12px;line-height:1.35}
.publication-tabs{display:flex;gap:8px;margin:22px 0 16px;padding:5px;background:#f3f7fb;border:1px solid #e0e9f3;border-radius:13px;width:max-content;max-width:100%}
.pub-tab{appearance:none;border:0;background:transparent;color:#5b7390;padding:11px 18px;border-radius:9px;font:700 14px/1.2 inherit;cursor:pointer;transition:.18s;white-space:nowrap}
.pub-tab:hover{color:#135fae;background:#edf5fd}
.pub-tab.active{background:#fff;color:#1268cc;box-shadow:0 4px 14px rgba(20,78,140,.09)}
.pub-panel[hidden]{display:none!important}
.publication-list-modern{gap:10px}
.publication-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:18px;padding:16px 17px}
.publication-copy{min-width:0}
.publication-copy h3{margin:0;color:#153a68;font-size:14px;line-height:1.4}
.publication-copy small{font-size:12px;margin-top:6px}
.pdf-btn{display:inline-flex;align-items:center;justify-content:center;min-width:76px;padding:10px 13px;border-radius:9px;background:#eaf4ff;border:1px solid #c9e1f9;color:#0f6fd5!important;text-decoration:none;font-weight:800;font-size:12px;white-space:nowrap;transition:.18s}
.pdf-btn:hover{background:#0f72dc!important;border-color:#0f72dc!important;color:#fff!important;transform:translateY(-1px)}
.pub-year{display:inline-block;margin-bottom:5px;padding:3px 7px;border-radius:6px;background:#edf5fd;color:#3f75aa;font-size:10px;font-weight:800;letter-spacing:.02em}
@media(max-width:800px){
  .publications-card{padding:18px}
  .publications-head{display:block}
  .pdf-note{margin-top:12px;max-width:none}
  .publication-tabs{width:100%;overflow-x:auto}
  .pub-tab{flex:1;min-width:max-content}
  .publication-row{grid-template-columns:1fr;gap:11px}
  .pdf-btn{justify-self:start}
}

/* v0.11 — clinical-state summaries and tooltip reliability */
.help-dot{pointer-events:auto;min-width:22px;min-height:22px;align-items:center;justify-content:center}
.interpretation.state-good{background:#eefaf5;border-color:#c7e9dc}
.interpretation.state-info{background:#eef6ff;border-color:#c9ddf5}
.interpretation.state-warn{background:#fff8e9;border-color:#f0d8a5}
.interpretation.state-neutral{background:#f5f8fb;border-color:#dce6ef}
.interpretation.state-warn .interp-icon{background:#d99622}
.interpretation.state-info .interp-icon{background:#2b79d4}
.interpretation.state-neutral .interp-icon{background:#7088a3}

/* v0.12 — branch-specific clinical routes and guideline library */
input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type="number"]{-moz-appearance:textfield;appearance:textfield}
.guideline-card>p{max-width:980px}.guideline-tabs{margin-top:18px}.guide-panel{display:grid;gap:12px}.guide-panel[hidden]{display:none!important}.guideline-item{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:18px;align-items:center;border:1px solid #e0e9f3;border-radius:13px;padding:17px;background:#fbfdff}.guideline-item h3{margin:5px 0 7px;font-size:16px;color:#173a68}.guideline-item p{margin:0;color:#617791;line-height:1.55}.guideline-item .pdf-btn{align-self:center}
#incidentalAnatomyHint{margin-bottom:18px}.score-detail-grid .branch{grid-column:1/-1}
@media(max-width:800px){.guideline-item{grid-template-columns:1fr}.guideline-item .pdf-btn{justify-self:start}}


/* v0.13 — expert referral section, conclusion state colors, age input cleanup */
.expert-section{margin:18px 0 26px;background:#fff;border:1px solid #dce7f2;border-radius:18px;padding:28px;box-shadow:0 6px 22px rgba(23,70,120,.045)}
.expert-head{max-width:980px;margin-bottom:22px}.expert-kicker{font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:#5d79a0;font-weight:800;margin-bottom:7px}.expert-head h2{margin:0 0 10px;font-size:28px;color:#102f60}.expert-head p{margin:0;color:#657b97;line-height:1.55;font-size:16px}
.expert-grid{display:grid;grid-template-columns:1.15fr 1fr 1fr 1fr;gap:14px}.expert-card{border:1px solid #d7e5f3;border-radius:16px;padding:20px;background:linear-gradient(145deg,#fff,#f8fbff);min-width:0}.expert-card h3{margin:14px 0 7px;font-size:18px;color:#12366e;line-height:1.2}.expert-card p{margin:0;color:#687d98;line-height:1.48;font-size:14px}.expert-card strong{color:#163f7b}.expert-person{background:linear-gradient(145deg,#f7fbff,#eef6ff)}.expert-symbol{width:58px;height:58px;aspect-ratio:1/1;border-radius:50%;display:grid;place-items:center;background:#edf6ff;color:#1670d8;border:1px solid #d2e6fb;font-size:20px;font-weight:900;flex-shrink:0}.expert-person .expert-symbol{font-size:34px}.expert-note{margin-top:16px;padding:14px 16px;border-radius:12px;background:#f5f9fd;color:#607994;font-size:14px;line-height:1.45}.page-signature{margin-top:18px}
@media(max-width:1100px){.expert-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:700px){.expert-section{padding:20px}.expert-grid{grid-template-columns:1fr}.expert-head h2{font-size:24px}.expert-section-visual-wrap{padding:10px}.expert-visual-mask{width:28%;height:11%;right:2.5%;bottom:2.2%}}

/* Keep circular conclusion/check icons perfectly round */
.conclusion-icon,.interp-icon{width:42px;height:42px;aspect-ratio:1/1;flex:0 0 42px;border-radius:50%}

/* Color the final conclusion according to clinical state */
.conclusion-box.state-good{background:#eefaf5;border-color:#c7e9dc}.conclusion-box.state-good .conclusion-icon{background:#139c74}
.conclusion-box.state-info{background:#eef6ff;border-color:#c9ddf5}.conclusion-box.state-info .conclusion-icon{background:#2b79d4}
.conclusion-box.state-warn{background:#f4f6f8;border-color:#d7dfe8}.conclusion-box.state-warn .conclusion-icon{background:#72859a}
.conclusion-box.state-neutral{background:#f7f9fb;border-color:#dce6ef}.conclusion-box.state-neutral .conclusion-icon{background:#8a9aad}
.conclusion-box.state-warn p,.conclusion-box.state-neutral p{color:#63758b}

/* Age is entered directly; browser stepper controls are unnecessary */
#age::-webkit-outer-spin-button,#age::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}#age{-moz-appearance:textfield}


.expert-section-visual-wrap{padding:12px;background:#f7fbff;max-width:1180px;margin:18px auto 26px}
.expert-visual-frame{position:relative;max-width:1120px;margin:0 auto}
.expert-section-visual{display:block;width:100%;height:auto;border-radius:18px}
.expert-visual-mask{position:absolute;right:1.8%;bottom:2%;width:16%;height:9%;background:linear-gradient(180deg,rgba(247,251,255,.96),rgba(247,251,255,1));border-radius:12px}


/* v0.17 — referral section: who to refer, without duplicate project branding */
.referral-section{margin:18px 0 26px;background:linear-gradient(145deg,#fff 0%,#fbfdff 66%,#f5faff 100%);border:1px solid #dce7f2;border-radius:18px;padding:28px;box-shadow:0 8px 26px rgba(23,70,120,.055)}
.referral-top{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(300px,.8fr);gap:28px;align-items:stretch}
.referral-copy{min-width:0;padding:4px 4px 2px}.referral-kicker{font-size:12px;line-height:1.2;letter-spacing:.085em;text-transform:uppercase;color:#4f79aa;font-weight:850;margin-bottom:8px}.referral-copy h2{margin:0;color:#102f60;font-size:31px;line-height:1.12;letter-spacing:-.35px}.referral-lead{margin:12px 0 18px;max-width:800px;color:#617894;font-size:16px;line-height:1.55}
.referral-points{display:grid;gap:9px}.referral-point{display:grid;grid-template-columns:34px minmax(0,1fr);gap:11px;align-items:start;padding:10px 12px;border-radius:12px;background:#f8fbff;border:1px solid #e2edf8}.referral-point>span{width:34px;height:34px;aspect-ratio:1/1;border-radius:50%;display:grid;place-items:center;background:#e8f3ff;color:#1670d8;font-size:11px;font-weight:900;flex-shrink:0}.referral-point p{margin:0;color:#667c97;font-size:13.5px;line-height:1.45}.referral-point strong{display:block;color:#173b70;font-size:14.5px;line-height:1.25;margin-bottom:2px}
.referral-doctor{border:1px solid #d7e6f5;border-radius:16px;padding:22px 22px 20px;background:linear-gradient(145deg,#f8fbff,#edf6ff);box-shadow:inset 0 1px 0 rgba(255,255,255,.75)}.referral-doctor-label{color:#6280a5;font-size:12px;font-weight:800;margin-bottom:7px}.referral-doctor h3{margin:0 0 8px;color:#102f60;font-size:24px;line-height:1.16}.referral-doctor>p{margin:0;color:#657b97;font-size:14px;line-height:1.5}.referral-doctor-rule{height:1px;background:#cfe0f0;margin:16px 0 13px}.referral-doctor ul{list-style:none;margin:0;padding:0;display:grid;gap:10px}.referral-doctor li{position:relative;padding-left:28px;color:#5e7591;font-size:13.5px;line-height:1.35}.referral-doctor li:before{content:"✓";position:absolute;left:0;top:-1px;width:20px;height:20px;aspect-ratio:1/1;border-radius:50%;display:grid;place-items:center;background:#dff0ff;color:#1670d8;font-size:12px;font-weight:900}
.referral-proof-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:20px}.referral-proof{min-width:0;display:grid;grid-template-columns:116px minmax(0,1fr);gap:14px;align-items:center;border:1px solid #d8e6f4;border-radius:15px;padding:14px;background:#fff}.referral-proof-image{width:116px;height:116px;border-radius:50%;overflow:hidden;background:#f0f7ff;display:grid;place-items:center}.referral-proof-image img{width:112%;height:112%;object-fit:contain;display:block}.referral-proof h3{margin:0 0 5px;color:#102f60;font-size:17px;line-height:1.18}.referral-proof strong{display:block;color:#16417e;font-size:15px;line-height:1.25;margin-bottom:5px}.referral-proof p{margin:0;color:#687e99;font-size:12.8px;line-height:1.42}
@media(max-width:1080px){.referral-top{grid-template-columns:1fr}.referral-proof-grid{grid-template-columns:1fr}.referral-proof{grid-template-columns:100px minmax(0,1fr)}.referral-proof-image{width:100px;height:100px}}
@media(max-width:700px){.referral-section{padding:20px}.referral-copy h2{font-size:25px}.referral-lead{font-size:14px}.referral-doctor{padding:18px}.referral-doctor h3{font-size:21px}.referral-proof{grid-template-columns:82px minmax(0,1fr);padding:12px}.referral-proof-image{width:82px;height:82px}.referral-proof h3{font-size:15px}.referral-proof strong{font-size:14px}.referral-proof p{font-size:12px}}

/* v0.18 — align final checklist labels regardless of status icon width */
.checklist-block li{
  display:flex;
  align-items:center;
  gap:8px;
}
.checklist-block li::before{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:16px;
  min-width:16px;
  flex:0 0 16px;
  margin:0;
}
.checklist-block li.done::before{content:"✓";}
.checklist-block li.warn::before{content:"!";}

/* Keep the compact completion checklist aligned as well */
.completion li::before{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:14px;
  min-width:14px;
  flex:0 0 14px;
}


/* v0.19 — referral section refinements */
.referral-point{
  grid-template-columns:12px minmax(0,1fr);
  gap:12px;
}
.referral-point>span.referral-dot{
  width:8px;
  height:8px;
  min-width:8px;
  aspect-ratio:1/1;
  border-radius:50%;
  background:#1670d8;
  margin-top:5px;
  font-size:0;
  line-height:0;
  display:block;
}
.referral-doctor li.referral-treatment{
  color:#173b70;
  font-weight:800;
  background:#eaf4ff;
  border:1px solid #cfe4fa;
  border-radius:10px;
  padding:9px 10px 9px 38px;
  margin-top:2px;
}
.referral-doctor li.referral-treatment:before{
  left:10px;
  top:8px;
  background:#1670d8;
  color:#fff;
}

/* v0.21 — stable header: logo / nav / action occupy independent columns */
@media (min-width:1201px){
  .topbar{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
    align-items:center;
    column-gap:20px;
  }
  .topbar .brand{
    justify-self:start;
  }
  .topbar .desktop-nav{
    justify-self:center;
  }
  .topbar .primary.compact{
    justify-self:end;
    margin-left:0;
  }
}

/* v0.24 — referral flow: minimal physician account + patient referral + assessment snapshot */
.referral-modal{width:min(720px,100%)}
.referral-view h2{color:#102f60}
.auth-tabs{display:grid;grid-template-columns:1fr 1fr;gap:6px;background:#f1f6fb;border:1px solid #dce8f4;border-radius:11px;padding:4px;margin:18px 0 16px}
.auth-tab{border:0;border-radius:8px;padding:10px 12px;background:transparent;color:#5f7592;font-weight:800;cursor:pointer}
.auth-tab.active{background:#fff;color:#1268cb;box-shadow:0 2px 9px rgba(34,84,135,.10)}
.referral-auth-fields{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.referral-auth-hint{margin:11px 0 0;color:#7588a0;font-size:12.5px}
.referral-auth-actions{margin-top:16px}
.referral-account-line{display:flex;align-items:center;justify-content:space-between;gap:16px;border:1px solid #dce8f4;background:#f7fbff;border-radius:11px;padding:10px 12px;margin-bottom:18px}
.referral-account-line>div{display:flex;flex-direction:column;gap:2px;min-width:0}
.referral-account-line span{font-size:11px;color:#8092a8}
.referral-account-line strong{font-size:13px;color:#294d78;overflow:hidden;text-overflow:ellipsis}
.link-button{border:0;background:transparent;color:#1670d8;font-weight:800;cursor:pointer;padding:5px 6px}
.referral-patient-section{margin-top:16px}
.referral-patient-section h3{margin:0 0 12px;color:#193b6a}
.referral-wide{grid-column:1/-1}
.referral-assessment-card{margin-top:18px;border:1px solid #cfe4f6;background:#f3f9ff;border-radius:13px;padding:14px;display:flex;gap:12px;align-items:flex-start}
.referral-assessment-card.empty{background:#f7f9fc;border-color:#dce4ee}
.referral-assessment-icon{width:30px;height:30px;min-width:30px;aspect-ratio:1/1;border-radius:50%;background:#1378df;color:#fff;display:grid;place-items:center;font-weight:900}
.referral-assessment-card.empty .referral-assessment-icon{background:#9aabba}
.referral-assessment-card strong{display:block;color:#173c6e;font-size:14px;line-height:1.35}
.referral-assessment-card p{margin:4px 0 0;color:#667d98;font-size:12.5px;line-height:1.4}
.referral-result-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:9px}
.referral-result-chips span{display:inline-flex;align-items:center;border-radius:99px;padding:5px 8px;background:#fff;border:1px solid #d7e6f4;color:#426488;font-size:11px;font-weight:750}
.referral-error{margin-top:12px;padding:10px 12px;border-radius:9px;background:#fff2f2;border:1px solid #f0cccc;color:#a33a3a;font-size:12.5px}
.referral-success{text-align:center;padding:10px 8px 4px}
.referral-success-icon{width:58px;height:58px;border-radius:50%;background:#139c74;color:#fff;display:grid;place-items:center;font-size:30px;font-weight:900;margin:8px auto 14px}
.referral-success h2{margin:0 0 7px}
.referral-success>p{max-width:560px;margin:0 auto;color:#687c94;line-height:1.5}
.referral-success-summary{display:grid;gap:8px;text-align:left;max-width:520px;margin:18px auto 0;padding:14px;border:1px solid #dce7f1;border-radius:12px;background:#f8fbfe}
.referral-success-summary div{display:flex;justify-content:space-between;gap:18px;font-size:12.5px}
.referral-success-summary span{color:#71849b}
.referral-success-summary strong{color:#25496f;text-align:right}
.referral-local-note{margin-top:12px!important;padding:9px 11px;border-radius:9px;background:#fff8e8;color:#87601f!important;font-size:11.5px!important}
@media(max-width:800px){
  .referral-auth-fields{grid-template-columns:1fr}
  .referral-account-line{align-items:flex-start}
  .referral-wide{grid-column:auto}
}

/* v0.25 — referral form refinements */
.required-mark{color:#d95454;font-weight:900}
.inline-field-note{font-size:10.5px;color:#8797aa;font-weight:600;margin-left:4px}
.account-prefilled,.field input.account-prefilled{background:#f2f5f8;color:#74859a}
.referral-doctor-form,.referral-patient-section{margin-top:16px}
.referral-doctor-form h3,.referral-patient-section h3{margin:0 0 12px;color:#193b6a}
.referral-age-field{grid-column:1/-1;max-width:50%}
.referral-age-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:stretch}
.field input.prefilled-age{background:#f1f4f7;color:#7f8c9d;border-color:#d8e0e9}
.age-edit{border:0;background:transparent;color:#1670d8;font-weight:800;font-family:inherit;cursor:pointer;padding:0 7px}
.age-warning{color:#c34a4a;font-size:11.5px;line-height:1.35;font-weight:700}
.referral-assessment-note{margin-top:18px;border:1px solid #cee2f5;background:#f2f8ff;border-radius:12px;padding:13px 14px;display:flex;gap:10px;align-items:flex-start}
.referral-assessment-note-icon{width:26px;height:26px;min-width:26px;border-radius:50%;display:grid;place-items:center;background:#1670d8;color:#fff;font-size:12px;font-weight:900}
.referral-assessment-note strong{display:block;color:#173d70;font-size:13.5px;line-height:1.35}
.referral-assessment-note p{margin:3px 0 0;color:#687f99;font-size:12px;line-height:1.4}
.referral-email-confirm{margin-top:12px!important;color:#315f91!important;font-size:12.5px!important;font-weight:700}
@media(max-width:800px){
  .referral-age-field{max-width:none}
}

/* v0.25 — print-only A4 report */
.print-report{display:none}
@media print{
  @page{size:A4 portrait;margin:12mm 13mm 14mm}
  html,body{background:#fff!important;width:auto!important;max-width:none!important;overflow:visible!important}
  body{-webkit-print-color-adjust:exact;print-color-adjust:exact;font-family:Arial,"Segoe UI",sans-serif;color:#16345f;font-size:10pt}
  .page-shell,.modal-backdrop,.help-popover{display:none!important}
  .print-report{display:block!important;width:auto!important;max-width:none!important;margin:0!important;padding:0!important;background:#fff!important;color:#16345f}
  .print-report *{box-sizing:border-box}
  .print-report-header{display:flex;justify-content:space-between;align-items:flex-start;gap:18px;border-bottom:1px solid #cad9e8;padding-bottom:8mm;margin-bottom:6mm}
  .print-brand{font-size:9pt;font-weight:800;letter-spacing:.02em;color:#416486;margin-bottom:3mm}
  .print-report-header h1{margin:0;font-size:20pt;line-height:1.08;color:#102f60}
  .print-date{font-size:8.5pt;color:#71849a;white-space:nowrap;padding-top:1mm}
  .print-block{border:1px solid #d7e3ef;border-radius:4mm;padding:5mm 5.5mm;margin-bottom:4.5mm;break-inside:avoid;page-break-inside:avoid;background:#fff}
  .print-conclusion{background:#f3faf7;border-color:#cfe4db}
  .print-section-kicker{font-size:8pt;text-transform:uppercase;letter-spacing:.08em;font-weight:800;color:#5a7ba0;margin-bottom:2mm}
  .print-block h2{font-size:15pt;line-height:1.22;margin:0 0 2.5mm;color:#123a6c}
  .print-block p{font-size:9.7pt;line-height:1.42;margin:0;color:#4e6886}
  .print-section-title{font-size:11pt;font-weight:800;color:#123a6c;margin-bottom:3mm}
  .print-score-list{display:block}
  .print-score-row{display:flex;align-items:flex-start;justify-content:space-between;gap:10mm;padding:2.8mm 0;border-top:1px solid #e4ebf3;break-inside:avoid;page-break-inside:avoid}
  .print-score-row:first-child{border-top:0;padding-top:0}
  .print-score-row:last-child{padding-bottom:0}
  .print-score-row>div{min-width:0}
  .print-score-row strong{display:block;font-size:10pt;color:#173c6d;margin-bottom:1mm}
  .print-score-row small{display:block;font-size:8.6pt;line-height:1.35;color:#6a7f98}
  .print-score-row>b{font-size:12pt;line-height:1.25;color:#173c6d;text-align:right;max-width:42%;overflow-wrap:anywhere}
  .print-checklist{list-style:none;padding:0;margin:0;display:grid;gap:2mm}
  .print-checklist li{position:relative;padding-left:6mm;font-size:9.5pt;line-height:1.3;color:#4f6884;break-inside:avoid}
  .print-checklist li:before{position:absolute;left:0;top:0;font-weight:900}
  .print-checklist li.done:before{content:"✓";color:#0f9b74}
  .print-checklist li.warn:before{content:"!";color:#d98612}
  .print-interpretation{background:#f8fbfe}
  .print-report-footer{font-size:8pt;color:#7b8da2;border-top:1px solid #dfe7f0;padding-top:3mm;margin-top:2mm;text-align:right}
}

/* v0.26 — simple one-step referral form */
.referral-modal-simple{width:min(860px,100%)}
.referral-modal-simple .modal-section{padding-top:17px;margin-top:17px;border-top:1px solid #e1eaf3}
.referral-modal-simple .modal-section:first-of-type{padding-top:0;margin-top:18px;border-top:0}
.referral-modal-simple .consent{margin-top:20px}
.referral-modal-simple .modal-actions{margin-top:18px}

/* v0.28 — TIA layout + result-card alignment */
#tiaBranch .context-banner{
  column-gap:12px;
}
#tiaBranch .context-banner b{
  flex:0 0 auto;
}

/* Keep metric title, info icon and "Справочно" chip on one line */
.metric-topline{
  min-width:0;
}
.metric-topline .metric-label{
  display:inline-flex;
  align-items:center;
  gap:5px;
  white-space:nowrap;
  min-width:0;
}
.metric-topline .metric-label .help-dot{
  flex:0 0 auto;
}
.metric-topline .status-chip{
  flex:0 0 auto;
}

/* v0.29 — explicit validation for required referral fields */
.referral-field-message{
  display:block;
  margin-top:-2px;
  color:#b54747;
  font-size:11px;
  line-height:1.25;
  font-weight:700;
}
.field.referral-field-invalid input,
.field input.referral-input-invalid{
  border-color:#df8d8d;
  background:#fff8f8;
  box-shadow:0 0 0 2px rgba(198,72,72,.05);
}
.field.referral-field-invalid input:focus,
.field input.referral-input-invalid:focus{
  border-color:#d46f6f;
  box-shadow:0 0 0 3px rgba(198,72,72,.10);
}
.consent-wrap{
  margin-top:20px;
  border:1px solid transparent;
  border-radius:10px;
  padding:0 10px 8px;
  transition:.15s ease;
}
.referral-modal-simple .consent-wrap .consent{margin-top:8px}
.consent-wrap.referral-consent-invalid{
  border-color:#edc1c1;
  background:#fff9f9;
}
.consent-wrap .referral-field-message{
  margin:4px 0 0 25px;
}
#referralSend:disabled{
  cursor:not-allowed;
  opacity:.48;
  transform:none;
  box-shadow:none;
}



/* v0.33 — mobile layout, touch targets and validation */
/* The page itself no longer relies on root overflow clipping. Components are constrained to the viewport instead. */
.segmented input[type="radio"],
.radio-card input[type="radio"]{
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  min-width:1px!important;
  max-width:1px!important;
  margin:-1px!important;
  padding:0!important;
  border:0!important;
  clip:rect(0 0 0 0)!important;
  clip-path:inset(50%)!important;
  overflow:hidden!important;
  white-space:nowrap!important;
}

.select-trigger{
  touch-action:manipulation;
  -webkit-tap-highlight-color:rgba(34,122,222,.12);
}
.select-trigger:active{
  border-color:#4d94e2;
  background:#eaf4ff;
  box-shadow:0 0 0 3px rgba(36,122,220,.14), inset 0 1px 2px rgba(18,78,145,.06);
  transform:scale(.995);
}
.select-enhanced.open .select-trigger{
  border-color:#4d94e2;
  background:#edf6ff;
  box-shadow:0 0 0 3px rgba(36,122,220,.13);
}

.help-dot{position:relative;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.help-dot::before{content:"";position:absolute;inset:-11px;border-radius:50%}

.check-card>span,
.check-card b,
.check-card small,
.section-title>div,
.interpretation>div,
.conclusion-box>div,
.metric,
.metric-word,
.metric p,
.results-head,
.result-head-modern>div{
  min-width:0;
  max-width:100%;
}
.check-card b,.check-card small,.metric-word,.metric p,.conclusion-box h3,.conclusion-box p,.interpretation h3,.interpretation p{
  white-space:normal;
  overflow-wrap:anywhere;
  word-break:normal;
}

body.modal-open{overflow:hidden;overscroll-behavior:none}

@media(max-width:800px){
  .assessment-layout{
    width:calc(100% - 24px);
    max-width:calc(100% - 24px);
    margin:12px auto 18px;
    grid-template-columns:minmax(0,1fr);
  }
  .assessment-main,
  .assessment-main .main-column,
  .form-step,
  .section-card,
  .results-column,
  .results-card,
  .metric-grid-modern,
  .metric-grid-modern>.metric,
  .score-detail-grid,
  .score-detail-grid>article,
  .interpretation,
  .completion,
  .result-actions,
  .conclusion-box,
  .anatomy-grid,
  .anatomy-grid>.check-card{
    width:100%;
    max-width:100%;
    min-width:0;
  }
  .assessment-main{overflow:visible}
  .hero-final{overflow:hidden}
  .results-card{padding:16px}
  .metric-grid-modern{grid-template-columns:1fr;gap:9px}
  .metric-grid-modern .metric{margin-top:0;padding:13px}
  .result-head-modern{flex-wrap:wrap;gap:4px 8px}
  .metric-topline{min-width:0;flex-wrap:wrap;align-items:center}
  .metric-topline .metric-label{white-space:normal;overflow-wrap:anywhere}
  .metric-topline .status-chip{margin-left:auto}
  .ccs-line{min-width:0;flex-wrap:wrap;align-items:flex-start}
  .ccs-line .metric-word{max-width:100%}
  .rope-attribution{grid-template-columns:minmax(0,1fr) auto}
  .conclusion-box,.interpretation{align-items:flex-start}

  .modal-backdrop{
    padding:8px 10px;
    align-items:center;
    overflow:hidden;
    overscroll-behavior:contain;
  }
  .referral-modal-simple{
    width:100%;
    max-width:100%;
    max-height:calc(100dvh - 16px);
    overflow-y:auto;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
    padding:20px 16px max(18px,env(safe-area-inset-bottom));
    scroll-padding-bottom:86px;
  }
  .referral-modal-simple #referralPatientForm,
  .referral-modal-simple .modal-section,
  .referral-modal-simple .grid,
  .referral-modal-simple .field,
  .referral-modal-simple .consent-wrap,
  .referral-modal-simple .consent{
    width:100%;
    max-width:100%;
    min-width:0;
  }
  .referral-modal-simple .consent span{min-width:0;overflow-wrap:anywhere}
  .referral-modal-simple .modal-actions{
    position:sticky;
    bottom:-1px;
    z-index:3;
    margin-left:-4px;
    margin-right:-4px;
    padding:12px 4px max(4px,env(safe-area-inset-bottom));
    background:linear-gradient(to bottom,rgba(255,255,255,.94),#fff 26%);
    border-top:1px solid #e4ebf3;
  }
  .referral-modal-simple .modal-actions button{min-width:0;flex:1}
  .consent-wrap{scroll-margin-bottom:88px}
}

@media(max-width:430px){
  .section-card{padding:16px}
  .results-card{padding:14px}
  .metric-value strong{font-size:31px}
  .metric-word{font-size:21px}
  .score-detail-grid .big{font-size:30px}
  .score-detail-grid .big.text{font-size:21px}
  .check-card{padding:12px;gap:9px}
  .modal-backdrop{padding:6px 8px}
  .referral-modal-simple{max-height:calc(100dvh - 12px);padding:18px 14px max(16px,env(safe-area-inset-bottom));border-radius:15px}
}

@media(max-width:340px){
  .results-card{padding:12px}
  .section-card{padding:14px}
  .result-actions{gap:8px}
  .conclusion-box,.interpretation{gap:10px;padding:13px}
  .conclusion-icon,.interp-icon{width:36px;height:36px;flex-basis:36px}
  .referral-modal-simple .modal-actions{gap:8px}
}

/* v0.34 — mobile dropdown: open next to the selected field */
@media (max-width:800px){
  .select-menu{
    position:absolute !important;
    left:0 !important;
    right:0 !important;
    top:calc(100% + 7px) !important;
    bottom:auto !important;
    width:auto !important;
    max-height:min(260px,42vh) !important;
  }
}
