/* Drill Deck app styles — layered on top of tokens.css. Nav shell (§A), per-client card (§B),
   campaign cards (§C), REPLAY controls (§D.3), honesty-rule visual language (§E). */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--canvas-2);
  color: var(--ink);
  padding: 0.5rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* ── A.1 nav shell ─────────────────────────────────────────────────────────────────────── */

.shell {
  display: flex;
  min-height: 100vh;
}

.sidenav {
  width: 220px;
  flex-shrink: 0;
  padding: 1.5rem 1rem;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.sidenav .brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  margin: 0 0.5rem 1.25rem;
  color: inherit;
  text-decoration: none;
}
/* SnapStream family group (added 2026-08-03, cross-property nav fix) — same .navitem/.disabled/
   .note classes as the rest of the sidenav, just visually separated with the divider color
   already used for other hairlines in this file (var(--line)). */
.navfamily {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
}
.navitem {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: 0.6rem;
  color: var(--ink-dim);
  text-decoration: none;
  font-size: 0.92rem;
  transition: background 150ms ease, color 150ms ease;
}
.navitem:hover { background: var(--glass-fill); color: var(--ink); }
.navitem[aria-current="page"] {
  background: var(--glass-fill);
  color: var(--ink);
  border: 1px solid var(--glass-border);
}
.navitem.disabled {
  color: var(--ink-faint);
  cursor: default;
  pointer-events: none;
}
.navitem .note { display: block; font-size: 0.72rem; color: var(--ink-faint); margin-top: 0.1rem; }

.hamburger {
  display: none;
  position: fixed;
  top: 0.85rem;
  left: 0.85rem;
  z-index: 60;
  width: 44px;
  height: 44px;
  border-radius: 0.6rem;
  border: 1px solid var(--glass-border);
  background: var(--glass-fill);
  color: var(--ink);
  font-size: 1.1rem;
  cursor: pointer;
}

.main {
  flex: 1;
  min-width: 0;
  padding: 1.25rem 1.5rem 4rem;
}

@media (max-width: 1023px) {
  .sidenav {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    width: 78vw;
    max-width: 300px;
    background: var(--canvas);
    transform: translateX(-100%);
    transition: transform 220ms ease;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.4);
    /* Clear the fixed hamburger's footprint (top:0.85rem, 44px tall -> bottom edge ~3.6rem):
       same 4rem offset .main already uses for the same reason, so the drawer's own "SnapStream
       Drill Deck" title never sits under the toggle button that stays fixed above it. */
    padding-top: 4rem;
  }
  .sidenav.open { transform: translateX(0); }
  .hamburger { display: block; }
  .main { padding-top: 4rem; }
  .navshade {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 45;
  }
  .navshade.open { display: block; }
}

/* ── E.1 rehearsal/live/replay banner — full width, never a corner tag ──────────────────── */

.banner {
  width: 100%;
  border-radius: 0.9rem;
  padding: 0.65rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-align: center;
  border: 1px solid var(--glass-border);
}
.banner.rehearsal { background: var(--wait-dim); color: var(--wait); }
.banner.replay { background: var(--ok-dim); color: var(--ok); }
.banner .sep { opacity: 0.6; font-weight: 400; margin: 0 0.4em; }

/* ── shared card chrome ────────────────────────────────────────────────────────────────── */

.card { padding: 1.1rem 1.25rem; margin-bottom: 1rem; }
.card h3 { margin: 0 0 0.6rem; font-family: var(--font-display); font-size: 1rem; }
.muted { color: var(--ink-dim); font-size: 0.85rem; }
.faint { color: var(--ink-faint); font-size: 0.78rem; }
.unavailable {
  color: var(--ink-faint);
  font-style: italic;
  font-size: 0.85rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1rem;
}
@media (max-width: 1023px) {
  .grid { grid-template-columns: 1fr; }
}

/* ── B.2 client-id badge ──────────────────────────────────────────────────────────────── */

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.pubkey { font-family: var(--font-mono); font-size: 0.85rem; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.2em 0.55em;
  border-radius: 999px;
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  color: var(--ink-dim);
}
.badge .basis { color: var(--ink-faint); }
.fault-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--bad);
  background: var(--bad-dim);
  border-radius: 999px;
  padding: 0.2em 0.6em;
  border: 1px solid var(--bad);
}

/* ── B.3 stake tick gauge ─────────────────────────────────────────────────────────────── */

.stake-row { margin: 0.5rem 0 0.9rem; }
.stake-hero { font-size: 1.6rem; font-weight: 700; font-family: var(--font-display); }
.stake-denom { font-size: 0.78rem; color: var(--ink-dim); }

/* ── B.4 dominant state + timeline lane ──────────────────────────────────────────────── */

.dominant-state {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 0.92rem;
  margin-bottom: 0.35rem;
}
.dominant-state .label { font-weight: 600; }
.dominant-state.stale .label { color: var(--ink-faint); font-style: italic; }

.timeline-track {
  position: relative;
  display: flex;
  width: 100%;
  height: 22px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--canvas-2);
}
.tl-seg {
  position: relative;
  min-width: 6px;
  height: 100%;
  cursor: pointer;
  border-right: 1px solid var(--canvas);
}
.tl-seg:last-child { border-right: none; }
.tl-seg .hit {
  position: absolute;
  inset: -6px -3px;
}
.tl-seg.gap {
  background-image: repeating-linear-gradient(
    45deg, var(--ink-faint) 0 3px, transparent 3px 8px
  );
  background-color: transparent;
  opacity: 0.55;
}
.tl-seg.fault { background: var(--bad); }
.tl-legend { margin-top: 0.3rem; font-size: 0.7rem; color: var(--ink-faint); }
.tl-note { font-size: 0.72rem; color: var(--ink-faint); margin-top: 0.25rem; font-style: italic; }
.time-in-state { text-align: right; font-size: 0.78rem; color: var(--ink-dim); margin-top: 0.15rem; }

/* segment popover / tooltip */
.tl-pop {
  position: absolute;
  z-index: 30;
  bottom: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  padding: 0.55rem 0.7rem;
  border-radius: 0.6rem;
  background: var(--canvas-2);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  font-size: 0.78rem;
  color: var(--ink);
  display: none;
}
.tl-pop.open { display: block; }

/* ── B.5 writ-step checklist ──────────────────────────────────────────────────────────── */

.checklist { list-style: none; margin: 0.75rem 0 0; padding: 0; font-size: 0.85rem; }
.checklist li {
  display: flex;
  gap: 0.55rem;
  align-items: baseline;
  padding: 0.28rem 0;
  border-bottom: 1px dashed var(--line);
}
.checklist li:last-child { border-bottom: none; }
.mark { width: 1.1em; text-align: center; font-weight: 700; flex-shrink: 0; }
.mark.pass { color: var(--ok); }
.mark.fail { color: var(--bad); }
.mark.pending { color: var(--wait); }
.mark.unavailable { color: var(--ink-faint); }
.step-label { font-weight: 600; width: 3.4em; flex-shrink: 0; color: var(--ink-dim); }
.step-detail { color: var(--ink-dim); }

/* ── B.7 last-seen freshness ──────────────────────────────────────────────────────────── */

.last-seen { margin-top: 0.6rem; font-size: 0.76rem; color: var(--ink-faint); }
.last-seen.stale { color: var(--wait); }

/* ── C campaign cards ─────────────────────────────────────────────────────────────────── */

.campaign-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.kv { display: flex; justify-content: space-between; font-size: 0.85rem; padding: 0.2rem 0; }
.kv .k { color: var(--ink-dim); }

.meter-track {
  position: relative;
  width: 100%;
  height: 18px;
  border-radius: 6px;
  background: var(--canvas-2);
  border: 1px solid var(--line);
  overflow: hidden;
  margin: 0.5rem 0 0.3rem;
}
.meter-fill { height: 100%; background: var(--ok); transition: width 300ms ease; }
.meter-required {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--ink);
}
.meter-unreachable {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  background-image: repeating-linear-gradient(45deg, var(--bad) 0 3px, transparent 3px 8px);
  opacity: 0.5;
}

.scenario-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  align-items: baseline;
  padding: 0.9rem 1.1rem;
  margin-bottom: 1rem;
}
.scenario-banner .sid { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.verdict-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15em 0.6em;
  border-radius: 999px;
}
.verdict-pill.pass { color: var(--ok); background: var(--ok-dim); }
.verdict-pill.fail_scoped { color: var(--bad); background: var(--bad-dim); }
.verdict-pill.blocked { color: var(--wait); background: var(--wait-dim); }
.criterion-quote {
  width: 100%;
  font-size: 0.85rem;
  color: var(--ink-dim);
  border-left: 2px solid var(--glass-border);
  padding-left: 0.7rem;
  margin: 0.4rem 0 0;
}

/* ── C.5 scrolling event log ──────────────────────────────────────────────────────────── */

.eventlog {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  max-height: 16rem;
  overflow-y: auto;
  line-height: 1.55;
  padding: 0.7rem 0.85rem;
}
.eventlog .ln { white-space: pre-wrap; word-break: break-word; }
.eventlog .ts { color: var(--ink-faint); }
.eventlog .scen { color: var(--blue); }
.eventlog .verdict-PASS { color: var(--ok); }
.eventlog .verdict-FAIL_SCOPED { color: var(--bad); }
.eventlog .verdict-BLOCKED { color: var(--wait); }
.eventlog .gap { color: var(--ink-faint); font-style: italic; }
.eventlog .disagree { color: var(--bad); font-weight: 600; }
.eventlog .cursor {
  display: inline-block;
  width: 0.55em;
  background: var(--ok);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.eventlog .ln.future { opacity: 0.18; }

.replay-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}
.replay-controls button {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass-fill);
  color: var(--ink);
  cursor: pointer;
}
.replay-controls button[aria-pressed="true"] { background: var(--ok-dim); color: var(--ok); border-color: var(--ok); }
.replay-controls .clock { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-dim); }

/* ── scenario picker (Drill Deck landing) ────────────────────────────────────────────── */

.picker-list { list-style: none; margin: 0; padding: 0; }
.picker-list li { border-bottom: 1px solid var(--line); }
.picker-list a, .picker-list .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0.2rem;
  text-decoration: none;
  color: var(--ink);
}
.picker-list a:hover { color: var(--blue); }
.picker-list .id { font-family: var(--font-mono); }
.picker-list .no-detail { color: var(--ink-faint); font-size: 0.78rem; }

footer.pagefoot {
  margin-top: 2rem;
  font-size: 0.72rem;
  color: var(--ink-faint);
}
