/* ============================================================
   STACK — iOS / iPadOS enhancements
   Glassmorphism, safe-area insets, native scroll feel.
   Loaded unconditionally (harmless on non-Apple platforms).
   ============================================================ */

/* ── Glassmorphic surfaces ── */
.topbar,
.bottom-nav,
.modal__sheet,
.dt-header,
.dt-sidebar,
.sidebar {
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}

.topbar {
  background: rgba(26, 44, 56, 0.85) !important;
}
.bottom-nav {
  background: rgba(15, 33, 46, 0.88) !important;
}

/* ── Smooth momentum scrolling on iOS ── */
html,
body,
.sidebar,
.modal__sheet,
.route-canvas {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

/* ── Safe-area padding on every edge-anchored element ── */
.bottom-nav {
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.sidebar {
  padding-top: calc(env(safe-area-inset-top, 0) + 16px);
  padding-bottom: calc(env(safe-area-inset-bottom, 0) + 16px);
}
.modal__sheet {
  padding-bottom: calc(env(safe-area-inset-bottom, 0) + 20px);
}

/* ── Prevent iOS auto-zoom on input focus ── */
input,
textarea,
select,
.field__input {
  font-size: 16px !important;
}

/* ── Kill the 300ms tap delay ── */
a,
button,
input,
[role="button"] {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0, 231, 1, 0.14);
}

/* ── Use dvh instead of vh so the address bar doesn't clip content ── */
.shell {
  min-height: 100dvh;
}

/* ── iOS home-indicator friendly toast position ── */
.toast {
  bottom: calc(env(safe-area-inset-bottom, 0) + 84px);
}

/* ── Solid fallback if backdrop-filter unsupported ── */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .topbar { background: #1A2C38 !important; }
  .bottom-nav { background: #0F212E !important; }
}
