/* ═══ WLMS – app-style mobile view (loaded after wlms.css) ═══ */
.app-bottom-nav, .app-toast, .app-sheet { display: none; }

@media (max-width: 768px) {
  html { -webkit-tap-highlight-color: transparent; }
  body { padding-bottom: calc(70px + env(safe-area-inset-bottom)); background: #f1f5f9; }

  /* Top bar: slim, app-like; the menu now lives in the bottom bar ("More") */
  .lms-topbar { padding: 0 16px; box-shadow: 0 1px 0 rgba(15,23,42,.06), 0 4px 14px rgba(15,23,42,.05); }
  .sidebar-toggle-btn { display: none !important; }
  .topbar-title { font-size: 17px; font-weight: 800; }

  .page-body { padding: 16px 14px 24px !important; }
  .page-header h1 { font-size: 20px; }
  .card, .course-card, .announce-card, .content-item { border-radius: 16px !important; }

  /* Side menu opens as a drawer above the bottom bar */
  .lms-sidebar { z-index: 1200; }
  .lms-sidebar.open { box-shadow: 8px 0 30px rgba(0,0,0,.25); }
  .lms-sidebar.open + .lms-topbar::after {
    content: ""; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 1100;
  }
  .nav-link.app-install-link { color: #86efac; }
  .nav-link.app-install-link svg { width: 18px; height: 18px; margin-right: 10px; vertical-align: -3px; }

  /* ── Bottom navigation ── */
  .app-bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
    background: #fff; border-top: 1px solid #e2e8f0;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 20px rgba(15,23,42,.07);
  }
  .abn-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 54px; padding: 2px 0; border: 0; background: none; font: inherit; cursor: pointer;
    color: #64748b; text-decoration: none; position: relative;
  }
  .abn-ic {
    position: relative; width: 52px; height: 30px; border-radius: 15px;
    display: flex; align-items: center; justify-content: center; transition: background .2s, color .2s;
  }
  .abn-lb { font-size: 11px; font-weight: 700; letter-spacing: .1px; }
  .abn-item.active { color: #1a3c5e; }
  .abn-item.active .abn-ic { background: #dbeafe; color: #2563a8; }
  .abn-item:active .abn-ic { background: #e2e8f0; }
  .abn-badge {
    position: absolute; top: -2px; right: 8px; min-width: 17px; height: 17px; padding: 0 4px;
    border-radius: 9px; background: #dc2626; color: #fff; font-size: 10px; font-weight: 800;
    display: flex; align-items: center; justify-content: center; border: 2px solid #fff;
  }

  /* ── "Get the app" toast ── */
  .app-toast:not([hidden]) {
    display: flex; align-items: center; gap: 10px; position: fixed; left: 50%; z-index: 1050;
    bottom: calc(80px + env(safe-area-inset-bottom)); width: calc(100% - 28px); max-width: 380px;
    background: #fff; border-radius: 14px; padding: 8px 8px 8px 10px; cursor: pointer;
    box-shadow: 0 10px 28px rgba(15,23,42,.22); border: 1px solid #e2e8f0;
    opacity: 0; transform: translate(-50%, 24px); transition: opacity .45s ease, transform .45s ease;
  }
  .app-toast.show { opacity: 1; transform: translate(-50%, 0); }
  .at-logo { width: 34px; height: 34px; border-radius: 9px; flex: none; }
  .at-text { flex: 1; min-width: 0; line-height: 1.2; }
  .at-text strong { display: block; font-size: 13.5px; color: #1a3c5e; }
  .at-text small { display: block; font-size: 11.5px; color: #64748b; margin-top: 2px; }
  .at-btn { background: #22c55e; color: #fff; font-weight: 800; font-size: 13px; padding: 7px 14px; border-radius: 9px; }
  .at-close { border: 0; background: none; font-size: 20px; line-height: 1; color: #94a3b8; padding: 2px 4px; }

  /* ── Step-by-step sheet (iPhone etc.) ── */
  .app-sheet:not([hidden]) {
    display: flex; align-items: flex-end; position: fixed; inset: 0; z-index: 1300; background: rgba(15,23,42,.45);
  }
  .as-card { background: #fff; width: 100%; border-radius: 20px 20px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); animation: asUp .3s ease; }
  @keyframes asUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
  .as-head { display: flex; align-items: center; gap: 10px; font-size: 16px; color: #1a3c5e; }
  .as-head .at-close { margin-left: auto; font-size: 24px; }
  .as-steps { margin: 14px 0 16px; padding-left: 22px; font-size: 14.5px; color: #334155; line-height: 1.9; }
  .as-steps svg { width: 18px; height: 18px; vertical-align: -4px; color: #2563a8; }
  .as-steps b { color: #1a3c5e; }
  .as-ok { width: 100%; border: 0; border-radius: 12px; padding: 13px; background: #2563a8; color: #fff; font-size: 15px; font-weight: 700; font-family: inherit; }
}
