@import url('https://api.fontshare.com/v2/css?f[]=satoshi@400,500,700&display=swap');
@import url('https://unpkg.com/@phosphor-icons/web@2.1.1/src/regular/style.css');

/* ===== CSS CUSTOM PROPERTIES ===== */
:root {
  --bp-mobile: 768px;
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
  --space-2xl: 64px;

  /* Typography */
  --font-family-base: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-family-display: 'Satoshi', sans-serif;
  --font-family-mono: ui-monospace, SFMono-Regular, monospace;

  /* Type scale — brand spec (slightly larger base for readability) */
  --font-size-display: 76px;
  --font-size-h1: 54px;
  --font-size-h2: 43px;
  --font-size-h3: 26px;
  --font-size-body2: 26px;
  --font-size-base: 17px;
  --font-size-sm: 15px;

  /* Fluid aliases used by existing components */
  --font-size-lg: 19px;
  /* Tool/product card: title + price pair (same scale, bold) */
  --font-size-card-product: var(--font-size-lg);
  --font-size-xl: 26px;
  --font-size-2xl: 34px;
  --font-size-3xl: 43px;
  --font-size-4xl: 54px;

  /* Brand colors — Sembli palette */
  --color-bright-blue: #413CFF;
  --color-light-blue: color-mix(in srgb, var(--color-bright-blue) 16%, #ffffff); /* tint for rails + chips */
  --color-bright-green: #cef932; /* lime */
  --color-light-green: #e4ffc4;
  /* Brand pink — suggested chips (rose-pink; sits between lavender-neon and hot pink) */
  --color-brand-pink: #ff85e8;
  --color-brand-pink-soft: color-mix(in srgb, var(--color-brand-pink) 52%, #ffffff);
  --color-charcoal: #1c1c1c;
  --color-white: #ffffff;
  /* Shared category/chip palette (single source of truth) */
  --chip-fg-light: #ffffff;
  --chip-fg-dark: #111111;
  --chip-swatch-charcoal: #1c1c1c;
  --chip-swatch-red: #FF0C31;
  --chip-swatch-pink: #FF85E8;
  --chip-swatch-purple: var(--chip-swatch-blue);
  --chip-swatch-green: #009640;
  --chip-swatch-blue: #199EE6;
  --chip-swatch-orange: #FC7B00;
  --chip-swatch-lime: #CEF932;
  --chip-swatch-cyan: #5DDEF4;
  --chip-all-bg: var(--chip-swatch-charcoal);
  --chip-all-fg: var(--chip-fg-light);
  --chip-writing-bg: var(--chip-swatch-red);
  --chip-writing-fg: var(--chip-fg-light);
  --chip-copy-bg: var(--chip-swatch-pink);
  --chip-copy-fg: var(--chip-fg-light);
  --chip-design-bg: var(--chip-swatch-purple);
  --chip-design-fg: var(--chip-fg-light);
  --chip-engineering-bg: var(--chip-swatch-green);
  --chip-engineering-fg: var(--chip-fg-light);
  --chip-ui-bg: var(--chip-swatch-blue);
  --chip-ui-fg: var(--chip-fg-light);
  --chip-web-bg: var(--chip-swatch-pink);
  --chip-web-fg: var(--chip-fg-light);
  --chip-image-bg: var(--chip-swatch-orange);
  --chip-image-fg: var(--chip-fg-light);
  --chip-research-bg: var(--chip-swatch-lime);
  --chip-research-fg: var(--chip-fg-dark);
  --chip-slides-bg: var(--chip-swatch-purple);
  --chip-slides-fg: var(--chip-fg-light);
  --chip-video-bg: var(--chip-swatch-red);
  --chip-video-fg: var(--chip-fg-light);
  --chip-audio-bg: var(--chip-swatch-green);
  --chip-audio-fg: var(--chip-fg-light);
  --chip-transcribe-bg: var(--chip-swatch-blue);
  --chip-transcribe-fg: var(--chip-fg-light);
  --chip-assistants-bg: var(--chip-swatch-pink);
  --chip-assistants-fg: var(--chip-fg-light);
  --chip-automation-bg: var(--chip-swatch-lime);
  --chip-automation-fg: var(--chip-fg-dark);
  --chip-planning-bg: var(--chip-swatch-purple);
  --chip-planning-fg: var(--chip-fg-light);
  --chip-productivity-bg: var(--chip-swatch-green);
  --chip-productivity-fg: var(--chip-fg-light);
  --chip-photos-bg: var(--chip-swatch-purple);
  --chip-photos-fg: var(--chip-fg-light);
  --chip-pitch-bg: var(--chip-swatch-pink);
  --chip-pitch-fg: var(--chip-fg-dark);
  --chip-social-bg: var(--chip-swatch-lime);
  --chip-social-fg: var(--chip-fg-dark);
  --chip-automate-workflow-bg: var(--chip-swatch-blue);
  --chip-automate-workflow-fg: var(--chip-fg-light);
  --chip-research-report-bg: var(--chip-swatch-red);
  --chip-research-report-fg: var(--chip-fg-dark);
  --chip-ads-bg: var(--chip-swatch-orange);
  --chip-ads-fg: var(--chip-fg-light);
  --chip-email-bg: var(--chip-swatch-green);
  --chip-email-fg: var(--chip-fg-light);
  --chip-uxcopy-bg: var(--chip-swatch-pink);
  --chip-uxcopy-fg: var(--chip-fg-dark);
  --chip-category-tint-blue-bg: #f3f9ff;
  --chip-category-tint-blue-border: rgba(139, 179, 226, 0.3);
  --chip-category-tint-green-bg: #f4faf3;
  --chip-category-tint-green-border: rgba(138, 193, 138, 0.3);
  --chip-accent-soft-blue: #eef7ff;
  --chip-accent-soft-green: #f3faf3;
  /* Unified light neutral across page/nav/cards (single source of truth) */
  --nav-rail-bg: #f9fbff;
  --color-bg-grey: var(--nav-rail-bg);
  --color-light-grey: var(--nav-rail-bg);
  /* Header rails — match Discover category carousel */
  /* Nav logo + pills: 32px icon + horizontal padding rhythm */
  --e-nav-pill-height: 44px;

  /* Nav chrome — top pill (uses brand accent) */
  --e-nav-chrome-bg: var(--color-bright-blue);

  /* Semantic tokens */
  --bg-primary: #ffffff;
  --bg-secondary: var(--nav-rail-bg);
  --bg-dark: #1c1c1c;
  --surface-elevated: rgba(255, 255, 255, 0.92);
  --surface-strong: rgba(255, 255, 255, 0.98);
  --border-light: rgba(184, 202, 224, 0.42);
  --border-strong: rgba(112, 224, 240, 0.35);
  /* Bordered cards / tiles: hover ring (nav chrome blue) */
  --card-hover-outline: var(--e-nav-chrome-bg);
  --text-primary: #2e2e2e;
  --text-secondary: #6b6b6b;
  --text-muted: #9a9a9a;
  --text-dark: rgba(46, 46, 46, 0.52);
  --glass-white: rgba(255, 255, 255, 0.2);
  --glass-white-light: rgba(255, 255, 255, 0.35);
  --text-white: #ffffff;
  --text-white-dim: rgba(255, 255, 255, 0.7);
  --text-white-muted: rgba(255, 255, 255, 0.45);
  --transition: all 0.22s ease;
  --color-success: #4CAF50;
  --shadow-soft: 0 4px 24px rgba(112, 224, 240, 0.12);
  --shadow-card: 0 8px 40px rgba(112, 224, 240, 0.14);
  /* Subtle card elevation — matches Discover-adjacent passive chrome */
  --shadow-panel: 0 4px 20px rgba(93, 222, 244, 0.06);
  /* Pickable cards / rows: selected surface (distinct from hover — use with border-strong + --shadow-panel) */
  --interactive-selected-fill: color-mix(in srgb, var(--color-light-blue) 58%, var(--bg-primary));
  --interactive-selected-inset: inset 0 0 0 1px rgba(112, 224, 240, 0.22);
  --radius-2xl: 28px;
  --radius-xl: 21px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  /* Nested strips inside assembly / discover cards (tool rows + favicons) */
  --radius-assemble-row: 8px;
  --radius-assemble-icon: 5px;
  --page-pad-x: 24px;
  --page-pad-y: 80px;

  /* Brand gradients */
  --grad-blue: linear-gradient(135deg, var(--color-bright-blue) 0%, var(--color-light-blue) 100%);
  --grad-green: linear-gradient(135deg, #4caf50 0%, #dbfbe1 100%);
  --grad-blue-green: linear-gradient(135deg, var(--color-bright-blue) 0%, #4caf50 100%);
  --grad-hero: linear-gradient(160deg, var(--color-light-blue) 0%, #fafaf9 50%, #dbfbe1 100%);
  --grad-dark: linear-gradient(180deg, #1c1c1c 0%, #121212 100%);
  --grad-card: linear-gradient(135deg, rgba(112, 224, 240, 0.1) 0%, rgba(76, 175, 80, 0.06) 100%);

  /* Z-index scale */
  --z-base: 1;
  --z-dropdown: 100;
  --z-modal: 1000;
  --z-overlay: 9999;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  margin-bottom: 0;
  padding-bottom: 0;
}

@media (max-width: 768px) {
  :root {
    --space-lg: 16px;
    --space-xl: 28px;
    --space-2xl: 40px;
    --font-size-h1: 40px;
    --font-size-h2: 32px;
    --font-size-h3: 22px;
    --font-size-base: 16px;
    --font-size-sm: 14px;
    --page-pad-x: 16px;
    --page-pad-y: 56px;
  }
}

/* index.html — full white page canvas (Discover and other pages keep --bg-secondary on body) */
body.summo-home {
  background: var(--bg-primary);
}

html:has(body.summo-home) {
  background: var(--bg-primary);
}

body.summo-home .e-page {
  background: var(--bg-primary);
}

/* Typography — brand scale */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-display);
  font-weight: 300;
  line-height: 1.0;
  color: var(--text-primary);
}

h1 {
  font-size: 70px;
  font-weight: 300;
  line-height: 1.0;
  letter-spacing: -0.01em;
  color: #0A0A0A;
}
h2 { font-size: var(--font-size-h2); font-weight: 300 !important; }
h3 { font-size: var(--font-size-h3); line-height: 1.3; }

p {
  color: var(--text-secondary);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--color-bright-blue);
  outline-offset: 2px;
}

/* ===== Interactive states (shared recipe) =====
   Default: 1px solid var(--border-light); optional var(--shadow-panel) on elevated cards.
   Hover:    border-color var(--card-hover-outline) + var(--shadow-panel).
   Selected: border-color var(--border-strong) + var(--shadow-panel) + var(--interactive-selected-inset)
             on var(--interactive-selected-fill) (or keep semantic greens/reds where required).
   Focus:    :focus-visible ring above (bright blue). Optional utility — apply to custom card shells. */
.is-interactive-surface {
  border: 1px solid var(--border-light);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.is-interactive-surface:hover {
  border-color: var(--card-hover-outline);
  box-shadow: var(--shadow-panel);
}

.is-interactive-surface.is-selected,
.is-interactive-surface[aria-selected='true'] {
  border-color: var(--border-strong);
  background: var(--interactive-selected-fill);
  box-shadow: var(--shadow-panel), var(--interactive-selected-inset);
}

img {
  max-inline-size: 100%;
  block-size: auto;
  display: block;
}

/* ===== MAIN LAYOUT ===== */
main {
  inline-size: 100%;
  position: relative;
}

header {
  background: var(--bg-secondary);
  padding-block: var(--space-lg);
  padding-inline: var(--space-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  inset-block-start: 0;
  z-index: var(--z-dropdown);

  .logo {
    font-size: var(--font-size-2xl);
    font-weight: 500;
    color: var(--text-primary);
  }

  nav {
    display: flex;
    gap: var(--space-2xl);
    align-items: center;
  
    a {
      font-size: var(--font-size-base);
      color: var(--text-secondary);
      text-decoration: none;
      transition: var(--transition);
      cursor: pointer;
    
      &:hover {
        color: var(--text-primary);
      }
    }
  }

  .auth-buttons {
    display: flex;
    gap: var(--space-md);
    align-items: center;
  }
}

/* ===== BUTTONS ===== */
.btn {
  padding-block: var(--space-sm);
  padding-inline: var(--space-lg);
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: var(--font-size-sm);
  font-weight: 500;
  transition: var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  font-family: inherit;

  &:hover {
    transform: translateY(-2px);
  }

  &:active {
    transform: translateY(0);
  }
}

.btn-text {
  background: rgba(255, 255, 255, 0.42);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.btn-text:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-primary {
  background: linear-gradient(180deg, #262626 0%, #1a1a1a 100%);
  color: var(--text-white);
  border: 1px solid rgba(38, 38, 38, 0.9);
  box-shadow: 0 12px 24px rgba(38, 38, 38, 0.18);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #333333 0%, #262626 100%);
}

/* Button variants */
.btn-find {
  background: linear-gradient(180deg, #262626 0%, #1a1a1a 100%);
  color: var(--text-white);
  border: none;
  border-radius: 999px;
  padding-block: var(--space-md);
  padding-inline: var(--space-2xl);
  font-size: var(--font-size-base);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.btn-find:hover {
  background: linear-gradient(180deg, #333333 0%, #262626 100%);
}

.filter-btn {
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid var(--border-light);
  border-radius: 50px;
  padding-block: var(--space-sm);
  padding-inline: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  cursor: pointer;
  transition: var(--transition);
  font-size: var(--font-size-base);
  color: rgba(0, 0, 0, 0.9);
  white-space: nowrap;
  font-family: inherit;
  border: none;
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.35);
}

.dropdown-icon {
  inline-size: 16px;
  block-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== HERO SECTION ===== */
.hero-section {
  padding-block: var(--space-2xl);
  padding-inline: var(--space-lg);
  text-align: center;
  background: var(--grad-hero);
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(circle at 15% 40%, rgba(93, 222, 244, 0.18) 0%, transparent 45%),
    radial-gradient(circle at 85% 75%, rgba(76, 175, 80, 0.12) 0%, transparent 40%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: var(--z-base);
  max-inline-size: 900px;
  margin-inline: auto;
}

.hero-title {
  font-size: var(--font-size-4xl);
  font-weight: 500;
  color: var(--text-primary);
  margin-block-end: var(--space-md);
  line-height: 1.2;
}

.hero-description {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  margin-block-end: var(--space-2xl);
}

/* ===== SEARCH CONTAINER ===== */
.search-container {
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid var(--border-light);
  border-radius: 50px;
  padding-block: var(--space-sm);
  padding-inline: var(--space-md);
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  margin-block-start: var(--space-xl);
  box-shadow: var(--shadow-panel);
  backdrop-filter: blur(10px);

  input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: var(--font-size-lg);
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
  }

  input::placeholder {
    color: var(--text-muted);
  }
}

.divider {
  inline-size: 1px;
  block-size: var(--space-2xl);
  background: rgba(234, 238, 246, 0.5);
}

/* ===== QUICK ACTIONS ===== */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-block-start: var(--space-2xl);
  padding-inline: 0;
}

.quick-action-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid var(--border-light);
  border-radius: 50px;
  padding-block: var(--space-lg);
  padding-inline: var(--space-md);
  text-decoration: none;
  color: var(--text-primary);
  font-size: var(--font-size-base);
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.quick-action-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: var(--border-strong);
}

.quick-actions-row-2 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-block-start: var(--space-md);
  padding-inline: 0;
}

/* ===== LOADING ANIMATION ===== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--grad-hero);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-overlay);
  transition: opacity 0.6s ease;
  opacity: 1;

  &.hidden {
    opacity: 0;
    pointer-events: none;
  }
}

.loading-container {
  text-align: center;
  inline-size: 100%;
  max-inline-size: 600px;
  padding-inline: var(--space-lg);
  padding-block: var(--space-xl);
}

.loading-content {
  position: relative;
  z-index: var(--z-base);
}

.loading-title {
  font-size: var(--font-size-3xl);
  font-weight: 500;
  color: var(--text-primary);
  margin-block-end: var(--space-md);
  line-height: 1.2;
}

.loading-subtitle {
  font-size: var(--font-size-base);
  color: rgba(0, 0, 0, 0.5);
  margin-block-end: var(--space-2xl);
}

.steps-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  animation: fadeIn 0.4s ease;
}

.step-connector {
  inline-size: 2px;
  block-size: 32px;
  background: rgba(0, 0, 0, 0.2);
}

.step-box {
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--space-md);
  padding-block: var(--space-md);
  padding-inline: var(--space-2xl);
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(10px);
  inline-size: 240px;
  text-align: center;
  color: rgba(0, 0, 0, 0.9);
  font-size: var(--font-size-base);
  font-weight: 500;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.5);
  transition: var(--transition);
}

.step-box:hover {
  background: rgba(255, 255, 255, 0.45);
  border-color: rgba(255, 255, 255, 0.6);
}

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

/* ===== RESULTS PAGE ===== */
.results-section {
    padding: 80px 40px;
    text-align: center;
    background: var(--grad-hero);
    position: relative;
    overflow: hidden;
    min-height: 500px;
}

.results-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(circle at 15% 40%, rgba(93, 222, 244, 0.18) 0%, transparent 45%),
        radial-gradient(circle at 85% 75%, rgba(76, 175, 80, 0.12) 0%, transparent 40%);
    pointer-events: none;
}

.results-container {
    position: relative;
    z-index: 1;
    max-width: 600px;
    margin: 0 auto;
}

.results-title {
    font-size: 32px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.2;
}

.results-subtitle {
    font-size: 16px;
    color: rgba(0, 0, 0, 0.5);
    margin-bottom: 60px;
}

.research-category {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 40px;
}

.category-card {
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-sm);
    padding: 24px;
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(10px);
    width: 240px;
    text-align: center;
    transition: var(--transition);
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.5);
}

.category-card:hover {}

.category-name {
    font-size: 16px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.9);
    margin: 0;
}

/* ===== FOOTER ===== */
footer {
  background: var(--bg-dark);
  color: var(--text-white);
  padding-block-start: var(--space-2xl);
  padding-block-end: var(--space-lg);
  padding-inline: var(--space-lg);
  margin-block-start: var(--space-2xl);
}

.footer-top {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-2xl);
  max-inline-size: 1400px;
  margin-inline: auto;
  margin-block-end: var(--space-2xl);
}

.footer-logo-wrapper {
  display: flex;
  gap: var(--space-xs);
  align-items: flex-start;
}

.footer-logo {
  font-size: 3rem;
  font-weight: 500;
  color: rgba(236, 238, 236, 1);
  letter-spacing: -1px;
}

.footer-logo-accent {
  font-size: 2.5rem;
  color: rgba(255, 255, 255, 0.6);
  position: relative;
  inset-block-start: -0.5rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md) var(--space-lg);
}

.footer-link-item {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  color: rgba(173, 179, 171, 1);
  font-size: var(--font-size-base);
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
}

.footer-link-item:hover {
  color: var(--text-white);
}

.footer-divider {
  color: rgba(60, 64, 60, 1);
  font-size: var(--font-size-base);
}

.footer-contact {
  text-align: right;

  .phone {
    font-size: var(--font-size-lg);
    font-weight: 500;
    color: var(--text-white);
    margin-block-end: var(--space-md);
  }

  .item {
    font-size: var(--font-size-sm);
    color: var(--text-white-dim);
    line-height: 1.6;
  }

  .link {
    color: var(--text-white-dim);
    text-decoration: none;
    transition: var(--transition);

    &:hover {
      color: var(--text-white);
    }
  }

  .cta {
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--text-white);
    margin-block-start: var(--space-lg);
    cursor: pointer;
    transition: var(--transition);

    &:hover {
      color: rgba(255, 255, 255, 0.8);
    }
  }
}

.footer-middle {
  border-block-start: 1px solid #333;
  padding-block-start: var(--space-xl);
  margin-block-end: var(--space-xl);
}

.partnerships-section {
  border: 3px solid rgba(255, 255, 255, 0.4);
  border-radius: 2rem;
  padding-block: var(--space-xl);
  padding-inline: var(--space-xl);
  background: linear-gradient(135deg, rgba(93, 222, 244, 0.2), rgba(219, 251, 225, 0.3));
  position:  relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-block-end: var(--space-lg);
}

.partnerships-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
  pointer-events: none;
}

.partnerships-header {
  position: relative;
  z-index: var(--z-base);
}

.partnerships-label {
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  font-weight: 400;
  margin-block-end: var(--space-xs);
}

.partnerships-title {
  font-size: var(--font-size-3xl);
  font-weight: 500;
  color: var(--text-primary);
}

.partnerships-arrow {
  font-size: 2.5rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  z-index: var(--z-base);

  &:hover {
    transform: translateX(0.5rem);
  }
}

.footer-bottom {
  text-align: center;
  padding-block-start: var(--space-md);
  border-block-start: 1px solid rgba(255, 255, 255, 0.1);
}

.copyright {
  font-size: var(--font-size-sm);
  color: var(--text-white-muted);
}

/* ===== ASSEMBLY BUILDER / RESULTS PAGE ===== */
.results-section {
    padding: 60px 40px;
    position: relative;
    overflow: visible;
    min-height: auto;
    background: var(--bg-secondary);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    max-width: 1400px;
    margin: 0 auto 40px;
    gap: 40px;
}

.results-title-group {
    text-align: left;
    flex: 1;
}

.results-title {
    font-size: 26px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.results-subtitle {
    font-size: 13px;
    color: rgba(0, 0, 0, 0.5);
    margin-bottom: 0;
}

.budget-badge {
    border: 0.735px solid rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(10px);
    padding: 10px 18px;
    min-width: 95px;
    flex-shrink: 0;
    box-shadow: inset 0px 0.735px 0px 0px rgba(255, 255, 255, 0.5);
}

.badge-label {
    font-size: 8.8px;
    color: rgba(0, 0, 0, 0.4);
    margin-bottom: 2px;
    text-transform: capitalize;
}

.badge-value {
    font-size: 12px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.9);
}

.results-content {
    display: grid;
    grid-template-columns: 1fr 264px;
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.stack-categories {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.category {
    border: 0.735px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(10px);
    padding: 18px;
    box-shadow: inset 0px 0.735px 0px 0px rgba(255, 255, 255, 0.5);
}

.category-title {
    font-size: 11.7px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.9);
    margin-bottom: 6px;
}

.category-description {
    font-size: 11.7px;
    color: rgba(0, 0, 0, 0.5);
    margin-bottom: 16px;
}

.tools-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tool-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.tool-name {
    font-size: 10.3px;
    color: rgba(0, 0, 0, 0.7);
}

.tool-price {
    font-size: 10.3px;
    color: rgba(0, 0, 0, 0.6);
    font-weight: 500;
    text-align: right;
}

.ai-stack-sidebar {
    border: 0.735px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(10px);
    padding: 18px;
    height: fit-content;
    position: sticky;
    top: 20px;
    box-shadow: inset 0px 0.735px 0px 0px rgba(255, 255, 255, 0.5);
}

.sidebar-title {
    font-size: 14.7px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.9);
    margin-bottom: 18px;
}

.stack-section {
    margin-bottom: 18px;
}

.section-label {
    font-size: 8.8px;
    color: rgba(0, 0, 0, 0.4);
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.section-value {
    font-size: 11.7px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.9);
}

.tools-breakdown {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.breakdown-item .tool-name {
    font-size: 10.3px;
    color: rgba(0, 0, 0, 0.7);
}

.breakdown-item .tool-price {
    font-size: 10.3px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.9);
}

.total-cost {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0 12px;
    margin-bottom: 20px;
}

.total-label {
    font-size: 8.8px;
    color: rgba(0, 0, 0, 0.6);
}

.total-value {
    font-size: 14.7px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.9);
}

.btn-build-assembly {
    width: 100%;
    background: var(--bg-dark);
    color: var(--text-white);
    border: none;
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 11.7px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-build-assembly:hover {
    background: rgba(0, 0, 0, 0.9);
}

.optimize-section {
    max-width: 1400px;
    margin: 60px auto 0;
    padding: 0;
}

.optimize-title {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 24px;
}

.optimization-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.optimization-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    transition: var(--transition);
}

.optimization-item:hover {
    background: rgba(255, 255, 255, 0.7);
}

.item-text {
    font-size: 14px;
    color: var(--text-primary);
}

.item-saving {
    font-size: 14px;
    font-weight: 500;
    color: #4CAF50;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .nav {
        gap: 20px;
    }

    .hero-title {
        font-size: 36px;
    }

    .results-title {
        font-size: 28px;
    }

    .results-content {
        grid-template-columns: 1fr;
    }

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

    .ai-stack-sidebar {
        position: static;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }

    .nav {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    .hero-section {
        padding: 40px 20px;
    }

    .hero-title {
        font-size: 28px;
    }

    .results-section {
        padding: 40px 20px;
    }

    .results-header {
        flex-direction: column;
        align-items: stretch;
    }

    .results-title {
        font-size: 22px;
    }

    .quick-actions {
        grid-template-columns: 1fr;
        padding: 0 20px;
    }

    .quick-actions-row-2 {
        grid-template-columns: 1fr;
        padding: 0 20px;
    }

    .search-container {
        flex-direction: column;
    }

    .footer-top {
        flex-direction: column;
        gap: 40px;
    }

    .footer-contact {
        text-align: left;
    }

    .partnerships-section {
        padding: 24px;
    }

    .partnerships-title {
        font-size: 24px;
    }

    .results-content {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .stack-categories {
        grid-template-columns: 1fr;
    }

    .ai-stack-sidebar {
        width: 100%;
    }
}

/* ===== CATALOG SECTION (discover.html) ===== */
.catalog-section {
    max-inline-size: 1400px;
    margin-inline: auto;
    padding-block: var(--space-2xl);
    padding-inline: var(--space-lg);
}

.catalog-header {
    margin-block-end: var(--space-2xl);
}

.catalog-header h1 {
    font-size: var(--font-size-4xl);
    color: var(--text-primary);
    margin-block-end: var(--space-md);
}

.catalog-header p {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    max-inline-size: 600px;
}

.catalog-filters {
    margin-block-end: var(--space-2xl);
}

.search-catalog {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    align-items: center;
}

.kit-catalog {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-lg);
}

.kit-card {
    padding: var(--space-lg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    background: var(--bg-secondary);
}

.kit-card:hover {}

.kit-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-md);
}

.kit-name {
    font-size: var(--font-size-lg);
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}

.kit-favorite-btn {
    background: none;
    border: none;
    font-size: var(--font-size-xl);
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
}

.kit-favorite-btn:hover {
    transform: scale(1.2);
}

.kit-description {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.kit-tools {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.tool-tag {
    display: inline-block;
    padding: 4px 8px;
    background: var(--color-light-grey);
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-primary);
}

.kit-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-block-start: auto;
    padding-block-start: var(--space-md);
    border-block-start: 1px solid var(--color-light-grey);
}

.kit-price {
    font-size: var(--font-size-lg);
    font-weight: 500;
    color: var(--text-primary);
}

/* ===== ASSEMBLY BUILDER SECTION ===== */
.stack-builder-section {
    max-inline-size: 1400px;
    margin-inline: auto;
    padding-block: var(--space-2xl);
    padding-inline: var(--space-lg);
}

.builder-header {
    margin-block-end: var(--space-2xl);
}

.builder-header h1 {
    font-size: var(--font-size-4xl);
    color: var(--text-primary);
    margin-block-end: var(--space-md);
}

.builder-meta {
    display: flex;
    gap: var(--space-md);
    align-items: center;
}

.budget-badge {
    display: inline-block;
    padding: var(--space-sm) var(--space-md);
    background: rgba(16, 185, 129, 0.1);
    color: #4CAF50;
    border-radius: 6px;
    font-weight: 500;
    font-size: var(--font-size-sm);
}

.builder-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: var(--space-2xl);
}

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

.category-card {
    padding: var(--space-lg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
}

.category-title {
    font-size: var(--font-size-lg);
    font-weight: 500;
    color: var(--text-primary);
    margin-block-end: var(--space-md);
}

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

.tool-item {
    padding: var(--space-md);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.tool-item:hover {
    border-color: var(--card-hover-outline);
    box-shadow: var(--shadow-panel);
    background: var(--bg-primary);
}

.tool-item.selected {
    border-color: var(--border-strong);
    background: var(--interactive-selected-fill);
    box-shadow: var(--shadow-panel), var(--interactive-selected-inset);
}

.tool-item h4 {
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--text-primary);
    margin-block-end: 4px;
}

.tool-item p {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin: 0;
}

.tool-price {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-primary);
    display: block;
    margin-block-start: var(--space-sm);
}

.stack-sidebar {
    padding: var(--space-lg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    height: fit-content;
    position: sticky;
    inset-block-start: 100px;
}

.stack-sidebar h3 {
    font-size: var(--font-size-lg);
    font-weight: 500;
    color: var(--text-primary);
    margin-block-end: var(--space-md);
}

.selected-tools {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-block-end: var(--space-lg);
    padding-block-end: var(--space-lg);
    border-block-end: 1px solid #e5e7eb;
}

.selected-tool-item {
    display: flex;
    justify-content: space-between;
    font-size: var(--font-size-sm);
    color: var(--text-primary);
}

.tool-cost {
    font-weight: 500;
}

.stack-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-block-end: var(--space-lg);
    padding-block: var(--space-md);
    border-block: 1px solid #e5e7eb;
    font-size: var(--font-size-base);
    font-weight: 500;
}

.total-cost {
    font-size: var(--font-size-lg);
    color: var(--text-primary);
}

.cost-remainder {
    font-size: var(--font-size-sm);
    color: #4CAF50;
    margin-block-end: var(--space-lg);
    padding: var(--space-sm);
    background: rgba(16, 185, 129, 0.05);
    border-radius: 6px;
    text-align: center;
}

.btn-block {
    width: 100%;
    margin-block-end: var(--space-lg);
}

.optimize-suggestion {
    padding: var(--space-md);
    background: rgba(59, 130, 246, 0.05);
    border-radius: 8px;
    border-inline-start: 3px solid var(--color-bright-blue);
}

.optimize-suggestion p {
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    margin: 0;
    margin-block-end: 4px;
}

.optimize-suggestion p:last-child {
    margin-block-end: 0;
}

/* ===== KIT DETAIL SECTION ===== */
.kit-detail-section {
    max-inline-size: 1200px;
    margin-inline: auto;
    padding-block: var(--space-2xl);
    padding-inline: var(--space-lg);
}

.kit-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-2xl);
    margin-block-end: var(--space-2xl);
    padding-block-end: var(--space-2xl);
    border-block-end: 1px solid #e5e7eb;
}

.kit-title-block h1 {
    font-size: var(--font-size-4xl);
    color: var(--text-primary);
    margin-block-end: var(--space-md);
}

.kit-subtitle {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    margin: 0;
}

.kit-stats {
    display: flex;
    gap: var(--space-2xl);
    align-self: flex-start;
}

.kit-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: var(--font-size-2xl);
    font-weight: 500;
    color: var(--text-primary);
}

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

.kit-tools-section h2,
.kit-workflow-section h2 {
    font-size: var(--font-size-2xl);
    font-weight: 500;
    color: var(--text-primary);
    margin-block-end: var(--space-lg);
}

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

.tool-card {
    padding: var(--space-lg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.tool-card:hover {}

.tool-card h3 {
    font-size: var(--font-size-card-product);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
    margin-block-end: var(--space-sm);
}

.tool-card p {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-block-end: var(--space-md);
}

.tool-category {
    display: inline-block;
    font-size: 12px;
    padding: 4px 8px;
    background: var(--color-light-grey);
    border-radius: 4px;
    color: var(--text-primary);
}

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

.workflow-step {
    padding-block: var(--space-lg);
    padding-inline: var(--space-lg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    inline-size: 40px;
    block-size: 40px;
    background: var(--text-primary);
    color: white;
    border-radius: 50%;
    font-weight: 500;
    font-size: var(--font-size-lg);
}

.workflow-step h3 {
    font-size: var(--font-size-lg);
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}

.workflow-step p {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin: 0;
}

.kit-cta {
    display: flex;
    gap: var(--space-md);
    margin-block-start: var(--space-2xl);
    padding-block-start: var(--space-2xl);
    border-block-start: 1px solid #e5e7eb;
}

/* ===== PRICING SECTION ===== */
.pricing-section,
.pricing-credits-section {
    max-inline-size: 1200px;
    margin-inline: auto;
    padding-block: var(--space-2xl);
    padding-inline: var(--space-lg);
}

.pricing-header,
.pricing-header {
    text-align: center;
    margin-block-end: var(--space-2xl);
}

.pricing-header h1 {
    font-size: var(--font-size-4xl);
    color: var(--text-primary);
    margin-block-end: var(--space-md);
}

.pricing-header p {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    margin-block-end: var(--space-2xl);
}

.billing-toggle {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    align-items: center;
    margin-block-end: var(--space-2xl);
}

.toggle-btn {
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border-light);
    background: var(--bg-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    font-size: var(--font-size-base);
    font-weight: 500;
}

.toggle-btn.active {
    background: var(--text-primary);
    color: white;
    border-color: var(--text-primary);
}

.save-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(16, 185, 129, 0.1);
    color: #4CAF50;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-2xl);
    margin-block-end: var(--space-2xl);
}

.pricing-card {
    padding: var(--space-2xl);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    background: var(--surface-elevated);
    position: relative;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
}

.pricing-card:hover {}

.pricing-card.featured {
    border-color: var(--text-primary);
    box-shadow: var(--shadow-card);
    transform: scale(1.02);
}

.featured-label {
    position: absolute;
    inset-block-start: -12px;
    inset-inline-start: 20px;
    display: inline-block;
    padding: 4px 12px;
    background: var(--text-primary);
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.card-header {
    margin-block-end: var(--space-lg);
}

.plan-name {
    font-size: var(--font-size-2xl);
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
    margin-block-end: 4px;
}

.plan-description {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin: 0;
}

.price {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-block-end: var(--space-lg);
}

.currency {
    font-size: var(--font-size-lg);
    font-weight: 500;
    color: var(--text-secondary);
}

.amount {
    font-size: var(--font-size-4xl);
    font-weight: 700;
    color: var(--text-primary);
}

.period {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
}

.features-list {
    list-style: none;
    padding: 0;
    margin: var(--space-lg) 0 0;
    padding-block-start: var(--space-lg);
    border-block-start: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.features-list li {
    display: flex;
    gap: var(--space-sm);
    font-size: var(--font-size-sm);
    color: var(--text-primary);
}

.check {
    color: #4CAF50;
    font-weight: 500;
    min-inline-size: 16px;
}

.unavailable {
    color: #EAEEF6;
    font-weight: 500;
    min-inline-size: 16px;
}

/* ===== HOW PRICING WORKS ===== */
.how-pricing-works,
.how-credits-works {
    margin-block: var(--space-2xl);
    padding-block: var(--space-2xl);
}

.how-pricing-works h2,
.how-credits-works h2 {
    text-align: center;
    font-size: var(--font-size-3xl);
    color: var(--text-primary);
    margin-block-end: var(--space-2xl);
}

.pricing-explanation,
.pricing-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
}

.explanation-card,
.step-card {
    padding: var(--space-lg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--color-bg-grey);
    text-align: center;
}

.explanation-icon {
    display: block;
    font-size: var(--font-size-3xl);
    margin-block-end: var(--space-md);
}

.explanation-card h3,
.step-card h3 {
    font-size: var(--font-size-lg);
    font-weight: 500;
    color: var(--text-primary);
    margin-block-end: var(--space-sm);
}

.explanation-card p,
.step-card p {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin: 0;
}

/* ===== CREDITS TABLE ===== */
.allocation-table {
    margin-block: var(--space-2xl);
    margin-block-end: var(--space-2xl);
}

.allocation-table h3 {
    font-size: var(--font-size-lg);
    font-weight: 500;
    color: var(--text-primary);
    margin-block-end: var(--space-lg);
}

.credits-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    overflow: hidden;
}

.credits-table thead {
    background: var(--color-bg-grey);
}

.credits-table th {
    padding: var(--space-md);
    text-align: inline-start;
    font-weight: 500;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    border-block-end: 1px solid #e5e7eb;
}

.credits-table td {
    padding: var(--space-md);
    border-block-end: 1px solid var(--color-light-grey);
    font-size: var(--font-size-sm);
    color: var(--text-primary);
}

.credits-table tbody tr:last-child td {
    border-block-end: none;
}

/* ===== MONTHLY CREDITS ===== */
.monthly-credits {
    margin-block-end: var(--space-2xl);
}

.monthly-credits h3 {
    font-size: var(--font-size-lg);
    font-weight: 500;
    color: var(--text-primary);
    margin-block-end: var(--space-lg);
}

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

.breakdown-item {
    padding: var(--space-lg);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.breakdown-label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.breakdown-value {
    font-size: var(--font-size-2xl);
    font-weight: 500;
    color: var(--text-primary);
}

/* ===== FAQ ===== */
.credits-faq {
    margin-block: var(--space-2xl);
}

.credits-faq h2 {
    font-size: var(--font-size-3xl);
    color: var(--text-primary);
    margin-block-end: var(--space-lg);
    text-align: center;
}

.faq-items {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    max-inline-size: 800px;
    margin-inline: auto;
}

.faq-item {
    padding: var(--space-lg);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: var(--bg-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.faq-item:hover {
    border-color: var(--text-primary);
}

.faq-item summary {
    font-weight: 500;
    color: var(--text-primary);
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-item summary::after {
    content: '›';
    display: block;
    transform: rotate(0deg);
    transition: transform 0.3s ease;
}

.faq-item[open] summary::after {
    transform: rotate(90deg);
}

.faq-item p {
    margin: var(--space-md) 0 0;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

/* ===== RESULTS PAGE FILTERS ===== */
.results-section {
    max-inline-size: 1400px;
    margin-inline: auto;
    padding-block: var(--space-2xl);
    padding-inline: var(--space-lg);
}

.results-header {
    margin-block-end: var(--space-2xl);
}

.results-header h1 {
    font-size: var(--font-size-4xl);
    color: var(--text-primary);
    margin-block-end: var(--space-md);
}

.results-subtitle {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
}

.results-content {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: var(--space-2xl);
}

.results-filters {
    padding: var(--space-lg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    height: fit-content;
    position: sticky;
    inset-block-start: 100px;
}

.results-filters h3 {
    font-size: var(--font-size-lg);
    font-weight: 500;
    color: var(--text-primary);
    margin-block-end: var(--space-lg);
}

.results-filters fieldset {
    margin-block-end: var(--space-lg);
    border: none;
    padding: 0;
}

.results-filters fieldset:last-of-type {
    margin-block-end: var(--space-lg);
}

.results-filters legend {
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--text-primary);
    margin-block-end: var(--space-sm);
    padding: 0;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-block-end: var(--space-sm);
    cursor: pointer;
    font-size: var(--font-size-sm);
    color: var(--text-primary);
}

.filter-checkbox input[type="checkbox"] {
    cursor: pointer;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-lg);
}

/* ===== RESPONSIVE - CATALOG & PRICING ===== */
@media (max-width: 1024px) {
    .builder-layout {
        grid-template-columns: 1fr;
    }

    .stack-sidebar {
        position: static;
    }

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

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

    .pricing-card.featured {
        transform: scale(1);
    }

    .kit-header {
        flex-direction: column;
        gap: var(--space-lg);
    }
}

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

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

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

    .kit-cta {
        flex-direction: column;
    }

    .kit-cta .btn {
        width: 100%;
    }

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

    .credits-breakdown-grid {
        grid-template-columns: 1fr;
    }

    .billing-toggle {
        flex-wrap: wrap;
    }

    .builder-header h1 {
        font-size: var(--font-size-2xl);
    }

    .kit-header {
        flex-direction: column;
    }

    .kit-stats {
        flex-direction: row;
        width: 100%;
    }

    .results-content {
        grid-template-columns: 1fr;
    }

    .results-filters {
        position: static;
    }

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

/* ===== NAV ACTIVE STATE ===== */
header nav a.active {
    color: var(--text-primary);
    font-weight: 500;
}

/* ===== LOADING OVERLAY (index.html chat flow) ===== */
.loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--grad-hero);
    z-index: var(--z-overlay);
    align-items: center;
    justify-content: center;
    text-align: center;
    flex-direction: column;
    gap: var(--space-md);
}

.loading-overlay.visible {
    display: flex;
}

.loading-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    align-items: center;
}

.loading-title {
    font-size: var(--font-size-3xl);
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}

.loading-subtitle {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    margin: 0;
}

.loading-step {
    margin-top: var(--space-lg);
    font-size: var(--font-size-lg);
    color: var(--text-muted);
    font-style: italic;
    transition: all 0.3s ease;
}

/* ===== DISCOVER TOOLS PAGE ===== */
.discover-section {
    max-inline-size: 1400px;
    margin-inline: auto;
    padding-block: var(--space-2xl);
    padding-inline: var(--space-lg);
}

.discover-header {
    margin-block-end: var(--space-2xl);
}

.discover-header h1 {
    font-size: var(--font-size-4xl);
    color: var(--text-primary);
    margin-block-end: var(--space-sm);
}

.discover-header p {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
}

.discover-filters {
    margin-block-end: var(--space-2xl);
    padding-block: var(--space-lg);
    border-block: 1px solid #e5e7eb;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-lg);
    align-items: center;
}

.price-filter {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.price-range {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-size-sm);
}

.price-slider {
    width: 120px;
    accent-color: var(--text-primary);
}

.kit-filter {
    display: flex;
    align-items: center;
}

.kit-input {
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-sm);
    font-family: inherit;
    outline: none;
}

.kit-input:focus {
    border-color: var(--text-primary);
}

.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.category-tab {
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    background: var(--bg-secondary);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.category-tab:hover,
.category-tab.active {
    background: var(--text-primary);
    color: white;
    border-color: var(--text-primary);
}

/* Discover tools grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

.tool-card-discover {
    padding: var(--space-lg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--color-bg-grey);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    transition: var(--transition);
}

.tool-card-discover:hover {}

.tool-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-md);
}

.tool-identity {
    display: flex;
    gap: var(--space-md);
    align-items: flex-start;
}

.tool-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    flex-shrink: 0;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 14px;
}

.tool-name {
    font-size: var(--font-size-card-product);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 2px;
    line-height: 1.2;
}

.tool-category {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
    line-height: 22px;
    margin: 0;
}

.tool-tagline {
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    margin: 0;
    line-height: 18px;
}

.tool-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    flex-shrink: 0;
}

.tool-badge--free {
    background: rgba(16,185,129,0.1);
    color: #4CAF50;
}

.tool-badge--paid {
    background: rgba(0,0,0,0.06);
    color: var(--text-secondary);
}

.tool-pricing-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm) var(--space-lg);
    padding-block: var(--space-sm);
    border-block: 1px solid var(--color-light-grey);
}

.tool-pricing-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pricing-label {
    font-size: var(--font-size-base);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 22px;
}

.pricing-value {
    font-size: var(--font-size-sm);
    font-weight: 400;
    color: var(--text-primary);
    line-height: 18px;
}

.tool-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-block-start: auto;
}

.tool-meta {
    font-size: var(--font-size-card-product);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.btn-visit {
    background: #1c1c1c;
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    text-decoration: none;
    transition: box-shadow 0.18s ease;
}

.btn-visit:hover {
    box-shadow: 0 4px 14px rgba(218, 112, 148, 0.36), 0 1px 4px rgba(218, 112, 148, 0.18);
}

/* ===== TRENDING ASSEMBLIES PAGE ===== */
.hero-section--assemblies {
    padding-block-end: var(--space-xl);
}

.trending-section {
    max-inline-size: 1400px;
    margin-inline: auto;
    padding-block: var(--space-2xl);
    padding-inline: var(--space-lg);
}

.trending-section-header {
    margin-block-end: var(--space-2xl);
}

.trending-section-header h2 {
    font-size: var(--font-size-3xl);
    color: var(--text-primary);
    margin-block-end: var(--space-sm);
}

.trending-section-header p {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
}

.kit-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

.kit-card {
    padding: var(--space-lg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    cursor: pointer;
    transition: var(--transition);
}

.kit-card:hover {}

.kit-meta {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===== ASSEMBLY BUILDER REDESIGN ===== */
.builder-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-block-end: var(--space-2xl);
}

.builder-label {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-block-end: var(--space-sm);
}

.builder-title {
    font-size: var(--font-size-3xl);
    font-weight: 500;
    color: var(--text-primary);
    margin: 0 0 var(--space-sm);
}

.builder-subtitle {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    margin: 0;
}

.btn-disconnect {
    background: none;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-sm);
    cursor: pointer;
    color: var(--text-secondary);
    font-family: inherit;
    transition: var(--transition);
}

.btn-disconnect:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

/* Category cards - table style */
.categories-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
}

.category-card {
    padding: var(--space-lg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
}

.category-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-size-lg);
    font-weight: 500;
    color: var(--text-primary);
    margin-block-end: var(--space-sm);
}

.category-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--text-primary);
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.category-desc {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin: 0 0 var(--space-lg);
}

.tools-table {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tools-table-header {
    display: grid;
    grid-template-columns: 1fr auto;
    padding: var(--space-sm) var(--space-md);
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.tool-row {
    display: grid;
    grid-template-columns: 1fr auto 20px;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.tool-row:hover {
    border-color: var(--card-hover-outline);
    box-shadow: var(--shadow-panel);
    background: var(--bg-primary);
}

.tool-row.selected {
    border-color: var(--border-strong);
    background: var(--interactive-selected-fill);
    box-shadow: var(--shadow-panel), var(--interactive-selected-inset);
}

.tool-row-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tool-row-name {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.tool-row-desc {
    font-size: 11px;
    color: var(--text-muted);
}

.tool-row-price {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.tool-row-check {
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    font-weight: 700;
    text-align: center;
}

/* Assembly sidebar redesign */
.stack-sidebar {
    padding: var(--space-lg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    height: fit-content;
    position: sticky;
    inset-block-start: 100px;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.sidebar-title {
    font-size: var(--font-size-lg);
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}

.sidebar-budget {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding-block-end: var(--space-md);
    border-block-end: 1px solid var(--color-light-grey);
}

.budget-row {
    display: flex;
    justify-content: space-between;
    font-size: var(--font-size-sm);
}

.budget-label {
    color: var(--text-muted);
}

.budget-value {
    font-weight: 500;
    color: var(--text-primary);
}

.selected-tools {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding-block: var(--space-md);
    border-block: 1px solid var(--color-light-grey);
}

.selected-tool-item {
    display: flex;
    justify-content: space-between;
    font-size: var(--font-size-sm);
}

.selected-tool-name {
    color: var(--text-primary);
}

.selected-tool-price {
    font-weight: 500;
    color: var(--text-primary);
}

.stack-total {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.total-row {
    display: flex;
    justify-content: space-between;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.total-row--remaining {
    color: #4CAF50;
    font-weight: 500;
}

.total-cost {
    font-size: var(--font-size-lg);
    font-weight: 700;
}

.sidebar-optimize {
    background: var(--color-bg-grey);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.optimize-title {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}

.optimize-desc {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin: 0;
}

.btn-optimize {
    background: none;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-sm);
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: var(--transition);
}

.btn-optimize:hover {
    border-color: var(--text-primary);
}

.btn-dark {
    background: var(--text-primary);
    color: white;
    border: 1px solid var(--text-primary);
}

.btn-dark:hover {
    background: rgba(0,0,0,0.85);
}

.btn-outline {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

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

.btn-block {
    width: 100%;
    justify-content: center;
}

/* ===== KIT DETAIL REDESIGN ===== */
.kit-detail-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 360px);
    gap: 28px;
    align-items: start;
    margin-bottom: 30px;
}

.kit-detail-hero-copy,
.kit-detail-summary-card {
    border: 1px solid var(--border-light);
    background: rgba(249, 252, 255, 0.88);
    box-shadow:
        0 24px 60px rgba(103, 117, 142, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 30px;
}

.kit-detail-hero-copy {
    padding: 34px 34px 32px;
}

.kit-detail-summary-card {
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.kit-detail-eyebrow,
.pricing-eyebrow,
.pricing-highlight-eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--border-light);
    background: rgba(255, 255, 255, 0.98);
    color: #555555;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 18px;
}

.kit-detail-title-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.kit-detail-title {
    font-size: clamp(36px, 4.3vw, 68px);
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.04em;
}

.kit-favorite-btn--lg {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    border: 1px solid var(--border-light);
    background: rgba(255, 255, 255, 0.96);
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.kit-detail-subtitle {
    font-size: 17px;
    color: var(--text-secondary);
    max-inline-size: 760px;
    margin-block: 16px 0;
    line-height: 1.7;
}

.kit-summary-stat {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}

.kit-summary-stat:last-of-type {
    margin-bottom: 0;
}

.kit-stat-label {
    font-size: 10px;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    font-weight: 500;
}

.kit-stat-value {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.kit-stat-value sub {
    font-size: var(--font-size-sm);
    font-weight: 400;
    color: var(--text-secondary);
}

.kit-summary-text {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
}

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

.kit-detail-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
    margin-block-end: var(--space-2xl);
}

.kit-tools-section,
.kit-workflow-section {
    padding: 28px;
}

.kit-section-heading,
.pricing-section-heading {
    margin-bottom: 24px;
}

.kit-tools-section h2,
.kit-workflow-section h2 {
    font-size: 30px;
    font-weight: 500;
    color: var(--text-primary);
    margin-block-end: 8px;
    letter-spacing: -0.03em;
}

.kit-section-heading p,
.pricing-section-heading p {
    max-width: 560px;
    font-size: 15px;
    color: var(--text-secondary);
}

.kit-tools-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.kit-tool-card {
    display: flex;
    gap: var(--space-md);
    padding: 18px;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    align-items: flex-start;
    background: rgba(255, 255, 255, 0.92);
}

.kit-tool-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    flex-shrink: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--border-light);
    line-height: 0;
}

.kit-tool-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    border-radius: inherit;
}

.kit-tool-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.kit-tool-name {
    font-size: var(--font-size-card-product);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.kit-tool-category {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

.kit-tool-price {
    font-size: var(--font-size-card-product);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.workflow-steps {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.workflow-step {
    border: 1px solid var(--border-light);
    border-radius: 20px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.92);
}

.workflow-step-summary {
    display: grid;
    grid-template-columns: 28px 1fr auto 20px;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.workflow-step-summary::-webkit-details-marker {
    display: none;
}

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--text-primary);
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.step-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.step-title {
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}

.step-desc {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin: 0;
}

.step-tool-badge {
    display: inline-block;
    padding: 5px 11px;
    background: rgba(238, 245, 255, 0.96);
    border-radius: 20px;
    font-size: 11px;
    color: #555555;
    font-weight: 500;
    white-space: nowrap;
}

.step-chevron {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    transition: transform 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.workflow-step[open] .step-chevron {
    transform: rotate(180deg);
}

.workflow-step-body {
    padding: var(--space-md) var(--space-lg);
    border-block-start: 1px solid rgba(232, 238, 245, 0.94);
    background: rgba(246, 249, 253, 0.92);
}

.workflow-step-body p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

.kit-detail-cta {
    display: flex;
    gap: var(--space-md);
    padding-block-start: var(--space-xl);
}

/* ===== PRICING REDESIGN ===== */
.pricing-card--featured {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-card);
    position: relative;
    transform: translateY(-8px);
}

.plan-badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--grad-dark);
    color: white;
    border-radius: 999px;
    padding: 5px 14px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.pricing-hero {
    text-align: center;
    max-width: 860px;
    margin: 0 auto 38px;
}

.pricing-hero h1 {
    margin: 0 0 14px;
    font-size: clamp(38px, 4vw, 62px);
    font-weight: 500;
    letter-spacing: -0.04em;
}

.pricing-hero p {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.pricing-card-top {
    margin-bottom: 14px;
}

.plan-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 4px 0 var(--space-lg);
}

.plan-price {
    display: flex;
    align-items: baseline;
    gap: 2px;
    margin-block-end: var(--space-sm);
}

.price-currency {
    font-size: var(--font-size-lg);
    font-weight: 500;
    color: var(--text-secondary);
}

.price-amount {
    font-size: var(--font-size-4xl);
    font-weight: 700;
    color: var(--text-primary);
}

.price-period {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
}

.plan-credits {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-block-end: var(--space-lg);
}

.plan-features {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-block-end: var(--space-xl);
    flex: 1;
}

.plan-features li {
    display: flex;
    gap: var(--space-sm);
    font-size: 14px;
    color: var(--text-primary);
    align-items: flex-start;
}

/* How Pricing Works */
.how-pricing-subtitle {
    text-align: left;
    font-size: 15px;
    color: var(--text-secondary);
    margin-block-end: 0;
}

.pricing-steps {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    margin-block-end: var(--space-2xl);
    flex-wrap: wrap;
}

.pricing-step {
    flex: 1;
    min-inline-size: 200px;
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
    padding: 22px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, 0.94);
}

.pricing-step-icon {
    width: 56px;
    height: 56px;
    border: 1px solid var(--border-light);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(242, 247, 255, 0.96);
    color: #555555;
    font-size: 22px;
}

.pricing-step h3 {
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}

.pricing-step p {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin: 0;
}

.pricing-step-arrow {
    font-size: var(--font-size-2xl);
    color: var(--text-muted);
    flex-shrink: 0;
}

.pricing-story-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    gap: 24px;
    margin-bottom: 24px;
}

.pricing-highlight-card {
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 20px;
}

.pricing-highlight-card h2 {
    margin: 0 0 10px;
    font-size: 32px;
    font-weight: 500;
    letter-spacing: -0.03em;
}

.pricing-highlight-card p {
    font-size: 15px;
    color: var(--text-secondary);
}

.pricing-highlight-meta {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
    padding-top: 22px;
    margin-top: 4px;
}

.pricing-highlight-label {
    display: block;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.pricing-highlight-meta strong {
    font-size: 30px;
    font-weight: 500;
}

.pricing-highlight-link {
    white-space: nowrap;
}

/* Credit allocator */
.credit-allocator {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
    padding: var(--space-2xl);
    margin-block-start: var(--space-2xl);
}

.plan-summary-card,
.monthly-credits-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
}

.plan-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-block-end: var(--space-sm);
}

.plan-summary-name {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text-primary);
}

.plan-summary-price {
    font-size: var(--font-size-xl);
    font-weight: 500;
    color: var(--text-primary);
}

.plan-summary-period {
    font-size: var(--font-size-sm);
    font-weight: 400;
    color: var(--text-secondary);
}

.plan-summary-credits {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-block-end: var(--space-xl);
}

.credit-bars {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-block-end: var(--space-lg);
}

.credit-bar-row {
    display: grid;
    grid-template-columns: 80px 1fr 40px;
    align-items: center;
    gap: var(--space-md);
}

.credit-bar-label {
    font-size: var(--font-size-sm);
    color: var(--text-primary);
}

.credit-bar-track {
    height: 6px;
    background: rgba(228, 235, 244, 0.98);
    border-radius: 3px;
    overflow: hidden;
}

.credit-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-bright-blue) 0%, #4CAF50 100%);
    border-radius: 3px;
}

.credit-bar-value {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-primary);
    text-align: right;
}

.plan-summary-remaining {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    padding-block-start: var(--space-md);
    border-block-start: 1px solid rgba(228, 235, 244, 0.98);
}

.monthly-credits-card h3 {
    font-size: var(--font-size-lg);
    font-weight: 500;
    color: var(--text-primary);
    margin-block-end: var(--space-lg);
}

.credits-overview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    margin-block-end: var(--space-lg);
}

.credits-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.credits-stat-label {
    font-size: 10px;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.credits-stat-value {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--text-primary);
}

.credits-usage-bar {
    height: 6px;
    background: rgba(228, 235, 244, 0.98);
    border-radius: 3px;
    overflow: hidden;
    margin-block-end: var(--space-xl);
}

.credits-usage-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-bright-blue) 0%, #4CAF50 100%);
    border-radius: 3px;
}

.credits-breakdown h4 {
    font-size: 10px;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-block-end: var(--space-md);
}

.breakdown-row {
    display: flex;
    justify-content: space-between;
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    padding-block: var(--space-sm);
    border-block-end: 1px solid var(--color-bg-grey);
}

.breakdown-row:last-child {
    border-block-end: none;
}

/* ===== RESPONSIVE - new pages ===== */
@media (max-width: 1024px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .kit-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .kit-detail-body {
        grid-template-columns: 1fr;
    }
    .kit-detail-hero,
    .pricing-story-grid {
        grid-template-columns: 1fr;
    }
    .credit-allocator {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .tools-grid {
        grid-template-columns: 1fr;
    }
    .kit-grid {
        grid-template-columns: 1fr;
    }
    .kit-tools-grid {
        grid-template-columns: 1fr;
    }
    .filter-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .builder-layout {
        grid-template-columns: 1fr;
    }
    .builder-top {
        flex-direction: column;
        gap: var(--space-md);
    }
    .pricing-steps {
        flex-direction: column;
    }
    .pricing-step-arrow {
        transform: rotate(90deg);
    }
    .credits-overview {
        grid-template-columns: repeat(3, 1fr);
    }
    .kit-detail-cta,
    .kit-detail-actions {
        flex-direction: column;
    }
    .kit-detail-cta .btn,
    .kit-detail-actions .btn,
    .kit-detail-cta .stack-primary-action,
    .kit-detail-cta .stack-secondary-action,
    .kit-detail-actions .stack-primary-action,
    .kit-detail-actions .stack-secondary-action,
    .pricing-action,
    .pricing-highlight-link {
        width: 100%;
    }
    .kit-detail-main,
    .pricing-page-main {
        padding: 48px 16px 72px;
    }
}

/* ===== HOMEPAGE CHAT REFRESH ===== */
.homepage-body {
    background:
        radial-gradient(circle at top left, rgba(76, 175, 80, 0.15), transparent 32%),
        radial-gradient(circle at top right, rgba(93, 222, 244, 0.2), transparent 26%),
        var(--grad-hero);
    min-height: 100vh;
}

.homepage-main {
    padding: 32px 24px 72px;
}

.home-hero {
    max-width: 1320px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 620px);
    gap: 28px;
    align-items: start;
}

.hero-copy {
    padding: 36px 12px 0 0;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--border-light);
    border-radius: 999px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.72);
    color: rgba(16, 24, 40, 0.86);
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    margin-bottom: 24px;
}

.hero-title-home {
    max-width: 9ch;
    font-size: clamp(3.4rem, 7vw, 6.3rem);
    line-height: 0.94;
    letter-spacing: -0.05em;
    margin-bottom: 20px;
}

.hero-description-home {
    max-width: 34rem;
    font-size: clamp(1.05rem, 2vw, 1.28rem);
    color: var(--text-secondary);
    margin-bottom: 28px;
}

.hero-highlights {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.highlight-card {
    min-height: 180px;
    padding: 18px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    background: rgba(255, 255, 255, 0.76);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(18px);
}

.highlight-card p {
    color: var(--text-secondary);
    font-size: 0.96rem;
}

.highlight-label {
    display: inline-flex;
    margin-bottom: 14px;
    color: #262626;
    font-weight: 700;
    font-size: 0.95rem;
}

.chat-shell {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-2xl);
    padding: 24px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(236,251,254,0.8) 100%);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    min-height: 760px;
}

.chat-shell::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top right, rgba(76, 175, 80, 0.15), transparent 28%),
        radial-gradient(circle at bottom left, rgba(156, 211, 255, 0.18), transparent 30%);
    pointer-events: none;
}

.chat-shell > * {
    position: relative;
    z-index: 1;
}

.chat-shell-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}

.chat-shell-header h2 {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    letter-spacing: -0.04em;
}

.chat-shell-label {
    margin-bottom: 8px;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    color: rgba(15, 23, 42, 0.52);
}

.chat-status-badge {
    flex-shrink: 0;
    padding: 10px 14px;
    border-radius: 999px;
    background: #262626;
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 500;
}

.chat-status-badge.is-loading {
    background: #4CAF50;
}

.prompt-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.prompt-chip {
    min-height: 84px;
    padding: 16px 18px;
    border-radius: var(--radius-xl);
    text-align: left;
    line-height: 1.4;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: var(--shadow-panel);
}

.chat-form {
    margin-bottom: 20px;
    padding: 18px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    background: rgba(255, 255, 255, 0.9);
}

.chat-input {
    width: 100%;
    min-height: 126px;
    resize: vertical;
    border: none;
    outline: none;
    background: transparent;
    font: inherit;
    font-size: 1rem;
    color: var(--text-primary);
}

.chat-input::placeholder {
    color: rgba(15, 23, 42, 0.42);
}

.chat-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
}

.chat-helper-text {
    font-size: 0.88rem;
    color: rgba(15, 23, 42, 0.56);
}

.chat-send-btn:disabled {
    opacity: 0.65;
    cursor: progress;
}

.chat-thread {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 340px;
    overflow: auto;
    padding-right: 6px;
}

.chat-message {
    max-width: 88%;
    padding: 16px 18px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-panel);
}

.chat-message p {
    color: rgba(15, 23, 42, 0.78);
}

.chat-message.assistant {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--border-light);
}

.chat-message.user {
    align-self: flex-end;
    background: #262626;
}

.chat-message.user p,
.chat-message.user .message-meta {
    color: rgba(255, 255, 255, 0.92);
}

.message-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    color: rgba(15, 23, 42, 0.46);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 1100px) {
    .home-hero {
        grid-template-columns: 1fr;
    }

    .hero-copy {
        padding-right: 0;
    }
}

@media (max-width: 900px) {
    .hero-highlights,
    .prompt-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .homepage-main {
        padding-inline: 16px;
        padding-bottom: 48px;
    }

    .chat-shell {
        padding: 18px;
        border-radius: var(--radius-lg);
        min-height: auto;
    }

    .chat-form-footer,
    .chat-shell-header {
        flex-direction: column;
        align-items: stretch;
    }

    .chat-message {
        max-width: 100%;
    }
}

/* ===== API KEY MODAL ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: var(--z-modal);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.modal-overlay.visible {
    display: flex;
}
.modal {
    background: rgba(255, 255, 255, 0.96);
    border-radius: 20px;
    padding: var(--space-2xl);
    max-width: 440px;
    width: calc(100% - var(--space-2xl));
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* ===== FIGMA HOMEPAGE ===== */
.homepage-figma {
  margin: 0;
  background: #ffffff;
  color: var(--text-primary);
  min-height: 100vh;
}

.homepage-header {
  padding: 10px 0 0;
}

.homepage-header-inner {
  width: min(1392px, calc(100vw - 48px));
  margin: 0 auto;
  min-height: 68px;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  background: rgba(248, 251, 255, 0.92);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px 0 20px;
}

.homepage-logo {
  font-size: 28px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.9);
  letter-spacing: -0.02em;
}

.homepage-logo sup,
.homepage-footer-logo sup {
  font-size: 0.32em;
  top: -1.2em;
  position: relative;
}

.homepage-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: 0;
  margin-right: auto;
  padding-left: 18px;
}

.homepage-nav a {
  font-size: 15px;
  color: rgba(0, 0, 0, 0.45);
}

.homepage-nav a:first-child {
  color: #000;
}

.homepage-auth {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-login-link {
  font-size: 15px;
  color: rgba(0, 0, 0, 0.45);
}

.header-signup-btn {
  height: 40px;
  padding: 0 22px;
  border-radius: 999px;
  background: #000;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 500;
  box-shadow: var(--shadow-panel);
}

.homepage-main-figma {
  padding: var(--page-pad-y) var(--page-pad-x) 120px;
  background: #ffffff;
}

.homepage-hero {
  width: min(1393px, 100%);
  margin: 0 auto;
  text-align: center;
}

.homepage-title {
  margin: 0 0 13px;
  font-size: clamp(34px, 3.6vw, 44px);
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: -0.02em;
}

.homepage-subtitle {
  margin: 0 auto 54px;
  max-width: 920px;
  font-size: clamp(17px, 1.8vw, 22px);
  line-height: 1.22;
  color: var(--text-dark);
}

.homepage-searchbar {
  width: min(1120px, 100%);
  min-height: 92px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-2xl);
  background: rgba(248, 251, 255, 0.92);
  box-shadow:
    var(--shadow-soft),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px 18px 26px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  justify-content: space-between;
}

.homepage-search-input {
  flex: 1;
  min-width: 220px;
  border: none;
  background: transparent;
  outline: none;
  color: var(--text-primary);
  font: inherit;
  font-size: clamp(17px, 1.55vw, 20px);
}

.homepage-dropdown {
  position: relative;
  flex-shrink: 0;
}

.homepage-search-input::placeholder {
  color: var(--text-muted);
}

.homepage-filter-btn,
.homepage-submit-btn,
.homepage-chip {
  border: 1.25px solid #e5e7eb;
  font: inherit;
  white-space: nowrap;
}

.homepage-filter-btn {
  min-width: 150px;
  height: 48px;
  padding: 0 14px 0 12px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #FAFAF9 0%, #ECFBFE 100%);
  color: rgba(0, 0, 0, 0.82);
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  font-size: 15px;
  box-shadow:
    0 10px 22px rgba(88, 102, 126, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.homepage-filter-btn:hover,
.homepage-dropdown.is-open .homepage-filter-btn {
  border-color: rgba(161, 169, 182, 0.82);
  box-shadow:
    0 14px 26px rgba(88, 102, 126, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

.filter-icon {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(235, 243, 252, 0.96);
  color: rgba(38, 45, 58, 0.78);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  flex-shrink: 0;
}

.filter-icon .ph {
  font-size: 14px;
}

.filter-label-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.filter-label-eyebrow {
  color: rgba(95, 107, 125, 0.72);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.filter-label-value {
  color: rgba(18, 23, 30, 0.9);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter-caret {
  color: rgba(38, 45, 58, 0.74);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform-origin: center;
  transition: transform 0.18s ease, color 0.18s ease;
}

.filter-caret .ph {
  font-size: 14px;
}

.homepage-dropdown.is-open .filter-caret {
  transform: rotate(180deg);
  color: rgba(20, 24, 31, 0.92);
}

.homepage-dropdown-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  min-width: 220px;
  padding: 10px;
  border: 1px solid rgba(198, 205, 215, 0.9);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    0 22px 60px rgba(48, 60, 84, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 20;
}

.homepage-dropdown.is-open .homepage-dropdown-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.homepage-dropdown-option {
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  border: none;
  border-radius: 14px;
  background: transparent;
  color: rgba(23, 28, 36, 0.82);
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.homepage-dropdown-option:hover {
  background: rgba(238, 245, 255, 0.96);
  color: #111;
}

.homepage-dropdown-option.is-selected {
  background: linear-gradient(180deg, #ECFBFE 0%, #DBFBE1 100%);
  color: #111;
  font-weight: 500;
}

.homepage-dropdown-option.is-selected::after {
  content: '•';
  color: rgba(60, 87, 132, 0.82);
  font-size: 20px;
}

.homepage-search-divider {
  width: 1px;
  height: 36px;
  background: rgba(223, 227, 233, 0.95);
}

.homepage-submit-btn {
  height: 44px;
  padding: 0 18px;
  border-radius: 18px;
  border-color: transparent;
  background: #262626;
  color: #fff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
}

.homepage-submit-btn:disabled {
  opacity: 0.7;
  cursor: progress;
}

.homepage-chip-row {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.homepage-chip-row-secondary {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 6px;
}

.homepage-chip {
  height: 48px;
  padding: 0 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  color: #000;
  cursor: pointer;
  font-size: 16px;
}

.homepage-footer {
  background: #000;
  color: #fff;
  padding: 85px 0 38px;
  position: relative;
  z-index: 1;
}

.homepage-footer-top,
.homepage-partnership-card,
.homepage-footer-bottom {
  width: min(1430px, calc(100vw - 48px));
  margin: 0 auto;
}

.homepage-footer-top {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  align-items: flex-start;
  margin-bottom: 115px;
}

.homepage-footer-logo {
  font-size: 74px;
  font-weight: 500;
  color: #FFFFFF;
  line-height: 0.8;
  letter-spacing: -0.03em;
}

.homepage-footer-links {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  max-width: 440px;
}

.homepage-footer-links a {
  color: rgba(255,255,255,0.6);
  font-size: 24px;
  font-weight: 500;
}

.homepage-footer-links span {
  color: rgba(255,255,255,0.3);
  font-size: 22px;
}

.homepage-footer-contact {
  text-align: right;
  font-style: normal;
}

.homepage-footer-contact .phone {
  margin-bottom: 20px;
  font-size: 31px;
  font-weight: 500;
  color: #fff;
}

.homepage-footer-contact div,
.homepage-footer-contact a {
  color: rgba(255, 255, 255, 0.6);
  font-size: 18px;
  line-height: 1.8;
}

.homepage-footer-contact .touch-link {
  margin-top: 26px;
  color: #fff;
  font-size: 23px;
  font-weight: 500;
}

.homepage-partnership-card {
  min-height: 204px;
  border: 3px solid rgba(255, 255, 255, 0.4);
  border-radius: 31px;
  background:
    radial-gradient(circle at left top, rgba(93, 222, 244, 0.8), transparent 34%),
    radial-gradient(circle at right top, rgba(219, 251, 225, 0.72), transparent 22%),
    linear-gradient(180deg, #ECFBFE 0%, #FAFAF9 100%);
  padding: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
}

.homepage-partnership-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.15;
  background-image: radial-gradient(rgba(0, 0, 0, 0.55) 0.55px, transparent 0.55px);
  background-size: 6px 6px;
  pointer-events: none;
}

.homepage-partnership-card > * {
  position: relative;
  z-index: 1;
}

.homepage-partnership-label {
  margin: 0 0 8px;
  color: #000;
  font-size: 15px;
}

.homepage-partnership-title {
  margin: 0;
  color: #000;
  font-size: 31px;
  font-weight: 500;
}

.homepage-partnership-arrow {
  color: #000;
  font-size: 42px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.homepage-footer-bottom {
  text-align: center;
  margin-top: 22px;
}

.homepage-footer-bottom p {
  color: rgba(255, 255, 255, 0.4);
  font-size: 15px;
}

@media (max-width: 1100px) {
  .homepage-header-inner,
  .homepage-searchbar,
  .homepage-footer-top,
  .homepage-partnership-card,
  .homepage-footer-bottom {
    width: min(100%, calc(100vw - 32px));
  }

  .homepage-header-inner {
    padding: 16px 18px;
    gap: 18px;
    border-radius: var(--radius-2xl);
    flex-wrap: wrap;
    justify-content: center;
  }

  .homepage-nav {
    margin-left: 0;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px 24px;
  }

  .homepage-main-figma {
    padding: 72px 24px 96px;
  }

  .homepage-searchbar {
    border-radius: 36px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 24px;
  }

  .homepage-search-input {
    width: 100%;
  }

  .homepage-dropdown {
    width: calc(50% - 8px);
  }

  .homepage-filter-btn,
  .homepage-dropdown-menu {
    width: 100%;
  }

  .homepage-search-divider {
    display: none;
  }

  .homepage-footer-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .homepage-footer-contact {
    text-align: left;
  }
}

@media (max-width: 768px) {
  .homepage-header {
    padding-top: 8px;
  }

  .homepage-auth {
    width: 100%;
    justify-content: center;
  }

  .homepage-main-figma {
    padding: 48px 16px 64px;
  }

  .homepage-subtitle {
    margin-bottom: 40px;
  }

  .homepage-searchbar {
    min-height: auto;
    padding: 18px;
  }

  .homepage-filter-btn,
  .homepage-submit-btn,
  .homepage-chip {
    width: 100%;
    justify-content: center;
  }

  .homepage-dropdown {
    width: 100%;
  }

  .homepage-filter-btn {
    justify-content: space-between;
  }

  .homepage-footer {
    padding-top: 60px;
  }

  .homepage-footer-logo {
    font-size: 56px;
  }

  .homepage-footer-links a {
    font-size: 20px;
  }

  .homepage-partnership-card {
    padding: 26px;
    border-radius: var(--radius-lg);
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }
}
.modal-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.modal-desc {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}
.modal-label {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-primary);
}
.modal-input {
    width: 100%;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: var(--space-md);
    font-size: var(--font-size-base);
    font-family: monospace;
    outline: none;
    transition: border-color 0.2s;
}
.modal-input:focus {
    border-color: var(--text-primary);
}
.modal-hint {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin: 0;
}
.modal-actions {
    display: flex;
    gap: var(--space-md);
    margin-block-start: var(--space-sm);
}

.auth-modal {
    max-width: 468px;
}

.auth-modal-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-light);
    border-radius: 999px;
    background: rgba(246, 249, 253, 0.96);
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.auth-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.auth-tab {
    min-height: 44px;
    border: 1px solid var(--border-light);
    border-radius: 14px;
    background: rgba(245, 248, 252, 0.96);
    color: var(--text-secondary);
    cursor: pointer;
}

.auth-tab.is-active {
    background: #262626;
    color: #fff;
    border-color: #262626;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-form[hidden] {
    display: none;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-password-note {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: -4px;
}

.auth-feedback {
    min-height: 20px;
    font-size: 13px;
    color: var(--text-secondary);
}

.auth-feedback.is-error {
    color: #4CAF50;
}

.auth-feedback.is-success {
    color: var(--color-success);
}

.auth-user-chip {
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--border-light);
    border-radius: 999px;
    background: rgba(245, 248, 252, 0.98);
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.auth-user-chip .ph {
    font-size: 16px;
    color: #555555;
}

/* ===== ERROR / SUCCESS TOAST ===== */
.error-toast {
    display: none;
    position: fixed;
    bottom: var(--space-xl);
    left: 50%;
    transform: translateX(-50%);
    background: #111;
    color: white;
    padding: var(--space-md) var(--space-xl);
    border-radius: 50px;
    font-size: var(--font-size-sm);
    font-weight: 500;
    z-index: var(--z-overlay);
    white-space: nowrap;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.error-toast.visible {
    display: block;
}
.error-toast.toast--success {
    background: #4CAF50;
}
.error-toast.toast--error {
    background: #262626;
}

/* ===== QUICK ACTIONS ROW 2 (3-col) ===== */
.quick-actions--row2 {
    grid-template-columns: repeat(3, 1fr);
}

/* ===== FIGMA LOADING + ASSEMBLY FLOW ===== */
.homepage-nav a.is-active {
    color: #000;
}

.workflow-loading-page .homepage-footer,
.stack-page .homepage-footer {
    margin-top: 0;
}

.workflow-loading-main {
    min-height: 560px;
    padding: var(--page-pad-y) var(--page-pad-x) 110px;
    background: #ffffff;
}

.workflow-loading-shell {
    width: min(1240px, 100%);
    margin: 0 auto;
    min-height: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 48px 32px 0;
    position: relative;
}

.workflow-loading-shell::before,
.workflow-loading-shell::after {
    content: '';
    position: absolute;
    width: 260px;
    height: 260px;
    border-radius: 999px;
    filter: blur(58px);
    pointer-events: none;
}

.workflow-loading-shell::before {
    left: max(0px, calc(50% - 480px));
    top: 18px;
    background: rgba(199, 220, 255, 0.5);
}

.workflow-loading-shell::after {
    right: max(0px, calc(50% - 480px));
    top: 42px;
    background: rgba(224, 236, 255, 0.36);
}

.workflow-loading-shell > * {
    position: relative;
    z-index: 1;
}

.workflow-loading-kicker {
    min-height: 32px;
    padding: 0 14px;
    margin: 0 0 20px;
    border: 1px solid var(--border-light);
    border-radius: 999px;
    background: rgba(247, 250, 255, 0.96);
    color: #555555;
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.01em;
    box-shadow: 0 14px 34px rgba(84, 103, 131, 0.08);
}

.workflow-loading-shell h1 {
    margin: 0 0 10px;
    font-size: clamp(34px, 3vw, 44px);
    font-weight: 500;
    letter-spacing: -0.03em;
}

.workflow-loading-shell p {
    margin: 0 0 22px;
    color: rgba(0, 0, 0, 0.48);
    font-size: 16px;
}

.workflow-loading-status {
    min-height: 48px;
    padding: 0 18px;
    margin: 0 0 16px;
    border: 1px solid var(--border-light);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 42px rgba(84, 103, 131, 0.08);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 14px;
}

.workflow-loading-orb {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--color-bright-blue) 0%, #4CAF50 100%);
    box-shadow: 0 0 0 8px rgba(93, 222, 244, 0.2);
    animation: workflow-orb-pulse 1.4s ease-in-out infinite;
}

.workflow-loading-meter {
    width: min(620px, 100%);
    height: 12px;
    margin: 0 0 28px;
    border-radius: 999px;
    background: rgba(231, 237, 245, 0.92);
    overflow: hidden;
}

.workflow-loading-meter-fill {
    display: block;
    width: 18%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--color-bright-blue) 0%, #4CAF50 100%);
    box-shadow: 0 4px 16px rgba(93, 222, 244, 0.3);
    transition: width 0.42s ease;
}

.workflow-loading-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, max-content));
    justify-content: center;
    gap: 18px;
    width: 100%;
}

.workflow-loading-pill {
    min-width: 180px;
    min-height: 54px;
    padding: 0 20px;
    border-radius: 18px;
    border: 1px solid var(--border-light);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 16px 34px rgba(58, 76, 104, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.78);
    opacity: 0;
    transform: translateY(8px);
    animation: workflow-pill-in 0.38s ease forwards;
}

@keyframes workflow-pill-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes workflow-orb-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(124, 162, 217, 0.18);
    }
    50% {
        transform: scale(1.12);
        box-shadow: 0 0 0 8px rgba(124, 162, 217, 0.08);
    }
}

/* Assembly builder: match Discover / global rail — soft page, white elevated cards */
.stack-page {
    background: var(--bg-secondary);
}

body.stack-page.homepage-figma {
    background: var(--bg-secondary);
}

.kit-detail-page,
.pricing-page {
    background: #ffffff;
}

.stack-page-main {
    padding: var(--page-pad-y) var(--page-pad-x) 96px;
    background: transparent;
}

.kit-detail-main,
.pricing-page-main {
    padding: var(--page-pad-y) var(--page-pad-x) 104px;
    background: #ffffff;
}

.stack-shell {
    width: min(1440px, 100%);
    margin: 0 auto;
}

/* Assembly Builder (stack-builder.html): Discover-aligned white canvas + gutters */
body.stack-builder-page.stack-page,
body.stack-builder-page.stack-page.homepage-figma,
body.assembly-builder-page.assembly-page,
body.assembly-builder-page.assembly-page.homepage-figma {
    background: var(--bg-primary);
}

body.stack-builder-page .stack-page-main,
body.assembly-builder-page .assembly-page-main {
    padding: 84px 24px 96px;
}

body.stack-builder-page .stack-shell,
body.assembly-builder-page .assembly-shell {
    max-width: 1320px;
    width: 100%;
    margin: 0 auto;
}

@media (max-width: 900px) {
    body.stack-builder-page .stack-page-main,
    body.assembly-builder-page .assembly-page-main {
        padding: 56px 18px 72px;
    }
}

.kit-detail-shell,
.pricing-shell {
    width: min(1392px, 100%);
    margin: 0 auto;
}

.stack-hero-row,
.assembly-hero-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 24px;
}

.stack-page-title,
.assembly-page-title {
    margin: 0 0 6px;
    font-size: var(--font-size-4xl);
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: var(--text-primary);
}

.stack-page-subtitle,
.assembly-page-subtitle {
    margin: 0;
    font-size: var(--font-size-lg);
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-secondary);
    max-width: 42ch;
}

.kit-surface-card,
.pricing-surface-card {
    border: 1px solid var(--border-light);
    background: rgba(249, 252, 255, 0.88);
    box-shadow:
        0 24px 60px rgba(103, 117, 142, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-2xl);
}

.stack-page-layout,
.assembly-page-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 24px;
    align-items: start;
}

.stack-workflow-column,
.assembly-workflow-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stack-workflow-list,
.assembly-workflow-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stack-stage-card,
.stack-summary-panel,
.stack-optimizations,
.assembly-stage-card,
.assembly-summary-panel,
.assembly-optimizations {
    border: 1px solid var(--border-light);
    background: var(--bg-primary);
    box-shadow: none;
    backdrop-filter: none;
}

.stack-stage-card,
.assembly-stage-card {
    border-radius: var(--radius-lg);
    padding: 22px 22px 18px;
}

.stack-stage-header,
.assembly-stage-header {
    margin-bottom: 16px;
}

.stack-stage-title-group,
.assembly-stage-title-group {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: start;
    column-gap: 14px;
    row-gap: 8px;
}

.stack-stage-number,
.assembly-stage-number {
    grid-column: 1;
    grid-row: 1;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: var(--color-charcoal);
    color: var(--text-white);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-sm);
    font-weight: 600;
    flex-shrink: 0;
    margin-top: 2px;
}

.stack-stage-heading-wrap,
.assembly-stage-heading-wrap {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
}

.stack-stage-title-group h3,
.assembly-stage-title-group h3 {
    margin: 0;
    font-size: var(--font-size-xl);
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--text-primary);
}

.stack-stage-purpose,
.assembly-stage-purpose {
    grid-column: 1 / -1;
    grid-row: 2;
    margin: 0;
    font-size: var(--font-size-sm);
    font-weight: 400;
    line-height: 1.45;
    color: var(--text-secondary);
}

.stack-tool-list,
.assembly-tool-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stack-tool-row,
.assembly-tool-row {
    width: 100%;
    min-height: 64px;
    padding: 14px 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    text-align: left;
    cursor: pointer;
    transition: none;
}

.stack-tool-row:hover,
.assembly-tool-row:hover {
    border-color: var(--card-hover-outline);
    box-shadow: var(--shadow-panel);
}

.stack-tool-row.is-selected,
.assembly-tool-row.is-selected {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-panel), var(--interactive-selected-inset);
    background: var(--interactive-selected-fill);
}

.stack-tool-main,
.assembly-tool-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stack-tool-name-line,
.assembly-tool-name-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    min-width: 0;
}

.stack-tool-name-cluster,
.assembly-tool-name-cluster {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.stack-tool-icon,
.assembly-tool-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid var(--border-light);
    background: #ffffff;
    overflow: hidden;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.stack-tool-icon img,
.assembly-tool-icon img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: 10px;
}

.stack-tool-icon::after,
.assembly-tool-icon::after {
    content: attr(data-initial);
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 700;
    color: color-mix(in srgb, var(--text-primary) 76%, #ffffff);
}

.stack-tool-icon[data-loaded='1']::after,
.assembly-tool-icon[data-loaded='1']::after {
    content: '';
}

.stack-tool-name-line strong,
.assembly-tool-name-line strong {
    font-size: var(--font-size-card-product);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.stack-tool-badge,
.assembly-tool-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    white-space: nowrap;
    min-height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    letter-spacing: 0.06em;
}

.stack-tool-badge-affordable,
.assembly-tool-badge-affordable {
    border-color: color-mix(in srgb, var(--color-bright-blue) 45%, #cfd5e3);
    color: var(--color-bright-blue);
    background: color-mix(in srgb, #ffffff 88%, var(--color-bright-blue));
}

.stack-tool-description,
.assembly-tool-description {
    font-size: var(--font-size-sm);
    font-weight: 400;
    line-height: 1.35;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.stack-tool-price,
.assembly-tool-price {
    font-size: var(--font-size-card-product);
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.stack-add-tool,
.assembly-add-tool {
    margin: 14px auto 0;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
}

.stack-add-tool:hover,
.assembly-add-tool:hover {
    color: var(--text-primary);
    font-weight: 600;
}

.stack-add-tool-panel,
.assembly-add-tool-panel {
    margin-top: 12px;
    padding: 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stack-add-tool-search,
.assembly-add-tool-search {
    width: 100%;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid var(--border-light);
    border-radius: 999px;
    background: var(--bg-secondary);
    font: inherit;
    color: var(--text-primary);
    outline: none;
}

.stack-add-tool-search:focus,
.assembly-add-tool-search:focus {
    border-color: var(--color-bright-blue);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-bright-blue) 45%, transparent);
}

.stack-add-tool-results,
.assembly-add-tool-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stack-add-tool-result,
.assembly-add-tool-result {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    text-align: left;
    font: inherit;
    cursor: pointer;
    transition: none;
}

.stack-add-tool-result:hover,
.assembly-add-tool-result:hover {
    border-color: var(--card-hover-outline);
    box-shadow: var(--shadow-panel);
}

.stack-add-tool-result-main,
.assembly-add-tool-result-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.stack-add-tool-result-main strong,
.assembly-add-tool-result-main strong {
    font-size: var(--font-size-card-product);
    font-weight: 700;
    color: var(--text-primary);
}

.stack-add-tool-result-main span,
.assembly-add-tool-result-main span {
    font-size: var(--font-size-sm);
    font-weight: 400;
    color: var(--text-secondary);
}

.stack-add-tool-result-price,
.assembly-add-tool-result-price {
    flex-shrink: 0;
    font-size: var(--font-size-card-product);
    font-weight: 700;
    color: var(--text-primary);
}

.stack-add-tool-empty,
.assembly-add-tool-empty {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.stack-step-no-tools,
.assembly-step-no-tools {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stack-step-no-tools-hint,
.assembly-step-no-tools-hint {
    margin: 0;
    font-size: var(--font-size-sm);
    font-weight: 400;
    line-height: 1.45;
    color: var(--text-secondary);
}

.stack-smart-suggestions-heading,
.assembly-smart-suggestions-heading {
    margin: 0;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.stack-smart-suggestions,
.assembly-smart-suggestions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stack-add-tool-result--smart,
.assembly-add-tool-result--smart {
    border-color: color-mix(in srgb, var(--color-bright-blue) 32%, var(--border-light));
}

.stack-summary-panel {
    border-radius: var(--radius-lg);
    padding: 24px 22px 22px;
    position: sticky;
    top: 16px;
}

.stack-summary-panel > h2 {
    margin: 0 0 18px;
    font-size: var(--font-size-xl);
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.15;
}

#costSummaryTitle {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stack-summary-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
}

.stack-summary-label {
    font-size: var(--font-size-sm);
    letter-spacing: 0.08em;
    color: var(--text-dark);
}

.stack-summary-value {
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--text-primary);
}

.stack-summary-tools {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px 0;
    margin: 8px 0;
}

.stack-summary-tool {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: var(--font-size-sm);
    font-weight: 400;
    color: var(--text-secondary);
}

.stack-summary-tool-name {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.stack-summary-tool-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    background: #ffffff;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.stack-summary-tool-icon img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: 8px;
}

.stack-summary-tool-icon::after {
    content: attr(data-initial);
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 700;
    color: color-mix(in srgb, var(--text-primary) 76%, #ffffff);
}

.stack-summary-tool-icon[data-loaded='1']::after {
    content: '';
}

.stack-summary-tool strong {
    font-weight: 600;
    color: var(--text-primary);
}

.stack-summary-total {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    padding: 18px 0 10px;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.stack-summary-total > span {
    font-size: var(--font-size-sm);
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

.stack-summary-total strong {
    font-size: var(--font-size-3xl);
    line-height: 1;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.03em;
}

.stack-budget-track {
    margin-bottom: 18px;
}

.stack-budget-track-labels {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: var(--font-size-sm);
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.stack-budget-track-labels span:last-child {
    font-weight: 600;
    color: var(--text-primary);
}

.stack-budget-bar {
    height: 4px;
    border-radius: 999px;
    background: var(--border-light);
    overflow: hidden;
}

.stack-budget-bar-fill {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--color-bright-blue) 0%, #4CAF50 100%);
}

.stack-primary-action,
.stack-secondary-action {
    min-height: 44px;
    border-radius: 999px;
    font: inherit;
    cursor: pointer;
}

.stack-optimizations {
    border-radius: var(--radius-lg);
    padding: 22px 20px;
}

.stack-tools-to-try {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    background: var(--bg-primary);
    box-shadow: none;
    backdrop-filter: none;
    padding: 22px 20px;
}

.stack-tools-to-try-header {
    margin-bottom: 14px;
}

.stack-tools-to-try-header h2 {
    margin: 0 0 4px;
    font-size: var(--font-size-xl);
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--text-primary);
}

.stack-tools-to-try-header p {
    margin: 0;
    font-size: var(--font-size-sm);
    font-weight: 400;
    line-height: 1.45;
    color: var(--text-secondary);
}

.stack-tools-to-try-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.stack-tools-to-try-card {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: none;
}

.stack-tools-to-try-card:hover {}

.stack-tools-to-try-main {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.stack-tools-to-try-main h3 {
    margin: 0 0 4px;
    font-size: var(--font-size-card-product);
    font-weight: 700;
    color: var(--text-primary);
}

.stack-tools-to-try-main p {
    margin: 0;
    font-size: var(--font-size-sm);
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.4;
}

.stack-tools-to-try-price {
    white-space: nowrap;
    font-size: var(--font-size-card-product);
    font-weight: 700;
    color: var(--text-primary);
}

.stack-tools-to-try-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.stack-tools-to-try-tags span {
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid var(--border-light);
    background: var(--bg-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-sm);
    font-weight: 400;
    color: var(--text-secondary);
}

.stack-optimizations-header {
    margin-bottom: 14px;
}

.stack-optimizations-header h2 {
    margin: 0 0 4px;
    font-size: var(--font-size-xl);
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--text-primary);
}

.stack-optimizations-header p {
    margin: 0;
    font-size: var(--font-size-sm);
    font-weight: 400;
    line-height: 1.45;
    color: var(--text-secondary);
}

.stack-optimization-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stack-optimization-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 10px;
    min-height: 52px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    background: var(--bg-primary);
    width: 100%;
    text-align: left;
    font: inherit;
    cursor: pointer;
    transition: none;
}

.stack-optimization-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    min-width: 0;
}

.stack-optimization-top .stack-optimization-copy {
    flex: 1;
    min-width: 0;
}

.stack-optimization-top .stack-optimization-savings {
    flex-shrink: 0;
}

.stack-optimization-row--message {
    cursor: default;
    pointer-events: none;
}

.stack-optimization-row--message .stack-optimization-savings {
    color: var(--text-secondary);
    font-weight: 500;
}

.stack-optimization-icons {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    flex-shrink: 0;
    align-self: flex-start;
}

.stack-optimization-icons-sep {
    display: inline-flex;
    align-items: center;
    color: var(--text-secondary);
    opacity: 0.72;
    font-size: 12px;
    line-height: 1;
}

.stack-optimization-tool-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    background: #ffffff;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.stack-optimization-tool-icon img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    border-radius: 8px;
}

.stack-optimization-tool-icon::after {
    content: attr(data-initial);
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 700;
    color: color-mix(in srgb, var(--text-primary) 76%, #ffffff);
}

.stack-optimization-tool-icon[data-loaded='1']::after {
    content: '';
}

.stack-optimization-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.stack-optimization-savings {
    color: #4CAF50;
    white-space: nowrap;
    font-size: var(--font-size-sm);
    font-weight: 500;
    flex-shrink: 0;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    line-height: 1.1;
    text-align: right;
}

.stack-optimization-save-label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.02em;
    opacity: 0.92;
}

.stack-optimization-save-value {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.stack-optimization-row:hover:not(.is-applied) {
    border-color: var(--card-hover-outline);
    box-shadow: var(--shadow-panel);
}

.stack-optimization-row.is-applied:hover {
    box-shadow: var(--shadow-panel);
}

.stack-optimization-row.is-applied {
    border-color: rgba(76, 175, 80, 0.45);
    background: var(--color-light-green);
}

.stack-optimization-row.is-applied .stack-optimization-savings {
    color: #4CAF50;
    font-weight: 500;
}

.stack-optimization-copy strong {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.stack-optimization-copy > span {
    font-size: var(--font-size-sm);
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.35;
}

.stack-optimization-copy .stack-optimization-swap-text {
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.015em;
    line-height: 1.3;
}

.stack-actions-row {
    display: flex;
    gap: 10px;
}

.stack-save-panel {
    margin-top: 14px;
    padding: 20px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    background: var(--bg-primary);
}

.stack-save-panel-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.stack-save-panel-header h2 {
    margin: 0 0 4px;
    font-size: var(--font-size-xl);
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.stack-save-panel-header p {
    margin: 0;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 400;
}

.stack-save-close {
    border: none;
    background: transparent;
    font: inherit;
    font-size: 22px;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
}

.stack-save-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.stack-save-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stack-save-field span {
    font-size: var(--font-size-sm);
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

.stack-save-field input,
.stack-save-field select {
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    font: inherit;
}

.stack-save-actions {
    margin-top: 14px;
    display: flex;
    gap: 10px;
}

.stack-save-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.stack-save-feedback {
    margin: 12px 0 0;
    font-size: var(--font-size-sm);
    color: #4CAF50;
}

.stack-primary-action {
    flex: 1;
    border: none;
    background: var(--color-charcoal);
    color: var(--text-white);
    font-size: var(--font-size-sm);
    font-weight: 600;
    transition: opacity 0.15s ease;
}

.stack-primary-action:hover {
    opacity: 0.88;
}

.stack-secondary-action {
    min-width: 92px;
    padding: 0 18px;
    border: 1px solid var(--border-light);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.stack-secondary-action:hover {
    border-color: var(--border-strong);
    background: var(--bg-secondary);
}

@media (max-width: 1100px) {
    .stack-page-layout,
.assembly-page-layout {
        grid-template-columns: 1fr;
    }

    .stack-summary-panel {
        position: static;
    }
}

@media (max-width: 760px) {
    .workflow-loading-main {
        padding-left: 16px;
        padding-right: 16px;
    }

    .stack-hero-row,
.assembly-hero-row {
        flex-direction: column;
        gap: 10px;
    }

    .stack-stage-card,
    .stack-summary-panel,
    .stack-optimizations:not(.stack-optimizations--rail) {
        border-radius: 18px;
    }

    .stack-tool-row,
.assembly-tool-row {
        grid-template-columns: minmax(0, 1fr) auto;
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .stack-actions-row {
        flex-direction: column;
    }

    .stack-tools-to-try-list {
        grid-template-columns: 1fr;
    }
}

/* ===== ASSEMBLY BUILDER — stack-builder.html only ===== */
/* Summary column scrolls with the page (no sticky pinning on desktop). */
body.stack-builder-page .stack-summary-panel {
    position: static;
    top: auto;
    inset: auto;
}

body.stack-builder-page .stack-summary-panel > h2 {
    margin: 0 0 16px;
    font-size: var(--font-size-lg);
    font-weight: 400;
    line-height: 1.32;
    letter-spacing: -0.01em;
    padding-bottom: 0.12em;
    overflow: visible;
}

body.stack-builder-page .stack-summary-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 14px;
    padding-bottom: 14px;
    border-bottom: 0;
}

body.stack-builder-page .stack-summary-meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

body.stack-builder-page .stack-summary-label {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-dark);
    letter-spacing: 0;
}

body.stack-builder-page .stack-summary-value {
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.25;
}

body.stack-builder-page .stack-summary-tools {
    gap: 12px;
    padding: 12px 0;
    margin: 0;
}

body.stack-builder-page .stack-summary-tool {
    font-size: var(--font-size-base);
    color: var(--text-dark);
}

body.stack-builder-page .stack-summary-tool strong {
    font-size: var(--font-size-base);
    font-weight: 600;
}

body.stack-builder-page .stack-summary-total {
    padding: 16px 0 14px;
    margin-top: 0;
    border-top: 1px solid #e2e8f0;
    align-items: flex-start;
}

body.stack-builder-page .stack-summary-total > span {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-dark);
    letter-spacing: 0;
}

body.stack-builder-page .stack-summary-total strong {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    letter-spacing: -0.02em;
}

body.stack-builder-page .stack-budget-track {
    margin-top: 4px;
    margin-bottom: 0;
}

body.stack-builder-page .stack-budget-track-labels {
    margin-bottom: 10px;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-dark);
}

/* Outline step index — light pill on grey cards (base rule is filled charcoal). */
body.stack-builder-page .stack-stage-number,
.assembly-stage-number {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

/* Muted row price until selected (Discover cards keep price in primary). */
body.stack-builder-page .stack-tool-price,
.assembly-tool-price {
    color: var(--text-secondary);
    padding-top: 5px;
}

body.stack-builder-page .stack-tool-row.is-selected .stack-tool-price,
.assembly-tool-price {
    color: var(--text-primary);
    font-weight: 700;
}

body.stack-builder-page .stack-tools-to-try-price,
body.stack-builder-page .stack-add-tool-result-price,
.assembly-add-tool-result-price {
    color: var(--text-secondary);
}

body.stack-builder-page .stack-budget-bar-fill {
    background: var(--color-bright-blue);
}

body.stack-builder-page .stack-secondary-action:focus-visible,
body.stack-builder-page .stack-primary-action:focus-visible,
body.stack-builder-page .stack-add-tool:focus-visible,
body.stack-builder-page .stack-add-to-assembly-btn:focus-visible {
    outline: 2px solid var(--color-bright-blue);
    outline-offset: 2px;
}

/* No hover motion: instant border/shadow/opacity feedback only */
body.stack-builder-page .stack-primary-action {
    transition: none;
}

/* Black pill CTAs on assembly builder (Share / Export use .assembly-summary-action-btn). */
body.stack-builder-page .stack-primary-action,
body.stack-builder-page .stack-secondary-action,
body.stack-builder-page .stack-add-tool,
.assembly-add-tool {
    background: #1a1a1a;
    color: #ffffff;
    border: 1px solid #1a1a1a;
    opacity: 1;
}

body.stack-builder-page .stack-primary-action:hover,
body.stack-builder-page .stack-secondary-action:hover,
body.stack-builder-page .stack-add-tool:hover,
.assembly-add-tool:hover {
    background: #2c2c2c;
    border-color: #2c2c2c;
    color: #ffffff;
    opacity: 1;
}

body.stack-builder-page .stack-add-tool,
.assembly-add-tool {
    border-style: solid;
}

body.stack-builder-page .stack-add-to-assembly-btn .ph {
    font-size: 18px;
    line-height: 1;
}

/* Assembly Builder — linework + surfaces (Discover / ya-card grey fill, stack-builder.html only) */
body.stack-builder-page .stack-stage-card,
body.stack-builder-page .stack-summary-panel,
body.stack-builder-page .stack-tools-to-try,
body.stack-builder-page .stack-save-panel {
    border: 1px solid var(--border-light);
    box-shadow: none;
    background: var(--color-bg-grey);
}

body.stack-builder-page .stack-add-tool-panel,
.assembly-add-tool-panel {
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(93, 222, 244, 0.06);
    background: var(--nav-rail-bg);
}

body.stack-builder-page .stack-tool-row,
.assembly-tool-row {
    border: 1px solid var(--border-light);
}

/* Pointer focus: no persistent ring; keyboard uses global :focus-visible on button. */
body.stack-builder-page .stack-tool-row:focus:not(:focus-visible) {
    outline: none;
}

body.stack-builder-page .stack-tool-row:hover,
.assembly-tool-row:hover {
    border-color: var(--card-hover-outline);
    box-shadow: var(--shadow-panel);
}

body.stack-builder-page .stack-tool-row.is-selected,
.assembly-tool-row.is-selected {
    border: 2px solid var(--color-bright-blue);
    background: var(--color-bright-blue);
    box-shadow: var(--shadow-panel);
}

body.stack-builder-page .stack-tool-row.is-selected:hover {
    border-color: var(--color-bright-blue);
    background: color-mix(in srgb, var(--color-charcoal) 9%, var(--color-bright-blue));
    box-shadow: var(--shadow-panel);
}

body.stack-builder-page .stack-tool-row.is-selected .stack-tool-badge,
.assembly-tool-badge {
    border-color: var(--border-strong);
    color: var(--color-charcoal);
    background: color-mix(in srgb, var(--bg-primary) 92%, transparent);
}

/* Selected row: title stays charcoal on cyan (explicit vs. any future row-level color). */
body.stack-builder-page .stack-tool-row.is-selected .stack-tool-name-line strong,
.assembly-tool-name-line strong {
    color: var(--text-primary);
}

body.stack-builder-page .stack-add-to-assembly {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

body.stack-builder-page .stack-add-to-assembly-btn {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

body.stack-builder-page .stack-add-tool-result:hover,
.assembly-add-tool-result:hover {
    border-color: var(--card-hover-outline);
    box-shadow: 0 4px 20px rgba(93, 222, 244, 0.06);
}

body.stack-builder-page .stack-tools-to-try-card {
    border: 1px solid var(--border-light);
    border-radius: 12px;
    background: var(--bg-primary);
}

body.stack-builder-page .stack-tools-to-try-card:hover {}

body.stack-builder-page .stack-optimization-row:hover {
    border-color: var(--card-hover-outline);
    box-shadow: 0 4px 20px rgba(93, 222, 244, 0.06);
}

body.stack-builder-page .stack-optimization-row.is-applied {
    border-color: var(--border-light);
}

body.stack-builder-page .stack-optimization-row {
    border-radius: 12px;
    background: var(--nav-rail-bg);
}

body.stack-builder-page .stack-add-tool-empty,
body.stack-builder-page .stack-add-tool-search,
body.stack-builder-page .stack-add-tool-result,
.assembly-add-tool-result {
    border: 1px solid var(--border-light);
}

body.stack-builder-page .stack-add-tool-result,
body.stack-builder-page .stack-add-tool-empty,
.assembly-add-tool-empty {
    border-radius: 12px;
    background: var(--nav-rail-bg);
}

body.stack-builder-page .stack-save-field input,
body.stack-builder-page .stack-save-field select {
    border: 1px solid var(--border-light);
}

/* ===== ASSEMBLY BUILDER BENTO REFRESH ===== */
body.stack-builder-page {
    height: auto;
    min-height: 100vh;
    overflow: visible;
}

body.stack-builder-page .stack-page-main {
    height: auto;
    min-height: calc(100vh - 74px);
    padding: 164px 24px 96px;
    overflow: visible;
    background: #ffffff;
}

body.stack-builder-page .stack-shell {
    max-width: 1360px;
    height: auto;
    display: flex;
    flex-direction: column;
    min-height: auto;
}

body.stack-builder-page .stack-hero-row,
.assembly-hero-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 18px;
    margin-bottom: 30px;
    align-items: end;
    flex-shrink: 0;
}

body.stack-builder-page .stack-page-title,
.assembly-page-title {
    margin-bottom: 12px;
    font-size: clamp(44px, 5.4vw, 76px);
    font-weight: 500;
    line-height: 1.06;
    letter-spacing: -0.03em;
}

body.stack-builder-page .stack-page-subtitle,
.assembly-page-subtitle {
    font-size: clamp(16px, 1.25vw, 19px);
    line-height: 1.38;
    color: color-mix(in srgb, var(--text-primary) 72%, #ffffff);
    max-width: 56ch;
}

body.stack-builder-page .stack-hero-kpis,
.assembly-hero-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

body.stack-builder-page .stack-hero-kpi,
.assembly-hero-kpi {
    min-height: 84px;
    border-radius: 16px;
    border: 1px solid var(--border-light);
    background: var(--nav-rail-bg);
    padding: 12px 12px 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

body.stack-builder-page .stack-hero-kpi:nth-child(2),
.assembly-hero-kpi:nth-child(2) {
    background: color-mix(in srgb, var(--color-light-blue) 52%, #ffffff);
}

body.stack-builder-page .stack-hero-kpi-label,
.assembly-hero-kpi-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--text-secondary) 88%, #ffffff);
}

body.stack-builder-page .stack-hero-kpi-value,
.assembly-hero-kpi-value {
    font-size: clamp(14px, 1.2vw, 18px);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: var(--text-primary);
}

body.stack-builder-page .stack-page-layout,
.assembly-page-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
    align-items: start;
    flex: none;
    min-height: auto;
    overflow: visible;
}

body.stack-builder-page .stack-workflow-column,
.assembly-workflow-column {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
    min-height: auto;
    overflow: visible;
    padding-right: 4px;
    align-content: start;
}

body.stack-builder-page .stack-workflow-list,
.assembly-workflow-list {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
}

body.stack-builder-page .stack-workflow-list .stack-stage-card,
.assembly-stage-card {
    grid-column: span 6;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid var(--border-light);
    background: var(--nav-rail-bg);
    box-shadow: none;
    position: relative;
    overflow: visible;
}

body.stack-builder-page .stack-workflow-list .stack-stage-card::after {
    content: none;
}

body.stack-builder-page .stack-workflow-list .stack-stage-card:first-child {
    grid-column: 1 / -1;
    background: var(--nav-rail-bg);
}

body.stack-builder-page .stack-workflow-list .stack-stage-card:nth-child(even):not(:first-child):not(.stack-stage-card--custom) {
    grid-column: span 6;
    background: var(--nav-rail-bg);
}

body.stack-builder-page .stack-workflow-list .stack-stage-card:nth-child(odd):not(:first-child):not(.stack-stage-card--custom) {
    grid-column: span 6;
    background: var(--nav-rail-bg);
}

/* User-added “new assembly” steps: full row (both half-columns) so the tool card reads wide. */
body.stack-builder-page .stack-workflow-list .stack-stage-card.stack-stage-card--custom {
    grid-column: 1 / -1;
}

body.stack-builder-page .stack-stage-title-group,
.assembly-stage-title-group {
    column-gap: 12px;
    row-gap: 10px;
}

body.stack-builder-page .stack-stage-number,
.assembly-stage-number {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--color-bright-blue) 22%, #d8deea);
    background: #ffffff;
    color: var(--text-primary);
    font-weight: 700;
}

body.stack-builder-page .stack-stage-title-group h3,
.assembly-stage-title-group h3 {
    font-size: clamp(19px, 1.72vw, 28px);
    font-weight: 500;
    line-height: 1.22;
    letter-spacing: -0.02em;
}

body.stack-builder-page .stack-stage-purpose,
.assembly-stage-purpose {
    font-size: 16px;
    line-height: 1.35;
}

body.stack-builder-page .stack-tool-list,
.assembly-tool-list {
    gap: 10px;
}

body.stack-builder-page .stack-tool-main,
.assembly-tool-main {
    gap: 12px;
}

body.stack-builder-page .stack-tool-name-cluster,
.assembly-tool-name-cluster {
    min-width: 0;
}

body.stack-builder-page .stack-tool-row,
.assembly-tool-row {
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, #d8deea 80%, #ffffff);
    background: #ffffff;
    min-height: 76px;
    padding: 12px 14px;
    align-items: start;
}

body.stack-builder-page .stack-tool-row.is-selected,
.assembly-tool-row.is-selected {
    border: 1px solid transparent;
    background: var(--color-bright-blue);
    box-shadow: none;
}

body.stack-builder-page .stack-tool-row.is-selected:hover {
    background: var(--color-bright-blue);
    box-shadow: none;
}

body.stack-builder-page .stack-tool-row.is-selected .stack-tool-name-line strong,
body.stack-builder-page .stack-tool-row.is-selected .stack-tool-description,
body.stack-builder-page .stack-tool-row.is-selected .stack-tool-price,
.assembly-tool-price {
    color: #ffffff;
}

body.stack-builder-page .stack-tool-row.is-selected .stack-tool-badge,
.assembly-tool-badge {
    border-color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

body.stack-builder-page .stack-add-tool,
.assembly-add-tool {
    margin-top: 10px;
    min-height: 42px;
    border-radius: 999px;
    padding: 0 16px;
}

body.stack-builder-page .stack-add-to-assembly {
    grid-column: span 4;
    border: 1px solid var(--border-light);
    border-radius: 16px;
    background: var(--nav-rail-bg);
    padding: 16px;
}

/* Save this assembly — primary CTA in cost summary rail (full-width pill). */
body.stack-builder-page .stack-summary-build {
    margin-top: 18px;
    padding-top: 2px;
}

body.stack-builder-page .stack-summary-build .stack-build-primary {
    width: 100%;
    flex: none;
    min-height: 52px;
    border-radius: 999px;
    padding: 0 22px;
    background: #1a1a1a;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-transform: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-sizing: border-box;
}

/* Tools to try: full width, compact strip above “Add to assembly”. */
body.stack-builder-page .stack-tools-to-try {
    grid-column: 1 / -1;
    border-radius: 12px;
    padding: 12px 14px;
    background: var(--nav-rail-bg);
}

body.stack-builder-page .stack-tools-to-try-header {
    margin-bottom: 8px;
}

body.stack-builder-page .stack-tools-to-try-header h2 {
    margin: 0 0 4px;
    font-size: clamp(19px, 1.72vw, 28px);
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.22;
    color: var(--text-primary);
}

body.stack-builder-page .stack-tools-to-try-header p {
    margin: 0;
    font-size: 16px;
    line-height: 1.35;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

body.stack-builder-page .stack-tools-to-try-list {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 2px 6px;
    margin: 0 -2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

body.stack-builder-page .stack-tools-to-try-card {
    flex: 0 0 min(340px, 88vw);
    max-width: 400px;
    padding: 10px 14px 12px;
    gap: 8px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
}

body.stack-builder-page .stack-tools-to-try-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    align-items: start;
}

body.stack-builder-page .stack-tools-to-try-copy {
    min-width: 0;
}

body.stack-builder-page .stack-tools-to-try-main h3 {
    margin: 0 0 4px;
    font-size: var(--font-size-card-product);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

body.stack-builder-page .stack-tools-to-try-main h3 .stack-tool-name-cluster,
.assembly-tool-name-cluster {
    gap: 8px;
}

body.stack-builder-page .stack-tools-to-try-card .stack-tool-icon,
.assembly-tool-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
}

body.stack-builder-page .stack-tools-to-try-card .stack-tool-icon img,
.assembly-tool-icon img {
    border-radius: 8px;
}

body.stack-builder-page .stack-tools-to-try-card .stack-tool-icon::after,
.assembly-tool-icon::after {
    font-size: 12px;
}

body.stack-builder-page .stack-tools-to-try-main p {
    margin: 0;
    font-size: var(--font-size-sm);
    line-height: 1.4;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

body.stack-builder-page .stack-tools-to-try-price {
    font-size: var(--font-size-sm);
    font-weight: 500;
    line-height: 1.25;
    padding-top: 2px;
    color: var(--text-dark);
}

/* Optimize for lower cost — integrated into summary panel (not a separate bento tile). */
body.stack-builder-page .stack-summary-panel .stack-optimizations--rail {
    margin: 0;
    padding: 16px 0 0;
    border: none;
    border-top: 1px solid #e2e8f0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

body.stack-builder-page .stack-summary-panel .stack-optimizations--rail .stack-optimizations-header {
    margin-bottom: 10px;
}

body.stack-builder-page .stack-summary-panel .stack-optimizations--rail .stack-optimizations-header h2 {
    margin: 0 0 4px;
    font-size: clamp(14px, 1.15vw, 16px);
    font-weight: 500;
    letter-spacing: -0.015em;
    line-height: 1.3;
    color: color-mix(in srgb, var(--text-primary) 72%, var(--text-secondary));
}

body.stack-builder-page .stack-summary-panel .stack-optimizations--rail .stack-optimizations-header p {
    margin: 0;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    color: color-mix(in srgb, var(--text-secondary) 88%, #ffffff);
}

body.stack-builder-page .stack-summary-panel .stack-optimizations--rail .stack-optimization-list {
    gap: 6px;
}

body.stack-builder-page .stack-summary-panel .stack-optimizations--rail .stack-optimization-row {
    background: var(--bg-primary);
    min-height: 0;
    padding: 10px 14px;
}

body.stack-builder-page .stack-summary-panel .stack-optimizations--rail .stack-optimization-row.is-applied {
    background: color-mix(in srgb, var(--color-light-green) 48%, var(--bg-primary));
    border-color: rgba(76, 175, 80, 0.22);
}

body.stack-builder-page .stack-summary-panel .stack-optimizations--rail .stack-optimization-row.is-applied strong {
    font-weight: 500;
    color: color-mix(in srgb, var(--text-primary) 55%, #2e7d32);
}

body.stack-builder-page .stack-summary-panel .stack-optimizations--rail .stack-optimization-row.is-applied .stack-optimization-copy .stack-optimization-swap-text {
    font-weight: 600;
    color: color-mix(in srgb, var(--text-primary) 42%, #2e7d32);
    font-size: 12px;
}

body.stack-builder-page .stack-summary-panel .stack-optimizations--rail .stack-optimization-row.is-applied .stack-optimization-savings {
    color: #5a9a62;
    font-weight: 400;
    font-size: 12px;
}

body.stack-builder-page .stack-summary-panel .stack-optimizations--rail .stack-optimization-save-label {
    font-size: 10px;
    font-weight: 500;
}

body.stack-builder-page .stack-summary-panel .stack-optimizations--rail .stack-optimization-save-value {
    font-size: 15px;
    font-weight: 700;
}

body.stack-builder-page .stack-summary-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 6px;
    padding-top: 2px;
}

body.stack-builder-page .stack-summary-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    width: 100%;
    flex: none;
    min-width: 0;
    padding: 0 14px;
    border-radius: 999px;
    font-size: var(--font-size-sm);
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid var(--border-light);
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-tap-highlight-color: transparent;
}

/* Don’t inherit generic secondary hover/focus “stuck” look; hover only when fine pointer. */
body.stack-builder-page .stack-summary-action-btn:focus:not(:focus-visible) {
    outline: none;
}

body.stack-builder-page .stack-summary-action-btn:focus-visible {
    outline: 2px solid var(--color-bright-blue);
    outline-offset: 2px;
}

@media (hover: hover) {
    body.stack-builder-page .stack-summary-action-btn:hover {
        border-color: var(--border-strong);
        background: var(--bg-primary);
    }
}

body.stack-builder-page .stack-summary-action-btn:active {
    border-color: var(--border-strong);
    background: var(--bg-secondary);
}

body.stack-builder-page .stack-summary-action-btn i.ph {
    font-size: 18px;
    line-height: 1;
}

body.stack-builder-page .stack-save-panel,
body.stack-builder-page .stack-add-step-panel {
    grid-column: 1 / -1;
    margin-top: 0;
    border-radius: 16px;
    padding: 20px;
}

/* Add-step panel: same bento tile as save assembly (stack-builder only). */
body.stack-builder-page .stack-add-step-panel[hidden] {
    display: none !important;
}

body.stack-builder-page .stack-add-step-panel:not([hidden]) {
    display: block;
}

@media (max-width: 640px) {
    body.stack-builder-page .stack-add-step-panel .stack-add-step-grid {
        grid-template-columns: 1fr;
    }
}

body.stack-builder-page .stack-summary-panel {
    position: static;
    border-radius: 16px;
    border: 1px solid var(--border-light);
    background: var(--nav-rail-bg);
    box-shadow: none;
    max-height: none;
    overflow: visible;
    padding: 20px;
}

body.stack-builder-page .stack-summary-panel > h2 {
    font-size: clamp(24px, 2vw, 30px);
    font-weight: 400;
    line-height: 1.32;
    letter-spacing: -0.03em;
    margin: 0 0 12px;
    padding-bottom: 0.14em;
    overflow: visible;
}

body.stack-builder-page .stack-stage-header,
.assembly-stage-header {
    margin-bottom: 14px;
}

body.stack-builder-page .stack-tool-description,
.assembly-tool-description {
    font-size: 14px;
    line-height: 1.35;
    -webkit-line-clamp: 2;
}

body.stack-builder-page .stack-summary-meta {
    grid-template-columns: 1fr;
    gap: 18px;
    padding-bottom: 12px;
}

body.stack-builder-page .stack-summary-value {
    font-size: clamp(18px, 1.3vw, 22px);
    line-height: 1.25;
    letter-spacing: -0.02em;
}

body.stack-builder-page .stack-summary-tool {
    font-size: 14px;
}

body.stack-builder-page .stack-summary-tool-icon img {
    object-fit: contain;
    border-radius: 8px;
}

body.stack-builder-page .stack-summary-total strong {
    font-size: clamp(28px, 3.1vw, 38px);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

body.stack-builder-page .stack-budget-bar {
    height: 4px;
}

body.stack-builder-page .stack-budget-bar-fill {
    background: var(--color-bright-blue);
}

body.stack-builder-page .summa-global-footer {
    display: block;
}

@media (max-width: 1200px) {
    body.stack-builder-page .stack-hero-row,
.assembly-hero-row {
        grid-template-columns: minmax(0, 1fr) 312px;
    }
}

@media (max-width: 1100px) {
    body.stack-builder-page {
        height: auto;
        overflow: visible;
    }

    body.stack-builder-page .stack-page-layout,
.assembly-page-layout {
        grid-template-columns: 1fr;
        overflow: visible;
        min-height: initial;
        flex: none;
    }

    body.stack-builder-page .stack-hero-row,
.assembly-hero-row {
        grid-template-columns: 1fr;
        align-items: start;
    }

    body.stack-builder-page .stack-summary-panel {
        position: static;
        max-height: none;
        overflow: visible;
    }

    body.stack-builder-page .stack-page-main {
        height: auto;
        overflow: visible;
    }

    body.stack-builder-page .stack-shell {
        height: auto;
        min-height: initial;
    }

    body.stack-builder-page .stack-workflow-column,
.assembly-workflow-column {
        overflow: visible;
        min-height: initial;
        padding-right: 0;
    }

    body.stack-builder-page .summa-global-footer {
        display: block;
    }
}

@media (max-width: 860px) {
    body.stack-builder-page .stack-workflow-column,
    body.stack-builder-page .stack-workflow-list,
.assembly-workflow-list {
        grid-template-columns: 1fr;
    }

    body.stack-builder-page .stack-workflow-column,
.assembly-workflow-column {
        padding: 0;
        border-radius: 0;
    }

    body.stack-builder-page .stack-workflow-list .stack-stage-card,
    body.stack-builder-page .stack-workflow-list .stack-stage-card:first-child,
    body.stack-builder-page .stack-workflow-list .stack-stage-card:nth-child(even):not(:first-child),
    body.stack-builder-page .stack-workflow-list .stack-stage-card:nth-child(odd):not(:first-child),
    body.stack-builder-page .stack-add-to-assembly,
    body.stack-builder-page .stack-tools-to-try,
    body.stack-builder-page .stack-save-panel,
    body.stack-builder-page .stack-add-step-panel {
        grid-column: 1 / -1;
    }

    body.stack-builder-page .stack-hero-kpis,
.assembly-hero-kpis {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    body.stack-builder-page .stack-page-title,
.assembly-page-title {
        font-size: clamp(36px, 10vw, 52px);
        font-weight: 400;
    }

    body.stack-builder-page .stack-stage-title-group h3,
.assembly-stage-title-group h3 {
        font-size: clamp(22px, 7vw, 30px);
    }

    body.stack-builder-page .stack-summary-panel > h2 {
        font-size: clamp(28px, 11vw, 40px);
        font-weight: 400;
        line-height: 1.32;
        padding-bottom: 0.14em;
    }
}

/* ===== ASSEMBLY BUILDER — landing reference surfaces (CSS only; preserves tool/button selected rules above) ===== */
body.stack-builder-page .stack-page-layout,
.assembly-page-layout {
    gap: 28px;
}

body.stack-builder-page .stack-workflow-column,
.assembly-workflow-column {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

body.stack-builder-page .stack-workflow-list,
.assembly-workflow-list {
    gap: 16px;
}

body.stack-builder-page .stack-stage-header,
.assembly-stage-header {
    margin-bottom: 18px;
}

/* Step index: solid accent circle (reference). */
body.stack-builder-page .stack-stage-number,
.assembly-stage-number {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--color-bright-blue);
    color: #ffffff;
    font-weight: 700;
    box-shadow: none;
}

/* Summary rail: same flat grey as main column panels (no drop shadow). */
body.stack-builder-page .stack-summary-panel {
    background: var(--nav-rail-bg);
    border: 1px solid #e2e8f0;
    box-shadow: none;
}

/* Inner sections: match summary grey (flat, border only). */
body.stack-builder-page .stack-add-to-assembly,
body.stack-builder-page .stack-tools-to-try,
body.stack-builder-page .stack-save-panel,
body.stack-builder-page .stack-add-step-panel {
    background: var(--nav-rail-bg);
    border: 1px solid #e2e8f0;
    box-shadow: none;
}

/* Full-width blocks; optimizations + tools-to-try stay side-by-side on wide layouts (see rules above). */
body.stack-builder-page .stack-add-to-assembly,
body.stack-builder-page .stack-save-panel,
body.stack-builder-page .stack-add-step-panel {
    grid-column: 1 / -1;
}

/* ===== ASSEMBLY BUILDER — Image 1 layout (hero + list + rail; wins over BENTO REFRESH above) ===== */
body.stack-builder-page .stack-hero-kpis,
.assembly-hero-kpis {
    display: none;
}

body.stack-builder-page .stack-hero-row,
.assembly-hero-row {
    display: block;
    margin-bottom: 28px;
    align-items: stretch;
}

body.stack-builder-page .stack-page-main {
    padding: 172px 24px 80px;
}

body.stack-builder-page .stack-page-title,
.assembly-page-title {
    margin-bottom: 10px;
    font-size: clamp(34px, 3.6vw, 48px);
    font-weight: 400;
    line-height: 1.14;
    letter-spacing: -0.03em;
}

body.stack-builder-page .stack-page-subtitle,
.assembly-page-subtitle {
    font-size: clamp(15px, 1.2vw, 18px);
    line-height: 1.45;
    color: #6b7280;
    max-width: 44ch;
}

@media (max-width: 1100px) {
    body.stack-builder-page .stack-page-main {
        padding: 156px 22px 84px;
    }
}

@media (max-width: 760px) {
    body.stack-builder-page .stack-page-main {
        padding: 136px 18px 84px;
    }

    /* Tool rows: assembly price under copy; badges stay single-line pills on their own row. */
    body.stack-builder-page .stack-tool-row,
.assembly-tool-row {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        align-items: start;
        gap: 12px;
        padding: 14px 14px;
    }

    body.stack-builder-page .stack-tool-main,
.assembly-tool-main {
        width: 100%;
        min-width: 0;
    }

    body.stack-builder-page .stack-tool-price,
.assembly-tool-price {
        justify-self: start;
        padding-top: 0;
    }

    body.stack-builder-page .stack-tool-name-line,
.assembly-tool-name-line {
        flex-wrap: wrap;
        align-items: flex-start;
        row-gap: 8px;
        column-gap: 8px;
    }

    body.stack-builder-page .stack-tool-name-cluster,
.assembly-tool-name-cluster {
        flex: 1 1 100%;
        min-width: 0;
    }

    body.stack-builder-page .stack-tool-row .stack-tool-badge,
.assembly-tool-badge {
        align-self: flex-start;
        padding: 6px 12px;
        font-size: 12px;
        line-height: 1.25;
        min-height: 28px;
        letter-spacing: 0.05em;
    }

}

/* “Suggested” pill — brand pink (soft fill + charcoal type; works on white + blue row) */
body.stack-builder-page .stack-tool-row:not(.is-selected) .stack-tool-badge:not(.stack-tool-badge-affordable) {
    background: var(--color-brand-pink-soft);
    color: var(--color-charcoal);
    border: none;
}

body.stack-builder-page .stack-tool-row.is-selected .stack-tool-badge:not(.stack-tool-badge-affordable) {
    background: var(--color-brand-pink-soft);
    color: var(--color-charcoal);
    border: none;
}

/* Most affordable — brand lime (readable on white + on selected blue row) */
body.stack-builder-page .stack-tool-badge-affordable,
.assembly-tool-badge-affordable {
    border: none;
    background: var(--color-bright-green);
    color: var(--color-charcoal);
    font-weight: 600;
    letter-spacing: 0.04em;
}

body.stack-builder-page .stack-tool-row.is-selected .stack-tool-badge-affordable,
.assembly-tool-badge-affordable {
    background: var(--color-bright-green);
    color: var(--color-charcoal);
    border: none;
}

/* Summary rail: soft grey panel like Image 1 (no elevation shadow). */
body.stack-builder-page .stack-summary-panel {
    background: var(--nav-rail-bg);
    border: 1px solid #e2e8f0;
    box-shadow: none;
    overflow: visible;
}

body.stack-builder-page .stack-summary-panel > h2 {
    font-size: clamp(22px, 2vw, 28px);
    font-weight: 400;
    line-height: 1.32;
}

/* Override global #costSummaryTitle (nowrap + overflow:hidden) so descenders aren’t clipped. */
body.stack-builder-page #costSummaryTitle {
    display: block;
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
    word-break: break-word;
    line-height: 1.32;
    padding-bottom: 0.14em;
}

body.stack-builder-page .stack-summary-label {
    color: #6b7280;
    font-weight: 500;
}

body.stack-builder-page .stack-summary-value {
    color: #111111;
    font-weight: 500;
}

/* ===== FIGMA DISCOVER TOOLS ===== */
.discover-page {
    background: #ffffff;
}

.discover-page-main {
    padding: var(--page-pad-y) var(--page-pad-x) 96px;
    background: #ffffff;
}

.discover-shell {
    width: min(1392px, 100%);
    margin: 0 auto;
}

.discover-hero {
    margin-bottom: 56px;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    border-radius: 0;
}

.discover-hero h1 {
    margin: 0 0 10px;
    font-size: var(--font-size-h1);
    font-weight: 500;
    letter-spacing: -0.03em;
    line-height: 1.05;
}

.discover-hero p {
    margin: 0;
    max-width: 580px;
    font-size: var(--font-size-lg);
    font-weight: 400;
    line-height: 1.35;
    color: var(--text-dark);
}

.discover-filter-grid {
    display: grid;
    grid-template-columns: 1.05fr 1.35fr;
    gap: 34px;
    align-items: start;
    margin-bottom: 58px;
}

.discover-price-panel,
.discover-category-panel,
.discover-tool-card {
    border: 1px solid var(--border-light);
    background: var(--nav-rail-bg);
    box-shadow: 0 4px 20px rgba(93, 222, 244, 0.06);
}

.discover-price-panel,
.discover-category-panel {
    border-radius: 26px;
    padding: 22px 24px 24px;
}

.discover-price-labels {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
    font-size: var(--font-size-sm);
    font-weight: 400;
    color: var(--text-dark);
}

.discover-price-labels strong {
    color: #262626;
    font-weight: 500;
}

.discover-price-slider {
    width: 100%;
    margin: 0 0 12px;
    accent-color: #262626;
}

.discover-price-stops,
.discover-filter-chip-row,
.discover-category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.discover-filter-chip-row-wide {
    align-items: flex-start;
}

.discover-price-stops {
    margin-bottom: 26px;
    flex-wrap: nowrap;
    gap: 8px;
}

.discover-price-chip,
.discover-filter-chip,
.discover-category-pill {
    min-height: 36px;
    padding: 10px 13px;
    border-radius: 999px;
    border: none;
    background: var(--color-light-grey);
    color: var(--text-primary);
    font: inherit;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.5);
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.discover-price-chip {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 10px;
    font-size: 13px;
}

.discover-dropdown {
    position: relative;
}

.discover-filter-trigger {
    min-width: 118px;
    justify-content: space-between;
    gap: 10px;
}

.discover-filter-trigger-wide {
    min-width: 150px;
}

.discover-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 180px;
    padding: 8px;
    border-radius: 18px;
    border: 1px solid rgba(225, 229, 234, 0.96);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 42px rgba(89, 104, 129, 0.12);
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 30;
}

.discover-dropdown.is-open .discover-dropdown-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.discover-dropdown-option {
    width: 100%;
    min-height: 38px;
    padding: 0 12px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: rgba(0, 0, 0, 0.7);
    text-align: left;
    font: inherit;
    font-size: 14px;
    cursor: pointer;
}

.discover-dropdown-option:hover,
.discover-dropdown-option.is-selected {
    background: var(--color-light-blue);
    color: #262626;
}

.discover-price-chip:hover,
.discover-filter-chip:hover,
.discover-category-pill:hover {
    background: var(--color-light-blue);
    color: var(--text-primary);
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.7);
}

.discover-price-chip.is-active,
.discover-category-pill.is-active,
.discover-filter-chip.is-active {
    background: var(--color-charcoal);
    color: #fff;
    box-shadow: none;
}

.discover-filter-chip span:not(.discover-filter-trigger-label) {
    margin-left: 8px;
    color: rgba(0, 0, 0, 0.38);
    font-weight: 500;
}

.discover-category-label {
    margin: 0 0 18px;
    font-size: 15px;
    color: rgba(0, 0, 0, 0.52);
}

.discover-category-panel {
    display: flex;
    flex-direction: column;
}

.discover-tool-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.discover-tool-card {
    position: relative;
    border-radius: var(--radius-md);
    padding: 16px;
    transition: var(--transition);
}

.discover-compare-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: none;
    background: var(--color-bright-blue);
    color: #ffffff;
    font: inherit;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: var(--transition);
}

.discover-compare-btn:hover {
    background: var(--color-bright-blue);
    color: #ffffff;
}

.discover-compare-btn.is-added {
    background: var(--text-primary);
    color: var(--text-white);
}

.discover-compare-btn.is-added:hover {
    background: #2a2a2a;
    color: var(--text-white);
}

.discover-tool-card-header {
    padding-bottom: 18px;
}

.discover-tool-brand {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.discover-tool-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    border: 1px solid var(--border-light);
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: #262626;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
    line-height: 0;
}

.discover-tool-icon img,
.discover-tool-icon .discover-tool-logo {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    padding: 0;
    box-sizing: border-box;
}

.discover-tool-brand h2 {
    margin: 0 0 2px;
    font-size: var(--font-size-card-product);
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.2;
}

.discover-tool-brand p {
    margin: 0;
    font-size: 12px;
    line-height: 22px;
    color: var(--text-muted);
}

.discover-tool-description {
    margin: 0;
    font-size: var(--font-size-sm);
    line-height: 18px;
    color: var(--text-primary);
    max-width: 92%;
}

.discover-tool-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 18px;
    padding: 20px 0;
}

.discover-tool-facts div {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.discover-tool-facts span {
    font-size: 15px;
    color: rgba(0, 0, 0, 0.44);
}

.discover-tool-facts strong {
    font-size: var(--font-size-base);
    font-weight: 600;
    line-height: 1.3;
}

.discover-tool-facts-wide {
    grid-column: 1 / -1;
}

.discover-tool-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 0;
}

.discover-tool-tags span {
    min-height: 32px;
    padding: 6px 12px;
    border-radius: 999px;
    border: none;
    background: var(--color-light-grey);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.5);
}

.discover-tool-meta {
    padding: 0 0 18px;
}

.discover-tool-meta p {
    margin: 0;
    font-size: 15px;
    color: rgba(0, 0, 0, 0.52);
}

.discover-tool-card-footer {
    padding-top: 12px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
}

.discover-visit-btn {
    padding: 9px 16px;
    border-radius: 999px;
    background: #1c1c1c;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
    transition: box-shadow 0.18s ease;
}

.discover-visit-btn:hover {
    box-shadow: 0 4px 14px rgba(218, 112, 148, 0.36), 0 1px 4px rgba(218, 112, 148, 0.18);
}

@media (max-width: 1220px) {
    .discover-filter-grid {
        grid-template-columns: 1fr;
    }

    .discover-tool-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .discover-page-main {
        padding-left: 16px;
        padding-right: 16px;
    }

    .discover-hero {
        margin-bottom: 34px;
    }

    .discover-hero p {
        font-size: 18px;
        max-width: 100%;
    }

    .discover-price-panel,
    .discover-category-panel,
    .discover-tool-card {
        border-radius: var(--radius-xl);
    }

    .discover-tool-grid {
        grid-template-columns: 1fr;
    }

    .discover-tool-card-footer {
        flex-direction: row;
        justify-content: flex-end;
        align-items: center;
    }
}

/* ===== FIGMA TRENDING ASSEMBLIES ===== */
.trending-page {
    background: #ffffff;
}

.trending-page-main {
    padding: var(--page-pad-y) var(--page-pad-x) 120px;
    background: #ffffff;
}

.trending-shell {
    width: min(1392px, 100%);
    margin: 0 auto;
}

.trending-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 56px;
}

.trending-title {
    margin: 0 0 12px;
    max-width: 760px;
    font-size: clamp(38px, 3.8vw, 50px);
    font-weight: 500;
    line-height: 1.08;
    letter-spacing: -0.03em;
}

.trending-subtitle {
    margin: 0 0 28px;
    max-width: 742px;
    font-size: 27px;
    line-height: 1.5;
    color: rgba(0, 0, 0, 0.5);
}

.trending-searchbar {
    width: 100%;
}

.trending-chip-grid {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.trending-chip-grid .homepage-chip {
    height: 42px;
    padding: 0 20px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.24);
}

.trending-kits-section {
    margin-top: 56px;
}

.trending-kits-header {
    margin-bottom: 24px;
}

.trending-kits-header h2 {
    margin: 0 0 6px;
    font-size: 46px;
    font-weight: 500;
    letter-spacing: -0.03em;
}

.trending-kits-header p {
    margin: 0;
    font-size: 16px;
    color: rgba(0, 0, 0, 0.42);
}

.trending-kits-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.trending-kit-card {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    background: var(--surface-elevated);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(20px);
    padding: 26px 24px 22px;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.trending-kit-card:hover {}

.trending-kit-card h3 {
    margin: 0 0 8px;
    font-size: var(--font-size-card-product);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: rgba(0, 0, 0, 0.9);
}

.trending-kit-card > p {
    margin: 0 0 22px;
    font-size: 15px;
    line-height: 1.45;
    color: rgba(0, 0, 0, 0.48);
}

.trending-kit-meta-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 28px;
}

.trending-kit-meta-block span {
    font-size: 14px;
    color: rgba(0, 0, 0, 0.4);
}

.trending-kit-meta-block strong {
    font-size: 17px;
    line-height: 1.45;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.72);
}

.trending-kit-footer {
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.trending-kit-footer span:first-child {
    font-size: var(--font-size-card-product);
    font-weight: 700;
    line-height: 1.2;
    color: rgba(0, 0, 0, 0.92);
}

.trending-kit-footer span:last-child {
    font-size: 15px;
    color: rgba(0, 0, 0, 0.46);
}

@media (max-width: 1180px) {
    .trending-kits-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .trending-page-main {
        padding-left: 16px;
        padding-right: 16px;
    }

    .trending-subtitle {
        font-size: 18px;
        line-height: 1.45;
        margin-bottom: 22px;
    }

    .trending-kits-header h2 {
        font-size: 34px;
    }

    .trending-kits-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== BUILD ASSEMBLY HUB ===== */
.build-stack-hub-page {
    background: #ffffff;
}

.build-stack-hub-main {
    padding: var(--page-pad-y) var(--page-pad-x) 120px;
    background: #ffffff;
}

.build-stack-hub-shell {
    width: min(1392px, 100%);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 34px;
}

.build-stack-hub-hero,
.build-stack-library,
.build-stack-tools-bank {
    border: 1px solid rgba(235, 239, 242, 0.95);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.42);
    box-shadow:
        0 24px 60px rgba(103, 117, 142, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.84);
    backdrop-filter: blur(20px);
}

.build-stack-hub-hero {
    padding: 30px 32px;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
}

.build-stack-hub-hero h1 {
    margin: 0 0 10px;
    font-size: clamp(38px, 3.6vw, 52px);
    font-weight: 500;
    letter-spacing: -0.03em;
}

.build-stack-hub-hero p {
    margin: 0;
    max-width: 720px;
    font-size: 18px;
    line-height: 1.45;
    color: rgba(0, 0, 0, 0.5);
}

.build-stack-new-btn,
.build-stack-catalog-link {
    min-height: 48px;
    padding: 0 20px;
    border-radius: 14px;
    background: var(--color-charcoal);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
}

.build-stack-library,
.build-stack-tools-bank {
    padding: 24px;
}

.build-stack-section-header {
    margin-bottom: 18px;
}

.build-stack-section-header h2 {
    margin: 0 0 6px;
    font-size: 30px;
    font-weight: 500;
    letter-spacing: -0.02em;
}

.build-stack-section-header p {
    margin: 0;
    font-size: 15px;
    color: rgba(0, 0, 0, 0.46);
}

.build-stack-folder-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.build-stack-folder-filter {
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--border-light);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    font: inherit;
    color: rgba(0, 0, 0, 0.62);
    cursor: pointer;
}

.build-stack-folder-filter.is-active {
    background: var(--color-charcoal);
    color: #fff;
    border-color: #262626;
}

.build-stack-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.build-stack-card,
.build-stack-tool-card {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    background: var(--surface-elevated);
    padding: 18px;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
}

.build-stack-card.is-latest {
    border-color: rgba(180, 188, 202, 0.96);
    background: rgba(244, 249, 255, 0.95);
}

.build-stack-card-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.build-stack-card-kicker,
.build-stack-card-index {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.42);
}

.build-stack-card h3,
.build-stack-tool-card h3 {
    margin: 0 0 8px;
    font-size: var(--font-size-card-product);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.build-stack-card p,
.build-stack-tool-description,
.build-stack-tool-card p {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    color: rgba(0, 0, 0, 0.5);
}

.build-stack-card-tools {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 18px 0 20px;
}

.build-stack-card-tools span {
    font-size: 13px;
    color: rgba(0, 0, 0, 0.42);
}

.build-stack-card-tools strong {
    font-size: 16px;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.74);
    line-height: 1.4;
}

.build-stack-card-footer {
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.build-stack-card-footer span {
    font-size: var(--font-size-card-product);
    font-weight: 700;
    color: rgba(0, 0, 0, 0.9);
    line-height: 1.2;
}

.build-stack-card-footer a {
    font-size: 14px;
    color: rgba(0, 0, 0, 0.48);
}

.build-stack-tools-bank-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.build-stack-tool-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.build-stack-tool-card > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.build-stack-tool-card p {
    margin-top: 2px;
}

.build-stack-tool-price {
    align-self: flex-start;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 246, 212, 0.92);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-card-product);
    font-weight: 700;
    color: #111;
    line-height: 1.2;
}

/* Matches .discover-compare-btn — default cyan circle + dark icon; saved uses black + white check */
.build-stack-tool-add {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 999px;
    border: none;
    background: var(--color-bright-blue);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font: inherit;
    font-size: 18px;
    line-height: 1;
}

.build-stack-tool-add:hover {
    background: var(--color-bright-blue);
    color: #ffffff;
}

.build-stack-tool-add i {
    font-size: 17px;
    font-weight: 700;
}

.build-stack-tool-add.is-added {
    background: var(--text-primary);
    color: var(--text-white);
}

.build-stack-tool-add.is-added:hover {
    background: #2a2a2a;
    color: var(--text-white);
}

.build-stack-tools-footer {
    margin-top: 20px;
    display: flex;
    justify-content: flex-start;
}

@media (max-width: 1180px) {
    .build-stack-cards,
    .build-stack-tools-bank-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .build-stack-hub-main {
        padding-left: 16px;
        padding-right: 16px;
    }

    .build-stack-hub-hero {
        flex-direction: column;
    }

    .build-stack-cards,
    .build-stack-tools-bank-grid {
        grid-template-columns: 1fr;
    }

    .build-stack-tool-card > div,
    .build-stack-card-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .stack-save-grid,
    .stack-save-actions {
        grid-template-columns: 1fr;
        flex-direction: column;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   SHARED E-HEADER  — used across all pages
   ═══════════════════════════════════════════════════════════════════ */

:root {
    --radius-pill: 999px;
    --radius-2xl: 28px;
    --radius-xl: 21px;
    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --radius-assemble-row: 8px;
    --radius-assemble-icon: 5px;
    --accent: var(--color-bright-blue);
}

*, *::before, *::after { box-sizing: border-box; }
a { text-decoration: none; color: inherit; }
button { font: inherit; cursor: pointer; border: none; background: none; }

.summo-icon  { display: block; width: 32px; height: 32px; flex-shrink: 0; }
.icon-state  { display: none; }
.icon-state.active { display: block; }

.e-header {
    position: sticky; top: 0; z-index: 500;
    display: flex; align-items: center; justify-content: flex-start;
    padding: 8px 20px;
    background: #ffffff;
    border-bottom: 1px solid #e9e9e9;
    font-family: 'Satoshi', sans-serif;
    -webkit-font-smoothing: antialiased;
}

.e-header-left {
    display: flex;
    align-items: center;
    flex: 0 1 auto;
    width: auto;
    max-width: 100%;
    min-width: 0;
    background: transparent;
    border-radius: 0;
    padding: 0;
    gap: 0;
    border: none;
    justify-content: flex-start;
}

.e-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -0.01em;
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin-right: 38px;
    min-height: 33px;
    height: 33px;
    color: #000000;
    text-transform: none;
}

.e-logo-img {
    display: none;
    height: 16px;
    width: auto;
    flex-shrink: 0;
}

.e-logo::after {
    content: "Sembli";
    display: inline-block;
    line-height: 1.5rem;
}

.e-nav-links {
    display: flex;
    align-items: center;
    gap: 0;
}

.e-nav-link {
    min-height: 33px;
    height: 33px;
    padding: 4px 22px;
    border-radius: 0;
    font-size: 15px;
    line-height: 1.5rem;
    font-weight: 500;
    color: #939393;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    text-transform: none;
    font-family: inherit;
    transition: color 0.14s ease, opacity 0.14s ease;
    white-space: nowrap;
}

.e-nav-link:hover {
    color: #5f5f5f;
}

.e-nav-link.is-active {
    background: transparent;
    color: #000000;
    font-weight: 500;
}

.e-logo.is-active {
    box-shadow: none;
    color: #000000 !important;
}

.e-nav-link.is-active:hover {
    background: transparent;
    color: #000000;
}

.e-mobile-link {
    text-transform: none;
}

.e-nav-item {
    position: relative;
}

.e-nav-btn {
    min-height: var(--e-nav-pill-height);
    height: var(--e-nav-pill-height);
    padding: 0 14px;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 500;
    color: var(--color-charcoal);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    border: none;
    background: transparent;
    font-family: inherit;
    transition: background 0.14s;
    white-space: nowrap;
}

.e-nav-btn:hover {
    background: var(--color-light-blue);
    box-shadow: 0 0 0 1px var(--border-light);
}

.e-nav-btn.is-active {
    background: var(--color-charcoal);
    color: #fff;
}

.e-nav-caret {
    font-size: 11px;
    color: var(--color-charcoal);
    transition: transform 0.18s;
    display: inline-flex;
}

.e-header-right {
    display: flex;
    align-items: center;
    background: var(--nav-rail-bg);
    border-radius: var(--radius-pill);
    padding: 6px;
    gap: 6px;
}

.e-login {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-charcoal);
    min-height: var(--e-nav-pill-height);
    height: var(--e-nav-pill-height);
    padding: 0 18px;
    border-radius: var(--radius-pill);
    background: #fff;
    display: inline-flex;
    align-items: center;
    transition: background 0.14s;
}

.e-login:hover {
    background: var(--color-light-blue);
    box-shadow: 0 0 0 1px var(--border-light);
}

.e-signup {
    min-height: var(--e-nav-pill-height);
    height: var(--e-nav-pill-height);
    padding: 0 18px;
    border-radius: var(--radius-pill);
    background: var(--color-charcoal);
    color: #fff;
    font-size: var(--font-size-sm);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    transition: opacity 0.14s;
}

.e-signup:hover {
    background: #000;
    color: #fff;
    opacity: 0.92;
    transform: translateY(-1px);
}

/* Hide auth/menu cluster in header across pages */
.e-header-right,
.e-menu-btn,
.e-mobile-menu {
    display: none !important;
}

.e-mega {
    display: none !important;
}

/* Global nav lock: enforce one header style across pages */
.e-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 500 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 8px 20px !important;
    background: #ffffff !important;
    border-bottom: 1px solid #e9e9e9 !important;
}
.e-header-left {
    display: flex !important;
    align-items: center !important;
    flex: 0 1 auto !important;
    width: auto !important;
    max-width: 100% !important;
    min-width: 0 !important;
    justify-content: flex-start !important;
    background: transparent !important;
    border-radius: 0 !important;
    padding: 0 !important;
    gap: 0 !important;
    border: none !important;
}
.e-header-right {
    display: none !important;
}
.e-logo {
    background: transparent !important;
    border-radius: 0 !important;
    min-height: 33px !important;
    height: 33px !important;
    padding: 0 !important;
    margin-right: 38px !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    letter-spacing: -0.01em !important;
    text-transform: none !important;
    display: inline-flex !important;
    align-items: center !important;
    color: #000000 !important;
}
.e-nav-link {
    min-height: 33px !important;
    height: 33px !important;
    padding: 4px 22px !important;
    border-radius: 0 !important;
    font-size: 15px !important;
    line-height: 1.5rem !important;
    font-weight: 500 !important;
    color: #939393 !important;
    background: transparent !important;
    text-transform: none !important;
}
.e-logo::after {
    line-height: 1.5rem !important;
}
.e-nav-links {
    align-items: center !important;
    gap: 0 !important;
}
.e-nav-link.is-active {
    font-weight: 500 !important;
    color: #000000 !important;
}
.e-nav-btn {
    border-radius: 999px !important;
    min-height: var(--e-nav-pill-height) !important;
    height: var(--e-nav-pill-height) !important;
}
.e-login {
    background: #fff !important;
    border-radius: 999px !important;
    min-height: var(--e-nav-pill-height) !important;
    height: var(--e-nav-pill-height) !important;
}
.e-signup {
    border-radius: 999px !important;
    min-height: var(--e-nav-pill-height) !important;
    height: var(--e-nav-pill-height) !important;
}

@media (max-width: 760px) {
    .e-header {
        padding: 8px 12px !important;
    }

    .e-header-left {
        width: auto !important;
        max-width: 100% !important;
        min-width: 0;
        flex: 0 1 auto !important;
        justify-content: flex-start !important;
        gap: 0 !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        flex-wrap: nowrap;
    }

    .e-logo {
        min-height: 33px !important;
        height: 33px !important;
        padding: 0 !important;
        margin-right: 18px !important;
        width: auto;
        justify-content: center;
        flex: 0 0 auto;
    }

    .e-logo-img {
        height: 15px;
    }

    .e-nav-links {
        margin-left: 0;
        min-width: 0;
        gap: 0;
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .e-nav-links::-webkit-scrollbar {
        display: none;
    }

    .e-nav-link {
        min-height: 33px !important;
        height: 33px !important;
        padding: 4px 14px !important;
        font-size: 13px !important;
        width: auto;
        flex: 0 0 auto;
    }
}

/* ===== GLOBAL FOOTER (ALL PAGES) — blue slab + white type ===== */
.summa-global-footer {
    margin-top: 0;
    margin-bottom: 0;
    padding: clamp(48px, 6vw, 72px) var(--page-pad-x, 28px) 0;
    background: var(--color-bright-blue);
    background-image: none !important;
    background-repeat: no-repeat;
    background-size: auto;
    color: #ffffff;
    border-top: none;
    overflow: clip;
}

.summa-global-footer-top {
    width: min(1320px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) auto;
    gap: clamp(28px, 5vw, 72px);
    align-items: start;
    justify-content: space-between;
    padding-bottom: 0;
    border-bottom: none;
}

.summa-footer-col--intro {
    max-width: 520px;
}

.summa-footer-nav-groups {
    display: grid;
    grid-template-columns: auto auto;
    gap: clamp(48px, 8vw, 120px);
    align-items: start;
    justify-items: start;
}

.summa-footer-nav-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.summa-global-footer-copy {
    max-width: 520px;
    margin: 0;
    color: rgba(255, 255, 255, 0.96);
    font-size: clamp(14px, 1.05vw, 17px);
    letter-spacing: 0.01em;
    line-height: 1.45;
}

.summa-global-footer-email {
    display: inline-block;
    margin-top: 14px;
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    font-size: clamp(13px, 0.95vw, 15px);
    line-height: 1.3;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    opacity: 0.95;
    transition: opacity 0.14s ease, color 0.14s ease;
}

.summa-global-footer-email:hover {
    opacity: 1;
    color: #ffffff;
}

.summa-footer-link {
    display: block;
    margin: 0;
    padding: 2px 0;
    font-size: clamp(14px, 1.05vw, 16px);
    line-height: 1.45;
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    text-transform: none;
    transition: opacity 0.14s ease;
}

.summa-footer-link:hover {
    opacity: 0.85;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

/* Clickable mega wordmark → marketing homepage */
.summa-global-footer-brand {
    display: block;
    width: min(1320px, 100%);
    margin: clamp(36px, 5.5vw, 64px) auto -0.04em;
    padding-bottom: 0;
    font-size: clamp(104px, 22vw, 300px);
    font-weight: 400;
    line-height: 0.62;
    letter-spacing: -0.05em;
    color: #ffffff;
    text-decoration: none;
    transition: opacity 0.14s ease;
}

.summa-global-footer-brand:visited {
    color: #ffffff;
}

.summa-global-footer-brand:hover {
    opacity: 0.9;
}

.summa-global-footer-brand:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.95);
    outline-offset: 6px;
    opacity: 1;
}

.summa-global-footer-logo {
    display: none;
}

@media (max-width: 900px) {
    .summa-global-footer-top {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .summa-footer-nav-groups {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }

    .summa-global-footer-email {
        font-size: var(--font-size-base, 17px);
        white-space: normal;
    }

    .summa-global-footer-brand {
        margin-top: clamp(28px, 8vw, 40px);
        font-size: clamp(72px, 26vw, 168px);
        font-weight: 400;
        line-height: 0.62;
        margin-bottom: -0.04em;
    }
}

/* ===== YOUR ASSEMBLIES PAGE ===== */
.your-assemblies-page {
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* Saved / recommended / tool cards: neutral surfaces, no accent rail (on-brand with hub cards). */
.your-assemblies-page .ya-card-asm,
.your-assemblies-page .ya-card-rec-asm {
    border: 1px solid var(--border-light);
    background: var(--color-bg-grey);
}

.your-assemblies-page .ya-tool-card {
    border: 1px solid var(--border-light);
    background: var(--color-bg-grey);
}

.your-assemblies-page .ya-card-asm:hover,
.your-assemblies-page .ya-card-rec-asm:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-panel);
}

.your-assemblies-page .ya-tool-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-panel);
}

/* Saved / recommended tool cards: same structure and visual system as Discover tool cards. */
.your-assemblies-page .discover-tool-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: stretch;
    padding: 22px 20px;
    background: var(--nav-rail-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: none;
    color: #1c1c1c;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
    min-height: 100%;
}

.your-assemblies-page .discover-tool-card:hover {
    border-color: var(--border-strong);
    box-shadow: none;
}

.your-assemblies-page .discover-tool-card :is(h2, p, span, strong, li) {
    color: #1c1c1c;
}

.your-assemblies-page .discover-tool-card .discover-tool-brand p {
    color: #1c1c1c;
}

.your-assemblies-page .discover-tool-card .discover-visit-btn,
.your-assemblies-page .discover-tool-card .discover-visit-btn * {
    color: #ffffff;
}

.your-assemblies-page .discover-tool-card-header {
    min-width: 0;
    padding-bottom: 12px;
    padding-right: 0;
}

.your-assemblies-page .discover-tool-brand {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.your-assemblies-page .discover-tool-brand-left {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.your-assemblies-page .discover-tool-brand-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.your-assemblies-page .discover-tool-brand h2 {
    font-size: 22px;
    line-height: 1.15;
    letter-spacing: 0;
    font-weight: 700;
    color: #262626;
    margin: 0 0 4px;
}

.your-assemblies-page .discover-tool-brand .discover-tool-brand-meta p {
    font-size: 15px;
    line-height: 1.2;
    font-weight: 500;
    color: rgba(38, 38, 38, 0.72);
    margin: 0;
}

.your-assemblies-page .discover-tool-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #262626;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
    line-height: 0;
    box-shadow: inset 0 0 0 1px var(--border-light);
}

.your-assemblies-page .discover-tool-icon img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    padding: 0;
    box-sizing: border-box;
}

.your-assemblies-page .discover-tool-description {
    font-size: 17px;
    line-height: 1.35;
    font-weight: 400;
    color: #262626;
    margin: 0 0 18px;
}

.your-assemblies-page .discover-tool-facts {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin: 0;
    padding: 0;
    flex: 1;
}

.your-assemblies-page .discover-tool-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.your-assemblies-page .discover-tool-stat-label {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #262626;
    line-height: 1.2;
}

.your-assemblies-page .discover-tool-stat-value {
    display: block;
    font-size: 17px;
    line-height: 1.25;
    font-weight: 400;
    color: #262626;
}

.your-assemblies-page .discover-tool-card-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    padding-top: 12px;
    margin-top: auto;
}

.your-assemblies-page .discover-tool-price-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-top: 15px;
}

.your-assemblies-page .discover-tool-price-starting {
    font-size: 12px;
    line-height: 1;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    color: rgba(28, 28, 28, 0.56);
}

.your-assemblies-page .discover-tool-price {
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    color: #1c1c1c;
    white-space: nowrap;
}

.your-assemblies-page .discover-visit-btn {
    height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--color-charcoal, #1c1c1c);
    color: #ffffff;
    border: none;
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    flex-shrink: 0;
    align-self: flex-end;
    text-decoration: none;
    transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
    box-shadow: none;
}

.your-assemblies-page .discover-visit-btn:hover {
    transform: translateY(-1px);
    opacity: 0.92;
    background: #000000;
    box-shadow: none;
}

.your-assemblies-page .discover-visit-arrow {
    font-size: 15px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.your-assemblies-page .discover-tool-card .discover-compare-btn {
    --discover-action-size: 32px;
    position: static;
    top: auto;
    right: auto;
    width: var(--discover-action-size);
    min-width: var(--discover-action-size);
    max-width: var(--discover-action-size);
    height: var(--discover-action-size);
    min-height: var(--discover-action-size);
    max-height: var(--discover-action-size);
    border-radius: 50%;
    background: var(--color-bright-blue);
    border: none;
    color: #ffffff;
    font-size: 0;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    align-self: flex-start;
    cursor: pointer;
    transition: transform 0.14s, opacity 0.14s, background 0.14s;
}

.your-assemblies-page .discover-tool-card .discover-compare-btn i {
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
}

.your-assemblies-page .discover-tool-card .discover-compare-btn:hover {
    background: var(--color-bright-blue);
    color: #ffffff;
    transform: translateY(-1px);
    opacity: 0.95;
    box-shadow: 0 0 0 1px var(--border-strong);
}

.your-assemblies-page .discover-tool-card .discover-compare-btn.is-added {
    background: var(--text-primary, var(--color-charcoal, #1c1c1c));
    color: var(--text-white, #ffffff);
}

.your-assemblies-page .discover-tool-card .discover-compare-btn.is-added:hover {
    background: #2a2a2a;
    color: var(--text-white, #ffffff);
}

.your-assemblies-page .ya-grid-tools {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

@media (max-width: 1220px) {
    .your-assemblies-page .ya-grid-tools,
    .your-assemblies-page .ya-grid-tools--rec {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.ya-main {
    padding-bottom: var(--space-2xl);
}

.ya-shell {
    width: min(1320px, 100%);
    margin: 0 auto;
    padding: 80px var(--page-pad-x) 0;
}

.ya-hero {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0;
    position: static;
    inset-block-start: auto;
    z-index: auto;
    background: transparent;
    padding-block: 0;
    padding-inline: 0;
    margin: 0 0 44px;
    max-width: 760px;
}

.ya-hero-title {
    font-family: var(--font-family-display);
    font-size: 40px;
    font-weight: 300;
    letter-spacing: -0.01em;
    line-height: 1.0;
    margin: 0 0 14px;
    color: #0A0A0A;
}

.ya-hero-sub {
    font-size: 16px;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.52;
    max-width: 620px;
    margin: 0;
}

.ya-section {
    margin-bottom: 42px;
}

.ya-section:last-of-type {
    margin-bottom: 0;
}

.ya-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.ya-section-head--single {
    justify-content: flex-start;
}

.ya-section-progress {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: -0.01em;
    line-height: 1;
}

.ya-section-title {
    margin: 0;
    font-family: var(--font-family-display);
    font-size: clamp(1.35rem, 1.6vw, 1.625rem);
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.25;
    color: var(--text-primary);
}

.ya-btn-black {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 999px;
    background: #1c1c1c;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: box-shadow 0.18s ease;
}

.ya-btn-black:hover {
    box-shadow: 0 4px 14px rgba(218, 112, 148, 0.36), 0 1px 4px rgba(218, 112, 148, 0.18);
}

.ya-btn-black:focus-visible {
    outline: 2px solid var(--color-bright-blue);
    outline-offset: 2px;
}

.ya-btn-black--sm {
    padding: 0 16px;
    min-height: 34px;
    font-size: 12px;
    font-weight: 600;
}

/* Saved assembly cards */
.ya-grid-saved-asm {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.ya-card-asm {
    background: var(--color-bg-grey);
    border-radius: var(--radius-md);
    padding: 18px 18px 14px;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    border: 1px solid var(--border-light);
    transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.ya-card-asm:hover {}

.ya-card-asm-title {
    font-family: var(--font-family-display);
    font-size: var(--font-size-card-product);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 4px;
    line-height: 1.2;
    color: var(--text-primary);
}

.ya-card-asm-kicker {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    margin: 0 0 10px;
}

.ya-card-asm-desc {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0 0 12px;
    flex: 1;
}

.ya-card-asm-tools-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px;
}

.ya-card-asm-tools-line {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.45;
    margin: 0 0 14px;
}

.ya-card-asm-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 18px;
    margin-top: auto;
}

.ya-card-asm-price {
    font-size: var(--font-size-card-product);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

/* Recommended assemblies */
.ya-grid-rec-asm {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.ya-card-rec-asm {
    background: var(--color-bg-grey);
    border-radius: var(--radius-md);
    padding: 18px;
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    min-height: 100%;
    transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.ya-card-rec-asm:hover {}

.ya-card-rec-asm-title {
    font-family: var(--font-family-display);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 6px;
    line-height: 1.2;
}

.ya-card-rec-asm-sub {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0 0 14px;
    line-height: 1.45;
}

.ya-rec-tool-list {
    list-style: none;
    margin: 0 0 14px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.ya-rec-tool-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.ya-rec-tool-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    flex-shrink: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--border-light);
    line-height: 0;
}

.ya-rec-tool-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    border-radius: inherit;
}

.ya-rec-tool-body strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 2px;
    color: var(--text-primary);
}

.ya-rec-tool-body span {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.35;
}

.ya-card-rec-asm-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 18px;
    margin-top: auto;
}

/* Tool cards (saved + recommended) */
.ya-grid-tools {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.ya-grid-tools--rec {
    grid-template-columns: repeat(4, 1fr);
}

.ya-tool-card {
    background: var(--color-bg-grey);
    border-radius: var(--radius-md);
    padding: 16px 16px 14px;
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    min-height: 100%;
    transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.ya-tool-card:hover {}

.ya-tool-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.ya-tool-card-id {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.ya-tool-icon-lg {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--border-light);
    line-height: 0;
    flex-shrink: 0;
}

.ya-tool-icon-lg img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    border-radius: inherit;
}

.ya-tool-name {
    font-family: var(--font-family-display);
    font-size: var(--font-size-card-product);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
    line-height: 1.2;
    color: var(--text-primary);
}

.ya-tool-type {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 2px;
}

.ya-tool-add {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-pill);
    border: none;
    background: var(--color-bright-blue);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.12s ease, opacity 0.12s ease;
}

.ya-tool-add i {
    font-size: 16px;
    font-weight: 700;
}

.ya-tool-add:hover {
    background: var(--color-bright-blue);
    color: #ffffff;
    opacity: 0.92;
    transform: scale(1.05);
}

.ya-tool-add.is-added {
    background: var(--text-primary);
    color: var(--text-white);
}

.ya-tool-add.is-added:hover {
    background: #2a2a2a;
    color: var(--text-white);
    opacity: 1;
    transform: none;
}

.ya-tool-add:focus-visible {
    outline: 2px solid var(--color-charcoal);
    outline-offset: 2px;
}

.ya-tool-desc {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.45;
    margin: 0 0 12px;
    flex: 1;
}

.ya-tool-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.ya-tool-meta-row {
    display: grid;
    grid-template-columns: 70px 1fr;
    gap: 8px 12px;
    font-size: 12px;
    line-height: 1.35;
    align-items: start;
}

.ya-tool-meta-k {
    font-weight: 700;
    color: var(--text-primary);
}

.ya-tool-meta-v {
    font-weight: 500;
    color: var(--text-secondary);
}

.ya-tool-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 16px;
    margin-top: auto;
}

@media (max-width: 1100px) {
    .ya-grid-saved-asm {
        grid-template-columns: repeat(2, 1fr);
    }

    .ya-grid-rec-asm {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 640px) {
    .ya-shell {
        padding-top: clamp(56px, 16vw, 88px);
    }

    .ya-hero {
        margin-bottom: 32px;
    }

    .ya-hero-title {
        white-space: normal;
    }

    .ya-grid-saved-asm {
        grid-template-columns: 1fr;
    }

    .ya-section-head {
        flex-direction: column;
        align-items: stretch;
    }

    .ya-section-head .ya-btn-black {
        width: 100%;
        justify-content: center;
    }

    .ya-grid-tools,
    .ya-grid-tools--rec {
        grid-template-columns: 1fr;
    }

    .your-assemblies-page .ya-grid-tools,
    .your-assemblies-page .ya-grid-tools--rec {
        grid-template-columns: 1fr;
    }

    .ya-tool-meta-row {
        grid-template-columns: 1fr;
        gap: 2px;
    }
}

@media print {
    body.stack-builder-page,
    body.assembly-builder-page {
        background: #ffffff !important;
    }

    body.stack-builder-page .e-header,
    body.stack-builder-page .e-mobile-menu,
    body.stack-builder-page .summa-global-footer,
    body.stack-builder-page .stack-summary-actions,
    body.assembly-builder-page .e-header,
    body.assembly-builder-page .e-mobile-menu,
    body.assembly-builder-page .summa-global-footer,
    body.assembly-builder-page .assembly-summary-actions {
        display: none !important;
    }

    body.stack-builder-page .stack-page-main,
    body.assembly-builder-page .assembly-page-main {
        padding-top: 8px !important;
        min-height: 0 !important;
    }

    body.stack-builder-page .stack-shell,
    body.stack-builder-page .stack-page-layout,
    body.assembly-builder-page .assembly-shell,
    body.assembly-builder-page .assembly-page-layout {
        max-width: none !important;
    }
}
