/* Shared host-page chrome + design tokens for all 5 DivKit screens.
   Single source of truth: frame, responsiveness, focus, motion, skip link. */

:root {
  /* OKLCH ramp - calm indigo-violet wellness brand. No pure #000 / #fff. */
  --paper: oklch(0.99 0.004 275);
  --page: oklch(0.95 0.008 275);
  --ink: oklch(0.24 0.03 275);
  --muted: oklch(0.55 0.02 275);
  --hairline: oklch(0.88 0.01 275);
  --brand: oklch(0.56 0.16 272);
  --brand-press: oklch(0.49 0.16 272);
  --accent: oklch(0.83 0.12 85);
  --success: oklch(0.72 0.15 156);
  --dark-surface: oklch(0.20 0.02 275);

  --radius-sm: 16px;
  --radius-md: 24px;
  --radius-lg: 30px;

  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);

  --font-sans: "Inter Variable", "Inter", system-ui, -apple-system, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--page);
  color: var(--ink);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
}

.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 32px 16px;
  width: 100%;
}

.device-frame {
  position: relative;
  width: 390px;
  min-width: 360px;
  height: auto;
  max-height: calc(100dvh - 56px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  border: 1px solid var(--hairline);
  background: var(--paper);
  box-shadow: 0 24px 60px -20px oklch(0.45 0.05 275 / 0.35);
  scrollbar-width: thin;
}

#main {
  display: block;
  min-height: 100%;
}

#root {
  width: 100%;
  height: auto;
  border-radius: 0;
}

/* Skip link - visually hidden until focused */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  background: var(--brand);
  color: #fff;
  border-radius: 0 0 12px 0;
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus {
  left: 0;
}

/* Visible focus everywhere */
:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Mobile: frame goes full-bleed, content scrolls with the page */
@media (max-width: 599px) {
  body {
    display: block;
    background: var(--paper);
  }
  .stage {
    gap: 0;
    padding: 0;
  }
  .device-frame {
    width: 100%;
    min-width: 0;
    min-height: 100dvh;
    height: auto;
    overflow: visible;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  #main {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
