/* Shared navigation and brand tokens. Product-specific data, warning and chart colours
   remain with the tool that defines their meaning. */
:root {
  --wg-green: #ff5342;
  --wg-ink: #f7f1f4;
  --wg-canvas: #101014;
  --wg-paper: #1c191e;
  --wg-line: #443a42;
  --wg-focus: #ff826f;
  --wg-mint: #ff8c7c;
  --wg-font: "DM Sans", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --wg-nav-height: 48px;
}

.wg-family-nav {
  position: relative;
  inset: auto;
  z-index: 2;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-sizing: border-box;
  width: 100%;
  min-height: var(--wg-nav-height);
  padding: 0 clamp(16px, 4vw, 64px);
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--wg-line);
  border-radius: 0;
  background: var(--wg-paper);
  color: var(--wg-ink);
  font: 600 14px/1.4 var(--wg-font);
  letter-spacing: normal;
  text-align: left;
}
.wg-family-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--wg-ink);
  font: inherit;
  text-decoration: none;
  white-space: nowrap;
}
.wg-family-nav .wg-family-brand {
  font-weight: 750;
}
.wg-family-nav .wg-family-brand img {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
}
.wg-family-nav .wg-family-directory {
  color: var(--wg-green);
}
.wg-family-nav a:hover {
  color: var(--wg-green);
  text-decoration: underline;
  text-underline-offset: 4px;
}
body[data-wg-product] :is(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--wg-focus);
  outline-offset: 3px;
}
body[data-wg-product] {
  font-family: var(--wg-font);
}
body[data-wg-product] :where(button, input, textarea, select) {
  font-family: inherit;
  accent-color: var(--wg-green);
}

/* Catalogues on light surfaces. */
body:is([data-wg-product="ai-chain"], [data-wg-product="ai-tools"]) {
  --ink: var(--wg-ink);
  --paper: var(--wg-canvas);
  --acid: var(--wg-green);
  --acid-soft: #ff8c7c;
  --acid-dim: #ff52651c;
  --line: #443a42;
  background: var(--wg-canvas);
}
body:is([data-wg-product="ai-chain"], [data-wg-product="ai-tools"]) :is(.tool, .panel, .company-card) {
  background-color: var(--wg-paper);
  border-color: var(--wg-line);
}
body[data-wg-product="zi-yong-ranking"] {
  --paper: var(--wg-canvas);
  --ink: var(--wg-ink);
  --coral: var(--wg-green);
  --coral-dark: #b42337;
}
body[data-wg-product="zi-yong-ranking"] .ranking-panel { background-color: #201b20; }
body[data-wg-product="zi-yong-ranking"] .composer-cta { border-color: var(--wg-line); }

/* Paired dark/light themes keep their existing user switch. */
body:is([data-wg-product="topic-picker"], [data-wg-product="prompts-site"]) {
  --bg: #111014;
  --panel: #1d191e;
  --panel-2: #2b2329;
  --border: #493c45;
  --text: #f4eff2;
  --muted: #c2b6c0;
  --accent: var(--wg-mint);
  --accent-2: #ffadb5;
  --brand-gradient: linear-gradient(135deg, #6b2334, #ff5342);
}
body:is([data-wg-product="topic-picker"], [data-wg-product="prompts-site"]):not(.theme-light) { background: var(--bg); }
body:is([data-wg-product="topic-picker"], [data-wg-product="prompts-site"]).theme-light {
  --bg: var(--wg-canvas);
  --panel: var(--wg-paper);
  --panel-2: #ededed;
  --border: var(--wg-line);
  --text: var(--wg-ink);
  --muted: #bfb2bb;
  --accent: var(--wg-green);
  --accent-2: #616161;
  background: var(--bg);
}
body[data-wg-product="inspiration-library"] { --gold: #ff7966; --gold-soft: #f5adb5; --gold-deep: #c55566; }
body[data-wg-product="inspiration-library"].theme-light { --gold: var(--wg-green); --gold-soft: #676767; --gold-deep: #565656; }
body:is([data-wg-product="creator-coach"], [data-wg-product="monetization-map"]) {
  --font: var(--wg-font);
  --bg: #111014;
  --surface: #1a171c;
  --surface-2: #211c23;
  --surface-3: #2d252b;
  --green: #ff826f;
  --green-soft: #ff69791c;
}
body[data-wg-product="h3-prompt-lab"] { --bg: #111014; --panel: #211b22; --surface: #2a222a; --line: #493c45; }
body[data-wg-product="h3-prompt-lab"] button.primary { background: var(--wg-mint); border-color: var(--wg-mint); color: #20090d; }
body[data-wg-product="h3-prompt-lab"] button.primary:hover { background: #ffb0b7; }
body:is([data-wg-product="project-versions"], [data-wg-product="token-plan"], [data-wg-product="comment-tracker"]) {
  --bg: #100f13;
  --bg2: #1b181d;
  --bg3: #30262d;
  --card: #211c22;
  --surface: #211c22;
  --bg-primary: #100f13;
  --bg-secondary: #1b181d;
  --bg-card: #211c22;
  --bg-card-hover: #31252d;
  --border: #443842;
  --accent: #ff826f;
  --accent2: #ffb6bf;
  --text-muted: #c2b7c0;
  --gradient-1: linear-gradient(115deg, #ff5342, #7c263c);
}
body:is([data-wg-product="project-versions"], [data-wg-product="token-plan"], [data-wg-product="comment-tracker"]) :is(.header h1, header h1) {
  background: none;
  color: #fff5f7;
  -webkit-text-fill-color: currentColor;
}
body[data-wg-product="token-plan"] :is(.filter-btn.active, .visit-btn:hover, .refresh-btn:hover, .refresh-toast) {
  color: #22090f;
}

/* Assessments keep individual answer, result and report semantics. */
body:is([data-wg-product="smti-v2"], [data-wg-product="smti-work"], [data-wg-product="wange-welcome"]) {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 0;
  padding: 0;
  background: var(--wg-canvas);
  color: var(--wg-ink);
}
body:is([data-wg-product="smti-v2"], [data-wg-product="smti-work"], [data-wg-product="wange-welcome"]) > .container {
  width: min(100% - 32px, 480px);
  box-sizing: border-box;
  margin: clamp(24px, 6vh, 60px) auto;
  background: var(--wg-paper);
  box-shadow: 0 8px 32px #26262612;
}
body:is([data-wg-product="smti-v2"], [data-wg-product="smti-work"]) .header { background: var(--wg-green); }
body:is([data-wg-product="smti-v2"], [data-wg-product="smti-work"]) :is(.start-btn, .restart-btn, .progress-fill) { background: var(--wg-green); color: white; }
body:is([data-wg-product="smti-v2"], [data-wg-product="smti-work"]) .option:is(:hover, .selected) { background: #39242d; border-color: var(--wg-green); color: var(--wg-ink); }
@media screen {
  body:is([data-wg-product="career-test"], [data-wg-product="career-portrait"]) .gate-main { min-height: calc(100svh - var(--wg-nav-height)); background: var(--wg-canvas); }
  body:is([data-wg-product="career-test"], [data-wg-product="career-portrait"]) .gate-card {
    background: var(--wg-paper);
    border: 1px solid var(--wg-line);
    color: var(--wg-ink);
    box-shadow: 0 10px 40px #26262610;
  }
  body:is([data-wg-product="career-test"], [data-wg-product="career-portrait"]) .gate-card :is(h1, input:not([type="checkbox"])) {
    color: var(--wg-ink);
    -webkit-text-fill-color: var(--wg-ink);
    background: transparent;
  }
  body:is([data-wg-product="career-test"], [data-wg-product="career-portrait"]) .gate-card :is(p:not([role="alert"]), label) { color: #c4b9c0; }
  body:is([data-wg-product="career-test"], [data-wg-product="career-portrait"]) .gate-card .gate-note { color: #bbadb7 !important; }
  body:is([data-wg-product="career-test"], [data-wg-product="career-portrait"]) :is(.gate-star, .access-row button, .button:not(.secondary)) {
    color: white;
    background: var(--wg-green);
    border-color: var(--wg-green);
  }
  body:is([data-wg-product="career-test"], [data-wg-product="career-portrait"]) .access-row input { border-color: #725d6b; }
  body:is([data-wg-product="career-test"], [data-wg-product="career-portrait"]) #access-error { color: #ffb69e; }
}

/* Directory support pages. */
body[data-wg-product="legal"] { --bg: var(--wg-canvas); --ink: var(--wg-ink); --line: var(--wg-line); --accent: var(--wg-green); }
body[data-wg-product="wange-feedback"] { padding: 0; background: var(--wg-canvas); }
body[data-wg-product="wange-feedback"] > .container { width: min(100% - 32px, 600px); margin: 36px auto; }
body[data-wg-product="wange-feedback"] .submit-btn { background: var(--wg-green); }
body[data-wg-product="wange-dashboard"] { background: var(--wg-canvas); }
body[data-wg-product="wange-dashboard"] .logo, body[data-wg-product="wange-dashboard"] .nav-item.active { color: var(--wg-green); }
body[data-wg-product="wange-dashboard"] .nav-item.active { background: #37232b; }
body[data-wg-product="wange-welcome"] .container { padding: clamp(36px, 7vw, 80px) 20px; }
body[data-wg-product="wange-welcome"] .container::before,
body[data-wg-product="wange-welcome"] :is(.logo, .divider, .dot) { background: var(--wg-green); }
body[data-wg-product="wange-welcome"] .brand-mark span { color: var(--wg-green); }
body[data-wg-product="placeholder"] { justify-content: flex-start; padding: 0; background: var(--wg-canvas); color: var(--wg-ink); overflow: auto; }
body[data-wg-product="placeholder"] .bg-glow { display: none; }
body[data-wg-product="placeholder"] .icon { margin-top: clamp(36px, 16vh, 170px); }
body[data-wg-product="placeholder"] .status { color: #bfb2bb; }
body[data-wg-product="placeholder"] .status span { background: var(--wg-green); }
body[data-wg-product="placeholder"] .back { border-color: var(--wg-line); background: var(--wg-paper); color: var(--wg-green); }
body[data-wg-product="placeholder"] .back:hover { border-color: var(--wg-green); }

/* Fixed sidebars start below the shared row, with their scroll region preserved. */
@media (min-width: 901px) {
  body[data-wg-product="creator-coach"] > .wg-family-nav { position: sticky; top: 0; z-index: 45; }
  body[data-wg-product="creator-coach"] .sidebar { top: var(--wg-nav-height); max-height: calc(100dvh - var(--wg-nav-height)); overflow-y: auto; }
}
@media (min-width: 769px) {
  body[data-wg-product="wange-dashboard"] > .wg-family-nav { position: sticky; top: 0; z-index: 45; }
  body[data-wg-product="wange-dashboard"] .sidebar { top: var(--wg-nav-height); }
}
@media print {
  .wg-family-nav { display: none; }
}

/* Dark shells use rose for interaction. A saved reading-mode preference remains available. */
.wg-family-nav { border-top: 2px solid #cd2b22; }
body[data-wg-product] { color-scheme: dark; }
body[data-wg-product].theme-light {
  color-scheme: light;
  --wg-canvas:#fff8f9; --wg-paper:#fff; --wg-ink:#261b23;
  --wg-green:#a71f38; --wg-line:#ddcdd4;
}
body:is([data-wg-product="topic-picker"],[data-wg-product="prompts-site"]).theme-light {
  --text:#261b23; --muted:#614f5a; --accent-2:#981d38; --panel-2:#f6e9ee;
}
body:is([data-wg-product="ai-chain"],[data-wg-product="ai-tools"],[data-wg-product="zi-yong-ranking"]) {
  color: var(--wg-ink); --ink-soft:#e9dfe6; --muted:#c7bdc4; --faint:#ab9aa6; --paper-dim:#d3c5cf; --line-strong:#63525e;
}
body:is([data-wg-product="ai-chain"],[data-wg-product="ai-tools"],[data-wg-product="zi-yong-ranking"]) :is(.hero,.topbar,.header,.search-box,.filter-bar,.company-card,.tool,.ranking-panel,.post-card,.sidebar,.panel) {
  background-color:#1c191e; color:#f5eff2; border-color:#443a42;
}
body:is([data-wg-product="career-test"],[data-wg-product="career-portrait"]) :is(.gate-star,.access-row button,.button:not(.secondary)),
body:is([data-wg-product="smti-v2"],[data-wg-product="smti-work"]) :is(.header,.start-btn,.restart-btn,.progress-fill) {background:#a9201c;color:white;}
body:is([data-wg-product="smti-v2"],[data-wg-product="smti-work"]) :is(.question,.question-text,.option,.result-card,.content,.welcome) {
  color:#f6f0f3; background-color:#201c22; border-color:#52424d;
}
body:is([data-wg-product="smti-v2"],[data-wg-product="smti-work"]) :is(.subtitle,.intro p,.description) {color:#c6b9c2;}
body[data-wg-product="legal"] {color:#f5eff2;background:#101014;}
body[data-wg-product="legal"] :is(main,article) {background:#1d191e;color:#f5eff2;}
body[data-wg-product="legal"] :is(p,li) {color:#c5b9c2;}
body[data-wg-product="placeholder"] :is(h1,h2,p) {color:#f6eff3;}

body[data-wg-product="legal"] .card,
body[data-wg-product="wange-feedback"] .form-card { background:#1e1a1f; color:#f6f1f4; border-color:#483c45; }
body[data-wg-product="legal"] .notice { background:#30242a; color:#e6dbe1; border-color:#79565e; }
body[data-wg-product="wange-feedback"] :is(input,select,textarea,.rating-btn) { background:#141215; color:#f7f1f5; border-color:#67545e; }
body[data-wg-product="wange-feedback"] :is(h1,h2,label) {color:#f5eff3;}
body[data-wg-product="wange-feedback"] :is(.header p,.contact-info,.form-group p) {color:#c9b9c3;}
body[data-wg-product="creator-coach"] :is(.focus-card,.sidebar,.mobile-header) {background:#1b191c;border-color:#423940;}
body[data-wg-product="creator-coach"] :is(.ambient-one,.ambient-two) {display:none;}
body[data-wg-product="placeholder"] .icon {background:#281e23;}

/* Keep brand controls in the same red family as the marketplace. */
:root {
  --wg-green: #ff5342;
  --wg-mint: #ff8c7c;
  --wg-focus: #ff826f;
}
body[data-wg-product="inspiration-library"].theme-light {
  --gold-soft: #a32c45;
  --gold-deep: #821e34;
}
body[data-wg-product="inspiration-library"] .dot { background-color: #ff5342; }
body[data-wg-product="creator-coach"] :is(.sidebar-insight, .focus-badge) {
  border-color: #ff53424d;
}
body[data-wg-product="creator-coach"] :is(.nav-item, .topbar-date, .quiet-button) {
  color: #c2b7c0;
}
body[data-wg-product="monetization-map"] .map-node.money-node:not(.available):not(.selected):not(.passed) {
  border-color: #ff53424d;
}
body[data-wg-product="zi-yong-ranking"] :is(.verified-badge, .rank-score) { color: #ff8c7c; }
body[data-wg-product="zi-yong-ranking"] .daily-prompt {
  background-color: #302522;
  border-color: #75483f;
}
body:is([data-wg-product="smti-v2"], [data-wg-product="smti-work"]) .invite-btn {
  background: #2a2321;
  color: #ff8c7c;
  border-color: #75483f;
}

/* Shared black navigation and pure-red interaction. */
:root {
  --wg-green: #f00;
  --wg-mint: #f00;
  --wg-focus: #f00;
  --wg-canvas: #000;
  --wg-paper: #141414;
  --wg-ink: #f5f5f5;
  --wg-line: #363636;
}
.wg-family-nav { background: #000; border-top: 0; }
body[data-wg-product].theme-light .wg-family-nav { background: #fff; }
body[data-wg-product]:not(.theme-light) :is(.gate-card,.form-card) { border-radius: 4px; }
body[data-wg-product="h3-prompt-lab"] button.primary,
body[data-wg-product="wange-feedback"] .submit-btn,
body:is([data-wg-product="career-test"],[data-wg-product="career-portrait"]) :is(.gate-star,.access-row button,.button:not(.secondary)),
body:is([data-wg-product="smti-v2"],[data-wg-product="smti-work"]) :is(.header,.start-btn,.restart-btn,.progress-fill) {
  background: #f00;
  color: #000;
  border-color: #f00;
}
body[data-wg-product="h3-prompt-lab"] button.primary:hover { background: #f00; box-shadow: inset 0 0 0 2px #000; }
body[data-wg-product="legal"], body[data-wg-product="creator-coach"],
body[data-wg-product="monetization-map"], body[data-wg-product="h3-prompt-lab"],
body:is([data-wg-product="topic-picker"],[data-wg-product="prompts-site"]):not(.theme-light) {
  --bg: #000; --panel: #141414; --surface: #141414; --surface-2: #1b1b1b; --surface-3: #222;
}
