/* Language switcher and per-language type. Generated pages and their English
   sources load this beside headron.css; scripts/i18n.mjs writes the link. */
.lang-switch {
  position: relative;
  flex: none;
  margin-left: auto;
}
.lang-switch + .nav-theme {
  margin-left: 0;
}
.lang-switch > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 44px;
  --btn-h: 44px;
  padding: 0 12px;
  border-radius: var(--radius-control);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
}
.lang-switch > summary::-webkit-details-marker {
  display: none;
}
.lang-switch > summary::marker {
  content: "";
}
.lang-switch .menu-icon {
  width: 16px;
  height: 16px;
}
.lang-switch .lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 60;
  display: grid;
  min-width: 9rem;
  padding: 6px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.18);
}
.lang-switch .lang-menu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: calc(var(--radius-control) - 4px);
  color: var(--color-text-2);
  text-decoration: none;
  font-size: var(--text-sm);
}
.lang-switch .lang-menu a:hover,
.lang-switch .lang-menu a:focus-visible {
  background: var(--color-surface-2);
  color: var(--color-text);
}
.lang-switch .lang-menu a[aria-current] {
  color: var(--color-text);
  font-weight: 600;
}
.lang-sheet {
  display: none;
}
/* Below 1100px the header has no slack: the switcher drops to its globe (the
   summary keeps its aria-label), longer locale menu words drop to the icon, and
   the brand never shrinks under the tabs. */
header.nav-float .nav-brand {
  flex: none;
}
/* Two-glyph CJK tabs (料金) fall under the 44px target floor with the narrow
   padding below 1100px on fonts with tight CJK metrics (CI's Linux). */
.nav-float .tabs a {
  min-width: 44px;
  justify-content: center;
}
@media (max-width: 1099px) {
  .nav-float .lang-switch .lang-code {
    display: none;
  }
}
@media (min-width: 768px) and (max-width: 1099px) {
  html:not([lang="en"]) .nav-float .menu-word {
    display: none;
  }
}
@media (max-width: 450px) {
  .nav-float .lang-switch {
    display: none;
  }
  .lang-sheet {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-line);
  }
  .lang-sheet a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-pill);
    color: var(--color-text-2);
    text-decoration: none;
    font-size: var(--text-sm);
  }
  .lang-sheet a[aria-current] {
    color: var(--color-text);
    font-weight: 600;
    border-color: var(--color-text-3, var(--color-line));
  }
}

/* Japanese: Latin from the system face, kana and kanji from the platform's Japanese face. */
html:lang(ja) body {
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    "Hiragino Sans",
    "Hiragino Kaku Gothic ProN",
    "Noto Sans JP",
    "Yu Gothic",
    YuGothic,
    Meiryo,
    sans-serif;
  line-break: strict;
}
html:lang(ja) :is(h1, h2, h3, h4) {
  letter-spacing: 0;
  word-break: auto-phrase;
}
html:lang(ja) .hero-primary {
  white-space: normal;
}
/* Phones: the unbreakable second line ("レシート付きで。", 8 em) must fit the column.
   13vw (the English size) makes it 377px in a 330px column at 375; 10.5vw fills ~90%. */
@media (max-width: 600px) {
  html:lang(ja) :is(.hero-primary, .hero-secondary) {
    font-size: clamp(1.9rem, 10.5vw, 3.5rem);
  }
}
