/* BBS-074: approved charcoal base, loaded after the Figma page styles.
   Club, CTA, brand/link, state and focus colors remain in their existing rules. */
/* BBS-125: Figma案A の中立色（青みを抑えたダーク3段階）。クラブ色・状態色は各部品の既存規則を維持。 */
html[data-theme=dark] .ffb.figma-site {
  --ffb-bg:#101419;
  --ffb-surface:#171d25;
  --ffb-surface-2:#202833;
  --ffb-muted:#202833;
  --ffb-text:#f5f7fa;
  --ffb-text-2:#a8b4c3;
  --ffb-line:#344051;
  --ffb-line-strong:#8190a3;
  --ffb-link:#8fc5ff;
  --ffb-primary:#8fc5ff;
  --ffb-primary-hover:#b5d8ff;
  --ffb-primary-soft:#243952;
  --ffb-primary-line:#8190a3;
  --ffb-focus:#8fc5ff;
  --ffb-emblem-well:#f0f2f7;
  --figma-border:#344051;
  --figma-body:#dce2ea;
  --figma-muted:#a8b4c3;
}
html[data-theme=dark] .ffb.figma-site.figma-view-channel { --ffb-bg:#101419; }
html[data-theme=dark] .ffb.figma-site .figma-board {
  --board-text:#f5f7fa;
  --board-body:#dce2ea;
  --board-secondary:#dce2ea;
  --board-meta:#a8b4c3;
  --board-line:#344051;
  --board-rule:#344051;
  --board-panel:#0c1016;
  --board-reaction:#202833;
  --board-reaction-mobile:#202833;
  --board-reaction-mobile-text:#dce2ea;
  /* Existing --board-thread-line keeps the approved 60% metadata-color mix. */
}

/* Distinguish reading text from headings without changing type or spacing. */
html[data-theme=dark] .ffb.figma-site :is(.ffb-guide,.ffb-article__body,.ffb-post__body) { color:var(--figma-body); }
html[data-theme=dark] .ffb.figma-site .figma-board :is(.ffb-discussion-post__body,.ffb-basic-editor) { color:var(--board-body); }
html[data-theme=dark] .ffb.figma-site .figma-home-post__body { color:var(--figma-body)!important; }
html[data-theme=dark] .ffb.figma-site :is(.ffb-guide,.ffb-article__body) :is(h1,h2,h3,h4,h5,h6) { color:var(--ffb-text); }
html[data-theme=dark] .ffb.figma-site :is(.ffb-activity,.ffb-match-card__meta,.ffb-match-card__abbr) { color:var(--ffb-text-2); }
html[data-theme=dark] .ffb.figma-site .ffb-activity-dot { background:var(--ffb-text-2); }
html[data-theme=dark] .ffb.figma-site ::placeholder { color:var(--ffb-text-2); }

/* Neutral surfaces that the reference styles expressed as literal colors. */
html[data-theme=dark] .ffb.figma-site .figma-safety { border-bottom-color:var(--ffb-line); }
html[data-theme=dark] .ffb.figma-site .figma-empty-favorites { box-shadow:inset 0 -1px 0 var(--ffb-line); }
html[data-theme=dark] .ffb.figma-site .figma-empty-favorites .ffb-btn { background:var(--ffb-surface-2); }
html[data-theme=dark] .ffb.figma-site .ffb-rankings__periods { background:var(--ffb-bg); }
html[data-theme=dark] .ffb.figma-site :is(.ffb-guidelines-dialog,.ffb-guidelines-dialog__bar) { background:var(--ffb-surface);color:var(--figma-body); }
html[data-theme=dark] .ffb.figma-site .ffb-toast { background:var(--ffb-surface-2);color:var(--figma-body); }

/* Input boundaries are stronger than the decorative separators. */
html[data-theme=dark] .ffb.figma-site :where(input:not([type=submit]):not([type=button]):not([type=reset]):not([type=checkbox]):not([type=radio]):not([type=hidden]),textarea,select) { background-color:var(--ffb-surface-2); }
html[data-theme=dark] .ffb.figma-site :where(input:not([type=submit]):not([type=button]):not([type=reset]):not([type=checkbox]):not([type=radio]):not([type=hidden]),textarea,select):not([aria-invalid=true]) { border-color:var(--ffb-line-strong); }
html[data-theme=dark] .ffb.figma-site :is(.figma-club-search,.ffb-header__search-link) { border-color:var(--ffb-line-strong); }
html[data-theme=dark] .ffb.figma-site .ffb-chip:not([aria-pressed=true]):not([aria-current]) { border-color:var(--ffb-line-strong); }
html[data-theme=dark] .ffb.figma-site .ffb-chip[aria-current=page] { background:var(--ffb-surface-2);border-color:var(--ffb-link);color:var(--ffb-link); }
html[data-theme=dark] .ffb.figma-site .figma-board :is(.ffb-favorite:not([aria-pressed=true]),.ffb-composer--dock,.ffb-format-link input:not([aria-invalid=true])) { border-color:var(--ffb-line-strong); }
html[data-theme=dark] .ffb.figma-site .figma-board .ffb-composer--dock { background:var(--ffb-surface-2); }
html[data-theme=dark] .ffb.figma-site .ffb-rankings__club::after { border-color:var(--ffb-line-strong);background:var(--ffb-surface-2); }
html[data-theme=dark] .ffb.figma-site .ffb-rankings__filters .ffb-select { background-color:transparent; }
html[data-theme=dark] .ffb.figma-site .ffb-discussion-reply:hover { background:var(--ffb-surface-2); }

/* These native sidebar labels are text artwork, not the colored nav icons. */
html[data-theme=dark] .ffb.figma-site .figma-native-label>img.figma-icon--dark { filter:brightness(0) invert(83.9215686%); }
html[data-theme=dark] .ffb.figma-site [aria-current] .figma-native-label>img.figma-icon--dark { filter:brightness(0) invert(94.9019608%); }
@media(max-width:1099px) {
  html[data-theme=dark] .ffb.figma-site .ffb-chip[aria-current=page] { background:transparent; }
}
@media(min-width:1100px) {
  html[data-theme=dark] .ffb.figma-site .ffb-header__search-link { background:var(--ffb-bg); }
  html[data-theme=dark] .ffb.figma-site.figma-view-channels .ffb-account__register { border-color:var(--ffb-line-strong);color:var(--ffb-text); }
  html[data-theme=dark] .ffb.figma-site:is(.figma-view-article,.figma-view-rankings) .ffb-account__register { background:var(--ffb-surface-2);border-color:var(--ffb-line-strong);color:var(--ffb-text); }
}
