/* Case-tinted drawing backgrounds; fixed mechanical materials stay neutral. */
[data-comparison-case=A]{--case-color:#087e8b;--case-ink:#075963;--case-soft:#edf8f9}
[data-comparison-case=B]{--case-color:#8346ad;--case-ink:#643086;--case-soft:#f6effa}
[data-comparison-case=C]{--case-color:#a36a00;--case-ink:#795000;--case-soft:#fff7e6}
[data-comparison-case=D]{--case-color:#365ec3;--case-ink:#294994;--case-soft:#f0f3ff}
[data-comparison-case=E]{--case-color:#a3477e;--case-ink:#7b345e;--case-soft:#fff0f8}
[data-comparison-case=F]{--case-color:#667725;--case-ink:#4b571b;--case-soft:#f5f8e9}
.comparison-case181{border:1px solid color-mix(in srgb,var(--case-color) 45%,#cbd2d8)!important;border-top:4px solid var(--case-color)!important;border-radius:10px;background:var(--case-soft,#fff)!important;box-sizing:border-box}
.comparison-case181:is(.act-card,.comparison177-card,.lane,.bounce-card,.drip-physical-card,.physics-lane,.slope-motion-lane){background:var(--case-soft)!important}
.comparison177-host{background:var(--case-soft);border-radius:7px}
.comparison-case181.condition{padding:14px!important;margin-top:14px}
.comparison-case181:is(.lane,.bounce-card,.drip-physical-card){padding:12px;box-sizing:border-box}
.comparison-case181:is(.act-fields,.act-result,.comparison177-card,.comparison177-edit){padding:14px}
.comparison-case181>:is(h3,.lane-header,.condition-head,.drip-fluid-label){color:var(--case-ink)!important;background:var(--case-soft);border:0;border-radius:5px;padding:7px 10px;margin:0 0 12px;line-height:1.5}
.comparison-case181 .dot{background:var(--case-color)!important}
.comparison-case181.act-result,.comparison-case181.act-result output{color:#8b2530}
.act-drawing,.comparison177-host .linkage-screen{background:var(--case-soft,#f7f9fb);border-radius:7px}
.comparison-case181 .linkage-screen{background:var(--case-soft,#f7f9fb)}
.case-key181{display:flex;flex-wrap:wrap;align-items:center;gap:8px;line-height:1.6;font-size:.9rem}
.case-chip181{display:inline-flex;align-items:center;justify-content:center;min-width:30px;padding:2px 8px;box-sizing:border-box;background:var(--case-color);border:2px solid var(--case-color);border-radius:6px;color:#fff;font-weight:700}
.case-chip181[data-comparison-case=A]{border-style:dashed}.case-key181[hidden]{display:none!important}
.comparison-model181[data-case-layout=overlay][data-comparison-case=A] [data-material=moving]{stroke-dasharray:7 4}
.comparison-model181[data-case-layout=overlay][data-comparison-case=A] text{visibility:hidden}
.act-figures[data-layout=overlay] .act-card:first-child,.comparison177-figures[data-layout=overlay] .comparison177-card:first-child .comparison177-host{filter:none!important;opacity:.75!important}
:is(.act-figures,.comparison177-figures)[data-layout=overlay] .comparison-case181{border:0!important;border-radius:0;background:transparent!important;box-shadow:none}
:is(.act-figures,.comparison177-figures)[data-layout=overlay] :is(.act-drawing,.comparison177-host){background:transparent!important}
.case-cell181{background:var(--case-soft)!important;border-left:2px solid var(--case-color)!important}
thead .case-cell181{border-top:4px solid var(--case-color)!important;color:var(--case-ink)!important}
.case-cell-letter181{color:var(--case-ink);font-weight:800}.compare-results-table .case-cell181{color:#8b2530!important}.compare-safety .case-cell181{background:transparent!important}
.comparison-case181[data-ng=true],.comparison-case181[data-valid=false]{border-color:#cf2035!important;background:#fff0f2!important}
.analysis182{margin:18px 0;padding:16px;border:1px solid #bdcbd6;border-radius:10px;background:#fff;line-height:1.75;color:#233d4a;scroll-margin-top:160px}
.analysis182 summary{font-weight:700;cursor:pointer;color:#174d72}.analysis182 p{margin:10px 0}.analysis182-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin:14px 0}
.analysis182 label{display:flex;flex-direction:column;gap:6px;min-width:0}.analysis182 input,.analysis182 select{box-sizing:border-box;min-width:0;width:100%;min-height:44px;font:inherit;color:#064d88;background:#fff;border:1px solid #9ab7cf;border-radius:6px;padding:9px}
.analysis182 input[aria-invalid=true]{border:2px solid #c62032;background:#fff1f2}.analysis182 output{display:block;font-size:1.2rem;font-weight:750;color:#8b2530;margin:12px 0}
.analysis182 small{display:block;font-size:.82rem;color:#4f6371}.analysis182 .analysis182-note{padding:10px 12px;background:#f0f4f7;border-radius:6px}.analysis182[data-error=true] output{color:#b71c30}
.analysis182-return{min-height:44px;padding:9px 14px;border:1px solid #477a9c;background:#e9f3fa;color:#164d73;border-radius:6px;font:inherit;cursor:pointer}
.pose182-status{border-left:4px solid #617c8c;padding:8px 12px;margin:10px 0;font-size:.9rem;line-height:1.6;background:#eef3f6;color:#283f4d}
.pose182-status[data-state=warn]{border-color:#c46a0a;background:#fff5e7;color:#7e4300}.pose182-status[data-state=error]{border-color:#db1735;background:#fff0f2;color:#ab1630}
.pose182-status:empty{display:none}.analysis182 .analysis182-cases{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.analysis182-case{min-width:0;border-top:3px solid var(--case-color,#8a9ca9);padding:10px 0}
.load182-static{padding:20px;margin:24px 0;border:1px solid #c7d3dc;border-radius:10px;line-height:1.8}.analysis182 .analysis182-note:empty{display:none}.analysis182 [hidden]{display:none!important}
svg [data-analysis182]{pointer-events:none}.linkage-screen svg text{stroke:#f7f9fb}
.load182-insufficient{background:#b41e31;color:#fff;border:2px solid #ee3149;border-radius:7px;padding:12px}.load182-insufficient output,.load182-insufficient small,.load182-insufficient .analysis182-note{color:#fff!important}.load182-insufficient .analysis182-note{background:#8e1525}
.comparison-case181.act-result[data-ng=true]{background:#b41e31!important;color:#fff!important}.comparison-case181.act-result[data-ng=true] output{color:#fff!important}
:is(html[data-theme=dark],html[data-color-mode=dark]:not([data-theme=light])) [data-comparison-case=A],[data-comparison-case=A][data-case-theme=dark]{--case-color:#76d9e1;--case-ink:#b8f0f3;--case-soft:#15383b}
:is(html[data-theme=dark],html[data-color-mode=dark]:not([data-theme=light])) [data-comparison-case=B],[data-comparison-case=B][data-case-theme=dark]{--case-color:#d0a5ef;--case-ink:#ead3fa;--case-soft:#34243f}
:is(html[data-theme=dark],html[data-color-mode=dark]:not([data-theme=light])) [data-comparison-case=C],[data-comparison-case=C][data-case-theme=dark]{--case-color:#e4c275;--case-ink:#f7e6b7;--case-soft:#39321e}
:is(html[data-theme=dark],html[data-color-mode=dark]:not([data-theme=light])) .comparison-case181{background:var(--case-soft,#192731)!important}
:is(html[data-theme=dark],html[data-color-mode=dark]:not([data-theme=light])) :is(.act-drawing,.comparison-case181 .linkage-screen,.analysis182){background:#172630;color:#e5edf4}
:is(html[data-theme=dark],html[data-color-mode=dark]:not([data-theme=light])) .analysis182 summary{color:#b1d8f5}
:is(html[data-theme=dark],html[data-color-mode=dark]:not([data-theme=light])) .analysis182 :is(small,.analysis182-note){color:#c3d3de}.analysis182:focus-within{outline-color:#155c97}
:is(html[data-theme=dark],html[data-color-mode=dark]:not([data-theme=light])) .analysis182-note{background:#263a49}
:is(html[data-theme=dark],html[data-color-mode=dark]:not([data-theme=light])) .analysis182 input{background:#10283a;color:#c8e6ff}
:is(html[data-theme=dark],html[data-color-mode=dark]:not([data-theme=light])) :is(.comparison-case181.act-result,.comparison-case181.act-result output,.compare-results-table .case-cell181,.analysis182 output){color:#ffd9db!important}
:is(html[data-theme=dark],html[data-color-mode=dark]:not([data-theme=light])) .case-chip181{color:#152a26}
:is(html[data-theme=dark],html[data-color-mode=dark]:not([data-theme=light])) .comparison-case181[data-ng=true],:is(html[data-theme=dark],html[data-color-mode=dark]:not([data-theme=light])) .comparison-case181[data-valid=false]{border-color:#ff6e81!important;background:#431c27!important}
@media(max-width:700px){.comparison-case181:is(.act-fields,.act-result,.comparison177-card,.comparison177-edit,.lane,.bounce-card,.drip-physical-card){padding:10px}.case-key181{font-size:.82rem;gap:6px}.case-chip181{min-width:26px;padding:1px 6px}.analysis182{padding:12px}.analysis182-grid,.analysis182 .analysis182-cases{grid-template-columns:1fr;gap:12px}}

/* Tint the same drawing area in dark mode without changing alert colours. */
:is(html[data-theme=dark],html[data-color-mode=dark]:not([data-theme=light])) .comparison-case181:is(.act-card,.comparison177-card,.lane,.bounce-card,.drip-physical-card,.physics-lane,.slope-motion-lane){background:var(--case-soft)!important}
:is(html[data-theme=dark],html[data-color-mode=dark]:not([data-theme=light])) .act-drawing{background:var(--case-soft,#172630)!important}

/* Shared overlay stays transparent so neither case hides the other. */
.act-figures[data-layout=overlay]>.act-card.comparison-case181,.comparison177-figures[data-layout=overlay]>.comparison177-card.comparison-case181{background:transparent!important}

/* Keep case identity through diagram, conditions and results. */
.analysis182-case:not(.load182-insufficient){background:var(--case-soft,transparent);border-radius:7px;padding:12px}
/* The generic linkage label span rule must not stack value and unit. */
.act-fields .linkage-fields label > .act-input-row{display:grid;grid-template-columns:minmax(0,1fr) max-content;align-items:center;gap:8px;min-width:0;width:100%;margin:0}
.act-fields .act-input-row > input{width:100%;min-width:0;max-width:100%}
.act-fields .linkage-fields label > .act-input-row > span{display:inline-block;flex:0 0 auto;white-space:nowrap;margin:0;line-height:1.4}

:is(html[data-theme=dark],html[data-color-mode=dark]:not([data-theme=light])) [data-comparison-case=D],[data-comparison-case=D][data-case-theme=dark]{--case-color:#9fb7ff;--case-ink:#d2ddff;--case-soft:#242f4a}
:is(html[data-theme=dark],html[data-color-mode=dark]:not([data-theme=light])) [data-comparison-case=E],[data-comparison-case=E][data-case-theme=dark]{--case-color:#efaccf;--case-ink:#fbd4e8;--case-soft:#402637}
:is(html[data-theme=dark],html[data-color-mode=dark]:not([data-theme=light])) [data-comparison-case=F],[data-comparison-case=F][data-case-theme=dark]{--case-color:#c2d388;--case-ink:#e5efc6;--case-soft:#30381f}
/* Keep labels and unit text readable against the dark case tints. */
:is(html[data-theme=dark],html[data-color-mode=dark]:not([data-theme=light])) .act-fields .linkage-fields label{color:#dce9f0}
:is(html[data-theme=dark],html[data-color-mode=dark]:not([data-theme=light])) .act-fields .linkage-fields small{color:#b8cad5}
:is(html[data-theme=dark],html[data-color-mode=dark]:not([data-theme=light])) .act-fields :is(input,select){background:#102337;color:#c4e2ff}

/* Overlay is a shared scene even when the surrounding panels carry case tints. */
.act-figures[data-layout=overlay]>.act-card.comparison-case181[data-comparison-case],.comparison177-figures[data-layout=overlay]>.comparison177-card.comparison-case181[data-comparison-case],.act-figures[data-layout=overlay]>.act-card.comparison-case181 .act-drawing,.comparison177-figures[data-layout=overlay]>.comparison177-card.comparison-case181 .comparison177-host{background:transparent!important}
