/* ==========================================================================
   OSReward — case player + corpus atlas
   Sits on the main.css token set (gold / cyan / ok / bad / surfaces), so both
   themes come for free. Overlay marks drawn on top of screenshots use fixed
   colours: they sit on arbitrary app pixels, not on the page background.
   ========================================================================== */

/* Action-kind palette, shared by the player's action chip and the atlas
   barcodes. Hues stay clear of the ok / bad pair, which means "human label". */
.px-k-c { --k: #3fb2c9; }
.px-k-d { --k: #1d86a6; }
.px-k-h { --k: #93d6e3; }
.px-k-t { --k: #e2c377; }
.px-k-k { --k: #e3964a; }
.px-k-s { --k: #9a86e8; }
.px-k-w { --k: #bba2f2; }
.px-k-g { --k: #7461c4; }
.px-k-n { --k: #4f97ee; }
.px-k-x { --k: #e27fb4; }
.px-k-p { --k: #6f7fa8; }
.px-k-e { --k: var(--text-hi); }
.px-k-o { --k: var(--text-faint); }

.px-k {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* --------------------------------------------------------------- shared */
.px-icon, .px-pill, .px-chip, .px-play, .px-speed, .px-link {
  font: inherit;
  color: var(--text);
  background: none;
  border: 0;
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s, border-color 0.15s, transform 0.15s, opacity 0.15s;
}
.px-icon {
  width: 34px; height: 34px;
  display: inline-grid; place-items: center;
  border-radius: 9px;
  border: 1px solid var(--hairline-cool);
  background: var(--surface-1b);
  flex: none;
}
.px-icon svg { width: 15px; height: 15px; }
.px-icon:hover:not(:disabled) { color: var(--gold-200); border-color: var(--hairline-strong); }
.px-icon:disabled { opacity: 0.35; cursor: default; }
.px-icon.is-on { color: var(--gold-200); border-color: var(--gold-400); background: rgba(207, 165, 75, 0.12); }
.px-icon.is-done { color: var(--ok); border-color: var(--ok); }

.px-pill {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--hairline-cool);
  background: var(--surface-1b);
  font-size: 13px; font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.px-pill svg { width: 13px; height: 13px; color: var(--gold-300); }
.px-pill:hover { border-color: var(--hairline-strong); color: var(--gold-200); }
.px-pill-gold {
  background: linear-gradient(180deg, var(--gold-200), var(--gold-400));
  border-color: transparent;
  color: #1a1002;
  font-weight: 600;
}
.px-pill-gold:hover { color: #1a1002; filter: brightness(1.06); }
:root[data-theme="light"] .px-pill-gold { background: linear-gradient(180deg, #e9c56d, #c99a35); }

.px-link {
  padding: 2px 0;
  font-size: 12.5px;
  color: var(--text-dim);
  text-decoration: underline;
  text-decoration-color: var(--hairline-strong);
  text-underline-offset: 3px;
}
.px-link:hover { color: var(--gold-200); }

.px-tag {
  display: inline-flex; align-items: center;
  height: 24px; padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--hairline-cool);
  font-size: 12px; color: var(--text-dim);
  white-space: nowrap;
}
.px-tag-gold { color: var(--gold-200); border-color: var(--hairline-strong); background: rgba(207, 165, 75, 0.08); }
.px-tag-blind { border-style: dashed; color: var(--text-faint); }
.px-plat {
  display: inline-flex; align-items: center;
  height: 24px; padding: 0 10px;
  border-radius: 6px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  color: var(--cyan-200);
  background: rgba(63, 178, 201, 0.12);
  border: 1px solid rgba(63, 178, 201, 0.3);
}
.px-plat-mobile { color: var(--gold-200); background: rgba(207, 165, 75, 0.1); border-color: var(--hairline-strong); }
.px-plat-web { color: #9cc4f6; background: rgba(79, 151, 238, 0.12); border-color: rgba(79, 151, 238, 0.32); }
.px-plat-windows { color: #b6c0dc; background: rgba(111, 127, 168, 0.14); border-color: rgba(111, 127, 168, 0.36); }
:root[data-theme="light"] .px-plat-web { color: #1f5fae; }
:root[data-theme="light"] .px-plat-windows { color: #46557d; }

.px-tag-v {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 8px;
  border-radius: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
}
.px-tag-v.is-success { color: var(--ok); background: color-mix(in srgb, var(--ok) 15%, transparent); }
.px-tag-v.is-failure { color: var(--bad); background: color-mix(in srgb, var(--bad) 15%, transparent); }
.px-ok { color: var(--ok); font-size: 12.5px; }
.px-bad { color: var(--bad); font-size: 12.5px; }

kbd {
  display: inline-grid; place-items: center;
  min-width: 20px; height: 20px; padding: 0 5px;
  font: 600 11px/1 var(--font-mono);
  color: var(--text-hi);
  border: 1px solid var(--hairline-cool);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface-2);
}

/* ================================================================ PLAYER */
.px { outline: none; }

/* ----------------------------------------------------------- case rail */
.px-rail { margin-bottom: 22px; }
.px-rail-top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.px-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.px-chip {
  height: 30px; padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--hairline-cool);
  font-size: 12.5px; color: var(--text-dim);
}
.px-chip:hover { color: var(--text-hi); border-color: var(--hairline-strong); }
.px-chip.is-on { color: #1a1002; background: var(--gold-300); border-color: transparent; font-weight: 600; }
:root[data-theme="light"] .px-chip.is-on { color: #fff; background: var(--gold-400); }

.px-score { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--text-dim); }
.px-score b { font: 600 15px var(--font-mono); color: var(--text-hi); }
.px-score-you b { color: var(--gold-200); }

.px-cards {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(176px, 1fr);
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}
.px-cards > div { scroll-snap-align: start; min-width: 0; }
.px-card {
  width: 100%;
  display: flex; flex-direction: column;
  padding: 0;
  text-align: left;
  font: inherit; color: inherit;
  background: var(--surface-1b);
  border: 1px solid var(--hairline-cool);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.px-card:hover { border-color: var(--hairline-strong); transform: translateY(-2px); }
.px-card.is-on { border-color: var(--gold-400); box-shadow: 0 0 0 1px var(--gold-400), 0 10px 26px -16px var(--gold-500); }
.px-card-shot { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #050a14; }
.px-card-shot img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; opacity: 0.86; transition: opacity 0.2s, transform 0.4s; }
.px-card.is-portrait .px-card-shot img { object-fit: contain; }
.px-card:hover .px-card-shot img, .px-card.is-on .px-card-shot img { opacity: 1; transform: scale(1.03); }
.px-card-mark {
  position: absolute; top: 7px; right: 7px;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: 12px; font-weight: 700;
  color: #06121f;
}
.px-card-mark.is-ok { background: var(--ok); }
.px-card-mark.is-bad { background: var(--bad); }
.px-card-mark.is-skip { background: var(--text-faint); }
.px-card-text { display: flex; flex-direction: column; gap: 2px; padding: 9px 11px 10px; min-width: 0; }
.px-card-plat { font-size: 11px; color: var(--text-faint); letter-spacing: 0.03em; }
.px-card-type { font-size: 13px; font-weight: 600; color: var(--text-hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* -------------------------------------------------------------- header */
.px-main {
  background: var(--surface-1);
  border: 1px solid var(--hairline-cool);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.px-head {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "meta nav" "task task";
  gap: 12px 18px;
  padding: 20px 24px 18px;
  border-bottom: 1px solid var(--hairline-cool);
}
.px-meta { grid-area: meta; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.px-head-nav { grid-area: nav; display: flex; align-items: center; gap: 6px; }
.px-case-idx { font: 500 12.5px var(--font-mono); color: var(--text-dim); min-width: 46px; text-align: center; }
.px-task { grid-area: task; }
.px-task p {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-size: clamp(18px, 1.6vw, 21px);
  line-height: 1.45;
  color: var(--text-hi);
  max-width: 1100px;
}

/* ---------------------------------------------------------------- body */
.px-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  min-height: 0;
}
.px-stage-col { position: relative; padding: 18px 20px 16px 24px; min-width: 0; }
.px-side {
  display: flex; flex-direction: column; gap: 14px;
  padding: 18px 22px 18px 20px;
  border-left: 1px solid var(--hairline-cool);
  background: var(--surface-1b);
  min-width: 0;
}

/* screen */
.px-stage { display: flex; justify-content: center; }
.px-screen {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #03070f;
  border: 1px solid rgba(122, 158, 200, 0.22);
  box-shadow: 0 30px 60px -36px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(0, 0, 0, 0.3);
}
.px-chrome {
  display: flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 11px;
  background: linear-gradient(180deg, #1a2638, #121c2b);
  border-bottom: 1px solid rgba(122, 158, 200, 0.16);
}
.px-chrome i { width: 9px; height: 9px; border-radius: 50%; background: #e0736b; opacity: 0.85; }
.px-chrome i:nth-child(2) { background: #e2c377; }
.px-chrome i:nth-child(3) { background: #58c7a4; }
.px-chrome span { margin-left: 8px; font: 500 11px var(--font-mono); color: #7d93ad; letter-spacing: 0.04em; }
.px-viewport { position: relative; aspect-ratio: 16 / 9; overflow: hidden; cursor: zoom-in; }
.px.has-lens .px-viewport { cursor: none; }
.px-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: fill;
  display: block;
  opacity: 0.35;
  transition: opacity 0.28s ease;
}
.px-img.is-in { opacity: 1; }

/* portrait (mobile) cases: a phone, centred, height-bound */
.px.is-portrait .px-body { grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); }
.px.is-portrait .px-screen {
  width: auto;
  height: min(640px, 70vh);
  aspect-ratio: auto;
  border-radius: 34px;
  padding: 12px;
  background: linear-gradient(160deg, #1e2a3c, #0a111d);
  border: 1px solid rgba(122, 158, 200, 0.3);
}
.px.is-portrait .px-chrome { display: none; }
.px.is-portrait .px-viewport { height: 100%; aspect-ratio: 1080 / 2400; border-radius: 24px; }

/* overlay */
.px-ov { position: absolute; inset: 0; pointer-events: none; }
.px-ov-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.px-ov-layer { position: absolute; inset: 0; }
.px-cursor {
  position: absolute; left: 50%; top: 50%;
  width: 24px; height: 24px;
  margin: -3px 0 0 -4px;
  z-index: 4;
  transition: opacity 0.2s;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6));
}
.px-cursor.is-pop { animation: px-cursor-pop 0.35s ease-out; }
@keyframes px-cursor-pop { from { opacity: 0; } }
.px-cursor.no-anim { transition: opacity 0.2s; }
.px-cursor.is-hidden { opacity: 0; }
.px-cursor svg path { fill: #fff; stroke: #0b1320; stroke-width: 1.4; stroke-linejoin: round; }

.px-box {
  position: absolute;
  border: 2px solid #ffd36e;
  border-radius: 4px;
  background: rgba(255, 211, 110, 0.12);
  opacity: 0;
  transition: opacity 0.25s;
}
.px-box.is-on { opacity: 1; box-shadow: 0 0 0 1px rgba(3, 7, 15, 0.55), 0 0 14px rgba(255, 211, 110, 0.55); }

.px-ripple {
  position: absolute;
  width: 46px; height: 46px;
  margin: -23px 0 0 -23px;
  border-radius: 50%;
  border: 2.5px solid #ffd36e;
  background: rgba(255, 211, 110, 0.22);
  animation: px-ripple 0.8s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}
.px-ripple-2 { animation-delay: 0.12s; background: none; opacity: 0; }
.px-ripple.is-right { border-color: #bba2f2; background: rgba(187, 162, 242, 0.2); }
@keyframes px-ripple {
  0% { transform: scale(0.2); opacity: 1; }
  70% { opacity: 0.9; }
  100% { transform: scale(1.6); opacity: 0; }
}
.px-hover-ring {
  position: absolute;
  width: 40px; height: 40px; margin: -20px 0 0 -20px;
  border-radius: 50%;
  border: 2px dashed #93d6e3;
  animation: px-spin 3s linear infinite;
}
@keyframes px-spin { to { transform: rotate(360deg); } }

.px-ov-chip {
  position: absolute; left: 50%; bottom: 7%;
  transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 86%;
  padding: 9px 15px;
  border-radius: 12px;
  font: 500 14px var(--font-mono);
  color: #fff;
  background: rgba(6, 12, 24, 0.86);
  border: 1px solid rgba(255, 211, 110, 0.5);
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(6px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  animation: px-pop 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.3) both;
}
.px-ov-keys kbd { min-width: 30px; height: 30px; font-size: 14px; color: #fff; background: #1b2639; border-color: rgba(255, 255, 255, 0.25); }
.px-ov-keys .px-plus { color: #8aa1bb; }
.px-ov-url { top: 6%; bottom: auto; border-color: rgba(79, 151, 238, 0.7); }
.px-ov-wait { border-color: rgba(111, 127, 168, 0.8); }
.px-ov-code { border-color: rgba(226, 127, 180, 0.7); }
@keyframes px-pop { from { opacity: 0; transform: translateX(-50%) translateY(8px) scale(0.94); } }

.px-ov-type {
  position: absolute;
  display: inline-flex; align-items: center; gap: 2px;
  max-width: 46%;
  margin: 22px 0 0 -10px;
  padding: 8px 12px;
  border-radius: 10px 10px 10px 3px;
  font: 500 14px/1.35 var(--font-mono);
  color: #1a1002;
  background: #ffd36e;
  box-shadow: 0 12px 26px -10px rgba(0, 0, 0, 0.75);
  animation: px-pop2 0.25s ease-out both;
}
.px-ov-type span { white-space: pre-wrap; word-break: break-word; }
.px-ov-type.is-above { margin-top: -62px; }
.px-ov-type.is-left { transform: translateX(-100%); margin-left: 10px; border-radius: 10px 10px 3px 10px; }
.px-ov-type.is-center { left: 50%; top: 40%; transform: translateX(-50%); margin: 0; }
.px-caret { width: 2px; height: 1.1em; background: #1a1002; animation: px-blink 0.9s steps(1) infinite; }
.px-caret.is-done { animation: none; opacity: 0; width: 0; }
.px-enter { margin-left: 6px; color: #1a1002; background: rgba(255, 255, 255, 0.6); border-color: rgba(0, 0, 0, 0.2); }
@keyframes px-blink { 50% { opacity: 0; } }
@keyframes px-pop2 { from { opacity: 0; } }

.px-ov-scroll {
  position: absolute;
  width: 40px; height: 64px; margin: -32px 0 0 -20px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.px-ov-scroll i {
  width: 18px; height: 18px;
  border-right: 4px solid #bba2f2; border-bottom: 4px solid #bba2f2;
  transform: rotate(45deg);
  margin-top: -6px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.7));
  animation: px-chev 1.1s ease-in-out infinite;
}
.px-ov-scroll i:nth-child(2) { animation-delay: 0.15s; }
.px-ov-scroll i:nth-child(3) { animation-delay: 0.3s; }
.px-ov-scroll.is-up { transform: rotate(180deg); }
.px-ov-scroll.is-left { transform: rotate(90deg); }
.px-ov-scroll.is-right { transform: rotate(-90deg); }
@keyframes px-chev { 0%, 100% { opacity: 0.2; } 50% { opacity: 1; } }

.px-swipe-line {
  stroke: #bba2f2; stroke-width: 5; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.6));
}
.px-swipe-line.is-on { stroke-dashoffset: 0; transition: stroke-dashoffset 0.7s ease-in-out; }
.px-swipe-dot {
  position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px;
  border-radius: 50%;
  background: rgba(187, 162, 242, 0.9);
  border: 3px solid #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}
.px-swipe-dot.is-moving { transition: left 0.7s ease-in-out, top 0.7s ease-in-out; }
.px-swipe-end {
  position: absolute; width: 0; height: 0; margin: -9px 0 0 -9px;
  border: 9px solid transparent;
}
.px-swipe-end.is-up { border-bottom-color: #bba2f2; margin-top: -22px; }
.px-swipe-end.is-down { border-top-color: #bba2f2; margin-top: 4px; }
.px-swipe-end.is-left { border-right-color: #bba2f2; margin-left: -22px; }
.px-swipe-end.is-right { border-left-color: #bba2f2; margin-left: 4px; }

.px-ov-done {
  position: absolute; left: 50%; bottom: 6%;
  transform: translateX(-50%);
  width: min(78%, 620px);
  display: flex; flex-direction: column; gap: 5px;
  padding: 13px 18px;
  border-radius: 12px;
  color: #eaf1f9;
  background: rgba(6, 12, 24, 0.9);
  border: 1px solid rgba(255, 211, 110, 0.6);
  box-shadow: 0 18px 40px -14px rgba(0, 0, 0, 0.9);
  animation: px-pop 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.px-ov-done b { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: #ffd36e; }
.px-ov-done span { font-size: 13.5px; line-height: 1.45; color: #c9d6e6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* HUD + progress */
.px-hud {
  position: absolute; left: 10px; bottom: 12px; right: 10px;
  display: flex; align-items: flex-end; gap: 6px; flex-wrap: wrap-reverse;
  z-index: 3;
  pointer-events: none;
}
.px-hud-step {
  padding: 4px 9px;
  border-radius: 7px;
  font: 600 11.5px var(--font-mono);
  color: #eaf1f9;
  background: rgba(6, 12, 24, 0.72);
  backdrop-filter: blur(4px);
}
.px-viewport:hover .px-hud { opacity: 0.25; }
.px-hud { transition: opacity 0.2s; }
.px-hud-badges { display: flex; gap: 5px; flex-wrap: wrap; }
.px-badge {
  padding: 4px 9px; border-radius: 7px;
  font-size: 11.5px; font-weight: 600;
  color: #06121f;
  animation: px-pop2 0.3s both;
}
.px-badge.is-focus { background: #ffd36e; }
.px-badge.is-evidence { background: #6fcfe0; }
.px-badge.is-verification { background: #bba2f2; }

.px-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(0, 0, 0, 0.3); opacity: 0; transition: opacity 0.2s; }
.px-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold-400), #ffd36e); }
.px-progress.is-run { opacity: 1; }
.px-progress.is-run i { animation: px-fill linear forwards; }
@keyframes px-fill { from { width: 0; } to { width: 100%; } }

/* lens */
.px-lens {
  position: absolute; left: 0; top: 0;
  width: 180px; height: 180px;
  border-radius: 50%;
  border: 3px solid #ffd36e;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(0, 0, 0, 0.4);
  background-color: #03070f;
  background-repeat: no-repeat;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 6;
}
.px-lens.is-on { opacity: 1; }
.px:not(.has-lens) .px-lens { display: none; }

/* transport */
.px-transport { display: flex; align-items: center; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.px-play {
  height: 36px; padding: 0 16px 0 13px;
  display: inline-flex; align-items: center; gap: 7px;
  border-radius: 999px;
  font-size: 13px; font-weight: 600;
  color: #1a1002;
  background: linear-gradient(180deg, var(--gold-200), var(--gold-400));
}
:root[data-theme="light"] .px-play { background: linear-gradient(180deg, #e9c56d, #c99a35); }
.px-play svg { width: 14px; height: 14px; }
.px-play:hover { filter: brightness(1.07); }
.px-speed {
  height: 34px; min-width: 44px; padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--hairline-cool);
  font: 600 12px var(--font-mono);
  color: var(--text-dim);
}
.px-speed:hover { color: var(--gold-200); border-color: var(--hairline-strong); }
.px-spacer { flex: 1; }
.px-key-jump[hidden] { display: none; }

/* filmstrip */
.px-film {
  display: flex; align-items: center; gap: 6px;
  margin-top: 14px;
  padding: 4px 2px 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.px-frame {
  position: relative;
  flex: none;
  width: 96px;
  aspect-ratio: 16 / 9;
  padding: 0;
  border-radius: 7px;
  border: 1.5px solid var(--hairline-cool);
  background: #03070f;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.62;
  transition: opacity 0.2s, border-color 0.2s, transform 0.2s;
}
.px.is-portrait .px-frame { width: 44px; aspect-ratio: 1080 / 2400; }
.px-frame img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.px-frame:hover { opacity: 1; transform: translateY(-2px); }
.px-frame.is-on { opacity: 1; border-color: var(--gold-300); box-shadow: 0 0 0 2px rgba(226, 195, 119, 0.35); }
.px-frame-n {
  position: absolute; left: 3px; bottom: 3px;
  padding: 1px 5px; border-radius: 4px;
  font: 600 10px var(--font-mono);
  color: #eaf1f9; background: rgba(6, 12, 24, 0.82);
}
.px-frame-k { position: absolute; right: 4px; bottom: 4px; width: 8px; height: 8px; border-radius: 2px; background: var(--k); }
.px-frame.is-focus::after, .px-frame.is-evidence::after, .px-frame.is-verification::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
}
.px-frame.is-focus::after { background: #ffd36e; }
.px-frame.is-evidence::after { background: #6fcfe0; }
.px-frame.is-verification::after { background: #bba2f2; }
.px-gap {
  flex: none;
  padding: 3px 6px;
  font: 500 10.5px var(--font-mono);
  color: var(--text-faint);
  border: 1px dashed var(--hairline-cool);
  border-radius: 5px;
}

/* macro timeline: the whole recorded trajectory, with shown states as ticks */
.px-macro { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.px-macro-track { position: relative; flex: 1; height: 18px; }
.px-macro-track::before {
  content: ""; position: absolute; left: 0; right: 0; top: 8px; height: 2px;
  border-radius: 2px; background: var(--chart-track);
}
.px-macro-fill {
  position: absolute; left: 0; top: 8px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--gold-500), var(--gold-300));
  transition: width 0.4s ease;
}
.px-macro-tick {
  position: absolute; top: 3px;
  width: 4px; height: 12px; margin-left: -2px;
  padding: 0; border: 0; border-radius: 2px;
  background: var(--text-faint);
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s;
}
.px-macro-tick:hover { transform: scaleY(1.35); }
.px-macro-tick.is-past { background: var(--gold-300); }
.px-macro-tick.is-focus { background: #ffd36e; height: 16px; top: 1px; }
.px-macro-tick.is-evidence { background: #6fcfe0; height: 16px; top: 1px; }
.px-macro-tick.is-verification { background: #bba2f2; height: 16px; top: 1px; }
.px-macro-head {
  position: absolute; top: 4px;
  width: 10px; height: 10px; margin-left: -5px;
  border-radius: 50%;
  background: var(--gold-200);
  box-shadow: 0 0 0 3px rgba(226, 195, 119, 0.25);
  transition: left 0.4s ease;
  pointer-events: none;
}
.px-macro-label { font: 500 11px var(--font-mono); color: var(--text-faint); white-space: nowrap; }

/* filmstrip hover preview */
.px-preview {
  position: absolute; z-index: 10;
  width: 220px;
  transform: translate(-50%, calc(-100% - 10px));
  padding: 6px;
  border-radius: 10px;
  background: var(--surface-3);
  border: 1px solid var(--hairline-strong);
  box-shadow: var(--shadow);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}
.px-preview.is-on { opacity: 1; }
.px-preview img { width: 100%; border-radius: 6px; display: block; }
.px.is-portrait .px-preview { width: 150px; }
.px-preview span { display: block; padding: 6px 3px 2px; font-size: 12px; color: var(--text); }

/* ---------------------------------------------------------- side panel */
.px-side-head { display: flex; flex-direction: column; gap: 5px; min-height: 22px; }
.px-caption { font-size: 15.5px; color: var(--gold-200); font-weight: 600; animation: px-pop2 0.3s both; }
.px-action {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 13px;
  border-radius: 11px;
  border: 1px solid var(--hairline-cool);
  background: var(--surface-2);
}
.px-action-icon {
  flex: none;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 8px;
  font: 700 14px var(--font-mono);
  color: #06121f;
  background: var(--k);
}
.px-action-text { min-width: 0; font-size: 14px; line-height: 1.4; color: var(--text); word-break: break-word; }
.px-action-text b { color: var(--text-hi); font-weight: 600; }
.px-action-text span { font-family: var(--font-mono); font-size: 13px; }

.px-thought { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.px-thought-head { display: flex; justify-content: space-between; align-items: center; }
.px-thought-head .px-link[hidden] { display: none; }
.px-thought-text {
  margin: 0;
  flex: 1;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 6px;
  font-size: 14px;
  line-height: 1.62;
  color: var(--text);
  white-space: pre-wrap;
  scrollbar-width: thin;
}
.px.is-portrait .px-thought-text { max-height: 420px; }
.px-thought.is-typing .px-thought-text::after {
  content: ""; display: inline-block; width: 7px; height: 1em; margin-left: 2px;
  vertical-align: -2px; background: var(--gold-300); animation: px-blink 0.9s steps(1) infinite;
}
.px-raw summary { cursor: pointer; font-size: 12.5px; color: var(--text-dim); }
.px-raw pre {
  margin: 8px 0 0;
  max-height: 160px; overflow: auto;
  padding: 10px 12px;
  border-radius: 8px;
  font: 12px/1.5 var(--font-mono);
  color: var(--cyan-200);
  background: var(--surface-3);
  border: 1px solid var(--hairline-cool);
  white-space: pre-wrap; word-break: break-all;
}
.px-keys-hint { margin: auto 0 0; font-size: 12px; color: var(--text-faint); }
@media (hover: none) { .px-keys-hint { display: none; } }

/* ------------------------------------------------------ verdict console */
.px-verdict {
  padding: 22px 24px 24px;
  border-top: 1px solid var(--hairline-cool);
  background: linear-gradient(180deg, rgba(207, 165, 75, 0.05), transparent 70%);
}
.px-verdict.is-ask { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.px-ask h3 { margin: 4px 0 6px; font-size: 22px; }
.px-ask p { margin: 0; max-width: 640px; font-size: 14px; color: var(--text-dim); }
.px-vote-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.px-vote {
  display: inline-flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 20px;
  border-radius: 12px;
  border: 1.5px solid;
  font: inherit; font-size: 15px;
  cursor: pointer;
  background: none;
  transition: transform 0.15s, background-color 0.15s, box-shadow 0.2s;
}
.px-vote small { font: 600 10.5px var(--font-mono); opacity: 0.65; border: 1px solid currentColor; border-radius: 4px; padding: 1px 4px; }
.px-vote.is-success { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 55%, transparent); }
.px-vote.is-failure { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 55%, transparent); }
.px-vote:hover { transform: translateY(-2px); }
.px-vote.is-success:hover { background: color-mix(in srgb, var(--ok) 12%, transparent); box-shadow: 0 8px 24px -12px var(--ok); }
.px-vote.is-failure:hover { background: color-mix(in srgb, var(--bad) 12%, transparent); box-shadow: 0 8px 24px -12px var(--bad); }
.px-skip { margin-left: 6px; }
.px-verdict.is-nudge .px-vote { animation: px-nudge 1.6s ease-in-out 2; }
@keyframes px-nudge { 0%, 100% { transform: none; } 50% { transform: translateY(-3px); box-shadow: 0 0 0 4px rgba(226, 195, 119, 0.2); } }

.px-result { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 28px; }
.px-verdict.is-flash .px-result { animation: px-pop2 0.4s both; }
.px-result-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.px-stamp {
  align-self: flex-start;
  display: inline-flex; flex-direction: column; gap: 2px;
  padding: 10px 20px 12px;
  border: 2.5px solid;
  border-radius: 10px;
  transform: rotate(-2.5deg);
  animation: px-stamp 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.px-stamp span { font-size: 10.5px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; opacity: 0.8; }
.px-stamp b { font: 700 28px/1 var(--font-mono); letter-spacing: 0.06em; }
.px-stamp.is-success { color: var(--ok); border-color: var(--ok); background: color-mix(in srgb, var(--ok) 9%, transparent); }
.px-stamp.is-failure { color: var(--bad); border-color: var(--bad); background: color-mix(in srgb, var(--bad) 9%, transparent); }
@keyframes px-stamp { from { opacity: 0; transform: rotate(-12deg) scale(1.6); } }
.px-you { margin: 0; font-size: 14.5px; font-weight: 600; color: var(--text-dim); }
.px-you.is-ok { color: var(--ok); }
.px-you.is-bad { color: var(--bad); }
.px-why { margin: 0; font-size: 15px; line-height: 1.55; color: var(--text-hi); }
.px-reason { padding: 11px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--hairline-cool); }
.px-reason p { margin: 5px 0 0; font-size: 14px; line-height: 1.55; color: var(--text); }

.px-result-judges { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.px-judges-head { display: flex; flex-direction: column; gap: 4px; }
.px-judges-head strong { font-size: 15px; color: var(--text-hi); }
.px-field { display: flex; flex-direction: column; gap: 6px; }
.px-field-dots { display: flex; gap: 4px; flex-wrap: wrap; }
.px-field-dots i {
  width: 14px; height: 14px; border-radius: 3px;
  animation: px-dot 0.35s ease-out both;
}
.px-field-dots i.is-success { background: var(--ok); }
.px-field-dots i.is-failure { background: var(--bad); }
.px-field-dots i.is-right { box-shadow: 0 0 0 1.5px var(--surface-3), 0 0 0 3px var(--gold-300); }
@keyframes px-dot { from { transform: scale(0); } }
.px-field-cap { font-size: 12.5px; color: var(--text-dim); }

.px-jtabs { display: flex; gap: 6px; flex-wrap: wrap; }
.px-jtab {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 8px 0 9px;
  border-radius: 9px;
  border: 1px solid var(--hairline-cool);
  background: var(--surface-1b);
  font: inherit; font-size: 13px; color: var(--text);
  cursor: pointer;
}
.px-jtab img { width: 18px; height: 18px; object-fit: contain; border-radius: 4px; background: var(--logo-plate); padding: 1px; }
.px-jtab .px-tag-v { min-width: 20px; height: 20px; padding: 0 5px; }
.px-jtab:hover { border-color: var(--hairline-strong); }
.px-jtab.is-on { border-color: var(--gold-400); background: rgba(207, 165, 75, 0.1); color: var(--text-hi); }
.px-jtab.is-wrong .px-jname { text-decoration: underline wavy color-mix(in srgb, var(--bad) 60%, transparent); text-underline-offset: 4px; text-decoration-thickness: 1px; }
.px-jpanel { border-radius: 11px; border: 1px solid var(--hairline-cool); background: var(--surface-3); overflow: hidden; }
.px-jpanel-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--hairline-cool); }
.px-jpanel-head small { margin-left: auto; color: var(--text-faint); font-size: 12px; }
.px-jresp {
  margin: 0;
  max-height: 300px; overflow: auto;
  padding: 12px 14px;
  font: 12.5px/1.6 var(--font-mono);
  color: var(--text);
  white-space: pre-wrap; word-break: break-word;
}
.px-result-foot { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* reveal changes the tone of the whole player a little */
.px.is-revealed .px-main { border-color: var(--hairline); }

/* ------------------------------------------------------------ lightbox */
.px-lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column;
  background: rgba(2, 6, 14, 0.94);
  backdrop-filter: blur(6px);
}
.px-lightbox[hidden] { display: none; }
.px-lightbox-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 12px 18px;
  color: #dfe8f3; font-size: 14px;
}
.px-lightbox-bar > div { display: flex; gap: 8px; align-items: center; }
.px-lightbox .px-icon, .px-lightbox .px-pill { color: #dfe8f3; background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.16); }
.px-lightbox-scroll { flex: 1; overflow: auto; display: grid; place-items: center; padding: 0 18px 18px; }
.px-lightbox-scroll img { max-width: 100%; max-height: calc(100vh - 80px); cursor: zoom-in; border-radius: 6px; }
.px-lightbox.is-actual .px-lightbox-scroll { place-items: start; }
.px-lightbox.is-actual .px-lightbox-scroll img { max-width: none; max-height: none; cursor: zoom-out; }
body.px-modal-open { overflow: hidden; }

/* ================================================================= ATLAS */
.atlas {
  padding: 20px 24px 22px;
  background: var(--surface-1);
  border: 1px solid var(--hairline-cool);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.atlas-bar { display: flex; align-items: center; gap: 12px 22px; flex-wrap: wrap; }
.atlas-ctl { display: flex; align-items: center; gap: 10px; }
.atlas-ctl .px-k { white-space: nowrap; }
.atlas-search { flex: 1; min-width: 200px; max-width: 360px; margin-left: auto; }
.atlas-search input {
  width: 100%; height: 34px; padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--hairline-cool);
  background: var(--surface-2);
  color: var(--text-hi);
  font: inherit; font-size: 13.5px;
}
.atlas-search input:focus { outline: none; border-color: var(--gold-400); box-shadow: 0 0 0 3px rgba(207, 165, 75, 0.18); }
.atlas-count { font: 500 12px var(--font-mono); color: var(--text-faint); white-space: nowrap; }

.atlas-legend { display: flex; gap: 18px; flex-wrap: wrap; margin: 16px 0 10px; font-size: 12.5px; color: var(--text-dim); }
.atlas-li { display: inline-flex; align-items: center; gap: 7px; }
.atlas-li i { width: 10px; height: 10px; border-radius: 3px; }
.atlas-li i.is-ok { background: var(--ok); }
.atlas-li i.is-bad { background: var(--bad); }
.atlas-li i.is-case { border: 1.5px solid var(--gold-300); }
.atlas-ramp { width: 90px !important; height: 8px !important; background: linear-gradient(90deg, var(--cyan-500), var(--cyan-300), var(--gold-300)); }

.atlas-canvas { position: relative; }
.atlas-canvas canvas { display: block; width: 100%; outline: none; border-radius: 6px; }
.atlas-canvas canvas:focus-visible { box-shadow: 0 0 0 2px var(--gold-400); }
.atlas-labels { position: absolute; inset: 0; pointer-events: none; }
.atlas-glabel { position: absolute; left: 0; display: flex; flex-direction: column; gap: 3px; }
.atlas-glabel b { font-size: 14px; color: var(--text-hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.atlas-gmeta { font: 500 11.5px var(--font-mono); color: var(--text-faint); }
.atlas-split { display: flex; width: 100%; max-width: 150px; height: 4px; border-radius: 2px; overflow: hidden; margin-top: 2px; }
.atlas-split i.is-ok { background: var(--ok); }
.atlas-split i.is-bad { background: var(--bad); }
.atlas-glabel.is-inline { flex-direction: row; align-items: baseline; gap: 10px; }
.atlas-glabel.is-inline .atlas-split { display: none; }

.atlas-tip {
  position: absolute; z-index: 5;
  width: 300px;
  padding: 11px 13px;
  border-radius: 11px;
  background: var(--surface-3);
  border: 1px solid var(--hairline-strong);
  box-shadow: var(--shadow);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.12s, transform 0.12s;
}
.atlas-tip.is-on { opacity: 1; transform: none; }
.atlas-tip-meta { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-dim); }
.atlas-tip p { margin: 8px 0; font-size: 13.5px; line-height: 1.45; color: var(--text-hi); }
.atlas-tip-case { display: block; margin-top: 8px; font-size: 12px; color: var(--gold-200); }

.atlas-code { display: flex; flex-wrap: wrap; gap: 1px; }
.atlas-code i { width: 5px; height: 12px; border-radius: 1px; background: var(--k); }
.atlas-code.is-big { gap: 2px; margin: 12px 0; }
.atlas-code.is-big i { width: 9px; height: 26px; border-radius: 2px; animation: px-dot 0.3s ease-out both; }

.atlas-detail { display: none; margin-top: 14px; padding: 16px 18px; border-radius: 12px; border: 1px solid var(--hairline); background: var(--surface-2); }
.atlas-detail.is-on { display: block; animation: px-pop2 0.25s both; }
.atlas-detail-top { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.atlas-detail-meta { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.atlas-detail-task { margin: 12px 0 0; font-family: var(--font-display); font-size: 18px; line-height: 1.45; color: var(--text-hi); }
.atlas-mix { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--text-dim); }
.atlas-detail-acts { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 14px; }
.atlas-id { font: 11.5px var(--font-mono); color: var(--text-faint); word-break: break-all; }

.atlas-kinds { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; margin-top: 16px; font-size: 12px; color: var(--text-dim); }
.atlas-kind { display: inline-flex; align-items: center; gap: 6px; }
.atlas-kind i { width: 6px; height: 13px; border-radius: 1px; background: var(--k); }

/* ============================================================ responsive */
@media (max-width: 1080px) {
  .px-body, .px.is-portrait .px-body { grid-template-columns: minmax(0, 1fr); }
  .px-side { border-left: 0; border-top: 1px solid var(--hairline-cool); }
  .px-thought-text { max-height: 260px; }
  .px-result { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 620px) {
  .px-head { grid-template-columns: 1fr; grid-template-areas: "meta" "nav" "task"; padding: 16px; }
  .px-stage-col { padding: 14px 12px; }
  .px-side { padding: 14px 16px; }
  .px-verdict { padding: 18px 16px; }
  .px-tag-blind { display: none; }
  .px-transport .px-spacer { display: none; }
  .px.is-portrait .px-screen { height: min(560px, 76vh); border-radius: 26px; padding: 8px; }
  .px-ov-chip { font-size: 12px; padding: 7px 11px; }
  .px-ov-type { font-size: 12px; max-width: 70%; }
  .px-ov-done { width: 90%; padding: 10px 12px; }
  .px-lens-btn { display: none; }
  .atlas { padding: 16px 14px; }
  .atlas-search { max-width: none; margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .px-cursor, .px-box, .px-macro-fill, .px-macro-head { transition: none !important; }
}

/* OS-Copilot Series (OS-Hub) entry at the top of the More research menu */
.nav-more ul .nav-more-hub { border-bottom: 1px solid var(--hairline-cool); margin-bottom: 4px; padding-bottom: 4px; }
.nav-more ul a .hub-mark { width: 26px; height: 26px; flex: none; padding: 3px; color: var(--gold-300); }

/* set filter + hard-pick badges (added with the extra hard cases) */
.px-chip-sep { width: 1px; height: 20px; margin: 0 4px; align-self: center; background: var(--hairline-cool); }
.px-chip-set.is-on { color: #1a1002; background: var(--gold-300); }
.px-filters .px-chip:not(.px-chip-set).is-on { color: var(--text-hi); background: rgba(63, 178, 201, 0.16); border-color: rgba(63, 178, 201, 0.5); font-weight: 600; }
.px-card-hard {
  position: absolute; left: 7px; top: 7px;
  padding: 2px 7px; border-radius: 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em;
  color: #1a1002; background: #ffd36e;
}
.px-empty { margin: 0; padding: 18px 4px; color: var(--text-faint); font-size: 13.5px; }
.px-judges-none { margin: 0; padding: 12px 14px; border-radius: 10px; border: 1px dashed var(--hairline-cool); font-size: 13.5px; line-height: 1.55; color: var(--text-dim); }
.px-provenance { margin: 0 auto 0 0; max-width: 640px; align-self: center; font-size: 12px; color: var(--text-faint); }

/* exact target point: a ring with a centre dot, drawn on top of the screenshot */
.px-target {
  position: absolute; z-index: 3;
  width: 30px; height: 30px; margin: -15px 0 0 -15px;
  border-radius: 50%;
  border: 2.5px solid #ffd36e;
  box-shadow: 0 0 0 2px rgba(3, 7, 15, 0.7), 0 0 14px rgba(255, 211, 110, 0.55);
  pointer-events: none;
  animation: px-target-in 0.3s ease-out both;
}
.px-target::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 6px; height: 6px; margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: #ffd36e;
  box-shadow: 0 0 0 1.5px rgba(3, 7, 15, 0.8);
}
.px-target.is-right { border-color: #bba2f2; }
.px-target.is-right::after { background: #bba2f2; }
.px-target.is-hover { border-style: dashed; }
@keyframes px-target-in { from { opacity: 0; transform: scale(1.6); } }
.px-box { display: none; }
