@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Noto+Sans+SC:wght@400;500;600;700&display=swap");

:root {
  --bg: #f3f5f7;
  --paper: #ffffff;
  --paper-soft: #f8fafc;
  --line: #dfe4ea;
  --line-strong: #ccd4de;
  --text: #172033;
  --muted: #6b778c;
  --soft: #98a2b1;
  --blue: #1877f2;
  --blue-dark: #0f63d8;
  --blue-soft: #eaf2fe;
  --shadow: 0 18px 50px rgba(28, 43, 66, 0.12);
  --sidebar-panel-width: 248px;
  --sidebar-rail-width: 78px;
  --sidebar-page-offset: 170px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-width: 320px; min-height: 100%; }
body {
  color: var(--text);
  background: var(--bg);
  font-family: "DM Sans", "Noto Sans SC", system-ui, sans-serif;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

body.auth-required { overflow: hidden; }
body.auth-required .app-shell { visibility: hidden; }
.auth-gate {
  position: fixed;
  z-index: 1000;
  inset: 0;
  padding: 28px;
  display: grid;
  place-items: center;
  overflow-y: auto;
  background:
    radial-gradient(circle at 72% 18%, rgba(24,119,242,.14), transparent 32%),
    linear-gradient(145deg, #eef2f6 0%, #f8fafc 52%, #e9eef4 100%);
}
.auth-card {
  width: min(100%,430px);
  padding: 30px;
  border: 1px solid rgba(196,207,220,.9);
  border-radius: 20px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 28px 80px rgba(31,47,69,.16);
  backdrop-filter: blur(18px);
}
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand img { width: 44px; height: 44px; display: block; }
.auth-brand div { display: grid; gap: 2px; }
.auth-brand strong { font-size: 16px; letter-spacing: -.02em; }
.auth-brand span { color: var(--muted); font-size: 11px; }
.auth-heading { margin: 32px 0 20px; }
.auth-heading h1 { margin: 0; font-size: 30px; letter-spacing: -.04em; }
.auth-heading p { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.auth-tabs {
  margin-bottom: 18px;
  padding: 3px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: 10px;
  background: #edf1f5;
}
.auth-tabs button {
  height: 34px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.auth-tabs button.active { color: var(--text); background: white; box-shadow: 0 2px 8px rgba(30,45,65,.09); }
.auth-form { display: grid; gap: 13px; }
.auth-form label { display: grid; gap: 7px; }
.auth-form label span { color: var(--muted); font-size: 11px; font-weight: 500; }
.auth-form .auth-remember { display: flex; align-items: center; gap: 9px; color: #53637a; cursor: pointer; }
.auth-form .auth-remember input { width: 16px; height: 16px; padding: 0; border-radius: 4px; accent-color: var(--blue); box-shadow: none; cursor: pointer; }
.auth-remember[hidden] { display: none; }
.auth-form input {
  width: 100%;
  height: 43px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  outline: 0;
  color: var(--text);
  background: white;
  font-size: 13px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.auth-form input:focus { border-color: #8bbaf8; box-shadow: 0 0 0 3px rgba(24,119,242,.09); }
.auth-submit {
  height: 43px;
  margin-top: 4px;
  border: 0;
  border-radius: 9px;
  color: white;
  background: var(--blue);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.auth-submit:hover { background: var(--blue-dark); }
.auth-submit:disabled { cursor: wait; opacity: .65; }
.auth-forgot {
  margin: 14px auto 0;
  display: block;
  border: 0;
  color: var(--blue);
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}
.auth-message { min-height: 18px; margin: 14px 0 0; color: #27804a; font-size: 11px; line-height: 1.45; text-align: center; }
.auth-message.error { color: #bd3f36; }
.boarding-gate {
  position: fixed;
  z-index: 1100;
  inset: 0;
  padding: 28px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 68% 24%, rgba(24,119,242,.16), transparent 34%),
    linear-gradient(145deg,#edf2f7 0%,#f8fafc 52%,#e7edf5 100%);
}
.boarding-card {
  width: min(100%,430px);
  padding: 42px 34px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid rgba(196,207,220,.92);
  border-radius: 22px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 30px 90px rgba(31,47,69,.17);
  text-align: center;
  backdrop-filter: blur(18px);
}
.boarding-logo { width: 48px; height: 48px; display: block; margin-bottom: 25px; filter: drop-shadow(0 7px 12px rgba(35,53,75,.15)); }
.boarding-spinner {
  position: relative;
  width: 64px;
  height: 64px;
  margin-bottom: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(from 20deg,var(--blue),#80b7fa 42%,rgba(24,119,242,.08) 72%);
  animation: boardingSpin 1.05s linear infinite;
}
.boarding-spinner::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: white; }
.boarding-spinner span { position: relative; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 5px rgba(24,119,242,.10); }
.boarding-card h1 { margin: 0; color: var(--text); font-size: 27px; letter-spacing: -.04em; }
.boarding-card p { max-width: 320px; min-height: 42px; margin: 10px 0 23px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.boarding-progress { width: 100%; height: 4px; overflow: hidden; border-radius: 3px; background: #e9eef4; }
.boarding-progress i { width: 42%; height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg,#76b0fb,var(--blue)); animation: boardingProgress 1.45s ease-in-out infinite; }
.boarding-card button { min-height: 38px; margin-top: 21px; padding: 0 17px; border: 1px solid #a9cafa; border-radius: 9px; color: var(--blue); background: white; font-size: 11px; font-weight: 600; cursor: pointer; }
.boarding-card button:hover { color: white; background: var(--blue); }
.boarding-gate.error .boarding-spinner { animation: none; background: #f5d7d4; }
.boarding-gate.error .boarding-spinner span { background: #c43f35; box-shadow: none; }
.boarding-gate.error .boarding-progress { display: none; }
.boarding-gate.error .boarding-card p { color: #a43b33; }
@keyframes boardingSpin { to { transform: rotate(360deg); } }
@keyframes boardingProgress {
  0% { transform: translateX(-110%); }
  50% { transform: translateX(75%); }
  100% { transform: translateX(240%); }
}
@media (prefers-reduced-motion: reduce) {
  .boarding-spinner, .boarding-progress i { animation-duration: 2.8s; }
}

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  z-index: 50;
  inset: 0 auto 0 0;
  width: var(--sidebar-panel-width);
  padding: 22px 16px 18px;
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,.96);
  border-right: 1px solid var(--line);
  box-shadow: 7px 0 25px rgba(35, 48, 67, .05);
  transition: width .25s ease;
  backdrop-filter: blur(18px);
}
.sidebar-head { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; margin-bottom: 28px; }
.brand {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
}
.brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 6px 9px rgba(38,56,74,.2));
}
.brand-mark img { width: 100%; height: 100%; display: block; }
.brand-copy { min-width: 0; white-space: nowrap; }
.brand-copy strong { display: block; font-size: 17px; letter-spacing: -.2px; }
.brand-copy small { display: block; margin-top: 2px; color: var(--soft); font-size: 8px; letter-spacing: 1.25px; }
.collapse-button {
  position: static;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--muted);
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(28,43,66,.06);
}
.collapse-button:hover { color: var(--blue); border-color: #a9cafa; }
.collapse-button svg { width: 15px; transition: transform .25s; }
.main-nav { display: flex; flex-direction: column; gap: 5px; }
.nav-item {
  height: 45px;
  width: 100%;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 9px;
  color: #68768a;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: .16s ease;
}
.nav-item:hover { color: var(--text); background: #f3f6fa; }
.nav-item.active { color: var(--blue); background: var(--blue-soft); font-weight: 600; }
.nav-icon { width: 21px; height: 21px; flex: 0 0 21px; display: grid; place-items: center; }
.nav-icon svg { width: 19px; height: 19px; }
.nav-label { font-size: 13px; white-space: nowrap; }
.nav-count {
  min-width: 23px;
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 10px;
  color: #627087;
  background: #edf0f4;
  font-size: 9px;
  text-align: center;
}
.nav-item.active .nav-count { color: var(--blue); background: white; }
.map-control { margin-top: 25px; padding: 17px 12px; border-top: 1px solid var(--line); }
.section-label { display: block; margin-bottom: 9px; color: #8792a3; font-size: 10px; font-weight: 700; letter-spacing: 1.1px; text-transform: uppercase; }
.segmented-control { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; background: #edf1f5; border-radius: 8px; }
.segmented-control button { height: 31px; border: 0; border-radius: 6px; background: transparent; color: #7b8798; font-size: 11px; cursor: pointer; }
.segmented-control button.active { color: var(--blue); background: white; font-weight: 600; box-shadow: 0 2px 7px rgba(34,51,73,.08); }
.map-control p { margin: 12px 0 0; color: #8490a1; font-size: 10px; line-height: 1.65; }
.sidebar-spacer { flex: 1; }
.primary-button, .subtle-button {
  min-height: 38px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: .16s ease;
}
.primary-button { border: 1px solid var(--blue); color: white; background: var(--blue); }
.primary-button:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.subtle-button { border: 1px solid var(--line); color: #657287; background: white; }
.subtle-button:hover { border-color: #a9cafa; color: var(--blue); }
.primary-button svg, .subtle-button svg { width: 15px; }
.settings-area { position: relative; padding-top: 13px; border-top: 1px solid var(--line); }
.settings-button {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 0;
  border-radius: 9px;
  color: #68768a;
  background: transparent;
  font-size: 13px;
  cursor: pointer;
}
.settings-button:hover, .settings-button.active { color: var(--blue); background: var(--blue-soft); }
.settings-button svg { width: 19px; flex: 0 0 19px; }
.settings-panel {
  position: absolute;
  z-index: 70;
  left: calc(100% + 14px);
  bottom: 0;
  width: 320px;
  max-height: min(84vh,760px);
  padding: 16px;
  overflow-y: auto;
  visibility: hidden;
  opacity: 0;
  transform: translateX(-8px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 18px 48px rgba(20,32,48,.16);
  transition: .18s ease;
}
.settings-panel.open { visibility: visible; opacity: 1; transform: none; }
.settings-head { margin-bottom: 15px; display: flex; align-items: center; justify-content: space-between; }
.settings-head strong { font-size: 15px; }
.settings-head button { width: 27px; height: 27px; display: grid; place-items: center; border: 0; border-radius: 50%; color: var(--muted); background: transparent; cursor: pointer; }
.settings-head button:hover { color: var(--blue); background: var(--blue-soft); }
.settings-head svg { width: 15px; }
.settings-label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 11px; }
.settings-preferences { margin-top: 13px; display: grid; gap: 10px; }
.settings-field { display: block; }
.settings-field .settings-label { margin-bottom: 6px; }
.settings-field select,
.settings-field input {
  width: 100%;
  height: 36px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  color: var(--text);
  background: white;
  font-size: 11px;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.settings-field input { padding: 0 10px; }
.settings-field select:hover, .settings-field input:hover { border-color: #abc7ec; }
.settings-field select:focus, .settings-field input:focus { border-color: #8bbaf8; box-shadow: 0 0 0 3px rgba(24,119,242,.08); }
.author-contact { margin-top: 14px; padding-top: 13px; display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--line); }
.author-contact span { color: var(--muted); font-size: 10px; }
.author-contact a + span { margin-top: 8px; }
.author-contact strong, .author-contact a { color: var(--text); font-size: 12px; font-weight: 500; text-decoration: none; }
.author-contact a:hover { color: var(--blue); }
.account-settings { margin-top: 14px; padding-top: 13px; display: grid; gap: 9px; border-top: 1px solid var(--line); }
.settings-section-head { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.settings-section-head .settings-label { margin: 0; }
.settings-edit-button {
  padding: 3px 0;
  border: 0;
  color: var(--blue);
  background: transparent;
  font-size: 10px;
  font-weight: 650;
  cursor: pointer;
}
.settings-editor { display: grid; gap: 9px; }
.password-editor { padding-top: 3px; display: grid; gap: 7px; }
.password-editor input {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  color: var(--text);
  background: white;
  font-size: 11px;
}
.password-editor button, .settings-signout-button {
  min-height: 31px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: white;
  font-size: 10px;
  cursor: pointer;
}
.settings-signout-button:hover, .password-editor button:hover { color: var(--blue); border-color: #a9cafa; }
.account-identity { min-width: 0; display: flex; align-items: center; gap: 8px; }
.account-identity b {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--blue);
  font-size: 11px;
}
.account-identity b img, .sidebar-account-summary b img, .onboarding-avatar-row b img { width: 100%; height: 100%; display: block; border-radius: inherit; object-fit: cover; }
.account-identity div { min-width: 0; }
.account-identity strong, .account-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-identity small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.avatar-upload { min-height: 34px; padding: 0 10px; display: flex; align-items: center; justify-content: center; border: 1px dashed #abc7ec; border-radius: 8px; color: var(--blue); background: #f8fbff; font-size: 10px; cursor: pointer; }
.avatar-upload:hover { border-color: var(--blue); }
.avatar-upload input { display: none; }
.account-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.account-actions button, .settings-save-button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #a9cafa;
  border-radius: 8px;
  color: var(--blue);
  background: white;
  font-size: 10px;
  cursor: pointer;
}
.account-actions button:hover, .settings-save-button:hover { color: white; background: var(--blue); }
.favourite-settings { margin-top: 14px; padding-top: 13px; display: grid; gap: 9px; border-top: 1px solid var(--line); }
.favourite-editor { grid-template-columns: repeat(2,minmax(0,1fr)); }
.favourite-editor > button { grid-column: 1 / -1; }
.favourite-settings label > span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; }
.favourite-summary { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px 10px; }
.favourite-summary span { min-width: 0; }
.favourite-summary small, .favourite-summary strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.favourite-summary small { color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .3px; }
.favourite-summary strong { margin-top: 2px; font-size: 10px; font-weight: 600; }
.settings-save-button { width: 100%; }
.feedback-link { margin-top: 9px; padding-top: 9px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); }
.feedback-link svg { width: 15px; }
.sidebar-account-summary { min-width: 0; margin-bottom: 8px; padding: 0 10px; display: flex; align-items: center; gap: 9px; }
.sidebar-account-summary b { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; color: white; background: var(--blue); font-size: 10px; }
.sidebar-account-summary span { min-width: 0; }
.sidebar-account-summary strong, .sidebar-account-summary small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-account-summary strong { font-size: 10px; }
.sidebar-account-summary small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.author-github { width: fit-content; display: inline-flex; align-items: center; gap: 8px; }
.author-github img { width: 28px; height: 28px; display: block; border: 1px solid rgba(35,51,72,.18); border-radius: 50%; object-fit: cover; box-shadow: 0 2px 7px rgba(35,51,72,.09); }
.author-github strong { color: inherit; font: inherit; }
.hub-settings { margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); }
.hub-settings-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hub-settings-head .settings-label { margin-bottom: 0; }
.hub-edit-button {
  height: 28px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #a9cafa;
  border-radius: 8px;
  color: var(--blue);
  background: white;
  font-size: 10px;
  cursor: pointer;
}
.hub-edit-button:hover, .hub-edit-button.active { color: white; border-color: var(--blue); background: var(--blue); }
.hub-edit-button svg { width: 12px; }
.hub-chips { min-height: 25px; margin-top: 9px; display: flex; flex-wrap: wrap; gap: 6px; }
.hub-chips span { padding: 5px 9px; border-radius: 13px; color: #c83d24; background: #fff0eb; font-size: 10px; font-weight: 600; }
.hub-chips .empty-hubs { color: var(--soft); background: var(--paper-soft); font-weight: 400; }
.hub-options {
  display: none;
  max-height: 230px;
  margin-top: 10px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
}
.hub-search {
  display: none;
  height: 38px;
  margin-top: 10px;
  padding: 0 9px;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
}
.hub-search.open { display: flex; }
.hub-search:focus-within { border-color: #85b6f6; box-shadow: 0 0 0 3px rgba(24,119,242,.08); }
.hub-search svg { width: 15px; flex: 0 0 15px; color: var(--muted); }
.hub-search input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 10px; }
.hub-search input::placeholder { color: var(--soft); }
.hub-search-status { margin: 0; padding: 14px 11px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.hub-options.open { display: block; }
.hub-country { border-bottom: 1px solid var(--line); }
.hub-country:last-child { border-bottom: 0; }
.hub-country summary {
  min-height: 38px;
  padding: 0 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #445165;
  background: var(--paper-soft);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.hub-country summary::-webkit-details-marker { display: none; }
.hub-country summary::before { content: "›"; color: var(--soft); font-size: 16px; transition: transform .16s; }
.hub-country[open] summary::before { transform: rotate(90deg); }
.hub-country summary span { flex: 1; }
.hub-country summary b { color: var(--blue); font-size: 9px; font-weight: 600; }
.hub-option {
  min-height: 38px;
  padding: 7px 9px;
  display: grid;
  grid-template-columns: 17px minmax(0,1fr);
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 10px;
  cursor: pointer;
}
.hub-option:last-child { border-bottom: 0; }
.hub-option:hover { background: var(--blue-soft); }
.hub-option input { width: 15px; height: 15px; margin: 0; accent-color: var(--blue); }
.hub-option strong { display: block; font-size: 10px; }
.hub-option small { display: block; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }

.app-shell.sidebar-collapsed .sidebar { width: var(--sidebar-rail-width); }
.sidebar-collapsed .sidebar { padding-left: 15px; padding-right: 15px; }
.sidebar-collapsed .brand-copy,
.sidebar-collapsed .nav-label,
.sidebar-collapsed .nav-count,
.sidebar-collapsed .map-control,
.sidebar-collapsed .settings-button span { display: none; }
.sidebar-collapsed .brand { display: none; }
.sidebar-collapsed .sidebar-head { justify-content: center; }
.sidebar-collapsed .nav-item { justify-content: center; padding: 0; }
.sidebar-collapsed .settings-button { justify-content: center; padding: 0; }
.sidebar-collapsed .sidebar-account-summary { justify-content: center; padding: 0; }
.sidebar-collapsed .sidebar-account-summary span { display: none; }
.sidebar-collapsed .collapse-button svg { transform: rotate(180deg); }

.incoming-sidebar { min-height: 0; display: none; flex: 1; flex-direction: column; }
.app-shell.incoming-mode .sidebar { width: 330px; box-shadow: 14px 0 38px rgba(24,35,52,.16); }
.incoming-mode .sidebar-head,
.incoming-mode .main-nav,
.incoming-mode .map-control,
.incoming-mode .sidebar-spacer,
.incoming-mode .settings-area { display: none; }
.incoming-mode .incoming-sidebar { display: flex; }
.incoming-collapse-button {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  z-index: 3;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #68768a;
  background: white;
  cursor: pointer;
}
.incoming-collapse-button:hover { color: var(--blue); border-color: #a9cafa; background: var(--blue-soft); }
.incoming-collapse-button svg { width: 17px; }
.incoming-mode .incoming-sidebar { position: relative; padding-top: 44px; }
.app-shell.incoming-mode.incoming-collapsed .sidebar { width: var(--sidebar-rail-width); padding-left: 15px; padding-right: 15px; }
.incoming-collapsed .incoming-sidebar { padding-top: 0; }
.incoming-collapsed .incoming-back,
.incoming-collapsed .incoming-head,
.incoming-collapsed .incoming-list { display: none; }
.incoming-collapsed .incoming-collapse-button { position: static; margin: 18px auto 0; }
.incoming-collapsed .incoming-collapse-button svg { transform: rotate(180deg); }
.incoming-back {
  min-height: 38px;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 0;
  color: var(--blue);
  background: transparent;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.incoming-back svg { width: 16px; }
.incoming-head { margin: 18px 0 17px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.incoming-head > span { color: var(--blue); font-size: 9px; font-weight: 700; letter-spacing: 1.1px; text-transform: uppercase; }
.incoming-title-row { margin: 6px 0 4px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.incoming-head h2 { margin: 0; font-size: 24px; letter-spacing: -.5px; }
.incoming-head p { margin: 0; color: var(--muted); font-size: 11px; }
.incoming-add-button {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border: 1px solid #a9cafa;
  border-radius: 9px;
  color: white;
  background: var(--blue);
  cursor: pointer;
}
.incoming-add-button:hover { background: var(--blue-dark); }
.incoming-add-button svg { width: 17px; }
.incoming-list { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 9px; }
.incoming-flight {
  width: 100%;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--text);
  background: white;
  text-align: left;
  cursor: pointer;
  transition: .16s ease;
}
.incoming-flight:hover { border-color: #9fc5f8; box-shadow: 0 9px 22px rgba(35,51,72,.07); transform: translateY(-1px); }
.incoming-flight-top { display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 9px; align-items: center; }
.incoming-airline-icon { width: 34px; height: 28px; display: grid; place-items: center; color: var(--blue); font-size: 9px; font-weight: 700; }
.incoming-airline-icon img { width: 100%; height: 100%; object-fit: contain; }
.incoming-flight-top span { min-width: 0; }
.incoming-flight-top strong { display: block; font-size: 13px; }
.incoming-flight-top small { display: block; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.incoming-flight-route { margin: 13px 0 0 -2px; display: grid; grid-template-columns: auto 40px auto minmax(62px,1fr); gap: 7px; align-items: center; }
.incoming-flight-route strong { font-size: 17px; }
.incoming-flight-route strong:first-child { justify-self: start; }
.incoming-flight-route i { height: 1px; position: relative; background: #b8d3f6; }
.incoming-flight-route i::after { content: ""; position: absolute; right: 0; top: -2px; border-left: 5px solid var(--blue); border-top: 2.5px solid transparent; border-bottom: 2.5px solid transparent; }
.incoming-flight-route b { justify-self: end; color: var(--text); font-size: 15px; font-weight: 700; white-space: nowrap; }
.incoming-flight p { margin: 6px 0 0; color: var(--muted); font-size: 10px; }
.incoming-empty { margin-top: 30px; padding: 30px 12px; text-align: center; color: var(--soft); border: 1px dashed var(--line-strong); border-radius: 13px; }
.incoming-empty span { display: block; margin-bottom: 9px; color: #a9cafa; font-size: 25px; }
.incoming-empty p { margin: 0; font-size: 11px; line-height: 1.5; }

.main-content { min-height: 100vh; margin-left: var(--sidebar-rail-width); }
.view { display: none; }
.view.active { display: block; animation: pageIn .22s ease; }
@keyframes pageIn { from { opacity: 0; } }
.atlas-view { position: relative; height: 100vh; overflow: hidden; background: #081d35; }
#globeCanvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; }
#globeCanvas.dragging { cursor: grabbing; }
.globe-style-switch {
  position: absolute;
  z-index: 16;
  top: 18px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.globe-style-switch button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: rgba(255,255,255,.58);
  background: transparent;
  cursor: pointer;
  transition: .16s ease;
}
.globe-style-switch button:hover { color: white; background: rgba(255,255,255,.08); }
.globe-style-switch button.active { color: #fff; background: transparent; }
.globe-style-switch button.active::after { content: ""; position: absolute; bottom: 0; width: 15px; height: 2px; border-radius: 2px; background: #ff5200; }
.globe-style-switch button { position: relative; }
.globe-style-switch svg { width: 23px; height: 23px; }
.globe-loading {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255,255,255,.84);
  border: 1px solid var(--line);
  font-size: 9px;
  pointer-events: none;
  transition: opacity .25s;
}
.globe-loading.hidden { opacity: 0; }
.globe-loading span { width: 12px; height: 12px; border: 2px solid #cdd8e5; border-top-color: var(--blue); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hover-tooltip {
  position: absolute;
  z-index: 12;
  display: none;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: rgba(255,255,255,.94);
  box-shadow: 0 8px 22px rgba(33,49,70,.12);
  font-size: 9px;
  pointer-events: none;
}
.hover-tooltip b { color: var(--blue); }
.info-drawer {
  position: absolute;
  z-index: 20;
  inset: 0 0 0 auto;
  width: min(390px, calc(100% - 20px));
  padding: 38px 25px 25px;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: rgba(255,255,255,.97);
  box-shadow: -18px 0 45px rgba(34,49,68,.12);
  transform: translateX(105%);
  transition: transform .26s ease;
  backdrop-filter: blur(18px);
}
.info-drawer.open { transform: translateX(0); }
.drawer-close, .modal-close {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: #7e8999;
  background: white;
  cursor: pointer;
}
.drawer-close { position: absolute; right: 19px; top: 18px; }
.drawer-close:hover, .modal-close:hover { color: var(--blue); border-color: #a9cafa; }
.drawer-close svg, .modal-close svg { width: 15px; }
.drawer-kicker { color: var(--blue); font-size: 8px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; }
.drawer-title { margin: 9px 40px 5px 0; font-size: 25px; letter-spacing: -.5px; }
.drawer-subtitle { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.drawer-metrics { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; margin: 22px 0; }
.drawer-metrics div { padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper-soft); }
.drawer-metrics strong { display: block; font-size: 16px; }
.drawer-metrics span { color: var(--soft); font-size: 8px; }
.drawer-section-title { margin: 24px 0 9px; color: #8793a5; font-size: 8px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.drawer-flight {
  margin-bottom: 8px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  cursor: pointer;
}
.drawer-flight:hover { border-color: #a9cafa; background: #fbfdff; }
.drawer-flight.highlighted { border-color: #8bbcfb; background: #f2f7ff; box-shadow: inset 3px 0 var(--blue); }
.drawer-flight-top { display: flex; justify-content: space-between; align-items: center; }
.drawer-flight-identity { min-width: 0; display: flex; align-items: center; gap: 8px; }
.drawer-airline-icon { width: 30px; height: 24px; flex: 0 0 30px; display: grid; place-items: center; }
.drawer-airline-icon img { width: 100%; height: 100%; object-fit: contain; }
.drawer-airline-icon.airline-fallback { color: var(--blue); font-size: 9px; font-weight: 700; }
.drawer-flight-identity strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-flight-top strong { color: var(--text); font-size: 10px; }
.drawer-flight-top > span { flex: 0 0 auto; margin-left: 9px; color: var(--soft); font-size: 8px; }
.drawer-flight-route { display: grid; grid-template-columns: 1fr auto 1fr; gap: 9px; align-items: center; margin-top: 10px; }
.drawer-flight-route div:last-child { text-align: right; }
.drawer-flight-route b { display: block; font-size: 13px; }
.drawer-flight-route small { color: var(--soft); font-size: 8px; }
.drawer-flight-route i { width: 55px; height: 1px; background: #b8d2f5; position: relative; }
.drawer-flight-route i::after { content: ""; position: absolute; right: -1px; top: -2px; border-left: 5px solid var(--blue); border-top: 2.5px solid transparent; border-bottom: 2.5px solid transparent; }
.connection-list { display: flex; flex-direction: column; gap: 7px; }
.connection-list button { padding: 11px 12px; display: flex; justify-content: space-between; border: 1px solid var(--line); border-radius: 8px; color: #4d5a6d; background: white; font-size: 9px; cursor: pointer; }
.connection-list button:hover { color: var(--blue); border-color: #a9cafa; }
.connection-list b { color: var(--blue); }

.page-view {
  min-height: 100vh;
  padding: 46px clamp(24px,4vw,62px) 70px calc(clamp(24px,4vw,62px) + var(--sidebar-page-offset));
  background: var(--bg);
}
.page-header { max-width: 1240px; margin: 0 auto 27px; display: flex; justify-content: space-between; align-items: flex-end; }
.page-kicker { color: var(--blue); font-size: 8px; font-weight: 700; letter-spacing: 1.5px; }
.page-header h1 { margin: 6px 0 4px; font-size: clamp(27px,3vw,38px); letter-spacing: -.8px; }
.page-header p { margin: 0; color: var(--muted); font-size: 13px; }
.records-heading { display: flex; align-items: flex-end; gap: 20px; }
.flight-total { margin-bottom: 5px; padding-left: 18px; display: flex; align-items: baseline; gap: 7px; border-left: 1px solid var(--line-strong); }
.flight-total strong { color: var(--blue); font-size: 25px; line-height: 1; }
.flight-total span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.page-add { min-width: 110px; }
.record-actions { display: flex; align-items: center; gap: 8px; }
.filter-bar { max-width: 1240px; margin: 0 auto 16px; display: flex; align-items: center; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.stats-filter-bar { margin-bottom: 22px; }
.search-field {
  width: 310px;
  min-width: 230px;
  height: 39px;
  margin-right: 7px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
.search-field svg { width: 16px; color: #8c98a8; }
.search-field input { width: 100%; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 12px; }
.year-filter {
  height: 39px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  white-space: nowrap;
}
.year-filter span { color: var(--muted); font-size: 10px; }
.year-filter select { min-width: 92px; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 11px; cursor: pointer; }
.scope-filters { display: flex; align-items: center; gap: 8px; }
.filter-chip { height: 34px; padding: 0 15px; border: 1px solid var(--line); border-radius: 17px; color: #738095; background: white; font-size: 11px; white-space: nowrap; cursor: pointer; }
.filter-chip:hover, .filter-chip.active { color: var(--blue); border-color: #a9cafa; background: var(--blue-soft); }
.record-table-head {
  max-width: 1240px;
  margin: auto;
  padding: 0 18px 8px;
  display: grid;
  grid-template-columns: minmax(190px,1.05fr) 105px minmax(310px,1.65fr) minmax(230px,1.15fr) 85px 70px;
  gap: 16px;
  color: #8a96a7;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .6px;
}
.flight-list { max-width: 1240px; margin: auto; display: flex; flex-direction: column; gap: 8px; }
.flight-row {
  min-height: 83px;
  padding: 14px 18px;
  display: grid;
  grid-template-columns: minmax(190px,1.05fr) 105px minmax(310px,1.65fr) minmax(230px,1.15fr) 85px 70px;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  cursor: pointer;
  transition: .16s ease;
}
.flight-row:hover { transform: translateY(-1px); border-color: #a9cafa; box-shadow: 0 8px 22px rgba(35,51,72,.07); }
.airline-cell { min-width: 0; display: flex; align-items: center; gap: 12px; }
.airline-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.airline-icon img { width: 94%; height: 94%; object-fit: contain; }
.airline-fallback { color: var(--blue); background: transparent; font-size: 14px; font-weight: 700; }
.airline-cell strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.airline-cell .flight-number { color: var(--text); font-size: 18px; line-height: 1.2; letter-spacing: -.2px; }
.airline-cell small { display: block; max-width: 125px; margin-top: 3px; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.date-cell strong { display: block; font-size: 12px; font-weight: 500; }
.date-cell small { color: var(--soft); font-size: 10px; }
.route-cell { display: grid; grid-template-columns: 92px 1fr 92px; align-items: center; gap: 12px; }
.route-point:last-child { text-align: right; }
.route-point strong { font-size: 17px; }
.route-point span { display: block; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.route-point small { display: block; margin-top: 3px; color: var(--text); font-size: 12px; font-weight: 600; }
.route-line { text-align: center; color: var(--muted); font-size: 10px; }
.route-line i { position: relative; display: block; height: 1px; margin: 6px 0; background: #b9d2f4; }
.route-line i::before, .route-line i::after { content: ""; position: absolute; top: -2px; width: 5px; height: 5px; border: 1px solid var(--blue); border-radius: 50%; background: white; }
.route-line i::before { left: 0; } .route-line i::after { right: 0; }
.flight-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 12px; }
.flight-meta span { color: var(--muted); font-size: 10px; }
.flight-meta b { display: block; color: #435064; font-size: 11px; font-weight: 500; }
.fare-cell strong { display: block; font-size: 13px; }
.fare-cell small { color: var(--soft); font-size: 10px; }
.row-arrow { color: #9da8b7; }
.row-arrow svg { width: 15px; }
.flight-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.flight-row-actions button { width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 7px; color: #7d899a; background: transparent; cursor: pointer; }
.flight-row-actions button:hover { color: var(--blue); background: var(--blue-soft); }
.flight-row-actions button[data-row-delete]:hover { color: #c9332b; background: #fff0ef; }
.flight-row-actions svg { width: 15px; }
.empty-state { padding: 70px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 10px; background: white; }

.stats-list { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.stat-block {
  width: 100%;
  min-height: 320px;
  aspect-ratio: 1;
  padding: 27px;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  grid-template-rows: auto 1fr auto auto;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 22px;
  color: var(--text);
  background: white;
  text-align: left;
  cursor: pointer;
  transition: .16s ease;
}
.stat-block:hover { transform: translateY(-3px); border-color: #a9cafa; box-shadow: 0 16px 38px rgba(35,51,72,.09); }
.stat-block.aligned-stat { grid-template-rows: auto minmax(58px,1fr) minmax(22px,auto) 124px; }
.stat-block.aligned-stat .stat-highlights { min-height: 124px; grid-template-rows: repeat(2,minmax(62px,1fr)); }
.stat-block.aligned-stat .stat-highlight-entry { min-height: 62px; }
.stat-label { font-size: 22px; font-weight: 650; letter-spacing: -.35px; }
.stat-arrow { grid-column: 2; grid-row: 1; align-self: center; color: #9da8b7; font-size: 28px; font-style: normal; line-height: 1; }
.stat-value { grid-column: 1 / -1; align-self: end; color: var(--blue); font-size: clamp(27px,3vw,42px); line-height: 1.08; overflow-wrap: anywhere; text-align: left; }
.stat-unit { grid-column: 1 / -1; color: #526176; font-size: 16px; font-weight: 600; line-height: 1.35; }
.stat-highlights { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr; gap: 0; }
.stat-highlights > .stat-highlight-entry {
  min-width: 0;
  min-height: 52px;
  padding-top: 10px;
  display: grid;
  grid-template-columns: minmax(0,1fr);
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
}
.stat-highlights > .has-highlight-logo { grid-template-columns: 42px minmax(0,1fr); }
.stat-highlight-copy { min-width: 0; display: block; }
.stat-highlight-copy > span { display: block; color: var(--soft); font-size: 10px; font-weight: 700; letter-spacing: .45px; text-transform: uppercase; }
.stat-highlight-copy > strong { display: block; margin-top: 3px; overflow: hidden; color: var(--text); font-size: 16px; font-weight: 650; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.stat-highlight-copy > small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 600; }
.stat-highlight-logo { width: 36px; height: 28px; display: grid; place-items: center; color: var(--blue); font-size: 9px; font-weight: 700; }
.stat-highlight-logo img { width: 100%; height: 100%; object-fit: contain; }
.stat-highlight-logo.rounded-flag-mark { width: 32px; height: 32px; overflow: hidden; border: 1px solid #dbe2eb; border-radius: 50%; box-shadow: 0 2px 7px rgba(35,51,72,.08); }
.stat-highlight-logo.rounded-flag-mark img { object-fit: cover; }
.stat-highlight-logo.entity-code-fallback,
.stat-highlight-logo.entity-empty-mark { border-radius: 9px; color: #74849a; background: var(--paper-soft); font-size: 10px; }
.stat-block.simple .stat-value { align-self: end; }
.stat-block.simple .stat-unit { margin-bottom: 4px; }

.stats-kpis { max-width: 1240px; margin: 0 auto 14px; display: grid; grid-template-columns: repeat(4,1fr); gap: 11px; }
.stats-kpis article, .data-card { border: 1px solid var(--line); border-radius: 11px; background: white; }
.stats-kpis article { min-height: 116px; padding: 18px; }
.stats-kpis article > span { color: var(--muted); font-size: 9px; }
.stats-kpis strong { display: block; margin: 12px 0 5px; font-size: 22px; letter-spacing: -.4px; }
.stats-kpis strong small { color: #788599; font-size: 10px; font-weight: 500; }
.stats-kpis p { margin: 0; color: var(--soft); font-size: 8px; }
.stats-kpis article:first-child strong { color: var(--blue); }
.stats-grid { max-width: 1240px; margin: auto; display: grid; grid-template-columns: 1.1fr .9fr; gap: 12px; }
.data-card { min-height: 280px; padding: 20px; }
.card-head { margin-bottom: 20px; display: flex; justify-content: space-between; align-items: flex-start; }
.card-head span { color: #8793a4; font-size: 8px; font-weight: 700; letter-spacing: 1px; }
.card-head h2 { margin: 4px 0 0; font-size: 15px; }
.card-head > b { color: var(--blue); font-size: 10px; }
.ranking-row { margin: 14px 0; display: grid; grid-template-columns: 22px 132px 1fr 36px; align-items: center; gap: 8px; }
.ranking-row > span { color: #9aa4b3; font-size: 8px; }
.ranking-row strong { font-size: 9px; font-weight: 500; }
.rank-track { height: 6px; border-radius: 4px; background: #edf1f5; overflow: hidden; }
.rank-track i { display: block; height: 100%; border-radius: inherit; background: var(--blue); }
.ranking-row b { color: #788599; font-size: 8px; text-align: right; }
.aircraft-summary { display: flex; align-items: center; justify-content: center; gap: 35px; padding-top: 10px; }
.donut { width: 145px; height: 145px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(#1877f2 0 44%,#5b9df5 44% 66%,#8bb9f7 66% 83%,#c6d8ef 83%); }
.donut::before { content: ""; width: 94px; height: 94px; border-radius: 50%; background: white; grid-area: 1/1; }
.donut span { z-index: 1; grid-area: 1/1; color: var(--muted); font-size: 8px; text-align: center; }
.donut strong { display: block; color: var(--text); font-size: 22px; }
.legend p { min-width: 160px; margin: 12px 0; display: grid; grid-template-columns: 10px 1fr 16px; gap: 6px; color: #69768a; font-size: 8px; }
.legend i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.legend b { color: var(--text); text-align: right; }
.airport-bars { display: flex; flex-direction: column; gap: 15px; }
.airport-row { display: grid; grid-template-columns: 82px 1fr 22px; gap: 10px; align-items: center; font-size: 8px; }
.airport-row span { color: #5d6a7d; }
.airport-row i { height: 6px; border-radius: 4px; background: #edf1f5; overflow: hidden; }
.airport-row i::after { content: ""; display: block; width: var(--w); height: 100%; background: #5b9df5; border-radius: inherit; }
.airport-row b { color: #7c899a; text-align: right; }
.countries-card { background: #f8fbff; }
.country-list { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.country-list span { padding: 12px; border: 1px solid #dce8f7; border-radius: 8px; color: #4e5c70; background: white; font-size: 9px; }
.country-list b { float: right; color: var(--blue); }

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  padding: 28px 16px;
  display: none;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  background: rgba(34,44,58,.36);
  backdrop-filter: blur(5px);
}
.modal-backdrop.open { display: flex; animation: fadeIn .18s ease; }
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  position: relative;
  width: min(650px,100%);
  max-height: calc(100vh - 56px);
  padding: 27px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: white;
  box-shadow: var(--shadow);
}
.modal-close { position: absolute; right: 16px; top: 16px; }
.modal-back {
  min-height: 32px;
  padding: 0 9px 0 5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  border-radius: 7px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}
.modal-back:hover { background: #dceafe; }
.modal-back[hidden] { display: none; }
.modal-back svg { width: 15px; }
.stats-return-button { margin: -8px 0 14px; }
.detail-modal { width: min(580px,100%); }
.modal-title-row { min-height: 61px; padding-right: 38px; display: flex; align-items: center; gap: 13px; }
.detail-logo { width: 64px; height: 55px; display: grid; place-items: center; overflow: visible; border: 0; border-radius: 0; background: transparent; color: var(--blue); font-weight: 700; }
.detail-logo img { width: 100%; height: 100%; object-fit: contain; }
.modal-title-row span { color: var(--muted); font-size: 9px; }
.modal-title-row h2 { margin: 2px 0; font-size: 21px; }
.modal-title-row p { margin: 0; color: var(--soft); font-size: 8px; }
.detail-route { margin: 24px 0 18px; padding: 20px 0; display: grid; grid-template-columns: 1fr 1.2fr 1fr; align-items: center; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.detail-route > div:not(.detail-flight-line) { min-height: 96px; display: grid; grid-template-rows: 34px 42px 20px; align-items: start; }
.detail-route > div:not(.detail-flight-line) > strong { align-self: start; font-size: 25px; line-height: 32px; }
.detail-route > div:not(.detail-flight-line) > span { align-self: start; color: #5b687a; font-size: 9px; line-height: 1.4; }
.detail-route > div:not(.detail-flight-line) > small { align-self: end; margin: 0; color: var(--text); font-size: 17px; font-weight: 600; line-height: 20px; }
.detail-route .align-right { justify-items: end; text-align: right; }
.detail-flight-line { align-self: center; display: flex; flex-direction: column; text-align: center; }
.detail-flight-line span { align-self: center; color: #5b687a; }
.detail-flight-line small { align-self: center; margin-top: 5px; color: var(--soft); }
.detail-flight-line i { position: relative; height: 1px; margin: 8px 0 3px; background: #b6d2f7; }
.detail-flight-line i::after { content: ""; position: absolute; right: 0; top: -2px; border-left: 5px solid var(--blue); border-top: 2.5px solid transparent; border-bottom: 2.5px solid transparent; }
.detail-aircraft-visual {
  margin: -3px 0 18px;
  padding: 5px 0;
  overflow: hidden;
}
.detail-aircraft-visual[hidden] { display: none; }
.detail-aircraft-visual img { width: 100%; height: auto; display: block; object-fit: contain; }
.detail-info-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; }
.detail-info-grid div { min-height: 61px; padding: 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper-soft); }
.detail-info-grid span, .detail-note > span { color: var(--soft); font-size: 8px; }
.detail-info-grid strong { display: block; margin-top: 4px; font-size: 9px; }
.detail-note { margin-top: 9px; padding: 13px; border-radius: 8px; background: var(--paper-soft); }
.detail-note p { margin: 6px 0 0; color: #657287; font-size: 9px; line-height: 1.7; }
.modal-actions { margin-top: 20px; display: flex; justify-content: flex-end; gap: 8px; }
.modal-action-spacer { flex: 1; }
.danger-button { color: #b42318; border-color: #f0c6c2; }
.danger-button:hover { color: white; border-color: #c9332b; background: #c9332b; }
.onboarding-backdrop { z-index: 180; }
.onboarding-modal { width: min(680px,100%); max-height: min(90vh,820px); overflow-y: auto; }
.onboarding-head { margin-bottom: 22px; display: flex; align-items: center; gap: 13px; }
.onboarding-head img { width: 48px; height: 48px; }
.onboarding-head span { color: var(--blue); font-size: 9px; font-weight: 700; letter-spacing: 1px; }
.onboarding-head h2 { margin: 4px 0 0; font-size: 26px; }
.onboarding-modal p { margin: 0 0 17px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.onboarding-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.onboarding-grid label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; }
.onboarding-grid input, .onboarding-grid select { width: 100%; height: 40px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; outline: 0; color: var(--text); background: white; }
.onboarding-grid input:focus, .onboarding-grid select:focus { border-color: #8bbaf8; box-shadow: 0 0 0 3px rgba(24,119,242,.08); }
.onboarding-avatar-row { margin-bottom: 18px; display: flex; align-items: center; gap: 12px; }
.onboarding-avatar-row b { width: 54px; height: 54px; flex: 0 0 54px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; color: white; background: var(--blue); }
.onboarding-avatar-row .avatar-upload { min-width: 140px; }
.onboarding-section { margin: 16px 0 18px; padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper-soft); }
.onboarding-section .hub-search { display: flex; }
.onboarding-section .hub-options { display: block; max-height: 170px; }
.onboarding-favourites { grid-template-columns: repeat(3,minmax(0,1fr)); }
.modal-header > span { color: var(--blue); font-size: 8px; font-weight: 700; letter-spacing: 1px; }
.modal-header h2 { margin: 5px 0 4px; font-size: 22px; }
.modal-header p { margin: 0; color: var(--muted); font-size: 9px; }
.form-modal { width: min(750px,100%); }
.form-modal form { margin-top: 20px; }
.incoming-form-modal form { margin-top: 20px; }
.smart-lookup { margin-bottom: 16px; padding: 12px 13px; display: flex; justify-content: space-between; align-items: center; border: 1px solid #d2e3fa; border-radius: 8px; background: #f6faff; }
.smart-lookup strong { display: block; font-size: 9px; }
.smart-lookup div > span { color: #7b899c; font-size: 8px; }
.switch input { display: none; }
.switch > span { width: 35px; height: 19px; padding: 2px; display: block; border-radius: 12px; background: var(--blue); }
.switch > span::after { content: ""; display: block; width: 15px; height: 15px; margin-left: 16px; border-radius: 50%; background: white; transition: .2s; }
.switch input:not(:checked) + span { background: #c7ced7; }
.switch input:not(:checked) + span::after { margin-left: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; }
.form-grid label, .full-field { display: flex; flex-direction: column; gap: 5px; }
.form-grid label > span, .full-field > span { color: #6e7a8c; font-size: 8px; }
.form-grid input, .form-grid select, .full-field textarea { width: 100%; border: 1px solid var(--line); border-radius: 7px; outline: 0; color: var(--text); background: white; font-size: 9px; }
.form-grid input, .form-grid select { height: 37px; padding: 0 10px; }
.form-grid input:focus, .form-grid select:focus, .full-field textarea:focus { border-color: #8bbaf8; box-shadow: 0 0 0 3px rgba(24,119,242,.08); }
.full-field { margin-top: 12px; }
.full-field textarea { height: 70px; padding: 9px 10px; resize: vertical; }
.photo-upload { height: 84px; margin-top: 13px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px dashed #b9c3d0; border-radius: 8px; color: #7b8798; cursor: pointer; }
.photo-upload input, .drop-zone input { display: none; }
.photo-upload > span { color: var(--blue); font-size: 18px; }
.photo-upload strong { font-size: 9px; }
.photo-upload small { color: var(--soft); font-size: 8px; }
.import-modal { width: min(570px,100%); }
.import-steps { margin: 20px 0 14px; display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; }
.import-steps span { padding: 11px; border: 1px solid var(--line); border-radius: 8px; color: #69768a; font-size: 8px; background: var(--paper-soft); }
.import-steps b { display: block; color: var(--blue); margin-bottom: 5px; }
.import-steps i { font-style: normal; }
.drop-zone { min-height: 145px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px dashed #aab8ca; border-radius: 9px; background: #fbfcfe; cursor: pointer; }
.drop-zone:hover { border-color: var(--blue); }
.drop-zone svg { width: 28px; margin-bottom: 9px; color: var(--blue); }
.drop-zone strong { font-size: 9px; }
.drop-zone span { margin-top: 3px; color: var(--soft); font-size: 8px; }
.toast {
  position: fixed;
  z-index: 250;
  right: 22px;
  bottom: 22px;
  min-width: 220px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #c9defa;
  border-radius: 9px;
  background: white;
  box-shadow: var(--shadow);
  transform: translateY(120%);
  opacity: 0;
  transition: .25s ease;
}
.toast.show { transform: none; opacity: 1; }
.toast > span { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--blue); font-size: 10px; }
.toast strong { display: block; font-size: 9px; }
.toast small { color: var(--muted); font-size: 8px; }

.stats-detail-modal { width: min(900px,100%); }
.stats-detail-head { padding-right: 42px; }
.stats-detail-head h2 { margin: 0 0 3px; font-size: 27px; }
.stats-detail-head p { margin: 0; color: var(--blue); font-size: 17px; font-weight: 600; }
.stats-detail-content { margin-top: 22px; }
.stats-preference-panel {
  margin-bottom: 20px;
  padding: 0 18px;
  border: 1px solid #c9defa;
  border-radius: 14px;
  background: linear-gradient(135deg,#f4f8ff,#fff);
}
.stats-preference-row { min-height: 86px; display: grid; grid-template-columns: 68px minmax(0,1fr) auto; gap: 15px; align-items: center; }
.stats-preference-row + .stats-preference-row { border-top: 1px solid var(--line); }
.stats-preference-logo { width: 64px; height: 50px; display: grid; place-items: center; overflow: hidden; color: var(--blue); font-size: 10px; font-weight: 700; }
.stats-preference-logo img { width: 100%; height: 100%; display: block; object-fit: contain; }
.stats-preference-logo.rounded-flag-mark { width: 38px; height: 38px; border: 1px solid #dbe2eb; border-radius: 50%; box-shadow: 0 2px 7px rgba(35,51,72,.08); }
.stats-preference-logo.rounded-flag-mark img { object-fit: cover; }
.stats-preference-logo.entity-code-fallback,
.stats-preference-logo.entity-empty-mark { border-radius: 10px; color: #74849a; background: white; }
.stats-preference-copy { min-width: 0; }
.stats-preference-copy span { display: block; color: var(--muted); font-size: 10px; font-weight: 650; text-transform: uppercase; letter-spacing: .5px; }
.stats-preference-copy strong { display: block; margin-top: 4px; overflow: hidden; color: var(--text); font-size: 21px; text-overflow: ellipsis; white-space: nowrap; }

.friends-view { position: relative; }
.friends-view .page-header p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.friend-search-panel { margin-bottom: 22px; padding: 16px; display: flex; gap: 10px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.friend-search-panel .search-field { flex: 1; }
.friends-results, .friends-section > div { display: grid; gap: 9px; }
.friends-section { margin-top: 26px; }
.friends-section h2 { margin: 0 0 12px; font-size: 17px; }
.friend-card {
  min-height: 72px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: white;
}
.friend-avatar, .friend-records-panel header > b {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: linear-gradient(145deg,#1877f2,#0b4f9f);
  font-size: 15px;
}
.friend-copy { min-width: 0; flex: 1; }
.friend-copy strong, .friend-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend-copy strong { font-size: 14px; }
.friend-copy small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.friend-actions { display: flex; gap: 7px; }
.friend-actions button {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid #afccf5;
  border-radius: 8px;
  color: var(--blue);
  background: white;
  font-size: 11px;
  cursor: pointer;
}
.friend-actions button.primary { color: white; background: var(--blue); border-color: var(--blue); }
.friend-actions button.danger { color: #c54137; border-color: #edc1bd; }
.friends-empty { padding: 20px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); background: #f8fafc; font-size: 12px; text-align: center; }
.friend-records-panel { position: absolute; inset: 0; z-index: 5; padding: 34px 46px; overflow: auto; background: var(--page); }
.friend-records-panel > header { margin: 24px 0; display: flex; align-items: center; gap: 13px; }
.friend-records-panel h2 { margin: 0; font-size: 25px; }
.friend-records-panel p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.friend-flight-list { display: grid; gap: 9px; }
.friend-flight-row { padding: 14px 16px; display: grid; grid-template-columns: 190px 130px minmax(280px,1fr) 180px; gap: 16px; align-items: center; border: 1px solid var(--line); border-radius: 13px; background: white; }
.friend-flight-row .airline-cell { min-width: 0; }
.friend-flight-route { display: flex; align-items: center; gap: 10px; }
.friend-flight-route strong { font-size: 19px; }
.friend-flight-route i { width: 32px; height: 1px; background: #afbdd0; }
.friend-flight-row > small { color: var(--muted); font-size: 11px; }
.friend-flight-row > b { font-size: 12px; font-weight: 600; }
.onboarding-username { margin: 14px 0; display: grid; gap: 6px; color: var(--muted); font-size: 11px; }
.onboarding-username input { height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; outline: 0; }

@media (max-width: 900px) {
  .friend-flight-row { grid-template-columns: 1fr 100px; }
  .friend-flight-route { grid-column: 1 / -1; }
  .friend-records-panel { padding: 24px; }
}
.stats-favourite-edit { height: 34px; padding: 0 12px; border: 1px solid #a9cafa; border-radius: 8px; color: var(--blue); background: white; font-size: 11px; font-weight: 600; cursor: pointer; }
.stats-favourite-edit:hover { color: white; background: var(--blue); }
.stats-favourite-editor { padding: 12px 0; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; border-top: 1px solid var(--line); }
.stats-favourite-editor[hidden] { display: none; }
.stats-favourite-editor select { min-width: 0; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: white; outline: 0; }
.country-stats-map {
  margin: 0 0 22px;
  overflow: hidden;
  border: 1px solid #c9d3da;
  border-radius: 17px;
  background: #eef2f2;
  box-shadow: 0 12px 28px rgba(24,47,67,.06);
}
.country-stats-map-head {
  min-height: 66px;
  padding: 15px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid rgba(58,79,91,.14);
  background: rgba(250,251,250,.9);
}
.country-stats-map-head div:first-child span { display: block; color: #74808b; font-size: 9px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; }
.country-stats-map-head div:first-child strong { display: block; margin-top: 4px; color: #20384f; font-size: 16px; }
.country-map-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 15px; }
.country-map-legend span { display: inline-flex; align-items: center; gap: 6px; color: #596977; font-size: 9px; white-space: nowrap; }
.country-map-legend i { width: 14px; height: 8px; display: inline-block; border-radius: 3px; }
.country-map-legend .visited { border: 1px solid rgba(178,99,11,.55); background: #e99a32; }
.country-map-legend .route { position: relative; height: 1px; border-radius: 0; background: #1877f2; }
.country-map-legend .route::after { content: ""; position: absolute; right: -1px; top: -2px; width: 5px; height: 5px; border-radius: 50%; background: #1877f2; }
#countryStatsMap { width: 100%; height: 380px; display: block; }
.country-map-flags {
  min-height: 48px;
  padding: 9px 12px;
  overflow-x: auto;
  border-top: 1px solid rgba(58,79,91,.14);
  background: #dfe3e6;
  scrollbar-width: thin;
}
.country-map-flags-track {
  width: max-content;
  min-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.country-map-flag {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: block;
  overflow: hidden;
  border: .5px solid rgba(0,0,0,.5);
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 6px rgba(35,51,72,.12);
}
.country-map-flag img { width: 100%; height: 100%; display: block; object-fit: cover; }
.detail-sort-label { margin: 18px 0 8px; color: var(--soft); font-size: 10px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; }
.stats-flight-row {
  width: 100%;
  min-height: 58px;
  padding: 9px 12px;
  display: grid;
  grid-template-columns: 38px minmax(0,1fr) auto 14px;
  gap: 12px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.stats-airline-icon { width: 36px; height: 29px; display: grid; place-items: center; color: var(--blue); font-size: 9px; font-weight: 700; }
.stats-airline-icon img { width: 100%; height: 100%; object-fit: contain; }
.stats-flight-row:hover { border-radius: 8px; background: var(--paper-soft); }
.stats-flight-copy { min-width: 0; }
.stats-flight-copy > strong { display: block; font-size: 13px; }
.stats-flight-copy > small { margin-top: 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 5px 10px; color: var(--muted); font-size: 10px; }
.stats-route-codes { display: inline-flex; align-items: center; gap: 5px; }
.stats-route-codes b { color: var(--text); font-size: 11px; }
.stats-route-codes i { color: var(--soft); font-size: 11px; font-style: normal; }
.stats-flight-value { color: var(--blue); font-size: 12px; font-weight: 600; }
.stats-flight-arrow { color: var(--soft); font-size: 18px; font-style: normal; }
.stats-flight-row.metric-row { min-height: 68px; }
.stats-flight-row.metric-row .stats-route-codes b { font-size: 15px; }
.stats-flight-row.metric-row .stats-route-codes i { font-size: 13px; }
.stats-flight-row.metric-row .stats-flight-value { font-size: 16px; }
.featured-flight-stack { display: grid; gap: 14px; }
.featured-flight {
  width: 100%;
  min-height: 218px;
  padding: 22px;
  display: grid;
  grid-template-columns: minmax(240px,.8fr) minmax(280px,1.2fr);
  gap: 18px;
  align-items: center;
  overflow: hidden;
  border: 1px solid #c6dcf8;
  border-radius: 18px;
  color: var(--text);
  background: linear-gradient(135deg,#f5f9ff,#fff);
  text-align: left;
  cursor: pointer;
}
.featured-flight:hover { border-color: #8ebbf6; box-shadow: 0 13px 30px rgba(35,72,118,.08); }
.featured-flight-copy > span { color: var(--blue); font-size: 9px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.featured-flight-title { margin-top: 12px; display: flex; align-items: center; gap: 10px; }
.featured-airline-icon { width: 42px; height: 34px; display: grid; place-items: center; color: var(--blue); font-size: 10px; font-weight: 700; }
.featured-airline-icon img { width: 100%; height: 100%; object-fit: contain; }
.featured-flight-title strong { display: block; font-size: 20px; }
.featured-flight-title small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.featured-flight-route { margin-top: 16px; display: grid; grid-template-columns: auto 1fr auto; gap: 9px; align-items: center; }
.featured-flight-route b { font-size: 26px; }
.featured-flight-route i { height: 1px; position: relative; background: #a9cafa; }
.featured-flight-route i::after { content: ""; position: absolute; right: 0; top: -3px; border-left: 6px solid var(--blue); border-top: 3px solid transparent; border-bottom: 3px solid transparent; }
.featured-flight-copy p { margin: 8px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.featured-flight-copy em { display: block; margin-top: 12px; color: var(--blue); font-size: 21px; font-style: normal; font-weight: 700; }
.featured-aircraft { min-width: 0; }
.featured-aircraft-image { width: 100%; max-height: 155px; display: block; object-fit: contain; mix-blend-mode: multiply; }
.equivalence-section { margin: 20px 0 8px; }
.equivalence-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; }
.equivalence-grid div { min-height: 116px; padding: 15px; border: 1px solid #d6e5f8; border-radius: 13px; background: #f7faff; }
.equivalence-symbol { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: var(--blue); background: white; font-size: 10px; font-weight: 700; }
.equivalence-grid strong { display: block; margin-top: 13px; color: var(--blue); font-size: 27px; line-height: 1; }
.equivalence-grid small { display: block; margin-top: 7px; color: var(--text); font-size: 13px; font-weight: 600; line-height: 1.4; }
.stats-bar-row {
  min-height: 72px;
  padding: 12px 4px;
  display: grid;
  grid-template-columns: 38px minmax(0,1fr);
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.stats-bar-row.has-image { min-height: 112px; grid-template-columns: 38px minmax(0,1fr) minmax(150px,220px); }
.stats-bar-row.no-leading { grid-template-columns: minmax(0,1fr); }
.stats-bar-row.no-leading.has-image { grid-template-columns: minmax(0,1fr) 200px; }
.stats-rank-index { color: var(--soft); font-size: 10px; }
.stats-flag { width: 32px; height: 32px; display: grid; place-items: center; overflow: hidden; border: 1px solid #dbe2eb; border-radius: 50%; background: white; box-shadow: 0 2px 7px rgba(35,51,72,.08); line-height: 1; }
.stats-flag img { width: 100%; height: 100%; display: block; object-fit: cover; }
.stats-flag-fallback { color: var(--blue); font-size: 15px; }
.stats-bar-logo { width: 38px; height: 31px; display: grid; place-items: center; color: var(--blue); font-size: 9px; font-weight: 700; }
.stats-bar-logo img { width: 100%; height: 100%; object-fit: contain; }
.stats-bar-main { min-width: 0; }
.stats-bar-head { margin-bottom: 9px; display: flex; justify-content: space-between; gap: 14px; align-items: flex-end; }
.stats-bar-head span { min-width: 0; }
.stats-bar-head strong { display: block; font-size: 13px; font-weight: 600; }
.stats-bar-head small { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 9px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.stats-bar-head .stats-inline-note { display: inline; margin: 0 0 0 9px; color: var(--soft); font-size: 10px; font-weight: 400; letter-spacing: 0; text-transform: none; }
.stats-bar-head b { flex: 0 0 auto; color: var(--blue); font-size: 10px; }
.stats-bar-track { height: 8px; overflow: hidden; border-radius: 5px; background: #e9eff6; }
.stats-bar-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--blue),#65a7f8); }
.stats-aircraft-visual { width: 200px; height: 92px; padding-left: 8px; display: grid; place-items: center; overflow: hidden; }
.stats-aircraft-image { width: 190px; height: 84px; display: block; object-fit: contain; mix-blend-mode: multiply; }
.generic-aircraft-image { color: #7d91a8; mix-blend-mode: normal; }
.generic-aircraft-image .generic-aircraft-body { fill: #dbe5ef; stroke: #7d91a8; stroke-width: 1.2; }
.generic-aircraft-image .generic-aircraft-wing { fill: #c9d7e6; stroke: #7d91a8; stroke-width: 1.2; }
.fare-group { margin-bottom: 9px; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.fare-group.bundled { border: 1.5px solid #8dbcf8; box-shadow: inset 3px 0 var(--blue); }
.fare-group > header { padding: 10px 12px; display: flex; justify-content: space-between; color: var(--muted); background: var(--paper-soft); font-size: 11px; }
.fare-group > header strong { color: var(--text); font-size: 14px; }
.fare-group .stats-flight-row { padding-left: 15px; padding-right: 15px; }

/* Legibility pass */
.brand-copy small { font-size: 9px; }
.nav-label { font-size: 14px; }
.section-label { font-size: 11px; }
.segmented-control button { font-size: 12px; }
.map-control p { font-size: 11px; }
.primary-button, .subtle-button { font-size: 11px; }
.globe-loading, .hover-tooltip { font-size: 11px; }
.drawer-kicker, .drawer-section-title, .page-kicker { font-size: 10px; }
.drawer-subtitle { font-size: 12px; }
.drawer-metrics span { font-size: 10px; }
.drawer-flight-top strong { font-size: 12px; }
.drawer-flight-top span, .drawer-flight-route small { font-size: 10px; }
.connection-list button { font-size: 11px; }
.record-table-head { font-size: 11px; }
.airline-cell small, .date-cell small, .route-point span, .route-line,
.flight-meta span, .fare-cell small { font-size: 11px; }
.stats-kpis article > span, .card-head span, .ranking-row strong,
.country-list span { font-size: 11px; }
.stats-kpis p, .ranking-row > span, .ranking-row b, .airport-row,
.legend p { font-size: 10px; }
.modal-title-row span, .modal-title-row p, .detail-route span,
.detail-route small, .detail-info-grid span, .detail-note > span,
.detail-info-grid strong, .detail-note p, .modal-header > span,
.modal-header p, .smart-lookup strong, .smart-lookup div > span,
.form-grid label > span, .full-field > span, .form-grid input,
.form-grid select, .full-field textarea, .photo-upload strong,
.photo-upload small, .import-steps span, .drop-zone strong,
.drop-zone span, .toast strong, .toast small { font-size: 11px; }

@media (max-width: 1400px) {
  .record-table-head { display: none; }
  .flight-row { grid-template-columns: 180px 1fr 115px 70px; }
  .date-cell { display: none; }
  .route-cell { grid-template-columns: 75px 1fr 75px; }
  .fare-cell { display: none; }
  .stats-kpis { grid-template-columns: repeat(2,1fr); }
  .stats-list { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 1150px) {
  .stats-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 780px) {
  .app-shell { --sidebar-panel-width: 78px; --sidebar-page-offset: 0px; }
  .app-shell.incoming-mode .sidebar { width: min(310px,85vw); }
  .sidebar { padding-left: 15px; padding-right: 15px; }
  .brand-copy, .nav-label, .nav-count, .map-control, .settings-button span { display: none; }
  .sidebar-head, .nav-item { justify-content: center; }
  .nav-item { padding: 0; }
  .settings-button { justify-content: center; padding: 0; }
  .sidebar-account-summary { justify-content: center; padding: 0; }
  .sidebar-account-summary span { display: none; }
  .settings-panel { width: min(320px,calc(100vw - 104px)); }
  .collapse-button { display: none; }
  .stats-grid { grid-template-columns: 1fr; }
  .flight-row { grid-template-columns: 150px 1fr 70px; }
  .flight-meta { display: none; }
  .stats-list { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .stat-block { min-height: 0; padding: 20px; border-radius: 17px; }
  .stat-label { font-size: 20px; }
  .stat-value { font-size: clamp(22px,4vw,32px); }
  .featured-flight { grid-template-columns: 1fr; }
  .featured-aircraft { grid-row: 1; }
  .featured-aircraft-image { max-height: 130px; }
  .equivalence-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 560px) {
  .auth-gate { padding: 14px; }
  .auth-card { padding: 23px 20px; border-radius: 16px; }
  .auth-heading { margin: 26px 0 18px; }
  .auth-heading h1 { font-size: 27px; }
  .boarding-gate { padding: 14px; }
  .boarding-card { padding: 34px 23px 30px; border-radius: 18px; }
  .boarding-card h1 { font-size: 24px; }
  .onboarding-grid, .onboarding-favourites { grid-template-columns: 1fr; }
  .app-shell { --sidebar-panel-width: 64px; --sidebar-rail-width: 64px; }
  .sidebar { padding: 16px 9px; }
  .brand-mark { width: 39px; height: 39px; flex-basis: 39px; }
  .globe-style-switch { top: 12px; right: 12px; }
  .page-view { padding: 30px 14px 50px; }
  .page-header { align-items: flex-start; flex-direction: column; gap: 16px; }
  .records-heading { align-items: center; gap: 12px; }
  .flight-total { margin: 0; padding-left: 12px; }
  .flight-total strong { font-size: 21px; }
  .flight-total span { font-size: 10px; }
  .record-actions { width: 100%; }
  .record-actions button { flex: 1; }
  .flight-row { grid-template-columns: 54px 1fr 16px; padding: 12px; }
  .airline-cell > div:last-child { display: none; }
  .route-cell { grid-template-columns: 58px 1fr 58px; gap: 7px; }
  .route-point strong { font-size: 14px; }
  .stats-kpis { grid-template-columns: 1fr; }
  .stats-list { grid-template-columns: 1fr; }
  .stats-list { grid-template-columns: 1fr; }
  .stat-block { min-height: 320px; aspect-ratio: auto; padding: 24px; }
  .stat-label { font-size: 21px; }
  .stat-value { font-size: 30px; }
  .stats-bar-row.has-image { grid-template-columns: 34px minmax(0,1fr); }
  .stats-bar-row.no-leading.has-image { grid-template-columns: minmax(0,1fr); }
  .stats-aircraft-visual { grid-column: 2; padding: 8px 0 0; }
  .stats-bar-row.no-leading .stats-aircraft-visual { grid-column: 1; }
  .stats-detail-head h2 { font-size: 23px; }
  .stats-preference-row { grid-template-columns: 40px minmax(0,1fr); padding: 12px 0; }
  .stats-favourite-edit { grid-column: 1 / -1; }
  .country-stats-map-head { align-items: flex-start; flex-direction: column; gap: 9px; }
  .country-map-legend { justify-content: flex-start; }
  #countryStatsMap { height: 300px; }
  .aircraft-summary { gap: 15px; }
  .form-grid { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal { max-height: 94vh; border-radius: 14px 14px 0 0; }
}
