/* COSYtools hub: filters, sections, status badges (markup generated by scripts/generate_hub.js) */
[hidden] { display: none !important; }

.engines-hub-page .hero.ref-hero {
  width: min(1200px, calc(100% - 2rem));
  max-width: none;
  margin: 0 auto 1rem;
  padding: 1.1rem 1.5rem 1.2rem;
  color: #fff;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(17, 28, 23, 0.1);
  background:
    radial-gradient(ellipse at 82% 18%, rgba(255, 255, 255, 0.16), transparent 38%),
    linear-gradient(135deg, #1d3529 0%, #335f48 48%, #416b49 100%);
}

.engines-hub-page .ref-hero h1 {
  color: #fff;
  font-size: 2.2rem;
  line-height: 1.06;
  margin: 0;
}

.engines-hub-page .ref-hero p {
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.05rem;
  margin-bottom: 1.2rem;
}

.engines-hub-page .cosy-hero-logo {
  width: 56px !important;
  height: 56px !important;
  margin-bottom: 0.5rem !important;
}

.engines-hub-page .cosy-hero-logo,
.engines-hub-page .hero-tag,
.engines-hub-page .hero-hub-subtext {
  display: none;
}

.engines-hub-page .hero-tag {
  margin-bottom: 0.4rem;
}

.engines-hub-page .hero-steps-container {
  display: none;
}

.engines-hub-page .hero-centered-panel {
  gap: 0.6rem;
}

.engines-hub-page .ref-search-container {
  width: min(720px, 100%);
  min-width: 0;
  margin: 1rem auto 0;
}

.engines-hub-page .ref-search-input {
  min-height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  box-shadow: 0 10px 22px rgba(15, 35, 25, 0.16);
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
}

.engines-hub-page .category-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 1.75rem 0 0.7rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
}

.engines-hub-page .hub-section {
  margin-top: 2.25rem;
}

.engines-hub-page .hub-section .category-header {
  margin-top: 0;
}

.engines-hub-page .engines-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
  gap: 0.85rem;
}

.engines-hub-page .engine-card {
  min-width: 0;
  min-height: 205px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 1.1rem 1rem;
  border: 1px solid rgba(65, 107, 73, 0.12);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(250,247,242,0.96));
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(35, 56, 39, 0.05);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.engines-hub-page .engine-card:hover {
  transform: translateY(-3px);
  border-color: rgba(65, 107, 73, 0.32);
  box-shadow: 0 16px 30px rgba(35, 56, 39, 0.1);
}

.engine-card-top {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
}

.engine-icon {
  width: 2.5rem;
  height: 2.5rem;
  flex: 0 0 2.5rem;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--sage-mist);
  color: var(--sage-dark);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}

.hub-lang-code {
  display: inline-grid;
  place-items: center;
  min-width: 1.55rem;
  height: 1.4rem;
  margin-right: 0.1rem;
  border-radius: 4px;
  background: var(--sage-mist);
  color: var(--sage-dark);
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}

.engines-hub-page .hub-section .category-header .cosy-icon {
  width: 1.1rem;
  height: 1.1rem;
  color: var(--cosy-ink-sage);
}

.engines-hub-page .ref-card-icon .cosy-icon {
  width: 1.35rem;
  height: 1.35rem;
}

.engines-hub-page .cosy-ecosystem-strip .cosy-icon {
  width: 0.85rem;
  height: 0.85rem;
}

.engine-title-area {
  min-width: 0;
}

.engine-title-area h3 {
  margin: 0 0 0.45rem;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.02rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.engine-subtitle {
  gap: 0.35rem;
}

.card-lang-tag,
.card-type-tag,
.status-badge {
  font-size: 0.72rem;
  line-height: 1.4;
}

.engine-desc {
  margin: 0.8rem 0 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.5;
}

.engine-cta-btn {
  color: var(--sage-dark);
  font-size: 0.84rem;
  font-weight: 700;
}

.engine-card:hover .engine-cta-btn {
  color: var(--cosy-tools-accent, var(--sage-dark));
}

.filter-section {
  display: grid;
  gap: 0.55rem;
  margin: 0.85rem 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(65, 107, 73, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 6px 18px rgba(31, 43, 34, 0.03);
}

.hub-primary-languages {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: stretch;
}

.hub-primary-languages .filter-label {
  grid-column: 1 / -1;
}

.hub-primary-languages .fpill {
  justify-content: flex-start;
  min-width: 0;
}

.hub-secondary-options {
  border-top: 1px solid rgba(65, 107, 73, 0.1);
  padding-top: 0.45rem;
}

.hub-secondary-options > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 36px;
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.hub-secondary-options > summary::-webkit-details-marker {
  display: none;
}

.hub-secondary-options > summary::after {
  content: "+";
  color: var(--sage-dark);
  font-size: 1.1rem;
}

.hub-secondary-options[open] > summary::after {
  content: "-";
}

.hub-secondary-options[open] > .filter-row {
  margin-top: 0.45rem;
}

.hub-secondary-options:focus-within > summary,
.hub-secondary-options > summary:focus-visible {
  outline: 3px solid var(--sage, #2d6a4f);
  outline-offset: 3px;
}

.hub-core-tools {
  margin: 1.25rem 0;
}

.hub-language-prompt {
  margin: 0.8rem 0 1.2rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

#hub-tool-results[hidden] {
  display: none !important;
}

.filter-label {
  flex: 0 0 auto;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 700;
}

.filter-section .fpill.active {
  background: var(--cosy-tools-accent, var(--sage-dark));
  border-color: var(--cosy-tools-accent, var(--sage-dark));
}

.engine-card[data-status="stub"] {
  opacity: 1;
  border-style: dashed;
  background: color-mix(in srgb, var(--surface-color) 85%, var(--cream-dark));
}

/* Hero Task Guidance */
.hero-steps-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  margin: 1rem auto 1.5rem auto;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.92);
}
.hero-step {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 500;
}
.hero-step .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.4);
}
.hero-step-sep { opacity: 0.6; color: rgba(255, 255, 255, 0.7); }

/* Mobile Touch Targets & Filter Usability */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}
.fpill {
  min-height: 38px;
  min-width: 44px;
  padding: 0.4rem 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.hub-filter-meta { justify-content: space-between; gap: 1rem; align-items: center; }
.hub-dev-toggle { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; font-size: 0.9rem; cursor: pointer; color: var(--ink-soft, #555); }
.hub-dev-toggle input { width: 1.15rem; height: 1.15rem; accent-color: var(--cosy-ink-sage, #2d6a4f); }
.hub-dev-count { opacity: 0.7; }
.hub-result-count { font-size: 0.95rem; font-weight: 700; color: var(--sage-dark, #1b4332); }

.engines-hub-page #hub > .page {
  width: min(1200px, 100%);
  padding: 0 1rem 3rem;
}

.engines-hub-page .sd-sticky-header {
  box-shadow: 0 4px 14px rgba(29, 53, 41, 0.05);
}

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

/* Focus States */
.fpill:focus-visible,
.engine-card:focus-visible,
.ref-card:focus-visible,
.hub-dev-toggle input:focus-visible,
#cosy-ui-language-select:focus-visible,
#hub-search-input:focus-visible {
  outline: 3px solid var(--sage, #2d6a4f);
  outline-offset: 3px;
}

/* Card Badges & Indicators */
.engine-subtitle { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.2rem; }
.card-lang-tag { font-size: 0.8rem; font-weight: 600; color: var(--ink-soft, #555); }
.card-type-tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--sage-dark, #1b4332);
  background: var(--sage-mist, #eaf2eb);
  padding: 0.1rem 0.55rem;
  border-radius: 6px;
}

.status-badge {
  display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  border: 1px solid currentColor;
}
.status-beta { color: #8a5a00; background: #fff4d6; border-color: #d99b00; }
.status-stub { color: #555; background: #f0f0f0; border-color: #ccc; }

[data-theme="dark"] .card-type-tag { color: #81c784; background: #1e3323; }
[data-theme="dark"] .status-beta { color: #ffd479; background: #3a2d0b; border-color: #8a5a00; }
[data-theme="dark"] .status-stub { color: #ccc; background: #333; border-color: #555; }

.engine-card[data-status="stub"] { opacity: 0.88; border-style: dashed; }
.hub-section + .hub-section { margin-top: 0.5rem; }

/* Mobile Layout Responsive Refinements */
@media (max-width: 600px) {
  .hub-filter-meta { flex-direction: column; align-items: flex-start; gap: 0.5rem; }

  .engines-hub-page .cosy-ecosystem-strip {
    height: 32px;
    min-height: 32px;
    padding: 0;
  }

  .engines-hub-page .cosy-strip-brand,
  .engines-hub-page .cosy-strip-links {
    display: none !important;
  }

  .engines-hub-page .cosy-strip-inner {
    justify-content: flex-end;
    padding: 0 0.5rem;
  }

  .engines-hub-page .cosy-theme-toggle-btn {
    min-height: 28px;
    padding: 0.1rem 0.4rem;
    font-size: 0.72rem;
  }

  .engines-hub-page .sd-header-inner {
    flex-wrap: nowrap;
    gap: 0.35rem;
    padding: 0.3rem 0.6rem;
  }

  .engines-hub-page .sd-breadcrumbs .sep,
  .engines-hub-page .sd-breadcrumbs .current,
  .engines-hub-page .cosy-ui-lang-switcher .ui-lang-label {
    display: none !important;
  }

  .engines-hub-page .sd-jump-links {
    flex: 0 1 auto;
    gap: 0.1rem !important;
  }

  .engines-hub-page .sd-jump-link {
    min-height: 32px !important;
    padding: 0.15rem 0.4rem;
    font-size: 0.72rem;
  }

  .engines-hub-page .cosy-ui-lang-switcher .styled-sel {
    width: 84px;
    max-width: 84px !important;
    font-size: 0.72rem !important;
    padding: 0.15rem 0.25rem !important;
  }

  .engines-hub-page .hub-language-prompt {
    display: none;
  }

  .engines-hub-page .hero.ref-hero {
    width: calc(100% - 1rem);
    margin-bottom: 0.65rem;
    padding: 0.9rem 0.85rem 0.8rem;
  }

  .engines-hub-page .cosy-hero-logo,
  .engines-hub-page .hero-tag,
  .engines-hub-page .ref-hero p {
    display: none;
  }

  .engines-hub-page .ref-hero h1 {
    margin: 0;
    font-size: 1.7rem;
    line-height: 1.12;
  }

  .engines-hub-page .ref-search-container {
    margin-top: 0.7rem;
  }

  .engines-hub-page .ref-search-input {
    min-height: 48px;
  }

  .engines-hub-page .filter-section {
    margin-top: 0.6rem !important;
    margin-bottom: 0.8rem !important;
    padding: 0.7rem;
  }

  .engines-hub-page .filter-row:not(.hub-filter-meta) {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 0.2rem 0.1rem 0.45rem;
    scrollbar-width: thin;
  }

  .engines-hub-page .filter-row:not(.hub-filter-meta) .fpill {
    flex: 0 0 auto;
    min-height: 44px;
  }

  .engines-hub-page .hub-primary-languages {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
    padding: 0;
  }

  .engines-hub-page .hub-primary-languages .fpill {
    justify-content: flex-start;
    white-space: normal;
  }

  .hub-secondary-options .filter-row:not(.hub-filter-meta) {
    flex-wrap: wrap;
    overflow: visible;
  }

  .engines-hub-page #hub > .page {
    padding-right: 0.75rem;
    padding-left: 0.75rem;
  }

  .engines-hub-page .engines-grid {
    grid-template-columns: 1fr;
  }

  .engines-hub-page .engine-card {
    min-height: 0;
  }
}

html.is-embedded body.engines-hub-page .hero.ref-hero {
  width: 100%;
  margin: 0 0 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 0;
  box-shadow: none;
}

html.is-embedded body.engines-hub-page .cosy-hero-logo,
html.is-embedded body.engines-hub-page .hero-tag,
html.is-embedded body.engines-hub-page .hero-hub-subtext {
  display: none;
}

html.is-embedded body.engines-hub-page .ref-hero h1 {
  margin: 0;
  font-size: 1.5rem;
}

html.is-embedded body.engines-hub-page .ref-search-container {
  margin-top: 0.65rem;
}

html.is-embedded body.engines-hub-page #hub > .page {
  padding: 0 0.65rem 0.75rem;
}

/* Daily board on the hub: full-width section above the tool filters. */
.daily-home-section {
  margin: 0 0 1.75rem;
}

.daily-home-section .daily-board {
  padding: clamp(1rem, 2.4vw, 1.75rem);
}

.daily-home-link {
  margin: 0.6rem 0 0;
  text-align: right;
}

.daily-home-link a {
  font-weight: 700;
  color: var(--cosy-ink-sage, #2d6a4f);
  text-decoration: none;
}

.daily-home-link a:hover,
.daily-home-link a:focus-visible {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .daily-home-section .daily-board-head {
    gap: 0.9rem;
  }

  .daily-home-section .daily-board-progress {
    width: 100%;
    min-width: 0;
  }
}

/* ── Product identity ─────────────────────────────────────────────────────
   The hub cards take their corner and lift from the product layer, so the
   `professional` identity on <body> drives them instead of a fixed choice. */
[data-product] .engine-card {
  border-radius: var(--cosy-product-radius, 8px);
  box-shadow: var(--cosy-product-shadow, var(--cosy-shadow-sm));
}

/* The hero display face follows the product identity too; the page rule is
   more specific than the generic [data-product] h1 rule in the tokens. */
body[data-product] .ref-hero h1 {
  font-family: var(--cosy-product-display);
  font-weight: var(--cosy-product-display-weight);
  letter-spacing: var(--cosy-product-tracking);
  line-height: var(--cosy-product-leading);
}
