/* Shared outer page geometry; model scope, prices, forms and dialogs are unchanged. */
@layer suite-overrides {
  :root {
    --zhua-page-max: 1920px;
    --zhua-page-gutter: clamp(12px, 1.6vw, 40px);
  }

  /* The same border-box frame is used by the public site and native app. */
  html body.zhuhua-suite :is(.container:not(.narrow), .nav-wrap, .hero-inner,
    .model-page, .guide-page, .footer-grid, .footer-bottom),
  html #zhua-home :is(.suite-nav-inner, .suite-hero, .suite-flow, .suite-section,
    .suite-document, .suite-guide, .suite-cta),
  html.suite-theme body #root header:is(.fixed, .sticky) > div,
  html.suite-theme body #root main.container,
  html.suite-theme body #root main > div:has(> .zhuhua-page-heading),
  html.suite-theme body #root main > div:has(> .zhuhua-page-heading) ~ div,
  html body #root .zhuhua-public-shell [data-zhua-market-frame],
  html body main.model-page[data-zhua-market-frame],
  html body.zhuhua-suite main.model-page.zhua-catalog-mount[data-zhua-market-frame],
  html.suite-theme body #root #zhua-catalog,
  html body #zhua-catalog {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: var(--zhua-page-max) !important;
    margin-inline: auto !important;
    padding-inline: var(--zhua-page-gutter) !important;
    min-width: 0 !important;
  }

  /* A mounted catalogue is inside an already padded page: add no second gutter. */
  html body main.model-page #zhua-catalog,
  html.suite-theme body #root [data-zhua-market-frame] #zhua-catalog[data-zhua-market-frame],
  html body #root [data-zhua-market-frame] [data-zhua-market-frame],
  html body #root main > div:has(> .zhuhua-page-heading) #zhua-catalog,
  html body #root main > div:has(> .zhuhua-page-heading) ~ div #zhua-catalog {
    width: 100% !important;
    max-width: none !important;
    padding-inline: 0 !important;
  }

  html body.zhuhua-suite :is(.container:not(.narrow), .model-page, .guide-page)
    :is(.container:not(.narrow), .hero-inner) {
    width: 100% !important;
    max-width: none !important;
    padding-inline: 0 !important;
  }

  html #zhua-home .suite-footer {
    box-sizing: border-box;
    padding-inline: max(var(--zhua-page-gutter), calc((100% - var(--zhua-page-max)) / 2 + var(--zhua-page-gutter))) !important;
  }

  /* The sidebar consumes its own space; the main frame fills the remaining area. */
  html.suite-theme body #root [data-slot="sidebar-inset"] {
    min-width: 0 !important;
    margin-inline: 0 !important;
  }
  html.suite-theme body #root [data-slot="sidebar-inset"] > main {
    box-sizing: border-box;
    width: 100%;
    max-width: var(--zhua-page-max);
    margin-inline: auto;
    min-width: 0;
  }
  html.suite-theme body #root .zhuhua-page-heading {
    padding-inline: 0 !important;
    min-width: 0 !important;
  }
  html.suite-theme body #root :is([data-slot="card"], [data-slot="card-content"],
    [data-slot="table-container"]) {
    min-width: 0;
    max-width: 100%;
  }
  html.suite-theme body #root [data-slot="table-container"] {
    overflow-x: auto;
  }
  html.suite-theme body #root :is(.zhuhua-page-heading h1, .zhuhua-page-heading h2) {
    overflow-wrap: anywhere;
  }

  /* The shared badge padding formerly left less than two digits of space. */
  html body .case-flow-card > .case-index {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    padding: 0 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    font-variant-numeric: tabular-nums;
  }

  /* Keep long documents readable inside the shared outer frame. */
  html body.zhuhua-suite :is(.container.narrow, .article-content) {
    width: 100%;
    max-width: 880px;
    margin-inline: auto;
  }
  html:is(.zhuhua-docs, :has(#nd-page)) #nd-docs-layout {
    --fd-layout-width: var(--zhua-page-max);
  }
  html:is(.zhuhua-docs, :has(#nd-page)) #nd-page {
    min-width: 0;
    padding-inline: var(--zhua-page-gutter) !important;
  }

  /* The existing layout script still measures sticky headers and filter height. */
  html body :is(#root, #zhua-catalog) :is([data-zhua-market-cards], .catalog-card-grid) {
    min-width: 0 !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }
  @media (min-width: 768px) {
    html body :is(#root, #zhua-catalog) :is([data-zhua-market-cards], .catalog-card-grid) {
      grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
  }
  @media (min-width: 1100px) {
    html body :is(#root, #zhua-catalog) :is([data-zhua-market-cards], .catalog-card-grid) {
      grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
  }
}

.partner-feature-card > .partner-monogram.zhua-partner-logo-badge {
  box-sizing: border-box;
  display: inline-flex;
  flex: 0 0 120px;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 72px;
  padding: 12px;
  border: 1px solid var(--line, #e1e5ed);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.partner-feature-card > .partner-monogram.zhua-partner-logo-badge > .zhua-partner-logo {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  flex: none;
}
@media (max-width: 600px) {
  .partner-feature-card > .partner-monogram.zhua-partner-logo-badge {
    flex-basis: 96px;
    width: 96px;
    height: 64px;
    padding: 10px;
  }
}

/* Native/model density only. The shared 1920px frame and all model semantics
   remain in the reviewed v1 stylesheet and JavaScript. */
@layer suite-overrides {
  html body #root .zhuhua-public-shell [data-zhua-market-frame] {
    padding-top: 24px !important;
    padding-bottom: 24px !important;
  }
  html body #root [data-zhua-market-frame] > header {
    padding-top: 0 !important;
    margin-bottom: 24px !important;
    max-width: 840px !important;
  }
  html.suite-theme body #root [data-zhua-market-frame] > header h1:not(.sr-only) {
    font-size: 28px !important;
    line-height: 1.25 !important;
  }
  html.suite-theme body #root [data-zhua-market-frame] > header p {
    font-size: 14px !important;
    line-height: 1.55 !important;
    margin-top: 8px !important;
  }
  html body #root [data-zhua-market-frame] > header > div {
    margin-top: 16px !important;
  }
  html body :is(#root, #zhua-catalog) [data-zhua-native-market-layout] {
    gap: 14px !important;
  }
  html body :is(#root, #zhua-catalog) [data-zhua-native-market-main] {
    --tw-space-y-reverse: 0;
  }
  html body :is(#root, #zhua-catalog) [data-zhua-native-market-main] > :not([hidden]) ~ :not([hidden]) {
    margin-block-start: 12px !important;
  }
  html.suite-theme body #root [data-zhua-native-market-main] > div:first-child h2:not(.sr-only) {
    font-size: 18px !important;
    line-height: 1.4 !important;
  }
  html body #root [data-zhua-native-market-main] > div:nth-child(2) {
    padding: 10px !important;
    gap: 8px !important;
  }
  html body :is(#root, #zhua-catalog) [data-zhua-market-cards] {
    gap: 12px !important;
  }
  html body :is(#root, #zhua-catalog) [data-zhua-market-card] {
    padding: 12px !important;
    border-radius: 10px !important;
    min-height: 0 !important;
  }
  html body :is(#root, #zhua-catalog) [data-zhua-market-card] > div:first-child {
    gap: 6px !important;
  }
  html.suite-theme body #root [data-zhua-market-frame] [data-zhua-market-card] h3:not(.sr-only) {
    font-size: 13px !important;
    line-height: 1.45 !important;
    overflow: visible !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }
  html.suite-theme body #root [data-zhua-market-frame] [data-zhua-market-card] > p {
    min-height: 0 !important;
    flex: 0 0 auto !important;
    margin-top: 8px !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
  }
  html body :is(#root, #zhua-catalog) [data-zhua-market-card] > :last-child {
    margin-top: 10px !important;
    padding-top: 0 !important;
  }
  html body :is(#root, #zhua-catalog) [data-zhua-native-market-filter] {
    padding: 10px !important;
  }
  html.suite-theme body #root [data-zhua-native-market-filter] h2:not(.sr-only) {
    font-size: 18px !important;
    line-height: 1.4 !important;
  }
  html body :is(#root, #zhua-catalog) [data-zhua-native-market-filter] button.group.flex {
    min-height: 36px !important;
    padding-block: 6px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
  }
  html body :is(#root, #zhua-catalog) [data-zhua-native-market-filter] button.group.inline-flex {
    min-height: 30px !important;
    padding: 4px 8px !important;
    font-size: 12px !important;
    line-height: 1.5 !important;
  }
  html.suite-theme body #root .zhuhua-page-heading {
    padding-top: 20px !important;
    padding-bottom: 16px !important;
  }
  html.suite-theme body #root .zhuhua-page-heading :is(h1,h2):not(.sr-only) {
    font-size: 28px !important;
    line-height: 1.3 !important;
  }
  html.suite-theme body #root .zhuhua-page-heading p {
    margin-top: 6px !important;
    font-size: 14px !important;
    line-height: 1.55 !important;
  }
  /* WordPress uses the same renderer inside its already padded page frame. */
  html body.zhuhua-suite main.model-page[data-zhua-market-frame] #zhua-catalog[data-zhua-market-frame] {
    width: 100% !important;
    max-width: none !important;
    margin-inline: 0 !important;
    padding-inline: 0 !important;
  }
  html body.zhuhua-suite main.model-page[data-zhua-market-frame] {
    padding-block: 24px !important;
  }
  html body #zhua-catalog[data-zhua-market-frame] .catalog-hero {
    gap: 20px !important;
    margin-bottom: 16px !important;
  }
  html body #zhua-catalog[data-zhua-market-frame] .catalog-filter-panel {
    padding: 14px !important;
    margin-bottom: 16px !important;
    border-radius: 12px !important;
  }
  html body #zhua-catalog[data-zhua-market-frame] .catalog-search-row {
    margin-bottom: 12px !important;
  }
  html body #zhua-catalog[data-zhua-market-frame] .catalog-search-label input {
    height: 40px !important;
  }
  html body #zhua-catalog[data-zhua-market-frame] .catalog-filter-row {
    gap: 10px !important;
    margin-top: 8px !important;
  }
  html body #zhua-catalog[data-zhua-market-frame] .catalog-layout {
    gap: 16px !important;
  }
  html body #zhua-catalog[data-zhua-market-frame] .catalog-card-grid {
    gap: 12px !important;
  }
  html body #zhua-catalog[data-zhua-market-frame] .catalog-card {
    padding: 12px !important;
    border-radius: 10px !important;
  }
  html body #zhua-catalog[data-zhua-market-frame] .catalog-card h3 {
    font-size: 14px !important;
    line-height: 1.5 !important;
    overflow-wrap: anywhere !important;
  }
  html body #zhua-catalog[data-zhua-market-frame] .catalog-card-top {
    gap: 10px !important;
    margin-bottom: 8px !important;
  }
  html body #zhua-catalog[data-zhua-market-frame] .catalog-card-description {
    min-height: 0 !important;
    margin-bottom: 8px !important;
    font-size: 13px !important;
    line-height: 1.55 !important;
  }
  html body #zhua-catalog[data-zhua-market-frame] .catalog-card-tags {
    margin-bottom: 8px !important;
  }
  html body #zhua-catalog[data-zhua-market-frame] .catalog-card-price {
    padding-top: 8px !important;
    min-height: 0 !important;
  }
  html body #zhua-catalog[data-zhua-market-frame] .catalog-card-foot {
    margin-top: 8px !important;
  }
  html body #zhua-catalog[data-zhua-market-frame] .catalog-vendor {
    min-height: 36px !important;
    padding-block: 6px !important;
  }
  @media (max-width: 767px) {
    html body #root .zhuhua-public-shell [data-zhua-market-frame] {
      padding-top: 14px !important;
      padding-bottom: 20px !important;
    }
    html body #root [data-zhua-market-frame] > header {
      margin-bottom: 14px !important;
    }
    html body #root [data-zhua-native-market-main] > div:nth-child(2) > div {
      flex-direction: row !important;
      flex-wrap: wrap !important;
      align-items: center !important;
      justify-content: space-between !important;
    }
    html body #root #zhua-native-pricing-return-v1 {
      margin-bottom: 12px !important;
    }
    html.suite-theme body #root [data-zhua-market-frame] > header h1:not(.sr-only),
    html.suite-theme body #root .zhuhua-page-heading :is(h1,h2):not(.sr-only) {
      font-size: 25px !important;
      line-height: 1.3 !important;
    }
    html body :is(#root, #zhua-catalog) [data-zhua-market-card] {
      padding: 14px !important;
    }
    html body :is(#root, #zhua-catalog) [data-zhua-market-card] :is(button,a[role="button"]),
    html body #root [data-zhua-market-frame] :is(input,[data-slot="select-trigger"]) {
      min-height: 40px !important;
    }
    html body :is(#root, #zhua-catalog) [data-zhua-market-card] button[title="复制"] {
      min-width: 40px !important;
    }
    html.suite-theme body #root [data-zhua-market-frame] [data-zhua-market-card] h3:not(.sr-only) {
      font-size: 14px !important;
    }
    html.suite-theme body #root [data-zhua-market-frame] > header p {
      font-size: 13px !important;
    }
    html body #zhua-catalog[data-zhua-market-frame] .catalog-card {
      padding: 14px !important;
    }
    html body #zhua-catalog[data-zhua-market-frame] :is(.catalog-text-button,.catalog-pill) {
      min-height: 36px !important;
    }
    html body #zhua-catalog[data-zhua-market-frame] .catalog-text-button {
      display: inline-flex !important;
      align-items: center !important;
    }
  }
}
/* One model-family group on the phone homepage. Presentation only. */
@layer suite-overrides {
  @media (max-width: 680px) {
    html body.home.zhuhua-suite #main.suite-home .suite-provider-band,
    html body.home.zhuhua-suite #main.suite-home .suite-model-section,
    html body.home.zhuhua-suite #main.suite-home .suite-hero-panel > .suite-panel-top,
    html body.home.zhuhua-suite #main.suite-home .suite-hero-panel > .suite-panel-request,
    html body.home.zhuhua-suite #main.suite-home .suite-hero-panel > .suite-panel-route,
    html body.home.zhuhua-suite #main.suite-home .suite-hero-panel > .suite-panel-foot {
      display: none !important;
    }
    html body.home.zhuhua-suite #main.suite-home .suite-hero {
      gap: 18px !important;
    }
    html body.home.zhuhua-suite #main.suite-home .suite-hero-panel {
      padding: 0 !important;
      border: 0 !important;
      border-radius: 0 !important;
      box-shadow: none !important;
      background: transparent !important;
    }
    html body.home.zhuhua-suite #main.suite-home .suite-panel-models > span {
      display: none !important;
    }
    html body.home.zhuhua-suite #main.suite-home .suite-panel-models > div {
      display: grid !important;
      grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
      gap: 8px !important;
      margin: 0 !important;
    }
    html body.home.zhuhua-suite #main.suite-home .suite-panel-models a {
      display: flex !important;
      align-items: center !important;
      justify-content: center !important;
      gap: 6px !important;
      box-sizing: border-box !important;
      min-width: 0 !important;
      min-height: 52px !important;
      padding: 10px 4px !important;
      border-radius: 12px !important;
      text-align: left !important;
    }
    html body.home.zhuhua-suite #main.suite-home .suite-panel-models b {
      width: 28px !important;
      height: 28px !important;
      flex: 0 0 28px !important;
    }
    html body.home.zhuhua-suite #main.suite-home .suite-panel-models a > span:nth-child(2) {
      min-width: 0 !important;
      font-size: 12px !important;
      white-space: nowrap !important;
    }
  }
}
/* Homepage presentation: one centered desktop hero and no provider caption. */
@layer suite-overrides {
  html body.home.zhuhua-suite #main.suite-home > .suite-provider-band > .container > span {
    display: none !important;
  }
  html body.home.zhuhua-suite #main.suite-home > .suite-provider-band > .container {
    justify-content: center !important;
  }
  @media (min-width: 1121px) {
    html body.home.zhuhua-suite #main.suite-home > .suite-hero.container {
      width: 100% !important;
      max-width: 1280px !important;
      margin-inline: auto !important;
      padding-inline: 32px !important;
      grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr) !important;
      gap: 40px !important;
      align-items: center !important;
    }
    html body.home.zhuhua-suite #main.suite-home > .suite-hero > .suite-hero-copy {
      min-width: 0 !important;
      max-width: none !important;
    }
    html body.home.zhuhua-suite #main.suite-home > .suite-hero > .suite-hero-panel {
      width: 100% !important;
      min-width: 0 !important;
      max-width: none !important;
      justify-self: start !important;
      box-sizing: border-box !important;
    }
  }
}
