/* Order arithmetic uses the existing record palette and keeps every amount editable. */
.medication-calculator{color:var(--ink,#203044);min-width:0;line-height:1.55}
.medication-calculator *{min-width:0}
.medication-calculator h2,.medication-calculator h3,.medication-calculator h4,.medication-calculator p,.medication-calculator li,.medication-calculator dd,.medication-calculator a{overflow-wrap:anywhere}
.medication-calculator button,.medication-calculator input,.medication-calculator select{font:inherit;line-height:1.35}
.medication-calculator button{min-height:46px;font-size:13px;touch-action:manipulation;overflow-wrap:anywhere}
.medication-calculator p{margin:8px 0}
.mc-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:10px}
.mc-heading h2{font-size:22px;line-height:1.3;margin:0;color:#25415a}
.mc-heading p{font-size:13px;color:#566f82;margin:4px 0 0}
.mc-mode{font-size:12px;font-weight:700;flex-shrink:0;background:#e4eaf2;border:1px solid #b4c5d5;border-radius:4px;padding:5px 8px;color:#3e5870}
.mc-scope{font-size:12px;color:#556979;line-height:1.6;border-left:3px solid #92adc2;padding:7px 10px;background:#edf3f7;margin-bottom:13px!important}
.mc-block{background:#fff;border:1px solid #b7c8d6;border-left:4px solid #688fba;border-radius:4px;padding:14px;margin:12px 0}
.mc-block h3{display:flex;align-items:center;gap:8px;font-size:16px;line-height:1.35;color:#29485f;margin:0 0 12px}
.mc-block h3>span{display:grid;place-items:center;flex:0 0 24px;height:24px;border-radius:3px;background:#e2ebf3;font-size:12px;color:#527795}
.mc-weight{border-left-color:#8b60a0;background:#f7f5fa}
.mc-weight h3>span{background:#ece4f3;color:#795693}
.mc-preparation{border-left-color:#be873b;background:#fcfbf6}
.mc-preparation h3>span{background:#f3ead7;color:#93691d}
.mc-field{display:flex;flex-direction:column;gap:5px;margin:10px 0}
.mc-field>span{display:block;font-size:12px;line-height:1.4;font-weight:700;color:#405c72}
.mc-field input,.mc-field select{width:100%;min-height:50px;min-width:0;padding:10px;border:1px solid #9fb6c9;border-radius:4px;color:#213e54;background:#fff;font-size:16px}
.mc-field input[type=number]{font-size:22px;font-variant-numeric:tabular-nums}
.mc-field input:disabled,.mc-field select:disabled{background:#e9edf2;color:#687b8d;opacity:1}
.mc-pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 12px;align-items:start}
.mc-optional-fields input{font-size:14px}
.mc-weight-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;gap:10px;align-items:end}
.mc-weight-grid button{margin:10px 0;min-height:50px;background:#e8dff0;color:#67457e;border-color:#bea9cf;padding:10px}
.mc-weight-grid button:disabled{color:#8390a0;background:#e9edf1;border-color:#c7d1db;opacity:1}
.mc-weight-status{font-size:12px;color:#5d4c70;padding:8px 10px;background:#eee8f3;border-radius:3px;line-height:1.6}
.mc-weight-status strong,.mc-weight-status span{display:block}
.mc-weight-status span{margin-top:3px;color:#657181}
.mc-small{font-size:12px;line-height:1.65;color:#596f81}
.mc-weight-error{font-size:13px;color:#a33032;background:#fce9e7;padding:8px 10px;border-left:3px solid #b6423e}
.mc-per-kg{display:flex;align-items:center;gap:10px;padding:10px;background:#eef3f8;border:1px solid #c1cfdb;border-radius:4px;font-size:14px;font-weight:700;color:#34566f;margin:8px 0;cursor:pointer;min-height:48px}
.mc-per-kg input{width:21px;min-height:21px;height:21px;flex-shrink:0;margin:0;accent-color:#397cac}
.mc-preparation-intro{font-size:14px;line-height:1.55;color:#65583d}
.mc-results{margin-top:15px;scroll-margin-top:12px}
.mc-result-empty{border:1px dashed #aabfce;border-radius:4px;padding:16px;background:#f4f8fa;color:#536b7e;font-size:14px}
.mc-result-empty h3{font-size:16px;margin:0 0 8px;color:#3b5d75}
.mc-result-empty p{margin-bottom:0}
.mc-needs-input{border-style:solid;border-color:#d4bd84;background:#fcf7e9;color:#776237}
.mc-needs-input h3{color:#7f652d}
.mc-result-empty ul{padding-left:20px;margin:8px 0 0}
.mc-result-empty li{margin:6px 0;line-height:1.55}
.mc-result-success{border:1px solid #aac5b1;border-top:4px solid #548659;border-radius:4px;padding:14px;background:#fff}
.mc-result-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:12px}
.mc-result-heading h3{font-size:18px;color:#315d3c;margin:0}
.mc-result-heading>span{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.5px;color:#66816b}
.mc-result-metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,200px),1fr));gap:10px;margin:10px 0 13px}
.mc-result-metrics>div{background:#eaf3ec;border:1px solid #c3d8c8;border-radius:4px;padding:12px}
.mc-result-metrics span{display:block;color:#416b4b;font-size:12px;font-weight:700}
.mc-result-metrics strong{display:block;font-size:32px;font-weight:700;line-height:1.3;color:#295c39;overflow-wrap:anywhere;font-variant-numeric:tabular-nums;margin-top:5px}
.mc-result-metrics small{font-size:15px;font-weight:700}
.mc-result-facts{margin:0;font-size:13px}
.mc-result-facts>div{display:grid;grid-template-columns:minmax(105px,.55fr) minmax(0,1fr);gap:10px;border-bottom:1px solid #dce5e0;padding:9px 0}
.mc-result-facts dt{font-size:12px;margin:0;color:#587466}
.mc-result-facts dd{font-size:14px;white-space:normal;margin:0;color:#29473b;line-height:1.6}
.mc-result-success h4{font-size:13px;margin:15px 0 7px;color:#466854}
.mc-calculation-steps{padding-left:21px;font-size:13px;line-height:1.8;margin:7px 0}
.mc-calculation-steps li{padding-left:2px;margin:6px 0;font-variant-numeric:tabular-nums}
.mc-no-limit{background:#f6f0df;border-left:3px solid #c5a264;color:#796338;padding:8px 10px;font-size:12px;margin-top:13px!important}
.mc-calculation-warnings{padding-left:20px;font-size:12px;color:#795131;line-height:1.6}
.mc-calculation-warnings li{margin:7px 0}
.mc-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:13px 0 18px}
.mc-review{background:#294e68;color:#fff;border-color:#294e68;flex:1 1 210px}
.mc-review:disabled{background:#e2e9ef;color:#7c8b98;border-color:#bfcdd8;opacity:1}
.mc-actions>[data-mc-clear]{background:#f1f5f8;color:#405c71;flex:0 1 auto}
.mc-actions>p{flex:1 1 100%;margin:0;font-size:12px;line-height:1.6;color:#5b7183}
.mc-reference,.mc-help{border:1px solid #b7c8d7;background:#f8fafc;border-radius:4px;margin:12px 0}
.mc-reference>summary,.mc-help>summary{min-height:50px;padding:12px 14px;cursor:pointer;font-size:14px;font-weight:700;color:#395d79;line-height:1.6;touch-action:manipulation}
.mc-reference>summary strong,.mc-reference>summary small{display:inline}
.mc-reference>summary small{font-size:12px;color:#62798c;font-weight:400;margin-left:7px}
.mc-reference[open]>summary,.mc-help[open]>summary{background:#eaf1f6;border-bottom:1px solid #c8d7e2}
.mc-reference>div,.mc-help>div{padding:3px 14px 12px;font-size:13px;line-height:1.65}
.mc-reference-context{font-size:12px;font-weight:700;color:#506e83}
.mc-reference-separation{border-left:3px solid #b3a2ca;background:#f0ebf5;padding:8px 10px;color:#66527c;font-size:12px}
.mc-reference-row{padding:13px 0;border-bottom:1px solid #d5e1e9}
.mc-reference-row:last-child{border-bottom:0;padding-bottom:0}
.mc-reference-row h4{font-size:14px;line-height:1.5;color:#36566e;margin:0 0 6px}
.mc-reference-row>strong{display:block;font-size:17px;color:#294d68;margin-bottom:5px}
.mc-reference-row p{font-size:12px;line-height:1.65;margin:5px 0;color:#526b7f}
.mc-reference-row .mc-reference-formula{font-weight:700;color:#4c6282}
.mc-reference-row .mc-reference-preparation{color:#75613e;background:#f4f0e7;padding:7px 9px;border-radius:3px}
.mc-reference-source a,.mc-method-sources a{color:#2d6c97;text-underline-offset:3px}
.mc-help ul{padding-left:19px}
.mc-help li{margin:8px 0}
.mc-version{font-size:11px;color:#63798c}
.mc-navigation{display:flex;align-items:center;flex-wrap:wrap;gap:8px;border-top:1px solid #c3d0db;margin-top:18px;padding-top:12px}
.mc-navigation>span{font-size:12px;color:#5c7286}
.mc-navigation button{min-height:42px;font-size:12px;padding:8px 10px;background:#eef3f7;color:#3c6582}
.section-sidebar button[data-tab="Medication calculator"]{border-left-color:#ed9134}
@media(max-width:1100px){.mc-weight-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.mc-weight-grid>button{grid-column:1/-1;margin:0 0 6px}.mc-result-facts>div{grid-template-columns:1fr;gap:3px}}
@media(max-width:550px){.mc-heading h2{font-size:19px}.mc-heading p{font-size:12px}.mc-mode{font-size:11px;padding:4px 6px}.mc-block{padding:11px 10px}.mc-block h3{font-size:15px}.mc-pair{grid-template-columns:1fr;gap:0}.mc-weight-grid{grid-template-columns:1fr;gap:0}.mc-weight-grid>button{margin-top:6px}.mc-field input,.mc-field select{font-size:16px}.mc-field input[type=number]{font-size:21px}.mc-per-kg{font-size:13px}.mc-result-success{padding:11px}.mc-result-metrics strong{font-size:29px}.mc-result-heading h3{font-size:17px}.mc-actions>button{flex-basis:100%;width:100%}.mc-reference>summary,.mc-help>summary{padding:11px 10px;font-size:13px}.mc-reference>summary small{display:block;margin:3px 0 0}.mc-reference>div,.mc-help>div{padding:3px 10px 10px}.mc-navigation{gap:6px}.mc-navigation>span{flex-basis:100%}.mc-navigation button{flex:1}.mc-scope,.mc-small{font-size:11px}}
@media(prefers-reduced-motion:reduce){.medication-calculator button{transition:none}}
