/* Complete the approved public design on legacy content and service pages.
   These selectors never match staff, supervisor or embedded admin workspaces. */
body.ls-public-ui,
body.ls-customer-page {
  --page-paper: #fffdf8;
  --page-surface: #f2f1e8;
  --page-line: #ded6c5;
  --page-ink: #263c36;
  --page-muted: #65716a;
  --page-green: #173f34;
  --page-gold: #c5a16a;
  --page-radius: 12px;
}

/* The content keeps its own H1; the shared section label becomes a breadcrumb. */
body.ls-public-ui #ls-page-heading.ls-heading-compact { padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: none !important; box-shadow: none !important; gap: 8px 24px !important; }
body.ls-public-ui .ls-heading-compact #ls-page-title { grid-row: 1 !important; color: var(--page-muted) !important; font: 600 14px/1.6 system-ui, sans-serif !important; letter-spacing: .05em !important; }
body.ls-public-ui .ls-heading-compact > .ls-public-description { display: none !important; }
body.ls-public-ui .ls-heading-compact .ls-reading-switch { grid-row: 1/3 !important; }
body.ls-public-ui .ls-heading-compact #ls-back-v83 { grid-column: 1 !important; grid-row: 2 !important; margin: 0 !important; }
body.ls-public-ui .ls-heading-compact #ls-back-v83 :is(a, button) { color: var(--page-green) !important; }
body.ls-public-ui .ls-heading-compact .ls-header-extras :is(a, button) { color: var(--page-green) !important; }
body.ls-public-ui .ls-heading-compact .ls-search-status { color: var(--page-muted) !important; }

/* Topic inventory: a readable index, followed by the original working forms. */
body.ls-public-ui .methods-page > h1 {
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--page-green);
  font: 500 clamp(25px, 3vw, 34px)/1.45 "Songti SC", "SimSun", serif;
  text-align: left;
}
body.ls-public-ui .methods-page > p { max-width: 780px; margin: 0 0 28px; color: var(--page-muted); }
body.ls-public-ui .method-page-group { margin: 36px 0; }
body.ls-public-ui .method-page-group > h2 { margin: 0 0 20px; padding-bottom: 12px; border-bottom: 1px solid var(--page-line); color: var(--page-green); font-size: 25px; }
body.ls-public-ui .method-topic-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; margin: 22px 0; }
body.ls-public-ui .method-topic-group > h3 { grid-column: 1/-1; margin: 0 0 2px; font-size: 17px; color: var(--page-muted); }
body.ls-public-ui .method-topic { min-width: 0; margin: 0; border: 1px solid var(--page-line); border-radius: var(--page-radius); background: var(--page-paper); box-shadow: 0 4px 20px #173f3405; scroll-margin-top: 24px; }
body.ls-public-ui .method-topic[open] { grid-column: 1/-1; border-color: var(--page-gold); }
body.ls-public-ui .method-topic > summary { min-height: 82px; padding: 16px 20px; color: var(--page-green); line-height: 1.5; }
body.ls-public-ui .method-topic > summary::marker { color: var(--page-gold); }
body.ls-public-ui .method-topic > summary img { width: 80px; height: 52px; border-radius: 6px; margin: 0 14px 0 6px; }
body.ls-public-ui .method-topic > summary span { max-width: calc(100% - 130px); font-size: 18px; overflow-wrap: anywhere; }
body.ls-public-ui .method-topic > summary small { margin-top: 4px; color: var(--page-muted); font: 400 12px/1.6 system-ui, sans-serif; }
body.ls-public-ui .method-topic[open] > summary { background: var(--public-soft, #f0f4ee); border-bottom: 1px solid var(--page-line); }
body.ls-public-ui .method-topic-content { padding: 22px 26px; }
body.ls-public-ui .method-topic-content > p { margin: 0 0 14px; max-width: 900px; line-height: 1.85; }
body.ls-public-ui .method-topic-content > p > a { display: inline-flex; align-items: center; min-height: 44px; color: var(--public-accent, #24564b); text-underline-offset: 4px; }
body.ls-public-ui :is(.method-tool, .method-history) { padding: 24px; margin: 24px 0 0; border: 1px solid var(--page-line); border-radius: var(--page-radius); background: var(--page-paper); }
body.ls-public-ui .method-tool > h3 { margin: 0 0 18px; color: var(--page-green); font-size: 22px; }
body.ls-public-ui .method-tool label { margin: 16px 0; color: var(--page-ink); font-size: 14px; font-weight: 600; }
body.ls-public-ui .method-tool :is(input:not([type=checkbox]):not([type=radio]), select, textarea) { width: min(100%, 420px); min-height: 46px; margin-top: 7px; padding: 10px 12px; border: 1px solid #c9cdbf; border-radius: 7px; background: #fff; color: var(--page-ink); font: 400 16px/1.5 system-ui, sans-serif; }
body.ls-public-ui .method-tool fieldset { padding: 16px; border-color: var(--page-line); border-radius: 8px; }
body.ls-public-ui .method-tool legend { padding: 0 8px; color: var(--page-green); font-size: 14px; }
body.ls-public-ui :is(.method-tool, .method-history) button { min-height: 44px; margin: 8px 8px 0 0; padding: 10px 18px; border: 1px solid var(--page-green); border-radius: 6px; background: var(--page-green); color: #fff8e9; font: 600 14px/1.5 system-ui, sans-serif; box-shadow: none; }
body.ls-public-ui .method-facts { padding: 18px; border-left: 3px solid var(--page-gold); border-radius: 6px; background: var(--page-surface); }
body.ls-public-ui .method-facts dt { margin-top: 12px; font-size: 13px; color: var(--page-muted); }
body.ls-public-ui .method-facts dd { margin: 5px 0 14px; font-size: 15px; line-height: 1.85; }

/* Reading surfaces share typography; diagrams, tables and calculators retain
   their original sizing, scroll regions and interaction contracts. */
body.ls-public-ui :is(.lk-article-heading, .well-hero-copy, .sp-hero-copy) h1 { color: var(--page-green); font-family: "Noto Serif SC", "Songti SC", "SimSun", serif; font-weight: 500; line-height: 1.45; letter-spacing: .025em; }
body.ls-public-ui :is(.lk-article-summary, .well-subject, .sp-lead) { color: #53665a; line-height: 1.9; }
body.ls-public-ui :is(.lk-toc, .well-toc) { padding: 20px; border: 1px solid var(--page-line); border-radius: var(--page-radius); background: var(--page-paper); box-shadow: none; }
body.ls-public-ui :is(.lk-toc, .well-toc) a { color: var(--page-green); text-underline-offset: 4px; }
body.ls-public-ui :is(.lk-reader, .well-reader, .sp-reader) p { line-height: 1.95; margin-block: 0 20px; }
body.ls-public-ui :is(.lk-reader, .well-reader, .sp-reader) :is(h2, h3) { margin-top: 32px; margin-bottom: 14px; color: var(--page-green); }
body.ls-public-ui :is(.lk-takeaway, .lk-boundary, .well-care, .sp-use-note) { padding: 20px 24px; border: 1px solid var(--page-line); border-left: 3px solid var(--page-gold); border-radius: 8px; background: #f6f3e9; box-shadow: none; }
body.ls-public-ui :is(.lk-related, .well-related, .sp-detail-section) { margin-top: 36px; }
body.ls-public-ui :is(.lk-sources, .well-sources, .sp-contact) { padding: 24px; border: 1px solid var(--page-line); border-radius: var(--page-radius); background: var(--page-paper); }
body.ls-public-ui :is(.lk-sources, .well-sources) { font-size: 14px; overflow-wrap: anywhere; }
body.ls-public-ui :is(.lk-card, .sp-card) { border-color: var(--page-line); border-radius: var(--page-radius); background: var(--page-paper); box-shadow: 0 5px 22px #173f3406; }

/* Existing tool workspaces, with functional chart elements deliberately outside
   these surface and heading selectors. */
body.ls-public-ui :is(.workspace, .places > .place, .card.result, .card.map-card, .five-workspace > .panel, .guide, .cart-box) { border-color: var(--page-line); border-radius: var(--page-radius); background: var(--page-paper); box-shadow: 0 5px 22px #173f3406; }
body.ls-public-ui :is(.section-heading, .workspace-heading, .map-heading, .card-title) { gap: 12px; color: var(--page-green); }
body.ls-public-ui :is(.workspace-heading h1, .section-heading h2, .card-title h2, .map-heading h2) { font-family: "Songti SC", "SimSun", serif; font-weight: 500; line-height: 1.5; }
body.ls-public-ui :is(.five-intro, .intro, .guide) > p { max-width: 900px; line-height: 1.85; }
body.ls-public-ui .guide-grid { gap: 20px; }
body.ls-public-ui.fs-direct :is(.hero, .section-heading, .guide) { color: var(--public-ink); }
body.ls-public-ui.fs-direct .hero { padding: 8px 0 24px; background: none; }
body.ls-public-ui.fs-direct .hero h1 { color: var(--page-green); font-family: "Songti SC", "SimSun", serif; font-weight: 500; }
body.ls-public-ui.fs-direct .section-heading .step { background: var(--public-accent); color: #fff8e9; }
body.ls-public-ui.fs-direct #calculate { min-height: 46px; border-color: var(--public-accent); border-radius: 6px; background: var(--public-accent); color: #fff8e9; font-family: inherit; box-shadow: none; }
body.ls-public-ui .five-workspace .upload-zone { border-color: #c6b48b; border-radius: 10px; background: #f5f3e9; }
body.ls-public-ui .five-actions .primary { border-color: var(--public-accent); border-radius: 6px; background: var(--public-accent); color: #fff8e9; }
body.ls-public-ui .sp-button { border-radius: 6px; background: var(--page-green); color: #fff8e9; box-shadow: none; }
body.ls-public-ui .well-interactive { padding: 24px; border: 1px solid var(--page-line); border-radius: var(--page-radius); background: var(--page-paper); }
body.ls-public-ui .cart-intro { margin-bottom: 26px; color: var(--page-muted); }
body.ls-public-ui .cart-box { padding: 26px; }
body.ls-public-ui .cart-box h2 { color: var(--page-green); font-size: 23px; font-weight: 600; }
body.ls-public-ui .cart-summary { background: #f1f3e9; }
body.ls-public-ui .cart-primary { min-height: 46px; border-radius: 6px; background: var(--page-green); color: #fff7e7; box-shadow: none; }

/* Standalone customer pages are explicitly marked by the trusted server layout.
   Internal roles and every adminEmbedded request are excluded before injection. */
body.ls-customer-page { margin: 0; background: #f9f5ed; color: var(--page-ink); font: 16px/1.8 system-ui, -apple-system, "Microsoft YaHei", sans-serif; }
body.ls-customer-page * { box-sizing: border-box; }
body.ls-customer-page [hidden] { display: none !important; }
body.ls-customer-page > header { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px max(20px, calc((100% - 1120px)/2)); border-bottom: 1px solid var(--page-line); background: #fffcf6; font-size: 14px; }
body.ls-customer-page > header a { color: var(--page-green); text-decoration: none; }
body.ls-customer-page > main { width: calc(100% - 64px); max-width: 1120px; min-width: 0; margin: 32px auto 56px; padding: 0; }
body.ls-customer-page > main:is(.activation-main, .j-wrap) { max-width: 620px; }
body.ls-customer-page :is(main > h1, .pagehead h1, .j-card h1) { margin: 0 0 14px; padding: 0; border: 0; background: none; box-shadow: none; color: var(--page-green); text-align: left; font: 500 clamp(27px, 3.5vw, 36px)/1.5 "Songti SC", "SimSun", serif; }
body.ls-customer-page :is(.card, .j-card, .zp-question-form, .zp-history) { margin: 24px 0; padding: 28px; border: 1px solid var(--page-line); border-radius: var(--page-radius); background: var(--page-paper); box-shadow: 0 5px 22px #173f3406; }
body.ls-customer-page :is(.intro, .pagehead p, .foot, .j-subtle) { color: var(--page-muted); font-size: 14px; line-height: 1.85; text-align: left; }
body.ls-customer-page :is(label, .zp-question-form label) { color: var(--page-ink); font-size: 14px; font-weight: 600; }
body.ls-customer-page :is(input:not([type=hidden]):not([type=checkbox]):not([type=radio]), select, textarea) { max-width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #c9cdbf; border-radius: 7px; background: #fff; color: var(--page-ink); font: 400 16px/1.5 system-ui, sans-serif; }
body.ls-customer-page textarea { width: 100%; min-height: 140px; resize: vertical; }
body.ls-customer-page :is(button:not([data-zp-node]):not([data-zp-factor]), a.button) { min-height: 44px; padding: 10px 18px; border: 1px solid var(--page-line); border-radius: 6px; background: #fffaf0; color: var(--page-green); font: 600 14px/1.5 system-ui, sans-serif; box-shadow: none; }
body.ls-customer-page :is(button[type=submit], button.primary, .j-actions .primary, #activate-confirm) { border-color: var(--page-green); background: var(--page-green); color: #fff7e7; }
body.ls-customer-page :is(button, a, input, select, textarea, summary):focus-visible { outline: 3px solid var(--page-gold); outline-offset: 3px; }
body.ls-customer-page a { color: #24564b; text-underline-offset: 4px; }
body.ls-customer-page :is(.zp-birth, .zp-query-inputs) { border-color: var(--page-line); background: #f6f3e9; }
body.ls-customer-page .zp-history h2 { color: var(--page-green); font-size: 23px; }
body.ls-customer-page :is(.platform-header, .platform-card) { border-color: var(--page-line); border-radius: var(--page-radius); background: var(--page-paper); box-shadow: 0 5px 22px #173f3406; }
body.ls-customer-page .platform-header { padding: 28px; color: var(--page-green); }
body.ls-customer-page .platform-tabs { gap: 8px; }
body.ls-customer-page .platform-tabs [aria-selected=true] { border-color: var(--page-green); background: var(--page-green); color: #fff8e9; }

@media (max-width: 700px) {
  body.ls-public-ui .method-topic-group { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  body.ls-public-ui .method-topic > summary { padding: 14px 16px; }
  body.ls-public-ui .method-topic-content { padding: 18px; }
  body.ls-public-ui :is(.method-tool, .method-history, .cart-box, .lk-sources, .well-sources, .sp-contact) { padding: 18px; }
  body.ls-public-ui .method-tool :is(input:not([type=checkbox]):not([type=radio]), select, textarea) { width: 100%; }
  body.ls-public-ui :is(.lk-takeaway, .lk-boundary, .well-care, .sp-use-note) { padding: 18px; }
  body.ls-customer-page > main { width: calc(100% - 32px); margin-top: 24px; }
  body.ls-customer-page :is(.card, .j-card, .zp-question-form, .zp-history) { padding: 20px 16px; }
  body.ls-customer-page > header { min-height: 64px; padding: 14px 16px; gap: 12px; }
}

@media (max-width: 540px) {
  body.ls-public-ui #ls-page-heading.ls-heading-compact { grid-template-columns: minmax(0, 1fr); }
  body.ls-public-ui .ls-heading-compact .ls-reading-switch { grid-column: 1 !important; grid-row: 3 !important; justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  body.ls-public-ui .method-topic { scroll-behavior: auto; }
}
