/* Flight-test blueprint: deep navy drafting grid, cyan instruments, amber highlights */
:root {
  --navy: #081426;
  --panel: rgba(12, 28, 52, 0.78);
  --line: rgba(127, 219, 255, 0.14);
  --cyan: #7fdbff;
  --amber: #f2c14e;
  --ink: #d6e4f5;
  --ink-muted: #6a87ab;
  --mono: "JetBrains Mono", monospace;
}

body {
  background-color: var(--navy);
  background-image:
    radial-gradient(ellipse at 70% 40%, rgba(31, 181, 201, 0.08), transparent 60%),
    linear-gradient(rgba(127, 219, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(127, 219, 255, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(127, 219, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(127, 219, 255, 0.03) 1px, transparent 1px);
  background-size: 100% 100%, 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-attachment: fixed;
  color: var(--ink);
}

.mantine-AppShell-header {
  background: rgba(8, 20, 38, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.mantine-AppShell-main {
  background: transparent;
}

.tail-number {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--amber);
  border: 1px solid var(--amber);
  padding: 4px 8px;
}

.subtitle,
.telemetry {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}

.telemetry {
  color: var(--ink);
}

.telemetry-label {
  color: var(--cyan);
  margin-right: 6px;
}

/* The whole app fits in one viewport on desktop: controls and readouts on the
   left, the 3D view fills the remaining space on the right */
.page {
  box-sizing: border-box;
  height: calc(100dvh - var(--app-shell-header-height));
  max-width: 1800px;
  margin: 0 auto;
  padding: 14px 20px 18px;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 14px;
}

.card {
  position: relative;
  box-sizing: border-box;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(6px);
}

/* Drafting corner brackets */
.card::before,
.card::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
}

.card::before {
  top: -1px;
  left: -1px;
  border-top: 2px solid var(--cyan);
  border-left: 2px solid var(--cyan);
}

.card::after {
  bottom: -1px;
  right: -1px;
  border-bottom: 2px solid var(--cyan);
  border-right: 2px solid var(--cyan);
}

.controls {
  overflow-y: auto;
}

.section-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-label:not(:first-child) {
  margin-top: 4px;
}

.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.section-number {
  color: var(--amber);
}

.control-value {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--cyan);
}

.mantine-Slider-markLabel {
  font-family: var(--mono);
  font-size: 10px;
}

.card-head {
  min-height: 24px;
  margin-bottom: 4px;
}

.view-title {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
}

.view-meta,
.view-hint {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-muted);
  white-space: pre;
}

.view-hint {
  position: absolute;
  left: 16px;
  bottom: 12px;
  pointer-events: none;
}

/* The graph fills whatever height is left in its card (dcc.Loading puts the
   parent class on two nested divs, so only position the outer one) */
.view-card > .view-loading {
  flex: 1;
  min-height: 0;
  position: relative;
}

.view-graph {
  position: absolute;
  inset: 0;
}

.readout-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

/* Tooltip targets get an inline fit-content width; stretch them to the cell */
.readout-grid > *,
.readout-row > * {
  width: auto !important;
}

.readout {
  box-sizing: border-box;
  padding: 6px 10px;
  background: rgba(6, 15, 29, 0.7);
  border-left: 2px solid var(--cyan);
}

.readout-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
}

.readout-value {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.readout-hero {
  border-left-color: var(--amber);
  padding: 8px 12px;
}

.readout-hero .readout-value {
  font-size: 34px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--amber);
  text-shadow: 0 0 18px rgba(242, 193, 78, 0.35);
}

.spacer {
  flex: 1;
}

.source p {
  margin: 0;
  font-size: 11px;
  color: var(--ink-muted);
}

.source a {
  color: inherit;
}

.dash-logo {
  display: flex;
}

/* Small screens: stack the controls above the 3D view and let the page scroll */
@media (max-width: 900px) {
  .page {
    height: auto;
    grid-template-columns: minmax(0, 1fr);
    padding: 12px;
  }

  .view-card {
    height: 70vh;
  }
}

@media (max-width: 600px) {
  .dash-logo {
    display: none;
  }
}
