* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #e8e8e8;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0 1rem;
}

.tabs {
  display: none;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0;
  margin-top: 0;
  border-bottom: 1px solid #334155;
  padding: 0 0 0 0.25rem;
}

body.map-tab-active main {
  padding: 0;
}

.tabs[hidden],
body.map-tab-active .tabs,
body.aircraft-tab-active .tabs,
body.airfields-tab-active .tabs,
body.history-tab-active .tabs,
body.notam-map-tab-active .tabs,
body.status-tab-active .tabs {
  display: none;
}

.tab {
  padding: 0.6rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: #94a3b8;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  font-family: inherit;
}

.tab:hover {
  color: #cbd5e1;
}

.tab.active {
  color: #f1f5f9;
  border-bottom-color: #3b82f6;
}

.tools-tab-wrap {
  position: relative;
  margin-left: auto;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  flex-shrink: 0;
}

.tools-tab-actions {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.notifications-bell-badge {
  position: absolute;
  top: 0.4rem;
  right: 0.35rem;
  width: 0.5rem;
  height: 0.5rem;
  background: #ef4444;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.95);
}

.notifications-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.25rem;
  min-width: 280px;
  max-width: min(360px, calc(100vw - 2rem));
  max-height: min(70vh, 420px);
  overflow-y: auto;
  padding: 0.35rem 0;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 10003;
}

.notifications-dropdown[hidden] {
  display: none !important;
}

/* Portaled under document.body (see app.js): escapes main/nav overflow and matches fixed tools menu. */
.notifications-dropdown.notifications-dropdown--portaled:not([hidden]) {
  position: fixed;
  top: calc(52px + env(safe-area-inset-top, 0));
  right: max(0.75rem, env(safe-area-inset-right, 0));
  left: auto;
  width: min(360px, calc(100vw - 1.5rem));
  max-height: min(70vh, 420px);
  margin-top: 0;
  z-index: 21001;
}

.notifications-dropdown.notifications-dropdown--map-anchor:not([hidden]) {
  top: auto;
  right: auto;
}

.notifications-dropdown-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0.25rem 0.5rem 0.35rem;
  border-bottom: 1px solid #334155;
}

.notifications-mark-all-read {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: #93c5fd;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid #475569;
  border-radius: 0.35rem;
  cursor: pointer;
  font-family: inherit;
}

.notifications-mark-all-read:hover {
  color: #bfdbfe;
  background: rgba(51, 65, 85, 0.75);
}

.notifications-dropdown-item--read {
  opacity: 0.62;
}

.notifications-dropdown-item--read .notifications-dropdown-title {
  font-weight: 500;
}

.notifications-dropdown-empty {
  margin: 0;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: #94a3b8;
}

.notifications-dropdown-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.notifications-dropdown-slide {
  overflow: hidden;
}

.notifications-dropdown-slide-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
}

.notifications-dropdown-slide-row .notifications-dropdown-item {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
}

.notifications-dropdown-remove {
  flex: 0 0 auto;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  padding: 0 0.35rem;
  margin: 0;
  font-size: 1.15rem;
  line-height: 1;
  font-weight: 400;
  color: #94a3b8;
  background: transparent;
  border: none;
  border-left: 1px solid rgba(51, 65, 85, 0.85);
  cursor: pointer;
  font-family: inherit;
}

.notifications-dropdown-remove:hover {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.35);
}

.notifications-dropdown-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  width: 100%;
  padding: 0.55rem 1rem;
  text-align: left;
  font-size: 0.9rem;
  font-weight: 500;
  color: #e2e8f0;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.notifications-dropdown-item:hover {
  background: rgba(51, 65, 85, 0.65);
}

.notifications-dropdown-time {
  font-size: 0.75rem;
  font-weight: 400;
  color: #94a3b8;
}

.notifications-dropdown-title {
  font-weight: 600;
  color: #f1f5f9;
}

.notifications-dropdown-preview {
  font-size: 0.8rem;
  font-weight: 400;
  color: #94a3b8;
  line-height: 1.25;
}

.tools-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.25rem;
  min-width: 180px;
  padding: 0.35rem 0;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 10002;
  display: flex;
  flex-direction: column;
}

.tools-menu[hidden] {
  display: none !important;
}

.tools-menu-item {
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 500;
  color: #94a3b8;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.tools-menu-item:hover {
  color: #f1f5f9;
  background: rgba(51, 65, 85, 0.6);
}

.tools-menu-item[hidden] {
  display: none !important;
}

.tools-menu-separator {
  height: 1px;
  margin: 0.35rem 0.75rem;
  background: #334155;
}

.tools-menu-separator[hidden] {
  display: none !important;
}

.sign-in-wrap {
  position: relative;
}

.sign-in-btn {
  margin-left: 0.25rem;
}

.sign-in-btn.signed-in {
  color: #22c55e;
}

.sign-in-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 320px;
  max-width: min(92vw, 420px);
  padding: 1rem 1.1rem;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  z-index: 21000;
}

.sign-in-panel[hidden] {
  display: none !important;
}

.sign-in-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.6);
  backdrop-filter: blur(1px);
  z-index: 20999;
}

.sign-in-backdrop[hidden] {
  display: none !important;
}

.sign-in-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sign-in-helper-text {
  margin: 0;
  color: #cbd5e1;
  font-size: 0.88rem;
}

.sign-in-error {
  margin: 0;
  color: #fca5a5;
  font-size: 0.85rem;
}

.sign-in-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.9rem;
  color: #94a3b8;
}

.sign-in-input {
  padding: 0.4rem 0.6rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: #e2e8f0;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 0.375rem;
}

.sign-in-input:focus {
  outline: none;
  border-color: #3b82f6;
}

.sign-in-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.sign-in-cancel {
  padding: 0.4rem 1rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: #64748b;
  background: transparent;
  border: 1px solid #94a3b8;
  border-radius: 0.375rem;
  cursor: pointer;
}

.sign-in-cancel:hover {
  color: #475569;
  border-color: #64748b;
}

.sign-in-submit {
  padding: 0.4rem 1rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: #f1f5f9;
  background: #3b82f6;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
}

.sign-in-submit:hover {
  background: #2563eb;
}

.tab-panel {
  display: none;
  flex: 1 1 0;
  min-height: 0;
  text-align: left;
  padding-top: 1.25rem;
  overflow: auto;
}

.tab-panel.active {
  display: flex;
  flex-direction: column;
  overflow: auto;
}

#inhouse-map-panel {
  position: relative;
  padding-top: 0;
  --inhouse-map-top-offset: 0px;
}

#inhouse-map-panel.active {
  overflow: hidden;
}

body.map-tab-active #inhouse-map-panel.active {
  /* Fill main; avoid 100vh inside body safe-area padding (clips bottom UI in iOS home-screen apps). */
  min-height: 0;
  flex: 1;
}

/* Airfields tab: cards per airfield */
.airfields-view-content {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  padding: 0;
}

.airfield-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.airfield-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #334155;
}

.airfield-card-header-main {
  flex: 1;
  min-width: 0;
}

.airfield-card-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.airfield-card-favourite-btn {
  padding: 0.25rem;
  color: #64748b;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.airfield-card-favourite-btn:hover {
  color: #f472b6;
}
.airfield-card-favourite-btn-active {
  color: #f472b6;
}
.airfield-card-favourite-btn-active:hover {
  color: #ec4899;
}

.airfield-card-webcam-btn {
  padding: 0.25rem;
  color: #64748b;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.airfield-card-webcam-btn:hover {
  color: #38bdf8;
  background: #334155;
}

.airfield-card-setup-btn {
  flex-shrink: 0;
  padding: 0.25rem;
  color: #64748b;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.airfield-card-setup-btn:hover {
  color: #94a3b8;
  background: #334155;
}

.airfield-card-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #f1f5f9;
}

.airfield-card-club-name {
  margin-top: 0.15rem;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.25;
  color: #94a3b8;
}

.airfield-card-map-btn {
  flex-shrink: 0;
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
  font-family: inherit;
  color: #94a3b8;
  background: transparent;
  border: 1px solid #475569;
  border-radius: 4px;
  cursor: pointer;
}
.airfield-card-map-btn:hover {
  color: #f1f5f9;
  background: #334155;
  border-color: #64748b;
}

.airfield-card-notify-btn,
.airfield-card-notify-all-btn {
  flex-shrink: 0;
  padding: 0.35rem;
  font-family: inherit;
  color: #93c5fd;
  background: rgba(30, 58, 138, 0.22);
  border: 1px solid rgba(59, 130, 246, 0.5);
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  min-height: 2rem;
}

.airfield-card-notify-btn:hover,
.airfield-card-notify-all-btn:hover {
  color: #dbeafe;
  background: rgba(30, 64, 175, 0.36);
  border-color: #60a5fa;
}

.airfield-card-notify-btn.active,
.airfield-card-notify-all-btn.active {
  color: #fbbf24;
  background: rgba(30, 58, 138, 0.22);
  border-color: rgba(251, 191, 36, 0.7);
}

.airfield-card-notify-btn svg {
  display: block;
}

.airfield-card-notify-btn:disabled,
.airfield-card-notify-all-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.airfield-card-notify-all {
  border-style: dashed;
}

.airfield-card-notify-all-text {
  margin: 0.2rem 0 0;
  color: #93a5bc;
  font-size: 0.82rem;
}

.airfield-card-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem 0.75rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 1rem 0.75rem;
  margin: 0;
  font-size: 0.875rem;
  color: #94a3b8;
  align-items: start;
}

.airfield-card-stats span {
  min-width: 0;
}

.airfield-card-stats .airfield-card-stat-on-airfield-highlight {
  color: #4ade80;
  font-weight: 600;
}

.airfield-card-stats .airfield-card-stat-in-flight-highlight {
  color: #38bdf8;
  font-weight: 600;
}

.airfield-card-stats .airfield-card-stat-flights-highlight {
  color: #f59e0b;
  font-weight: 600;
}

.airfield-card-stats .airfield-card-last-launch-highlight {
  color: #38bdf8;
  font-weight: 600;
}

.airfield-card-stats .airfield-card-last-launch {
  grid-column: 1 / -1;
  width: 100%;
}

.airfield-card-map-wrap {
  position: relative;
  width: 100%;
  height: 220px;
  min-height: 220px;
  background: #0f172a;
  cursor: pointer;
}

.airfield-card-map-wrap .airfield-card-map {
  width: 100%;
  height: 100%;
}

.airfields-view-empty {
  color: #94a3b8;
  padding: 1.5rem;
  margin: 0;
}

.airfields-view-back {
  display: inline-block;
  margin-bottom: 1rem;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.9rem;
}

.airfields-view-back:hover {
  color: #f1f5f9;
}

/* Placeholder card for adding a new airfield (admin only) */
.airfield-card-add-placeholder {
  border-style: dashed;
  cursor: pointer;
}
.airfield-card-add-placeholder:hover {
  border-color: #64748b;
  background: #334155;
}
.airfield-card-add-placeholder .airfield-card-add-placeholder-title {
  color: #94a3b8;
  font-weight: 500;
}
.airfield-card-add-placeholder-map {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 220px;
}
.airfield-card-add-placeholder-message {
  color: #64748b;
  font-size: 0.9rem;
  text-align: center;
  padding: 1rem;
}
.airfield-card-add-placeholder:hover .airfield-card-add-placeholder-message {
  color: #94a3b8;
}

.airfield-card-map-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  color: #64748b;
  font-size: 0.875rem;
}

/* Aircraft flights sub-page (like airfield detail) */
.aircraft-flights-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 1rem;
}

.aircraft-flights-view[hidden] {
  display: none !important;
}

.aircraft-flights-back {
  display: inline-block;
  margin-bottom: 1rem;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.9rem;
}

#aircraft .aircraft-flights-back {
  margin-bottom: 0;
}

#history-panel .aircraft-flights-back {
  margin-bottom: 0;
}

#airfields-view-panel .airfields-view-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1.25rem;
  flex-shrink: 0;
  margin-bottom: 1rem;
}

#airfields-view-panel .airfields-view-nav .aircraft-flights-back {
  margin-bottom: 0;
}

#airfields-view-panel .airfields-view-nav .aircraft-flights-back[hidden] {
  display: none !important;
}

#status-panel .aircraft-flights-back {
  margin-bottom: 0.5rem;
}

.aircraft-flights-back:hover {
  color: #f1f5f9;
}

.aircraft-flights-title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: #e2e8f0;
}

.aircraft-flights-blacklist-wrap {
  margin-bottom: 1rem;
}

.aircraft-flights-blacklist-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: #94a3b8;
}

.aircraft-flights-blacklist-checkbox {
  width: 1rem;
  height: 1rem;
}

.aircraft-flights-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.aircraft-flights-loading,
.aircraft-flights-empty {
  margin: 0;
  color: #94a3b8;
  font-size: 0.95rem;
}

.aircraft-flights-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  grid-auto-rows: min-content;
  gap: 1.25rem;
  align-content: start;
  align-items: start;
}

.aircraft-flights-details {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid #334155;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  color: #e2e8f0;
}

.aircraft-flights-detail-item strong {
  color: #94a3b8;
  font-weight: 600;
  margin-right: 0.25rem;
}

.aircraft-flight-card {
  position: relative;
  z-index: 1;
  contain: paint;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.aircraft-flight-card-in-flight {
  border-color: #0ea5e9;
  background: linear-gradient(135deg, #1e293b 0%, rgba(14, 165, 233, 0.12) 100%);
  box-shadow: 0 0 0 1px rgba(14, 165, 233, 0.4);
}

.aircraft-flight-card-landout {
  border-color: rgba(220, 38, 38, 0.55);
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.28);
}

.aircraft-flight-card-landout-badge {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 0.25rem;
  background: rgba(220, 38, 38, 0.22);
  color: #fca5a5;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.aircraft-flight-card-header {
  padding: 0.5rem 0.75rem;
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid #334155;
}

.aircraft-flight-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: #e2e8f0;
}

.aircraft-flight-card-date {
  font-weight: 600;
}

.aircraft-flight-card-in-flight-label {
  color: #38bdf8;
}

.aircraft-flight-card-times {
  margin-left: auto;
  color: #94a3b8;
  font-size: 0.9rem;
}

.aircraft-flight-card-distance {
  color: #a78bfa;
  font-size: 0.9rem;
  font-weight: 500;
}

.aircraft-flight-card-landing {
  cursor: help;
}

.aircraft-flight-card-status-dot {
  margin-left: auto;
}

.aircraft-flight-card-status-dot .aircraft-flights-corrupt-dot {
  color: #f59e0b;
  font-size: 0.8em;
}

.aircraft-flight-card-status-dot .aircraft-flights-rejected-dot {
  color: #ef4444;
  font-size: 0.8em;
}

.aircraft-flight-card-status-dot .aircraft-flights-tracking-lost-dot {
  color: #8b5cf6;
  font-size: 0.8em;
}

.aircraft-flight-card-corrupt {
  margin-left: auto;
}

.aircraft-flight-card-corrupt .aircraft-flights-corrupt-dot {
  color: #f59e0b;
  font-size: 0.8em;
}

.aircraft-flight-card-map-wrap {
  position: relative;
  z-index: 0;
  height: 180px;
  min-height: 180px;
  flex-shrink: 0;
  border-bottom: 1px solid #334155;
  overflow: hidden;
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.aircraft-flight-card-map-wrap:hover {
  outline: 2px solid #64748b;
  outline-offset: -2px;
}

.aircraft-flight-card-map {
  width: 100%;
  height: 100%;
  background: #0f172a;
  pointer-events: none;
}

/* Constrain Leaflet map z-index so multiple maps don't overlap cards */
.aircraft-flight-card-map-wrap .leaflet-pane,
.aircraft-flight-card-map-wrap .leaflet-container {
  z-index: 1 !important;
}

.aircraft-flight-card-no-trace {
  margin: 0;
  padding: 2rem;
  text-align: center;
  color: #64748b;
  font-size: 0.9rem;
}

.aircraft-flight-card-chart-wrap {
  padding: 0.75rem;
  padding-bottom: 1rem;
  background: #0f172a;
  border-top: 1px solid #475569;
  flex-shrink: 0;
  overflow: hidden;
}

.aircraft-flight-card-chart {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 120px;
  max-height: 120px;
}

.aircraft-flights-corrupt-dot {
  color: #f59e0b;
  font-size: 0.8em;
}

.aircraft-flights-rejected-dot {
  color: #ef4444;
  font-size: 0.8em;
}

.aircraft-flights-tracking-lost-dot {
  color: #8b5cf6;
  font-size: 0.8em;
}

/* Orange cross for suspect corrupt points on flight trace (map) */
.flight-trace-corrupt-marker {
  background: none !important;
  border: none !important;
}
.flight-trace-corrupt-marker .flight-trace-corrupt-cross {
  display: block;
  width: 14px;
  height: 14px;
  line-height: 14px;
  font-size: 16px;
  font-weight: bold;
  color: #f59e0b;
  text-align: center;
  margin: -1px 0 0 -1px;
  text-shadow: 0 0 1px rgba(0,0,0,0.8), 0 0 2px rgba(0,0,0,0.5);
}

.aircraft-flights-link {
  color: #93c5fd;
  text-decoration: none;
}

.aircraft-flights-link:hover {
  color: #dbeafe;
  text-decoration: underline;
}

/* Single airfield: map left, flight lists right on desktop; stacked on mobile */
.airfields-view-content:has(.airfields-view-single-layout) {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
}

/* Setup map: fill viewport – class set in JS so flex chain works reliably */
#airfields-view-panel:has(.airfields-view-has-setup).active {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#airfields-view-content.airfields-view-has-setup {
  display: flex !important;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}
#airfields-view-content.airfields-view-has-setup .airfields-view-single-layout {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}

.airfields-view-single-layout {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  flex: 1 1 0;
  min-height: 0;
}

/* Prevent airfield card from shrinking when flights log grows (e.g. on mobile) */
.airfields-view-single-layout .airfield-card {
  flex-shrink: 0;
}

.airfields-view-single-right {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Airfield page setup map (replaces aircraft/flights when setup=1) */
.airfields-view-setup {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  border: 1px solid #334155;
  border-radius: 6px;
  overflow: hidden;
  background: #1e293b;
}
.airfields-view-has-setup .airfields-view-setup {
  min-height: 0;
}

.airfields-view-setup-toolbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.airfields-view-setup-toolbar .airfields-map-view-toggle {
  margin-left: auto;
}
.airfields-view-setup-save-in-toolbar {
  margin-left: auto;
  flex-shrink: 0;
}
.airfields-view-setup-name-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #334155;
  background: #1e293b;
}
.airfields-view-setup-name-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #94a3b8;
  margin: 0;
  flex-shrink: 0;
}
.airfields-view-setup-name-input {
  flex: 1;
  min-width: 0;
  padding: 0.4rem 0.6rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: #f1f5f9;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 4px;
}
.airfields-view-setup-name-input::placeholder {
  color: #64748b;
}
.airfields-view-setup-name-input:focus {
  outline: none;
  border-color: #3b82f6;
}
.airfields-view-setup-club-row,
.airfields-view-setup-webcams-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex-shrink: 0;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #334155;
  background: #1e293b;
}
.airfields-view-setup-club-row .airfields-view-setup-name-label,
.airfields-view-setup-webcams-row .airfields-view-setup-name-label {
  padding-top: 0.4rem;
  min-width: 4.5rem;
}
.airfields-view-setup-webcams-input {
  flex: 1;
  min-width: 0;
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  font-family: inherit;
  line-height: 1.35;
  color: #f1f5f9;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 4px;
  resize: vertical;
  min-height: 4.5rem;
}
.airfields-view-setup-webcams-input::placeholder {
  color: #64748b;
}
.airfields-view-setup-webcams-input:focus {
  outline: none;
  border-color: #3b82f6;
}
.airfields-view-setup-map-container {
  position: relative;
  flex: 1 1 0;
  min-height: 200px;
}
/* Force map to fill viewport when flex chain fails (e.g. align-items: flex-start on row) */
.airfields-view-has-setup .airfields-view-setup-map-container {
  min-height: calc(100vh - 220px);
  height: calc(100vh - 220px);
}
.airfields-view-setup-map-container .airfields-map {
  width: 100%;
  height: 100%;
  min-height: 200px;
}

.airfields-view-single-right .airfields-view-aircraft {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.airfields-view-aircraft-heading-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.airfields-view-aircraft-heading {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  color: #f1f5f9;
}

.airfields-view-aircraft-away-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.25rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: #cbd5e1;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.airfields-view-aircraft-away-filter:hover {
  color: #e2e8f0;
}

.airfields-view-aircraft-away-filter-input {
  margin: 0;
  cursor: pointer;
  accent-color: #38bdf8;
}

.airfields-view-aircraft-away-filter-text {
  line-height: 1.2;
}

.airfields-view-aircraft-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.airfields-view-aircraft-cards-empty {
  margin: 0;
  padding: 0;
  color: #94a3b8;
  text-align: left;
}

.airfields-view-aircraft-card {
  display: inline-flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.5rem 0.75rem;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.375rem;
  font-size: 0.85rem;
}

.airfields-view-aircraft-card-in-flight {
  border-color: #0ea5e9;
  background: linear-gradient(135deg, #1e293b 0%, rgba(14, 165, 233, 0.12) 100%);
}

.airfields-view-aircraft-card-on-airfield {
  border-color: #22c55e;
  background: linear-gradient(135deg, #1e293b 0%, rgba(34, 197, 94, 0.12) 100%);
}

.airfields-view-aircraft-card-on-ground {
  border-color: #64748b;
  background: linear-gradient(135deg, #1e293b 0%, rgba(100, 116, 139, 0.12) 100%);
}

/* Inactive (log-only) overrides: grey surround and status so they beat on-airfield/in-flight green/blue */
.airfields-view-aircraft-card-inactive {
  border-color: #475569 !important;
  background: linear-gradient(135deg, #1e293b 0%, rgba(71, 85, 105, 0.15) 100%) !important;
}

.airfields-view-aircraft-card-inactive .airfields-view-aircraft-card-status {
  color: #64748b !important;
}

.airfields-view-aircraft-card-name-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.airfields-view-aircraft-card-name {
  font-weight: 600;
  color: #f1f5f9;
}

.airfields-view-aircraft-card-status {
  font-size: 0.75rem;
  color: #94a3b8;
}

.airfields-view-aircraft-card-in-flight .airfields-view-aircraft-card-status {
  color: #38bdf8;
}

.airfields-view-aircraft-card-on-airfield .airfields-view-aircraft-card-status {
  color: #4ade80;
}

.airfields-view-aircraft-card-landout-glider {
  background: rgba(254, 202, 202, 0.95) !important;
  border-color: rgba(220, 38, 38, 0.45);
}

.airfields-view-aircraft-card-landout-glider .airfields-view-aircraft-card-status {
  color: #991b1b;
}

.airfields-view-aircraft-card-landout-other {
  background: rgba(220, 252, 231, 0.95) !important;
  border-color: rgba(220, 38, 38, 0.9);
  box-shadow: inset 0 0 0 2px rgba(220, 38, 38, 0.9);
}

.airfields-view-aircraft-card-landout-other .airfields-view-aircraft-card-status {
  color: #166534;
}

.airfields-view-aircraft-card-on-ground .airfields-view-aircraft-card-status {
  color: #94a3b8;
}

.airfields-view-aircraft-card-type-hint {
  font-size: 0.85em;
  color: #64748b;
  font-weight: 400;
}

.airfields-view-flight-type-hint {
  font-size: 0.85em;
  color: #64748b;
  font-weight: 400;
}

.airfields-view-tow-hint {
  font-size: 0.85em;
  color: #0ea5e9;
  font-weight: 400;
}

.airfields-view-tow-hint-launch {
  margin-left: 0.35em;
}

.airfields-view-flight-corrupt-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  min-width: 8px;
  min-height: 8px;
  margin-left: 0.35em;
  border-radius: 50%;
  background: #f59e0b;
  vertical-align: middle;
}

.airfields-view-flight-rejected-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  min-width: 8px;
  min-height: 8px;
  margin-left: 0.35em;
  border-radius: 50%;
  background: #ef4444;
  vertical-align: middle;
}

.airfields-view-flight-tracking-lost-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  min-width: 8px;
  min-height: 8px;
  margin-left: 0.35em;
  border-radius: 50%;
  background: #8b5cf6;
  vertical-align: middle;
}

.airfields-view-glide-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  min-width: 9px;
  min-height: 9px;
  margin-left: 0.4em;
  border-radius: 50%;
  vertical-align: middle;
  border: 1px solid rgba(15, 23, 42, 0.2);
}

.airfields-view-glide-dot-green {
  background: #22c55e;
}

.airfields-view-glide-dot-yellow {
  background: #facc15;
}

.airfields-view-glide-dot-red {
  background: #ef4444;
}

.airfields-view-log-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.airfields-view-show-corrupt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  color: #64748b;
}

.airfields-view-show-corrupt-btn:hover {
  background: rgba(148, 163, 184, 0.1);
  color: #475569;
}

.airfields-view-show-corrupt-btn-active {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  color: #dc2626;
}

.airfields-view-show-corrupt-btn-active:hover {
  background: rgba(239, 68, 68, 0.18);
}

.airfields-view-show-corrupt-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}

.airfields-view-show-corrupt-dot {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: transparent;
}

.airfields-view-show-corrupt-btn-active .airfields-view-show-corrupt-dot {
  background: #ef4444;
  opacity: 0.35;
}

.airfields-view-show-corrupt-bolt {
  position: relative;
  width: 10px;
  height: 10px;
  color: #ef4444;
}

.airfields-view-show-corrupt-btn:not(.airfields-view-show-corrupt-btn-active) .airfields-view-show-corrupt-bolt {
  color: #94a3b8;
}

.airfields-view-aircraft-card-selected {
  box-shadow: 0 0 0 2px #3b82f6;
  outline: none;
}

.airfields-view-aircraft-card[role="button"] {
  cursor: pointer;
}

.airfields-view-aircraft-card[role="button"]:hover {
  filter: brightness(1.05);
}

.airfields-view-single-right .airfields-view-current {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.airfields-view-single-right .airfields-view-logbook {
  margin-top: 0;
}

@media (min-width: 768px) {
  .airfields-view-single-layout {
    flex-direction: row;
    align-items: flex-start;
    gap: 1.5rem;
  }
  .airfields-view-single-layout .airfield-card {
    flex: 0 0 380px;
    min-width: 0;
  }
  .airfields-view-single-right {
    flex: 1 1 0;
    min-width: 0;
  }
}

/* Card state: any aircraft in flight → sky blue; else active aircraft → green */
.airfield-card-in-flight {
  border-color: #0ea5e9;
  background: linear-gradient(135deg, #1e293b 0%, rgba(14, 165, 233, 0.12) 100%);
  box-shadow: 0 0 0 1px rgba(14, 165, 233, 0.4);
}
.airfield-card-has-active {
  border-color: #22c55e;
  background: linear-gradient(135deg, #1e293b 0%, rgba(34, 197, 94, 0.1) 100%);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.4);
}

.airfield-card-selectable {
  cursor: pointer;
}

.airfield-card-selectable:hover {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6;
}

.airfields-view-current {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #334155;
}

.airfields-view-current-heading {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  color: #f1f5f9;
}

.airfields-view-current-empty {
  color: #94a3b8;
  margin: 0;
}

.airfields-view-current-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.airfields-view-current-table th,
.airfields-view-current-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid #334155;
}

.airfields-view-current-table th {
  color: #94a3b8;
  font-weight: 500;
}

.airfields-view-launch-col .airfields-view-sort-indicator,
.airfields-view-logbook-table .airfields-view-launch-col .airfields-view-sort-indicator {
  margin-left: 0.2em;
  font-size: 0.85em;
  opacity: 0.9;
}

.airfields-view-current-table td {
  color: #e2e8f0;
}

.airfields-view-current-table th.airfields-view-num,
.airfields-view-current-table td.airfields-view-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.airfields-view-current-table tr.airfields-view-flight-row-highlight td,
.airfields-view-logbook-table tr.airfields-view-flight-row-highlight td {
  background: rgba(59, 130, 246, 0.2);
}

.airfields-view-logbook-table tr.airfields-view-flight-row-landout td {
  background: rgba(220, 38, 38, 0.22);
}

.airfields-view-logbook-table tr.airfields-view-flight-row-landout.airfields-view-flight-row-highlight td {
  background: rgba(59, 130, 246, 0.18);
  box-shadow: inset 3px 0 0 0 rgba(220, 38, 38, 0.85);
}

.airfields-view-current-table tr.airfields-view-flight-row-clickable,
.airfields-view-logbook-table tr.airfields-view-flight-row-clickable {
  cursor: pointer;
}
.airfields-view-current-table tr.airfields-view-flight-row-clickable:hover td,
.airfields-view-logbook-table tr.airfields-view-flight-row-clickable:hover td {
  background: rgba(51, 65, 85, 0.6);
}

.airfields-view-logbook-table tr.airfields-view-flight-row-landout.airfields-view-flight-row-clickable:hover td {
  background: rgba(220, 38, 38, 0.32);
}

.airfields-view-logbook {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #334155;
}

.airfields-view-logbook-heading {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  color: #f1f5f9;
}

.airfields-view-logbook-empty {
  color: #94a3b8;
  margin: 0;
}

.airfields-view-logbook-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.airfields-view-logbook-table th,
.airfields-view-logbook-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid #334155;
}

.airfields-view-logbook-table th {
  color: #94a3b8;
  font-weight: 500;
}

.airfields-view-logbook-table td {
  color: #e2e8f0;
}

.glideandseek-embed-wrap {
  margin-top: 0;
  width: 100%;
  min-height: calc(100vh - 10rem);
  border-radius: 0.5rem;
  overflow: hidden;
  background: #1e293b;
}

.glideandseek-iframe {
  display: block;
  width: 100%;
  height: calc(100vh - 10rem);
  min-height: 480px;
  border: 0;
}

.glideandseek-links-container {
  margin-bottom: 1.5rem;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  border-top: 1px solid #334155;
  border-bottom: 1px solid #334155;
}

.glideandseek-links-container h3 {
  margin: 0 0 0.75rem 0;
  font-size: 1rem;
  font-weight: 500;
  color: #cbd5e1;
}

.glideandseek-links-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.glideandseek-link {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 0.375rem;
  color: #93c5fd;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.glideandseek-link:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(59, 130, 246, 0.5);
  color: #dbeafe;
}

.glideandseek-aircraft-link {
  display: inline-block;
  margin-left: 0.5rem;
  text-decoration: none;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.glideandseek-aircraft-link:hover {
  opacity: 1;
}

.inhouse-map-aircraft-link {
  display: inline-block;
  text-decoration: none;
  transition: color 0.2s;
  color: inherit;
}

.aircraft-table .inhouse-map-aircraft-link {
  color: #93c5fd;
}

.aircraft-table .inhouse-map-aircraft-link:hover {
  color: #dbeafe;
  text-decoration: underline;
}

.aircraft-table .aircraft-flights-link {
  margin-left: 0.35rem;
  color: #9ca3af;
  pointer-events: auto;
}

.aircraft-table .aircraft-flights-link:hover {
  color: #9ca3af;
  text-decoration: none;
}

.aircraft-table td:has(.inhouse-map-aircraft-link) {
  white-space: nowrap;
}

.aircraft-section {
  margin-top: 0;
  text-align: left;
  max-width: 100%;
}

.airfields-section {
  margin-top: 0;
  max-width: 100%;
}

.status-section {
  margin-top: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

/* Status page header */
.status-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.status-header-left {
  min-width: 0;
}
.status-page-title {
  margin: 0 0 0.25rem 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: #f1f5f9;
  letter-spacing: -0.02em;
}
.status-refresh-info {
  margin: 0;
  font-size: 0.8125rem;
  color: #64748b;
}

.status-content {
  margin-bottom: 1rem;
}

/* Status sub-tabs: Overview vs Monitoring */
.status-tabs {
  display: flex;
  gap: 0;
  margin: 0 0 1rem 0;
  padding: 0;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}
.status-tab {
  margin: 0;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #94a3b8;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  cursor: pointer;
}
.status-tab:hover {
  color: #e2e8f0;
}
.status-tab.active {
  color: #e2e8f0;
  border-bottom-color: #3b82f6;
}
.status-pane {
  display: none;
}
.status-pane.active {
  display: block;
}

/* Status panel fills main so Logs (and similar) can use remaining height */
#status-panel.active {
  overflow: hidden;
}
#status-panel .status-section {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
#status-panel .status-header {
  flex-shrink: 0;
}
#status-panel .status-content {
  flex: 1 1 0;
  min-height: 0;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#status-panel .status-tabs {
  flex-shrink: 0;
}
#status-panel .status-pane.active {
  flex: 1 1 0;
  min-height: 0;
  overflow: auto;
}
#status-panel #status-logs-pane.active {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Card-style blocks */
.status-block {
  margin-bottom: 1rem;
  padding: 1.25rem 1.5rem;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: 0.5rem;
}
.status-block:last-child {
  margin-bottom: 0;
}
.status-block-title {
  margin: 0 0 0.75rem 0;
  padding-bottom: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #e2e8f0;
  letter-spacing: 0.01em;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}

/* Monitoring sub-panel (chart etc.) */
.status-monitoring .status-monitoring-content {
  margin-top: 0.5rem;
}
.status-monitoring-chart-block {
  margin-bottom: 1.25rem;
}
.status-monitoring-chart-block:last-child {
  margin-bottom: 0;
}
.status-subblock-title {
  margin: 0;
  padding: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #cbd5e1;
}

/* Update-call chart (duration, gap, aircraft count over time) */
.status-update-call-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.status-update-call-header .status-subblock-title {
  margin: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.status-update-call-refresh-btn {
  flex-shrink: 0;
}
.status-update-call-legend {
  margin: 0 0 0.5rem 0;
  padding: 0;
  font-size: 0.75rem;
  color: #94a3b8;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.status-update-call-legend-item::before {
  display: inline-block;
  width: 0.75rem;
  height: 3px;
  margin-right: 0.35rem;
  vertical-align: middle;
  content: '';
  border-radius: 1px;
}
.status-update-call-legend-duration::before { background: #3b82f6; }
.status-update-call-legend-api::before {
  background: transparent;
  border-bottom: 2px dashed #eab308;
  height: 0;
}
.status-update-call-legend-gap::before { background: #10b981; }
.status-update-call-legend-count::before { background: #10b981; }
.status-update-call-legend-sent::before { background: #3b82f6; }
.status-update-call-chart-wrap {
  width: 100%;
  height: 220px;
  margin-top: 0.25rem;
  position: relative;
}
.status-update-call-placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  font-size: 0.875rem;
  color: #64748b;
}
.status-update-call-chart {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
  border-radius: 0.25rem;
  background: rgba(15, 23, 42, 0.4);
}

.status-update-call-crosshair {
  position: absolute;
  z-index: 2;
  display: block;
  pointer-events: none;
  background: rgba(226, 232, 240, 0.55);
}
.status-update-call-crosshair[hidden] {
  display: none;
}
.status-update-call-crosshair--vertical {
  width: 1px;
}
.status-update-call-crosshair--horizontal {
  height: 1px;
}
.status-update-call-value-tooltip {
  position: absolute;
  z-index: 3;
  min-width: 11rem;
  padding: 0.4rem 0.55rem;
  pointer-events: none;
  color: #f1f5f9;
  font-size: 0.75rem;
  line-height: 1.45;
  white-space: nowrap;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.55);
  border-radius: 0.3rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transform: translateY(-100%);
}
.status-update-call-value-tooltip[hidden] {
  display: none;
}
.status-update-call-value-tooltip--left {
  transform: translate(-100%, -100%);
}
.status-update-call-value-tooltip-time {
  margin-bottom: 0.15rem;
  color: #bfdbfe;
  font-weight: 600;
}

/* Floating tooltip for restart labels on gap-between-runs chart (canvas hit-test). */
.status-update-call-restart-tooltip {
  max-width: min(320px, 90vw);
  padding: 0.35rem 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: #f1f5f9;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 0.25rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.status-list {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1.5rem;
  align-items: baseline;
}

.status-list dt {
  margin: 0;
  padding: 0;
  color: #94a3b8;
  font-size: 0.8125rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.2;
  vertical-align: baseline;
}

.status-list dd {
  margin: 0;
  padding: 0;
  color: #e2e8f0;
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.2;
  vertical-align: baseline;
}

/* Status badges (ok / warning / error) – light text on tint for legibility */
.status-ok {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #ecfdf5;
  background: rgba(22, 163, 74, 0.65);
}
.status-warning {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #422006;
  background: rgba(253, 224, 71, 0.7);
}
.status-error {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #fef2f2;
  background: rgba(185, 28, 28, 0.7);
}
.status-content .status-sign-out-btn {
  margin-top: 0.75rem;
  padding: 0.4rem 1rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: #e2e8f0;
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.5);
  border-radius: 0.375rem;
  cursor: pointer;
}
.status-detail { display: block; font-size: 0.8125rem; color: #94a3b8; margin-top: 0.35rem; line-height: 1.4; }

.status-env-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-size: 0.875rem;
}
.status-env-item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
}
.status-env-key {
  color: #94a3b8;
  font-family: ui-monospace, monospace;
}
.status-env-value {
  color: #e2e8f0;
  word-break: break-all;
}

.status-schedule-list {
  margin: 0;
  padding-left: 1.25rem;
  list-style: disc;
}
.status-schedule-list li {
  margin: 0.2rem 0;
}
.status-schedule-window {
  color: #94a3b8;
}
.status-schedule-item--active {
  color: #e2e8f0;
  font-weight: 500;
}

.status-blacklist-empty {
  color: #94a3b8;
  font-size: 0.8125rem;
}
.status-blacklist-item {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin: 0.15rem 0.35rem 0.15rem 0;
  padding: 0.2rem 0.35rem 0.2rem 0.5rem;
  background: rgba(148, 163, 184, 0.2);
  border-radius: 0.25rem;
  font-size: 0.875rem;
}
.status-blacklist-remove {
  padding: 0 0.35rem;
  font-size: 1.1rem;
  line-height: 1;
  color: #94a3b8;
  background: none;
  border: none;
  border-radius: 0.2rem;
  cursor: pointer;
}
.status-blacklist-remove:hover:not(:disabled) {
  color: #e2e8f0;
  background: rgba(148, 163, 184, 0.2);
}
.status-blacklist-remove:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.status-schedule-item--active .status-schedule-window {
  color: #93c5fd;
}
.status-schedule-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: #1e293b;
  background: #93c5fd;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  margin-left: 0.35rem;
}
.status-interval-override {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.8125rem;
  color: #86efac;
}

.status-interval-editor {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 0.6rem;
}

.status-interval-editor-label {
  font-size: 0.84rem;
  font-weight: 500;
  color: #cbd5e1;
  white-space: nowrap;
}

.status-interval-editor-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.84rem;
  color: #cbd5e1;
  flex: 1 1 100%;
}

.status-interval-hour-input {
  width: 4.25rem;
  min-width: 4.25rem;
  padding: 0.35rem 0.45rem;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(71, 85, 105, 0.7);
  border-radius: 0.375rem;
  color: #e2e8f0;
  font-size: 0.86rem;
  line-height: 1.2;
}

.status-interval-hour-input:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 0;
}
.status-aerotow-criteria {
  line-height: 1.5;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
}
.status-aerotow-group {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  background: rgba(51, 65, 85, 0.3);
  border-left: 3px solid #64748b;
}
.status-aerotow-launch { border-left-color: #3b82f6; }
.status-aerotow-separation { border-left-color: #8b5cf6; }
.status-aerotow-general { border-left-color: #64748b; }
.status-aerotow-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin-bottom: 0.35rem;
}

.status-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(51, 65, 85, 0.4);
  border-radius: 0.5rem;
}
.status-actions-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 0.25rem;
}
.status-actions-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.status-refresh-btn {
  padding: 0.5rem 1rem;
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 0.375rem;
  color: #93c5fd;
  font-size: 0.9rem;
  cursor: pointer;
}

.status-refresh-btn:hover {
  background: rgba(59, 130, 246, 0.3);
}

.status-refresh-btn:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.debug-section {
  margin-top: 0;
  max-width: 100%;
}

.debug-section h2 {
  margin: 0 0 1rem 0;
  font-size: 1.25rem;
  color: #e2e8f0;
}

.debug-description {
  margin: 0 0 1rem 0;
  color: #94a3b8;
  font-size: 0.9rem;
}

.debug-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.debug-form label {
  color: #e2e8f0;
}

.debug-input {
  padding: 0.5rem 0.75rem;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(71, 85, 105, 0.6);
  border-radius: 0.375rem;
  color: #e2e8f0;
  font-size: 0.9rem;
  min-width: 12rem;
}

.debug-input:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 0;
}

.debug-output-wrap {
  margin-top: 1rem;
}

.debug-output {
  margin: 0;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(71, 85, 105, 0.5);
  border-radius: 0.375rem;
  color: #94a3b8;
  font-size: 0.8rem;
  line-height: 1.4;
  overflow: auto;
  max-height: 60vh;
  white-space: pre-wrap;
  word-break: break-all;
}

.debug-error {
  margin-top: 0.5rem;
  color: #f87171;
  font-size: 0.9rem;
}

.status-logs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-shrink: 0;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

#status-logs-pane .status-logs-header {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.65rem;
}

.status-logs-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  min-width: 0;
  width: 100%;
}

.status-logs-title-row .status-refresh-btn {
  margin-left: auto;
}

.status-logs-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
  min-width: 0;
}

.status-logs-view-toggle {
  display: inline-flex;
  border: 1px solid rgba(51, 65, 85, 0.7);
  border-radius: 0.375rem;
  overflow: hidden;
  flex-shrink: 0;
}
.status-logs-view-btn {
  margin: 0;
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: #94a3b8;
  background: transparent;
  border: none;
  border-radius: 0;
  cursor: pointer;
}
.status-logs-view-btn:hover {
  color: #e2e8f0;
  background: rgba(51, 65, 85, 0.35);
}
.status-logs-view-btn.active {
  color: #e2e8f0;
  background: rgba(59, 130, 246, 0.35);
}
.status-logs-line-filters {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  min-width: 0;
}
.status-logs-line-filters[hidden] {
  display: none !important;
}
.status-logs-pid-filter[hidden] {
  display: none !important;
}

.status-logs-pid-summary,
.status-logs-pid-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin: 0 0 0.5rem 0;
  color: #cbd5e1;
  font-size: 0.82rem;
}
.status-logs-pid-legend i {
  display: inline-block;
  width: 0.75rem;
  height: 0.55rem;
  border-radius: 2px;
  margin-right: 0.35rem;
  vertical-align: middle;
}
.status-logs-pid-swatch-a {
  background: rgba(232, 121, 249, 0.18);
  border-left: 3px solid rgba(240, 171, 252, 0.55);
}
.status-logs-pid-swatch-b {
  background: rgba(251, 191, 36, 0.16);
  border-left: 3px solid rgba(252, 211, 77, 0.55);
}
.status-logs-pid-hint {
  margin: 0 0 0.5rem 0;
}
.status-logs-pid-chart-wrap {
  overflow: auto;
  border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: 0.5rem;
  background: rgba(15, 23, 42, 0.45);
  max-height: min(70vh, 720px);
}
.status-logs-pid-svg {
  display: block;
  min-width: 100%;
}

.status-logs-header .status-block-title {
  margin: 0;
  padding: 0;
  border-bottom: none;
  flex: 1 1 auto;
  min-width: 0;
}

#status-logs-pane .status-logs-header .status-block-title {
  flex: 0 1 auto;
}

.status-logs-level-filter-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #cbd5e1;
  font-size: 0.82rem;
}

.status-logs-pid-filter {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #cbd5e1;
  font-size: 0.82rem;
}

.status-logs-pid-filter-label {
  white-space: nowrap;
}

.status-logs-pid-filter-button {
  min-height: 2rem;
  min-width: 7.5rem;
  padding: 0.25rem 1.6rem 0.25rem 0.45rem;
  color: #e2e8f0;
  background: #0f172a;
  border: 1px solid #475569;
  border-radius: 0.35rem;
  text-align: left;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, #94a3b8 50%),
    linear-gradient(135deg, #94a3b8 50%, transparent 50%);
  background-position: calc(100% - 12px) calc(50% - 2px), calc(100% - 7px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.status-logs-pid-filter-button:hover:not(:disabled),
.status-logs-pid-filter.is-open .status-logs-pid-filter-button {
  border-color: #60a5fa;
}

.status-logs-pid-filter-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.status-logs-pid-filter-menu {
  position: absolute;
  top: calc(100% + 0.25rem);
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 14rem;
  max-height: 16rem;
  overflow: auto;
  padding: 0.4rem;
  background: #0f172a;
  border: 1px solid #475569;
  border-radius: 0.35rem;
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.45);
}

.status-logs-pid-filter-menu[hidden] {
  display: none;
}

.status-logs-pid-filter-option {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 0.3rem 0.35rem;
  border-radius: 0.25rem;
  color: #e2e8f0;
  font-size: 0.78rem;
  cursor: pointer;
}

.status-logs-pid-filter-option:hover {
  background: rgba(59, 130, 246, 0.15);
}

.status-logs-pid-filter-option input {
  margin-top: 0.1rem;
  flex: 0 0 auto;
}

.status-logs-pid-filter-empty {
  margin: 0;
  padding: 0.35rem;
  color: #94a3b8;
  font-size: 0.78rem;
}

.status-logs-search-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #cbd5e1;
  font-size: 0.82rem;
}

.status-logs-level-filter,
.status-logs-search {
  min-height: 2rem;
  padding: 0.25rem 0.45rem;
  color: #e2e8f0;
  background: #0f172a;
  border: 1px solid #475569;
  border-radius: 0.35rem;
}

.status-logs-search {
  width: min(16rem, 100%);
  max-width: 100%;
  box-sizing: border-box;
}

.status-logs-search::placeholder {
  color: #64748b;
}

.status-logs-path {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  color: #64748b;
}

.status-logs-content {
  margin: 0;
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.status-logs-table-wrap {
  flex: 1 1 0;
  min-height: 0;
  overflow: auto;
  max-width: 100%;
  border: 1px solid rgba(71, 85, 105, 0.5);
  border-radius: 0.375rem;
  background: rgba(15, 23, 42, 0.9);
}

.status-logs-table {
  font-size: 0.75rem;
  min-width: 720px;
  width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.status-logs-table th,
.status-logs-table td {
  vertical-align: top;
}

.status-logs-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #1e293b;
  color: #94a3b8;
  font-weight: 600;
  border-bottom: 1px solid #475569;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.8);
}

.status-log-time {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: #94a3b8;
}

.status-log-level-cell {
  white-space: nowrap;
}

.status-log-level {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.status-log-level-info {
  color: #e0f2fe;
  background: rgba(14, 165, 233, 0.45);
}

.status-log-level-debug {
  color: #e2e8f0;
  background: rgba(100, 116, 139, 0.6);
}

.status-log-level-warn {
  color: #422006;
  background: rgba(245, 158, 11, 0.75);
}

.status-log-level-error {
  color: #fef2f2;
  background: rgba(239, 68, 68, 0.7);
}

.status-log-category-cell {
  white-space: nowrap;
}

.status-log-category {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #0f172a;
  background: color-mix(in srgb, var(--status-log-category-colour) 78%, white);
  border: 1px solid color-mix(in srgb, var(--status-log-category-colour) 55%, #0f172a);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--status-log-category-colour) 35%, transparent);
}

.status-log-pid-cell {
  white-space: nowrap;
}

.status-log-pid {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.12rem 0.45rem;
  border-radius: 0.35rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
  background: color-mix(in srgb, var(--status-log-pid-colour) 78%, white);
  border: 1px solid color-mix(in srgb, var(--status-log-pid-colour) 55%, #0f172a);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--status-log-pid-colour) 35%, transparent);
}

/* Current server process: bright ring + live dot so it stands out among coloured PID pills. */
.status-log-pid--current {
  color: #fff;
  font-weight: 700;
  background: color-mix(in srgb, var(--status-log-pid-colour) 72%, #0f172a);
  border: 2px solid #f8fafc;
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--status-log-pid-colour) 85%, #22c55e),
    0 0 10px color-mix(in srgb, #22c55e 55%, transparent);
}

.status-log-pid-current-mark {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  flex-shrink: 0;
  background: #4ade80;
  box-shadow: 0 0 0 2px color-mix(in srgb, #4ade80 35%, transparent);
}

.status-log-row--current-pid td {
  background: color-mix(in srgb, #22c55e 8%, transparent);
}

.status-log-message {
  word-break: break-word;
  white-space: normal;
  color: #e2e8f0;
  min-width: 14rem;
}

.status-log-meta {
  word-break: break-word;
  white-space: normal;
  color: #94a3b8;
  max-width: 22rem;
  font-size: 0.7rem;
}

.status-logs-error {
  margin-top: 0.5rem;
  flex-shrink: 0;
  color: #f87171;
  font-size: 0.9rem;
}

.status-send-log-table-wrap {
  overflow-x: auto;
  max-width: 100%;
  margin-top: 0.5rem;
}

.status-send-log-table {
  font-size: 0.75rem;
  min-width: 720px;
}

.status-send-log-body {
  max-width: 12rem;
  word-break: break-word;
  white-space: normal;
}

.status-send-log-url {
  color: #7dd3fc;
  word-break: break-all;
}

.airfields-layout {
  display: flex;
  gap: 1.5rem;
  align-items: stretch;
  min-height: 400px;
}

.airfields-list-wrap {
  flex: 0 0 220px;
}

.airfields-section h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.airfields-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 1rem;
  color: #e2e8f0;
}

.airfields-list li.airfield-item {
  padding: 0.5rem 0.5rem 0.5rem 0;
  border-bottom: 1px solid #334155;
  cursor: pointer;
}

.airfields-list li.airfield-item:hover {
  background: rgba(51, 65, 85, 0.4);
}

.airfields-list li.airfield-item.selected {
  background: rgba(59, 130, 246, 0.25);
  color: #f1f5f9;
}

.airfields-list li.airfield-item .saved-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  margin-left: 0.35rem;
  vertical-align: middle;
}

.airfields-list li.airfield-item:not(.has-coords) .saved-dot {
  display: none;
}

.airfields-list li:last-child {
  border-bottom: none;
}

.airfields-map-coords-wrap {
  border-top: 1px solid #334155;
  background: #1e293b;
}

.store-coords-btn {
  display: block;
  margin: 0.5rem 0.5rem 0.75rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: #f1f5f9;
  background: #16a34a;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.store-coords-btn:hover {
  background: #15803d;
}

.airfields-map-wrap {
  flex: 1;
  min-width: 50vw;
  border: 1px solid #334155;
  border-radius: 6px;
  overflow: hidden;
  background: #1e293b;
}

.airfields-map-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid #334155;
  background: #1e293b;
}

.airfields-map-view-toggle {
  display: flex;
  gap: 0;
}

.map-view-btn {
  padding: 0.4rem 0.9rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: #94a3b8;
  background: transparent;
  border: 1px solid #334155;
  cursor: pointer;
}

.map-view-btn:first-child {
  border-radius: 4px 0 0 4px;
}

.map-view-btn:last-child {
  border-radius: 0 4px 4px 0;
  margin-left: -1px;
}

.airfields-map-view-toggle .map-layer-toggle {
  border-radius: 4px;
  margin-left: 0;
  padding: 0.4rem;
}

.airfields-map-view-toggle .map-layer-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.airfields-map-view-toggle .map-layer-icon[hidden] {
  display: none;
}

/* Ensure only one icon shows: [hidden] must override panel-specific display:flex */
.map-layer-toggle .map-layer-icon[hidden] {
  display: none !important;
}

.map-view-btn:hover {
  color: #e2e8f0;
  background: #334155;
}

.map-view-btn.active {
  color: #f1f5f9;
  background: #3b82f6;
  border-color: #3b82f6;
}

.inhouse-map-toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

#inhouse-map-panel .airfields-map-toolbar {
  position: relative;
  z-index: 1001;
}

#inhouse-map-panel #inhouse-map-type-filter-panel,
#inhouse-map-panel #inhouse-map-airfield-filter-panel,
#inhouse-map-panel #inhouse-map-saved-views-panel {
  top: calc(10px + var(--inhouse-map-top-offset));
  left: 48px;
  right: auto;
  margin-top: 0;
  z-index: 10025;
}

#inhouse-map-panel #inhouse-map-competition-filter-panel {
  top: calc(162px + var(--inhouse-map-top-offset));
  left: 10px;
  right: auto;
  margin-top: 0;
  z-index: 10000;
  max-height: min(70vh, 520px);
  overflow-y: auto;
}

#inhouse-map-panel #inhouse-map-competition-aircraft-panel {
  top: calc(162px + var(--inhouse-map-top-offset));
  left: min(calc(10px + 22rem), calc(100% - 20rem));
  right: auto;
  margin-top: 0;
  z-index: 10001;
  width: min(22rem, calc(100vw - 24px));
  max-height: min(70vh, 520px);
  overflow-y: auto;
}

#inhouse-map-panel .inhouse-map-competition-aircraft-meta {
  font-size: 0.78rem;
  color: #94a3b8;
  margin: 0 0 0.45rem;
  line-height: 1.3;
}

#status-panel .status-competitions-today-date {
  font-weight: 500;
  color: #64748b;
  font-size: 0.85rem;
  margin-left: 0.35rem;
}

#status-panel .status-competitions-today-list {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

#status-panel .status-competition-today-row {
  padding: 0.55rem 0.65rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
}

#status-panel .status-competition-today-row.is-selected {
  border-color: #93c5fd;
  background: #eff6ff;
}

#status-panel .status-competition-today-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

#status-panel .status-competition-today-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
  min-width: 0;
}

#status-panel .status-competition-today-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

#status-panel .status-competition-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
  color: #475569;
  cursor: pointer;
}

#status-panel .status-competition-action-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #94a3b8;
}

#status-panel .status-competition-action-btn-danger:hover {
  background: #fee2e2;
  border-color: #f87171;
  color: #b91c1c;
}

#status-panel .status-competition-today-meta {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 0.15rem;
  line-height: 1.35;
}

#status-panel .status-competition-import-label {
  display: block;
  font-size: 0.85rem;
  color: #64748b;
  margin: 0.5rem 0 0.3rem;
}

#status-panel .status-competition-import-url-list {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 48rem;
}

#status-panel .status-competition-import-url-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
}

#status-panel .status-competition-import-url-row.is-current {
  border-color: #93c5fd;
  background: #eff6ff;
}

#status-panel .status-competition-import-url-main {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  flex: 1;
}

#status-panel .status-competition-import-url-text {
  font-size: 0.82rem;
  line-height: 1.35;
  color: #1d4ed8;
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

#status-panel .status-competition-import-url-badge {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #1d4ed8;
  background: #dbeafe;
  border-radius: 999px;
  padding: 0.1rem 0.4rem;
}

#status-panel .status-competition-import-add-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  max-width: 48rem;
  flex-wrap: wrap;
}

#status-panel .status-competition-import-url-input {
  flex: 1;
  min-width: 12rem;
  box-sizing: border-box;
  font-size: 0.85rem;
  line-height: 1.4;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

#status-panel .status-competition-import-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

#status-panel .status-competition-import-date-label {
  font-size: 0.85rem;
  color: #64748b;
}

#status-panel .status-competition-import-date {
  font-size: 0.9rem;
  padding: 0.25rem 0.4rem;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
}

#status-panel .status-competition-import-status {
  font-size: 0.85rem;
  color: #64748b;
  margin-top: 0.5rem;
  white-space: pre-wrap;
}

#status-panel .status-competition-import-status.is-error {
  color: #b91c1c;
}

#status-panel .status-competition-import-status.is-ok {
  color: #15803d;
}

#inhouse-map-panel .inhouse-map-competition-aircraft-panel .inhouse-map-competition-aircraft-search {
  margin-bottom: 0.45rem;
}

#inhouse-map-panel .inhouse-map-competition-aircraft-panel .inhouse-map-competition-aircraft {
  max-height: none;
}

.inhouse-map-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}


.inhouse-map-airfields-btn,
.inhouse-map-aircraft-btn {
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

#inhouse-map-panel .inhouse-map-airfields-btn .filter-btn-icon,
#inhouse-map-panel .inhouse-map-aircraft-btn .filter-btn-icon,
#inhouse-map-panel .inhouse-map-flights-btn .filter-btn-icon,
#inhouse-map-panel .inhouse-map-favourites-btn .filter-btn-icon,
#inhouse-map-panel #inhouse-map-airfield-filter-btn .filter-btn-icon,
#inhouse-map-panel #inhouse-map-type-filter-btn .filter-btn-icon {
  display: inline-flex;
}

/* Match Airfield tab icon buttons: compact, icon-only */
#inhouse-map-panel .inhouse-map-airfields-btn,
#inhouse-map-panel .inhouse-map-aircraft-btn,
#inhouse-map-panel .inhouse-map-flights-btn,
#inhouse-map-panel .inhouse-map-favourites-btn,
#inhouse-map-panel #inhouse-map-airfield-filter-btn,
#inhouse-map-panel #inhouse-map-type-filter-btn {
  padding: 0.4rem;
  min-width: 36px;
  min-height: 36px;
}

#inhouse-map-panel .inhouse-map-airfields-btn span:not(.filter-btn-icon),
#inhouse-map-panel .inhouse-map-aircraft-btn span:not(.filter-btn-icon),
#inhouse-map-panel .inhouse-map-flights-btn span:not(.filter-btn-icon),
#inhouse-map-panel .inhouse-map-favourites-btn span:not(.filter-btn-icon),
#inhouse-map-panel #inhouse-map-airfield-filter-btn .filter-btn-text,
#inhouse-map-panel #inhouse-map-type-filter-btn .filter-btn-text {
  display: none;
}

#inhouse-map-panel .inhouse-map-airfields-btn .filter-btn-icon svg,
#inhouse-map-panel .inhouse-map-aircraft-btn .filter-btn-icon svg,
#inhouse-map-panel .inhouse-map-flights-btn .filter-btn-icon svg,
#inhouse-map-panel .inhouse-map-favourites-btn .filter-btn-icon svg,
#inhouse-map-panel #inhouse-map-airfield-filter-btn .filter-btn-icon svg,
#inhouse-map-panel #inhouse-map-type-filter-btn .filter-btn-icon svg {
  display: block;
}

#inhouse-map-panel .inhouse-map-flights-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.inhouse-goto-option {
  display: block;
  width: 100%;
  padding: 0.35rem 0.5rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: #cbd5e1;
  background: transparent;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  text-align: left;
}

.inhouse-goto-option:hover {
  background: rgba(51, 65, 85, 0.8);
  color: #e2e8f0;
}

.draw-rect-btn.active {
  background: #16a34a;
  border-color: #16a34a;
}

/* Launch dots on airfield setup map: clickable, zoom to area */
#airfields-map .airfield-map-launch-dot {
  cursor: pointer;
}

.leaflet-tooltip.airfield-map-launch-dot-tooltip {
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
  color: #f1f5f9;
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid #475569;
  border-radius: 4px;
  white-space: nowrap;
  max-width: 240px;
  white-space: normal;
}
.leaflet-tooltip.airfield-map-launch-dot-tooltip .launch-dot-tooltip {
  display: block;
  line-height: 1.35;
}

/* Inactive aircraft on airfield detail maps: same visual treatment as on main map */
.airfield-map-marker-inactive {
  opacity: 0.65;
}

.airfields-map-coords {
  padding: 0.5rem 0.5rem 0.75rem;
  font-size: 0.8rem;
  font-family: ui-monospace, monospace;
  color: #94a3b8;
  background: #1e293b;
  border-top: 1px solid #334155;
  white-space: pre-wrap;
  word-break: break-all;
}

.airfields-map-coords:empty {
  display: none;
}

.airfields-map-coords-wrap:has(.airfields-map-coords:empty) .store-coords-btn {
  display: none !important;
}

/* Define airfield page: always show store button; enable only when bounds (and name) are set */
.airfields-view-setup-coords-wrap .airfields-view-setup-store-btn {
  display: block !important;
}
.airfields-view-setup-store-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: #475569;
}
.airfields-view-setup-store-btn:disabled:hover {
  background: #475569;
}

.airfields-map-container {
  position: relative;
}

.airfields-map {
  width: 100%;
  height: 400px;
  display: block;
}

/* UK gliding sites: runway-plan markers (airfields-view-setup map and others) */
.uk-site-diamond-marker {
  background: none;
  border: none;
}

/* UK gliding sites: tooltip for site details */
.leaflet-tooltip.uk-site-map-tooltip {
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
  color: #f1f5f9;
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid #475569;
  border-radius: 4px;
  white-space: nowrap;
  max-width: 280px;
  white-space: normal;
}
.leaflet-tooltip.uk-site-map-tooltip .uk-site-tooltip {
  display: block;
  line-height: 1.35;
}

#inhouse-map-panel .inhouse-map-wrap {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#inhouse-map-panel .airfields-map-toolbar.inhouse-map-toolbar-empty {
  display: none;
}

#inhouse-map-panel .inhouse-map-wrap .inhouse-map-container {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.inhouse-map-user-location-marker {
  background: none !important;
  border: none !important;
  pointer-events: auto;
  cursor: pointer;
}

.inhouse-map-user-location {
  position: relative;
  width: 44px;
  height: 44px;
}

.inhouse-map-user-location-dot-inner {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: #2d8cff;
  border: 2.5px solid #fff;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.35);
  z-index: 2;
}

.inhouse-map-user-location-arrow {
  position: absolute;
  inset: 0;
  transform-origin: 50% 50%;
  pointer-events: none;
  z-index: 1;
}

.inhouse-map-user-location-arrow-hidden {
  opacity: 0;
}

.inhouse-map-user-location-beam {
  position: absolute;
  left: 50%;
  top: 3px;
  width: 20px;
  height: 18px;
  margin-left: -10px;
  background: rgba(45, 140, 255, 0.42);
  clip-path: polygon(50% 0%, 6% 100%, 94% 100%);
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.65));
}

/* Full-screen AR camera overlay (flight profile → AR button) */
.inhouse-ar-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  background: #000;
  overflow: hidden;
}

.inhouse-ar-overlay[hidden] {
  display: none !important;
}

.inhouse-ar-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #111;
  transform-origin: center center;
  touch-action: none;
  pointer-events: none;
}

.inhouse-ar-hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.inhouse-ar-hud-top {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(0.75rem, env(safe-area-inset-top)) 0.75rem 0.5rem;
  pointer-events: auto;
}

.inhouse-ar-hud-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.inhouse-ar-title {
  display: inline-flex;
  align-items: center;
  max-width: min(58vw, 14rem);
  padding: 0.35rem 0.7rem;
  border-radius: 0.4rem;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f8fafc;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.inhouse-ar-title.inhouse-ar-title-selected {
  font-size: 1.15rem;
  padding: 0.4rem 0.8rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

.inhouse-ar-hud-btn {
  min-height: 2.25rem;
  padding: 0 0.7rem;
  border: none;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #f8fafc;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
}

.inhouse-ar-hud-btn[hidden] {
  display: none !important;
}

.inhouse-ar-hud-btn:hover {
  background: rgba(30, 41, 59, 0.92);
}

.inhouse-ar-hud-btn[aria-pressed="false"] {
  background: rgba(51, 65, 85, 0.85);
  color: #94a3b8;
}

.inhouse-ar-diagnostics {
  position: absolute;
  top: 3.1rem;
  left: 0.5rem;
  right: 0.5rem;
  max-height: 42vh;
  overflow: auto;
  margin: 0;
  padding: 0.5rem 0.6rem;
  border-radius: 0.4rem;
  background: rgba(0, 0, 0, 0.82);
  color: #86efac;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.62rem;
  line-height: 1.45;
  white-space: pre-wrap;
  pointer-events: auto;
  z-index: 3;
  -webkit-overflow-scrolling: touch;
}

.inhouse-ar-diagnostics[hidden] {
  display: none;
}

.inhouse-ar-close {
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #f8fafc;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
}

.inhouse-ar-close:hover {
  background: rgba(30, 41, 59, 0.92);
}

.inhouse-ar-overlay.inhouse-ar-labels-hidden .inhouse-ar-target-label,
.inhouse-ar-overlay.inhouse-ar-labels-hidden .inhouse-ar-predicted-label {
  display: none !important;
}

.inhouse-ar-status {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: min(90vw, 320px);
  margin: 0;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background: rgba(15, 23, 42, 0.82);
  color: #e2e8f0;
  font-size: 0.85rem;
  text-align: center;
  line-height: 1.4;
  pointer-events: none;
}

.inhouse-ar-permission-prompt {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 10080;
  max-width: min(90vw, 320px);
  margin: 0;
  padding: 0.85rem 1rem 0.75rem;
  border-radius: 0.5rem;
  background: rgba(15, 23, 42, 0.88);
  color: #e2e8f0;
  text-align: center;
  line-height: 1.4;
  pointer-events: auto;
  touch-action: manipulation;
}

.inhouse-ar-permission-prompt[hidden] {
  display: none !important;
}

.inhouse-ar-permission-message {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
}

.inhouse-ar-permission-retry-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0 1rem;
  border: none;
  border-radius: 999px;
  background: #3b82f6;
  color: #f8fafc;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(59, 130, 246, 0.35);
}

.inhouse-ar-permission-retry-btn:hover {
  background: #2563eb;
}

.inhouse-ar-permission-settings-hint {
  margin: 0.65rem 0 0;
  font-size: 0.72rem;
  color: #94a3b8;
  line-height: 1.35;
}

.inhouse-ar-reticle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.inhouse-ar-reticle::before,
.inhouse-ar-reticle::after {
  content: '';
  position: absolute;
  background: rgba(255, 255, 255, 0.55);
}

.inhouse-ar-reticle::before {
  left: 50%;
  top: 3px;
  width: 2px;
  height: 16px;
  margin-left: -1px;
}

.inhouse-ar-reticle::after {
  top: 50%;
  left: 3px;
  width: 16px;
  height: 2px;
  margin-top: -1px;
}

.inhouse-ar-trail-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.inhouse-ar-predicted {
  position: absolute;
  left: 0;
  top: 0;
  /* Pin ring centre (not ring+label stack) to the predicted point. */
  transform: translate(-50%, -16px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  pointer-events: none;
}

.inhouse-ar-predicted[hidden] {
  display: none !important;
}

.inhouse-ar-predicted-ring {
  width: 32px;
  height: 32px;
  border: 2.5px dashed rgba(251, 191, 36, 0.92);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.65);
}

.inhouse-ar-predicted-label {
  padding: 0.1rem 0.35rem;
  border-radius: 0.2rem;
  background: rgba(15, 23, 42, 0.78);
  color: #fcd34d;
  font-size: 0.7rem;
  font-weight: 600;
}

.inhouse-ar-predicted.inhouse-ar-predicted-offscreen {
  opacity: 0.55;
}

.inhouse-ar-predicted-20 {
  /* +20s ring is 38px — half of that. */
  transform: translate(-50%, -19px);
}

.inhouse-ar-predicted-20 .inhouse-ar-predicted-ring {
  width: 38px;
  height: 38px;
  border-color: rgba(251, 146, 60, 0.88);
}

.inhouse-ar-predicted-20 .inhouse-ar-predicted-label {
  color: #fdba74;
}

.inhouse-ar-locators {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.inhouse-ar-locator {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  pointer-events: auto;
  cursor: pointer;
  border: none;
  padding: 0.35rem;
  margin: 0;
  background: transparent;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.inhouse-ar-locator-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(248, 250, 252, 0.95);
  border: 2px solid rgba(15, 23, 42, 0.85);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.75);
}

.inhouse-ar-locator-label {
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  background: rgba(15, 23, 42, 0.78);
  color: #f8fafc;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  max-width: 7rem;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.inhouse-ar-pick-sheet {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  padding: 1rem;
}

.inhouse-ar-pick-sheet[hidden] {
  display: none !important;
}

.inhouse-ar-pick-sheet-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  margin: 0;
  padding: 0;
  background: rgba(2, 6, 23, 0.55);
  cursor: pointer;
}

.inhouse-ar-pick-sheet-panel {
  position: relative;
  z-index: 1;
  width: min(20rem, 100%);
  max-height: min(60vh, 28rem);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.85rem 0.85rem 0.75rem;
  border-radius: 0.65rem;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  pointer-events: auto;
}

.inhouse-ar-pick-sheet-title {
  color: #e2e8f0;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.inhouse-ar-pick-sheet-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  max-height: min(44vh, 20rem);
}

.inhouse-ar-pick-sheet-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  width: 100%;
  min-height: 2.6rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.4rem;
  background: rgba(59, 130, 246, 0.85);
  color: #f8fafc;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.inhouse-ar-pick-sheet-item-meta {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.9;
}

.inhouse-ar-pick-sheet-cancel {
  align-self: stretch;
  min-height: 2.4rem;
  border: none;
  border-radius: 0.4rem;
  background: rgba(51, 65, 85, 0.95);
  color: #e2e8f0;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}

.inhouse-ar-pick-sheet-cancel:hover {
  background: rgba(71, 85, 105, 0.98);
}

.inhouse-ar-target {
  position: absolute;
  left: 0;
  top: 0;
  /* Pin the 36px icon centre (not icon+label stack) to the projected point so the trail meets it. */
  transform: translate(-50%, -18px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  transition: opacity 0.12s ease;
  pointer-events: auto;
  cursor: pointer;
  z-index: 5;
  touch-action: manipulation;
}

.inhouse-ar-target[hidden] {
  display: none !important;
}

.inhouse-ar-target-icon {
  position: relative;
  width: 36px;
  height: 36px;
  color: #f8fafc;
  filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.85));
}

.inhouse-ar-aircraft-icon-plan {
  display: block;
  width: 36px;
  height: 36px;
  transform: rotate(var(--ar-icon-rotation, 45deg));
  transform-origin: 50% 50%;
}

.inhouse-ar-target-label {
  padding: 0.15rem 0.45rem;
  border-radius: 0.25rem;
  background: rgba(15, 23, 42, 0.78);
  color: #f8fafc;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* White = off target, blue = near (±5°), green = on (±2°) — same as map label facing highlight. */
.inhouse-ar-target.inhouse-ar-target-near .inhouse-ar-target-icon {
  color: #38bdf8;
}

.inhouse-ar-target.inhouse-ar-target-aligned .inhouse-ar-target-icon {
  color: #4ade80;
}

.inhouse-ar-edge {
  position: absolute;
  width: 28px;
  height: 28px;
  border-right: 4px solid #f8fafc;
  border-bottom: 4px solid #f8fafc;
  transform-origin: 50% 50%;
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.75));
}

.inhouse-ar-edge.inhouse-ar-edge-near {
  border-right-color: #38bdf8;
  border-bottom-color: #38bdf8;
}

.inhouse-ar-edge.inhouse-ar-edge-aligned {
  border-right-color: #4ade80;
  border-bottom-color: #4ade80;
}

.inhouse-ar-controls {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: calc(max(0.75rem, env(safe-area-inset-bottom)) + 2.6rem);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.55rem 0.75rem 0.65rem;
  border-radius: 0.55rem;
  background: rgba(15, 23, 42, 0.82);
  pointer-events: auto;
  z-index: 20;
  touch-action: manipulation;
}

.inhouse-ar-control-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.75rem;
}

.inhouse-ar-trail-control-label {
  flex-shrink: 0;
  min-width: 6.75rem;
  color: #e2e8f0;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.inhouse-ar-radius-slider-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

.inhouse-ar-radius-ticks {
  position: absolute;
  left: 0.925rem;
  right: 0.925rem;
  top: 50%;
  height: 0.55rem;
  margin-top: calc(-0.55rem / 2);
  pointer-events: none;
  z-index: 0;
}

.inhouse-ar-radius-tick {
  position: absolute;
  top: 50%;
  width: 2px;
  height: 0.85rem;
  margin-top: calc(-0.85rem / 2);
  margin-left: -1px;
  border-radius: 1px;
  background: rgba(248, 250, 252, 0.9);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.35);
}

.inhouse-ar-radius-slider-wrap .inhouse-ar-trail-slider {
  position: relative;
  z-index: 1;
  width: 100%;
}

.inhouse-ar-trail-full-label {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #e2e8f0;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.inhouse-ar-trail-full-checkbox {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  accent-color: #38bdf8;
  cursor: pointer;
}

.inhouse-ar-trail-slider {
  flex: 1;
  min-width: 0;
  height: 2.75rem;
  margin: 0;
  padding: 0;
  accent-color: #38bdf8;
  cursor: pointer;
  touch-action: none;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}

.inhouse-ar-trail-slider:disabled {
  opacity: 0.45;
  cursor: default;
}

.inhouse-ar-trail-slider:focus {
  outline: none;
}

.inhouse-ar-trail-slider:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.85);
  outline-offset: 2px;
  border-radius: 999px;
}

/* Larger track + thumb so AR sliders are easy to grab on a phone. */
.inhouse-ar-trail-slider::-webkit-slider-runnable-track {
  height: 0.55rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.45);
}

.inhouse-ar-trail-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1.85rem;
  height: 1.85rem;
  margin-top: calc((0.55rem - 1.85rem) / 2);
  border-radius: 50%;
  border: 2px solid rgba(15, 23, 42, 0.9);
  background: #38bdf8;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);
}

.inhouse-ar-trail-slider::-moz-range-track {
  height: 0.55rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.45);
}

.inhouse-ar-trail-slider::-moz-range-thumb {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  border: 2px solid rgba(15, 23, 42, 0.9);
  background: #38bdf8;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);
}

.inhouse-ar-readout {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: max(0.75rem, env(safe-area-inset-bottom));
  padding: 0.45rem 0.65rem;
  border-radius: 0.4rem;
  background: rgba(15, 23, 42, 0.72);
  color: #cbd5e1;
  font-size: 0.75rem;
  line-height: 1.35;
  text-align: center;
}

.inhouse-ar-readout:empty {
  display: none;
}

/* Keep map selection status bar visible above AR camera overlay; lift AR bottom HUD above it. */
body.inhouse-ar-mode-active .inhouse-map-selection-status--ar-portaled {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10060;
  padding-bottom: calc(0.35rem + env(safe-area-inset-bottom, 0px));
}

body.inhouse-ar-mode-active .inhouse-ar-readout {
  bottom: calc(var(--inhouse-ar-status-bar-offset, 0px) + max(0.75rem, env(safe-area-inset-bottom)));
}

body.inhouse-ar-mode-active .inhouse-ar-controls {
  bottom: calc(var(--inhouse-ar-status-bar-offset, 0px) + max(0.75rem, env(safe-area-inset-bottom)) + 2.6rem);
}

#inhouse-map-panel .inhouse-map-wrap .inhouse-map-container .inhouse-map {
  flex: 1;
  min-height: 0;
  height: auto;
}

#inhouse-map .leaflet-bottom {
  bottom: var(--inhouse-map-attribution-offset, 0px);
}

.inhouse-map-selection-status {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  /* Above Leaflet panes; below fixed map tabs (10010). */
  z-index: 10005;
  container-type: inline-size;
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 0.35rem 0.65rem;
  background: rgba(15, 23, 42, 0.92);
  border-top: 1px solid #334155;
  color: #e2e8f0;
  font-size: 0.75rem;
  line-height: 1.25;
  pointer-events: none;
  overflow: hidden;
  max-width: 100%;
  box-sizing: border-box;
}

.inhouse-map-selection-status-icons {
  display: grid;
  grid-template-rows: repeat(3, auto);
  align-content: start;
  row-gap: 0.1rem;
  flex-shrink: 0;
  pointer-events: auto;
}

.inhouse-map-selection-status-btn {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 0;
  width: 1.25em;
  height: 1.25em;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  line-height: 0;
}

.inhouse-map-selection-status-btn svg {
  display: block;
}

.inhouse-map-selection-status-btn:hover {
  background: rgba(51, 65, 85, 0.8);
  color: #e2e8f0;
}

.inhouse-map-selection-status-favourite-btn-active {
  color: #fb7185;
}

.inhouse-map-selection-status-favourite-btn-active:hover {
  color: #fda4af;
}

.inhouse-map-selection-status-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

/* Narrow: 3 rows — label/value columns left and right */
.inhouse-map-selection-status-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  width: 100%;
  flex: 1;
  min-width: 0;
  gap: 0.35rem 0.35rem;
  align-items: flex-start;
  overflow: hidden;
}

.inhouse-map-selection-status-col {
  display: grid;
  grid-template-columns: max-content max-content;
  column-gap: 0.35rem;
  row-gap: 0.1rem;
  align-items: baseline;
  min-width: 0;
}

.inhouse-map-selection-status-col:not(.inhouse-map-selection-status-col--right) {
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 0.45rem;
  min-width: 0;
}

.inhouse-map-selection-status-col:not(.inhouse-map-selection-status-col--right) .inhouse-map-selection-status-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.inhouse-map-selection-status-col--right {
  grid-template-columns: max-content 7.75rem;
  flex-shrink: 0;
  justify-self: end;
  max-width: 100%;
}

.inhouse-map-selection-status-col--right .inhouse-map-selection-status-value {
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inhouse-map-selection-status-item {
  white-space: nowrap;
}

@container (max-width: 519px) {
  .inhouse-map-selection-status-item {
    display: contents;
  }
}

/* Wide enough for one line */
@container (min-width: 520px) {
  .inhouse-map-selection-status {
    align-items: center;
    overflow: visible;
  }

  .inhouse-map-selection-status-icons {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.2rem;
  }

  .inhouse-map-selection-status-layout {
    display: flex;
    flex: 1;
    width: 100%;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.85rem;
    overflow: visible;
  }

  .inhouse-map-selection-status-col {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: baseline;
    gap: 0;
    min-width: 0;
  }

  .inhouse-map-selection-status-col:not(.inhouse-map-selection-status-col--right) {
    grid-template-columns: none;
    column-gap: normal;
    flex-shrink: 1;
    min-width: 0;
  }

  .inhouse-map-selection-status-col--right {
    grid-template-columns: none;
    flex-shrink: 0;
    justify-self: auto;
    max-width: none;
  }

  .inhouse-map-selection-status-col--right .inhouse-map-selection-status-value,
  .inhouse-map-selection-status-col:not(.inhouse-map-selection-status-col--right) .inhouse-map-selection-status-value {
    display: inline;
    width: auto;
    min-width: 0;
    max-width: none;
    text-align: left;
    overflow: visible;
    text-overflow: clip;
  }

  .inhouse-map-selection-status-value-alt {
    display: inline-block;
    width: auto;
  }

  .inhouse-map-selection-status-item {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    white-space: nowrap;
    margin-right: 1.35rem;
  }

  .inhouse-map-selection-status-col .inhouse-map-selection-status-item:last-child {
    margin-right: 0;
  }
}

.inhouse-map-selection-status[hidden] {
  display: none !important;
}

.inhouse-map-selection-status-label {
  color: #94a3b8;
  font-weight: 500;
}

.inhouse-map-selection-status-value {
  color: #f8fafc;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.inhouse-map-selection-status-vario-up {
  color: #93c5fd;
}

.inhouse-map-selection-status-vario-down {
  color: #f87171;
}

.inhouse-map-selection-status-value-alt {
  display: inline-block;
  box-sizing: border-box;
  width: 100%;
  padding: 0.02rem 0.28rem;
  border-radius: 0.2rem;
  border: 1px solid rgba(15, 23, 42, 0.35);
}

/* Left overlay: four rows — filters; plot/zoom/AR; saved zoom; trophy. */
#inhouse-map-panel .inhouse-map-overlay-controls {
  position: absolute;
  top: calc(10px + var(--inhouse-map-top-offset));
  left: 10px;
  z-index: 9999;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

#inhouse-map-panel .inhouse-map-overlay-controls:has(.search-typeahead-dropdown:not([hidden])) {
  z-index: 10025;
}

#inhouse-map-panel .inhouse-map-overlay-controls-row {
  display: flex;
  flex-direction: row;
  gap: 10px;
  pointer-events: auto;
}

#inhouse-map-panel .inhouse-map-overlay-controls-row:has(#inhouse-map-competition-btn):not(:has(.inhouse-map-competition-btn.is-available)) {
  display: none;
}

/* Left overlay: 30×30, icon centered. */
#inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-flights-btn,
#inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-favourites-btn,
#inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-plot-btn,
#inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-airspace-mode-btn,
#inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-notams-btn,
#inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-competition-btn,
#inhouse-map-panel .inhouse-map-overlay-controls #inhouse-map-airfield-filter-btn,
#inhouse-map-panel .inhouse-map-overlay-controls #inhouse-map-type-filter-btn {
  pointer-events: auto;
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  min-height: 30px !important;
  padding: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 4px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.65);
}

#inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-flights-btn .filter-btn-icon,
#inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-favourites-btn .filter-btn-icon,
#inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-plot-btn .filter-btn-icon,
#inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-airspace-mode-btn .filter-btn-icon,
#inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-notams-btn .filter-btn-icon,
#inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-competition-btn .filter-btn-icon,
#inhouse-map-panel .inhouse-map-overlay-controls #inhouse-map-airfield-filter-btn .filter-btn-icon,
#inhouse-map-panel .inhouse-map-overlay-controls #inhouse-map-type-filter-btn .filter-btn-icon {
  margin: 0;
}

#inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-flights-btn .filter-btn-icon svg,
#inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-favourites-btn .filter-btn-icon svg,
#inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-plot-btn .filter-btn-icon svg,
#inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-airspace-mode-btn .filter-btn-icon svg,
#inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-notams-btn .filter-btn-icon svg,
#inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-competition-btn .filter-btn-icon svg,
#inhouse-map-panel .inhouse-map-overlay-controls #inhouse-map-airfield-filter-btn .filter-btn-icon svg,
#inhouse-map-panel .inhouse-map-overlay-controls #inhouse-map-type-filter-btn .filter-btn-icon svg {
  width: 18px;
  height: 18px;
}

#inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-favourites-btn .filter-btn-text,
#inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-plot-btn .filter-btn-text,
#inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-airspace-mode-btn .filter-btn-text,
#inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-notams-btn .filter-btn-text,
#inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-competition-btn .filter-btn-text,
#inhouse-map-panel .inhouse-map-overlay-controls #inhouse-map-airfield-filter-btn .filter-btn-text,
#inhouse-map-panel .inhouse-map-overlay-controls #inhouse-map-type-filter-btn .filter-btn-text {
  display: none;
}

#inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-plot-btn.active {
  background: #3b82f6 !important;
  border-color: #3b82f6 !important;
  color: #f1f5f9 !important;
}
#inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-plot-btn.active:hover {
  background: #2563eb !important;
  border-color: #2563eb !important;
}

#inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-airspace-mode-btn.active {
  background: #0d9488 !important;
  border-color: #0d9488 !important;
  color: #f0fdfa !important;
}
#inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-airspace-mode-btn.active:hover {
  background: #0f766e !important;
  border-color: #0f766e !important;
}

#inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-favourites-btn.active {
  background: #3b82f6 !important;
  border-color: #3b82f6 !important;
  color: #f1f5f9 !important;
}
#inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-favourites-btn.active:hover {
  background: #2563eb !important;
  border-color: #2563eb !important;
}

#inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-competition-btn.active {
  background: #b45309 !important;
  border-color: #b45309 !important;
  color: #fef3c7 !important;
}
#inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-competition-btn.active:hover {
  background: #92400e !important;
  border-color: #92400e !important;
}

#inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-competition-btn {
  touch-action: manipulation;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}

#inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-competition-btn {
  display: none !important;
}
#inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-competition-btn.is-available {
  display: flex !important;
}

#inhouse-map-panel .inhouse-map-competition-panel {
  position: absolute;
  left: 10px;
  top: calc(10px + var(--inhouse-map-top-offset) + 152px);
  z-index: 10015;
  pointer-events: auto;
  width: min(16.5rem, calc(100% - 1.25rem));
  padding: 0.55rem 0.65rem;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid #334155;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: #e2e8f0;
  font-size: 0.78rem;
}

#inhouse-map-panel .inhouse-map-competition-panel[hidden] {
  display: none !important;
}

#inhouse-map-panel .inhouse-map-competition-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#inhouse-map-panel .inhouse-map-competition-panel-header:active {
  cursor: grabbing;
}

#inhouse-map-panel .inhouse-map-competition-panel-title {
  font-weight: 600;
  color: #f8fafc;
}

#inhouse-map-panel .inhouse-map-competition-panel-actions {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex-shrink: 0;
}

#inhouse-map-panel .inhouse-map-competition-exclusions-toggle {
  appearance: none;
  border: 1px solid #475569;
  background: #1e293b;
  color: #94a3b8;
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.2rem 0.35rem;
  cursor: pointer;
  border-radius: 3px;
}

#inhouse-map-panel .inhouse-map-competition-exclusions-toggle:hover {
  color: #e2e8f0;
  background: #334155;
}

#inhouse-map-panel .inhouse-map-competition-exclusions-toggle.active {
  background: #0f766e;
  border-color: #0f766e;
  color: #f8fafc;
}

#inhouse-map-panel .inhouse-map-competition-exclusions-toggle[hidden] {
  display: none !important;
}

#inhouse-map-panel .inhouse-map-competition-panel-close {
  appearance: none;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.05rem 0.25rem;
  cursor: pointer;
  border-radius: 3px;
}

#inhouse-map-panel .inhouse-map-competition-panel-close:hover {
  color: #f8fafc;
  background: #334155;
}

#inhouse-map-panel .inhouse-map-competition-meta,
#inhouse-map-panel .inhouse-map-competition-count {
  color: #94a3b8;
}

#inhouse-map-panel .inhouse-map-competition-mode {
  display: flex;
  gap: 0;
  border: 1px solid #475569;
  border-radius: 4px;
  overflow: hidden;
}

#inhouse-map-panel .inhouse-map-competition-mode-btn {
  appearance: none;
  flex: 1;
  border: none;
  background: #1e293b;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.28rem 0.4rem;
  cursor: pointer;
}

#inhouse-map-panel .inhouse-map-competition-mode-btn + .inhouse-map-competition-mode-btn {
  border-left: 1px solid #475569;
}

#inhouse-map-panel .inhouse-map-competition-mode-btn:hover {
  background: #334155;
  color: #e2e8f0;
}

#inhouse-map-panel .inhouse-map-competition-mode-btn.active {
  background: #0f766e;
  color: #f8fafc;
}

#inhouse-map-panel .inhouse-map-competition-time-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#inhouse-map-panel .inhouse-map-competition-play-btn {
  appearance: none;
  border: 1px solid #475569;
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  cursor: pointer;
}

#inhouse-map-panel .inhouse-map-competition-play-btn:hover {
  background: #334155;
}

#inhouse-map-panel .inhouse-map-competition-clock {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #f8fafc;
}

#inhouse-map-panel .inhouse-map-competition-trail-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  color: #94a3b8;
}

#inhouse-map-panel .inhouse-map-competition-trail,
#inhouse-map-panel .inhouse-map-competition-select {
  flex: 1;
  min-width: 0;
  appearance: none;
  border: 1px solid #475569;
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 4px;
  font-size: 0.72rem;
  padding: 0.2rem 0.35rem;
}

#inhouse-map-panel .inhouse-map-competition-scrub {
  width: 100%;
  margin: 0.15rem 0 0;
  accent-color: #f59e0b;
}

#inhouse-map-panel .inhouse-map-competition-play-btn[hidden],
#inhouse-map-panel .inhouse-map-competition-scrub[hidden] {
  display: none !important;
}

#inhouse-map-panel .inhouse-map-competition-sync-bar {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  z-index: 1000;
  width: min(28rem, calc(100% - 2rem));
  box-sizing: border-box;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid #334155;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

#inhouse-map-panel .inhouse-map-competition-sync-bar[hidden] {
  display: none !important;
}

#inhouse-map-panel .inhouse-map-competition-sync-status {
  margin-left: auto;
  font-size: 0.72rem;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

#inhouse-map-panel .inhouse-map-competition-sync-speed-label {
  flex: 0 0 auto;
  margin: 0;
}

#inhouse-map-panel .inhouse-map-competition-sync-speed-label .inhouse-map-competition-trail {
  flex: 0 0 auto;
  width: auto;
  min-width: 3.25rem;
}

#inhouse-map-panel .inhouse-map-competition-sync-replay-btn {
  width: 100%;
  margin-top: 0.15rem;
}

#inhouse-map-panel .inhouse-map-open-aircraft-list-btn,
#inhouse-map-panel .inhouse-map-open-airfields-list-btn {
  width: auto;
  margin-top: 0;
  flex-shrink: 0;
}

#inhouse-map-panel .inhouse-map-competition-sync-replay-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#inhouse-map-panel .inhouse-map-competition-aircraft-wrap {
  border-top: 1px solid #334155;
  padding-top: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

#inhouse-map-panel .inhouse-map-competition-aircraft-wrap[hidden] {
  display: none !important;
}

#inhouse-map-panel .inhouse-map-competition-aircraft-search {
  width: 100%;
  box-sizing: border-box;
  appearance: none;
  border: 1px solid #475569;
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 4px;
  font-size: 0.72rem;
  padding: 0.28rem 0.4rem;
}

#inhouse-map-panel .inhouse-map-competition-aircraft-search::placeholder {
  color: #64748b;
}

#inhouse-map-panel .inhouse-map-competition-aircraft {
  max-height: 11rem;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

#inhouse-map-panel .inhouse-map-competition-aircraft-heading {
  font-size: 0.68rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

#inhouse-map-panel .inhouse-map-competition-aircraft-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

#inhouse-map-panel .inhouse-map-competition-aircraft-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #e2e8f0;
}

#inhouse-map-panel .inhouse-map-competition-aircraft-name.is-excluded {
  color: #94a3b8;
  text-decoration: line-through;
}

#inhouse-map-panel .inhouse-map-competition-aircraft-row.is-not-seen {
  background: rgba(245, 158, 11, 0.12);
  border-radius: 4px;
  padding: 0.15rem 0.25rem;
  margin: 0 -0.25rem;
}

#inhouse-map-panel .inhouse-map-competition-aircraft-name.is-not-seen {
  color: #fbbf24;
}

#inhouse-map-panel .inhouse-map-competition-aircraft-pending {
  margin-left: 0.35rem;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #f59e0b;
  white-space: nowrap;
}

#inhouse-map-panel .inhouse-map-competition-aircraft-detail {
  margin-left: 0.35em;
  font-weight: 400;
  opacity: 0.75;
  white-space: nowrap;
}

#inhouse-map-panel .inhouse-map-competition-aircraft-id {
  color: #64748b;
  font-size: 0.65rem;
  font-weight: 500;
  text-decoration: none;
}

#inhouse-map-panel .inhouse-map-competition-aircraft-action {
  appearance: none;
  flex-shrink: 0;
  border: 1px solid #475569;
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.12rem 0.35rem;
  cursor: pointer;
}

#inhouse-map-panel .inhouse-map-competition-aircraft-action:hover {
  background: #334155;
}

#inhouse-map-panel .inhouse-map-competition-aircraft-action.is-exclude {
  border-color: #7f1d1d;
  color: #fecaca;
}

#inhouse-map-panel .inhouse-map-competition-aircraft-empty {
  color: #64748b;
  font-size: 0.7rem;
}

#inhouse-map-panel .inhouse-map-competition-tp-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: #94a3b8;
  font-size: 0.72rem;
  cursor: pointer;
  user-select: none;
}

#inhouse-map-panel .inhouse-map-competition-tp-count {
  margin-left: auto;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

.inhouse-map-competition-tp-marker {
  background: none !important;
  border: none !important;
}

.inhouse-map-competition-oz {
  pointer-events: none;
}

.inhouse-map-competition-tp-label-chip {
  display: inline-block;
  padding: 0.05rem 0.25rem;
  border-radius: 2px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.55);
  color: #cbd5e1;
  font-size: 0.58rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
}

.inhouse-map-competition-tp-label-chip.is-home {
  border-color: #f59e0b;
  color: #fde68a;
}

.inhouse-map-competition-tp-label-chip.is-start {
  border-color: #38bdf8;
  color: #bae6fd;
}

.inhouse-map-competition-marker {
  background: none !important;
  border: none !important;
  pointer-events: auto;
  cursor: pointer;
}

.inhouse-map-competition-label {
  display: inline-block;
  padding: 0.12rem 0.35rem;
  border-radius: 3px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--comp-color, #f59e0b);
  color: #f8fafc;
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: auto;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.inhouse-map-competition-label.is-selected {
  background: var(--comp-color, #f59e0b);
  color: #0f172a;
  box-shadow: 0 0 0 2px rgba(248, 250, 252, 0.85), 0 1px 4px rgba(0, 0, 0, 0.45);
}

.inhouse-map-competition-label.is-dimmed {
  opacity: 0.45;
}

/* Map overlay: search box (same height as buttons) */
#inhouse-map-panel .inhouse-map-search-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  pointer-events: auto;
}
#inhouse-map-panel .inhouse-map-search-input {
  width: 120px;
  min-width: 80px;
  height: 30px;
  padding: 0 1.75rem 0 0.5rem;
  font-size: 0.75rem;
  font-family: inherit;
  color: #e2e8f0;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 4px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.65);
  outline: none;
}
#inhouse-map-panel .inhouse-map-search-input::placeholder {
  color: #64748b;
}
#inhouse-map-panel .inhouse-map-search-input:focus {
  border-color: #3b82f6;
}
#inhouse-map-panel .inhouse-map-search-input.inhouse-map-search-active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #f1f5f9;
  caret-color: #f8fafc;
}
#inhouse-map-panel .inhouse-map-search-input.inhouse-map-search-active:focus {
  border-color: #93c5fd;
}
#inhouse-map-panel .inhouse-map-search-wrap:has(.inhouse-map-search-active) .inhouse-map-search-clear {
  color: #f1f5f9;
}
#inhouse-map-panel .inhouse-map-search-wrap:has(.inhouse-map-search-active) .inhouse-map-search-clear:hover {
  color: #fff;
  background: rgba(37, 99, 235, 0.9);
}
#inhouse-map-panel .inhouse-map-toolbar-zoom-btn,
#inhouse-map-panel .inhouse-map-toolbar-ar-btn {
  pointer-events: auto;
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  min-height: 30px !important;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 4px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.65);
  color: #94a3b8;
  cursor: pointer;
}
#inhouse-map-panel .inhouse-map-toolbar-zoom-btn:hover:not(:disabled),
#inhouse-map-panel .inhouse-map-toolbar-ar-btn:hover:not(:disabled) {
  color: #e2e8f0;
  background: #334155;
}
#inhouse-map-panel .inhouse-map-toolbar-zoom-btn:active:not(:disabled),
#inhouse-map-panel .inhouse-map-toolbar-zoom-btn:focus,
#inhouse-map-panel .inhouse-map-toolbar-zoom-btn:focus-visible,
#inhouse-map-panel .inhouse-map-toolbar-ar-btn:active:not(:disabled),
#inhouse-map-panel .inhouse-map-toolbar-ar-btn:focus,
#inhouse-map-panel .inhouse-map-toolbar-ar-btn:focus-visible {
  color: #94a3b8;
  background: #1e293b;
  outline: none;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.65);
}
#inhouse-map-panel .inhouse-map-toolbar-zoom-btn:focus-visible,
#inhouse-map-panel .inhouse-map-toolbar-ar-btn:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 1px;
}
#inhouse-map-panel .inhouse-map-toolbar-zoom-btn:disabled,
#inhouse-map-panel .inhouse-map-toolbar-ar-btn:disabled {
  opacity: 0.4;
  color: #64748b;
  cursor: default;
  pointer-events: none;
}
#inhouse-map-panel .inhouse-map-toolbar-zoom-btn:disabled:hover,
#inhouse-map-panel .inhouse-map-toolbar-ar-btn:disabled:hover {
  color: #64748b;
  background: #1e293b;
}
#inhouse-map-panel .inhouse-map-toolbar-location-btn.active {
  background: #3b82f6 !important;
  border-color: #3b82f6 !important;
  color: #f1f5f9 !important;
}
#inhouse-map-panel .inhouse-map-toolbar-location-btn.active:hover {
  background: #2563eb !important;
  border-color: #2563eb !important;
}
#inhouse-map-panel .inhouse-map-toolbar-zoom-btn.has-preferred-min-zoom {
  color: #cbd5e1;
  border-color: #64748b;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.65), inset 0 0 0 1px rgba(148, 163, 184, 0.35);
}
#inhouse-map-panel .inhouse-map-toolbar-zoom-btn.has-preferred-min-zoom::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.65);
  pointer-events: none;
}
#inhouse-map-panel .inhouse-map-toolbar-zoom-btn.inhouse-map-toolbar-zoom-btn-hold-flash {
  color: #e2e8f0;
  border-color: #38bdf8;
}
#inhouse-map-panel #inhouse-map-zoom-to-visible-btn {
  position: relative;
}

#inhouse-map-panel #inhouse-map-saved-views-panel {
  min-width: 16.5rem;
}

#inhouse-map-panel #inhouse-map-saved-views-list {
  max-height: min(50vh, 22rem);
  overflow-y: auto;
}

#inhouse-map-panel .inhouse-map-saved-views-save-row {
  display: flex;
  align-items: center;
}

#inhouse-map-panel .inhouse-map-saved-views-empty {
  color: #94a3b8;
  font-size: 0.85rem;
  padding: 0.15rem 0;
}

#inhouse-map-panel .inhouse-map-saved-view-select {
  flex: 1;
  min-width: 0;
  text-align: left;
  background: none;
  border: none;
  color: #cbd5e1;
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.3;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  margin-right: 0.35rem;
  border-radius: 0.3rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#inhouse-map-panel .inhouse-map-saved-view-select:hover {
  color: #f8fafc;
}

#inhouse-map-panel .inhouse-map-saved-view-row {
  width: 100%;
}

#inhouse-map-panel .inhouse-map-saved-view-row.is-active .inhouse-map-saved-view-select {
  background: rgba(59, 130, 246, 0.2);
  box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.4);
  color: #e2e8f0;
  font-weight: 500;
}
#inhouse-map-panel .inhouse-map-toolbar-zoom-btn .filter-btn-icon,
#inhouse-map-panel .inhouse-map-toolbar-ar-btn .filter-btn-icon {
  margin: 0;
  display: inline-flex;
}
#inhouse-map-panel .inhouse-map-toolbar-zoom-btn .filter-btn-icon svg,
#inhouse-map-panel .inhouse-map-toolbar-ar-btn .filter-btn-icon svg {
  width: 18px;
  height: 18px;
}
#inhouse-map-panel .inhouse-map-search-clear {
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  color: #94a3b8;
  background: transparent;
  border: none;
  border-radius: 0.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
#inhouse-map-panel .inhouse-map-search-clear:hover {
  color: #e2e8f0;
  background: rgba(51, 65, 85, 0.8);
}
#inhouse-map-panel .inhouse-map-search-clear[hidden] {
  display: none;
}

/* Right overlay: Airfields toggle + Street/Satellite, top-right */
#inhouse-map-panel .inhouse-map-overlay-controls-right {
  position: absolute;
  top: calc(10px + var(--inhouse-map-top-offset));
  right: 10px;
  left: auto;
  z-index: 9999;
  pointer-events: none;
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: flex-start;
  justify-content: flex-end;
  overflow: visible;
}

#inhouse-map-panel .inhouse-map-overlay-controls-right:has(.inhouse-map-layers-dropdown:not([hidden])) {
  z-index: 10025;
}

#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-airfields-btn,
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-history-btn,
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-signin-btn,
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-notifications-btn,
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-layers-btn,
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-airspace-mode-btn,
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-notams-btn,
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-debug-logs-btn,
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-ui-update-btn,
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-toolbar-ar-btn,
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-status-btn {
  pointer-events: auto;
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  min-height: 30px !important;
  padding: 0 !important;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 4px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.65);
}

#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-history-btn[hidden],
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-notifications-btn[hidden],
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-airspace-mode-btn[hidden],
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-notams-btn[hidden],
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-status-btn[hidden] {
  display: none !important;
}

#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-airfields-btn .filter-btn-icon,
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-history-btn .filter-btn-icon,
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-signin-btn .filter-btn-icon,
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-notifications-btn .filter-btn-icon,
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-layers-btn .filter-btn-icon,
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-airspace-mode-btn .filter-btn-icon,
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-notams-btn .filter-btn-icon,
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-debug-logs-btn .filter-btn-icon,
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-ui-update-btn .filter-btn-icon,
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-toolbar-ar-btn .filter-btn-icon,
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-status-btn .filter-btn-icon {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-airfields-btn .filter-btn-icon svg,
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-history-btn .filter-btn-icon svg,
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-signin-btn .filter-btn-icon svg,
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-notifications-btn .filter-btn-icon svg,
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-layers-btn .filter-btn-icon svg,
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-airspace-mode-btn .filter-btn-icon svg,
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-notams-btn .filter-btn-icon svg,
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-debug-logs-btn .filter-btn-icon svg,
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-ui-update-btn .filter-btn-icon svg,
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-toolbar-ar-btn .filter-btn-icon svg,
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-status-btn .filter-btn-icon svg {
  width: 18px;
  height: 18px;
}

#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-airfields-btn .filter-btn-text,
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-airspace-mode-btn .filter-btn-text,
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-notams-btn .filter-btn-text {
  display: none;
}

#inhouse-map-panel .inhouse-map-overlay-controls-right .airfields-map-view-toggle {
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  overflow: visible;
}

#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-overlay-account-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-layers-menu {
  position: relative;
  pointer-events: auto;
  flex: 0 0 auto;
  overflow: visible;
}

#inhouse-map-panel .inhouse-map-layers-dropdown {
  position: absolute;
  top: 0;
  right: calc(100% + 6px);
  left: auto;
  z-index: 10025;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0.3rem;
  min-width: 11.75rem;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  pointer-events: auto;
}

#inhouse-map-panel .inhouse-map-layers-dropdown[hidden] {
  display: none !important;
}

#inhouse-map-panel .inhouse-map-layers-dropdown .inhouse-map-layers-item[hidden] {
  display: none !important;
}

#inhouse-map-panel .inhouse-map-layers-dropdown .inhouse-map-layers-item {
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 36px !important;
  margin: 0 !important;
  padding: 0.4rem 0.55rem !important;
  border: none !important;
  border-radius: 4px !important;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  background: transparent;
  color: #e2e8f0;
  font-size: 0.8125rem;
  line-height: 1.2;
  white-space: nowrap;
}

#inhouse-map-panel .inhouse-map-layers-dropdown .inhouse-map-layers-item:hover {
  background: #334155;
  color: #f8fafc;
}

#inhouse-map-panel .inhouse-map-layers-dropdown .inhouse-map-layers-item.active,
#inhouse-map-panel .inhouse-map-layers-dropdown .inhouse-map-layers-item.active:hover {
  background: #3b82f6 !important;
  border-color: #3b82f6 !important;
  color: #f1f5f9 !important;
}

#inhouse-map-panel .inhouse-map-layers-dropdown .inhouse-map-layers-item .filter-btn-icon,
#inhouse-map-panel .inhouse-map-layers-dropdown .inhouse-map-layers-item .map-layer-icon {
  margin: 0;
  display: flex;
  flex: 0 0 18px;
  align-items: center;
  justify-content: center;
}

#inhouse-map-panel .inhouse-map-layers-dropdown .inhouse-map-layers-item .filter-btn-icon svg,
#inhouse-map-panel .inhouse-map-layers-dropdown .inhouse-map-layers-item .map-layer-icon svg {
  width: 18px;
  height: 18px;
}

#inhouse-map-panel .inhouse-map-layers-dropdown .inhouse-map-layers-item-label {
  flex: 1 1 auto;
}

#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-signin-btn .filter-btn-icon[hidden] {
  display: none !important;
}

#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-signin-btn.signed-in {
  color: #86efac;
  border-color: #22c55e;
}

#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-notifications-btn {
  position: relative;
}

#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-notifications-btn .notifications-bell-badge {
  top: 2px;
  right: 2px;
  width: 0.4rem;
  height: 0.4rem;
  box-shadow: 0 0 0 1px #1e293b;
}

/* Layers menu + radar/transparency: blue highlight when active */
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-layers-btn.active,
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-radar-btn.active {
  background: #3b82f6 !important;
  border-color: #3b82f6 !important;
  color: #f1f5f9 !important;
}
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-layers-btn.active:hover,
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-radar-btn.active:hover {
  background: #2563eb !important;
  border-color: #2563eb !important;
}

#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-debug-logs-btn.active {
  background: #b45309 !important;
  border-color: #b45309 !important;
  color: #fef3c7 !important;
}
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-debug-logs-btn.active:hover {
  background: #92400e !important;
  border-color: #92400e !important;
}

/* display:flex on the map button overrides the UA [hidden] rule */
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-debug-logs-btn[hidden],
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-ui-update-btn[hidden] {
  display: none !important;
}

#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-ui-update-btn {
  background: #b45309 !important;
  border-color: #b45309 !important;
  color: #fef3c7 !important;
}
#inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-ui-update-btn:hover {
  background: #92400e !important;
  border-color: #92400e !important;
}

#inhouse-map-panel .inhouse-map-debug-logs-panel {
  position: absolute;
  left: 10px;
  right: auto;
  top: auto;
  bottom: calc(2.75rem + env(safe-area-inset-bottom, 0px));
  z-index: 10020;
  pointer-events: auto;
  width: min(26rem, calc(100% - 1.25rem));
  max-width: 26rem;
  padding: 0.5rem 0.65rem;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid #334155;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: #e2e8f0;
  font-size: 0.8rem;
}

#inhouse-map-panel .inhouse-map-debug-logs-panel[hidden] {
  display: none !important;
}

#inhouse-map-panel .inhouse-map-debug-logs-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  cursor: grab;
  user-select: none;
  touch-action: none;
  padding-bottom: 0.15rem;
  border-bottom: 1px solid #334155;
  margin-bottom: 0.1rem;
}

#inhouse-map-panel .inhouse-map-debug-logs-panel-header:active {
  cursor: grabbing;
}

#inhouse-map-panel .inhouse-map-debug-logs-panel-title {
  font-weight: 600;
  color: #f8fafc;
}

#inhouse-map-panel .inhouse-map-debug-logs-panel-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

#inhouse-map-panel .inhouse-map-debug-logs-action-btn {
  cursor: pointer;
  appearance: none;
  border: 1px solid #475569;
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  line-height: 1.3;
}

#inhouse-map-panel .inhouse-map-debug-logs-action-btn:hover {
  background: #334155;
}

#inhouse-map-panel .inhouse-map-debug-logs-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  user-select: none;
}

#inhouse-map-panel .inhouse-map-debug-logs-item input {
  margin: 0;
}

#inhouse-map-panel .inhouse-map-debug-logs-output {
  margin: 0.25rem 0 0;
  padding: 0.4rem 0.45rem;
  max-height: 12rem;
  overflow: auto;
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: 4px;
  color: #94a3b8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.68rem;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
  user-select: text;
  cursor: text;
}

#inhouse-map-panel .inhouse-map-overlay-controls-right .airfields-map-view-toggle {
  display: flex;
}

.inhouse-map-airfield-label-marker {
  background: none !important;
  border: none !important;
  cursor: pointer;
}

.inhouse-chart-click-cross {
  background: none !important;
  border: none !important;
}
.inhouse-chart-click-cross-inner {
  display: block;
  width: 24px;
  height: 24px;
  position: relative;
  box-sizing: border-box;
}
.inhouse-chart-click-cross-inner::before,
.inhouse-chart-click-cross-inner::after {
  content: '';
  position: absolute;
  background: #0ea5e9;
  box-shadow: 0 0 0 1px #fff;
}
.inhouse-chart-click-cross-inner::before {
  left: 50%;
  top: 0;
  width: 2px;
  height: 24px;
  margin-left: -1px;
}
.inhouse-chart-click-cross-inner::after {
  top: 50%;
  left: 0;
  width: 24px;
  height: 2px;
  margin-top: -1px;
}

.inhouse-map-airfield-label {
  display: inline-block;
  padding: 0.15rem 0.35rem;
  font-size: 0.65rem;
  font-weight: 600;
  color: #f1f5f9;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(59, 130, 246, 0.6);
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.inhouse-map-aircraft-label-marker {
  background: none !important;
  border: none !important;
  pointer-events: auto;
  cursor: pointer;
}

.inhouse-map-aircraft-label {
  display: inline-block;
  padding: 0.15rem 0.35rem;
  font-size: 0.65rem;
  font-weight: 600;
  color: #f1f5f9;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: auto;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Favourite gliders: same label text/size as normal boxes; heart is a
   background shape only, so the aircraft name is never clipped. */
.inhouse-map-aircraft-label-favourite {
  position: relative;
  z-index: 0;
  padding: 0.28rem 0.55rem 0.4rem;
  color: #fff;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
}

.inhouse-map-aircraft-label-favourite::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--aircraft-heart-fill);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 56'%3E%3Cpath d='M32 53 C27 47 4 32 4 17 C4 4 21 -1 32 12 C43 -1 60 4 60 17 C60 32 37 47 32 53 Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 56'%3E%3Cpath d='M32 53 C27 47 4 32 4 17 C4 4 21 -1 32 12 C43 -1 60 4 60 17 C60 32 37 47 32 53 Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  filter:
    drop-shadow(0 0 0.6px var(--aircraft-heart-stroke))
    drop-shadow(0 0 0.6px var(--aircraft-heart-stroke))
    drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
  pointer-events: none;
}

.inhouse-map-aircraft-label-airborne {
  background: rgba(59, 130, 246, 0.85);
}

.inhouse-map-aircraft-label-ground {
  background: rgba(34, 197, 94, 0.85);
}

.inhouse-map-aircraft-label-landout-glider {
  background: rgba(220, 38, 38, 0.92) !important;
  color: #fff;
}

.inhouse-map-aircraft-label-landout-other {
  background: rgba(22, 163, 74, 0.92) !important;
  border: 2px solid rgba(220, 38, 38, 0.98);
  color: #fff;
}

/* Aircraft on aerotow: same amber fill; tug distinguished by blue border (not landout red) */
.inhouse-map-aircraft-label-tow-glider {
  background: rgba(251, 191, 36, 0.92);
}

.inhouse-map-aircraft-label-tow-tug {
  background: rgba(251, 191, 36, 0.92);
  border: 2px solid rgba(59, 130, 246, 0.98);
}

.inhouse-map-aircraft-label-colour-by-airfield {
  color: #fff;
}

.inhouse-map-aircraft-label-colour-by-altitude {
  border: 1px solid rgba(15, 23, 42, 0.35);
}

.inhouse-map-aircraft-label-colour-landout {
  border: 2px solid rgba(220, 38, 38, 0.98) !important;
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.35), 0 1px 3px rgba(0, 0, 0, 0.3);
}

.inhouse-map-aircraft-label-colour-tow-tug {
  border: 2px solid rgba(59, 130, 246, 0.98) !important;
}

.inhouse-map-airfield-filter-swatch {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 3px;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.inhouse-map-airfield-filter-swatch-empty {
  visibility: hidden;
  box-shadow: none;
}

/* Selected: keep airborne/ground background; add ring so selection is clear */
.inhouse-map-aircraft-label-highlight {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #f59e0b;
  outline: none;
}

/* Selected aircraft: device compass within ±5° (blue) or ±2° (green) of bearing to glider. */
.inhouse-map-aircraft-label-facing-near {
  background: rgba(37, 99, 235, 0.95) !important;
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.85) !important;
}

.inhouse-map-aircraft-label-facing-on {
  background: rgba(22, 163, 74, 0.95) !important;
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.85) !important;
}

.inhouse-map-aircraft-label-favourite.inhouse-map-aircraft-label-highlight {
  border-radius: 50%;
}

.inhouse-map-aircraft-label-inactive {
  opacity: 0.65;
}

.aircraft-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Left column: Aircraft heading + filter row (airfield/type/search). Keep min-width so filters stay visible in standard view. */
.aircraft-heading-left {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  min-width: 0; /* allow shrink for wrapping; actual minimum comes from .aircraft-heading-controls */
}

.aircraft-heading-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  width: 100%;
  min-width: 20rem; /* keep airfield + type filters and search visible in standard (desktop) view */
}

.aircraft-section h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

.aircraft-filters-and-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex-shrink: 0; /* keep airfield/type filters and search visible */
}

.aircraft-filters-and-search .aircraft-search-wrap {
  margin-bottom: 0;
}

.aircraft-controls-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.aircraft-search-wrap {
  margin-bottom: 1rem;
  position: relative;
  display: inline-block;
}

.aircraft-search-input {
  width: 100%;
  max-width: 400px;
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: #e2e8f0;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.375rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.aircraft-search-clear {
  position: absolute;
  right: 0.375rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  font-size: 1.25rem;
  line-height: 1;
  color: #94a3b8;
  background: transparent;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.aircraft-search-clear:hover {
  color: #e2e8f0;
  background: rgba(51, 65, 85, 0.8);
}
.aircraft-search-clear[hidden] {
  display: none;
}
.aircraft-search-clear:not([hidden]) {
  display: flex;
}

.aircraft-search-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.aircraft-search-input.aircraft-search-active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #f1f5f9;
  caret-color: #f8fafc;
}
.aircraft-search-input.aircraft-search-active:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.25);
}
.aircraft-search-wrap:has(.aircraft-search-active) .aircraft-search-clear {
  color: #f1f5f9;
}
.aircraft-search-wrap:has(.aircraft-search-active) .aircraft-search-clear:hover {
  color: #fff;
  background: rgba(37, 99, 235, 0.9);
}

.aircraft-search-input::placeholder {
  color: #64748b;
}

.search-typeahead-dropdown {
  position: absolute;
  left: 0;
  top: 100%;
  width: 100%;
  max-height: 240px;
  overflow-y: auto;
  margin-top: 2px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.375rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  z-index: 1000;
}

.search-typeahead-item {
  padding: 0.4rem 0.75rem;
  font-size: 0.9rem;
  color: #e2e8f0;
  cursor: pointer;
}

.search-typeahead-item:hover,
.search-typeahead-item.search-typeahead-item-highlighted {
  background: rgba(51, 65, 85, 0.9);
  color: #f1f5f9;
}

.aircraft-count {
  font-size: 0.9rem;
  font-weight: 400;
  color: #94a3b8;
  margin-left: 0.5rem;
  word-break: break-word;
}

.aircraft-count.error-indicator {
  color: #f87171;
  font-weight: 500;
}

.aircraft-count.error-indicator::after {
  content: ' ⚠';
  opacity: 0.8;
}

/* Status panel: refresh info (handled by .status-refresh-info in .status-header) */
#status-panel .status-refresh-info {
  margin-top: 0;
}

.aircraft-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #cbd5e1;
  margin-bottom: 0.75rem;
  cursor: pointer;
}

.aircraft-filter input {
  cursor: pointer;
}

.aircraft-filter-select {
  margin-left: 0.5rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.9rem;
  background: #1e293b;
  color: #f1f5f9;
  border: 1px solid #475569;
  border-radius: 4px;
  cursor: pointer;
}

.aircraft-filter-select:hover,
.aircraft-filter-select:focus {
  border-color: #64748b;
  outline: none;
}

.aircraft-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.aircraft-type-filters {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.type-filter-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #334155;
}

.type-filter-favourites-only {
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #334155;
}

.type-filter-action-btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  background: rgba(51, 65, 85, 0.8);
  border: 1px solid #475569;
  border-radius: 0.25rem;
  color: #94a3b8;
  cursor: pointer;
}

.type-filter-action-btn:hover {
  color: #e2e8f0;
  background: rgba(71, 85, 105, 0.8);
}

.filter-panel-actions {
  display: flex;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.filter-panel-zoom-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
  background: rgba(51, 65, 85, 0.8);
  border: 1px solid #475569;
  border-radius: 0.25rem;
  color: #94a3b8;
  cursor: pointer;
}

.filter-panel-zoom-btn:hover {
  color: #e2e8f0;
  background: rgba(71, 85, 105, 0.8);
}

.filter-panel-zoom-btn .filter-btn-icon {
  display: inline-flex;
}

.filter-panel-zoom-btn .filter-btn-icon svg {
  width: 18px;
  height: 18px;
}

.filter-panel-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
  flex-wrap: nowrap;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.filter-panel-heading-row .columns-panel-heading {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-panel-heading-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.filter-panel-heading-btn {
  box-sizing: border-box;
  width: auto;
  min-width: 0;
  height: 24px;
  min-height: 24px;
  padding: 0 0.5rem;
  font-size: 0.8rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Fixed pixel size so zoom/font scaling doesn't make button wrap under heading */
.filter-panel-zoom-btn-icon-only {
  flex-shrink: 0;
  width: 24px;
  min-width: 24px;
  height: 24px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.filter-panel-zoom-btn-icon-only .filter-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.filter-panel-zoom-btn-icon-only .filter-btn-icon svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.type-filter-panel .aircraft-type-filters {
  min-width: 180px;
}

#inhouse-map-panel .inhouse-map-type-filter-extra-options {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.aircraft-type-filter-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: #cbd5e1;
  cursor: pointer;
}

/* Author display:flex above beats the UA [hidden] rule — keep intentionally-hidden items hidden. */
.aircraft-type-filter-item[hidden] {
  display: none !important;
}

.aircraft-type-filter-item input[type="checkbox"],
.aircraft-type-filter-item input[type="radio"] {
  cursor: pointer;
  width: 1rem;
  height: 1rem;
  accent-color: #3b82f6;
}

.inhouse-map-airfield-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 1.65rem;
}

#inhouse-map-panel .inhouse-map-competition-filter-group {
  margin-bottom: 0.55rem;
}

#inhouse-map-panel .inhouse-map-competition-filter-group:last-child {
  margin-bottom: 0;
}

#inhouse-map-panel .inhouse-map-competition-filter-group-heading {
  font-size: 0.78rem;
  font-weight: 600;
  color: #cbd5e1;
  padding: 0.2rem 0.15rem 0.35rem;
  line-height: 1.3;
}

#inhouse-map-panel .inhouse-map-competition-filter-child {
  padding-left: 0.65rem;
}

.inhouse-map-airfield-filter-row-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.inhouse-map-airfield-zoom-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  padding: 0;
  background: rgba(51, 65, 85, 0.55);
  border: 1px solid #475569;
  border-radius: 0.3rem;
  color: #94a3b8;
  cursor: pointer;
}

.inhouse-map-airfield-zoom-btn:hover {
  color: #e2e8f0;
  background: rgba(71, 85, 105, 0.6);
}

.inhouse-map-airfield-log-btn {
  margin-left: 0;
  padding: 0.2rem 0.5rem;
  background: rgba(51, 65, 85, 0.55);
  border: 1px solid #475569;
  border-radius: 0.3rem;
  color: #cbd5e1;
  font-size: 0.78rem;
  line-height: 1.2;
  cursor: pointer;
}

.inhouse-map-airfield-log-btn:hover {
  background: rgba(71, 85, 105, 0.6);
}

.aircraft-table-controls {
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
}

.flyout-wrap {
  position: relative;
}

.columns-toggle-btn {
  padding: 0.4rem 0.75rem;
  font-size: 0.9rem;
  background: rgba(51, 65, 85, 0.6);
  border: 1px solid #475569;
  border-radius: 0.375rem;
  color: #cbd5e1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.filter-btn-icon-only .filter-btn-text {
  display: none;
}

.filter-btn-icon-only .filter-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.filter-btn-icon-only .filter-btn-icon svg {
  flex-shrink: 0;
}

/* Icon-only buttons: compact */
.filter-btn-icon-only {
  padding: 0.4rem;
  min-width: 36px;
  min-height: 36px;
}

.columns-toggle-btn:hover {
  background: rgba(51, 65, 85, 0.9);
}

#type-filter-toggle-btn.type-filter-active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #f1f5f9;
}
#type-filter-toggle-btn.type-filter-active:hover {
  background: #2563eb;
  border-color: #2563eb;
}

#primary-airfield-toggle-btn.primary-airfield-filter-active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #f1f5f9;
}
#primary-airfield-toggle-btn.primary-airfield-filter-active:hover {
  background: #2563eb;
  border-color: #2563eb;
}

#inhouse-map-airfield-filter-btn.inhouse-map-airfield-filter-active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #f1f5f9;
}
#inhouse-map-airfield-filter-btn.inhouse-map-airfield-filter-active:hover {
  background: #2563eb;
  border-color: #2563eb;
}

/* Override overlay button base styles when airfield filter is active (same as aircraft tab) */
#inhouse-map-panel .inhouse-map-overlay-controls #inhouse-map-airfield-filter-btn.inhouse-map-airfield-filter-active {
  background: #3b82f6 !important;
  border-color: #3b82f6 !important;
  color: #f1f5f9 !important;
}
#inhouse-map-panel .inhouse-map-overlay-controls #inhouse-map-airfield-filter-btn.inhouse-map-airfield-filter-active:hover {
  background: #2563eb !important;
  border-color: #2563eb !important;
}

#inhouse-map-type-filter-btn.inhouse-map-type-filter-active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #f1f5f9;
}
#inhouse-map-type-filter-btn.inhouse-map-type-filter-active:hover {
  background: #2563eb;
  border-color: #2563eb;
}

/* Override overlay button base styles when type filter is active (same as aircraft tab) */
#inhouse-map-panel .inhouse-map-overlay-controls #inhouse-map-type-filter-btn.inhouse-map-type-filter-active {
  background: #3b82f6 !important;
  border-color: #3b82f6 !important;
  color: #f1f5f9 !important;
}
#inhouse-map-panel .inhouse-map-overlay-controls #inhouse-map-type-filter-btn.inhouse-map-type-filter-active:hover {
  background: #2563eb !important;
  border-color: #2563eb !important;
}

/* Favourites-only / competition mode: type/airfield filters are unused — disabled look, but keep active tint if a filter is set. */
#inhouse-map-panel .inhouse-map-overlay-controls #inhouse-map-type-filter-btn:disabled,
#inhouse-map-panel .inhouse-map-overlay-controls #inhouse-map-airfield-filter-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}
#inhouse-map-panel .inhouse-map-overlay-controls #inhouse-map-type-filter-btn:disabled.inhouse-map-type-filter-active,
#inhouse-map-panel .inhouse-map-overlay-controls #inhouse-map-airfield-filter-btn:disabled.inhouse-map-airfield-filter-active {
  background: #64748b !important;
  border-color: #64748b !important;
  color: #e2e8f0 !important;
  opacity: 0.55;
}
#inhouse-map-panel .inhouse-map-overlay-controls #inhouse-map-type-filter-btn:disabled.inhouse-map-type-filter-active:hover,
#inhouse-map-panel .inhouse-map-overlay-controls #inhouse-map-airfield-filter-btn:disabled.inhouse-map-airfield-filter-active:hover {
  background: #64748b !important;
  border-color: #64748b !important;
}

/* Map overlay transparency (aircraft/airfield selectors), same idea as flight plot modal */
#inhouse-map-panel.map-overlay-transparent .inhouse-map-overlay-controls,
#inhouse-map-panel.map-overlay-transparent .inhouse-map-overlay-controls-right,
#inhouse-map-panel.map-overlay-transparent .inhouse-map-selection-status {
  opacity: 0.5;
  transition: opacity 0.2s;
}
#inhouse-map-panel.map-overlay-transparent #inhouse-map-airfield-filter-panel,
#inhouse-map-panel.map-overlay-transparent #inhouse-map-type-filter-panel,
#inhouse-map-panel.map-overlay-transparent #inhouse-map-saved-views-panel,
#inhouse-map-panel.map-overlay-transparent #inhouse-map-debug-logs-panel,
#inhouse-map-panel.map-overlay-transparent #inhouse-map-competition-filter-panel,
#inhouse-map-panel.map-overlay-transparent #inhouse-map-competition-aircraft-panel {
  opacity: 0.5;
  transition: opacity 0.2s;
}

.columns-toggle-btn:focus-visible,
.filter-toggle-btn:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.filter-toggle-btn[aria-pressed="true"],
.filter-toggle-btn.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #f1f5f9;
}

.filter-toggle-btn[aria-pressed="true"]:hover,
.filter-toggle-btn.active:hover {
  background: #2563eb;
  border-color: #2563eb;
}

.columns-panel {
  position: absolute;
  top: 100%;
  right: 0;
  left: auto;
  margin-top: 0.25rem;
  padding: 0.75rem;
  min-width: 220px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 50;
}

.columns-panel-heading {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: #f1f5f9;
}

.filter-panel-separator {
  height: 1px;
  background: #334155;
  margin: 0.5rem 0 0.5rem 0;
}

/* Aircraft tab: flyouts are left-aligned, so open panel to the right of the button (not left) */
#aircraft #primary-airfield-panel,
#aircraft #type-filter-panel {
  left: 0;
  right: auto;
}

/* Aircraft tab filter panels: match map panel (override .aircraft-section h2) */
#primary-airfield-panel .columns-panel-heading,
#type-filter-panel .columns-panel-heading {
  font-size: 1rem;
  margin: 0 0 0.75rem;
}
#primary-airfield-panel .aircraft-type-filter-item,
#type-filter-panel .aircraft-type-filter-item {
  font-size: 0.9rem;
}

.columns-panel-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: 280px;
  overflow-y: auto;
  margin-bottom: 0.5rem;
}

.columns-panel-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.columns-panel-drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  margin: -0.25rem 0;
  cursor: grab;
  color: #64748b;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.columns-panel-drag-handle:active {
  cursor: grabbing;
}

.columns-panel-drag-handle:hover {
  color: #94a3b8;
}

.columns-panel-item-dragging {
  opacity: 0.6;
}

.columns-panel-item-drag-over {
  outline: 2px solid #3b82f6;
  outline-offset: -2px;
  border-radius: 0.25rem;
}

.columns-panel-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: #e2e8f0;
  font-size: 0.9rem;
  flex: 1;
  min-width: 0;
}

.columns-panel-check {
  flex-shrink: 0;
}

.columns-panel-move {
  display: flex;
  gap: 0.15rem;
}

.columns-move-btn {
  padding: 0.2rem 0.4rem;
  font-size: 0.8rem;
  background: rgba(51, 65, 85, 0.8);
  border: 1px solid #475569;
  border-radius: 0.25rem;
  color: #94a3b8;
  cursor: pointer;
}

.columns-move-btn:hover:not(:disabled) {
  color: #e2e8f0;
  background: rgba(71, 85, 105, 0.8);
}

.columns-move-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.columns-reset-btn {
  display: block;
  width: 100%;
  padding: 0.4rem;
  font-size: 0.85rem;
  background: transparent;
  border: 1px solid #475569;
  border-radius: 0.375rem;
  color: #94a3b8;
  cursor: pointer;
}

.columns-reset-btn:hover {
  color: #e2e8f0;
  background: rgba(51, 65, 85, 0.5);
}

.aircraft-table-wrap {
  overflow-x: auto;
}

.aircraft-table {
  width: 100%;
  border-collapse: collapse;
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, monospace;
  font-size: 0.85rem;
}

.aircraft-table th,
.aircraft-table td {
  padding: 0.35rem 0.75rem;
  border: 1px solid #334155;
  text-align: left;
  white-space: nowrap;
}

.aircraft-table th {
  background: #1e293b;
  color: #cbd5e1;
  font-weight: 600;
}

.aircraft-table th.sortable {
  cursor: pointer;
  user-select: none;
}

.aircraft-table th.sortable:hover {
  color: #f1f5f9;
}

.aircraft-table tbody tr:nth-child(even) {
  background: rgba(30, 41, 59, 0.4);
}

.aircraft-table-empty-message {
  text-align: center;
  color: #94a3b8;
  padding: 1.5rem 0.75rem !important;
  white-space: normal;
}

.aircraft-table td.num {
  text-align: right;
}

.aircraft-table td.flight-count-clickable {
  cursor: pointer;
  position: relative;
}

.aircraft-table td.flight-count-clickable:hover {
  background: rgba(59, 130, 246, 0.15);
  text-decoration: underline;
}

/* Confirm modal (e.g. Reset today's data) */
.confirm-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 11050;
}

.confirm-modal[hidden] {
  display: none !important;
}

.confirm-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.confirm-modal-content {
  position: relative;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  padding: 1.25rem 1.5rem;
  max-width: 420px;
  width: 90%;
}

.confirm-modal-title {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #f1f5f9;
}

.confirm-modal-message {
  margin: 0 0 1.25rem 0;
  font-size: 0.95rem;
  color: #94a3b8;
  line-height: 1.45;
}

.confirm-modal-message[hidden] {
  display: none !important;
}

.confirm-modal-input {
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin: 0 0 1.25rem 0;
  appearance: none;
  border: 1px solid #475569;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 0.375rem;
  font-size: 0.95rem;
  font-family: inherit;
  padding: 0.45rem 0.6rem;
}

.confirm-modal-input[hidden] {
  display: none !important;
}

.confirm-modal-input:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 1px;
}

.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.confirm-modal-btn {
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  border: 1px solid transparent;
}

.confirm-modal-cancel {
  background: rgba(51, 65, 85, 0.6);
  border-color: #475569;
  color: #e2e8f0;
}

.confirm-modal-cancel:hover {
  background: rgba(51, 65, 85, 0.9);
}

.confirm-modal-confirm {
  background: rgba(220, 38, 38, 0.25);
  border-color: rgba(220, 38, 38, 0.5);
  color: #fca5a5;
}

.confirm-modal-confirm:hover {
  background: rgba(220, 38, 38, 0.4);
}

.confirm-modal-btn:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.confirm-modal-confirm:focus-visible {
  outline-color: #dc2626;
}

.confirm-modal-confirm--primary {
  background: rgba(37, 99, 235, 0.3);
  border-color: rgba(59, 130, 246, 0.5);
  color: #93c5fd;
}

.confirm-modal-confirm--primary:hover {
  background: rgba(37, 99, 235, 0.45);
}

.confirm-modal-confirm--primary:focus-visible {
  outline-color: #3b82f6;
}

.airspace-lookup-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 21050;
}

.airspace-lookup-modal[hidden] {
  display: none !important;
}

.airspace-lookup-modal--float {
  inset: auto;
  right: 12px;
  bottom: 16px;
  align-items: stretch;
  justify-content: flex-start;
  pointer-events: none;
  z-index: 10040;
}

.airspace-lookup-modal--float .airspace-lookup-modal-backdrop {
  display: none;
}

.airspace-lookup-modal--float .airspace-lookup-modal-content {
  pointer-events: auto;
  position: relative;
  width: 400px;
  height: 340px;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 16px);
  overflow: hidden;
}

.airspace-lookup-modal--float .airspace-lookup-modal-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.airspace-lookup-modal--float .airspace-lookup-layout {
  height: 100%;
  min-height: 0;
  align-items: stretch;
}

.airspace-lookup-modal--float .airspace-lookup-stack {
  height: 100%;
  min-height: 0;
  align-self: stretch;
}

.airspace-lookup-modal--float .airspace-lookup-list {
  min-height: 0;
  overflow: auto;
}

.airspace-lookup-resize-handle {
  display: none;
}

.airspace-lookup-modal--float .airspace-lookup-resize-handle {
  display: block;
  position: absolute;
  bottom: 0;
  right: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, rgba(51, 65, 85, 0.8) 50%);
  border-radius: 0 0 0.25rem 0;
}

.airspace-lookup-modal--float .airspace-lookup-resize-handle:hover {
  background: linear-gradient(135deg, transparent 50%, rgba(71, 85, 105, 0.9) 50%);
}

.airspace-lookup-modal--float .airspace-lookup-modal-header {
  cursor: move;
  user-select: none;
  touch-action: none;
  align-items: center;
}

.airspace-lookup-modal--float .airspace-lookup-modal-close,
.airspace-lookup-modal--float .airspace-lookup-modal-btn {
  cursor: pointer;
}

.airspace-lookup-modal-header-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.airspace-lookup-modal-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.15rem;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.airspace-lookup-modal-btn:hover {
  background: rgba(148, 163, 184, 0.15);
  color: #e2e8f0;
}

.airspace-lookup-collapse-icon {
  display: block;
}

.airspace-lookup-modal--collapsed .airspace-lookup-collapse-icon {
  transform: rotate(180deg);
}

.airspace-lookup-modal--collapsed .airspace-lookup-list {
  display: none !important;
}

.airspace-lookup-modal--collapsed .airspace-lookup-layout {
  grid-template-columns: 1fr;
  gap: 0;
}

.airspace-lookup-modal--collapsed .airspace-lookup-stack {
  width: 100% !important;
}

.airspace-lookup-modal--float.airspace-lookup-modal--collapsed .airspace-lookup-modal-content {
  width: 132px;
}

body.airspace-mode-active #inhouse-map {
  cursor: crosshair;
}

.airspace-lookup-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.airspace-lookup-modal-content {
  position: relative;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  width: min(440px, 92vw);
  max-height: min(80vh, 640px);
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.airspace-lookup-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-bottom: 1px solid #334155;
  flex-shrink: 0;
}

.airspace-lookup-modal-heading {
  min-width: 0;
}

.airspace-lookup-modal-title {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: #e2e8f0;
}

.airspace-lookup-modal-close {
  appearance: none;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 1.1rem;
  line-height: 1;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  border-radius: 0.25rem;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.airspace-lookup-modal-close:hover {
  background: rgba(148, 163, 184, 0.15);
  color: #e2e8f0;
}

.airspace-lookup-modal-body {
  padding: 0.85rem 1rem 1rem;
  overflow: hidden;
  min-height: 4rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.airspace-lookup-status {
  margin: 0;
  color: #94a3b8;
  font-size: 0.92rem;
  line-height: 1.45;
  flex-shrink: 0;
}

.airspace-lookup-layout {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 0.75rem;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

.airspace-lookup-stack {
  position: relative;
  min-height: 220px;
  height: 100%;
  border-radius: 0.4rem;
  background: #0f172a;
  border: 1px solid #334155;
  overflow: hidden;
}

.airspace-lookup-stack-plot {
  position: absolute;
  inset: 16px 4px 16px 6px;
}

.airspace-lookup-stack-band {
  position: absolute;
  border-radius: 2px;
  opacity: 0.9;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-sizing: border-box;
}

.airspace-lookup-stack-tick {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  pointer-events: none;
}

.airspace-lookup-stack-rule {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--airspace-bars-width, 18px);
  height: 1px;
  background: rgba(226, 232, 240, 0.7);
}

.airspace-lookup-stack-tick span {
  position: absolute;
  left: calc(var(--airspace-bars-width, 18px) + 6px);
  right: 0;
  top: 0;
  transform: translateY(-50%);
  font-size: 0.6rem;
  line-height: 1.15;
  color: #e2e8f0;
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.95);
}

.airspace-lookup-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 0;
  max-height: 100%;
  overflow: auto;
}

.airspace-lookup-item {
  display: grid;
  grid-template-columns: 6px 1fr;
  gap: 0.55rem;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid #334155;
  border-radius: 0.4rem;
  padding: 0.5rem 0.6rem;
}

.airspace-lookup-item-swatch {
  border-radius: 99px;
}

.airspace-lookup-item-name {
  font-weight: 600;
  color: #f8fafc;
  font-size: 0.88rem;
  line-height: 1.3;
}

.airspace-lookup-item-meta {
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: #94a3b8;
}

.airspace-lookup-item-limits {
  margin-top: 0.28rem;
  font-size: 0.8rem;
  color: #e2e8f0;
  font-variant-numeric: tabular-nums;
}

.airspace-lookup-class {
  display: inline-block;
  min-width: 1.15rem;
  padding: 0 0.28rem;
  border-radius: 0.25rem;
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  font-weight: 700;
  text-align: center;
}

#inhouse-map {
  -webkit-touch-callout: none;
}

/* Airfield webcam popup */
.airfield-webcam-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
}
.airfield-webcam-modal[hidden] {
  display: none !important;
}
.airfield-webcam-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}
.airfield-webcam-modal-content {
  position: relative;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  padding: 1rem 1.25rem 1.25rem;
  max-width: min(960px, 94vw);
  max-height: min(90vh, 900px);
  width: 100%;
  overflow: auto;
}
.airfield-webcam-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.airfield-webcam-modal-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #f1f5f9;
}
.airfield-webcam-modal-close {
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}
.airfield-webcam-modal-close:hover {
  color: #f1f5f9;
  background: #334155;
}
.airfield-webcam-modal-club {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
}
.airfield-webcam-modal-club a {
  color: #38bdf8;
  text-decoration: none;
}
.airfield-webcam-modal-club a:hover {
  text-decoration: underline;
}
.airfield-webcam-modal-images {
  display: grid;
  gap: 0.75rem;
}
.airfield-webcam-modal-empty {
  margin: 0;
  color: #94a3b8;
  font-size: 0.9rem;
}
.airfield-webcam-modal-figure {
  margin: 0;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 0.35rem;
  overflow: hidden;
}
.airfield-webcam-modal-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.competition-edit-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.competition-edit-modal[hidden] {
  display: none !important;
}

.competition-edit-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
}

.competition-edit-modal-content {
  position: relative;
  z-index: 1;
  width: min(52rem, 100%);
  max-height: min(90vh, 48rem);
  overflow: auto;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  padding: 1rem 1.1rem 1.1rem;
  color: #e2e8f0;
}

.competition-edit-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.competition-edit-modal-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #f8fafc;
}

.competition-edit-modal-close {
  appearance: none;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.4rem;
}

.competition-edit-modal-close:hover {
  color: #f8fafc;
}

.competition-edit-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.competition-edit-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.5rem 0.75rem;
}

.competition-edit-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.75rem;
  color: #94a3b8;
}

.competition-edit-field input,
.competition-edit-tp-row input,
.competition-edit-tp-row select {
  appearance: none;
  font: inherit;
  font-size: 0.82rem;
  color: #e2e8f0;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 0.375rem;
  padding: 0.35rem 0.45rem;
}

.competition-edit-field input:focus,
.competition-edit-tp-row input:focus,
.competition-edit-tp-row select:focus {
  outline: none;
  border-color: #3b82f6;
}

.competition-edit-field input[readonly] {
  opacity: 0.75;
  cursor: default;
}

.competition-edit-tp-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.competition-edit-tp-heading {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #f1f5f9;
}

.competition-edit-tp-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: min(50vh, 28rem);
  overflow: auto;
  padding-right: 0.15rem;
}

.competition-edit-tp-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem;
  padding: 0.55rem;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 0.4rem;
}

.competition-edit-tp-row-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.competition-edit-tp-row-top input[data-field="code"] {
  width: 4.5rem;
  text-transform: uppercase;
}

.competition-edit-tp-row-top input[data-field="name"] {
  flex: 1 1 8rem;
  min-width: 6rem;
}

.competition-edit-tp-row-top input[data-field="lat"],
.competition-edit-tp-row-top input[data-field="lng"] {
  width: 6.5rem;
}

.competition-edit-tp-oz {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.competition-edit-tp-oz select,
.competition-edit-tp-oz input {
  width: auto;
  min-width: 4.5rem;
}

.competition-edit-tp-oz input[data-field="radiusM"],
.competition-edit-tp-oz input[data-field="innerRadiusM"],
.competition-edit-tp-oz input[data-field="angleDeg"] {
  width: 5rem;
}

.competition-edit-tp-actions {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
}

.competition-edit-tp-actions button {
  appearance: none;
  border: 1px solid #475569;
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 0.3rem;
  font-size: 0.72rem;
  padding: 0.2rem 0.4rem;
  cursor: pointer;
}

.competition-edit-tp-actions button:hover {
  background: #334155;
}

.competition-edit-status {
  margin: 0;
  min-height: 1.1em;
  font-size: 0.8rem;
  color: #94a3b8;
}

.competition-edit-status.is-error {
  color: #f87171;
}

.competition-edit-status.is-ok {
  color: #4ade80;
}

.competition-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding-top: 0.25rem;
}

/* Toast notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  padding: 0.75rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: #f1f5f9;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  animation: toast-in 0.25s ease-out;
  pointer-events: auto;
  max-width: min(420px, calc(100vw - 2rem));
}

.toast--success {
  background: rgba(34, 197, 94, 0.95);
  border-color: rgba(74, 222, 128, 0.4);
}

.toast--error {
  background: rgba(220, 38, 38, 0.95);
  border-color: rgba(248, 113, 113, 0.4);
}

.toast--info {
  background: rgba(51, 65, 85, 0.96);
  border-color: rgba(148, 163, 184, 0.45);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(0.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toast.toast--out {
  animation: toast-out 0.2s ease-in forwards;
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-0.25rem);
  }
}

/* Simplified flight plot modal: movable, resizable, bottom-right, 3:2 ratio */
.flight-plot-modal {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10000;
  pointer-events: none;
}

.flight-plot-modal[hidden] {
  display: none !important;
}

.flight-plot-modal .flight-plot-modal-content {
  pointer-events: auto;
  width: 252px;
  height: 168px;
  min-width: 140px;
  min-height: 98px;
  max-width: 90vw;
  max-height: 60vh;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  position: relative;
}

.flight-plot-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.2rem 0.5rem;
  border-bottom: 1px solid #334155;
  cursor: move;
  user-select: none;
  flex-shrink: 0;
}

.flight-plot-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.flight-plot-modal-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #e2e8f0;
}

.flight-plot-modal-corrupt-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  min-width: 6px;
  min-height: 6px;
  border-radius: 50%;
  background: #f59e0b;
  vertical-align: middle;
}

.flight-plot-modal-corrupt-dot.flight-plot-modal-suspect-dot {
  background: #f59e0b;
}

.flight-plot-modal-corrupt-dot.flight-plot-modal-rejected-dot {
  background: #ef4444;
}

.flight-plot-modal-corrupt-dot.flight-plot-modal-tracking-lost-dot {
  background: #8b5cf6;
}

.flight-plot-modal-corrupt-dot[hidden] {
  display: none;
}

.flight-plot-modal-header-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.flight-plot-modal-btn {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
}

.flight-plot-modal-btn:hover {
  background: rgba(51, 65, 85, 0.8);
  color: #e2e8f0;
}

.flight-plot-modal-favourite-btn-active {
  color: #fb7185;
}

.flight-plot-modal-favourite-btn-active:hover {
  color: #fda4af;
}

.flight-plot-modal-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.flight-plot-modal-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 1.25rem;
  height: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
}

.flight-plot-modal-close:hover {
  background: rgba(51, 65, 85, 0.8);
  color: #e2e8f0;
}

.flight-plot-modal-select-wrap {
  position: relative;
}

.flight-plot-modal-select-panel {
  position: absolute;
  top: 100%;
  right: 0;
  left: auto;
  margin-top: 0.25rem;
  min-width: 200px;
  max-height: 240px;
  z-index: 10001;
}

.flight-plot-modal-select-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 200px;
  overflow-y: auto;
}

.flight-plot-modal-select-item {
  flex-shrink: 0;
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  line-height: 1.35;
  color: #e2e8f0;
  cursor: pointer;
  border-radius: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.flight-plot-modal-select-item:hover {
  background: rgba(51, 65, 85, 0.8);
}

.flight-plot-modal-select-item[aria-selected="true"] {
  background: rgba(59, 130, 246, 0.3);
  color: #93c5fd;
}

.flight-plot-modal-content.opacity-30 {
  opacity: 0.5;
}

.flight-plot-modal-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  position: relative;
  background: #0f172a;
}

.flight-plot-placeholder {
  margin: 0;
  padding: 1rem;
  color: #64748b;
  font-size: 0.875rem;
  text-align: center;
}

.flight-plot-placeholder[hidden],
.flight-plot-canvas[hidden] {
  display: none !important;
}

.flight-plot-canvas {
  display: block;
  flex: 1;
  min-height: 0;
  width: 100%;
  object-fit: contain;
}

.flight-plot-resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, rgba(51, 65, 85, 0.8) 50%);
  border-radius: 0 0 0.25rem 0;
}

.flight-plot-resize-handle:hover {
  background: linear-gradient(135deg, transparent 50%, rgba(71, 85, 105, 0.9) 50%);
}

.aircraft-table tbody td.elapsed-warning {
  background: rgba(251, 146, 60, 0.35);
}

.aircraft-table tbody td.elapsed-stale {
  background: rgba(248, 113, 113, 0.35);
}

.aircraft-table tbody td.row-highlight {
  background: rgba(34, 197, 94, 0.35);
}

.aircraft-table tbody tr.aircraft-list-row-highlight td {
  background: rgba(59, 130, 246, 0.2);
}

.aircraft-table tbody td.primary-airfield-in-flight {
  background: rgba(135, 206, 235, 0.5);
}

.aircraft-table tbody td.active-yes {
  text-align: center;
}

.aircraft-table tbody td.active-no {
  color: transparent;
}

.aircraft-table .aircraft-favourite-cell {
  width: 1%;
  white-space: nowrap;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
  text-align: center;
}

.aircraft-table .aircraft-favourite-btn {
  padding: 0.2rem;
  color: #64748b;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.aircraft-table .aircraft-favourite-btn:hover {
  color: #f472b6;
}
.aircraft-table .aircraft-favourite-btn-active {
  color: #f472b6;
}
.aircraft-table .aircraft-favourite-btn-active:hover {
  color: #ec4899;
}

.aircraft-table .aircraft-favourite-btn svg {
  width: 14px;
  height: 14px;
}

.active-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-sizing: border-box;
  vertical-align: middle;
}

.active-dot-warning {
  background: #f59e0b;
}

.active-dot-stale {
  background: #ef4444;
}

.active-dot-inactive {
  background: transparent;
  border: 1.5px solid #94a3b8;
}

.inhouse-map-selection-status-active-dot {
  margin-left: 0.35rem;
  flex-shrink: 0;
}

.inhouse-map-selection-status-value:has(.inhouse-map-selection-status-active-dot) {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

@keyframes inhouse-map-selection-status-dot-flash {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.8);
  }
  30% {
    transform: scale(1.55);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.45);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 7px rgba(34, 197, 94, 0);
  }
}

@keyframes inhouse-map-selection-status-id-flash {
  0%, 45% {
    background-color: rgba(34, 197, 94, 0.35);
  }
  100% {
    background-color: rgba(34, 197, 94, 0);
  }
}

.inhouse-map-selection-status-active-dot.inhouse-map-selection-status-update-flash {
  animation: inhouse-map-selection-status-dot-flash 1s ease-out;
}

.inhouse-map-selection-status-value.inhouse-map-selection-status-update-flash {
  animation: inhouse-map-selection-status-id-flash 1s ease-out;
  border-radius: 0.2rem;
  padding: 0 0.2rem;
}

.aircraft-table .aircraft-landout-exclaim {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.25rem;
  min-width: 0.95rem;
  height: 0.95rem;
  padding: 0 0.15rem;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1;
  color: #fef2f2;
  background: #b91c1c;
  border-radius: 2px;
  vertical-align: middle;
}

.aircraft-table .aircraft-landout-exclaim-glider {
  background: #b91c1c;
}

.aircraft-table .aircraft-landout-exclaim-other {
  background: #15803d;
  box-shadow: inset 0 0 0 2px #b91c1c;
  color: #fef2f2;
}

.aircraft-table tbody td.active-cell-landout {
  white-space: nowrap;
}

/* ========== Mobile & small screen ========== */
@media (max-width: 768px) {
  body {
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  main {
    padding: 0 0.75rem;
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0));
    min-height: 0;
  }

  /* Map tab has no fixed bottom bar, so no bottom padding needed */
  main:has(#inhouse-map-panel.active) {
    padding-bottom: 0;
  }

  /*
   * Home-screen / standalone PWAs apply a non-zero safe-area-inset-bottom.
   * Keep the selection status fixed to the viewport so overflow:hidden on the
   * map panel cannot clip it, and pad above the home indicator.
   */
  body.map-tab-active .inhouse-map-selection-status {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding-bottom: calc(0.35rem + env(safe-area-inset-bottom, 0px));
    z-index: 10005;
  }

  body.inhouse-ar-mode-active .inhouse-map-selection-status--ar-portaled {
    z-index: 10060;
  }

  /* Stack tab bar (and fixed sign-in / tools inside it) above #inhouse-map-panel + Leaflet; otherwise map paints over the login UI */
  .tabs {
    position: relative;
    z-index: 20000;
    padding: 0;
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tab {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    white-space: nowrap;
    min-height: 44px;
    min-width: 0;
    flex-shrink: 0;
  }

  .tools-tab-wrap {
    margin-left: auto;
  }

  /* Tools menu: fixed on mobile so it isn’t clipped by .tabs overflow-x */
  .tools-menu:not([hidden]) {
    position: fixed;
    top: 52px;
    right: 0.75rem;
    left: auto;
    width: min(180px, calc(100vw - 1.5rem));
    margin-top: 0;
    z-index: 21000;
  }

  /* Sign-in panel: fixed on mobile so it isn’t clipped by .tabs overflow-x */
  .sign-in-panel:not([hidden]) {
    position: fixed;
    inset: 0;
    top: 0;
    left: 0;
    transform: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    margin: 0;
    width: auto;
    max-width: none;
    max-height: none;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    z-index: 21000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .sign-in-panel:not([hidden]) .sign-in-form {
    flex-shrink: 0;
    width: min(360px, calc(100vw - 2rem));
    max-height: calc(100dvh - env(safe-area-inset-top, 0) - env(safe-area-inset-bottom, 0) - 1.5rem);
    overflow-y: auto;
    padding: 1.25rem;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 0.5rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  }

  .tab-panel {
    padding-top: 1rem;
  }

  .tab-panel.active {
    position: relative;
    z-index: 0;
    isolation: isolate;
  }

  .aircraft-heading-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
  }

  .aircraft-section h2 {
    font-size: 1.1rem;
    margin: 0;
  }

  /* Filter bar: fixed at bottom on mobile; scrollable so column selector stays reachable */
  .aircraft-heading-row .aircraft-heading-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.5rem calc(0.5rem + env(safe-area-inset-bottom, 0));
    background: #1e293b;
    border-top: 1px solid #334155;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.3);
    margin: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .aircraft-heading-row .aircraft-heading-controls .aircraft-filters-and-search,
  .aircraft-heading-row .aircraft-heading-controls .aircraft-controls-right {
    flex-shrink: 0;
  }

  .aircraft-heading-row .aircraft-heading-controls .aircraft-search-input {
    max-width: 120px;
  }

  /* Spacer so content isn’t hidden behind fixed filter bar */
  .aircraft-section .aircraft-table-wrap {
    margin-bottom: calc(60px + env(safe-area-inset-bottom, 0));
  }

  .columns-toggle-btn,
  .filter-toggle-btn {
    min-height: 44px;
    min-width: 44px;
    padding: 0.5rem;
    font-size: 0.875rem;
    -webkit-tap-highlight-color: transparent;
    flex: 1;
    max-width: 72px;
  }

  .filter-btn-icon-only .filter-btn-icon svg {
    width: 22px;
    height: 22px;
  }

  .flyout-wrap {
    position: static;
  }

  .columns-panel,
  .type-filter-panel,
  #primary-airfield-panel {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    max-height: 70vh;
    border-radius: 0.5rem 0.5rem 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
    z-index: 100;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  /* Flight plot modal select: keep as dropdown above modal (z-index 10001), not bottom sheet */
  .flight-plot-modal-select-wrap {
    position: relative;
  }
  .flight-plot-modal .flight-plot-modal-select-panel {
    position: absolute !important;
    top: 100% !important;
    bottom: auto !important;
    left: auto !important;
    right: 0 !important;
    margin: 0.25rem 0 0 !important;
    max-height: 240px !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    z-index: 10001 !important;
    padding: 0.5rem !important;
  }

  .type-filter-panel .aircraft-type-filters {
    min-width: 0;
  }

  .aircraft-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -0.75rem;
    padding: 0 0.75rem;
  }

  .aircraft-table {
    font-size: 0.8rem;
    min-width: 600px;
  }

  .aircraft-table th,
  .aircraft-table td {
    padding: 0.5rem 0.5rem;
  }

  .airfields-layout {
    flex-direction: column;
    min-height: 0;
    gap: 1rem;
  }

  .airfields-list-wrap {
    flex: 0 0 auto;
  }

  .airfields-map-wrap {
    min-width: 0;
    min-height: 300px;
  }

  .airfields-map {
    height: 300px;
  }

  .airfields-map-toolbar {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .map-view-btn {
    min-height: 44px;
    padding: 0.5rem 0.75rem;
  }

  /* Map tab: fixed toolbar at bottom; z-index above map */
  #inhouse-map-panel .airfields-map-toolbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-around;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.5rem calc(0.5rem + env(safe-area-inset-bottom, 0));
    background: #1e293b;
    border-top: 1px solid #334155;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.3);
    margin: 0;
  }

  #inhouse-map-panel .inhouse-map-toolbar-left {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-around;
    align-items: center;
    flex: 3;
    min-width: 0;
    gap: 0.5rem;
  }

  #inhouse-map-panel .inhouse-map-toolbar-right {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0;
    flex: 2;
    min-width: 0;
    justify-content: flex-end;
  }

  #inhouse-map-panel .airfields-map-view-toggle {
    flex: 0 0 auto;
    min-width: 0;
  }

  #inhouse-map-panel .airfields-map-view-toggle .map-view-btn {
    flex: 0 0 auto;
    min-width: 44px;
    width: 44px;
    padding: 0.5rem;
  }

  #inhouse-map-panel .inhouse-map-layers-dropdown .inhouse-map-layers-item {
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 40px !important;
    padding: 0.45rem 0.6rem !important;
  }

  /* Icon-only on mobile: hide text in Map toolbar buttons */
  #inhouse-map-panel .inhouse-map-airfields-btn span:not(.filter-btn-icon),
  #inhouse-map-panel .inhouse-map-aircraft-btn span:not(.filter-btn-icon),
  #inhouse-map-panel .inhouse-map-flights-btn span:not(.filter-btn-icon),
  #inhouse-map-panel .inhouse-map-favourites-btn span:not(.filter-btn-icon),
  #inhouse-map-panel .inhouse-map-plot-btn span:not(.filter-btn-icon),
  #inhouse-map-panel .inhouse-map-airspace-mode-btn span:not(.filter-btn-icon),
  #inhouse-map-panel .inhouse-map-notams-btn span:not(.filter-btn-icon),
  #inhouse-map-panel #inhouse-map-airfield-filter-btn .filter-btn-text,
  #inhouse-map-panel #inhouse-map-type-filter-btn .filter-btn-text {
    display: none;
  }

  #inhouse-map-panel .inhouse-map-airfields-btn,
  #inhouse-map-panel .inhouse-map-aircraft-btn,
  #inhouse-map-panel .inhouse-map-flights-btn,
  #inhouse-map-panel .inhouse-map-favourites-btn,
  #inhouse-map-panel .inhouse-map-plot-btn,
  #inhouse-map-panel .inhouse-map-airspace-mode-btn,
  #inhouse-map-panel .inhouse-map-notams-btn,
  #inhouse-map-panel #inhouse-map-airfield-filter-btn,
  #inhouse-map-panel #inhouse-map-type-filter-btn {
    min-height: 44px;
    min-width: 44px;
    width: 44px;
    padding: 0.5rem;
    -webkit-tap-highlight-color: transparent;
    flex: 0 0 auto;
  }

  /* Overlay buttons on map stay 30×30 – !important overrides toolbar 44px */
  #inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-flights-btn,
  #inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-favourites-btn,
  #inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-plot-btn,
  #inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-airspace-mode-btn,
  #inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-notams-btn,
  #inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-competition-btn,
  #inhouse-map-panel .inhouse-map-overlay-controls #inhouse-map-airfield-filter-btn,
  #inhouse-map-panel .inhouse-map-overlay-controls #inhouse-map-type-filter-btn,
  #inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-airfields-btn,
  #inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-history-btn,
  #inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-signin-btn,
  #inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-notifications-btn,
  #inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-layers-btn,
  #inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-airspace-mode-btn,
  #inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-notams-btn,
  #inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-debug-logs-btn,
  #inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-toolbar-ar-btn,
  #inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-status-btn {
    min-height: 30px !important;
    min-width: 30px !important;
    width: 30px !important;
    height: 30px !important;
    padding: 0 !important;
  }

  #inhouse-map-panel .inhouse-map-airfields-btn .filter-btn-icon svg,
  #inhouse-map-panel .inhouse-map-aircraft-btn .filter-btn-icon svg,
  #inhouse-map-panel .inhouse-map-flights-btn .filter-btn-icon svg,
  #inhouse-map-panel .inhouse-map-favourites-btn .filter-btn-icon svg,
  #inhouse-map-panel .inhouse-map-plot-btn .filter-btn-icon svg,
  #inhouse-map-panel .inhouse-map-airspace-mode-btn .filter-btn-icon svg,
  #inhouse-map-panel .inhouse-map-notams-btn .filter-btn-icon svg,
  #inhouse-map-panel #inhouse-map-airfield-filter-btn .filter-btn-icon svg,
  #inhouse-map-panel #inhouse-map-type-filter-btn .filter-btn-icon svg {
    width: 22px;
    height: 22px;
  }

  #inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-flights-btn .filter-btn-icon svg,
  #inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-favourites-btn .filter-btn-icon svg,
  #inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-plot-btn .filter-btn-icon svg,
  #inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-airspace-mode-btn .filter-btn-icon svg,
  #inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-notams-btn .filter-btn-icon svg,
  #inhouse-map-panel .inhouse-map-overlay-controls .inhouse-map-competition-btn .filter-btn-icon svg,
  #inhouse-map-panel .inhouse-map-overlay-controls #inhouse-map-airfield-filter-btn .filter-btn-icon svg,
  #inhouse-map-panel .inhouse-map-overlay-controls #inhouse-map-type-filter-btn .filter-btn-icon svg,
  #inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-airfields-btn .filter-btn-icon svg,
  #inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-history-btn .filter-btn-icon svg,
  #inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-signin-btn .filter-btn-icon svg,
  #inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-notifications-btn .filter-btn-icon svg,
  #inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-layers-btn .filter-btn-icon svg,
  #inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-airspace-mode-btn .filter-btn-icon svg,
  #inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-notams-btn .filter-btn-icon svg,
  #inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-debug-logs-btn .filter-btn-icon svg,
  #inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-toolbar-ar-btn .filter-btn-icon svg,
  #inhouse-map-panel .inhouse-map-overlay-controls-right .inhouse-map-status-btn .filter-btn-icon svg {
    width: 18px !important;
    height: 18px !important;
  }

  /* Map wrap: no bottom spacer (toolbar is empty/hidden); fill height */
  #inhouse-map-panel .inhouse-map-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
    z-index: 0;
  }

  #inhouse-map-panel .inhouse-map-wrap .inhouse-map-container {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  /* Map filter popups: above overlay buttons and flight profile, not bottom sheet */
  #inhouse-map-panel #inhouse-map-type-filter-panel,
  #inhouse-map-panel #inhouse-map-airfield-filter-panel,
  #inhouse-map-panel #inhouse-map-saved-views-panel {
    position: fixed;
    top: calc(10px + var(--inhouse-map-top-offset));
    left: 48px;
    right: auto;
    bottom: auto;
    margin: 0;
    max-height: calc(100vh - 20px - var(--inhouse-map-top-offset));
    border-radius: 0.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 10025;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  #inhouse-map-panel #inhouse-map-competition-filter-panel,
  #inhouse-map-panel #inhouse-map-competition-aircraft-panel {
    position: fixed;
    top: calc(162px + var(--inhouse-map-top-offset)); /* below row 5 (comp, after plot) */ */
    left: 10px;
    right: auto;
    bottom: auto;
    margin: 0;
    max-height: calc(100vh - 174px - var(--inhouse-map-top-offset));
    border-radius: 0.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 1100;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  #inhouse-map-panel #inhouse-map-competition-aircraft-panel {
    left: 10px;
    z-index: 1101;
  }

  /* Override inline height so map fills available vertical space */
  #inhouse-map-panel .inhouse-map-wrap .inhouse-map-container .inhouse-map {
    flex: 1;
    min-height: 280px;
    height: 100% !important;
  }

  .glideandseek-links-list {
    flex-direction: column;
  }

  .glideandseek-link {
    display: block;
    text-align: center;
    padding: 0.6rem 1rem;
  }

  .status-refresh-btn {
    min-height: 44px;
    padding: 0.6rem 1.25rem;
    -webkit-tap-highlight-color: transparent;
  }

  .status-list {
    grid-template-columns: 1fr;
    gap: 0.35rem 0;
  }

  .status-list dt {
    margin-top: 0.5rem;
  }
  .status-list dt:first-child {
    margin-top: 0;
  }

  /* Status panel: better mobile layout */
  #status-panel .status-section {
    padding: 0;
    max-width: 100%;
  }
  #status-panel .status-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
  }
  #status-panel .status-actions-label {
    margin-right: 0;
  }
  #status-panel .status-actions-buttons {
    flex-direction: column;
  }
  #status-panel .status-refresh-btn {
    width: 100%;
    text-align: center;
  }
  #status-panel .status-content {
    margin-bottom: 0;
  }
  #status-panel .status-update-call-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  #status-panel .status-update-call-refresh-btn {
    width: 100%;
    box-sizing: border-box;
  }
  #status-panel .status-block {
    margin-bottom: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: none;
  }
  #status-panel .status-block:last-child {
    margin-bottom: 0;
  }
  #status-panel .status-block-title {
    font-size: 0.95rem;
    margin-bottom: 0.6rem;
    padding-bottom: 0.4rem;
  }
  #status-panel .status-list dt {
    margin-top: 0.5rem;
    font-size: 0.75rem;
  }
  #status-panel .status-list dt:first-child {
    margin-top: 0;
  }
  #status-panel .status-list dd {
    font-size: 0.9rem;
    word-break: break-word;
    min-width: 0;
  }

  /* Logs header: title+toggle on one row; filters stack from the left */
  #status-panel .status-logs-title-row {
    width: 100%;
  }
  #status-panel .status-logs-title-row .status-refresh-btn {
    margin-left: auto;
  }
  #status-panel #status-logs-pane .status-logs-title-row #status-logs-refresh-btn {
    width: auto;
  }
  #status-panel .status-logs-toolbar {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  #status-panel .status-logs-line-filters {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  #status-panel .status-logs-level-filter-label,
  #status-panel .status-logs-search-label,
  #status-panel .status-logs-pid-filter {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    box-sizing: border-box;
  }
  #status-panel .status-logs-level-filter,
  #status-panel .status-logs-search,
  #status-panel .status-logs-pid-filter-button {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    max-width: none;
    box-sizing: border-box;
  }
  #status-panel .status-logs-search {
    width: 100%;
  }
  #status-panel .status-logs-pid-filter-button {
    min-height: 44px;
  }
}

@media (max-width: 480px) {
  main {
    padding: 0 0.5rem;
  }

  .aircraft-table-wrap {
    margin: 0 -0.5rem;
    padding: 0 0.5rem;
  }

  .aircraft-table {
    font-size: 0.75rem;
    min-width: 520px;
  }

  .aircraft-table th,
  .aircraft-table td {
    padding: 0.4rem 0.35rem;
  }

  .aircraft-section h2 {
    font-size: 1rem;
  }

}

/* NOTAM map tab */
body.notam-map-tab-active main {
  padding: 0;
}

#notam-map-panel.active {
  padding: 0;
  overflow: hidden;
  min-height: 0;
  flex: 1;
}

.notam-map-panel-inner {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
}

.notam-map-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
  padding: 0.55rem 0.75rem;
  background: #0f172a;
  border-bottom: 1px solid #334155;
  flex-shrink: 0;
}

.notam-map-header-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.4rem 1rem;
}

.notam-map-cats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.85rem;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.notam-map-cat {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: #cbd5e1;
  white-space: nowrap;
  cursor: pointer;
}

.notam-map-cat-swatch {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  flex: 0 0 auto;
}

.notam-map-cat-swatch[data-cat="obstacle"] { background: #8b5cf6; }
.notam-map-cat-swatch[data-cat="restriction"] { background: #ef4444; }
.notam-map-cat-swatch[data-cat="warning"] { background: #f59e0b; }
.notam-map-cat-swatch[data-cat="aerodrome"] { background: #3b82f6; }
.notam-map-cat-swatch[data-cat="other"] { background: #94a3b8; }

.notam-map-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #e2e8f0;
  flex: 0 0 auto;
}

.notam-map-meta {
  margin: 0 0 0 auto;
  font-size: 0.75rem;
  color: #94a3b8;
  text-align: right;
  white-space: nowrap;
  min-width: 0;
}

.notam-map-when {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.9rem;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.notam-map-filter {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: #cbd5e1;
  white-space: nowrap;
  cursor: pointer;
}

.notam-map-period {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: #cbd5e1;
}

.notam-map-period #notam-map-period-date {
  width: 8rem;
  max-width: 100%;
}

.notam-map-period.is-disabled {
  opacity: 0.45;
}

.notam-map-period-field {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.notam-map-period select {
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid #475569;
  border-radius: 4px;
  padding: 0.15rem 0.35rem;
  font-size: 0.78rem;
  color-scheme: dark;
}

.notam-map-time-slider {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  width: 100%;
  min-width: 0;
}

.notam-map-time-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #e2e8f0;
  font-variant-numeric: tabular-nums;
}

.notam-map-time-slider-rail {
  position: relative;
  height: 1.35rem;
}

.notam-map-time-slider-rail::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 0.35rem;
  margin-top: -0.175rem;
  background: #334155;
  border-radius: 999px;
}

.notam-map-time-slider-range {
  position: absolute;
  top: 50%;
  height: 0.35rem;
  margin-top: -0.175rem;
  background: #3b82f6;
  border-radius: 999px;
  z-index: 1;
  pointer-events: none;
}

.notam-map-time-slider-rail input[type="range"] {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 1.35rem;
  margin: 0;
  padding: 0;
  background: transparent;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
  accent-color: #3b82f6;
  touch-action: none;
}

.notam-map-time-slider-rail input[type="range"]:focus {
  outline: none;
}

.notam-map-time-slider-rail input[type="range"]:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 2px #0f172a, 0 0 0 4px #60a5fa;
}

.notam-map-time-slider-rail input[type="range"]::-webkit-slider-runnable-track {
  height: 0.35rem;
  background: transparent;
}

.notam-map-time-slider-rail input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: calc((0.35rem - 1.15rem) / 2);
  border-radius: 50%;
  border: 2px solid #0f172a;
  background: #3b82f6;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
  cursor: pointer;
}

.notam-map-time-slider-rail input[type="range"]::-moz-range-track {
  height: 0.35rem;
  background: transparent;
}

.notam-map-time-slider-rail input[type="range"]::-moz-range-thumb {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  border: 2px solid #0f172a;
  background: #3b82f6;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
  cursor: pointer;
}

.notam-map-time-slider-rail #notam-map-period-from {
  z-index: 2;
}

.notam-map-time-slider-rail #notam-map-period-to {
  z-index: 3;
}

.notam-map-period-tz {
  color: #94a3b8;
  font-size: 0.72rem;
}

#notam-map-panel .aircraft-flights-back {
  margin-bottom: 0;
}

.notam-map-body {
  display: flex;
  flex: 1 1 0;
  min-height: 0;
  align-items: stretch;
  overflow: hidden;
}

.notam-map-wrap {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.notam-map {
  flex: 1 1 auto;
  min-height: 0;
  background: #1e293b;
}

.notam-map-click-target {
  background: none !important;
  border: 0 !important;
  pointer-events: none;
}

.notam-map-click-target svg {
  display: block;
  width: 28px;
  height: 28px;
  overflow: visible;
}

.notam-map-overlay-controls {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 9999;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notam-map-overlay-row {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.notam-map-search-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  pointer-events: auto;
}

.notam-map-search-input {
  width: 9.6rem;
  max-width: min(9.6rem, calc(100vw - 9.5rem));
  height: 30px;
  padding: 0 1.75rem 0 0.5rem;
  font-size: 0.75rem;
  font-family: inherit;
  color: #e2e8f0;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 4px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.65);
  outline: none;
}

.notam-map-search-input::placeholder {
  color: #64748b;
}

.notam-map-search-input:focus {
  border-color: #3b82f6;
}

.notam-map-search-input.is-active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #f1f5f9;
  caret-color: #f8fafc;
}

.notam-map-search-input.is-active:focus {
  border-color: #93c5fd;
}

.notam-map-search-wrap:has(.is-active) .notam-map-search-clear {
  color: #f1f5f9;
}

.notam-map-search-wrap:has(.is-active) .notam-map-search-clear:hover {
  color: #fff;
  background: rgba(37, 99, 235, 0.9);
}

.notam-map-search-clear {
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  color: #94a3b8;
  background: transparent;
  border: none;
  border-radius: 0.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notam-map-search-clear:hover {
  color: #e2e8f0;
  background: rgba(51, 65, 85, 0.8);
}

.notam-map-search-clear[hidden] {
  display: none;
}

.notam-map-overlay-controls-right {
  left: auto;
  right: 10px;
  align-items: flex-end;
}

.notam-map-overlay-controls-right:has(.notam-map-layers-dropdown:not([hidden])) {
  z-index: 10025;
}

.notam-map .leaflet-top.leaflet-right {
  top: 40px;
}

.notam-map-overlay-controls .map-view-btn:first-child,
.notam-map-overlay-controls .map-view-btn:last-child {
  border-radius: 4px;
  margin-left: 0;
}

.notam-map-overlay-controls-right .notam-map-layers-dropdown {
  left: auto;
  right: calc(100% + 6px);
}

.notam-map-layers-menu {
  position: relative;
  pointer-events: auto;
}

.notam-map-layers-dropdown {
  position: absolute;
  top: 0;
  left: calc(100% + 6px);
  z-index: 10025;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0.3rem;
  min-width: 9.5rem;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  pointer-events: auto;
}

.notam-map-layers-dropdown[hidden] {
  display: none !important;
}

#notam-map-export-dropdown {
  min-width: 12rem;
}

.notam-map-layers-dropdown .notam-map-layers-item {
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 36px !important;
  margin: 0 !important;
  padding: 0.4rem 0.55rem !important;
  border: none !important;
  border-radius: 4px !important;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  background: transparent;
  color: #e2e8f0;
  font-size: 0.8125rem;
  line-height: 1.2;
  white-space: nowrap;
}

.notam-map-layers-dropdown .notam-map-layers-item:hover {
  background: #334155;
  color: #f8fafc;
}

.notam-map-layers-dropdown .notam-map-layers-item.active,
.notam-map-layers-dropdown .notam-map-layers-item.active:hover {
  background: #3b82f6 !important;
  color: #f1f5f9 !important;
}

.notam-map-layers-dropdown .notam-map-layers-item .filter-btn-icon {
  margin: 0;
  display: flex;
}

.notam-map-layers-dropdown .notam-map-layers-item-label {
  flex: 1 1 auto;
}

.notam-map-filter-btn {
  pointer-events: auto;
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  min-height: 30px !important;
  padding: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 4px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.65);
  color: #e2e8f0;
}

.notam-map-filter-btn .filter-btn-icon {
  margin: 0;
  display: flex;
}

.notam-map-filter-btn .filter-btn-icon svg {
  width: 18px;
  height: 18px;
}

.notam-map-filter-btn .filter-btn-text {
  display: none;
}

.notam-map-filter-btn.active {
  background: #0d9488 !important;
  border-color: #0d9488 !important;
  color: #f0fdfa !important;
}

.notam-map-filter-btn[data-notam-filter-btn][aria-expanded="true"] {
  box-shadow: 0 0 0 2px #5eead4;
}

.notam-map-overlay-gap {
  height: 2px;
  pointer-events: none;
}

.notam-map-filter-section[hidden] {
  display: none !important;
}

.notam-map-sups-btn .notam-map-sups-btn-label {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1;
}

.notam-map-sups-btn.active {
  background: #0891b2 !important;
  border-color: #0891b2 !important;
  color: #ecfeff !important;
}

#notam-map-filter-panel,
#notam-map-export-confirm {
  position: fixed;
  top: 10px;
  left: 48px;
  right: auto;
  margin-top: 0;
  z-index: 10025;
  height: auto;
  max-height: calc(100dvh - 16px);
  overflow-x: hidden;
  overflow-y: auto;
}

#notam-map-export-confirm {
  min-width: 16.5rem;
  max-width: 22rem;
  height: fit-content;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#notam-map-export-confirm[hidden] {
  display: none !important;
}

#notam-map-export-confirm .filter-panel-heading-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.15rem;
  margin-bottom: 0.65rem;
  flex-shrink: 0;
  overflow: visible;
}

#notam-map-export-confirm .filter-panel-heading-row .columns-panel-heading {
  margin-bottom: 0;
  overflow: visible;
  text-overflow: unset;
  flex-shrink: 0;
}

.notam-map-export-confirm-format {
  margin: 0;
  font-size: 0.78rem;
  color: #94a3b8;
  white-space: nowrap;
}

.notam-map-export-confirm-body {
  pointer-events: none;
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
  margin: 0 -0.35rem;
  padding: 0 0.35rem 0.35rem;
}

.notam-map-export-confirm-body .notam-map-period {
  color: #94a3b8;
  font-size: 0.75rem;
}

.notam-map-export-confirm-body .is-excluded {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  border-radius: 0.3rem;
  padding: 0.12rem 0.4rem;
  margin-left: -0.4rem;
  margin-right: -0.4rem;
}

.notam-map-export-confirm-body .is-excluded .notam-map-cat-swatch {
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.7);
  opacity: 0.55;
}

.notam-map-export-flag {
  margin-left: auto;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #f59e0b;
}

.notam-map-export-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-top: 0.55rem;
  padding-top: 0.7rem;
  border-top: 1px solid #334155;
}

.notam-map-export-go {
  background: #0d9488 !important;
  border-color: #0d9488 !important;
  color: #f0fdfa !important;
}

.notam-map-export-go:hover {
  background: #0f766e !important;
  border-color: #0f766e !important;
  color: #fff !important;
}

#notam-map-filter-panel .notam-map-when,
#notam-map-filter-panel .notam-map-cats,
#notam-map-export-confirm .notam-map-when,
#notam-map-export-confirm .notam-map-cats {
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
}

#notam-map-filter-panel .filter-panel-heading-row {
  margin-bottom: 0.85rem;
}

#notam-map-filter-panel .notam-map-extra-filters,
#notam-map-export-confirm .notam-map-extra-filters {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.45rem;
}

#notam-map-filter-panel .notam-map-extra-filters .filter-panel-separator,
#notam-map-export-confirm .notam-map-extra-filters .filter-panel-separator {
  margin: 0.15rem 0;
}

#notam-map-filter-panel .notam-map-filter-subhead {
  margin: 0.35rem 0 0.85rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #f1f5f9;
}

#notam-map-filter-panel .notam-map-extra-filters .notam-map-filter-subhead {
  margin-bottom: 0.4rem;
}

#notam-map-filter-panel .notam-map-ceiling-field,
#notam-map-export-confirm .notam-map-ceiling-field {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.78rem;
  color: #cbd5e1;
}

#notam-map-filter-panel .notam-map-ceiling-field input {
  width: 5.5rem;
  padding: 0.2rem 0.35rem;
  border: 1px solid #475569;
  border-radius: 0.25rem;
  background: #0f172a;
  color: #e2e8f0;
  font: inherit;
}

.notam-map-issued {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.notam-map-issued-controls {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
  padding: 0 0 0 1.4rem;
}

.notam-map-issued-controls select {
  width: 100%;
  max-width: 100%;
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid #475569;
  border-radius: 4px;
  padding: 0.15rem 0.35rem;
  font-size: 0.78rem;
  color-scheme: dark;
}

.notam-map-issued-controls.is-disabled {
  opacity: 0.45;
}

.notam-map-issued-note {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  font-size: 0.72rem;
  line-height: 1.3;
  font-weight: 600;
  color: #f59e0b;
}

.notam-map-issued-note svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  color: #f59e0b;
}

#notam-map-filter-panel .notam-map-when-period,
#notam-map-export-confirm .notam-map-when-period {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.7rem;
}

#notam-map-filter-panel .notam-map-period,
#notam-map-export-confirm .notam-map-period {
  padding: 0.1rem 0 0.25rem 1.4rem;
  flex-direction: column;
  align-items: stretch;
  flex-wrap: nowrap;
  gap: 0.55rem;
}

#notam-map-filter-panel .notam-map-time-slider,
#notam-map-export-confirm .notam-map-time-slider {
  padding-left: 0.6rem;
}

#notam-map-filter-panel .notam-map-cat,
#notam-map-export-confirm .notam-map-cat {
  color: #cbd5e1;
}

@media (max-width: 768px) {
  #notam-map-filter-panel,
  #notam-map-export-confirm {
    position: fixed;
    top: 10px;
    left: 48px;
    right: auto;
    bottom: auto;
    height: auto;
    max-height: calc(100dvh - 16px);
    max-width: calc(100vw - 56px);
    border-radius: 0.5rem;
    z-index: 10040;
  }
}

.notam-map-count {
  color: #94a3b8;
  font-weight: 500;
}

.notam-map-popup-count {
  font-weight: 600;
  font-size: 0.78rem;
  color: #334155;
  margin-bottom: 0.35rem;
}

.notam-map-popup-list-wrap {
  position: relative;
}

.notam-map-popup-list {
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding-right: 0.35rem;
  scrollbar-gutter: stable;
}

.notam-map-popup-list::-webkit-scrollbar {
  width: 8px;
}

.notam-map-popup-list::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 4px;
}

.notam-map-popup-list.has-more {
  mask-image: linear-gradient(to bottom, #000 80%, transparent 100%);
}

.notam-map-popup-more {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.35rem 0 0.1rem;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: #334155;
  background: linear-gradient(transparent, #fff 45%);
  pointer-events: none;
}

.notam-map-popup-item {
  padding-top: 0.45rem;
  border-top: 1px solid #e2e8f0;
}

.notam-map-popup-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.notam-map-popup-id {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  font-weight: 600;
  color: #0f172a;
}

.notam-map-popup-id-text {
  flex: 1;
  min-width: 0;
}

.notam-map-full-btn {
  appearance: none;
  flex: 0 0 auto;
  margin-left: auto;
  padding: 0.12rem 0.5rem;
  border: 1px solid #94a3b8;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  cursor: pointer;
}

.notam-map-full-btn:hover,
.notam-map-full-btn:focus-visible {
  background: #e2e8f0;
  color: #0f172a;
  outline: none;
}

.notam-map-popup-id .notam-map-cat-swatch {
  width: 0.55rem;
  height: 0.55rem;
  margin-top: 0.28em;
}

.notam-map-popup-meta,
.notam-map-popup-when,
.notam-map-popup-sched,
.notam-map-popup-alt {
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: #475569;
}

.notam-map-popup-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.28rem;
}

.notam-map-popup-flags span {
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
}

.notam-map-popup-flags span.is-ifr {
  background: #dbeafe;
  color: #1d4ed8;
}

.notam-map-popup-flags span.is-fir {
  background: #f1f5f9;
  color: #475569;
}

.notam-map-popup-flags span.is-sup-active {
  background: #cffafe;
  color: #0e7490;
}

.notam-map-popup-flags span.is-sup-dormant {
  background: #f1f5f9;
  color: #64748b;
}

.notam-map-sup-swatch {
  width: 0.6rem;
  height: 0.6rem;
  margin-top: 0.25em;
  flex: 0 0 auto;
  border: 2px dashed #0891b2;
  border-radius: 2px;
  background: rgba(8, 145, 178, 0.15);
}

a.notam-map-sup-pdf {
  text-decoration: none;
}

.notam-map-popup-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.3rem;
}

.notam-map-links-label {
  margin-right: 0.15rem;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #64748b;
}

.notam-map-link-chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
}

.notam-map-link-chip.is-sup {
  border-color: #67e8f9;
  background: #ecfeff;
  color: #0e7490;
}

.notam-map-link-chip.is-sup.is-uncaptured {
  border-style: dashed;
  background: #f8fafc;
}

.notam-map-link-chip.is-notam.is-live {
  border-color: #5eead4;
  background: #f0fdfa;
  color: #0f766e;
}

.notam-map-link-chip:hover,
.notam-map-link-chip:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(14, 116, 144, 0.25);
}

.notam-map-link-chip.is-missing {
  border-style: dashed;
  opacity: 0.7;
  cursor: default;
  box-shadow: none;
}

.notam-map-popup-text {
  margin-top: 0.4rem;
  font-size: 0.82rem;
  line-height: 1.35;
  color: #1e293b;
}

.notam-map-popup-note {
  margin-top: 0.45rem;
  font-size: 0.7rem;
  color: #64748b;
}

.notam-detail-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 11060;
  padding: 1rem;
}

.notam-detail-modal[hidden] {
  display: none !important;
}

.notam-detail-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.notam-detail-modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(40rem, 100%);
  max-height: min(85vh, 44rem);
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.notam-detail-modal-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem 0.7rem;
  border-bottom: 1px solid #334155;
}

.notam-detail-modal-title {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #f1f5f9;
}

.notam-detail-modal-close {
  appearance: none;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 1.35rem;
  line-height: 1;
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border-radius: 0.25rem;
  cursor: pointer;
  flex-shrink: 0;
}

.notam-detail-modal-close:hover,
.notam-detail-modal-close:focus-visible {
  background: rgba(148, 163, 184, 0.15);
  color: #e2e8f0;
  outline: none;
}

.notam-detail-modal-body {
  padding: 0.85rem 1rem 1rem;
  overflow: auto;
  min-height: 0;
}

.notam-detail-raw {
  margin: 0;
  padding: 0.7rem 0.8rem;
  border-radius: 0.35rem;
  background: #0f172a;
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.notam-detail-dl {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.35rem 0.75rem;
  margin: 0.85rem 0 0;
}

.notam-detail-dl dt {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #94a3b8;
  padding-top: 0.15rem;
}

.notam-detail-dl dd {
  margin: 0;
  font-size: 0.85rem;
  color: #e2e8f0;
  line-height: 1.35;
}

.notam-detail-note {
  margin: 0.75rem 0 0;
  font-size: 0.7rem;
  color: #64748b;
}

.notam-map-dock {
  width: min(380px, 42vw);
  flex: 0 0 min(380px, 42vw);
  align-self: stretch;
  min-width: 0;
  min-height: 0;
  height: auto;
  max-height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  border-left: 1px solid #334155;
}

.notam-map-dock-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  background: #0f172a;
  border-bottom: 1px solid #334155;
  flex-shrink: 0;
}

.notam-map-dock-title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: #e2e8f0;
}

.notam-map-dock-body {
  flex: 1 1 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.7rem 0.8rem 1rem;
  scrollbar-gutter: stable;
  touch-action: pan-y;
}

.notam-map-dock-body::-webkit-scrollbar {
  width: 10px;
}

.notam-map-dock-body::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 5px;
}

.notam-map-dock-empty {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
  line-height: 1.4;
  color: #475569;
}

.notam-map-dock-body .notam-map-popup-list {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.notam-map-dock-body .notam-map-popup-list.has-more {
  mask-image: none;
}

.notam-map-dock-body .notam-map-popup-item[data-notam-id],
.notam-map-dock-body .notam-map-popup-item[data-sup-id] {
  cursor: pointer;
  border-radius: 6px;
  margin-left: -0.25rem;
  margin-right: -0.25rem;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.notam-map-dock-body .notam-map-popup-item[data-notam-id]:hover,
.notam-map-dock-body .notam-map-popup-item[data-sup-id]:hover {
  background: #e2e8f0;
}

@media (max-width: 480px) {
  .notam-map-body {
    flex-direction: column;
  }

  .notam-map-dock {
    width: auto;
    flex: 0 0 36%;
    max-height: 36%;
    border-left: 0;
    border-top: 1px solid #334155;
  }
}

/* History tab */
#history-panel.active {
  padding-top: 0.75rem;
}

#history-panel.active:has(.history-flights-layout) {
  overflow: hidden;
}

.history-panel-inner:has(.history-flights-layout) {
  overflow: hidden;
}

.history-panel-content:has(.history-flights-layout) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.history-panel-inner {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
  flex: 1;
}

.history-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: #94a3b8;
}

.history-bc-link {
  background: none;
  border: none;
  padding: 0;
  color: #60a5fa;
  cursor: pointer;
  font: inherit;
}

.history-bc-link:hover {
  text-decoration: underline;
}

.history-bc-sep {
  color: #64748b;
}

.history-bc-current {
  color: #e2e8f0;
  font-weight: 500;
}

.history-panel-content {
  flex: 1;
  min-height: 0;
}

.history-empty,
.history-map-loading {
  color: #94a3b8;
  margin: 1rem 0;
}

#history-panel.active:has(.history-cal-view) {
  overflow: hidden;
}

.history-panel-inner:has(.history-cal-view) {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.history-panel-content:has(.history-cal-view) {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.history-cal-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.history-cal-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 0.15rem;
}

.history-cal-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
  margin-bottom: 0.75rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid #334155;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.history-cal-search-wrap {
  position: relative;
  flex: 0 0 auto;
}

.history-cal-search.history-filter-search-input {
  width: 10ch;
  max-width: 10ch;
}

.history-cal-search-status {
  font-size: 0.8rem;
  color: #94a3b8;
}

.history-cal-clear-cache {
  margin-left: auto;
  padding: 0.4rem 0.75rem;
  font-size: 0.78rem;
  color: #cbd5e1;
}

.history-cal-clear-cache:hover:not(:disabled) {
  background: #334155;
  border-color: #475569;
}

.history-cal-legend-match[hidden] {
  display: none;
}

.history-cal-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: none;
  margin: 0;
}

.history-cal-year {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.history-cal-year-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #e2e8f0;
  text-align: center;
}

.history-cal-year-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.45rem;
}

.history-cal-month {
  min-width: 0;
  padding: 0.3rem;
  border-radius: 0.35rem;
  border: 1px solid #475569;
  background: rgba(30, 41, 59, 0.96);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
}

.history-cal-month-empty {
  border-color: #3a4556;
  background: #1a2332;
  box-shadow: none;
}

.history-cal-month-empty .history-cal-month-title {
  color: #7c8a9e;
}

.history-cal-month-empty .history-cal-dow {
  color: #556275;
}

.history-cal-month-title {
  margin: 0 0 0.2rem;
  font-size: 0.62rem;
  font-weight: 600;
  color: #e2e8f0;
  text-align: center;
  letter-spacing: 0.02em;
}

.history-cal-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.08rem;
  margin-bottom: 0.12rem;
  font-size: 0.48rem;
  font-weight: 600;
  color: #64748b;
  text-align: center;
}

.history-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.08rem;
}

.history-cal-cell {
  position: relative;
  min-height: 0;
  aspect-ratio: 1;
  padding: 0.05rem;
  border: 1px solid #334155;
  border-radius: 0.2rem;
  background: #1e293b;
  color: #e2e8f0;
  font: inherit;
  text-align: center;
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: center;
}

.history-cal-cell.history-cal-pad {
  border: none;
  background: transparent;
  min-height: 0;
}

.history-cal-has-data {
  cursor: pointer;
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.12);
}

.history-cal-has-data:hover {
  background: rgba(59, 130, 246, 0.22);
}

.history-cal-aircraft-match {
  border-color: #f59e0b !important;
  background: rgba(245, 158, 11, 0.24) !important;
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.45);
}

.history-cal-aircraft-match:hover {
  border-color: #fbbf24 !important;
  background: rgba(245, 158, 11, 0.32) !important;
}

.history-legend-aircraft-match {
  background: rgba(245, 158, 11, 0.35);
  border: 1px solid #f59e0b;
}

.history-cal-today {
  box-shadow: inset 0 0 0 2px #e2e8f0;
}

.history-cal-today .history-cal-day-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0.95rem;
  min-height: 0.95rem;
  padding: 0;
  border-radius: 999px;
  background: #e2e8f0;
  color: #0f172a;
}

.history-cal-has-data.history-cal-today {
  box-shadow: inset 0 0 0 2px #f8fafc, 0 0 0 1px #3b82f6;
}

.history-legend-today {
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
}

.history-cal-empty {
  opacity: 0.45;
}

.history-cal-day-num {
  font-weight: 600;
  font-size: 0.52rem;
  line-height: 1;
}

.history-cal-stats {
  display: none;
}

.history-cal-stat {
  display: block;
}

.history-cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
  font-size: 0.72rem;
  color: #94a3b8;
}

.history-legend-swatch {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 0.15rem;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.history-legend-data {
  background: rgba(59, 130, 246, 0.35);
  border: 1px solid #3b82f6;
}

.history-legend-empty {
  background: #1e293b;
  border: 1px solid #334155;
}

.history-summary-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.5rem;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  color: #cbd5e1;
}

.history-day-view-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.history-day-view-tab {
  padding: 0.4rem 0.85rem;
  border: 1px solid #334155;
  border-radius: 0.375rem;
  background: #0f172a;
  color: #94a3b8;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}

.history-day-view-tab:hover {
  border-color: #475569;
  color: #e2e8f0;
}

.history-day-view-tab.active {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.15);
  color: #e2e8f0;
}

.history-logbook {
  margin-top: 0.25rem;
}

.history-logbook-table-wrap {
  overflow-x: auto;
  max-height: min(70vh, 720px);
  overflow-y: auto;
  border: 1px solid #334155;
  border-radius: 0.5rem;
}

.history-logbook-table-wrap .airfields-view-logbook-table {
  margin: 0;
}

.history-logbook-table tr.history-logbook-row {
  cursor: pointer;
}

.history-logbook-table tr.history-logbook-row:hover td {
  background: rgba(51, 65, 85, 0.6);
}

.history-logbook-table tr.history-logbook-row.airfields-view-flight-row-landout:hover td {
  background: rgba(220, 38, 38, 0.32);
}

.history-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.history-select,
.history-search {
  padding: 0.45rem 0.6rem;
  border: 1px solid #334155;
  border-radius: 0.375rem;
  background: #0f172a;
  color: #e2e8f0;
  font: inherit;
  font-size: 0.85rem;
}

.history-search {
  min-width: 10rem;
  flex: 1;
}

#history-filter-search.history-filter-search-input,
.history-filter-search-input {
  width: 10ch;
  max-width: 10ch;
  min-width: 0;
  flex: 0 0 auto;
  box-sizing: content-box;
}

.history-filter-check {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: #cbd5e1;
}

.history-type-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  width: 100%;
}

.history-filter-type {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: #94a3b8;
}

.history-filters-aircraft-only .history-filter-muted {
  opacity: 0.45;
}

.history-filters-aircraft-only .history-select:disabled,
.history-filters-aircraft-only .history-filter-check input:disabled,
.history-filters-aircraft-only .history-filter-type input:disabled {
  cursor: not-allowed;
}

.history-table-wrap {
  overflow: auto;
  border: 1px solid #334155;
  border-radius: 0.5rem;
}

.history-table {
  width: 100%;
}

.history-aircraft-row {
  cursor: pointer;
}

.history-aircraft-row:hover td {
  background: rgba(59, 130, 246, 0.1);
}

.history-flights-header {
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}

.history-flights-layout {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
  flex: 1;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}

.history-flights-sidebar {
  flex: 0 0 min(260px, 32%);
  max-width: 300px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
  min-width: 0;
  overflow: hidden;
}

.history-flights-select-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  padding: 0.35rem 0;
  flex-shrink: 0;
}

.history-select-all-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: #cbd5e1;
  cursor: pointer;
}

.history-flights-count {
  font-size: 0.8rem;
  color: #64748b;
  white-space: nowrap;
}

.history-flights-map-pane {
  flex: 1;
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.history-flights-title {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
  color: #f1f5f9;
}

.history-flights-sub {
  margin: 0;
  font-size: 0.85rem;
  color: #94a3b8;
}

.history-flights-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.history-flight-card {
  display: flex;
  gap: 0.45rem;
  align-items: flex-start;
  padding: 0.45rem 0.5rem;
  border: 1px solid #334155;
  border-radius: 0.375rem;
  background: #1e293b;
  cursor: pointer;
}

.history-flight-card:has(.history-flight-check:checked) {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}

.history-flight-times {
  font-weight: 500;
  color: #e2e8f0;
  font-size: 0.8rem;
  line-height: 1.25;
}

.history-flight-meta {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 0.1rem;
}

.history-landout-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  font-size: 0.7rem;
  font-weight: 600;
}

.history-corrupt-dot {
  color: #f59e0b;
  margin-left: 0.25rem;
}

.history-rejected-dot {
  color: #ef4444;
  margin-left: 0.25rem;
}

.history-tracking-lost-dot {
  color: #8b5cf6;
  margin-left: 0.25rem;
}

.history-flights-actions {
  display: flex;
  gap: 0.5rem;
}

.history-btn {
  padding: 0.55rem 1rem;
  border-radius: 0.375rem;
  border: 1px solid #334155;
  background: #1e293b;
  color: #e2e8f0;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.history-btn.primary {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
}

.history-btn.primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.history-map {
  width: 100%;
  height: min(60vh, 520px);
  min-height: 280px;
  border-radius: 0.5rem;
  border: 1px solid #334155;
  z-index: 0;
}

.history-map.history-map-inline {
  flex: 1;
  min-height: 0;
  height: auto;
}

.history-flights-map-pane .history-map-loading {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
}

.history-flights-map-pane .history-map-legend {
  margin-top: 0.45rem;
  flex-shrink: 0;
}

.history-profile-wrap {
  flex-shrink: 0;
  margin-top: 0.5rem;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  background: #0f172a;
  overflow: hidden;
}

.history-profile-placeholder {
  margin: 0;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: #94a3b8;
  text-align: center;
}

.history-profile-placeholder[hidden],
.history-profile-canvas[hidden] {
  display: none;
}

.history-profile-canvas {
  display: block;
  width: 100%;
  height: 180px;
  cursor: crosshair;
}

.history-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.history-map-chip {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border: 2px solid #3b82f6;
  border-radius: 999px;
  font-size: 0.75rem;
  color: #e2e8f0;
}

@media (max-width: 768px) {
  #history-panel.active:has(.history-flights-layout) {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .history-panel-inner:has(.history-flights-layout),
  .history-panel-content:has(.history-flights-layout) {
    overflow: visible;
    flex: none;
    min-height: auto;
  }

  .history-flights-layout {
    flex-direction: column;
    flex: none;
    min-height: auto;
    max-height: none;
    overflow: visible;
    gap: 0.75rem;
  }

  /* Map + profile above flight list; page scrolls below the map block. */
  .history-flights-map-pane {
    order: -1;
    flex: none;
    min-height: auto;
    max-height: none;
    overflow: visible;
  }

  .history-flights-sidebar {
    flex: none;
    max-width: none;
    max-height: none;
    overflow: visible;
  }

  .history-flights-list {
    flex: none;
    min-height: auto;
    max-height: none;
    overflow: visible;
  }

  .history-map.history-map-inline {
    flex: none;
    width: 100%;
    height: min(52vh, 480px);
    min-height: 280px;
  }

  .history-profile-canvas {
    height: 200px;
  }
}

@media (max-width: 1100px) {
  .history-cal-year-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .history-cal-stack {
    max-width: none;
  }

  .history-cal-year-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  /* Mobile: only months with flying days (empty panes omitted from layout). */
  .history-cal-month-empty {
    display: none;
  }

  .history-cal-month {
    padding: 0.55rem 0.65rem;
  }

  .history-cal-month-title {
    font-size: 1rem;
    margin-bottom: 0.35rem;
  }

  .history-cal-dow {
    font-size: 0.72rem;
    gap: 0.12rem;
    margin-bottom: 0.2rem;
  }

  .history-cal-grid {
    gap: 0.12rem;
  }

  .history-cal-cell {
    aspect-ratio: 1;
    padding: 0.12rem;
    border-radius: 0.3rem;
  }

  .history-cal-day-num {
    font-size: 0.8rem;
  }

  .history-cal-legend > span:has(.history-legend-empty) {
    display: none;
  }
}

@media (max-width: 420px) {
  .airspace-lookup-stack {
    min-height: 140px;
  }
}

@media (max-width: 640px) {
  .airspace-lookup-modal--float {
    right: 8px;
    bottom: 12px;
  }

  .airspace-lookup-modal--float .airspace-lookup-modal-content {
    height: 300px;
    max-width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  .airspace-lookup-modal--float.airspace-lookup-modal--collapsed .airspace-lookup-modal-content {
    width: 132px;
  }

  .airspace-lookup-modal--float .airspace-lookup-modal-header {
    gap: 0.25rem;
  }

  .airspace-lookup-modal--float .airspace-lookup-modal-body {
    flex: 1;
    display: flex;
    min-height: 0;
    padding: 0.35rem 0.35rem 0.45rem;
  }

  .airspace-lookup-modal--float .airspace-lookup-layout {
    width: 100%;
    height: 100%;
    min-height: 0;
  }

  .airspace-lookup-modal--float .airspace-lookup-stack {
    min-height: 0;
    height: 100%;
    flex: 1;
  }

  .airspace-lookup-modal--float .airspace-lookup-status {
    font-size: 0.75rem;
  }
}

@media (max-width: 640px) {
  .history-cal-year-row {
    grid-template-columns: 1fr;
  }

  .history-cal-cell {
    aspect-ratio: 1;
    padding: 0.1rem;
  }

  .history-cal-day-num {
    font-size: 0.78rem;
  }

  .history-map {
    height: 50vh;
    min-height: 220px;
  }
}
