.yb-region-language[hidden],
body > .yb-language-switcher,
.yb-language-switcher[hidden] { display: none !important; }
[data-yb-language-slot] { flex: 1; min-width: 0; }
.yb-language-switcher {
  position: static;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  box-shadow: none;
  font-size: 14px;
}
.yb-language-switcher select {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 8px 30px 8px 10px;
  border: 1px solid #739eb4;
  border-radius: 2px;
  background-color: #fff;
  color: #123957;
  color-scheme: light;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.yb-language-switcher select:focus-visible { outline: 2px solid #1486c9; outline-offset: 2px; }
.yb-language-switcher [data-yb-language-status]:not(:empty) {
  display: block;
  padding: 6px 0 0;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
#yuyi-right-menu-drawer .yb-language-switcher select:focus-visible { outline-color: #ffe185; }
@media print { .yb-region-language, .yb-language-switcher { display: none !important; } }

@media (max-width:1089px) {
  #yuyi-right-menu-drawer .yb-right-region-settings {
    display: grid;
    grid-template-columns: minmax(0,.85fr) minmax(0,1.15fr);
    gap: 10px;
    margin: 0 8px;
    padding: 6px 0;
    border-bottom: 1px solid #9edbec35;
  }
  #easystore-section-header #yuyi-right-menu-drawer .yb-right-region-settings > .yuyi-right-drawer-topbar {
    display: grid;
    grid-template-columns: auto minmax(0,1fr);
    align-items: center;
    gap: 6px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
  }
  #yuyi-right-menu-drawer .yb-right-region-settings .currency-label {
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
  }
  #yuyi-right-menu-drawer .yb-right-region-settings :is(.yuyi-right-currency-select,[data-yb-language-slot]) {
    min-width: 0;
    width: 100%;
    flex: 1 1 auto;
  }
  #easystore-section-header #yuyi-right-menu-drawer .yb-right-region-settings select {
    width: 100%;
    min-width: 0;
    height: 36px;
    min-height: 36px;
    padding: 4px 20px 4px 6px;
    font-size: 13px;
    line-height: 1.2;
    text-overflow: ellipsis;
  }
}

/* Shared foreign-language text flow. The Traditional Chinese layout is unchanged. */
html[data-yb-i18n-language]:not([data-yb-i18n-language="zh-Hant"]) body {
  overflow-wrap: anywhere;
}
html[data-yb-i18n-language]:not([data-yb-i18n-language="zh-Hant"]) :is(h1,h2,h3,h4,h5,h6,p,li,dt,dd,label,summary,th,td,.button,.btn,.rte,[class$="__title"],[class$="-title"],[class$="-label"],[class$="-text"]) {
  overflow-wrap: anywhere;
  word-break: normal;
  white-space: normal !important;
}
/* Flexible children must be allowed to shrink inside their existing column. */
html[data-yb-i18n-language]:not([data-yb-i18n-language="zh-Hant"]) :is(.grid__item,.card__content,.card__information,.rte,.product__info-wrapper,.product__info-container,.yb-quest-caption,.yb-quest-dialog,.ybm-title,.yuyi-menu-label,.product_upsell-text) {
  min-width: 0;
}
/* Text actions grow vertically; native fields and icon-only controls keep their size. */
html[data-yb-i18n-language]:not([data-yb-i18n-language="zh-Hant"]) :is(.button,.btn,button:not([aria-label]):not(:has(svg,img))):not(input):not(.quantity__button):not(.yb-qty-btn):not(.slider-button):not(.header__icon):not(.modal__close-button):not(.yb-product-choice-cover__open):not([data-yb-i18n-fixed]) {
  min-width: 0;
  max-width: 100%;
  height: auto !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
  line-height: 1.4;
}
html[data-yb-i18n-language]:not([data-yb-i18n-language="zh-Hant"]) :is(.menu-drawer__menu-item,.yuyi-drill__items a,.yuyi-drill__items button,.breadcrumb a,.yb-member-back,.yb-reviews-view-all,.yb-welcome-choices a,.yb-menu-context strong,.yb-menu-context span) {
  min-width: 0;
  max-width: 100%;
  height: auto;
  white-space: normal !important;
  overflow-wrap: anywhere;
}
/* A typewriter's invisible spacer and visible overlay must use the same line breaks. */
html[data-yb-i18n-language]:not([data-yb-i18n-language="zh-Hant"]) [data-yb-typewriter] {
  min-width: 0;
  max-width: 100%;
  height: auto !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
}
html[data-yb-i18n-language]:not([data-yb-i18n-language="zh-Hant"]) [data-yb-typewriter] :is(.yb-typewriter__space,.yb-typewriter__typed) {
  white-space: inherit;
  overflow-wrap: inherit;
  word-break: inherit;
}
html[data-yb-i18n-language]:not([data-yb-i18n-language="zh-Hant"]) [data-yb-typewriter] .yb-typewriter__letter {
  display: inline;
}
/* Dialog titles take the remaining width; the close action keeps its own column. */
html[data-yb-i18n-language]:not([data-yb-i18n-language="zh-Hant"]) :is(.ybm-head,.cart-notification__header,.yb-notify-head,.yb-catalog-dialog__heading) {
  min-width: 0;
  height: auto;
  align-items: flex-start;
  gap: 12px;
}

/* Public labels drawn by CSS use the same dictionary as real text nodes. */
html[data-yb-i18n-language] #yb-article-top .yb-article-author::before { content: var(--yb-i18n-author,"作者 ") !important; }
html[data-yb-i18n-language] .yb-game-theme .customer:is(.login,.yb-account-auth):not(.yb-account-challenge) > .card::before { content: var(--yb-i18n-login,"登入") !important; }
html[data-yb-i18n-language] .yb-game-theme .customer:is(.login,.yb-account-auth):has(#tab-register:checked) > .card::before { content: var(--yb-i18n-register,"註冊") !important; }
html[data-yb-i18n-language] .yb-game-theme .customer.yb-account-auth[data-yb-login-mode="recover"] > .card::before { content: var(--yb-i18n-reset-password,"重設密碼") !important; }
html[data-yb-i18n-language] .yb-game-theme .customer.yb-account-auth[data-yb-login-mode="setup"] > .card::before { content: var(--yb-i18n-finish-registration,"完成註冊") !important; }
html[data-yb-i18n-language] .yb-game-theme .customer.yb-account-auth[data-yb-login-mode="verify"] > .card::before { content: var(--yb-i18n-enter-verification-code,"輸入驗證碼") !important; }
html[data-yb-i18n-language] .price-field.yb-pending::after { content: var(--yb-i18n-select-option,"請先選擇規格") !important; }
html[data-yb-i18n-language]:not([data-yb-i18n-language="zh-Hant"]) :is(.ybm-title,.cart-notification__heading,.yb-notify-head-title,.yb-catalog-dialog__heading > div) {
  flex: 1 1 0;
  min-width: 0;
  white-space: normal !important;
  overflow-wrap: anywhere;
}
html[data-yb-i18n-language]:not([data-yb-i18n-language="zh-Hant"]) :is(.ybm-close,.yb-notify-readall,.cart-notification__close,.yb-catalog-dialog__heading > button) {
  flex: 0 0 auto;
}
html[data-yb-i18n-language]:not([data-yb-i18n-language="zh-Hant"]) .ybm-close {
  max-width: 45%;
  height: auto;
  white-space: normal !important;
  overflow-wrap: anywhere;
}
/* Decorative dialog tabs enter the flow when a translation needs multiple lines. */
html[data-yb-i18n-language]:not([data-yb-i18n-language="zh-Hant"]) .ybm-label {
  position: relative;
  top: auto;
  left: auto;
  align-self: flex-start;
  flex: 0 0 auto;
  max-width: 100%;
  margin: -12px 0 14px;
  white-space: normal;
  overflow-wrap: anywhere;
}
html[data-yb-i18n-language]:not([data-yb-i18n-language="zh-Hant"]) :is(.ybm-body,.rte,.fr-view) {
  min-width: 0;
  overflow-wrap: anywhere;
}
html[data-yb-i18n-language]:not([data-yb-i18n-language="zh-Hant"]) :is(.ybm-body,.rte,.fr-view) img {
  max-width: 100% !important;
  height: auto !important;
}
/* Imported rich text stays within its container in every language. */
html :is(.ybm-body,.rte,.fr-view) :is(div,p,span)[style*="width"] {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box;
}
html :is(.ybm-body,.rte,.fr-view) :is(div,p,span)[style*="white-space"] {
  white-space: normal !important;
  overflow-wrap: anywhere;
}
/* Illustrated purchase notices use the same wrapping and action width in every language. */
html .yb-r18-overlay { touch-action: pan-y; }
html .yb-r18-overlay .yb-r18-card .yb-r18-textbox {
  max-height: 58%;
  padding-inline: 1cqw;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  font-size: clamp(13px,4.2cqw,20px);
}
html .yb-r18-overlay .yb-r18-card :is(.yb-r18-line,.yb-r18-link) {
  white-space: normal;
  overflow-wrap: break-word;
}
html .yb-r18-overlay .yb-r18-card .yb-r18-actions {
  left: 46%;
  width: 51%;
  transform: none;
  white-space: normal;
}
html .yb-r18-overlay .yb-r18-card .yb-r18-actions .yb-r18-btn {
  display: block;
  box-sizing: border-box;
  width: 100%;
  padding: 3.4cqw 2cqw;
  font-size: clamp(12px,4.4cqw,20px);
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
}
html .yb-r18-overlay .yb-r18-card .yb-r18-btn::after { white-space: nowrap; }
/* The containers and labels in a shared text row grow together. */
html[data-yb-i18n-language]:not([data-yb-i18n-language="zh-Hant"]) :is(.yb-search__recent,.yb-catalog__state,.yb-menu-context) {
  min-width: 0;
  max-width: 100%;
  height: auto;
  white-space: normal !important;
  overflow-wrap: anywhere;
}
html[data-yb-i18n-language]:not([data-yb-i18n-language="zh-Hant"]) .yb-search__recent { min-height: 36px; align-items: flex-start; }
html[data-yb-i18n-language]:not([data-yb-i18n-language="zh-Hant"]) :is(.yb-catalog__toolbar,.yb-catalog__state,.yb-menu-context) { flex-wrap: wrap; }
html[data-yb-i18n-language]:not([data-yb-i18n-language="zh-Hant"]) .yb-catalog__state { flex-shrink: 1; }
html[data-yb-i18n-language]:not([data-yb-i18n-language="zh-Hant"]) .yb-menu-context strong { overflow: visible; text-overflow: clip; }
/* Long Latin menu titles own a full row instead of the leftover flex width. */
@media (max-width:1089px) {
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) :is(#easystore-section-header,.yb-world-turn-source-header) #menu-drawer .yb-menu-context:not(.yb-menu-context--root) {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    grid-template-areas: "location back" "title title";
    gap: 8px 12px;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) #menu-drawer .yb-menu-context > span { grid-area: location; }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) #menu-drawer .yb-menu-context > strong { grid-area: title; }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) #menu-drawer .yb-menu-context > .menu-drawer__close-button { grid-area: back; }
}
/* Mobile Latin headings reserve a separate row for the return action. */
@media (max-width:640px) {
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) :is(.yb-cart-heading,.yb-lobby-heading) {
    grid-template-columns: 40px minmax(0,1fr);
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) :is(.yb-cart-news-back,.yb-account-news-back) {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: end;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) :is(#easystore-section-header,.yb-world-turn-source-header) .yb-notify-head {
    display: grid;
    grid-template-columns: minmax(0,1fr);
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) :is(#easystore-section-header,.yb-world-turn-source-header) .yb-notify-readall {
    justify-self: end;
    max-width: 100%;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) #yb-info-page #yb-help-quest .yhq-archive-nav.yb-game-filters {
    grid-template-columns: minmax(0,1fr);
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) #yb-info-page #yb-help-quest .yhq-archive-nav.yb-game-filters > a.yb-game-filter {
    flex-direction: row;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) #yb-info-page #yb-help-quest .yhq-archive-label {
    display: grid;
    grid-template-columns: auto minmax(0,1fr) auto;
    flex: 1 1 0;
    min-width: 0;
    gap: 8px;
    text-align: left;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) .yb-lobby__scene-controls {
    width: min(150px,calc(100vw - 32px));
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) .yb-lobby__scene-controls > button[data-yb-view-mode] {
    width: 140px;
    height: auto;
    min-height: 44px;
    white-space: normal;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) [data-yb-view-label] {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: break-word;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) :is(.yb-float,.yb-float__compact) {
    width: 140px;
    height: 104px;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) .yb-float__portrait {
    left: calc(50% - 36px);
    right: auto;
  }
  /* Translated lobby content flows vertically instead of using fixed scene coordinates. */
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) .yb-lobby {
    grid-template-columns: minmax(0,1fr);
    grid-template-rows: repeat(4,auto);
    gap: 16px;
    padding-top: 240px;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) .yb-lobby > :is(.yb-lobby__welcome,.yb-lobby__social,.yb-lobby__missions,.yb-lobby__notice) {
    position: relative;
    inset: auto;
    grid-column: 1;
    width: calc(100% - 32px);
    max-width: none;
    margin: 0 auto;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) .yb-lobby__welcome { grid-row: 1; }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) .yb-lobby__social {
    grid-row: 2;
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) .yb-lobby__missions {
    grid-row: 3;
    grid-template-columns: minmax(0,1fr);
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) .yb-lobby__notice { grid-row: 4; }
}
@media (max-width:620px) {
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) #ybXmb .yb-xmb-row {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
}
/* The existing four-column header reserves the logo, search and action tiles. */
@media (min-width: 1090px) {
  html[data-yb-i18n-language]:not([data-yb-i18n-language="zh-Hant"]) :is(#easystore-section-header,.yb-world-turn-source-header) .header {
    grid-template-rows: auto;
  }
  html[data-yb-i18n-language]:not([data-yb-i18n-language="zh-Hant"]) :is(#easystore-section-header,.yb-world-turn-source-header) .header__inline-menu {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
  html[data-yb-i18n-language]:not([data-yb-i18n-language="zh-Hant"]) :is(#easystore-section-header,.yb-world-turn-source-header) .header__inline-menu > ul {
    min-width: 0;
    width: 100%;
    align-items: stretch;
  }
  html[data-yb-i18n-language]:not([data-yb-i18n-language="zh-Hant"]) :is(#easystore-section-header,.yb-world-turn-source-header) .header__inline-menu > ul > li {
    flex: 1 1 auto;
    min-width: min-content;
  }
  html[data-yb-i18n-language]:not([data-yb-i18n-language="zh-Hant"]) :is(#easystore-section-header,.yb-world-turn-source-header) .header__inline-menu > ul > li > a,
  html[data-yb-i18n-language]:not([data-yb-i18n-language="zh-Hant"]) :is(#easystore-section-header,.yb-world-turn-source-header) .header__inline-menu > ul > li > details-disclosure > details > summary {
    min-width: 0;
    width: 100%;
    min-height: 48px;
    height: auto;
    padding-block: 8px;
    white-space: normal !important;
    overflow-wrap: normal;
    word-break: normal;
    transform: none;
  }
  html[data-yb-i18n-language]:not([data-yb-i18n-language="zh-Hant"]) :is(#easystore-section-header,.yb-world-turn-source-header) .header__inline-menu .yuyi-menu-label {
    min-width: 0;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
  }
  html[data-yb-i18n-language]:not([data-yb-i18n-language="zh-Hant"]) :is(#easystore-section-header,.yb-world-turn-source-header) .header__inline-menu .icon-caret {
    flex: 0 0 auto;
  }
  html[data-yb-i18n-language]:not([data-yb-i18n-language="zh-Hant"]) :is(#easystore-section-header,.yb-world-turn-source-header) .header__icons {
    flex-shrink: 0;
    min-width: max-content;
  }
}

html[data-yb-i18n-language] .template-point-history #MainContent .yb-points-heading h1::after { content: var(--yb-i18n-points-history-description,"查看每筆 Y幣的增減與紀錄。") !important; }


/* Appended language layout: auth-account.css */
/* Confirmed by live 360px Malay screenshots: vouchers, pass, profile and orders.
   The shared hero reserved three columns and capped the return link at 108px.
   Keep the emblem beside the title; give prose and the return link their own rows.
   Sources: source/assets/yb-member-benefits.css:446-479;
   source/templates/customers/details.liquid:4-37, orders.liquid:6-39.
   Display only: no DOM, form value, translation engine or payment changes. */
@media (max-width: 1089px) {
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) #MainContent :is(.yb-benefit-hero,#details_form .yb-profile-heading,.account-order-page .yb-orders-hero) {
    grid-template-columns: 40px minmax(0,1fr);
    gap: 12px;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) #MainContent :is(.yb-benefit-hero,#details_form .yb-profile-heading,.account-order-page .yb-orders-hero) :is(.yb-benefit-emblem,.account-title-image,.yb-orders-emblem) {
    grid-area: 1 / 1;
    width: 40px;
    height: 40px;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) #MainContent :is(.yb-benefit-hero,#details_form .yb-profile-heading,.account-order-page .yb-orders-hero) :is(.yb-benefit-heading-copy,.yb-profile-heading-copy,.yb-orders-heading-copy) {
    display: contents;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) #MainContent :is(.yb-benefit-hero,#details_form .yb-profile-heading,.account-order-page .yb-orders-hero) :is(.yb-benefit-heading-copy,.yb-profile-heading-copy,.yb-orders-heading-copy) > :is(h1,h2) {
    grid-area: 1 / 2;
    min-width: 0;
    position: relative;
    z-index: 1;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) #MainContent :is(.yb-benefit-hero,#details_form .yb-profile-heading,.account-order-page .yb-orders-hero) :is(.yb-benefit-description,.yb-profile-heading-copy > p,.yb-orders-heading-copy > p) {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
    margin-top: 0;
    position: relative;
    z-index: 1;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) #MainContent :is(.yb-benefit-hero,#details_form .yb-profile-heading,.account-order-page .yb-orders-hero) :is(.yb-benefit-back,.yb-profile-back,.yb-orders-back) {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-self: stretch;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) #MainContent :is(.yb-benefit-hero,#details_form .yb-profile-heading,.account-order-page .yb-orders-hero) :is(.yb-benefit-back,.yb-profile-back,.yb-orders-back) > span:not([aria-hidden]) {
    min-width: 0;
    overflow-wrap: normal;
    word-break: normal;
  }
}

/* Confirmed mobile Malay control labels: preserve whole words and font size.
   A minimum usable column width makes narrow phones use one column, while
   wider phones can use two. Counts remain independent children of buttons. */
@media (max-width: 640px) {
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) #details_form .yb-profile-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(min(100%,200px),1fr));
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) #details_form .yb-profile-nav a {
    min-width: 0;
    justify-content: flex-start;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) .account-order-page .account-sidebar-tabs {
    grid-template-columns: repeat(auto-fit,minmax(min(100%,220px),1fr));
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) .account-order-page .account-sidebar-tabs .account-sidebar-tab > span:first-child {
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
  }
}

/* Additional confirmed headers: points and wishlist. Credit history already
   uses .yb-benefit-hero above. Points' description is h1::after, not a <p>;
   retain that native pseudo-content and put its return action in row two.
   Sources: source/assets/yb-game-ui.css:89-122 and
   mu-plugins/yb-native-member-lists/assets/wishlist-client.js embedded CSS. */
@media (max-width: 1089px) {
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) :is(#MainContent .yb-points .yb-points-heading,#yb-wishlist-root .yb-wl-head) {
    grid-template-columns: 40px minmax(0,1fr);
    gap: 12px;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) :is(#MainContent .yb-points .yb-points-heading .yb-points-emblem,#yb-wishlist-root .yb-wl-head .yb-wl-mascot) {
    grid-area: 1 / 1;
    width: 40px;
    height: 40px;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) #MainContent .yb-points .yb-points-heading h1::after {
    max-width: none;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) #yb-wishlist-root .yb-wl-head .yb-wl-heading {
    display: contents;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) #yb-wishlist-root .yb-wl-head .yb-wl-heading > h1 {
    grid-area: 1 / 2;
    min-width: 0;
    position: relative;
    z-index: 1;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) #yb-wishlist-root .yb-wl-head .yb-wl-description {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
    margin-top: 0;
    position: relative;
    z-index: 1;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) :is(#MainContent .yb-points .yb-points-heading .yb-points-back,#yb-wishlist-root .yb-wl-head .yb-wl-back) {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) #yb-wishlist-root .yb-wl-head .yb-wl-back {
    grid-row: 3;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) :is(#MainContent .yb-points .yb-points-heading .yb-points-back,#yb-wishlist-root .yb-wl-head .yb-wl-back) > span:not([aria-hidden]) {
    min-width: 0;
    overflow-wrap: normal;
    word-break: normal;
  }
}

/* Tablet headers keep a larger emblem while retaining the separate prose and
   return-action rows. Form controls and filters retain their 640px breakpoint. */
@media (min-width: 641px) and (max-width: 1089px) {
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) :is(#MainContent :is(.yb-benefit-hero,#details_form .yb-profile-heading,.account-order-page .yb-orders-hero),#MainContent .yb-points .yb-points-heading,#yb-wishlist-root .yb-wl-head) {
    grid-template-columns: 54px minmax(0,1fr);
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) :is(#MainContent :is(.yb-benefit-hero,#details_form .yb-profile-heading,.account-order-page .yb-orders-hero),#MainContent .yb-points .yb-points-heading,#yb-wishlist-root .yb-wl-head) :is(.yb-benefit-emblem,.account-title-image,.yb-orders-emblem,.yb-points-emblem,.yb-wl-mascot) {
    width: 54px;
    height: 54px;
  }
}

/* Confirmed at 360px in Malay: the recovery link is 324px inside a 269px
   parent, and Google/Apple labels exceed the fixed 48px button height.
   Keep provider labels, native icons, actions and input values unchanged. */
@media (max-width: 640px) {
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) .yb-game-theme .customer:is(.login,.yb-account-auth) .button-snippet {
    grid-template-columns: repeat(auto-fit,minmax(min(100%,180px),1fr));
    align-items: stretch;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) .yb-game-theme .customer:is(.login,.yb-account-auth) .button-snippet > a,
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) .yb-game-theme .customer:is(.login,.yb-account-auth) .button-snippet > .yb-phone-panel > :is(summary,.yb-phone-trigger) {
    height: auto;
    min-height: 48px;
    align-self: stretch;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) .yb-game-theme .customer:is(.login,.yb-account-auth) .button-snippet > a > span:last-child {
    min-width: 0;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) .yb-game-theme .customer:is(.login,.yb-account-auth) .button-snippet > .yb-email-recovery-link > a {
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
  }
}

/* Confirmed at 320px in Malay on the password step: the recovery action
   overflows its 109.5px column. Keep two actions and let each grow by line. */
@media (max-width: 640px) {
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) .yb-account-auth .yb-auth-account-actions .yb-auth-account-action {
    height: auto;
    min-height: 44px;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
  }
}


/* Appended language layout: tickets-recent.css */
/* English/Malay mobile ticket actions and recently-viewed heading. */
@media (max-width: 749px) {
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) #yb-member-tickets .yb-tickets-head.yb-lobby-heading {
    grid-template-columns: 54px minmax(0,1fr);
    min-width: 0;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) #yb-member-tickets .yb-tickets-head.yb-lobby-heading > .yb-ticket-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: minmax(0,1fr);
    gap: 10px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin-top: 8px;
  }
  /* A return link's old header column must not create a third nav column. */
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) #yb-member-tickets .yb-tickets-head.yb-lobby-heading > .yb-ticket-actions > a {
    grid-area: auto;
    box-sizing: border-box;
    justify-self: stretch;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 44px;
    height: auto;
    white-space: normal;
    overflow-wrap: break-word;
    line-height: 1.4;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) #yb-member-tickets .yb-tickets-head.yb-lobby-heading > .yb-ticket-actions > a > span[aria-hidden="true"] {
    flex: 0 0 auto;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) .yb-rv-head {
    grid-template-columns: 54px minmax(0,1fr);
    min-width: 0;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) .yb-rv-head > .yb-rv-back {
    grid-column: 1 / -1;
    grid-row: 2;
    box-sizing: border-box;
    justify-self: stretch;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 44px;
    height: auto;
    white-space: normal;
    overflow-wrap: break-word;
    line-height: 1.4;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) .yb-rv-head > .yb-rv-back > span[aria-hidden="true"] {
    flex: 0 0 auto;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) .yb-rv-head > .yb-rv-back > span:not([aria-hidden]) {
    min-width: 0;
  }
}
@media (max-width: 400px) {
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) #yb-member-tickets .yb-tickets-head.yb-lobby-heading,
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) .yb-rv-head {
    grid-template-columns: 40px minmax(0,1fr);
  }
}

/* Keep the ticket subject and metadata above the conversation action. */
@media (max-width: 640px) {
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) #yb-member-tickets #yb-ticket-list > .yb-ticket-row {
    grid-template-columns: minmax(0,1fr);
    gap: 12px;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) #yb-member-tickets #yb-ticket-list > .yb-ticket-row > div {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    max-width: 100%;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) #yb-member-tickets #yb-ticket-list > .yb-ticket-row > div > :is(strong,small) {
    overflow-wrap: break-word;
    word-break: normal;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) #yb-member-tickets #yb-ticket-list > .yb-ticket-row > button[data-ticket] {
    grid-column: 1;
    grid-row: 2;
    box-sizing: border-box;
    justify-self: stretch;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 44px;
    height: auto;
    margin: 0;
    white-space: normal;
    overflow-wrap: break-word;
    line-height: 1.4;
  }
}


/* Appended language layout: history-amount.css */
/* Confirmed in en/ms member histories: per-letter inline-block overlays can
   wrap the final amount digit or Y-Coin letter despite the native text fitting.
   Match normal inline text flow and keep the temporary amount overlay on one
   line. Source text, financial values, timing and cursor animation are intact. */
html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) body:is(.template-point-history,.template-credit-histories) #MainContent .yb-history-amount-typed {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}
html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) body:is(.template-point-history,.template-credit-histories) #MainContent .yb-history-amount-typed > .yb-typewriter__letter {
  display: inline;
  white-space: pre;
  overflow-wrap: normal;
  word-break: normal;
}


/* Appended language layout: product-help.css */
/* The closed Malay service-guide label needs room for "perkhidmatan".
   Only the label widens; the open 64px label and scrolling orbit are unchanged. */
@media (max-width: 640px) {
  html[data-yb-i18n-language="ms"] .yb-product-help__orbit[data-yb-orbit-ready]:not(.is-open) .yb-product-help__sun-label {
    left: 50%;
    right: auto;
    width: 150px;
    transform: translateX(-50%);
  }
}


/* Appended language layout: article-nav.css */
/* Keep both mobile article navigation labels readable at their normal size. */
@media (max-width: 640px) {
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) #yb-article-top .yb-news-article-nav {
    display: grid;
    grid-template-columns: minmax(0,1fr);
    gap: 10px;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) #yb-article-top .yb-news-article-nav > a {
    box-sizing: border-box;
    justify-self: stretch;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: auto;
    min-height: 44px;
    margin: 0;
    white-space: normal;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) #yb-article-top .yb-news-article-nav > a > span {
    min-width: 0;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
  }
}


/* Appended language layout: catalog-search.css */
/* Mobile Latin catalog titles use a complete row before the brand control. */
@media (max-width: 640px) {
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) body.template-collection .yb-catalog__heading {
    display: grid;
    grid-template-columns: minmax(0,1fr);
    gap: 12px;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) body.template-collection .yb-catalog__heading-main {
    display: grid;
    grid-template-columns: auto minmax(0,1fr);
    width: 100%;
    min-width: 0;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) body.template-collection .yb-catalog__heading-main > div {
    min-width: 0;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) body.template-collection #yb-collection-title {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) body.template-collection .yb-catalog__heading > .yb-float {
    grid-column: 1;
    grid-row: 2;
    justify-self: end;
  }
}
/* The visible typing layer reserves multiline height at every viewport size. */
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) #yb-search-title {
    display: grid;
    grid-template-columns: minmax(0,1fr);
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) #yb-search-title > :is(.yb-typewriter__space,.yb-typewriter__typed) {
    grid-area: 1 / 1;
    min-width: 0;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) #yb-search-title > .yb-typewriter__typed {
    position: relative;
    inset: auto;
  }
@media (max-width: 640px) {
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) .yb-search .yb-search__field > button.yb-search__submit {
    flex-basis: 80px;
    min-width: 80px;
    padding-inline: 10px;
  }
}


/* Appended language layout: home-desktop.css */
/* Give long Latin labels usable desktop tracks without reducing their type size. */
@media (min-width: 1090px) {
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) .yb-lobby {
    grid-template-columns: minmax(0,1fr) minmax(0,1fr) 380px;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) .yb-lobby__social {
    grid-column: 1 / 3;
    grid-template-columns: repeat(auto-fit,minmax(120px,1fr));
    width: 100%;
    max-width: none;
    gap: 12px;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) .yb-lobby__round > span:last-child {
    min-width: 0;
    width: 100%;
    text-align: center;
    overflow-wrap: normal;
    word-break: normal;
    white-space: normal;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) .yb-lobby__missions {
    width: 100%;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) .yb-lobby__mission > span:not(.yb-lobby__mission-icon),
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) .yb-lobby__start-main,
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) .yb-lobby__start-main > span:not(.yb-lobby__cart) {
    min-width: 0;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) :is(.yb-lobby__mission,.yb-lobby__start) :is(strong,em,small) {
    overflow-wrap: normal;
    word-break: normal;
    white-space: normal;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) .yb-lobby__start > svg {
    flex: 0 0 33px;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) .yb-lobby__scene-controls > button[data-yb-view-mode] {
    flex-basis: 160px;
    width: 160px;
    height: auto;
    min-height: 44px;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) .yb-lobby__scene-controls > button[data-yb-view-mode] svg {
    flex-shrink: 0;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) .yb-lobby__float-slot .yb-float__badge {
    left: 50%;
    right: auto;
    width: 120px;
    transform: translateX(-50%);
    overflow-wrap: normal;
    word-break: normal;
  }
}


/* Appended language layout: orders-desktop.css */
/* Confirmed desktop Malay: a 214px sidebar leaves about 100px for 22px
   labels beside the original icon/count columns. Increase only this sidebar;
   cards can choose an appropriate number of readable columns in the remainder. */
@media (min-width: 981px) {
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) .customer.account-order-page .account-layout {
    grid-template-columns: 320px minmax(0,1fr);
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) .account-order-page .account-sidebar-tabs .account-sidebar-tab > span:first-child {
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
  }
  html:is([data-yb-i18n-language="en"],[data-yb-i18n-language="ms"]) .account-order-page .yb-orders-list {
    grid-template-columns: repeat(auto-fit,minmax(min(100%,220px),1fr));
  }
}


/* Appended all-language password action layout. */
/* Password-step account actions: size from each translated label, then wrap
   whole buttons to another row when their natural widths no longer fit.
   The existing 260px maximum wrapper, 14px font, colors, borders and links stay.
   Source: existing-member-auth.liquid:41-42. Applies before/after translation
   to every language and viewport; no form values or handlers are changed. */
.yb-game-theme .customer.yb-account-auth .yb-auth-account-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
}
.yb-game-theme .customer.yb-account-auth .yb-auth-account-actions .yb-auth-account-action {
  flex: 1 1 max-content;
  width: auto !important;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  height: auto;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  text-align: center;
}

/* Round 7: translate generated labels without changing the Traditional Chinese layout. */
html[data-yb-i18n-language]:not([data-yb-i18n-language="zh-Hant"]) body.yb-game-theme:is(.template-app:has(#reward_tab),.template-voucher) #MainContent .main-wrapper>h2::before{content:var(--yb-i18n-vouchers,"YUYIBUY / VOUCHERS")!important}
html[data-yb-i18n-language]:not([data-yb-i18n-language="zh-Hant"]) body.yb-game-theme.template-voucher .main-wrapper>div>h2::before{content:var(--yb-i18n-voucher-details,"YUYIBUY / VOUCHER DETAILS")!important}
html[data-yb-i18n-language]:not([data-yb-i18n-language="zh-Hant"]) .yb-game-theme .page-verify_otp>h1::before{content:var(--yb-i18n-account-verification,"YUYIBUY / ACCOUNT VERIFICATION")!important}
html[data-yb-i18n-language]:not([data-yb-i18n-language="zh-Hant"]) body .page-sf-promotion .sf_promo-page-header-title::after{content:var(--yb-i18n-addon-offers,"YUYIBUY / ADD-ON OFFERS")!important}
html[data-yb-i18n-language]:not([data-yb-i18n-language="zh-Hant"]) body.yb-game-theme.template-credit-histories .customer.account.yb-pass-account h1::after{content:var(--yb-i18n-pass-heading,"YUYIBUY / PASS")!important}
html[data-yb-i18n-language]:not([data-yb-i18n-language="zh-Hant"]) .yb-product-help__orbit[data-yb-orbit-ready].is-open .yb-product-help__sun-label::before{content:var(--yb-i18n-collapse,"收合")!important}
@media print{html[data-yb-i18n-language]:not([data-yb-i18n-language="zh-Hant"]).yb-copy-protected.yb-cp-print-content::after{content:var(--yb-i18n-print-protected,"此頁面已啟用防抄保護，無法列印內容。")!important}}
