/* Language switch for sms688: Chinese or English, one language at a time. */
.lang-switch {
  display: flex;
  flex: none;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line, #e5eaf3);
  border-radius: 9px;
  background: var(--soft, #f4f7fb);
}

.lang-switch-desktop {
  margin: 10px 8px 6px;
  justify-content: center;
}

.lang-switch button {
  min-width: 40px;
  padding: 4px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--mut, #7a879c);
  font: inherit;
  font-size: 11px;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
}

.lang-switch button[aria-pressed="true"] {
  background: var(--card, #fff);
  color: var(--text, #16213a);
  box-shadow: 0 1px 4px rgba(20, 35, 70, .12);
  font-weight: 700;
}

.lang-switch-mobile {
  display: none;
}

html[data-lang-mode="en"] .tabbar a {
  font-size: 10px;
  white-space: nowrap;
}

html[data-lang-mode="en"] .tabbar a .i {
  margin-bottom: 1px;
}

@media (max-width: 900px) {
  .lang-switch-mobile {
    display: flex;
    position: fixed;
    top: calc(8px + env(safe-area-inset-top));
    right: 10px;
    z-index: 90;
    padding: 3px;
    border-color: var(--line, #e5eaf3);
    background: color-mix(in srgb, var(--card, #fff) 88%, transparent);
    box-shadow: 0 4px 16px rgba(8, 12, 20, .14);
    backdrop-filter: blur(10px);
  }

  .lang-switch-mobile button {
    min-width: 42px;
    padding: 5px 8px;
  }

  html:not([data-i18n-frame]) .workspace-toolbar {
    gap: 8px;
  }

  html:not([data-i18n-frame]) .workspace-location {
    min-width: 0;
    flex: 1 1 auto;
  }

  html:not([data-i18n-frame]) .workspace-location > strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html:not([data-i18n-frame]) .workspace-toolbar .lang-switch-mobile {
    position: static;
    z-index: auto;
    margin-left: 0;
    padding: 2px;
    border-color: var(--line, #e5eaf3);
    background: var(--soft, #f4f7fb);
    box-shadow: none;
    backdrop-filter: none;
  }

  html:not([data-i18n-frame]) .workspace-toolbar .lang-switch-mobile button {
    min-width: 34px;
    padding: 4px 6px;
    font-size: 10.5px;
  }

  html:not([data-i18n-frame]) .workspace-admin {
    display: none !important;
  }

  /* The mobile tab bar is taller than the 56px the legacy buy bar assumed. */
  html:not([data-i18n-frame]) .buybar {
    bottom: calc(65px + env(safe-area-inset-bottom));
  }

  html:not([data-i18n-frame]) main {
    padding-bottom: 156px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lang-switch button { transition: none; }
}


/* Date inputs: browser-native 年/月/日 is locale-driven, so overlay an English placeholder when empty. */
.i18n-date-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  vertical-align: middle;
}
.i18n-date-wrap > input[type="date"] {
  box-sizing: border-box;
}
.i18n-date-ph {
  display: none;
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  color: var(--mut, #7a879c);
  font-size: 12.5px;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
}
html[data-lang-mode="en"] .i18n-date-wrap.is-empty .i18n-date-ph {
  display: block;
}
html[data-lang-mode="en"] .i18n-date-wrap.is-empty > input[type="date"],
html[data-lang-mode="en"] .i18n-date-wrap.is-empty > input[type="date"]::-webkit-datetime-edit {
  color: transparent;
}

/* bi11: mobile search button must not fall back to Chinese in English mode. */
@media (max-width: 900px) {
  html[data-lang-mode="en"] .workspace-search { flex: 0 0 auto; }
  html[data-lang-mode="en"] .workspace-search:before { content: 'Search'; }
}

/* Hide the platform-admin shortcut from the public workspace toolbar. */
.workspace-admin { display: none !important; }
