:root {
  color-scheme: dark;
  --bg: #0b1118;
  --card: #111a24;
  --edge: #243244;
  --text: #e9f0f8;
  --muted: #9ab0c8;
  --accent: #3e8eff;
  --danger: #d95e5e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background: radial-gradient(circle at top, #15253a 0%, var(--bg) 60%);
  color: var(--text);
}

.mvp-breadcrumb {
  width: min(1050px, 94vw);
  margin: 18px auto 0;
  font-size: 0.9rem;
}

.mvp-breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}

.mvp-breadcrumb a:hover {
  text-decoration: underline;
}

.mvp-breadcrumb-sep {
  color: var(--muted);
  user-select: none;
}

.container {
  width: min(1050px, 94vw);
  margin: 28px auto;
  display: grid;
  gap: 14px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.page-header h1 {
  margin: 0;
  font-size: 1.7rem;
}

.page-header p {
  margin: 5px 0 0;
  color: var(--muted);
}

.badge {
  border: 1px solid #537198;
  background: #182637;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
}

button.badge {
  color: #e6f1ff;
}

.card {
  background: linear-gradient(180deg, #162332, var(--card));
  border: 1px solid var(--edge);
  border-radius: 12px;
  padding: 14px;
}

.mission-session-idle-hint {
  margin: 0 0 12px;
  max-width: 72ch;
  line-height: 1.45;
}

.mission-session-active-summary {
  margin: 0 0 12px;
  line-height: 1.45;
}

.mission-session-active-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.toolbar p {
  margin: 0;
}

.mvp-cloud-sync {
  margin: 0;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.35;
}

.mvp-cloud-sync::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mvp-cloud-sync.mvp-cloud-sync--pending::before {
  background: #e8a542;
  box-shadow: 0 0 0 2px rgba(232, 165, 66, 0.35);
}

.mvp-cloud-sync.mvp-cloud-sync--synced::before {
  background: #5cd18a;
}

.mvp-cloud-sync.mvp-cloud-sync--offline::before {
  background: #6b8fb3;
}

.mvp-pilot-pull-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
  width: 100%;
  max-width: 420px;
  font-size: 0.78rem;
  line-height: 1.35;
}

.mvp-pilot-pull-label {
  display: block;
}

.mvp-pilot-pull-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(120, 150, 185, 0.22);
  overflow: hidden;
}

.mvp-pilot-pull-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4a8fd4, #6bc4a8);
  transition: width 0.25s ease;
}

.mvp-pilot-pull-panel.mvp-pilot-pull-panel--ready .mvp-pilot-pull-track {
  background: rgba(92, 209, 138, 0.22);
}

.mvp-pilot-pull-panel.mvp-pilot-pull-panel--ready .mvp-pilot-pull-fill {
  background: linear-gradient(90deg, #3d9a6a, #5cd18a);
}

/* DO-NOT-RELOAD banner: shown whenever un-synced mission data could be lost by refreshing. */
.do-not-reload-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 12px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 2px solid #f0a13a;
  background: rgba(232, 165, 66, 0.16);
  color: #ffd9a6;
  font-size: 0.95rem;
  line-height: 1.4;
  box-shadow: 0 0 0 1px rgba(232, 165, 66, 0.2) inset;
}

/*
 * Must override `display: flex` above: otherwise `[hidden]` is ineffective (same specificity,
 * later rule wins) and the "hidden" branch in JS still leaves a visible yellow strip + default title.
 */
.do-not-reload-banner[hidden] {
  display: none !important;
}

.do-not-reload-banner.do-not-reload-banner--critical {
  border-color: #ff5b5b;
  background: rgba(255, 91, 91, 0.18);
  color: #ffd1d1;
  animation: do-not-reload-pulse 1.8s ease-in-out infinite;
}

@keyframes do-not-reload-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(255, 91, 91, 0.35) inset, 0 0 0 0 rgba(255, 91, 91, 0); }
  50% { box-shadow: 0 0 0 1px rgba(255, 91, 91, 0.55) inset, 0 0 12px 0 rgba(255, 91, 91, 0.55); }
}

.do-not-reload-banner-icon {
  font-size: 1.35rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
}

.do-not-reload-banner-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.do-not-reload-banner-title {
  font-size: 1rem;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.do-not-reload-banner-text {
  font-size: 0.9rem;
  color: inherit;
  opacity: 0.95;
}

.do-not-reload-banner-action {
  flex-shrink: 0;
  margin-left: auto;
  align-self: center;
  padding: 8px 14px;
  border: 1px solid currentColor;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.05s ease;
}

.do-not-reload-banner-action:hover:not([disabled]) {
  background: currentColor;
  color: #111a24;
}

.do-not-reload-banner-action:active:not([disabled]) {
  transform: translateY(1px);
}

.do-not-reload-banner-action[disabled] {
  opacity: 0.55;
  cursor: progress;
}

/* Mission Overwatch: subtle notice when the browser reports no internet (LAN bridge may still work). */
.mvp-network-offline-banner {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #3d5270;
  background: rgba(20, 32, 52, 0.85);
  color: #b8c8e6;
  line-height: 1.45;
}

.mvp-network-offline-banner[hidden] {
  display: none !important;
}

.sticky-summary {
  position: sticky;
  top: 10px;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px 18px;
  align-items: center;
  background: rgba(17, 26, 36, 0.95);
  backdrop-filter: blur(4px);
}

.sticky-summary p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.sticky-summary strong {
  color: var(--text);
}

#appSection .mvp-ow-custody-intro {
  margin-top: 12px;
  position: relative;
  padding: 14px 16px 14px 18px;
  border-left: 3px solid color-mix(in oklab, var(--accent) 72%, transparent);
  background:
    linear-gradient(
      105deg,
      color-mix(in oklab, var(--accent) 14%, transparent) 0%,
      transparent min(52%, 420px)
    ),
    linear-gradient(180deg, #162332, var(--card));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 0 1px rgba(0, 0, 0, 0.12);
}

body.ar-github-ui #appSection .mvp-ow-custody-intro {
  background:
    linear-gradient(
      105deg,
      color-mix(in oklab, var(--accent, #58a6ff) 12%, transparent) 0%,
      transparent min(48%, 400px)
    ),
    linear-gradient(
      165deg,
      color-mix(in oklab, var(--card) 96%, white 4%) 0%,
      var(--card) 55%
    );
  border: 1px solid color-mix(in oklab, var(--edge) 78%, white 9%);
  border-left: 3px solid color-mix(in oklab, var(--accent, #58a6ff) 65%, transparent);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.22),
    0 16px 40px -14px rgba(0, 0, 0, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.mvp-ow-custody-intro-head {
  margin: 0 0 10px;
}

.mvp-ow-custody-intro-badge.mvp-custody-badge {
  margin-right: 0;
  margin-bottom: 0;
  border-color: color-mix(in oklab, var(--accent) 45%, var(--edge));
  background: color-mix(in oklab, var(--card) 88%, var(--accent) 12%);
  color: var(--text);
  letter-spacing: 0.06em;
}

body.ar-github-ui .mvp-ow-custody-intro-badge.mvp-custody-badge {
  border-color: color-mix(in oklab, var(--accent, #58a6ff) 42%, var(--edge, #30363d));
  background: color-mix(in oklab, var(--card, #161b22) 90%, var(--accent, #58a6ff) 10%);
  color: #e6edf3;
}

.mvp-ow-custody-intro-lead {
  margin: 0 0 12px;
  max-width: 78ch;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text);
}

.mvp-ow-custody-intro-aar {
  margin: 0;
  max-width: 78ch;
  font-size: 0.8125rem;
  line-height: 1.5;
}

/* Evidence custody modal (Mission Overwatch): hero + empty-state callouts */
.mvp-custody-modal-hero {
  padding: 12px 14px 14px 16px;
  margin: 0 0 16px;
  border-radius: 8px;
  border: 1px solid var(--edge);
  border-left: 3px solid color-mix(in oklab, var(--accent) 65%, transparent);
  background:
    linear-gradient(
      105deg,
      color-mix(in oklab, var(--accent) 11%, transparent) 0%,
      transparent min(46%, 340px)
    ),
    linear-gradient(180deg, #162332, var(--card));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.ar-github-ui .mvp-custody-modal-hero {
  border: 1px solid color-mix(in oklab, var(--edge, #30363d) 82%, var(--accent, #58a6ff) 12%);
  border-left: 3px solid color-mix(in oklab, var(--accent, #58a6ff) 58%, transparent);
  background:
    linear-gradient(
      105deg,
      color-mix(in oklab, var(--accent, #58a6ff) 8%, transparent) 0%,
      transparent min(40%, 300px)
    ),
    var(--color-canvas-subtle, #161b22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.mvp-custody-modal-hero-head {
  margin: 0 0 8px;
}

.mvp-custody-modal-hero-badge.mvp-custody-badge {
  margin-right: 0;
  margin-bottom: 0;
  border-color: color-mix(in oklab, var(--accent) 45%, var(--edge));
  background: color-mix(in oklab, var(--card) 88%, var(--accent) 12%);
  color: var(--text);
  letter-spacing: 0.06em;
}

body.ar-github-ui .mvp-custody-modal-hero-badge.mvp-custody-badge {
  border-color: color-mix(in oklab, var(--accent, #58a6ff) 42%, var(--edge, #30363d));
  background: color-mix(in oklab, var(--card, #161b22) 90%, var(--accent, #58a6ff) 10%);
  color: #e6edf3;
}

.mvp-custody-modal-lead {
  margin: 0 0 10px;
  max-width: 72ch;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text);
}

.mvp-custody-modal-foot {
  margin: 0;
  max-width: 72ch;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.mvp-custody-modal-tip {
  margin: 0 0 14px;
  max-width: 72ch;
  font-size: 0.78rem;
  line-height: 1.45;
}

.mvp-custody-modal-callout {
  margin: 0 0 12px;
  max-width: 72ch;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text);
}

.mvp-custody-modal-callout p {
  margin: 0 0 0.65em;
}

.mvp-custody-modal-callout p:last-child {
  margin-bottom: 0;
}

.mvp-custody-modal-callout code {
  font-size: 0.84em;
}

.mvp-custody-modal-err {
  margin-top: 0.5rem;
}

/* Closed-mission review: operator / past mission / executive summary bar scrolls away (not sticky). */
#appSection.past-mission-review #persistentHeader.sticky-summary {
  position: static;
  top: auto;
  z-index: auto;
}

body.ar-github-ui #appSection.past-mission-review #persistentHeader.sticky-summary {
  position: static;
  top: auto;
  z-index: auto;
}

/* Past mission deep-link: read-only event log + report; hide live console blocks */
#appSection.past-mission-review .mvp-overwatch-live-only {
  display: none !important;
}

/* Closed missions: Event Log left; footage + after-action report stacked in the right column */
#appSection.past-mission-review .mvp-ow-event-log.span-2 {
  grid-column: auto;
  min-width: 0;
}

#appSection.past-mission-review .mvp-ow-event-log,
#appSection.past-mission-review .mvp-ow-footage-report-stack {
  align-self: start;
}

#appSection.past-mission-review .mvp-ow-footage-report-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  grid-column: auto;
  min-width: 0;
}

#appSection.past-mission-review .mvp-ow-footage-report-stack > .card {
  width: 100%;
}

.sticky-past-play {
  grid-column: 1 / -1;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  width: 100%;
}

.sticky-past-play .ghost {
  flex-shrink: 0;
}

.sticky-past-meta {
  grid-column: span 2;
  font-size: 0.8rem;
}

.sticky-past-actions {
  grid-column: 1 / -1;
  margin: 0;
}

/* Closed-mission bar: operator (left) | mission + ended meta (center) | Play with events (right) */
.sticky-summary.sticky-summary--past {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr) auto;
  column-gap: clamp(20px, 4vw, 48px);
  row-gap: 14px;
  align-items: start;
  padding-top: 4px;
}

.sticky-summary.sticky-summary--past > .sticky-past-play {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  align-self: start;
  width: auto;
  margin: 0;
}

.sticky-summary.sticky-summary--past > .sticky-summary-operator {
  grid-column: 1;
  grid-row: 1;
}

.sticky-summary.sticky-summary--past > .sticky-summary-mission {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.sticky-summary.sticky-summary--past > .sticky-past-meta {
  grid-column: 2;
  grid-row: 2;
  margin: 0;
}

.sticky-summary.sticky-summary--past > .sticky-past-actions {
  grid-column: 1;
  grid-row: 2;
  justify-self: start;
  width: auto;
  margin: 0;
}

.sticky-summary.sticky-summary--past > .sticky-executive-summary {
  grid-column: 1 / -1;
  grid-row: 3;
  margin-top: 6px;
}

.sticky-executive-summary {
  grid-column: 1 / -1;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid rgba(88, 166, 255, 0.22);
}

.sticky-executive-summary[hidden] {
  display: none !important;
}

.sticky-executive-summary-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 14px;
  margin-bottom: 8px;
}

.sticky-executive-summary-heading {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}

.sticky-executive-summary-body {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--muted);
}

.sticky-executive-summary-body .aar-prose-para {
  margin: 0 0 0.55em;
}

.sticky-executive-summary-body .aar-prose-para:last-child {
  margin-bottom: 0;
}

.sticky-executive-summary-fallback {
  margin: 0;
}

/* Chain of custody detail (evidence / footage) */
.mvp-custody-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  border: 1px solid var(--color-border-default, #30363d);
  background: var(--color-canvas-subtle, #161b22);
  color: var(--color-fg-default, #e6edf3);
  margin-right: 6px;
  margin-bottom: 4px;
}
.mvp-custody-badge--verified {
  border-color: #238636;
  color: #3fb950;
}
.mvp-custody-badge--failed {
  border-color: #da3633;
  color: #ff7b72;
}
.mvp-custody-badge--unknown {
  border-color: #6e7681;
  color: #8b949e;
}
.mvp-custody-help {
  font-size: 0.85rem;
  line-height: 1.45;
  margin: 0.5rem 0 1rem;
  color: var(--color-fg-muted, #8b949e);
}
.mvp-custody-timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}
.mvp-custody-timeline li {
  border-left: 2px solid var(--color-border-default, #30363d);
  padding: 0.5rem 0 0.5rem 0.75rem;
  margin-left: 0.35rem;
}
.mvp-custody-event-type {
  font-weight: 600;
  font-size: 0.85rem;
}
.mvp-custody-raw {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 12rem;
  overflow: auto;
  background: var(--color-canvas-subtle, #161b22);
  padding: 0.5rem;
  border-radius: 4px;
  margin-top: 0.35rem;
}

.aar-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: rgba(5, 9, 14, 0.88);
  backdrop-filter: blur(6px);
}

/* `[hidden]` alone can lose to `display: flex` above without higher specificity (see do-not-reload-banner note). */
.aar-modal-overlay[hidden] {
  display: none !important;
  pointer-events: none;
}

.aar-modal-panel {
  display: flex;
  flex-direction: column;
  width: min(960px, 100%);
  max-height: min(92vh, 920px);
  overflow: hidden;
  box-sizing: border-box;
}

.aar-modal-header {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(88, 166, 255, 0.22);
}

.aar-modal-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.aar-modal-header-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
}

.aar-modal-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px 18px;
  font-size: 0.88rem;
  line-height: 1.55;
}

.aar-modal-scroll .footage-qr-svg {
  max-width: min(280px, 100%);
}

.aar-edit-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.aar-edit-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.aar-edit-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text, #e9f0f8);
}

.aar-edit-textarea {
  width: 100%;
  min-height: 120px;
  box-sizing: border-box;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.88rem;
  line-height: 1.5;
  border-radius: 8px;
  border: 1px solid rgba(88, 166, 255, 0.35);
  background: rgba(8, 14, 22, 0.92);
  color: inherit;
  resize: vertical;
}

.aar-edit-hint {
  margin: 14px 0 0;
  font-size: 0.82rem;
}

.grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

/* Mission overwatch: wrappers flatten into the default 2-column grid */
.mvp-ow-right-stack,
.mvp-ow-center-below,
.mvp-ow-footage-report-stack {
  display: contents;
}

.relay-feed-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--edge);
  background: rgba(22, 35, 52, 0.35);
}

.relay-feed-toolbar[hidden] {
  display: none !important;
}

.relay-feed-toolbar-status {
  font-size: 0.88rem;
}

/* Relay connected: 3-column console + center column stack below feed (event log → footage → report) */
.mvp-overwatch-grid.mvp-relay-live {
  grid-template-columns: minmax(220px, 0.95fr) minmax(300px, 1.55fr) minmax(220px, 0.9fr);
  grid-template-areas:
    "ow-session ow-session ow-session"
    "ow-scenario ow-feed ow-right"
    "ow-scenario ow-below ow-right";
}

.mvp-overwatch-grid.mvp-relay-live .mvp-ow-session {
  grid-area: ow-session;
}

.mvp-overwatch-grid.mvp-relay-live .mvp-ow-scenario {
  grid-area: ow-scenario;
  min-width: 0;
}

.mvp-overwatch-grid.mvp-relay-live .mvp-ow-bridge-panel {
  display: none !important;
}

.mvp-overwatch-grid.mvp-relay-live .mvp-ow-feed {
  grid-area: ow-feed;
  min-width: 0;
}

.mvp-overwatch-grid.mvp-relay-live .mvp-ow-right-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  grid-area: ow-right;
  min-width: 0;
}

.mvp-overwatch-grid.mvp-relay-live .mvp-ow-right-stack > .card {
  width: 100%;
}

.mvp-overwatch-grid.mvp-relay-live .mvp-ow-right-stack .right-column {
  grid-column: auto;
}

.mvp-overwatch-grid.mvp-relay-live .mvp-ow-center-below {
  display: flex;
  flex-direction: column;
  gap: 12px;
  grid-area: ow-below;
  min-width: 0;
}

.mvp-overwatch-grid.mvp-relay-live .mvp-ow-center-below > .card {
  width: 100%;
}

/* Closed mission while relay layout class is still set: keep log | (footage + report) side-by-side */
#appSection.past-mission-review .mvp-overwatch-grid.mvp-relay-live .mvp-ow-center-below {
  flex-direction: row;
  align-items: flex-start;
}

#appSection.past-mission-review .mvp-overwatch-grid.mvp-relay-live .mvp-ow-center-below > .mvp-ow-footage-report-stack {
  flex: 1 1 0;
  min-width: 0;
}

#appSection.past-mission-review .mvp-overwatch-grid.mvp-relay-live .mvp-ow-center-below > .card {
  width: auto;
  flex: 1 1 0;
  min-width: 0;
}

/* Scenario guidance collapsed: narrow left rail; only the center column uses fr so it absorbs freed width */
.mvp-overwatch-grid.mvp-relay-live.mvp-scenario-collapsed {
  grid-template-columns:
    minmax(0, 72px)
    minmax(300px, 1fr)
    minmax(220px, min(380px, 34vw));
}

.mvp-overwatch-grid.mvp-relay-live.mvp-scenario-collapsed .mvp-ow-scenario {
  min-width: 0;
}

/* .span-2 is defined later; re-assert placement for named grid areas */
.mvp-overwatch-grid.mvp-relay-live > .mvp-ow-session.span-2 {
  grid-area: ow-session;
}
.mvp-overwatch-grid.mvp-relay-live > .mvp-ow-scenario.span-2 {
  grid-area: ow-scenario;
}
.mvp-overwatch-grid.mvp-relay-live > .mvp-ow-feed.span-2 {
  grid-area: ow-feed;
}

#mvpOverwatchMain.mvp-overwatch-layout-live {
  width: min(1680px, 98vw);
  max-width: 1680px;
}

.span-2 {
  grid-column: 1 / -1;
}

.right-column {
  grid-column: 2;
}

h2 {
  margin: 0 0 10px;
  font-size: 1.1rem;
}

.form-grid {
  display: grid;
  gap: 10px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  background: #0f1721;
  border: 1px solid #33475f;
  color: var(--text);
  border-radius: 8px;
  padding: 9px 10px;
}

textarea {
  resize: vertical;
}

button {
  border: 1px solid #4d74a4;
  color: #edf5ff;
  background: #1e416b;
  border-radius: 8px;
  padding: 9px 12px;
  cursor: pointer;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.ghost {
  background: #182535;
}

button.danger {
  border-color: #ab4e4e;
  background: #6b2d2d;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mission-template-hint {
  margin: -2px 0 2px;
  font-size: 0.82rem;
}

.mission-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 10px;
  min-height: 1.5rem;
}

.mission-tag-chip {
  display: inline-block;
  border: 1px solid #3a5f86;
  background: #15263a;
  color: #cfe4fb;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.75rem;
  line-height: 1.2;
  text-transform: lowercase;
}

/* Scenario guidance (overwatch) */
.scenario-guidance-card {
  padding: 16px 16px 14px;
}

.sg-header {
  margin: 0;
}

.sg-header-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.sg-header-title {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  flex: 1;
  min-width: 0;
}

.sg-collapse-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 6px 10px;
}

.sg-collapse-toggle-icon {
  display: block;
  width: 1.15rem;
  height: 1.15rem;
}

.sg-collapsible-body {
  margin-top: 10px;
}

.scenario-guidance-card.scenario-guidance-collapsed {
  position: relative;
  padding: 10px 8px;
}

.scenario-guidance-card.scenario-guidance-collapsed .sg-collapsible-body {
  display: none;
}

.scenario-guidance-card.scenario-guidance-collapsed .sg-header-toolbar {
  flex-wrap: nowrap;
  justify-content: center;
  gap: 0;
}

.scenario-guidance-card.scenario-guidance-collapsed .sg-header-title {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.scenario-guidance-card.scenario-guidance-collapsed .sg-collapse-toggle {
  width: 100%;
  min-height: 40px;
  padding: 8px 6px;
}

.sg-summary {
  margin: 0 0 10px;
  font-size: 0.92rem;
  line-height: 1.45;
  max-width: 72ch;
}

.sg-tags {
  margin-bottom: 4px;
}

.sg-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

/* Objectives + guided prompts stacked left; tap-to-log right */
.sg-layout--split {
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  align-items: start;
}

.sg-left-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.scenario-guidance-card .sg-layout--split:has(#scenarioTapToLogPanel[hidden]) {
  grid-template-columns: 1fr;
}

.mvp-ow-checklist-sidebar .sg-panel-title {
  margin-bottom: 10px;
}

.sg-panel {
  background: rgba(10, 18, 28, 0.65);
  border: 1px solid rgba(58, 88, 118, 0.45);
  border-radius: 10px;
  padding: 12px 12px 10px;
  min-width: 0;
}

.sg-panel-title {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9eb6d4;
}

.sg-panel-hint {
  margin: -4px 0 10px;
  font-size: 0.8rem;
  line-height: 1.35;
}

.sg-objective-list,
.sg-prompt-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sg-objective-list li,
.sg-prompt-list li {
  margin: 0;
  padding: 8px 10px;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--text);
  background: rgba(22, 35, 52, 0.55);
  border-radius: 8px;
  border: 1px solid rgba(47, 69, 94, 0.5);
}

.sg-objective-list li.muted,
.sg-prompt-list li.muted {
  border-style: dashed;
  background: transparent;
}

.sg-chip-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  min-height: 2rem;
}

.sg-event-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 6px 11px;
  font-size: 0.8rem;
  line-height: 1.25;
  color: #d8e8fb;
  background: linear-gradient(180deg, #1a2d45, #152638);
  border: 1px solid #3a5f86;
  border-radius: 999px;
}

.mission-checklist-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mission-checklist-list li {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 8px 0;
  border-bottom: 1px solid rgba(47, 69, 94, 0.35);
}

.mission-checklist-list li:last-child {
  border-bottom: none;
  padding-bottom: 2px;
}

.mission-checklist-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
  font-size: 0.88rem;
  line-height: 1.35;
  color: var(--text);
}

.mission-checklist-label input[type="checkbox"] {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  margin-top: 2px;
  accent-color: var(--accent);
}

.footage-upload-row {
  align-items: center;
  margin: 10px 0 0;
}

.footage-upload-hint {
  font-size: 0.85rem;
  margin-top: 4px;
}

.footage-upload-status {
  display: inline-block;
  min-height: 1.25em;
  max-width: min(520px, 100%);
}

.footage-upload-progress {
  margin-top: 12px;
  max-width: min(560px, 100%);
}

.footage-upload-progress-track {
  height: 8px;
  border-radius: 12px;
  background: #0d141d;
  border: 1px solid #33485d;
  overflow: hidden;
}

.footage-upload-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 5px;
  background: linear-gradient(90deg, #3e8eff, #5cb3ff);
  transition: width 0.12s ease-out;
}

.footage-upload-progress-bar--indeterminate {
  width: 18% !important;
  animation: footage-upload-pulse 0.85s ease-in-out infinite alternate;
}

@keyframes footage-upload-pulse {
  from {
    opacity: 0.4;
  }
  to {
    opacity: 1;
  }
}

.footage-upload-progress-meta {
  margin-top: 6px;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

/* Mission Overwatch: pilot auto-footage runs in “Mission footage”; outline so operators notice below-the-fold activity. */
.mvp-ow-footage.footage-auto-upload-attention {
  outline: 2px solid #3e8eff;
  outline-offset: 3px;
  border-radius: 10px;
}

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

.muted a {
  color: var(--accent);
}

.bridge-panel-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 12px;
}

.bridge-panel-head h2 {
  margin: 0;
}

.bridge-panel-sub {
  margin: 0;
  font-size: 0.85rem;
}

.bridge-connect-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: 10px 12px;
  padding: 12px;
  border: 1px solid #2a3a53;
  background: #0f1826;
  border-radius: 10px;
}

.bridge-connect-field {
  display: grid;
  gap: 6px;
  margin: 0;
}

.bridge-connect-field input {
  width: 100%;
}

.bridge-connect-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.bridge-connect-primary {
  min-width: 140px;
  padding: 10px 18px;
  font-weight: 600;
  background: #2352a8;
  border-color: #4279d9;
}

.bridge-connect-primary:hover:not(:disabled) {
  background: #295ec0;
}

.bridge-connect-secondary {
  padding: 10px 14px;
}

.bridge-status {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
  min-height: 1.2em;
}

.bridge-cert-hint-bar {
  margin-top: 10px;
}

.bridge-cert-hint-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bridge-trust-details {
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid #2a3a53;
  background: #0c1522;
  border-radius: 10px;
}

.bridge-trust-details > summary {
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  color: var(--text);
  font-size: 0.92rem;
  list-style: revert;
}

.bridge-trust-summary-title {
  font-weight: 600;
}

.bridge-trust-summary-sub {
  font-size: 0.8rem;
}

.bridge-trust-steps {
  margin: 10px 0 0;
  padding-left: 1.25rem;
  line-height: 1.55;
  font-size: 0.88rem;
}

.bridge-trust-steps > li + li {
  margin-top: 10px;
}

.bridge-trust-instructions {
  margin: 0 0 8px;
  font-size: 0.86rem;
  line-height: 1.45;
}

.bridge-trust-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 8px;
}

.bridge-trust-open-btn {
  padding: 10px 16px;
  font-weight: 600;
  background: #2352a8;
  border-color: #4279d9;
}

.bridge-trust-open-btn:hover:not(:disabled) {
  background: #295ec0;
}

.bridge-trust-open-btn--secondary {
  font-weight: 500;
  background: #1e416b;
}

.bridge-trust-url-label {
  margin-right: 6px;
  font-size: 0.78rem;
}

.bridge-trust-link-row {
  margin-top: 2px;
  font-size: 0.82rem;
}

.bridge-trust-link {
  display: inline-block;
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
}

.bridge-trust-link[aria-disabled="true"] {
  color: var(--muted);
  pointer-events: none;
  text-decoration: none;
}

.bridge-trust-video-details > summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.85rem;
}

.bridge-trust-video-details[open] > summary {
  margin-bottom: 6px;
}

.bridge-panel-foot {
  margin: 12px 0 0;
  font-size: 0.82rem;
}

@media (max-width: 720px) {
  .bridge-connect-card {
    grid-template-columns: minmax(0, 1fr);
  }
}

.list {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.list li {
  border: 1px solid #33485d;
  border-radius: 8px;
  background: #122131;
  padding: 9px 10px;
}

.mvp-event-log-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  margin-bottom: 2px;
}

.mvp-event-log-head h2 {
  margin: 0;
}

#eventList li {
  display: grid;
  gap: 4px;
}

#eventList li .mvp-event-log-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

#eventList li .mvp-event-log-item-text {
  display: grid;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

#eventList li .mvp-event-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
  align-self: start;
  justify-content: flex-end;
}

#eventList li .mvp-event-delete,
#eventList li .mvp-event-edit {
  flex-shrink: 0;
  align-self: start;
}

#eventList li .mvp-event-note-input {
  width: 100%;
  min-height: 3.25rem;
  margin-top: 2px;
  padding: 8px 10px;
  font: inherit;
  color: var(--text);
  background: rgba(8, 14, 22, 0.92);
  border: 1px solid #39516b;
  border-radius: 12px;
  resize: vertical;
  box-sizing: border-box;
}

#eventList li strong {
  font-size: 0.85rem;
  color: #b9d4f5;
}

#eventList li span {
  color: var(--text);
}

.event-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.event-screenshot {
  margin-top: 6px;
  width: min(300px, 100%);
  border-radius: 8px;
  border: 1px solid #39516b;
}

.event-footage {
  margin-top: 6px;
  width: min(360px, 100%);
  max-height: 220px;
  border-radius: 8px;
  border: 1px solid #39516b;
  background: #0a1018;
}

.mission-footage-list li {
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #2a3b4d;
}

.mission-footage-list li:last-child {
  border-bottom: none;
}

.mission-footage-item-title {
  font-weight: 600;
  margin-bottom: 4px;
}

/* Footage modal: video + custom scrubber with mission-event markers */
.footage-viewer-overlay {
  position: fixed;
  inset: 0;
  /* Above `.aar-modal-overlay` (10020) when opened from the after-action report modal. */
  z-index: 10160;
  background: rgba(5, 9, 14, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  cursor: zoom-out;
}

/* play-with-events.html: timeline cannot be dismissed — no backdrop “close” affordance. */
.footage-viewer-overlay--locked-open {
  cursor: default;
}

/* Play with events: true full viewport (simple clip preview keeps centered card). */
.footage-viewer-overlay:has(.footage-viewer-panel--timeline) {
  padding: 0;
  align-items: stretch;
  justify-content: flex-start;
  min-height: 100vh;
  min-height: 100dvh;
}

.footage-viewer-panel {
  cursor: default;
  width: min(1120px, 100%);
  max-height: 96vh;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #152536, #101a26);
  border: 1px solid var(--edge);
  border-radius: 12px;
  padding: 14px 16px 16px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
}

/* Definite height so flex children (body + sidebar scroll) receive real space; auto height + max-height only leaves no free space for flex: 1. */
.footage-viewer-panel--timeline {
  flex: 1 1 auto;
  width: 100%;
  max-width: none;
  min-height: 0;
  max-height: none;
  border-radius: 0;
  box-shadow: none;
  padding: calc(14px + env(safe-area-inset-top, 0px)) calc(16px + env(safe-area-inset-right, 0px))
    calc(16px + env(safe-area-inset-bottom, 0px)) calc(16px + env(safe-area-inset-left, 0px));
}

.footage-viewer-body {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  align-items: stretch;
  gap: 14px;
}

.footage-viewer-main {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.footage-viewer-main .footage-viewer-hint,
.footage-viewer-main .footage-viewer-current-event,
.footage-viewer-main .footage-viewer-controls {
  flex-shrink: 0;
}

.footage-viewer-main .footage-viewer-video-wrap {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footage-viewer-main .footage-viewer-video {
  max-height: 100%;
  width: 100%;
  object-fit: contain;
}

.footage-event-sidebar {
  flex: 0 0 380px;
  width: 380px;
  max-width: 48vw;
  padding: 4px 2px 4px 10px;
  border-left: 1px solid #33485d;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  align-self: stretch;
  overflow: hidden;
}

.footage-event-sidebar-title {
  flex-shrink: 0;
  margin: 0 0 2px;
  padding: 0 4px 8px 0;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8aa4c4;
  border-bottom: 1px solid #2c3f52;
}

.footage-event-sidebar-scroll {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 6px 4px 0;
  scrollbar-gutter: stable;
}

.footage-event-sidebar-empty {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.35;
}

.footage-event-thumb {
  display: block;
  width: 100%;
  flex-shrink: 0;
  padding: 0;
  margin: 0;
  border: 1px solid #3d556d;
  border-radius: 8px;
  background: #0d141d;
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  transition:
    border-color 0.12s ease,
    box-shadow 0.12s ease;
}

.footage-event-thumb:hover {
  border-color: #5a7aa0;
  box-shadow: 0 0 0 1px rgba(62, 142, 255, 0.25);
}

.footage-event-thumb--active {
  border-color: #ffd060;
  box-shadow: 0 0 0 2px rgba(255, 208, 96, 0.45);
}

.footage-event-thumb-visual {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #05080c;
}

.footage-event-thumb-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: #05080c;
  vertical-align: middle;
}

.footage-event-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: unset;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: #8aa4c4;
  background: linear-gradient(145deg, #121b28, #0a1018);
}

.footage-event-thumb-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px 8px 8px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.2) 20%, rgba(0, 0, 0, 0.88));
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: stretch;
  text-align: left;
  pointer-events: none;
}

.footage-event-thumb-overlay-note {
  font-size: 0.78rem;
  line-height: 1.28;
  font-weight: 600;
  color: #f2f7ff;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.95),
    0 0 12px rgba(0, 0, 0, 0.75);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.footage-event-thumb-overlay-time {
  font-size: 0.68rem;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #ffb347;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.95),
    0 0 10px rgba(0, 0, 0, 0.8);
}

.footage-viewer-current-event {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #33485d;
  background: #0d141d;
}

.footage-viewer-current-event-when {
  font-size: 0.78rem;
  line-height: 1.35;
  color: #d8e6f7;
  font-weight: 500;
  margin-bottom: 6px;
}

.footage-viewer-current-event-note {
  font-size: 0.8rem;
  line-height: 1.4;
  color: #b9cce3;
  margin-bottom: 6px;
  word-break: break-word;
}

.footage-viewer-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.footage-viewer-angle-strip {
  flex-shrink: 0;
  margin: 0 0 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #2c3f52;
}

.footage-viewer-angle-tab-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.footage-viewer-angle-tab {
  font-size: 0.82rem;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #39516b;
  background: rgba(8, 14, 22, 0.85);
  color: #c5d6eb;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.footage-viewer-angle-tab:hover {
  border-color: #4a6a8f;
  color: #fff;
}

.footage-viewer-angle-tab--active {
  border-color: #e8912d;
  background: rgba(232, 145, 45, 0.12);
  color: #fff;
  font-weight: 600;
}

.footage-viewer-angle-strip-hint {
  margin: 8px 0 0;
  font-size: 0.75rem;
  line-height: 1.35;
}

.footage-viewer-title {
  margin: 0;
  font-size: 1.1rem;
}

.footage-viewer-hint {
  margin: 0 0 10px;
  font-size: 0.82rem;
  line-height: 1.4;
}

.footage-viewer-hint-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 10px;
}

.footage-viewer-hint-row .footage-viewer-hint {
  flex: 1 1 220px;
  margin: 0;
  min-width: 0;
}

.footage-viewer-align-btn {
  flex-shrink: 0;
}

.footage-viewer-multiview-btn {
  flex-shrink: 0;
}

.footage-viewer-main .footage-viewer-video-wrap--multi {
  align-items: stretch;
  justify-content: flex-start;
}

.footage-viewer-angle-grid {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: grid;
  /* Play with events / “All angles”: at most two tiles per row (was auto-fit → 3+ on wide screens). */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
  overflow: auto;
}

.footage-viewer-angle-cell {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #33485d;
  background: #05080c;
}

.footage-viewer-angle-cell--master {
  border-color: #e8912d;
  box-shadow: 0 0 0 1px rgba(232, 145, 45, 0.22);
}

.footage-viewer-angle-cell-label {
  flex-shrink: 0;
  font-size: 0.72rem;
  line-height: 1.25;
  padding: 5px 8px;
  background: #0d141d;
  color: #8aa4c4;
  border-bottom: 1px solid #2c3f52;
  font-variant-numeric: tabular-nums;
}

.footage-viewer-video--tile {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-height: min(42vh, 360px);
  object-fit: contain;
  background: #05080c;
}

.mission-footage-play-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}

.mission-footage-play-with-events-btn {
  margin-left: auto;
}

.footage-viewer-video-wrap {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #39516b;
  background: #05080c;
}

.footage-viewer-video {
  display: block;
  width: 100%;
  max-height: min(62vh, 520px);
  vertical-align: middle;
}

.footage-viewer-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 12px;
}

.footage-viewer-play {
  min-width: 72px;
}

.footage-viewer-time {
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  color: #b9d4f5;
}

.footage-event-rail-wrap {
  flex: 1 1 220px;
  min-width: 160px;
}

.footage-event-rail {
  position: relative;
  height: 22px;
  border-radius: 12px;
  background: #0d141d;
  border: 1px solid #33485d;
  cursor: pointer;
  outline: none;
}

.footage-event-rail:focus-visible {
  box-shadow: 0 0 0 2px rgba(62, 142, 255, 0.5);
}

.footage-event-rail-progress {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  border-radius: 5px 0 0 5px;
  background: linear-gradient(90deg, rgba(62, 142, 255, 0.35), rgba(62, 142, 255, 0.12));
  pointer-events: none;
}

.footage-event-markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.footage-event-marker {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  margin-left: -6px;
  padding: 0;
  border: none;
  border-radius: 2px;
  transform: rotate(45deg);
  background: linear-gradient(135deg, #ffb347, #ff6b35);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.45), 0 0 10px rgba(255, 107, 53, 0.55);
  cursor: pointer;
  pointer-events: auto;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease;
}

.footage-event-marker:hover {
  transform: rotate(45deg) scale(1.15);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.5), 0 0 16px rgba(255, 140, 80, 0.75);
}

.footage-event-marker--active {
  background: linear-gradient(135deg, #fff1a8, #ffd060);
  box-shadow: 0 0 0 2px rgba(255, 214, 96, 0.9), 0 0 18px rgba(255, 220, 120, 0.85);
}

/* Dual-video sync: slide handle vs drone (primary) timeline */
.footage-sync-align-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(5, 9, 14, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  cursor: zoom-out;
}

.footage-sync-align-panel {
  cursor: default;
  width: min(1100px, 100%);
  max-height: min(96vh, 900px);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
  background: linear-gradient(180deg, #152536, #101a26);
  border: 1px solid var(--edge);
  border-radius: 12px;
  padding: 14px 16px 16px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.55);
}

.footage-sync-align-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.footage-sync-align-title {
  margin: 0;
  font-size: 1.1rem;
}

.footage-sync-align-sub {
  margin: 0 0 12px;
  font-size: 0.82rem;
  line-height: 1.45;
}

.footage-sync-align-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  min-height: 0;
}

@media (max-width: 720px) {
  .footage-sync-align-grid {
    grid-template-columns: 1fr;
  }
}

.footage-sync-align-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.footage-sync-align-col-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8aa4c4;
}

.footage-sync-align-video {
  width: 100%;
  max-height: min(38vh, 320px);
  border-radius: 8px;
  border: 1px solid #39516b;
  background: #05080c;
  object-fit: contain;
}

.footage-sync-align-readout {
  margin-top: 10px;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  color: #b9d4f5;
  line-height: 1.4;
}

.footage-sync-align-strip-wrap {
  margin-top: 14px;
}

.footage-sync-align-strip-label {
  font-size: 0.78rem;
  color: #8aa4c4;
  margin-bottom: 6px;
}

.footage-sync-align-strip-track {
  position: relative;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(90deg, #0d141d, #121b28);
  border: 1px solid #33485d;
  cursor: pointer;
  touch-action: none;
  outline: none;
}

.footage-sync-align-strip-track:focus-visible {
  box-shadow: 0 0 0 2px rgba(62, 142, 255, 0.45);
}

.footage-sync-align-strip-track::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 6px;
  bottom: 6px;
  width: 2px;
  margin-left: -1px;
  background: rgba(138, 164, 196, 0.45);
  pointer-events: none;
}

.footage-sync-align-strip-handle {
  position: absolute;
  top: 50%;
  width: 22px;
  height: 22px;
  margin-top: -11px;
  margin-left: -11px;
  border-radius: 50%;
  background: linear-gradient(145deg, #5a9fff, #3a6fd8);
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
  cursor: grab;
  touch-action: none;
}

.footage-sync-align-strip-handle:active {
  cursor: grabbing;
}

.footage-sync-align-fine-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.footage-sync-align-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  justify-content: flex-end;
}

@media (max-width: 720px) {
  .footage-viewer-angle-grid {
    grid-template-columns: 1fr;
  }

  .footage-viewer-body {
    flex-direction: column;
  }

  .footage-viewer-main {
    flex: 3 1 0;
  }

  .footage-event-sidebar {
    flex: 2 1 0;
    width: 100%;
    max-width: none;
    min-height: min(42vh, 280px);
    max-height: none;
    border-left: none;
    border-top: 1px solid #33485d;
    padding: 10px 0 0;
  }

  .footage-event-sidebar-scroll {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    min-height: min(200px, 38vh);
    overflow-x: auto;
    overflow-y: hidden;
    gap: 8px;
    padding: 8px 0 6px;
    scrollbar-gutter: auto;
  }

  .footage-event-thumb {
    flex: 0 0 min(220px, 78vw);
    width: min(220px, 78vw);
  }

  .footage-event-sidebar-title {
    padding-bottom: 6px;
  }
}

.report {
  margin-top: 10px;
  border: 1px solid #33485d;
  border-radius: 10px;
  background: #0f1722;
  padding: 10px 12px;
}

.report h3,
.report h4 {
  margin: 10px 0 6px;
}

.report .aar-approval-banner {
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--color-border-default, #30363d);
  background: var(--color-canvas-subtle, #161b22);
}
.report .aar-approval-banner strong {
  font-weight: 600;
}

.report .aar-narrative-block {
  margin: 0 0 8px;
}

.report .aar-narrative-block .aar-prose-para {
  margin: 0 0 0.5em;
}

.report .aar-custody-section {
  margin: 12px 0 16px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(240, 246, 252, 0.12);
  background: rgba(15, 23, 34, 0.45);
}

.report .aar-custody-asof {
  font-size: 0.86rem;
  margin: 0 0 8px;
}

.report .aar-custody-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin-top: 8px;
}

.report .aar-custody-table th,
.report .aar-custody-table td {
  border: 1px solid rgba(240, 246, 252, 0.12);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}

.report .aar-custody-table th {
  font-weight: 600;
  background: rgba(15, 23, 34, 0.65);
}

.report .aar-custody-hash {
  font-size: 0.72rem;
  word-break: break-all;
}

.report ul {
  margin: 0;
  padding-left: 20px;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.history-item p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.pilot-modal {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 16, 0.78);
  display: grid;
  place-items: center;
  padding: 14px;
  z-index: 20;
}

.pilot-modal[hidden] {
  display: none;
}

.pilot-panel {
  width: min(1120px, 96vw);
  max-height: 94vh;
  overflow: auto;
}

.pilot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pilot-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
}

.pilot-feed-wrap {
  position: relative;
  border: 1px solid #30465f;
  border-radius: 10px;
  overflow: hidden;
  background: #070b12;
  aspect-ratio: 16 / 9;
  width: 100%;
}

.pilot-mjpeg-feed {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #070b12;
}

.pilot-mjpeg-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.pilot-mjpeg-layer.is-front {
  z-index: 1;
}

.pilot-mjpeg-feed[hidden] {
  display: none;
}

.pilot-mjpeg-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.pilot-mjpeg-overlay[hidden] {
  display: none;
}

.pilot-mjpeg-debug {
  position: absolute;
  left: 8px;
  top: 42px;
  z-index: 12;
  margin: 0;
  padding: 6px 8px;
  max-width: min(95%, 760px);
  max-height: 52%;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font: 11px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color: #dcecff;
  background: rgba(7, 12, 18, 0.92);
  border: 1px solid rgba(120, 160, 208, 0.4);
  border-radius: 12px;
}

.pilot-mjpeg-bar--top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 34px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  background: rgba(8, 12, 18, 0.74);
  color: #dcecff;
  font: 14px/1.2 system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

.pilot-mjpeg-bar--bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  padding: 0 10px;
  background: rgba(8, 12, 18, 0.68);
  color: #d7e8fb;
  font: 13px/1.2 system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

.pilot-mjpeg-reticle {
  position: absolute;
  left: 50%;
  top: 52%;
  width: 68px;
  height: 68px;
  margin: -34px 0 0 -34px;
  border: 1.6px solid rgba(238, 247, 255, 0.86);
  border-radius: 50%;
  box-sizing: border-box;
}

.pilot-mjpeg-reticle::before,
.pilot-mjpeg-reticle::after {
  content: "";
  position: absolute;
  background: rgba(238, 247, 255, 0.86);
}

.pilot-mjpeg-reticle::before {
  left: 50%;
  top: 50%;
  width: 96px;
  height: 1.6px;
  margin: -0.8px 0 0 -48px;
}

.pilot-mjpeg-reticle::after {
  left: 50%;
  top: 50%;
  width: 1.6px;
  height: 96px;
  margin: -48px 0 0 -0.8px;
}

#pilotFeedCanvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: #070b12;
}

#pilotFeedCanvas[hidden] {
  display: none;
}

.pilot-feed-hud {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 4;
  border-radius: 12px;
  background: rgba(6, 10, 16, 0.72);
  border: 1px solid #3c5878;
  padding: 6px 8px;
  font-size: 0.8rem;
}

.pilot-flash {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: rgba(234, 244, 255, 0.86);
  pointer-events: none;
}

.pilot-controls {
  display: grid;
  gap: 10px;
}

.pilot-control-card {
  border: 1px solid #30465f;
  border-radius: 10px;
  background: #101b28;
  padding: 10px;
}

.pilot-control-card h3 {
  margin: 0 0 8px;
}

.pilot-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pilot-buttons button {
  padding: 8px;
  font-size: 0.85rem;
}

.joystick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.joystick-wrap p {
  margin: 0 0 6px;
  font-size: 0.82rem;
}

.joystick {
  width: 124px;
  height: 124px;
  border-radius: 50%;
  border: 1px solid #3d5673;
  background:
    radial-gradient(circle at center, rgba(42, 64, 89, 0.68) 0 28%, rgba(15, 25, 36, 0.95) 60%),
    #0d1520;
  position: relative;
  margin: 0 auto;
  touch-action: none;
}

.joystick-knob {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #6f93bd;
  background: radial-gradient(circle at 34% 34%, #cce4ff 0%, #7ba2cf 42%, #29425f 90%);
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  cursor: grab;
  box-shadow: 0 0 12px rgba(95, 144, 202, 0.44);
}

.joystick.is-disabled {
  opacity: 0.5;
  filter: grayscale(0.3);
}

.joystick:active .joystick-knob,
.joystick-knob:active {
  cursor: grabbing;
}

.pilot-preview {
  width: 100%;
  border: 1px solid #3a5168;
  border-radius: 8px;
  margin-bottom: 8px;
}

.pilot-waypoint-map {
  position: relative;
  width: 100%;
  min-height: 180px;
  border: 1px solid #3d5673;
  border-radius: 10px;
  background:
    linear-gradient(90deg, rgba(132, 166, 206, 0.12) 1px, transparent 1px) 0 0 / 26px 26px,
    linear-gradient(rgba(132, 166, 206, 0.12) 1px, transparent 1px) 0 0 / 26px 26px,
    linear-gradient(180deg, rgba(36, 55, 79, 0.74), rgba(16, 25, 36, 0.86));
  overflow: hidden;
  cursor: crosshair;
}

.pilot-waypoint-map img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.62;
}

.pilot-waypoint-map.locked {
  cursor: not-allowed;
  filter: saturate(0.82);
}

.pilot-waypoint-map.locked::after {
  content: "Capture a feed screenshot to unlock waypoint selection.";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 12px;
  font-size: 0.82rem;
  color: #d7e6fa;
  background: rgba(7, 14, 22, 0.58);
  pointer-events: none;
}

.pilot-waypoint-map:focus-visible {
  outline: 2px solid #8db9eb;
  outline-offset: 2px;
}

.pilot-waypoint-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.pilot-waypoint-steps li {
  border: 1px solid #2d4258;
  border-radius: 7px;
  background: #101c2b;
  padding: 6px 8px;
  font-size: 0.8rem;
  color: #b7cbe2;
}

.pilot-waypoint-steps li.is-active {
  border-color: #7aa3d4;
  color: #eaf4ff;
}

.pilot-waypoint-steps li.is-complete {
  border-color: #5cbf82;
  color: #d9f7e4;
}

.pilot-waypoint-dot,
.pilot-waypoint-drone {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.pilot-waypoint-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(234, 244, 255, 0.95);
  background: rgba(109, 166, 246, 0.82);
  box-shadow: 0 0 0 3px rgba(9, 16, 24, 0.5);
}

.pilot-waypoint-dot::after {
  content: attr(data-label);
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  color: #eaf4ff;
  font-size: 0.72rem;
  white-space: nowrap;
}

.pilot-waypoint-dot.is-target {
  background: rgba(248, 205, 86, 0.94);
  border-color: rgba(255, 242, 191, 0.98);
}

.pilot-waypoint-dot.is-complete {
  background: rgba(88, 193, 128, 0.86);
  border-color: rgba(208, 249, 222, 0.95);
}

.pilot-waypoint-drone {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid rgba(224, 235, 247, 0.85);
  background: linear-gradient(145deg, rgba(246, 207, 88, 0.94), rgba(192, 150, 39, 0.92));
  box-shadow:
    0 0 0 2px rgba(13, 21, 31, 0.48),
    0 5px 14px rgba(0, 0, 0, 0.33);
}

.pilot-waypoint-actions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pilot-waypoint-actions button {
  flex: 1 1 140px;
  padding: 8px;
  font-size: 0.82rem;
}

.pilot-waypoint-list {
  margin-top: 8px;
  list-style: none;
  padding: 0;
  display: grid;
  gap: 6px;
}

.pilot-waypoint-list li {
  border: 1px solid #30465f;
  background: #0f1a27;
  border-radius: 8px;
  padding: 7px 8px;
  font-size: 0.82rem;
}

#reportOutput .report-checklist {
  margin: 0.35rem 0 0;
  padding-left: 1.25rem;
}

#reportOutput .report-checklist-done {
  color: #b8e6c8;
}

#reportOutput .report-checklist-open {
  color: var(--muted);
}

@media print {
  body {
    background: #fff;
    color: #111;
  }

  /* Mission console + dashboard: only print the after-action report block (not a fixed grid index). */
  nav.mvp-breadcrumb,
  .page-header,
  #loginSection,
  .toolbar,
  #persistentHeader,
  #doNotReloadBanner,
  .dashboard-home .mvp-home-hero,
  .dashboard-home .mvp-home-stats,
  .dashboard-home .mvp-home-command,
  .dashboard-home .mvp-home-foot,
  .grid > *:not(:has(#reportOutput)),
  .mvp-home-grid > *:not(:has([data-dashboard-report-output])) {
    display: none !important;
  }

  /*
   * Mission Overwatch: the grid row that contains #reportOutput also wraps Event Log + Mission
   * footage (:has matches the whole wrapper). Hide those so print/PDF is only the generated AAR.
   */
  .mvp-ow-event-log,
  .mvp-ow-footage {
    display: none !important;
  }

  .grid,
  .mvp-home-grid {
    display: block;
  }

  /* Strip chrome around the embedded report HTML */
  section:has(#reportOutput) > h2,
  section:has(#reportOutput) > .button-row,
  section:has(#reportOutput) > p.muted,
  article:has([data-dashboard-report-output]) > h2,
  article:has([data-dashboard-report-output]) > p.muted,
  article:has([data-dashboard-report-output]) > ul.list,
  article:has([data-dashboard-report-output]) > .mvp-home-report-actions {
    display: none !important;
  }

  .card,
  .ar-dash-surface,
  .report {
    border: 0;
    background: #fff;
    color: #111;
    padding: 0;
    margin: 0;
  }

  .report ul {
    padding-left: 1.25em;
  }

  .report img.event-screenshot {
    max-width: 100%;
    page-break-inside: avoid;
  }

  /* In-app only; embedded screenshot image still prints below. */
  .report .event-meta {
    display: none !important;
  }

  /* After-action footage QR block */
  .report .footage-qr-block {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .report .footage-qr-svg {
    background: #fff;
    border: 1px solid #ccc;
  }

  .report .footage-qr-svg svg {
    width: 220px;
    height: 220px;
  }

  .report .footage-qr-caption,
  .report .footage-qr-url {
    color: #333;
  }

  /*
   * After-action modal: Print / Save PDF toggles body.aar-modal-print-session so only the dialog
   * content prints (not the mission console grid).
   */
  body.aar-modal-print-session > *:not(#afterActionReportModalOverlay) {
    display: none !important;
  }

  body.aar-modal-print-session #afterActionReportModalOverlay {
    position: static !important;
    inset: auto !important;
    background: transparent !important;
    backdrop-filter: none !important;
    padding: 0 !important;
    display: block !important;
    z-index: auto !important;
  }

  body.aar-modal-print-session #afterActionReportModalOverlay .aar-modal-panel {
    max-height: none !important;
    width: 100% !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  body.aar-modal-print-session #afterActionReportModalOverlay .aar-modal-scroll {
    overflow: visible !important;
    padding: 0 !important;
  }

  body.aar-modal-print-session #afterActionReportModalOverlay .aar-modal-no-print {
    display: none !important;
  }
}

/* After-action report: footage QR (replaces inline footage clips) */
.report .footage-qr-block {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.report .footage-qr-svg {
  display: inline-block;
  background: #fff;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #d4dee9;
  line-height: 0;
}

.report .footage-qr-svg svg {
  display: block;
  width: 180px;
  height: 180px;
}

.report .footage-qr-caption {
  margin: 0;
  font-size: 0.9rem;
  max-width: 60ch;
}

.report .footage-qr-url {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--muted);
  word-break: break-all;
}

.report .footage-qr-fallback {
  display: inline-block;
  padding: 6px 10px;
  border: 1px dashed #5a708a;
  border-radius: 12px;
}

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

  .span-2 {
    grid-column: auto;
  }

  .right-column {
    grid-column: auto;
  }

  .toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .sticky-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    top: 6px;
  }

  .sticky-summary.sticky-summary--past {
    grid-template-columns: 1fr;
    column-gap: 0;
    row-gap: 12px;
  }

  .sticky-summary.sticky-summary--past > .sticky-past-play,
  .sticky-summary.sticky-summary--past > .sticky-summary-operator,
  .sticky-summary.sticky-summary--past > .sticky-summary-mission,
  .sticky-summary.sticky-summary--past > .sticky-past-meta,
  .sticky-summary.sticky-summary--past > .sticky-past-actions,
  .sticky-summary.sticky-summary--past > .sticky-executive-summary {
    grid-column: 1;
    grid-row: auto;
    justify-self: stretch;
    width: auto;
  }

  .sticky-summary.sticky-summary--past > .sticky-past-play {
    justify-self: end;
  }

  .sticky-summary.sticky-summary--past > .sticky-past-actions {
    justify-self: start;
  }

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

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

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

@media (max-width: 1180px) {
  .mvp-overwatch-grid.mvp-relay-live {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "ow-session"
      "ow-scenario"
      "ow-feed"
      "ow-right"
      "ow-below";
  }

  /* Keep single-column stack; do not apply wide 3-col template from .mvp-scenario-collapsed */
  .mvp-overwatch-grid.mvp-relay-live.mvp-scenario-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }

  #mvpOverwatchMain.mvp-overwatch-layout-live {
    width: min(1050px, 94vw);
    max-width: 1050px;
  }
}

/* Public HTTPS: LAN relay banner (ws:// blocked from https:// origins) */
.mvp-lan-https-banner {
  border-color: #b8922a;
  background: linear-gradient(180deg, #2a2415, #151c12);
  margin-bottom: 4px;
}

.mvp-lan-banner-title {
  margin: 0 0 8px;
  font-size: 1.15rem;
  color: #f0e6c8;
}

.mvp-lan-banner-lead {
  margin: 0 0 10px;
  line-height: 1.5;
}

.mvp-lan-banner-lead code,
.mvp-lan-banner-steps code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88em;
  color: #c5d8ee;
}

.mvp-lan-banner-steps {
  margin: 0;
  padding-left: 1.35em;
  line-height: 1.55;
  color: var(--text);
}

.mvp-lan-banner-steps li + li {
  margin-top: 10px;
}

.mvp-lan-banner-steps a {
  color: var(--accent);
  font-weight: 600;
}

.mvp-lan-banner-more {
  margin: 12px 0 0;
}
