/* The instrument button uses existing header space; chart sizing is unchanged. */
#trackChartModal .chart-modal-header { position: relative; }
#trackChartModal .glide-profile-toggle {
  position: absolute; right: .6rem; top: 50%; transform: translateY(-50%);
  width: 25px; height: 20px; padding: 1px 3px;
  border: 1px solid var(--border-subtle); border-radius: 3px;
  color: var(--text-primary); background: var(--surface-chip); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
#trackChartModal .glide-profile-icon {
  width: 17px; height: 14px; background: currentColor;
  mask: url('res/symbols_icons/glide_airplane.svg') center / contain no-repeat;
  -webkit-mask: url('res/symbols_icons/glide_airplane.svg') center / contain no-repeat;
}
#trackChartModal .chart-meta { min-width: 0; padding-right: 31px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.glide-profile-toggle:hover { outline: 1px solid #76e4ff; }
.glide-profile-toggle:focus-visible, .gp-close:focus-visible { outline: 2px solid #76e4ff; outline-offset: 2px; }
.glide-profile-modal {
  width: min(920px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px);
  padding: 0; margin: auto; overflow: auto; box-sizing: border-box;
  color: #dce7ef; background: #0a1520; border: 1px solid #466071; border-radius: 6px;
  box-shadow: 0 24px 100px #000b; font: 12px/1.5 system-ui, sans-serif;
  color-scheme: dark;
}
.glide-profile-modal::backdrop { background: #02080dc2; }
.gp-header { display: flex; align-items: center; gap: 20px; padding: 18px 24px; border-bottom: 1px solid #2b4050; background: #101e2b; }
.gp-eyebrow { color: #88a7bb; font: 10px/1.4 ui-monospace, Consolas, monospace; letter-spacing: 2px; }
.gp-header h2 { color: #eef6fc; font-size: 20px; font-weight: 600; margin: 2px 0 0; letter-spacing: .3px; }
.gp-identity { margin-left: auto; color: #76e4ff; font: 600 16px ui-monospace, Consolas, monospace; }
.gp-close { width: 30px; height: 30px; flex-shrink: 0; border: 1px solid #466071; background: transparent; color: #dce7ef; border-radius: 3px; cursor: pointer; font-size: 23px; line-height: 1; }
.gp-close:hover { background: #263c4b; }
.gp-strip { display: flex; gap: 18px; align-items: center; padding: 10px 24px; border-bottom: 1px solid #263a49; font: 11px ui-monospace, Consolas, monospace; letter-spacing: .7px; color: #a8bdcb; }
.gp-strip b { color: #eef6fc; margin-left: 8px; }
.gp-status { margin-left: auto; color: #65e4c0; font-weight: 700; }
.gp-status::before { content: '●'; margin-right: 7px; }
.gp-status.gp-stale { color: #ffc36b; }
.gp-metrics { display: grid; grid-template-columns: 1.2fr 1.15fr 1.1fr 1fr; padding: 20px 24px 16px; gap: 16px; }
.gp-metric { min-width: 0; border-right: 1px solid #263a49; }
.gp-metric:last-child { border-right: 0; }
.gp-metric > span { display: block; color: #9ab1c1; font: 10px/1.4 ui-monospace, Consolas, monospace; letter-spacing: .6px; }
.gp-metric strong { display: block; margin: 5px 0 2px; color: #edf6ff; font: 500 25px/1.2 ui-monospace, Consolas, monospace; font-variant-numeric: tabular-nums; }
.gp-metric small { color: #a7bac8; font-size: 10px; }
.gp-primary strong { color: #76e4ff; }
.gp-plot { padding: 0 10px; }
.gp-plot svg { width: 100%; height: auto; display: block; font-family: ui-monospace, Consolas, monospace; }
.gp-grid { stroke: #21313f; stroke-width: 1; }
.gp-axis { fill: #9bb1c1; font-size: 11px; }
.gp-axis-title { fill: #90a8bb; font-size: 10px; letter-spacing: 1px; }
.gp-reference { fill: none; stroke: #d4dfe9; stroke-width: 2; stroke-dasharray: 8 6; }
.gp-extension { opacity: .4; }
.gp-trajectory { fill: none; stroke: #76e4ff; stroke-width: 2.5; }
.gp-guide { stroke: #547186; stroke-dasharray: 3 5; }
.gp-separation { stroke-width: 1.7; }
.gp-clearance-label { font-size: 13px; font-weight: 700; paint-order: stroke; stroke: #0a1520; stroke-width: 5px; stroke-linejoin: round; }
.gp-aircraft-label { fill: #76e4ff; font-size: 11px; paint-order: stroke; stroke: #0a1520; stroke-width: 4px; }
.gp-ground { fill: #31414b; }
.gp-no-aircraft { fill: #ffc36b; font-size: 14px; paint-order: stroke; stroke: #0a1520; stroke-width: 6px; }
.gp-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 24px; padding: 6px 20px 18px; color: #c3d2de; font-size: 11px; }
.gp-legend span { display: inline-flex; align-items: center; gap: 8px; }
.gp-legend i { width: 24px; display: inline-block; border-top: 2px solid #76e4ff; }
.gp-legend .gp-dash { border-top: 2px dashed #d4dfe9; }
.gp-legend .gp-fade { border-top: 2px dashed #667984; }
.gp-foot { display: flex; justify-content: space-between; gap: 12px; padding: 10px 24px; border-top: 1px solid #263a49; color: #9ab1c1; font-size: 10px; }
.gp-detail { padding-top: 0; border-top: 0; }
.gp-empty { min-height: 290px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #b7cad8; padding: 20px; }
.gp-empty-symbol { font-size: 45px; color: #76e4ff; }
.gp-empty strong { font: 13px ui-monospace, Consolas, monospace; letter-spacing: 1.5px; }
.gp-empty p { color: #9ab1c1; }
@media (max-width: 650px) {
  .gp-header { padding: 14px; gap: 12px; }
  .gp-header h2 { font-size: 18px; }
  .gp-identity { font-size: 13px; }
  .gp-strip { padding: 10px 14px; gap: 10px; font-size: 10px; flex-wrap: wrap; }
  .gp-metrics { grid-template-columns: 1fr 1fr; padding: 16px; gap: 16px; }
  .gp-metric:nth-child(2) { border-right: 0; }
  .gp-metric strong { font-size: 22px; }
  .gp-plot { overflow-x: auto; padding: 0; }
  .gp-plot svg { min-width: 620px; }
  .gp-foot { padding-left: 14px; padding-right: 14px; flex-wrap: wrap; }
}
