/* Phone workflow: preserve clinical rules; optimize entry and reading. */
.mobile-tabs,.mobile-actionbar,.mobile-drug-select{display:none}
.field-label-row{display:flex;align-items:center;justify-content:space-between;gap:8px}
#date-today{border:0;background:#edf0f4;color:var(--green);border-radius:6px;padding:4px 10px;font-size:12px}
.demo-section{margin-bottom:15px;font-size:12px;color:var(--muted)}
.demo-section>summary{cursor:pointer;padding:10px 0}
.demo-section .demo-toolbar{margin-top:9px;flex-wrap:wrap}
.case-state{font-size:12px;color:var(--muted);margin:0 0 12px}
.med-empty-note{color:var(--muted);font-size:13px;line-height:1.8;margin-bottom:14px}
.export-actions{flex-wrap:wrap}
body.dialog-open{overflow:hidden}
dialog:not([open]){display:none}
#drug-dialog,#report-dialog{padding:0;overflow:hidden}
#drug-dialog .dialog-top,#report-dialog .dialog-top{margin:0;padding:15px 20px;background:#fff}
#drug-search{display:block;width:calc(100% - 40px);margin:15px 20px 8px;min-height:46px;border:1px solid #ced5df;border-radius:9px;padding:10px 12px;font-size:16px;background:#f5f7fa;color:var(--ink)}
.picker-hint,.report-hint{padding:0 20px 12px;font-size:12px;color:var(--muted)}
#drug-picker-list{max-height:55vh;overflow:auto;overscroll-behavior:contain;padding:0 20px 20px}
.picker-group h3{font-size:12px;font-weight:600;color:var(--green);padding:16px 0 8px}
.drug-pick{display:flex;align-items:center;justify-content:space-between;text-align:left;gap:16px;width:100%;min-height:50px;background:#fff;border:0;border-bottom:1px solid var(--line);padding:12px 0;font-size:15px;line-height:1.5;color:var(--ink);overflow-wrap:anywhere}
.drug-pick>span:last-child{color:var(--green);font-size:20px;flex-shrink:0}
.picker-empty{font-size:14px;color:var(--muted);padding:20px 0}
.dialog-top button{min-width:44px;min-height:44px;padding:0;border-radius:8px}
.report-hint{padding-top:15px}
#report-text{display:block;margin:0 20px;width:calc(100% - 40px);height:38vh;border:1px solid var(--line);border-radius:8px;background:#f5f7fa;padding:12px;font:14px/1.75 -apple-system,BlinkMacSystemFont,"PingFang SC",sans-serif;color:var(--ink);resize:none}
.report-actions{display:flex;gap:10px;padding:15px 20px}
#report-copy-status{color:var(--green);font-size:13px;padding:0 20px 18px;line-height:1.7}
@media(max-width:760px){
 body{font-size:16px;-webkit-text-size-adjust:100%;text-size-adjust:100%}
 main{padding:18px 12px calc(92px + env(safe-area-inset-bottom,0px))}
 .topbar{height:64px;padding:0 12px;gap:10px}
 .brand{font-size:14px}.brand small{display:none}.brand-mark{width:32px;height:32px;font-size:23px}
 .topbar nav button{font-size:13px;min-width:44px;min-height:44px}
 .intro{gap:10px;margin-bottom:14px}.intro h1{font-size:21px;line-height:1.45}.eyebrow{font-size:11px;margin-bottom:6px}
 .intro p{display:none}.intro .button{min-height:44px;padding:8px;font-size:12px;flex-shrink:0}
 .scope-strip{margin-bottom:15px;font-size:12px;line-height:1.7;padding:10px}
 .mobile-tabs{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:4px;background:#e4e8ee;border-radius:10px;margin:0 0 15px;scroll-margin-top:12px}
 .mobile-tabs button{min-height:44px;background:transparent;border:0;border-radius:8px;font-size:15px;font-weight:600;color:var(--muted)}
 .mobile-tabs button[aria-pressed=true]{background:#fff;color:var(--green);box-shadow:0 2px 6px #252d390a}
 body[data-mobile-view=input] .results{display:none}
 body[data-mobile-view=result] .inputs{display:none}
 .panel{padding:17px;border-radius:13px}.panel-heading{margin-bottom:16px}h2{font-size:17px}
 .field{font-size:14px;gap:8px;margin-bottom:15px}.field input,.field select,.med-entry .field input,.med-entry .field select{font-size:16px;min-height:48px;height:48px;padding:0 10px;width:100%;max-width:100%}
 input[type=date]{display:block;min-width:0;max-width:100%;appearance:none;-webkit-appearance:none}
 .field-grid{gap:10px}.field-note{font-size:12px;color:#687b93;line-height:1.75}
 .egfr-field label{font-size:15px}.egfr-field small{font-size:12px}.egfr-input input{font-size:32px;width:108px;height:60px}.egfr-input span{font-size:12px}
 #date-today{min-height:44px;min-width:44px;font-size:13px;padding:4px 8px;margin:-8px 0 -4px}
 .extra-context{font-size:13px;padding:8px 12px}.extra-context summary{min-height:44px;display:flex;align-items:center;line-height:1.5}
 .med-entry{padding:12px}.med-top{align-items:start;gap:8px;margin-bottom:10px}
 .med-top .med-select{display:none}
 .mobile-drug-select{display:flex;align-items:center;justify-content:space-between;gap:8px;flex:1;min-width:0;min-height:48px;border:1px solid #ced5df;border-radius:8px;background:#fff;padding:10px;text-align:left;font-size:16px;line-height:1.5;font-weight:600;color:var(--ink);overflow-wrap:anywhere}
 .mobile-drug-select span{font-size:11px;color:var(--green);white-space:nowrap;font-weight:400;flex-shrink:0}
 .remove-med{width:44px;min-width:44px;height:48px;min-height:48px;background:#eef0f4;border-radius:8px;font-size:24px}
 .med-subtitle{font-size:12px;line-height:1.7}.med-entry .field{font-size:13px;margin-bottom:12px}.dose-wrap span{font-size:13px;top:12px}
 .add-button{min-height:48px;font-size:15px;padding:11px}
 .input-actions{padding-top:14px}.input-actions .button{min-height:48px;font-size:15px}.input-actions .primary{display:none}.input-actions .ghost{width:100%;border-color:var(--line)}
 .mobile-actionbar{position:fixed;display:grid;grid-template-columns:108px minmax(0,1fr);gap:10px;bottom:0;left:0;right:0;z-index:5;background:#ffffffed;border-top:1px solid var(--line);padding:10px max(12px,env(safe-area-inset-right,0px)) calc(10px + env(safe-area-inset-bottom,0px)) max(12px,env(safe-area-inset-left,0px));box-shadow:0 -3px 14px #252d3908}
 .mobile-actionbar button{border:1px solid #d2d7df;background:#f2f4f8;color:var(--green);border-radius:9px;min-height:48px;font-size:15px;font-weight:600;padding:9px 10px}
 #mobile-review-btn{background:var(--green);color:#fff;border-color:var(--green)}
 body.keyboard-open .mobile-actionbar,body.dialog-open .mobile-actionbar{visibility:hidden}
 .results{margin-top:0}.case-state{font-size:13px}.demo-section{font-size:13px;border:1px solid var(--line);border-radius:9px;background:#fff;padding:0 12px;margin-bottom:14px}.demo-section>summary{min-height:44px;padding:10px 0}
 .demo-toolbar{font-size:12px;gap:10px}.demo-toolbar>div{width:100%;white-space:normal}.demo-toolbar select,.demo-toolbar button{font-size:14px;min-height:44px;border:1px solid var(--line);border-radius:7px;background:#fff;padding:8px;max-width:100%}
 .summary-panel{padding:20px 17px}.summary-top{align-items:start;gap:12px}.summary-top h2{font-size:18px;line-height:1.5}.renal-number strong{font-size:32px}.renal-number span{font-size:10px;max-width:110px}.renal-meta{font-size:12px;line-height:1.7}
 .stats{gap:8px}.stat{display:flex;flex-direction:column;align-items:start;gap:5px}.stat b{font-size:27px}.stat span{font-size:12px;line-height:1.6}
 .range-panel{padding:13px 15px}.range-top{font-size:12px}.range-labels{font-size:11px}.range-labels span:nth-child(2){display:none}
 .results-heading{align-items:start;gap:8px}.results-heading span{font-size:11px;text-align:right;max-width:110px}.results-heading h2{font-size:16px}
 .result-card{padding:17px 15px}.result-card-head{gap:8px;flex-wrap:wrap}.result-card-head .result-drug{font-size:17px;line-height:1.55;overflow-wrap:anywhere;flex:1;min-width:160px}.result-card-head .status{font-size:11px;line-height:1.6;padding:4px 7px;white-space:normal;max-width:110px}
 .reference-label{font-size:12px;line-height:1.85;padding:9px 10px;overflow-wrap:anywhere}.recorded{font-size:13px}.result-title{font-size:15px;line-height:1.6}.result-text{font-size:14px;line-height:1.9;overflow-wrap:anywhere}
 .source-details{font-size:13px}.source-details summary{min-height:44px;line-height:1.6}.source-details .source-meta,.source-item .source-meta{font-size:12px;line-height:1.85;overflow-wrap:anywhere}.source-details a{display:inline-flex;align-items:center;min-height:44px;max-width:100%;overflow-wrap:anywhere}
 .export-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}.export-actions .button{font-size:14px;min-height:48px;padding:10px 8px;white-space:normal}.export-actions #download-btn,.export-actions #print-btn{display:none}
 .bottom-note{font-size:12px;margin-bottom:15px}.context-notices,.alert-panel ul,.dirty-banner{font-size:13px}.alert-panel h3{font-size:15px}
 footer{font-size:11px;letter-spacing:0}
 dialog{width:calc(100vw - 20px);max-height:88vh;max-height:88dvh;border-radius:14px;padding:16px;overflow:auto;overscroll-behavior:contain}
 #drug-dialog,#report-dialog{width:calc(100vw - 20px);max-height:88vh;max-height:88dvh}
 #drug-dialog .dialog-top,#report-dialog .dialog-top{padding:12px 16px}
 .dialog-top h2{font-size:17px;line-height:1.5}.dialog-top{gap:8px}.dialog-top button{flex-shrink:0}
 #drug-search{width:calc(100% - 32px);margin:12px 16px 8px;min-height:48px}
 .picker-hint{padding:0 16px 10px;font-size:12px}#drug-picker-list{max-height:56vh;max-height:56dvh;padding:0 16px 16px}
 .drug-pick{min-height:52px;font-size:16px}.picker-group h3{font-size:13px}
 .catalog-tools{top:-16px;padding:8px 0}.catalog-tools input,.catalog-tools select{font-size:16px;min-height:48px;width:100%}.catalog-tools input{flex-basis:100%}.catalog-add{min-height:44px;font-size:13px;padding:8px 10px}.source-item h3{font-size:16px}.source-item p,#dialog-body>p,.dialog-list{font-size:13px}.coverage-summary{grid-template-columns:repeat(2,1fr);gap:12px}.coverage-summary span{font-size:12px}
 #report-text{font-size:16px;height:37vh;height:37dvh}#report-dialog .button{min-height:48px;font-size:15px}.report-hint{font-size:13px;line-height:1.8}
 #toast{max-width:calc(100vw - 32px);width:max-content;white-space:normal;bottom:calc(88px + env(safe-area-inset-bottom,0px));font-size:14px;text-align:center}
 .empty-state{padding:44px 18px}.empty-state p{font-size:14px;line-height:1.8}
}
@media(max-width:350px){.brand{font-size:13px}.brand-mark{display:none}.topbar nav button{font-size:12px}.intro h1{font-size:19px}.result-card-head .result-drug{min-width:120px}.mobile-actionbar{grid-template-columns:98px minmax(0,1fr)}.field-grid{grid-template-columns:1fr}.egfr-input input{width:96px}.summary-top{flex-wrap:wrap}.renal-number{text-align:left}.renal-number span{max-width:none}.range-top{flex-direction:column}.report-actions{flex-wrap:wrap}.report-actions .button{flex:1}}
@media print{.mobile-tabs,.mobile-actionbar,.mobile-drug-select,.demo-section,.case-state,.report-actions{display:none!important}.inputs{display:none!important}.results{display:block!important}body{padding:0}.reference-label{background:#fff}.result-text{color:#333}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}

@media(max-width:760px){
 dialog[open]{top:calc(var(--visible-top,0px) + 12px);bottom:auto;margin:0 auto;max-height:calc(var(--visible-height,100dvh) - 24px)}
 #drug-dialog[open]{display:flex;flex-direction:column;max-height:calc(var(--visible-height,100dvh) - 24px)}
 #drug-dialog .dialog-top,#drug-search,.picker-hint{flex-shrink:0}
 #drug-picker-list{min-height:0;flex:1;max-height:56vh;max-height:56dvh;overflow:auto}
}

.scope-block{font-size:12px;line-height:1.8;color:#96703c;border:1px solid #e8d9bd;background:#fcf8ef;padding:10px;border-radius:8px;margin-bottom:12px}.purpose-note{margin-bottom:12px}@media(max-width:760px){.scope-block{font-size:13px}.scope-note{margin-bottom:17px}.scope-note,.purpose-note{line-height:1.85}.brand{white-space:normal;line-height:1.35;font-size:13px}.brand-mark{flex-shrink:0}.renal-meta{overflow-wrap:anywhere}}
