/* The existing English layout and brand typography remain unchanged. */
:root{--isekai-header-top:12px;--isekai-header-right:calc(16px + var(--isekai-scrollbar-width,0px) - (100vw - 100%));}
/* A zero-height flow slot preserves the existing page geometry and scrolls with its owner. */
.language-switcher-slot{position:relative;display:flow-root;grid-area:1/1;align-self:start;justify-self:stretch;width:100%;height:0;min-height:0;z-index:1001;pointer-events:none;}
.member-panel:has(>.language-switcher-slot)>.member-shell,body:has(>.language-switcher-slot)>:is(.wrap,.card){grid-area:1/1;}
.language-switcher{position:relative;top:auto;right:auto;display:flex;align-items:center;gap:2px;width:max-content;margin:var(--isekai-header-top) calc(var(--isekai-header-right) - var(--isekai-flow-owner-scrollbar-width,0px)) 0 auto;background:transparent;color:#999;pointer-events:auto;}
.language-switcher[hidden]{display:none;}

.language-switcher button{position:relative;display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;margin:0;padding:0 5px;border:0;border-radius:0;background:transparent;color:#999;font:400 13px/1.4 Arial,sans-serif;letter-spacing:.02em;text-transform:none;cursor:pointer;}
.language-switcher button[data-language="en"]{justify-content:flex-end;}
.language-switcher button[data-language="ja"]{justify-content:flex-start;}
.language-switcher button[aria-pressed="true"]{color:#eee;text-decoration-line:underline;text-decoration-color:#a50021;text-decoration-thickness:1px;text-underline-offset:10px;text-decoration-skip-ink:none;}
.language-switcher button[aria-pressed="true"]::after{content:none;}
.language-switcher button:focus-visible{outline:2px solid #a50021;outline-offset:1px;}
.language-switcher>span{font:400 12px/1 Arial,sans-serif;color:#999;}
html:root[lang="ja"] body.redesign-ui :is(input,textarea,select,button,[data-i18n],[data-i18n-parts]):not(:where([data-i18n-ignore],[data-i18n-ignore] *,#admin,#admin *,#adminPanel,#adminPanel *,.admin-mfa,.admin-mfa *)){font-family:"Noto Sans JP","Hiragino Kaku Gothic ProN","Yu Gothic",sans-serif;font-weight:400;letter-spacing:.02em;word-break:normal;overflow-wrap:anywhere;line-break:strict;}
html:root[lang="ja"] body.redesign-ui :is(p[data-i18n],p[data-i18n-parts],label,legend,summary):not(:where([data-i18n-ignore],[data-i18n-ignore] *,#admin,#admin *,#adminPanel,#adminPanel *,.admin-mfa,.admin-mfa *)){line-height:1.75;}
html:root[lang="ja"] body.redesign-ui :is(p[data-i18n],p[data-i18n-parts],label[data-i18n],legend[data-i18n],summary[data-i18n],.field>span[data-i18n]){font-size:15px;}
html:root[lang="ja"] body.redesign-ui :is(input,textarea,select):not(:where([data-i18n-ignore],[data-i18n-ignore] *,#admin *,#adminPanel *,.admin-mfa *)){font-size:16px;}
html:root[lang="ja"] body.redesign-ui :is(h1,h2,h3)[data-i18n]:not(:where([data-i18n-ignore],[data-i18n-ignore] *,#admin,#admin *,#adminPanel,#adminPanel *,.admin-mfa,.admin-mfa *)){font-family:"Noto Serif JP","Yu Mincho",serif;font-weight:400;letter-spacing:.03em;}
html[lang="ja"] .home .home-menu-description{font-size:15px;line-height:1.7;letter-spacing:.02em;}
html[lang="ja"] .home :is(.join-button,.button-vein){font-family:Cinzel,serif;}
html[lang="ja"] .language-switcher button{font:400 13px/1.4 "Noto Sans JP",Arial,sans-serif;letter-spacing:.02em;}
@media(max-width:599px){.account-heading-row{flex-wrap:wrap;}:root{--isekai-header-top:8px;--isekai-header-right:calc(10px + var(--isekai-scrollbar-width,0px) - (100vw - 100%));}body.redesign-ui .booking-header:has(#openMyAccount:not([hidden])) .booking-account-actions{padding-top:52px;max-width:100%}html[lang="ja"] .home .home-menu-description{font-size:14px;line-height:1.65}}
/* Keep the existing space beside the desktop stage caption. */
@media(min-width:900px){body.redesign-ui .booking-content .adaptive-progress-top{padding-right:130px;}}

/* Requested auth logo enlargement; keep every surrounding layout box unchanged. */
body.redesign-ui #members .member-shell:has(:is(#memberResetView,#memberActivateView,#memberLoginView).is-active) > .page-brand-logo{transform:translateY(16px) scale(2);transform-origin:top center;}
/* Identity transforms retain the existing entrance motion, then anchor fixed controls to the viewport. */
body.redesign-ui :is(#members,#booking,#adminPanel).is-open{transform:none;}
/* Match HOME's header baseline without shifting the content below the back link. */
body.redesign-ui :is(.join-back,.new-projects-back){position:relative;top:calc(var(--isekai-header-top) - 28px);}
@media(max-width:899px){
  body.redesign-ui :is(#members .member-close,#booking .booking-close){position:fixed;top:calc(var(--isekai-header-top) + 56px);right:22px;}
}
/* The language switcher keeps its existing position. Reserve its row on narrow screens. */
body.account-page .account-shell { padding-top: var(--isekai-header-top); }
@media (max-width: 1320px) {
  body.account-page > .language-switcher-slot { height: auto; }
  body.account-page .account-shell { padding-top: 0; }
}
body.account-page .account-top > :is(a, button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 5.5rem;
  min-height: 44px;
  height: 44px;
  white-space: nowrap;
  cursor: pointer;
}
body.account-page .account-header > .page-brand-logo { margin-bottom: 8px; }
body.account-page #accountContent :is(.account-muted, .account-note, .account-status) { margin-inline: 0; }
body.account-page #accountContent .account-actions > :is(a, button) {
  justify-content: flex-start;
  text-align: left !important;
}

/* Keep HOME JOIN sized from the English timer in both languages. */
body.redesign-ui #top.home .join-entry{display:grid;grid-template-columns:var(--isekai-home-join-column,max-content);justify-items:center;width:var(--isekai-home-join-column,max-content);max-width:100%;margin-inline:auto;}
body.redesign-ui #top.home .join-countdown{width:max-content;max-width:100%;margin-inline:auto;}
body.redesign-ui #top.home .join-button{width:calc(100% + 5px);min-width:0;max-width:none;height:56px;min-height:56px;padding:0;font-size:17px;line-height:1.2;justify-self:center;}
@media(max-width:599px){body.redesign-ui #top.home .join-button{height:70px;min-height:70px;}}
/* Mobile member access separates the prompt from one unbroken row of links. */
@media(max-width:599px){
  html:root[lang] body.redesign-ui.join-page p.join-existing{display:flex;flex-direction:column;align-items:flex-start;gap:4px;width:100%;max-width:100%;font-size:13px;line-height:1.6;letter-spacing:0;}
  html:root[lang] body.redesign-ui.join-page .join-existing-links{display:inline-flex;align-items:center;gap:5px;max-width:100%;white-space:nowrap;}
  html:root[lang] body.redesign-ui.join-page .join-existing-links :is(a,span){display:inline-flex;align-items:center;justify-content:center;min-height:44px;font-size:13px;line-height:1.5;letter-spacing:0;white-space:nowrap;}
}

/* Compact only the existing account and page-close controls. */
body.redesign-ui #bookingReservationHeader .booking-account-actions > :is(button, a) { min-width: 0; min-height: 32px; height: 32px; padding: 6px 5px; font-size: 10px; line-height: 1.3; white-space: nowrap; }
body.redesign-ui :is(#members #closeMembers, #adminPanel #closeAdmin, #snoopWelcome #closeSnoopWelcome) { width: 32px; min-width: 32px; height: 32px; min-height: 32px; padding: 0; font-size: 18px; }
body.redesign-ui :is(#members #closeMembers, #adminPanel #closeAdmin) { position: fixed; top: max(var(--isekai-header-top), env(safe-area-inset-top)); right: calc(var(--isekai-header-right) + 112px); }
