  :root {
    --primary: #1d5d9c;
    --secondary: #e96e01;
    --accent-gold: #f4a500;
    --accent-teal: #00a28b;
    --cream: #fbf2dd;
    --neutral: #3c3c4b;
    --bg: #ffffff;
    --surface: #f7f4ee;
    --border: #e0d9cc;
    --text: #3c3c4b;
    --muted: #7a7a8a;
    --tag-automation: #1d5d9c;
    --tag-agent: #e96e01;
    --tag-hybrid: #00a28b;
  }

.automations-hero {
  padding: 64px 0 48px;
  max-width: 760px;
}

.automations-hero h1 {
  font-family: 'Cabin', sans-serif;
  font-weight: 700;
  font-size: 48px;
  line-height: 1.1;
  letter-spacing: -1px;
  color: var(--primary);
  margin-bottom: 16px;
}

.automations-hero h1 em {
  font-style: normal;
  color: var(--secondary);
}

.hero-sub {
  color: var(--neutral);
  font-size: 15px;
  max-width: 560px;
  line-height: 1.7;
  font-family: 'Open Sans', sans-serif;
}

.stats-bar {
  display: flex;
  gap: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
  overflow-x: auto;
}

.stat {
  padding: 24px 36px;
  border-right: 1px solid var(--border);
  white-space: nowrap;
  flex-shrink: 0;
}

.stat-number {
  font-family: 'Cabin', sans-serif;
  font-weight: 700;
  font-size: 36px;
  color: var(--primary);
  display: block;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: 'Cabin', sans-serif;
  font-weight: 600;
}

.section {
  padding-bottom: 32px;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-family: 'Cabin', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--primary);
}

.section-count {
  color: var(--muted);
  font-size: 12px;
  font-family: 'Open Sans', sans-serif;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  background: var(--bg);
}

.card {
  background: var(--bg);
  padding: 20px;
  transition: background 0.15s;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.card:hover {
  background: var(--surface);
}

.card-top {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.card-name {
  font-family: 'Cabin', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--neutral);
  line-height: 1.4;
  flex: 1;
}

.type-badge {
  font-family: 'Cabin', sans-serif;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 3px;
  flex-shrink: 0;
  font-weight: 700;
}

.type-automation {
  background: rgba(29, 93, 156, 0.1);
  color: var(--tag-automation);
  border: 1px solid rgba(29, 93, 156, 0.2);
}

.type-agent {
  background: rgba(233, 110, 1, 0.1);
  color: var(--tag-agent);
  border: 1px solid rgba(233, 110, 1, 0.2);
}

.type-hybrid {
  background: rgba(0, 162, 139, 0.1);
  color: var(--tag-hybrid);
  border: 1px solid rgba(0, 162, 139, 0.2);
}

.card-desc {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
  font-family: 'Open Sans', sans-serif;
}

.card-footer {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.roi-badge {
  font-family: 'Cabin', sans-serif;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 3px;
  background: rgba(0, 162, 139, 0.1);
  color: var(--accent-teal);
  border: 1px solid rgba(0, 162, 139, 0.25);
}

.hot-badge {
  font-family: 'Cabin', sans-serif;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 3px;
  background: rgba(244, 165, 0, 0.1);
  color: var(--accent-gold);
  border: 1px solid rgba(244, 165, 0, 0.3);
}

.automations-tabs {
  display: flex;
  gap: 32px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.tab-btn {
  background: none;
  border: none;
  display: inline-block;
  padding: 12px 0;
  font-family: 'Cabin', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  text-decoration: none;
}

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

.az-section {
  margin-bottom: 48px;
}

.alpha-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  background: white;
  z-index: 10;
  padding: 8px 20px 8px 0;
}

.alpha-nav-btn {
  display: inline-block;
  background: white;
  border: none;
  padding: 8px 0 4px 0;
  font-family: 'Cabin', sans-serif;
  font-weight: 600;
  font-size: 18px;
  color: var(--primary);
  cursor: pointer;
  border-bottom: 2px solid var(--primary);
  transition: all 0.15s;
}

.alpha-nav-btn:hover {
  background: var(--primary);
  color: white;
}

.alpha-nav-btn--off {
  background: white;
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.5;
  border-bottom-color: transparent;
}

.alpha-section {
  margin-bottom: 48px;
}

.alpha-heading {
  font-family: 'Cabin', sans-serif;
  font-weight: 700;
  font-size: 24px;
  color: var(--primary);
  margin-bottom: 16px;
}

.alpha-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.alpha-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 4px;
  text-decoration: none;
  color: inherit;
  transition: all 0.15s;
}

.alpha-item:hover {
  background: var(--surface);
  border-color: var(--primary);
}

.alpha-item-title {
  font-family: 'Cabin', sans-serif;
  font-weight: 600;
  font-size: 14px;
}

.alpha-item-meta {
  display: flex;
  gap: 8px;
  align-items: center;
}

.category-tag {
  font-family: 'Cabin', sans-serif;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--surface);
  color: var(--muted);
}

.heath-badge {
  font-family: 'Cabin', sans-serif;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(233, 110, 1, 0.1);
  color: var(--tag-agent);
}

@media (max-width: 600px) {
  .container {
    padding-left: 20px;
    padding-right: 20px;
  }

  .automations-hero h1 {
    font-size: 36px;
  }

  .stats-bar {
    margin-left: -20px;
    margin-right: -20px;
  }
}

/* Detail pages */
.detail-stack {
  display: flex;
  flex-direction: column;
  gap: 48px;
  padding-bottom: 96px;
}

/* ── Detail hero ── */
.detail-hero-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.detail-hero {
  background: linear-gradient(135deg, rgba(29, 93, 156, 0.08), rgba(233, 110, 1, 0.08));
  border-bottom: 1px solid var(--border);
}

.detail-hero-inner {
  padding: 56px 0 48px;
}

.detail-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Cabin', sans-serif;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 16px;
  color: var(--muted);
}

.detail-breadcrumb a {
  color: var(--primary);
  text-decoration: none;
}

.detail-breadcrumb a:hover {
  text-decoration: underline;
}

.detail-hero h1 {
  font-family: 'Cabin', sans-serif;
  font-size: 48px;
  line-height: 1.1;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
  color: var(--primary);
}

.detail-summary {
  font-family: 'Open Sans', sans-serif;
  font-size: 18px;
  line-height: 1.7;
  color: var(--neutral);
  max-width: 720px;
  margin-bottom: 0;
}

.detail-meta-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

/* ── Body two-column layout ── */
.detail-body {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 48px;
  align-items: start;
  padding-top: 48px;
  padding-bottom: 96px;
}

.detail-main {
  display: flex;
  flex-direction: column;
  gap: 40px;
  min-width: 0;
}

/* ── Section label ── */
.section-label {
  font-family: 'Cabin', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0 0 12px;
}

.detail-section {
  display: flex;
  flex-direction: column;
}

/* ── Left column prose text ── */
.detail-main-text {
  font-family: 'Open Sans', sans-serif;
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
  margin: 0;
  max-width: 660px;
}

.detail-main-text--lede {
  margin-bottom: 20px;
}

/* ── Flat cards (no box, left column) ── */
.detail-cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
}

.detail-card-flat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.detail-card-flat p {
  font-family: 'Open Sans', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  margin: 0;
}

.detail-card-flat__heading {
  font-family: 'Cabin', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 8px;
  line-height: 1.2;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.detail-card-flat--heath .detail-card-flat__heading {
  color: var(--secondary);
}

/* ── Detail card variants ── */
.detail-card__lede {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 16px;
}

/* ── Flat list (no card box) ── */
.detail-list--flat li {
  font-family: 'Open Sans', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
}

/* ── Agency failure numbered list ── */
.detail-list--numbered li {
  font-family: 'Open Sans', sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

/* ── Section heading ── */
.section-heading {
  font-family: 'Cabin', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 8px;
  line-height: 1.2;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* ── Fit check ── */
.fit-check {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.fit-check__col {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fit-check__col p:not(.fit-check__label) {
  margin: 0;
  font-family: 'Open Sans', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
}

.fit-check__col--yes {
  background: rgba(0, 162, 139, 0.06);
  border-right: 1px solid var(--border);
}

.fit-check__col--no {
  background: rgba(233, 110, 1, 0.05);
}

.fit-check__label {
  font-family: 'Cabin', sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 !important;
}

.fit-check__col--yes .fit-check__label {
  color: var(--accent-teal);
}

.fit-check__col--no .fit-check__label {
  color: var(--secondary);
}

/* ── Sidebar ── */
.detail-sidebar {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.sidebar-card__title {
  font-family: 'Cabin', sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.sidebar-card__body {
  font-family: 'Open Sans', sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  margin: 0;
}

/* ── Rating bars ── */
.sidebar-rating {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-rating__label {
  font-family: 'Cabin', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--neutral);
}

.rating-bar {
  display: flex;
  gap: 4px;
}

.rating-pip {
  display: block;
  width: 32px;
  height: 8px;
  border-radius: 4px;
  background: var(--border);
}

.rating-pip--on {
  background: var(--primary);
}

/* ── Trigger/Output flow ── */
.sidebar-flow {
  gap: 0;
}

.sidebar-flow .sidebar-card__title {
  margin-bottom: 14px;
}

.flow-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
}

.flow-step + .flow-step {
  border-top: 1px dashed var(--border);
}

.flow-step__icon {
  font-size: 14px;
  margin-top: 2px;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.flow-step--trigger .flow-step__icon {
  color: var(--primary);
}

.flow-step--output .flow-step__icon {
  color: var(--accent-teal);
}

.flow-step__label {
  font-family: 'Cabin', sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 4px;
}

.flow-step__body {
  font-family: 'Open Sans', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  margin: 0;
}

.flow-arrow {
  text-align: center;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  padding: 2px 0;
}

/* ── FAQ accordion ── */
.detail-faq {
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.detail-faq summary {
  padding: 16px 20px;
  font-family: 'Cabin', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.detail-faq summary::-webkit-details-marker {
  display: none;
}

.detail-faq summary::after {
  content: '+';
  font-size: 18px;
  font-weight: 400;
  color: var(--muted);
  flex-shrink: 0;
}

.detail-faq[open] summary::after {
  content: '−';
}

.detail-faq[open] summary {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.detail-faq p {
  padding: 16px 20px;
  margin: 0;
  font-family: 'Open Sans', sans-serif;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .detail-body {
    grid-template-columns: 1fr;
  }

  .detail-sidebar {
    position: static;
  }

  .fit-check {
    grid-template-columns: 1fr;
  }

  .fit-check__col--yes {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}

.last-updated-pill {
  font-size: 12px;
  font-family: 'Cabin', sans-serif;
  padding: 4px 12px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--muted);
  background: white;
}

.detail-stat-grid {
  margin-top: 32px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.detail-stat {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid rgba(29, 93, 156, 0.25);
  border-radius: 4px;
  background: rgba(29, 93, 156, 0.08);
}

.detail-stat-icon {
  font-size: 16px;
}

.detail-stat-label {
  font-family: 'Cabin', sans-serif;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0;
}

.detail-stat-value {
  font-family: 'Cabin', sans-serif;
  font-size: 14px;
  color: var(--primary);
  margin: 0;
}

.detail-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.detail-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

.detail-card-span {
  grid-column: span 2;
}

@media (max-width: 720px) {
  .detail-card-span {
    grid-column: span 1;
  }
}

.card-eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: 'Cabin', sans-serif;
  color: var(--muted);
  margin: 0;
}

.detail-card p {
  margin: 0;
  font-family: 'Open Sans', sans-serif;
  line-height: 1.6;
  color: var(--text);
}

.detail-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-list li {
  position: relative;
  padding-left: 18px;
}

.detail-list li::before {
  content: "•";
  color: var(--primary);
  position: absolute;
  left: 0;
}

.detail-faq-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-faq h3 {
  margin: 0 0 6px;
  font-family: 'Cabin', sans-serif;
  font-size: 16px;
  color: var(--primary);
}

.detail-faq p {
  margin: 0;
  font-family: 'Open Sans', sans-serif;
  line-height: 1.6;
}

.detail-cta {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: var(--surface);
}

.detail-cta h2 {
  font-family: 'Cabin', sans-serif;
  font-size: 28px;
  margin: 8px 0 12px;
  color: var(--primary);
}

.detail-cta p {
  margin: 0;
  color: var(--text);
  line-height: 1.6;
}

.card-eyebrow + h2 {
  margin-top: 8px;
}

.detail-cta .button {
  white-space: nowrap;
}

@media (max-width: 768px) {
  .detail-cta {
    flex-direction: column;
    align-items: flex-start;
  }
}
