/* Dedicated mobile layer for the same RFB website/domain */

.mobile-tabbar {
  display: none;
}

@media (max-width: 980px) {
  .container {
    width: min(100%, calc(100% - 1rem));
  }

  .hero {
    padding: 4rem 0 2.2rem;
  }

  .section {
    padding: 2rem 0;
  }

  .hero-panel,
  .card,
  .price-card,
  .panel {
    padding: 1rem;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(1.65rem, 8vw, 2.3rem);
  }

  .subline,
  .small {
    font-size: 0.9rem;
  }

  .topbar .inner {
    min-height: 56px;
    padding: 0.45rem 0;
  }

  .topbar .inner .row {
    width: 100%;
    gap: 0.5rem;
    justify-content: flex-start !important;
  }

  .topbar .inner .row > * {
    flex: 0 0 auto;
  }

  #user-badge {
    width: 100%;
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #pending-key-btn,
  #logout-btn {
    width: auto;
    padding: 0.45rem 0.7rem;
    font-size: 0.78rem;
  }

  main .row {
    display: grid;
    grid-template-columns: 1fr;
  }

  main .row > * {
    width: 100%;
  }

  main .row .btn,
  main .row .btn.ghost {
    width: 100%;
    text-align: center;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
  }

  .kpi .v {
    font-size: 1rem;
  }

  .dashboard-wrap {
    padding-bottom: calc(82px + env(safe-area-inset-bottom));
  }

  .dashboard-layout {
    display: block;
    margin-top: 0.7rem !important;
  }

  .tabs {
    display: none;
  }

  .glass {
    border-radius: 14px;
  }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 680px;
  }

  .mobile-tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 140;
    gap: 0.35rem;
    padding: 0.45rem 0.45rem calc(0.45rem + env(safe-area-inset-bottom));
    background: linear-gradient(to top, rgba(4, 5, 8, 0.96), rgba(4, 5, 8, 0.75));
    border-top: 1px solid var(--line);
    backdrop-filter: blur(14px);
    overflow-x: auto;
  }

  .m-tab-btn {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    border-radius: 999px;
    padding: 0.42rem 0.62rem;
    font-size: 0.75rem;
    white-space: nowrap;
    cursor: pointer;
  }

  .m-tab-btn.active {
    color: var(--fg);
    border-color: rgba(67, 167, 255, 0.7);
    box-shadow: 0 8px 20px rgba(67, 167, 255, 0.18);
  }
}
