#dialog[data-kind="probe-lab"] { width:min(820px,calc(100% - var(--phone-left,14px) - var(--phone-right,14px))); }
.probe-shell { --paper:#15283b; --ink:#324151; --tint:#355b65; color:var(--ink); }
.probe-head { display:grid; grid-template-columns:auto 1fr; align-items:center; gap:14px; margin-right:52px; }
.probe-head #dialog-title { margin:0; white-space:nowrap; }
.probe-cases { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:5px; }
.probe-cases button,.probe-inputs button {
  min-width:0; min-height:44px; padding:4px; color:#374454; border:1px solid #a69bab; border-radius:8px; background:#fff8ee;
  font-size:clamp(11px,1.65vw,14px); font-weight:850; line-height:1.15;
}
.probe-cases button[aria-pressed="true"] { background:#244553; border-color:#183640; color:#fff7df; }
.probe-cases button i { margin-left:3px; font-weight:950; color:#327666; font-style:normal; }
.probe-cases button[aria-pressed="true"] i { color:#a2f1db; }
#dialog .probe-brief { margin:8px 0; color:#465764; line-height:1.35; }
.probe-layout {
  display:grid; align-items:start; grid-template-columns:minmax(160px,.75fr) minmax(0,1.25fr); gap:13px;
}
.probe-layout section { min-width:0; }
.probe-layout section > header {
  display:flex; flex-wrap:wrap; align-items:baseline; justify-content:space-between;
  gap:3px 7px; color:#314b57; font-size:14px; font-weight:850; margin-bottom:5px;
}
.probe-layout header span { color:#516172; font-size:11px; font-weight:850; font-variant-numeric:tabular-nums; }
.probe-board {
  position:relative; isolation:isolate; overflow:hidden; aspect-ratio:1; width:100%; max-width:280px; margin-inline:auto;
  border:2px solid #58647d; border-radius:12px; color:#d2e6ef;
  background:radial-gradient(ellipse at center,#253a54 0%,var(--paper) 76%); box-shadow:0 3px 0 #31425280;
}
.probe-board::before {
  content:""; inset:0; position:absolute;
  background-image:linear-gradient(90deg,#759eb94a 1px,transparent 1px),linear-gradient(#759eb94a 1px,transparent 1px);
  background-size:calc(100% / var(--cols)) calc(100% / var(--rows));
}
.probe-board-north { position:absolute; font-size:10px; top:4px; left:6px; opacity:.8; }
.probe-terminal,.probe-screen,.probe-socket { position:absolute; translate:-50% -50%; }
.probe-terminal {
  color:#d8ecf5; background:#2b495d; border:1px solid #abd3e0; border-radius:4px; font-size:clamp(8px,2vw,12px);
  font-style:normal; padding:2px; font-weight:800; white-space:nowrap;
}
.probe-terminal[data-signal="entry"],.probe-terminal[data-signal="return"] { color:#372937; background:#ffe29b;border-color:#fff2c3; }
.probe-terminal[data-signal="exit"] { color:#1b3941; background:#9fead9; border-color:#bdfde8; }
.probe-terminal { z-index:3; }
.probe-terminal[data-preview] { outline:2px dashed #e1c7ff; outline-offset:1px; }
.probe-draft-ray { position:absolute; z-index:2; inset:0; width:100%; height:100%; pointer-events:none; }
.probe-draft-ray path { fill:none; stroke:#e9c8ff; stroke-width:2.4; stroke-linecap:round; stroke-linejoin:round; stroke-dasharray:3 4; vector-effect:non-scaling-stroke; }
.probe-ray-key { display:inline-block; width:15px; height:0; border-top:2px dashed #795d8b; vertical-align:middle; }
.probe-screen { width:13%; height:9%; border:1px solid #e4c398; border-radius:3px; background:repeating-linear-gradient(135deg,#bd8b61 0 4px,#5f4a50 4px 8px); }
.probe-socket {
  z-index:1; display:grid; place-items:center; width:44px; height:44px; border:1px solid #9cb9c9;
  border-radius:10px; background:#1f3b50; color:#f9eadc; padding:2px; touch-action:manipulation;
}
.probe-socket span { position:absolute; top:2px; left:4px; font:900 11px/1 system-ui,sans-serif; }
.probe-socket:enabled:hover { border-color:#f9de8c; background:#31546b; }
.probe-socket:disabled { opacity:.9; }
.probe-empty { width:13px;height:13px;border:1px dashed #a8bbc8;rotate:45deg; }
.probe-mirror {
  width:28px;height:6px;rotate:-45deg; border:1px solid #d9f6f6;border-radius:2px;
  background:linear-gradient(#f4fffb,#7eb4c8 72%,#436585);box-shadow:0 0 8px #6ce6e66b;
}
.probe-socket[data-turn="1"] .probe-mirror { rotate:45deg; }
.probe-inputs { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:4px; }
.probe-inputs > div { display:grid; gap:3px; grid-template-columns:repeat(2,minmax(0,1fr)); }
.probe-inputs button { display:grid; justify-items:center; align-content:center; gap:3px; touch-action:manipulation; }
.probe-inputs button small { color:#526368; font-size:10px; line-height:1; font-weight:700; }
.probe-inputs button[data-state="useful"] { background:#f6edd0; color:#503e38; border-color:#b49a69; }
.probe-inputs button[data-state="useful"] small { color:#705332; }
.probe-inputs button[data-state="tested"] { background:#e4eef0; border-color:#9cbdc1; }
.probe-inputs button:enabled:hover { border-color:#447581; }
.probe-ledger { position:relative; margin-top:7px; border:1px solid #b0c3c6; border-radius:8px; overflow:auto; max-height:146px; background:#f4f7f1; }
.probe-ledger table { width:100%; border-spacing:0; font-size:12px; text-align:left; }
.probe-ledger thead { position:sticky; top:0; z-index:1; color:#47616c; background:#e8efeb; }
.probe-ledger :is(th,td) { padding:3px 9px; vertical-align:middle; }
.probe-ledger tbody th { color:#314555; white-space:nowrap; }
.probe-ledger tbody tr:nth-child(even) { background:#e9f1ef; }
.probe-ledger tbody tr[data-selected] { background:#e2f0e7; }
.probe-ledger small { margin-left:5px; font-weight:700; color:#547080; }
.probe-ledger td[data-conflict] { color:#882845; font-weight:900; }
.probe-ledger th:has(button) { padding:0; }
.probe-ledger button {
  display:inline-flex; align-items:center; justify-content:center; gap:4px; min-width:44px; min-height:44px;
  padding:3px 8px; color:#35525a; background:transparent; border:1px solid transparent; border-radius:5px;
  box-shadow:none; font-size:12px; line-height:1.1; touch-action:manipulation;
}
.probe-ledger button small { margin:0; font-size:10px; }
.probe-ledger button[aria-pressed="true"] { color:#174b43; background:#d7ebe3; border-color:#72998a; }
.probe-shell :is(.probe-inputs,.probe-ledger) button:focus-visible { outline:2px solid #695489; outline-offset:-2px; }
.probe-comparison {
  display:grid; grid-template-columns:auto minmax(0,1fr) minmax(0,1fr) auto; align-items:center;
  gap:5px; min-height:36px; margin-top:7px; padding:4px 7px;
  border:1px solid #a6bbb0; border-radius:7px; background:#e5efe7; color:#304f52; font-size:12px;
}
.probe-comparison > b { white-space:nowrap; }
.probe-comparison > span { display:flex; align-items:baseline; justify-content:center; flex-wrap:wrap; gap:1px 4px; }
.probe-comparison small { font-size:10px; font-weight:750; color:#536762; }
.probe-comparison .probe-predicted { color:#674d79; }
.probe-comparison .probe-predicted small { color:#765e81; }
.probe-comparison > i { font-size:11px; font-weight:850; font-style:normal; color:#365f51; }
.probe-comparison[data-match="conflict"] { background:#fbebe0; border-color:#bf947f; }
.probe-comparison[data-match="conflict"] > i { color:#883e42; }
.probe-comparison[data-match="sample"] > i { color:#5d6666; }
#dialog[data-kind="probe-lab"] .dialog-close { min-width:44px; min-height:44px; }
.probe-actions { display:flex; align-items:center; justify-content:space-between; gap:7px; margin-top:8px; }
#dialog .probe-actions p,#dialog .probe-paper p { font-size:11px; margin:0; color:#405865; line-height:1.35; }
#dialog .probe-paper p { text-align:center; margin-top:6px; }
.probe-actions button { min-height:44px; white-space:nowrap; }
.probe-profile-switch {
  display:inline-flex; padding:2px; border:1px solid #97aaa5; border-radius:9px; background:#e2e8dd;
}
.probe-profile-switch button {
  display:inline-flex; align-items:center; justify-content:center; gap:5px; min-width:64px; min-height:44px;
  padding:2px 7px; border:1px solid transparent; border-radius:6px; background:transparent;
  color:#49615c; font-size:13px; font-weight:800; touch-action:manipulation;
}
.probe-profile-switch button[aria-pressed="true"] {
  color:#fdf4d9; background:#315452; border-color:#233e3d; box-shadow:0 1px 2px #142d342e;
}
.probe-switch-icon {
  width:20px; height:9px; position:relative; border:1px solid currentColor; border-radius:3px;
}
.probe-switch-icon::before {
  content:""; position:absolute; top:-3px; left:1px; width:7px; height:12px; border-radius:2px;
  background:#b99063; border:1px solid #765f4a;
}
[data-profile="east"] > .probe-switch-icon::before { left:auto; right:1px; }
.probe-profile-switch [aria-pressed="true"] .probe-switch-icon::before { background:#ffcf83; border-color:#765534; }
.probe-layout .probe-test:has(.probe-profile-switch) > header { align-items:center; }
.probe-board .probe-shutter-rail {
  position:absolute; translate:-50% -50%; height:5px; border-block:1px solid #8fa3aa;
  background:#10202d; pointer-events:none;
}
.probe-shutter-rail::before,.probe-shutter-rail::after {
  content:""; position:absolute; top:50%; translate:-50% -50%; width:7px; height:10px;
  border:1px solid #a1afb0; border-radius:2px; background:#465767;
}
.probe-shutter-rail::before { left:0; }
.probe-shutter-rail::after { left:100%; }
.probe-board .probe-shutter {
  width:clamp(17px,11%,29px); height:clamp(10px,6%,16px); border-color:#ffe4a8; border-radius:3px;
  background:linear-gradient(90deg,#e8b274 0 20%,#966347 20% 28%,#e8b274 28% 45%,#966347 45% 53%,#e8b274 53% 70%,#966347 70% 78%,#e8b274 78%);
  box-shadow:0 2px 0 #342c31;
}
.probe-shell[data-profile] .probe-board {
  border-color:#405a60; background:radial-gradient(ellipse at 48% 35%,#31515c,var(--paper) 82%);
}
.probe-await { grid-template-columns:auto 1fr; border-style:dashed; background:#edf1e9; }
.probe-comparison.probe-await > span { justify-content:flex-start; }
.probe-shell[data-profile] .probe-ledger button small {
  padding:2px 4px; border-radius:3px; background:#e7e2cb; color:#665434; white-space:nowrap;
}
.probe-shell[data-profile] .probe-ledger [aria-pressed="true"] small { background:#c9dbcb; color:#355847; }
.probe-shell .probe-profile-switch button:focus-visible { outline:2px solid #695489; outline-offset:-2px; }
@media (orientation:landscape) and (max-height:445px) {
  .probe-head #dialog-title { font-size:21px; }
  #dialog[data-kind="probe-lab"] .dialog-content { padding:9px 15px; }
  #dialog .probe-brief { margin:5px 0; }
  .probe-layout { grid-template-columns:minmax(165px,.58fr) minmax(0,1.42fr); gap:10px; }
  .probe-layout section > header { margin-bottom:4px; }
  .probe-board { max-width:166px; }
  #dialog .probe-paper p { margin-top:3px; }
  .probe-comparison { margin-top:4px; min-height:29px; padding:2px 5px; }
  .probe-ledger { max-height:53px; margin-top:3px; padding:2px; }
  .probe-ledger table { display:block; }
  .probe-ledger thead,.probe-ledger td { display:none; }
  .probe-ledger tbody { display:grid; grid-template-columns:repeat(auto-fill,minmax(44px,1fr)); gap:2px; }
  .probe-ledger tbody tr,.probe-ledger tbody th { display:block; width:100%; }
  .probe-ledger tbody tr:nth-child(n) { background:transparent; }
  .probe-ledger button { width:100%; display:grid; gap:2px; padding:2px; background:#e4eeea; border-color:#abbdb5; }
  .probe-ledger button[aria-pressed="true"] { background:#d5e9df; border-color:#618d7d; }
  .probe-actions { margin-top:4px; }
}
@media (orientation:landscape) and (max-height:365px) and (min-width:600px) {
  #dialog[data-kind="probe-lab"] {
    inset:max(2px,env(safe-area-inset-top)) var(--phone-right,8px) max(3px,env(safe-area-inset-bottom)) var(--phone-left,8px);
    max-height:calc(100dvh - max(2px,env(safe-area-inset-top)) - max(3px,env(safe-area-inset-bottom)));
    border-radius:12px;
  }
  #dialog[data-kind="probe-lab"] .dialog-content { padding:3px 7px; }
  #dialog[data-kind="probe-lab"] .dialog-close { top:3px; right:5px; }
  .probe-head { gap:8px; margin-right:48px; }
  .probe-cases { gap:3px; }
  #dialog .probe-brief { font-size:11px; line-height:1.2; margin:2px 0; }
  .probe-layout { grid-template-columns:166px minmax(0,1fr); gap:8px; }
  .probe-profile-switch { padding:0; border:0; }
  .probe-profile-switch button { min-width:53px; padding-inline:3px; }
  .probe-test:has(.probe-profile-switch) { display:grid; gap:2px; }
  .probe-test:has(.probe-profile-switch) > :is(header,.probe-comparison,.probe-ledger,.probe-actions) { margin:0; }
  .probe-test:has(.probe-profile-switch) .probe-comparison { min-height:23px; font-size:11px; padding:1px 4px; }
  .probe-shell[data-profile] .probe-ledger { max-height:48px; padding:1px; }
  .probe-shell[data-profile] .probe-ledger button small { padding:0 3px; }
  .probe-inputs { gap:3px; }
  .probe-inputs > div { gap:2px; }
}
@media (orientation:landscape) and (max-height:445px) {
  /* The hit boxes stay 44px. Inset the drawn sockets so the screens between them remain visible. */
  .probe-socket, .probe-socket:enabled:hover { border:0; background:none; }
  .probe-socket::before {
    content:""; position:absolute; z-index:-1; inset:5px; border:1px solid #9cb9c9;
    border-radius:7px; background:#1f3b50;
  }
  .probe-socket:enabled:hover::before { border-color:#f9de8c; background:#31546b; }
  .probe-socket span { top:6px; left:8px; font-size:9px; }
  .probe-mirror { width:23px; height:5px; }
  .probe-empty { width:9px; height:9px; }
}
@media (max-width:585px) {
  .probe-head { grid-template-columns:1fr; gap:7px; margin-right:0; }
  .probe-head #dialog-title { margin-right:44px; }
  .probe-layout { grid-template-columns:1fr; gap:12px; }
  .probe-board { max-width:218px; }
  .probe-inputs { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
