:root {
      --bg-dark: #090d16;
      --panel-bg: rgba(15, 23, 42, 0.92);
      --panel-border: rgba(255, 255, 255, 0.08);
      --panel-highlight: rgba(56, 189, 248, 0.15);
      --accent: #38bdf8;
      --accent-glow: rgba(56, 189, 248, 0.4);
      --accent-hover: #0ea5e9;
      --secondary: #818cf8;
      --text-main: #f8fafc;
      --text-muted: #94a3b8;
      --text-dim: #64748b;
      --success: #10b981;
      --warning: #f59e0b;
      --danger: #ef4444;
      --card-bg: rgba(30, 41, 59, 0.65);
      --input-bg: rgba(15, 23, 42, 0.6);
      --font-ui: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
      --font-mono: 'JetBrains Mono', monospace;
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    body, html {
      width: 100%;
      height: 100%;
      overflow: hidden;
      font-family: var(--font-ui);
      background-color: var(--bg-dark);
      color: var(--text-main);
    }

    #app-container {
      display: flex;
      flex-direction: column;
      width: 100vw;
      height: 100vh;
      position: relative;
    }

    /* Top Navigation Bar */
    header {
      height: 66px;
      background: var(--panel-bg);
      backdrop-filter: blur(14px);
      -webkit-backdrop-filter: blur(14px);
      border-bottom: 1px solid var(--panel-border);
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 20px;
      z-index: 1000;
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 14px;
    }

    .brand-icon {
      width: 34px;
      height: 34px;
      background: linear-gradient(135deg, #0284c7, #38bdf8);
      border-radius: 9px;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 0 16px var(--accent-glow);
    }

    .brand-icon svg {
      width: 19px;
      height: 19px;
      fill: #ffffff;
    }

    .brand-title {
      font-size: 1.15rem;
      font-weight: 700;
      letter-spacing: -0.02em;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .brand-title span {
      color: var(--accent);
    }

    .brand-badge {
      font-size: 0.65rem;
      padding: 2px 8px;
      background: rgba(129, 140, 248, 0.2);
      border: 1px solid rgba(129, 140, 248, 0.4);
      color: var(--secondary);
      border-radius: 10px;
      font-weight: 600;
      letter-spacing: 0.05em;
      text-transform: uppercase;
    }

    /* Prominent Connect Button on the left next to Passenger Connect */
    .btn-connect-future {
      background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%) !important;
      color: #080c14 !important;
      font-size: 0.92rem !important;
      font-weight: 700 !important;
      padding: 9px 20px !important;
      border-radius: 10px !important;
      border: 1px solid rgba(255, 255, 255, 0.4) !important;
      box-shadow: 0 0 25px rgba(56, 189, 248, 0.5), 0 4px 14px rgba(0, 0, 0, 0.35) !important;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      cursor: pointer;
      transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
      letter-spacing: 0.01em;
    }

    .btn-connect-future:hover {
      background: linear-gradient(135deg, #7dd3fc 0%, #0284c7 100%) !important;
      transform: translateY(-2px) scale(1.02);
      box-shadow: 0 0 35px rgba(56, 189, 248, 0.75), 0 8px 20px rgba(0, 0, 0, 0.4) !important;
    }

    .header-controls {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .status-badge {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 6px 14px;
      border-radius: 20px;
      font-size: 0.78rem;
      font-weight: 500;
      background: rgba(16, 185, 129, 0.12);
      border: 1px solid rgba(16, 185, 129, 0.35);
      color: #34d399;
      font-family: var(--font-mono);
      transition: all 0.3s ease;
    }

    .status-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: currentColor;
      box-shadow: 0 0 8px currentColor;
      animation: pulse 2s infinite;
    }

    @keyframes pulse {
      0%, 100% { opacity: 1; transform: scale(1); }
      50% { opacity: 0.4; transform: scale(0.85); }
    }

    .btn {
      background: rgba(255, 255, 255, 0.06);
      border: 1px solid var(--panel-border);
      color: var(--text-main);
      padding: 7px 13px;
      border-radius: 8px;
      font-size: 0.82rem;
      font-weight: 500;
      font-family: var(--font-ui);
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      transition: all 0.2s ease;
    }

    .btn:hover {
      background: rgba(255, 255, 255, 0.12);
      border-color: rgba(255, 255, 255, 0.2);
    }

    .btn-primary {
      background: var(--accent);
      border-color: var(--accent);
      color: #090d16;
      font-weight: 600;
    }

    .btn-primary:hover {
      background: var(--accent-hover);
      box-shadow: 0 0 12px var(--accent-glow);
    }

    /* Workspace */
    .workspace {
      display: flex;
      flex: 1;
      position: relative;
      overflow: hidden;
    }

    #map {
      flex: 1;
      height: 100%;
      width: 100%;
      background: #080c14;
    }

    /* Sidebar Overlay Panel */
    .sidebar {
      position: absolute;
      top: 16px;
      left: 16px;
      bottom: 16px;
      width: 380px;
      background: var(--panel-bg);
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
      border: 1px solid var(--panel-border);
      border-radius: 16px;
      box-shadow: 0 20px 45px rgba(0,0,0,0.5);
      z-index: 999;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      transition: transform 0.3s ease;
    }

    .sidebar-header {
      padding: 16px;
      border-bottom: 1px solid var(--panel-border);
    }

    /* Mode Switcher Tabs */
    .view-mode-tabs {
      display: flex;
      gap: 6px;
      margin-bottom: 12px;
      background: rgba(0,0,0,0.35);
      padding: 4px;
      border-radius: 8px;
    }

    .mode-tab-btn {
      flex: 1;
      text-align: center;
      border-radius: 6px;
      padding: 8px 6px;
      font-size: 0.8rem;
      font-weight: 600;
      color: var(--text-muted);
      background: transparent;
      border: none;
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .mode-tab-btn.active {
      background: var(--accent);
      color: #080c14;
      box-shadow: 0 0 14px var(--accent-glow);
    }

    .search-box {
      position: relative;
      margin-bottom: 10px;
    }

    .search-box input {
      width: 100%;
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid var(--panel-border);
      border-radius: 8px;
      padding: 10px 12px 10px 36px;
      font-size: 0.85rem;
      color: var(--text-main);
      font-family: var(--font-ui);
      outline: none;
      transition: border 0.2s ease;
    }

    .search-box input:focus {
      border-color: var(--accent);
      background: rgba(255, 255, 255, 0.08);
    }

    .search-box svg {
      position: absolute;
      left: 12px;
      top: 50%;
      transform: translateY(-50%);
      width: 15px;
      height: 15px;
      fill: var(--text-dim);
    }

    .filter-pills {
      display: flex;
      gap: 6px;
      overflow-x: auto;
      padding-bottom: 4px;
    }

    .pill {
      font-size: 0.75rem;
      padding: 4px 10px;
      border-radius: 12px;
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid var(--panel-border);
      color: var(--text-muted);
      cursor: pointer;
      white-space: nowrap;
      transition: all 0.2s ease;
    }

    .pill.active {
      background: var(--panel-highlight);
      border-color: var(--accent);
      color: var(--accent);
    }

    .hubs-bar {
      display: flex;
      gap: 6px;
      padding: 8px 16px;
      background: rgba(0, 0, 0, 0.2);
      border-bottom: 1px solid var(--panel-border);
      font-size: 0.75rem;
      align-items: center;
    }

    .hubs-label {
      color: var(--text-dim);
      font-weight: 500;
    }

    .hub-link {
      color: var(--text-muted);
      text-decoration: none;
      padding: 2px 7px;
      border-radius: 4px;
      background: rgba(255, 255, 255, 0.03);
      cursor: pointer;
      transition: all 0.2s;
    }

    .hub-link:hover {
      color: var(--accent);
      background: rgba(56, 189, 248, 0.12);
    }

    /* Flight List */
    .flight-list-container {
      flex: 1;
      overflow-y: auto;
      padding: 8px 12px;
    }

    .flight-card {
      background: var(--card-bg);
      border: 1px solid var(--panel-border);
      border-radius: 10px;
      padding: 12px;
      margin-bottom: 8px;
      cursor: pointer;
      transition: all 0.2s ease;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .flight-card:hover {
      border-color: rgba(56, 189, 248, 0.4);
      background: rgba(30, 41, 59, 0.85);
      transform: translateY(-1px);
    }

    .flight-card.selected {
      border-color: var(--accent);
      background: rgba(56, 189, 248, 0.12);
      box-shadow: 0 0 14px rgba(56, 189, 248, 0.2);
    }

    .flight-row-1 {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .flight-callsign {
      font-size: 0.98rem;
      font-weight: 700;
      letter-spacing: 0.02em;
      color: #ffffff;
      font-family: var(--font-mono);
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .community-tag {
      font-size: 0.65rem;
      background: rgba(129, 140, 248, 0.2);
      color: var(--secondary);
      border: 1px solid rgba(129, 140, 248, 0.3);
      padding: 1px 6px;
      border-radius: 6px;
      font-weight: 500;
    }

    .flight-country {
      font-size: 0.72rem;
      color: var(--text-muted);
      background: rgba(255, 255, 255, 0.05);
      padding: 2px 6px;
      border-radius: 4px;
      max-width: 150px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .flight-row-2 {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
      font-size: 0.75rem;
      color: var(--text-muted);
      font-family: var(--font-mono);
    }

    .stat-item {
      display: flex;
      flex-direction: column;
    }

    .stat-label {
      font-size: 0.65rem;
      color: var(--text-dim);
      text-transform: uppercase;
    }

    .stat-val {
      font-weight: 600;
      color: var(--text-main);
    }

    /* Right Side Detail & Passenger Connect Drawer */
    .detail-drawer {
      position: absolute;
      top: 16px;
      right: 16px;
      bottom: 16px;
      width: 440px;
      background: var(--panel-bg);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      border: 1px solid var(--panel-border);
      border-radius: 16px;
      box-shadow: 0 20px 45px rgba(0,0,0,0.6);
      z-index: 999;
      display: none;
      flex-direction: column;
      overflow: hidden;
      animation: slideIn 0.3s ease;
    }

    @keyframes slideIn {
      from { opacity: 0; transform: translateX(25px); }
      to { opacity: 1; transform: translateX(0); }
    }

    .drawer-top-banner {
      padding: 16px 20px 12px;
      border-bottom: 1px solid var(--panel-border);
      background: linear-gradient(180deg, rgba(56, 189, 248, 0.08) 0%, transparent 100%);
    }

    .drawer-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      margin-bottom: 8px;
    }

    .drawer-title-group {
      display: flex;
      flex-direction: column;
    }

    .drawer-callsign {
      font-size: 1.45rem;
      font-weight: 700;
      font-family: var(--font-mono);
      color: var(--accent);
      letter-spacing: 0.02em;
    }

    .drawer-sub {
      font-size: 0.8rem;
      color: var(--text-muted);
    }

    .close-btn {
      background: transparent;
      border: none;
      color: var(--text-muted);
      cursor: pointer;
      font-size: 1.3rem;
      padding: 4px;
      line-height: 1;
    }

    .close-btn:hover {
      color: #ffffff;
    }

    /* Date Selector */
    .flight-date-selector {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-top: 10px;
      background: rgba(0, 0, 0, 0.3);
      padding: 8px 12px;
      border-radius: 8px;
      border: 1px solid var(--panel-border);
    }

    .date-label {
      font-size: 0.75rem;
      color: var(--text-dim);
      font-weight: 500;
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }

    .date-input {
      background: transparent;
      border: none;
      color: var(--accent);
      font-family: var(--font-mono);
      font-size: 0.85rem;
      font-weight: 600;
      outline: none;
      cursor: pointer;
    }

    .date-input::-webkit-calendar-picker-indicator {
      filter: invert(1);
      cursor: pointer;
    }

    .date-shortcuts {
      display: flex;
      gap: 4px;
      margin-left: auto;
    }

    .date-btn {
      font-size: 0.7rem;
      padding: 2px 7px;
      border-radius: 4px;
      background: rgba(255, 255, 255, 0.06);
      border: 1px solid var(--panel-border);
      color: var(--text-muted);
      cursor: pointer;
    }

    .date-btn:hover {
      background: rgba(56, 189, 248, 0.15);
      color: var(--accent);
    }

    .drawer-tabs {
      display: flex;
      border-bottom: 1px solid var(--panel-border);
      background: rgba(0, 0, 0, 0.15);
    }

    .drawer-tab {
      flex: 1;
      padding: 10px;
      text-align: center;
      font-size: 0.82rem;
      font-weight: 500;
      color: var(--text-muted);
      border: none;
      background: transparent;
      cursor: pointer;
      transition: all 0.2s;
      border-bottom: 2px solid transparent;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
    }

    .drawer-tab.active {
      color: var(--accent);
      border-bottom-color: var(--accent);
      background: rgba(56, 189, 248, 0.05);
      font-weight: 600;
    }

    .tab-badge {
      background: var(--accent);
      color: #0b0f19;
      font-size: 0.68rem;
      font-weight: 700;
      padding: 1px 6px;
      border-radius: 10px;
    }

    .drawer-content {
      flex: 1;
      overflow-y: auto;
      padding: 16px;
    }

    .connect-banner {
      background: linear-gradient(135deg, rgba(129, 140, 248, 0.15), rgba(56, 189, 248, 0.1));
      border: 1px solid rgba(129, 140, 248, 0.3);
      border-radius: 10px;
      padding: 12px;
      margin-bottom: 16px;
    }

    .connect-banner h4 {
      font-size: 0.9rem;
      color: #ffffff;
      margin-bottom: 4px;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .connect-banner p {
      font-size: 0.78rem;
      color: var(--text-muted);
      line-height: 1.4;
    }

    .topic-filter-bar {
      display: flex;
      gap: 5px;
      overflow-x: auto;
      padding-bottom: 8px;
      margin-bottom: 14px;
    }

    .topic-pill {
      font-size: 0.72rem;
      padding: 3px 8px;
      border-radius: 6px;
      background: rgba(255, 255, 255, 0.04);
      border: 1px solid var(--panel-border);
      color: var(--text-muted);
      cursor: pointer;
      white-space: nowrap;
    }

    .topic-pill.active {
      background: rgba(129, 140, 248, 0.2);
      border-color: var(--secondary);
      color: #ffffff;
      font-weight: 600;
    }

    .post-card {
      background: var(--card-bg);
      border: 1px solid var(--panel-border);
      border-radius: 10px;
      padding: 14px;
      margin-bottom: 18px;
    }

    .post-card-title {
      font-size: 0.8rem;
      font-weight: 600;
      color: var(--text-main);
      margin-bottom: 10px;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    .form-row {
      display: flex;
      gap: 8px;
      margin-bottom: 8px;
    }

    .form-input {
      flex: 1;
      min-width: 0;
      background: var(--input-bg);
      border: 1px solid var(--panel-border);
      border-radius: 6px;
      padding: 8px 10px;
      font-size: 0.8rem;
      color: var(--text-main);
      font-family: var(--font-ui);
      outline: none;
    }

    .form-input:focus {
      border-color: var(--accent);
    }

    .form-select {
      background: #0f172a;
      border: 1px solid var(--panel-border);
      border-radius: 6px;
      padding: 8px 10px;
      font-size: 0.8rem;
      color: var(--text-main);
      font-family: var(--font-ui);
      outline: none;
      min-width: 0;
    }

    .form-textarea {
      width: 100%;
      height: 70px;
      background: var(--input-bg);
      border: 1px solid var(--panel-border);
      border-radius: 6px;
      padding: 8px 10px;
      font-size: 0.8rem;
      color: var(--text-main);
      font-family: var(--font-ui);
      outline: none;
      resize: none;
      margin-bottom: 10px;
    }

    .form-textarea:focus {
      border-color: var(--accent);
    }

    .post-actions {
      display: flex;
      justify-content: flex-end;
    }

    .comments-feed {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .comment-item {
      background: rgba(255, 255, 255, 0.025);
      border: 1px solid var(--panel-border);
      border-radius: 10px;
      padding: 12px;
      transition: all 0.2s ease;
    }

    .comment-item:hover {
      border-color: rgba(255, 255, 255, 0.15);
      background: rgba(255, 255, 255, 0.04);
    }

    .comment-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 6px;
    }

    .comment-author-info {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .avatar {
      width: 28px;
      height: 28px;
      border-radius: 50%;
      background: linear-gradient(135deg, #3b82f6, #8b5cf6);
      color: #fff;
      font-size: 0.75rem;
      font-weight: 700;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .author-name {
      font-size: 0.85rem;
      font-weight: 600;
      color: var(--text-main);
    }

    .seat-badge {
      font-size: 0.68rem;
      background: rgba(255, 255, 255, 0.07);
      color: var(--text-muted);
      padding: 1px 6px;
      border-radius: 4px;
      font-family: var(--font-mono);
    }

    .comment-date {
      font-size: 0.7rem;
      color: var(--text-dim);
    }

    .comment-tag {
      display: inline-block;
      font-size: 0.68rem;
      font-weight: 600;
      padding: 2px 7px;
      border-radius: 4px;
      margin-bottom: 6px;
    }

    .tag-rideshare {
      background: rgba(16, 185, 129, 0.15);
      color: #34d399;
      border: 1px solid rgba(16, 185, 129, 0.3);
    }

    .tag-lounge {
      background: rgba(129, 140, 248, 0.15);
      color: #a5b4fc;
      border: 1px solid rgba(129, 140, 248, 0.3);
    }

    .tag-tips {
      background: rgba(245, 158, 11, 0.15);
      color: #fbbf24;
      border: 1px solid rgba(245, 158, 11, 0.3);
    }

    .tag-chat {
      background: rgba(56, 189, 248, 0.15);
      color: #7dd3fc;
      border: 1px solid rgba(56, 189, 248, 0.3);
    }

    .comment-body {
      font-size: 0.82rem;
      line-height: 1.45;
      color: #e2e8f0;
      margin-bottom: 8px;
    }

    .comment-footer {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding-top: 6px;
      border-top: 1px solid rgba(255, 255, 255, 0.04);
    }

    .btn-connect {
      font-size: 0.72rem;
      padding: 3px 8px;
      background: rgba(56, 189, 248, 0.1);
      border: 1px solid rgba(56, 189, 248, 0.25);
      color: var(--accent);
      border-radius: 5px;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      transition: all 0.2s;
    }

    .btn-connect:hover {
      background: var(--accent);
      color: #090d16;
    }

    .like-btn {
      background: transparent;
      border: none;
      color: var(--text-dim);
      font-size: 0.72rem;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 4px;
    }

    .like-btn:hover {
      color: #f43f5e;
    }

    .empty-connect-state {
      text-align: center;
      padding: 30px 15px;
      color: var(--text-dim);
    }

    .empty-connect-state svg {
      width: 40px;
      height: 40px;
      stroke: var(--text-dim);
      margin-bottom: 10px;
      opacity: 0.6;
    }

    /* Modals */
    .modal-overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100vw;
      height: 100vh;
      background: rgba(0, 0, 0, 0.75);
      backdrop-filter: blur(8px);
      z-index: 2000;
      display: none;
      align-items: center;
      justify-content: center;
    }

    .modal-card {
      width: 480px;
      max-width: 92vw;
      background: #0f172a;
      border: 1px solid var(--panel-border);
      border-radius: 16px;
      padding: 24px;
      box-shadow: 0 25px 50px rgba(0,0,0,0.8);
      position: relative;
    }

    .modal-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 16px;
    }

    .modal-title {
      font-size: 1.15rem;
      font-weight: 700;
      color: #fff;
    }

    .modal-body {
      display: flex;
      flex-direction: column;
      gap: 14px;
    }

    .input-label {
      font-size: 0.75rem;
      color: var(--text-dim);
      text-transform: uppercase;
      font-weight: 600;
      margin-bottom: 4px;
    }

    .telemetry-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
    }

    .telemetry-card {
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid var(--panel-border);
      border-radius: 8px;
      padding: 10px;
    }

    .telemetry-label {
      font-size: 0.68rem;
      color: var(--text-dim);
      margin-bottom: 4px;
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }

    .telemetry-value {
      font-size: 0.95rem;
      font-weight: 600;
      font-family: var(--font-mono);
      color: var(--text-main);
    }

    .heading-box {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .compass-arrow {
      width: 16px;
      height: 16px;
      fill: var(--accent);
      transition: transform 0.4s ease;
    }

    /* Custom Leaflet Markers */
    .plane-marker {
      display: flex;
      align-items: center;
      justify-content: center;
      transition: transform 0.5s linear;
    }

    .plane-svg {
      filter: drop-shadow(0 2px 5px rgba(0,0,0,0.8));
      transition: all 0.2s ease;
    }

    .plane-marker.selected .plane-svg {
      filter: drop-shadow(0 0 10px var(--accent));
      transform: scale(1.35);
    }

    @media (max-width: 860px) {
      .sidebar {
        width: calc(100vw - 32px);
        left: 16px;
        right: 16px;
        bottom: 16px;
        height: 48vh;
        top: auto;
      }
      .detail-drawer {
        width: calc(100vw - 32px);
        right: 16px;
        left: 16px;
        top: auto;
        bottom: 16px;
        height: 60vh;
      }
    }

    .altitude-legend {
      position: absolute;
      bottom: 24px;
      left: 405px;
      background: rgba(15, 23, 42, 0.9);
      backdrop-filter: blur(12px);
      border: 1px solid var(--panel-border);
      border-radius: 8px;
      padding: 6px 14px;
      display: flex;
      align-items: center;
      gap: 16px;
      font-size: 0.73rem;
      color: var(--text-muted);
      z-index: 998;
      box-shadow: 0 8px 20px rgba(0,0,0,0.4);
    }
    .legend-item {
      display: flex;
      align-items: center;
      gap: 6px;
      font-weight: 500;
    }
    .legend-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
    }
    .legend-dot.green { background: #10b981; box-shadow: 0 0 6px #10b981; }
    .legend-dot.amber { background: #f59e0b; box-shadow: 0 0 6px #f59e0b; }
    .legend-dot.blue { background: #38bdf8; box-shadow: 0 0 6px #38bdf8; }

    @media (max-width: 860px) {
      .altitude-legend {
        left: 16px;
        bottom: 50vh;
        gap: 8px;
        font-size: 0.68rem;
        padding: 4px 8px;
      }
    }


    .btn-delete-post {
      background: transparent;
      border: none;
      color: var(--text-dim);
      font-size: 0.72rem;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 3px;
      padding: 3px 6px;
      border-radius: 4px;
      transition: all 0.2s;
    }
    .btn-delete-post:hover {
      color: var(--danger);
      background: rgba(239, 68, 68, 0.1);
    }

    .tag-swap {
      background: rgba(236, 72, 153, 0.15);
      color: #f472b6;
      border: 1px solid rgba(236, 72, 153, 0.3);
    }

  
    /* ======================================================== */
    /* SkyRadar Hybrid Architecture (Passenger Hub + Live Radar) */
    /* ======================================================== */
    .app-mode-switcher {
      display: inline-flex;
      background: rgba(15, 23, 42, 0.85);
      border: 1px solid var(--panel-border);
      border-radius: 30px;
      padding: 3px;
      gap: 3px;
    }
    .mode-switch-btn {
      background: transparent;
      border: none;
      color: var(--text-muted);
      padding: 7px 18px;
      border-radius: 20px;
      font-size: 0.84rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }
    .mode-switch-btn:hover {
      color: var(--text-main);
      background: rgba(255, 255, 255, 0.05);
    }
    .mode-switch-btn.active {
      background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
      color: #080c14;
      font-weight: 700;
      box-shadow: 0 0 16px rgba(56, 189, 248, 0.45);
    }

    /* Main View Panes */
    .main-view-pane {
      display: none;
      width: 100%;
      height: calc(100vh - 66px);
      overflow: hidden;
    }
    .main-view-pane.active {
      display: flex;
    }

    /* Passenger Hub Layout */
    #view-passenger-hub {
      flex-direction: column;
      background: #090d16;
    }

    .hub-hero {
      background: linear-gradient(180deg, rgba(15, 23, 42, 0.96) 0%, rgba(10, 15, 28, 0.9) 100%);
      border-bottom: 1px solid var(--panel-border);
      padding: 14px 24px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 20px;
      flex-shrink: 0;
    }
    .hub-hero-left {
      display: flex;
      flex-direction: column;
      gap: 3px;
    }
    .hub-callsign {
      font-size: 1.35rem;
      font-weight: 800;
      color: var(--accent);
      font-family: var(--font-mono);
      letter-spacing: -0.01em;
    }
    .hub-airline {
      font-size: 0.92rem;
      color: var(--text-main);
      font-weight: 600;
    }
    .hub-status-badge {
      font-size: 0.72rem;
      background: rgba(16, 185, 129, 0.15);
      color: var(--success);
      padding: 3px 9px;
      border-radius: 6px;
      font-weight: 700;
      border: 1px solid rgba(16, 185, 129, 0.3);
    }
    .hub-route {
      font-size: 1.05rem;
      font-weight: 700;
      color: #f1f5f9;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .hub-times {
      font-size: 0.78rem;
      color: var(--text-muted);
    }
    .hub-hero-center {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 6px;
    }
    .hub-airspace-pill {
      font-size: 0.74rem;
      color: var(--accent);
      background: rgba(56, 189, 248, 0.08);
      border: 1px solid rgba(56, 189, 248, 0.22);
      padding: 4px 12px;
      border-radius: 20px;
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }
    .hub-hero-right {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    /* 3 Categorized Boards */
    .hub-boards-container {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 18px;
      padding: 18px 24px;
      flex: 1;
      overflow-x: auto;
      overflow-y: hidden;
    }
    .hub-board-col {
      background: rgba(15, 23, 42, 0.55);
      border: 1px solid var(--panel-border);
      border-radius: 14px;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      min-width: 280px;
      backdrop-filter: blur(10px);
    }
    .hub-col-header {
      padding: 12px 16px;
      border-bottom: 1px solid var(--panel-border);
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: rgba(30, 41, 59, 0.45);
    }
    .hub-col-title {
      font-weight: 700;
      font-size: 0.9rem;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .hub-col-count {
      font-size: 0.72rem;
      padding: 2px 8px;
      border-radius: 12px;
      font-weight: 700;
      font-family: var(--font-mono);
    }
    .hub-col-add-btn {
      width: 26px;
      height: 26px;
      border-radius: 6px;
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid rgba(255, 255, 255, 0.15);
      color: var(--text-main);
      font-weight: 700;
      font-size: 1rem;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.2s;
    }
    .hub-col-add-btn:hover {
      background: var(--accent);
      color: #080c14;
      border-color: var(--accent);
      transform: scale(1.05);
    }
    .hub-col-body {
      flex: 1;
      overflow-y: auto;
      padding: 14px;
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    /* Cards Inside Boards */
    .hub-card {
      background: var(--card-bg);
      border: 1px solid var(--panel-border);
      border-radius: 12px;
      padding: 14px;
      transition: all 0.2s ease;
    }
    .hub-card:hover {
      border-color: rgba(56, 189, 248, 0.35);
      background: rgba(30, 41, 59, 0.85);
      transform: translateY(-1px);
    }
    .hub-card-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 8px;
    }
    .hub-card-author {
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .hub-card-avatar {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      background: linear-gradient(135deg, #0284c7, #818cf8);
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 700;
      font-size: 0.78rem;
      color: #fff;
      flex-shrink: 0;
    }
    .hub-card-name {
      font-weight: 600;
      font-size: 0.88rem;
    }
    .hub-card-seat {
      font-family: var(--font-mono);
      font-size: 0.68rem;
      color: var(--accent);
      background: rgba(56, 189, 248, 0.12);
      padding: 1px 6px;
      border-radius: 4px;
      margin-left: 4px;
    }
    .hub-card-badge {
      font-size: 0.68rem;
      font-weight: 600;
      padding: 2px 8px;
      border-radius: 12px;
    }
    .hub-card-text {
      font-size: 0.84rem;
      line-height: 1.48;
      color: #e2e8f0;
      margin-bottom: 10px;
    }
    .hub-card-actions {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding-top: 8px;
      border-top: 1px solid rgba(255, 255, 255, 0.05);
    }
    .hub-card-meta {
      font-size: 0.72rem;
      color: var(--text-dim);
    }

    @media (max-width: 960px) {
      .hub-boards-container {
        grid-template-columns: 1fr;
        overflow-y: auto;
      }
      .hub-hero {
        flex-direction: column;
        align-items: flex-start;
      }
    }

    /* Quick Flight Chips inside Hub */
    .hub-quick-chip {
      background: rgba(15, 23, 42, 0.8);
      border: 1px solid var(--panel-border);
      border-radius: 8px;
      padding: 6px 12px;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      font-size: 0.8rem;
      white-space: nowrap;
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
      flex-shrink: 0;
    }
    .hub-quick-chip:hover {
      background: rgba(30, 41, 59, 0.95);
      border-color: rgba(56, 189, 248, 0.4);
      transform: translateY(-1px);
    }
    .hub-quick-chip.active {
      background: linear-gradient(135deg, rgba(2, 132, 199, 0.3) 0%, rgba(15, 23, 42, 0.95) 100%);
      border: 1.5px solid var(--accent);
      box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
      color: var(--accent);
      font-weight: 700;
    }

    /* Autocomplete Dropdown Styles */
    .flight-autocomplete-menu {
      position: absolute;
      top: calc(100% + 6px);
      left: 0;
      right: 0;
      background: #0b1329;
      border: 1.5px solid rgba(56, 189, 248, 0.45);
      border-radius: 14px;
      box-shadow: 0 20px 45px rgba(0, 0, 0, 0.8), 0 0 30px rgba(56, 189, 248, 0.25);
      z-index: 9999;
      max-height: 520px;
      overflow-y: auto;
      padding: 8px;
      backdrop-filter: blur(20px);
      scrollbar-width: thin;
      scrollbar-color: rgba(56, 189, 248, 0.4) rgba(15, 23, 42, 0.8);
    }
    .flight-autocomplete-menu::-webkit-scrollbar {
      width: 6px;
    }
    .flight-autocomplete-menu::-webkit-scrollbar-track {
      background: rgba(15, 23, 42, 0.8);
      border-radius: 4px;
    }
    .flight-autocomplete-menu::-webkit-scrollbar-thumb {
      background: rgba(56, 189, 248, 0.4);
      border-radius: 4px;
    }
    .flight-autocomplete-menu::-webkit-scrollbar-thumb:hover {
      background: var(--accent);
    }
    .autocomplete-header {
      padding: 8px 12px 6px 12px;
      font-size: 0.72rem;
      font-weight: 700;
      color: var(--accent);
      text-transform: uppercase;
      letter-spacing: 0.05em;
      border-bottom: 1px solid rgba(255, 255, 255, 0.06);
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    .autocomplete-item {
      padding: 10px 14px;
      border-radius: 8px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: space-between;
      transition: all 0.15s ease;
      margin-bottom: 3px;
    }
    .autocomplete-item:hover, .autocomplete-item.active {
      background: rgba(56, 189, 248, 0.14);
      border: 1px solid rgba(56, 189, 248, 0.35);
    }
    .auto-callsign {
      font-family: var(--font-mono);
      font-weight: 800;
      font-size: 0.96rem;
      color: var(--accent);
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .auto-airline {
      font-weight: 600;
      font-size: 0.86rem;
      color: var(--text-main);
    }
    .auto-route {
      font-size: 0.78rem;
      color: var(--text-muted);
      margin-top: 2px;
    }
    .auto-badge {
      font-size: 0.7rem;
      background: rgba(255, 255, 255, 0.08);
      color: var(--text-muted);
      padding: 3px 8px;
      border-radius: 6px;
      font-weight: 600;
    }
    .auto-custom-btn {
      padding: 11px 14px;
      border-radius: 8px;
      cursor: pointer;
      background: rgba(56, 189, 248, 0.08);
      border: 1px dashed rgba(56, 189, 248, 0.35);
      color: var(--accent);
      font-size: 0.84rem;
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 8px;
      margin-top: 4px;
      transition: all 0.2s;
    }
    .auto-custom-btn:hover {
      background: rgba(56, 189, 248, 0.18);
      border-color: var(--accent);
    }

    /* Date Selector Row in Hero Card */
    .hero-date-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding-top: 14px;
      margin-top: 14px;
      border-top: 1px solid rgba(255, 255, 255, 0.08);
      flex-wrap: wrap;
      gap: 12px;
    }
    .date-shortcut-btn {
      background: rgba(255, 255, 255, 0.06);
      border: 1px solid var(--panel-border);
      color: var(--text-muted);
      padding: 6px 14px;
      border-radius: 8px;
      font-size: 0.78rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
      font-family: var(--font-ui);
    }
    .date-shortcut-btn:hover {
      background: rgba(255, 255, 255, 0.12);
      color: var(--text-main);
      border-color: rgba(255, 255, 255, 0.25);
    }
    .date-shortcut-btn.active {
      background: rgba(56, 189, 248, 0.2);
      border-color: var(--accent);
      color: var(--accent);
      font-weight: 700;
      box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
    }