.metal-panel {
  border: 1px solid #cbd4de;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 252, 0.96) 46%, rgba(232, 238, 244, 0.96) 100%);
  box-shadow:
    0 12px 22px rgba(80, 99, 120, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    inset 0 -1px 0 rgba(170, 184, 199, 0.35);
}

.site-header {
  --site-header-height: 23rem;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  height: var(--site-header-height);
  border-bottom: 1px solid #cbd6df;
  background:
    linear-gradient(90deg, rgba(7, 38, 59, 0.96) 0%, rgba(11, 61, 91, 0.9) 44%, rgba(32, 102, 137, 0.45) 100%),
    url("../assets/images/airplane-hero.jpg") center / cover no-repeat;
  box-shadow: 0 8px 20px rgba(38, 58, 76, 0.18);
}

.portal-nav-link:focus-visible,
.hero-button:focus-visible {
  outline: 3px solid rgba(14, 116, 144, 0.36);
  outline-offset: 3px;
}

.site-header::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background:
    linear-gradient(180deg, rgba(14, 60, 88, 0.06), rgba(4, 22, 35, 0.32)),
    rgba(54, 126, 166, 0.16);
  backdrop-filter: saturate(0.95);
}

.site-header .decmet-shell {
  display: flex;
  min-height: 100%;
  align-items: center;
  padding-block: 0;
}

.hero-copy {
  max-width: 670px;
  padding: 2rem;
}

.site-header .header-hero-copy {
  padding: 0.2rem 0;
}

.hero-button {
  display: inline-flex;
  min-height: 2.7rem;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(191, 220, 238, 0.78);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #d6edf9 48%, #9bc7e1 49%, #e9f7fd 100%);
  color: #123a55;
  font-size: 0.9rem;
  font-weight: 800;
  padding: 0.68rem 1rem;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.85);
  box-shadow:
    0 5px 12px rgba(2, 17, 29, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.98);
}

.portal-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.55rem;
  padding: 0.6rem;
  border: 1px solid #bfceda;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(236, 244, 249, 0.96) 100%);
  box-shadow:
    0 8px 18px rgba(70, 88, 105, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.98);
}

.portal-nav-link {
  display: inline-flex;
  min-width: 0;
  min-height: 2.65rem;
  align-items: center;
  justify-content: center;
  gap: 0.48rem;
  border: 1px solid #b7c8d6;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, #f1f7fb 48%, #d8e6f0 100%);
  color: #294b63;
  font-size: 0.87rem;
  font-weight: 800;
  padding: 0.55rem 0.78rem;
  text-align: center;
  text-shadow: 0 1px 0 #ffffff;
  box-shadow: inset 0 1px 0 #ffffff, 0 2px 6px rgba(72, 91, 109, 0.12);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.portal-nav-link svg {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.portal-nav-link:hover {
  border-color: #89b7d4;
  transform: translateY(-1px);
}

.portal-nav-link.is-active {
  border-color: #6fa8cc;
  background: linear-gradient(180deg, #eaf8ff 0%, #bde0f3 48%, #7fb1cf 49%, #d8edf8 100%);
  color: #0e3e5c;
  box-shadow:
    inset 0 2px 5px rgba(55, 86, 110, 0.2),
    0 2px 8px rgba(56, 93, 119, 0.18);
}

.inset-panel {
  border: 1px solid #c8d2dd;
  background:
    linear-gradient(180deg, #f7fbfe 0%, #ffffff 46%, #eef3f7 100%);
  box-shadow:
    inset 0 2px 6px rgba(87, 103, 119, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.classic-widget {
  border: 1px solid #c6d1dc;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 42%, #eaf0f5 100%);
  box-shadow: 0 8px 16px rgba(70, 86, 103, 0.2), inset 0 1px 0 #ffffff;
}

.widget-title {
  border-bottom: 1px solid #c3ced9;
  background: linear-gradient(180deg, #f7fbff 0%, #dceaf5 49%, #c8d8e8 50%, #eff5fa 100%);
  color: #24506f;
  text-shadow: 0 1px 0 #ffffff;
}

.glossy-button {
  border: 1px solid #9fb7cb;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(218, 238, 250, 0.95) 48%, rgba(161, 201, 227, 0.95) 49%, rgba(220, 239, 250, 0.95) 100%);
  color: #173f5b;
  box-shadow:
    0 3px 7px rgba(60, 84, 105, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    inset 0 -1px 1px rgba(79, 117, 143, 0.22);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.86);
}

.glossy-button:hover {
  filter: brightness(1.035);
}

.glossy-button:active,
.glossy-button.is-active {
  background: linear-gradient(180deg, #a8cbe2 0%, #dff0fb 52%, #f9fdff 100%);
  box-shadow:
    inset 0 2px 7px rgba(62, 83, 101, 0.3),
    0 1px 2px rgba(62, 83, 101, 0.18);
}

.glossy-button-secondary {
  border: 1px solid #b5c0cb;
  background:
    linear-gradient(180deg, #ffffff 0%, #eff3f6 45%, #d5dde5 46%, #f7f9fb 100%);
  color: #3c4854;
  box-shadow:
    0 3px 7px rgba(72, 83, 94, 0.16),
    inset 0 1px 0 #ffffff,
    inset 0 -1px 0 rgba(143, 155, 168, 0.3);
}

.classic-tab {
  border: 1px solid #afbfce;
  background:
    linear-gradient(180deg, #ffffff 0%, #edf6fc 46%, #c9dceb 47%, #edf4fa 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 2px 5px rgba(62, 76, 90, 0.14);
  color: #274f6d;
  text-shadow: 0 1px 0 #ffffff;
}

.classic-tab:hover,
.classic-tab.is-active {
  background:
    linear-gradient(180deg, #eff9ff 0%, #c5e5f8 45%, #8dbbd8 46%, #dceefa 100%);
  color: #113d59;
}

.status-lamp {
  display: inline-block;
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 30%, #ffffff 0 10%, #98e0a2 26%, #42a755 62%, #1f6d33 100%);
  box-shadow: 0 0 0 1px rgba(47, 109, 56, 0.28), 0 0 8px rgba(72, 175, 85, 0.55);
}

.token-pill {
  border: 1px solid #b8cad7;
  background: linear-gradient(180deg, #ffffff 0%, #e9f5fb 100%);
  box-shadow: inset 0 1px 0 #ffffff, 0 2px 4px rgba(70, 90, 110, 0.13);
}

.token-pill.token-unknown {
  border-color: #e4a7ad;
  background: linear-gradient(180deg, #fffafb 0%, #ffe3e6 100%);
  color: #7a2530;
}

.token-pill.token-possible_typo {
  border-color: #dfbd72;
  background: linear-gradient(180deg, #fffdf4 0%, #fff0c6 100%);
  color: #79520e;
}

.token-pill.token-remark {
  border-color: #bdc7d0;
  background: linear-gradient(180deg, #ffffff 0%, #eef1f4 100%);
}

.decoded-row {
  border-bottom: 1px solid #dde4eb;
}

.decoded-row:last-child {
  border-bottom: 0;
}

.decoded-row[data-category="unknown"] {
  background: #fff0f2;
}

.decoded-row[data-category="possible_typo"] {
  background: #fff8dc;
}

.metar-mono {
  font-family: "JetBrains Mono", "Courier New", monospace;
}

.metar-token-button {
  border: 1px solid #a9c4d8;
  background:
    linear-gradient(180deg, #ffffff 0%, #f3fbff 38%, #cfe5f4 39%, #edf7fd 100%);
  color: #183f5c;
  box-shadow:
    0 4px 9px rgba(56, 80, 101, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    inset 0 -1px 1px rgba(95, 126, 150, 0.22);
  text-shadow: 0 1px 0 #ffffff;
  transition: transform 140ms ease, filter 140ms ease, box-shadow 140ms ease;
}

.metar-token-button:hover,
.metar-token-button:focus-visible {
  filter: brightness(1.035);
  transform: translateY(-1px);
}

.metar-token-button.is-active {
  background:
    linear-gradient(180deg, #b7d9ef 0%, #e5f5ff 52%, #ffffff 100%);
  box-shadow:
    inset 0 2px 7px rgba(53, 83, 108, 0.3),
    0 2px 5px rgba(55, 78, 98, 0.16);
  color: #0d3a58;
  transform: translateY(1px);
}

.knowledge-detail {
  border: 1px solid #c3d1dd;
  background:
    linear-gradient(180deg, #ffffff 0%, #f6fbff 46%, #e8f0f6 100%);
  box-shadow:
    0 9px 18px rgba(70, 88, 105, 0.19),
    inset 0 1px 0 #ffffff,
    inset 0 -1px 0 rgba(155, 174, 190, 0.3);
}

.knowledge-tree-node {
  border-left: 3px solid #8bbfdf;
  background: linear-gradient(180deg, #ffffff 0%, #f3f7fa 100%);
  box-shadow:
    0 3px 8px rgba(65, 85, 103, 0.12),
    inset 0 1px 0 #ffffff;
}

main .metal-panel,
main .classic-widget,
main .inset-panel {
  border-radius: 0 !important;
}

/* ============================================================================
   Autocomplete / Airport Suggestions Styling
   ============================================================================ */

.airport-page-grid {
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  overflow: visible;
}

.airport-search-column,
.airport-search-panel,
.airport-search-wrapper {
  position: relative;
  overflow: visible;
}

.airport-search-column {
  z-index: 40;
}

.airport-search-panel {
  z-index: 30;
}

.airport-suggestions-list {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  right: auto;
  z-index: 1000;
  width: min(460px, calc(100vw - 32px));
  max-width: min(460px, calc(100vw - 32px));
  max-height: min(24rem, 58vh);
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid #c8d2dd;
  border-radius: 0.55rem;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 42%, #eaf0f5 100%);
  box-shadow:
    0 12px 28px rgba(70, 86, 103, 0.22),
    inset 0 1px 0 #ffffff;
  list-style: none;
  padding: 0;
  margin: 0;
}

.airport-suggestions-list.hidden {
  display: none;
}

.airport-suggestion-item {
  min-width: 0;
  padding: 0.8rem 0.95rem;
  border-bottom: 1px solid rgba(200, 210, 221, 0.5);
  cursor: pointer;
  transition: background-color 160ms ease;
}

.airport-suggestion-item:last-child {
  border-bottom: none;
}

.airport-suggestion-item:hover,
.airport-suggestion-item.highlighted {
  background: linear-gradient(180deg, #e9f4fb 0%, #d4e8f6 100%);
}

.suggestion-header {
  display: flex;
  min-width: 0;
  gap: 0.6rem;
  align-items: flex-start;
  margin-bottom: 0.25rem;
}

.suggestion-code {
  min-width: 0;
  font-family: monospace;
  font-weight: 700;
  font-size: 0.9rem;
  color: #0e3e5c;
  letter-spacing: 0.05em;
  overflow-wrap: anywhere;
}

.suggestion-type {
  font-size: 0.7rem;
  font-weight: 600;
  color: #5a7a8f;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  border-radius: 0.375rem;
  background: rgba(14, 116, 144, 0.08);
  margin-left: auto;
  flex-shrink: 0;
  max-width: 42%;
  line-height: 1.2;
  text-align: right;
}

.suggestion-details {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.suggestion-name {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.35;
  color: #1e293b;
  overflow-wrap: anywhere;
}

.suggestion-location {
  font-size: 0.75rem;
  line-height: 1.35;
  color: #64748b;
  overflow-wrap: anywhere;
}

/* ============================================================================
   Scrollbar styling for autocomplete list
   ============================================================================ */

.airport-suggestions-list::-webkit-scrollbar {
  width: 6px;
}

.airport-suggestions-list::-webkit-scrollbar-track {
  background: rgba(200, 210, 221, 0.1);
  border-radius: 0.375rem;
}

.airport-suggestions-list::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.4);
  border-radius: 0.375rem;
}

.airport-suggestions-list::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.6);
}

@media (max-width: 820px) {
  .portal-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-header .decmet-shell {
    padding-block: 0;
  }
}

@media (max-width: 960px) {
  .airport-page-grid {
    grid-template-columns: 1fr;
  }

  .airport-suggestions-list {
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 520px) {
  body {
    padding-bottom: calc(5.9rem + env(safe-area-inset-bottom));
  }

  .site-header .decmet-shell {
    padding-block: 0;
  }

  .hero-copy {
    padding: 1.35rem;
  }

  .portal-nav {
    position: fixed;
    right: max(0.8rem, env(safe-area-inset-right));
    bottom: max(0.8rem, env(safe-area-inset-bottom));
    left: max(0.8rem, env(safe-area-inset-left));
    z-index: 2000;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.28rem;
    max-width: 28rem;
    margin-inline: auto;
    padding: 0.45rem;
    border-color: rgba(163, 184, 201, 0.92);
    border-radius: 1.15rem;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(232, 241, 248, 0.94) 54%, rgba(188, 207, 222, 0.96) 100%);
    box-shadow:
      0 16px 32px rgba(18, 39, 56, 0.28),
      0 3px 10px rgba(72, 91, 109, 0.18),
      inset 0 1px 0 rgba(255, 255, 255, 0.98),
      inset 0 -1px 0 rgba(104, 128, 148, 0.26);
    backdrop-filter: blur(14px) saturate(1.12);
  }

  .portal-nav-link {
    aspect-ratio: 1;
    min-height: 0;
    flex-direction: column;
    gap: 0.18rem;
    border-radius: 0.8rem;
    padding: 0.32rem 0.2rem;
    font-size: 0;
    text-shadow: none;
  }

  .portal-nav-link svg {
    width: 1.18rem;
    height: 1.18rem;
  }

  .portal-nav-link span {
    max-width: 100%;
    overflow: hidden;
    color: inherit;
    font-size: 0.56rem;
    font-weight: 800;
    line-height: 1.05;
    text-align: center;
    text-overflow: ellipsis;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.82);
    white-space: nowrap;
  }

  .portal-nav-link.is-active {
    transform: translateY(-0.16rem);
    box-shadow:
      0 7px 16px rgba(47, 84, 111, 0.24),
      inset 0 2px 5px rgba(55, 86, 110, 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 0.95);
  }

  .airport-suggestions-list {
    max-height: 62vh;
  }

  .suggestion-header {
    flex-direction: column;
    gap: 0.35rem;
  }

  .suggestion-type {
    max-width: 100%;
    margin-left: 0;
    text-align: left;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  body {
    padding-bottom: calc(6.5rem + env(safe-area-inset-bottom));
  }

  .portal-nav {
    position: fixed;
    right: max(1.2rem, env(safe-area-inset-right));
    bottom: max(1.2rem, env(safe-area-inset-bottom));
    left: max(1.2rem, env(safe-area-inset-left));
    z-index: 2000;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.4rem;
    max-width: 36rem;
    margin-inline: auto;
    padding: 0.55rem;
    border-color: rgba(163, 184, 201, 0.92);
    border-radius: 1.25rem;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(232, 241, 248, 0.94) 54%, rgba(188, 207, 222, 0.96) 100%);
    box-shadow:
      0 16px 32px rgba(18, 39, 56, 0.28),
      0 3px 10px rgba(72, 91, 109, 0.18),
      inset 0 1px 0 rgba(255, 255, 255, 0.98),
      inset 0 -1px 0 rgba(104, 128, 148, 0.26);
    backdrop-filter: blur(14px) saturate(1.12);
  }

  .portal-nav-link {
    aspect-ratio: 1;
    min-height: 0;
    flex-direction: column;
    gap: 0.25rem;
    border-radius: 0.9rem;
    padding: 0.45rem 0.25rem;
    font-size: 0;
    text-shadow: none;
  }

  .portal-nav-link svg {
    width: 1.35rem;
    height: 1.35rem;
  }

  .portal-nav-link span {
    max-width: 100%;
    overflow: hidden;
    color: inherit;
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1.05;
    text-align: center;
    text-overflow: ellipsis;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.82);
    white-space: nowrap;
  }

  .portal-nav-link.is-active {
    transform: translateY(-0.18rem);
    box-shadow:
      0 7px 16px rgba(47, 84, 111, 0.24),
      inset 0 2px 5px rgba(55, 86, 110, 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 0.95);
  }
}

@media (min-width: 1025px) and (max-width: 1366px) {
  body {
    padding-bottom: calc(7rem + env(safe-area-inset-bottom));
  }

  .portal-nav {
    position: fixed;
    right: max(1.5rem, env(safe-area-inset-right));
    bottom: max(1.5rem, env(safe-area-inset-bottom));
    left: max(1.5rem, env(safe-area-inset-left));
    z-index: 2000;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.5rem;
    max-width: 42rem;
    margin-inline: auto;
    padding: 0.65rem;
    border-color: rgba(163, 184, 201, 0.92);
    border-radius: 1.35rem;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(232, 241, 248, 0.94) 54%, rgba(188, 207, 222, 0.96) 100%);
    box-shadow:
      0 16px 32px rgba(18, 39, 56, 0.28),
      0 3px 10px rgba(72, 91, 109, 0.18),
      inset 0 1px 0 rgba(255, 255, 255, 0.98),
      inset 0 -1px 0 rgba(104, 128, 148, 0.26);
    backdrop-filter: blur(14px) saturate(1.12);
  }

  .portal-nav-link {
    aspect-ratio: 1;
    min-height: 0;
    flex-direction: column;
    gap: 0.3rem;
    border-radius: 1rem;
    padding: 0.55rem 0.3rem;
    font-size: 0;
    text-shadow: none;
  }

  .portal-nav-link svg {
    width: 1.5rem;
    height: 1.5rem;
  }

  .portal-nav-link span {
    max-width: 100%;
    overflow: hidden;
    color: inherit;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.05;
    text-align: center;
    text-overflow: ellipsis;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.82);
    white-space: nowrap;
  }

  .portal-nav-link.is-active {
    transform: translateY(-0.2rem);
    box-shadow:
      0 7px 16px rgba(47, 84, 111, 0.24),
      inset 0 2px 5px rgba(55, 86, 110, 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 0.95);
  }
}

@media (max-width: 360px) {
  .portal-nav-link span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
}
