/* Localized mobile layout corrections. Loaded after page-specific styles. */
@media (max-width: 760px) {
  html:is(.locale-mobile,.en-mobile) *,
  html:is(.locale-mobile,.en-mobile) *::before,
  html:is(.locale-mobile,.en-mobile) *::after {
    box-sizing: border-box;
  }

  html:is(.locale-mobile,.en-mobile) body,
  html:is(.locale-mobile,.en-mobile) main,
  html:is(.locale-mobile,.en-mobile) section,
  html:is(.locale-mobile,.en-mobile) article,
  html:is(.locale-mobile,.en-mobile) aside,
  html:is(.locale-mobile,.en-mobile) form,
  html:is(.locale-mobile,.en-mobile) main > * {
    min-width: 0 !important;
    max-width: 100%;
  }

  html:is(.locale-mobile,.en-mobile) .directory-container {
    width: auto !important;
    max-width: none !important;
    margin-left: 16px !important;
    margin-right: 16px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  html:is(.locale-mobile,.en-mobile) main :where(h1, h2, h3, h4, p, label, strong, small) {
    height: auto !important;
    min-width: 0 !important;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  html:is(.locale-mobile,.en-mobile) main :where(h1, h2, h3, h4) {
    padding-bottom: .08em;
    line-height: 1.28 !important;
  }

  html:is(.locale-mobile,.en-mobile) main :where(button, .btn, .button, .primary-btn, .secondary-btn) {
    height: auto !important;
    min-height: 44px;
    max-width: 100%;
    white-space: normal !important;
    line-height: 1.35 !important;
    overflow-wrap: anywhere;
  }

  html:is(.locale-mobile,.en-mobile) main :where(.result-value, .metric-value, .result-main, .result-number,
    .perf-result-value, .eng-result-hero strong, .accept-score b, .calc-result strong) {
    max-width: 100% !important;
    font-size: clamp(24px, 9vw, 40px) !important;
    line-height: 1.2 !important;
    overflow-wrap: anywhere;
  }

  html:is(.locale-mobile,.en-mobile) main :where(.metric-grid, .result-grid, .summary-grid, .stats-grid,
    .perf-metrics, .accept-metrics) > * {
    min-width: 0 !important;
  }

  html:is(.locale-mobile,.en-mobile) main :where(.metric, .stat, .summary-item, .result-item,
    .perf-metric, .jewelry-result, .fuel-result) strong {
    font-size: clamp(16px, 5.5vw, 28px) !important;
    word-break: break-word !important;
  }

  html:is(.locale-mobile,.en-mobile) main table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  html:is(.locale-mobile,.en-mobile) .tiny-info {
    display: inline-grid !important;
    place-items: center;
    width: 18px !important;
    height: 18px !important;
    min-height: 18px !important;
    border: 1px solid currentColor;
    border-radius: 999px;
    font-size: 0 !important;
    overflow: hidden !important;
  }

  html:is(.locale-mobile,.en-mobile) .tiny-info::before {
    content: "i";
    font: 700 11px/1 Arial, sans-serif;
  }

  html:is(.locale-mobile,.en-mobile) .trust {
    flex: 1 1 140px !important;
    max-width: 100% !important;
  }

  html:is(.locale-mobile,.en-mobile) body:not(.popular-page) .popular-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  html:is(.locale-mobile,.en-mobile) main :where(.metric-grid, .result-grid, .summary-grid, .stats-grid,
    .perf-metrics, .accept-metrics) strong {
    max-width: 100% !important;
    font-size: clamp(18px, 6vw, 30px) !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  html:is(.locale-mobile,.en-mobile) main :where(.compound-input, .fuel-input, .tip-field, .tip-input,
    .dt-field, .input-unit, .field-control) {
    height: auto !important;
    min-height: 44px !important;
    overflow: visible !important;
  }

  html:is(.locale-mobile,.en-mobile) main :where(.compound-input, .fuel-input, .tip-field, .tip-input,
    .dt-field, .input-unit, .field-control) :where(input, select) {
    min-height: 44px !important;
  }

  html:is(.locale-mobile,.en-mobile) main :where(.tabs, .tab-list, .segmented, .toggle-group,
    .perf-unit-toggle, .filter-row, .button-group) {
    display: flex !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  html:is(.locale-mobile,.en-mobile) main :where(.tabs, .tab-list, .segmented, .toggle-group,
    .perf-unit-toggle, .filter-row, .button-group) > * {
    flex: 1 1 120px !important;
    min-width: 0 !important;
  }

  /* Legacy everyday pages used desktop-width hero columns on phones. */
  html:is(.locale-mobile,.en-mobile) :where(.perf-hero-grid, .hundred-hero-grid, .day180-layout,
    .adddays-hero-grid, .addmin-hero-grid, .addtime-hero-grid, .hm-hero-grid,
    .age-hero-grid, .sec-hero-grid, .month-hero-grid, .day-hero-grid,
    .hour-hero-grid, .min-hero-grid) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(.perf-hero-grid, .hundred-hero-grid, .day180-layout,
    .adddays-hero-grid, .addmin-hero-grid, .addtime-hero-grid, .hm-hero-grid,
    .age-hero-grid, .sec-hero-grid, .month-hero-grid, .day-hero-grid,
    .hour-hero-grid, .min-hero-grid) > * {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(.perf-art, .hundred-art) {
    overflow: hidden !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(.uc-table, .jpc-table) {
    min-width: 460px;
  }
  html:is(.locale-mobile,.en-mobile),
  html:is(.locale-mobile,.en-mobile) body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }

  html:is(.locale-mobile,.en-mobile) *,
  html:is(.locale-mobile,.en-mobile) *::before,
  html:is(.locale-mobile,.en-mobile) *::after {
    box-sizing: border-box;
  }

  html:is(.locale-mobile,.en-mobile) :where(main, section, article, form, fieldset,
    .directory-container, .container, .page-shell, .tool-shell,
    .calculator-shell, .workspace-grid, .input-panel, .result-panel,
    .hero-copy, .month6-copy, .day180-card) {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(.workspace-grid, .calculator-layout,
    .tool-layout, .input-output-grid, .result-layout, .results-grid) {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(.directory-container.hero-inner,
    .directory-container.workspace-grid) {
    width: calc(100% - 32px) !important;
    margin-inline: 16px !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(.topic-tabs, .collection-tabs, .mode-tabs,
    .filter-tabs, .category-tabs, .tab-list, [role="tablist"]) {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: visible !important;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }

  html:is(.locale-mobile,.en-mobile) :where(.browse-categories, .sort-tabs, .hero-category-chips,
    .img2-filters, .popular-filters) {
    display: flex !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
    gap: 8px !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(.browse-categories, .sort-tabs, .hero-category-chips,
    .img2-filters, .popular-filters) > * {
    flex: 0 1 auto !important;
    max-width: 100% !important;
    white-space: normal !important;
  }

  html:is(.locale-mobile,.en-mobile) .calculator-card {
    min-height: 94px !important;
    align-items: center;
  }

  html:is(.locale-mobile,.en-mobile) .calculator-card .card-copy p {
    display: -webkit-box !important;
    margin-top: 3px !important;
    font-size: 11px !important;
    line-height: 1.35 !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }

  html:is(.locale-mobile,.en-mobile) :where(.topic-tab, .collection-tab, .mode-tab,
    [role="tab"]) {
    flex: 0 0 auto !important;
    min-height: 44px !important;
    white-space: nowrap;
  }

  html:is(.locale-mobile,.en-mobile) :where(.segmented-control, .toggle-group,
    .button-group, .button-row, .action-row, .form-actions,
    .calculator-actions, .result-actions, .preset-row) {
    display: flex !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 8px !important;
  }

  html:is(.locale-mobile,.en-mobile) body :where(button, .btn, .button, [role="button"],
    .lang-btn, .cookie-primary, .cookie-secondary) {
    min-height: 44px !important;
    min-width: 44px !important;
  }

  html:is(.locale-mobile,.en-mobile) body :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
    min-height: 44px !important;
    font-size: 16px !important;
  }

  html:is(.locale-mobile,.en-mobile) body {
    line-break: strict;
  }

  html:is(.locale-mobile,.en-mobile) :where(h1, h2, h3, h4, p, li, label, button, a,
    .hero-copy, .result-value, .metric-value, .formula) {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  html:is(.locale-mobile,.en-mobile) :where(.search, .hero-search, .popular-search, .img2-search) {
    position: relative !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    gap: 8px !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(.search, .hero-search, .popular-search, .img2-search) input {
    grid-column: 1 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 48px !important;
    min-height: 48px !important;
    padding: 0 14px 0 44px !important;
    border: 1px solid #cbd9e8 !important;
    border-radius: 12px !important;
    outline: 0;
    background: #fff !important;
    box-shadow: 0 6px 18px rgba(29, 75, 120, .06) !important;
    -webkit-appearance: none !important;
    appearance: none !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(.search, .hero-search, .popular-search, .img2-search) input::-webkit-search-decoration,
  html:is(.locale-mobile,.en-mobile) :where(.search, .hero-search, .popular-search, .img2-search) input::-webkit-search-cancel-button {
    display: none !important;
    -webkit-appearance: none !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(.search, .hero-search, .popular-search, .img2-search) > span:first-child {
    position: absolute !important;
    z-index: 2;
    top: 14px !important;
    left: 14px !important;
    width: 20px !important;
    height: 20px !important;
    pointer-events: none;
  }

  html:is(.locale-mobile,.en-mobile) :where(.search, .hero-search, .img2-search) button {
    position: static !important;
    grid-column: 1 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 46px !important;
    padding: 10px 16px !important;
    margin: 0 !important;
    border-radius: 12px !important;
    line-height: 1.35 !important;
    white-space: normal !important;
    overflow: visible !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(.popular-search) kbd {
    position: absolute !important;
    top: 14px !important;
    right: 12px !important;
    max-width: 72px;
  }

  html:is(.locale-mobile,.en-mobile) :where(.search, .hero-search, .popular-search, .img2-search) input:focus-visible {
    outline: 2px solid #2d74b8;
    outline-offset: 2px;
  }

  html:is(.locale-mobile,.en-mobile) :where(.hero-category-chips, .quick-tags, .img2-filters,
    .popular-toolbar, .popular-results-heading, .guide-links) {
    display: flex !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    gap: 8px !important;
  }

  /* The shared mobile theme hides the homepage quick-calculator fields.
     Japanese pages keep the complete calculator instead of a result-only demo. */
  html:is(.locale-mobile,.en-mobile) .hero .calculator-card .form-grid .field {
    display: grid !important;
    min-width: 0 !important;
  }

  html:is(.locale-mobile,.en-mobile) .hero .calculator-card :where(.quick-fields, .field-row) {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(.calculator-card, .browse, .calc-panel) .field-row {
    grid-template-columns: minmax(0, 1fr) minmax(76px, 92px) !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(.calculator-card, .browse, .calc-panel) .field-row select {
    width: 100% !important;
    padding-inline: 10px 28px !important;
    white-space: nowrap !important;
  }

  /* Popular page: replace overlapping desktop collage with a readable flow. */
  html:is(.locale-mobile,.en-mobile) .img2-art {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 0 !important;
    padding: 4px 0 !important;
    overflow: visible !important;
  }

  html:is(.locale-mobile,.en-mobile) .img2-art :where(.img2-hand-note, .img2-tomorrow-note,
    .img2-bubble, .img2-symbol, .img2-mini-percent) {
    display: none !important;
  }

  html:is(.locale-mobile,.en-mobile) .img2-art .img2-feature {
    position: relative !important;
    inset: auto !important;
    width: auto !important;
    height: auto !important;
    min-height: 112px !important;
    transform: none !important;
    overflow: hidden !important;
  }

  html:is(.locale-mobile,.en-mobile) .img2-art .img2-feature-percent {
    grid-column: 1 / -1 !important;
    min-height: 170px !important;
  }

  html:is(.locale-mobile,.en-mobile) .img2-art .img2-feature :where(strong, small) {
    position: relative !important;
    inset: auto !important;
    max-width: 100% !important;
  }

  html:is(.locale-mobile,.en-mobile) .img2-art .img2-feature > svg {
    position: absolute !important;
    right: 14px !important;
    bottom: 14px !important;
  }

  /* Homepage category browsing: compact, aligned cards with no clipped copy. */
  html:is(.locale-mobile,.en-mobile) .category-section .categories {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  html:is(.locale-mobile,.en-mobile) .category-section .category {
    align-items: flex-start !important;
    min-height: 132px !important;
    height: auto !important;
    padding: 14px !important;
    text-align: left !important;
  }

  html:is(.locale-mobile,.en-mobile) .category-section .category .icon-box {
    width: 34px !important;
    height: 34px !important;
    margin: 0 0 8px !important;
  }

  html:is(.locale-mobile,.en-mobile) .category-section .category :where(h3, p) {
    width: 100% !important;
    max-width: 100% !important;
  }

  html:is(.locale-mobile,.en-mobile) .category-section .category p {
    display: -webkit-box !important;
    max-height: none !important;
    font-size: 10px !important;
    line-height: 1.35 !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden !important;
  }

  html:is(.locale-mobile,.en-mobile) .category-section .category a {
    align-self: flex-start !important;
  }

  html:is(.locale-mobile,.en-mobile) .hero .calculator-card :where(input, select, button) {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  /* Keep feedback available without covering calculator fields or actions. */
  html:is(.locale-mobile,.en-mobile) .atlas-feedback-button {
    right: 8px !important;
    bottom: 8px !important;
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    padding: 0 !important;
    border-radius: 999px !important;
    font-size: 0 !important;
  }

  html:is(.locale-mobile,.en-mobile) .atlas-feedback-button::before {
    content: "✉";
    font-size: 18px;
    line-height: 1;
  }

  html:is(.locale-mobile,.en-mobile) :where(.hero-category-chips, .quick-tags, .img2-filters,
    .guide-links) > * {
    flex: 0 1 auto !important;
    max-width: 100% !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(.hero-art, .img2-art, .calendar-art,
    .scientific-display, .result-panel, .input-panel) {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden;
  }

  html:is(.locale-mobile,.en-mobile) body :where(.faq-item > button, .accordion-trigger,
    summary) {
    min-height: 44px !important;
    padding-block: 10px !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(.uc-table-wrap, .jpc-table-wrap,
    .table-wrap, .table-responsive, .schedule-table, .result-table,
    .conversion-table) {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  html:is(.locale-mobile,.en-mobile) :where(.uc-table, .jpc-table) {
    min-width: 460px;
  }

  html:is(.locale-mobile,.en-mobile) :where(.perf-hero-copy, .hundred-hero-copy,
    .month6-copy, .day180-card, .day180-input, .calendar-art,
    .perf-badges, .hundred-badges, .month6-feature-row) {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  html:is(.locale-mobile,.en-mobile) .hundred-hero-source-art {
    position: relative !important;
    inset: auto !important;
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin-inline: auto;
  }

  html:is(.locale-mobile,.en-mobile) :where(.perf-hero, .hundred-hero, .month6-hero,
    .day180-layout) {
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(.perf-hero-grid, .hundred-hero-grid,
    .month6-hero-grid, .day180-layout, .fc-grid) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(.perf-hero-grid, .hundred-hero-grid,
    .month6-hero-grid, .day180-layout, .fc-grid) > * {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  html:is(.locale-mobile,.en-mobile) .fc-tabs-nav {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    gap: 6px !important;
  }

  html:is(.locale-mobile,.en-mobile) .fc-tabs-nav button {
    width: 100% !important;
    min-width: 0 !important;
    padding-inline: 8px !important;
    white-space: normal;
  }

  html:is(.locale-mobile,.en-mobile) .fc-buttons {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    gap: 8px !important;
  }

  html:is(.locale-mobile,.en-mobile) .fc-buttons button {
    width: 100% !important;
    min-width: 0 !important;
    padding-inline: 10px !important;
  }

  html:is(.locale-mobile,.en-mobile) .fc-buttons .fc-calc {
    min-height: 48px !important;
    font-weight: 800;
    box-shadow: 0 6px 16px rgba(14, 159, 110, .18);
  }

  html:is(.locale-mobile,.en-mobile) .fc-buttons .fc-reset {
    min-height: 44px !important;
    border: 1px solid #d7e1ec !important;
    background: #fff !important;
    box-shadow: none !important;
  }

  html:is(.locale-mobile,.en-mobile) .related-inner {
    display: block !important;
  }

  html:is(.locale-mobile,.en-mobile) .related-inner > h2 {
    margin: 0 0 14px !important;
  }

  html:is(.locale-mobile,.en-mobile) .related-list {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    gap: 8px !important;
  }

  html:is(.locale-mobile,.en-mobile) .related-card {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 56px !important;
    padding: 10px 14px !important;
    border: 1px solid #dce6f2 !important;
    border-radius: 10px !important;
    text-align: left !important;
    line-height: 1.4 !important;
  }

  html:is(.locale-mobile,.en-mobile) .related-card span:first-child {
    display: flex !important;
    min-width: 0 !important;
    gap: 10px !important;
    align-items: center !important;
    white-space: normal !important;
    word-break: normal !important;
  }

  html:is(.locale-mobile,.en-mobile) .fc-related {
    display: grid;
    gap: 8px;
  }

  html:is(.locale-mobile,.en-mobile) .fc-related a {
    min-height: 60px;
    padding: 10px 12px !important;
    border: 1px solid #e2e9f1 !important;
    border-radius: 10px;
    background: #fff;
  }

  html:is(.locale-mobile,.en-mobile) .fc-related a:last-child {
    border-bottom: 1px solid #e2e9f1 !important;
  }

  html:is(.locale-mobile,.en-mobile) .fc-related span {
    min-width: 0;
    line-height: 1.35;
  }

  html:is(.locale-mobile,.en-mobile) .fc-related small {
    margin-top: 4px;
    line-height: 1.35;
  }

  html:is(.locale-mobile,.en-mobile) :where(.calculator-actions, .form-actions, .result-actions) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(.calculator-actions, .form-actions, .result-actions) > :where(button, .btn, a) {
    width: 100% !important;
    min-height: 44px !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(.guide-links, .result-toolbar, .scientific-actions) > * {
    min-width: 44px !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(.scientific-display, .calc-display,
    .formula-display) {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(.hero-pills, .hero-chips, .quick-links,
    .guide-links) {
    display: flex !important;
    flex-wrap: wrap !important;
    max-width: 100% !important;
    gap: 8px !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(.img2-orbit, .hero-dot) {
    pointer-events: none;
  }

  html:is(.locale-mobile,.en-mobile) .img2-orbit-right {
    right: -18px !important;
  }

  html:is(.locale-mobile,.en-mobile) .img2-orbit-left {
    left: -18px !important;
  }

  html:is(.locale-mobile,.en-mobile) body.directory-page .directory-header
    .directory-actions .language-switcher > button.lang-btn {
    box-sizing: border-box !important;
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
    height: 44px !important;
    min-height: 44px !important;
    padding-inline: 9px !important;
  }
}

@media (max-width: 760px) {
  html:is(.locale-mobile,.en-mobile) :where(.mode-tabs, .tip-mode-tabs) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
  }
  html:is(.locale-mobile,.en-mobile) :where(.mode-tabs, .tip-mode-tabs) > button {
    width: 100% !important;
    min-width: 0 !important;
    white-space: normal !important;
  }
  html:is(.locale-mobile,.en-mobile) .tip-preset-row {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    overflow: visible !important;
  }
  html:is(.locale-mobile,.en-mobile) .tip-preset-row > button,
  html:is(.locale-mobile,.en-mobile) .tip-stepper,
  html:is(.locale-mobile,.en-mobile) .tip-stepper > * {
    min-width: 0 !important;
    max-width: 100% !important;
  }
  html:is(.locale-mobile,.en-mobile) .perf-hero-exact {
    width: min(100%, 330px) !important;
    max-width: 100% !important;
    height: auto !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
  }
  html:is(.locale-mobile,.en-mobile) .adddays-art .calendar-art {
    left: 50% !important;
    right: auto !important;
    width: min(210px, calc(100% - 42px)) !important;
    transform: translateX(-50%) rotate(3deg) !important;
  }
  html:is(.locale-mobile,.en-mobile) .guide-links {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    overflow: visible !important;
  }
  html:is(.locale-mobile,.en-mobile) .guide-links > a {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  html:is(.locale-mobile,.en-mobile) :where(.img2-orbit-left, .img2-orbit-right) {
    max-width: 44vw !important;
    transform: scale(.78) !important;
  }
  html:is(.locale-mobile,.en-mobile) .sci-modes button {
    display: grid !important;
    grid-template-columns: 28px minmax(0, 1fr) !important;
    width: 100% !important;
    min-width: 0 !important;
  }
  html:is(.locale-mobile,.en-mobile) .sci-modes button :where(strong, small) {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
  }
}

/* No-side-scroll mobile layout: every content block must fit the viewport. */
@media (max-width: 760px) {
  html:is(.locale-mobile,.en-mobile),
  html:is(.locale-mobile,.en-mobile) body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: clip !important;
  }

  html:is(.locale-mobile,.en-mobile) body:not(.popular-page) .popular-grid,
  html:is(.locale-mobile,.en-mobile) .related-row,
  html:is(.locale-mobile,.en-mobile) .related-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 10px !important;
    overflow: visible !important;
    scroll-snap-type: none !important;
  }

  html:is(.locale-mobile,.en-mobile) body:not(.popular-page) .popular-grid > .calc-item,
  html:is(.locale-mobile,.en-mobile) .related-row > *,
  html:is(.locale-mobile,.en-mobile) .related-grid > * {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    transform: none !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(.table-wrap, .table-scroll, .schedule-table-wrap,
    .amortization-table-wrap, .matrix-table-wrap, .result-table-wrap) {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: clip !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(table, .uc-table, .schedule-table,
    .amortization-table, .result-table) {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    table-layout: fixed !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(th, td) {
    min-width: 0 !important;
    padding: 7px 5px !important;
    font-size: 11px !important;
    line-height: 1.3 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }
}

@media (max-width: 340px) {
  html:is(.locale-mobile,.en-mobile) body:not(.popular-page) .popular-grid,
  html:is(.locale-mobile,.en-mobile) .related-row,
  html:is(.locale-mobile,.en-mobile) .related-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

@media (max-width: 760px) {
  html:is(.locale-mobile,.en-mobile) .hero-dot--yellow {
    right: 2px !important;
    transform: scale(.72) !important;
    transform-origin: right center !important;
  }

  html:is(.locale-mobile,.en-mobile) body:not(.popular-page) .popular-grid > .calc-item {
    min-height: 112px !important;
    height: auto !important;
    align-items: flex-start !important;
  }

  html:is(.locale-mobile,.en-mobile) body:not(.popular-page) .popular-grid > .calc-item p {
    display: block !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    -webkit-line-clamp: unset !important;
    white-space: normal !important;
  }
}

@media (max-width: 760px) {
  html:is(.locale-mobile,.en-mobile) body .footer-meta > .language-switcher {
    flex: 0 0 auto !important;
    flex-basis: auto !important;
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    margin: 0 0 5px !important;
  }

  html:is(.locale-mobile,.en-mobile) body .footer-columns > section:not(.is-open),
  html:is(.locale-mobile,.en-mobile) body .footer .footer-group:not(.is-open) {
    height: 56px !important;
    min-height: 56px !important;
    max-height: 56px !important;
    overflow: hidden !important;
  }

  html:is(.locale-mobile,.en-mobile) body .footer .footer-group > button.footer-toggle,
  html:is(.locale-mobile,.en-mobile) body .footer-columns > section > button {
    height: 56px !important;
    min-height: 56px !important;
    max-height: 56px !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(.topbar, .directory-header) .language-menu {
    position: fixed !important;
    top: 68px !important;
    right: 16px !important;
    left: auto !important;
    width: min(320px, calc(100vw - 32px)) !important;
    max-width: calc(100vw - 32px) !important;
    max-height: calc(100vh - 84px) !important;
    margin: 0 !important;
    padding: 7px !important;
    border: 1px solid #dce7f1 !important;
    border-radius: 14px !important;
    background: #fff !important;
    box-shadow: 0 18px 48px rgba(16, 40, 74, .18) !important;
    overflow-y: auto !important;
    z-index: 1000 !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(.topbar, .directory-header) .language-option {
    display: grid !important;
    grid-template-columns: 24px minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 10px !important;
    border-radius: 9px !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
    text-align: left !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(.topbar, .directory-header) .language-option small {
    font-size: 11px !important;
  }
}

/* Unified mobile footer for legacy home pages and directory/tool pages. */
@media (max-width: 760px) {
  html:is(.locale-mobile,.en-mobile) :where(.footer, .directory-footer) {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border-top: 1px solid #e3ebf3 !important;
    background: #fff !important;
    color: #10284a !important;
    font-size: 13px !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(.footer > .footer-inner,
    .directory-footer > .footer-inner) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: calc(100% - 32px) !important;
    max-width: 343px !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 auto !important;
    padding: 20px 0 16px !important;
    gap: 0 !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(.footer-brand, .footer-brand-block) {
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 0 18px !important;
    border-bottom: 1px solid #e7eef5 !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(.footer-logo,
    .footer-brand-block .directory-brand) {
    display: block !important;
    width: 108px !important;
    min-width: 108px !important;
    max-width: 108px !important;
    height: 27px !important;
    margin: 0 0 10px !important;
    object-fit: contain !important;
    object-position: left center !important;
  }

  html:is(.locale-mobile,.en-mobile) .footer-brand-block .directory-brand {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    width: max-content !important;
    min-width: 0 !important;
    max-width: 140px !important;
    height: 27px !important;
    margin: 0 0 10px !important;
    background: none !important;
  }

  html:is(.locale-mobile,.en-mobile) .footer-brand-block .directory-brand .brand-planet {
    display: block !important;
    flex: 0 0 27px !important;
    width: 27px !important;
    height: 27px !important;
  }

  html:is(.locale-mobile,.en-mobile) .footer-brand-block .directory-brand .brand-word {
    display: block !important;
    width: auto !important;
    height: auto !important;
    font-size: 19px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(.footer-brand, .footer-brand-block) p {
    max-width: 300px !important;
    margin: 0 !important;
    color: #64748b !important;
    font-size: 12px !important;
    line-height: 1.55 !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(.socials, .footer-socials) {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin-top: 12px !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(.socials span, .footer-socials a) {
    display: grid !important;
    place-items: center !important;
    width: 32px !important;
    min-width: 32px !important;
    height: 32px !important;
    min-height: 32px !important;
    margin: 0 !important;
    border: 1px solid #dfe8f1 !important;
    border-radius: 50% !important;
    background: #fff !important;
    color: #365472 !important;
    font-size: 11px !important;
  }

  html:is(.locale-mobile,.en-mobile) .footer-columns {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 0 !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(.footer-group, .footer-columns section) {
    display: grid !important;
    width: 100% !important;
    min-height: 56px !important;
    padding: 0 !important;
    border-bottom: 1px solid #e7eef5 !important;
  }

  html:is(.locale-mobile,.en-mobile) .footer-group > h3 {
    display: none !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(.footer-toggle, .footer-columns section > button) {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 56px !important;
    min-height: 56px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: #10284a !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    text-align: left !important;
    box-shadow: none !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(.footer-group > ul,
    .footer-columns section > a) {
    font-size: 13px !important;
    line-height: 1.45 !important;
  }

  html:is(.locale-mobile,.en-mobile) .footer-meta {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 18px 0 0 !important;
    gap: 7px !important;
    border: 0 !important;
  }

  html:is(.locale-mobile,.en-mobile) .footer-meta .language-switcher,
  html:is(.locale-mobile,.en-mobile) .footer-meta .lang-btn {
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
    height: 44px !important;
    min-height: 44px !important;
    margin: 0 0 5px !important;
  }

  html:is(.locale-mobile,.en-mobile) .footer-meta p {
    margin: 0 !important;
    color: #64748b !important;
    font-size: 12px !important;
    line-height: 1.45 !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(.bottom-bar, .cookie-bar) {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 12px 16px !important;
    border-top: 1px solid #e3ebf3 !important;
    background: #f8fafc !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(.bottom-inner, .cookie-inner) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    max-width: 343px !important;
    margin: 0 auto !important;
    padding: 0 !important;
    gap: 10px !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(.bottom-inner, .cookie-inner) p,
  html:is(.locale-mobile,.en-mobile) .bottom-inner .cookie {
    margin: 0 !important;
    color: #64748b !important;
    font-size: 11px !important;
    line-height: 1.5 !important;
  }

  html:is(.locale-mobile,.en-mobile) .cookie-inner > div {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100% !important;
    gap: 8px !important;
  }

  html:is(.locale-mobile,.en-mobile) .cookie-inner button {
    width: 100% !important;
    min-width: 0 !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 12px !important;
    font-size: 13px !important;
  }
}

/* Unified mobile shell: the home, directory and tool templates share one header. */
@media (max-width: 760px) {
  html:is(.locale-mobile,.en-mobile) :where(.topbar, .directory-header) {
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 60px !important;
    min-height: 60px !important;
    margin: 0 !important;
    padding: 0 10px !important;
    border-bottom: 1px solid #e8eef5 !important;
    background: rgba(255, 255, 255, .97) !important;
    box-shadow: 0 2px 12px rgba(16, 49, 89, .04) !important;
    backdrop-filter: blur(14px);
  }

  html:is(.locale-mobile,.en-mobile) .directory-header .header-inner {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 59px !important;
    min-height: 59px !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  html:is(.locale-mobile,.en-mobile) .topbar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(.topbar > .logo, .directory-brand) {
    display: block !important;
    width: 108px !important;
    min-width: 108px !important;
    max-width: 108px !important;
    height: 27px !important;
    object-fit: contain !important;
    object-position: left center !important;
    margin: 0 !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(.top-actions, .directory-actions) {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex: 0 0 auto !important;
    gap: 8px !important;
    height: 44px !important;
    margin: 0 !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(.language, .directory-actions .lang-btn,
    .language-switcher__button, .footer-meta .lang-btn) {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    flex: 0 0 120px !important;
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 9px !important;
    border: 1px solid #dce7f1 !important;
    border-radius: 12px !important;
    background: #fff !important;
    color: #10284a !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    box-shadow: 0 4px 12px rgba(20, 60, 105, .05) !important;
  }

  html:is(.locale-mobile,.en-mobile) .language-switcher {
    width: 120px !important;
    flex: 0 0 120px !important;
  }

  html:is(.locale-mobile,.en-mobile) .language-switcher__label {
    display: block !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  html:is(.locale-mobile,.en-mobile) :where(.menu-toggle, .mobile-menu-btn) {
    display: grid !important;
    place-items: center !important;
    flex: 0 0 44px !important;
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
    border: 1px solid #dce7f1 !important;
    border-radius: 12px !important;
    background: #fff !important;
    color: #10284a !important;
    box-shadow: 0 4px 12px rgba(20, 60, 105, .05) !important;
  }

  html:is(.locale-mobile,.en-mobile) .language-menu {
    width: min(320px, calc(100vw - 20px)) !important;
    max-width: calc(100vw - 20px) !important;
    max-height: min(70vh, 560px) !important;
    overflow-y: auto !important;
  }

  html:is(.locale-mobile,.en-mobile) .mobile-menu {
    width: min(86vw, 320px) !important;
    max-width: 320px !important;
  }

  html:is(.locale-mobile,.en-mobile) .mobile-menu__nav a {
    min-height: 52px !important;
    font-size: 15px !important;
  }

  html:is(.locale-mobile,.en-mobile) .pagination-area {
    width: 100% !important;
    max-width: 100% !important;
    gap: 10px !important;
  }

  html:is(.locale-mobile,.en-mobile) .pagination {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 44px !important;
  }

  html:is(.locale-mobile,.en-mobile) .pagination :where(.page-prev, .page-next) {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 10px !important;
    font-size: 14px !important;
    white-space: nowrap !important;
  }

  html:is(.locale-mobile,.en-mobile) .pagination::before {
    min-width: 82px !important;
    font-size: 13px !important;
    white-space: nowrap !important;
  }
}

@media (max-width: 380px) {
  html:is(.locale-mobile,.en-mobile) body :where(.directory-actions .lang-btn, .lang-btn) {
    width: auto !important;
    min-width: 88px;
    padding-inline: 8px !important;
  }
}

/* Final localized mobile pass: long translated labels must remain fully visible. */
@media (max-width: 760px) {
  html:is(.locale-mobile,.en-mobile) body:not(.popular-page) .popular-grid {
    display: flex !important;
    width: 100% !important;
    gap: 10px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x proximity;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  html:is(.locale-mobile,.en-mobile) body:not(.popular-page) .popular-grid::-webkit-scrollbar {
    display: none;
  }

  html:is(.locale-mobile,.en-mobile) body:not(.popular-page) .popular-grid > .calc-item {
    flex: 0 0 min(82vw, 304px) !important;
    width: min(82vw, 304px) !important;
    min-width: min(82vw, 304px) !important;
    max-width: min(82vw, 304px) !important;
    transform: none !important;
    scroll-snap-align: start;
  }

  html:is(.locale-mobile,.en-mobile) .fraction-guide-tabs,
  html:is(.locale-mobile,.en-mobile) .formula-tabs {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 6px !important;
    overflow: visible !important;
  }

  html:is(.locale-mobile,.en-mobile) .fraction-guide-tabs > button,
  html:is(.locale-mobile,.en-mobile) .formula-tabs > button {
    width: 100% !important;
    min-width: 0 !important;
    padding-inline: 8px !important;
    white-space: normal !important;
  }

  html:is(.locale-mobile,.en-mobile) .operation-control {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  html:is(.locale-mobile,.en-mobile) .hero-dot--yellow {
    right: 8px !important;
  }

  html:is(.locale-mobile,.en-mobile) .related-row,
  html:is(.locale-mobile,.en-mobile) .related-grid {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overscroll-behavior-inline: contain;
  }

  html:is(.locale-mobile,.en-mobile) .matrix-hero {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 16px !important;
    overflow: hidden !important;
  }

  html:is(.locale-mobile,.en-mobile) .matrix-hero > * {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  html:is(.locale-mobile,.en-mobile) .hero-matrix {
    font-size: clamp(13px, 4vw, 18px) !important;
    overflow-wrap: anywhere !important;
  }
}

/* English and Simplified Chinese use a compact, readable mobile type scale. */
@media (max-width: 760px) {
  html.en-mobile body,
  html.locale-mobile[lang="zh-CN"] body,
  html.locale-mobile[lang="zh"] body {
    font-size: 15px !important;
    line-height: 1.55 !important;
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
  }

  html.en-mobile main h1,
  html.locale-mobile[lang="zh-CN"] main h1,
  html.locale-mobile[lang="zh"] main h1 {
    font-size: clamp(30px, 8.4vw, 34px) !important;
    line-height: 1.16 !important;
    letter-spacing: -.025em !important;
  }

  html.en-mobile main h2,
  html.locale-mobile[lang="zh-CN"] main h2,
  html.locale-mobile[lang="zh"] main h2 {
    font-size: clamp(20px, 5.8vw, 23px) !important;
    line-height: 1.28 !important;
  }

  html.en-mobile main h3,
  html.locale-mobile[lang="zh-CN"] main h3,
  html.locale-mobile[lang="zh"] main h3 {
    font-size: clamp(16px, 4.6vw, 18px) !important;
    line-height: 1.35 !important;
  }

  html.en-mobile main :where(p, li),
  html.locale-mobile[lang="zh-CN"] main :where(p, li),
  html.locale-mobile[lang="zh"] main :where(p, li) {
    line-height: 1.55 !important;
  }

  html.en-mobile main :where(input, select, textarea),
  html.locale-mobile[lang="zh-CN"] main :where(input, select, textarea),
  html.locale-mobile[lang="zh"] main :where(input, select, textarea) {
    min-height: 44px !important;
    font-size: 16px !important;
  }

  html.en-mobile main :where(button, .btn, .button, .primary-btn, .secondary-btn),
  html.locale-mobile[lang="zh-CN"] main :where(button, .btn, .button, .primary-btn, .secondary-btn),
  html.locale-mobile[lang="zh"] main :where(button, .btn, .button, .primary-btn, .secondary-btn) {
    font-size: 14px !important;
  }

  html.en-mobile .atlas-feedback-button,
  html.locale-mobile[lang="zh-CN"] .atlas-feedback-button,
  html.locale-mobile[lang="zh"] .atlas-feedback-button {
    bottom: 76px !important;
  }
}

@media (max-width: 760px) {
  html:is(.locale-mobile,.en-mobile) :where(.language, .directory-actions .lang-btn,
    .language-switcher__button, .footer-meta .lang-btn) {
    flex-basis: 120px !important;
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
    height: 44px !important;
    min-height: 44px !important;
  }

  html:is(.locale-mobile,.en-mobile) body .footer-meta > .language-switcher {
    flex: 0 0 auto !important;
    flex-basis: auto !important;
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
  }

  html:is(.locale-mobile,.en-mobile) body .footer-columns > section:not(.is-open),
  html:is(.locale-mobile,.en-mobile) body .footer .footer-group:not(.is-open) {
    height: 56px !important;
    min-height: 56px !important;
    max-height: 56px !important;
    overflow: hidden !important;
  }

  html:is(.locale-mobile,.en-mobile) body .footer .footer-group > button.footer-toggle,
  html:is(.locale-mobile,.en-mobile) body .footer-columns > section > button {
    height: 56px !important;
    min-height: 56px !important;
    max-height: 56px !important;
  }
}
/* Desktop language menu: keep the panel anchored below the trigger. */
@media (min-width: 761px) {
  html:is(.locale-mobile,.en-mobile) body.directory-page .directory-header,
  html:is(.locale-mobile,.en-mobile) body.directory-page .directory-header .header-inner,
  html:is(.locale-mobile,.en-mobile) body.directory-page .directory-actions,
  html:is(.locale-mobile,.en-mobile) body.directory-page .language-switcher {
    overflow: visible !important;
  }

  html:is(.locale-mobile,.en-mobile) body.directory-page .directory-actions {
    position: relative !important;
    z-index: 1000 !important;
  }

  html:is(.locale-mobile,.en-mobile) body.directory-page .directory-actions .language-switcher {
    position: relative !important;
    flex: 0 0 auto !important;
    z-index: 1001 !important;
  }

  html:is(.locale-mobile,.en-mobile) body.directory-page .directory-actions .language-menu {
    position: absolute !important;
    top: calc(100% + 10px) !important;
    right: 0 !important;
    left: auto !important;
    width: min(350px, calc(100vw - 32px)) !important;
    max-width: calc(100vw - 32px) !important;
    max-height: min(430px, calc(100vh - 90px)) !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(145px, 1fr)) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    transform-origin: top right !important;
    z-index: 10020 !important;
  }
}
/* Homepage desktop language menu: anchor it to the topbar trigger. */
@media (min-width: 761px) {
  html:is(.locale-mobile,.en-mobile) body > .page > .topbar,
  html:is(.locale-mobile,.en-mobile) body > .page > .topbar .top-actions,
  html:is(.locale-mobile,.en-mobile) body > .page > .topbar .language-switcher {
    overflow: visible !important;
  }

  html:is(.locale-mobile,.en-mobile) body > .page > .topbar .top-actions {
    position: relative !important;
    z-index: 1000 !important;
  }

  html:is(.locale-mobile,.en-mobile) body > .page > .topbar .language-switcher {
    position: relative !important;
    flex: 0 0 auto !important;
    z-index: 1001 !important;
  }

  html:is(.locale-mobile,.en-mobile) body > .page > .topbar .language-menu {
    position: absolute !important;
    top: calc(100% + 10px) !important;
    right: 0 !important;
    left: auto !important;
    width: min(350px, calc(100vw - 32px)) !important;
    max-width: calc(100vw - 32px) !important;
    max-height: min(430px, calc(100vh - 90px)) !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(145px, 1fr)) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    transform-origin: top right !important;
    z-index: 10020 !important;
  }
}
/* Mobile navigation triggers must stay hidden when desktop navigation is shown. */
@media (min-width: 761px) {
  html:is(.locale-mobile,.en-mobile) body .topbar .menu-toggle,
  html:is(.locale-mobile,.en-mobile) body .directory-header .mobile-menu-btn {
    display: none !important;
  }
}

/* Shared icon alignment: remove inline SVG baseline drift on desktop and mobile. */
html:is(.locale-mobile,.en-mobile) :where([data-dir-icon], [data-icon], [data-icon-rendered], .language-current-flag) {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  vertical-align: middle !important;
  line-height: 0 !important;
}

html:is(.locale-mobile,.en-mobile) :where([data-dir-icon], [data-icon], [data-icon-rendered], .language-current-flag) > svg {
  display: block !important;
  flex: 0 0 auto !important;
  vertical-align: middle !important;
}

html:is(.locale-mobile,.en-mobile) :where(.lang-btn, .language-switcher__button,
  .sort-tab, .category-tab, .hero-chip, .unit-btn, .page-btn, .page-number,
  .top-actions > a, .directory-actions > a) {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  vertical-align: middle !important;
  line-height: 1 !important;
}

html:is(.locale-mobile,.en-mobile) :where(.lang-btn, .language-switcher__button,
  .sort-tab, .category-tab, .hero-chip, .unit-btn, .page-btn, .page-number) > svg {
  display: block !important;
  flex: 0 0 auto !important;
}

/* The homepage still loads app.css for its main content. Keep that legacy
   newsletter rule from changing the shared pagination footer layout. */
html:is(.locale-mobile,.en-mobile) body.home-page .directory-newsletter .newsletter-copy {
  display: block !important;
  align-items: initial !important;
  gap: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Footer links are navigation, not text annotations. Keep them clean and
   remove the secondary locale control from every footer. */
html:is(.locale-mobile,.en-mobile) :where(.directory-footer, .footer) a {
  text-decoration: none !important;
}

html:is(.locale-mobile,.en-mobile) :where(.directory-footer, .footer) .lang-btn,
html:is(.locale-mobile,.en-mobile) :where(.directory-footer, .footer) .language-switcher,
html:is(.locale-mobile,.en-mobile) :where(.directory-footer, .footer) .language-menu {
  display: none !important;
}
