/* ============================================================ */
/* THE WORDS WE USE — JARGON DECODER                              */
/* Minimalist. Black, white, gray, and yellow.                    */
/* ============================================================ */

:root {
  /* Color system */
  --ink: #0a0a0a;
  --ink-soft: #1a1a1a;
  --text: #2a2a2a;
  --text-soft: #555555;
  --text-light: #888888;
  --line: #e5e5e5;
  --line-soft: #f0f0f0;
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --bg-panel: #f7f7f7;
  --yellow: #fbc02d;
  --yellow-dark: #d9a400;
  --yellow-soft: #fff4c4;

  /* Cluster colors (muted grayscale with yellow accent) */
  --cluster-direction: #2a2a2a;
  --cluster-people: #3a3a3a;
  --cluster-resources: #4a4a4a;
  --cluster-process: #5a5a5a;
  --cluster-results: #2a2a2a;

  /* Formula type colors */
  --type-additive: #f0f0f0;
  --type-combination: #e8e8e8;
  --type-exponential: #fff4c4;
  --type-multiplied: #e0e0e0;
  --type-refinement: #eeeeee;
  --type-ratio: #f5f5f5;

  /* Spacing */
  --gap-xs: 4px;
  --gap-sm: 8px;
  --gap: 16px;
  --gap-md: 24px;
  --gap-lg: 40px;
  --gap-xl: 64px;

  /* Fonts */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
  --font-mono: "SF Mono", Monaco, Menlo, Consolas, monospace;

  /* Radii */
  --r-sm: 4px;
  --r: 6px;
  --r-lg: 10px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  height: 100%;
}
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  color: var(--ink);
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
}
p { margin: 0; }
a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: border-color 0.15s ease;
}
a:hover { border-color: var(--yellow-dark); }
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}
input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--gap-md);
}

/* ============================================================ */
/* HEADER                                                         */
/* ============================================================ */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: var(--gap) 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.95);
}
.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--gap-md);
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--gap);
}
.brand-mark {
  width: 56px;
  height: 56px;
  background: var(--ink);
  color: var(--yellow);
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 700;
  font-style: italic;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease;
}
.brand-mark:hover {
  background: var(--yellow);
  color: var(--ink);
}
.brand-title {
  font-size: 26px;
  line-height: 1.1;
}
.brand-subtitle {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
  font-style: italic;
}
.site-nav {
  display: flex;
  gap: var(--gap-sm);
  flex-wrap: wrap;
}
.nav-link {
  padding: 6px 14px;
  font-size: 14px;
  color: var(--text-soft);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  transition: all 0.15s ease;
}
.nav-link:hover {
  color: var(--ink);
  border-color: var(--line);
  background: var(--bg-soft);
}
.nav-link.active {
  color: var(--ink);
  background: var(--yellow);
  border-color: var(--yellow);
  font-weight: 600;
}

/* ============================================================ */
/* HERO                                                           */
/* ============================================================ */
.hero {
  padding: var(--gap-xl) 0 var(--gap-lg);
  border-bottom: 1px solid var(--line);
  text-align: center;
  background: var(--bg);
}
.hero-title {
  font-size: clamp(32px, 5vw, 52px);
  letter-spacing: -0.02em;
  margin-bottom: var(--gap);
}
.hero-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 4px;
  background: var(--yellow);
  margin: var(--gap) auto 0;
}
.hero-sub {
  font-size: 18px;
  color: var(--text-soft);
  max-width: 640px;
  margin: 0 auto var(--gap-lg);
}
.hero-stats {
  display: flex;
  gap: var(--gap-lg);
  justify-content: center;
  flex-wrap: wrap;
}
.stat {
  text-align: center;
}
.stat-num {
  font-family: var(--font-serif);
  font-size: 40px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}
.stat-label {
  font-size: 12px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 4px;
}

/* ============================================================ */
/* TABS                                                           */
/* ============================================================ */
.app { padding: var(--gap-lg) 0 var(--gap-xl); flex: 1; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.panel-header { margin-bottom: var(--gap-lg); }
.panel-title {
  font-size: 28px;
  margin-bottom: 8px;
}
.panel-sub {
  color: var(--text-soft);
  font-size: 16px;
}

/* ============================================================ */
/* DECODE TAB                                                     */
/* ============================================================ */
.decode-controls {
  margin-bottom: var(--gap-lg);
}
.search-wrap {
  position: relative;
  margin-bottom: var(--gap);
}
.search-input {
  width: 100%;
  padding: 16px 20px;
  font-size: 18px;
  border: 2px solid var(--line);
  border-radius: var(--r);
  background: var(--bg);
  color: var(--ink);
  transition: border-color 0.15s ease;
}
.search-input:focus {
  outline: none;
  border-color: var(--yellow);
}
.search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  max-height: 320px;
  overflow-y: auto;
  z-index: 50;
  display: none;
}
.search-dropdown.active { display: block; }
.search-dropdown-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
  transition: background 0.1s ease;
}
.search-dropdown-item:last-child { border-bottom: none; }
.search-dropdown-item:hover,
.search-dropdown-item.active { background: var(--yellow-soft); }
.search-dropdown-word {
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--ink);
}
.search-dropdown-meta {
  font-size: 12px;
  color: var(--text-light);
  display: flex;
  gap: 8px;
}
.search-dropdown-empty {
  padding: 20px;
  color: var(--text-light);
  text-align: center;
  font-style: italic;
}
.decode-filters {
  display: flex;
  gap: var(--gap-sm);
  flex-wrap: wrap;
}
.filter-select {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.filter-select:focus {
  outline: none;
  border-color: var(--yellow);
}

/* Decode result card */
.decode-result { margin-bottom: var(--gap-lg); }
.result-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--gap-lg);
  position: relative;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.result-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--gap);
  margin-bottom: var(--gap-md);
  padding-bottom: var(--gap-md);
  border-bottom: 1px solid var(--line);
}
.result-word-block { flex: 1; }
.result-word {
  font-size: 44px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}
.result-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tag {
  display: inline-block;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: var(--r-sm);
  background: var(--bg-panel);
  color: var(--text-soft);
  border: 1px solid var(--line);
}
.tag-cluster { background: var(--ink); color: var(--yellow); border-color: var(--ink); }
.tag-type { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }
.tag-status-core { background: var(--bg-panel); }
.tag-status-extended { background: var(--yellow-soft); border-color: var(--yellow); color: var(--ink); }
.tag-status-alternative { background: var(--bg-soft); font-style: italic; }

.formula-display {
  background: var(--ink);
  color: var(--bg);
  padding: var(--gap-md);
  border-radius: var(--r);
  margin-bottom: var(--gap-md);
  position: relative;
  overflow: hidden;
}
.formula-display::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--yellow);
}
.formula-notation {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.formula-expression {
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--yellow);
  font-weight: 600;
  line-height: 1.4;
  word-break: break-word;
}

.result-section {
  margin-bottom: var(--gap-md);
}
.result-section:last-child { margin-bottom: 0; }
.section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-light);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-label::before {
  content: "";
  width: 16px;
  height: 2px;
  background: var(--yellow);
}
.section-content {
  font-size: 16px;
  color: var(--text);
  line-height: 1.7;
}

.components-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.component-chip {
  padding: 6px 12px;
  background: var(--yellow-soft);
  border: 1px solid var(--yellow);
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

.alternatives-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.alternative-item {
  padding: 8px 12px;
  background: var(--bg-soft);
  border-left: 3px solid var(--yellow);
  font-size: 15px;
  color: var(--text);
  font-style: italic;
}

/* Quickpick */
.quickpick {
  background: var(--bg-soft);
  border: 1px dashed var(--line);
  border-radius: var(--r);
  padding: var(--gap-md);
}
.quickpick-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  margin-bottom: var(--gap);
}
.quickpick-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.quickpick-tag {
  padding: 6px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-serif);
}
.quickpick-tag:hover {
  background: var(--yellow);
  border-color: var(--yellow);
  color: var(--ink);
  transform: translateY(-1px);
}

/* ============================================================ */
/* ENCODE TAB                                                     */
/* ============================================================ */
.encode-form {
  background: var(--bg-soft);
  padding: var(--gap-lg);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  margin-bottom: var(--gap-lg);
}
.encode-components {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--gap);
  margin-bottom: var(--gap-md);
}
.component-input label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  margin-bottom: 6px;
}
.encode-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg);
  color: var(--ink);
  transition: border-color 0.15s ease;
}
.encode-input:focus {
  outline: none;
  border-color: var(--yellow);
}

.encode-options {
  display: flex;
  gap: var(--gap);
  flex-wrap: wrap;
  align-items: flex-end;
}
.option-group { flex: 1; min-width: 180px; }
.option-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  margin-bottom: 6px;
}
.encode-select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  cursor: pointer;
}

.btn-primary,
.btn-secondary {
  padding: 12px 24px;
  border-radius: var(--r-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--ink);
  color: var(--yellow);
}
.btn-primary:hover {
  background: var(--yellow);
  color: var(--ink);
}
.btn-secondary {
  background: var(--bg);
  color: var(--text-soft);
  border-color: var(--line);
}
.btn-secondary:hover {
  border-color: var(--ink);
  color: var(--ink);
}

/* Encode results */
.encode-result { margin-top: var(--gap-lg); }
.match-list {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}
.match-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--gap-md);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  overflow: hidden;
}
.match-card:hover {
  border-color: var(--yellow);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}
.match-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--yellow);
}
.match-rank {
  position: absolute;
  top: var(--gap);
  right: var(--gap);
  background: var(--ink);
  color: var(--yellow);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 18px;
}
.match-word {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
  padding-right: 48px;
}
.match-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: var(--gap);
}
.match-formula {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: var(--gap);
  padding: 10px 14px;
  background: var(--bg-panel);
  border-radius: var(--r-sm);
  border-left: 2px solid var(--yellow);
}
.match-score {
  font-size: 12px;
  color: var(--text-light);
}
.match-score strong { color: var(--ink); font-size: 14px; }
.match-highlight {
  background: var(--yellow-soft);
  padding: 1px 3px;
  border-radius: 2px;
}

.encode-empty {
  text-align: center;
  padding: var(--gap-xl);
  color: var(--text-light);
  font-style: italic;
}

/* ============================================================ */
/* BROWSE TAB                                                     */
/* ============================================================ */
.browse-filters {
  display: flex;
  gap: var(--gap);
  margin-bottom: var(--gap-lg);
  flex-wrap: wrap;
}
.browse-filters .search-input {
  flex: 1;
  min-width: 240px;
  padding: 12px 16px;
  font-size: 15px;
}
.browse-grid {
  display: flex;
  flex-direction: column;
  gap: var(--gap-lg);
}
.cluster-section {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.cluster-header {
  background: var(--ink);
  color: var(--bg);
  padding: var(--gap) var(--gap-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid var(--yellow);
}
.cluster-header-left {
  display: flex;
  align-items: baseline;
  gap: var(--gap);
}
.cluster-num {
  font-family: var(--font-serif);
  font-size: 14px;
  color: var(--yellow);
  font-style: italic;
}
.cluster-name {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
}
.cluster-question {
  font-size: 13px;
  font-style: italic;
  color: var(--text-light);
}
.cluster-count {
  font-size: 12px;
  color: var(--yellow);
  background: rgba(251,192,45,0.15);
  padding: 4px 10px;
  border-radius: 20px;
}
.cluster-words {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1px;
  background: var(--line);
}
.word-card {
  padding: var(--gap) var(--gap-md);
  background: var(--bg);
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
}
.word-card:hover {
  background: var(--yellow-soft);
}
.word-card-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.word-card-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dot-core { background: var(--ink); }
.dot-extended { background: var(--yellow); }
.dot-alternative { background: var(--text-light); }
.word-card-type {
  font-size: 11px;
  color: var(--text-light);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================================ */
/* HEALTH CHECK TAB                                               */
/* ============================================================ */
.master-formula-display {
  background: var(--ink);
  color: var(--bg);
  padding: var(--gap-lg);
  border-radius: var(--r-lg);
  margin-bottom: var(--gap-lg);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.master-formula-display::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 4px;
  background: var(--yellow);
}
.master-formula-line {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 8px;
}
.master-formula-expr {
  font-family: var(--font-mono);
  font-size: clamp(14px, 2.2vw, 22px);
  font-weight: 700;
  color: var(--yellow);
  line-height: 1.5;
  word-break: break-word;
  margin-bottom: var(--gap);
}
.master-formula-note {
  font-style: italic;
  color: var(--text-light);
  font-size: 14px;
}

.health-mode-toggle {
  display: flex;
  gap: 2px;
  background: var(--bg-panel);
  padding: 4px;
  border-radius: var(--r);
  margin-bottom: var(--gap-lg);
  max-width: 320px;
}
.mode-btn {
  flex: 1;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-soft);
  transition: all 0.15s ease;
  background: transparent;
}
.mode-btn.active {
  background: var(--ink);
  color: var(--yellow);
}

.health-panel { display: none; }
.health-panel.active { display: block; }

.health-question {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--gap-md);
  margin-bottom: var(--gap);
  transition: border-color 0.15s ease;
}
.health-question.answered {
  border-color: var(--yellow);
  background: var(--yellow-soft);
}
.health-question-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  gap: var(--gap);
  flex-wrap: wrap;
}
.health-question-num {
  font-family: var(--font-serif);
  font-size: 14px;
  color: var(--text-light);
  font-style: italic;
}
.health-question-cluster {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--yellow-dark);
}
.health-question-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}
.health-question-text {
  color: var(--text-soft);
  margin-bottom: var(--gap);
  font-size: 15px;
}
.health-question-deep-text {
  background: var(--bg-soft);
  padding: var(--gap);
  border-radius: var(--r-sm);
  font-size: 14px;
  color: var(--text);
  margin-bottom: var(--gap);
  border-left: 3px solid var(--yellow);
  font-style: italic;
}
.health-answers {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.health-answer {
  padding: 8px 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}
.health-answer:hover {
  border-color: var(--ink);
}
.health-answer.selected {
  background: var(--ink);
  color: var(--yellow);
  border-color: var(--ink);
}

.health-consistency-box {
  background: var(--yellow);
  padding: var(--gap-md);
  border-radius: var(--r-lg);
  margin: var(--gap-lg) 0;
  text-align: center;
}
.health-consistency-box h4 {
  font-family: var(--font-serif);
  margin-bottom: 8px;
}

.health-submit {
  display: block;
  margin: var(--gap-lg) auto 0;
  padding: 14px 36px;
  font-size: 16px;
  background: var(--ink);
  color: var(--yellow);
  border-radius: var(--r);
  font-weight: 700;
  border: 2px solid var(--ink);
  transition: all 0.15s ease;
}
.health-submit:hover {
  background: var(--yellow);
  color: var(--ink);
}
.health-submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.health-result {
  margin-top: var(--gap-lg);
}
.health-result-card {
  background: var(--bg);
  border: 2px solid var(--ink);
  border-radius: var(--r-lg);
  padding: var(--gap-lg);
  animation: fadeIn 0.4s ease;
}
.health-score-display {
  text-align: center;
  margin-bottom: var(--gap-md);
  padding-bottom: var(--gap-md);
  border-bottom: 1px solid var(--line);
}
.health-score-num {
  font-family: var(--font-serif);
  font-size: 64px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  margin-bottom: 8px;
}
.health-score-label {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 12px;
  color: var(--text-light);
  font-weight: 600;
}
.health-breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.health-row {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  align-items: center;
  gap: var(--gap);
  padding: 10px 14px;
  background: var(--bg-soft);
  border-radius: var(--r-sm);
  border-left: 3px solid var(--yellow);
}
.health-row-label {
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--ink);
}
.health-row-bar {
  background: var(--line);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
}
.health-row-bar-fill {
  height: 100%;
  background: var(--yellow);
  transition: width 0.5s ease;
}
.health-row-value {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
}
.health-diagnosis {
  margin-top: var(--gap-md);
  padding-top: var(--gap-md);
  border-top: 1px solid var(--line);
  color: var(--text);
  line-height: 1.7;
}
.health-diagnosis strong { color: var(--ink); }
.health-reset {
  display: inline-block;
  margin-top: var(--gap);
  font-size: 13px;
  color: var(--text-soft);
  cursor: pointer;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 2px 0;
}
.health-reset:hover { color: var(--ink); border-color: var(--ink); }

/* ============================================================ */
/* ABOUT TAB                                                      */
/* ============================================================ */
.about-content {
}
.about-intro p {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: var(--gap);
}
.about-intro em { font-style: italic; }
.about-h {
  font-size: 22px;
  margin: var(--gap-lg) 0 var(--gap) 0;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--yellow);
}
.formula-types-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--gap);
  margin-bottom: var(--gap-lg);
}
.type-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--gap);
  background: var(--bg);
}
.type-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}
.type-card-name {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--ink);
}
.type-card-notation {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-panel);
  padding: 3px 8px;
  border-radius: var(--r-sm);
  color: var(--text);
  margin-left: auto;
}
.type-card-desc {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.6;
}

.clusters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--gap);
  margin-bottom: var(--gap-lg);
}
.cluster-card {
  background: var(--ink);
  color: var(--bg);
  padding: var(--gap);
  border-radius: var(--r);
  border-top: 3px solid var(--yellow);
}
.cluster-card-num {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--yellow);
  font-size: 13px;
  margin-bottom: 4px;
}
.cluster-card-name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 20px;
  margin-bottom: 6px;
}
.cluster-card-q {
  font-size: 13px;
  font-style: italic;
  color: var(--text-light);
}

.about-footer {
  margin-top: var(--gap-xl);
  padding-top: var(--gap);
  border-top: 1px solid var(--line);
  color: var(--text-light);
  font-size: 14px;
}
.about-footer em { font-style: italic; }
.about-links { margin-top: 8px; display: flex; gap: 8px; align-items: center; }
.about-links a { color: var(--text); font-weight: 500; }
.about-links span { color: var(--text-light); }

/* ============================================================ */
/* FOOTER                                                         */
/* ============================================================ */
.site-footer {
  background: var(--ink);
  color: var(--text-light);
  padding: var(--gap-lg) 0 var(--gap-md);
  font-size: 13px;
  border-top: 3px solid var(--yellow);
  text-align: center;
}
.site-footer em { font-style: italic; color: var(--bg); }
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 8px;
  margin-bottom: var(--gap-md);
}
.footer-nav-link {
  color: #aaa;
  font-size: 13px;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 20px;
  transition: all 0.15s ease;
}
.footer-nav-link:hover {
  color: var(--yellow);
  background: rgba(255,255,255,0.06);
}
.footer-copy {
  color: var(--text-light);
  margin: 0;
  font-size: 12px;
}

/* ============================================================ */
/* RESPONSIVE                                                     */
/* ============================================================ */
@media (max-width: 720px) {
  .site-header .container {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--gap);
  }
  .site-nav {
    width: 100%;
    justify-content: space-around;
    overflow-x: auto;
  }
  .nav-link { flex-shrink: 0; }
  .result-word { font-size: 32px; }
  .hero { padding: var(--gap-lg) 0; }
  .hero-stats { gap: var(--gap-md); }
  .stat-num { font-size: 32px; }
  .panel-title { font-size: 22px; }
  .health-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .health-row-label { font-size: 14px; }
}

/* Utility: hidden */
.hidden { display: none !important; }

/* ============================================================ */
/* NEW — METAPHOR TAG & INDICATORS                                */
/* ============================================================ */
.tag-metaphor {
  background: var(--yellow);
  color: var(--ink);
  border-color: var(--yellow-dark);
  font-style: italic;
}
.dot-metaphor {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--yellow-dark);
  display: inline-block;
  flex-shrink: 0;
}
.dropdown-metaphor-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--yellow-dark);
  margin-left: 5px;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ============================================================ */
/* NEW — ALTERNATIVE REDIRECT CARD                               */
/* ============================================================ */
.result-card-alt {
  border-color: var(--line);
  background: var(--bg-soft);
}
.alt-redirect-block {
  background: var(--ink);
  color: var(--bg);
  padding: var(--gap-md);
  border-radius: var(--r);
  margin-bottom: var(--gap-md);
  display: flex;
  align-items: center;
  gap: var(--gap-md);
  flex-wrap: wrap;
}
.alt-redirect-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-light);
  flex-shrink: 0;
}
.alt-redirect-target {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--yellow);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s ease;
  border-bottom: 2px solid transparent;
}
.alt-redirect-target:hover {
  color: var(--bg);
  border-bottom-color: var(--yellow);
}

/* ============================================================ */
/* FRAMEWORKS & STANDARDS TAB                                    */
/* ============================================================ */
.fw-controls {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  margin-bottom: var(--gap-lg);
}
.fw-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.fw-filter-tab {
  padding: 7px 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  cursor: pointer;
  transition: all 0.15s ease;
}
.fw-filter-tab:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.fw-filter-tab.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--yellow);
}
.fw-search-wrap {
  max-width: 480px;
}
.fw-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Card wrap — the accordion container */
.fw-card-wrap {
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  transition: box-shadow 0.15s ease;
}
.fw-card-wrap.open {
  box-shadow: 0 2px 16px rgba(0,0,0,0.08);
  border-color: var(--ink);
}

/* Card trigger — the clickable header row */
.fw-card {
  width: 100%;
  background: var(--bg);
  border: none;
  cursor: pointer;
  text-align: left;
  padding: 0;
  transition: background 0.15s ease;
}
.fw-card-trigger {
  display: block;
  width: 100%;
}
.fw-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  gap: 12px;
}
.fw-card:hover .fw-card-top,
.fw-card-wrap.open .fw-card .fw-card-top {
  background: var(--ink);
}
.fw-card:hover .fw-card-word,
.fw-card-wrap.open .fw-card .fw-card-word {
  color: var(--yellow);
}
.fw-card:hover .fw-card-acronym,
.fw-card-wrap.open .fw-card .fw-card-acronym,
.fw-card:hover .fw-card-subtype,
.fw-card-wrap.open .fw-card .fw-card-subtype,
.fw-card:hover .fw-card-chevron,
.fw-card-wrap.open .fw-card .fw-card-chevron {
  color: #aaa;
}
.fw-card-word {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
  transition: color 0.15s ease;
}
.fw-card-acronym {
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.4;
  transition: color 0.15s ease;
}
.fw-card-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.fw-card-subtype {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  transition: color 0.15s ease;
}
.fw-card-chevron {
  font-size: 11px;
  color: var(--text-light);
  transition: color 0.15s ease;
}

/* Expanded detail area */
.fw-card-detail {
  display: none;
  border-top: 1px solid var(--line);
}
.fw-card-wrap.open .fw-card-detail {
  display: block;
}
.fw-card-detail-inner {
  padding: 24px;
  background: var(--bg);
}

/* Framework detail card */
.result-card-framework {
  border-top: 3px solid var(--yellow);
}
.tag-framework {
  background: var(--ink);
  color: var(--yellow);
  border-color: var(--ink);
}
.tag-acronym {
  background: var(--yellow-soft);
  color: var(--ink);
  border-color: var(--yellow);
  font-style: normal;
  font-size: 10px;
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fw-origin-block {
  display: flex;
  align-items: baseline;
  gap: var(--gap-sm);
  padding: 10px var(--gap-md);
  background: var(--bg-soft);
  border-radius: var(--r-sm);
  margin-bottom: var(--gap-md);
  border-left: 2px solid var(--yellow);
}
.fw-origin-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-light);
  flex-shrink: 0;
}
.fw-origin-text {
  font-size: 14px;
  color: var(--text-soft);
  font-style: italic;
}
.fw-related-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.fw-related-link {
  padding: 5px 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-serif);
}
.fw-related-link:hover {
  background: var(--yellow);
  border-color: var(--yellow);
  color: var(--ink);
}
.fw-related-plain {
  padding: 5px 12px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-light);
  font-style: italic;
}

/* ============================================================ */
/* BOOK TAB                                                       */
/* ============================================================ */

/* Hero — cover + text side by side */
.book-hero {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 48px;
  align-items: start;
  margin-bottom: 64px;
  padding-bottom: 64px;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 700px) {
  .book-hero { grid-template-columns: 1fr; gap: 32px; }
}

/* Book cover placeholder */
.book-cover-placeholder {
  width: 100%;
  aspect-ratio: 2/3;
  background: var(--ink);
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 8px 12px 32px rgba(0,0,0,0.2);
}
.book-cover-inner {
  text-align: center;
  padding: 24px;
}
.book-cover-j {
  font-family: var(--font-serif);
  font-size: 64px;
  font-style: italic;
  color: var(--yellow);
  line-height: 1;
  margin-bottom: 16px;
}
.book-cover-title {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--bg);
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.3;
}
.book-cover-sub {
  font-size: 12px;
  color: #aaa;
  line-height: 1.5;
  font-style: italic;
}

/* Hero text */
.book-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--yellow-dark);
  margin-bottom: 12px;
}
.book-title {
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 8px;
}
.book-subtitle {
  font-size: 17px;
  color: var(--text-soft);
  font-style: italic;
  margin-bottom: 8px;
}
.book-byline {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.book-pitch {
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 32px;
  max-width: 560px;
}

/* CTA buttons */
.book-cta-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.book-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 22px;
  border-radius: var(--r);
  text-decoration: none;
  transition: all 0.15s ease;
  min-width: 220px;
}
.book-btn-primary {
  background: var(--ink);
  color: var(--yellow);
  border: 2px solid var(--ink);
}
.book-btn-primary:hover {
  background: var(--yellow);
  color: var(--ink);
  border-color: var(--yellow);
}
.book-btn-secondary {
  background: var(--bg);
  color: var(--ink);
  border: 2px solid var(--ink);
}
.book-btn-secondary:hover {
  background: var(--ink);
  color: var(--yellow);
}
.book-btn-icon {
  font-size: 20px;
  flex-shrink: 0;
}
.book-btn-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.book-btn-label {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}
.book-btn-note {
  font-size: 12px;
  opacity: 0.7;
}

/* Sections */
.book-section {
  margin-bottom: 64px;
  padding-bottom: 64px;
  border-bottom: 1px solid var(--line);
}
.book-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--yellow-dark);
  margin-bottom: 12px;
}
.book-section-title {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: 32px;
  max-width: 640px;
}

/* Feature numbers */
.book-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
@media (max-width: 600px) {
  .book-features { grid-template-columns: 1fr; }
}
.book-feature {
  padding: 24px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--yellow);
  border-radius: var(--r);
}
.book-feature-num {
  font-family: var(--font-serif);
  font-size: 48px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 12px;
}
.book-feature-text {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.65;
}

/* Split: image + text */
.book-split {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 48px;
  align-items: start;
  margin-bottom: 64px;
  padding-bottom: 64px;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 700px) {
  .book-split { grid-template-columns: 1fr; }
}
.book-body {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 16px;
}
.book-author-link {
  font-weight: 600;
  color: var(--ink);
  font-size: 14px;
  border-bottom: 1px solid var(--yellow);
  padding-bottom: 1px;
}
.book-author-link:hover { color: var(--yellow-dark); }

/* Image placeholders */
.book-image-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--bg-soft);
  border: 2px dashed var(--line);
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 13px;
  font-style: italic;
}
.book-image-placeholder--tall {
  aspect-ratio: 3/4;
}

/* Pull quote */
.book-quote-block {
  background: var(--ink);
  color: var(--bg);
  padding: 48px;
  border-radius: var(--r);
  margin-bottom: 64px;
  position: relative;
}
.book-quote-mark {
  font-family: var(--font-serif);
  font-size: 80px;
  color: var(--yellow);
  line-height: 0.6;
  margin-bottom: 20px;
  display: block;
}
.book-quote {
  font-family: var(--font-serif);
  font-size: 22px;
  line-height: 1.6;
  color: var(--bg);
  font-style: italic;
  margin: 0 0 20px 0;
  max-width: 680px;
}
.book-quote-attr {
  font-size: 13px;
  color: #aaa;
  font-style: italic;
}

/* Three preview cards */
.book-previews {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 700px) {
  .book-previews { grid-template-columns: 1fr; }
}
.book-preview-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.book-preview-card .book-image-placeholder {
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--line);
  aspect-ratio: 4/3;
}
.book-preview-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  padding: 16px 16px 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.book-preview-text {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.65;
  padding: 0 16px 16px;
}

/* Bottom CTA */
.book-bottom-cta {
  background: var(--yellow-soft);
  border: 1px solid var(--yellow);
  border-top: 3px solid var(--yellow-dark);
  border-radius: var(--r);
  padding: 48px;
  text-align: center;
}
.book-bottom-cta-title {
  font-family: var(--font-serif);
  font-size: 24px;
  color: var(--ink);
  margin-bottom: 28px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}
.book-bottom-cta .book-cta-buttons {
  justify-content: center;
}

/* ============================================================ */
/* BROWSE ACCORDION                                               */
/* ============================================================ */
.cluster-accordion {
  border: 1px solid var(--line);
  border-radius: var(--r);
  margin-bottom: 10px;
  overflow: hidden;
  transition: box-shadow 0.15s ease;
}
.cluster-accordion.open {
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}
.cluster-accordion-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  background: var(--bg);
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
  gap: 12px;
}
.cluster-accordion-header:hover {
  background: var(--yellow-soft);
}
.cluster-accordion.open .cluster-accordion-header {
  background: var(--ink);
  border-bottom: 1px solid var(--line);
}
.cluster-accordion.open .cluster-num,
.cluster-accordion.open .cluster-name,
.cluster-accordion.open .cluster-question {
  color: var(--bg);
}
.cluster-accordion.open .cluster-count,
.cluster-accordion.open .cluster-chevron {
  color: var(--yellow);
}
.cluster-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.cluster-chevron {
  font-size: 11px;
  color: var(--text-light);
  transition: color 0.15s ease;
}
.cluster-accordion-body {
  display: none;
  padding: 20px;
  background: var(--bg);
}
.cluster-accordion.open .cluster-accordion-body {
  display: block;
}

/* ============================================================ */
/* BOOK — PERSONAL STORIES HEADER & STORY LABEL                  */
/* ============================================================ */
.book-stories-header {
  background: var(--ink);
  border-radius: var(--r);
  padding: 24px 32px;
  margin: 32px 0 24px;
}
.book-stories-header-text {
  font-family: var(--font-serif);
  font-size: 20px;
  color: var(--yellow);
  margin: 0;
  line-height: 1.4;
}
.book-feature-story-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--yellow-dark);
  margin-bottom: 10px;
}

/* ============================================================ */
/* ABOUT — FRAMEWORKS & STANDARDS CATEGORIES                     */
/* ============================================================ */
.about-section-intro {
  font-size: 15px;
  color: var(--text-soft);
  line-height: 1.7;
  margin-bottom: 20px;
}
.fw-categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gap);
  margin-bottom: var(--gap-lg);
}
.fw-cat-card {
  border: 1px solid var(--line);
  border-top: 3px solid var(--ink);
  border-radius: var(--r);
  padding: var(--gap-md);
}
.fw-cat-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.fw-cat-card-name {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}
.fw-cat-card-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-light);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 2px 9px;
  flex-shrink: 0;
}
.fw-cat-card-desc {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.65;
  margin-bottom: 14px;
}
.fw-cat-card-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.fw-cat-example {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-soft);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 3px 8px;
  font-style: italic;
}

/* ============================================================ */
/* ENCODE — STARTER SCENARIOS                                    */
/* ============================================================ */
.encode-scenarios {
  margin-bottom: var(--gap-lg);
}
.encode-scenarios-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-light);
  margin-bottom: 10px;
}
.encode-scenarios-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.scenario-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}
.scenario-btn:hover {
  border-color: var(--ink);
  background: var(--bg-soft);
}
.scenario-btn.active {
  background: var(--ink);
  border-color: var(--ink);
}
.scenario-btn.active .scenario-btn-label {
  color: var(--yellow);
}
.scenario-btn.active .scenario-btn-cluster {
  color: #aaa;
}
.scenario-btn-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  transition: color 0.15s ease;
}
.scenario-btn-cluster {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  transition: color 0.15s ease;
  flex-shrink: 0;
}

/* ============================================================ */
/* ENCODE — WORD BANK                                            */
/* ============================================================ */
.word-bank {
  margin-top: var(--gap-xl);
  padding-top: var(--gap-lg);
  border-top: 1px solid var(--line);
}
.word-bank-header {
  margin-bottom: var(--gap);
}
.word-bank-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}
.word-bank-sub {
  font-size: 14px;
  color: var(--text-soft);
  margin-bottom: var(--gap);
}
.word-bank-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--gap);
}
.word-bank-tab {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  cursor: pointer;
  transition: all 0.15s ease;
}
.word-bank-tab:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.word-bank-tab.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--yellow);
}
.word-bank-words {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.word-bank-word {
  padding: 7px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}
.word-bank-word:hover {
  background: var(--yellow-soft);
  border-color: var(--yellow);
  color: var(--ink);
}
.word-bank-word.used {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--yellow);
  transform: scale(0.96);
}
.encode-input.flash {
  border-color: var(--yellow);
  background: var(--yellow-soft);
}

/* ============================================================ */
/* TAB-LEVEL BOOK CTA (shared across all non-book tabs)          */
/* ============================================================ */
.tab-book-cta {
  margin-top: var(--gap-lg);
  padding: 24px 32px;
  background: var(--yellow-soft);
  border: 1px solid var(--yellow);
  border-top: 3px solid var(--yellow-dark);
  border-radius: var(--r);
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}
.tab-book-cta-cover {
  background: var(--ink);
  border-radius: 4px;
  width: 160px;
  flex-shrink: 0;
  aspect-ratio: 2/3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
  text-align: center;
  box-shadow: 6px 10px 24px rgba(0,0,0,0.25);
}
.tab-cta-j {
  font-family: var(--font-serif);
  font-size: 52px;
  font-style: italic;
  font-weight: 700;
  color: var(--yellow);
  line-height: 1;
  margin-bottom: 10px;
}
.tab-cta-cover-title {
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 700;
  color: var(--bg);
  line-height: 1.3;
  margin-bottom: 6px;
}
.tab-cta-cover-sub {
  font-size: 10px;
  color: #999;
  line-height: 1.4;
  font-style: italic;
}
.tab-book-cta-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}
.tab-book-cta-heading {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tab-book-cta-eyebrow {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--yellow-dark);
}
.tab-book-cta-title {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  line-height: 1.2;
}
@media (max-width: 700px) {
  .tab-book-cta { padding: 20px; gap: 20px; }
  .tab-book-cta-cover { width: 100px; }
  .tab-book-cta-title { font-size: 20px; }
  .tab-cta-j { font-size: 36px; }
  .tab-cta-cover-title { font-size: 10px; }
  .tab-cta-cover-sub { font-size: 8px; }
}

/* ============================================================ */
/* NAV MORE DROPDOWN                                             */
/* ============================================================ */
.nav-more {
  position: relative;
}
.nav-more-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-soft);
  padding: 6px 10px;
  border-radius: var(--r-sm);
  transition: all 0.15s ease;
  white-space: nowrap;
  font-family: var(--font-sans);
}
.nav-more-btn:hover,
.nav-more-btn.active {
  color: var(--ink);
  background: var(--yellow);
}
.nav-more-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  min-width: 160px;
  z-index: 200;
  overflow: hidden;
}
.nav-more-dropdown.open {
  display: block;
}
.nav-more-item {
  display: block;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  transition: background 0.12s ease;
  border-bottom: 1px solid var(--line);
}
.nav-more-item:last-child {
  border-bottom: none;
}
.nav-more-item:hover {
  background: var(--yellow-soft);
  color: var(--ink);
}

/* ============================================================ */
/* BOOK TAB — PLACEHOLDER REPLACEMENTS                           */
/* ============================================================ */

/* Author placeholder */
.book-author-placeholder {
  width: 100%;
  aspect-ratio: 3/4;
  background: var(--ink);
  border-radius: var(--r);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 8px 12px 32px rgba(0,0,0,0.15);
}
.book-author-placeholder-initial {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.book-author-placeholder-label {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--bg);
}
.book-author-placeholder-sub {
  font-size: 12px;
  color: #aaa;
  font-style: italic;
  text-align: center;
  padding: 0 20px;
}

/* Shared preview content block */
.book-preview-content-block {
  aspect-ratio: 4/3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px;
}

/* Formula preview */
.book-preview-formula {
  background: var(--ink);
}
.bpcb-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #888;
  margin-bottom: 10px;
}
.bpcb-formula {
  font-family: "SF Mono", Monaco, Menlo, Consolas, monospace;
  font-size: 13px;
  color: var(--yellow);
  line-height: 1.5;
  margin-bottom: 14px;
}
.bpcb-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.bpcb-chips span {
  font-size: 11px;
  padding: 3px 10px;
  border: 1px solid #444;
  border-radius: 3px;
  color: #bbb;
}

/* Cluster list preview */
.book-preview-clusters {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  gap: 0;
  padding: 0;
}
.bpcb-cluster-list {
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: center;
}
.bpcb-cluster-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.bpcb-cluster-item:last-child { border-bottom: none; }
.bpcb-cluster-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--yellow-dark);
  font-family: var(--font-sans);
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

/* Story quote preview */
.book-preview-story {
  background: var(--yellow);
  justify-content: flex-start;
}
.bpcb-quote-mark {
  font-family: var(--font-serif);
  font-size: 60px;
  color: var(--ink);
  line-height: 0.7;
  margin-bottom: 12px;
}
.bpcb-quote-text {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.45;
}

/* ============================================================ */
/* HEALTH CHECK — INTRO BLOCK                                    */
/* ============================================================ */
.health-intro {
  margin-bottom: var(--gap);
  padding: 12px 16px;
  border-left: 3px solid var(--yellow);
  background: var(--bg-soft);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.health-intro p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-soft);
  margin: 0;
}

/* ============================================================ */
/* ENCODE — WORD BANK INSTRUCTION LINE                           */
/* ============================================================ */
.word-bank-instruction {
  font-size: 13px;
  color: var(--text-light);
  font-style: italic;
  margin: 0 0 var(--gap) 0;
  padding: 8px 12px;
  background: var(--bg-soft);
  border-radius: var(--r-sm);
  border-left: 2px solid var(--yellow);
}

/* ============================================================ */
/* EMAIL CAPTURE FORM                                            */
/* ============================================================ */
.email-capture {
  margin-top: var(--gap-xl);
  background: var(--ink);
  border-radius: var(--r);
  padding: 28px 40px;
}
.email-capture-inner {
  display: flex;
  align-items: center;
  gap: var(--gap-lg);
  flex-wrap: wrap;
}
.email-capture-text {
  flex-shrink: 0;
}
.email-capture-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--yellow);
  margin-bottom: 4px;
}
.email-capture-sub {
  font-size: 14px;
  color: #aaa;
  margin: 0;
}
.email-capture-form {
  flex: 1;
}
.email-capture-fields {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.email-capture-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 140px;
}
.email-capture-field label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #888;
}
.email-capture-field input {
  padding: 11px 14px;
  font-size: 14px;
  border: 1px solid #333;
  border-radius: var(--r-sm);
  background: #1a1a1a;
  color: var(--bg);
  font-family: var(--font-sans);
  transition: border-color 0.15s ease;
  width: 100%;
  box-sizing: border-box;
}
.email-capture-field input::placeholder { color: #555; }
.email-capture-field input:focus {
  outline: none;
  border-color: var(--yellow);
}
.email-capture-btn {
  padding: 11px 22px;
  background: var(--yellow);
  color: var(--ink);
  border: none;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
  font-family: var(--font-sans);
  flex-shrink: 0;
}
.email-capture-btn:hover { background: #e6ad00; }
.email-capture-success {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: #1a1a1a;
  border-radius: var(--r-sm);
  border: 1px solid #333;
}
.email-capture-success-icon {
  width: 36px;
  height: 36px;
  background: var(--yellow);
  color: var(--ink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}
.email-capture-success-text {
  font-size: 15px;
  color: var(--bg);
  font-weight: 600;
}
@media (max-width: 640px) {
  .email-capture { padding: 24px 20px; }
  .email-capture-inner { flex-direction: column; align-items: stretch; }
  .email-capture-fields { flex-direction: column; }
}

/* ============================================================ */
/* DECODE — FILTERS TOGGLE                                       */
/* ============================================================ */
.decode-search-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}
.decode-search-row .search-wrap {
  flex: 1;
}
.filters-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-soft);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  font-family: var(--font-sans);
  height: 48px;
}
.filters-toggle:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.filters-toggle.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--yellow);
}
.filters-toggle-icon {
  font-size: 11px;
}
.decode-filters {
  margin-top: 4px;
}

/* ============================================================ */
/* BOTTOM SECTIONS — SHARED STACK                                */
/* ============================================================ */
.bottom-section {
  margin-top: var(--gap-lg);
}

/* ============================================================ */
/* SHARE SECTION                                                 */
/* ============================================================ */
.share-section {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-top: 3px solid var(--ink);
  border-radius: var(--r);
  padding: 28px 40px;
}
.share-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-lg);
  flex-wrap: wrap;
}
.share-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-light);
  margin-bottom: 6px;
}
.share-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  line-height: 1.3;
}
.share-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.share-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-sans);
  border: 2px solid var(--ink);
  white-space: nowrap;
}
.share-btn-main {
  background: var(--ink);
  color: var(--yellow);
}
.share-btn-main:hover {
  background: var(--yellow);
  color: var(--ink);
  border-color: var(--yellow);
}
.share-btn-copy {
  background: var(--bg);
  color: var(--ink);
}
.share-btn-copy:hover {
  background: var(--ink);
  color: var(--yellow);
}
.share-btn-icon {
  font-size: 16px;
}
@media (max-width: 640px) {
  .share-section { padding: 24px 20px; }
  .share-inner { flex-direction: column; }
  .share-actions { width: 100%; }
  .share-btn { flex: 1; justify-content: center; }
}

.tab-book-cta-desc {
  font-size: 13px;
  line-height: 1.7;
  color: #555;
  margin: 0;
}

/* ============================================================ */
/* REAL IMAGE STYLES                                             */
/* ============================================================ */
.book-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--r);
  box-shadow: 8px 12px 32px rgba(0,0,0,0.2);
  display: block;
}
.book-author-img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: var(--r);
  display: block;
}
.book-preview-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 0;
  display: block;
  border-bottom: 1px solid var(--line);
}
.tab-cta-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}
.tab-cta-cover-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  height: 100%;
  padding: 16px 12px;
  box-sizing: border-box;
}

/* ============================================================ */
/* HEALTH REPORT — PRINT BUTTON & REPORT HEADER                  */
/* ============================================================ */
.health-report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--yellow);
}
.health-report-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.health-report-j {
  font-family: var(--font-serif);
  font-size: 32px;
  font-style: italic;
  font-weight: 700;
  color: var(--yellow);
  background: var(--ink);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  flex-shrink: 0;
}
.health-report-brand-text { display: flex; flex-direction: column; gap: 2px; }
.health-report-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}
.health-report-sub {
  font-size: 11px;
  color: var(--text-light);
  font-style: italic;
}
.health-report-date {
  font-size: 12px;
  color: var(--text-light);
  font-style: italic;
}
.health-formula-reminder {
  background: var(--ink);
  color: var(--bg);
  padding: 16px 20px;
  border-radius: var(--r-sm);
  margin-top: var(--gap);
}
.health-formula-reminder-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #888;
  margin-bottom: 6px;
}
.health-formula-reminder-expr {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--yellow);
  line-height: 1.5;
}
.health-report-footer {
  margin-top: var(--gap);
  padding-top: var(--gap);
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--text-light);
  font-style: italic;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.health-result-actions {
  display: flex;
  gap: 12px;
  margin-top: var(--gap-md);
  flex-wrap: wrap;
}
.health-print-btn {
  padding: 14px 24px;
  background: var(--ink);
  color: var(--yellow);
  border: none;
  border-radius: var(--r-sm);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all 0.15s ease;
}
.health-print-btn:hover {
  background: var(--yellow);
  color: var(--ink);
}

/* ============================================================ */
/* PRINT STYLES                                                   */
/* ============================================================ */
/* Print styles handled via dedicated print window in app.js */

/* ============================================================ */
/* ABOUT — CLUSTER LOGIC DIAGRAM                                 */
/* ============================================================ */
.cluster-logic-diagram {
  margin: var(--gap) 0 var(--gap-lg);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--gap-md);
  background: var(--bg-soft);
  max-width: 680px;
}

/* ============================================================ */
/* WAITLIST CTA                                                   */
/* ============================================================ */
.tab-waitlist-cta {
  margin-top: var(--gap-lg);
  padding: 24px 32px;
  background: var(--yellow-soft);
  border: 1px solid var(--yellow);
  border-top: 3px solid var(--yellow-dark);
  border-radius: var(--r);
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}
.tab-waitlist-cover {
  background: var(--ink);
  border-radius: 4px;
  width: 160px;
  flex-shrink: 0;
  aspect-ratio: 2/3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
  text-align: center;
  box-shadow: 6px 10px 24px rgba(0,0,0,0.25);
  overflow: hidden;
}
.tab-waitlist-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 260px;
}
.tab-waitlist-eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--yellow-dark);
  margin-bottom: 4px;
}
.tab-waitlist-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  line-height: 1.25;
}
.tab-waitlist-desc {
  font-size: 13px;
  color: #555;
  line-height: 1.7;
  margin: 0;
}
.tab-waitlist-form { width: 100%; }
.tab-waitlist-fields {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: stretch;
}
.tab-waitlist-field {
  flex: 1;
  min-width: 140px;
}
.tab-waitlist-field input {
  width: 100%;
  padding: 11px 14px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: var(--r-sm);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}
.tab-waitlist-field input:focus {
  outline: none;
  border-color: var(--ink);
}
.tab-waitlist-btn {
  padding: 11px 22px;
  background: var(--ink);
  color: var(--yellow);
  border: none;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font-sans);
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.tab-waitlist-btn:hover {
  background: var(--yellow);
  color: var(--ink);
}
@media (max-width: 700px) {
  .tab-waitlist-cta { flex-direction: column; padding: 20px; }
  .tab-waitlist-cover { width: 100px; }
  .tab-waitlist-fields { flex-direction: column; }
  .tab-waitlist-btn { width: 100%; }
}
