.jp-lang-menu{position:relative;z-index:8;color:#eef4fc;font-size:.84rem;font-weight:600;line-height:1.4}
.jp-lang-menu summary,.jp-lang-menu>div{border:1px solid #66819a;border-radius:.6rem;background:#182b3d;color:#fff}
.jp-lang-menu summary{cursor:pointer;min-height:36px;display:flex;align-items:center;gap:.4rem;padding:0 .7rem;white-space:nowrap;list-style:none;font-size:.84rem}
.jp-lang-menu summary::-webkit-details-marker{display:none}.jp-lang-menu summary::after{content:"▾";font-size:.8em}
.jp-lang-menu>div{position:absolute;right:0;top:calc(100% + .3rem);min-width:10rem;padding:.25rem;box-shadow:0 .35rem .9rem #0004}
.jp-lang-menu a,.jp-lang-menu span{display:block;padding:.55rem .7rem;color:#fff;text-decoration:none;white-space:nowrap}
.jp-lang-menu a:hover,.jp-lang-menu a:focus-visible{background:#354d61}.jp-lang-menu summary:focus-visible,.jp-lang-menu a:focus-visible{outline:2px solid #fbbb83}
.jp-native .detail-feature-grid:has(>.detail-feature-column:only-child){grid-template-columns:1fr}
.jp-native .hero h1{overflow-wrap:anywhere}
/* On narrow screens the controls, the logo and the region bar have their own
   rows. Opening a disclosure grows its row; the logo never sits behind it. */
@media (max-width: 48em) {
  .site-header:has(.jp-lang-menu) {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    padding-top: 6px;
  }
  .site-header:has(.jp-lang-menu) > .header-actions { position: static; align-items: flex-start; }
  .site-header:has(.jp-lang-menu) > .header-actions-left { grid-area: 1 / 1; justify-self: start; }
  .site-header:has(.jp-lang-menu) > .header-actions.header-actions-right {
    grid-area: 1 / 2; justify-self: end; flex-direction: row; gap: 6px; margin-block-end: 10px;
    min-width: 0; max-width: 100%;
  }
  .site-header:has(.jp-lang-menu) > .logo-link { grid-row: 2; grid-column: 1 / -1; justify-self: center; margin: 0; }
  .site-header:has(.jp-lang-menu) > :is(.country-toggle, .detail-header) { grid-column: 1 / -1; }
  .site-header:has(.jp-lang-menu) .header-actions > .utility-link { min-width: 44px; min-height: 44px; }
  .jp-lang-menu { min-width: 0; }
  .jp-lang-menu summary {
    position: relative; isolation: isolate; box-sizing: border-box; width: max-content; min-height: 44px;
    max-width: 100%; margin-inline-start: auto; padding: 0 7px; gap: 5px; line-height: 1.2;
    white-space: normal; overflow-wrap: anywhere; background: none; border: 0;
  }
  .jp-lang-menu summary::before {
    content: ""; position: absolute; inset: 6px 0; z-index: -1;
    background: #182b3d; border: 1px solid #66819a; border-radius: .55rem;
  }
  .jp-lang-menu[open] > div {
    position: static; box-sizing: border-box; width: max-content; min-width: 0;
    max-width: min(10rem, 100%); margin-block-start: 2px; text-align: start;
  }
  .jp-lang-menu :is(a, span) {
    box-sizing: border-box; display: flex; align-items: center; min-height: 44px;
    padding: .3rem 8px; white-space: normal; overflow-wrap: anywhere;
  }
  .jp-native .hero .hero-actions .save-race-button { padding-inline: 6px; gap: 4px; }
  .jp-native .hero .save-race-notify-label { text-wrap: balance; }
}
@media (max-width: 480px) {
  /* pwa.js reserves 43px for absolutely positioned photo controls. This
     header already reserves the real row, including when the photo link loads. */
  .site-header.pbd-has-photo-entry:has(.jp-lang-menu) { padding-top: 6px !important; }
}
