/* FusionCharge shared UI layer (fc-ui.css), WP0 of the Nov 2026 wiki unify plan (§3, design-token bridge).
 *
 * The approved home's design language (css/home-ac.css: white paper, thin VI-red rules, mono numerals,
 * square-ish 3 px corners) turned into site-wide --fc-* tokens plus a component layer that restyles the
 * classes js/render.js already emits. No new markup is needed for any rule below the token block.
 *
 * SOURCE = the customer wiki's css/fc-ui.css. The partner beta and the prod fork hold VERBATIM copies
 * (sync, don't retype). Load order in every tree: css/wiki.css -> css/fc-ui.css -> everything else, so
 * wiki.css is outranked at equal specificity and every page/partner stylesheet still outranks this file.
 *
 * Brand: Huawei only as words. No logo, no petal, no #E60012. #E9002F lives only in --fc-red-hot.
 * Guarded by the ui-tokens gate.
 */

:root {
  /* VI palette (design-system/tokens/colors.css, 2026-11-03) */
  --fc-red: #C7000B; --fc-red-deep: #A5000A; --fc-red-hot: #E9002F; --fc-grey: #595757;
  --fc-ink: #000; --fc-ink2: #2E2E2C; --fc-ink3: #5F5F5D; --fc-ink4: #666664;
  --fc-paper: #FFFFFF; --fc-mist: #F6F6F4;
  --fc-rule: #DCDCD8; --fc-rule-soft: #ECECE9; --fc-bar: #CFCFCB; --fc-tint: #FBE9EA;
  --fc-sans: 'Hanken Grotesk', 'Noto Sans Thai', Arial, system-ui, sans-serif;
  --fc-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --fc-radius: 3px;

  /* accent hooks: partner themes override through the EXISTING --p-* API, never new vars.
     The customer tree defines no --p-*, so all four fall back to VI red. */
  --fc-accent:      var(--p-primary,           var(--fc-red));   /* fills, rules, active bars */
  --fc-accent-ink:  var(--p-accent-on-surface, var(--fc-red));   /* text/links on white (contrast-guarded) */
  --fc-on-accent:   var(--p-on-primary,         #fff);
  --fc-accent-soft: var(--p-primary-soft,       var(--fc-tint));
}
html[data-lang="th"] { --fc-sans: 'Noto Sans Thai', 'Hanken Grotesk', Arial, system-ui, sans-serif; }

/* =====================================================================================================
 * COMPONENT LAYER
 * Every selector sits under :where(.page:not(:has(.hac-hero))) — "a page body that is not the approved
 * home". :where() adds no specificity, so each rule weighs exactly what the wiki.css rule it restyles
 * weighs and wins only by load order. The approved home (#page.page-home with .hac-hero inside) is left
 * to home-ac.css untouched. A browser without :has() drops these rules and shows the old look.
 * Visual only: colour, border, radius, type. No grid, width or padding changes (no layout change).
 * ===================================================================================================== */

/* ---------- page head + section head (the .hac-h2 editorial head) ---------- */
:where(.page:not(:has(.hac-hero))) .eyebrow { color: var(--fc-accent-ink); }
:where(.page:not(:has(.hac-hero))) h1.page-title { font-weight: 700; letter-spacing: -0.03em; color: var(--fc-ink); }
:where(.page:not(:has(.hac-hero))) .page-intro { color: var(--fc-ink3); }
:where(.page:not(:has(.hac-hero))) h2.sec-h {
  border-left: 0; padding-left: 0; padding-bottom: 8px; border-bottom: 1px solid var(--fc-ink);
  font-weight: 700; letter-spacing: -0.025em; color: var(--fc-ink);
}
html[data-lang="th"] :where(.page:not(:has(.hac-hero))) h2.sec-h,
html[data-lang="th"] :where(.page:not(:has(.hac-hero))) h1.page-title { letter-spacing: 0; }
:where(.page:not(:has(.hac-hero))) .prose p,
:where(.page:not(:has(.hac-hero))) .prose ul { color: var(--fc-ink2); }

/* new primitive (WP0): editorial section head = <div class="fc-sec-head"><h2 class="fc-h2">…</h2><p class="fc-sec-stamp">…</p></div> */
.fc-sec-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 8px 24px; flex-wrap: wrap;
  padding-bottom: 10px; border-bottom: 1px solid var(--fc-ink); margin-bottom: 18px;
}
.fc-h2 {
  margin: 0; font-family: var(--fc-sans); font-size: clamp(26px, 3vw, 36px); line-height: 1.1;
  letter-spacing: -0.025em; font-weight: 700; color: var(--fc-ink);
}
html[data-lang="th"] .fc-h2 { letter-spacing: 0; line-height: 1.3; }
.fc-sec-stamp { margin: 0; font-size: 12.5px; color: var(--fc-ink3); max-width: 64ch; }

/* ---------- cards (white paper, 1 px rule, 3 px top rule in accent) ----------
 * .qa-tile/.req-card/.hf-card/.so-card are the partner duplicates: partner.css still sets the same
 * properties later in the cascade, so these take over only once WP2 deletes those duplicate declarations. */
:where(.page:not(:has(.hac-hero))) .card,
:where(.page:not(:has(.hac-hero))) .qa-tile,
:where(.page:not(:has(.hac-hero))) .req-card,
:where(.page:not(:has(.hac-hero))) .hf-card,
:where(.page:not(:has(.hac-hero))) .so-card {
  background: var(--fc-paper); border: 1px solid var(--fc-rule); border-top: 3px solid var(--fc-accent);
  border-radius: var(--fc-radius); box-shadow: none;
}
:where(.page:not(:has(.hac-hero))) a.card:hover,
:where(.page:not(:has(.hac-hero))) .qa-tile:hover {
  box-shadow: none; transform: none; background: var(--fc-mist); border-color: var(--fc-ink3); border-top-color: var(--fc-accent);
}
:where(.page:not(:has(.hac-hero))) .card .ic { color: var(--fc-accent-ink); }
:where(.page:not(:has(.hac-hero))) .card h3 { color: var(--fc-ink); }
:where(.page:not(:has(.hac-hero))) .card p { color: var(--fc-ink3); }
/* new primitive (WP0): an icon holder for window.FC_ICONS (24x24, stroke 1.4, currentColor) */
.fc-ic { color: var(--fc-accent-ink); display: inline-grid; place-items: center; line-height: 0; }
.fc-ic svg { width: 24px; height: 24px; }

/* ---------- stats (the .hac-pf proof figure) ---------- */
:where(.page:not(:has(.hac-hero))) .stat {
  background: var(--fc-paper); border: 1px solid var(--fc-rule); border-top: 1px solid var(--fc-ink);
  border-radius: var(--fc-radius); box-shadow: none;
}
:where(.page:not(:has(.hac-hero))) .stat .v { font-family: var(--fc-mono); font-weight: 500; color: var(--fc-ink); font-variant-numeric: tabular-nums; }
:where(.page:not(:has(.hac-hero))) .stat .v .suf,
:where(.page:not(:has(.hac-hero))) .stat .l { color: var(--fc-ink3); }
:where(.page:not(:has(.hac-hero))) .stat .n { color: var(--fc-ink4); }

/* ---------- tables (ruled rows, mono numerals) ---------- */
:where(.page:not(:has(.hac-hero))) .tbl-wrap { background: var(--fc-paper); border: 1px solid var(--fc-rule); border-radius: var(--fc-radius); box-shadow: none; }
:where(.page:not(:has(.hac-hero))) .tbl th { color: var(--fc-ink3); border-bottom: 1px solid var(--fc-ink); }
:where(.page:not(:has(.hac-hero))) .tbl td { color: var(--fc-ink2); border-bottom-color: var(--fc-rule-soft); }
:where(.page:not(:has(.hac-hero))) .tbl td.num,
:where(.page:not(:has(.hac-hero))) .tbl th.num { font-family: var(--fc-mono); font-variant-numeric: tabular-nums; }
:where(.page:not(:has(.hac-hero))) .tbl-note { color: var(--fc-ink3); border-top-color: var(--fc-rule-soft); }

/* ---------- buttons (.btn -> the .hac-btn red / ghost pair) ---------- */
:where(.page:not(:has(.hac-hero))) .btn { border-radius: var(--fc-radius); font-weight: 600; }
:where(.page:not(:has(.hac-hero))) .btn:hover { transform: none; }
:where(.page:not(:has(.hac-hero))) .btn.primary { background: var(--fc-accent); color: var(--fc-on-accent); border-color: var(--fc-accent); box-shadow: none; }
:where(.page:not(:has(.hac-hero))) .btn.primary:hover {
  background: var(--fc-red-deep); background: color-mix(in srgb, var(--fc-accent) 84%, #000);
  border-color: transparent;
}
:where(.page:not(:has(.hac-hero))) .btn.ghost { background: transparent; color: var(--fc-ink); border-color: var(--fc-ink); }
:where(.page:not(:has(.hac-hero))) .btn.ghost:hover { background: var(--fc-ink); color: #fff; }
:where(.page:not(:has(.hac-hero))) .btn:focus-visible { outline: 2px solid var(--fc-accent-ink); outline-offset: 2px; }
/* LINE keeps LINE green on purpose (wiki.css): only the geometry follows the house */
:where(.page:not(:has(.hac-hero))) .btn.line { box-shadow: none; }

/* ---------- pills / chips / badges ---------- */
:where(.page:not(:has(.hac-hero))) .badge { border-radius: var(--fc-radius); background: var(--fc-mist); color: var(--fc-ink3); border: 1px solid var(--fc-rule-soft); }
:where(.page:not(:has(.hac-hero))) .badge.red { background: var(--fc-paper); color: var(--fc-accent-ink); border-color: var(--fc-accent); }
:where(.page:not(:has(.hac-hero))) .vid-tag { border-radius: var(--fc-radius); }
:where(.page:not(:has(.hac-hero))) .vid-tag.official { background: var(--fc-tint); color: var(--fc-red-deep); }
/* new primitive (WP0): <ul class="fc-chips"><li>…</li></ul>, the .hac-chips mono chip */
.fc-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.fc-chips li, .fc-chip {
  font: 500 11.5px var(--fc-mono); padding: 2px 8px; border: 1px solid var(--fc-accent); color: var(--fc-accent-ink);
  border-radius: 999px; white-space: nowrap; background: var(--fc-paper);
}

/* ---------- tabs / segmented controls (the .hac-seg look) ---------- */
:where(.page:not(:has(.hac-hero))) .pool-view { border-color: var(--fc-rule); border-radius: var(--fc-radius); }
:where(.page:not(:has(.hac-hero))) .pool-view button { color: var(--fc-ink3); }
:where(.page:not(:has(.hac-hero))) .pool-view button + button { border-left: 1px solid var(--fc-rule); }
:where(.page:not(:has(.hac-hero))) .pool-view button:hover { color: var(--fc-ink); background: var(--fc-mist); }
:where(.page:not(:has(.hac-hero))) .pool-view button.on { background: var(--fc-ink); color: #fff; }
:where(.page:not(:has(.hac-hero))) .sim-tab { border-radius: var(--fc-radius); }
:where(.page:not(:has(.hac-hero))) .sim-tab.active { background: var(--fc-accent); border-color: var(--fc-accent); color: var(--fc-on-accent); }
:where(.page:not(:has(.hac-hero))) .preset-row button.active { border-color: var(--fc-accent); background: var(--fc-accent-soft); }
/* new primitive (WP0): <div class="fc-seg" role="group"><button class="fc-seg-b on" aria-pressed="true">…</button>…</div> */
.fc-seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--fc-rule); border-radius: var(--fc-radius); background: var(--fc-paper); }
.fc-seg-b {
  appearance: none; border: 0; border-left: 1px solid var(--fc-rule); background: transparent; color: var(--fc-ink3);
  font: 600 12.5px/1.2 var(--fc-sans); min-height: 40px; padding: 0 14px; cursor: pointer;
}
.fc-seg-b:first-child { border-left: 0; }
.fc-seg-b:hover { color: var(--fc-ink); background: var(--fc-mist); }
.fc-seg-b.on, .fc-seg-b[aria-pressed="true"] { background: var(--fc-ink); color: #fff; }
.fc-seg-b:focus-visible { outline: 2px solid var(--fc-accent-ink); outline-offset: 2px; }

/* ---------- charts (bars --fc-bar, the one to look at in accent, mono axis) ---------- */
:where(.page:not(:has(.hac-hero))) .t10-row { border-color: var(--fc-rule); border-radius: var(--fc-radius); }
:where(.page:not(:has(.hac-hero))) .t10-row.hw { border-left: 3px solid var(--fc-accent); }
:where(.page:not(:has(.hac-hero))) .t10-rank { color: var(--fc-ink4); }
:where(.page:not(:has(.hac-hero))) .t10-row.hw .t10-rank { color: var(--fc-accent-ink); }
:where(.page:not(:has(.hac-hero))) .t10-bar-track { background: var(--fc-rule-soft); border-radius: 2px; }
:where(.page:not(:has(.hac-hero))) .t10-bar { background: var(--fc-bar); border-radius: 2px; }
:where(.page:not(:has(.hac-hero))) .t10-row.hw .t10-bar { background: var(--fc-accent); }

/* ---------- forms (.lead-blk contact capture) ---------- */
:where(.page:not(:has(.hac-hero))) .lead-field input,
:where(.page:not(:has(.hac-hero))) .lead-field textarea { border-radius: var(--fc-radius); border-color: var(--fc-rule); }
:where(.page:not(:has(.hac-hero))) .lead-field input:focus-visible,
:where(.page:not(:has(.hac-hero))) .lead-field textarea:focus-visible { outline-color: var(--fc-accent-ink); }
:where(.page:not(:has(.hac-hero))) .lead-field .req { color: var(--fc-red); }

/* ---------- banners / callouts / CTA block / quote ---------- */
:where(.page:not(:has(.hac-hero))) .callout.red {
  border-left: 3px solid var(--fc-accent); background: var(--fc-accent-soft); color: var(--fc-ink2);
  border-radius: 0 var(--fc-radius) var(--fc-radius) 0;
}
:where(.page:not(:has(.hac-hero))) .callout.red strong { color: var(--fc-accent-ink); }
:where(.page:not(:has(.hac-hero))) .cta-blk { border-radius: var(--fc-radius); border-top: 3px solid var(--fc-accent); }
:where(.page:not(:has(.hac-hero))) blockquote.quote { border-radius: var(--fc-radius); }

/* ---------- other ruled blocks ---------- */
:where(.page:not(:has(.hac-hero))) .compare .col { border-color: var(--fc-rule); border-radius: var(--fc-radius); }
:where(.page:not(:has(.hac-hero))) .compare .col.us { border-top: 3px solid var(--fc-accent); }
:where(.page:not(:has(.hac-hero))) .compare .col.them { border-top: 3px solid var(--fc-grey); }
:where(.page:not(:has(.hac-hero))) .faq .qa { border-color: var(--fc-rule); border-radius: var(--fc-radius); }
:where(.page:not(:has(.hac-hero))) .faq summary::marker { color: var(--fc-accent-ink); }
:where(.page:not(:has(.hac-hero))) .tl-step { border-radius: var(--fc-radius); background: var(--fc-ink); font-family: var(--fc-mono); font-weight: 500; }
:where(.page:not(:has(.hac-hero))) .tl-item::before { background: var(--fc-rule); }
:where(.page:not(:has(.hac-hero))) .link-row { border-color: var(--fc-rule); border-radius: var(--fc-radius); }
:where(.page:not(:has(.hac-hero))) .link-row:hover { box-shadow: none; background: var(--fc-mist); }
:where(.page:not(:has(.hac-hero))) .link-row .t { color: var(--fc-accent-ink); }
:where(.page:not(:has(.hac-hero))) .vid-card,
:where(.page:not(:has(.hac-hero))) .artifact-blk { border-color: var(--fc-rule); border-radius: var(--fc-radius); }
:where(.page:not(:has(.hac-hero))) figure.img img,
:where(.page:not(:has(.hac-hero))) .gallery img { border-radius: var(--fc-radius); }

/* ---------- data stamps (fixed, never themed: the state colours stay) ---------- */
:where(.page:not(:has(.hac-hero))) .feed-stamp { border-radius: var(--fc-radius); font-variant-numeric: tabular-nums; }
/* new primitive (WP0): a quiet mono data stamp, e.g. "as of 4 Nov 2026 · source PugEV" */
.fc-stamp { font: 500 11.5px/1.4 var(--fc-mono); color: var(--fc-ink3); letter-spacing: 0; font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  :where(.page:not(:has(.hac-hero))) .card, :where(.page:not(:has(.hac-hero))) .btn { transition: none; }
}
