/* Electric light is a layer underneath each face, rather than a blue wash. */
/* Selection contract for every HTML control: a seated, blue-tinted face.
   The bright backing belongs to pointer hover, never persistent selection.
   Scientific diagram strokes, map risk colors and checkbox/switch glyphs keep
   their native meanings. Component rules retain their geometry and state owner. */
:root {
  --pra-selected-bg:linear-gradient(140deg,#354c5c,#293e4c);
  --pra-selected-base:#2e4352;
  --pra-selected-fg:#d5efff;
  --pra-selected-muted:#98bdcf;
  --pra-selected-rim:#7ab8dc38;
  --pra-selected-shadow:inset 0 0 0 1px var(--pra-selected-rim),inset 0 1px #c9e7fa12,0 1px 2px #0005;
  --pra-selected-row-shadow:inset 0 1px var(--pra-selected-rim),inset 0 -1px var(--pra-selected-rim);
  --pra-hover-lift:translate(-2px,-3px);
  --pra-row-hover-lift:translate(-1px,-2px);
  --pra-hover-shadow:inset 0 0 0 1px #7ab8dc38,inset 0 1px #d5e6ef0d,2px 5px 7px #0008;
  --pra-lift-gutter:6px;
}
/* Selection seats the face. Native state attributes/classes are authoritative;
   every lifted navigation tile and table row uses these hover values. */
:is(.pra-lift-tile,.pra-lift-row):is([aria-selected=true],[aria-current]:not([aria-current=false]),[aria-pressed=true],.on,.asset-selected,.cockpit-record-selected,.ac-sel,.mit-sel) {
  --pra-hover-lift:translate(0,0);
  --pra-row-hover-lift:translate(0,0);
  --pra-hover-light:0;
  --pra-hover-rim:var(--pra-selected-rim);
  --pra-hover-shadow:var(--pra-selected-shadow);
  --pra-row-hover-shadow:var(--pra-selected-row-shadow);
}
/* Shared click affordance; drawing canvases retain their grab/edit cursors. */
:is(button,[role="button"],[role="tab"],[role="combobox"]:not(input):not(textarea),summary,select):not(:disabled):not([aria-disabled="true"]) { cursor:pointer; }
input:is([type="checkbox"],[type="radio"]):enabled,
label:has(input:is([type="checkbox"],[type="radio"]):enabled) { cursor:pointer; }
#view-map.studio-workspace {
  --piercing-blue:#16b7ff; --piercing-core:#9be8ff;
  --focus-surface:linear-gradient(180deg,#181d20,#202629);
  --focus-treatment:inset 0 2px 4px #04090c99,inset 0 3px 8px #16b7ff2e,inset 3px 0 7px #16b7ff17,inset -3px 0 7px #16b7ff17;
}
#view-map.studio-workspace[data-focus-style="light"] {
  --focus-treatment:inset 0 1px 2px #000c,inset 2px 0 4px #16b7ffd9,inset -2px 0 4px #16b7ffd9,inset 0 -1px 1px #9be8ff80;
}
#view-map.studio-workspace[data-focus-style="corners"] {
  --focus-treatment:inset 0 2px 5px #0009,0 1px #d7e3e312;
  --focus-surface:
    linear-gradient(#69d5ff,#69d5ff) left 11px top 7px/7px 1px no-repeat,
    linear-gradient(#16b7ff,#16b7ff) left 11px top 7px/1px 6px no-repeat,
    linear-gradient(#69d5ff,#69d5ff) right 11px top 7px/7px 1px no-repeat,
    linear-gradient(#16b7ff,#16b7ff) right 11px top 7px/1px 6px no-repeat,
    linear-gradient(#16b7ff,#16b7ff) left 11px bottom 7px/7px 1px no-repeat,
    linear-gradient(#16b7ff,#16b7ff) left 11px bottom 7px/1px 6px no-repeat,
    linear-gradient(#16b7ff,#16b7ff) right 11px bottom 7px/7px 1px no-repeat,
    linear-gradient(#16b7ff,#16b7ff) right 11px bottom 7px/1px 6px no-repeat,
    linear-gradient(180deg,#181d20,#202629);
}
#view-map.studio-workspace .studio-command .studio-scope-picker .studio-console-select:is(:focus-within,.is-open,.pra-focus-preview),
#view-map.studio-workspace :is(.studio-search-box,.pf-find-row,.pra-register-search):is(:focus-within,.pra-focus-preview),
#view-map.studio-workspace .pra-register .pra-register-search:is(:focus-within,.pra-focus-preview),
#view-map.studio-workspace .pra-register .pra-register-type-trigger:is(:focus-visible,[aria-expanded=true],.pra-focus-preview) {
  outline:none; border-color:#10181d; background:var(--focus-surface); box-shadow:var(--focus-treatment);
}
#view-map.studio-workspace :is(.studio-tree,.pf-side,.studio-camera-tools,.studio-view-toolbar,.pra-register) :is(button,summary):focus-visible {
  outline:none; box-shadow:var(--focus-treatment);
}
#view-map.studio-workspace .studio-tree .studio-all-stations:focus-visible {
  outline:none; outline-offset:0; border-radius:7px; color:#d5e2eb;
  background:linear-gradient(180deg,#1b2226,#252e33); box-shadow:var(--focus-treatment);
}
#view-map.studio-workspace .pra-register #pf-at-lines:focus-visible { outline:none; border-color:var(--piercing-blue); box-shadow:0 0 0 2px #142027,0 0 0 3px #16b7ff; }
#view-map.studio-workspace #pf-legend .pf-legend-toggle:hover { background:linear-gradient(160deg,#454b4e,#343c40); }
#view-map.studio-workspace #pf-legend .pf-legend-toggle:active { background:#2d3438; }

/* Faces move; the original button remains a stationary hit target. The slower
   return lets previously hovered rows settle in sequence behind the pointer.
   Scroll trays reserve --pra-lift-gutter inside their clipping boundary. */
#view-map.studio-workspace :is(.studio-station-row,.studio-tree-node).pra-lift-tile {
  position:relative; isolation:isolate; display:block; padding:0; border:0;
  background:transparent; box-shadow:none; overflow:visible; z-index:0;
}
#view-map.studio-workspace .pra-lift-tile::after {
  content:''; position:absolute; inset:1px; z-index:0; pointer-events:none;
  border-radius:inherit; background:var(--piercing-blue); opacity:0;
  box-shadow:0 0 7px #16b7ff55; transition:opacity .58s .09s ease;
}
#view-map.studio-workspace .pra-lift-face {
  position:relative; z-index:1; display:flex; align-items:center; gap:9px; width:100%;
  min-height:inherit; padding:8px 10px; border:1px solid transparent; border-radius:inherit;
  background:linear-gradient(155deg,#2b3135,#252c30); color:inherit;
  transform:translate(0,0); transition:transform .58s .09s cubic-bezier(.3,0,.25,1),box-shadow .58s .09s ease,border-color .3s;
}
#view-map.studio-workspace .studio-station-row>.pra-lift-face { justify-content:space-between; min-height:57px; }
#view-map.studio-workspace .studio-tree-node>.pra-lift-face { min-height:34px; padding:7px 10px; }
#view-map.studio-workspace .studio-station-row { margin:3px 0; }
#view-map.studio-workspace .studio-tree-node[aria-current=true]>.pra-lift-face {
  color:var(--pra-selected-fg); border-color:var(--pra-selected-rim); background:var(--pra-selected-bg);
  box-shadow:var(--pra-selected-shadow);
}
#view-map.studio-workspace .pra-lift-tile:focus-visible { box-shadow:none; }
#view-map.studio-workspace .pra-lift-tile:focus-visible>.pra-lift-face { box-shadow:var(--focus-treatment); }

/* The drawer body is a tray of contiguous row faces. All ten cells keep their
   real table columns; the light is revealed only along the outer row edges. */
#view-map.studio-workspace .pra-register .pf-at-wrap {
  padding:0 14px 7px; background:linear-gradient(130deg,#181f23,#1d252a);
  border-top:1px solid #10181d; box-shadow:inset 0 3px 6px #0004;
}
#view-map.studio-workspace .pra-register table.pf-at { border-collapse:separate; border-spacing:0; }
#view-map.studio-workspace .pra-register table.pf-at thead th {
  height:37px; padding-inline:14px; background:linear-gradient(#30373b,#252d32);
  border-bottom:1px solid #131b20; box-shadow:inset 0 1px #d7e4eb09,0 2px 3px #0004;
}
#view-map.studio-workspace .pra-register table.pf-at tbody tr.pra-lift-row,
#view-map.studio-workspace .pra-register table.pf-at tbody tr.pra-lift-row:is(:hover,.asset-selected) { position:relative; isolation:isolate; background:transparent; }
#view-map.studio-workspace .pra-register table.pf-at tbody tr.pra-lift-row>:is(td,th) {
  position:relative; height:50px; padding:0; border:0; background:transparent; box-shadow:none;
}
/* Generated content on a table row can create an anonymous extra column in
   fixed-layout tables, even when positioned absolutely. Seat the light inside
   the real cells instead, beneath their contiguous moving faces. */
#view-map.studio-workspace .pra-lift-row::after { content:none; }
#view-map.studio-workspace .pra-register table.pf-at .pra-lift-row>:is(td,th)::before {
  content:''; position:absolute; inset:3px 0; z-index:0; background:var(--piercing-blue); opacity:0;
  pointer-events:none; box-shadow:0 0 3px #16b7ff22; transition:opacity .58s .09s ease;
}
#view-map.studio-workspace .pra-register table.pf-at .pra-lift-row>:first-child::before { border-radius:7px 0 0 7px; }
#view-map.studio-workspace .pra-register table.pf-at .pra-lift-row>:last-child::before { border-radius:0 7px 7px 0; }
#view-map.studio-workspace .pra-row-face {
  /* A one-pixel overlap prevents fractional column edges exposing the backing. */
  position:relative; z-index:1; display:grid; align-content:center; width:calc(100% + 1px); height:44px;
  padding:0 14px; border-top:1px solid #bdd9e30b; border-bottom:1px solid #0c131857;
  background:linear-gradient(160deg,#2a3237,#252d32); color:inherit;
  transform:translate(0,0); transition:transform .58s .09s cubic-bezier(.3,0,.25,1),box-shadow .58s .09s ease;
}
#view-map.studio-workspace .pra-lift-row>:first-child>.pra-row-face { border-radius:7px 0 0 7px; }
#view-map.studio-workspace .pra-lift-row>:last-child>.pra-row-face { width:100%; border-radius:0 7px 7px 0; }
#view-map.studio-workspace .pra-register table.pf-at tbody tr.asset-selected .pra-row-face { background:var(--pra-selected-bg); color:var(--pra-selected-fg); box-shadow:var(--pra-selected-row-shadow); }
#view-map.studio-workspace .pra-register table.pf-at tbody tr.asset-selected>:first-child>.pra-row-face { box-shadow:var(--pra-selected-row-shadow),inset 1px 0 var(--pra-selected-rim); }
#view-map.studio-workspace .pra-register table.pf-at tbody tr.asset-selected>:last-child>.pra-row-face { box-shadow:var(--pra-selected-row-shadow),inset -1px 0 var(--pra-selected-rim); }
#view-map.studio-workspace .pra-register table.pf-at tbody tr:focus-visible { outline:none; }
#view-map.studio-workspace .pra-register table.pf-at tbody tr:focus-visible .pra-row-face { box-shadow:inset 0 -1px var(--piercing-blue),inset 0 1px var(--piercing-blue); }
#view-map.studio-workspace .pra-register .pra-risk-amount { margin-top:3px; font-size:12px; }
#view-map.studio-workspace .pra-register .pra-risk-track { height:2px; margin-block:4px 3px; width:70px; }
#view-map.studio-workspace .asset-selected .pra-risk-track>i { background:var(--piercing-blue); }
@media(hover:hover) and (pointer:fine) {
  #view-map.studio-workspace .pra-lift-tile:hover { z-index:2; }
  #view-map.studio-workspace .pra-lift-tile:hover::after,
  #view-map.studio-workspace .pra-register table.pf-at .pra-lift-row:hover>:is(td,th)::before { opacity:var(--pra-hover-light,1); transition:opacity .12s ease; }
  #view-map.studio-workspace .pra-lift-tile:hover>.pra-lift-face {
    transform:var(--pra-hover-lift); border-color:var(--pra-hover-rim,#a8d8f026);
    box-shadow:var(--pra-hover-shadow); transition:transform .15s cubic-bezier(.16,.8,.25,1),box-shadow .15s ease,border-color .15s;
  }
  #view-map.studio-workspace .pra-lift-row:hover .pra-row-face {
    transform:var(--pra-row-hover-lift); box-shadow:var(--pra-row-hover-shadow,none);
    transition:transform .15s cubic-bezier(.16,.8,.25,1),box-shadow .15s ease;
  }
}

/* Temporary comparison controls appear only on ?review=interactions. */
.pra-interaction-review {
  position:absolute; top:calc(var(--studio-command-h,86px) + 10px); left:50%; transform:translateX(-50%);
  z-index:1900; display:grid; grid-template-columns:auto 1fr 18px; gap:6px 12px; align-items:center;
  width:490px; max-width:calc(100% - 32px); padding:6px 10px; border:1px solid #10191e; border-radius:13px;
  background:linear-gradient(150deg,#353e43fa,#252e34fa); box-shadow:inset 0 1px #d6e8f018,0 3px 8px #0009;
  color:#bdced9; font:11px var(--sans);
}
.pra-interaction-review>strong { font-size:10px; font-weight:500; color:#90a8b7; }
.pra-interaction-review>[role=group] { display:flex; gap:3px; padding:3px; border-radius:8px; background:#151f25; box-shadow:inset 0 2px 4px #0007; }
.pra-interaction-review button { min-height:26px; padding:4px 7px; border:0; border-radius:6px; background:transparent; color:#93acbd; font:10px var(--sans); cursor:pointer; }
.pra-interaction-review button[aria-pressed=true] { color:var(--pra-selected-fg); background:var(--pra-selected-bg); box-shadow:var(--pra-selected-shadow); }
.pra-interaction-review button:focus-visible { outline:1px solid var(--piercing-blue); outline-offset:1px; }
.pra-interaction-review>small { display:none; grid-column:2; font-size:9px; color:#7793a4; }
.pra-interaction-review>.pra-review-close { grid-column:3; grid-row:1; width:20px; min-width:20px; padding:0; font-size:19px; }
@media(max-width:860px) {
  .pra-interaction-review { top:calc(var(--studio-command-h,136px) + 66px); width:calc(100% - 24px); max-width:500px; gap:5px 8px; grid-template-columns:1fr 18px; }
  .pra-interaction-review>strong { grid-column:1; }
  .pra-interaction-review>[role=group] { grid-column:1/-1; grid-row:2; }
  .pra-interaction-review>[role=group]>button { flex:1; }
  .pra-interaction-review>small { display:block; grid-column:1/-1; }
  .pra-interaction-review>.pra-review-close { grid-column:2; }
  #view-map.studio-workspace .pra-register .pf-at-wrap { padding-inline:8px; }
  #view-map.studio-workspace .pra-row-face { padding-inline:12px; }
}
@media(prefers-reduced-motion:reduce) {
  .pra-lift-tile>.pra-lift-face,.pra-lift-row .pra-row-face { transform:none!important; transition:none!important; }
  #view-map.studio-workspace :is(.pra-lift-face,.pra-row-face),
  #view-map.studio-workspace .pra-lift-tile::after,
  #view-map.studio-workspace .pra-register table.pf-at .pra-lift-row>:is(td,th)::before { transition:none; }
  #view-map.studio-workspace .pra-lift-tile:hover>.pra-lift-face { transform:none; box-shadow:var(--pra-hover-shadow); }
  #view-map.studio-workspace .pra-lift-row:hover .pra-row-face { transform:none; box-shadow:var(--pra-row-hover-shadow,inset 0 -1px var(--piercing-blue)); }
}
