:root{font-family:system-ui,-apple-system,"Segoe UI",sans-serif;color:#202828;background:white;font-size:16px}*{box-sizing:border-box}body{margin:0}header{max-width:860px;margin:auto;padding:16px;display:flex;align-items:center;gap:12px;border-bottom:1px solid #edf0ee}header strong{flex:1}main{max-width:760px;margin:auto;padding:16px 22px 48px}h1{font-size:clamp(28px,5vw,42px);line-height:1.4;margin:40px 0 16px}h2{font-size:25px;margin-top:30px}p{line-height:1.8;color:#5e6966}.subtitle{font-size:13px;margin:5px 0}.badge{font-size:12px;background:#eff6f2;color:#347155;display:inline-block;border-radius:20px;padding:4px 12px}.grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.card{display:flex;align-items:flex-start;flex-direction:column;gap:10px;padding:22px;text-align:left;border:1px solid #e0e5e2;border-radius:20px;min-height:145px;background:#fff}.card span{font-size:25px;color:#357861}.card strong{font-size:16px}.card small{color:#738079;line-height:1.5}.card:hover{background:#f6faf7}button{cursor:pointer;border:1px solid #dde4df;border-radius:12px;padding:11px 15px;background:#f7f9f7;color:inherit;font:inherit}button:disabled{opacity:.5;cursor:wait}.primary{background:#20664e;color:white;border:0}input,select,textarea{display:block;width:100%;padding:13px;font:inherit;border:1px solid #ced8d1;border-radius:11px;background:white;color:#202828}label{display:block;margin:18px 0;line-height:1.7}input[type=checkbox],input[type=radio]{width:20px;display:inline-block;margin-right:10px;vertical-align:middle}.consent{font-size:14px}.compose{display:flex;align-items:center;border:1px solid #d8e0da;border-radius:24px;padding:8px}.compose textarea{border:0;resize:vertical;min-height:72px}.compose button{background:#20664e;color:white;border-radius:50%;margin:6px}#composer{margin-top:32px}.row{display:flex;gap:12px;flex-wrap:wrap;align-items:center;margin:20px 0}.panel{padding:20px;border:1px solid #d8e2da;border-radius:16px;background:#f3f8f5;line-height:1.8}.danger{background:#fff0ed;color:#992d1b;border-color:#e0a99c}#notice{color:#973d28;white-space:pre-wrap;line-height:1.6}#history p{background:#f7f9f7;padding:12px;border-radius:12px;overflow-wrap:anywhere}#summary p{border-bottom:1px solid #edf0ed;padding-bottom:10px}pre{white-space:pre-wrap;overflow-wrap:anywhere;background:#f7f8f7;padding:14px;font-size:12px}footer{padding:24px;text-align:center;color:#7e8781;font-size:12px;line-height:1.8}a{color:#20664e}input:focus,button:focus-visible,textarea:focus{outline:2px solid #459c79;outline-offset:2px}[hidden]{display:none!important}@media(max-width:420px){main{padding:12px 16px 32px}.card{padding:16px;min-height:160px}.card strong{font-size:15px}.grid{gap:10px}}

.service-grid{margin:20px 0}.service-grid .card[aria-expanded='true']{border-color:#20664e;background:#f3f8f5}.service-detail{margin:18px 0;background:white}.service-detail h3,.service-contact h3{margin-top:0}.service-detail fieldset{border:0;padding:0;margin:18px 0}.service-detail legend{font-weight:600}.service-detail fieldset label{margin:9px 0}.service-contact{margin-top:20px}.service-contact strong{color:#173d45}

.service-grid .card{min-width:0;overflow-wrap:anywhere}.service-detail,.service-contact{overflow-wrap:anywhere}

#home{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:10px 16px;background:#20664e;border-color:#20664e;color:#fff;font-weight:700;white-space:nowrap}
#home:hover{background:#174d3a}
.site-brand{display:flex;align-items:center;white-space:nowrap}
.site-brand .brand-logo{display:block;width:215px;height:41px;object-fit:contain}
.site-brand .brand-text{display:none}
@media(max-width:420px){.site-brand .brand-logo{width:185px;height:36px}}
@media(max-width:420px){header{gap:8px;flex-wrap:wrap}header strong{min-width:0;flex:1 1 140px;font-size:14px}#install{margin-left:auto}}

#landing h1{margin:26px 0 12px;font-size:clamp(22px,6.8vw,42px);white-space:nowrap}#scope-description{margin-bottom:18px}#landing .card{justify-content:center;min-height:112px;gap:5px;padding:18px}#landing .card small{font-size:13px}.profile-privacy{margin:0 0 24px;border-top:1px solid #e0e5e2;border-bottom:1px solid #e0e5e2;padding:12px 0}.profile-privacy summary{cursor:pointer;color:#20664e;font-weight:600}.profile-privacy p{font-size:14px;margin:10px 0 0}@media(max-width:420px){#landing .card{min-height:124px;padding:14px}#landing .card strong{font-size:15px}#landing .card small{font-size:12px}}
#health-tools{margin:18px 0}#health-tools summary{cursor:pointer;color:#20664e;font-weight:600}#health-tools button{margin-top:12px}#bmi-result{margin-top:12px}
#waist-form{margin-top:18px;padding-top:16px;border-top:1px solid #e0e5e2}#waist-form small{display:block;color:#526b68}#waist-result{margin-top:12px}
/* Contact tasks contain status only; the promoter never sees a case record. */
.promoter-task-page{max-width:640px;margin:0 auto;padding:24px}
.promoter-task-page ul{padding:0}
.promoter-task-page li{list-style:none;border-bottom:1px solid #dce6e2;padding:16px 0}
.promoter-task-page li small{display:block;color:#526b68}
.promoter-task-page li button{margin-top:8px}

/* Input-first patient home; other clinical screens keep their existing components. */
.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
#landing h1{font-size:clamp(24px,5.6vw,32px);margin:22px 0 18px;white-space:normal;letter-spacing:-.03em}
#landing .home-shell{border:1px solid #e1e4e3;border-radius:28px;padding:20px;background:#fdfdfc;margin:20px 0}
#landing #composer{margin:18px 0 0}
.patient-consultation-record{margin:24px 0;padding:24px 0;border-top:1px solid #d8e2da;border-bottom:1px solid #d8e2da;scroll-margin-top:20px}
.patient-consultation-record h2{margin:0 0 8px}.patient-consultation-record h3{margin:24px 0 10px;font-size:18px}
.patient-consultation-record .record-meta{font-size:14px;color:#68756f;margin:6px 0 12px}
.patient-consultation-record .record-text,.patient-answer-records dd{font-size:17px;line-height:1.85;color:#17352f;white-space:pre-wrap;overflow-wrap:anywhere;user-select:text}
.patient-answer-records dt{font-weight:600;margin:18px 0 6px;overflow-wrap:anywhere}.patient-answer-records dd{margin:0 0 14px}
.patient-reply-record+.patient-reply-record{margin-top:20px;padding-top:16px;border-top:1px solid #edf0ed}
#landing .compose{display:flex;flex-direction:column;align-items:stretch;gap:12px;padding:14px;border-radius:22px;border-color:#dedfdd;background:#fff}
#landing .compose textarea{min-height:132px;padding:8px 6px;line-height:1.7;border-radius:12px;resize:vertical}
#landing .compose textarea::placeholder{color:#8b918e}
#landing .compose button{align-self:flex-end;min-width:88px;min-height:44px;margin:0;padding:9px 20px;border-radius:24px;background:#edf2ef;color:#244e40;border:1px solid #dfe7e2;font-weight:600}
#landing .compose button:hover{background:#e1ece5}
#landing .home-shell .grid{gap:12px}
#landing .home-shell .card{min-height:142px;border-radius:22px;padding:22px 18px;gap:14px;background:#fff}
#landing .home-shell .card strong{font-size:19px;font-weight:650;line-height:1.45;letter-spacing:-.02em}
#landing .home-shell .card small{font-size:14px;color:#727b76}
#landing .home-shell .card:hover{background:#f5f8f6;border-color:#b9cec0}
#landing>details{margin:12px 0;font-size:14px;color:#65716a}
#landing>details summary{cursor:pointer;min-height:30px;padding:5px 0}
#landing .home-scope p{font-size:14px}
/* Keep secondary controls available to the app without showing them on the patient home. */
#landing #contact-settings,#landing .home-scope,#landing #collaboration-entry,#landing #resume,#landing #clinical-device-recovery{display:none!important}
header .header-brand{flex:1;min-width:0}
header #edition-location{display:flex;align-items:center;flex-wrap:wrap;gap:4px 12px;margin:0;line-height:1.4}
header #edition-label{font-size:12px;font-weight:400;color:#65716a}
header #edition-switch{display:inline-flex;align-items:center;min-height:44px;font-size:13px;font-weight:400;white-space:nowrap;text-underline-offset:3px}
@media(max-width:420px){header .header-brand{flex:1 1 140px}header #edition-label{font-size:12px}header #edition-location{gap:2px 10px}}
@media(max-width:420px){#landing .home-shell{padding:12px;border-radius:24px;margin:16px 0}#landing .compose{padding:12px;border-radius:19px}#landing .compose textarea{min-height:124px;font-size:16px}#landing .home-shell .grid{gap:10px}#landing .home-shell .card{min-height:132px;padding:16px 12px;border-radius:19px;gap:12px}#landing .home-shell .card strong{font-size:17px}#landing .home-shell .card small{font-size:12px}}

/* Keep the active question and its actions in view without hiding prior answers. */
#answer-form{min-height:0;display:block;scroll-margin-top:20px}
#question-label{margin:0 0 12px;scroll-margin-top:20px}
#notice{scroll-margin-top:20px}
#answer-form>.row{position:static;margin:16px 0 0;padding:12px 0 max(12px,env(safe-area-inset-bottom));background:#fff;border-top:1px solid #edf0ee}
#answer-form>.row button{min-height:44px}

/* Source-bound questions reuse the current conversation and form. */
.patient-guide{margin:18px 0}.guide-actions{display:flex;flex-wrap:wrap;gap:8px}.guide-actions button,.guide-questions button,.guide-information button{min-height:44px;background:#fff;color:#20564c;border:1px solid #cbdcd5;text-align:left}
.guide-information{padding:12px 0}.guide-information dt{font-weight:600}.guide-information dd{margin:4px 0 14px;white-space:pre-wrap;overflow-wrap:anywhere}.guide-information button{display:block;width:100%;margin:8px 0}
.guide-questions{display:grid;gap:12px}.guide-questions button{width:100%;margin:0}.guide-questions small{display:block;margin:5px 0;color:#596c65}.conversation-turn{scroll-margin-top:18px;overflow-wrap:anywhere}.conversation-turn details{margin-top:12px}.conversation-turn details summary{cursor:pointer;min-height:32px}.patient-guide h4{margin-bottom:10px}

/* Patient result: action first, clinician replies before AI, details on demand. */
.doctor-reply-heading{display:flex;align-items:baseline;justify-content:space-between;gap:16px}.doctor-reply-heading>span{font-size:14px;color:#21664e;flex-shrink:0}
#doctor-review-panel.has-published-reply{margin:0 0 24px;padding:24px;border-color:#b8cec7}
#doctor-review-panel .doctor-reply-entry{padding:0 0 16px;white-space:normal}
#doctor-review-panel .doctor-reply-entry+.doctor-reply-entry{padding-top:16px;border-top:1px solid #e0e7e3}
#doctor-review-panel .doctor-reply-meta{margin:2px 0 10px;font-size:14px;line-height:1.5;color:#536963}
#doctor-review-panel .doctor-reply-content{margin:0;font-size:18px;line-height:1.85;color:#17352f;overflow-wrap:anywhere;user-select:text}
.doctor-reply-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:6px}
#doctor-review-panel .doctor-reply-actions>button{margin:0;min-height:44px}
#doctor-review-panel.has-published-reply .doctor-reply-actions>button:not(.primary){background:transparent;border-color:transparent;text-decoration:underline;text-underline-offset:3px}
@media(max-width:420px){#doctor-review-panel.has-published-reply{padding:18px}#doctor-review-panel .doctor-reply-actions{align-items:stretch}#doctor-review-panel #result-primary-action{flex:1;margin:0;width:auto}}
#result>h2{margin:24px 0 18px}#risk{margin:0 0 24px;padding:18px 20px}#risk h3{margin:0 0 8px;font-size:20px}#risk>p{margin:8px 0;color:inherit}#risk>small{display:block;color:inherit}#risk>details{font-size:14px;margin:12px 0}#result-primary-action{display:block;min-height:44px;margin-top:16px}
#consultation-overview{margin:24px 0}#consultation-overview h3{font-size:20px;margin-bottom:10px}#consultation-overview p{margin:10px 0}#consultation-overview>button{min-height:44px}
#doctor-review-panel{margin:24px 0;background:#fff}#doctor-review-panel h3{margin:0 0 10px;font-size:20px}#doctor-review-panel>button{margin:8px 8px 8px 0;min-height:44px}#doctor-review-panel>div section{padding:0 0 12px;white-space:pre-wrap;overflow-wrap:anywhere}#doctor-review-panel>details{font-size:14px;margin-top:12px}
#continuous-conversation{margin:26px 0}#continuous-conversation>h3{font-size:20px}#continuous-conversation>form{scroll-margin-top:18px}#continuous-conversation>form button{margin:4px 6px 4px 0;min-height:44px}
#result>details{margin:16px 0}#result>details>summary{cursor:pointer;min-height:44px;padding:8px 0}#result>details.panel{background:#fff;padding:10px 18px}.result-details{border-top:1px solid #e0e7e3;padding-top:4px}
@media(max-width:420px){#risk{padding:16px}#result-primary-action{width:100%}#doctor-review-panel{padding:16px}#result .row{gap:8px}}

#preparation-dialog{width:min(680px,calc(100% - 24px));max-height:90svh;border:1px solid #ccd9d2;border-radius:18px;padding:22px;color:#202828}#preparation-dialog::backdrop{background:#142b264d}#preparation-dialog h3{margin-top:0}#preparation-dialog fieldset{border:0;padding:0;margin:20px 0}#preparation-dialog fieldset label{margin:10px 0}#preparation-dialog button{min-height:44px;margin:8px 8px 8px 0}#preparation-dialog button[type=submit]{background:#20664e;color:white}#preparation-dialog details p{border-bottom:1px solid #e8eeea;padding-bottom:8px;overflow-wrap:anywhere}
.service-product{padding:18px 0;border-bottom:1px solid #dde7e0;overflow-wrap:anywhere}.service-product strong{display:block}.service-product p{margin:8px 0;font-size:14px}.service-product a,.service-product button{display:block;margin:10px 0;min-height:40px}#service-drug-question{margin-top:22px}#service-drug-results{max-width:100%}

#preparation-dialog .preparation-actions{position:sticky;bottom:-22px;margin:16px -4px -4px;padding:10px 4px;background:white;border-top:1px solid #e0e8e3;display:flex;flex-wrap:wrap;gap:8px}#preparation-dialog .preparation-actions button{margin:0}

/* Full consultation identity stays readable and selectable on small screens. */
.case-reference{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin:8px 0 18px;padding:12px 0;border-bottom:1px solid #dce5e3;color:#173e44}
.case-reference>span:first-child{font-size:14px;color:#52676b}
.case-reference-value{font-size:16px;font-weight:600;line-height:1.6;overflow-wrap:anywhere;word-break:break-word;min-width:0;max-width:100%;user-select:text}
.case-reference button{padding:8px 12px;min-height:44px;white-space:nowrap;font-size:14px;margin:0}
.case-reference-status{font-size:13px;line-height:1.5}
@media(max-width:480px){.case-reference-value{flex:1 1 100%;order:1}.case-reference button{margin-left:auto}.case-reference-status{order:2;width:100%}.case-reference-status:empty{display:none}}
