html {
  line-break: strict;
  overflow-wrap: anywhere;
  word-break: normal;
}

/* Keep the upstream English snapshot from flashing before the Japanese
   runtime finishes translating the hydrated tree. */
html:not([data-ja-ready="true"]):not([data-ja-ready="error"]) body {
  visibility: hidden;
}

/* Narration is English-only in the pinned upstream snapshot. Keep its assets
   available, but hide every playback entry point until ja-runtime.js enables
   the Japanese narration feature flag. The not-enabled default also prevents
   the controls from flashing before the deferred runtime starts. */
html:not([data-ja-narration="enabled"])
  :is(
    button[aria-label="Listen to narration"],
    button[aria-label="ナレーションを聞く"],
    button[aria-label="Play audio of page text"],
    button[aria-label="ページテキストの音声を再生する"],
    audio
  ) {
  display: none !important;
}

html:not([data-ja-narration="enabled"])
  nav
  > div:has(
    > button[aria-label="Listen to narration"],
    > button[aria-label="ナレーションを聞く"]
  ) {
  display: none !important;
}

body,
button,
input,
select,
textarea {
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  font-feature-settings: "palt" 1;
}

body {
  padding-top: 42px;
}

html[data-translation-embedded="true"] body {
  padding-top: 0;
}

/* Temporarily hide the upstream English PDF entry point. Remove this rule
   when the reviewed Japanese PDF is ready and the link target is replaced. */
a[href$="/AI-2040.pdf" i],
a[href$="/ai-2040-original.pdf" i] {
  display: none !important;
}

/* Keep narration controls hidden until reviewed Japanese audio is available. */
button[aria-label="Listen to narration"],
button[aria-label="ナレーションを聴く"],
button[aria-label="ナレーションを聞く"] {
  display: none !important;
}

:lang(ja) p,
:lang(ja) li,
:lang(ja) blockquote {
  text-wrap: pretty;
}

.translation-disclosure {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1200;
  width: 100%;
  border-bottom: 1px solid #1d1b17;
  background: #eee6d6;
  color: #1d1b17;
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
}

.translation-disclosure__inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 20px;
  width: min(100% - 32px, 1280px);
  margin: 0 auto;
  padding: 10px 0;
}

.translation-disclosure__label {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 0.08em;
  color: #7a160f;
  white-space: nowrap;
}

.translation-disclosure__copy {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
}

.translation-disclosure a,
.translation-credits a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.translation-disclosure__source {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.translation-disclosure a:focus-visible,
.translation-credits a:focus-visible {
  outline: 2px solid #7a160f;
  outline-offset: 3px;
}

.translation-credits {
  position: relative;
  z-index: 1200;
  clear: both;
  width: 100%;
  margin-top: 72px;
  border-top: 1px solid #b8b09f;
  background: #f4efe4;
  color: #343027;
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
}

.translation-credits__inner {
  width: min(100% - 32px, 1080px);
  margin: 0 auto;
  padding: 28px 0 32px;
}

.translation-credits p {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.7;
}

.translation-credits__eyebrow {
  margin-bottom: 12px !important;
  text-transform: uppercase;
}

.translation-credits__note {
  max-width: 760px;
  color: #625c50;
}

@media (max-width: 860px) {
  .translation-disclosure__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px;
    width: min(100% - 24px, 1280px);
    padding: 9px 0 11px;
  }

  .translation-disclosure__copy,
  .translation-disclosure__source {
    font-size: 12px;
  }

  .translation-disclosure__source {
    justify-self: end;
  }

  .translation-disclosure__copy {
    display: none;
  }

  .translation-credits {
    margin-top: 48px;
  }

  .translation-credits__inner {
    width: min(100% - 24px, 1080px);
    padding: 24px 0 28px;
  }
}

@media print {
  .translation-disclosure,
  .translation-credits {
    break-inside: avoid;
  }
}
