.ble-panel{margin:0 0 13px;padding:11px;background:#ebe8e4;border:1px solid #d7d0ca;border-radius:10px}
.ble-panel[hidden]{display:none}
.ble-field{display:grid;gap:5px;margin-bottom:9px}
.ble-field label{font-size:10px;color:#736b69}
.ble-field input,.ble-field select{width:100%;min-width:0;background:#f8f6f3;border:1px solid #d6cdc7;border-radius:7px;padding:8px;font:9px 'DM Mono',monospace;color:#332d2d}
.ble-help{margin:7px 0 10px;color:#736b69;font-size:9px;line-height:1.45;overflow-wrap:anywhere}
.ble-connect{width:100%;border:0;border-radius:8px;padding:10px;background:#f8dadd;color:#a52f40;font-size:11px;font-weight:700}
.ble-connect:hover{background:#f1c8ca}
.ble-connect:disabled{opacity:.6;cursor:wait}
.ble-status{margin-top:8px;padding:8px 9px;border:1px solid #d7d0ca;border-radius:7px;background:#f3f0ec;color:#736b69;font-size:9px;line-height:1.4}
.ble-status[data-state="live"]{border-color:#d99a94;background:#fff0ed;color:#963344}
.ble-status[data-state="error"]{border-color:#d7a57f;background:#fff6e9;color:#805328}
.ble-readout{margin-top:8px;color:#493b3b;font:9px/1.6 'DM Mono',monospace;overflow-wrap:anywhere}
.ble-readout:empty{display:none}
.control-row select:disabled,.rate-control input:disabled{opacity:.6;cursor:not-allowed}
.demo-tag[data-mode="ble"]{border-color:#d99a94;color:#963344;background:#fff0ed}
.demo-tag[data-mode="udp"]{border-color:#d99a94;color:#963344;background:#fff0ed}
.map-card.bluetooth-mode #map .pulse-dot,.map-card.bluetooth-mode #map .pulse-track,.map-card.bluetooth-mode .propagation-key,.map-card.bluetooth-mode #map .map-legend{display:none}
.map-card.bluetooth-mode .rhythm-toolbar{display:none}
.udp-panel{margin:0 0 13px;padding:11px;background:#ebe8e4;border:1px solid #d7d0ca;border-radius:10px}
.udp-panel[hidden]{display:none}
.udp-listen{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px;color:#736b69;font-size:10px}
.udp-listen strong{color:#963344;font:600 10px 'DM Mono',monospace}
.udp-format-label{display:block;margin-bottom:5px;font-size:10px;color:#736b69}
.udp-panel select{width:100%;background:#f8f6f3;border:1px solid #d6cdc7;border-radius:7px;padding:8px;font:9px 'DM Mono',monospace;color:#332d2d}
.udp-help{margin:8px 0 10px;color:#736b69;font-size:9px;line-height:1.5;overflow-wrap:anywhere}
.udp-help code{font:inherit}
.udp-panel .ble-status{overflow-wrap:anywhere}
.udp-panel .ble-connect:disabled{opacity:.6;cursor:wait}
.electrode-position[hidden]{display:none!important}
.udp-panel .ble-field input{width:100%;box-sizing:border-box}
.trace-tools #traceLabel{white-space:normal;overflow-wrap:anywhere}
.easi-vector-overlay{position:absolute;inset:0;width:100%;height:100%;z-index:3;pointer-events:none}
.easi-vector-overlay[hidden],.easi-caption[hidden]{display:none}
.vector-axis{fill:#08636c;font:14px monospace}
.easi-caption{padding:8px 16px;border-top:1px solid #d7d0ca;background:#ebe8e4;color:#493b3b;font:10px/1.5 var(--sans)}
#easiTrail{stroke:#ffd85b;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;opacity:.8;filter:drop-shadow(0 0 2px #e89824)}
#easiTrailGlow{stroke:#ffcf4a;filter:blur(3px);stroke-linecap:round;stroke-linejoin:round}
#easiArrowLine{stroke:#ffe575;stroke-width:3;opacity:.75;filter:drop-shadow(0 0 3px #efa52c)}
#easiArrow path{fill:#ffe575}
#easiVectorTip{fill:#fff7b5;stroke:#ffbe37;stroke-width:2;filter:drop-shadow(0 0 6px #ffb72d)}
#easiVectorOverlay > line:not(#easiArrowLine){opacity:.08}
#easiVectorOverlay .vector-axis{opacity:.35}
.vector-key{display:flex;flex-wrap:wrap;align-items:center;gap:3px 16px;color:#655b59;font:10px/1.5 var(--sans)}
.vector-key span{display:flex;align-items:center;gap:5px;white-space:nowrap}
.vector-key b{display:inline-block;width:12px;text-align:center;font-size:13px;color:#b18a38}
.vector-key-tip{text-shadow:0 0 3px #ffc34c}
.vector-key-trail{opacity:.65}
.vector-delay{margin-left:auto;color:#817572;font:9px var(--mono,monospace)}
.vector-details{margin-top:4px;color:#817572;font:9px/1.5 var(--sans)}
.vector-details summary{width:fit-content;cursor:pointer}
.vector-details summary:hover{color:#a52f40}
.vector-key-explanation{margin:7px 0;color:#756d6a;font:10px/1.5 var(--sans)}
#easiVectorReadout{height:4.5em;overflow:auto;color:#817572;font:9px/1.5 var(--mono,monospace);font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.easi-landmark-halos{filter:drop-shadow(0 0 6px #ffbd35)}
.map-card.bluetooth-mode #conductionNodes .conduction-node{fill:#e2bd51;stroke:#f5d77b;opacity:.55;filter:none;transition:r .08s linear,opacity .08s linear}
.map-card.bluetooth-mode #conductionNodes .conduction-node.vector-near{fill:#fffbd2;stroke:#ffd65c;stroke-width:2;opacity:calc(.55 + var(--vector-glow,0) * .45);filter:drop-shadow(0 0 5px #ffca43) drop-shadow(0 0 12px #ffb428)}
#easiVectorKey[hidden],#easiPathwayKey[hidden]{display:none}
.map-card.live-pathway-mode #map .pulse-track,.map-card.live-pathway-mode #map .pulse-dot{display:initial}
.map-card.live-pathway-mode #map .ectopic-route,.map-card.live-pathway-mode #map .pulse-dot:has(#pulsePVCLeft),.map-card.live-pathway-mode #map .pulse-dot:has(#pulsePVCRight){display:none}
.live-pathway-mode #easiVectorOverlay{opacity:.3}
.live-pathway-mode #easiTrail{stroke:#94d9e7;stroke-width:2;filter:none}
.live-pathway-mode #easiArrowLine{stroke:#a5dfed;stroke-width:2;filter:none}
.live-pathway-mode #easiArrow path{fill:#a5dfed}
.live-pathway-mode #easiVectorTip{fill:#d0f4fb;stroke:#96d9e7;filter:none}
.live-pathway-mode #easiTrailGlow,.live-pathway-mode .easi-landmark-halos,.live-pathway-mode #easiVectorOverlay .vector-axis,.live-pathway-mode #easiVectorOverlay > line:not(#easiArrowLine){display:none}
.vector-key .vector-key-overlay{color:#6aa9ba;opacity:.65}
.map-card.live-pathway-mode #map .pulse-dot:not(.buffered-dot){display:none}
.map-card.live-pathway-mode #map .signal-route-active{opacity:.8;filter:drop-shadow(0 0 4px #ffbe30)}

/* Match the demo's gold landmarks, with a clear ring at the current model stage. */
.live-node-halos{display:none;pointer-events:none}
.map-card.live-pathway-mode .live-node-halos{display:initial}
.live-node-halos circle{fill:#ffcf4a;fill-opacity:.12;stroke:#ffe88d;stroke-width:2;filter:drop-shadow(0 0 6px #ffc34c);transition:opacity .12s ease-out}
.map-card.live-pathway-mode #conductionNodes .conduction-node{fill:#ffe35d;stroke:#fff5a5;stroke-width:2;opacity:.85;filter:drop-shadow(0 0 4px #f5b82b)}
.map-card.live-pathway-mode #conductionNodes .conduction-node.vector-near{fill:#fffbd2;stroke:#fff5a5;opacity:1;filter:drop-shadow(0 0 7px #ffca43) drop-shadow(0 0 15px #ffb428)}

.live-route-nodes{display:none;pointer-events:none}
.map-card.live-pathway-mode .live-route-nodes{display:initial}
.live-route-nodes .route-landmark{fill:#ffe35d;stroke:#fff5a5;stroke-width:1.5;opacity:.65;filter:drop-shadow(0 0 3px #f5b82b);transition:opacity .1s,fill .1s}
.live-route-nodes .route-landmark-lit{fill:#fffbd2;opacity:1;filter:drop-shadow(0 0 6px #ffca43) drop-shadow(0 0 10px #ffb428)}

.heart-signal-layout{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(180px,1fr);gap:14px;align-items:start;min-width:0}
.heart-signal-layout>.card{min-width:0}
.heart-signal-layout .trace-head{flex-wrap:wrap;gap:7px;padding-bottom:12px}
.four-channel-mode .trace-tools{width:100%;justify-content:flex-end}
.four-channel-mode #traceLabel,.four-channel-mode .ecg,.four-channel-mode .trace-foot{display:none}
#fourChannelSignals[hidden]{display:none}
.channel-signal{margin:0 12px;border-top:1px solid #d7d0ca;padding:10px 0 4px}
.channel-signal-head{display:flex;gap:6px;align-items:baseline;font:9px var(--sans);color:#756d6a;flex-wrap:wrap}
.channel-signal-head b{color:#a52f40;font:600 10px var(--mono)}
.channel-signal-head small{margin-left:auto;font:8px var(--mono);font-variant-numeric:tabular-nums}
.channel-signal svg{display:block;width:100%;height:74px}
.channel-time{display:flex;justify-content:space-between;gap:4px;margin:4px 12px 12px;font:8px var(--mono);color:#756d6a}
.four-channel-mode .signal-status{margin:8px 12px;font-size:9px}
.four-channel-mode .source-note{font-size:8px;line-height:1.5}
@media(max-width:1100px){.layout{grid-template-columns:minmax(0,1fr)}.maincol,.sidecol{min-width:0}}
@media(max-width:700px){.heart-signal-layout{order:0;gap:10px;grid-template-columns:minmax(0,1.6fr) minmax(180px,1fr)}.heart-signal-layout .map-canvas{padding-left:30px;padding-right:0}.heart-signal-layout .map-info{font-size:8px;right:8px}.heart-signal-layout .map-info strong{overflow-wrap:anywhere}.heart-signal-layout .map-orientation{display:none}.heart-signal-layout .map-head{height:auto;min-height:53px;flex-wrap:wrap;gap:4px;padding:10px}.heart-signal-layout .view-label{font-size:8px}.heart-signal-layout .map-wrap{height:370px}.heart-signal-layout .vector-key{gap:4px;font-size:9px}.heart-signal-layout .vector-delay{margin-left:0}.channel-signal-head span{font-size:8px}.channel-time{font-size:7px}.channel-signal{margin:0 9px}.heart-signal-layout .trace-head{padding:12px 9px 8px}}
@media(max-width:480px){.heart-signal-layout{grid-template-columns:minmax(0,1fr)}.heart-signal-layout .map-wrap{height:390px}}

.channel-pulse-markers path{fill:none;stroke:#9b5864;stroke-width:1;stroke-dasharray:3 3;opacity:.8;vector-effect:non-scaling-stroke}
.pulse-marker-key{color:#9b5864}
