/* Hex Breach + debugger overlay */
.breach-ui { color: var(--cyan); background: #050812; text-shadow: 0 0 6px rgba(46,230,255,.4); height: 100%; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: .8em; outline: none; }
.breach-head { display: flex; align-items: center; justify-content: space-between; gap: 1em; }
.breach-title { letter-spacing: .3em; color: var(--magenta); text-shadow: 0 0 10px rgba(255,61,242,.6); font-size: 1.05em; margin: 0; }
.breach-abort {
  font-family: inherit; font-size: .85em; letter-spacing: .15em; cursor: pointer;
  color: var(--magenta); background: transparent; border: 1px solid var(--magenta);
  padding: .3em .7em; text-shadow: 0 0 8px rgba(255,61,242,.5);
}
.breach-abort:hover, .breach-abort:focus-visible { background: rgba(255,61,242,.2); color: #fff; outline: none; }

.breach-panels { display: flex; gap: 1.4em; flex-wrap: nowrap; align-items: flex-start; }
.root-crashdump {
  border: 1px solid rgba(255, 61, 242, .65);
  background: rgba(5, 8, 18, .94);
  padding: .75rem;
  color: #d8fbff;
  text-shadow: none;
}
.root-crashdump h4 {
  margin: 0 0 .35rem;
  color: var(--magenta);
  letter-spacing: .08em;
}
.crash-notice {
  color: var(--acid);
  font-weight: 700;
}
.crash-registers {
  display: grid;
  grid-template-columns: repeat(4, minmax(4ch, auto) minmax(10ch, 1fr));
  gap: .2rem .6rem;
  margin: .55rem 0;
}
.crash-registers dt { color: var(--cyan); font-weight: 700; }
.crash-registers dd { margin: 0; color: #fff; }
.crash-frames { margin: .45rem 0 0; padding-left: 1.6rem; }
.crash-frames li {
  display: grid;
  grid-template-columns: minmax(18ch, auto) minmax(14ch, 1fr);
  gap: .7rem;
}
.frame-address {
  color: var(--cyan);
  font-variant-numeric: tabular-nums;
}
.frame-symbol { color: #fff; overflow-wrap: anywhere; }
.hex-matrix { border-collapse: collapse; }
.hex-cell {
  width: clamp(38px, 6vw, 58px); height: clamp(30px, 4.6vh, 42px);
  text-align: center; vertical-align: middle;
  border: 1px solid rgba(46,230,255,.25);
  font-family: inherit; font-size: 1em; color: var(--cyan);
  background: transparent; cursor: pointer; padding: 0;
}
.hex-cell:focus-visible { outline: 2px solid var(--magenta); outline-offset: -2px; z-index: 1; position: relative; }
.hex-cell:hover:not(:disabled) { background: rgba(46,230,255,.18); }
.hex-cell.zone-start { border-color: var(--acid); color: var(--acid); box-shadow: inset 0 0 8px rgba(184,255,46,.3); }
.hex-cell.picked { background: rgba(255,61,242,.28); color: #fff; border-color: var(--magenta); cursor: default; }
.hex-cell.candidate { box-shadow: inset 0 0 10px rgba(46,230,255,.45); animation: cand-pulse 1s ease-in-out infinite alternate; }
@keyframes cand-pulse { to { background: rgba(46,230,255,.18);} }

.breach-side { display: flex; flex-direction: column; gap: .9em; min-width: 220px; }
.seq-block h4 { margin: 0 0 .3em; color: var(--acid); letter-spacing: .12em; font-size: .85em; text-transform: uppercase; }
.seq-values span { display: inline-block; border: 1px solid rgba(168,107,255,.4); padding: .1em .45em; margin-right: .3em; color: var(--violet); min-width: 2.2ch; text-align: center; }
.seq-values span.done { border-color: var(--acid); color: var(--acid); background: rgba(184,255,46,.12); }

.buffer-slots { display: flex; gap: .3em; margin-top: .4em; }
.buffer-slot { width: 2.9ch; height: 2.2em; border-bottom: 2px solid var(--violet); text-align: center; line-height: 2.2em; color: #fff; }

.breach-log { font-size: .85em; min-height: 3.6em; white-space: pre-wrap; color: #7fdcff; border-top: 1px dashed rgba(46,230,255,.3); padding-top: .4em; }
.breach-hint { font-size: .8em; opacity: .8; }

.result-banner { text-align: center; letter-spacing: .25em; margin: auto 0; font-size: clamp(16px, 3vw, 26px); }
.result-banner.ok { color: var(--acid); text-shadow: 0 0 18px rgba(184,255,46,.7); animation: banner-in .5s ease-out; }
.result-banner.fail { color: var(--magenta); text-shadow: 0 0 18px rgba(255,61,242,.7); animation: banner-in .35s ease-out; }
@keyframes banner-in { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.progress-bar { letter-spacing: -1px; color: var(--acid); white-space: pre; }

/* Addressed NOP dump: technical readout, not a card grid. */
.nop-memory-dump {
  overflow-x: auto;
  border-block: 1px solid rgba(46,230,255,.42);
  padding: .45em 0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.nop-dump-row {
  display: grid;
  grid-template-columns: 11ch minmax(max-content, 1fr) minmax(8ch, max-content);
  gap: 1.2ch;
  align-items: center;
  min-width: max-content;
}
.nop-dump-header {
  color: var(--acid);
  border-bottom: 1px dashed rgba(184,255,46,.35);
  margin-bottom: .35em;
  letter-spacing: .08em;
}
.nop-dump-offset,
.nop-dump-ascii { color: rgba(127,220,255,.78); }
.nop-dump-offset::before { content: '> '; color: var(--magenta); }
.nop-dump-ascii::before,
.nop-dump-ascii::after { content: '|'; color: rgba(46,230,255,.45); }
.nop-dump-bytes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .45ch;
  min-width: 0;
}
.nop-dump-bytes button {
  position: relative;
  min-width: 0;
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(46,230,255,.22);
  padding: .28em .15em;
  color: var(--cyan);
  background: transparent;
  font: inherit;
  font-size: 14px;
  min-height: 32px;
  cursor: pointer;
}
.nop-dump-bytes button:hover { background: rgba(46,230,255,.12); }
.nop-dump-bytes button:focus-visible {
  outline: 2px solid var(--magenta);
  outline-offset: -2px;
}
.nop-dump-bytes button[aria-pressed='true'] {
  color: #fff;
  background: rgba(255,61,242,.25);
  border-color: var(--magenta);
}
.nop-dump-bytes button[data-selection-order]::after {
  content: '[' attr(data-selection-order) ']';
  margin-left: .35ch;
  color: var(--acid);
}
.nop-dump-controls {
  display: flex;
  flex-wrap: wrap;
  gap: .8em;
  margin-top: .9em;
}
.nop-dump-execute,
.nop-dump-cancel {
  font: inherit;
  background: transparent;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  min-height: 44px;
  padding: .5em 1.2em;
  cursor: pointer;
}
.nop-dump-cancel {
  border-color: var(--magenta);
  color: var(--magenta);
}
.nop-dump-execute:focus-visible,
.nop-dump-cancel:focus-visible {
  outline: 2px solid var(--magenta);
  outline-offset: 2px;
}
.nop-dump-status {
  min-height: 1.5em;
  color: rgba(127, 220, 255, .86);
}

@media (max-width: 640px) {
  .breach-panels { flex-direction: column; gap: .7em; }
  .root-crashdump { padding: .55rem; font-size: .78rem; }
  .crash-registers { grid-template-columns: 4ch minmax(0, 1fr); }
  .crash-frames li { grid-template-columns: minmax(0, 1fr); gap: .15rem; }
  .frame-address { white-space: nowrap; }
  .hex-cell { width: min(13vw, 52px); height: 8.5vh; font-size: max(12px, 3.6vw); }
  .nop-memory-dump { white-space: normal; width: 100%; overflow-x: hidden; }
  .nop-dump-row {
    grid-template-columns: minmax(0, 1fr);
    gap: .35em;
    min-width: 0;
    margin-bottom: .8em;
  }
  .nop-dump-header { display: grid; grid-template-columns: repeat(3, minmax(0, auto)); }
  .nop-dump-bytes { display: flex; flex-wrap: wrap; row-gap: .45em; }
  .nop-dump-bytes button {
    min-width: 7.5ch;
    width: auto;
    min-height: 44px;
    font-size: max(14px, 3.6vw);
  }
  .nop-dump-ascii { text-align: left; justify-self: start; overflow-wrap: anywhere; white-space: pre-wrap; }
  .nop-dump-controls button { flex: 1 1 auto; min-width: 7.5em; }
}

/* Synthetic password audit: dense evidence, native controls. */
#overlay h2:has(+ [data-part='simulation-notice']) {
  margin: 0 0 .55em;
  color: #fff;
  font-size: clamp(18px, 2vw, 24px);
  letter-spacing: .12em;
  text-shadow: none;
}
#overlay [data-part='simulation-notice'] {
  color: #d9ff8a;
  border-left: 3px solid var(--acid);
  padding: .45em .7em;
  letter-spacing: .04em;
  font-size: clamp(14px, 1.3vw, 16px);
  font-weight: 700;
  line-height: 1.45;
  text-shadow: none;
}
#overlay [data-part='passwd'], #overlay [data-part='shadow'], #overlay [data-part='hint'], #overlay [data-part='wordlist'] {
  margin: .35em 0; padding: .55em .7em; border: 1px solid rgba(46,230,255,.65); color: #8ff4ff;
  font-size: clamp(14px, 1.25vw, 16px); line-height: 1.45; text-shadow: none;
  font-variant-numeric: tabular-nums; white-space: pre-wrap; overflow-wrap: anywhere;
}
#overlay [data-part='wordlist'] { border-color: rgba(196,155,255,.8); color: #c49bff; }
#overlay [data-part='wordlist'] ~ form[aria-labelledby] {
  display: grid; grid-template-columns: minmax(10ch, auto) minmax(12ch, 1fr) auto;
  gap: .6em; align-items: center; margin-top: .8em;
}
#overlay [data-part='wordlist'] ~ form[aria-labelledby] label {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .08em;
  text-shadow: none;
}
#overlay [data-part='wordlist'] ~ form[aria-labelledby] input[name='guess'],
#overlay [data-part='wordlist'] ~ form[aria-labelledby] button, #overlay [data-action='cancel'] {
  min-height: 44px; box-sizing: border-box; font: inherit; font-size: 16px; text-shadow: none;
}
#overlay [data-part='wordlist'] ~ form[aria-labelledby] input[name='guess'] {
  min-width: 0; color: #fff; background: rgba(0,0,0,.38); border: 1px solid var(--cyan); padding: .45em .65em;
}
#overlay [data-part='wordlist'] ~ form[aria-labelledby] button, #overlay [data-action='cancel'] {
  color: var(--cyan); background: transparent; border: 1px solid var(--cyan); padding: .45em 1em; cursor: pointer;
}
#overlay [data-action='cancel'] { color: var(--magenta); border-color: var(--magenta); }
#overlay [data-part='wordlist'] ~ form[aria-labelledby] input[name='guess']:focus-visible,
#overlay [data-part='wordlist'] ~ form[aria-labelledby] button:focus-visible, #overlay [data-action='cancel']:focus-visible {
  outline: 2px solid var(--magenta); outline-offset: 2px;
}
#overlay [data-part='wordlist'] ~ [role='status'] { min-height: 1.5em; }
@media (max-width: 640px) {
  #overlay [data-part='wordlist'] ~ form[aria-labelledby] { grid-template-columns: minmax(0, 1fr); width: 100%; }
  #overlay [data-part='wordlist'] ~ form[aria-labelledby] input[name='guess'],
  #overlay [data-part='wordlist'] ~ form[aria-labelledby] button, #overlay [data-action='cancel'] { width: 100%; }
}

/* === Operation trace: responsive accessible packet-trace layout (issue #3) === */
.operation-trace__title {
  margin: 0 0 .35rem;
  color: var(--cyan);
  font-size: 1rem;
  letter-spacing: .08em;
  text-shadow: none;
}
.operation-trace__instructions {
  margin: 0 0 .75rem;
  color: #fff;
  text-shadow: none;
}
.operation-trace {
  overflow-x: auto;
  font-variant-numeric: tabular-nums;
  background: rgba(0, 0, 0, .92);
}
.operation-trace__header,
.operation-trace__row {
  display: grid;
  grid-template-columns: 10ch 8ch 8ch 10ch 8ch minmax(20ch, 1fr) minmax(16ch, auto);
  gap: .5em;
  align-items: center;
  box-sizing: border-box;
  width: 100%;
}
.operation-trace__header {
  color: var(--cyan);
  font-weight: 700;
  letter-spacing: .08em;
  text-shadow: none;
}
.operation-trace__row {
  min-height: 44px;
  width: 100%;
  padding: .35em .6em;
  text-align: left;
  font: inherit;
  cursor: pointer;
  color: #fff;
  background: rgba(0, 0, 0, .42);
  border: 1px solid var(--cyan);
  text-shadow: none;
}
.operation-trace__row:hover {
  background: rgba(0, 255, 255, .14);
  border-color: var(--cyan);
  color: #fff;
}
.operation-trace__row:focus-visible {
  outline: 2px solid var(--magenta);
  outline-offset: 2px;
}
.operation-trace__row[aria-pressed='true'] {
  background: rgba(255, 0, 255, .18);
  border-color: var(--magenta);
  color: #fff;
}
.operation-trace__controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .5rem;
  margin-top: .75rem;
}
#overlay .operation-trace__controls > button[data-action] {
  min-height: 44px;
  box-sizing: border-box;
  font: inherit;
  cursor: pointer;
  color: var(--cyan);
  background: transparent;
  border: 1px solid var(--cyan);
  padding: .45em 1em;
  text-shadow: none;
}
#overlay .operation-trace__controls > button[data-action='cancel'] {
  color: var(--magenta);
  border-color: var(--magenta);
}
#overlay .operation-trace__controls > button[data-action]:disabled {
  opacity: .38;
  cursor: not-allowed;
  color: #9aa;
  border-color: #667;
  box-shadow: none;
}
#overlay .operation-trace__controls > button[data-action]:focus-visible {
  outline: 2px solid var(--magenta);
  outline-offset: 2px;
}
@media (max-width: 640px) {
  .operation-trace__header { display: none; }
  .operation-trace__row {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: .15rem;
    padding: .4rem .55rem;
    height: auto;
    min-height: 44px;
  }
  .operation-trace__time,
  .operation-trace__seq,
  .operation-trace__ack,
  .operation-trace__flags,
  .operation-trace__fragment,
  .operation-trace__annotation,
  .operation-trace__operation {
    min-width: 0;
    overflow-wrap: break-word;
  }
  .operation-trace__annotation,
  .operation-trace__operation { grid-column: 1 / -1; }
  .operation-trace__row > span {
    display: grid;
    grid-template-columns: 10ch minmax(0, 1fr);
    gap: .35rem;
  }
  .operation-trace__time,
  .operation-trace__seq,
  .operation-trace__ack,
  .operation-trace__flags,
  .operation-trace__fragment {
    white-space: nowrap;
  }
  .operation-trace__row > span::before {
    white-space: nowrap;
    content: attr(data-label);
    color: var(--cyan);
    font-weight: 700;
  }
}
@media (prefers-reduced-motion: reduce) {
  .operation-trace,
  .operation-trace__header,
  .operation-trace__row,
  #overlay .operation-trace__controls > button[data-action] {
    animation: none;
    transition: none;
  }
}

/* === Guru Meditation: fictional crash overlay (Issue #4) ================ */
/* All rules are scoped to .guru-* classes emitted by guru-meditation-ui.js;
   no universal selectors, so unrelated overlay/terminal UI is untouched.  */
@keyframes guru-alert-pulse {
  from { box-shadow: 0 0 0 2px rgba(255, 71, 71, .9); }
  to { box-shadow: 0 0 0 4px rgba(255, 71, 71, .35); }
}
.guru-meditation {
  box-sizing: border-box;
  width: min(68ch, calc(100vw - 2rem));
  max-width: 68ch;
  max-height: min(85vh, 42rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 1.5rem auto;
  padding: 1rem 1.25rem;
  color: #ffd9d9;
  background: #0b0000;
  border: 3px solid var(--guru-red, #ff4747);
  text-shadow: none;
  animation: guru-alert-pulse 1.6s steps(2, jump-none) infinite alternate;
}
.guru-title {
  margin: 0 0 .5rem;
  color: #fff;
  background: var(--guru-red, #ff4747);
  padding: .3em .5em;
  font-size: clamp(1.2rem, 4vw, 2rem);
  letter-spacing: .08em;
}
.guru-notice {
  margin: 0 0 .75rem;
  padding: .4em .6em;
  color: #fff;
  background: #1c0000;
  border: 2px dashed var(--guru-red, #ff4747);
  font-weight: 700;
}
.guru-incident {
  margin: .5rem 0;
  padding-left: .6em;
  color: #fff;
  background: #8b0f0f;
  border-left: 4px solid var(--guru-red, #ff4747);
  font-weight: 700;
}
.guru-incident::before { content: "INCIDENT "; color: #ffd9d9; }
.guru-error-class {
  margin: .5rem 0 1rem;
  padding-left: .6em;
  color: var(--guru-red, #ff4747);
  border-left: 4px dotted #fff;
  font-style: italic;
}
.guru-error-class::before { content: "ERROR CLASS "; color: #fff; }
.guru-registers {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: .2rem .8rem;
  margin: 0 0 1rem;
}
.guru-registers dt { color: var(--guru-red, #ff4747); font-weight: 700; }
.guru-registers dd {
  margin: 0;
  color: #fff;
  overflow-wrap: break-word;
  font-variant-numeric: tabular-nums;
}
.guru-frames {
  margin: 0 0 1rem;
  padding-left: 2.5em;
  max-height: 30vh;
  overflow-y: auto;
}
.guru-frames li { display: grid; gap: .1rem; }
.guru-frame-address { color: var(--guru-red, #ff4747); font-weight: 700; white-space: nowrap; }
.guru-frame-symbol { color: #ffd9d9; overflow-wrap: break-word; }
.guru-reboot-log {
  margin: 0 0 1rem;
  padding-left: 2.5em;
  max-height: 30vh;
  overflow-y: auto;
  color: #fff;
  background: #160404;
  border: 1px solid var(--guru-red, #ff4747);
}
.guru-reboot-log li { padding: .2em .35em; }
#overlay button.guru-reboot {
  box-sizing: border-box;
  min-height: 44px;
  min-width: 44px;
  font: inherit;
  cursor: pointer;
  color: #0a0a0a;
  background: var(--guru-red, #ff4747);
  border: 2px solid #fff;
  padding: .5em 1.25em;
  font-weight: 700;
  text-shadow: none;
}
#overlay button.guru-reboot:hover { background: #ff6b6b; text-decoration: underline; }
#overlay button.guru-reboot:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
#overlay button.guru-reboot:disabled { opacity: .38; cursor: not-allowed; box-shadow: none; }
@media (max-width: 640px) {
  .guru-meditation { width: calc(100vw - 1rem); max-height: calc(100vh - 2rem); margin: .5rem auto; padding: .75rem; }
  .guru-registers { grid-template-columns: minmax(0, 1fr); gap: .1rem; }
  .guru-frames li { grid-template-columns: minmax(0, 1fr); }
  .guru-frame-address { white-space: normal; overflow-wrap: break-word; }
}
@media (prefers-reduced-motion: reduce) {
  .guru-meditation,
  #overlay button.guru-reboot { animation: none; transition: none; box-shadow: 0 0 0 2px rgba(255, 71, 71, .9); }
}

/* === Return-target memory forensics (Issue #7) ============================ */
.rt-notice, .rt-legend, .rt-status { color: #d8fbff; text-shadow: none; }
/* Issue #16 debugger layout: toolbar / task+plan left-top, dump center,
   evidence right, watch bottom. ASCII frames + monospace density, no cards. */
.rt-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
  border-block: 1px solid var(--cyan);
  padding-block: .3rem;
  color: #d8fbff;
}
.rt-toolbar-target { color: var(--acid); font-weight: 700; }
.rt-toolbar-status { color: var(--amber); }
.rt-task { border-left: 2px solid var(--cyan); padding-inline-start: .6rem; margin-block: .55rem; max-width: 90ch; }
.rt-task-title, .rt-pane-title { color: var(--acid); font-weight: 700; letter-spacing: .04em; }
.rt-task-body, .rt-task-outcome { color: #d8fbff; margin-block: .3rem; overflow-wrap: break-word; }
.rt-plan { display: grid; gap: .15rem; margin-block: .3rem; }
.rt-plan-step { color: #9fd8e6; white-space: pre; }
.rt-plan-step[data-plan-state='active'] {
  color: #fff; background: rgba(46, 230, 255, .18); outline: 1px solid var(--cyan);
}
.rt-commit[aria-disabled='true'] { opacity: .75; border-style: dashed; cursor: not-allowed; }
.rt-watch {
  position: static;
  margin-block-start: .6rem; padding-block: .4rem;
  border-top: 1px solid var(--acid); background: #050805; color: #d8fbff;
}
#overlay:has(.rt-workbench) { background: #050805; }
.rt-workbench { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; min-width: 0; }
.rt-dump-pane, .rt-evidence-pane { min-width: 0; }
@media (min-width: 900px) {
  .rt-workbench { grid-template-columns: minmax(29rem, 1fr) minmax(16rem, 24rem); align-items: start; }
}
.rt-segments, .rt-slots, .rt-evidence, .rt-controls {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-block: .55rem;
}
.rt-segment-chip, .rt-slot {
  border: 1px solid rgba(46, 230, 255, .65);
  padding: .3rem .5rem;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.rt-dump {
  box-sizing: border-box;
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  border-block: 1px solid rgba(46, 230, 255, .55);
  font-variant-numeric: tabular-nums;
}
.rt-row {
  display: grid;
  grid-template-columns: 11ch minmax(29rem, 1fr) 8ch;
  gap: .75rem;
  align-items: center;
  min-width: 48rem;
}
.rt-row-header, .rt-cell-offset { color: #d8fbff; font-weight: 700; }
.rt-cell-ascii { color: #9fd8e6; }
.rt-cell-bytes { display: grid; grid-template-columns: repeat(8, 44px); gap: .2rem; }
.rt-byte {
  box-sizing: border-box;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid rgba(46, 230, 255, .42);
  color: var(--cyan);
  background: transparent;
  font: inherit;
  cursor: pointer;
}
.rt-byte[aria-pressed='true'] {
  color: #fff; border-color: var(--magenta); background: rgba(255, 61, 242, .25);
  outline: 2px double #fff;
  outline-offset: -4px;
}
.rt-byte[data-slot-role]::after { display: block; color: #fff; font-size: .65em; font-weight: 800; line-height: 1; }
.rt-byte[data-slot-role='region-start']::after { content: 'S'; }
.rt-byte[data-slot-role='region-end']::after { content: 'E'; }
.rt-byte[data-slot-role='landing']::after { content: 'L'; }
.rt-evidence-btn, .rt-commit, .rt-cancel {
  box-sizing: border-box;
  min-height: 44px;
  padding: .5rem .75rem;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  background: transparent;
  font: inherit;
  cursor: pointer;
}
.rt-cancel { color: var(--magenta); border-color: var(--magenta); }
.rt-evidence-btn[aria-pressed='true'] { color: #fff; border-color: var(--acid); background: rgba(184, 255, 46, .16); }
.rt-evidence-btn[aria-pressed='true']::before { content: '[SELECTED] '; color: var(--acid); font-weight: 800; }
.rt-byte:focus-visible, .rt-evidence-btn:focus-visible, .rt-commit:focus-visible, .rt-cancel:focus-visible {
  outline: 2px solid var(--magenta);
  outline-offset: 2px;
}
@media (max-width: 390px) {
  /* Mobile 390x844: single-column rows and four byte cells per line keep the
     debugger inside the viewport without page-level or nested horizontal scroll. */
  .rt-toolbar { gap: .5rem; }
  .rt-workbench, .rt-dump-pane, .rt-evidence-pane { width: 100%; max-width: 100%; min-width: 0; }
  .rt-dump { width: 100%; max-width: 100%; overflow-x: hidden; }
  .rt-row { grid-template-columns: minmax(0, 1fr); min-width: 0; gap: .3rem; padding-block: .35rem; }
  .rt-cell-bytes { grid-template-columns: repeat(4, 44px); gap: .3rem; }
  .rt-cell-ascii { overflow-wrap: break-word; }
  .rt-segments, .rt-slots, .rt-evidence, .rt-controls { width: 100%; max-width: 100%; min-width: 0; }
  .rt-plan-step { white-space: normal; }
  .rt-watch { white-space: normal; overflow-wrap: break-word; }
  .rt-evidence-btn, .rt-commit, .rt-cancel { flex: 1 1 100%; min-width: 0; min-height: 44px; overflow-wrap: break-word; }
}
@media (prefers-reduced-motion: reduce) {
  .rt-byte, .rt-evidence-btn, .rt-commit, .rt-cancel { animation: none; transition: none; }
}

/* --- Issue #8: stackframe forensics (sf-*) ------------------------------------ */
.sf-slot-btn,
.sf-endian,
.sf-clear,
.sf-hint-btn {
  box-sizing: border-box;
  min-height: 44px;
  padding: .5rem .75rem;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  background: transparent;
  font: inherit;
  cursor: pointer;
}
.sf-digit {
  box-sizing: border-box;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid rgba(46, 230, 255, .42);
  color: var(--cyan);
  background: transparent;
  font: inherit;
  cursor: pointer;
}
.sf-commit-frame {
  box-sizing: border-box;
  min-height: 44px;
  padding: .5rem .75rem;
  border: 1px solid var(--acid);
  color: var(--acid);
  background: transparent;
  font: inherit;
  cursor: pointer;
}
.sf-cancel {
  box-sizing: border-box;
  min-height: 44px;
  padding: .5rem .75rem;
  border: 1px solid var(--magenta);
  color: var(--magenta);
  background: transparent;
  font: inherit;
  cursor: pointer;
}
.sf-slot-btn[aria-pressed='true'], .sf-digit[aria-pressed='true'] { color: #fff; border-color: var(--magenta); background: rgba(255, 61, 242, .25); }
.sf-endian[aria-pressed='true'] { color: #fff; border-color: var(--acid); background: rgba(184, 255, 46, .16); }
.sf-slot-btn:focus-visible, .sf-digit:focus-visible, .sf-endian:focus-visible, .sf-clear:focus-visible, .sf-hint-btn:focus-visible, .sf-commit-frame:focus-visible, .sf-cancel:focus-visible {
  outline: 2px solid var(--magenta);
  outline-offset: 2px;
}
@media (max-width: 390px) {
  .sf-panels { flex-direction: column; max-width: 100%; }
  .sf-panel, .sf-slot-group, .sf-offset, .sf-endian-group, .sf-controls { max-width: 100%; }
  .sf-commit-frame, .sf-cancel { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .sf-slot-btn, .sf-digit, .sf-endian, .sf-clear, .sf-hint-btn, .sf-commit-frame, .sf-cancel { animation: none; transition: none; }
}
/* --- Issue #9: canary fork lab (cfl-*) --------------------------------------
   Four terminal-style hex reels. Animation is transform/opacity ONLY; status
   never relies on color alone (text + data-state attributes carry the state). */
.cfl-reels { display: flex; gap: .5rem; }
.cfl-reel-cell {
  box-sizing: border-box;
  min-width: 64px;
  padding: .75rem .5rem;
  border: 1px solid rgba(46, 230, 255, .42);
  color: var(--cyan);
  background: transparent;
  font-family: inherit;
  text-align: center;
}
.cfl-reel-value { display: inline-block; will-change: transform, opacity; }
@keyframes cfl-scanline {
  from { transform: translateY(-6px); opacity: .35; }
  to   { transform: translateY(6px);  opacity: 1; }
}
.cfl-reel-spinning .cfl-reel-value { animation: cfl-scanline .9s ease-in-out infinite alternate; }
@keyframes cfl-latch {
  from { transform: scale(1.25); opacity: .4; }
  to   { transform: scale(1);    opacity: 1; }
}
.cfl-reel-cell.is-locked { border-color: var(--acid); }
.cfl-reel-cell.is-locked .cfl-reel-value { animation: cfl-latch .25s ease-out 1; }

/* Controls and commit inputs — every interactive element is a 44px touch target. */
.cfl-btn, .cfl-commit-input {
  box-sizing: border-box;
  min-height: 44px;
  padding: .5rem .75rem;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  background: transparent;
  font: inherit;
}
.cfl-btn { cursor: pointer; }
.cfl-commit-input { min-width: 64px; text-transform: lowercase; }
.cfl-commit, .cfl-mark-evidence { border-color: var(--acid); color: var(--acid); }
.cfl-cancel { border-color: var(--magenta); color: var(--magenta); }
.cfl-btn:focus-visible, .cfl-commit-input:focus-visible {
  outline: 2px solid var(--magenta);
  outline-offset: 2px;
}

/* Status is text + data-state first; color is decoration only. */
.cfl-status { min-height: 1.5em; font-weight: 700; }
.cfl-status[data-state='crashed'] { border-left: 3px solid var(--magenta); padding-left: .5rem; }

/* Real table semantics (caption + th scope) with a readable terminal grid. */
.cfl-trace { width: 100%; border-collapse: collapse; font-size: .9em; }
.cfl-trace caption { text-align: left; color: var(--cyan); padding-bottom: .25rem; }
.cfl-trace-th, .cfl-trace-cell { border: 1px solid rgba(46, 230, 255, .28); padding: .35rem .5rem; text-align: left; }

@media (max-width: 390px) {
  .cfl-reels { flex-wrap: wrap; max-width: 100%; }
  .cfl-commit-row { display: grid; gap: .5rem; }
  .cfl-btn, .cfl-commit-input { width: 100%; }
  .cfl-trace { font-size: 1em; } /* scalable text stays readable at small widths */
}

/* Reduced motion disables every canary animation/transition outright. */
@media (prefers-reduced-motion: reduce) {
  #overlay .cfl-reel-cell, #overlay .cfl-reel-value,
  #overlay .cfl-btn, #overlay .cfl-commit-input,
  #overlay .cfl-status, #overlay .cfl-trace,
  #overlay .cfl-prefix-readout { animation: none !important; transition: none !important; }
}

/* --- Issue #10: syscall ABI analyzer (sa-*) ----------------------------------
   Dense two-column ABI/disassembly readout in KFC2 cyberdeck style. All rules
   are scoped to the .sa-* classes emitted by syscall-analyzer-ui.js — no
   universal selectors, so no other game's layout or colors change. Status,
   selection and evidence never rely on color alone: text labels plus
   data-state / aria-checked / is-evidence markers carry the meaning; borders,
   prefixes and weight reinforce it. */
#overlay .sa-notice {
  margin: 0 0 .6em;
  padding: .45em .7em;
  color: #d9ff8a;
  background: rgba(184, 255, 46, .08);
  border-left: 3px solid var(--acid);
  font-size: clamp(14px, 1.3vw, 16px); /* scalable, readable at every width */
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: .04em;
  text-shadow: none;
}

/* Two-column desktop comparison (Linux/i386 vs Linux/x86-64). */
#overlay .sa-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .9rem;
  margin-block: .7rem;
}
.sa-col { min-width: 0; }
.sa-compare-fieldset {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: .55rem .7rem;
  border: 1px solid rgba(46, 230, 255, .5);
}
.sa-legend {
  color: var(--cyan);
  font-weight: 700;
  letter-spacing: .1em;
  padding-inline: .35em;
  text-shadow: none;
}

/* Tables: full width plus scalable clamp font; long hex wraps inside the cell. */
#overlay .sa-table {
  width: 100%;
  border-collapse: collapse;
  font-size: clamp(14px, 1.25vw, 16px); /* scalable type, no fixed px body copy */
  color: #d8fbff;
  text-shadow: none;
}
/* Controlled horizontal scroll container for dense tables on narrow screens —
   the table scrolls inside this box (max-width plus overflow-x set to auto),
   never the viewport. */
.sa-table-scroll {
  box-sizing: border-box;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}
#overlay .sa-table caption {
  text-align: left;
  color: var(--acid);
  padding-bottom: .3em;
  letter-spacing: .06em;
}
.sa-th, .sa-row-th, .sa-td {
  border: 1px solid rgba(46, 230, 255, .28);
  padding: .35rem .5rem;
  text-align: left;
  vertical-align: top;
}
.sa-th { color: var(--cyan); font-weight: 700; }
.sa-row-th { color: rgba(127, 220, 255, .9); white-space: nowrap; }
#overlay .sa-mono {
  font-variant-numeric: tabular-nums;
  overflow-wrap: break-word; /* long hex wraps instead of widening the page */
}

/* Byte rows in the code window. Evidence is marked by border + prefix glyph,
   not color alone (is-evidence also drives an aria-label from the UI). */
#overlay .sa-byte-row.is-evidence { background: rgba(255, 61, 242, .18); }
.sa-byte-row.is-evidence .sa-byte-addr::before { content: '[E] '; color: var(--acid); font-weight: 700; }
.sa-reg-name.is-evidence { border-left: 3px solid var(--magenta); padding-left: calc(.5rem - 3px); }
.sa-reg-name.is-compare-value::after { content: ' <- compare'; color: var(--acid); font-weight: 700; white-space: nowrap; }

/* Questions: fieldset/legend + radiogroup of buttons. */
#overlay .sa-questions { margin-block: .8rem; display: grid; gap: .6rem; }
.sa-question {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: .5rem .7rem;
  border: 1px dashed rgba(46, 230, 255, .5);
}
.sa-question legend { color: #fff; font-weight: 700; text-shadow: none; padding-inline: .3em; }
.sa-options { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .4rem; }

/* Every interactive sa-* control is a >=44px touch target. */
#overlay .sa-btn, #overlay .sa-close {
  box-sizing: border-box;
  min-height: 44px;
  min-width: 44px;
  padding: .5rem .75rem;
  font: inherit;
  cursor: pointer;
  color: var(--cyan);
  background: transparent;
  border: 1px solid var(--cyan);
  text-shadow: none;
}
#overlay .sa-option[aria-checked='true'] {
  /* selected = white fill + magenta border + aria-checked (never color alone) */
  color: #fff;
  background: rgba(255, 61, 242, .28);
  border-color: var(--magenta);
}
#overlay .sa-option[aria-checked='true']::before { content: '> '; color: var(--acid); font-weight: 700; }
#overlay .sa-mark-evidence { border-color: var(--acid); color: var(--acid); }
#overlay .sa-execute { border-color: var(--acid); color: var(--acid); font-weight: 700; letter-spacing: .08em; }
#overlay .sa-cancel, #overlay .sa-close { border-color: var(--magenta); color: var(--magenta); }

/* Evidence readouts are explicit text outputs. */
.sa-byte-evidence, .sa-reg-evidence {
  display: block;
  min-height: 1.5em;
  margin-block: .3rem;
  padding-left: .4em;
  border-left: 2px solid rgba(46, 230, 255, .5);
  color: #d8fbff;
  font-variant-numeric: tabular-nums;
  overflow-wrap: break-word;
}

/* Status carries data-state + text; shape/border differ per state. */
#overlay .sa-status { min-height: 1.6em; margin-top: .5rem; color: #d8fbff; font-weight: 700; }
#overlay .sa-status[data-state='error'] { color: #fff; background: rgba(255, 61, 242, .16); border-left: 3px solid var(--magenta); padding-left: .5em; }
#overlay .sa-status[data-state='success'] { color: #0a0f0a; background: var(--acid); padding-inline: .4em; font-weight: 800; }
#overlay .sa-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Clear focus-visible ring on every interactive part (high contrast). */
#overlay .sa-btn:focus-visible, #overlay .sa-close:focus-visible { outline: 2px solid var(--magenta); outline-offset: 2px; }

@supports not selector(:focus-visible) {
  #overlay .sa-btn:focus, #overlay .sa-close:focus { outline: 2px solid var(--magenta); outline-offset: 2px; }
}

/* Mobile <=390px: single column, no viewport overflow (tables keep their own
   controlled horizontal scroll), full-width controls. */
@media (max-width: 390px) {
  #overlay .sa-compare { grid-template-columns: minmax(0, 1fr); }
  .sa-col, .sa-compare-fieldset, .sa-question { max-width: 100%; }
  .sa-options { flex-direction: column; }
  #overlay .sa-btn, #overlay .sa-close { width: 100%; min-height: 44px; font-size: clamp(14px, 3.6vw, 16px); }
  #overlay .sa-table { table-layout: fixed; }
}

/* Reduced motion disables every sa-related transition/animation outright. */
@media (prefers-reduced-motion: reduce) {
  #overlay .sa-notice, #overlay .sa-compare, #overlay .sa-col,
  #overlay .sa-table, #overlay .sa-th, #overlay .sa-row-th, #overlay .sa-td,
  #overlay .sa-byte-row.is-evidence, #overlay .sa-reg-name.is-evidence,
  #overlay .sa-question, #overlay .sa-options,
  #overlay .sa-btn, #overlay .sa-close, #overlay .sa-option[aria-checked='true'],
  #overlay .sa-mark-evidence, #overlay .sa-execute, #overlay .sa-cancel,
  #overlay .sa-byte-evidence, #overlay .sa-reg-evidence,
  #overlay .sa-status[data-state], #overlay .sa-live {
    animation: none !important;
    transition: none !important;
  }
}
/* --- End Issue #10 syscall ABI analyzer ------------------------------ */

/* --- Issue #11: synthetic exploit-chain validator -------------------- */
#overlay .ec-notice {
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid #9fd12f;
  border-left: 0.35rem solid #d8ff57;
  background: #10170d;
  color: #f2ffd0;
  font-size: clamp(0.9rem, 1.7vw, 1.05rem);
  line-height: 1.45;
}
#overlay .ec-evidence,
#overlay .ec-questions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  min-width: 0;
}
#overlay .ec-evidence-row,
#overlay .ec-question {
  min-width: 0;
  padding: 0.65rem;
  border: 1px solid #637052;
  background: #0b1009;
  color: #e7efdb;
  overflow-wrap: break-word;
}
#overlay .ec-evidence-row.is-evidence {
  border-left: 0.35rem solid #d8ff57;
  background: #15200e;
}
#overlay .ec-evidence-row.is-evidence::before {
  content: "[EVIDENCE] ";
  font-weight: 800;
  color: #fff;
}
#overlay .ec-badge,
#overlay .ec-marker {
  display: inline-block;
  margin-inline-end: 0.4rem;
  font-weight: 800;
  color: #d8ff57;
}
#overlay .ec-options,
#overlay .ec-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-width: 0;
}
#overlay .ec-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 0.55rem 0.75rem;
  border: 2px solid #77856a;
  border-radius: 0.2rem;
  background: #151c12;
  color: #f2f5ed;
  font: inherit;
  overflow-wrap: break-word;
}
#overlay .ec-option[aria-checked="true"] {
  border-width: 3px;
  border-color: #d8ff57;
  background: #273417;
}
#overlay .ec-option[aria-checked="true"]::before {
  content: "[SELECTED] ";
  font-weight: 800;
}
#overlay .ec-btn:focus,
#overlay .ec-btn:focus-visible {
  outline: 3px solid #fff36b;
  outline-offset: 3px;
}
#overlay .ec-status,
#overlay .ec-live {
  margin-top: 0.65rem;
  padding: 0.65rem;
  border: 1px solid #77856a;
  color: #f5f8ef;
  background: #11170e;
  font-size: clamp(0.9rem, 1.6vw, 1rem);
}
#overlay .ec-status[data-state="error"] {
  border-style: dashed;
  border-width: 3px;
}
#overlay .ec-status[data-state="success"] {
  border-style: double;
  border-width: 4px;
}
@media (max-width: 390px) {
  #overlay .ec-evidence,
  #overlay .ec-questions {
    grid-template-columns: minmax(0, 1fr);
  }
  #overlay .ec-controls,
  #overlay .ec-options {
    flex-direction: column;
  }
  #overlay .ec-btn {
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  #overlay .ec-notice,
  #overlay .ec-evidence,
  #overlay .ec-evidence-row,
  #overlay .ec-badge,
  #overlay .ec-ev-detail,
  #overlay .ec-questions,
  #overlay .ec-question,
  #overlay .ec-legend,
  #overlay .ec-options,
  #overlay .ec-btn,
  #overlay .ec-option,
  #overlay .ec-marker,
  #overlay .ec-controls,
  #overlay .ec-status,
  #overlay .ec-live {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
/* --- End Issue #11 synthetic exploit-chain validator ---------------- */

/* Keep the established canary reduced-motion contract as the final global
   reduced-motion block; legacy regression tests intentionally anchor to it. */
@media (prefers-reduced-motion: reduce) {
  #overlay .cfl-reel-cell, #overlay .cfl-reel-value,
  #overlay .cfl-btn, #overlay .cfl-commit-input,
  #overlay .cfl-status, #overlay .cfl-trace,
  #overlay .cfl-prefix-readout { animation: none !important; transition: none !important; }
}
