@media (max-width: 1199px) {

  .topbar { padding: 0 12px; gap: 8px; }

  .clock-stat { display: none; }

  .topbar-center { gap: 14px; }
  .stat { font-size: 13px; }
  .stat-icon { font-size: 14px; }

  .sidebar { width: 240px; }
  .mission-sidebar { width: 220px; }

  .footer-links { gap: 12px; }
  .game-footer { font-size: 11px; padding: 0 12px; }
}

@media (min-width: 768px) and (max-width: 1199px) and (orientation: portrait) {

  body { overflow: hidden; }

  .game-wrapper { position: relative; overflow: hidden; }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    z-index: 5000;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0,0,0,0.6);
    padding-top: 50px;
  }
  .sidebar.mobile-open { transform: translateX(0); }

  .mission-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100%;
    z-index: 5000;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 24px rgba(0,0,0,0.6);
    padding-top: 50px;
  }
  .mission-sidebar.mobile-open { transform: translateX(0); }

  #map {
    position: fixed;
    top: 50px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
  }

  .alpha-banner ~ .topbar ~ .game-wrapper #map,
  body > .alpha-banner + .topbar + .game-wrapper #map {
    top: 78px;
  }

  .game-footer { display: none; }

  .mobile-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 4999;
    backdrop-filter: blur(2px);
  }
  .mobile-backdrop.active { display: block; }

  .mobile-fab-bar { display: none !important; }

  .topbar-right .dropdown { display: inline-block !important; }
  .topbar-right .dropdown .btn-menu {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }
}

@media (min-width: 768px) and (max-width: 1199px) and (orientation: landscape) {

  body { overflow: hidden; }

  .topbar-right .dropdown { display: inline-block !important; }
  .topbar-right .dropdown .btn-menu {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }

  .sidebar {
    width: 220px !important;
    min-width: 220px !important;
  }
  .mission-sidebar {
    width: 240px !important;
    min-width: 240px !important;
  }

  #mapStyleSwitcher {
    right: 252px !important;
    bottom: 16px !important;
  }
  #mapLayerFilterPanel {
    max-width: 240px !important;
    max-height: 60vh !important;
  }

  .topbar {
    padding: 0 10px !important;
  }
  .topbar .stat-card {
    padding: 4px 8px !important;
    font-size: 11px !important;
  }
  .topbar .stat-label {
    font-size: 9px !important;
  }

  .sidebar, .mission-sidebar {
    overflow-y: auto;
    overflow-x: hidden;
  }

  .sidebar h3, .mission-sidebar h3 {
    font-size: 12px !important;
  }
  .station-item, .mission-item {
    padding: 8px 10px !important;
    font-size: 11px !important;
  }

  .topbar .afk-pill,
  .topbar #afkPill,
  .topbar .topbar-afk,
  .topbar #updateAvailableBadge,
  .topbar .topbar-update-badge { display: none !important; }

  .topbar-center .stat-xp,
  .topbar-center .stat-stations,
  .topbar-center .shift-stat,
  .topbar .clock-stat,
  .topbar #welcomeUser,
  .topbar #afkStatus,
  .topbar #vipTopbarBadge,
  .topbar #founderTopbarBadge,

  .topbar .btn-pm,
  .topbar #updateBtn,
  .topbar .topbar-news-link,
  .topbar [data-news-link],
  .topbar .topbar-date { display: none !important; }
}

@media (min-width: 1200px) and (max-width: 1399px) and (orientation: landscape) {
  .topbar .afk-pill,
  .topbar #afkPill,
  .topbar .topbar-afk,
  .topbar #updateAvailableBadge,
  .topbar .topbar-update-badge,
  .topbar-center .stat-xp,
  .topbar-center .stat-stations,
  .topbar-center .shift-stat,
  .topbar .clock-stat,
  .topbar #welcomeUser,
  .topbar #afkStatus,
  .topbar #vipTopbarBadge,
  .topbar #founderTopbarBadge,

  .topbar .btn-pm,
  .topbar #updateBtn,
  .topbar .topbar-news-link,
  .topbar [data-news-link],
  .topbar .topbar-date { display: none !important; }

  .topbar-right .dropdown { display: inline-block !important; }
  .topbar-right .dropdown .btn-menu {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }
}

@media (min-width: 768px) and (max-width: 1199px) and (orientation: portrait) {
  .topbar .afk-pill,
  .topbar #afkPill,
  .topbar .topbar-afk,
  .topbar #updateAvailableBadge,
  .topbar .topbar-update-badge { display: none !important; }
}

@media (min-width: 768px) and (max-width: 1399px) {
  .topbar { gap: 8px !important; }
  .topbar-left { flex: 0 1 auto; min-width: 0; overflow: hidden; }
  .topbar-left .logo-small { display: none !important; }
  .topbar-right { flex-shrink: 0; }
  .topbar-center { min-width: 0; flex-wrap: nowrap; }
  .topbar-center .stat-xp,
  .topbar-center .stat-stations,
  .topbar-center .shift-stat,
  .topbar .clock-stat,
  .topbar #welcomeUser,
  .topbar #afkStatus,
  .topbar #vipTopbarBadge,
  .topbar #founderTopbarBadge,
  .topbar #updateBtn,
  .topbar .btn-pm { display: none !important; }
}

@media (min-width: 768px) and (max-width: 1199px) {
  body .topbar .topbar-right .dropdown {
    display: inline-block !important;
    position: relative !important;
  }
  body .topbar .topbar-right .dropdown .btn-menu {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    min-width: 36px !important;
    min-height: 36px !important;
    
    cursor: pointer !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: rgba(255,255,255,0.15) !important;
    user-select: none !important;
    -webkit-user-select: none !important;
  }
  
  body .topbar .topbar-right .dropdown .dropdown-menu {
    z-index: 99999 !important;
  }
  
  body .topbar {
    pointer-events: auto !important;
    z-index: 1000 !important;
  }
}

@media (min-width: 768px) and (max-width: 1199px) {
  .topbar .clock-stat,
  .topbar .stat-xp,
  .topbar .stat-stations,
  .topbar .shift-stat,
  .topbar #welcomeUser,
  .topbar .afk-pill,
  .topbar #afkPill,
  .topbar .topbar-afk,
  .topbar #updateAvailableBadge,
  .topbar .topbar-update-badge { display: none !important; }
  
  .topbar .topbar-center { gap: 8px !important; }
  .topbar .stat { font-size: 12px !important; }
}

.btn-menu, .btn-pm, .btn-support, .topbar-right button, .topbar-right a {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(255,255,255,0.1);
  cursor: pointer;
}

@media (max-width: 1199px) {
  
  #mapLayerFilterToggle,
  #verbandLayerToggle,
  #mapStyleToggle {
    width: 44px !important;
    height: 44px !important;
    font-size: 20px !important;
  }

  #mapLayerFilterPanel button {
    min-height: 36px;
    padding: 7px 9px !important;
  }
  #mapLayerFilterPanel {
    
    max-height: 70vh !important;
  }
}

@media (max-width: 767px) {

  body { overflow: hidden; }

  .game-wrapper {
    position: relative;
    overflow: hidden;
  }

  #mapLayerFilterPanel {
    position: fixed !important;
    top: 58px !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translateX(-50%) !important;
    width: min(92vw, 330px) !important;
    max-width: 92vw !important;
    max-height: calc(100dvh - 74px) !important;
    overflow-y: auto !important;
    z-index: 6200 !important;
  }

  .alpha-banner {
    font-size: 10px;
    padding: 5px 10px;
  }
  .alpha-banner a { display: none; }

  .topbar {
    height: 50px;
    padding: 0 10px;
    gap: 6px;
  }

  .logo-small { display: none; }
  .topbar #afkStatus,
  .topbar #updateBtn { display: none !important; }
  .stat-credits, .stat-fl { white-space: nowrap; flex-shrink: 0; }

  .clock-stat { display: none; }

  .topbar-center { gap: 10px; }
  .stat { font-size: 12px; gap: 4px; }
  .stat-icon { font-size: 13px; }
  
  .topbar-center .stat-xp,
  .topbar-center .stat-stations,
  .topbar-center .shift-stat { display: none; }

  .topbar-right { gap: 8px; font-size: 13px; }
  #welcomeUser { display: none; }

  .btn-menu { padding: 6px 10px; font-size: 12px; }
  .btn-pm   { padding: 6px 10px; font-size: 13px; }
  .topbar-right .dropdown .btn-menu { display: none; }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 290px;
    height: 100%;
    z-index: 5000;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0,0,0,0.6);
    padding-top: 50px; 
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .mission-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 290px;
    height: 100%;
    z-index: 5000;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 24px rgba(0,0,0,0.6);
    padding-top: 50px;
  }

  .mission-sidebar.mobile-open {
    transform: translateX(0);
  }

  #map {
    position: fixed;
    top: 50px;   
    left: 0;
    right: 0;
    bottom: 46px; 
    z-index: 1;
  }

  .alpha-banner ~ .topbar ~ .game-wrapper #map,
  body > .alpha-banner + .topbar + .game-wrapper #map {
    top: 78px;
  }

  .game-footer { display: none; }

  .mobile-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 4999;
    backdrop-filter: blur(2px);
  }

  .mobile-backdrop.active { display: block; }

  .mobile-fab-bar {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 46px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    z-index: 4000;
    align-items: stretch;
  }

  .mobile-fab {
    flex: 1;
    background: transparent;
    border: none;
    border-right: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    transition: all 0.15s;
    padding: 4px;
  }

  .mobile-fab:last-child { border-right: none; }
  .mobile-fab:hover, .mobile-fab.active { color: var(--accent); background: rgba(230,57,70,0.06); }

  .mobile-fab-icon { font-size: 18px; line-height: 1; }
  .mobile-fab-label { font-size: 9px; text-transform: uppercase; letter-spacing: 0.5px; }

  .mobile-fab-badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 20px);
    background: var(--accent);
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 8px;
    min-width: 14px;
    text-align: center;
  }

  .modal-overlay .modal-box {
    max-width: 100% !important;
    max-height: 90vh !important;
    width: 100%;
    margin: 0;
    border-radius: 16px 16px 0 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px 20px;
    animation: slideUpMobile 0.25s ease;
  }

  @keyframes slideUpMobile {
    from { transform: translateY(40px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
  }

  .modal-overlay {
    align-items: flex-end;
  }

  #panelOverlay .modal-box {
    max-height: 88vh !important;
    padding: 20px 16px;
  }

  .dropdown-menu {
    position: fixed !important;
    top: auto !important;
    bottom: 46px !important;
    right: 0 !important;
    left: 0 !important;
    width: 100% !important;
    min-width: unset;
    border-radius: 16px 16px 0 0;
    max-height: 75vh;
    overflow-y: auto;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.5);
  }

  .mission-settings { padding: 8px 12px; gap: 6px; }
  .setting-row { font-size: 11px; }

  .sidebar-section { padding: 14px; }
  .sidebar-section h3 { margin-bottom: 8px; }

  .station-item { padding: 8px 10px; }
  .vehicle-list-item { padding: 4px 6px; }

  .station-type-card { padding: 9px 12px; }
  .station-type-card .stc-icon { font-size: 18px; }

  .rang-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .rang-tab { white-space: nowrap; flex-shrink: 0; }

  .wachen-vehicle-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }

  .pm-badge { top: -2px; }

  #dienstgradBadge { font-size: 11px !important; padding: 3px 8px !important; }

  div[style*="bottom:50px"] {
    bottom: 56px !important;
  }
}

@media (max-width: 379px) {
  .sidebar, .mission-sidebar { width: 100%; }
  
  .mobile-fab-label { display: none; }
  .mobile-fab { font-size: 11px; }
  .mobile-fab-icon { font-size: 20px; }
}

@media (min-width: 1200px), (min-width: 768px) and (orientation: landscape) {
  .mobile-fab-bar { display: none !important; }
  .mobile-backdrop { display: none !important; }
}

html {
  min-width: 320px;
}

@media (min-width: 768px) {
  .mission-required-sticky {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
  }
}

@media (max-width: 767px) {
  .mission-required-sticky {
    position: static !important;
  }
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  @media (max-width: 767px) {
    #vehicleFooterHint,
    #vehicleSelectedBox {
      padding-bottom: calc(12px + env(safe-area-inset-bottom)) !important;
    }
  }
}

@media (max-width: 1024px) {
  .ingame-announcement {
    top: 60px !important;
    max-width: 94% !important;
    padding: 12px 44px 12px 14px !important;
    font-size: 13px !important;
    line-height: 1.45 !important;
    max-height: 78vh !important;
    overflow-y: auto !important;
    white-space: normal !important;
    display: block !important;
  }
  .ingame-announcement > button {
    width: 34px !important;
    height: 34px !important;
    font-size: 19px !important;
    top: 5px !important;
    right: 5px !important;
    position: absolute !important;
  }
}
@media (max-width: 480px) {
  .ingame-announcement {
    width: 94% !important;
    padding: 12px 42px 12px 14px !important;
    font-size: 12.5px !important;
  }
  .ingame-announcement > button {
    width: 32px !important;
    height: 32px !important;
  }
}
@media (max-width: 360px) {
  .ingame-announcement {
    top: 56px !important;
    width: 96% !important;
    max-width: 96% !important;
    padding: 11px 40px 11px 12px !important;
    font-size: 12px !important;
  }
}

@media (max-width: 480px) {
  #abPickerOverlay > div {
    padding: 14px 14px !important;
    max-height: 92vh !important;
    border-radius: 12px !important;
  }
  #abPickerOverlay h3 {
    font-size: 14px !important;
  }
  
  #abPickerSearch { min-width: 0 !important; }
  
}

@media (max-width: 480px) {
  
  [data-vw-tab-station] { padding: 4px 6px !important; font-size: 9px !important; }
  
  [data-wache-search],
  [data-vw-search-station] {
    
    font-size: 16px !important;
    padding: 6px 8px !important;
  }
  
  #abPickerSearch {
    font-size: 16px !important;
  }
}

.topbar {
  min-height: 48px;
  position: sticky;
  top: 0;
  z-index: 500; 
}

@media (min-width: 768px) and (max-width: 1199px) {

  .topbar { height: 50px; padding: 0 10px; gap: 6px; }

  .logo-small {
    font-size: 0;
    width: 32px;
    overflow: hidden;
  }
  .logo-small::before {
    content: "🚨";
    font-size: 22px;
  }

  .topbar-center { gap: 10px; }
  .topbar-center .stat-xp,
  .topbar-center .stat-stations,
  .topbar-center .shift-stat { display: none; }
  .topbar-center .stat { font-size: 12px; }

  .topbar-right { gap: 5px; }
  #welcomeUser { display: none; }

  #vipTopbarBadge {
    font-size: 0 !important;
    padding: 2px 5px !important;
    margin-left: 2px !important;
  }
  #vipTopbarBadge::before {
    content: "👑";
    font-size: 12px;
  }

  #founderTopbarBadge { font-size: 12px !important; margin-left: 2px !important; }

  #afkStatus {
    font-size: 0 !important;
    padding: 3px 6px !important;
    gap: 0 !important;
    min-width: 24px;
    height: 24px;
  }
  
  #afkStatus * { font-size: 12px !important; }

  #notifBellBtn {
    font-size: 16px !important;
    padding: 4px 6px !important;
  }
  #notifBellBadge {
    font-size: 9px !important;
    min-width: 14px !important;
    height: 14px !important;
    line-height: 14px !important;
  }

  #updateBtn {
    font-size: 0 !important;
    padding: 0 !important;
    width: 30px !important;
    height: 28px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }
  #updateBtn::before {
    content: "🆕";
    font-size: 14px;
  }

  #supportBtn {
    font-size: 0 !important;
    width: 30px !important;
    height: 28px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }
  #supportBtn::before {
    content: "🆘";
    font-size: 14px;
  }

  .topbar-right .btn-pm {
    font-size: 0 !important;
    width: 32px !important;
    height: 28px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    position: relative;
  }
  .topbar-right .btn-pm::before {
    content: "💬";
    font-size: 14px;
  }
  
  .topbar-right .btn-pm .pm-badge {
    font-size: 9px !important;
    min-width: 14px !important;
    height: 14px !important;
    line-height: 14px !important;
    position: absolute !important;
    top: -2px !important;
    right: -2px !important;
  }

  .topbar-right .btn-menu {
    font-size: 0 !important;
    width: 36px !important;
    height: 28px !important;
    padding: 0 !important;
    align-items: center;
    justify-content: center;
  }
  .topbar-right .btn-menu::before {
    content: "☰";
    font-size: 16px;
    font-weight: 700;
  }

  .dropdown-menu {
    width: 280px;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 10px;
  }
}

@media (min-width: 768px) and (max-width: 1199px) {
  body .topbar #dropdownMenu.dropdown-menu.open,
  html body #dropdownMenu.dropdown-menu.open {
    display: block !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    max-height: 80vh !important;
    width: 280px !important;
    min-width: 240px !important;
    z-index: 999999 !important;
    
    animation: none !important;
    transform: none !important;
    
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  
  body .topbar #dropdownMenu.dropdown-menu.open > * {
    display: block !important;
    width: auto !important;
    flex: none !important;
  }
  
  body .topbar #dropdownMenu.dropdown-menu.open a,
  body .topbar #dropdownMenu.dropdown-menu.open button {
    display: flex !important;
    flex-direction: row !important;
  }
}

@media (max-width: 1199px) {
  #dropdownMenu .dropdown-category.collapsible {
    min-height: 44px;
    padding-top: 11px;
    padding-bottom: 11px;
  }
}

@media (min-width: 768px) and (max-width: 899px) {
  .topbar { padding: 0 8px; gap: 4px; }
  .topbar-center { gap: 8px; }
  .topbar-center .stat { font-size: 11px; }
  .topbar-right { gap: 3px; }

  #afkStatus { display: none !important; }
}

@media (max-width: 1199px) {
  .topbar {
    overflow: visible;
    flex-wrap: nowrap;
  }

  .topbar-left {
    flex-shrink: 0;
    min-width: 0;
  }

  .topbar-center {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    justify-content: center;
  }

  .topbar-right {
    flex-shrink: 0;
    gap: 4px;
  }
}

@media (max-width: 767px) {

  #updateBtn {
    font-size: 10px !important;
    padding: 3px 8px !important;
  }
  #supportBtn {
    display: none !important;
  }

  .topbar {
    flex-wrap: nowrap;
    overflow: hidden;
  }

  .dropdown-menu {
    position: fixed !important;
    top: auto !important;
    bottom: 46px !important;
    right: 0 !important;
    left: 0 !important;
    width: 100% !important;
    border-radius: 16px 16px 0 0;
    max-height: 75vh;
    overflow-y: auto;
  }
}

@media (max-width: 400px) {
  .logo-small {
    font-size: 0;        
    width: 28px;
  }
  .logo-small::before {
    content: "🚨";
    font-size: 20px;
  }
}

@media (max-width: 1199px) {
  .modal-overlay,
  #panelOverlay,
  #missionModal,
  #vehicleModal,
  #vehicleHelpModal,
  #missionHelpModal {
    z-index: 99999 !important;
  }

  #alarmOverviewModal {
    z-index: 100010 !important;
  }
  #folgeQueueModal {
    z-index: 100011 !important;
  }

  .mobile-backdrop {
    z-index: 4999 !important;
  }

  .sidebar,
  .mission-sidebar {
    z-index: 5000 !important;
  }
}

@media (max-width: 767px) {
  .topbar {
    z-index: 6000 !important;
  }
  .sidebar.mobile-open,
  .mission-sidebar.mobile-open {
    z-index: 7000 !important;
    padding-top: 0 !important;
  }
  #vehicleModal > div {
    max-height: 85vh !important;
    max-height: 85dvh !important;
  }
  #vehicleModalHeader {
    position: sticky;
    top: 0;
    z-index: 6;
    background: var(--bg-card);
  }
}

@media (max-width: 767px) {
  #mapStyleSwitcher {
    right: 12px !important;
    bottom: 100px !important; 
  }
  
  #mapLayerFilterPanel {
    max-width: calc(100vw - 24px) !important;
    width: 280px !important;
    max-height: 65vh !important;
    font-size: 12px;
    
    z-index: 7500 !important;
  }
  
  #mapLayerFilterToggle,
  #verbandLayerToggle,
  #mapStyleToggle {
    width: 42px !important;
    height: 42px !important;
  }
}

@media (min-width: 768px) and (max-width: 1199px) {
  #mapStyleSwitcher {
    right: 12px !important;
    bottom: 70px !important;
  }
}

@media (max-width: 767px) {
  #mainPanelBox {
    max-width: calc(100vw - 16px) !important;
    width: calc(100vw - 16px) !important;
    max-height: 90vh !important;
    margin: 8px !important;
    padding: 16px !important;
  }
  #panelContent {
    font-size: 13px !important;
  }
}
@media (min-width: 768px) and (max-width: 1199px) {
  #mainPanelBox {
    max-width: 90vw !important;
    max-height: 88vh !important;
  }
  
  #mainPanelBox.xlarge-panel {
    max-width: min(1100px, 96vw) !important;
  }
}

@media (max-width: 1199px) {
  .station-item, .mission-item, .verband-item {
    min-height: 44px;
  }
  
  .modal-overlay button:not(.btn-cancel-x):not(.el-switch) {
    min-height: 38px;
  }

  .el-switch {
    min-height: 0 !important;
    flex-shrink: 0 !important;
  }
}

@media (max-width: 767px) {
  
  .topbar-center { gap: 8px; overflow: hidden; }
  #flDisplay { font-size: 12px; }
}

@media (max-width: 767px) {
  .btn-generate {
    min-width: 52px;
    font-size: 11px;
    padding: 5px 8px;
    white-space: nowrap;
  }
  
  .mission-settings {
    flex-wrap: wrap;
    gap: 4px;
  }
  #missionRadius { width: 60px !important; }
  #missionCategoryFilter { font-size: 10px; }
}

@media (max-width: 1399px) {
  #missionModal .modal-box {
    max-width: 760px !important;
    max-height: 92vh !important;
    padding: 16px 20px 0 20px !important;
    
    display: block !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }
  
  #missionModal .modal-box > * {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  #missionModal .modal-box > .modal-header {
    margin-top: 0 !important;
  }
  
  #missionModal .modal-box > #vehicleSelectList {
    flex: none !important;
    overflow-y: visible !important;
    max-height: none !important;
    min-height: 0 !important;
    margin-bottom: 8px !important;
  }

  #missionModal #missionInfoScroll {
    max-height: none !important;
    overflow: visible !important;
  }
  
  #missionModal .modal-box > .modal-actions {
    position: sticky !important;
    bottom: 0 !important;
    background: var(--bg-card) !important;
    margin: 0 -20px !important;
    padding: 10px 14px !important;
    border-top: 1px solid var(--border) !important;
    z-index: 5 !important;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.4) !important;
    
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    justify-content: flex-end !important;
    align-items: center !important;
  }
  #missionModal .modal-box > .modal-actions > button {
    
    padding: 8px 12px !important;
    font-size: 12px !important;
    margin: 0 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    min-height: 38px !important;
    flex: 0 1 auto !important;
  }
  
  #missionModal .modal-box > .modal-actions > #dispatchBtn {
    margin-left: auto !important;
  }
}

@media (max-width: 767px) {
  #missionModal .modal-box {
    max-width: 100% !important;
    padding: 16px 16px 0 16px !important;
  }
  #missionModal .modal-box > .modal-actions {
    margin: 0 -16px !important;
    padding: 10px 12px !important;
  }
  
  #missionModal .modal-box > .modal-actions > button {
    padding: 7px 10px !important;
    font-size: 11px !important;
    min-height: 36px !important;
  }
}

@media (max-width: 767px) {
  
  #missionModal .modal-box > .modal-header {
    position: sticky !important;
    top: -16px !important;
    background: var(--bg-card) !important;
    margin: -16px -16px 8px -16px !important;
    padding: 14px 16px 10px !important;
    z-index: 5 !important;
    border-bottom: 1px solid var(--border);
  }
  
  #missionModal .modal-header button[aria-label="Schließen"] {
    font-size: 28px !important;
    padding: 6px 10px !important;
  }
  
  #missionModal .modal-header span:first-child {
    font-size: 28px !important;
  }
  #missionModal .modal-header h2 {
    font-size: 17px !important;
    line-height: 1.25;
  }
  #missionModal .modal-header {
    gap: 10px !important;
  }
  #missionModal .modal-subtitle {
    margin-bottom: 10px !important;
    font-size: 12px !important;
    line-height: 1.5;
  }
  
  #missionRewardCard {
    padding: 8px 12px !important;
    margin-bottom: 8px !important;
  }
  #missionRewardCard [style*="font-size:18px"] { font-size: 16px !important; }
  #missionRewardCard #missionModalReward { font-size: 14px !important; }

  #missionModal > .modal-box > div[style*="background:var(--bg-input)"][style*="border-radius:10px"] {
    padding: 8px 12px !important;
    margin-bottom: 8px !important;
  }

  #vehicleSelectList > div:first-child {
    flex-wrap: wrap;
  }

  #vehicleSelectList .vehicle-select-item {
    padding: 11px 12px !important;
    margin-bottom: 4px !important;
    min-height: 48px;
  }

  #missionModal .modal-actions {
    flex-direction: column !important;
    gap: 6px !important;
  }
  #missionModal .modal-actions button {
    width: 100% !important;
    flex: none !important;
    padding: 11px !important;
    min-height: 44px;
  }
  
  #missionModal #dispatchBtn {
    order: 1;
    font-size: 15px !important;
    font-weight: 700 !important;
  }
  #missionModal #scheduledDispatchBtn {
    order: 2;
    margin-left: 0 !important;
  }
  #missionModal #flSkipBtn {
    order: 3;
  }
  #missionModal .btn-cancel {
    order: 4;
    padding: 9px !important;
    font-size: 13px !important;
  }

  #vehicleRequirementHint {
    padding: 6px 9px !important;
    font-size: 11px !important;
    margin-bottom: 6px !important;
  }
  
  #missionModal .vehicle-select-label {
    margin-bottom: 6px !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    align-items: center !important;
  }
  
  #missionModal .vehicle-select-label > #alarmOverviewBtn {
    margin-left: 0 !important;
  }
  
  #missionModal .vehicle-select-label > button:not(:first-of-type) {
    flex: 1 1 calc(50% - 4px) !important;
    justify-content: center !important;
    font-size: 11px !important;
    padding: 7px 8px !important;
    min-height: 36px;
    white-space: nowrap;
  }
  
  #missionModal .vehicle-select-label > button:first-of-type,
  #missionModal .vehicle-select-label > button[title*="Äquivalenz"] {
    flex: 0 0 auto !important;
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    min-height: 22px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    font-size: 11px !important;
    line-height: 1 !important;
  }
}

@media (max-width: 1024px) {
  
  #missingVehiclesSticky {
    display: none;
    position: fixed;
    top: 60px;   
    left: 8px;
    right: 8px;
    z-index: 9100;  
    margin: 0;
    padding: 10px 14px;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(247,177,31,0.98), rgba(255,159,28,0.98));
    color: #1a1a1a;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.55), 0 0 0 1px rgba(247,177,31,0.4);
  }
  #missingVehiclesSticky.show {
    display: flex !important;
    animation: missingStickySlideDown 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  }
  #missingVehiclesSticky.all-met {
    background: linear-gradient(135deg, rgba(63,185,80,0.96), rgba(46,160,67,0.96));
    color: #fff;
  }
  
  #missingVehiclesStickyText {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  @keyframes missingStickySlideDown {
    from { opacity: 0; transform: translateY(-100%); }
    to   { opacity: 1; transform: translateY(0); }
  }
}

@media (min-width: 1025px) {
  #missingVehiclesSticky { display: none !important; }
}

@media (max-width: 380px) {
  #missionModal .modal-box {
    padding: 12px !important;
  }
  #missionModal .modal-header span:first-child { font-size: 24px !important; }
  #missionModal .modal-header h2 { font-size: 15px !important; }
  #vehicleSelectList { max-height: 34vh !important; }
}

@media (max-width: 767px) {
  
  #elRewardFilter, #elXpFilter, #elSortFilter {
    font-size: 10px;
    padding: 6px 3px;
  }
  
  .el-mission-card {
    padding: 8px !important;
  }
  
  #elList { max-height: 420px !important; }
}

@media (max-width: 767px) {
  
  .mw-actions button { font-size: 10px !important; padding: 5px 6px !important; }
  
  .mw-vehicle-item { font-size: 11px !important; }
}

@media (max-width: 767px) {
  .station-type-card {
    flex-wrap: nowrap;
    gap: 6px;
  }
  .stc-cost { font-size: 11px; }
  
  .station-type-card button { font-size: 9px !important; padding: 2px 5px !important; }
}

@media (max-width: 767px) {
  #vehicleSearchInput,
  #missionVehicleSearchInput { font-size: 11px !important; padding: 6px 8px !important; }
  #vehicleSortSel { font-size: 9px !important; padding: 6px 4px !important; }
  .station-grp-header { font-size: 10px !important; padding: 6px 4px 3px !important; }
}

@media (max-width: 767px) {
  #panelOverlay {
    align-items: flex-end !important;
  }

  #panelOverlay .modal-box {
    border-radius: 20px 20px 0 0 !important;
    
    max-height: calc(92vh - 46px) !important;
    height: calc(92vh - 46px) !important;
    width: 100% !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  #panelOverlay .modal-box .modal-header {
    flex-shrink: 0;
    padding: 18px 16px 10px;
    border-bottom: 1px solid var(--border);
  }

  #panelOverlay .modal-box #panelContent {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 14px 16px;
    min-height: 0;
  }

  #panelOverlay .modal-box .modal-actions {
    flex-shrink: 0;
    padding: 12px 16px 14px;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: 0 !important;
  }
}

@media (max-width: 767px) {
  #missionFilterBar select { font-size: 10px; padding: 4px 2px; }
  #missionSearch { font-size: 11px; }
}

@media (max-width: 767px) {
  #vehicleFlBtn { font-size: 11px !important; padding: 10px 8px !important; }
  #vehicleFlCost { font-size: 9px !important; }
  
  #vehicleSelectedBox > div:last-of-type {
    flex-wrap: nowrap;
  }
}

@media (max-width: 767px) {

  #toastStack {
    max-width: 96vw !important;
  }

  .toast-container, [id*="toast"]:not(#toastStack) {
    bottom: 60px !important;
  }
}

@media (max-width: 767px) {
  .verband-item { padding: 8px 10px; }
  .verband-item div { font-size: 12px; }
}

@media (min-width: 768px) and (max-width: 1199px) {
  
  #elRewardFilter, #elXpFilter, #elSortFilter {
    font-size: 11px;
    padding: 7px 4px;
  }
  
  #missionModal .modal-box {
    max-width: 520px !important;
  }
  
  #panelOverlay .modal-box {
    max-width: 480px !important;
    max-height: 85vh !important;
  }
  
  .sidebar { width: 230px; }
  .mission-sidebar { width: 210px; }
}

@media (max-width: 767px) {
  
  .topbar-center .stat-xp {
    min-width: 0 !important;
    flex-shrink: 1;
  }
  
  #xpBar { display: none !important; }
  
  #xpDisplay { font-size: 11px; }
  #levelBadge { font-size: 9px !important; padding: 1px 4px !important; }

  #vipTopbarBadge {
    font-size: 9px !important;
    padding: 1px 5px !important;
    margin-left: 3px !important;
  }
}

@media (max-width: 380px) {
  
  .topbar-center .stat-fl { display: none; }
  
  #credits { font-size: 12px; }
}

@media (max-width: 767px) {
  
  .station-item [style*="Lv."],
  .mw-station-level { white-space: nowrap; flex-shrink: 0; }
}

@media (max-width: 767px) {
  
  .rang-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap !important;
  }
  .rang-tabs::-webkit-scrollbar { display: none; }
  .rang-tab { flex-shrink: 0; font-size: 11px !important; padding: 6px 10px !important; }

  .rang-table-scroll {
    max-width: 100%;
  }
  .rang-table {
    font-size: 11px !important;
  }
  .rang-table th,
  .rang-table td {
    padding: 6px 6px !important;
  }
  
  .rang-avatar {
    width: 22px !important;
    height: 22px !important;
    font-size: 10px !important;
  }
  
  .rang-player {
    min-width: 100px !important;
  }
}

@media (max-width: 767px) {
  .doc-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap !important;
    gap: 4px !important;
    padding-bottom: 4px;
  }
  .doc-nav::-webkit-scrollbar { display: none; }
  .doc-nav-btn {
    flex-shrink: 0;
    font-size: 11px !important;
    padding: 5px 10px !important;
    white-space: nowrap;
  }
}

@media (max-width: 767px) {

  #panelContent [style*="repeat(4,1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  #panelContent [style*="flex:1;padding:7px"] {
    font-size: 10px !important;
    padding: 6px 4px !important;
  }
}

@media (max-width: 767px) {
  
  #panelContent [data-el-tab] {
    font-size: 10px !important;
    padding: 4px 8px !important;
  }
  
  #panelContent button[title="Alle Filter zurücksetzen"] {
    font-size: 10px !important;
    padding: 4px 8px !important;
  }
  
}

@media (max-width: 480px) {
  
  #panelContent #elRewardFilter,
  #panelContent #elXpFilter,
  #panelContent #elSortFilter {
    flex: 1 1 100% !important;
  }
}

@media (max-width: 767px) {
  
  #chatOverlay .modal-box {
    height: 85vh !important;
    max-height: 85vh !important;
  }
  
  #chatOverlay {
    padding-bottom: 0;
  }
}

@media (max-width: 767px) {
  #confirmModal .modal-box {
    margin: 0 16px;
    width: calc(100% - 32px) !important;
  }
}

@media (max-width: 767px) {
  
  .station-type-card {
    align-items: flex-start !important;
    flex-wrap: nowrap !important;
  }
  .stc-info { min-width: 0; flex: 1; }
  .stc-meta { font-size: 10px !important; white-space: normal; }
  
  .station-type-card > div:last-child {
    flex-shrink: 0;
    text-align: right;
    min-width: 70px;
  }
}

@media (min-width: 768px) and (max-width: 1199px) {
  
  .doc-nav {
    overflow-x: auto;
    flex-wrap: nowrap !important;
    gap: 6px;
  }
  .doc-nav-btn {
    flex-shrink: 0;
    font-size: 12px;
    white-space: nowrap;
  }
  
  .rang-tabs { overflow-x: auto; flex-wrap: nowrap !important; }
  .rang-tab  { flex-shrink: 0; }
}

@media (max-width: 767px) {
  
  #panelContent table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    font-size: 12px;
  }
  #panelContent th,
  #panelContent td {
    padding: 5px 8px !important;
    white-space: nowrap;
  }
}

@media (max-width: 767px) {
  
  #radioLog .radio-entry { font-size: 10px !important; padding: 4px 6px !important; }
}

@media (max-width: 767px) {
  
  .btn-generate {
    overflow: visible !important;
    white-space: nowrap !important;
    min-width: 48px !important;
    max-width: 80px !important;
  }
}

@media (max-width: 767px) {
  
  #panelContent .fin-tabs { overflow-x: auto; flex-wrap: nowrap !important; }
}

@media (max-width: 767px) {
  .stat-xp {
    min-width: 0 !important;
    max-width: 90px;
    overflow: hidden;
  }
  .stat-xp #xpBar { display: none !important; }
}
@media (max-width: 480px) {
  
  .stat-xp { display: none !important; }
}

@media (max-width: 767px) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="tel"],
  input[type="url"],
  input[type="search"],
  input[type="date"],
  input[type="datetime-local"],
  input[type="time"],
  input:not([type]),
  textarea,
  select {
    font-size: 16px !important;
  }
}

@media (max-width: 1199px) {
  .verband-tabs {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    
  }
  .verband-tabs::-webkit-scrollbar { height: 3px; }
  .verband-tabs::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
  .verband-tabs > button {
    flex: 0 0 auto !important;
    min-width: 80px !important;
  }
}
@media (max-width: 480px) {
  .verband-tabs > button {
    min-width: 70px !important;
    padding: 8px 8px !important;
    font-size: 11px !important;
  }
  .verband-tabs > button > span { font-size: 9px !important; }
}

@media (max-width: 480px) {
  
  #vWettkampfContent > div:first-child {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 6px !important;
  }
  
  #vWettkampfContent [style*="background:linear-gradient(135deg,#388bfd33"] [style*="font-size:26px"] {
    font-size: 20px !important;
  }
  
  #vWettkampfContent [style*="border-radius:8px"][style*="padding:10px 12px"] {
    padding: 8px 10px !important;
  }
}

@media (max-width: 480px) {
  #comebackBannerModal > div {
    width: calc(100% - 24px) !important;
    max-width: calc(100% - 24px) !important;
    padding: 24px 18px !important;
  }
  #comebackBannerModal h2 { font-size: 22px !important; }
  
  #comebackBannerModal [style*="font-size:64px"] { font-size: 48px !important; }
  
  #comebackBannerModal [style*="font-size:28px"] { font-size: 22px !important; }
}

@media (max-width: 480px) {
  
  #emailSettingsBox ul {
    padding-left: 18px !important;
    margin: 6px 0 !important;
  }
  #emailSettingsBox li {
    margin-bottom: 4px;
    line-height: 1.5;
  }
  
  #emailSettingsBox label[style*="display:flex"] {
    align-items: flex-start !important;
  }
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  @media (max-width: 1199px) {
    
    .mobile-fab-bar {
      padding-bottom: env(safe-area-inset-bottom);
      height: calc(46px + env(safe-area-inset-bottom));
    }
    
    .modal-overlay .modal-box {
      padding-bottom: calc(24px + env(safe-area-inset-bottom)) !important;
    }
    
    .dropdown-menu {
      bottom: calc(46px + env(safe-area-inset-bottom)) !important;
      padding-bottom: env(safe-area-inset-bottom);
    }
  }
}

@media (max-width: 1199px) {
  .modal-box,
  .sidebar,
  .mission-sidebar,
  .dropdown-menu,
  .verband-tabs {
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 480px) {
  #vehicleModal > div {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;  
    margin: 0 !important;
  }
  
  #vehicleModal > div > div {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }
}

@media (max-width: 480px) {
  .confirm-modal-overlay .confirm-modal-box,
  #confirmModal .modal-box {
    width: calc(100% - 24px) !important;
    max-width: calc(100% - 24px) !important;
  }
  .confirm-modal-actions,
  #confirmModal .modal-actions {
    flex-direction: column !important;
    gap: 6px !important;
  }
  .confirm-modal-actions button,
  #confirmModal .modal-actions button {
    width: 100% !important;
    min-height: 44px;
  }
}

@media (max-width: 480px) {
  .mission-item {
    padding: 10px 12px !important;
  }
  .mission-item-name {
    font-size: 13px !important;  
  }
  
  .mission-skip-btn {
    min-width: 28px !important;
    min-height: 28px !important;
  }
  
  .mission-badge {
    font-size: 10px !important;
    padding: 2px 7px !important;
  }
}

@media (max-width: 1199px) {
  .btn-confirm:active,
  .btn-cancel:active,
  .mobile-fab:active,
  .mission-item:active {
    transform: scale(0.97);
    transition: transform 0.05s;
  }
  
  button, a, .clickable, .mission-item, .vehicle-select-item, .mobile-fab {
    -webkit-tap-highlight-color: transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  
  .modal-overlay .modal-box {
    animation: none !important;
  }
  
  .btn-confirm:active,
  .btn-cancel:active,
  .mobile-fab:active,
  .mission-item:active,
  .vehicle-select-item:active {
    transform: none !important;
  }
  
  .mission-progress-bar {
    animation: none !important;
  }
  
  * {
    scroll-behavior: auto !important;
  }
  
  #comebackBannerModal * {
    animation: none !important;
  }
}

@media (max-width: 360px) {
  
  .logo-small {
    font-size: 0 !important;  
  }
  .logo-small::before {
    content: '🚨';
    font-size: 20px;
  }
  
  .topbar-center { gap: 8px !important; }
  .stat { font-size: 11px !important; }
  .stat-icon { font-size: 12px !important; }

  .mobile-fab-label {
    font-size: 8px !important;
    letter-spacing: 0 !important;
  }
  .mobile-fab-icon {
    font-size: 16px !important;
  }
  .mobile-fab {
    padding: 4px 2px !important;
  }

  .modal-overlay .modal-box {
    padding: 14px 12px !important;
  }
}

@supports selector(:focus-visible) {
  button:focus-visible,
  a:focus-visible,
  input:focus-visible,
  textarea:focus-visible,
  select:focus-visible,
  .mission-item:focus-visible,
  .vehicle-select-item:focus-visible,
  .mobile-fab:focus-visible {
    outline: 2px solid var(--info, #388bfd);
    outline-offset: 2px;
    border-radius: inherit;
  }
}

@media (min-width: 1920px) {
  .sidebar { max-width: 380px; }
  .mission-sidebar { max-width: 360px; }
  
  .modal-overlay .modal-box {
    max-width: 720px;
  }
  #vehicleModal > div {
    max-width: 800px !important;
  }
}

@media (orientation: landscape) and (max-height: 500px) {
  
  .mobile-fab-bar { display: flex !important; }

  .topbar-right .dropdown { display: inline-block !important; }
  .topbar-right .dropdown .btn-menu {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }

  .game-wrapper { padding-bottom: 46px; }
  
  @supports (padding-bottom: env(safe-area-inset-bottom)) {
    .game-wrapper { padding-bottom: calc(46px + env(safe-area-inset-bottom)); }
    .mobile-fab-bar {
      padding-bottom: env(safe-area-inset-bottom);
      height: calc(46px + env(safe-area-inset-bottom));
    }
  }
}

@media (orientation: landscape) and (max-width: 1199px) {
  
  html.lock-portrait body::after {
    content: '🔒\A\AQuer-Modus gesperrt\A\ABitte dein Handy zurück ins Hochformat drehen\Aoder den Schalter unter „Menü → Einstellungen → Quer-Modus" deaktivieren.';
    white-space: pre-line;
    text-align: center;
    line-height: 1.6;
    position: fixed;
    inset: 0;
    z-index: 2147483647; 
    background: linear-gradient(135deg, rgba(13, 17, 23, 0.97), rgba(22, 27, 34, 0.97));
    color: #fff;
    font-size: clamp(14px, 4vw, 22px);
    font-weight: 600;
    padding: clamp(20px, 6vw, 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
  }
  
  html.lock-portrait body {
    
    pointer-events: none;
  }
  
  html.lock-portrait body::after {
    pointer-events: auto;
  }
}

@media (orientation: landscape) {

  html.lock-portrait body { overflow: auto !important; }

  html.lock-portrait .sidebar,
  html.lock-portrait .mission-sidebar {
    width: revert !important;
    min-width: revert !important;
  }
  
  html.lock-portrait .mobile-fab-bar { display: flex !important; }
  html.lock-portrait .mobile-backdrop { display: revert !important; }

  html.lock-portrait #mapStyleSwitcher {
    right: revert !important;
    bottom: revert !important;
  }
  html.lock-portrait #mapLayerFilterPanel {
    max-width: revert !important;
    max-height: revert !important;
  }

  html.lock-portrait .topbar { padding: revert !important; }
  html.lock-portrait .topbar .stat-card {
    padding: revert !important;
    font-size: revert !important;
  }
  html.lock-portrait .topbar .stat-label { font-size: revert !important; }

  html.lock-portrait .sidebar h3,
  html.lock-portrait .mission-sidebar h3 { font-size: revert !important; }
  html.lock-portrait .station-item,
  html.lock-portrait .mission-item {
    padding: revert !important;
    font-size: revert !important;
  }

  html.lock-portrait .topbar .afk-pill,
  html.lock-portrait .topbar #afkPill,
  html.lock-portrait .topbar .topbar-afk,
  html.lock-portrait .topbar #updateAvailableBadge,
  html.lock-portrait .topbar .topbar-update-badge,
  html.lock-portrait .topbar-center .stat-xp,
  html.lock-portrait .topbar-center .stat-stations,
  html.lock-portrait .topbar-center .shift-stat,
  html.lock-portrait .topbar .clock-stat,
  html.lock-portrait .topbar #welcomeUser,
  html.lock-portrait .topbar #afkStatus,
  html.lock-portrait .topbar #vipTopbarBadge,
  html.lock-portrait .topbar #founderTopbarBadge,
  html.lock-portrait .topbar .btn-pm,
  html.lock-portrait .topbar #updateBtn,
  html.lock-portrait .topbar .topbar-news-link,
  html.lock-portrait .topbar [data-news-link],
  html.lock-portrait .topbar .topbar-date {
    display: revert !important;
  }

  html.lock-portrait .game-wrapper {
    padding-bottom: revert !important;
  }
}

@media (orientation: landscape) and (min-width: 1200px) {
  html.lock-portrait body {
    pointer-events: auto !important;
    overflow: hidden !important;
  }
  html.lock-portrait body::after {
    content: none !important;
    display: none !important;
  }
  html.lock-portrait .mobile-fab-bar,
  html.lock-portrait .mobile-backdrop {
    display: none !important;
  }
  html.lock-portrait .sidebar { width: 280px !important; min-width: 280px !important; }
  html.lock-portrait .mission-sidebar { width: 260px !important; min-width: 260px !important; }
  html.lock-portrait #map {
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }
}

@media (max-width: 1199px) {

  #notifPanel {
    
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    transform: translate(-50%, -50%) !important;
    width: min(420px, calc(100vw - 32px)) !important;
    max-width: calc(100vw - 32px) !important;
    max-height: min(80vh, 640px) !important;
    z-index: 10500 !important;  
    box-shadow: 0 16px 48px rgba(0,0,0,0.6) !important;
  }

  body:has(#notifPanel[style*="display: flex"])::before,
  body:has(#notifPanel[style*="display:flex"])::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 10400;  
    pointer-events: none;
    animation: notifBackdropFadeIn 0.18s ease-out;
  }

  /* .topbar ist hier sticky mit z-index:500 und damit ein eigener
     Stapel-Kontext. Das Panel liegt darin, sein z-index:10500 zaehlt also nur
     innerhalb der Topbar — der Schleier im Wurzel-Kontext lag darueber und
     machte den Text grau. Topbar anheben, solange das Panel offen ist. */
  body:has(#notifPanel[style*="display: flex"]) .topbar,
  body:has(#notifPanel[style*="display:flex"]) .topbar {
    z-index: 10600 !important;
  }
}

@keyframes notifBackdropFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (max-width: 560px) {
  #panelContent .aao-rule-row {
    flex-wrap: wrap;
    contain-intrinsic-size: auto 82px;
  }
  #panelContent .aao-rule-l1,
  #panelContent .aao-rule-l2 {
    flex: 1 1 100% !important;
    min-width: 0;
  }
  #panelContent .aao-rule-l2 > select {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none !important;
    font-size: 11px !important;
    padding: 8px 6px !important;
  }
  #panelContent .aao-rule-l2 > button {
    min-width: 40px;
    min-height: 40px;
  }
}

@media (min-width: 1200px) {
  .topbar {
    height: auto;
    min-height: 56px;
  }
}

@media (max-width: 900px) {
  .topbar-center {
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .topbar-center::-webkit-scrollbar { width: 0; height: 0; }

  .topbar-center .stat-credits { font-size: 0; }
  .topbar-center .stat-credits > span { font-size: 13px; }
  .topbar-center .stat-credits > span.stat-icon { font-size: 14px; }

  .topbar-center .stat-fl > span:last-child,
  .topbar-center .stat-ruhm > span:last-child { display: none; }

  .topbar-center .stat-fl { display: inline-flex; }
}

@media (max-width: 380px) {
  .topbar-center .stat-fl { display: inline-flex; }
}

@media (max-width: 767px) {
  #vipTopbarBadge,
  #founderTopbarBadge { display: none !important; }
}
