/* ============================================================
   DUNE — Historic Controls Prototype
   A desert-inspired design system
   ============================================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400;1,600&family=JetBrains+Mono:wght@400;500;700&family=Outfit:wght@300;400;500;600;700&display=swap');

/* --- Design Tokens --- */
:root {
  /* Core palette */
  --sand-50:  #faf8f5;
  --sand-100: #f4efe8;
  --sand-200: #e8dfd4;
  --sand-300: #d4c5b0;
  --sand-400: #b8a48a;
  --sand-500: #9c8468;
  --sand-600: #7a6650;

  --dark-900: #1a1714;
  --dark-800: #242019;
  --dark-700: #2e2a22;
  --dark-600: #3a352b;
  --dark-500: #4a4438;

  --spice:      #c8956c;
  --spice-light:#dbb48e;
  --spice-dark: #a87248;

  --sage:       #6b8f71;
  --sage-light: #8fb396;
  --sage-dark:  #4f6e55;

  --terracotta:     #c17b4a;
  --terracotta-light:#d49a6f;

  --sienna:     #9c4040;
  --sienna-light:#b85a5a;

  /* Semantic */
  --bg:          var(--dark-900);
  --surface:     var(--sand-100);
  --surface-alt: var(--sand-200);
  --text:        var(--dark-900);
  --text-muted:  var(--sand-600);
  --text-inverse:#f4efe8;
  --accent:      var(--spice);
  --success:     var(--sage);
  --warning:     var(--terracotta);
  --danger:      var(--sienna);

  /* Legacy aliases (used by calculator JS for dynamic styling) */
  --green: var(--sage);
  --green-light: #dae8dc;
  --amber: var(--terracotta);
  --amber-light: #f0dcc8;
  --red: var(--sienna);
  --red-light: #e8d0d0;
  --accent: var(--spice);
  --accent-light: #f0dcc8;
  --border: var(--sand-300);
  --font: var(--font-body);
  --mono: var(--font-mono);
  --radius: var(--radius-md);
  --surface: white;
  --surface-alt: var(--sand-100);
  --text-muted: var(--sand-600);

  /* Typography */
  --font-display: 'Cormorant Garamond', 'Georgia', serif;
  --font-body:    'Outfit', 'Helvetica Neue', sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(26,23,20,0.08);
  --shadow-md: 0 4px 12px rgba(26,23,20,0.1);
  --shadow-lg: 0 8px 30px rgba(26,23,20,0.14);
  --shadow-glow: 0 0 20px rgba(200,149,108,0.15);

  /* Transitions */
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --duration: 0.25s;
}

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

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

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--sand-100);
  min-height: 100vh;
  position: relative;
}

/* Grain texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.25;
  color: var(--dark-900);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p { margin-bottom: var(--space-md); }
p:last-child { margin-bottom: 0; }

a {
  color: var(--spice-dark);
  text-decoration: none;
  transition: color var(--duration) var(--ease);
}

a:hover {
  color: var(--spice);
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--sand-200);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
  color: var(--spice-dark);
}

pre {
  background: var(--dark-800);
  color: var(--sand-200);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
}

pre code, .code-block code {
  background: none;
  padding: 0;
  color: inherit;
}

img { max-width: 100%; height: auto; }

/* --- Animations --- */
@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--sand-200);
}

::-webkit-scrollbar-thumb {
  background: var(--sand-400);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--sand-500);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--sand-400) var(--sand-200);
}

/* ============================================================
   NAVIGATION
   ============================================================ */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--dark-900);
  border-bottom: 1px solid var(--dark-600);
  padding: 0 var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-nav.scrolled {
  box-shadow: var(--shadow-md);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--sand-100);
  text-decoration: none;
  letter-spacing: 0.02em;
  padding: 0.75rem 0;
}

.nav-brand:hover {
  color: var(--spice-light);
}

.nav-brand-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--spice), var(--terracotta));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
  font-weight: 700;
}

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

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--sand-400);
  text-decoration: none;
  transition: all var(--duration) var(--ease);
  border-bottom: 2px solid transparent;
}

.nav-link:hover {
  color: var(--sand-100);
  background: rgba(255,255,255,0.05);
}

.nav-link.active {
  color: var(--spice-light);
  border-bottom-color: var(--spice);
  font-weight: 600;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
  color: var(--sand-400);
  font-size: 1.4rem;
}

/* ============================================================
   LAYOUT
   ============================================================ */

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

.container-wide {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
}

/* ============================================================
   HERO
   ============================================================ */

.hero {
  background: linear-gradient(
    165deg,
    var(--dark-900) 0%,
    var(--dark-800) 40%,
    var(--dark-700) 100%
  );
  color: var(--text-inverse);
  padding: var(--space-3xl) 0;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 70% 20%, rgba(200,149,108,0.1) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 20% 80%, rgba(107,143,113,0.06) 0%, transparent 50%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--spice), transparent);
  opacity: 0.3;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  animation: fadeSlideIn 0.6s var(--ease) both;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  color: var(--sand-100);
  line-height: 1.15;
  margin-bottom: var(--space-md);
  letter-spacing: -0.01em;
}

.hero .subtitle {
  font-size: 1.15rem;
  font-weight: 300;
  color: var(--sand-300);
  line-height: 1.6;
  max-width: 560px;
  margin-bottom: var(--space-xl);
}

.hero-epigraph {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-style: italic;
  color: var(--sand-400);
  margin-bottom: var(--space-md);
  letter-spacing: 0.02em;
}

.hero-actions {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */

.page-header {
  background: linear-gradient(
    170deg,
    var(--dark-900) 0%,
    var(--dark-800) 100%
  );
  color: var(--text-inverse);
  padding: var(--space-2xl) 0 var(--space-xl);
  position: relative;
}

.page-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--spice), transparent);
  opacity: 0.25;
}

.page-header-inner {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  animation: fadeSlideIn 0.5s var(--ease) both;
}

.page-header-inner h1 {
  font-family: var(--font-display);
  font-size: 2.25rem;
  color: var(--sand-100);
  margin-bottom: var(--space-sm);
}

.page-header-inner p {
  color: var(--sand-300);
  font-weight: 300;
  font-size: 1.05rem;
  max-width: 600px;
}

/* ============================================================
   CARDS & COMPONENTS
   ============================================================ */

.card {
  background: white;
  border: 1px solid var(--sand-200);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  transition: all var(--duration) var(--ease);
  box-shadow: var(--shadow-sm);
}

.container > .card + .card {
  margin-top: var(--space-lg);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--sand-300);
}

.card-title {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sand-500);
  margin-bottom: var(--space-md);
}

.card-intro {
  color: var(--sand-600);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* --- Buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.6rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid var(--sand-300);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--dark-900);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--duration) var(--ease);
  white-space: nowrap;
  line-height: 1.4;
}

.btn:hover {
  background: var(--sand-100);
  border-color: var(--sand-400);
  box-shadow: var(--shadow-sm);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--spice), var(--spice-dark));
  color: white;
  border-color: var(--spice-dark);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--spice-light), var(--spice));
  border-color: var(--spice);
  color: white;
  box-shadow: var(--shadow-glow);
}

.btn-hero {
  padding: 0.75rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--spice), var(--terracotta));
  color: white;
  border: none;
  box-shadow: 0 4px 16px rgba(200,149,108,0.3);
}

.btn-hero:hover {
  background: linear-gradient(135deg, var(--spice-light), var(--spice));
  box-shadow: 0 6px 24px rgba(200,149,108,0.4);
  color: white;
  transform: translateY(-1px);
}

.btn-hero-secondary {
  background: transparent;
  border: 1px solid var(--sand-400);
  color: var(--sand-200);
  box-shadow: none;
}

.btn-hero-secondary:hover {
  background: rgba(255,255,255,0.08);
  border-color: var(--sand-200);
  color: white;
  box-shadow: none;
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.btn-group {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* --- Callouts --- */

.callout {
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--sand-400);
  background: var(--sand-50);
  margin: var(--space-lg) 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

.callout.info {
  border-left-color: var(--sage);
  background: rgba(107, 143, 113, 0.06);
}

.callout.warning {
  border-left-color: var(--terracotta);
  background: rgba(193, 123, 74, 0.06);
}

.callout.danger {
  border-left-color: var(--sienna);
  background: rgba(156, 64, 64, 0.06);
}

/* --- Section Title --- */

.section-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--dark-900);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--spice);
  border-radius: 1px;
}

/* --- Footer --- */

.site-footer {
  background: var(--dark-900);
  color: var(--sand-400);
  padding: var(--space-2xl) 0;
  margin-top: var(--space-3xl);
  font-size: 0.875rem;
  text-align: center;
  border-top: 1px solid var(--dark-600);
}

.site-footer a {
  color: var(--spice-light);
}

.site-footer a:hover {
  color: var(--spice);
}

/* ============================================================
   LANDING — Concepts & Steps
   ============================================================ */

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

.concept-card {
  background: white;
  border: 1px solid var(--sand-200);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  text-align: center;
  transition: all var(--duration) var(--ease);
  box-shadow: var(--shadow-sm);
}

.concept-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--sand-300);
}

.concept-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-md);
  background: linear-gradient(135deg, rgba(200,149,108,0.12), rgba(193,123,74,0.08));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-lg);
  margin: var(--space-xl) 0;
  counter-reset: step;
}

.step-card {
  background: white;
  border: 1px solid var(--sand-200);
  border-radius: var(--radius-md);
  padding: var(--space-xl) var(--space-lg);
  position: relative;
  transition: all var(--duration) var(--ease);
  box-shadow: var(--shadow-sm);
}

.step-card:hover {
  box-shadow: var(--shadow-md);
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--spice), var(--terracotta));
  color: white;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 50%;
  margin-bottom: var(--space-md);
}

/* ============================================================
   CALCULATOR FLOW
   ============================================================ */

.flow {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: var(--space-xl);
}

.flow-step {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 130px;
  padding: 0.75rem 0.9rem;
  position: relative;
  flex: 1;
  background: white;
  border: 2px solid var(--sand-200);
  border-radius: var(--radius-md);
  transition: all var(--duration) var(--ease);
}

.flow-step:not(:last-child) {
  margin-right: 1.6rem;
}

.flow-step:not(:last-child)::after {
  content: '';
  position: absolute;
  right: -1.1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 9px solid var(--sand-300);
  transition: border-color var(--duration) var(--ease);
}

.flow-step:last-child::after {
  display: none;
}

.flow-step.active {
  border-color: var(--spice);
  background: rgba(200,149,108,0.06);
}
.flow-step.active:not(:last-child)::after { border-left-color: var(--spice); }

.flow-step.pass {
  border-color: var(--sage);
  background: rgba(107,143,113,0.06);
}
.flow-step.pass:not(:last-child)::after { border-left-color: var(--sage); }
.flow-step.pass .flow-num { color: var(--sage-dark); }
.flow-step.pass .flow-label { color: var(--sage-dark); }

.flow-step.fail {
  border-color: var(--sienna);
  background: rgba(156,64,64,0.06);
}
.flow-step.fail:not(:last-child)::after { border-left-color: var(--sienna); }
.flow-step.fail .flow-num { color: var(--sienna); }
.flow-step.fail .flow-label { color: var(--sienna); }

.flow-step.warn {
  border-color: var(--terracotta);
  background: rgba(193,123,74,0.06);
}
.flow-step.warn:not(:last-child)::after { border-left-color: var(--terracotta); }
.flow-step.warn .flow-num { color: var(--terracotta); }
.flow-step.warn .flow-label { color: var(--terracotta); }

.flow-num {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--sand-500);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: color var(--duration) var(--ease);
}

.flow-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--dark-900);
  transition: all var(--duration) var(--ease);
  line-height: 1.3;
}

.flow-detail {
  font-size: 0.7rem;
  color: var(--sand-400);
  margin-top: var(--space-xs);
  font-family: var(--font-mono);
}

/* ============================================================
   TABLES & INPUTS
   ============================================================ */

.study-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: white;
  border: 1px solid var(--sand-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: var(--space-lg) 0;
  font-size: 0.9rem;
}

.study-table th {
  background: var(--sand-100);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--sand-600);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  border-bottom: 2px solid var(--sand-200);
  white-space: nowrap;
}

.study-table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--sand-200);
  vertical-align: middle;
}

.study-table tr:last-child td {
  border-bottom: none;
}

.study-table tr:hover td {
  background: var(--sand-50);
}

.study-table input {
  width: 100%;
  padding: 0.4rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  border: 1px solid var(--sand-300);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--dark-900);
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.study-table input:focus {
  outline: none;
  border-color: var(--spice);
  box-shadow: 0 0 0 3px rgba(200,149,108,0.15);
}

.study-table .row-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--sand-400);
  width: 30px;
  text-align: center;
}

/* --- Param Grid --- */

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

.param-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.param-item label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--sand-600);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.param-item input,
.param-item select {
  padding: 0.5rem 0.75rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  border: 1px solid var(--sand-300);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--dark-900);
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.param-item input:focus,
.param-item select:focus {
  outline: none;
  border-color: var(--spice);
  box-shadow: 0 0 0 3px rgba(200,149,108,0.15);
}

/* ============================================================
   RESULTS
   ============================================================ */

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

.result-item {
  background: white;
  border: 1px solid var(--sand-200);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  text-align: center;
  transition: all var(--duration) var(--ease);
}

.result-item.highlight {
  border-color: var(--spice);
  background: rgba(200,149,108,0.04);
  box-shadow: var(--shadow-glow);
}

.result-item.good {
  border-color: var(--sage);
  background: rgba(107,143,113,0.04);
}

.result-value {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--dark-900);
  line-height: 1.2;
  margin-bottom: var(--space-xs);
}

.result-item.highlight .result-value {
  color: var(--spice-dark);
}

.result-item.good .result-value {
  color: var(--sage-dark);
}

.result-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--sand-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================================
   WARNING BOX
   ============================================================ */

.warning-box {
  display: none;
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  margin: var(--space-lg) 0;
  font-size: 0.9rem;
  line-height: 1.6;
  animation: fadeSlideIn 0.3s var(--ease) both;
  border: 1px solid;
}

.warning-box.visible {
  display: block;
}

.warning-box.danger {
  background: rgba(156,64,64,0.06);
  border-color: rgba(156,64,64,0.25);
  color: var(--sienna);
}

.warning-box.caution {
  background: rgba(193,123,74,0.06);
  border-color: rgba(193,123,74,0.25);
  color: var(--terracotta);
}

.warning-box.success {
  background: rgba(107,143,113,0.06);
  border-color: rgba(107,143,113,0.25);
  color: var(--sage-dark);
}

/* ============================================================
   COMPARE TABLE
   ============================================================ */

.compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: white;
  border: 1px solid var(--sand-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: var(--space-lg) 0;
  font-size: 0.9rem;
}

.compare-table th {
  background: var(--dark-800);
  color: var(--sand-200);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: var(--space-sm) var(--space-md);
  text-align: left;
}

.compare-table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--sand-200);
  vertical-align: top;
}

.compare-table tr:last-child td {
  border-bottom: none;
}

.compare-table tr:hover td {
  background: var(--sand-50);
}

.compare-table tr.recommended {
  background: rgba(107,143,113,0.06);
}

.compare-table tr.recommended td {
  border-bottom-color: rgba(107,143,113,0.15);
  font-weight: 500;
}

/* ============================================================
   SENSITIVITY
   ============================================================ */

.sensitivity-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) 0;
}

.tau-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--sand-600);
  min-width: 60px;
  text-align: right;
}

.bar-track {
  flex: 1;
  height: 24px;
  background: var(--sand-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--spice), var(--terracotta));
  border-radius: var(--radius-sm);
  transition: width 0.5s var(--ease);
  position: relative;
}

.bar-fill::after {
  content: attr(data-value);
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: white;
  white-space: nowrap;
}

/* ============================================================
   METHOD BOX / FORMULA / NAIVE TABLE
   ============================================================ */

.method-box {
  background: white;
  border: 1px solid var(--sand-200);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  margin: var(--space-lg) 0;
  box-shadow: var(--shadow-sm);
}

.formula {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  background: var(--dark-800);
  color: var(--spice-light);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  margin: var(--space-md) 0;
  overflow-x: auto;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.naive-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
  margin: var(--space-md) 0;
  border: 1px solid var(--sand-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.naive-table th {
  background: var(--sand-100);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--sand-600);
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  border-bottom: 1px solid var(--sand-200);
}

.naive-table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--sand-200);
}

.naive-table tr:last-child td {
  border-bottom: none;
}

/* ============================================================
   EXAMPLES
   ============================================================ */

.example-section {
  background: white;
  border: 1px solid var(--sand-200);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  margin: var(--space-lg) 0;
  box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--sand-300);
}

.example-section.good {
  border-top-color: var(--sage);
}

.example-section.borderline {
  border-top-color: var(--terracotta);
}

.example-section.bad {
  border-top-color: var(--sienna);
}

.example-mini-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.85rem;
  margin: var(--space-md) 0;
  border: 1px solid var(--sand-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.example-mini-table th {
  background: var(--sand-100);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--sand-600);
  padding: var(--space-xs) var(--space-sm);
  text-align: left;
  border-bottom: 1px solid var(--sand-200);
}

.example-mini-table td {
  padding: var(--space-xs) var(--space-sm);
  border-bottom: 1px solid var(--sand-200);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.example-mini-table tr:last-child td {
  border-bottom: none;
}

.example-result-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin: var(--space-md) 0;
}

.example-result-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.3rem 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  background: var(--sand-100);
  border: 1px solid var(--sand-200);
  border-radius: 100px;
  white-space: nowrap;
}

.example-takeaway {
  margin-top: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--sand-50);
  border-left: 3px solid var(--spice);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--sand-600);
}

/* ============================================================
   METHODS PAGE
   ============================================================ */

.method-section {
  margin-bottom: var(--space-2xl);
  animation: fadeSlideIn 0.4s var(--ease) both;
}

.method-section h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--dark-900);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--sand-200);
}

.method-section p {
  color: var(--sand-600);
  font-size: 0.95rem;
  line-height: 1.7;
  max-width: 65ch;
}

.method-section code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--sand-200);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
  color: var(--spice-dark);
}

/* --- References --- */

.ref-list {
  list-style: none;
  padding: 0;
  margin: var(--space-lg) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.ref-list li {
  padding: var(--space-md) var(--space-lg);
  background: white;
  border: 1px solid var(--sand-200);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  line-height: 1.6;
  transition: border-color var(--duration) var(--ease);
}

.ref-list li:hover {
  border-color: var(--sand-300);
}

.ref-authors {
  font-weight: 600;
  color: var(--dark-900);
}

.ref-title {
  color: var(--spice-dark);
  font-style: italic;
}

.ref-journal {
  color: var(--sand-500);
  font-size: 0.85rem;
}

/* ============================================================
   STORY CLASSES
   ============================================================ */

.story-chapter {
  margin-bottom: var(--space-3xl);
  padding-bottom: var(--space-2xl);
  border-bottom: 1px solid var(--sand-200);
  animation: fadeSlideIn 0.5s var(--ease) both;
}

.story-chapter:last-child {
  border-bottom: none;
}

.story-header {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--dark-900);
  margin-bottom: var(--space-lg);
  position: relative;
  padding-left: var(--space-lg);
}

.story-header::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.2em;
  bottom: 0.2em;
  width: 3px;
  background: linear-gradient(180deg, var(--spice), var(--terracotta));
  border-radius: 2px;
}

.story-narrative {
  font-size: 1.05rem;
  color: var(--sand-600);
  line-height: 1.75;
  max-width: 65ch;
  margin-bottom: var(--space-lg);
}

.story-scene {
  background: white;
  border: 1px solid var(--sand-200);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  margin: var(--space-lg) 0;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.story-scene::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--spice), transparent);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.story-diagram {
  background: var(--dark-800);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  margin: var(--space-lg) 0;
  overflow-x: auto;
  color: var(--sand-200);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
}

.story-verdict {
  padding: var(--space-lg) var(--space-xl);
  border-radius: var(--radius-md);
  margin: var(--space-lg) 0;
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 1.6;
  border: 1px solid;
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
}

.story-verdict.positive {
  background: rgba(107,143,113,0.06);
  border-color: rgba(107,143,113,0.25);
  color: var(--sage-dark);
}

.story-verdict.cautious {
  background: rgba(193,123,74,0.06);
  border-color: rgba(193,123,74,0.25);
  color: var(--terracotta);
}

.story-verdict.negative {
  background: rgba(156,64,64,0.06);
  border-color: rgba(156,64,64,0.25);
  color: var(--sienna);
}

.animal-counter {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.4rem 0.9rem;
  background: var(--sand-100);
  border: 1px solid var(--sand-200);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--dark-900);
  white-space: nowrap;
}

.timeline {
  position: relative;
  padding-left: var(--space-2xl);
  margin: var(--space-xl) 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--spice), var(--sand-300));
  border-radius: 1px;
}

.timeline > * {
  position: relative;
  margin-bottom: var(--space-lg);
  padding-left: var(--space-md);
}

.timeline > *::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-2xl) + 6px);
  top: 0.5em;
  width: 10px;
  height: 10px;
  background: var(--spice);
  border: 2px solid var(--sand-100);
  border-radius: 50%;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1024px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .concepts {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

@media (max-width: 768px) {
  html { font-size: 15px; }

  .hero h1 { font-size: 2.25rem; }
  .hero { padding: var(--space-2xl) 0; }

  .page-header-inner h1 { font-size: 1.75rem; }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--dark-900);
    border-bottom: 1px solid var(--dark-600);
    padding: var(--space-md);
    box-shadow: var(--shadow-md);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-link.active::after {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .flow {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .flow-step {
    min-width: 0;
  }

  .flow-step:not(:last-child) {
    margin-right: 0;
  }

  .flow-step:not(:last-child)::after {
    display: none;
  }

  .result-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .param-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .sensitivity-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .tau-label {
    text-align: left;
  }

  .bar-track {
    width: 100%;
  }

  .study-table {
    display: block;
    overflow-x: auto;
  }

  .compare-table {
    display: block;
    overflow-x: auto;
  }
}

@media (max-width: 480px) {
  html { font-size: 14px; }

  .hero h1 { font-size: 1.85rem; }

  .container,
  .container-wide {
    padding: 0 var(--space-md);
  }

  .card {
    padding: var(--space-lg);
  }

  .result-grid {
    grid-template-columns: 1fr;
  }

  .steps {
    grid-template-columns: 1fr;
  }

  .concepts {
    grid-template-columns: 1fr;
  }

  .story-header {
    font-size: 1.5rem;
  }

  .story-narrative {
    font-size: 1rem;
  }
}

/* ============================================================
   PRINT
   ============================================================ */

@media print {
  body::before { display: none; }
  .site-nav,
  .site-footer,
  .nav-toggle { display: none; }

  .hero,
  .page-header {
    background: white;
    color: black;
  }

  .hero h1,
  .page-header-inner h1 {
    color: black;
  }

  .card,
  .story-scene,
  .method-box {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}

/* ============================================================
   FADE-IN ANIMATIONS
   ============================================================ */

.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

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

/* ============================================================
   LANDING PAGE — MISC
   ============================================================ */

.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--sand-300), transparent);
  margin: var(--space-2xl) 0;
}

.section-subtitle {
  font-size: 1rem;
  color: var(--sand-500);
  margin-top: calc(-1 * var(--space-sm));
  margin-bottom: var(--space-lg);
}

.prose {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--sand-600);
}

.knowledge-card {
  text-align: center;
}

.knowledge-card h3 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.knowledge-card p {
  font-size: 0.9rem;
  color: var(--sand-500);
  line-height: 1.6;
}

.exclusion-card {
  border-top: 3px solid var(--terracotta);
}

.exclusion-list {
  list-style: none;
  padding: 0;
  margin: var(--space-md) 0;
}

.exclusion-list li {
  padding: var(--space-sm) 0;
  padding-left: 1.5rem;
  position: relative;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--sand-600);
  border-bottom: 1px solid var(--sand-100);
}

.exclusion-list li:last-child { border-bottom: none; }

.exclusion-list li::before {
  content: '\2717';
  position: absolute;
  left: 0;
  color: var(--terracotta);
  font-weight: 700;
}

/* ============================================================
   C*POWER — NAV LOGO
   ============================================================ */

.nav-logo {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

/* ============================================================
   ZONE BADGES
   ============================================================ */

.zone-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 100px;
  color: white;
  white-space: nowrap;
}

.zone-stable { background: var(--sage); }
.zone-moderate { background: var(--terracotta); }
.zone-unstable { background: var(--sienna); }
.zone-insufficient { background: var(--sand-500); }

.zone-summary {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  padding: var(--space-md) var(--space-lg);
  background: var(--sand-50);
  border: 1px solid var(--sand-200);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
}

.zone-metrics {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--sand-600);
}

.zone-metrics span {
  padding: 0.15rem 0.5rem;
  background: white;
  border: 1px solid var(--sand-200);
  border-radius: var(--radius-sm);
}

.hidden { display: none !important; }

/* ============================================================
   PATH CARDS
   ============================================================ */

.path-card {
  border: 1px solid var(--sand-200);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  background: white;
  transition: all var(--duration) var(--ease);
}

.path-card:hover {
  box-shadow: var(--shadow-md);
}

.path-card.path-a {
  border-left: 4px solid var(--sage);
}

.path-card.path-b {
  border-left: 4px solid var(--spice);
}

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

.path-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.path-icon-a { background: var(--sage); }
.path-icon-b { background: var(--spice); }

.path-icon-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: white;
  font-weight: 700;
  font-size: 0.7rem;
  flex-shrink: 0;
  vertical-align: middle;
}

.path-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--dark-900);
}

.path-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.path-body {
  margin-bottom: var(--space-md);
}

.path-numbers {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.path-num-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  background: var(--sand-50);
  border: 1px solid var(--sand-200);
  border-radius: var(--radius-md);
  min-width: 70px;
}

.path-num-item.path-saved {
  background: rgba(107,143,113,0.06);
  border-color: rgba(107,143,113,0.25);
}

.path-num {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--dark-900);
  line-height: 1.2;
}

.path-saved .path-num {
  color: var(--sage-dark);
}

.path-num-label {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--sand-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.path-caveat {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--sand-200);
  font-style: italic;
}

.path-a-row {
  background: rgba(107,143,113,0.04);
}

.path-b-row {
  background: rgba(200,149,108,0.04);
}

/* ============================================================
   CHART TABS
   ============================================================ */

.chart-tabs {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
  border-bottom: 2px solid var(--sand-200);
  padding-bottom: var(--space-xs);
}

.chart-tab {
  padding: 0.4rem 0.9rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: transparent;
  color: var(--sand-500);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}

.chart-tab:hover {
  color: var(--dark-900);
  background: var(--sand-50);
}

.chart-tab.active {
  color: var(--spice-dark);
  background: white;
  border-color: var(--sand-200);
  font-weight: 600;
  position: relative;
}

.chart-tab.active::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--spice);
  border-radius: 2px 2px 0 0;
}

.chart-panel {
  display: none;
}

.chart-panel.active {
  display: block;
  animation: fadeSlideIn 0.3s var(--ease) both;
}

.chart-container {
  background: white;
  border: 1px solid var(--sand-200);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  overflow-x: auto;
}

/* ============================================================
   INTERPRETATION CARDS
   ============================================================ */

.interpretation-card .interp-card {
  padding: var(--space-md) var(--space-lg);
  border-left: 3px solid var(--sand-300);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--sand-50);
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--sand-600);
}

/* ============================================================
   COMPARISON BARS
   ============================================================ */

.comp-bars {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.comp-bar-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.comp-bar-label {
  min-width: 90px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--sand-600);
  text-align: right;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
}

.comp-bar-track {
  flex: 1;
  display: flex;
  height: 36px;
  background: var(--sand-100);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.comp-bar-fill {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  transition: width 0.5s var(--ease);
}

.comp-bar-classic { background: var(--sand-500); }
.comp-bar-a { background: var(--sage-dark); }
.comp-bar-saved-a { background: var(--sage); opacity: 0.35; color: var(--sage-dark); }
.comp-bar-b { background: var(--spice-dark); }
.comp-bar-saved-b { background: var(--spice); opacity: 0.3; color: var(--spice-dark); }

/* ============================================================
   ACTION PLAN
   ============================================================ */

.action-plan {
  font-size: 0.9rem;
}

.action-headline {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--sand-50);
  border: 1px solid var(--sand-200);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
}

.action-msg {
  font-weight: 500;
  color: var(--dark-900);
}

.action-section {
  border: 1px solid var(--sand-200);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  background: white;
  overflow: hidden;
}

.action-section summary {
  padding: var(--space-md) var(--space-lg);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--dark-900);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  transition: background var(--duration) var(--ease);
}

.action-section summary::-webkit-details-marker { display: none; }
.action-section summary::before {
  content: '\25B6';
  font-size: 0.6rem;
  color: var(--sand-400);
  transition: transform var(--duration) var(--ease);
}

.action-section[open] summary::before {
  transform: rotate(90deg);
}

.action-section summary:hover {
  background: var(--sand-50);
}

.action-body {
  padding: 0 var(--space-lg) var(--space-lg);
}

.action-pills {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.action-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.2rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  background: var(--sand-100);
  border: 1px solid var(--sand-200);
  border-radius: 100px;
  white-space: nowrap;
}

.action-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.action-list li {
  padding: var(--space-xs) 0;
  padding-left: 1.5rem;
  position: relative;
  font-size: 0.85rem;
  line-height: 1.6;
}

.action-do li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  color: var(--sage);
  font-weight: 700;
}

.action-dont li::before {
  content: '\2717';
  position: absolute;
  left: 0;
  color: var(--sienna);
  font-weight: 700;
}

/* ============================================================
   SETTINGS PANEL
   ============================================================ */

.settings-panel {
  margin-top: var(--space-md);
  border: 1px solid var(--sand-200);
  border-radius: var(--radius-md);
  background: var(--sand-50);
}

.settings-toggle {
  padding: var(--space-sm) var(--space-md);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--sand-500);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.settings-toggle::-webkit-details-marker { display: none; }

.settings-toggle svg {
  color: var(--sand-400);
}

.settings-body {
  padding: var(--space-sm) var(--space-md) var(--space-md);
}

/* ============================================================
   EXPERT PANEL
   ============================================================ */

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

@media (max-width: 768px) {
  .expert-grid {
    grid-template-columns: 1fr;
  }
}

.expert-panel {
  background: var(--sand-50);
  border: 1px solid var(--sand-200);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
}

.expert-slider-row {
  margin-bottom: var(--space-md);
}

.expert-slider-row label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--sand-600);
  margin-bottom: var(--space-xs);
}

.expert-slider-row input[type="range"] {
  width: calc(100% - 60px);
  vertical-align: middle;
}

.expert-slider-val {
  display: inline-block;
  width: 50px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--spice-dark);
}

.expert-results {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--sand-200);
}

.expert-result-cell {
  flex: 1;
  text-align: center;
  padding: var(--space-sm);
  background: white;
  border: 1px solid var(--sand-200);
  border-radius: var(--radius-sm);
}

.expert-result-val {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--dark-900);
  line-height: 1.2;
}

.expert-result-lbl {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--sand-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

/* ── Dunnett info panel ── */

.dunnett-info {
  font-size: 0.85rem;
}

.dunnett-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-xs) 0;
  color: var(--sand-600);
}

.dunnett-row span:last-child {
  font-family: var(--font-mono);
  color: var(--dark-900);
}

/* ── Preset chips ── */

.preset-chip.btn-primary {
  background: linear-gradient(135deg, var(--spice), var(--spice-dark));
  color: white;
  border-color: var(--spice-dark);
}

/* ============================================================
   FOOTER (C*Power branding)
   ============================================================ */

.footer-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--sand-200);
  margin-bottom: var(--space-sm);
}

.footer-disclaimer {
  font-size: 0.78rem;
  color: var(--sand-500);
  margin-top: var(--space-sm);
}
