/* Map layers: one control for the map overlays, drawn as a piece of cockpit overhead panel — painted legends on
   blue-grey, black square push-buttons whose "ON" legend lights blue when the layer is on (Airbus style). */
.map-layers-dock {
  position: fixed;
  right: 12px;
  top: 0;
  z-index: 1305;
  border-radius: var(--airshow-chip-radius, 6px);
  box-shadow: var(--airshow-chip-shadow, 0 2px 8px rgba(0, 0, 0, 0.34));
}
.map-layers-dock[hidden] { display: none; }
.map-layers-btn {
  position: relative;
  width: 44px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--airshow-chip-border, rgba(0, 0, 0, 0.55));
  border-radius: var(--airshow-chip-radius, 6px);
  background: var(--airshow-chip-bg, rgba(40, 40, 42, 0.66));
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.map-layers-btn:hover { background: var(--airshow-chip-bg-hover, rgba(58, 58, 62, 0.76)); }
.map-layers-btn:active svg { transform: scale(0.9); }
.map-layers-btn:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.85); outline-offset: 2px; }
.map-layers-btn[aria-expanded="true"] {
  color: #6fd6ff;
  box-shadow: inset 0 0 0 1px rgba(111, 214, 255, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
.map-layers-btn svg { display: block; transition: transform 0.15s ease; }
.map-layers-btn-dot {
  position: absolute;
  top: 5px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6fd6ff;
  box-shadow: 0 0 5px rgba(111, 214, 255, 0.8);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.map-layers-btn.has-layers .map-layers-btn-dot { opacity: 1; }
/* Its plan tag (when the plan does not include map layers) comes from airshow_plan_tags.css. */

/* The panel */
.map-layers-panel {
  --mlp-face: #5d6c7c;
  --mlp-paint: #f2f5f8;
  --mlp-col: 142px;
  --mlp-btn-w: 74px;
  --mlp-btn-h: 60px;
  position: fixed;
  z-index: 1307;
  box-sizing: border-box;
  padding: 12px 22px 16px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0) 38%),
    var(--mlp-face);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(0, 0, 0, 0.28),
    0 0 0 2px #2a3139,
    0 14px 30px rgba(0, 0, 0, 0.45);
  color: var(--mlp-paint);
  font-family: "Pretendard Variable", Pretendard, system-ui, sans-serif;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.map-layers-panel[hidden] { display: none; }
.map-layers-panel.is-open { opacity: 1; transform: none; }
.mlp-screw {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #c9d1d9, #7d8893 60%, #4b545d);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
}
.mlp-screw::after {
  content: "";
  position: absolute;
  left: 1px;
  right: 1px;
  top: 3.5px;
  height: 1px;
  background: rgba(40, 46, 52, 0.85);
  transform: rotate(var(--slot, 30deg));
}
.mlp-screw.is-tl { left: 6px; top: 6px; --slot: 30deg; }
.mlp-screw.is-tr { right: 6px; top: 6px; --slot: -55deg; }
.mlp-screw.is-bl { left: 6px; bottom: 6px; --slot: 80deg; }
.mlp-screw.is-br { right: 6px; bottom: 6px; --slot: 10deg; }

/* Painted section title between two painted lines, and the close button. */
.mlp-head { display: flex; align-items: center; gap: 12px; height: 24px; margin: 0 0 10px; }
.mlp-head::before,
.mlp-head::after { content: ""; flex: 1 1 auto; height: 1px; background: rgba(242, 245, 248, 0.62); }
.mlp-head::after { margin-right: 4px; }
.mlp-title {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}
.mlp-close {
  order: 3;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 0, 0, 0.45);
  border-radius: 4px;
  background: #1a1e23;
  color: var(--mlp-paint);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  cursor: pointer;
}
.mlp-close:hover { background: #262b31; }
.mlp-close:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }

.mlp-row { display: grid; grid-template-columns: repeat(4, var(--mlp-col)); column-gap: 12px; }
.mlp-unit { display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 0; }
.mlp-name {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 16px;
  white-space: nowrap;
}
.mlp-cap {
  max-width: 100%;
  color: rgba(242, 245, 248, 0.84);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 16px;
  white-space: nowrap;
}

/* Push-button: bezel, black face, upper legend (symbol) and lower legend (ON). */
.mlp-btn {
  position: relative;
  width: var(--mlp-btn-w);
  height: var(--mlp-btn-h);
  padding: 3px;
  border: 0;
  border-radius: 4px;
  background: linear-gradient(180deg, #2b3138, #14181c);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55), 0 2px 3px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mlp-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.mlp-face {
  display: grid;
  grid-template-rows: 1fr 1fr;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(180deg, #16191d, #0b0d10);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.8);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.mlp-btn:active .mlp-face { transform: translateY(1px); box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.9); }
.mlp-icon { display: flex; align-items: center; justify-content: center; color: rgba(230, 236, 242, 0.42); transition: color 0.2s ease; }
.mlp-icon svg { display: block; width: 19px; height: 19px; }
.mlp-on {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333c47;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}
.mlp-btn.on .mlp-on { color: #5fd2ff; text-shadow: 0 0 6px rgba(95, 210, 255, 0.7); }
.mlp-btn.on .mlp-icon { color: rgba(240, 245, 250, 0.82); }

/* Locked: a clear guard over each button; pressing it opens the plan notice. The plan tag sits on the note. */
.map-layers-panel.is-locked .mlp-btn::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 6px;
  background: linear-gradient(160deg, rgba(235, 242, 250, 0.3), rgba(235, 242, 250, 0.08) 45%, rgba(235, 242, 250, 0.2));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45), 0 1px 2px rgba(0, 0, 0, 0.3);
}
.map-layers-panel.is-locked .mlp-cap { color: rgba(242, 245, 248, 0.62); }

.mlp-note {
  display: none;
  margin: 10px 0 0;
  color: #ffdc8f;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 13px;
  text-align: center;
  text-transform: uppercase;
}
.map-layers-panel.is-locked .mlp-note { display: block; }

/* Settings > ADD-ONS link row */
/* The Settings row that opens the panel is a shortcut, not a setting: no First Class lock, nothing synced. */
.topbar-settings-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 28px;
  padding: 5px 0;
}
.topbar-settings-group.collapsed .topbar-settings-link-row {
  display: none;
}
html.airshow-mobile-runtime .topbar-settings-link-row {
  gap: 6px;
  padding: 4px 0;
}
.map-layers-settings-btn {
  flex: 0 0 auto;
  height: 28px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(8, 12, 20, 0.62);
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.map-layers-settings-btn:hover { border-color: rgba(255, 255, 255, 0.36); }

html.airshow-mobile-runtime .map-layers-btn { width: 34px; height: 32px; }
html.airshow-mobile-runtime .map-layers-btn svg { width: 15px; height: 15px; }
html.airshow-mobile-runtime .map-layers-btn-dot { top: 4px; right: 4px; width: 5px; height: 5px; }
html.airshow-mobile-runtime .map-layers-panel {
  --mlp-col: 110px;
  --mlp-btn-w: 52px;
  --mlp-btn-h: 40px;
  padding: 6px 12px 9px;
}
html.airshow-mobile-runtime .mlp-head { gap: 10px; height: 18px; margin-bottom: 5px; }
html.airshow-mobile-runtime .mlp-title { font-size: 10.5px; }
html.airshow-mobile-runtime .mlp-close { width: 20px; height: 20px; }
html.airshow-mobile-runtime .mlp-screw { width: 6px; height: 6px; }
html.airshow-mobile-runtime .mlp-screw::after { top: 2.5px; }
html.airshow-mobile-runtime .mlp-row { column-gap: 6px; }
html.airshow-mobile-runtime .mlp-unit { gap: 4px; }
html.airshow-mobile-runtime .mlp-name { font-size: 10.5px; line-height: 13px; }
html.airshow-mobile-runtime .mlp-cap { font-size: 10.5px; line-height: 13px; }
html.airshow-mobile-runtime .mlp-on { font-size: 10px; }
html.airshow-mobile-runtime .mlp-note { margin-top: 6px; font-size: 9.5px; line-height: 12px; }
html.airshow-mobile-runtime .mlp-icon svg { width: 14px; height: 14px; }

@media (prefers-reduced-motion: reduce) {
  .map-layers-panel,
  .mlp-face,
  .mlp-on,
  .mlp-icon,
  .map-layers-btn,
  .map-layers-btn svg,
  .map-layers-btn-dot { transition: none; }
}
