/* Shared reading rhythm. Content, order, controls and translations stay intact. */
html {
  --page-gutter: 28px;
  --content-gap: 32px;
  --card-space: 24px;
  --grid-gap: 20px;
}
html body :is(.library-main,.source-content,.feature-article,.journal,.shell) { min-width: 0; }
html body .library-main { padding-top: 32px; padding-bottom: 32px; }
html body .page-context { margin-bottom: 24px; gap: 8px 16px; line-height: 1.5; }
html body :is(.source-content,.feature-article) { font-size: 16px; line-height: 1.65; }
html body .source-content[class] :is(section,.company-intro):not(.closing-section):not(.story-next-chapter) {
  margin-block: var(--content-gap) 0 !important;
  padding-block: 0 !important;
  min-height: 0;
}
html body .source-content[class] > :is(section,.company-intro):first-child,
html body .source-content[class] > div > :is(section,.company-intro):first-child {
  margin-top: 0 !important;
}
html body .source-content[class] :is(.section-alt,.section-soft,.section-dark,.editorial-section--soft,.editorial-section--dark):not(.closing-section) {
  padding: var(--card-space) !important;
}
html body .source-content[class] :is(.shell,.page-shell,.editorial-shell) { padding-inline: 0 !important; }
html body .source-content[class] :is(h1,h2,h3,h4) { overflow-wrap: break-word; }
html body .source-content[class] h1 { margin-block: 0 16px !important; line-height: 1.16 !important; }
html body .source-content[class] h2 { margin-block: 28px 12px; line-height: 1.3; }
html body .source-content[class] h3 { margin-block: 20px 10px; line-height: 1.35; }
html body .source-content[class] :is(section,article,header,aside,.s-card,.company-card) > :is(h2,h3):first-child { margin-top: 0 !important; }
html body .source-content[class] p { margin-block: 0 16px; line-height: 1.65; }
html body .source-content[class] :is(section,article,aside,.s-card,.company-card) > p:last-child { margin-bottom: 0; }
html body .source-content[class] :is(.s-eyebrow,.eyebrow,.hero-soft-chip) { margin-bottom: 12px !important; line-height: 1.5; }
html body .source-content[class] :is(.s-grid,.category-grid,.feature-grid,.content-grid,.comparison-grid,.diff-grid,.surface-grid,.tool-grid,.pricing-grid,.buyer-pricing-options) { gap: var(--grid-gap) !important; }
html body .source-content[class] :is(.s-card,.card,.surface-card,.feature-card,.diff-card,.content-card,.tool-card,.category-card,.price-card,.editorial-card,.company-card,.verified-reviews__card,.buyer-practitioner__card,.buyer-pricing-options>article,.buyer-pricing-includes) {
  padding: var(--card-space) !important;
  min-width: 0;
}
html body .source-content[class] .s-card:has(>img):not(:has(h2,h3,p)) { padding: 0 !important; }
html body .source-content[class] :is(.s-actions,.button-row,.cta-group) { gap: 12px; margin-block: 20px 0; align-items: center; }
html body .source-content[class] :is(.s-button,.button,.btn) { min-height: 46px; line-height: 1.45; white-space: normal; text-align: center; }
html body .source-content[class] :is(.s-callout,.callout,.ownership-callout) { margin-block: 20px; padding: 20px; }
html body .source-content[class] :is(.s-callout,.callout,.ownership-callout) > :last-child { margin-bottom: 0; }
html body .source-content[class] .s-hero { padding-bottom: 0 !important; }
html body .source-content[class] .editorial-section-intro { margin-bottom: 20px; }
html body .source-content[class] :is(.breadcrumbs,.help-breadcrumb) { margin-bottom: 20px; gap: 6px 10px; line-height: 1.6; }
html body .source-content[class] :is(ul,ol) { margin-block: 16px; }
html body .source-content[class] li { line-height: 1.65; }

/* Developer pages: use the available column and keep wide data inside its scroller. */
html body .source-content[class] .endpoint-shell { width: 100%; max-width: none; padding: 0; margin: 0; gap: 28px; }
html body .source-content[class] .endpoint-copy { min-width: 0; }
html body .source-content[class] .endpoint-copy h1 { margin-top: 0; }
html body .source-content[class] .endpoint-path { margin-block: 16px 20px; gap: 8px; }
html body .source-content[class] .endpoint-summary { margin-bottom: 16px; }
html body .source-content[class] .doc-section { margin-block: 28px 0 !important; padding: 0 !important; }
html body .source-content[class] .doc-section h2 { margin-block: 0 12px; }
html body .source-content[class] .code-column { padding-top: 0; margin-top: 0; }
html body .source-content[class] :is(.code-sample,.code-block) { margin-block: 16px; }
html body .source-content[class] :is(.code-sample,.code-block):first-child { margin-top: 0; }
html body .source-content[class] :is(.s-table-wrap,.table-scroll) { max-width: 100%; margin-block: 20px; overflow-x: auto; overscroll-behavior-inline: contain; }
html body .source-content[class] :is(th,td) { padding: 12px 14px; font-size: 14px; line-height: 1.55; }
html body .source-content[class] .doc-section table { min-width: 640px; }
html body .source-content[class] .doc-section :is(th,td):last-child { min-width: 240px; }
html body .source-content[class] pre { font-size: 13px; line-height: 1.65; padding: 18px; margin-block: 16px; }
html body .source-content[class] :is(.code-sample,.code-block) pre { margin: 0; }
html body .source-content[class] .related-links { gap: 6px 10px; }
html body .source-content[class] .related-links a { min-height: 44px; display: inline-flex; align-items: center; }

/* Pricing details retain their hierarchy without fixed-height empty blocks. */
html body .source-content[class] .buyer-pricing-options > article { min-height: 0; }
html body .source-content[class] .buyer-pricing-options header { min-height: 0; align-items: baseline; flex-wrap: wrap; gap: 8px 12px; }
html body .source-content[class] .buyer-pricing-options header :is(h2,span) { margin: 0 !important; }
html body .source-content[class] .buyer-pricing-options__price { margin: 20px 0 8px; gap: 4px 8px; }
html body .source-content[class] .buyer-pricing-options__note { margin: 0 0 16px; min-height: 0; font-size: 16px; line-height: 1.6; }
html body .source-content[class] .buyer-pricing-options__credit { padding: 0; margin: auto 0 20px; min-height: 0; }
html body .source-content[class] .buyer-pricing-options__credit strong { min-height: 0; }
html body .source-content[class] .buyer-pricing-options__credit span { font-size: 14px; line-height: 1.55; }
html body .source-content[class] .buyer-pricing-includes ul { margin-top: 16px; gap: 10px 24px; }
html body .source-content[class] .buyer-pricing-includes li { padding-block: 0; font-size: 15px; }
html body .source-content[class] :is(.price-card,.editorial-card) > ul { margin-block: 16px 20px; }
html body .source-content[class] :is(.price-card,.editorial-card) li { margin-block: 8px; font-size: 15px; }
html body .source-content[class] .regional-pricing-notice { margin-block: 0 20px; }

/* Help articles, company pages and feature text use the same reading rhythm. */
html body .source-content[class] .help-heading { margin: 0 0 24px !important; }
html body .source-content[class] .help-prose { line-height: 1.7; }
html body .source-content[class] .help-prose h2 { margin-block: 28px 12px !important; }
html body .source-content[class] .help-prose h3 { margin-block: 24px 10px !important; }
html body .source-content[class] .help-prose :is(ul,ol) { padding-inline-start: 24px; }
html body .source-content[class] .help-article header { margin-bottom: 24px; }
html body .source-content[class] .help-article-list > a { padding: 18px 20px; }
html body .source-content[class] .help-category-grid > a { min-height: 68px; padding: 16px 20px; }
html body .source-content[class] .company-journey { gap: 0; }
html body .source-content[class] .company-journey > li { padding-block: 20px; }
html body .source-content[class] .company-journey h2 { margin-bottom: 12px !important; }
html body .feature-article .sf-intro { font-size: 16px; line-height: 1.65; }
html body .feature-article :is(.sf-benefits li,.sf-steps p,.sf-more>details>div) { font-size: 16px; line-height: 1.65; }
html body .feature-article :is(h3,.sf-more>details>summary) { font-size: 16px; line-height: 1.5; }
html body .feature-article .sf-section { margin-top: 28px; }
html body .feature-article .sf-steps { gap: 16px; }
html body .feature-article .sf-benefits { gap: 10px; }
html body .feature-article .sf-title { margin-bottom: 20px; }
html body .journal :is(.journal-article-heading,.journal-cover,.journal-prose) { margin-block: 28px; }
html body .journal-prose { line-height: 1.7; }
html body .journal-prose :is(h2,h3,h4) { line-height: 1.3; }
html body .journal-meta { font-size: 13px; }
html body .journal-grid article > p { font-size: 16px; }

@media (max-width: 800px) {
  html { --page-gutter: 20px; --content-gap: 28px; --card-space: 20px; --grid-gap: 16px; }
  html body .library-layout { display: block; padding-inline: var(--page-gutter); }
  html body .library-main { padding-top: 24px; padding-bottom: 28px; }
  html body .page-context { margin-bottom: 24px; font-size: 11px; letter-spacing: .08em; }
  html body .source-content[class] > :is(section,article,div) { max-width: 100%; }
  html body .source-content[class] h1 { font-size: 32px !important; line-height: 1.18 !important; }
  html body .source-content[class] h2 { font-size: 24px; }
  html body .source-content[class] h3 { font-size: 20px; }
  html body .source-content[class] :is(.s-hero,.company-intro) p { font-size: 17px; line-height: 1.6; }
  html body .source-content[class] :is(.s-cols-2,.s-cols-3,.category-grid,.comparison-grid,.surface-grid,.tool-grid,.pricing-grid,.buyer-pricing-options,.overview-feature-grid) { grid-template-columns: minmax(0,1fr) !important; }
  html body .source-content[class] .company-intro .s-grid { grid-template-columns: minmax(0,1fr) !important; }
  html body .source-content[class] .s-actions > .s-button { flex: 1 1 160px; }
  html body .source-content[class] :is(.s-card,.company-card) :is(h2,h3):first-child { margin-top: 0 !important; }
  html body .source-content[class] .endpoint-shell { grid-template-columns: minmax(0,1fr); gap: 28px; }
  html body .source-content[class] .endpoint-description { font-size: 16px; }
  html body .source-content[class] .buyer-pricing-options__credit { margin-top: 4px; }
  html body .source-content[class] .buyer-pricing-options__price { font-size: 30px; }
  html body .source-content[class] .buyer-pricing-options__price small { font-size: 16px; }
  html body .source-content[class] :is(.s-table-wrap,.table-scroll) { margin-block: 16px; }
  html body .source-content[class] details summary { padding: 16px 18px !important; min-height: 48px; }
  html body .source-content[class] details > :is(div,p) { padding: 0 18px 18px !important; }
  html body .source-content[class] .help-library > a { gap: 12px; padding: 20px !important; }
  html body .feature-article h1 { font-size: 28px; }
  html body .feature-article h2 { font-size: 22px; }
  html body .feature-article .sf-more > details > summary { padding-block: 14px; }
  html body > main > .shell,
  html body > main.shell,
  html body .journal.shell { padding-inline: var(--page-gutter); }
  html body :is(.hero,.plans-hero) { padding-block: 28px 32px; gap: 24px; }
  html body :is(.features,.pricing,.practice-context,.builder-context,.agent-context,.personal-everyday,.human-photo-story,.partner-steps) { padding-block: 24px 32px; }
  html body :is(.feature-grid,.plans,.journal-grid,.partner-steps ol) { gap: 20px; }
  html body .section-heading { margin-bottom: 24px; }
  html body .plans > article { padding: 20px; gap: 12px; }
  html body .plans .plan-description { min-height: 0; }
  html body .plan-features { font-size: 16px; gap: 10px; margin-block: 8px 12px; }
  html body .journal { padding-block: 28px 32px; }
  html body .journal-heading { margin-bottom: 24px; }
  html body .journal-prose { font-size: 17px; }
  html body .journal-prose h2 { font-size: 26px; }
  html body .journal-prose h3 { font-size: 22px; }
  html body .journal-end { margin-top: 28px; flex-wrap: wrap; }
  html body .human-footer { padding-inline: var(--page-gutter) !important; }
  html body .human-footer .footer-top { gap: 28px; }
  html body .human-footer nav { gap: 24px 20px; }
  html body .human-footer nav h3 { margin-bottom: 14px; }
  html body .human-footer .footer-purpose h2 { margin-block: 24px 16px; }
  html body .human-footer .footer-purpose p { margin-bottom: 0; }
  html body .human-footer .footer-stores:empty { margin: 0; }
}
@media (max-width: 359px) {
  html { --page-gutter: 16px; --card-space: 18px; }
  html body .source-content[class] h1 { font-size: 29px !important; }
}

/* Inline icons and disclosure controls stay beside their text at every width. */
html body .source-content[class] .company-inline:has(> .company-icon),
html body .source-content[class] .s-inline:has(> div > .company-icon) {
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 12px;
}
html body .source-content[class] .company-inline:has(> .company-icon) > span,
html body .source-content[class] .s-inline:has(> div > .company-icon) > div:last-child { min-width: 0; flex: 1; }
html body .source-content[class] .company-inline:has(> a.s-button) { margin-top: 20px; }
html body .source-content[class] details.company-card { padding: 0 !important; margin-block: 12px 0; }
html body .source-content[class] details.company-card > summary {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 56px;
  margin: 0 !important;
  padding: 18px 20px !important;
}
html body .source-content[class] details.company-card > summary > span:first-child { min-width: 0; flex: 1; }
html body .source-content[class] details.company-card > summary > .company-inline { flex: 0 0 auto; margin: 0; }
html body .source-content[class] details.company-card > :not(summary) { margin: 0; padding: 0 20px 20px !important; }
html body .source-content[class] .company-stack > details.company-card + details.company-card { margin-top: 12px; }
html body .source-content[class] .doc-section th:first-child,
html body .source-content[class] .doc-section td:first-child { min-width: 140px; }

/* Grid gaps own the spacing; legacy card margins must not double it. */
html body .source-content[class] :is(.s-grid,.category-grid,.feature-grid,.content-grid,.comparison-grid,.diff-grid,.surface-grid,.tool-grid,.pricing-grid,.buyer-pricing-options) > * { margin-block: 0 !important; }
html body .human-footer .footer-stores img { display: block; }
