/* GAH 29 local candidate: presentation only, after the existing review.css.
   Existing nodes, module order, enabled states, actions and access checks remain authoritative.
   The separately scoped approved-home29.css owns the approved homepage geometry. */
:root {
  --paper: #f7f5ed;
  --white: #fffefa;
  --cream: #fffefa;
  --ink: #263d4b;
  --navy: #263d4b;
  --green: #505d40;
  --gold: #b89a65;
  --gold-text: #7a6339;
  --muted: #64705b;
  --line: #d6dacd;
  --soft: #e1e7d9;
  --control-line: #98a18c;
  --hover-green: #3f4d32;
  --read29: 17px;
  --aux29: 14px;
  --label29: 15px;
  --action29: 16px;
  --danger29: #923d2d;
  --danger-soft29: #fff0e9;
  --font-reading: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  --font-code: ui-monospace, "Cascadia Mono", Consolas, monospace;
}
body {
  width: auto;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-reading);
  font-size: var(--read29);
  line-height: 1.85;
}
body:not(.route-home) :is(p, li, dd, td),
:is(.public-tools, .share-dialog, #pending-dialog) :is(p, li, dd, td) {
  font-size: var(--read29);
  line-height: 1.85;
  overflow-wrap: anywhere;
  word-break: normal;
}
body:not(.route-home) :is(h1, h2, h3, h4),
:is(.share-dialog, #pending-dialog) :is(h1, h2, h3, h4) {
  overflow-wrap: anywhere;
  word-break: normal;
  color: var(--ink);
}
:is(.public-main, .gov-root, .connection-page, .layer4-shell) h1 {
  font-size: clamp(30px, 3.3vw, 42px);
  line-height: 1.4;
  font-weight: 600;
}
:is(.public-main, .gov-root, .connection-page, .layer4-shell) h2 {
  font-size: clamp(24px, 2.4vw, 30px);
  line-height: 1.5;
}
:is(.public-main, .gov-root, .connection-page, .layer4-shell) h3 {
  font-size: 22px;
  line-height: 1.6;
}
body:not(.route-home) :is(label, dt, th, legend),
:is(.public-tools, .share-dialog, #pending-dialog) :is(label, dt, th, legend) {
  font-size: var(--label29);
  line-height: 1.75;
  overflow-wrap: anywhere;
}
body :is(input:not([type=checkbox]):not([type=radio]), select, textarea) {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
  font-family: var(--font-reading);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--white);
  border-color: var(--control-line);
}
body :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select) {
  min-height: 44px;
}
body :is(pre, code) {
  font-family: var(--font-code);
  font-size: 14px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
body pre { max-width: 100%; min-width: 0; white-space: pre-wrap; }
body:not(.route-home) :is(small, .eyebrow, .source-note, .gov-scope, .gov-pill,
  .metric-date-policy, .public-muted, .public-location, .public-result-location,
  .public-breadcrumb, .public-pending, .public-tool-status, .public-storage-note,
  .public-home-notice, .gov-message, .digital-tool-state, .merchant-note,
  .china-ad-notice, .china-reserved-state, .explainer-label, .purpose-pending),
:is(.share-dialog, #pending-dialog) :is(.share-secondary, .share-card-position,
  .share-local-warning, .share-status, .pending-state, figcaption),
.public-tools :is(.public-muted, .public-location, .public-tool-status,
  .public-storage-note, .public-home-notice),
.review-status span, .review-footer, .layer4-notice:not(:empty) {
  font-size: var(--aux29);
  line-height: 1.85;
  letter-spacing: normal;
}
.source-note, .public-muted, .public-result-location, .gov-scope,
.metric-date-policy, .share-secondary, .share-card-position { color: var(--muted); }
.site-head > span, .share-page-tools > span { font-size: var(--aux29); line-height: 1.85; }
body:not(.route-home) figcaption,
body:not(.route-home) .public-result-location { font-size: var(--aux29) !important; }
.eyebrow, .digital-tool-state { color: var(--gold-text); }
body :is(a, button, input, select, textarea, summary) {
  -webkit-tap-highlight-color: transparent;
}
body :is(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--gold-text);
  outline-offset: 4px;
}

/* Class-only semantics are attached to the original controls by presentation29.mjs. */
.va29-action {
  box-sizing: border-box;
  min-width: 44px;
  min-height: 44px;
  max-width: 100%;
  font-family: var(--font-reading);
  font-size: var(--action29) !important;
  line-height: 1.5 !important;
  touch-action: manipulation;
}
.va29-action:not(:is(.va29-surface, .va29-rich-link)) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  border: 1.5px solid var(--control-line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
}
.va29-action:is(.va29-surface, .va29-rich-link) {
  color: inherit;
  white-space: normal;
  overflow-wrap: anywhere;
}
.va29-primary:not(:is(.va29-surface, .va29-rich-link)) {
  background: var(--green) !important;
  color: var(--white) !important;
  border: 1.5px solid var(--green) !important;
  font-weight: 600;
}
.va29-secondary:not(:is(.va29-surface, .va29-rich-link)) {
  background: var(--white) !important;
  color: var(--ink) !important;
  border: 1.5px solid var(--control-line) !important;
}
.va29-nav:not(:is(.va29-surface, .va29-rich-link)) {
  background: transparent !important;
  color: var(--ink) !important;
  border: 0 !important;
  border-bottom: 2px solid #c1c8b6 !important;
  border-radius: 0;
  padding: 10px 8px;
}
.va29-nav:is(.active, .current, [aria-current]):not([aria-current=false]) {
  background: var(--soft) !important;
  color: var(--green) !important;
  border-bottom: 4px double var(--green) !important;
  font-weight: 700;
}
.va29-back:not(:is(.va29-surface, .va29-rich-link)) {
  background: transparent !important;
  color: var(--ink) !important;
  border: 1.5px solid var(--control-line) !important;
  border-left: 4px solid var(--green) !important;
  border-radius: 0;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.va29-confirm:not(:is(.va29-surface, .va29-rich-link)) {
  background: var(--green) !important;
  color: var(--white) !important;
  border: 3px double var(--white) !important;
  outline: 1px solid var(--green);
  border-radius: 4px;
  font-weight: 700;
}
.va29-cancel:not(:is(.va29-surface, .va29-rich-link)) {
  background: var(--white) !important;
  color: var(--ink) !important;
  border: 1.5px dashed #7e8874 !important;
  border-radius: 999px;
  font-weight: 500;
}
.va29-danger:not(:is(.va29-surface, .va29-rich-link)) {
  background: var(--danger-soft29) !important;
  color: var(--danger29) !important;
  border: 2px solid var(--danger29) !important;
  border-radius: 4px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.va29-action[aria-pressed=true]:not(:is(.va29-surface, .va29-rich-link)) {
  background: var(--soft) !important;
  color: var(--ink) !important;
  border: 3px double var(--green) !important;
  font-weight: 700;
}
.va29-action:not(:disabled):not([aria-disabled=true]):hover {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.va29-action:not(:disabled):not([aria-disabled=true]):active {
  box-shadow: inset 0 0 0 2px var(--gold);
}
.va29-action:focus-visible {
  outline: 3px solid var(--gold-text);
  outline-offset: 4px;
}
summary.va29-action:not(:is(.va29-surface, .va29-rich-link)) {
  display: list-item;
  list-style-position: inside;
  text-align: left;
}

/* Shared shell stays visible and all original routes remain available. */
.review-status {
  background: #eeece3;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  gap: 12px;
  padding: 12px 24px;
}
.review-status > * { min-width: 0; }
.review-status > strong { font-size: 16px; line-height: 1.7; }
.review-status > span { flex: 1 1 240px; }
.review-footer {
  margin-top: 28px;
  border-top: 1px solid var(--line);
  background: #eeece3;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.site-foot > p:has(> a) { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.site-head, .public-tools { background: var(--white); border-color: var(--line); }
.site-nav > * { background: var(--white); border-color: var(--line); }
.site-nav .active { background: var(--soft); border-color: var(--green); }
.public-tools { color: var(--ink); box-shadow: 0 4px 16px #263d4b04; }
.public-search-form { gap: 12px; }
.public-search-form > * { min-width: 0; }
.public-search-form input, .public-intent-form input {
  border: 1.5px solid var(--control-line);
  border-radius: 5px;
  background: var(--white);
}
.public-location, .public-breadcrumb { color: var(--muted); }
.public-result, .gov-panel, .merchant-detail-panel, .content-card,
.life-item, .china-ad-card, .merchant-card {
  background: var(--white);
  border-color: var(--line);
  color: var(--ink);
  min-width: 0;
}
.gov-panel, .merchant-detail-panel, .public-result { box-shadow: 0 5px 18px #263d4b03; }
/* Preserve the original white heading over the dark China landscape overlay. */
body:not(.route-home) .china-scene-copy h2 { color: inherit; }

body:not(.route-home) .public-result h2 a.va29-rich-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  max-width: 100%;
  font-size: inherit !important;
  line-height: 1.5;
}
.gov-panel h2, .merchant-detail-panel h2 { margin-bottom: 16px; }
.gov-pill { color: var(--green); background: var(--soft); border-color: var(--line); }
.gov-message, .public-pending, .pending-state {
  color: var(--gold-text);
  background-color: #f0ece1;
  border-color: #d9c9a8;
}
.gov-root, .connection-page, .public-main, .layer4-shell,
.merchant-detail-page, .merchant-detail-grid, .layer4-grid,
.gov-heading, .gov-panel, .public-results, .content-pair, .content-card {
  min-width: 0;
  box-sizing: border-box;
}
.merchant-detail-page { width: 100%; max-width: 1200px; }
.layer4-shell { width: calc(100% - 48px); max-width: 1200px; }
:is(.merchant-detail-grid, .layer4-grid, .dashboard-grid, .life-grid) > * { min-width: 0; }
:is(.gov-actions, .gov-return, .gov-tabs, .life-quick, .governance-entry,
  .layer4-controls, .layer4-options, .layer4-return, .public-quick,
  .public-info-links, .public-intents, .public-share-actions,
  .share-page-tools, .share-channel-actions, .merchant-detail-feedback,
  .merchant-detail-return, .public-next-actions) {
  gap: 12px;
  flex-wrap: wrap;
}
.directory-form { gap: 12px; }
.directory-form > *, .layer4-controls > *, .gov-heading > * { min-width: 0; }
.directory-form label, .directory-form input, .gov-root select { max-width: 100%; }
.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--white);
}
.gov-table { color: var(--ink); max-width: 100%; }
.gov-table :is(th, td) {
  padding: 14px;
  line-height: 1.8;
  border-color: var(--line);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}
.gov-table th { background: #eeeee5; }
.gov-table .va29-action { margin: 4px 0; }

/* Keep the service strip horizontal. Larger text must not be clipped by fixed cards. */
.category-strip, .merchant-strip { display: flex; flex-wrap: nowrap; }
.category-card { height: auto; min-height: 160px; flex-shrink: 0; padding: 0; }
.category-card .category-picture { flex-shrink: 0; }
.category-label {
  min-height: 54px;
  height: auto;
  font-size: 16px;
  line-height: 1.65;
  padding: 8px 10px;
  overflow-wrap: anywhere;
  word-break: normal;
}
.merchant-card { height: auto; min-height: 280px; }
.merchant-title { min-height: 54px; height: auto; font-size: 17px; line-height: 1.65; padding: 8px 10px; }
.merchant-actions { grid-template-rows: auto auto; gap: 12px; margin: 4px 8px 12px; }
.merchant-actions button { min-height: 44px; font-size: 16px; }
.merchant-actions .va29-action { width: 100%; }
.content-card p { font-size: var(--read29); line-height: 1.85; }
.content-card h2 { line-height: 1.55; overflow-wrap: anywhere; }
.content-card .read-more, .problem-list :is(a, button) { min-height: 44px; font-size: 16px; line-height: 1.65; }
.problem-list :is(a, button) { width: 100%; text-align: left; justify-content: flex-start; }
.content-card :is(.hero-media, .b-video) { height: auto; }
.digital-tool-label, .china-ad-title { font-size: 16px; line-height: 1.65; }
.china-ad-card { height: auto; }

/* Native dialogs keep their native open/close state, focus handling and top layer. */
:is(#pending-dialog, .share-dialog) {
  box-sizing: border-box;
  max-width: calc(100% - 32px);
  max-height: 90vh;
  max-height: 90dvh;
  padding: 28px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--control-line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--white);
  box-shadow: 0 20px 72px #263d4b26;
}
#pending-dialog { width: 680px; }
.share-dialog { width: 900px; }
:is(#pending-dialog, .share-dialog)::backdrop { background: #263d4b66; }
:is(#pending-dialog, .share-dialog) :is(h2, h3) { line-height: 1.5; }
#pending-dialog h2, .share-heading h2 { font-size: 28px; }
#pending-dialog ul { padding-inline-start: 24px; }
#pending-dialog li { margin-block: 10px; }
#pending-dialog form { margin-top: 24px; }
.share-heading { gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.share-heading h2 { flex: 1 1 190px; min-width: 0; margin: 0; }
.share-heading > button { flex: 0 1 auto; }
.share-dialog label { display: block; margin-block: 14px 8px; }
.share-dialog select { min-height: 48px; padding: 10px 12px; }
.share-card-summary { align-items: start; }
.share-card-summary > *, #share-preview, #share-channel { min-width: 0; }
.share-card-summary #share-preview-text { font-size: var(--read29); line-height: 1.85; }
.share-card-summary h3 { font-size: 23px; margin-block: 6px 12px; }
.share-card-position, .share-card-figure figcaption { font-size: 14px; line-height: 1.8; }
.share-card-image { height: auto; }
#share-preview dl { gap: 12px 16px; }
#share-preview dd { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.share-copy-actions { gap: 12px; }
.share-copy-actions > * { min-width: 0; width: 100%; }
.share-channel-actions { gap: 12px; margin-block: 20px; }
.share-channel-actions > * {
  white-space: nowrap !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
  hyphens: none;
}
#share-manual { font-size: 16px; line-height: 1.85; max-width: 100%; min-height: 140px; }
.share-status { min-height: 26px; }

/* Native disabled attributes always outrank semantic colors and hover states. */
.va29-action:is(:disabled, [aria-disabled=true]),
.va29-action:is(:disabled, [aria-disabled=true]):hover {
  background: #e9e7de !important;
  color: #5d6557 !important;
  border: 2px dashed var(--control-line) !important;
  border-radius: 4px;
  opacity: 1 !important;
  cursor: not-allowed;
  box-shadow: none !important;
  outline: none;
  text-decoration: none;
  font-weight: 500;
}
.va29-action:is(:disabled, [aria-disabled=true]):focus-visible {
  outline: 3px dashed var(--gold-text);
  outline-offset: 4px;
}
/* Hidden controls stay hidden; no screenshot-only dialog expansion is included. */
.va29-action[hidden], .share-dialog [hidden], #pending-dialog [hidden] { display: none !important; }

@media (max-width: 900px) {
  .review-status { padding-inline: 24px; }
  .category-card { min-height: 148px; }
  .merchant-card { min-height: 280px; }
  .share-copy-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .share-card-summary { grid-template-columns: 150px minmax(0, 1fr); gap: 16px; }
}
@media (max-width: 600px) {
  :root { --read29: 16px; --aux29: 14px; --label29: 15px; }
  .review-status { padding: 12px 16px; gap: 10px 12px; }
  .review-status > span { flex-basis: 100%; }
  .review-status > a { flex: 1 1 100px; }
  .review-status > button { width: 100%; }
  .review-footer { padding: 18px 16px; text-align: left; }
  .public-tools { padding: 16px; }
  .public-search-form { grid-template-columns: minmax(0, 1fr) auto; }
  .public-search-form > label { grid-column: 1 / -1; }
  .public-search-form > input { grid-column: 1; }
  .public-search-form > button { grid-column: 2; }
  .public-intent-form > *, .directory-form > * { max-width: 100%; }
  .public-intent-form label { flex-basis: 100%; min-width: 0; }
  .directory-form { align-items: stretch; }
  .gov-root label { min-width: 0; }
  .gov-actions button, .layer4-controls .va29-action, .layer4-options .va29-action { width: 100%; }
  .layer4-shell { width: calc(100% - 32px); }
  .gov-table { min-width: 580px; }
  .gov-table :is(th, td) { padding: 12px; }
  .merchant-title { min-height: 58px; font-size: 16px; }
  .category-label { min-height: 58px; }
  .content-card { padding: 12px; }
  .content-card h2 { font-size: 21px; }
  :is(.public-main, .gov-root, .connection-page, .layer4-shell) h2 { font-size: 24px; }
  :is(.public-main, .gov-root, .connection-page, .layer4-shell) h3 { font-size: 20px; }
  :is(#pending-dialog, .share-dialog) {
    max-width: calc(100% - 24px);
    max-height: 92vh;
    max-height: 92dvh;
    padding: 20px;
  }
  #pending-dialog h2, .share-heading h2 { font-size: 25px; }
  .share-heading h2 { flex: 1 1 140px; flex-shrink: 1; }
  .share-heading > button { flex: 1 1 160px; }
  .share-card-summary { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .share-card-figure { width: min(100%, 260px); margin: 0; }
  .share-card-summary h3 { font-size: 21px; }
  #share-preview dl { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  #share-preview dd { margin-bottom: 10px; }
  .share-copy-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .share-copy-actions > .va29-action { padding-inline: 10px; }
  .share-channel-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
    gap: 12px;
  }
  .share-channel-actions > * { min-width: 0; width: 100%; }
  .share-channel-actions > #share-system { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  .va29-action { scroll-behavior: auto; transition: none; }
}
