:root {
  --bg:           #0a0c10;
  --surface:      #10141c;
  --surface2:     #161b26;
  --border:       #1e2535;
  --border-bright:#2a3550;
  --accent:       #00d4ff;
  --accent2:      #4df0ff;
  --accent3:      #00ff88;
  --text:         #e2e8f0;
  --text-dim:     #8899b0;
  --text-mid:     #94a3b8;
  --warn:         #f59e0b;
  --ok:           #22c55e;
  --danger:       #ef4444;
  --info:         #60a5fa;
  --mono: 'IBM Plex Mono', monospace;
  --sans: 'IBM Plex Sans', sans-serif;
  --max-w: 960px;

  /* ── Spacing scale (4px base) ── */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px;  --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-7: 32px;  --sp-8: 48px;
  --sp-9: 64px;

  /* ── Radius ── */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;

  /* ── Shadows & glow ── */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.15);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4), 0 2px 4px rgba(0,0,0,0.2);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5), 0 4px 8px rgba(0,0,0,0.25);
  --shadow-glow-accent: 0 0 20px rgba(0,212,255,0.08), 0 0 40px rgba(0,212,255,0.04);
  --shadow-glow-bright: 0 0 20px rgba(77,240,255,0.08), 0 0 40px rgba(77,240,255,0.04);

  /* ── Transitions ── */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --duration: 200ms;
  --duration-slow: 400ms;

  /* ── Gradient accents ── */
  --gradient-accent: linear-gradient(135deg, var(--accent), var(--accent3));
  --gradient-surface: linear-gradient(135deg, rgba(0,212,255,0.03), rgba(77,240,255,0.03));

}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  font-feature-settings: 'ss01', 'cv01';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Focus visible - WCAG 2.4.7 */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Link styling for paragraph text - WCAG 2.4.4 */
p a, li a {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  color: var(--accent);
}

/* Remove outline for mouse clicks (keep for keyboard only) */
:focus:not(:focus-visible) {
  outline: none;
}

/* Skip navigation link - WCAG 2.4.1 */
.skip-link {
  position: absolute;
  top: -40px;
  left: 8px;
  background: var(--accent);
  color: var(--bg);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  z-index: 9999;
  font-size: 14px;
  transition: top 0.1s;
  text-decoration: none;
  font-weight: 500;
}
.skip-link:focus {
  top: 8px;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.wrapper {
  position: relative;
  z-index: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}


/* ============================================================
   NAV
   ============================================================ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,12,16,0.82);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid rgba(30,37,53,0.6);
  box-shadow: 0 1px 0 rgba(0,212,255,0.04), var(--shadow-sm);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--accent);
}
.logo .logo-dim { color: var(--text-dim); }
.logo .logo-white { color: var(--text); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links > li {
  position: relative;
  display: flex;
  align-items: center;
  padding-bottom: 6px;
}
.nav-links > li > a {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-mid);
  text-decoration: none;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}
.nav-links > li > a:hover { color: var(--text); }
.nav-links > li > a.active { color: var(--accent); }
.nav-links > li::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  transition: background 0.15s;
}
.nav-links > li:hover::after { background: var(--accent); }
.nav-links > li.active::after { background: var(--accent); }

.nav-pill {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent3);
  border: 1px solid rgba(0,255,136,0.25);
  background: rgba(0,255,136,0.04);
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.1em;
  white-space: nowrap;
}
.nav-pill::before {
  content: '● ';
  animation: blink 2s infinite;
}
@keyframes blink { 0%,100% { opacity:1; } 50% { opacity:0.3; } }

/* ── Nav Dropdown (v0.2) ────────────────────────────────────────── */

.nav-has-dropdown { position: relative; }
.nav-dropdown-trigger { display: flex; align-items: center; gap: 5px; }
.nav-arrow { font-size: 8px; opacity: 0.55; transition: transform 0.2s; }
.nav-has-dropdown:hover .nav-arrow { transform: rotate(180deg); }

.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  min-width: 320px;
  background: rgba(16,20,28,0.92);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border: 1px solid rgba(42,53,80,0.6);
  border-top: 2px solid var(--accent);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg), var(--shadow-glow-accent);
  z-index: 9999;
  padding: 4px 0;
}

/* Invisible hover buffer above dropdown to prevent collapse during mouse movement */
.nav-dropdown::before {
  content: '';
  position: absolute;
  top: -14px;
  left: 0;
  width: 100%;
  height: 14px;
  pointer-events: auto;
}
.nav-has-dropdown:hover .nav-dropdown,
.nav-has-dropdown:focus-within .nav-dropdown { display: block; }

/* Keep dropdown visible when hovering over it directly */
.nav-dropdown:hover { display: block; }

.nav-dd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 28px;
  text-decoration: none;
  border-bottom: 1px solid #1e2535;
  transition: background 0.1s;
}
.nav-dd-item:last-child { border-bottom: none; }
.nav-dd-item:hover { background: #161b26; }
.nav-dd-item.current { background: transparent; }

.nav-dd-num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: #64748b;
  width: 16px;
  flex-shrink: 0;
}
.nav-dd-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 400;
  color: #94a3b8;
  flex: 1;
  transition: color 0.1s;
}
.nav-dd-item:hover .nav-dd-label { color: #e2e8f0; }
.nav-dd-item.current .nav-dd-label { color: #94a3b8; }
.nav-dd-live {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: #00ff88;
  border: 1px solid rgba(0,255,136,0.3);
  padding: 2px 6px;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}

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

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

.nav-toggle-line {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-dim);
  transition: all 0.3s ease;
  transform-origin: center;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Menu Styles */
.nav-links-open .nav-dropdown {
  position: static;
  display: block;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  margin-top: 8px;
}

.nav-links-open .nav-dropdown::before {
  display: none;
}

.nav-links-open .nav-dropdown .nav-dd-item {
  border-bottom: 1px solid var(--border);
}

/* ============================================================
   SECTION HEADERS — shared pattern
   ============================================================ */
.section-rule {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}
.section-rule h2,
.section-rule span {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
}
.section-rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border-bright), transparent);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding: 24px 0 16px;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -40%;
  left: -20%;
  width: 60%;
  height: 140%;
  background: radial-gradient(ellipse at center, rgba(0,212,255,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  top: -20%;
  right: -15%;
  width: 50%;
  height: 120%;
  background: radial-gradient(ellipse at center, rgba(77,240,255,0.05) 0%, transparent 70%);
  pointer-events: none;
}
.home-hero {
  padding: 80px 0 64px;
}

.hero-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.hero h1 {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
  text-wrap: balance;
  position: relative;
  z-index: 1;
}
.home-hero .hero-label { margin-bottom: 24px; position: relative; z-index: 1; }
.home-hero h1 { font-size: clamp(34px, 5.5vw, 58px); margin-bottom: 20px; }
.hero h1 .accent { color: var(--accent); font-weight: 600; }

.hero-subhead {
  font-size: 16px;
  color: var(--text-mid);
  line-height: 1.75;
  max-width: 540px;
  margin-bottom: 36px;
}

.hero-ctas {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.btn-primary {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 13px 28px;
  background: var(--gradient-accent);
  color: var(--bg);
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease), opacity var(--duration);
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(0,212,255,0.15);
  position: relative;
  z-index: 1;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,212,255,0.25), var(--shadow-glow-accent);
}
.btn-primary:active { transform: translateY(0) scale(0.97); }

.btn-ghost {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 13px 28px;
  background: rgba(255,255,255,0.02);
  color: var(--text-mid);
  border: 1px solid var(--border-bright);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all var(--duration) var(--ease);
  border-radius: var(--radius-sm);
  position: relative;
  z-index: 1;
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0,212,255,0.04);
  box-shadow: 0 0 16px rgba(0,212,255,0.06);
  transform: translateY(-1px);
}
.btn-ghost:active { transform: translateY(0) scale(0.97); }

.btn-feedback {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5em 0.8em;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.15s;
  display: inline-block;
  text-decoration: none;
}
.btn-feedback:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.hero-stats {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.5s 0.5s ease forwards;
}
.hero-stat {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.hero-stat::before {
  content: '';
  width: 4px; height: 4px;
  background: var(--border-bright);
  border-radius: 50%;
}

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
  from { opacity: 0; transform: translateY(10px); }
}

/* ============================================================
   TOOLS GRID
   ============================================================ */
.tools-section {
  padding: 64px 0;
  border-bottom: 1px solid var(--border);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.tool-card {
  background: rgba(16,20,28,0.7);
  padding: 24px;
  position: relative;
  transition: all var(--duration) var(--ease);
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}
.tool-card:hover {
  background: rgba(22,27,38,0.9);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

/* Live card — accent top border */
.tool-card.live {
  border-top: 2px solid var(--accent3);
}
.tool-card.live .tool-badge {
  color: var(--accent3);
  border-color: rgba(0,255,136,0.3);
  background: rgba(0,255,136,0.05);
}

.tool-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid var(--border-bright);
  padding: 2px 10px;
  border-radius: 999px;
  width: fit-content;
}


.tool-num {
  position: absolute;
  top: 20px;
  right: 20px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent3);
}

.tool-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-top: 4px;
}

.tool-inputs {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.6;
}

.tool-cta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.05em;
  margin-top: auto;
  padding-top: 8px;
  transition: opacity 0.15s;
}
.tool-cta:hover { opacity: 0.7; }
.tool-cta.dim { color: var(--text-dim); cursor: default; }

/* ============================================================
   HOW IT WORKS
   ============================================================ */
.how-section {
  padding: 64px 0;
  border-bottom: 1px solid var(--border);
}

.steps-row {
  display: grid;
  grid-template-columns: 1fr 24px 1fr 24px 1fr;
  gap: 0;
  align-items: start;
}

.step-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 14px;
}
.step-connector::after {
  content: '';
  width: 100%;
  height: 1px;
  border-top: 1px dashed var(--border-bright);
}

.step-item {
  padding: 0 4px;
}

.step-num {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent);
  border: 1px solid rgba(0,212,255,0.3);
  background: rgba(0,212,255,0.06);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  border-radius: 50%;
  position: relative;
}

/* Tiny circuit trace extending from node */
.step-num::after {
  content: '';
  position: absolute;
  bottom: -14px;
  left: 50%;
  width: 1px;
  height: 10px;
  background: rgba(0,212,255,0.2);
}

.step-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.step-text {
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.7;
}

/* ============================================================
   HARDWARE CATALOG
   ============================================================ */
.hardware-section {
  padding: 64px 0;
  border-bottom: 1px solid var(--border);
}

.hw-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.hw-card {
  background: rgba(16,20,28,0.7);
  padding: 20px 18px;
  transition: all var(--duration) var(--ease);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hw-card:hover {
  background: rgba(22,27,38,0.9);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.hw-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  min-height: 34px;
  display: flex;
  align-items: flex-start;
}

.hw-specs {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hw-spec {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.hw-spec-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-mid);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hw-spec-val {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.hw-spec-val.tops { color: var(--accent3); }
.hw-spec-val.power { color: var(--warn); }

.hw-link {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.04em;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  transition: opacity 0.15s;
}
.hw-link:hover { opacity: 0.7; }

/* ============================================================
   JSON CALLOUT
   ============================================================ */
.json-section {
  padding: 64px 0;
  border-bottom: 1px solid var(--border);
}

.json-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.json-text h3 {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
  color: var(--text);
}

.json-text p {
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.75;
  margin-bottom: 12px;
}

.json-text p:last-child { margin-bottom: 0; }

.json-block-wrap {
  background: rgba(16,20,28,0.7);
  border: 1px solid rgba(42,53,80,0.5);
  border-left: 2px solid var(--accent2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.json-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}

.json-block-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-mid);
  letter-spacing: 0.1em;
}

.json-schema-badge {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.06em;
}

pre.json-block {
  padding: 18px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-mid);
  line-height: 1.7;
  overflow-x: auto;
  background: var(--surface);
  border: none;
  border-radius: 0;
  margin: 0;
}

.jk { color: var(--accent); }
.js { color: var(--accent3); }
.jn { color: var(--warn); }

/* ============================================================
   USE CASES
   ============================================================ */
.usecases-section {
  padding: 64px 0;
  border-bottom: 1px solid var(--border);
}

.usecases-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.usecase-card {
  background: rgba(16,20,28,0.7);
  padding: 22px 20px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all var(--duration) var(--ease);
  position: relative;
}
.usecase-card:hover {
  background: rgba(22,27,38,0.9);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}
.usecase-card:hover .usecase-arrow { opacity: 1; }

.usecase-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-mid);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.usecase-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.usecase-desc {
  font-size: 12px;
  color: var(--text-mid);
  line-height: 1.6;
  font-family: var(--mono);
}

.usecase-arrow {
  position: absolute;
  bottom: 18px;
  right: 18px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.2s;
}

/* ============================================================
   KNOWLEDGE CTA
   ============================================================ */
.knowledge-section {
  padding: 56px 0;
  border-bottom: 1px solid var(--border);
}

.knowledge-inner {
  background: rgba(16,20,28,0.6);
  border: 1px solid rgba(42,53,80,0.5);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

.knowledge-text h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.knowledge-text p {
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.7;
  max-width: 500px;
}

.knowledge-text a {
  color: var(--accent);
  text-decoration: none;
}
.knowledge-text a:hover { text-decoration: underline; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
  margin-top: 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand .logo {
  display: block;
  margin-bottom: 10px;
  text-decoration: none;
}

.footer-tagline {
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.6;
  margin-bottom: 14px;
  max-width: 280px;
}

.footer-version {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-mid);
  letter-spacing: 0.1em;
}

.footer-col h3 {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-mid);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-col a {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-mid);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-col a:hover { color: var(--accent); }

.footer-col .tag-dim {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-mid);
  border: 1px solid var(--border);
  padding: 1px 8px;
  border-radius: 999px;
  margin-left: 4px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 8px;
}

.footer-bottom-left,
.footer-bottom-right {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-mid);
  letter-spacing: 0.06em;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
  .hw-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .steps-row { grid-template-columns: 1fr; gap: 24px; }
  .step-connector { display: none; }
  .json-container { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .tools-grid { grid-template-columns: 1fr; }
  .hw-grid { grid-template-columns: repeat(2, 1fr); }
  .usecases-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }

  /* ── Mobile Navigation — Full-Width Drawer (v0.3) ────────────── */
  .nav-toggle {
    display: flex;
  }
  .nav-pill {
    display: none;
  }
  .nav-links {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(10, 12, 16, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    padding: 0;
    margin: 0;
    list-style: none;
    z-index: 100;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.6);
  }
  .nav-links-open {
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    padding: 0;
  }
  .nav-links > li {
    border-bottom: 1px solid var(--border);
    padding: 0;
  }
  .nav-links > li:last-child {
    border-bottom: none;
  }
  .nav-links > li > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-dim);
    letter-spacing: 0.1em;
    border-radius: 0;
    background: transparent;
    border: none;
  }
  .nav-links > li > a:hover {
    color: var(--text);
    background: rgba(255,255,255,0.02);
  }
  .nav-has-dropdown .nav-dropdown {
    display: block !important;
    position: static;
    background: var(--surface);
    border: none;
    border-top: 1px solid var(--border);
    box-shadow: none;
    padding: 0;
    min-width: unset;
  }
  .nav-has-dropdown .nav-dropdown::before {
    display: none;
  }
  .nav-dd-item {
    padding: 11px 20px 11px 24px;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .nav-dd-item:last-child {
    border-bottom: none;
  }
  .nav-arrow {
    display: none;
  }
  .nav-inner {
    position: relative;
  }

  /* Hero Section Mobile */
  .hero { padding: 56px 0 44px; }
  .hero h1 { font-size: 30px; }
  .knowledge-inner { flex-direction: column; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.breadcrumb a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s;
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb span {
  color: var(--border-bright);
  margin: 0 6px;
}

/* Optional: only needed if page uses .logo .d / .logo .w instead of .logo-dim / .logo-white */
.logo .d { color: var(--text-dim); }
.logo .w { color: var(--text); }

/* ============================================================
   HERO CONTENT HELPERS
   ============================================================ */
.hero h1 strong {
  font-weight: 600;
  color: var(--accent);
}

.hero p {
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.6;
  max-width: 960px;
}

/* ============================================================
   ENGINE / TOOL FORM LAYOUT
   ============================================================ */
.engine {
  padding: 24px 0;
}

.engine-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.engine-header h2 {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  white-space: nowrap;
}

.engine-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.step {
  margin-bottom: 20px;
}

.step-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.step-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.step-desc {
  font-size: 12px;
  color: var(--text-dim);
  margin-left: 32px;
  margin-bottom: 12px;
  font-family: var(--mono);
}

.option-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: 32px;
}

.opt {
  font-family: var(--mono);
  font-size: 12px;
  padding: 8px 14px;
  border: 1px solid var(--border-bright);
  background: var(--surface);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s var(--ease);
  border-radius: var(--radius-sm);
  position: relative;
  user-select: none;
}

.opt:hover {
  border-color: rgba(0,212,255,0.4);
  color: var(--text);
  background: var(--surface2);
}

.opt.selected {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0,212,255,0.05);
}

.opt.selected::after {
  content: '✓';
  position: absolute;
  top: -6px;
  right: -6px;
  width: 14px;
  height: 14px;
  background: var(--accent);
  color: var(--bg);
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.slider-track {
  display: flex;
  gap: 6px;
  margin-left: 32px;
  margin-bottom: 8px;
}

.slider-opt {
  font-family: var(--mono);
  font-size: 12px;
  padding: 8px 12px;
  border: 1px solid var(--border-bright);
  background: var(--surface);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s var(--ease);
  border-radius: var(--radius-sm);
  min-width: 48px;
  text-align: center;
  user-select: none;
}

.slider-opt:hover {
  border-color: rgba(0,212,255,0.4);
  color: var(--text);
}

.slider-opt.selected {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0,212,255,0.05);
}

.step-note {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  margin-left: 32px;
  margin-top: 6px;
}

/* ── Collapsible step groups & optional badges ──────────────────────────── */

.step-collapsible {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 16px;
  padding: 0;
}
.step-collapsible > summary.step-toggle {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 10px 16px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.step-collapsible > summary.step-toggle::before {
  content: '▸ ';
}
.step-collapsible[open] > summary.step-toggle::before {
  content: '▾ ';
}
.step-collapsible > .step {
  padding: 0 16px 12px;
}
.optional-badge {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  font-weight: 400;
  text-transform: lowercase;
}

.run-section {
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-run {
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 12px 28px;
  background: var(--gradient-accent);
  color: var(--bg);
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: all var(--duration) var(--ease);
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(0,212,255,0.15);
}

.btn-run::before {
  content: '';
  position: absolute;
  inset: 0;
  background: white;
  opacity: 0;
  transition: opacity var(--duration);
}

.btn-run:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,212,255,0.25), var(--shadow-glow-accent);
}

.btn-run:hover::before {
  opacity: 0.08;
}

.btn-run:active {
  transform: translateY(0) scale(0.97);
}

.btn-run:disabled {
  background: var(--border-bright);
  color: var(--text-dim);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.run-hint {
  font-size: 11px;
  color: var(--text-dim);
}

/* ============================================================
   PROCESSING
   ============================================================ */
.processing {
  display: none;
  padding: 40px 0;
  text-align: center;
}

.processing.visible {
  display: block;
}

.proc-label {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 16px;
}

.proc-bar {
  width: 240px;
  height: 2px;
  background: var(--border);
  margin: 0 auto;
  overflow: hidden;
}

.proc-fill {
  width: 40%;
  height: 100%;
  background: var(--accent);
  animation: slide 1s ease infinite;
}

@keyframes slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

/* ============================================================
   RESULTS / BOM
   ============================================================ */
.results {
  display: none;
  padding: 24px 0;
  border-top: 1px solid var(--border);
}

.results.visible {
  display: block;
  animation: fadeUp 0.5s ease forwards;
}

.results-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.results-header h2 {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.results-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.bom-summary {
  background: rgba(16,20,28,0.7);
  border: 1px solid rgba(42,53,80,0.5);
  border-top: 2px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md), var(--shadow-glow-accent);
}

.bom-badge {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.bom-title {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.bom-sub {
  font-size: 14px;
  color: var(--text-mid);
  margin-bottom: 24px;
}

/* bom-totals, total-label, total-value — see DASHBOARD section at end of file */
.total-value.green { color: var(--accent3); }
.total-value.amber { color: var(--warn); }
.total-value.cyan { color: var(--accent); }
.total-value.purple { color: var(--accent2); }

.bom-section {
  margin-bottom: 20px;
}

.bom-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
}

.bom-section-header:hover {
  background: var(--border);
}

.bom-section-title {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-mid);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.bom-section-total {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--warn);
}

.bom-section-toggle {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
}

.bom-section-body {
  border: 1px solid var(--border);
  border-top: none;
  background: var(--surface);
}

.bom-section-body.collapsed {
  display: none;
}

.bom-line {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 16px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.bom-line:last-child {
  border-bottom: none;
}

.bom-line-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.bom-line-spec {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
}

.bom-line-qty {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-mid);
  text-align: right;
  white-space: nowrap;
}

.bom-line-cost {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--warn);
  text-align: right;
  white-space: nowrap;
}

.bom-line-flag {
  font-family: var(--mono);
  font-size: 10px;
  padding: 2px 8px;
  border: 1px solid;
  border-radius: 999px;
  white-space: nowrap;
}

.flag-warn {
  color: var(--warn);
  border-color: rgba(245,158,11,0.3);
  background: rgba(245,158,11,0.05);
}

.flag-ok {
  color: var(--accent3);
  border-color: rgba(0,255,136,0.3);
  background: rgba(0,255,136,0.05);
}

.bom-rationale {
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.75;
  border-left: 2px solid var(--accent);
  padding-left: 16px;
  margin: 20px 0;
}

.confidence-bar {
  margin-top: 16px;
}

.confidence-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.confidence-track {
  height: 4px;
  background: var(--border-bright);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.confidence-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  border-radius: var(--radius-sm);
  transition: width 1.2s var(--ease-out);
  box-shadow: 0 0 8px rgba(0,212,255,0.2);
}

.cta-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.btn-primary-sm {
  font-family: var(--mono);
  font-size: 12px;
  padding: 10px 20px;
  background: var(--accent);
  color: var(--bg);
  border: none;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.05em;
  transition: all 0.2s;
}

.btn-primary-sm:hover {
  opacity: 0.85;
}

.btn-ghost-sm {
  font-family: var(--mono);
  font-size: 12px;
  padding: 10px 20px;
  background: transparent;
  color: var(--text-mid);
  border: 1px solid var(--border-bright);
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: all 0.2s;
}

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

.warnings-panel {
  margin-top: 24px;
}

.warn-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid rgba(245,158,11,0.2);
  background: rgba(245,158,11,0.03);
  margin-bottom: 8px;
}

.warn-icon {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--warn);
  flex-shrink: 0;
  padding-top: 1px;
}

.warn-text {
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.6;
}

.json-block {
  margin-top: 32px;
  border: 1px solid var(--border);
}

.json-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}

.json-title {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

.btn-copy {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  background: none;
  border: 1px solid rgba(0,212,255,0.3);
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-copy:hover {
  background: rgba(0,212,255,0.05);
}

pre.json-content {
  padding: 20px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-mid);
  overflow-x: auto;
  line-height: 1.6;
  background: var(--surface);
}

pre.json-content .key { color: var(--accent); }
pre.json-content .str { color: var(--accent3); }
pre.json-content .num { color: var(--warn); }

.share-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding: 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
}

.share-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.share-url {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-mid);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 10px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-share {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--bg);
  background: var(--accent2);
  border: none;
  padding: 8px 16px;
  cursor: pointer;
  font-weight: 600;
}

.btn-reset {
  font-size: 12px;
  color: var(--text-dim);
  background: none;
  border: 1px solid var(--border);
  padding: 10px 20px;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 32px;
}

.btn-reset:hover {
  border-color: var(--border-bright);
  color: var(--text);
}

/* ============================================================
   RESPONSIVE ADDITIONS FOR TOOL / BOM PAGES
   ============================================================ */
@media (max-width: 640px) {
  .option-grid,
  .slider-track,
  .step-note {
    margin-left: 0;
  }

  .bom-line {
    grid-template-columns: 1fr auto;
  }

  .bom-line-qty {
    display: none;
  }
}


/* ============================================================
   POWER / TOOL CARD EXTENSIONS
   ============================================================ */

.primary-card {
  background: rgba(16,20,28,0.7);
  border: 1px solid rgba(42,53,80,0.5);
  border-top: 2px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.card-badge {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.card-device {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.card-tagline {
  font-size: 14px;
  color: var(--text-mid);
  margin-bottom: 20px;
}

/* card-metrics, metric-label, metric-value — see DASHBOARD section at end of file */

.card-reason {
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.7;
  border-left: 2px solid var(--accent);
  padding-left: 16px;
  margin-bottom: 20px;
}

.btn-purchase {
  font-size: 12px;
  padding: 10px 20px;
  background: var(--accent);
  color: var(--bg);
  border: none;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.05em;
  transition: all 0.2s;
  border-radius: var(--radius-sm);
}

.btn-purchase:hover {
  opacity: 0.85;
}

.btn-docs {
  font-family: var(--mono);
  font-size: 12px;
  padding: 10px 20px;
  background: transparent;
  color: var(--text-mid);
  border: 1px solid var(--border-bright);
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: all 0.2s;
  border-radius: var(--radius-sm);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

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

/* ============================================================
   POWER-SPECIFIC BOM TABLE
   ============================================================ */

/* ── Model Comparator Results Table ─────────────────────────── */
.bom-table {
  width: 100%;
  margin: 1em 0;
  border-collapse: collapse;
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 13px;
  table-layout: fixed;
}
/* Column widths — fixed layout prevents columns fighting over space */
.bom-table col.col-model    { width: 22%; }
.bom-table col.col-fps      { width: 8%; }
.bom-table col.col-latency  { width: 9%; }
.bom-table col.col-memory   { width: 9%; }
.bom-table col.col-map      { width: 8%; }
.bom-table col.col-fpstop   { width: 9%; }
.bom-table col.col-power    { width: 9%; }
.bom-table col.col-badges   { width: 26%; }
/* Header row */
.bom-table thead tr {
  background: var(--surface2);
  border-bottom: 2px solid var(--border-bright);
}
.bom-table th {
  padding: 10px 12px;
  text-align: left;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  border-right: 1px solid var(--border);
  vertical-align: bottom;
}
.bom-table th:last-child {
  border-right: none;
}
/* Right-align all metric headers */
.bom-table th.th-num {
  text-align: right;
}
/* Sub-label under main header text */
.bom-table th .th-sub {
  display: block;
  font-size: 9px;
  color: var(--text-dim);
  opacity: 0.6;
  font-weight: 400;
  letter-spacing: 0.05em;
  margin-top: 2px;
}
/* Body rows */
.bom-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.bom-table tbody tr:last-child {
  border-bottom: none;
}
.bom-table tbody tr:hover {
  background: var(--surface2);
}
/* All body cells */
.bom-table td {
  padding: 11px 12px;
  vertical-align: middle;
  border-right: 1px solid var(--border);
  color: var(--text-mid);
  font-size: 13px;
}
.bom-table td:last-child {
  border-right: none;
}
/* Numeric value cells — right-aligned */
.bom-table td.value {
  text-align: right;
  font-family: var(--mono);
  font-size: 13px;
  white-space: nowrap;
  color: var(--text);
}
/* Model name cell */
.bom-table td.td-model {
  vertical-align: middle;
}
.bom-table .model-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  font-family: var(--mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bom-table .model-source {
  display: block;
  font-size: 10px;
  color: var(--text-dim);
  font-family: var(--mono);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bom-table .model-est {
  display: inline-block;
  font-size: 9px;
  color: var(--text-dim);
  border: 1px solid var(--border-bright);
  padding: 1px 5px;
  letter-spacing: 0.06em;
  margin-left: 4px;
  vertical-align: middle;
}
/* Badges cell */
.bom-table td.td-badges {
  font-size: 12px;
  line-height: 1.7;
  color: var(--text);
  vertical-align: middle;
}
.bom-table .badge-item {
  display: inline-block;
  white-space: nowrap;
  margin-right: 4px;
  margin-bottom: 2px;
  font-size: 11px;
  padding: 2px 7px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  letter-spacing: 0.03em;
  color: var(--text-mid);
}
/* Row below FPS threshold — dimmed */
.bom-table tr.below-threshold td {
  opacity: 0.5;
}
/* Responsive: on small screens, allow horizontal scroll on wrapper */
@media (max-width: 640px) {
  .bom-table {
    font-size: 12px;
    table-layout: auto;
  }
  .bom-table th,
  .bom-table td {
    padding: 8px 8px;
  }
  .bom-table td.td-badges {
    min-width: 160px;
  }
}

.bom-header {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  padding: 10px 16px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}

.bom-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  align-items: center;
}

.bom-row:last-child {
  border-bottom: none;
}

.bom-row.header-row {
  background: var(--surface2);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.bom-item {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-mid);
}

.bom-item.name {
  color: var(--text);
}

.bom-item.val {
  color: var(--accent3);
}

.bom-item.total {
  color: var(--warn);
  font-weight: 600;
}

.bom-row.total-row {
  background: rgba(0, 212, 255, 0.03);
  border-top: 1px solid var(--border-bright);
}

.bom-row.total-row .bom-item {
  color: var(--text);
  font-weight: 600;
}

.bom-row.total-row .bom-item.total {
  color: var(--warn);
  font-size: 14px;
}

/* ============================================================
   ALTERNATIVE / RECOMMENDATION CARDS
   ============================================================ */

.alt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.alt-card {
  background: rgba(16,20,28,0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  transition: all var(--duration) var(--ease);
}

a.alt-card {
  text-decoration: none;
  color: inherit;
}

.alt-card:hover {
  border-color: var(--border-bright);
  background: rgba(22,27,38,0.8);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.alt-badge {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.alt-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.alt-reason {
  font-size: 12px;
  color: var(--text-mid);
  line-height: 1.6;
  margin-bottom: 12px;
  font-family: var(--mono);
}

.alt-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-family: var(--mono);
  font-size: 10px;
  padding: 3px 10px;
  border: 1px solid var(--border-bright);
  color: var(--text-dim);
  letter-spacing: 0.05em;
  border-radius: 999px;
}

/* ============================================================
   STREAM-STYLE SELECTOR ALIASES
   ============================================================ */

.stream-slider {
  margin-left: 32px;
}

.stream-opt {
  font-family: var(--mono);
  font-size: 12px;
  padding: 8px 12px;
  border: 1px solid var(--border-bright);
  background: var(--surface);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s;
  border-radius: var(--radius-sm);
  min-width: 52px;
  text-align: center;
  user-select: none;
}

.stream-opt:hover {
  border-color: rgba(0,212,255,0.4);
  color: var(--text);
}

.stream-opt.selected {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0,212,255,0.05);
}

.stream-note {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

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

@media (max-width: 640px) {
  .stream-slider {
    margin-left: 0;
  }

  .card-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .run-section {
    flex-direction: column;
    align-items: flex-start;
  }

  .bom-row {
    grid-template-columns: 1fr 1fr;
  }
}

/* ============================================================
   STORAGE / LIFESPAN PAGE DELTA
   ============================================================ */

.metric-value.red {
  color: #ef4444;
}

/* Lifespan bar */
.lifespan-section {
  margin-top: 24px;
}

.lifespan-header {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.lifespan-bar-wrap {
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 20px;
}

.lifespan-years {
  display: flex;
  gap: 2px;
  margin-bottom: 8px;
}

.year-block {
  height: 28px;
  flex: 1;
  background: var(--border);
  border-radius: 1px;
  position: relative;
  transition: background 0.3s;
}

.year-block.alive {
  background: var(--accent3);
}

.year-block.warning {
  background: var(--warn);
}

.year-block.dead {
  background: #ef4444;
}

.year-block .yr-label {
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-mid);
}

.lifespan-legend {
  display: flex;
  gap: 16px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-mid);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 1px;
}

/* ============================================================
   CALCULATOR TWO-PANEL LAYOUT (Tools 07+)
   ============================================================ */

.calc-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 40px;
  align-items: start;
}

.calc-inputs {
  display: flex;
  flex-direction: column;
}

.calc-results {
  position: sticky;
  top: 24px;
  align-self: start;
  height: fit-content;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

.calc-inputs section {
  margin-bottom: 2em;
}

.calc-inputs .input-row {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  margin: 1em 0;
}

/* Fix: Restore System Designer left pane input-row layout */
.designer-pane-left .input-row {
  display: block;
  padding: 0;
  gap: 0;
  border-bottom: none;
  align-items: unset;
}

.input-num {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.6em 0.8em;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: var(--mono);
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.input-num:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,212,255,0.1);
}

.engine-select {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.6em 0.8em;
  border-radius: var(--radius-sm);
  font-size: 13px;
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.engine-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,212,255,0.1);
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.8em 0;
  border-bottom: 1px solid var(--border);
}

.metric-row:last-child {
  border-bottom: none;
}

.metric-row .label {
  color: var(--text-mid);
  font-size: 13px;
}

.metric-row .value {
  color: var(--text);
  font-weight: 600;
  font-family: var(--mono);
  font-size: 14px;
}

.inline-notice {
  background: rgba(0, 212, 255, 0.05);
  border-left: 3px solid var(--accent);
  padding: 0.6em 0.8em;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-mid);
  margin: 0.8em 0;
}

.inline-warn {
  background: rgba(255, 165, 0, 0.08);
  border-left: 3px solid #ffa500;
  padding: 0.6em 0.8em;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: #d68000;
  margin: 0.8em 0;
}

.collapsible {
  margin: 1em 0;
}

.collapsible summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 500;
  padding: 0.6em 0;
  user-select: none;
}

.collapsible summary:hover {
  color: var(--accent);
}

.collapsible[open] summary {
  margin-bottom: 0.8em;
}

.opt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  border: 2px solid var(--border);
  padding: 0.6em 1em;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  margin-right: 0.6em;
  margin-bottom: 0.6em;
  transition: all 0.15s;
}

.opt:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.opt.selected {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  font-weight: 600;
}

.opt-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
  margin: 0.8em 0;
}

.knowledge-text {
  background: var(--surface2);
  border-left: 3px solid var(--border-bright);
  padding: 1em;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.6;
  margin: 1em 0;
}

.action-row {
  display: flex;
  gap: 0.5em;
  margin-top: 1em;
  flex-wrap: wrap;
}

.action-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5em 0.8em;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.15s;
}

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

.action-btn.primary {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  font-weight: 600;
}

.action-btn.primary:hover {
  opacity: 0.9;
}

.json-block {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.8em;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-mid);
  max-height: 200px;
  overflow-y: auto;
  margin: 1em 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.confidence-bar {
  margin: 1em 0;
  font-size: 12px;
}

.confidence-bar-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.confidence-bar-inner {
  height: 6px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 0.3rem;
}

.confidence-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-sm);
  transition: width 0.3s;
  width: 0%;
}

/* periph-row: label + input + unit combos for component sizing inputs */
.periph-row {
  display: flex;
  gap: 0.8em;
  align-items: center;
  margin: 0.6em 0;
}

.periph-row label {
  flex: 0 0 130px;
  color: var(--text-dim);
  font-size: 12px;
  font-family: var(--mono);
}

.periph-row select {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.6em 0.8em;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.periph-row .unit {
  flex: 0 0 auto;
  color: var(--text-dim);
  font-size: 11px;
  font-family: var(--mono);
  white-space: nowrap;
}

/* result-card: accent-bordered card for results summary */
.result-card {
  background: rgba(16,20,28,0.7);
  border: 1px solid rgba(42,53,80,0.5);
  border-radius: var(--radius-sm);
  padding: 1.2em;
  margin-bottom: 1.5em;
  box-shadow: var(--shadow-sm);
}

/* metric-row variants for totals and highlights */
.metric-row.highlight {
  background: var(--surface2);
  padding: 0.8em;
  margin: 0 -0.8em;
  border-radius: var(--radius-sm);
}

.metric-row.total .label {
  font-weight: 600;
  color: var(--text);
}

.metric-row.total .value {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
}

/* calc-results: hidden until calculation completes */
.calc-results {
  display: none;
}

.engine-header {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 2em 0 1em 0;
  font-family: var(--mono);
}

.engine-header:first-child {
  margin-top: 0;
}

.section-rule {
  height: 1px;
  background: var(--border);
  margin: 2em 0;
}

.label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: var(--mono);
}

@media (max-width: 900px) {
  .calc-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .calc-results {
    position: static;
    top: auto;
  }
}

/* ============================================================
   DATASHEETS PAGE
   ============================================================ */
.ds-wrap { max-width: 1100px; margin: 40px auto; padding: 0 20px; }
.ds-grid { display: grid; grid-template-columns: 280px 1fr; gap: 20px; }
.ds-panel { border: 1px solid var(--border); border-radius: var(--radius-md); background: rgba(255,255,255,0.02); }
.ds-list { max-height: 70vh; overflow: auto; padding: 12px; }
.ds-item { display: block; margin: 0 0 8px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; border: 1px solid transparent; }
.ds-item:hover, .ds-item.active { border-color: var(--accent3); background: var(--surface2); }
.ds-main { padding: 20px; }
.ds-k { font-size: 12px; color: var(--text-mid); text-transform: uppercase; letter-spacing: .08em; }
.ds-empty { color: var(--text-mid); }
.ds-summary li { margin-bottom: 8px; }
.ds-sources li { margin-bottom: 6px; }
@media (max-width: 900px) { .ds-grid { grid-template-columns: 1fr; } .ds-list { max-height: 260px; } }

/* ── Tool context paragraph ─────────────────────────────────── */
.tool-context {
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.7;
  max-width: 640px;
  margin-top: 8px;
  margin-bottom: 0;
}

/* ── Tool CTA Card ──────────────────────────────────────────────── */
.tool-cta-card {
  background: var(--surface2, #161b26);
  border: 1px solid var(--accent, #00ff88);
  border-left: 3px solid var(--accent, #00ff88);
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
}
.tool-cta-label {
  font-family: var(--font-mono, monospace);
  font-size: 0.7rem;
  color: var(--accent, #00ff88);
  letter-spacing: 0.08em;
  margin-bottom: 0.35rem;
}
.tool-cta-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text, #e2e8f0);
  margin-bottom: 0.5rem;
}
.tool-cta-desc {
  font-size: 0.875rem;
  color: var(--muted, #8892a4);
  margin-bottom: 0.85rem;
  line-height: 1.5;
}
.tool-cta-btn {
  display: inline-block;
  background: var(--accent, #00ff88);
  color: #000;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.45em 1em;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: opacity 0.15s;
}
.tool-cta-btn:hover { opacity: 0.85; }
.inline-tool-prompt { font-size: 0.875rem; margin: 1rem 0; }
.inline-tool-prompt a { color: var(--accent, #00ff88); }

/* === NAV GROUPED DROPDOWN === */

.nav-dropdown-grouped {
  min-width: 320px;
}

.nav-dd-group {
  border-bottom: 1px solid var(--border);
  padding: 6px 0;
}
.nav-dd-group:last-of-type {
  border-bottom: none;
}

.nav-dd-group-heading {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 16px 16px 8px;
  pointer-events: none;
  user-select: none;
}

.nav-dd-item-anchor {
  border-left: 2px solid var(--accent2);
  padding-left: 26px;
}
.nav-dd-item-anchor .nav-dd-label {
  color: var(--text-mid);
  font-weight: 600;
}

.nav-dd-badge {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  padding: 1px 7px;
  border-radius: 999px;
  flex-shrink: 0;
}
.nav-dd-badge-new {
  color: var(--accent);
  border: 1px solid rgba(0, 212, 255, 0.35);
}
.nav-dd-badge-core {
  color: var(--accent2);
  border: 1px solid rgba(77, 240, 255, 0.35);
}

.nav-dd-footer {
  padding: 8px 14px;
  border-top: 1px solid var(--border);
}
.nav-dd-view-all {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
  text-decoration: none;
  letter-spacing: 0.08em;
  transition: color 0.15s;
}
.nav-dd-view-all:hover {
  color: var(--accent);
}

/* === TOOLS PAGE REDESIGN === */

.hero-ctas {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.workflow-section {
  margin: 4rem 0 4.5rem;
}

.workflow-intro {
  font-size: 14px;
  color: var(--text-mid);
  max-width: 760px;
  margin: 1rem 0 2rem 0;
  line-height: 1.65;
}

.section-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.section-title {
  font-size: 24px;
  font-weight: 300;
  letter-spacing: -0.02em;
  margin: 0.5rem 0 0.75rem;
}

.section-sub {
  font-size: 14px;
  color: var(--text-mid);
  max-width: 760px;
  margin-bottom: 2rem;
  line-height: 1.65;
}

/* Workflow grid: horizontal on desktop, stacking on mobile */
.workflow-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 0;
}

/* Individual workflow steps */
.workflow-step {
  display: flex;
  flex-direction: column;
  background: rgba(16,20,28,0.6);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-bright);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  transition: all var(--duration) var(--ease);
}

.workflow-step:hover {
  background: rgba(22,27,38,0.8);
  border-left-color: var(--accent);
  transform: translateX(2px);
  box-shadow: var(--shadow-md);
}

/* Final step styling */
.workflow-step-final {
  border-left-color: var(--accent2);
  background: rgba(77, 240, 255, 0.04);
}

.workflow-step-final:hover {
  background: rgba(77, 240, 255, 0.08);
  border-left-color: var(--accent2);
}

/* Phase label with numbering */
.workflow-phase {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.workflow-step-final .workflow-phase {
  color: var(--accent2);
}

/* Tool name */
.workflow-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.workflow-step-final .workflow-name {
  color: var(--accent2);
}

/* Description text */
.workflow-desc {
  font-size: 0.9rem;
  color: var(--text-mid);
  line-height: 1.5;
  margin-bottom: 1rem;
  flex: 1;
}

/* Arrow link */
.workflow-link {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
  align-self: flex-start;
}

.workflow-step-final .workflow-link {
  color: var(--accent2);
}

.workflow-link:hover {
  opacity: 0.7;
}

/* Desktop: horizontal 5-column layout */
@media (min-width: 900px) {
  .workflow-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 1.2rem;
  }
}

.tl-section {
  margin-top: 4rem;
}

.tl-group {
  margin-bottom: 48px;
}

.tl-group + .tl-group {
  margin-top: 3rem;
}

.tl-group-heading {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.tl-tag {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
}

.tl-tag-core {
  color: var(--accent);
  border: 1px solid rgba(0, 212, 255, 0.3);
}

.tl-tag-final {
  color: var(--accent2);
  border: 1px solid rgba(77, 240, 255, 0.3);
}

.tl-tag-quick {
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.tl-tag-advanced {
  color: var(--text-mid);
  border: 1px solid var(--border);
}

/* Tools rationale section */
.tools-rationale {
  margin: 4rem 0 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.compare-section {
  margin-top: 4rem;
}

/* ============================================================
   ENGINEERING COMPONENT LIBRARY
   Shared components used across 3+ tool pages.
   ============================================================ */

/* ── A. Status Badges ──────────────────────────────────────── */
.conf-badge {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid;
  display: inline-block;
}

.conf-high {
  background: rgba(0, 255, 136, 0.12);
  color: var(--accent3);
  border-color: var(--accent3);
}

.conf-validated {
  background: rgba(96, 165, 250, 0.12);
  color: var(--info);
  border-color: var(--info);
}

.conf-medium {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warn);
  border-color: var(--warn);
}

.conf-low {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
  border-color: var(--danger);
}

.badge-rec {
  background: rgba(0, 212, 255, 0.12);
  color: var(--accent);
  border-color: var(--accent);
}

/* ── B. Risk / Warning Items ───────────────────────────────── */
.risk-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 6px;
}

.risk-fail {
  background: rgba(239, 68, 68, 0.08);
  border-left: 3px solid var(--danger);
}

.risk-warn {
  background: rgba(245, 158, 11, 0.08);
  border-left: 3px solid var(--warn);
}

.risk-none {
  font-size: 13px;
  color: var(--text-dim);
  font-family: var(--mono);
}

.risk-icon {
  flex-shrink: 0;
  font-weight: 700;
}

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

/* ── C. Metric Grid (cell-based) ───────────────────────────── */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 16px;
}

.metric-cell {
  background: rgba(16,20,28,0.8);
  padding: 12px 14px;
}

.metric-cell-label {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 6px;
}

/* metric-cell-primary — see DASHBOARD section at end of file */

.metric-cell-secondary {
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--mono);
}

@media (max-width: 640px) {
  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── D. Tab Strip ──────────────────────────────────────────── */
.tab-strip {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
  font-family: inherit;
  margin-bottom: -1px;
  transition: color 0.12s, border-color 0.12s;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── E. Sources / Collapsible Panel ────────────────────────── */
.sources-panel {
  margin: 12px 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.sources-toggle {
  width: 100%;
  text-align: left;
  background: var(--surface2);
  border: none;
  padding: 8px 12px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sources-toggle:hover {
  color: var(--text);
}

.sources-chevron {
  margin-left: auto;
  transition: transform 0.15s;
}

.source-row {
  display: grid;
  grid-template-columns: 1.2rem 1fr 1fr;
  gap: 6px;
  padding: 4px 12px;
  font-size: 12px;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  color: var(--text-dim);
}

/* ── F. Section Header (mono label) ────────────────────────── */
.section-header {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 12px;
}

/* ================================
   BUY DROPDOWN — shared across engine pages
   ================================ */
.buy-dropdown {
  position: relative;
  display: inline-block;
}

.buy-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  margin-top: 4px;
  z-index: 100;
  min-width: 180px;
}

.buy-menu a {
  display: block;
  padding: 10px 16px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-mid);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 1px solid var(--border);
}

.buy-menu a:last-child {
  border-bottom: none;
}

.buy-menu a:hover {
  background: var(--surface2);
  color: var(--accent);
}

/* ============================================================
   DATA TABLE — reusable class for article/blog tables
   Replaces inline table styles across blog articles
   ============================================================ */
main table,
.data-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 1.5em 0;
  font-size: 14px;
}

main table thead,
.data-table thead {
  background: var(--surface2);
}

main table th,
.data-table th {
  padding: 11px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  border-bottom: 2px solid var(--border-bright);
  white-space: nowrap;
}

main table td,
.data-table td {
  padding: 11px 14px;
  color: var(--text-mid);
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  vertical-align: top;
}

main table tbody tr:last-child td,
.data-table tbody tr:last-child td {
  border-bottom: none;
}

main table tbody tr,
.data-table tbody tr {
  transition: background var(--duration) var(--ease);
}

main table tbody tr:hover,
.data-table tbody tr:hover {
  background: rgba(22,27,38,0.5);
}

/* ============================================================
   ARTICLE META — reusable class for "Last updated" lines
   ============================================================ */
.article-meta {
  font-size: 13px;
  color: var(--text-dim);
  font-style: italic;
  margin-top: 12px;
}

/* ============================================================
   GLOBAL HEADING REFINEMENTS
   ============================================================ */
h1, h2, h3 {
  text-wrap: balance;
}

h2 {
  letter-spacing: -0.02em;
}

h3 {
  letter-spacing: -0.01em;
}

/* ============================================================
   SMOOTH SCROLL ANCHOR OFFSET
   ============================================================ */
:target {
  scroll-margin-top: 80px;
}

/* ============================================================
   SELECTION COLOR
   ============================================================ */
::selection {
  background: rgba(0,212,255,0.2);
  color: var(--text);
}

/* ============================================================
   LINK HOVER TRANSITIONS (global)
   ============================================================ */
a {
  transition: color var(--duration) var(--ease);
}

/* ============================================================
   SUBTLE NOISE TEXTURE — adds tactile depth to surfaces
   ============================================================ */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.015;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ============================================================
   SCROLL-DRIVEN PROGRESS BAR — reading progress at top
   ============================================================ */
@supports (animation-timeline: scroll()) {
  body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gradient-accent);
    transform-origin: left;
    transform: scaleX(0);
    z-index: 9999;
    animation: scroll-progress linear forwards;
    animation-timeline: scroll();
  }
  @keyframes scroll-progress {
    to { transform: scaleX(1); }
  }
}

/* ============================================================
   CARD INNER GLOW ON HOVER — subtle top highlight
   ============================================================ */
.tool-card::after,
.hw-card::after,
.usecase-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
  opacity: 0;
  transition: opacity var(--duration) var(--ease);
  pointer-events: none;
}

.tool-card:hover::after,
.hw-card:hover::after,
.usecase-card:hover::after {
  opacity: 1;
}

/* ============================================================
   FOOTER GRADIENT DIVIDER
   ============================================================ */
.site-footer {
  border-top: none;
  position: relative;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-bright), var(--accent), var(--border-bright), transparent);
  opacity: 0.5;
}

/* ============================================================
   SECTION FADE-IN ON SCROLL (progressive enhancement)
   ============================================================ */
@supports (animation-timeline: view()) {
  .tools-section,
  .how-section,
  .hardware-section,
  .json-section,
  .usecases-section,
  .knowledge-section {
    animation: sectionFadeIn linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 25%;
  }
  @keyframes sectionFadeIn {
    from { opacity: 0.4; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}

/* ── Featured card styling (static purple accent) ── */
.tool-card-featured {
  border-top: 2px solid var(--accent2);
  background: rgba(77, 240, 255, 0.03);
}

.tool-card-featured:hover {
  background: rgba(77, 240, 255, 0.07);
}

.tool-card-featured .tool-title {
  color: var(--accent2);
}

.tool-card-featured .tool-cta {
  color: var(--accent2);
}

/* ============================================================
   DASHBOARD-STYLE METRIC PANELS
   Makes result metrics feel like instrument readouts.
   Adds a value bar underneath showing position in range.
   ============================================================ */

/* Upgrade card-metrics to dashboard style */
.card-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  margin-bottom: 20px;
  padding: 0;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.card-metrics > div {
  background: rgba(16,20,28,0.8);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Metric label — small mono uppercase */
.metric-label {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

/* Metric value — large, bold, mono */
.metric-value {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

/* Metric unit — separated from value for clarity */
.metric-unit {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 400;
}

/* Color semantics for metric values */
.metric-value.accent,
.metric-value.compute { color: var(--accent3); }  /* compute/performance */
.metric-value.warn,
.metric-value.power   { color: var(--warn); }      /* power/thermal */
.metric-value.cyan,
.metric-value.network  { color: var(--accent); }    /* network/bandwidth */
.metric-value.purple,
.metric-value.cost     { color: var(--accent2); }   /* cost/money */
.metric-value.red,
.metric-value.danger   { color: var(--danger); }    /* at limit */

/* Metric bar — thin indicator bar under the value */
.metric-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}

.metric-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.8s var(--ease-out);
  background: var(--accent);
}

.metric-bar-fill.compute { background: var(--accent3); }
.metric-bar-fill.power   { background: var(--warn); }
.metric-bar-fill.network { background: var(--accent); }
.metric-bar-fill.cost    { background: var(--accent2); }
.metric-bar-fill.danger  { background: var(--danger); }

/* ── Upgrade metric-grid cells ── */
.metric-cell {
  background: rgba(16,20,28,0.8);
  padding: 14px 16px;
  position: relative;
}

.metric-cell-primary {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
  letter-spacing: -0.02em;
  font-family: var(--mono);
}

/* ── Upgrade bom-totals to dashboard style ── */
.bom-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  padding: 0;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 20px;
}

.bom-totals > div {
  background: rgba(16,20,28,0.8);
  padding: 16px 18px;
}

.total-label {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.total-value {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ── Hero Ask Form ─────────────────────────────────────────────────────── */

.hero-ask-form { margin-top: 28px; }

.hero-ask-wrap {
  display: flex;
  gap: 0;
  max-width: 640px;
}

.hero-ask-input {
  flex: 1;
  background: #10141c;
  border: 1px solid #2a3550;
  border-right: none;
  color: #e2e8f0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  padding: 14px 16px;
  outline: none;
  transition: border-color 0.15s;
}

.hero-ask-input:focus { border-color: #00d4ff; }
.hero-ask-input::placeholder { color: #64748b; }

.hero-ask-btn {
  background: #00d4ff;
  color: #0a0c10;
  border: none;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  padding: 14px 24px;
  cursor: pointer;
  letter-spacing: 0.05em;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.hero-ask-btn:hover { opacity: 0.85; }

.hero-ask-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  max-width: 640px;
}

.hero-chip {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: #64748b;
  border: 1px solid #1e2535;
  padding: 5px 12px;
  border-radius: 2px;
  text-decoration: none;
  transition: all 0.15s;
}

.hero-chip:hover { border-color: #00d4ff; color: #00d4ff; }

.hero-ask-alt { margin-top: 16px; }

@media (max-width: 640px) {
  .hero-ask-wrap { flex-direction: column; }
  .hero-ask-input { border-right: 1px solid #2a3550; border-bottom: none; }
  .hero-ask-btn { width: 100%; }
}

/* ============================================================
   FEATURED TOOL SECTION
   ============================================================ */
.featured-tool-section { padding: 48px 0; border-top: 1px solid #1e2535; }

.featured-tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.featured-tool-card {
  background: #10141c;
  border: 1px solid #1e2535;
  padding: 24px;
  transition: border-color 0.2s;
}

.featured-tool-card:hover { border-color: #2a3550; }

.featured-tool-card.primary {
  border-color: #2a3550;
  border-top: 2px solid #00d4ff;
}

.featured-tool-badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  color: #00d4ff;
  margin-bottom: 10px;
}

.featured-tool-name {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 10px;
  color: #e2e8f0;
}

.featured-tool-desc {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.6;
  margin-bottom: 20px;
  font-family: 'IBM Plex Mono', monospace;
}

/* ── Hero layout overrides ───────────────────────────────── */
.home-hero { padding-bottom: 32px; }
.hero-chip { display: inline-block; flex-shrink: 0; white-space: nowrap; }

/* ── Simulator preview section ──────────────────────────── */
.simulator-preview-section {
  padding: 64px 0;
  border-top: 1px solid var(--border);
}

.sim-preview-layout {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 56px;
  align-items: center;
  margin-top: 32px;
}

.sim-preview-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin-bottom: 16px;
}

.sim-preview-heading {
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  color: var(--text);
}

.sim-preview-desc {
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.75;
  margin-bottom: 20px;
  max-width: 420px;
}

.sim-feature-list {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sim-feature-list li {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  padding-left: 16px;
  position: relative;
}

.sim-feature-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
}

.sim-preview-frame {
  position: relative;
}

.sim-preview-badge {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--accent);
  border: 1px solid rgba(0,212,255,0.3);
  background: rgba(0,212,255,0.04);
  display: inline-block;
  padding: 4px 12px;
  margin-bottom: 12px;
}

.sim-preview-img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--border-bright);
  border-top: 2px solid var(--accent);
  box-shadow: 0 24px 64px rgba(0,0,0,0.4);
}

@media (max-width: 900px) {
  .sim-preview-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .sim-preview-copy { order: 1; }
  .sim-preview-frame { order: 2; }
  .sim-preview-desc { max-width: 100%; }
}

/* ── Hero ask input/button rounding ──────────────────────── */
.hero-ask-input { border-radius: 8px 0 0 8px; }
.hero-ask-btn   { border-radius: 0 8px 8px 0; }

@media (max-width: 640px) {
  .hero-ask-input { border-radius: 8px 8px 0 0; }
  .hero-ask-btn   { border-radius: 0 0 8px 8px; }
}

/* ── Hero ask alt ghost button ───────────────────────────── */
.hero-ask-alt-btn {
  display: inline-block;
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mid);
  border: 1px solid var(--border-bright);
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}

.hero-ask-alt-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Featured card button alignment ──────────────────────── */
.featured-tool-card {
  display: flex;
  flex-direction: column;
}

.featured-tool-card .btn-primary,
.featured-tool-card .btn-ghost {
  margin-top: auto;
  align-self: flex-start;
}

/* ── Missing border-radius on secondary button classes ── */
.btn-ghost-sm  { border-radius: var(--radius-sm); }
.btn-primary-sm { border-radius: var(--radius-sm); }
.btn-copy      { border-radius: var(--radius-sm); }
.btn-share     { border-radius: var(--radius-sm); }
.btn-reset     { border-radius: var(--radius-sm); }

/* ── Compact grouped input cards (Option D) ─────────────── */
.input-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  margin-bottom: 12px;
  overflow: hidden;
}
.input-card-header {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 10px 16px 6px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.input-card-body { padding: 4px 0; }
.input-row {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  gap: 16px;
  border-bottom: 1px solid rgba(30,37,53,0.5);
}
.input-row:last-child { border-bottom: none; }
.input-row-label {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-mid);
  min-width: 140px;
  flex-shrink: 0;
  white-space: nowrap;
}
.input-row-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}
.input-card .opt,
.input-card .stream-opt {
  padding: 5px 12px;
  font-size: 11px;
}
/* Advanced toggle inside input cards */
.input-card-advanced {
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.input-card-advanced summary {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 10px 16px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  background: var(--surface2);
  border-bottom: 1px solid transparent;
  transition: all 0.15s;
}
.input-card-advanced summary::-webkit-details-marker { display: none; }
.input-card-advanced summary::before {
  content: '▶';
  font-size: 8px;
  color: var(--accent);
  transition: transform 0.2s;
}
.input-card-advanced[open] summary::before { transform: rotate(90deg); }
.input-card-advanced[open] summary { border-bottom-color: var(--border); }
.input-card-advanced summary:hover { color: var(--accent2); }
@media (max-width: 640px) {
  .input-card .input-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .input-card .input-row-label { min-width: auto; }
}

/* ── Currency FX estimated indicator ── */
.fx-est { font-size: 0.75em; opacity: 0.6; margin-left: 0.3em; }

