/* DEMO V4 — OFFLINE TYPOGRAPHY. app/globals.css (a locked file) imports Pretendard from a CDN; the offline demo bundles
   the same font (SIL Open Font License 1.1, public/fonts/pretendard/LICENSE.txt) so text renders identically without a
   network. Same family name: online, both sources serve the same font; offline, these local faces are used. */
@font-face { font-family: 'Pretendard'; font-weight: 300; font-display: swap; src: local('Pretendard Light'), url(/fonts/pretendard/Pretendard-Light.woff2) format('woff2'); }
@font-face { font-family: 'Pretendard'; font-weight: 400; font-display: swap; src: local('Pretendard Regular'), url(/fonts/pretendard/Pretendard-Regular.woff2) format('woff2'); }
@font-face { font-family: 'Pretendard'; font-weight: 500; font-display: swap; src: local('Pretendard Medium'), url(/fonts/pretendard/Pretendard-Medium.woff2) format('woff2'); }
@font-face { font-family: 'Pretendard'; font-weight: 600; font-display: swap; src: local('Pretendard SemiBold'), url(/fonts/pretendard/Pretendard-SemiBold.woff2) format('woff2'); }
@font-face { font-family: 'Pretendard'; font-weight: 700; font-display: swap; src: local('Pretendard Bold'), url(/fonts/pretendard/Pretendard-Bold.woff2) format('woff2'); }
@font-face { font-family: 'Pretendard'; font-weight: 800; font-display: swap; src: local('Pretendard ExtraBold'), url(/fonts/pretendard/Pretendard-ExtraBold.woff2) format('woff2'); }

/* ALAGA DEMO V3 GLOBAL — language switch + no-flash guard (presentation only). */

/* English page stays hidden until the translator has run once (fail-safe: shown after 6 s whatever happens). */
html[data-alaga-lang="en"]:not([data-alaga-i18n-ready]) body {
  visibility: hidden;
  animation: alaga-i18n-failsafe 0s linear 6s forwards;
}
@keyframes alaga-i18n-failsafe {
  to { visibility: visible; }
}

/* Compact 한국어 / English switch: sits just above the DEMO badge (left, above the bottom navigation). */
[data-alaga-lang-switch] {
  position: fixed;
  left: 12px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 116px);
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 999px;
  border: 1px solid rgba(23, 34, 53, 0.15);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 2px rgba(23, 34, 53, 0.08);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font: 600 11px/1 "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", sans-serif;
}
[data-alaga-lang-switch][hidden] { display: none; }
[data-alaga-lang-switch] button {
  appearance: none;
  border: 0;
  margin: 0;
  min-height: 24px;
  padding: 5px 9px;
  border-radius: 999px;
  background: transparent;
  color: rgba(23, 34, 53, 0.7);
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
[data-alaga-lang-switch] button[aria-pressed="true"] {
  background: #172235;
  color: #fff;
}
[data-alaga-lang-switch] button:focus-visible {
  outline: 2px solid #172235;
  outline-offset: 2px;
}
@media (prefers-reduced-motion: no-preference) {
  [data-alaga-lang-switch] button { transition: background-color 0.15s ease, color 0.15s ease; }
}
@media print {
  [data-alaga-lang-switch] { display: none; }
}

/* English text expansion (layout only, English mode only; Korean layout untouched) */
/* Gut Disease insights — report level tiles at 360 px: keep "Caution" on one line */
html[lang="en"] button[data-status][aria-pressed] .text-bodySmall {
  white-space: nowrap;
  font-size: 13px;
  letter-spacing: -0.01em;
}

/* ── Desktop presentation fixes (GLOBAL, 2026-10-19) ─────────────────────────────────────────── */
/* Language switch on the desktop split layout (≥1200 px: brand column + 430 px app panel): top-right
   corner of the brand column (its max-width 540 px copy never reaches it), so the switch neither covers
   the brand copy nor the app panel. Tablet / mobile keep the position above the DEMO badge. */
@media (min-width: 1200px) {
  html:has(.mshell-brand) [data-alaga-lang-switch] {
    top: 20px;
    bottom: auto;
    left: calc(50% + min(50%, 660px) - 64px - 430px - 72px);
    transform: translateX(-100%);
  }
}
/* /welcome intro artwork on tablet / desktop (≥768 px). WelcomePage sizes the approved artwork like
   `object-fit: cover` for the full window (height = window height). Inside the fixed 430 px app panel
   that enlarged and side-cropped it on tall windows or when zoomed out (at 2560×1440 the coral "next"
   arrow was cropped away). Here it is fitted (contain) into the panel and centred; the arrow hit area is
   %-positioned inside the same box, so it stays on the arrow. Phones (< 768 px) are unchanged. */
@media (min-width: 768px) {
  .mshell-panel main:has(> div > img[src*="welcome"]) {
    width: 100%;
    background: #fefefe;
  }
  .mshell-panel main:has(> div > img[src*="welcome"]) > div {
    top: 50%;
    height: auto;
    width: min(100%, calc(100dvh * 853 / 1844));
    transform: translate(-50%, -50%);
  }
}
