
:root {
  --pv-bg: #eef5f7;
  --pv-surface: rgba(255,255,255,0.78);
  --pv-surface-strong: rgba(255,255,255,0.92);
  --pv-text: #12222d;
  --pv-muted: #5d7281;
  --pv-line: rgba(18,34,45,0.12);
  --pv-teal: #0f7c83;
  --pv-blue: #2c5bff;
  --pv-good: #1f8b53;
  --pv-bad: #c53a3a;
  --pv-warn: #d68017;
  --pv-shadow: 0 18px 45px rgba(34, 63, 94, 0.10);
}

.cockpit-shell {
  display: grid;
  gap: 1rem;
  color: var(--pv-text);
}

.enhanced-shell {
  background:
    radial-gradient(circle at 15% 20%, rgba(30,126,201,0.10), transparent 28%),
    radial-gradient(circle at 85% 12%, rgba(16,156,137,0.10), transparent 24%),
    linear-gradient(180deg, #f6fbfd 0%, #edf4f8 100%);
  border-radius: 28px;
  padding: 1rem;
  border: 1px solid rgba(20, 49, 69, 0.08);
  box-shadow: var(--pv-shadow);
}

.aircraft-strip-wrap,
.viewer-card,
.status-card,
.log-card,
.debrief-card,
.aircraft-strip,
.ops-comms,
.ops-brief {
  border: 1px solid var(--pv-line);
  border-radius: 24px;
  background: var(--pv-surface);
  backdrop-filter: blur(18px);
  box-shadow: 0 8px 30px rgba(51, 82, 109, 0.08);
}

.aircraft-strip-wrap {
  display: grid;
  gap: 0.9rem;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.aircraft-strip {
  padding: 0.8rem 1rem;
  display: grid;
  gap: 0.75rem;
}

.aircraft-strip.alert {
  box-shadow: 0 0 0 1px rgba(197,58,58,0.16), 0 0 0 6px rgba(197,58,58,0.05);
}

.strip-primary {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0.6rem;
}

.strip-block,
.strip-ecam,
.ops-brief-grid > div,
.score-card {
  padding: 0.72rem 0.85rem;
  border-radius: 18px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(18,34,45,0.08);
}

.strip-block span,
.strip-ecam span,
.ops-brief-grid span,
.score-card span,
.ops-head,
.section-kicker,
.eyebrow,
.progress-title {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.67rem;
  color: var(--pv-muted);
}

.strip-block strong,
.strip-ecam strong,
.ops-brief-grid strong,
.score-card strong {
  display: block;
  margin-top: 0.22rem;
  font-size: 1rem;
  color: #143142;
}

.strip-block.emphasis {
  background: linear-gradient(135deg, rgba(16,124,131,0.14), rgba(44,91,255,0.08));
}

.strip-block.risk-high,
.strip-block.risk-critical {
  background: linear-gradient(135deg, rgba(197,58,58,0.14), rgba(214,128,23,0.10));
}

.strip-block.risk-medium {
  background: linear-gradient(135deg, rgba(214,128,23,0.14), rgba(255,255,255,0.7));
}

.strip-ecam {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(90deg, rgba(255,247,247,0.95), rgba(255,255,255,0.75));
}

.strip-ecam strong {
  color: #a53232;
}

.ops-band {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0.8rem;
}

.ops-comms,
.ops-brief {
  padding: 0.9rem 1rem;
}

.comms-ticker {
  margin-top: 0.55rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 58px;
  padding: 0.7rem 0.8rem;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(17,108,183,0.08), rgba(16,124,131,0.08));
  border: 1px solid rgba(18,34,45,0.08);
  animation: tickerFade 420ms ease;
}

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

.role-pill {
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(18,34,45,0.08);
  font-size: 0.75rem;
  font-weight: 700;
  color: #18485d;
  flex: 0 0 auto;
}

.comms-text {
  color: #294655;
  line-height: 1.5;
}

.ops-brief-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.55rem;
}

.viewer-card,
.status-card,
.log-card,
.debrief-card {
  padding: 1rem;
}

.viewer-head,
.status-top,
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.viewer-head h2,
.status-top h3,
.modal-head h3 {
  margin: 0;
}

.top-tools {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.scenario-select,
.default-btn,
.zoom-pod,
.view-tabs button,
.hint-btn,
.archive-head,
.modal-close {
  border: 1px solid rgba(18,34,45,0.10);
  background: rgba(255,255,255,0.82);
  color: #183545;
}

.scenario-select,
.default-btn,
.hint-btn,
.modal-close {
  border-radius: 16px;
  padding: 0.7rem 0.9rem;
}

.view-tabs,
.zoom-pod {
  display: inline-flex;
  align-items: center;
  border-radius: 18px;
  overflow: hidden;
}

.view-tabs button,
.zoom-pod button,
.zoom-pod div {
  padding: 0.7rem 0.82rem;
}

.view-tabs button.active,
.telemetry-tabs button.active {
  background: linear-gradient(135deg, rgba(15,124,131,0.18), rgba(44,91,255,0.12));
  color: #0d4f57;
}

.viewer-stage {
  position: relative;
  height: min(52vw, 560px);
  border-radius: 24px;
  overflow: hidden;
  margin-top: 0.9rem;
  background:
    linear-gradient(180deg, rgba(240,246,250,0.75), rgba(225,235,241,0.88)),
    url('/images/cockpit/comp_bg.png') center/cover no-repeat;
  border: 1px solid rgba(19,49,66,0.10);
  cursor: grab;
}

.cinematic-stage {
  background:
    linear-gradient(180deg, rgba(240,246,250,0.75), rgba(225,235,241,0.88)),
    url('/images/cockpit/comp_bg.png') center/cover no-repeat;
}

.viewer-stage:active {
  cursor: grabbing;
}

.viewer-inner {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center center;
  transition: transform 0.42s cubic-bezier(0.2, 1, 0.2, 1);
}

.viewer-inner img {
  display: block;
  max-width: none;
  width: auto;
  height: auto;
  user-select: none;
  pointer-events: none;
}

.panel-overlay,
.modal-hotspots,
.expected-hotspots {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.panel-zone {
  fill: rgba(27, 139, 170, 0.10);
  stroke: rgba(13, 93, 117, 0.18);
  stroke-width: 2;
  transition: fill 180ms ease, stroke 180ms ease, opacity 180ms ease;
}

.panel-zone.study:hover,
.panel-zone.scenario:hover {
  fill: rgba(25, 112, 150, 0.18);
  stroke: rgba(13, 93, 117, 0.34);
}

.panel-zone.expected {
  fill: rgba(214, 128, 23, 0.18);
  stroke: rgba(214, 128, 23, 0.75);
  animation: expectedPulse 1.5s ease-in-out infinite;
}

@keyframes expectedPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.viewer-hud {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  padding: 0.72rem 0.95rem;
  border-radius: 18px;
  background: rgba(248,252,255,0.82);
  border: 1px solid rgba(18,34,45,0.08);
  color: #2d4a59;
  font-size: 0.9rem;
  backdrop-filter: blur(10px);
}

.desk-row,
.score-row {
  display: grid;
  gap: 0.9rem;
}

.desk-row {
  grid-template-columns: 1fr 1fr 1fr;
}

.timer-box,
.callout,
.micro-callout,
.log-note,
.archive-body,
.debrief-box,
.study-note-inline,
.missed-box,
.required-list {
  border-radius: 18px;
  padding: 0.82rem 0.9rem;
  border: 1px solid rgba(18,34,45,0.08);
  background: rgba(255,255,255,0.72);
}

.timer-box strong {
  display: block;
  margin-top: 0.28rem;
  font-size: 1.5rem;
}

.timer-box.pulse {
  animation: timerPulse 1s ease-in-out infinite;
}

@keyframes timerPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(197,58,58,0.12); }
  50% { box-shadow: 0 0 0 6px rgba(197,58,58,0.06); }
}

.callout.info,
.log-note.info,
.archive-body.info {
  background: rgba(17,108,183,0.08);
}

.callout.good,
.log-note.good,
.archive-body.good,
.micro-callout.hint-state {
  background: rgba(31,139,83,0.09);
}

.callout.bad,
.log-note.bad,
.archive-body.bad,
.missed-box {
  background: rgba(197,58,58,0.10);
}

.log-grid,
.archive-wrap,
.step-track,
.debrief-grid,
.modal-body,
.modal-figure-wrap,
.fallback-preview-wrap {
  display: grid;
  gap: 0.75rem;
}

.step-track {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.step-pill {
  min-height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255,255,255,0.68);
  border: 1px solid rgba(18,34,45,0.08);
  font-weight: 700;
  color: #46606f;
}

.step-pill.done {
  background: rgba(31,139,83,0.12);
  color: #18633e;
}

.step-pill.bad {
  background: rgba(197,58,58,0.12);
  color: #8d2d2d;
}

.archive-head {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0.9rem;
  border-radius: 16px;
}

.score-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 0.9rem;
}

.score-card span {
  display: block;
}

.debrief-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.expected-figure,
.modal-figure {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(244,248,251,0.9);
  border: 1px solid rgba(18,34,45,0.08);
}

.expected-figure img,
.modal-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.expected-hotspot {
  fill: rgba(214,128,23,0.20);
  stroke: rgba(214,128,23,0.95);
  stroke-width: 3;
}

.modal-hotspot {
  fill: rgba(15,124,131,0.14);
  stroke: rgba(15,124,131,0.70);
  stroke-width: 2.5;
  transition: fill 160ms ease, stroke 160ms ease;
}

.modal-hotspot.required {
  fill: rgba(44,91,255,0.12);
  stroke: rgba(44,91,255,0.74);
}

.modal-hotspot.checked {
  fill: rgba(31,139,83,0.16);
  stroke: rgba(31,139,83,0.95);
}

.check-mark circle {
  fill: rgba(31,139,83,0.92);
}

.check-mark path {
  fill: none;
  stroke: white;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.modal-shell {
  position: fixed;
  inset: 0;
  background: rgba(12, 22, 30, 0.46);
  display: grid;
  place-items: center;
  padding: 1rem;
  z-index: 60;
}

.modal-card {
  width: min(1000px, 96vw);
  max-height: 92vh;
  overflow: auto;
  padding: 1rem;
  border-radius: 24px;
  background: rgba(248,252,255,0.96);
  border: 1px solid rgba(18,34,45,0.10);
  box-shadow: 0 25px 70px rgba(22, 34, 49, 0.20);
}

.modal-sub,
.log-note span,
.archive-body small,
.fallback-label {
  color: var(--pv-muted);
  font-size: 0.84rem;
}

.fallback-preview {
  background-repeat: no-repeat;
  border-radius: 16px;
  border: 1px solid rgba(18,34,45,0.08);
  max-width: 100%;
}

.required-list strong,
.debrief-box strong,
.log-note strong,
.callout strong,
.micro-callout strong,
.study-note-inline strong,
.score-card strong {
  display: block;
}

button,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

@media (max-width: 1100px) {
  .strip-primary,
  .desk-row,
  .score-row,
  .debrief-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ops-band {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .viewer-head,
  .status-top,
  .modal-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .strip-primary,
  .desk-row,
  .score-row,
  .debrief-grid,
  .ops-brief-grid {
    grid-template-columns: 1fr;
  }

  .viewer-stage {
    height: min(74vw, 500px);
  }
}
