/**
 * Android phone–first baseline for promo / user-facing templates.
 * Load BEFORE each template’s own CSS. Admin is not covered.
 *
 * Forms: use font-size: 16px on input/textarea/select to avoid zoom on focus.
 */
:root {
  --android-vh: 100vh;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --android-tap: 48px;
  --android-font: Roboto, "Noto Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

@supports (height: 100dvh) {
  :root { --android-vh: 100dvh; }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  height: 100%;
}

html, body {
  min-height: 100%;
  min-height: var(--android-vh);
}

body {
  margin: 0;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

a, button, [role="button"], .android-tap {
  touch-action: manipulation;
}

.android-min-tap {
  min-height: var(--android-tap);
  min-width: var(--android-tap);
}

/* Bottom sheet shell — pair with template card styles */
.android-sheet {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  border-radius: 20px 20px 0 0;
  padding-bottom: calc(16px + var(--safe-b));
  max-height: min(92vh, 92dvh);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.android-sheet::before {
  content: "";
  display: block;
  width: 36px;
  height: 4px;
  margin: 8px auto 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .18);
}

@media (min-width: 520px) {
  .android-sheet {
    border-radius: 20px;
    padding-bottom: 20px;
    max-height: min(88vh, 720px);
  }
  .android-sheet::before { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
