/* PickInstead design system (T21, D-30). Tokens and component styles only;
   see DESIGN.md for the source of every value and the pattern it is drawn
   from. Light only. No UI library, no inline styles anywhere (CSP style-src
   'self'). Self-hosted Inter and Instrument Sans: no third-party font origin
   at runtime. */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter/inter-latin-variable.woff2') format('woff2');
}

@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/instrument-sans/instrument-sans-latin-variable.woff2') format('woff2');
}

/* Size-adjusted local fallbacks so the reflow when a webfont swaps in is
   small. A technique, not extra font files (DESIGN.md). */
@font-face {
  font-family: 'Inter Fallback';
  src: local('Arial');
  size-adjust: 107%;
  ascent-override: 90%;
  descent-override: 22%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Instrument Sans Fallback';
  src: local('Arial');
  size-adjust: 98%;
  ascent-override: 96%;
  descent-override: 25%;
  line-gap-override: 0%;
}

:root {
  color-scheme: light;

  --font-sans: 'Inter', 'Inter Fallback', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Instrument Sans', 'Instrument Sans Fallback', 'Inter', system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Consolas, 'Liberation Mono', monospace;

  --font-size-xs: 0.75rem;    /* 12px */
  --font-size-sm: 0.875rem;   /* 14px */
  --font-size-base: 1rem;     /* 16px */
  --font-size-lg: 1.125rem;   /* 18px */
  --font-size-xl: 1.375rem;   /* 22px */
  --font-size-2xl: 1.75rem;   /* 28px */
  --font-size-3xl: 2.25rem;   /* 36px */
  --font-size-4xl: 3.5rem;    /* 56px, home hero only */

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;

  --radius-sm: 4px;
  --radius-md: 5px;
  --radius-lg: 10px;
  --radius-pill: 999px;

  --container-max: 80rem; /* 1280px */
  --gutter: 1.25rem;      /* 20px */

  --header-height: 56px;

  /* Role tokens, light only (D-30). Values per DESIGN.md. */
  --canvas: #fffefb;
  --card: #ffffff;
  --surface-raised: #f9f7f3;
  --surface-sunken: #f8f4f0;
  --border: #d7d3c9;
  --border-soft: #ece9df;
  --border-input: #b5b2aa;
  --text-heading: #201515;
  --text: #413735;
  --text-muted: #6f6765;
  --accent: #1c5fd1;
  --accent-foreground: #ffffff;
}

/* Reset and base */

* {
  box-sizing: border-box;
}

html {
  font-family: var(--font-sans);
}

body {
  margin: 0;
  color: var(--text);
  background: var(--canvas);
  font-size: var(--font-size-base);
  line-height: 1.55;
}

h1,
h2,
h3 {
  color: var(--text-heading);
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  line-height: 1.15;
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--accent);
}

ul,
ol {
  padding: 0;
}

summary {
  cursor: pointer;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

.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;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 1100;
  padding: var(--space-2) var(--space-4);
  background: var(--canvas);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.skip:focus {
  left: var(--space-4);
  top: var(--space-4);
}

/* Progressive-enhancement gate: hidden until enhance.js confirms JS runs and
   adds js-enhanced to <html> (DESIGN.md, filter/sort/search bar). */
.enhance-only {
  display: none;
}

html.js-enhanced .enhance-only {
  display: block;
}

/* Page container: capped width, side gutter, used inside <main> and by the
   header/footer's own inner wrapper so all three line up at every width. */

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

.prose {
  max-width: 44rem;
}

.prose h1 {
  margin-top: 0;
  font-size: var(--font-size-2xl);
}

.prose h2 {
  font-size: var(--font-size-lg);
}

.prose .sources {
  padding-left: var(--space-5);
}

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

/* ============================= Header ============================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-height);
  background: var(--canvas);
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  position: relative;
  max-width: var(--container-max);
  height: var(--header-height);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.brand .mark {
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
}

.wordmark {
  font-size: var(--font-size-lg);
  font-weight: var(--weight-bold);
  letter-spacing: -0.01em;
}

.wordmark span {
  font-weight: var(--weight-medium);
  color: var(--text-muted);
}

.desktop-nav {
  display: none;
  align-items: center;
  gap: var(--space-5);
}

.nav-link {
  color: var(--text);
  text-decoration: none;
  font-size: var(--font-size-sm);
  font-weight: var(--weight-medium);
  padding: var(--space-2) 0;
}

.nav-link:hover {
  color: var(--accent);
}

.nav-mega > summary {
  color: var(--text);
  font-size: var(--font-size-sm);
  font-weight: var(--weight-medium);
  padding: var(--space-2) 0;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.nav-mega > summary::after {
  content: '';
  width: 0.4rem;
  height: 0.4rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.nav-mega[open] > summary::after {
  transform: rotate(-135deg) translateY(2px);
}

.header-utils {
  display: none;
  align-items: center;
  gap: var(--space-4);
  margin-left: auto;
}

.nav-link-utility {
  white-space: nowrap;
}

/* ============================= Mega menu ============================= */

.mega-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--canvas);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
  padding: var(--space-6) var(--gutter);
  display: grid;
  grid-template-columns: 5fr 2fr;
  grid-template-areas:
    'intro intro'
    'columns rail'
    'quicklinks quicklinks';
  gap: var(--space-6) var(--space-5);
  max-height: calc(100vh - var(--header-height));
  overflow-y: auto;
}

.mega-menu-intro {
  grid-area: intro;
}

.mega-menu-heading {
  margin: 0 0 var(--space-1);
  font-size: var(--font-size-xl);
  font-weight: var(--weight-semibold);
}

.mega-menu-subheading {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

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

.mega-menu-col-title {
  margin: 0 0 var(--space-3);
  font-size: var(--font-size-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mega-menu-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}

.mega-menu-items a {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--text);
  padding: var(--space-2);
  border-radius: var(--radius-md);
}

.mega-menu-items a:hover {
  background: var(--surface-sunken);
}

.mega-menu-item-icon {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.mega-menu-item-icon-dot::before {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
}

.mega-menu-item-title {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--weight-semibold);
}

.mega-menu-item-desc {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.mega-menu-items-plain a {
  padding-left: var(--space-2);
}

.mega-menu-rail {
  grid-area: rail;
  align-self: start;
  background: var(--surface-sunken);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.mega-menu-quick-links {
  grid-area: quicklinks;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.mega-menu-quick-links a {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  text-decoration: none;
}

.mega-menu-quick-links a:hover {
  color: var(--accent);
}

/* ============================= Drawer trigger ============================= */

.drawer-trigger {
  margin-left: auto;
}

.drawer-trigger > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  color: var(--text);
}

.drawer-icon-close {
  display: none;
}

.drawer-trigger[open] .drawer-icon-open {
  display: none;
}

.drawer-trigger[open] .drawer-icon-close {
  display: inline-flex;
}

.site-header-inner:has(.drawer-trigger[open]) .header-utils {
  display: none;
}

body:has(.drawer-trigger[open]) {
  overflow: hidden;
}

.drawer-panel {
  position: fixed;
  inset: var(--header-height) 0 0 0;
  z-index: 999;
  background: var(--canvas);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.drawer-nav {
  padding: var(--space-4) var(--gutter);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1 1 auto;
}

.drawer-accordion > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) 0;
  font-size: var(--font-size-base);
  font-weight: var(--weight-medium);
  border-bottom: 1px solid var(--border);
}

.drawer-accordion > summary::after {
  content: '\2304';
  color: var(--text-muted);
}

.drawer-accordion[open] > summary::after {
  content: '\2303';
}

.drawer-accordion-list {
  list-style: none;
  margin: 0;
  padding: var(--space-2) 0 var(--space-3) var(--space-3);
  display: grid;
  gap: var(--space-3);
}

.drawer-accordion-list a {
  color: var(--text);
  text-decoration: none;
  font-size: var(--font-size-sm);
}

.drawer-row {
  display: block;
  padding: var(--space-3) 0;
  color: var(--text);
  text-decoration: none;
  font-weight: var(--weight-medium);
  border-bottom: 1px solid var(--border);
}

.drawer-bottom {
  padding: var(--space-4) var(--gutter) var(--space-6);
  background: var(--surface-sunken);
  border-top: 1px solid var(--border);
  display: grid;
  gap: var(--space-3);
}

.drawer-bottom-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-2);
}

.drawer-bottom-links a {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  text-decoration: none;
  min-height: 2rem;
  display: inline-flex;
  align-items: center;
}

/* Desktop / mobile switch, pinned to the measured 1024px breakpoint */

@media (min-width: 64rem) {
  .desktop-nav {
    display: flex;
  }

  .header-utils {
    display: flex;
  }

  .drawer-trigger {
    display: none;
  }
}

/* ============================= Buttons ============================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 40px;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: var(--weight-semibold);
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-pill {
  height: 36px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-pill);
  font-size: var(--font-size-sm);
}

.btn-lg {
  height: 48px;
  padding: 0 var(--space-5);
  font-size: var(--font-size-base);
}

.btn-block {
  width: 100%;
}

.btn-accent {
  background: var(--accent);
  color: var(--accent-foreground);
}

.btn-secondary {
  background: var(--canvas);
  color: var(--text-heading);
  border-color: var(--text-heading);
}

/* ============================= Footer ============================= */

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 0;
  padding: var(--space-7) 0 var(--space-6);
}

.site-footer-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  gap: var(--space-6);
}

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

.footer-col-heading {
  margin: 0 0 var(--space-3);
  font-size: var(--font-size-sm);
  font-weight: var(--weight-semibold);
}

.footer-col-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}

.footer-col-list a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: var(--font-size-sm);
}

.footer-col-list a:hover {
  color: var(--accent);
}

.footer-utility-row {
  border-top: 1px solid var(--border);
  padding-top: var(--space-4);
}

.footer-utility-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer-utility-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: var(--font-size-sm);
  min-height: 2rem;
  display: inline-flex;
  align-items: center;
}

.footer-closing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.footer-closing a {
  color: var(--text-muted);
}

@media (min-width: 48rem) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 64rem) {
  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================= Alphabetical index ============================= */

.alpha-index {
  text-align: center;
}

.alpha-index-label {
  margin: 0 0 var(--space-3);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.alpha-index-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
}

.alpha-index-list a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  min-height: 2rem;
  padding: 0 var(--space-1);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: var(--font-size-sm);
}

.alpha-index-list a:hover {
  background: var(--surface-sunken);
  color: var(--accent);
}

/* ============================= Home page ============================= */

.build-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

.build-status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
}

.lead {
  font-size: var(--font-size-lg);
  color: var(--text-muted);
  margin: 0;
  max-width: 42rem;
}

/* Illustrative matching demo on the home page: built from the product row,
   logo tile, match meter and use-case chip components, not bespoke cards. */

.match-demo {
  margin: 0;
  display: grid;
  gap: var(--space-3);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.match-demo-note {
  margin: 0;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.match-demo-source {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.match-demo-label {
  margin: 0;
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.match-demo-name {
  margin: 0;
  font-weight: 600;
}

.match-demo-chip-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.match-demo-ranked {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}

.match-demo-rank-label {
  display: flex;
  align-items: center;
  margin: 0 0 var(--space-2);
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  margin-right: var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-foreground);
  font-size: 0.65rem;
}

.match-demo-caption {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.section {
  padding: var(--space-6) 0;
  border-top: 1px solid var(--border);
}

.section h2 {
  font-size: var(--font-size-2xl);
  margin-top: 0;
}

.home-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-5);
}

.home-steps li h3 {
  margin: 0 0 var(--space-2);
  font-size: var(--font-size-lg);
}

.home-steps li p {
  margin: 0;
  color: var(--text-muted);
}

.home-who {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-4);
}

.home-who strong {
  color: var(--text);
}

/* ============================= Component: product row ============================= */

.product-row-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-4);
}

.product-row {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
}

.product-row-name {
  margin: 0;
  font-size: var(--font-size-base);
  font-weight: 600;
}

.product-row-name a {
  color: var(--text);
  text-decoration: none;
}

.product-row-name .ext {
  color: var(--text-muted);
  font-weight: 400;
}

.product-row-desc {
  margin: var(--space-1) 0 var(--space-2);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.product-row-badges {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.product-row-badges li {
  border-right: 1px solid var(--border);
  padding-right: var(--space-2);
}

.product-row-badges li:last-child {
  border-right: none;
}

/* ============================= Component: monogram / logo tile ============================= */

.logo-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.logo-tile-mono {
  font-family: var(--font-sans);
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--text-muted);
}

.logo-tile img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* A vendor's own logo sits on white with padding (D-31); the monogram keeps the canvas fill. */
.logo-tile-vendor {
  background: #fff;
  padding: 6px;
  box-sizing: border-box;
}

.logo-tile-lg.logo-tile-vendor {
  padding: 10px;
}

.logo-tile-demo {
  display: flex;
  gap: var(--space-4);
}

/* ============================= Component: use-case chip ============================= */

.use-case-chip {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  color: var(--text);
  text-decoration: none;
  background: var(--canvas);
  white-space: nowrap;
}

.use-case-chip:hover {
  background: var(--surface-sunken);
}

.topic-pill-row {
  position: relative;
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: var(--space-2);
}

/* ============================= Component: match meter ============================= */

.match-meter {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.match-meter meter {
  width: 100%;
  height: 0.5rem;
  appearance: none;
  border: none;
  background: var(--border);
  border-radius: var(--radius-sm);
}

.match-meter meter::-webkit-meter-bar {
  background: var(--border);
  border: none;
  border-radius: var(--radius-sm);
  height: 0.5rem;
}

.match-meter meter::-webkit-meter-optimum-value {
  background: var(--accent);
  border-radius: var(--radius-sm);
}

.match-meter meter::-moz-meter-bar {
  background: var(--accent);
  border-radius: var(--radius-sm);
}

.match-meter-label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

/* ============================= Component: feature matrix ============================= */

.feature-matrix-wrap {
  position: relative;
  overflow-x: auto;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.feature-matrix {
  border-collapse: collapse;
  width: 100%;
  font-size: var(--font-size-sm);
}

.feature-matrix th,
.feature-matrix td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
  background: var(--canvas);
}

.feature-matrix thead th {
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.feature-matrix th[scope='row'],
.feature-matrix .feature-matrix-corner {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--card);
  font-weight: 600;
  white-space: normal;
  min-width: 10rem;
}

.feature-matrix td {
  text-align: center;
}

.fm-yes {
  color: var(--accent);
}

.fm-no {
  color: var(--text-muted);
}

.fm-unknown {
  color: var(--text-muted);
  font-style: italic;
}

/* ============================= Component: side-by-side table ============================= */

.side-by-side {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
}

.side-by-side-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  font-size: var(--font-size-sm);
}

.side-by-side-filters label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
}

.side-by-side-filters input[type='checkbox'] {
  width: 1.5rem;
  height: 1.5rem;
}

/* ============================= Component: filter and sort bar ============================= */

.filter-sort-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
}

.filter-checks {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  border: none;
  margin: 0;
  padding: 0;
  font-size: var(--font-size-sm);
}

.filter-checks label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
}

.filter-checks input[type='checkbox'] {
  width: 1.5rem;
  height: 1.5rem;
}

.sort-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-left: auto;
}

.filter-sort-bar select {
  font: inherit;
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--canvas);
  color: var(--text);
}

/* ============================= Component: search box ============================= */

.search-box {
  position: relative;
  flex: 1 1 12rem;
}

.search-icon {
  position: absolute;
  left: var(--space-4);
  top: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input[hidden] ~ .search-icon {
  display: none;
}

.search-box input[type='search'] {
  width: 100%;
  height: 48px;
  font: inherit;
  padding: var(--space-2) var(--space-4) var(--space-2) 2.75rem;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  background: var(--canvas);
  color: var(--text);
}


/* Site search (Pagefind): results list and the JS-off fallback line. */
[data-component='site-search'] {
  max-width: 53.375rem;
  margin: var(--space-4) auto;
  text-align: left;
}

.search-results {
  list-style: none;
  margin: var(--space-2) 0 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--canvas);
}

.search-results li {
  padding: var(--space-2) var(--space-4);
  border-top: 1px solid var(--border);
}

.search-results li:first-child {
  border-top: 0;
}

.search-results mark {
  background: transparent;
  color: inherit;
  font-weight: 600;
}
/* ============================= Component: source footnote ============================= */

.source-footnote {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin: var(--space-2) 0 0;
}

.source-footnote a {
  color: var(--text-muted);
  text-decoration: underline;
}

/* ============================= Component: last-updated stamp ============================= */

.updated-stamp {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin: 0 0 var(--space-4);
}

/* ============================= Component: labelled sponsor slot ============================= */

.sponsor-slot {
  position: relative;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-sunken);
}

.sponsor-slot-label {
  position: absolute;
  top: var(--space-2);
  right: var(--space-3);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sponsor-slot-name {
  margin: 0 0 var(--space-1);
  font-weight: 600;
}

.sponsor-slot-desc {
  margin: 0 0 var(--space-3);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.directory-sponsor {
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  margin-bottom: var(--space-4);
}

@media (max-width: 39.999rem) {
  .directory-sponsor {
    grid-template-columns: 40px 1fr;
  }
}

/* ============================= Component: category rail ============================= */

.category-rail-list {
  display: none;
}

.category-rail-item > summary {
  padding: var(--space-3) 0;
  font-size: var(--font-size-sm);
  font-weight: var(--weight-medium);
  border-bottom: 1px solid var(--border);
}

.category-rail-sub {
  list-style: none;
  margin: 0;
  padding: var(--space-2) 0 var(--space-3) var(--space-3);
  display: grid;
  gap: var(--space-2);
}

.category-rail-sub a {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  text-decoration: none;
}

.category-rail-select select {
  width: 100%;
  height: 48px;
  font: inherit;
  padding: 0 var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--canvas);
  color: var(--text);
}

@media (min-width: 64rem) {
  .category-rail-list {
    display: block;
  }

  .category-rail-select {
    display: none;
  }
}

/* ============================= Component: app grid ============================= */

.app-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 40rem) {
  .app-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.app-card {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 14px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
}

.app-card:hover {
  border-color: var(--border-soft);
  background: var(--card);
}

.app-card-body {
  display: grid;
  gap: var(--space-1);
  align-content: start;
  min-width: 0;
}

.app-card-name {
  margin: 0;
  font-weight: var(--weight-bold);
  line-height: 1.5;
}

.app-card-name a {
  color: var(--text);
  text-decoration: none;
}

.app-card-desc {
  margin: 0;
  font-size: var(--font-size-sm);
  line-height: 1.7;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

/* ============================= Component: pagination ============================= */

.pagination-list {
  list-style: none;
  margin: var(--space-5) 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
}

.pagination-list a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  min-height: 2.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  text-decoration: none;
  font-size: var(--font-size-sm);
}

.pagination-list a.pagination-current {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-foreground);
}

/* ============================= Directory page ============================= */

.directory-toolbar {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-5) 0;
}

.directory-layout {
  display: grid;
  gap: var(--space-5);
}

.directory-result-count {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

@media (min-width: 64rem) {
  .directory-layout {
    grid-template-columns: 16rem 1fr;
    align-items: start;
  }
}

/* ============================= Styleguide page ============================= */

.styleguide-banner {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.styleguide-section {
  padding: var(--space-6) 0;
  border-top: 1px solid var(--border);
}

.styleguide-section h2 {
  font-size: var(--font-size-xl);
  margin: 0 0 var(--space-1);
}

.styleguide-section .styleguide-note {
  margin: 0 0 var(--space-4);
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.styleguide-open-demo {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  background: var(--card);
  min-height: 20rem;
}

.styleguide-open-demo .mega-menu,
.styleguide-open-demo .drawer-panel {
  position: static;
  box-shadow: none;
  inset: auto;
  max-height: none;
}

.styleguide-open-demo .drawer-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

/* ============================= Sample product page ============================= */

.product-header {
  background: var(--surface-sunken);
  border-bottom: 1px solid var(--border-soft);
  border-left: 8px solid var(--accent);
}

.product-header-inner {
  display: flex;
  gap: var(--space-5);
  align-items: flex-start;
}

.product-header .product-header-inner {
  padding-top: var(--space-6);
  padding-bottom: var(--space-6);
}

.product-header h1 {
  margin: 0 0 var(--space-2);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}

.product-header p {
  margin: 0;
  color: var(--text-muted);
}

.competitor-chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}

.competitor-chip {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.competitor-chip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  font-weight: 600;
}

.product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: var(--space-4) 0;
}

.screenshot-placeholder {
  margin: 0;
  width: 100%;
  box-sizing: border-box;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
}

.screenshot-placeholder svg {
  display: block;
  width: 100%;
  height: auto;
}

.screenshot-placeholder figcaption {
  margin-top: var(--space-2);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.details-panel {
  display: grid;
  gap: var(--space-5);
  padding: var(--space-5) 0;
  align-items: start;
}

@media (min-width: 48rem) {
  .details-panel {
    grid-template-columns: 2fr 1fr;
  }

  /* DOM order is signals-side then description (source order matters for
     screen readers and for I-17); grid placement puts description back in
     the left column and the signals side in the right one at desktop. */
  .details-panel .details-side {
    grid-column: 2;
    grid-row: 1;
  }

  .details-panel .details-description {
    grid-column: 1;
    grid-row: 1;
  }
}

.details-side {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
}

.details-description {
  min-width: 0;
}

.signals-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}

.signals-list li {
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
}

.signals-list li p {
  margin: 0 0 var(--space-1);
}

.signals-list .signal-value {
  font-weight: 600;
}

/* ============================= Catalogue pages (T18.6) ============================= */

.product-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-2) 0 0;
}

.product-meta .updated-stamp {
  margin: 0;
}

.product-header .product-actions {
  padding: var(--space-3) 0 0;
}

.category-header {
  padding: var(--space-6) 0 var(--space-4);
}

.category-header h1 {
  margin: 0 0 var(--space-2);
  font-size: var(--font-size-2xl);
}

.category-header .lead {
  margin: 0 0 var(--space-2);
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  list-style: none;
  margin: 0 0 var(--space-2);
  padding: 0;
}

.chip-list .use-case-chip,
.product-meta .use-case-chip {
  white-space: normal;
}

.facts-list {
  display: grid;
  gap: var(--space-2);
  margin: 0 0 var(--space-3);
}

.facts-row {
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
}

.facts-row dt {
  color: var(--text-muted);
  font-size: var(--font-size-xs);
}

.facts-row dd {
  margin: 0;
  font-weight: 600;
}

.compare-facts {
  display: grid;
  gap: var(--space-5);
}

@media (min-width: 48rem) {
  .compare-facts {
    grid-template-columns: 1fr 1fr;
  }
}

.fn-ref {
  margin-left: 0.15em;
  font-size: var(--font-size-xs);
}

.footnotes {
  padding-left: var(--space-5);
  font-size: var(--font-size-sm);
  overflow-wrap: anywhere;
}

.footnotes li {
  margin-bottom: var(--space-2);
}

.signal-missing {
  color: var(--text-muted);
  font-style: italic;
}

.signals-list .signal-note {
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  margin: 0;
}

.edge-label {
  padding: 0 var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: 400;
  color: var(--text-muted);
}

ol.competitor-chips {
  list-style: none;
}

.competitor-differs {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.feature-list {
  list-style: none;
  margin: 0 0 var(--space-3);
  padding: 0;
  display: grid;
  gap: var(--space-3);
}

.feature-list li p {
  margin: 0 0 var(--space-1);
}

.feature-quote {
  margin: 0;
  padding-left: var(--space-3);
  border-left: 3px solid var(--border);
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.feature-quote p {
  margin: 0;
}

.fm-figure {
  font-size: var(--font-size-xs);
  white-space: nowrap;
}

.category-matrix thead th {
  white-space: normal;
  min-width: 6.5rem;
  vertical-align: bottom;
}

.category-matrix .sig-cell {
  font-size: var(--font-size-xs);
  white-space: nowrap;
}

.directory-section {
  padding: var(--space-5) 0 0;
}

.use-case-groups {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}

.use-case-group-name {
  margin: 0 0 var(--space-1);
  font-weight: 600;
}

.plain-inline-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  list-style: none;
  margin: 0;
  padding: 0;
}

.az-group h3 {
  margin: var(--space-3) 0 var(--space-1);
}

.az-group p {
  margin: 0;
}

/* Logo (D-30): the name is live text in the display face. */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  color: var(--text);
  line-height: 1;
}

.logo svg {
  flex-shrink: 0;
  display: block;
}

.logo-name {
  font-family: var(--font-display, var(--font-sans));
  font-size: calc(var(--logo-size, 24px) * 0.75);
  font-weight: var(--weight-bold);
  letter-spacing: -0.01em;
}

.logo-name span {
  font-weight: var(--weight-medium);
  color: var(--text-muted);
}

/* Logo name sizes: set by data-size, since the CSP allows no style attribute. */
.logo[data-size='22'] { --logo-size: 22px; }
.logo[data-size='24'] { --logo-size: 24px; }
.logo[data-size='44'] { --logo-size: 44px; }

.logo-tile-lg {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-lg);
}

.logo-tile-lg .logo-tile-mono {
  font-size: var(--font-size-2xl);
}

/* ============================= Anchors ============================= */

.directory-section,
.az-group,
.use-case-groups li,
#letters {
  scroll-margin-top: calc(var(--header-height) + var(--space-4));
}

/* ============================= Home hero and bands (T21) ============================= */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
  font-size: var(--font-size-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.hero {
  padding: var(--space-7) var(--gutter) var(--space-6);
  text-align: center;
}

.hero-inner {
  max-width: 48rem;
  margin: 0 auto;
}

.hero h1 {
  margin: 0 0 var(--space-4);
  font-size: clamp(2.5rem, 7vw, var(--font-size-4xl));
  font-weight: var(--weight-medium);
  line-height: 1.05;
}

.hero-lead {
  margin: 0 auto var(--space-5);
  max-width: 40rem;
  font-size: var(--font-size-base);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
}

.band {
  padding: 5rem 0;
}

.band-sunken {
  background: var(--surface-sunken);
}

.band .page-container {
  padding-bottom: 0;
}

.band h2 {
  margin: 0 0 var(--space-5);
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: var(--weight-medium);
}

.band .match-demo {
  max-width: 40rem;
  margin: 0 auto;
}

@media (min-width: 64rem) {
  .hero {
    padding-top: 6rem;
    padding-bottom: 4rem;
  }

  .band {
    padding: 6rem 0;
  }

  .home-steps,
  .home-who {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
  }
}

/* ============================= Directory (T21) ============================= */

.dir-hero {
  padding: var(--space-7) 0 var(--space-5);
  text-align: center;
}

.dir-hero h1 {
  margin: 0 0 var(--space-3);
  font-size: clamp(2.375rem, 6vw, 3.9rem);
  font-weight: var(--weight-medium);
  line-height: 1.1;
}

.dir-hero-lead {
  margin: 0 auto var(--space-5);
  max-width: 40rem;
  font-size: var(--font-size-lg);
}

.search-fallback {
  margin: var(--space-2) 0 0;
  text-align: center;
  font-size: var(--font-size-sm);
}

.dir-divider {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-5) 0 var(--space-4);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.dir-divider::before,
.dir-divider::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--border);
}

.cat-tiles {
  list-style: none;
  margin: 0 0 var(--space-6);
  padding: 0 0 var(--space-2);
  display: flex;
  gap: var(--space-4);
  overflow-x: auto;
}

.cat-tiles li {
  flex: 0 0 15rem;
}

.cat-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  min-height: 8rem;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  text-align: center;
  text-decoration: none;
}

.cat-tile:hover,
.cat-tile-first {
  border-color: var(--accent);
  background: var(--card);
}

.cat-tile-name {
  font-size: var(--font-size-lg);
  font-weight: var(--weight-semibold);
  line-height: 1.3;
  color: var(--text-heading);
}

.cat-tile-count {
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: var(--border-soft);
  font-size: 0.8125rem;
  font-weight: var(--weight-semibold);
  line-height: 20px;
  color: var(--text);
}

@media (min-width: 75rem) {
  .cat-tiles {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    overflow-x: visible;
  }
}

.dir-layout {
  display: grid;
  gap: var(--space-5);
}

.dir-rail {
  display: none;
}

.dir-rail-heading {
  margin: 0 0 var(--space-2);
  font-size: var(--font-size-lg);
  font-weight: var(--weight-semibold);
  color: var(--text-heading);
}

.dir-rail-list {
  list-style: none;
  margin: 0 0 var(--space-5);
  padding: 0;
}

.dir-rail-list a {
  display: block;
  padding: 10px var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  line-height: 20px;
  color: var(--text);
  text-decoration: none;
}

.dir-rail-list a:hover {
  background: var(--surface-sunken);
  color: var(--accent);
}

.dir-list {
  min-width: 0;
}

.dir-list .directory-section:first-child {
  padding-top: 0;
}

.dir-list h2 {
  margin: 0 0 var(--space-1);
  font-family: var(--font-sans);
  font-size: var(--font-size-xl);
  font-weight: var(--weight-bold);
}

.app-grid-dir {
  margin-top: var(--space-4);
  gap: 10px 30px;
}

@media (min-width: 64rem) {
  .dir-layout {
    grid-template-columns: 19rem 1fr;
    gap: 30px;
    align-items: start;
  }

  .dir-rail {
    display: block;
    position: sticky;
    top: calc(var(--header-height) + var(--space-4));
  }
}

/* Competitor rows carry the competitor's logo tile beside its name (D-31). */
.competitor-name {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
