/* The calibrated axes and the stick photograph share a single coordinate system. */
.bench.calibrating > :is(h1,.bench-back,#live-desk,#connection,#pickers,#dual-connect,#hid-help) { display:none; }
#cal-view {
  position:fixed; inset:0; width:100%; height:100dvh; max-width:none; max-height:none;
  margin:0; padding:clamp(14px,4vh,44px) clamp(16px,4vw,52px);
  border:0; background:transparent; color:#edf3fa; overflow:auto; overscroll-behavior:contain;
}
#cal-view::backdrop { background:rgba(3,6,10,.94); backdrop-filter:blur(7px); }
body:has(#cal-view[open]) { overflow:hidden; }
.cal-shell {
  width:min(100%,960px); min-height:100%; margin:auto;
  display:flex; flex-direction:column; --stick-accent:#9de4ff;
}
.cal-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
#cal-signal { font-size:14px; font-weight:650; color:#a4c3d5; }
#cal-title { margin:12px 0 18px; font-size:clamp(30px,4vw,48px); letter-spacing:-.045em; }
#cal-title:focus:not(:focus-visible) { outline:none; }
#cal-view:not([data-phase=connect]) #cal-title { font-size:clamp(21px,2.2vw,30px); margin:6px 0 10px; }
#cal-view .stages { display:grid; grid-auto-flow:column; grid-auto-columns:minmax(0,1fr); list-style:none; gap:6px; margin:22px 0 0; padding:0; }
#cal-view .stages li { padding:9px 3px; border-top:3px solid #364756; color:#b1c3d0; font-size:14px; }
#cal-view .stages .completed { border-color:#487782; }
#cal-view .stages li[aria-current] { border-color:#6ad7ff; color:white; font-weight:720; }
#cal-view .guide { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.15fr); align-items:center; padding:12px 0; margin:0; gap:clamp(12px,3vw,40px); border:0; background:transparent; }
#cal-view #task { font-size:clamp(26px,3.4vw,43px); letter-spacing:-.045em; line-height:1.07; margin:0 0 12px; }
#cal-view .guide { flex:1; align-content:center; }
.cal-copy { min-width:0; border-inline-start:2px solid #466b81; padding-inline-start:18px; }
.cal-copy p { max-width:42ch; }
#cal-view #hint { line-height:1.5; margin:0; }
.cal #notice { margin:12px 0 0; font-size:15px; color:#ffe2a0; }
.cal #notice:empty { display:none; }
.cal-note {
  position:absolute; left:50%; top:12%; z-index:4; pointer-events:none;
  transform:translate(-50%,-50%); white-space:nowrap;
}
.cal-note .press-note {
  position:relative; display:inline-block; transform:none;
  font-size:clamp(13px,1.55vw,19px); animation:stick-message 1.15s ease-out both;
}
@media(prefers-reduced-motion:reduce){ .cal-note .press-note { animation-name:press-still; } }
.cal-overview { display:block; width:min(100%,460px); height:auto; margin:auto; }
#cal-side-guide { margin:0 0 14px; }
#cal-side-guide .stick-sides { margin:0 0 6px; }
#cal-laps { color:#bdd1df; font-size:14px; font-variant-numeric:tabular-nums; }
#cal-visuals { min-width:0; }
#cal-view[data-phase="centerSample"] #cal-visuals { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; }
#cal-view[data-phase="centerSample"] #cal-side-guide .stick-sides,
#cal-view[data-phase="adjustRange"] #cal-laps { display:none; }
#cal-view[data-phase="centerSample"] #cal-visuals .stick-instrument { min-height:0; }
#cal-view:is([data-phase="centerSample"],[data-phase="adjustRange"]) #task { min-block-size:2.3em; margin-bottom:0; }
#cal-view .cal-result.pending-side { opacity:.5; }
#axes-live .stick-feedback { color:#e1f6ff; }
#cal-view:is([data-phase=centerSample],[data-phase=adjustRange]) .cal-copy { border:0; padding:0; }
#cal-view .cal-actions { margin:12px 0 0; padding-top:14px; border-top:1px solid #344c5c; gap:10px; }
#cal-view :is(#act,#confirm-save) { margin-left:auto; order:2; }
#cal-view button { min-height:44px; }
#cal-view[data-phase=closed] .stages { visibility:hidden; }
@media (max-width:650px) {
  #cal-view .guide { grid-template-columns:1fr; gap:7px; padding:14px 0; }
  .cal-overview { max-width:370px; }
  #cal-view[data-phase=adjustRange] .guide { grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr); gap:8px; }
  #cal-view[data-phase=centerSample] .guide { grid-template-columns:1fr; gap:12px; }
  #cal-view:is([data-phase=centerSample],[data-phase=adjustRange]) #task { font-size:clamp(21px,5vw,28px); }
  #cal-view .guide { row-gap:18px; }
  #cal-view .stages { margin-top:14px; }
  #cal-view .cal-actions button { font-size:14px; }
  .cal-copy { padding-inline-start:12px; }
  #cal-view .stages li { font-size:13px; }
  #cal-view .cal-actions { margin-top:5px; }
}
/* Use the same beveled actions as the rest of the site, including the two entry points. */
.bench .tool-actions .ecg-control, #cal-view .ecg-control {
  border:0; border-radius:0; background:transparent; min-height:46px; color:white;
  padding:10px 20px; margin-inline:12px;
}
#cal-view .cal-actions { align-items:center; }
#cal-view :is(#act,#confirm-save) { margin-inline-start:auto; }
#cal-view .cal-head button { font-size:14px; }
#cal-view .ecg-control:hover, .bench .tool-actions .ecg-control:hover { background:transparent; }
#cal-review { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.cal-result { min-width:0; position:relative; margin:0; text-align:center; }
.cal-result svg { display:block; width:100%; overflow:visible; }
.cal-field { fill:#1d2a36; }
.cal-sectors path { stroke:rgba(10,24,32,.45); stroke-width:.45; }
.cal-sectors .within,.cal-origin[data-state=within] { fill:#59d69c; }
.cal-sectors .over,.cal-origin[data-state=over] { fill:#ff746e; }
.cal-sectors .short { fill:#6a8192; }
.cal-limit,.cal-nominal { fill:none; stroke:#c9d6de; stroke-width:1; }
.cal-limit { stroke-dasharray:3 3; }
.cal-origin { fill:#101922; stroke:#e2f5ff; stroke-width:1.3; }
.cal-cursor { fill:#f6fdff; stroke:#152532; stroke-width:2; }
.cal-result .cal-note { top:32%; }
.cal-result figcaption { display:grid; gap:2px; margin-top:-6px; font-size:14px; color:#bdd0dc; }
.cal-result figcaption strong { font-size:17px; color:#eef7fe; }
#cal-key { display:flex; flex-wrap:wrap; gap:6px 14px; margin-top:14px; font-size:14px; color:#bfd1db; }
#cal-key span::before { content:""; display:inline-block; width:8px; height:8px; margin-right:6px; border-radius:50%; background:#708493; }
#cal-key span:first-child::before { background:#59d69c; }
#cal-key span:nth-child(2)::before { background:#ff746e; }
#cal-key details { flex-basis:100%; max-width:42ch; }
#cal-key summary { width:fit-content; cursor:pointer; }
@media(max-width:650px){
  #cal-view .cal-actions { justify-content:center; }
  #cal-view :is(#act,#confirm-save) { margin-inline:12px; }
}
@media(forced-colors:active){
  .bench .tool-actions .ecg-control, #cal-view .ecg-control { border:2px solid ButtonText; }
}

