/* ==========================================================================
   Mobile app view (phones, ≤ 768px) — bottom tab bar, "More" sheet, install
   prompt and app-like touch behaviour. Desktop/tablet layouts are untouched.
   ========================================================================== */
.tabbar, .sheet-backdrop, .app-sheet { display: none; }

@media (max-width: 768px) {
  :root { --tab-h: 64px; }
  html { -webkit-tap-highlight-color: transparent; }
  body { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); overscroll-behavior-y: none; }
  body.no-tabbar { padding-bottom: 0; }

  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding: 0 6px env(safe-area-inset-bottom);
    background: rgba(255, 255, 255, .97); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
    border-top: 1px solid #ECECEF; box-shadow: 0 -6px 24px rgba(31, 31, 31, .06);
    transition: transform .22s ease;
  }
  body.no-tabbar .tabbar, body.kb-open .tabbar { transform: translateY(110%); }
  .tabbar a, .tabbar button {
    all: unset; box-sizing: border-box; cursor: pointer;
    height: var(--tab-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    font: 600 11px/1.1 Inter, system-ui, sans-serif; color: #6B6E76; text-align: center; position: relative;
  }
  .tabbar a svg, .tabbar button svg { width: 23px; height: 23px; transition: transform .15s ease; }
  .tabbar a:active svg, .tabbar button:active svg { transform: scale(.88); }
  .tabbar [aria-current="page"] { color: #FF7A00; }
  .tabbar [aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 50%; width: 26px; height: 3px; margin-left: -13px; border-radius: 0 0 3px 3px; background: #FF7A00; }
  .tabbar a:focus-visible, .tabbar button:focus-visible { outline: 2px solid #FF7A00; outline-offset: -4px; border-radius: 12px; }
  /* raised centre action */
  .tabbar .tb-main { color: #1F1F1F; }
  .tabbar .tb-main .tb-fab {
    width: 52px; height: 52px; margin-top: -26px; border-radius: 18px; display: grid; place-items: center;
    background: #FF7A00; color: #fff; box-shadow: 0 8px 20px rgba(255, 122, 0, .38), 0 0 0 5px #fff;
  }
  .tabbar .tb-main .tb-fab svg { width: 24px; height: 24px; }
  .tabbar .tb-main[aria-current="page"]::before { display: none; }

  /* toasts sit above the tab bar */
  .toasts { bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 12px); }

  /* "More" bottom sheet */
  .sheet-backdrop { display: block; position: fixed; inset: 0; z-index: 120; background: rgba(20, 20, 22, .45); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .app-sheet {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 130; max-height: 86vh; overflow: auto;
    background: #fff; border-radius: 22px 22px 0 0; padding: 8px 18px calc(20px + env(safe-area-inset-bottom));
    transform: translateY(105%); transition: transform .26s cubic-bezier(.2, .8, .2, 1); box-shadow: 0 -12px 40px rgba(0, 0, 0, .18);
  }
  .app-sheet[hidden] { visibility: hidden; }
  body.sheet-open .sheet-backdrop { opacity: 1; pointer-events: auto; }
  body.sheet-open .app-sheet { transform: none; }
  .app-sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: #DADBDF; margin: 4px auto 14px; }
  .app-sheet h2 { font: 700 17px/1.2 Inter, system-ui, sans-serif; margin: 0 0 12px; color: #1F1F1F; }
  .sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
  .sheet-grid a { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px; border-radius: 14px; background: #F7F7F8; color: #1F1F1F; text-decoration: none; font: 600 12.5px/1.2 Inter, system-ui, sans-serif; text-align: center; }
  .sheet-grid a .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: #FFF1E5; color: #FF7A00; }
  .sheet-grid a[aria-current="page"] { outline: 2px solid #FF7A00; background: #FFF8F2; }
  .sheet-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
  .sheet-row a, .sheet-install { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; border-radius: 12px; font: 600 14px/1 Inter, system-ui, sans-serif; text-decoration: none; }
  .sheet-row .wa { background: #25D366; color: #fff; }
  .sheet-row .call { background: #1F1F1F; color: #fff; }
  .sheet-install { width: 100%; border: 1.5px dashed #FF7A00; background: #FFF8F2; color: #C25700; cursor: pointer; }
  .sheet-ios { font: 400 13px/1.5 Inter, system-ui, sans-serif; color: #55585F; background: #F7F7F8; border-radius: 12px; padding: 12px 14px; margin: 0; }
  .sheet-ios b { color: #1F1F1F; }

  /* app-like page change */
  main#main { animation: rv-page-in .22s ease both; }
  @keyframes rv-page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}

/* Installed app (opened from the home screen) */
@media (display-mode: standalone) and (max-width: 768px) {
  .site-head { padding-top: env(safe-area-inset-top); }
  .site-foot .foot-grid { display: none; } /* the tab bar replaces the footer link lists */
}

@media (prefers-reduced-motion: reduce) {
  main#main { animation: none !important; }
  .tabbar, .app-sheet, .sheet-backdrop { transition: none !important; }
}
