/* A single route panel keeps map controls together without stretching with the viewport. */
#flight-route-panel.flight-route-workspace {
  --frw-paper: #fff;
  --frw-ink: #172b45;
  --frw-muted: #586b82;
  --frw-line: #d6e0ec;
  --frw-soft: #f4f7fb;
  --frw-accent: #1763dc;
  --frw-accent-soft: #edf4ff;
  --frw-alternate: #087f8c;
  --frw-danger: #b42338;
  --frw-shadow: 0 8px 24px rgb(15 23 42 / 16%);
  --frw-radius: 6px;
  --frw-control-height: 40px;
  --frw-compact-height: 32px;
  --frw-row-height: 64px;
  --frw-panel-padding: 16px;
  --frw-font-body: 14px;
  --frw-font-label: 12px;
  --frw-line-height: 20px;
  --frw-panel-width: 400px;
  --route-panel-bg: var(--frw-paper);
  --route-panel-border: var(--frw-line);
  --route-panel-text: var(--frw-ink);
  --route-panel-muted: var(--frw-muted);
  --route-panel-control: var(--frw-paper);
  --route-panel-accent: var(--frw-accent);
  position: fixed;
  inset: 76px auto auto 16px;
  z-index: 13;
  display: flex;
  width: var(--frw-panel-width);
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 212px);
  padding: 0;
  overflow: visible;
  border: 1px solid var(--frw-line);
  border-radius: var(--frw-radius);
  background: var(--frw-paper);
  box-shadow: var(--frw-shadow);
  backdrop-filter: none;
  color: var(--frw-ink);
  font-size: var(--frw-font-body);
  font-weight: 400;
  line-height: var(--frw-line-height);
}
#flight-route-panel.flight-route-workspace.is-collapsed { display: none; }
.flight-route-workspace *, .flight-route-workspace *::before, .flight-route-workspace *::after { box-sizing: border-box; }
.flight-route-workspace [hidden] { display: none !important; }
.frw-form { display: flex; flex-direction: column; min-width: 0; min-height: 0; max-height: inherit; width: 100%; margin: 0; }
.flight-route-workspace button, .flight-route-workspace summary { font: inherit; cursor: pointer; }
.flight-route-workspace button { min-height: var(--frw-control-height); padding: 8px 12px; border: 1px solid var(--frw-line); border-radius: 4px; background: var(--frw-paper); color: var(--frw-ink); font-weight: 600; line-height: var(--frw-line-height); }
.flight-route-workspace button:hover:not(:disabled), .flight-route-workspace button[aria-expanded="true"], .flight-route-workspace button[aria-pressed="true"] { border-color: var(--frw-accent); background: var(--frw-accent-soft); }
.flight-route-workspace button:disabled { opacity: .48; cursor: default; }
.flight-route-workspace :is(button, input, select, summary):focus-visible { outline: 2px solid var(--frw-accent); outline-offset: 2px; }
.flight-route-workspace input:not([type="checkbox"]):not([type="hidden"]), .flight-route-workspace select { min-width: 0; width: 100%; height: var(--frw-control-height); min-height: var(--frw-control-height); padding: 8px; border: 1px solid var(--frw-line); border-radius: 4px; box-shadow: none; background: var(--frw-paper); color: var(--frw-ink); color-scheme: light; font: inherit; font-size: var(--frw-font-body); font-weight: 400; line-height: var(--frw-line-height); }
.flight-route-workspace input::placeholder { color: var(--frw-muted); opacity: 1; }
.flight-route-workspace input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--frw-accent); margin: 0; }
.flight-route-workspace input[aria-invalid="true"] { border-color: var(--frw-danger) !important; }
.flight-route-workspace .frw-primary, .flight-route-workspace #flight-route-profile { background: var(--frw-accent); color: #fff; border-color: var(--frw-accent); }
.flight-route-workspace .frw-primary:hover:not(:disabled), .flight-route-workspace #flight-route-profile:hover:not(:disabled) { background: #104cae; }
.flight-route-workspace .frw-icon-button { display: inline-grid; place-items: center; width: var(--frw-control-height); height: var(--frw-control-height); padding: 0; font-size: 20px; line-height: 1; flex: 0 0 var(--frw-control-height); }
.flight-route-workspace .frw-danger { color: var(--frw-danger); }
.flight-route-workspace .frw-text-button { border: 0; color: var(--frw-accent); padding-left: 0; background: transparent; }
.frw-strip { position: relative; display: flex; align-items: center; gap: 4px; padding: 24px var(--frw-panel-padding) 12px; flex: 0 0 auto; }
.flight-route-workspace .frw-drag-handle { position: absolute; top: 0; left: 50%; transform: translateX(-50%); display: grid; place-items: center; width: 64px; min-height: 20px; height: 20px; padding: 0; border: 0; background: transparent; color: var(--frw-muted); font-size: 16px; letter-spacing: 4px; line-height: 1; cursor: grab; touch-action: none; user-select: none; }
.flight-route-workspace .frw-resize-handle { flex: 0 0 12px; min-height: 12px; height: 12px; width: 100%; display: grid; place-items: center; padding: 0; border: 0; border-radius: 0 0 var(--frw-radius) var(--frw-radius); background: transparent; cursor: ns-resize; touch-action: none; user-select: none; }
.frw-resize-handle span { width: 40px; height: 3px; border-radius: 2px; background: var(--frw-line); }
.flight-route-workspace .frw-resize-handle:hover span, .flight-route-workspace .frw-resize-handle:focus-visible span { background: var(--frw-accent); }
.flight-route-workspace.is-frw-positioned .frw-form { height: 100%; max-height: 100%; }
.flight-route-workspace.is-frw-positioned.is-minimized .frw-form { height: auto; }
.flight-route-workspace.is-frw-dragging, .flight-route-workspace.is-frw-dragging .frw-drag-handle { cursor: grabbing; user-select: none; }
.flight-route-workspace.is-frw-resizing { user-select: none; }
.frw-title { min-width: 0; flex: 1; }
.frw-title h2 { margin: 0 0 4px; font-size: 18px; line-height: 24px; font-weight: 600; }
.frw-title .flight-route-summary { color: var(--frw-muted); font-size: var(--frw-font-label); line-height: 16px; font-weight: 400; margin: 0; }
.flight-route-workspace .frw-strip .frw-icon-button { align-self: flex-start; border-color: transparent; background: transparent; }
.flight-route-workspace .frw-strip .frw-icon-button:hover { background: var(--frw-soft); }
.frw-tabs { display: flex; flex: 0 0 auto; gap: 16px; padding: 0 var(--frw-panel-padding); border-bottom: 1px solid var(--frw-line); }
.flight-route-workspace .frw-tabs button { min-width: 96px; height: var(--frw-control-height); padding: 8px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; font-weight: 400; background: transparent; }
.flight-route-workspace .frw-tabs button[aria-selected="true"] { color: var(--frw-accent); border-bottom-color: var(--frw-accent); font-weight: 600; }
.frw-main { min-height: 0; flex: 1 1 auto; padding: 16px var(--frw-panel-padding); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scroll-padding-block: 16px; }
.frw-overview { display: grid; gap: 16px; }
.frw-ribbon { position: relative; min-width: 0; display: grid; }
.frw-ribbon::before { content: ''; position: absolute; top: calc(var(--frw-row-height) / 2); bottom: calc(var(--frw-row-height) / 2); left: 13px; width: 2px; background: var(--frw-line); }
.frw-waypoints { position: relative; display: grid; }
.frw-waypoints:empty { display: none; }
.frw-endpoint-row { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr) var(--frw-compact-height); align-items: center; gap: 8px; min-height: var(--frw-row-height); }
.frw-point-number { display: grid; place-items: center; border-radius: 50%; width: 28px; height: 28px; background: var(--frw-accent); color: #fff; font-size: 12px; font-weight: 600; flex: 0 0 28px; outline: 4px solid var(--frw-paper); z-index: 1; }
.flight-route-workspace .frw-endpoint { min-width: 0; display: grid; grid-template-columns: 20px minmax(0, 1fr) auto 12px; align-items: center; gap: 4px; padding: 8px; text-align: left; font-weight: 400; }
.frw-endpoint .frw-caption { grid-column: 1 / -1; }
.frw-endpoint img { width: 20px; height: 20px; grid-column: 1; }
.frw-endpoint strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; font-weight: 600; }
.frw-binding { color: var(--frw-accent); font-size: 12px; }
.frw-chevron { grid-column: 4; }
.frw-caption { color: var(--frw-muted); font-size: var(--frw-font-label); line-height: 16px; font-weight: 400; }
.flight-route-workspace .frw-point-edit { display: grid; place-items: center; width: var(--frw-compact-height); height: var(--frw-compact-height); min-height: var(--frw-compact-height); border-color: transparent; padding: 0; font-weight: 400; }
.flight-route-workspace .frw-point-token { display: grid; grid-template-columns: 28px minmax(0, 1fr) var(--frw-compact-height); align-items: center; gap: 8px; width: 100%; padding: 4px 0; border: 0; min-height: var(--frw-row-height); text-align: left; font-weight: 400; background: transparent; }
.frw-point-description { display: grid; min-width: 0; gap: 4px; padding: 0 8px; border-inline: 1px solid transparent; }
.frw-point-token-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.frw-point-coordinates { color: var(--frw-muted); font-size: var(--frw-font-label); line-height: 16px; font-variant-numeric: tabular-nums; }
.frw-edit-icon { display: flex; align-items: center; justify-content: center; width: var(--frw-compact-height); height: var(--frw-compact-height); font-size: 0; line-height: 0; }
.frw-point-edit .frw-edit-icon { width: 100%; height: 100%; }
.frw-edit-icon::before { content: ''; width: 16px; height: 16px; background: currentColor; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m16 4 4 4M4 16 16 4a2.8 2.8 0 0 1 4 4L8 20l-5 1 1-5Z'/%3E%3C/svg%3E") center / contain no-repeat; }
.flight-route-workspace .frw-add-point { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 16px; padding: 0; text-align: left; }
.frw-add-icon { border: 1px solid currentColor; border-radius: 50%; width: 28px; height: 28px; display: grid; place-items: center; font-size: 20px; line-height: 1; font-weight: 400; }
.frw-empty { color: var(--frw-muted); font-size: 12px; margin: 0; }
.frw-alternates { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 16px 0; border-block: 1px solid var(--frw-line); }
.frw-alternates > .frw-caption { flex-basis: 100%; }
.frw-alternates [data-frw-alternate-chips] { display: flex; gap: 8px; flex-wrap: wrap; min-width: 0; }
.frw-alternates [data-frw-alternate-chips]:empty { display: none; }
.flight-route-workspace .frw-alternate-chip { color: var(--frw-alternate); border-color: #acd6dc; background: #f0fafb; font-size: var(--frw-font-label); padding: 4px 8px; height: var(--frw-compact-height); min-height: var(--frw-compact-height); }
.flight-route-workspace .frw-alternates .frw-icon-button { width: var(--frw-compact-height); height: var(--frw-compact-height); min-height: var(--frw-compact-height); flex-basis: var(--frw-compact-height); }
.frw-departure-time .flight-route-plan-control { display: grid; gap: 4px; }
.frw-departure-time .flight-route-plan-control span { font-size: 12px; color: var(--frw-muted); }
.flight-route-workspace .frw-flight-summary { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; text-align: left; font-weight: 400; }
.frw-flight-summary [data-frw-flight-summary] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.frw-context { min-width: 0; }
.frw-context-head { margin-bottom: 8px; }
.flight-route-workspace .frw-back { display: inline-flex; align-items: center; gap: 8px; border: 0; padding: 0; color: var(--frw-accent); background: transparent; }
.frw-context-title { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.frw-context-body > section:not([hidden]) { display: grid; gap: 12px; }
.frw-context .frw-muted { margin: 0; color: var(--frw-muted); font-size: 12px; line-height: 1.5; }
.frw-field { display: grid; min-width: 0; gap: 4px; color: var(--frw-muted); font-size: 12px; font-weight: 600; }
.frw-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.frw-auto { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--frw-muted); }
.frw-point-actions { display: flex; gap: 8px; }
.frw-point-actions > button:first-child { flex: 1; padding-inline: 8px; }
.frw-point-airports { display: flex; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--frw-line); padding-top: 12px; }
.frw-point-airports > .frw-caption, .frw-point-airports p { width: 100%; }
.frw-radius label { grid-template-columns: 1fr 72px; align-items: center; gap: 12px; }
.frw-radius input { text-align: right; }
.frw-airport-hint { display: grid; gap: 4px; }
.frw-manual { border-top: 1px solid var(--frw-line); padding-top: 12px; margin-top: 8px; }
.frw-manual > summary { color: var(--frw-muted); padding-bottom: 8px; }
.flight-route-workspace .bulletin-airport-suggestion { width: 100%; display: flex; align-items: center; gap: 8px; text-align: left; min-height: 64px; border-color: transparent; padding: 8px; }
.flight-route-workspace .bulletin-airport-suggestion[aria-pressed="true"] { border-color: var(--frw-accent); }
.flight-route-workspace .bulletin-runway-icon { width: 24px; height: 24px; flex: 0 0 24px; }
.flight-route-workspace .bulletin-airport-candidate-name { display: grid; gap: 4px; flex: 1; min-width: 0; }
.flight-route-workspace .bulletin-airport-candidate-name strong { font-size: 14px; }
.flight-route-workspace .bulletin-airport-candidate-name > span { color: var(--frw-muted); font-weight: 400; font-size: 12px; overflow-wrap: anywhere; }
.flight-route-workspace .bulletin-airport-distance { white-space: nowrap; font-size: 11px; font-weight: 400; color: var(--frw-muted); }
.flight-route-workspace .bulletin-airport-check { color: var(--frw-accent); font-size: 16px; }
.flight-route-workspace .bulletin-muted { color: var(--frw-muted); font-size: 12px; }
.frw-notices { display: grid; flex: 0 0 auto; gap: 8px; padding: 0 var(--frw-panel-padding) 12px; max-height: 160px; overflow-y: auto; }
.frw-notices:not(:has(> :not([hidden]))) { display: none; }
.frw-notices > :not([hidden]) { margin: 0; }
.frw-error, .flight-route-workspace .error-box { padding: 8px 12px; border: 1px solid #f1b5bd; border-radius: 4px; background: #fff5f6; color: #8a1c2e; font-size: 12px; overflow-wrap: anywhere; }
.frw-progress, .frw-drawing-hint { padding: 8px; background: var(--frw-soft); color: var(--frw-ink); border-radius: 4px; font-size: 12px; line-height: 1.4; }
.frw-progress { display: flex; align-items: center; gap: 12px; }
.flight-route-workspace .bulletin-progress-ring { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--frw-accent) var(--bulletin-progress-angle, 0deg), var(--frw-line) 0); flex: 0 0 44px; }
.flight-route-workspace .bulletin-progress-ring span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--frw-paper); font-size: 11px; font-variant-numeric: tabular-nums; font-weight: 600; }
.frw-dock { flex: 0 0 auto; padding: 12px var(--frw-panel-padding); border-top: 1px solid var(--frw-line); display: grid; gap: 8px; }
.frw-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, var(--frw-control-height)); align-items: center; gap: 8px; }
.frw-draw { display: flex; justify-content: center; align-items: center; gap: 8px; }
.frw-draw > span:first-child { font-size: 20px; line-height: 16px; }
.frw-more { position: relative; }
.frw-more > summary { height: var(--frw-control-height); min-width: var(--frw-control-height); display: grid; place-items: center; background: var(--frw-paper); border: 1px solid var(--frw-line); border-radius: 4px; list-style: none; font-size: 20px; line-height: 1; }
.frw-more > summary::-webkit-details-marker { display: none; }
.frw-more-menu { position: absolute; bottom: calc(100% + 8px); right: 0; width: 208px; z-index: 2; display: grid; gap: 4px; padding: 8px; background: var(--frw-paper); border: 1px solid var(--frw-line); border-radius: var(--frw-radius); box-shadow: var(--frw-shadow); }
.frw-more-menu button { text-align: left; }
.frw-dock .flight-route-output-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 8px; }
.frw-dock .flight-route-profile-kind { min-width: 0; width: 100%; max-width: none; margin: 0; grid-column: 1 / -1; }
.frw-dock .flight-route-profile-kind > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.frw-dock .flight-route-output-actions button { margin: 0; font-size: 13px; min-width: 0; padding-inline: 8px; }
.flight-route-workspace .flight-route-host-controls { display: grid; gap: 24px; }
.flight-route-workspace .flight-route-planning { display: block; }
.flight-route-workspace .flight-route-plan-control, .flight-route-workspace .flight-route-performance-control { min-width: 0; gap: 4px; text-transform: none; letter-spacing: normal; font-size: var(--frw-font-body); font-weight: 400; }
.flight-route-workspace .flight-route-plan-control > span, .flight-route-workspace .flight-route-performance-control > span { color: var(--frw-muted); font-weight: 600; font-size: var(--frw-font-label); line-height: 16px; }
.flight-route-workspace .flight-route-performance { border: 0; padding: 0; gap: 12px; background: transparent; }
.flight-route-workspace .flight-route-section-title { margin: 0; color: var(--frw-ink); font-weight: 600; font-size: 14px; }
.flight-route-workspace .flight-route-performance-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.flight-route-workspace .flight-route-aircraft-settings { border-top: 1px solid var(--frw-line); padding-top: 12px; }
.flight-route-workspace .flight-route-aircraft-settings summary { min-height: var(--frw-compact-height); padding-block: 4px; color: var(--frw-ink); font-weight: 600; font-size: 13px; line-height: 24px; }
.flight-route-workspace .flight-route-performance-hint { font-size: 12px; line-height: 1.4; color: var(--frw-muted); }
.flight-route-workspace .flight-route-aircraft-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 16px 12px; padding-top: 12px; }
.flight-route-workspace .flight-route-performance-control { grid-template-rows: 1fr var(--frw-control-height); }
.flight-route-workspace .flight-route-performance-control > span { overflow-wrap: anywhere; }
.flight-route-workspace .flight-route-aircraft-grid > .flight-route-performance-control:last-of-type { grid-column: 1 / -1; }
.flight-route-workspace #flight-route-aircraft-reset { grid-column: 1 / -1; min-width: 0; height: var(--frw-control-height); padding: 8px 12px; font-size: 13px; }
.flight-route-workspace #flight-route-editor-root { display: none; }
.flight-route-workspace.is-minimized .frw-form > :not(.frw-strip):not(.frw-notices) { display: none; }
.flight-route-workspace.is-minimized .frw-strip { padding-bottom: 12px; }
@media (min-width: 721px) and (max-width: 960px) {
  #flight-route-panel.flight-route-workspace { --frw-panel-width: 360px; }
}
@media (max-width: 720px) {
  body.has-flight-route-workspace .map-shell { top: 8px; right: 8px; left: 8px; max-width: none; height: 56px; padding: 4px; flex-wrap: nowrap; gap: 4px; }
  body.has-flight-route-workspace .map-shell .map-brand { flex: 0 0 36px; padding: 0 2px; }
  body.has-flight-route-workspace .map-shell .map-brand > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  body.has-flight-route-workspace .map-shell .map-panel-actions { flex: 1 1 auto; min-width: 0; justify-content: flex-start; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; margin: 0; }
  body.has-flight-route-workspace .map-shell .map-panel-actions::-webkit-scrollbar { display: none; }
  body.has-flight-route-workspace .map-shell .map-panel-button { flex: 0 0 44px; }
  #flight-route-panel.flight-route-workspace { inset: auto 8px 132px; width: auto; max-width: none; max-height: min(56dvh, calc(100dvh - 220px)); --frw-panel-padding: 12px; }
  .flight-route-workspace .frw-drag-handle { min-height: 24px; height: 24px; width: 80px; }
  .flight-route-workspace .frw-resize-handle { flex-basis: 16px; min-height: 16px; height: 16px; }
  .frw-title h2 { font-size: 16px; }
  .flight-route-workspace .frw-endpoint { grid-template-columns: 16px minmax(0, 1fr) 8px; gap: 4px; }
  .frw-endpoint img { width: 16px; height: 16px; }
  .frw-endpoint .frw-binding { display: none !important; }
  .frw-endpoint .frw-chevron { grid-column: 3; }
  .frw-notices { max-height: 104px; }
  .frw-drawing-hint { display: none; }
  .frw-dock .flight-route-output-actions button { font-size: 12px; }
}
.map-page .flight-route-marker { background: #2563eb; border-color: #fff; color: #fff; }
.map-page .flight-route-marker.is-route-selected { outline: 2px dashed #2563eb; outline-offset: 4px; }
