/* =====================================================================
   blackbox-timeline.css
   The incident replay deck. Inherits site tokens with hex fallbacks,
   same idiom as system-map.css; the 64px grid marks it as another
   panel of the same machine.
   ===================================================================== */

.bbx-section { padding: 5rem 0; border-bottom: 1px solid var(--border, rgba(255,255,255,0.08)); }

.bbx-statusline { font-size: 11px; letter-spacing: 0.05em; color: var(--text-dim, #aaa9a0); }

#blackbox-host {
  position: relative;
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(245,166,35,0.05), transparent 55%),
    var(--bg-1, #111118);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 8px;
  padding: 16px;
  overflow: hidden;
  font-family: var(--mono, 'IBM Plex Mono', monospace);
}
#blackbox-host::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
}
#blackbox-host > * { position: relative; }

/* ── Top row: picker + badges ─────────────────────────────────────── */
.bbx-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }

.bbx-picker {
  background: var(--bg-2, #1a1a24);
  border: 1px solid var(--border-hi, rgba(255,255,255,0.16));
  border-radius: 4px;
  color: var(--text, #e8e8e0);
  font-family: inherit;
  font-size: 12px;
  padding: 6px 8px;
  max-width: 100%;
}
.bbx-picker:focus-visible { outline: none; border-color: var(--accent, #f5a623); }

.bbx-badges { display: flex; gap: 6px; }
.bbx-badge {
  font-size: 10px; letter-spacing: 0.08em;
  color: var(--text-faint, #555560);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 3px;
  padding: 3px 7px;
}
.bbx-badge-sealed { color: #4ade80; border-color: rgba(74,222,128,0.35); }
.bbx-badge-open   { color: var(--accent, #f5a623); border-color: rgba(245,166,35,0.35); }

/* ── Readout ──────────────────────────────────────────────────────── */
.bbx-readout { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.bbx-time { font-size: 22px; color: var(--text, #e8e8e0); letter-spacing: 0.06em; }
.bbx-time-note { font-size: 10px; color: var(--text-faint, #555560); letter-spacing: 0.1em; }
.bbx-replay {
  margin-left: auto;
  background: none;
  border: 1px solid var(--border-hi, rgba(255,255,255,0.16));
  border-radius: 4px;
  color: var(--accent, #f5a623);
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 5px 10px;
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.bbx-replay:hover, .bbx-replay:focus-visible { border-color: var(--accent, #f5a623); outline: none; }

/* ── Track: aftermath shade, marker layer, the scrubber ───────────── */
.bbx-track { position: relative; padding: 18px 0 14px; }

.bbx-aftermath {
  position: absolute; top: 0; bottom: 0; right: 0;
  background: linear-gradient(90deg, rgba(226,75,74,0.06), rgba(226,75,74,0.12));
  border-left: 1px dashed rgba(226,75,74,0.45);
  pointer-events: none;
}

.bbx-markers { position: absolute; left: 0; right: 0; top: 2px; height: 14px; pointer-events: none; }
.bbx-mk { position: absolute; transform: translateX(-50%); }
.bbx-mk-info    { width: 2px; height: 8px; top: 6px; background: var(--text-faint, #555560); }
.bbx-mk-success { width: 2px; height: 8px; top: 6px; background: #4ade80; }
.bbx-mk-warning { width: 2px; height: 11px; top: 3px; background: var(--accent, #f5a623); }
.bbx-mk-failure { width: 3px; height: 14px; top: 0; background: #e24b4a; }
.bbx-mk-deploy {
  width: 0; height: 0; top: 4px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 7px solid var(--accent, #f5a623);
  background: none;
}
.bbx-mk-trigger {
  width: 8px; height: 8px; top: -2px;
  background: #e24b4a;
  transform: translateX(-50%) rotate(45deg);
  box-shadow: 0 0 0 3px rgba(226,75,74,0.25);
}

.bbx-scrub {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  height: 4px;
  background: var(--bg-2, #1a1a24);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 2px;
  cursor: pointer;
}
.bbx-scrub::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px; height: 20px;
  background: var(--accent, #f5a623);
  border-radius: 2px;
  cursor: ew-resize;
}
.bbx-scrub::-moz-range-thumb {
  width: 10px; height: 20px;
  background: var(--accent, #f5a623);
  border: none;
  border-radius: 2px;
  cursor: ew-resize;
}
.bbx-scrub:focus-visible { outline: 1px solid var(--accent, #f5a623); outline-offset: 3px; }

/* ── Gauges ───────────────────────────────────────────────────────── */
.bbx-gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 6px 18px; margin: 10px 0 14px; }
.bbx-gauge { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.bbx-gauge-label { width: 62px; color: var(--text-faint, #555560); letter-spacing: 0.08em; text-transform: uppercase; }
.bbx-gauge-bar {
  flex: 1; height: 6px;
  background: var(--bg-2, #1a1a24);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 2px;
  overflow: hidden;
}
.bbx-gauge-fill { display: block; height: 100%; background: var(--accent, #f5a623); }
.bbx-gauge-val { min-width: 72px; text-align: right; color: var(--text-dim, #aaa9a0); }
.bbx-offline { font-size: 11.5px; color: var(--text-faint, #555560); padding: 6px 0 10px; }

/* ── Event feed ───────────────────────────────────────────────────── */
.bbx-feed { border-top: 1px solid var(--border, rgba(255,255,255,0.08)); padding-top: 8px; max-height: 210px; overflow-y: auto; }
.bbx-ev { display: flex; align-items: baseline; gap: 8px; font-size: 11.5px; padding: 2px 0; color: var(--text-dim, #aaa9a0); }
.bbx-ev-t { color: var(--text-faint, #555560); }
.bbx-ev-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; align-self: center; background: var(--text-faint, #555560); }
.bbx-ev-success .bbx-ev-dot { background: #4ade80; }
.bbx-ev-warning .bbx-ev-dot { background: var(--accent, #f5a623); }
.bbx-ev-failure .bbx-ev-dot { background: #e24b4a; }
.bbx-ev-dialect { color: var(--text-faint, #555560); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; min-width: 52px; }
.bbx-ev-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bbx-ev-trig {
  color: #e24b4a; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  border: 1px solid rgba(226,75,74,0.45); border-radius: 3px; padding: 0 5px;
}
.bbx-ev-latest .bbx-ev-title { color: var(--text, #e8e8e0); }
.bbx-ev-none { color: var(--text-faint, #555560); }

.bbx-foot { margin-top: 10px; font-size: 10px; letter-spacing: 0.05em; color: var(--text-faint, #555560); }

.bbx-empty { font-size: 12px; color: var(--text-dim, #aaa9a0); padding: 8px 0; }
.t-dim { color: var(--text-dim, #aaa9a0); }
.t-faint { color: var(--text-faint, #555560); }
.t-ok { color: #4ade80; }
.t-err { color: #e24b4a; }

@media (max-width: 720px) {
  .bbx-time { font-size: 18px; }
  .bbx-gauge-val { min-width: 60px; }
}
