/* MOD-HEAVY — Ops-floor aesthetic (professional, cinematic; not CRT arcade) */

:root {
  --bg: #0b1018;
  --bg-elev: #121a26;
  --bg-panel: rgba(18, 26, 38, 0.92);
  --border: #243044;
  --border-hi: #3a516e;
  --cyan: #3ecfef;
  --cyan-dim: #1a8aa3;
  --cyan-glow: rgba(62, 207, 239, 0.28);
  --amber: #f0b429;
  --amber-dim: #a67c1a;
  --green: #3dd68c;
  --red: #f07178;
  --text: #d7e0ec;
  --muted: #7a8ba3;
  --font-sans: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --radius: 10px;
  --max: 1100px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
}

.grid-bg {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(62, 207, 239, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(62, 207, 239, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
  z-index: 0;
}

.scanline {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 50%,
    rgba(0, 0, 0, 0.04) 50%
  );
  background-size: 100% 4px;
  opacity: 0.35;
  z-index: 1;
}

.topbar,
.shell,
.footer {
  position: relative;
  z-index: 2;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 16, 24, 0.85);
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  color: var(--cyan);
  font-size: 1.4rem;
  text-shadow: 0 0 12px var(--cyan-glow);
}

.brand-title {
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.08em;
  font-size: 0.95rem;
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--muted);
}

.topbar-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.pill {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  letter-spacing: 0.04em;
}

.pill-sim {
  color: var(--amber);
  border-color: var(--amber-dim);
  background: rgba(240, 180, 41, 0.08);
}

.pill-def {
  color: var(--green);
  border-color: rgba(61, 214, 140, 0.35);
  background: rgba(61, 214, 140, 0.08);
}

.clock {
  color: var(--muted);
}

.shell {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.view {
  display: none;
  animation: fadeIn 0.35s ease;
}

.view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
  box-shadow: var(--shadow);
}

.hero h1,
.panel > h1 {
  margin: 0.35rem 0 0.75rem;
  font-size: clamp(1.45rem, 3.5vw, 2rem);
  line-height: 1.25;
  font-weight: 600;
}

.eyebrow {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
}

.lede {
  max-width: 52ch;
  color: var(--text);
}

.dim {
  color: var(--muted);
}

.tiny {
  font-size: 0.8rem;
}

em {
  font-style: normal;
  color: var(--cyan);
}

.feature-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  list-style: none;
  padding: 0;
  margin: 1.25rem 0;
}

.feature-row li {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  font-size: 0.85rem;
  background: rgba(0, 0, 0, 0.2);
}

.feature-row strong {
  display: block;
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  margin-bottom: 0.15rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

a.btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn {
  appearance: none;
  border: 1px solid var(--border-hi);
  background: var(--bg-elev);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.65rem 1.1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s, color 0.15s;
}

.btn:hover,
.btn:focus-visible {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-glow);
  outline: none;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-primary {
  background: linear-gradient(180deg, #1e6f82 0%, #155566 100%);
  border-color: var(--cyan-dim);
  color: #e8fbff;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: linear-gradient(180deg, #248196 0%, #1a6475 100%);
}

.btn-secondary {
  border-color: var(--cyan-dim);
  color: var(--cyan);
}

.btn-ghost {
  background: transparent;
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1.25rem;
}

.card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}

.card-code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--cyan-dim);
  margin: 0 0 0.65rem;
}

.muted-card {
  opacity: 0.85;
}

.card-wide {
  grid-column: 1 / -1;
}

.callout {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin: 1rem 0 1.25rem;
  font-size: 0.95rem;
}

.callout-warn {
  border-color: rgba(240, 180, 41, 0.45);
  background: rgba(240, 180, 41, 0.07);
}

.callout strong {
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.prose ul {
  margin: 0.5rem 0 1rem;
  padding-left: 1.2rem;
}

.prose li {
  margin: 0.35rem 0;
}

.triage-layout {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(280px, 1.2fr);
  gap: 1rem;
  align-items: start;
}

.alert-panel h2 {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  margin: 0.25rem 0 0.75rem;
  color: var(--amber);
}

.meta-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.3rem 0.75rem;
  margin: 0 0 1rem;
  font-size: 0.85rem;
}

.meta-list dt {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.meta-list dd {
  margin: 0;
}

.alert-summary {
  font-size: 0.95rem;
  margin: 0 0 1rem;
}

.subhead {
  margin: 0.85rem 0 0.4rem;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.ind-list,
.noise-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.88rem;
}

.ind-list li {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(36, 48, 68, 0.7);
}

.ind-list .ind-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--cyan-dim);
  text-transform: uppercase;
}

.noise-list li {
  position: relative;
  padding: 0.3rem 0 0.3rem 0.9rem;
  color: var(--muted);
}

.noise-list li::before {
  content: "·";
  position: absolute;
  left: 0;
  color: var(--border-hi);
}

.triage-steps {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.step-locked {
  opacity: 0.55;
  pointer-events: none;
}

.step-locked.unlocked {
  opacity: 1;
  pointer-events: auto;
}

.option-grid {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.85rem;
}

.opt {
  text-align: left;
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.opt:hover,
.opt:focus-visible {
  border-color: var(--cyan);
  outline: none;
  box-shadow: 0 0 0 2px var(--cyan-glow);
}

.opt .opt-detail {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.opt.selected {
  border-color: var(--cyan);
  background: rgba(62, 207, 239, 0.1);
}

.opt.best {
  border-color: var(--green);
  box-shadow: 0 0 0 1px rgba(61, 214, 140, 0.35);
}

.opt.poor {
  border-color: var(--red);
}

.opt:disabled {
  cursor: default;
}

.feedback {
  margin: 0.85rem 0 0;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.9rem;
  background: rgba(0, 0, 0, 0.3);
}

.feedback.good {
  border-color: rgba(61, 214, 140, 0.4);
  color: #c8f5df;
}

.feedback.ok {
  border-color: rgba(240, 180, 41, 0.4);
  color: #f5e6c0;
}

.feedback.bad {
  border-color: rgba(240, 113, 120, 0.4);
  color: #f5d0d2;
}

.score-banner {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.1rem;
  margin: 1rem 0 1.25rem;
  border-radius: 10px;
  border: 1px solid var(--border-hi);
  background: linear-gradient(120deg, rgba(62, 207, 239, 0.08), rgba(0, 0, 0, 0.2));
}

.score-num {
  font-family: var(--font-mono);
  font-size: 2.4rem;
  font-weight: 600;
  color: var(--cyan);
  min-width: 2.5rem;
  line-height: 1;
}

.score-label {
  font-weight: 600;
  font-size: 1.1rem;
}

.score-note {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.field-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.notes {
  width: 100%;
  resize: vertical;
  min-height: 120px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.5;
  padding: 0.75rem 0.9rem;
}

.notes:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-glow);
}

.lore-panel {
  margin-top: 1.35rem;
  padding: 1rem 1.1rem;
  border-radius: 10px;
  border: 1px dashed var(--cyan-dim);
  background: rgba(62, 207, 239, 0.05);
}

.lore-panel h2 {
  margin: 0.35rem 0 0.65rem;
  font-size: 1.05rem;
}

.lore-body {
  margin: 0;
  white-space: pre-wrap;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text);
}

.toast {
  margin-top: 0.85rem;
  color: var(--green);
  font-size: 0.9rem;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1rem 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--muted);
  max-width: var(--max);
  margin: 0 auto;
}

/* ============================================================
   Mission One · Phish in the Wire (js/m1.js)
   ============================================================ */

.m1-progress,
.m2-progress,
.m3-progress,
.m4-progress {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.m1-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.m1-steps li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.75rem 0.2rem 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.25);
}

.m1-step-num {
  display: inline-grid;
  place-items: center;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  border: 1px solid var(--border-hi);
  font-size: 0.68rem;
}

.m1-steps li.current {
  color: var(--cyan);
  border-color: var(--cyan-dim);
  box-shadow: 0 0 0 2px var(--cyan-glow);
}

.m1-steps li.current .m1-step-num {
  border-color: var(--cyan);
}

.m1-steps li.done {
  color: var(--green);
  border-color: rgba(61, 214, 140, 0.35);
}

.m1-steps li.done .m1-step-num {
  border-color: var(--green);
}

.m1-timer,
.m2-timer,
.m3-timer,
.m4-timer {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--amber);
  letter-spacing: 0.06em;
}

.comms {
  border: 1px solid var(--border);
  border-left: 3px solid var(--cyan-dim);
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  margin: 0 0 1rem;
  background: rgba(18, 26, 38, 0.92);
}

.comms-who {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--cyan);
}

.comms p {
  margin: 0.2rem 0 0;
  font-size: 0.92rem;
}

.m1-quote {
  margin: 0.75rem 0 1rem;
  padding: 0.6rem 0.9rem;
  border-left: 3px solid var(--amber-dim);
  background: rgba(240, 180, 41, 0.06);
  font-style: italic;
  color: #efe3c4;
}

.m1-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* --- mail client --- */

.mail-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 300px;
  gap: 1rem;
  align-items: start;
}

.mail-layout > *,
.doc-layout > * {
  min-width: 0;
}

.mail-inbox {
  padding: 1rem 0.75rem;
}

.inbox-list {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.inbox-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.6rem;
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-family: var(--font-sans);
  cursor: pointer;
}

.inbox-item:hover,
.inbox-item:focus-visible {
  border-color: var(--cyan);
  outline: none;
}

.inbox-item.active {
  border-color: var(--cyan-dim);
  background: rgba(62, 207, 239, 0.08);
}

.inbox-top {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  font-size: 0.78rem;
}

.inbox-from {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inbox-item.unread .inbox-from::before {
  content: "● ";
  color: var(--cyan);
}

.inbox-date {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  white-space: nowrap;
}

.inbox-subj {
  font-size: 0.78rem;
}

.inbox-prev {
  font-size: 0.72rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag {
  display: inline-block;
  align-self: flex-start;
  margin-top: 0.2rem;
  padding: 0.05rem 0.45rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  border: 1px solid var(--border);
}

.tag-red {
  color: var(--red);
  border-color: rgba(240, 113, 120, 0.45);
  background: rgba(240, 113, 120, 0.08);
}

.tag-cyan {
  color: var(--cyan);
  border-color: var(--cyan-dim);
  background: rgba(62, 207, 239, 0.06);
}

.mail-message {
  position: relative;
  padding-bottom: 2.6rem;
  min-width: 0;
}

.mail-note {
  margin: 0 0 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--cyan);
}

.mail-subject {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  line-height: 1.35;
}

.mail-head {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

.mail-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.6rem;
}

.mail-k {
  min-width: 4.8rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
}

.mail-v {
  flex: 1 1 14rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.mail-addr {
  margin-left: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
}

.mail-addr.revealed {
  color: var(--amber);
}

.mail-date {
  font-size: 0.78rem;
  color: var(--muted);
}

.mail-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.65rem 0;
}

.raw-headers {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0 0 0.85rem;
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.45);
  max-height: 22rem;
  overflow: auto;
}

.raw-block,
.hs-block {
  white-space: pre;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.5;
  color: #b9c6d8;
}

.mail-body {
  margin-top: 0.5rem;
  font-size: 0.93rem;
}

.mail-body p {
  margin: 0 0 0.8rem;
  overflow-wrap: anywhere;
}

.pre-line {
  white-space: pre-line;
}

.mail-blocked {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--amber);
}

.mail-attach {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}

.chip {
  border: 1px solid var(--border-hi);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  padding: 0.35rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  cursor: pointer;
}

.chip-inner {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.chip-icon {
  color: var(--red);
}

.mail-status {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.4rem 0.9rem;
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  background: rgba(0, 0, 0, 0.55);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--amber);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.12s;
}

.mail-status.visible {
  opacity: 1;
}

/* --- inspectable hotspots --- */

.hs {
  display: inline;
  margin: 0;
  padding: 0 0.1rem;
  border: 0;
  border-bottom: 1px dashed var(--cyan-dim);
  border-radius: 2px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  line-height: inherit;
  cursor: help;
  transition: background 0.12s, border-color 0.12s;
}

.hs:hover,
.hs:focus-visible {
  background: rgba(62, 207, 239, 0.12);
  border-bottom-color: var(--cyan);
  outline: none;
}

.hs-strong {
  font-weight: 600;
}

.hs-block,
.hs-pre {
  display: block;
  width: 100%;
  padding: 0.2rem 0.35rem;
  border: 1px dashed var(--cyan-dim);
}

.hs-pre {
  white-space: pre-line;
}

.hs.hs-block {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.5;
  white-space: pre;
  color: #b9c6d8;
}

.hs-chip {
  border: 1px dashed var(--cyan-dim);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: rgba(0, 0, 0, 0.3);
}

.mail-link {
  color: #7fb8ff;
  text-decoration: underline;
  border-bottom: 0;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.hs-active {
  background: rgba(62, 207, 239, 0.16);
  box-shadow: 0 0 0 2px var(--cyan-glow);
}

.hs-flag {
  background: rgba(240, 113, 120, 0.14);
  border-color: var(--red);
  border-bottom-style: solid;
}

.hs-clear {
  background: rgba(61, 214, 140, 0.1);
  border-color: var(--green);
  border-bottom-style: solid;
}

/* --- inspector + evidence board --- */

.inspector {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow: auto;
}

.insp-title {
  margin: 0.4rem 0 0.5rem;
  font-size: 1rem;
  color: var(--amber);
}

.insp-dl {
  margin: 0;
  font-size: 0.85rem;
}

.insp-dl dt {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-top: 0.45rem;
}

.insp-dl dd {
  margin: 0.1rem 0 0;
  overflow-wrap: anywhere;
}

.insp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.btn-flag {
  border-color: rgba(240, 113, 120, 0.55);
  color: #f5c2c5;
}

.btn-flag:hover,
.btn-flag:focus-visible {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(240, 113, 120, 0.25);
}

.evidence-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.8rem;
}

.ev-item {
  display: grid;
  grid-template-columns: 1.1rem 1fr auto;
  gap: 0.4rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(36, 48, 68, 0.7);
}

.ev-icon {
  color: var(--red);
}

.ev-benign .ev-icon {
  color: var(--green);
}

.ev-text strong {
  display: block;
  font-weight: 500;
}

.ev-ioc {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.ev-mark {
  font-size: 0.75rem;
}

.ev-right .ev-mark {
  color: var(--green);
}

.ev-wrong .ev-mark {
  color: var(--red);
}

/* --- checkbox lists (justify / contain) --- */

.chk-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.chk {
  display: grid;
  grid-template-columns: 1.2rem 1fr;
  gap: 0.6rem;
  align-items: start;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.92rem;
  cursor: pointer;
}

.chk:hover {
  border-color: var(--border-hi);
}

.chk input {
  margin-top: 0.25rem;
  accent-color: var(--cyan);
}

.chk-text .opt-detail,
.chk-text .opt-note {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.chk-text .opt-note {
  color: inherit;
  opacity: 0.9;
}

.chk-good {
  border-color: rgba(61, 214, 140, 0.5);
  color: #c8f5df;
}

.chk-bad {
  border-color: rgba(240, 113, 120, 0.5);
  color: #f5d0d2;
}

.chk-missed {
  border-style: dashed;
  border-color: rgba(240, 180, 41, 0.5);
  color: #f5e6c0;
}

.chk-neutral {
  border-color: var(--cyan-dim);
}

/* --- logs --- */

.log-block {
  margin-bottom: 1rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.table-wrap:focus-visible {
  outline: 2px solid var(--cyan-dim);
}

.log-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.74rem;
}

.log-table th,
.log-table td {
  padding: 0.4rem 0.6rem;
  text-align: left;
  border-bottom: 1px solid rgba(36, 48, 68, 0.7);
  white-space: nowrap;
}

.log-table thead th {
  color: var(--cyan-dim);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  background: rgba(0, 0, 0, 0.3);
}

.log-table tbody tr:hover {
  background: rgba(62, 207, 239, 0.05);
}

.exec-log {
  list-style: none;
  margin: 0;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.4);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.55;
}

.log-line {
  padding: 0.25rem 0;
}

.log-ok { color: #c8f5df; }
.log-info { color: var(--cyan); }
.log-bad { color: #f5d0d2; }
.log-miss { color: var(--amber); }

/* --- document + debrief --- */

.doc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(240px, 1fr);
  gap: 1rem;
  align-items: start;
}

.field {
  margin-top: 0.9rem;
}

.breakdown-table th {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--text);
  width: 7rem;
}

.breakdown-table td {
  white-space: normal;
}

.score-cell {
  color: var(--cyan);
  font-weight: 600;
  width: 6rem;
}

.gap-list {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.86rem;
}

.gap-list li {
  margin: 0.3rem 0;
}

.report-preview {
  margin: 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.4);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  max-height: 24rem;
  overflow: auto;
}

.hook-panel {
  border-color: rgba(240, 180, 41, 0.55);
  background: rgba(240, 180, 41, 0.05);
}

.hook-panel .eyebrow {
  color: var(--amber);
}

.text-link {
  color: var(--cyan);
}


/* ============================================================
   Mission Two · Ghost Process (js/m2.js)
   Reuses the Mission One layout (.mail-layout, inspector, evidence
   board, logs, debrief). Additions: evidence console panes.
   ============================================================ */

/* console: sources as a tab row on top, evidence pane + inspector below */
.mail-layout.m2-console {
  grid-template-columns: minmax(0, 1fr) 300px;
}

.m2-console .mail-inbox {
  grid-column: 1 / -1;
  padding: 0.75rem;
}

.m2-console .inbox-list {
  flex-direction: row;
  overflow-x: auto;
  padding-bottom: 0.15rem;
}

.m2-console .inbox-list li {
  flex: 1 1 0;
  min-width: 160px;
}

.m2-console .inbox-item {
  height: 100%;
}

.m2-pane {
  min-width: 0;
}

.m2-pane .log-table {
  font-size: 0.7rem;
}

.m2-pane .log-table th,
.m2-pane .log-table td,
#m2-logs .log-table td {
  padding: 0.35rem 0.45rem;
}

/* long cells wrap so key columns (paths, IPs, sizes) stay on screen; short ones don't */
.log-table td.m2-wrap {
  white-space: normal;
  overflow-wrap: break-word;
  min-width: 9rem;
}

.m2-meta {
  margin: 0 0 0.85rem;
  font-size: 0.85rem;
}

.m2-meta dd {
  overflow-wrap: anywhere;
}

/* agent transcript */
.m2-term {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.5);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  line-height: 1.55;
  color: #b9c6d8;
  max-height: 34rem;
  overflow: auto;
}

.m2-term-line {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.m2-term-head {
  color: var(--cyan);
}

.hs.hs-block.m2-term-hs {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.74rem;
}

/* PR diff */
.m2-diff {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0 0 0.85rem;
}

.m2-diff-file {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.m2-diff-path {
  padding: 0.4rem 0.7rem;
  border-bottom: 1px solid var(--border);
  background: rgba(62, 207, 239, 0.06);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--cyan);
}

.m2-diff-hunk {
  padding: 0.2rem 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.m2-diff-line,
.hs.hs-block.m2-diff-line {
  padding: 0.05rem 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.m2-add {
  background: rgba(61, 214, 140, 0.08);
  color: #c8f5df;
}

.m2-del {
  background: rgba(240, 113, 120, 0.08);
  color: #f5d0d2;
}

.m2-ctx {
  color: #b9c6d8;
}

.hs.hs-block.m2-diff-line {
  border-radius: 0;
}

/* row-level hotspots in log tables */
.hs-row {
  cursor: help;
  outline: none;
}

.log-table tbody tr.hs-row td {
  border-bottom: 1px dashed var(--cyan-dim);
}

.log-table tbody tr.hs-row:hover,
.log-table tbody tr.hs-row:focus-visible {
  background: rgba(62, 207, 239, 0.12);
}

.log-table tbody tr.hs-row.hs-active {
  background: rgba(62, 207, 239, 0.16);
  box-shadow: inset 0 0 0 2px var(--cyan-glow);
}

.log-table tbody tr.hs-row.hs-flag {
  background: rgba(240, 113, 120, 0.12);
}

.log-table tbody tr.hs-row.hs-flag td {
  border-bottom: 1px solid var(--red);
}

.log-table tbody tr.hs-row.hs-clear {
  background: rgba(61, 214, 140, 0.08);
}

.log-table tbody tr.hs-row.hs-clear td {
  border-bottom: 1px solid var(--green);
}

/* evidence board items jump back to their source */
.ev-jump {
  cursor: pointer;
}

.ev-jump:hover strong,
.ev-jump:focus-visible strong {
  color: var(--cyan);
}

.ev-jump:focus-visible {
  outline: 1px solid var(--cyan-dim);
}

/* decide: multiple scope questions */
.m2-scope-q + .m2-scope-q {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.m2-scope-prompt {
  margin: 0.2rem 0 0;
  font-weight: 600;
}

/* ============================================================
   Mission Three · Exfil Whisper (js/m3.js)
   Same evidence console as Mission Two. js/m3.js emits m3-* class
   names, so the console, transcript, table, and scope rules are
   mirrored here under the m3 prefix (missions never share hooks).
   ============================================================ */

.mail-layout.m3-console {
  grid-template-columns: minmax(0, 1fr) 300px;
}

.m3-console .mail-inbox {
  grid-column: 1 / -1;
  padding: 0.75rem;
}

.m3-console .inbox-list {
  flex-direction: row;
  overflow-x: auto;
  padding-bottom: 0.15rem;
}

.m3-console .inbox-list li {
  flex: 1 1 0;
  min-width: 160px;
}

.m3-console .inbox-item {
  height: 100%;
}

.m3-pane {
  min-width: 0;
}

.m3-pane .log-table {
  font-size: 0.7rem;
}

.m3-pane .log-table th,
.m3-pane .log-table td,
#m3-logs .log-table td {
  padding: 0.35rem 0.45rem;
}

.log-table td.m3-wrap {
  white-space: normal;
  overflow-wrap: break-word;
  min-width: 9rem;
}

.m3-meta {
  margin: 0 0 0.85rem;
  font-size: 0.85rem;
}

.m3-meta dd {
  overflow-wrap: anywhere;
}

/* scheduled-task listing (terminal kind) */
.m3-term {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.5);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  line-height: 1.55;
  color: #b9c6d8;
  max-height: 34rem;
  overflow: auto;
}

.m3-term-line {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.m3-term-head {
  color: var(--cyan);
}

.hs.hs-block.m3-term-hs {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.74rem;
}

/* decide: multiple scope questions */
.m3-scope-q + .m3-scope-q {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.m3-scope-prompt {
  margin: 0.2rem 0 0;
  font-weight: 600;
}

/* ============================================================
   Mission Four · Lantern Court (js/m4.js)
   Same evidence console as Mission Three. js/m4.js emits m4-* class
   names, so the console, transcript, table, and scope rules are
   mirrored here under the m4 prefix (missions never share hooks).
   ============================================================ */

.mail-layout.m4-console {
  grid-template-columns: minmax(0, 1fr) 300px;
}

.m4-console .mail-inbox {
  grid-column: 1 / -1;
  padding: 0.75rem;
}

.m4-console .inbox-list {
  flex-direction: row;
  overflow-x: auto;
  padding-bottom: 0.15rem;
}

.m4-console .inbox-list li {
  flex: 1 1 0;
  min-width: 160px;
}

.m4-console .inbox-item {
  height: 100%;
}

.m4-pane {
  min-width: 0;
}

.m4-pane .log-table {
  font-size: 0.7rem;
}

.m4-pane .log-table th,
.m4-pane .log-table td,
#m4-logs .log-table td {
  padding: 0.35rem 0.45rem;
}

.log-table td.m4-wrap {
  white-space: normal;
  overflow-wrap: break-word;
  min-width: 9rem;
}

.m4-meta {
  margin: 0 0 0.85rem;
  font-size: 0.85rem;
}

.m4-meta dd {
  overflow-wrap: anywhere;
}

/* scheduled-task listing (terminal kind) */
.m4-term {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.5);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  line-height: 1.55;
  color: #b9c6d8;
  max-height: 34rem;
  overflow: auto;
}

.m4-term-line {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.m4-term-head {
  color: var(--cyan);
}

.hs.hs-block.m4-term-hs {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.74rem;
}

/* decide: multiple scope questions */
.m4-scope-q + .m4-scope-q {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.m4-scope-prompt {
  margin: 0.2rem 0 0;
  font-weight: 600;
}


@media (max-width: 1000px) {
  .mail-layout,
  .mail-layout.m2-console,
  .mail-layout.m3-console,
  .mail-layout.m4-console {
    grid-template-columns: minmax(0, 1fr);
  }

  .inspector {
    position: static;
    max-height: none;
  }

  .inbox-list {
    flex-direction: row;
    overflow-x: auto;
  }

  .inbox-list li {
    min-width: 200px;
  }

  .doc-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 860px) {
  .feature-row {
    grid-template-columns: 1fr 1fr;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .triage-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .feature-row {
    grid-template-columns: 1fr;
  }

  .ind-list li {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .shell {
    padding: 1rem 0.85rem 2.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .view {
    animation: none;
  }

  html {
    scroll-behavior: auto;
  }
}
