/* Opioid calculator compact UI v47. Scoped to this calculator. */

#opioid-root .op-mode-switch{margin-bottom:12px;padding:3px}
#opioid-root .op-mode-switch button{min-height:34px;padding:7px 12px;font-size:11px}
.op-compact .op-heading{gap:16px;margin-bottom:8px}
.op-compact .op-heading h1{font-size:26px}
.op-compact .op-heading .page-heading p{margin-top:3px;font-size:11px}
.op-compact .op-source-link{padding:8px 0;border:0;background:none;font:500 10px/1.6 Geist,Arial,sans-serif;color:var(--muted);cursor:pointer;white-space:nowrap}
.op-compact-population{display:flex;align-items:center;gap:8px;min-height:36px;margin:0 0 10px;color:var(--ink)}
.op-compact-population>label{display:flex;align-items:center;gap:8px;font-size:11px;font-weight:500;cursor:pointer;margin:0}
.op-compact-population input{height:17px;width:17px;accent-color:var(--brand);margin:0}
.op-compact .op-flow{grid-template-columns:minmax(0,1.25fr) 20px minmax(0,1fr);gap:12px}
.op-compact .op-panel{padding:17px;border-radius:11px}
.op-compact .op-panel-heading{gap:7px;margin-bottom:8px;align-items:center;flex-wrap:nowrap}
.op-compact .op-panel-heading h2{font-size:11px}
.op-compact .op-panel-heading>span{font-size:10px}
.op-compact .op-panel-heading .op-row-count{margin-left:auto;font-size:10px;white-space:nowrap}
.op-compact .op-flow-arrow{padding-top:76px}
.op-compact .op-treatment{margin:0;padding:10px 0 12px;border-top:1px solid var(--line);min-width:0}
.op-compact .op-treatment:last-child{padding-bottom:8px}
.op-compact .op-row-toolbar{display:flex;align-items:center;gap:8px;min-height:29px;margin-bottom:7px}
.op-compact .op-row-title{font-size:10px;font-weight:650;white-space:nowrap;color:var(--muted);margin-right:auto}
.op-compact .op-treatment .op-remove{position:static;min-height:28px;padding:4px 0 4px 6px;background:none;font-size:10px;margin:0;line-height:1.5}
.op-compact .op-treatment .op-remove[hidden]{display:none}
.op-compact .op-treatment-grid{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(0,1fr);gap:10px;align-items:end}
.op-compact .op-control{margin:0;min-width:0}
.op-compact .op-control>label,.op-compact .op-field-heading>label{display:block;font-size:10px;font-weight:550;line-height:1.5;margin:0 0 5px}
.op-compact .op-field-heading{display:flex;align-items:center;gap:4px;height:20px;margin-bottom:0}
.op-compact .op-field-heading>label{margin:0}
.op-compact .op-control .select-trigger{min-height:44px;border-radius:7px;font-size:12px;padding:9px 10px;gap:6px}
.op-compact .select-value-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.op-compact .select-route-badge{font-size:9px;padding:2px 5px}
.op-compact .op-dose-fields{display:grid;grid-template-columns:minmax(0,1fr);gap:7px}
.op-compact .op-dose-fields.with-count{grid-template-columns:minmax(0,1.35fr) minmax(0,.8fr)}
.op-compact input[type=text]{height:44px;padding:8px 10px;border-radius:7px;font-size:16px;line-height:1.4}
.op-compact .op-number-wrap input[type=text]{padding-right:67px}
.op-compact .with-count .op-number-wrap input[type=text]{padding-right:49px}
.op-compact .op-input-unit{font-size:9px;right:9px}
.op-compact .op-segment{display:flex;gap:2px;padding:3px;border:0;background:var(--bg);border-radius:7px}
.op-compact .op-segment[hidden]{display:none}
.op-compact .op-segment button{border:0;background:transparent;border-radius:5px;padding:5px 8px;min-height:27px;font:500 10px/1.5 Geist,Arial,sans-serif;color:var(--muted);cursor:pointer;white-space:nowrap}
.op-compact .op-segment button.selected{background:var(--surface);color:var(--brand);box-shadow:0 1px 4px #0f172a13}
.op-compact .op-segment button:disabled{opacity:.45;cursor:default}
.op-compact .op-entry-actions{display:flex;align-items:center;gap:12px;margin-top:5px}
.op-compact .op-add{flex:1;width:auto;margin:0;min-height:38px;font-size:11px;padding:7px 10px;border-radius:7px}
.op-compact .op-reset{min-height:38px;background:none;border:0;color:var(--muted);font:500 10px Geist,Arial,sans-serif;padding:8px 0;cursor:pointer}
.op-compact .op-reduction{margin:12px 0 0}
.op-compact .op-reduction-heading{display:flex;align-items:center;gap:5px;font-size:10px;font-weight:550;margin-bottom:5px}
.op-compact .op-reduction-options button{flex:1;min-height:32px;font-size:11px}
.op-compact .op-reduction-options button.selected{background:var(--brand);color:#fff;box-shadow:none}
.op-compact .op-result-card{padding:16px;margin-top:12px;border-radius:9px}
.op-compact .op-result-eyebrow{font-size:9px;letter-spacing:.55px;margin-bottom:8px;line-height:1.6}
.op-compact .op-result-card .op-big{font-size:42px;line-height:1.05;letter-spacing:-1.4px}
.op-compact .op-value-unit{font-size:11px}
.op-compact .op-result-card .op-target-name{font-size:12px;margin-top:7px;line-height:1.5;gap:6px}
.op-compact .op-result-card .op-route-label{font-size:10px}
.op-compact .op-result-card .op-reduction-equation,.op-compact .op-result-card .op-reduction-hint{font-size:10px;line-height:1.6;margin-top:5px}
.op-compact .op-total{display:flex;align-items:baseline;justify-content:space-between;gap:10px;padding:10px 0;margin-top:12px}
.op-compact .op-total>span{font-size:10px;line-height:1.6}
.op-compact .op-total>strong{font-size:13px;color:var(--ink);margin:0;white-space:nowrap;font-weight:650}
.op-compact .op-contributions li{padding:8px 0;gap:7px;font-size:10px}
.op-compact .op-contributions li strong{font-size:10px;line-height:1.45}
.op-compact .op-contributions li small{font-size:10px;line-height:1.6;margin-top:2px}
.op-compact .op-contributions li b{font-size:11px;line-height:1.5}
.op-compact .op-clinical-comments{border:1px solid var(--line);background:var(--surface);border-radius:7px;padding:9px 10px;margin-top:12px}
.op-compact .op-clinical-comments>strong{display:block;font-size:10px;font-weight:650;line-height:1.6;color:var(--ink)}
.op-compact .op-result-card .op-clinical-comments>p{font-size:10px;line-height:1.65;margin:3px 0 0;color:var(--muted)}
.op-compact .op-result-card .op-copy{min-height:40px;padding:9px 12px;margin-top:12px;font-size:11px;border-radius:7px}
.op-compact .op-copy svg{height:15px;width:15px}
.op-compact .op-empty-result{padding:8px 0;min-height:64px}
.op-compact .op-empty-result .op-empty-dash{font-size:26px;line-height:1;color:var(--muted)}
.op-compact .op-empty-result p{font-size:11px;line-height:1.65;margin-top:8px}
.op-compact .op-empty-result h3{font-size:13px}
.op-compact .op-result-card .op-confirm{margin-top:8px;min-height:38px;padding:8px 12px;font-size:11px}
.op-compact .op-reference-area{margin-top:8px}
.op-compact .op-guidance>summary{min-height:36px;font-size:10px}
.op-compact .op-help{position:relative;display:inline-flex;align-items:center;flex-shrink:0;vertical-align:middle;font-weight:400;letter-spacing:normal;text-transform:none}
.op-compact .op-help-trigger{display:inline-flex;align-items:center;justify-content:center;height:24px;width:24px;padding:0;border:0;background:transparent;color:var(--muted);font:600 11px/1 Geist,Arial,sans-serif;cursor:help;border-radius:50%}
.op-compact .op-help-trigger:before{display:none;content:'';position:absolute;inset:5px;border:1px solid currentColor;border-radius:50%;opacity:.65}
.op-compact .op-help-pop{display:none;position:fixed;z-index:1000;width:min(304px,calc(100vw - 24px));padding:12px 14px;border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--ink);box-shadow:0 8px 30px #0f172a20;font:400 11px/1.7 Geist,Arial,sans-serif;max-height:calc(100vh - 32px);overflow:auto;white-space:normal;text-align:left}
.op-compact .op-help-pop:not([hidden]){display:block}
.op-compact [hidden]{display:none!important}
.dark .op-compact .op-segment button.selected{color:var(--ink)}
.dark .op-compact .op-reduction-options button.selected{background:#235D72;color:#fff}
@media(max-width:1000px) and (min-width:761px){.op-compact .op-treatment-grid{grid-template-columns:1fr}.op-compact .op-dose-fields.with-count{grid-template-columns:1fr 1fr}.op-compact .op-number-wrap input[type=text]{padding-right:74px}}
@media(max-width:760px){.op-compact .op-flow{grid-template-columns:1fr;gap:12px}.op-compact .op-heading{display:flex;align-items:center}.op-compact .op-heading h1{font-size:24px}.op-compact .op-to-panel{position:static}.op-compact .op-panel{padding:16px}.op-compact .op-flow-arrow{display:none}}
@media(max-width:520px){.op-compact .op-treatment-grid:has(.with-count){grid-template-columns:1fr}.op-compact .op-dose-fields.with-count{grid-template-columns:1fr 1fr}.op-compact .op-treatment-grid{grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);gap:8px}.op-compact .op-source-link{font-size:9px}.op-compact .op-panel-heading>span{font-size:10px}.op-compact .op-heading .page-heading p{font-size:10px}.op-compact .op-number-wrap input[type=text]{padding-left:9px;padding-right:57px}.op-compact .op-control .select-trigger{font-size:11px}.op-compact .select-route-badge{display:none}.op-compact .op-help-trigger{height:28px;width:26px}.op-compact .op-field-heading{height:23px}.op-compact .op-row-toolbar{gap:5px}.op-compact .op-segment button{min-height:30px;padding:5px 7px}.op-compact .op-reduction-options button{min-height:38px;font-size:11px}.op-compact .op-result-card .op-big{font-size:40px}.op-compact .op-result-card .op-copy{min-height:44px}.op-compact .op-total>span{max-width:60%}}
@media print{.op-compact .op-help,.op-compact .op-reset,.op-compact .op-segment,.op-compact .op-source-link{display:none!important}.op-compact .op-flow{grid-template-columns:1fr 1fr}.op-compact .op-to-panel{position:static}.op-compact .op-clinical-comments{break-inside:avoid}}
/* Keep copying within reach even when three audit rows are visible. */
.op-compact .op-result-card{position:relative}
.op-compact .op-result-card.has-result .op-result-eyebrow{min-height:32px;padding-right:135px;margin-bottom:8px}
.op-compact .op-result-card .op-copy{position:absolute;right:12px;top:12px;width:132px;min-height:34px;margin:0;padding:7px 9px;font-size:10px;gap:5px}
@media(max-width:520px){.op-compact .op-result-card.has-result .op-result-eyebrow{min-height:40px;padding-right:132px}.op-compact .op-result-card .op-copy{width:128px;min-height:40px;font-size:10px}}

/* Give the choices a clear shape independently of the base stylesheet cache. */
.op-compact .op-segment{background:#eef1f4;border:1px solid #e0e5ea;padding:3px;border-radius:9px}
.op-compact .op-segment button{min-height:30px;border-radius:6px;color:#596474;transition:background .12s,box-shadow .12s}
.op-compact .op-segment button[aria-pressed=true]{background:#fff;color:#173d56;box-shadow:0 1px 4px #172b4d24;font-weight:650}
.op-compact .op-reduction-options{gap:4px;padding:4px}
.op-compact .op-reduction-options button{min-height:34px;font-size:12px}
.op-compact .op-reduction-options button[aria-pressed=true]{background:var(--brand,#235d72);color:#fff;box-shadow:0 1px 3px #172b4d20}
.op-compact .op-reduction-note{margin:6px 0 0;font-size:10px;line-height:1.6;color:var(--muted,#697586)}
.op-compact .op-help-trigger{cursor:pointer;touch-action:manipulation}
.op-compact .op-help-trigger svg{display:block;width:16px;height:16px;flex:none}
.op-compact .op-help-trigger:hover,.op-compact .op-help-trigger[aria-expanded=true]{color:var(--brand,#235d72);background:var(--bg,#eef1f4)}
.op-compact .op-help-trigger:focus-visible,.op-compact .op-segment button:focus-visible{outline:2px solid var(--brand,#235d72);outline-offset:3px}
.dark .op-compact .op-segment{background:#15232e;border-color:#334454}
.dark .op-compact .op-segment button{color:#a5b4c5}
.dark .op-compact .op-segment button[aria-pressed=true]{background:#334454;color:#fff}
.dark .op-compact .op-reduction-options button[aria-pressed=true]{background:#235d72;color:#fff}
@media(max-width:520px){.op-compact .op-segment button{min-height:32px}.op-compact .op-reduction-options button{min-height:40px}}

/* Keep explanations in the folded method section; form labels stay short. */
.op-compact .op-heading{margin-bottom:14px;gap:12px;flex-wrap:wrap}
.op-compact .op-compact-population{margin:0;min-height:30px}
.op-compact .op-panel-heading h2{display:flex;align-items:center;gap:6px;margin:0}
.op-compact .op-panel-heading .op-row-count{margin:0;font-size:10px;font-weight:500;color:var(--muted)}
.op-compact .op-reduction-heading{margin-bottom:6px;min-height:24px}
.op-compact .op-reduction-options{gap:6px;background:transparent;border:0;padding:0;border-radius:0}
.op-compact .op-reduction-options button{border:1px solid var(--line,#dce2e8);background:var(--bg,#f7f9fb);border-radius:7px;min-height:38px}
.op-compact .op-reduction-options button[aria-pressed=true]{border-color:var(--brand,#235d72)}
.op-compact .op-reduction-options button:not(:disabled):hover{border-color:var(--brand,#235d72)}
.op-compact .op-reduction-options button:disabled{opacity:.55}
.op-compact .op-result-card .op-clinical-comments>p:first-child{margin-top:0}
@media(max-width:520px){.op-compact .op-heading{gap:8px}.op-compact .op-heading h1{font-size:24px}.op-compact .op-compact-population>label{font-size:10px}.op-compact .op-reduction-options button{min-height:40px}}

/* Validation stays quiet until an input or dose needs review. */
.op-compact input[aria-invalid=true]{border-color:#bd3232;background:#fff5f4;box-shadow:0 0 0 1px #bd323214}
.op-compact .op-row-error{font-size:11px;line-height:1.55;color:#a82929;margin:8px 0 0}
.op-compact .op-result-card.has-error{background:#fff2f0;border:1px solid #e5b5ae;color:#8f2727}
.op-compact .has-error .op-empty-result strong{font-size:12px;color:#8f2727}
.op-compact .has-error .op-empty-result p{color:#8f2727}
.op-compact .op-dose-alert{background:#fff8e5;border:1px solid #e3cb86;border-left:3px solid #b78a1d;border-radius:7px;padding:10px 12px;margin:0 0 13px;color:#6f5315}
.op-compact .op-dose-alert.is-high{background:#fff0df;border-color:#dba05b;border-left-color:#c47316;color:#754410}
.op-compact .op-dose-alert>strong{font-size:11px;line-height:1.5;display:block}
.op-compact .op-dose-alert ul{margin:6px 0 0;padding-left:15px}
.op-compact .op-dose-alert li{font-size:11px;line-height:1.6;margin:4px 0 0}
.op-compact .op-result-card.has-warning .op-copy{position:static;width:100%;margin-top:12px;min-height:38px}
.op-compact .op-result-card.has-warning .op-result-eyebrow{padding-right:0;min-height:0}
.dark .op-compact input[aria-invalid=true],.dark .op-compact .op-result-card.has-error{background:#3b2427;color:#f2bdba;border-color:#ae6060}
.dark .op-compact .op-row-error,.dark .op-compact .has-error .op-empty-result strong,.dark .op-compact .has-error .op-empty-result p{color:#f2bdba}
.dark .op-compact .op-dose-alert{background:#3a3220;color:#f0d99c;border-color:#8f7941}
.dark .op-compact .op-dose-alert.is-high{background:#403020;color:#f0c891;border-color:#a7783d}

/* Keep the product distinction beside the patch estimate, not only in methods. */
.op-compact .op-patch-notice{border:1px solid var(--line);border-left:3px solid var(--brand);border-radius:7px;padding:10px 12px;margin:0 0 13px;background:var(--bg);color:var(--ink)}
.op-compact .op-patch-notice strong{display:block;font-size:12px;line-height:1.5}
.op-compact .op-patch-notice p,.op-compact .op-patch-notice a{font-size:11px;line-height:1.65}
.op-compact .op-patch-notice p{margin:6px 0}

/* Native, initially folded notices: no popover dependency on managed PCs. */
.op-compact .op-dose-alert,.op-compact .op-patch-notice{padding:0;margin-bottom:9px}
.op-compact .op-dose-alert>summary,.op-compact .op-patch-notice>summary{display:flex;align-items:center;gap:7px;cursor:pointer;min-height:40px;padding:9px 11px;font-size:11px;line-height:1.5;font-weight:650;list-style:none}
.op-compact .op-dose-alert>summary::-webkit-details-marker,.op-compact .op-patch-notice>summary::-webkit-details-marker{display:none}
.op-compact .op-dose-alert>summary:after,.op-compact .op-patch-notice>summary:after{content:'⌄';margin-left:auto;font-size:15px;line-height:1}
.op-compact .op-dose-alert[open]>summary:after,.op-compact .op-patch-notice[open]>summary:after{transform:rotate(180deg)}
.op-compact .op-notice-body{padding:0 12px 11px}
.op-compact .op-notice-count{display:inline-flex;align-items:center;justify-content:center;min-width:19px;height:19px;padding:0 5px;border:1px solid currentColor;border-radius:12px;font-size:10px;opacity:.8}
.op-compact summary:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
.op-compact .op-row-note{font-size:10px;line-height:1.6;color:var(--muted);margin:5px 0 0}
@media print{.op-compact .op-dose-alert .op-notice-body,.op-compact .op-patch-notice .op-notice-body{display:block!important}}

/* Rich select trigger: align the route badge and leave room for the chevron. */
.opioid-workspace.op-compact .op-control .select-trigger{min-height:44px;padding:9px 34px 9px 12px;border:1px solid var(--line);border-radius:9px;background:var(--surface);font-family:inherit;font-size:12px;line-height:1.5;box-shadow:0 1px 2px #0b1f2604}
.opioid-workspace.op-compact .op-control .select-trigger:hover{border-color:var(--brand)}
.opioid-workspace.op-compact .op-control .select-trigger[aria-expanded=true]{border-color:var(--brand);box-shadow:0 0 0 3px #0284c712}
.opioid-workspace.op-compact .select-trigger:after{right:14px;width:6px;height:6px}
.opioid-workspace.op-compact .select-route-badge{background:var(--chip);color:var(--chip-ink);padding:3px 6px;border-radius:5px;font-size:9px;line-height:1.4}
