@media (max-width: 900px) {
  .topbar {
    padding: 14px 18px;
    gap: 14px;
  }

  .topbar > nav {
    display: none;
  }

  .brand {
    min-width: 0;
    gap: 8px;
  }

  .brand span:last-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-menu-button {
    margin-left: auto;
    width: 44px;
    height: 44px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #0d1520;
    color: var(--text);
    cursor: pointer;
  }

  .mobile-menu-button span {
    width: 19px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform .18s ease, opacity .18s ease;
  }

  .mobile-menu-button.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .mobile-menu-button.open span:nth-child(2) { opacity: 0; }
  .mobile-menu-button.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .mobile-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 14px;
    right: 14px;
    padding: 10px;
    border: 1px solid #294563;
    border-radius: 15px;
    background: rgba(11, 18, 29, .98);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .48);
    backdrop-filter: blur(18px);
  }

  .mobile-menu-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .mobile-menu-links a,
  .mobile-menu-action {
    width: 100%;
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 10px 12px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text);
    text-align: left;
    font-weight: 800;
    font-size: .96rem;
    cursor: pointer;
  }

  .mobile-menu-links a:hover,
  .mobile-menu-action:hover {
    background: #15243a;
    color: var(--accent2);
  }

  .mobile-menu-links a.active {
    background: rgba(46, 140, 255, .12);
    color: var(--accent2);
  }

  .mobile-menu-divider {
    height: 1px;
    margin: 6px 4px;
    background: var(--line);
  }

  .mobile-menu-action.danger {
    color: #ff9a9a;
  }

  .pwa-install-banner {
    position: fixed;
    z-index: 100;
    left: 14px;
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 11px 13px;
    align-items: center;
    padding: 14px;
    border: 1px solid #31547a;
    border-radius: 17px;
    background: linear-gradient(145deg, rgba(19, 32, 51, .99), rgba(10, 18, 29, .99));
    box-shadow: 0 24px 80px rgba(0, 0, 0, .58), 0 0 30px rgba(46, 140, 255, .08);
    backdrop-filter: blur(18px);
  }

  .pwa-install-icon {
    width: 54px;
    height: 54px;
    border-radius: 13px;
    display: block;
  }

  .pwa-install-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
  }

  .pwa-install-copy strong {
    font-size: .98rem;
  }

  .pwa-install-copy span {
    color: var(--muted);
    font-size: .82rem;
    line-height: 1.45;
  }

  .pwa-install-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: .8fr 1.2fr;
    gap: 8px;
  }

  .pwa-install-actions .btn {
    min-height: 42px;
    padding: 9px 12px;
  }

  .hero {
    min-height: auto;
    padding-top: 58px;
    padding-bottom: 58px;
  }

  .hero h1 {
    font-size: clamp(2.6rem, 12vw, 4.4rem);
  }

  .hero p {
    font-size: 1.03rem;
  }

  .hero-actions .btn {
    flex: 1 1 190px;
  }

  .section {
    padding-top: 62px;
    padding-bottom: 62px;
  }

  .section-head h2 {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .cards article {
    padding: 21px;
  }

  .editor-dialog {
    width: 100vw;
    max-width: 100vw;
    max-height: 100dvh;
    height: 100dvh;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .dialog-shell {
    max-height: 100dvh;
    padding: 18px;
  }
}

@media (min-width: 901px) {
  .mobile-menu-button,
  .mobile-menu,
  .pwa-install-banner {
    display: none !important;
  }
}
