/* instrument-ui.css (UI17 v2): the parts of the observation-instrument pass that are not the landscape console rails. Loads after console-rails.css, unlayered.
   1. HP / MP meters: the generated cap bitmap as a thin groove, a flat state fill, numbers beside it (never on it); no rounded glossy bar, no blinking.
   2. Portrait terminal: the message strip follows the glass's lower corners; the radio receiver sits in the terminal's display rectangle.
   3. Screen looks over menus and pages: a fine grain, a slow scan band and the glass curvature from the chosen look's strength (fx/overlay.js data-ui / data-ui-warp).
   4. Narrow item readers (the docked / portrait inspector): a compact head so the traits and numbers are in view; the body scrolls, 戻る stays in the head.
   5. Weapon traits as units: name + state, effect, numbers and its own 解放 key together.
   PS1 only; GB keeps its own sheet. */

/* ---------- 1. HP / MP meters (every PS1 HUD: portrait terminal, landscape overlay, console rails; all appearances) ---------- */
html[data-skin="ps1"] body .ui-hud .ui-gauge { --meter-fill: var(--ob-ink, #e8e2d4); }
html[data-skin="ps1"] body .ui-hud .ui-gauge[data-kind="mp"] { --meter-fill: var(--meter-mp, #7aa4d4); }
html[data-skin="ps1"] body .ui-hud .ui-gauge[data-low="true"] { --meter-fill: var(--nx-danger, #e2604c); }
html[data-skin="ps1"] body .ui-hud .ui-gauge__bar {
  box-sizing: border-box; height: 6px !important; min-height: 0 !important; overflow: hidden; border: 1px solid transparent !important; border-radius: 0 !important;
  background: none !important; box-shadow: none !important; border-image: url("../../../assets/ui/observer-2026-10-21/crail2-kbd.webp") 3 fill / 2px stretch !important;
}
html[data-skin="ps1"] body .ui-hud .ui-gauge[data-kind="mp"] .ui-gauge__bar { height: 5px !important; }
html[data-skin="ps1"] body .ui-hud .ui-gauge__fill {
  border-radius: 0 !important; background: var(--meter-fill) !important; box-shadow: none !important; -webkit-mask-image: none; mask-image: none; animation: none !important;
  transition: width calc(200ms * var(--menu-fx-k, 1)) linear;
}
html[data-skin="ps1"]:is([data-reduced-motion="1"], [data-menu-fx="0"]) body .ui-hud .ui-gauge__fill { transition: none; }
@media (prefers-reduced-motion: reduce) { html[data-skin="ps1"] body .ui-hud .ui-gauge__fill { transition: none; } }

/* ---------- 2. portrait terminal (scope and the wooden arcade alike) ---------- */
@media (orientation: portrait) {
  /* the strip ends in the same curve as the glass: its lower corners are clipped to the aperture's radius (clip-path keeps the opened history scrollable) */
  html[data-native-aperture="1"][data-native-frame]:not([data-inspect="1"]) body .ui-rail > .ui-log {
    border-radius: 0 0 var(--native-aperture-rb, 0px) var(--native-aperture-rb, 0px) !important;
    clip-path: inset(0 round 0 0 var(--native-aperture-rb, 0px) var(--native-aperture-rb, 0px));
  }
  /* the radio receiver is shown in the terminal's display rectangle (same rounded glass), never over the chassis or the keys. Oct23: a transparent layer
     takes every tap from the top of the screen down to the bottom of the glass (a tap there advances / skips as before, the field under it cannot fire);
     the key deck below stays live and is the call's keypad (renderer radioDeckAction: directions choose, centre / action decide, menu cancels) */
  html[data-skin="ps1"][data-native-frame] body .radio:not([hidden]) {
    inset: auto; left: var(--native-screen-x); top: var(--native-screen-y); width: var(--native-screen-w); height: var(--native-screen-h);
    background: var(--ob-void, #030705);
    box-sizing: border-box; padding: 4px; overflow: hidden; --rc-face: min(26vw, calc(var(--native-screen-h) * 0.26));
    border-radius: var(--native-aperture-r, 0px) var(--native-aperture-r, 0px) var(--native-aperture-rb, 0px) var(--native-aperture-rb, 0px);
  }
  html[data-skin="ps1"][data-native-frame] body .radio:not([hidden])::before { content: ""; position: fixed; inset: 0 0 auto 0; height: calc(var(--native-screen-y) + var(--native-screen-h)); z-index: -1; }
  /* while Liz chooses, the faces and the reception points shrink so the question list takes the glass */
  html[data-skin="ps1"][data-native-frame] body .radio[data-choosing="1"]:not([hidden]) { --rc-face: min(16vw, calc(var(--native-screen-h) * 0.14)); }
  html[data-skin="ps1"][data-native-frame] body .radio .radio__crt { width: 100%; max-height: 100%; overflow: hidden auto; overscroll-behavior: contain; }
}

/* ---------- 3. screen looks over menus, settings and pages (FxOverlay data-ui="1", strength = the view's existing 画面効果の強さ) ---------- */
.fx-ov > .fx-ov__ui { display: none; }
.fx-ov[data-ui="1"] > .fx-ov__ui {
  display: block; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen;
  overflow: hidden;
  opacity: 1;
}
/* Move a pre-painted grain sheet instead of repainting a viewport-sized
   background on every noise step. The rolling beam keeps its own layer. */
.fx-ov[data-ui="1"] > .fx-ov__ui::before {
  content: ""; position: absolute; inset: -100px; pointer-events: none; will-change: transform;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .62 0 0 0 0 .95 0 0 0 0 .72 0 0 0 1.4 -.55'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E") 0 0 / 160px 160px repeat;
  opacity: calc(0.07 * var(--fx-ui-k,0) * var(--menu-fx-noise-k,1));
  animation: fx-ui-grain 0.42s steps(3, end) infinite;
}
/* one soft band of the beam rolling down the glass, very faint (a few % at full strength), never a blink */
.fx-ov[data-ui="1"] > .fx-ov__ui::after {
  content: ""; position: absolute; left: 0; right: 0; top: -24%; height: 24%; mix-blend-mode: screen;
  background: linear-gradient(to bottom, transparent, rgb(190 255 214 / 0.55), transparent); opacity: calc(0.07 * var(--fx-ui-k,0) * 0.1 * var(--fx-ui-k,0) * var(--menu-fx-roll-k,1));
  animation: fx-ui-roll 11s linear infinite;
}
.fx-ov.fx-still > .fx-ov__ui::before, .fx-ov.fx-still > .fx-ov__ui::after { animation: none; }
html:is([data-reduced-motion="1"], [data-menu-fx="0"]) .fx-ov > .fx-ov__ui::before, html:is([data-reduced-motion="1"], [data-menu-fx="0"]) .fx-ov > .fx-ov__ui::after { animation: none; }
@media (prefers-reduced-motion: reduce) { .fx-ov > .fx-ov__ui::before, .fx-ov > .fx-ov__ui::after { animation: none; } }
@keyframes fx-ui-grain { 33% { transform: translate(37px, 61px); } 66% { transform: translate(83px, 19px); } 100% { transform: translate(11px, 97px); } }
@keyframes fx-ui-roll { to { translate: 0 520%; } }
/* Static tube edges follow the selected look, menu master and curvature level.
   The live text/scroll surface has no displacement filter; its hit areas stay exact. */
.fx-ui-glass { position: fixed; display: none; pointer-events: none; contain: strict; }
@supports (mask-image: url("")) or (-webkit-mask-image: url("")) {
  html[data-skin="ps1"][data-ui-warp="1"]:not([data-high-contrast="1"]) .fx-ui-glass[data-on="1"] { display: block; animation: fx-ui-glass-in var(--ob-t-l,0ms) ease-out backwards; }
}
@keyframes fx-ui-glass-in { from { opacity: 0; } }
html[data-skin="ps1"]:is([data-ui-theme="dark"],[data-ui-theme="light"]) { --fx-ui-bezel: #0c0d10; }
html[data-skin="ps1"][data-protagonist="elvi"]:is([data-ui-theme="dark"],[data-ui-theme="light"]) { --fx-ui-bezel: #030b07; }
html[data-skin="ps1"][data-ui-theme="console"] { --fx-ui-bezel: #020503; }
.fx-ui-glass > i { position: absolute; display: block; pointer-events: none; background: var(--fx-ui-bezel,#020503); -webkit-mask: var(--m) 0 0 / 100% 100% no-repeat; mask: var(--m) 0 0 / 100% 100% no-repeat; }
.fx-ui-glass__t { left: 0; right: 0; top: 0; height: var(--ui-glass-l); --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 0H100V100Q50 -100 0 100Z'/%3E%3C/svg%3E"); }
.fx-ui-glass__b { left: 0; right: 0; bottom: 0; height: var(--ui-glass-l); --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 100H100V0Q50 200 0 0Z'/%3E%3C/svg%3E"); }
.fx-ui-glass__l { left: 0; top: 0; bottom: 0; width: var(--ui-glass-l); --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 0V100H100Q-100 50 100 0Z'/%3E%3C/svg%3E"); }
.fx-ui-glass__r { right: 0; top: 0; bottom: 0; width: var(--ui-glass-l); --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M100 0V100H0Q200 50 0 0Z'/%3E%3C/svg%3E"); }

/* Keep every spell in the accessible list, but defer layout and paint for rows
   far outside its scrolling viewport. Browsers remember measured row heights. */
html[data-skin="ps1"] #sidebarList.ui-spell-rows > .ui-spell-row {
  content-visibility: auto;
  contain-intrinsic-block-size: auto 240px;
}
@media (orientation: portrait) {
  html[data-skin="ps1"] #sidebarList.ui-spell-rows > .ui-spell-row { contain-intrinsic-block-size: auto 360px; }
}
html[data-skin="ps1"] #sidebarList.ui-spell-rows[data-spell-display="compact"] > .ui-spell-row { contain-intrinsic-block-size: auto 120px; }

/* ---------- 4. narrow item readers: the docked inspector of the console rails (211-404px) and the portrait key-panel inspector (~350px) ---------- */
html[data-skin="ps1"] body #tapInspectPanel .inspect-body { container: inspect / inline-size; }
@container inspect (max-width: 360px) {
  .item-card .ic-hero { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: start; gap: 8px; padding-bottom: 8px; }
  .item-card .ic-hero > .ic-art { width: 32px !important; height: 32px !important; }
  .item-card .ic-name { font-size: 15px; line-height: 1.35; letter-spacing: 0; }
  .item-card .ic-meta { font-size: 11px; letter-spacing: 0; }
  .item-card .ic-body, .ic-body { gap: 8px; }
  .item-card .ic-stats, .ic-body .ic-stats { --ic-cols: 1; gap: 4px; }
  .ic-stat { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto; padding: 4px 6px; }
  .ic-stat__value { grid-column: auto; font-size: 15px; }
  .ic-stat > .ic-pips { grid-column: 1 / -1; }
  .ic-trait { padding: 6px 8px; }
  .ic-trait b { font-size: 13px; }
}

/* ---------- 5. weapon traits as units (itemCard.js traitHtml), menu and readers alike ----------
   Each trait reads as one block: its name with its state (ロック中) on the first line, its effect, its own numbers, and in the menu its own 解放 key at the
   block's foot (the same menu action as before; the bottom bar no longer repeats it). Blocks are parted by the generated hairline, not boxed. A locked
   trait's numbers are dimmed: they do not work until it is unlocked. The key is the menu's usual survey-point key, 44px tall. */
:root:root:root:root:root[data-skin="ps1"] body :is(#actionSidebar, #tapInspectPanel, .ui-record-popup) .ic-traits > .ic-trait + .ic-trait {
  margin-top: 2px; padding-top: 8px; background: var(--ob-hairline) center top / 100% 1px no-repeat;
}
html[data-skin="ps1"] body .ic-trait[data-locked] > p > b { display: inline; }
html[data-skin="ps1"] body .ic-trait__lock { display: inline-block; margin-left: 8px; color: var(--ob-ink-2, currentColor); font: 400 11px/1.5 var(--ff-ui); letter-spacing: 0.06em; white-space: nowrap; }
html[data-skin="ps1"] body .ic-trait[data-locked] > .ic-mods { opacity: 0.62; }
:root:root:root:root:root[data-skin="ps1"] body #actionSidebar .ic-trait > .ic-trait__unlock {
  grid-column: 1 / -1; justify-self: end; display: inline-flex; align-items: center; gap: 8px; width: auto; min-width: 112px; height: auto; min-height: 44px; margin: 2px 0 0;
  white-space: nowrap; overflow: visible;
}
:root:root:root:root:root[data-skin="ps1"] body #actionSidebar .ic-trait > .ic-trait__unlock .ui-btn__meta { display: inline; color: var(--ob-ink-2); font: 400 12px/1 var(--ff-num, inherit); }

/* ---------- 6. Oct23: a learned spell's two 1-SP traits in the book (menuView spellTraitPickHtml / spellTraitTagHtml) ----------
   詳細 rows: one block under the prose, parted by the generated hairline. The pair is two full-width keys stacked (one per line at every width, so a name
   never shares its line with a narrow column): line 1 = the name and, at the right end, its state (SP 1 / 選択済み / 選べない); line 2 = the effect.
   Correction: the key's survey point is the menu's own key lamp (skin-observer §2: the button background ring, lit when aria-pressed / controller-selected,
   dashed when disabled); this sheet adds no pseudo-element of its own and only moves that ring up beside the name line. Every child is a block of its
   own grid cell (no inherited ::before / float from wider menu rules). コンパクト rows carry only a short tag in the heading. GB keeps the shared structure. */
.ui-spell-traitpick { margin-top: 6px; padding-top: 6px; min-width: 0; }
.ui-spell-traitpick__lead { margin: 0 0 2px; font: 400 11px/1.4 var(--ff-ui); letter-spacing: 0.06em; opacity: 0.8; }
.ui-spell-traitpick__keys { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; min-width: 0; }
.ui-spell-traitpick .ui-spell-trait {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) max-content; grid-template-rows: auto auto; gap: 0 10px; align-items: baseline; justify-items: start;
  width: 100%; min-width: 0; height: auto; min-height: 44px; margin: 0; padding: 6px 8px 6px 30px; box-sizing: border-box;
  text-align: left; white-space: normal; font: inherit; line-height: 1.4; color: inherit; cursor: pointer;
}
.ui-spell-traitpick .ui-spell-trait:disabled { cursor: default; }
.ui-spell-traitpick .ui-spell-trait > * { display: block; float: none; position: static; min-width: 0; margin: 0; padding: 0; }
.ui-spell-traitpick .ui-spell-trait > *::before, .ui-spell-traitpick .ui-spell-trait > *::after { content: none; display: none; }
.ui-spell-traitpick .ui-spell-trait__name { grid-column: 1; grid-row: 1; font-weight: 700; font-size: 14px; word-break: normal; overflow-wrap: anywhere; }
.ui-spell-traitpick .ui-spell-trait__state { grid-column: 2; grid-row: 1; justify-self: end; font-style: normal; font-weight: 400; font-size: 11px; white-space: nowrap; }
.ui-spell-traitpick .ui-spell-trait__fx { grid-column: 1 / -1; grid-row: 2; font-weight: 400; font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.ui-spell-traitpick .ui-spell-trait:is([data-trait-state="closed"], [data-trait-state="locked"]) { opacity: 0.6; }
.ui-spell-traittag { flex: none; margin-left: 6px; font: 400 11px/1.4 var(--ff-ui); letter-spacing: 0.04em; white-space: nowrap; opacity: 0.75; }
.ui-spell-traittag[data-on="1"] { opacity: 1; }
html[data-skin="ps1"] body .ui-spell-traitpick { background: var(--ob-hairline) center top / 100% 1px no-repeat; }
html[data-skin="ps1"] body .ui-spell-traitpick__lead { color: var(--ob-ink); opacity: 0.85; }
html[data-skin="ps1"] body .ui-spell-trait__state, html[data-skin="ps1"] body .ui-spell-traittag { color: var(--ob-ink-2); }
html[data-skin="ps1"] body .ui-spell-trait[aria-pressed="true"] .ui-spell-trait__state { color: var(--ob-ink); }
/* the menu key ring sits beside the name line (the menu default centres it on the whole key, which now has two lines) */
:root:root:root:root:root[data-skin="ps1"] body #actionSidebar.ui-menu .ui-spell-traitpick .ui-spell-trait {
  display: grid; width: 100%; height: auto; min-height: 44px; padding: 6px 8px 6px 30px; white-space: normal; justify-content: stretch; background-position: left 10px top 13px;
}
:root:root:root:root:root[data-skin="ps1"] body #actionSidebar.ui-menu .ui-spell-traitpick .ui-spell-trait:is([aria-pressed="true"], .controller-selected) { background-position: left calc(16px - var(--ob-lamp) / 2) top calc(19px - var(--ob-lamp) / 2); }

/* ---------- 7. console signal: the console appearance's live phosphor (PS1 + console only; strength = メニューの効果, --menu-fx 0..1) ----------
   One fixed layer (fx/overlay.js ensureConsoleSignal, made once, after the menu and the flow overlay in <body>) over the full menu and the flow pages, never
   over the hand tray (the board stays clear) or the title. Five parts in several rhythms that never line up: a speckle sheet that jumps every 90ms with its
   own slow hiss (2.3s), a soft beam rolling down with a phosphor tail (6.7s), a faint black-level flutter (3.1s), a broken sync line that tears sideways for
   ~60ms and fades out as afterglow (6.1s), a thin double line that slips 0.6vh (9.7s); opening the menu or turning a tab gives one short jolt. Under the words,
   the console scan rows flutter and slip 1px (5.2s at 75; slower at lower strength). Every part is a still raster moved only by transform / opacity; nothing
   repaints, nothing moves the words, the keys or their hit areas (pointer-events none). The layer's opacity is the strength (25 = a quarter, 100 = full);
   the brightest flutter is 6% green over the screen at 100. Off at メニューの効果 0, under either reduced-motion switch and in high contrast (no layer at all);
   dark / light / GB never match. The rows' flutter stays off while the menu wears the warp filter (section 3), so the filtered surface is not re-filtered. */
.con-sig { display: none; }
@media (prefers-reduced-motion: no-preference) {
  html[data-skin="ps1"][data-ui-theme="console"][data-menu-fx="1"]:not([data-high-contrast="1"], [data-reduced-motion="1"]) body > #actionSidebar.ui-menu:not([hidden], [data-hand="1"]) ~ .con-sig,
  html[data-skin="ps1"][data-ui-theme="console"][data-menu-fx="1"]:not([data-high-contrast="1"], [data-reduced-motion="1"]) body > #productFlowOverlay:not([hidden], [data-flow-mode="title"]) ~ .con-sig {
    display: block; position: fixed; inset: 0; z-index: 2147482990; pointer-events: none; overflow: hidden; contain: strict;
    opacity: min(1, var(--menu-fx, 0.75));
  }
  .con-sig > i { display: block; position: absolute; left: 0; top: 0; width: 100%; pointer-events: none; will-change: transform, opacity; }
  /* speckles: a pre-painted sheet (rasterised once), larger than the screen by one tile, jumped by transform */
  .con-sig > .con-sig__snow {
    left: -160px; top: -160px; width: calc(100% + 160px); height: calc(100% + 160px); opacity: calc(.1 * var(--menu-fx-noise,1));
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='2' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .55 0 0 0 0 1 0 0 0 0 .68 0 0 0 1.9 -.88'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E") 0 0 / 160px 160px repeat;
    animation: con-sig-snow 0.36s steps(1, end) infinite, con-sig-hiss 2.3s steps(1, end) infinite;
  }
  /* the beam: bright leading edge at the bottom, the persistence trailing above it */
  .con-sig > .con-sig__roll {
    top: -24vh; height: 24vh; opacity: var(--menu-fx-roll,1);
    background: linear-gradient(to bottom, transparent, rgb(70 242 122 / 0.035) 50%, rgb(120 255 170 / 0.09) 90%, rgb(190 255 214 / 0.22) 98.5%, transparent);
    animation: con-sig-roll 6.7s linear infinite;
  }
  .con-sig > .con-sig__flick { height: 100%; opacity: 0; background: rgb(70 242 122); animation: con-sig-flick 3.1s steps(1, end) infinite; }
  /* the sync tear: a broken bright line with a soft glow; rarer at lower strength */
  .con-sig > .con-sig__tear {
    height: 12px; opacity: 0;
    background: linear-gradient(90deg, transparent 0 3%, rgb(214 255 228 / 0.85) 3% 36%, transparent 36% 41%, rgb(214 255 228 / 0.7) 41% 78%, transparent 78% 84%, rgb(214 255 228 / 0.8) 84%) center / 100% 2px no-repeat,
      linear-gradient(to bottom, transparent, rgb(70 242 122 / 0.22) 50%, transparent);
    animation: con-sig-tear calc(6.1s / max(0.6, var(--menu-fx-k, 1))) steps(1, end) infinite;
  }
  .con-sig > .con-sig__ghost {
    height: 5px; opacity: 0;
    background: linear-gradient(to bottom, rgb(200 255 220 / 0.7) 0 1px, transparent 1px 3px, rgb(90 230 160 / 0.4) 3px 4px, transparent 4px);
    animation: con-sig-ghost calc(9.7s / max(0.6, var(--menu-fx-k, 1))) steps(1, end) infinite;
  }
  /* opening / tab turn (renderer data-ob-open 420ms, data-turn 320ms): one jolt of the tear and a short surge of the speckles */
  html[data-skin="ps1"][data-ui-theme="console"][data-menu-fx="1"]:not([data-high-contrast="1"], [data-reduced-motion="1"]) body > #actionSidebar.ui-menu:is([data-ob-open], [data-turn]):not([hidden], [data-hand="1"]) ~ .con-sig > .con-sig__tear { animation: con-sig-jolt 0.32s steps(1, end) 1; }
  html[data-skin="ps1"][data-ui-theme="console"][data-menu-fx="1"]:not([data-high-contrast="1"], [data-reduced-motion="1"]) body > #actionSidebar.ui-menu:is([data-ob-open], [data-turn]):not([hidden], [data-hand="1"]) ~ .con-sig > .con-sig__snow { animation: con-sig-snow 0.36s steps(1, end) infinite, con-sig-surge 0.32s ease-out 1; }
  /* under the words: the console scan rows (skin-observer.css 17b, still at 0.5) flutter and slip 1px; the menu, the hand tray's own box and the pop-ups */
  html[data-skin="ps1"][data-ui-theme="console"][data-menu-fx="1"]:not([data-high-contrast="1"], [data-reduced-motion="1"], [data-ui-warp="1"]) body #actionSidebar.ui-menu:not([hidden], [data-hand="1"])::before,
  html[data-skin="ps1"][data-ui-theme="console"][data-menu-fx="1"]:not([data-high-contrast="1"], [data-reduced-motion="1"]) body #actionSidebar[data-hand="1"]:not([hidden], [data-hand-state="closing"])::before,
  html[data-skin="ps1"][data-ui-theme="console"][data-menu-fx="1"]:not([data-high-contrast="1"], [data-reduced-motion="1"], [data-ui-warp="1"]) body > :is(#tapInspectPanel.ui-inspect, .ui-record-popup):not([hidden]):not(.nx-paper)::before {
    animation: con-sig-rows calc(5.2s / var(--menu-fx-k, 1)) steps(1, end) infinite;
  }
}
@keyframes con-sig-snow { 0% { transform: translate3d(0, 0, 0); } 25% { transform: translate3d(97px, 41px, 0); } 50% { transform: translate3d(23px, 131px, 0); } 75% { transform: translate3d(139px, 89px, 0); } 100% { transform: translate3d(0, 0, 0); } }
@keyframes con-sig-hiss { 0% { opacity: calc(0.09 * var(--menu-fx-noise,1)); } 17% { opacity: calc(0.14 * var(--menu-fx-noise,1)); } 19% { opacity: calc(0.08 * var(--menu-fx-noise,1)); } 43% { opacity: calc(0.11 * var(--menu-fx-noise,1)); } 61% { opacity: calc(0.17 * var(--menu-fx-noise,1)); } 62% { opacity: calc(0.1 * var(--menu-fx-noise,1)); } 83% { opacity: calc(0.07 * var(--menu-fx-noise,1)); } 100% { opacity: calc(0.09 * var(--menu-fx-noise,1)); } }
@keyframes con-sig-surge { from { opacity: calc(0.3 * var(--menu-fx-noise,1)); } to { opacity: calc(0.1 * var(--menu-fx-noise,1)); } }
@keyframes con-sig-roll { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(0, 124vh, 0); } }
@keyframes con-sig-flick { 0% { opacity: calc(0 * var(--menu-fx-flicker,1)); } 8% { opacity: calc(0.03 * var(--menu-fx-flicker,1)); } 9.5% { opacity: calc(0 * var(--menu-fx-flicker,1)); } 31% { opacity: calc(0.05 * var(--menu-fx-flicker,1)); } 32% { opacity: calc(0.015 * var(--menu-fx-flicker,1)); } 34% { opacity: calc(0 * var(--menu-fx-flicker,1)); } 57% { opacity: calc(0.025 * var(--menu-fx-flicker,1)); } 58% { opacity: calc(0 * var(--menu-fx-flicker,1)); } 76% { opacity: calc(0.06 * var(--menu-fx-flicker,1)); } 77% { opacity: calc(0 * var(--menu-fx-flicker,1)); } 78.5% { opacity: calc(0.035 * var(--menu-fx-flicker,1)); } 80% { opacity: calc(0 * var(--menu-fx-flicker,1)); } 100% { opacity: calc(0 * var(--menu-fx-flicker,1)); } }
@keyframes con-sig-tear {
  0% { opacity: calc(0 * var(--menu-fx-jitter,1)); transform: translate3d(0, 31vh, 0); }
  36% { opacity: calc(0.9 * var(--menu-fx-jitter,1)); transform: translate3d(-6%, 31vh, 0); }
  37% { opacity: calc(0.7 * var(--menu-fx-jitter,1)); transform: translate3d(4%, 31.5vh, 0); animation-timing-function: ease-out; }
  41% { opacity: calc(0 * var(--menu-fx-jitter,1)); transform: translate3d(4%, 31.5vh, 0); }
  78% { opacity: calc(0 * var(--menu-fx-jitter,1)); transform: translate3d(0, 72vh, 0); }
  78.6% { opacity: calc(0.75 * var(--menu-fx-jitter,1)); transform: translate3d(7%, 72vh, 0); animation-timing-function: ease-out; }
  81.5% { opacity: calc(0 * var(--menu-fx-jitter,1)); transform: translate3d(7%, 72vh, 0); }
  100% { opacity: calc(0 * var(--menu-fx-jitter,1)); transform: translate3d(0, 72vh, 0); }
}
@keyframes con-sig-ghost {
  0% { opacity: calc(0 * var(--menu-fx-jitter,1)); transform: translate3d(0, 57vh, 0); }
  62% { opacity: calc(0.8 * var(--menu-fx-jitter,1)); transform: translate3d(0, 57vh, 0); }
  62.5% { opacity: calc(0.65 * var(--menu-fx-jitter,1)); transform: translate3d(0, 56.4vh, 0); animation-timing-function: ease-out; }
  67% { opacity: calc(0 * var(--menu-fx-jitter,1)); transform: translate3d(0, 56.4vh, 0); }
  100% { opacity: calc(0 * var(--menu-fx-jitter,1)); transform: translate3d(0, 57vh, 0); }
}
@keyframes con-sig-jolt {
  0% { opacity: calc(0.9 * var(--menu-fx-jitter,1)); transform: translate3d(-5%, 18vh, 0); }
  18% { opacity: calc(0.75 * var(--menu-fx-jitter,1)); transform: translate3d(6%, 47vh, 0); }
  36% { opacity: calc(0.85 * var(--menu-fx-jitter,1)); transform: translate3d(-3%, 66vh, 0); }
  54% { opacity: calc(0.5 * var(--menu-fx-jitter,1)); transform: translate3d(2%, 83vh, 0); animation-timing-function: ease-out; }
  100% { opacity: calc(0 * var(--menu-fx-jitter,1)); transform: translate3d(2%, 83vh, 0); }
}
@keyframes con-sig-rows { 0% { opacity: calc(0.5 * var(--menu-fx-scanlines-k,1)); translate: 0 0; } 19% { opacity: calc(0.62 * var(--menu-fx-scanlines-k,1)); } 20.5% { opacity: calc(0.5 * var(--menu-fx-scanlines-k,1)); } 44% { opacity: calc(0.4 * var(--menu-fx-scanlines-k,1)); translate: 0 1px; } 45.5% { opacity: calc(0.5 * var(--menu-fx-scanlines-k,1)); translate: 0 0; } 71% { opacity: calc(0.66 * var(--menu-fx-scanlines-k,1)); } 72% { opacity: calc(0.44 * var(--menu-fx-scanlines-k,1)); } 73.5% { opacity: calc(0.5 * var(--menu-fx-scanlines-k,1)); } 100% { opacity: calc(0.5 * var(--menu-fx-scanlines-k,1)); translate: 0 0; } }

/* An effect at zero has no live layer, not merely a transparent animation. */
html[data-menu-fx-noise="0"] .fx-ov[data-ui="1"] > .fx-ov__ui::before,
html[data-menu-fx-roll="0"] .fx-ov[data-ui="1"] > .fx-ov__ui::after,
html[data-menu-fx-noise="0"] .con-sig > .con-sig__snow,
html[data-menu-fx-roll="0"] .con-sig > .con-sig__roll,
html[data-menu-fx-flicker="0"] .con-sig > .con-sig__flick,
html[data-menu-fx-jitter="0"] .con-sig > :is(.con-sig__tear,.con-sig__ghost) { display: none !important; animation: none !important; }

/* Equipment readers: name the extra layer without changing the GB card's spacing. */
.ic-additional-traits { display: contents; }
.ic-extra-traits-title { display: none; }
:root[data-skin="ps1"] .ic-body[data-equipment="1"] .ic-additional-traits { display: block; }
:root[data-skin="ps1"] .ic-body[data-equipment="1"] .ic-extra-traits-title { display: flex; }
:root[data-skin="ps1"] .ic-body[data-equipment="1"] [data-equipment-layer="inscription"] .ic-inscription-name { display: none; }
:root[data-skin="ps1"] .ic-body[data-equipment="1"] [data-equipment-layer="inscription"] .ic-trait > p:has(> .ic-inscription-name:only-child) { display: none; }
:root[data-skin="ps1"] .ic-body[data-equipment="1"] [data-equipment-layer="inscription"] .ic-trait:has(> p > .ic-inscription-name:only-child) > .ic-mods { grid-column: 2; grid-row: 1; }

/* Use Chromium's persistent native scrollbar instead of the low-contrast raster track here.
   The browser owns its thumb size and position; non-equipment readers retain their current bars. */
:root:root[data-skin="ps1"] body #actionSidebar.ui-menu:not([data-hand="1"]) #sidebarDetail:has(.ic-body[data-equipment="1"]),
:root:root[data-skin="ps1"] body #actionSidebar.ui-menu:not([data-hand="1"]) .ui-detail__content:has(.ic-body[data-equipment="1"]) {
  overflow-y: auto; scrollbar-gutter: stable; scrollbar-width: auto; scrollbar-color: auto;
}
:root:root[data-skin="ps1"] body #actionSidebar.ui-menu:not([data-hand="1"]) #sidebarDetail:has(.ic-body[data-equipment="1"])::-webkit-scrollbar,
:root:root[data-skin="ps1"] body #actionSidebar.ui-menu:not([data-hand="1"]) .ui-detail__content:has(.ic-body[data-equipment="1"])::-webkit-scrollbar {
  display: block; width: 8px; height: 8px; background: var(--ob-void);
}
:root:root[data-skin="ps1"] body #actionSidebar.ui-menu:not([data-hand="1"]) #sidebarDetail:has(.ic-body[data-equipment="1"])::-webkit-scrollbar-track,
:root:root[data-skin="ps1"] body #actionSidebar.ui-menu:not([data-hand="1"]) .ui-detail__content:has(.ic-body[data-equipment="1"])::-webkit-scrollbar-track {
  background: var(--ob-void); border: 0; border-image: none;
}
:root:root[data-skin="ps1"] body #actionSidebar.ui-menu:not([data-hand="1"]) #sidebarDetail:has(.ic-body[data-equipment="1"])::-webkit-scrollbar-thumb,
:root:root[data-skin="ps1"] body #actionSidebar.ui-menu:not([data-hand="1"]) .ui-detail__content:has(.ic-body[data-equipment="1"])::-webkit-scrollbar-thumb {
  min-height: 28px; background: var(--ob-ink); border: 2px solid var(--ob-void); border-image: none;
}
@supports (-moz-appearance: none) {
  :root:root[data-skin="ps1"] body #actionSidebar.ui-menu:not([data-hand="1"]) #sidebarDetail:has(.ic-body[data-equipment="1"]),
  :root:root[data-skin="ps1"] body #actionSidebar.ui-menu:not([data-hand="1"]) .ui-detail__content:has(.ic-body[data-equipment="1"]) {
    scrollbar-width: thin; scrollbar-color: var(--ob-ink) var(--ob-void);
  }
}
/* Portrait uses the whole detail sheet as its single scroller. A second auto
   scroller around the content would trap touch panning before it reaches the sheet. */
@media (orientation: portrait) {
  :root:root[data-skin="ps1"] body #actionSidebar.ui-menu:not([data-hand="1"]) #sidebarDetail:has(.ic-body[data-equipment="1"]) { touch-action: pan-y; }
  :root:root[data-skin="ps1"] body #actionSidebar.ui-menu:not([data-hand="1"]) .ui-detail__content:has(.ic-body[data-equipment="1"]) { overflow: visible; scrollbar-gutter: auto; }
}
