/* ═══════════════════════════════════════════════════════════════════════
   Desktop layout (>768px)
   Loaded LAST — always wins the cascade
   ═══════════════════════════════════════════════════════════════════════ */
@media (min-width: 768px) {

  /* ── Shell: constrain & center ──────────────────────────────────── */
  body {
    align-items: center;
    overflow-y: auto;
  }

  #app {
    width: 100%;
    max-width: 1240px;
    height: auto;
    min-height: 100vh;
    overflow: visible;
    padding-bottom: 40px;
  }

  /* ── Header ──────────────────────────────────────────────────────── */
  .app-header {
    max-width: 1240px;
    margin: 0 auto;
    border-bottom: none;
    padding: 24px 28px 16px;
    background: transparent;
  }
  .app-header h1 { font-size: 22px; }

  /* ── Main content ────────────────────────────────────────────────── */
  #main-content {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 28px 24px;
    width: 100%;
  }

  /* Constrain search bar and tag filter to card grid width (3×380 + 2×14 = 1168px) */
  #search-bar, #tag-filter-bar {
    max-width: 1168px;
    margin-left: auto;
    margin-right: auto;
  }

  /* ── Account cards: 3-column grid ────────────────────────────────── */
  .account-list {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(350px, 380px));
    gap: 14px;
    justify-content: center;
  }
  .account-card {
    padding: 18px 20px 16px;
    min-width: 0;
    max-width: 450px;
    justify-self: center;
    width: 100%;
  }
  @media (hover: hover) {
    .account-card:hover {
      transform: translateY(-2px);
      box-shadow: 0 1px 0 rgba(255,255,255,0.05), 0 8px 28px rgba(139,123,216,0.18);
    }
  }
  .otp-code {
    font-size: 34px;
    letter-spacing: 5px;
    line-height: 40px;
    margin-right: -5px;
  }

  /* ── Auth screens: centered card ─────────────────────────────────── */
  .fullscreen {
    align-items: flex-start;
    padding-top: 12vh;
    background: var(--tg-bg);
  }
  #preloader.fullscreen {
    align-items: center;
    padding-top: 0;
  }

  .auth-container,
  .pin-container,
  .settings-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 36px;
    box-shadow: var(--shadow);
  }
  .pin-container {
    max-width: 420px;
    width: 100%;
    padding: 32px 40px;
  }
  .settings-container {
    max-width: 520px;
    padding: 24px 28px 32px;
  }

  /* ── Modal: centered dialog ──────────────────────────────────────── */
  .modal {
    align-items: center;
    justify-content: center;
  }
  .modal-sheet {
    max-width: 560px;
    max-height: 85vh;
    border-radius: var(--radius);
    animation: dtFadeIn 0.2s ease;
  }
  .modal-handle { display: none; }

  /* ── Action sheet: centered dialog ───────────────────────────────── */
  .actions-overlay {
    align-items: center;
    justify-content: center;
  }
  .actions-sheet {
    max-width: 420px;
    border-radius: var(--radius);
    animation: dtFadeIn 0.2s ease;
  }
  .actions-handle { display: none; }

  /* ── FAB ─────────────────────────────────────────────────────────── */
  .fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
  }

  /* ── Empty state ─────────────────────────────────────────────────── */
  .empty-state {
    padding: 60px 0;
  }
  .empty-state h2 { font-size: 24px; }

  /* ── PIN pad: wider ──────────────────────────────────────────────── */
  .pin-pad {
    grid-template-columns: repeat(3, 72px);
    gap: 14px;
  }
  .pin-key {
    width: 72px;
    height: 72px;
    font-size: 26px;
  }
  .pin-key.biometric img {
    width: 30px;
    height: 30px;
  }
  .pin-dots {
    gap: 16px;
  }
  .pin-dots .dot {
    width: 18px;
    height: 18px;
  }

  /* ── Toast ────────────────────────────────────────────────────────── */
  .toast {
    bottom: 32px;
  }
  .toast.hidden {
    transform: translateX(-50%) translateY(20px);
  }

  /* ── Misc ────────────────────────────────────────────────────────── */
  ::-webkit-scrollbar { width: 6px; }
}

@keyframes dtFadeIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
