/* Shared locale rhythm: typography, spacing and controls only. */
:root {
  --sl-ui-radius: 14px;
  --sl-ui-control-height: 48px;
  --sl-ui-content-width: 1180px;
}

html,
body,
button,
input,
select,
textarea {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html[lang="zh-Hant"],
html[lang="zh-Hant"] body,
html[lang="zh-Hant"] button,
html[lang="zh-Hant"] input,
html[lang="zh-Hant"] select,
html[lang="zh-Hant"] textarea {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

html[lang="ja"],
html[lang="ja"] body,
html[lang="ja"] button,
html[lang="ja"] input,
html[lang="ja"] select,
html[lang="ja"] textarea {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
}

body {
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

html[lang="zh-Hant"] body,
html[lang="ja"] body {
  line-height: 1.7;
}

h1,
h2,
h3,
h4,
p,
li,
label,
button,
a,
span,
small {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin-top: 0;
  text-wrap: balance;
}

p,
li {
  text-wrap: pretty;
}

html[lang="zh-Hant"] h1,
html[lang="zh-Hant"] h2,
html[lang="zh-Hant"] h3,
html[lang="ja"] h1,
html[lang="ja"] h2,
html[lang="ja"] h3 {
  line-break: strict;
  word-break: normal;
  letter-spacing: .01em;
}

:where(.mk-hero-copy, .mk-page-hero > div, .mk-heading, .customer-app-main, .page-head > div) h1 {
  font-size: clamp(2.35rem, 5vw, 4.35rem);
  line-height: 1.08;
  letter-spacing: -.035em;
}

html[lang="zh-Hant"] :where(.mk-hero-copy, .mk-page-hero > div, .mk-heading, .customer-app-main, .page-head > div) h1,
html[lang="ja"] :where(.mk-hero-copy, .mk-page-hero > div, .mk-heading, .customer-app-main, .page-head > div) h1 {
  letter-spacing: -.02em;
}

:where(.mk-section, .mk-band, .mk-agency, .panel, .slv-card, .sld-card, .sl-plan-card) h2 {
  font-size: clamp(1.65rem, 3vw, 2.55rem);
  line-height: 1.18;
}

:where(.mk-hero-copy, .mk-page-hero, .mk-heading, .mk-scan-head, .slv-card, .sld-card, .panel) p {
  font-size: clamp(1rem, 1.25vw, 1.125rem);
  line-height: 1.7;
}

:where(.mk-button, .btn, .control, form button, .slv-card button, .sld-card button, .sl-plan-card button, [role="button"]:not(.side-link)) {
  min-height: var(--sl-ui-control-height);
  padding: 0 18px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 680;
  line-height: 1.25;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: normal;
}

:where(input, select, textarea) {
  width: 100%;
  min-width: 0;
  min-height: var(--sl-ui-control-height);
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 16px;
  line-height: 1.45;
}

textarea {
  min-height: 112px;
  resize: vertical;
}

:where(form label, .field, .slv-form label, .sld-form label, .mk-scan label) {
  display: grid;
  gap: 8px;
  min-width: 0;
}

:where(form label > span, .field > label, .slv-form label > span, .sld-form label > span, .mk-scan label > span) {
  font-size: 14px;
  font-weight: 680;
  line-height: 1.35;
}

:where(.mk-header-inner, .mk-hero-inner, .mk-section, .mk-band, .mk-agency, .mk-pricing, .mk-footer-grid) {
  width: min(var(--sl-ui-content-width), calc(100% - 40px));
  margin-inline: auto;
}

:where(.mk-plan-grid, .sl-plan-grid, .stats, .provider-grid, .slx-provider-results) {
  align-items: stretch;
}

.mk-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(225px, 1fr));
  gap: 18px;
}

.mk-plan-grid > article {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  border-radius: var(--sl-ui-radius);
}

.mk-plan-grid > article :where(button, .mk-button) {
  width: 100%;
  margin-top: auto;
}

:where(.mk-prompt-list article, .mk-feature-rail article, .mk-plan-grid > article, .mk-utility-card, .mk-method-list article, .panel, .slv-card, .sld-card, .sl-plan-card, .shared-workspace-card) {
  border-radius: var(--sl-ui-radius);
}

.mk-languages,
.slx-locale {
  display: inline-grid !important;
  grid-template-columns: repeat(3, minmax(52px, auto)) !important;
  align-items: center !important;
  gap: 4px !important;
  width: auto !important;
  min-width: 0 !important;
}

.mk-languages a,
.slx-locale button {
  min-width: 0 !important;
  min-height: 36px !important;
  padding: 0 10px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 9px !important;
  font-size: 13px !important;
  font-weight: 680 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.mk-languages a[aria-current="page"],
.slx-locale button.active,
.slx-locale button[aria-pressed="true"] {
  font-weight: 760 !important;
}

.mk-nav,
.mk-actions,
.slx-header-actions,
.slx-nav {
  align-items: center;
}

:where(.mk-scan form, .slv-form, .sld-form, .customer-form-grid, .form-grid) {
  gap: 16px;
}

:where(.mk-result-provider, .slx-provider-results > article, .customer-provider-mini, .provider-card) {
  min-width: 0;
  height: 100%;
}

:where(.mk-result, .slx-result, .slv-card, .sld-card, .customer-app-main, .panel) {
  max-width: 100%;
}

html[lang="zh-Hant"] :where(.mk-nav a, .mk-button, .btn, form button, label, .mk-plan-grid li),
html[lang="ja"] :where(.mk-nav a, .mk-button, .btn, form button, label, .mk-plan-grid li) {
  letter-spacing: .01em;
}

@media (max-width: 980px) {
  :where(.mk-header-inner, .mk-hero-inner, .mk-section, .mk-band, .mk-agency, .mk-pricing, .mk-footer-grid) {
    width: min(100% - 30px, var(--sl-ui-content-width));
  }

  .mk-plan-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  body {
    font-size: 16px;
  }

  :where(.mk-header-inner, .mk-hero-inner, .mk-section, .mk-band, .mk-agency, .mk-pricing, .mk-footer-grid) {
    width: min(100% - 22px, var(--sl-ui-content-width));
  }

  :where(.mk-hero-copy, .mk-page-hero > div, .mk-heading, .customer-app-main, .page-head > div) h1 {
    font-size: clamp(2.15rem, 10vw, 3rem);
    line-height: 1.12;
  }

  .mk-plan-grid {
    grid-template-columns: 1fr;
  }

  :where(form > button, form .wide > button, .mk-plan-grid .mk-button, .slv-actions .btn, .sld-actions .btn, .customer-form-actions .btn) {
    width: 100%;
    min-height: 50px;
  }

  .mk-languages,
  .slx-locale {
    grid-template-columns: repeat(3, minmax(48px, auto)) !important;
  }

  .mk-languages a,
  .slx-locale button,
  .mk-menu,
  .icon-button,
  .side-link {
    width: auto !important;
  }

  .mk-languages a,
  .slx-locale button {
    min-height: 34px !important;
    padding-inline: 8px !important;
    font-size: 12px !important;
  }
}
