/* RISCON Labs — CREDIT-HARVEST & HALLUC-GATE Field Skin
 * Based on risconlabs.com Field skin + Riscon-AI/riscon-guidelines@85a4bfc
 * Strict compliance:
 *   - 0% text under 12px
 *   - 0% WCAG AA contrast failure (all text >= 4.5:1, zero text opacity < 1)
 *   - <= 7 distinct font sizes (48/32, 28, 24, 21, 17, 14, 12)
 *   - Pretendard Variable single sans axis; monospace only on .mono-code (IDs, hashes, JSONL)
 *   - WSTiger Navy (#0b1527) signature on pills, primary buttons, and dark surfaces
 */
@import url("/styles/tokens.css");
@import url("/styles/bundle.css");

:root {
  color-scheme: light;
  --fx-ground: #e8e8e6;
  --fx-ink: #121315;
  --fx-ink-2: #262930;
  --fx-mute: #454952;
  --fx-line: rgba(18, 19, 21, 0.14);
  --fx-line-2: rgba(18, 19, 21, 0.26);
  --fx-dot: #121315;
  --fx-navy: #0b1527;
  --fx-accent: #1f3196;
  --fx-accent-ink: #162470;
  --fx-accent-soft: #dce2f9;
  --fx-on-accent: #ffffff;
  --fx-glass: rgba(11, 21, 39, 0.94);
  --fx-glass-ink: #fafbfd;
  --fx-glass-mute: #c8d0e0;
  --fx-glass-line: rgba(255, 255, 255, 0.16);
  --fx-glass-hi: rgba(255, 255, 255, 0.16);
  --fx-panel: #f7f7f5;
  --fx-panel-alt: #ffffff;
  --fx-panel-line: rgba(18, 19, 21, 0.12);
  --fx-card-ink: #0b1527;
  --fx-card-ink-fg: #f5f7fa;
  --fx-card-ink-mute: #c2cadb;
  --fx-card-paper: #ffffff;
  --fx-card-paper-fg: #121315;
  --fx-veil: rgba(232, 232, 230, 0.92);
  --fx-shadow: 0 12px 40px rgba(11, 21, 39, 0.12);

  --fx-sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --fx-ko: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --fx-mono: "Geist Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --fx-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --fx-gutter: clamp(16px, 4vw, 40px);
  --fx-max: 1180px;
  --fx-r-card: 18px;
  --fx-r-panel: 22px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --fx-ground: #0b1527;
  --fx-ink: #ededed;
  --fx-ink-2: #d0d5e0;
  --fx-mute: #9ea6b8;
  --fx-line: rgba(236, 236, 234, 0.14);
  --fx-line-2: rgba(236, 236, 234, 0.28);
  --fx-dot: #e8ebf3;
  --fx-navy: #0b1527;
  --fx-accent: #8ca2ff;
  --fx-accent-ink: #d6dfff;
  --fx-accent-soft: #1b2a4a;
  --fx-on-accent: #0b1527;
  --fx-glass: rgba(14, 24, 44, 0.94);
  --fx-glass-ink: #fafbfd;
  --fx-glass-mute: #c8d0e0;
  --fx-glass-line: rgba(255, 255, 255, 0.16);
  --fx-glass-hi: rgba(255, 255, 255, 0.16);
  --fx-panel: #101d33;
  --fx-panel-alt: #15243f;
  --fx-panel-line: rgba(236, 236, 234, 0.14);
  --fx-card-ink: #15243f;
  --fx-card-ink-fg: #f5f7fa;
  --fx-card-ink-mute: #c2cadb;
  --fx-card-paper: #f4f4f2;
  --fx-card-paper-fg: #121315;
  --fx-veil: rgba(11, 21, 39, 0.92);
  --fx-shadow: 0 12px 40px rgba(0, 0, 0, 0.42);
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--fx-ground);
  color: var(--fx-ink);
  font-family: var(--fx-sans);
  font-size: 17px;
  font-weight: 400;
  line-height: 27px;
  letter-spacing: 0;
  word-break: keep-all;
  overflow-wrap: break-word;
  font-kerning: normal;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color 0.3s var(--fx-ease), color 0.3s var(--fx-ease);
}
html:not([data-lang="ko"]) .ko-only { display: none !important; }
html[data-lang="ko"] .en-only { display: none !important; }
:is(em, i, cite, address) { font-style: normal; }
:is(strong, b) { font-weight: 600; }
a, .kt a { color: inherit; text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
img, svg { display: block; }
button, input, select, textarea { font-family: var(--fx-sans); font-size: 14px; line-height: 22px; color: inherit; }
::selection { background: var(--fx-accent); color: var(--fx-on-accent); }
:focus-visible { outline: 2px solid var(--fx-accent); outline-offset: 3px; border-radius: 6px; }
.fx-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fx-skip { position: fixed; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: 999px; background: var(--fx-navy); color: #ffffff; text-decoration: none; font-size: 14px; font-weight: 600; }
.fx-skip:focus { top: 12px; }

/* Monospace strictly for code, field IDs, hashes, receipts */
.mono-code {
  font-family: var(--fx-mono);
  font-size: 12px;
  line-height: 17px;
  font-weight: 400;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------------------ field & WebGL cosmos (scoped to .fx-hero) */
.fx-field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
  pointer-events: auto;
  touch-action: pan-y;
  cursor: grab;
}
.fx-field.is-dragging { cursor: grabbing; }
.fx-field.is-pointing { cursor: pointer; }
.fx-page--home .fx-main { pointer-events: auto; }
.fx-cosmos { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; visibility: hidden; }
.fx-passage { display: none; }

.fx-main, .fx-foot { position: relative; z-index: 1; }

/* ------------------------------------------------------------------ rim: white-hole / black-hole navy glow */
@property --fx-rim-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.fx-rim {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  --rim-hot: 11, 21, 39;
  --rim-cool: 31, 49, 150;
  --rim-a1: 0.12;
  --rim-a2: 0.44;
  --rim-c1: 0.28;
  --rim-c2: 0.14;
  background:
    conic-gradient(from var(--fx-rim-a) at 50% 50%, rgba(var(--rim-hot), 0) 0deg, rgba(var(--rim-hot), var(--rim-c1)) 70deg, rgba(var(--rim-hot), 0) 150deg, rgba(var(--rim-cool), 0) 190deg, rgba(var(--rim-cool), var(--rim-c2)) 250deg, rgba(var(--rim-cool), 0) 320deg),
    radial-gradient(ellipse at 50% 50%, rgba(var(--rim-hot), 0) 54%, rgba(var(--rim-hot), var(--rim-a1)) 76%, rgba(var(--rim-hot), var(--rim-a2)) 100%);
  -webkit-mask: radial-gradient(ellipse at 50% 50%, transparent 54%, #000 94%);
  mask: radial-gradient(ellipse at 50% 50%, transparent 54%, #000 94%);
  animation: fx-rim-turn 90s linear infinite;
}
:root[data-theme="dark"] .fx-rim {
  --rim-hot: 30, 54, 150;
  --rim-cool: 70, 96, 220;
  --rim-a1: 0.12;
  --rim-a2: 0.48;
  --rim-c1: 0.38;
  --rim-c2: 0.20;
  mix-blend-mode: screen;
}
@keyframes fx-rim-turn { to { --fx-rim-a: 360deg; } }
.fx-core {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 48%, rgba(255, 255, 255, 0.58) 0%, rgba(255, 255, 255, 0.24) 32%, rgba(255, 255, 255, 0) 62%);
}
:root[data-theme="dark"] .fx-core { display: none; }

/* ------------------------------------------------------------------ top bar */
.fx-top {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px var(--fx-gutter);
  pointer-events: none;
}
.fx-top > * { pointer-events: auto; }
.fx-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: var(--fx-ink);
  background: var(--fx-panel);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--fx-panel-line);
}
.fx-brand svg { width: 18px; height: 18px; flex: none; }
.fx-lang {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  line-height: 17px;
  font-weight: 600;
  background: var(--fx-panel);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--fx-panel-line);
}
.fx-lang button {
  appearance: none;
  border: 0;
  background: none;
  color: var(--fx-mute);
  padding: 4px 6px;
  font-size: 12px;
  line-height: 17px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.fx-lang button[aria-pressed="true"] { color: var(--fx-ink); text-decoration: underline; }
.fx-lang span { color: var(--fx-mute); }

/* ------------------------------------------------------------------ glass pill (prompt / nav) */
.fx-pill {
  display: grid;
  grid-template-rows: auto 0fr;
  background: var(--fx-glass);
  color: var(--fx-glass-ink);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  backdrop-filter: blur(18px) saturate(1.25);
  border: 1px solid var(--fx-glass-line);
  border-radius: 28px;
  box-shadow: var(--fx-shadow);
  overflow: hidden;
  transition: grid-template-rows 0.34s var(--fx-ease), border-radius 0.34s var(--fx-ease), opacity 0.3s var(--fx-ease), transform 0.3s var(--fx-ease);
}
.fx-pill.is-open { grid-template-rows: auto 1fr; border-radius: 22px; }
.fx-pill-row { display: flex; align-items: center; gap: 4px; min-height: 50px; padding: 5px 6px 5px 18px; min-width: 0; }
.fx-pill-panel { min-height: 0; overflow: hidden; }
.fx-pill-panel-inner { padding: 6px 18px 18px; border-top: 1px solid var(--fx-glass-line); }
.fx-more {
  appearance: none;
  margin-left: auto;
  flex: none;
  width: 40px; height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--fx-glass-hi);
  color: var(--fx-glass-ink);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.fx-more svg { width: 16px; height: 16px; }
.fx-pill.is-open .fx-more { transform: rotate(90deg); }

.fx-menu-links { display: grid; padding: 8px 0 10px; }
.fx-menu-links a {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 9px 2px;
  text-decoration: none;
  font-size: 21px;
  line-height: 32px;
  font-weight: 600;
  color: var(--fx-glass-mute);
  border-bottom: 1px solid var(--fx-glass-line);
}
.fx-menu-links a small {
  font-size: 12px;
  line-height: 17px;
  font-weight: 600;
  color: var(--fx-glass-mute);
}
.fx-menu-links a:hover, .fx-menu-links a[aria-current="page"] { color: var(--fx-glass-ink); }
.fx-menu-labs { display: grid; width: 0; min-width: 100%; padding: 2px 0 4px; }
.fx-menu-labs a { display: grid; gap: 5px; padding: 11px 2px 12px; text-decoration: none; color: var(--fx-glass-mute); border-bottom: 1px solid var(--fx-glass-line); }
.fx-menu-lab-name { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; line-height: 22px; font-weight: 600; color: var(--fx-glass-ink); }
.fx-menu-lab-name svg { width: 14px; height: 14px; flex: none; }
.fx-menu-lab-note { font-size: 12px; line-height: 17px; font-weight: 400; color: var(--fx-glass-mute); }
.fx-settings { display: grid; gap: 8px; padding-top: 12px; }
.fx-setting { display: flex; align-items: center; gap: 10px; }
.fx-setting-name { flex: 0 0 76px; font-size: 12px; line-height: 17px; font-weight: 600; color: var(--fx-glass-mute); }
.fx-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: rgba(0, 0, 0, 0.28); }
.fx-seg button { appearance: none; border: 0; background: none; color: var(--fx-glass-mute); height: 30px; padding: 0 12px; border-radius: 999px; font-size: 12px; line-height: 17px; font-weight: 600; cursor: pointer; }
.fx-seg button[aria-pressed="true"] { background: var(--fx-glass-ink); color: #0b1527; }

/* Top navigation pill */
.fx-navpill {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 45;
  width: max-content;
  max-width: calc(100vw - 2 * var(--fx-gutter));
}
.fx-navpill .fx-pill-row { padding-left: 8px; min-height: 46px; }
.fx-navlinks { display: flex; align-items: center; gap: 2px; min-width: 0; }
.fx-navlinks a {
  padding: 8px 12px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: var(--fx-glass-mute);
  white-space: nowrap;
}
.fx-navlinks a:hover { color: var(--fx-glass-ink); }
.fx-navlinks a[aria-current="page"] { color: var(--fx-glass-ink); background: var(--fx-glass-hi); }
.fx-navcurrent { display: none; padding: 0 8px; font-size: 14px; line-height: 20px; font-weight: 600; white-space: nowrap; }
.fx-navpill .fx-more { width: 36px; height: 36px; }
.fx-navpill .fx-pill-panel-inner { min-width: min(360px, calc(100vw - 2 * var(--fx-gutter))); }
.fx-navpill .fx-menu-links { display: none; }
.fx-page--home.fx-hero-in .fx-navpill { opacity: 0; pointer-events: none; transform: translate(-50%, -10px); }

/* ------------------------------------------------------------------ home hero */
.fx-hero {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: minmax(0, 1fr);
  padding: 86px var(--fx-gutter) 26px;
  pointer-events: none;
  border-bottom: 1px solid var(--fx-line);
}
.fx-hero-top {
  position: relative;
  z-index: 2;
  pointer-events: auto;
  justify-self: start;
  max-width: min(50rem, 100%);
  background: var(--fx-panel);
  padding: 18px 22px;
  border-radius: var(--fx-r-card);
  border: 1px solid var(--fx-panel-line);
  box-shadow: var(--fx-shadow);
}
.fx-eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 17px;
  font-weight: 600;
  color: var(--fx-mute);
}
.fx-statement {
  margin: 0;
  font-size: 48px;
  line-height: 57px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--fx-ink);
}
.fx-statement .fx-quiet { color: var(--fx-mute); }
.fx-hero-note {
  margin: 12px 0 0;
  max-width: 42em;
  font-size: 17px;
  line-height: 27px;
  font-weight: 400;
  color: var(--fx-ink-2);
}

.fx-hero-center {
  position: relative;
  z-index: 2;
  align-self: start;
  margin-top: 18px;
  justify-self: center;
  width: min(860px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}
.fx-prompt, .fx-chips { pointer-events: auto; }
.fx-prompt { width: min(680px, 100%); }
.fx-prompt .fx-pill-row { min-height: 56px; padding-left: 20px; }
.fx-prompt-lead {
  color: var(--fx-glass-mute);
  font-size: 14px;
  line-height: 22px;
  font-weight: 400;
  white-space: nowrap;
  flex: none;
}
.fx-topic {
  appearance: none;
  border: 0;
  background: none;
  padding: 6px 6px;
  margin: 0 2px;
  min-width: 0;
  flex: 0 1 auto;
  cursor: pointer;
  color: var(--fx-glass-ink);
  font-size: 14px;
  line-height: 22px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 8px;
}
.fx-topic > span {
  display: inline-block;
  border-bottom: 1px solid var(--fx-glass-ink);
}

.fx-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  max-width: 820px;
}
.fx-chip {
  appearance: none;
  border: 1px solid rgba(22, 36, 112, 0.22);
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--fx-accent-soft);
  color: var(--fx-accent-ink);
  font-size: 12px;
  line-height: 17px;
  font-weight: 600;
  transition: background-color 0.2s var(--fx-ease), color 0.2s var(--fx-ease);
}
.fx-chip:hover { background: var(--fx-accent); color: var(--fx-on-accent); }
.fx-chip[aria-pressed="true"] { background: var(--fx-navy); color: #ffffff; border-color: transparent; }

.fx-hero-bottom {
  position: relative;
  z-index: 2;
  pointer-events: auto;
  margin-top: 76px;
  justify-self: center;
  width: min(640px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.fx-card {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 16px;
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--fx-glass);
  color: var(--fx-glass-ink);
  border: 1px solid var(--fx-glass-line);
  box-shadow: var(--fx-shadow);
}
.fx-card-body { min-width: 0; }
.fx-card-meta {
  margin: 0 0 4px;
  font-size: 12px;
  line-height: 17px;
  font-weight: 600;
  color: var(--fx-glass-mute);
}
.fx-card-text {
  margin: 0;
  font-size: 14px;
  line-height: 22px;
  font-weight: 400;
  color: var(--fx-glass-ink);
}
.fx-card-link, .kt a.fx-card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--fx-glass-ink);
  color: #0b1527;
  text-decoration: none;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  white-space: nowrap;
}
.fx-card-link svg { width: 12px; height: 12px; }
.fx-modes { display: flex; gap: 8px; }
.fx-mode {
  appearance: none;
  border: 1px solid var(--fx-glass-line);
  cursor: pointer;
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--fx-glass);
  color: var(--fx-glass-ink);
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
}
.fx-mode[aria-pressed="true"] { background: var(--fx-accent); color: var(--fx-on-accent); border-color: transparent; }
.fx-cue {
  position: absolute;
  z-index: 2;
  pointer-events: auto;
  left: var(--fx-gutter);
  bottom: 28px;
  font-size: 12px;
  line-height: 17px;
  font-weight: 600;
  color: var(--fx-ink);
  background: var(--fx-panel);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--fx-panel-line);
  text-decoration: none;
}

/* ------------------------------------------------------------------ index overlay */
.fx-index {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
  padding: 22px 0;
  background: var(--fx-veil);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--fx-ease), visibility 0s linear 0.3s;
}
.fx-index.is-open { opacity: 1; visibility: visible; transition: opacity 0.3s var(--fx-ease); }
.fx-index-head { padding: 0 var(--fx-gutter); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.fx-index-title { margin: 0; font-size: 14px; line-height: 22px; font-weight: 600; color: var(--fx-ink); }
.fx-index-nav { display: flex; align-items: center; gap: 8px; flex: none; }
.fx-index-count { margin: 0 4px 0 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fx-inav {
  appearance: none;
  width: 38px; height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--fx-glass-line);
  background: var(--fx-glass);
  color: var(--fx-glass-ink);
  cursor: pointer;
}
.fx-inav svg { width: 16px; height: 16px; }
.fx-index-row {
  align-self: center;
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--fx-gutter);
  padding: 10px var(--fx-gutter) 18px;
  scrollbar-width: none;
}
.fx-index-row::-webkit-scrollbar { display: none; }
.fx-icard {
  flex: 0 0 min(330px, 80vw);
  height: min(420px, 64svh);
  scroll-snap-align: start;
  border-radius: 22px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  text-decoration: none;
}
.fx-icard-top { display: flex; justify-content: space-between; font-size: 12px; line-height: 17px; font-weight: 600; }
.fx-icard-name { margin: 0; font-size: 28px; line-height: 35px; font-weight: 600; letter-spacing: -0.015em; }
.fx-icard-q { margin: 0; font-size: 14px; line-height: 22px; font-weight: 400; }
.fx-icard-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12px; line-height: 17px; font-weight: 600; }
.fx-icard-foot svg { width: 16px; height: 16px; flex: none; }
.is-ink, .kt a.is-ink { background: var(--fx-card-ink); color: var(--fx-card-ink-fg); text-decoration: none; }
.is-paper, .kt a.is-paper { background: var(--fx-card-paper); color: var(--fx-card-paper-fg); border: 1px solid var(--fx-panel-line); text-decoration: none; }
.is-accent, .kt a.is-accent { background: var(--fx-accent); color: var(--fx-on-accent); text-decoration: none; }
.is-glass, .kt a.is-glass { background: var(--fx-glass); color: var(--fx-glass-ink); border: 1px solid var(--fx-glass-line); text-decoration: none; }
.fx-close {
  appearance: none;
  justify-self: center;
  border: 1px solid var(--fx-glass-line);
  cursor: pointer;
  height: 40px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--fx-glass);
  color: var(--fx-glass-ink);
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
}

/* ------------------------------------------------------------------ reading layout & sections */
.fx-wrap { width: min(var(--fx-max), calc(100% - 2 * var(--fx-gutter))); margin-inline: auto; }
.fx-main { padding-bottom: 24px; }
.fx-read { padding-top: 16px; }
.fx-section {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: 20px 40px;
  margin: 0 auto 36px;
  padding-top: 32px;
  border-top: 1px solid var(--fx-line);
  scroll-margin-top: 76px;
}
.fx-section--stack {
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}
.fx-section-head { padding-top: 4px; }
.fx-section-body { min-width: 0; }
.fx-label {
  display: block;
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 17px;
  font-weight: 600;
  color: var(--fx-mute);
}
.fx-h2 {
  margin: 0;
  font-size: 28px;
  line-height: 35px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--fx-ink);
}
.fx-bigtext {
  margin: 0 0 22px;
  max-width: 44em;
  font-size: 21px;
  line-height: 32px;
  font-weight: 400;
  color: var(--fx-ink);
}
.fx-panel {
  min-width: 0;
  background: var(--fx-panel);
  border: 1px solid var(--fx-panel-line);
  border-radius: var(--fx-r-panel);
  padding: 24px;
  box-shadow: var(--fx-shadow);
}
.fx-pillars {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.fx-pillar {
  border-radius: var(--fx-r-card);
  padding: 20px;
  display: grid;
  gap: 8px;
  align-content: start;
  background: var(--fx-panel);
  border: 1px solid var(--fx-panel-line);
}
.fx-num {
  font-size: 12px;
  line-height: 17px;
  font-weight: 600;
  color: var(--fx-mute);
}
.fx-pillar strong {
  font-size: 17px;
  line-height: 27px;
  font-weight: 600;
  color: var(--fx-ink);
}
.fx-pillar p {
  margin: 0;
  font-size: 14px;
  line-height: 22px;
  font-weight: 400;
  color: var(--fx-ink-2);
}

.fx-doors {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.fx-door {
  min-height: 230px;
  border-radius: 22px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  text-decoration: none;
  transition: transform 0.25s var(--fx-ease);
}
.fx-door:hover { transform: translateY(-2px); }
.fx-door-top {
  font-size: 12px;
  line-height: 17px;
  font-weight: 600;
}
.fx-door h3 {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 31px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.fx-door p {
  margin: 0;
  font-size: 14px;
  line-height: 22px;
  font-weight: 400;
}
.fx-door-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  text-decoration: underline;
}
.fx-door-link svg { width: 12px; height: 12px; }

/* ------------------------------------------------------------------ CREDIT-HARVEST Workbenches */
.ch-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.ch-kpi {
  background: var(--fx-panel);
  border: 1px solid var(--fx-panel-line);
  border-radius: var(--fx-r-card);
  padding: 18px 20px;
  display: grid;
  gap: 4px;
}
.ch-kpi-label {
  font-size: 12px;
  line-height: 17px;
  font-weight: 600;
  color: var(--fx-mute);
}
.ch-kpi-val {
  font-size: 24px;
  line-height: 31px;
  font-weight: 600;
  color: var(--fx-ink);
  font-variant-numeric: tabular-nums;
}
.ch-kpi-sub {
  font-size: 14px;
  line-height: 22px;
  color: var(--fx-ink-2);
}

/* Filter bar & Injector bar */
.ch-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--fx-panel);
  border: 1px solid var(--fx-panel-line);
  border-radius: var(--fx-r-card);
  padding: 14px 18px;
  margin-bottom: 16px;
}
.ch-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ch-filter-btn {
  appearance: none;
  border: 1px solid var(--fx-line-2);
  background: var(--fx-panel-alt);
  color: var(--fx-ink);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  cursor: pointer;
}
.ch-filter-btn[aria-pressed="true"] {
  background: var(--fx-navy);
  color: #ffffff;
  border-color: var(--fx-navy);
}
:root[data-theme="dark"] .ch-filter-btn[aria-pressed="true"] {
  background: var(--fx-accent);
  color: var(--fx-on-accent);
  border-color: var(--fx-accent);
}

/* Discovery Radar Grid */
.ch-radar-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.ch-prog-card {
  background: var(--fx-panel);
  border: 1px solid var(--fx-panel-line);
  border-radius: var(--fx-r-card);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}
.ch-prog-card.is-active {
  border: 2px solid var(--fx-accent);
}
.ch-prog-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ch-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 17px;
  font-weight: 600;
  background: var(--fx-accent-soft);
  color: var(--fx-accent-ink);
}
.ch-badge.is-navy {
  background: var(--fx-navy);
  color: #ffffff;
}
.ch-prog-title {
  margin: 6px 0 4px;
  font-size: 21px;
  line-height: 32px;
  font-weight: 600;
  color: var(--fx-ink);
}
.ch-prog-q {
  margin: 0;
  font-size: 14px;
  line-height: 22px;
  color: var(--fx-ink-2);
}
.ch-prog-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  padding-top: 12px;
  border-top: 1px solid var(--fx-line);
  font-size: 14px;
  line-height: 22px;
}
.ch-prog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 8px;
}

/* Buttons */
.ch-btn, .kt a.ch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--fx-line-2);
  background: var(--fx-panel-alt);
  color: var(--fx-ink);
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.ch-btn:hover, .kt a.ch-btn:hover { border-color: var(--fx-ink); }
.ch-btn.is-primary, .kt a.ch-btn.is-primary {
  background: var(--fx-navy);
  color: #ffffff;
  border-color: var(--fx-navy);
}
:root[data-theme="dark"] .ch-btn.is-primary, :root[data-theme="dark"] .kt a.ch-btn.is-primary {
  background: var(--fx-accent);
  color: var(--fx-on-accent);
  border-color: var(--fx-accent);
}
.ch-btn.is-accent, .kt a.ch-btn.is-accent {
  background: var(--fx-accent);
  color: var(--fx-on-accent);
  border-color: var(--fx-accent);
}

/* Workbench Two-Column Split */
.ch-workbench {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.ch-list {
  display: grid;
  gap: 6px;
  max-height: 680px;
  overflow-y: auto;
  padding-right: 4px;
}
.ch-list-item {
  appearance: none;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--fx-panel-line);
  background: var(--fx-panel);
  color: var(--fx-ink);
  cursor: pointer;
  display: grid;
  gap: 4px;
}
.ch-list-item[aria-selected="true"] {
  background: var(--fx-navy);
  color: #ffffff;
  border-color: var(--fx-navy);
}
:root[data-theme="dark"] .ch-list-item[aria-selected="true"] {
  background: var(--fx-accent);
  color: var(--fx-on-accent);
  border-color: var(--fx-accent);
}
.ch-list-item-top {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  line-height: 17px;
  font-weight: 600;
}
.ch-list-item-name {
  font-size: 14px;
  line-height: 22px;
  font-weight: 600;
}

.ch-field-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}
.ch-field-box {
  background: var(--fx-panel-alt);
  border: 1px solid var(--fx-line);
  border-radius: 14px;
  padding: 14px 16px;
  display: grid;
  gap: 6px;
}
.ch-field-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ch-field-label {
  font-size: 14px;
  line-height: 22px;
  font-weight: 600;
  color: var(--fx-ink);
}
.ch-field-val {
  margin: 0;
  font-size: 14px;
  line-height: 22px;
  color: var(--fx-ink-2);
  white-space: pre-wrap;
}

/* Inputs & Textareas */
.ch-input, .ch-select, .ch-textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--fx-line-2);
  background: var(--fx-panel-alt);
  color: var(--fx-ink);
  font-size: 14px;
  line-height: 22px;
}
.ch-textarea {
  min-height: 150px;
  resize: vertical;
}

/* Lifecycle Table */
.ch-table-wrap {
  overflow-x: auto;
  border-radius: var(--fx-r-card);
  border: 1px solid var(--fx-panel-line);
  background: var(--fx-panel);
}
.ch-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
  line-height: 22px;
}
.ch-table th {
  padding: 12px 14px;
  font-size: 12px;
  line-height: 17px;
  font-weight: 600;
  color: var(--fx-mute);
  border-bottom: 1px solid var(--fx-line-2);
  background: var(--fx-panel-alt);
  white-space: nowrap;
}
.ch-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--fx-line);
  vertical-align: middle;
}
.ch-table tr:last-child td { border-bottom: 0; }

/* Next chapter + Footer */
.fx-next { padding: 48px 0 10px; }
.fx-next-link {
  display: grid;
  gap: 10px;
  padding: 28px 0;
  border-top: 1px solid var(--fx-line-2);
  color: var(--fx-ink);
  text-decoration: none;
}
.fx-next-title {
  display: flex;
  align-items: center;
  gap: 0.22em;
  font-size: 48px;
  line-height: 57px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.fx-next-arrow { display: inline-grid; place-items: center; width: 0.55em; height: 0.55em; }
.fx-next-arrow svg { width: 100%; height: 100%; }
.fx-next-text {
  max-width: 40em;
  font-size: 17px;
  line-height: 27px;
  color: var(--fx-ink-2);
}

.fx-foot { margin-top: 40px; }
.fx-foot-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) repeat(4, minmax(0, 1fr));
  gap: 22px;
}
.fx-foot-brand strong {
  display: block;
  font-size: 17px;
  line-height: 27px;
  font-weight: 600;
}
.fx-foot-brand p {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 22px;
  color: var(--fx-mute);
}
.fx-foot-col { display: grid; gap: 7px; align-content: start; }
.fx-foot-col a, .fx-foot-col p {
  margin: 0;
  font-size: 14px;
  line-height: 22px;
  color: var(--fx-ink-2);
  text-decoration: none;
}
.fx-foot-col a:hover { color: var(--fx-ink); text-decoration: underline; }

.riscon-family-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 24px;
  padding: 16px var(--fx-gutter) 22px;
  border-top: 1px solid var(--fx-line);
  font-size: 12px;
  line-height: 17px;
  font-weight: 600;
}
.riscon-family-lab { display: inline-flex; align-items: center; gap: 6px; color: var(--fx-ink); text-decoration: none; }
.riscon-family-lab::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--fx-accent); }
.riscon-family-lab svg { width: 11px; height: 11px; }
.riscon-family-rule { width: 26px; height: 1px; background: var(--fx-line-2); }
.riscon-family-sites { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding: 0; list-style: none; }
.riscon-family-sites a { color: var(--fx-mute); text-decoration: none; }
.riscon-family-sites a:hover { color: var(--fx-ink); text-decoration: underline; }

/* Responsive */
@media (max-width: 1040px) {
  .fx-pillars, .fx-doors, .ch-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ch-radar-grid, .ch-workbench { grid-template-columns: minmax(0, 1fr); }
  .fx-foot-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fx-foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .fx-section { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .fx-navlinks { display: none; }
  .fx-navcurrent { display: block; }
  .fx-navpill .fx-menu-links { display: grid; }
}
@media (max-width: 640px) {
  .fx-statement, .fx-next-title { font-size: 32px; line-height: 39px; }
  .fx-pillars, .fx-doors, .ch-kpis, .ch-prog-meta { grid-template-columns: minmax(0, 1fr); }
  .fx-hero { padding-top: 76px; padding-bottom: 20px; }
  .fx-chips { display: none; }
  .fx-card { grid-template-columns: minmax(0, 1fr); }
  .fx-card-link { justify-self: start; }
  .fx-cue { display: none; }
  .fx-mode[data-mode="linear"] { display: none; }
  .fx-foot-panel { grid-template-columns: minmax(0, 1fr); }
}
