/* A persistent language switch is shared by the website and the standalone guide. */
.website-language-corner {
  font: 600 .875rem/1.4 "Avenir Next", "Segoe UI", "PingFang TC", "PingFang SC", sans-serif;
  letter-spacing: normal;
  text-transform: none;
}
.website-language-corner a[data-website-language] {
  display: inline-flex;
  box-sizing: border-box;
  align-items: center;
  min-block-size: 44px;
  padding: .4rem .45rem;
  border: 0;
  border-radius: .25rem;
  color: inherit;
  font: inherit;
  text-decoration: none;
}
a[data-website-language="zh-TW"] { font-family: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif !important; }
a[data-website-language="zh-CN"] { font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif !important; }
.website-language-corner {
  position: fixed;
  z-index: 15;
  inset-inline-end: max(1rem, env(safe-area-inset-right));
  inset-block-end: max(1rem, env(safe-area-inset-bottom));
  color: #142e46;
}
.website-language-corner summary, .website-language-corner nav {
  border: 1px solid #c7c0b4;
  background: #fffdf8;
  box-shadow: 0 3px 14px #131e2c1f;
}
.website-language-corner summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  min-block-size: 44px;
  box-sizing: border-box;
  padding: .4rem .85rem;
  border-radius: 2rem;
  cursor: pointer;
  list-style: none;
}
.website-language-corner summary::-webkit-details-marker { display: none; }
.website-language-corner summary svg { margin-inline-end: .15rem; }
.website-language-corner[open] > nav {
  position: absolute;
  inset-inline-end: 0;
  bottom: calc(100% + .5rem);
  box-sizing: border-box;
  overflow-y: auto;
  max-block-size: calc(100dvh - 5rem);
  min-inline-size: 10rem;
  padding: .3rem;
  border-radius: .65rem;
}
.website-language-corner nav a { display: flex; inline-size: 100%; justify-content: space-between; }
.website-language-corner a[aria-current]::after { content: "✓"; }
.website-language-corner a[aria-current] { background: #f0eadf; }
.website-language-corner :is(a, summary):focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -2px;
}
@media (hover: hover) {
  .website-language-corner :is(a[data-website-language], summary):hover {
    background: #ebe4d8;
    color: #583d18;
  }
}
@media print { .website-language-corner { display: none; } }

/* Latin names and prices keep the site's Baskerville and Avenir letterforms.
   Regional fallbacks select the right glyphs when a character is Chinese. */
html:lang(zh-TW) {
  --han-serif: "Songti TC", "Noto Serif TC", "Noto Serif CJK TC", PMingLiU;
  --han-sans: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", "Noto Sans CJK TC";
}
html:lang(zh-CN) {
  --han-serif: "Songti SC", "Noto Serif SC", "Noto Serif CJK SC", SimSun;
  --han-sans: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC";
}
html:lang(zh) {
  --brand-display-font: Baskerville, Georgia, var(--han-serif), serif;
  --brand-body-font: "Avenir Next", "Segoe UI", var(--han-sans), sans-serif;
  --display: var(--brand-display-font);
  --body: var(--brand-body-font);
  --zh-hero: clamp(2.45rem, 1.75rem + 3.15vw, 4.6rem);
  --zh-title: clamp(2rem, 1.55rem + 1.95vw, 3.35rem);
  --zh-section: clamp(1.65rem, 1.33rem + 1.4vw, 2.65rem);
  --zh-subheading: clamp(1.32rem, 1.14rem + .8vw, 1.88rem);
  --zh-card: clamp(1.18rem, 1.08rem + .52vw, 1.54rem);
  line-break: strict;
  word-break: normal;
}
html:lang(zh) body { line-height: 1.75; }
html:lang(zh) :where(p, li, dd, td, th, label, h1, h2, h3) { overflow-wrap: break-word; }
html:lang(zh) :is(h1, h2, h3) { letter-spacing: normal; line-height: 1.36; }
html:lang(zh) :where(h1, h2, h3) { text-wrap: balance; }
html:lang(zh) .headline-phrase { display: inline-block; max-inline-size: 100%; vertical-align: top; }

/* Keep compact section labels and form headings at their component sizes. */
html:where(:lang(zh)) h2 { font-size: var(--zh-section); }
html:where(:lang(zh)) h3 { font-size: var(--zh-subheading); }
html:lang(zh) :is(.page-intro, .simple-page, .privacy-intro, .guide-intro, .contact-welcome, .recovery-copy, .seller-worksheet-intro, .resource-event-layout, .event-recap) h1 {
  font-size: var(--zh-title);
  max-inline-size: 23em;
  line-height: 1.3;
}
html:lang(zh) .video-hero h1 {
  font-size: var(--zh-hero);
  line-height: 1.2;
  margin-block: .65rem .95rem;
}
html:lang(zh) .video-hero h1 em { margin-top: .1em; font-style: normal; font-size: .9em; }
html:lang(zh) .hero-deck { max-width: 29em; font-size: clamp(1rem, .96rem + .24vw, 1.12rem); line-height: 1.75; }
html:lang(zh) .page-deck { max-inline-size: 37em; font-size: clamp(1rem, .97rem + .17vw, 1.1rem); line-height: 1.78; }
html:lang(zh) .profile-opening h1,
html:lang(zh) .story-hero h1 { font-size: clamp(2.7rem, 1.75rem + 3.8vw, 5.6rem); line-height: 1.08; }
html:lang(zh) .profile-lead { max-inline-size: 28em; font-size: clamp(1.12rem, 1rem + .57vw, 1.48rem); line-height: 1.75; }
html:lang(zh) .profile-role { line-height: 1.6; }
/* English ch-based headline measures can leave room for only six Han characters. */
html:lang(zh) :is(.profile-sale-copy, .profile-buy-copy, .seller-presentation-copy, .seller-worksheet, .seller-film, .contact-first-call) h2 {
  max-inline-size: 16em;
}
html:lang(zh) :is(.profile-sale-copy, .profile-close, .contact-first-call) > p:not(.profile-label) { max-inline-size: 36em; }
html:lang(zh) :is(.home-path, .home-tool-grid, .contact-layout, .testimonial-contact, .compare-controls, .city-topic, .buyer-next-steps, .seller-worksheet, .web-events) h2 { font-size: var(--zh-section); }
html:lang(zh) :is(.guide-group, .city-map-panel, .contact-panel, .guide-chapter, .guide-letter-links, .guide-subscribe, .web-rsvp, .web-event-details, .profile-events-heading, .profile-service-section) h2 { font-size: var(--zh-subheading); }
html:lang(zh) :is(.insight-card, .guide-card, .city-card-title, .web-event-card, .web-event-upcoming-row, .profile-events, .profile-service, .property-places, .campaign-decisions) h3 { font-size: var(--zh-card); line-height: 1.48; }
html:lang(zh) .guide-directory .city-card-title h3 { font-size: var(--zh-card); }
html:lang(zh) :is(.eyebrow, .profile-label, .work-kicker, .resource-kicker, .portfolio-price-label, .portfolio-card-location) { letter-spacing: .045em; line-height: 1.5; }
html:lang(zh) #site-nav {
  font-size: .875rem;
  font-weight: 600;
  letter-spacing: .025em;
  text-transform: none;
}
@media (min-width: 1221px) {
  html:lang(zh) #site-nav { column-gap: clamp(1.3rem, 1.9vw, 2.25rem); }
}
html:lang(zh) .drawer-pages a { font-size: clamp(1.05rem, .98rem + .47vw, 1.22rem); line-height: 1.5; }
html:lang(zh) .button { line-height: 1.45; }
/* Keep the number and the longer Chinese area unit legible together. */
html:lang(zh) .property-key-facts dd {
  font-size: clamp(1.24rem, 1.05rem + 1.5vw, 2.1rem);
  letter-spacing: normal;
  line-height: 1.32;
}

/* A little more leading gives dense Chinese prose room without enlarging it. */
html:lang(zh) :is(.article-body, .guide-chapter, .privacy-body, .web-event-story) :is(p, li),
html:lang(zh) .review-letter blockquote { font-size: 1rem; line-height: 1.85; }
html:lang(zh) .article-body > p + p { margin-block-start: .85em; }
html:lang(zh) :is(.article-header, .event-recap) .article-summary { font-size: clamp(1.03rem, .99rem + .25vw, 1.14rem); line-height: 1.8; }
html:lang(zh) .article-body h2, html:lang(zh) .event-recap-film h2 { font-size: var(--zh-subheading); line-height: 1.5; }
html:lang(zh) .article-body h3, html:lang(zh) .article-conversation-copy h2 { font-size: var(--zh-card); line-height: 1.5; }
html:lang(zh) .testimonial-card > figure blockquote,
html:lang(zh) .dossier-voice blockquote {
  font: 400 clamp(1.3rem, 1.12rem + 1vw, 2.1rem)/1.65 var(--display);
  letter-spacing: normal;
}
html:lang(zh) .standalone-resources .resource-identity h1 { font-size: clamp(1.4rem, 1.05rem + 1.4vw, 1.85rem); line-height: 1.35; }
html:lang(zh) :is(.resource-tool, .resource-event-name) strong,
html:lang(zh) .resource-feature-copy :is(h2, h3) { font-size: var(--zh-card); line-height: 1.5; letter-spacing: normal; }
@media screen {
  html:lang(zh) .studio-document-cover .sdc-title { font-family: var(--display); font-size: var(--zh-title); line-height: 1.35; max-width: 18em; }
  html:lang(zh) .cma-inner h2 { font-size: var(--zh-section); }
}

/* The resource guides mix Chinese prose with addresses, loan terms and dollar amounts. */
@media screen {
  html:lang(zh) .standalone-resources :is(.native-guide, .resource-proceeds, .resource-event-opening) {
    --measure: 62rem;
    --resource-detail-title: clamp(1.85rem, 1.5rem + 1.7vw, 2.9rem);
  }
  html:lang(zh) .standalone-resources .worksheet-guide { --measure: 47rem; }
  html:lang(zh) .standalone-resources :is(.guide-intro, .seller-worksheet-intro, .resource-event-layout) h1 {
    max-inline-size: 21em;
    font-size: var(--resource-detail-title);
    line-height: 1.36;
    letter-spacing: normal;
  }
  html:lang(zh) .standalone-resources :is(.guide-intro, .seller-worksheet-intro) .page-label {
    font-size: .8rem;
    line-height: 1.55;
    letter-spacing: .035em;
  }
  html:lang(zh) .native-guide :is(.guide-reading, .guide-letter, .guide-subscribe) {
    column-gap: clamp(1.5rem, 4vw, 3.5rem);
  }
  html:lang(zh) .native-guide :is(.guide-intro .page-deck, .guide-chapter > p, .guide-letter-body),
  html:lang(zh) .resource-event-layout .resource-event-description {
    max-inline-size: 38em;
    font-size: 1rem;
    line-height: 1.85;
  }
  html:lang(zh) .native-guide :is(.guide-intro .page-deck, .guide-chapter > ul, .guide-chapter > ol) { margin-block-start: .75rem; }
  html:lang(zh) .native-guide :is(.guide-chapter, .guide-letter-links, .guide-subscribe) h2,
  html:lang(zh) .resource-event-layout .event-facts h2 {
    margin-block-end: .7rem;
    font-size: clamp(1.32rem, 1.18rem + .65vw, 1.75rem);
    line-height: 1.5;
  }
  html:lang(zh) .native-guide :is(.lender-institution, .resource-planner h3) {
    font-size: 1.22rem;
    line-height: 1.45;
    letter-spacing: normal;
  }
  html:lang(zh) .guide-lender-directory :is(.lender-role, .lender-licenses, .lender-legal) { line-height: 1.65; }
  html:lang(zh) .native-guide .guide-letter-links :is(a, .button),
  html:lang(zh) .resource-event-layout .event-actions a { max-inline-size: 100%; line-height: 1.6; }
  html:lang(zh) .standalone-resources :is(.resource-planner label, .seller-field) {
    gap: .4rem;
    line-height: 1.55;
  }
  html:lang(zh) .standalone-resources :is(.seller-result, .resource-planner-result) > output {
    font-size: clamp(1.55rem, 1.2rem + 2vw, 2.4rem);
    line-height: 1.4;
    letter-spacing: normal;
    font-variant-numeric: tabular-nums;
  }
}
/* Keep bilingual contact and calculator values legible on a narrow phone. */
.standalone-resources .guide-lender-directory .lender-contact a { min-block-size: 44px; }
.standalone-resources .resource-planner-lines div { align-items: baseline; flex-wrap: wrap; gap: .1rem .75rem; }
.standalone-resources .resource-planner-lines dd {
  max-inline-size: 100%;
  margin-inline-start: auto;
  text-align: end;
  white-space: normal;
  font-variant-numeric: tabular-nums;
}
.standalone-resources .resource-proceeds :where(.seller-money:not(:has([aria-invalid="true"])), .seller-field > input:not([aria-invalid="true"]), .seller-field > select) {
  border-color: var(--control-line);
}
@media (max-width: 30rem) {
  html:lang(zh) .standalone-resources :is(.resource-planner-fields, .seller-fields) { grid-template-columns: minmax(0, 1fr); }
  html:lang(zh) .native-guide .guide-next { align-items: flex-start; gap: .3rem .95rem; }
}
