/* ─── Google Fonts (must be first) ─────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400&display=swap');

/* ═══════════════════════════════════════════════════════
   Human Design Website · Core Styles
   Tone: intelligent, grounded, slightly provocative
   Dark, clean, philosophical
   ═══════════════════════════════════════════════════════ */

/* ─── Reset & Base ─────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Colors · dark with warm accents */
  --bg-deep: #0a0a0f;
  --bg-card: #12121a;
  --bg-surface: #1a1a26;
  --bg-hover: #222233;
  
  --text-primary: #e8e6e1;
  --text-secondary: #9a9690;
  --text-muted: #5a5854;
  
  --accent: #c49a6c;
  --accent-dim: #8a6d4d;
  --accent-glow: rgba(196, 154, 108, 0.15);
  --accent-bright: #E8C170;

  /* Design (unconscious / subconscious) side · red, HD convention. Matches the
     body-linework design markers (bodygraph-claude barDesign). Personality stays gold. */
  --design-red: #E0564D;
  --design-red-tint: rgba(224, 86, 77, 0.2);

  /* Cover / launch tones · home & marketing surfaces */
  --bg-launch: #0E0B1F;
  --cover-vig-1: #1A1530;
  --cover-vig-2: #0E0B1F;
  --cover-vig-3: #08060F;
  
  --border: #2a2a38;
  --border-light: #333344;
  
  /* Type colors for HD types */
  --type-generator: #e8a838;
  --type-mg: #e87038;
  --type-manifestor: #c83838;
  --type-projector: #3888c8;
  --type-reflector: #88c888;
  
  /* Typography */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 2rem;
  --space-xl: 4rem;
  --space-2xl: 8rem;
  
  /* Layout */
  --max-width: 1200px;
  --content-width: 720px;
  --nav-height: 72px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
}

/* ─── Typography ───────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.2;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  margin-bottom: var(--space-lg);
}

h2 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  margin-bottom: var(--space-md);
}

h3 {
  font-size: 1.4rem;
  margin-bottom: var(--space-sm);
}

p {
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--text-primary);
}

strong {
  color: var(--text-primary);
  font-weight: 600;
}

em {
  font-style: italic;
  color: var(--accent-dim);
}

blockquote {
  border-left: 2px solid var(--accent);
  padding-left: var(--space-lg);
  margin: var(--space-lg) 0;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* ─── Navigation ───────────────────────────────────────── */

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(10, 10, 15, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
}

.nav-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  z-index: 101;
}

.nav-logo {
  height: 56px;
  width: auto;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-brand:hover .nav-logo {
  transform: scale(1.03);
  opacity: 0.9;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links > li {
  position: relative;
}

.nav-links > li > a,
.nav-dropdown-trigger {
  color: var(--text-secondary);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.2s;
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.nav-links > li > a:hover,
.nav-links > li > a.active,
.nav-dropdown-trigger:hover,
.nav-dropdown-trigger.active {
  color: var(--accent);
}

/* ─── Nav Dropdown ─────────────────────────────────────── */

.nav-dropdown-trigger {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.dropdown-chevron {
  transition: transform 0.2s ease;
}

.nav-dropdown.open .dropdown-chevron {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 200px;
  padding: 0.5rem 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.nav-dropdown.open .nav-dropdown-menu {
  display: block;
  opacity: 1;
  visibility: visible;
}

.nav-dropdown-menu li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-transform: none;
  letter-spacing: 0.02em;
  transition: background 0.15s, color 0.15s;
}

.nav-dropdown-menu li a:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.nav-dropdown-menu .nav-coming-soon {
  cursor: not-allowed;
  opacity: 0.5;
}

.nav-dropdown-menu .nav-coming-soon:hover {
  background: transparent;
  color: var(--text-secondary);
}

.tbd-badge {
  font-size: 0.65rem;
  background: var(--bg-surface);
  color: var(--text-muted);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 0.35rem 0;
}

/* ─── Calculator Sub-Nav ──────────────────────────────── */

.calc-subnav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.5rem;
  margin-top: var(--nav-height, 72px);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.calc-subnav a {
  display: inline-block;
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 20px;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
  border: 1px solid transparent;
}

.calc-subnav a:hover {
  color: var(--text-primary);
  background: var(--bg-surface);
}

.calc-subnav a.active {
  color: var(--bg-deep);
  background: var(--accent);
  font-weight: 600;
}

@media (max-width: 600px) {
  .calc-subnav {
    padding: 0.5rem 0.75rem;
    gap: 0.35rem;
  }
  .calc-subnav a {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
  }
}

/* ─── User Menu ────────────────────────────────────────── */

.nav-user {
  position: relative;
  margin-left: 0.5rem;
}

.user-icon-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.2s, border-color 0.2s;
  padding: 0;
}

.user-icon-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 160px;
  padding: 0.5rem 0;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  flex-direction: column;
}

.user-dropdown.open {
  display: flex;
}

.user-dropdown a,
.user-dropdown button {
  display: block;
  width: 100%;
  padding: 0.6rem 1rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
  letter-spacing: 0.03em;
}

.user-dropdown a:hover,
.user-dropdown button:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 0.35rem 0;
}

.dropdown-upgrade-link {
  color: var(--accent) !important;
}

/* ─── Nav Right Controls (user icon + burger) ─────────── */

.nav-right-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 102;
}

/* Desktop: hide user icon from controls, show in nav-links */
.nav-right-controls > .nav-user {
  display: none;
}

/* Desktop inline user icon in nav-links: smaller */
.nav-user--inline {
  display: flex;
  align-items: center;
}

.nav-user--inline .user-icon-btn {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
}

.nav-user--inline .user-icon-btn svg {
  width: 18px;
  height: 18px;
}

/* ─── Mobile Nav Toggle (Hamburger) ────────────────────── */

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 101;
}

.hamburger-line {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle.active .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ─── Layout ───────────────────────────────────────────── */

main {
  padding-top: var(--nav-height);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.content {
  max-width: var(--content-width);
  margin: 0 auto;
}

.section {
  padding: var(--space-2xl) 0;
}

.section + .section {
  border-top: 1px solid var(--border);
}

/* ─── Hero ─────────────────────────────────────────────── */

.hero {
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  position: relative;
}

.hero h1 {
  max-width: 800px;
}

.hero .subtitle {
  font-size: clamp(1rem, 2vw, 1.3rem);
  color: var(--text-secondary);
  max-width: 600px;
  margin-bottom: var(--space-xl);
}

.hero-line {
  width: 60px;
  height: 1px;
  background: var(--accent);
  margin: var(--space-lg) auto;
}

/* ─── Cards ────────────────────────────────────────────── */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-lg);
  margin: var(--space-xl) 0;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: var(--space-lg);
  transition: border-color 0.3s, transform 0.2s;
}

.card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-2px);
}

.card h3 {
  margin-bottom: var(--space-sm);
}

.card .tag {
  display: inline-block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: var(--space-md);
}

/* ─── Buttons ──────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.75rem 2rem;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-family: var(--font-body);
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-deep);
}

.btn-primary:hover {
  background: var(--text-primary);
  color: var(--bg-deep);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-outline:hover {
  background: var(--accent-glow);
  color: var(--text-primary);
  border-color: var(--text-primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
}

.btn-ghost:hover {
  color: var(--accent);
}

/* ─── Forms ────────────────────────────────────────────── */

.form-group {
  margin-bottom: var(--space-md);
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-md);
}

/* ─── Chart Display ────────────────────────────────────── */

.chart-result {
  display: none;
  margin-top: var(--space-sm);
}

.chart-result.visible {
  display: block;
}

.chart-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.chart-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: var(--space-md) var(--space-lg);
  text-align: center;
}

.chart-stat .label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.chart-stat .value {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--accent);
}

.chart-planets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

.planet-table {
  width: 100%;
  border-collapse: collapse;
}

.planet-table th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border);
}

.planet-table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.planet-table .gate-cell {
  font-family: var(--font-mono);
  color: var(--accent);
}

.personality-label {
  color: var(--text-primary);
  font-weight: 600;
}

.design-label {
  color: var(--design-red);
  font-weight: 600;
}

/* ─── Centers Visualization ────────────────────────────── */

.centers-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  max-width: 300px;
  margin: var(--space-lg) auto;
}

.center-node {
  aspect-ratio: 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 2px solid var(--border);
  transition: all 0.3s;
}

.center-node.defined {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent);
}

.center-node.undefined {
  background: transparent;
  border-color: var(--border);
  color: var(--text-muted);
}

/* ─── Channels List ────────────────────────────────────── */

.channel-list {
  list-style: none;
}

.channel-list li {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.channel-list .channel-key {
  font-family: var(--font-mono);
  color: var(--accent);
  min-width: 60px;
}

.channel-list .channel-name {
  font-weight: 600;
  color: var(--text-primary);
}

.channel-list .channel-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ─── Calculator Sub-Nav ───────────────────────────────── */

.calc-subnav {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding-top: var(--nav-height);
}

.calc-subnav-inner {
  display: flex;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.calc-subnav-link {
  padding: 0.4rem 0.9rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 6px;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}

.calc-subnav-link:hover {
  color: var(--text-primary);
  background: var(--bg-surface);
}

.calc-subnav-link.active {
  color: var(--accent);
  background: rgba(196, 154, 108, 0.1);
  font-weight: 600;
}

@media (max-width: 768px) {
  .calc-subnav-inner {
    justify-content: flex-start;
    gap: 2px;
    padding: var(--space-xs) var(--space-sm);
  }
  .calc-subnav-link {
    font-size: 0.78rem;
    padding: 0.35rem 0.65rem;
  }
}

/* ─── Footer ───────────────────────────────────────────── */

footer {
  border-top: 1px solid var(--border);
  padding: var(--space-xl) var(--space-lg);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

footer p {
  color: var(--text-muted);
}

.footer-social { display: flex; justify-content: center; gap: 1rem; }
.footer-social a { color: var(--text-muted); transition: color 0.2s; }
.footer-social a:hover { color: var(--accent); }
.footer-social svg { width: 20px; height: 20px; }

/* ─── Utility ──────────────────────────────────────────── */

.text-center { text-align: center; }
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: var(--space-md); }
.mt-2 { margin-top: var(--space-lg); }
.mt-4 { margin-top: var(--space-xl); }
.mb-1 { margin-bottom: var(--space-md); }
.mb-2 { margin-bottom: var(--space-lg); }

.divider {
  width: 40px;
  height: 1px;
  background: var(--accent);
  margin: var(--space-xl) auto;
}

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Loading ──────────────────────────────────────────── */

.loading {
  display: none;
  text-align: center;
  padding: var(--space-xl);
}

.loading.visible {
  display: block;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto var(--space-md);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── Responsive ───────────────────────────────────────── */

/* Tablet (landscape) */
@media (max-width: 1024px) {
  nav {
    padding: 0 var(--space-md);
  }
  
  .nav-links {
    gap: var(--space-sm);
  }
  
  .nav-links > li > a,
  .nav-dropdown-trigger {
    font-size: 0.75rem;
    padding: 0.4rem 0.5rem;
  }
  
  .nav-logo {
    height: 38px;
  }
}

/* Tablet (portrait) and Mobile */
@media (max-width: 768px) {
  nav {
    padding: 0 var(--space-md);
  }
  
  .nav-logo {
    height: 36px;
  }
  
  nav {
    overflow: visible;
  }

  .nav-toggle {
    display: flex;
  }

  /* Mobile: show user icon in controls, hide from nav-links */
  .nav-right-controls > .nav-user {
    display: flex;
  }

  .nav-user--inline {
    display: none !important;
  }


  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100vh - var(--nav-height));
    background: #0a0a0f;
    flex-direction: column;
    padding: 0;
    gap: 0;
    overflow-y: auto;
    border-bottom: none;
    z-index: 101;
  }

  .nav-links.open {
    display: flex !important;
    flex-direction: column !important;
  }

  .nav-links > li {
    border-bottom: 1px solid var(--border);
  }

  .nav-links > li:last-child {
    border-bottom: none;
  }

  .nav-links > li > a {
    display: block;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    color: var(--text-secondary);
    text-decoration: none;
  }

  .nav-links > li > a:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.03);
  }


  .chart-planets {
    grid-template-columns: 1fr;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem 0.5rem;
  }
  
  .footer-links a {
    white-space: nowrap;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  nav {
    padding: 0 var(--space-sm);
  }
  
  .nav-logo {
    height: 32px;
  }
  
  .nav-links > li > a,
  .nav-dropdown-trigger {
    font-size: 0.95rem;
  }
}

/* ─── (Google Fonts loaded at top of file) ─────────────── */

/* ─── Bodygraph Mobile Responsiveness ────────────────── */

@media (max-width: 480px) {
  .bodygraph-container {
    max-width: 100%;
    padding: 0 var(--space-sm);
    margin: var(--space-md) auto;
  }
  
  .bodygraph-legend {
    font-size: 0.65rem;
    gap: var(--space-sm);
  }
  
  /* Make gate pills slightly larger for touch */
  .gate-pill-clickable {
    transform-origin: center;
  }
  
  /* Improve touch targets */
  .gate-pill-clickable rect {
    stroke-width: 0.8;
  }
}

/* ─── Gate Pill Hover Effects ──────────────────────────── */

.gate-pill-clickable:hover .gate-hover {
  fill: rgba(196, 154, 108, 0.25) !important;
}

.gate-pill-clickable:hover text {
  fill: var(--accent) !important;
}

.gate-pill-clickable:active {
  opacity: 0.8;
}

/* Touch feedback for mobile - highlight touch target area */
@media (hover: none) and (pointer: coarse) {
  .gate-pill-clickable:active .gate-touch-target {
    fill: rgba(196, 154, 108, 0.15) !important;
  }
  
  .gate-pill-clickable:active text {
    fill: var(--accent) !important;
  }
}

/* Keyboard focus styles for accessibility */
.gate-pill-clickable:focus {
  outline: none;
}

.gate-pill-clickable:focus .gate-hover {
  fill: rgba(196, 154, 108, 0.3) !important;
}

.gate-pill-clickable:focus text {
  fill: var(--accent) !important;
}

/* ─── Center Hover Effects ─────────────────────────────── */

.ctr g:hover polygon,
.ctr g:hover rect {
  filter: brightness(1.15);
}

/* ─── Bodygraph Channel Animations ─────────────────────── */

/* Subtle glow pulse for defined channels on load */
@keyframes channelGlow {
  0% {
    filter: drop-shadow(0 0 0px transparent);
  }
  40% {
    filter: drop-shadow(0 0 4px currentColor);
  }
  100% {
    filter: drop-shadow(0 0 0px transparent);
  }
}

.ch-on line {
  animation: channelGlow 1.5s ease-out;
  animation-delay: calc(var(--channel-index, 0) * 0.08s);
}

/* Subtle breathing effect for defined centers */
@keyframes centerBreath {
  0%, 100% {
    filter: url(#glow);
  }
  50% {
    filter: url(#glow) brightness(1.1);
  }
}

.ctr g[filter] {
  animation: centerBreath 4s ease-in-out infinite;
  animation-delay: calc(var(--center-index, 0) * 0.3s);
}

/* ─── Circuit Diagram Container ────────────────────────── */

.chart-full-layout {
  display: flex;
  gap: var(--space-xl);
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
}

.circuit-container {
  flex: 1 1 100%;
  max-width: 100%;
  min-width: 240px;
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.circuit-svg {
  width: 100%;
  height: auto;
  min-height: 300px;
}

/* Layout for .bodygraph-with-activations, .activations-column, .bodygraph-center
   is defined in chart.css to avoid duplicate/conflicting rules */

.activations-label {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: var(--space-xs);
  text-align: left;
}

.design-label {
  color: var(--design-red);
}

.personality-label {
  color: #C0C0C0;
}

.activations-sublabel {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: -0.5rem;
  margin-bottom: var(--space-sm);
  text-align: left;
}

.activation-side-row {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  font-size: 0.9rem;
}

.gate-line-clickable {
  font-family: var(--font-mono);
  color: var(--accent);
  cursor: pointer;
  transition: color 0.2s ease;
  min-width: 3.2em;
  display: inline-block;
}

.gate-line-clickable:hover {
  color: var(--text-primary);
}

.planet-symbol {
  font-size: 0.9rem;
  opacity: 0.85;
}

.activation-angle {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  opacity: 0.6;
  min-width: 45px;
}

.design-column {
  align-items: flex-start;
}

.design-column .activation-angle {
  text-align: right;
}

.personality-column .activation-angle {
  text-align: left;
}

.design-column .activation-side-row {
  flex-direction: row;
}

.personality-column .activation-side-row {
  flex-direction: row-reverse;
}

/* .bodygraph-center layout is in chart.css */

@media (max-width: 768px) {
  .chart-full-layout {
    flex-direction: column;
    align-items: center;
  }

  .circuit-container {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
    order: 2;
  }

  .bodygraph-with-activations {
    order: 1;
    width: 100%;
  }

  .bodygraph-overlay-controls .overlay-btn {
    min-width: 90px;
    text-align: center;
  }
}

/* ─── Circuit Layout ───────────────────────────────────── */

.circuit-layout {
  display: flex;
  gap: var(--space-xl);
  align-items: flex-start;
  flex-wrap: wrap;
}

.circuit-diagram-container {
  flex: 1 1 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: var(--space-md);
  text-align: center;
}

.circuit-diagram-container .circuit-svg {
  width: 100%;
  height: auto;
  min-height: 400px;
}

.circuit-cards-container {
  flex: 1;
  min-width: 300px;
}

@media (max-width: 768px) {
  .circuit-layout {
    flex-direction: column;
  }
  
  .circuit-diagram-container {
    flex: 1 1 100%;
    max-width: 100%;
  }
  
  .circuit-cards-container {
    width: 100%;
  }
}

/* ─── Circuit Summary Styles ───────────────────────────── */

.circuit-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.circuit-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: var(--space-lg);
  transition: all 0.3s ease;
}

.circuit-card.circuit-active {
  border-color: var(--circuit-color, var(--accent));
  box-shadow: 0 0 20px rgba(var(--circuit-color, 196, 154, 108), 0.1);
}

.circuit-card.circuit-inactive {
  opacity: 0.6;
}

.circuit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.circuit-name {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--circuit-color, var(--text-primary));
  font-weight: 600;
}

.circuit-count {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: var(--bg-surface);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

.circuit-bar {
  height: 4px;
  background: var(--bg-surface);
  border-radius: 2px;
  margin-bottom: var(--space-md);
  overflow: hidden;
}

.circuit-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
}

.circuit-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-md);
}

.circuit-channels {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
}

.circuit-channel-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  transition: all 0.2s;
}

.circuit-channel-badge:hover {
  background: var(--bg-hover);
  border-color: var(--circuit-color, var(--accent));
}

/* ─── Integration Circuit Special Styling ─── */

.circuit-card.circuit-integration {
  background: linear-gradient(135deg, var(--bg-card), rgba(184, 134, 11, 0.08));
  border: 1px solid rgba(184, 134, 11, 0.4);
  position: relative;
  overflow: hidden;
}

.circuit-card.circuit-integration::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #4bc98a, #5ed9a0, #4bc98a);
}

.circuit-card.circuit-integration .circuit-name {
  color: #5ed9a0;
}

.circuit-card.circuit-integration .circuit-desc {
  font-style: italic;
}

.integration-badge {
  background: rgba(94, 217, 160, 0.15);
  border-color: #5ed9a0 !important;
}

/* ─── Circuit Diagram Interactivity ─── */

/* Channel hover effects */
.circuit-channel-group {
  transition: all 0.2s ease;
}

.circuit-channel-group:hover .circuit-channel-line {
  stroke: #E8D4B8;
  stroke-width: 3;
  filter: drop-shadow(0 0 4px rgba(232, 212, 184, 0.4));
}

.circuit-channel-group:hover .circuit-channel-label {
  fill: #E8D4B8;
  font-weight: 600;
}

.circuit-channel-group:hover .circuit-gate-num {
  fill: #E8D4B8;
}

.circuit-channel-group.highlighted .circuit-channel-line {
  stroke: #FFD700;
  stroke-width: 3;
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
}

/* Center node hover effects */
.circuit-center-group {
  transition: all 0.2s ease;
}

.circuit-center-group.defined:hover .circuit-center-rect {
  filter: drop-shadow(0 0 6px rgba(196, 154, 108, 0.5));
  stroke: #E8D4B8;
  stroke-width: 2;
}

.circuit-center-group:not(.defined):hover .circuit-center-rect {
  stroke: rgba(255, 255, 255, 0.3);
  stroke-width: 1.5;
}

/* Hanging gate hover */
.circuit-hanging-gate:hover {
  opacity: 1 !important;
}
.circuit-hanging-gate:hover rect {
  stroke: var(--accent);
  stroke-width: 1.2;
}
.circuit-hanging-gate:hover text {
  fill: var(--accent);
}

/* Open center hover */
.circuit-open-center:hover {
  opacity: 0.8 !important;
}
.circuit-open-center:hover rect {
  stroke: rgba(136, 200, 136, 0.5);
  stroke-width: 1.2;
}
.circuit-open-center:hover text {
  fill: rgba(136, 200, 136, 0.9);
}

/* Entry animation for channels · trace drawing effect */
@keyframes traceIn {
  0% {
    stroke-dashoffset: 600;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

.circuit-channel-line {
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
}

.circuit-channel-line.animate-in {
  animation: traceIn 0.8s ease-out forwards;
  animation-delay: calc(var(--channel-index, 0) * 0.1s);
}

/* Channel tooltip */
.circuit-tooltip {
  position: absolute;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: var(--text-primary);
  pointer-events: none;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.circuit-tooltip.visible {
  opacity: 1;
}

/* Mobile responsiveness for circuit summary */
@media (max-width: 768px) {
  .circuit-summary {
    grid-template-columns: 1fr;
  }
  
  .circuit-card {
    padding: var(--space-md);
  }
  
  .circuit-name {
    font-size: 1.1rem;
  }
}

/* ─── Profile Section Styles ─── */
.profile-section {
  margin-top: var(--space-xl);
}

.profile-lines-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.profile-line-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: var(--space-lg);
  transition: all 0.3s ease;
}

.profile-line-card.conscious {
  border-left: 4px solid #2a2a2a;
}

.profile-line-card.unconscious {
  border-left: 4px solid #c46c6c;
}

.profile-line-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.profile-line-number {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.profile-line-name {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}

.profile-line-type {
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: var(--bg-surface);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin-left: auto;
}

.profile-line-theme {
  font-size: 0.9rem;
  color: var(--accent);
  font-style: italic;
  margin-bottom: var(--space-sm);
}

.profile-line-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-md);
}

.profile-gifts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
}

.gifts-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-right: var(--space-xs);
}

.gift-tag {
  font-size: 0.75rem;
  color: var(--text);
  background: rgba(196, 154, 108, 0.15);
  border: 1px solid rgba(196, 154, 108, 0.3);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

/* Mobile responsiveness for profile section */
@media (max-width: 768px) {
  .profile-lines-grid {
    grid-template-columns: 1fr;
  }
  
  .profile-line-card {
    padding: var(--space-md);
  }
  
  .profile-line-number {
    font-size: 1.5rem;
  }
  
  .profile-line-name {
    font-size: 1rem;
  }
  
  .profile-line-type {
    margin-left: 0;
  }
}

/* ─── Hover Cross-Linking (Bodygraph <-> Activation Rows) ─── */
.activation-side-row.hover-highlight {
  background: rgba(196, 154, 108, 0.3);
  box-shadow: 0 0 12px rgba(196, 154, 108, 0.5);
  border-radius: 4px;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.activation-side-row {
  transition: background 0.15s ease, box-shadow 0.15s ease;
  padding: 2px 4px;
}

[id^="GateTextBg"].svg-hover-highlight circle,
[id^="GateTextBg"].svg-hover-highlight path {
  filter: brightness(2.5) drop-shadow(0 0 4px rgba(255, 255, 255, 1));
}

/* Senary bodygraph (ledger #182, senary-bodygraph.js): a soft gold disc under
   the gate number on hover and on reverse hover from the activation columns.
   iOS has no hover; this is the web's pointer affordance only. */
.senary-bodygraph .hd-gate .sb-gate-hit { transition: fill 0.15s ease; }
.senary-bodygraph .hd-gate:hover .sb-gate-hit,
.senary-bodygraph .hd-gate.svg-hover-highlight .sb-gate-hit { fill: rgba(233, 185, 106, 0.22); }
/* Keyboard focus on a gate (B154): the same disc with a gold ring. */
.senary-bodygraph .hd-gate:focus-visible .sb-gate-hit {
  fill: rgba(233, 185, 106, 0.22);
  stroke: #e9b96a;
}

/* ─── SVG Gate Hover Effect (all gates, including non-activated) ─── */
.hd-bodygraph svg [id^="GateTextBg"] {
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.hd-bodygraph svg [id^="GateTextBg"]:hover {
  filter: brightness(1.3) drop-shadow(0 0 4px rgba(196, 154, 108, 0.4));
  transform: scale(1.08);
  transform-origin: center;
  transform-box: fill-box;
}

/* ─── Gate Panel Activation Summary ─── */
#gate-panel-activations {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--bg-surface);
  border-radius: 8px;
  border: 1px solid var(--border);
}

#gate-panel-activations .activation-entry {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

#gate-panel-activations .activation-entry .act-planet-symbol {
  font-size: 1.1rem;
  min-width: 1.4rem;
  text-align: center;
}

#gate-panel-activations .activation-entry .act-planet-name {
  color: var(--text-secondary);
  min-width: 5rem;
}

#gate-panel-activations .activation-entry .act-type-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
}

#gate-panel-activations .activation-entry .act-type-label.design {
  background: var(--design-red-tint);
  color: var(--design-red);
}

#gate-panel-activations .activation-entry .act-type-label.personality {
  background: rgba(192, 192, 192, 0.15);
  color: #C0C0C0;
}

#gate-panel-activations .activation-entry .act-detail {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-left: auto;
}

/* ─── Bodygraph Overlay Controls ─── */
.bodygraph-overlay-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
  align-items: center;
  margin-top: var(--space-md);
}

.overlay-btn {
  font-family: var(--font-body);
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.overlay-btn:hover {
  background: var(--bg-surface);
  border-color: var(--text-muted);
}

.overlay-btn.active {
  border-color: var(--accent);
  color: var(--text-primary);
  background: rgba(196, 154, 108, 0.15);
}

/* ─── Chiron iOS Toggle ─── */
.chiron-row {
  /* no extra spacing · flush with other planet rows */
}

.chiron-row .chiron-ios-toggle {
  flex-shrink: 0;
}

.chiron-inactive {
  opacity: 0.5;
}

.chiron-label-text {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.chiron-ios-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}

.chiron-ios-toggle input[type="checkbox"] {
  display: none;
}

.chiron-toggle-slider {
  position: relative;
  width: 40px;
  height: 22px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  transition: background 0.25s ease, border-color 0.25s ease;
  flex-shrink: 0;
}

.chiron-toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform 0.25s ease, background 0.25s ease;
}

.chiron-ios-toggle input:checked + .chiron-toggle-slider {
  background: rgba(170, 85, 170, 0.3);
  border-color: #aa55aa;
}

.chiron-ios-toggle input:checked + .chiron-toggle-slider::after {
  transform: translateX(18px);
  background: #cc88cc;
}

.chiron-toggle-label {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--text-secondary);
  transition: color 0.15s ease;
}

.chiron-ios-toggle input:checked ~ .chiron-toggle-label {
  color: #cc88cc;
}

/* ─── Lilith iOS Toggle ─── */
.lilith-row {
  /* no extra spacing · flush with other planet rows */
}

.lilith-row .lilith-ios-toggle {
  flex-shrink: 0;
}

.lilith-inactive {
  opacity: 0.5;
}

.lilith-label-text {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.lilith-ios-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}

.lilith-ios-toggle input[type="checkbox"] {
  display: none;
}

.lilith-toggle-slider {
  position: relative;
  width: 40px;
  height: 22px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  transition: background 0.25s ease, border-color 0.25s ease;
  flex-shrink: 0;
}

.lilith-toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform 0.25s ease, background 0.25s ease;
}

.lilith-ios-toggle input:checked + .lilith-toggle-slider {
  background: rgba(138, 58, 58, 0.3);
  border-color: #8a3a3a;
}

.lilith-ios-toggle input:checked + .lilith-toggle-slider::after {
  transform: translateX(18px);
  background: #c45a5a;
}

.lilith-toggle-label {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--text-secondary);
  transition: color 0.15s ease;
}

.lilith-ios-toggle input:checked ~ .lilith-toggle-label {
  color: #c45a5a;
}

.ascendant-row {
  /* no extra spacing · flush with other planet rows */
}

.ascendant-row .ascendant-ios-toggle {
  flex-shrink: 0;
}

.ascendant-inactive {
  opacity: 0.5;
}

.ascendant-label-text {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.ascendant-ios-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}

.ascendant-ios-toggle input[type="checkbox"] {
  display: none;
}

.ascendant-toggle-slider {
  position: relative;
  width: 40px;
  height: 22px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  transition: background 0.25s ease, border-color 0.25s ease;
  flex-shrink: 0;
}

.ascendant-toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform 0.25s ease, background 0.25s ease;
}

.ascendant-ios-toggle input:checked + .ascendant-toggle-slider {
  background: rgba(212, 168, 67, 0.3);
  border-color: #d4a843;
}

.ascendant-ios-toggle input:checked + .ascendant-toggle-slider::after {
  transform: translateX(18px);
  background: #e8c473;
}

.ascendant-toggle-label {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--text-secondary);
  transition: color 0.15s ease;
}

.ascendant-ios-toggle input:checked ~ .ascendant-toggle-label {
  color: #e8c473;
}

/* ─── Optional-bodies pill row (Chiron / Lilith / Ascendant) ─── */
.optional-bodies-pills {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.25rem 0 1.25rem;
}

.body-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-surface);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.82rem;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.body-pill:hover {
  border-color: var(--text-muted);
}

.body-pill input[type="checkbox"] {
  display: none;
}

.body-pill-glyph {
  font-size: 1rem;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.18s ease;
}

.body-pill-label {
  font-weight: 500;
}

/* Active states · each body keeps its accent color */
.body-pill.active {
  color: #fff;
}
.body-pill.active .body-pill-glyph {
  opacity: 1;
}

.chiron-pill.active {
  background: rgba(170, 85, 170, 0.18);
  border-color: #aa55aa;
  color: #d98fd9;
  box-shadow: 0 0 0 1px rgba(170, 85, 170, 0.25) inset;
}
.lilith-pill.active {
  background: rgba(138, 58, 58, 0.18);
  border-color: #c45a5a;
  color: #e09393;
  box-shadow: 0 0 0 1px rgba(196, 90, 90, 0.25) inset;
}
.ascendant-pill.active {
  background: rgba(212, 168, 67, 0.18);
  border-color: #d4a843;
  color: #e8c473;
  box-shadow: 0 0 0 1px rgba(212, 168, 67, 0.25) inset;
}

/* ─── Overlay Section Labels ─── */
.overlay-section-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 0.15rem;
  flex-basis: 100%;
  margin-top: 0.35rem;
}

.overlay-section-label:first-child {
  margin-top: 0;
}

/* ─── Wearables: Connected Devices ────────────────────────── */
.wearables-intro {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0 0 0.75rem;
}
.wearables-intro .privacy {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}
.wearables-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.wearable-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.95rem 1.05rem;
  transition: border-color 0.2s, opacity 0.2s;
}
.wearable-card.coming-soon {
  opacity: 0.7;
}
.wearable-card.connected {
  border-color: rgba(196, 154, 108, 0.45);
}
.wearable-card.error {
  border-color: rgba(200, 56, 56, 0.55);
  background: rgba(200, 56, 56, 0.05);
}
.wearable-card-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.wearable-logo {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}
.wearable-logo svg { width: 100%; height: 100%; }
.wearable-meta {
  flex: 1;
  min-width: 140px;
}
.wearable-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.wearable-tagline {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0.1rem 0 0;
}
.wearable-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.wearable-btn {
  background: var(--accent);
  color: var(--bg-deep);
  border: none;
  padding: 0.45rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  font-family: inherit;
}
.wearable-btn:hover { opacity: 0.9; }
.wearable-btn:disabled { opacity: 0.45; cursor: wait; }
.wearable-btn.secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.wearable-btn.secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.wearable-btn.danger {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.wearable-btn.danger:hover {
  border-color: #c83838;
  color: #c83838;
}
.wearable-coming-pill {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(154, 150, 144, 0.12);
  color: var(--text-muted);
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  font-weight: 600;
}
.wearable-status-line {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0.45rem 0 0;
  flex-basis: 100%;
}
.wearable-status-line.error-msg {
  color: #e87070;
}
.wearable-howto {
  margin-top: 0.75rem;
  border-top: 1px dashed var(--border);
  padding-top: 0.65rem;
}
.wearable-howto summary {
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.85rem;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  user-select: none;
}
.wearable-howto summary::-webkit-details-marker { display: none; }
.wearable-howto summary::before {
  content: '▸';
  display: inline-block;
  transition: transform 0.15s;
  color: var(--text-muted);
  font-size: 0.7rem;
}
.wearable-howto[open] summary::before {
  transform: rotate(90deg);
}
.wearable-howto summary:hover {
  color: var(--accent);
}
.wearable-howto ol {
  margin: 0.55rem 0 0.45rem 1.25rem;
  padding: 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
}
.wearable-howto ol li { margin-bottom: 0.2rem; }
.wearable-howto .howto-link {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.82rem;
  color: var(--accent);
  text-decoration: none;
}
.wearable-howto .howto-link:hover { text-decoration: underline; }
.wearable-key-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.65rem;
  flex-wrap: wrap;
}
.wearable-key-form input:not([type="checkbox"]) {
  flex: 1;
  min-width: 180px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.65rem;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
}
.wearable-key-form input:not([type="checkbox"]):focus {
  outline: none;
  border-color: var(--accent);
}
.wearable-form-error {
  font-size: 0.82rem;
  color: #e87070;
  margin: 0.4rem 0 0;
}
.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  flex-basis: 100%;
  margin-top: 0.45rem;
}
.wearable-key-form > [data-uh-consent-error] { flex-basis: 100%; }
.consent-row input[type="checkbox"] {
  flex: 0 0 auto;
  margin: 0.2rem 0 0;
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
  cursor: pointer;
}
.consent-row label {
  flex: 1;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-secondary);
  cursor: pointer;
}
/* The legal-agreement row on the account-creation forms reuses .consent-row
   (register.html, the chart.html auth modal, chart-sidereal.html). It is the
   only consent row carrying inline document links, so the link colour lives
   here rather than being repeated per page. */
.consent-row label a {
  color: var(--accent);
  text-decoration: underline;
}
.consent-row label a:hover {
  color: var(--accent-bright);
}
.wearable-form-status {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0.4rem 0 0;
  font-style: italic;
}
.wearable-progress-bar {
  position: relative;
  width: 100%;
  height: 6px;
  background: var(--bg-card);
  border-radius: 3px;
  overflow: hidden;
  margin: 0.5rem 0 0;
}
.wearable-progress-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-dim));
  border-radius: 3px;
  transition: width 0.4s ease;
  width: 0;
}
.wearable-progress-bar.indeterminate > span {
  width: 35%;
  animation: wearable-indet 1.4s ease-in-out infinite;
}
@keyframes wearable-indet {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(285%); }
}
.wearable-not-config {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0.5rem 0 0;
  font-style: italic;
}

/* Disconnect modal */
.wearable-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 15, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}
.wearable-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 420px;
  width: 100%;
  padding: 1.5rem;
}
.wearable-modal h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}
.wearable-modal p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0 0 1rem;
}
.wearable-modal label {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  cursor: pointer;
}
.wearable-modal label input { margin-top: 0.2rem; }
.wearable-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}

/* TestFlight waitlist modal (re-uses .wearable-modal* scaffolding).
   The modal is a sibling of <main class="signal-main">, so signal.css's
   `.signal-main .signal-btn*` rules and `--sn-*` tokens don't reach it.
   The styles below mirror that look so the modal feels like the rest of
   the home page (Cosmic Pulse styling). */
#testflight-modal[hidden] { display: none; }
#testflight-modal .wearable-modal {
  background: #14102a;
  border: 1px solid rgba(214, 198, 255, 0.10);
  max-width: 440px;
  padding: 1.75rem 1.75rem 1.5rem;
  color: #ece6ff;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
#testflight-modal .wearable-modal h2 {
  margin: 0 0 0.4rem;
  font-family: 'Outfit', 'DM Sans', system-ui, sans-serif;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #ece6ff;
}
#testflight-modal .wearable-modal > p {
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #b8aee0;
  margin: 0 0 1.25rem;
}
#testflight-modal form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #b8aee0;
  margin-bottom: 0.85rem;
  cursor: text;
}
#testflight-modal form input[type="text"],
#testflight-modal form input[type="email"],
#testflight-modal form input[type="date"],
#testflight-modal form select,
#testflight-modal form textarea {
  background: #1c1740;
  color: #ece6ff;
  border: 1px solid rgba(214, 198, 255, 0.10);
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  font-size: 0.95rem;
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  letter-spacing: normal;
  text-transform: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
/* Native date picker: keep the calendar indicator legible on the dark card. */
#testflight-modal form input[type="date"] {
  color-scheme: dark;
}
#testflight-modal form input:focus,
#testflight-modal form select:focus,
#testflight-modal form textarea:focus {
  outline: none;
  border-color: #e9b96a;
  background: #221a4d;
}
#testflight-modal form textarea {
  resize: vertical;
  min-height: 64px;
}
/* "Other" selected → the free-text field reads as expected (still optional
   in validation). Label tint + warm border mirror the focus accent. */
#testflight-modal form .testflight-reason.is-expected {
  color: #e9b96a;
}
#testflight-modal form .testflight-reason.is-expected textarea {
  border-color: rgba(233, 185, 106, 0.55);
}
#testflight-modal .testflight-error {
  background: rgba(196, 80, 76, 0.14);
  border: 1px solid rgba(196, 80, 76, 0.5);
  color: #f4b8b8;
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  font-size: 0.85rem;
  margin: 0.25rem 0 0.9rem;
}
#testflight-modal .testflight-success p {
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #ece6ff;
  margin: 0 0 1.25rem;
}
#testflight-modal .wearable-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 0.5rem;
}
/* Buttons: mirror .signal-main .signal-btn* from signal.css so the modal
   buttons match the home-page hero CTAs. */
#testflight-modal .signal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.15rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  background: #1c1740;
  color: #ece6ff;
  border-color: rgba(214, 198, 255, 0.18);
}
#testflight-modal .signal-btn:hover {
  background: #2a2356;
}
#testflight-modal .signal-btn-primary {
  background: #e9b96a;
  color: #0c0917;
  border-color: #e9b96a;
}
#testflight-modal .signal-btn-primary:hover {
  background: #f3c876;
  border-color: #f3c876;
}
#testflight-modal .signal-btn-primary:disabled {
  opacity: 0.6;
  cursor: progress;
}
#testflight-modal .signal-btn-ghost {
  background: transparent;
  color: #b8aee0;
  border-color: rgba(214, 198, 255, 0.10);
}
#testflight-modal .signal-btn-ghost:hover {
  color: #ece6ff;
  border-color: rgba(214, 198, 255, 0.18);
}

@media (max-width: 600px) {
  .wearable-actions { width: 100%; }
  .wearable-actions .wearable-btn { flex: 1; }
}

/* ─── Global .eyebrow utility ──────────────────────────── */
.eyebrow {
  font-family: var(--font-body);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-bright);
  font-weight: 600;
  display: inline-block;
}

/* === Chart-page journey reframe (2026-06-10) ============================
   Token-aligned styles consumed by chart.js. Append-only so the diff
   stays merge-friendly against Pipeline C. */
.result-journey-eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}
.result-sun-signature {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  line-height: 1.2;
  margin-bottom: 0.4rem;
}

/* "This chart is temporary" · thin one-line sliver strip, sits directly under
   the birth-data topbar, spans full width, minimal vertical height. */
.ephemeral-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  width: 100%;
  margin: 0;
  padding: 0.35rem 1rem;
  background: rgba(196, 154, 108, 0.1);
  border-bottom: 1px solid var(--accent);
  font-size: 0.82rem;
  line-height: 1.2;
  text-align: center;
}
.ephemeral-notice .ephemeral-msg { color: var(--accent); font-weight: 600; }
.ephemeral-notice .ephemeral-sep { color: var(--text-muted); }
.ephemeral-notice .ephemeral-countdown { color: var(--text-muted); }
.ephemeral-notice .btn-primary {
  display: inline-block;
  background: var(--accent);
  color: var(--bg-primary);
  padding: 0.2rem 0.7rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.78rem;
  line-height: 1.3;
}
.ephemeral-notice .btn-primary:hover { opacity: 0.9; }

/* Optional-bodies (Chiron / Lilith / Ascendant) toggles · rendered as the very
   last element on the chart screen. */
.optional-bodies-footer {
  margin: 2.5rem 0 1rem;
  display: flex;
  justify-content: center;
}
.journey-planet-list {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
}
.journey-planet-list li {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  color: var(--text-primary);
  line-height: 1.45;
}
.journey-planet-list li:last-child { border-bottom: none; }
.journey-planet-list li .journey-planet-name strong {
  color: var(--accent);
  margin-right: 0.35rem;
}
.journey-planet-list li .journey-role {
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.journey-planet-list li .journey-gate-chip {
  margin-left: 0.5rem;
  font-size: 0.72rem;
}
.chart-card-suntag {
  display: inline-block;
  margin-left: 0.3rem;
  padding: 0.18rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.4;
}
.drawer-meta {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.95rem;
  margin: 0.15rem 0 0.5rem;
}
.dropdown-replay-journey-btn {
  display: block;
  padding: 0.55rem 1rem;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
}
.dropdown-replay-journey-btn:hover {
  background: var(--bg-card);
}


/* ─── Bodygraph perpendicular gate ticks ─── */
/* One short perpendicular line per planet activation at each gate.        */
/* Stack along the channel axis from startMid (badge end) toward endMid    */
/* (channel midpoint). Personality below centerpoint, design above.        */

.gate-tick {
  stroke-linecap: round;
  fill: none;
  pointer-events: none;
}
.gate-tick.personality { stroke: #000000; }
.gate-tick.design { stroke: #C5191D; }

/* In transit mode (chart-page transit overlay), override both types       */
/* with the existing cyan token so ticks stay legible.                     */
.hd-bodygraph--transit .gate-tick.personality,
.hd-bodygraph--transit .gate-tick.design {
  stroke: #00d4ff;
  filter: drop-shadow(0 0 4px rgba(0, 212, 255, 0.5));
}

/* Channel strip: semi-transparent fill polygon when BOTH endpoints active. */
.channel-strip {
  stroke: none;
  pointer-events: none;
}
.channel-strip.personality { fill: #000000; }
.channel-strip.design { fill: #C5191D; }
.channel-strip.semi-active { fill-opacity: 0.35; }
.channel-strip.split { fill-opacity: 0.35; }

.hd-bodygraph--transit .channel-strip {
  fill: #00d4ff;
  fill-opacity: 0.25;
}


/* ─── Gate hover tooltip (bodygraph) ───────────────────── */
.gate-hover-tooltip {
  position: absolute;
  z-index: 9999;
  max-width: 300px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  color: var(--text-primary);
  font-size: 0.8rem;
  line-height: 1.4;
  pointer-events: none;
}
.gate-hover-tooltip .ght-head {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-bottom: 5px;
}
.gate-hover-tooltip .ght-num {
  font-weight: 700;
  color: var(--accent-bright);
  font-size: 0.95rem;
}
.gate-hover-tooltip .ght-name {
  font-weight: 600;
  color: var(--text-primary);
}
.gate-hover-tooltip .ght-desc {
  color: var(--text-secondary, #b8b6b0);
  font-size: 0.76rem;
}
.gate-hover-tooltip .ght-desc.ght-loading {
  color: var(--text-muted);
  font-style: italic;
}
.gate-hover-tooltip .ght-acts {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.gate-hover-tooltip .ght-act {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px;
  font-size: 0.74rem;
}
.gate-hover-tooltip .ght-glyph {
  color: var(--accent);
  font-size: 0.85rem;
}
.gate-hover-tooltip .ght-planet { font-weight: 600; }
.gate-hover-tooltip .ght-planet-role {
  font-weight: 400;
  color: var(--text-muted);
}
.gate-hover-tooltip .ght-type {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 5px;
  border-radius: 4px;
}
.gate-hover-tooltip .ght-type-pers {
  background: rgba(196, 154, 108, 0.18);
  color: var(--accent-bright);
}
.gate-hover-tooltip .ght-type-design {
  background: rgba(120, 120, 160, 0.22);
  color: #b3b0d8;
}
.gate-hover-tooltip .ght-line {
  color: var(--accent);
  font-weight: 600;
}
.gate-hover-tooltip .ght-line-kn {
  flex-basis: 100%;
  color: var(--text-secondary, #b8b6b0);
  font-size: 0.72rem;
}

/* ─── Planet meaning sections (below the chart) ───────────────────────────
   Static plain-text blocks that replace the blocking Doorway carousel. One per
   planet in Eva's narrative order. */
.chart-planet-sections {
  max-width: 760px;
  margin: 3rem auto 1rem;
  padding: 0 1rem;
}
.cps-section-header {
  text-align: center;
  margin-bottom: 2rem;
}
.cps-section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}
.cps-section-sub {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0.4rem 0 0;
}
.cps-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.cps-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.4rem 1.5rem;
}
.cps-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}
.cps-glyph {
  font-size: 1.4rem;
  line-height: 1;
  color: var(--accent-bright);
}
.cps-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.cps-headline {
  font-size: 1.15rem;
  color: var(--text-primary);
  margin: 0 0 0.6rem;
  line-height: 1.3;
}
.cps-meaning p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0 0 0.5rem;
}
.cps-meaning p:last-child { margin-bottom: 0; }
.cps-detail {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.cps-gate-label {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent-bright);
  margin-bottom: 0.5rem;
}
.cps-line-label {
  color: var(--text-secondary);
  font-weight: 400;
}
.cps-gate-text,
.cps-line-text {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.55;
  margin: 0 0 0.5rem;
}
.cps-line-text { color: var(--text-primary); }
.cps-loading {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
  margin: 0;
}
.cps-drawer-link {
  display: inline-block;
  margin-top: 0.3rem;
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--accent-bright);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.35rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.cps-drawer-link:hover {
  background: rgba(196, 154, 108, 0.12);
  border-color: var(--accent);
}

/* ─── Intro block (conscious vs subconscious, the doorway) ─── */
.cps-intro {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.6rem 1.7rem;
  margin-bottom: 2rem;
}
.cps-intro-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.cps-intro-headline {
  font-size: 1.35rem;
  color: var(--text-primary);
  margin: 0 0 0.9rem;
  line-height: 1.25;
}
.cps-intro-p {
  color: var(--text-secondary);
  font-size: 0.94rem;
  line-height: 1.6;
  margin: 0 0 0.7rem;
}
.cps-intro-p:last-child { margin-bottom: 0; }

/* ─── Both activations, side by side (Design + Personality) ─── */
.cps-activations {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.cps-side {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.cps-side-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-bright);
}
/* Design (subconscious) side reads red, HD convention. Personality stays gold. */
.cps-side-design .cps-side-label { color: var(--design-red); }
.cps-side-personality .cps-side-label { color: var(--text-primary); }
.cps-side-note {
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0.02em;
}
.cps-side-gateline {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-primary);
}
.cps-side-title {
  color: var(--text-secondary);
  font-weight: 400;
}
.cps-side-text {
  color: var(--text-secondary);
  font-size: 0.86rem;
  line-height: 1.5;
  margin: 0.1rem 0 0.2rem;
}
.cps-side-none {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
}

/* ─── Closing Variables call-to-action ─── */
.cps-variables-cta {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.8rem 1.7rem;
  margin-top: 2rem;
  text-align: center;
}
.cps-variables-cta-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.cps-variables-cta-headline {
  font-size: 1.25rem;
  color: var(--text-primary);
  margin: 0 0 0.7rem;
  line-height: 1.3;
}
.cps-variables-cta-text {
  color: var(--text-secondary);
  font-size: 0.94rem;
  line-height: 1.6;
  margin: 0 auto 1.2rem;
  max-width: 46ch;
}
.cps-variables-cta-btn {
  display: inline-block;
  background: var(--accent);
  color: #1a140e;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.7rem 1.6rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.15s ease, transform 0.1s ease;
}
.cps-variables-cta-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  .cps-section { padding: 1.1rem 1.15rem; }
  .chart-planet-sections { margin-top: 2rem; }
  .cps-activations { grid-template-columns: 1fr; }
}

/* ─── Bodygraph legend (ledger #182, B153) ──────────────────────────────────
   chart.js writes one of two legends beside the bodygraph, chosen by the
   renderer that mounted: senary-bodygraph.js (chart page) gets the hub /
   channel / hanging-gate samples drawn the way it draws them; the older
   renderers (HdBodygraph on chart-sidereal.html, bodygraph-claude.js as a
   fallback) keep the Conscious / Unconscious / Both key their gate colours
   need. Shared here because both pages render the same markup. */
.bodygraph-legend .legend-swatch {
  width: 18px;
  height: 4px;
  border-radius: 2px;
}
/* Swatch colours are set inline by chart.js from the renderer that mounted. */
.bodygraph-legend-explain {
  flex-wrap: wrap;
  gap: var(--space-lg);
  margin-top: var(--space-sm);
  align-items: flex-start;
}
.bodygraph-legend-explain .legend-item {
  align-items: flex-start;
  gap: 0.5rem;
  max-width: 15rem;
}
.legend-text { display: flex; flex-direction: column; gap: 0.1rem; line-height: 1.3; }
.legend-term { color: var(--text-primary); font-weight: 600; }
.legend-desc { color: var(--text-muted); font-size: 0.7rem; }
/* senary-bodygraph.js: the Integration hub, a neutral ring with a solid core. */
.legend-hub {
  flex: 0 0 auto;
  position: relative;
  width: 12px; height: 12px;
  margin-top: 2px;
  border-radius: 50%;
  background: #1a1825;
  border: 1.5px solid rgba(200, 196, 208, 0.85);
  box-sizing: border-box;
}
.legend-hub::after {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: 4px; height: 4px;
  margin: -2px 0 0 -2px;
  border-radius: 50%;
  background: rgba(200, 196, 208, 0.85);
}
/* senary-bodygraph.js: flowing gold dots, as the channel streams draw them. */
.legend-dots {
  flex: 0 0 auto;
  width: 22px; height: 8px;
  margin-top: 4px;
  background: radial-gradient(circle, rgba(233, 185, 106, 0.95) 1.2px, rgba(233, 185, 106, 0.25) 2px, transparent 2.8px) 0 50% / 5px 8px repeat-x;
}
/* A hanging gate's stream fades towards the open end of its channel. */
.legend-dots.hanging {
  -webkit-mask-image: linear-gradient(90deg, #000 20%, transparent);
  mask-image: linear-gradient(90deg, #000 20%, transparent);
}
/* Older renderers: the gold four-pointed star hub and the tube samples. */
.legend-star {
  flex: 0 0 auto;
  width: 16px; height: 16px;
  margin-top: 1px;
  background: #A98467;
  clip-path: polygon(50% 0%, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0% 50%, 40% 40%);
}
.legend-tube {
  flex: 0 0 auto;
  width: 20px; height: 7px;
  margin-top: 5px;
  border-radius: 4px;
  box-sizing: border-box;
}
.legend-tube.complete {
  background: rgba(214, 178, 82, 0.80);
  border: 1px solid rgba(120, 92, 40, 0.55);
}
.legend-tube.hanging {
  background: rgba(201, 162, 75, 0.34);
  border: 1px solid rgba(120, 92, 40, 0.45);
  position: relative;
}
.legend-tube.hanging::after {
  content: '';
  position: absolute;
  right: -2px; top: 50%;
  transform: translateY(-50%);
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255, 241, 201, 0.95);
  box-shadow: 0 0 4px 1px rgba(255, 241, 201, 0.8);
}

/* ─── Your people: the person overlay on the chart page (ledger #175) ─────── */
.people-overlay {
  margin: 0 auto var(--space-md);
  max-width: 420px;
  font-size: 0.8rem;
  color: var(--text-secondary, #b8aee0);
}
.people-overlay-picker,
.people-overlay-state {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}
.people-overlay-title { color: var(--text-primary, #ece6ff); font-weight: 600; }
.people-overlay-message { margin: 0; color: var(--text-secondary, #9a9690); flex: 1 1 14rem; }
.people-overlay-select,
.people-overlay-retry,
.people-overlay-clear {
  font: inherit;
  color: var(--text-primary, #ece6ff);
  background: var(--bg-surface, #1c1740);
  border: 1px solid var(--border, #2e2754);
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
  min-height: 32px;
}
.people-overlay-select { flex: 1 1 10rem; }
.people-overlay-retry,
.people-overlay-clear { cursor: pointer; }
.people-overlay-retry:focus-visible,
.people-overlay-clear:focus-visible,
.people-overlay-select:focus-visible { outline: 2px solid #e9b96a; outline-offset: 2px; }
.people-overlay-strip { margin-top: 0.5rem; }
.people-overlay-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.4rem 0.35rem 0.75rem;
  border: 1px solid var(--border, #2e2754);
  border-radius: 999px;
  background: rgba(20, 16, 42, 0.92);
}
.people-overlay-key { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.75rem; }
.people-overlay-swatch,
.people-overlay-count { display: inline-flex; align-items: center; gap: 0.3rem; }
.people-overlay-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.people-overlay-counts { display: inline-flex; flex-wrap: wrap; gap: 0.5rem; }
.people-overlay-none { color: var(--text-secondary, #9a9690); }
.people-overlay-legend { margin-top: 0.5rem; }
.people-overlay-legend summary { cursor: pointer; color: var(--text-secondary, #b8aee0); }
.people-overlay-types,
.people-overlay-channels { list-style: none; margin: 0.5rem 0 0; padding: 0; display: grid; gap: 0.4rem; }
.people-overlay-types li,
.people-overlay-channels li { display: flex; align-items: flex-start; gap: 0.5rem; line-height: 1.35; }
.people-overlay-badge { flex: 0 0 auto; }

/* ─── Inside the web app (/app/astro) ───────────────────────────────────
   js/app-embed.js marks a chart page framed by the app; the app's own frame
   replaces the site's top bar and footer, so they go, and so does the room
   the page kept for the bar. */
html.sn-embedded { --nav-height: 0px; }
html.sn-embedded body > nav,
html.sn-embedded body > footer { display: none !important; }
/* The planetarium keeps 64px for the bar in its own stylesheet. */
html.sn-embedded .planetarium-page { padding-top: 0 !important; }
