.bureau-language-switch {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  min-width: 48px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: var(--paper);
  font: 800 12px/1.2 var(--body);
  cursor: pointer;
  pointer-events: auto;
  white-space: nowrap;
}

.bureau-language-switch:hover {
  background: var(--acid);
}

.bureau-language-switch:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.bureau-language-toolbar {
  display: flex;
  justify-content: flex-end;
  padding-right: 48px;
  margin-bottom: 12px;
}

[data-bureau-locale] .site-header {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 16px;
}

[data-bureau-locale] .header-actions {
  gap: 12px;
  min-width: 0;
}

[data-bureau-locale] .brand {
  min-width: 0;
  max-width: 100%;
  width: auto;
}

[data-bureau-locale] .brand-type {
  min-width: 0;
}

[data-bureau-locale] .brand-type strong {
  overflow-wrap: anywhere;
}

html[lang="en"] .brand-type strong {
  max-width: 12ch;
  font-size: 20px;
  line-height: 1.05;
}

html[lang="en"] .primary-nav a {
  padding-inline: 12px;
  letter-spacing: 0;
}

html[lang="en"] :is(.auth-body h2, .ai-disclaimer-sheet h2, .score-heading h2, .ballot-step h2) {
  line-height: 1.15;
}

html[lang="en"] :is(#board-title, #about-title) {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.05;
  text-wrap: balance;
}

html[lang="en"] :is(.rating-hint, .rubric-row legend, .rubric-description, .task-checklist, .detail-form-hint) {
  overflow-wrap: anywhere;
}

html[lang="en"] :is(#game-title, #reference-title, #original-game-name, #reference-original-name, .leader-game h2, .leader-game small) {
  overflow-wrap: anywhere;
  min-width: 0;
}

html[lang="en"] .game-tags span {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

html[lang="en"] .leader-game h2,
html[lang="en"] .leader-game p {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.2;
}

html[lang="en"] .leader-bars > div {
  grid-template-columns: minmax(0, 1fr) minmax(28px, .65fr) minmax(0, 1fr);
}

html[lang="en"] .leader-bars :is(span, em) {
  white-space: normal;
  overflow-wrap: anywhere;
}

html[lang="en"] .completion-evidence-list :is(strong, p) {
  min-width: 0;
  overflow-wrap: anywhere;
}

[data-bureau-locale] .trial-chrome > .bureau-language-switch {
  order: 6;
  color: var(--paper);
  background: var(--ink);
  border-color: var(--paper);
}

[data-bureau-locale] .trial-chrome > .bureau-language-switch:hover {
  color: var(--ink);
  background: var(--acid);
}

[data-bureau-locale] .trial-chrome .capture-ticket {
  min-width: 0;
  flex: 0 1 220px;
}

[data-bureau-locale] .trial-chrome .capture-ticket strong {
  max-width: none;
  white-space: normal;
  overflow-wrap: anywhere;
}

[data-bureau-locale] .trial-chrome .game-ticket {
  min-width: 0;
  flex: 1 1 140px;
}

@media (max-width: 1180px) {
  [data-bureau-locale] .site-header {
    grid-template-columns: auto auto minmax(0, 1fr);
    padding-inline: 20px;
  }

  html[lang="en"] .live-status {
    max-width: 70px;
    font-size: 9px;
  }
}

@media (max-width: 1023px) {
  [data-bureau-locale] .site-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  [data-bureau-locale] .primary-nav a {
    min-width: 0;
  }
}

@media (max-width: 620px) {
  html[lang="en"] .primary-nav a {
    padding-inline: 6px;
    font-size: 11px;
  }

  html[lang="en"] #board-nav-link[data-locked="true"] {
    gap: 4px;
  }

  [data-bureau-locale] .site-header {
    gap: 12px;
    padding-inline: 12px;
  }

  [data-bureau-locale] .header-actions {
    gap: 8px;
  }

  [data-bureau-locale] .account-button {
    min-width: 0;
    max-width: 128px;
  }

  [data-bureau-locale] .brand-type {
    max-width: 84px;
  }

  html[lang="en"] .brand-type strong {
    font-size: 16px;
  }
}

@media (max-width: 400px) {
  [data-bureau-locale] .brand-mark {
    width: 32px;
    height: 32px;
    font-size: 20px;
  }

  [data-bureau-locale] .brand {
    gap: 8px;
  }

  [data-bureau-locale] .account-button {
    max-width: 104px;
  }

  html[lang="en"] .brand-type strong {
    font-size: 14px;
  }
}

@media (max-width: 1100px) {
  [data-bureau-locale]:has(.trial-chrome) {
    --trial-rail-height: calc(env(safe-area-inset-top, 0px) + 116px);
  }

  [data-bureau-locale] .trial-chrome {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    grid-template-rows: 48px minmax(0, 1fr);
    gap: 4px 8px;
    padding: calc(env(safe-area-inset-top, 0px) + 8px) 12px 8px;
  }

  [data-bureau-locale] .trial-chrome > * {
    order: initial;
  }

  [data-bureau-locale] .trial-chrome .exit-button {
    grid-column: 1;
    grid-row: 1;
    min-height: 44px;
    width: auto;
    grid-template-columns: auto minmax(0, 1fr);
    justify-content: start;
    gap: 8px;
  }

  [data-bureau-locale] .trial-chrome .rerecord-button {
    grid-column: 2;
    grid-row: 1;
  }

  [data-bureau-locale] .trial-chrome .zero-exit-button {
    grid-column: 3;
    grid-row: 1;
  }

  [data-bureau-locale] .trial-chrome > .bureau-language-switch {
    grid-column: 4;
    grid-row: 1;
  }

  [data-bureau-locale] .trial-chrome .capture-ticket {
    grid-column: 1 / 3;
    grid-row: 2;
    min-height: 0;
    margin: 0;
    padding: 4px 8px;
    border: 0;
    gap: 8px;
    width: auto;
    height: auto;
    justify-content: start;
  }

  [data-bureau-locale] .trial-chrome .game-ticket {
    display: grid;
    grid-column: 3 / 5;
    grid-row: 2;
    min-height: 0;
    padding: 4px 8px;
    box-shadow: none;
    height: auto;
  }

  [data-bureau-locale] .trial-chrome .game-ticket strong {
    max-width: none;
    font-size: 12px;
  }

  [data-bureau-locale] .trial-chrome :is(.exit-copy small, .shortcut, .game-ticket span, .capture-ticket small) {
    display: none;
  }

  [data-bureau-locale] .trial-chrome :is(.rerecord-button, .zero-exit-button) {
    width: 44px;
    min-height: 44px;
    padding: 6px;
    justify-content: center;
  }

  [data-bureau-locale] .trial-chrome :is(.rerecord-copy, .zero-exit-copy) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  [data-bureau-locale] .trial-chrome .exit-copy strong {
    font-size: 14px;
  }

  [data-bureau-locale] .trial-chrome :is(.exit-copy, .capture-ticket > span) {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    clip: auto;
    overflow: visible;
    white-space: normal;
  }

  [data-bureau-locale] .trial-chrome .capture-ticket strong {
    font-size: 10px;
  }
}
