/* The complete directory shares the homepage catalog, icons and theme. */
.hd-library { padding-bottom: 3rem; }
.hd-library-hero { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: 2.25rem 0 2rem; }
.hd-library-hero .hd-kicker { margin-bottom: .75rem; font-size: .72rem; letter-spacing: .14em; }
.hd-library-hero h1 { margin: 0; font-size: clamp(2rem, 4.2vw, 3.4rem); font-weight: 780; letter-spacing: -.045em; line-height: 1.12; }
.hd-library-lead { margin: 1rem 0 0; color: var(--hd-muted); font-size: 1rem; line-height: 1.7; }
.hd-library-stats { display: flex; gap: 2rem; padding: .5rem 0 .5rem 2rem; border-left: 1px solid var(--hd-line); }
.hd-library-stats > div { display: grid; gap: .25rem; min-width: 75px; }
.hd-library-stats strong { font-size: 2.5rem; font-weight: 750; letter-spacing: -.05em; line-height: 1; }
.hd-library-stats span { color: var(--hd-muted); font-size: .8rem; }
.hd-library-search { display: none; align-items: center; gap: 1rem; min-height: 66px; padding: .5rem 1.25rem; border: 1px solid var(--hd-line); border-radius: 12px; background: var(--hd-surface); box-shadow: 0 3px 12px rgb(16 32 51 / 3%); }
.hd-js .hd-library-search { display: flex; }
.hd-library-search:focus-within { border-color: var(--hd-focus); outline: 2px solid var(--hd-focus); outline-offset: 2px; }
.hd-library-search label { display: flex; flex: 1; min-width: 0; align-items: center; gap: .9rem; }
.hd-library-search svg { width: 22px; height: 22px; flex: none; color: var(--hd-muted); }
.hd-library-search input { width: 100%; min-width: 0; min-height: 44px; border: 0; outline: none !important; color: var(--hd-ink); background: transparent; font-size: .95rem; }
.hd-library-search input::placeholder { color: var(--hd-muted); opacity: 1; }
.hd-library-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.hd-library-search-clear { display: grid; place-items: center; width: 40px; height: 40px; flex: none; padding: 0; border: 0; border-radius: 7px; background: var(--hd-canvas); cursor: pointer; }
.hd-library-search-clear[hidden] { display: none; }
.hd-library-search-note { flex: none; color: var(--hd-muted); font-size: .75rem; border-left: 1px solid var(--hd-line); padding-left: 1rem; }
.hd-library-layout { display: grid; grid-template-columns: 215px minmax(0, 1fr); gap: 2.5rem; align-items: start; margin-top: 2.5rem; scroll-margin-top: 1rem; }
.hd-library-sidebar { position: sticky; top: 1rem; min-width: 0; max-height: calc(100vh - 2rem); overflow-y: auto; scrollbar-width: thin; }
.hd-library-navigation summary { display: flex; align-items: center; gap: .5rem; min-height: 36px; padding: 0 .75rem .75rem; color: var(--hd-muted); font-size: .7rem; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; list-style: none; cursor: pointer; }
.hd-library-navigation summary::-webkit-details-marker { display: none; }
.hd-library-navigation summary > svg { width: 16px; height: 16px; margin-left: auto; transition: transform .15s; }
.hd-library-navigation[open] summary > svg { transform: rotate(180deg); }
.hd-library-mobile-selection { display: none; }
.hd-library-filter { display: flex; align-items: center; gap: .6rem; min-height: 44px; margin-bottom: .25rem; padding: .5rem .75rem; border: 1px solid transparent; border-radius: 8px; color: var(--hd-muted) !important; font-size: .85rem; font-weight: 600; text-decoration: none; }
.hd-library-filter:hover { color: var(--hd-ink) !important; background: var(--hd-surface); }
.hd-library-filter[aria-current] { color: var(--hd-brand-dark) !important; border-color: color-mix(in srgb, var(--hd-brand) 16%, var(--hd-line)); background: var(--hd-soft-brand); }
.hd-library-filter-icon { display: flex; }
.hd-library-filter-icon svg { width: 18px; height: 18px; }
.hd-library-filter-count { margin-left: auto; min-width: 24px; text-align: right; color: var(--hd-muted); font-size: .75rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.hd-library-subcategories { margin: .25rem 0 0 1.3rem; padding-left: .6rem; border-left: 1px solid var(--hd-line); }
.hd-library-subcategories .hd-library-filter { min-height: 38px; padding-left: .65rem; font-size: .8rem; font-weight: 500; }
.hd-library-feedback { margin: 1.75rem .75rem .5rem; padding-top: 1.25rem; border-top: 1px solid var(--hd-line); }
.hd-library-feedback-icon { color: var(--hd-brand-dark); font-size: 1.6rem; }
.hd-library-feedback p { margin: .5rem 0 .25rem; font-size: .8rem; color: var(--hd-muted); }
.hd-library-feedback a { font-size: .8rem; font-weight: 650; text-decoration: none; }
.hd-library-feedback a:hover { text-decoration: underline; }
.hd-library-results { min-width: 0; }
.hd-library-results-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding-bottom: 1.5rem; border-bottom: 1px solid var(--hd-line); }
.hd-library-results-heading h2 { margin: 0; font-size: 1.3rem; font-weight: 750; letter-spacing: -.025em; }
.hd-library-results-heading p { margin: .3rem 0 0; color: var(--hd-muted); font-size: .8rem; overflow-wrap: anywhere; }
.hd-library-results-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem 1rem; flex: none; align-items: center; color: var(--hd-muted); font-size: .8rem; }
.hd-library-results-meta button { min-height: 36px; padding: .25rem 0; border: 0; background: none; color: var(--hd-brand-dark); font-size: .8rem; font-weight: 650; cursor: pointer; }
.hd-library-results-meta button[hidden] { display: none; }
.hd-library-group { padding: 1.75rem 0 2rem; scroll-margin-top: 1rem; }
.hd-library-group + .hd-library-group { border-top: 1px solid var(--hd-line); }
.hd-library-group-heading { display: flex; align-items: center; gap: .8rem; margin-bottom: 1.15rem; }
.hd-library-group-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 10px; background: var(--hd-soft-brand); color: var(--hd-brand-dark); }
.hd-library-group-icon svg { width: 21px; height: 21px; }
.hd-library-group-heading > div { min-width: 0; }
.hd-library-group-heading h2 { margin: 0; font-size: 1.05rem; font-weight: 700; letter-spacing: -.015em; }
.hd-library-group-heading p { margin: .25rem 0 0; color: var(--hd-muted); font-size: .77rem; line-height: 1.6; }
.hd-library-group-heading > a { display: inline-flex; align-items: center; gap: .4rem; flex: none; margin-left: auto; color: var(--hd-brand-dark) !important; font-size: .75rem; font-weight: 650; text-decoration: none; }
.hd-library-group-heading > a:hover { text-decoration: underline; }
.hd-library-group-heading > a svg { width: 16px; height: 16px; }
.hd-library-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.hd-library-card { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 175px; padding: 1.1rem; border: 1px solid var(--hd-line); border-radius: 11px; background: var(--hd-surface); text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
.hd-library-card:hover { border-color: var(--hd-brand); box-shadow: 0 4px 14px rgb(16 32 51 / 5%); transform: translateY(-2px); }
.hd-library-card-icon { display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: .85rem; border-radius: 9px; background: var(--hd-soft-brand); color: var(--hd-brand-dark); }
.hd-library-card-icon svg { width: 21px; height: 21px; }
.hd-library-developer .hd-library-card-icon, .hd-library-developer .hd-library-group-icon { color: var(--hd-blue); background: color-mix(in srgb, var(--hd-blue) 9%, var(--hd-surface)); }
.hd-library-productivity .hd-library-card-icon, .hd-library-productivity .hd-library-group-icon { color: var(--hd-ink); background: var(--hd-surface-muted); }
.hd-library-card h3, .hd-library-card h4 { margin: 0 0 .4rem; font-size: .88rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.45; overflow-wrap: anywhere; }
.hd-library-card p { margin: 0; color: var(--hd-muted); font-size: .77rem; line-height: 1.65; }
.hd-library-card-arrow { position: absolute; right: 1rem; top: 1.15rem; color: var(--hd-muted); }
.hd-library-card-arrow svg { width: 17px; height: 17px; }
.hd-library-card:hover .hd-library-card-arrow { color: var(--hd-brand-dark); }
.hd-library-topic { margin-top: 1.5rem; scroll-margin-top: 1rem; }
.hd-library-topic-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .8rem; }
.hd-library-topic-heading h3 { margin: 0; font-size: .9rem; font-weight: 650; }
.hd-library-topic-heading > span { color: var(--hd-muted); font-size: .72rem; }
.hd-library-empty { padding: 4rem 1.5rem; margin-top: 1.75rem; border: 1px dashed var(--hd-line); border-radius: 12px; text-align: center; background: var(--hd-surface); }
.hd-library-empty-icon { display: grid; place-items: center; width: 64px; height: 64px; margin: auto; color: var(--hd-brand-dark); background: var(--hd-soft-brand); border-radius: 50%; font-size: 2.5rem; }
.hd-library-empty h2 { margin: 1.25rem 0 .5rem; font-size: 1.3rem; letter-spacing: -.025em; }
.hd-library-empty p { margin: 0 auto 1.5rem; color: var(--hd-muted); font-size: .88rem; line-height: 1.7; }
.hd-library-empty button { display: block; min-height: 44px; margin: 0 auto 1rem; padding: .6rem 1.1rem; border: 0; border-radius: 8px; background: var(--hd-brand); color: var(--hd-surface); font-weight: 650; cursor: pointer; }
.hd-library-empty a { color: var(--hd-brand-dark) !important; font-size: .8rem; }
.hd-library-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; }
.hd-library [hidden] { display: none !important; }
@media (max-width: 1100px) {
  .hd-library-layout { grid-template-columns: 195px minmax(0, 1fr); gap: 1.75rem; }
  .hd-library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hd-library-group-heading p { max-width: 40ch; }
}
@media (max-width: 899px) {
  .hd-library-layout { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; margin-top: 1.5rem; }
  .hd-library-sidebar { position: static; max-height: none; overflow: visible; }
  .hd-library-navigation { border: 1px solid var(--hd-line); border-radius: 10px; background: var(--hd-surface); }
  .hd-library-navigation summary { min-height: 52px; padding: .75rem 1rem; text-transform: none; letter-spacing: 0; font-size: .83rem; font-weight: 600; }
  .hd-library-mobile-selection { display: block; margin-left: auto; color: var(--hd-brand-dark); font-size: .75rem; }
  .hd-library-navigation summary > svg { margin-left: .35rem; }
  .hd-library-navigation nav { padding: 0 .5rem .5rem; }
  .hd-library-subcategories { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: .5rem; padding: .5rem 0 0; border-left: 0; border-top: 1px solid var(--hd-line); }
  .hd-library-feedback { display: none; }
  .hd-library-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hd-library-stats { gap: 1.25rem; padding-left: 1.25rem; }
  .hd-library-stats strong { font-size: 2rem; }
}
@media (max-width: 700px) {
  .hd-library-hero { padding-top: 1.5rem; gap: 1.5rem; }
  .hd-library-stats { display: none; }
  .hd-library-search-note { display: none; }
  .hd-library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hd-library-group-heading > a { font-size: 0; }
  .hd-library-group-heading > a svg { width: 20px; height: 20px; }
  .hd-library-results-meta { max-width: 45%; }
  .hd-library-card { padding: 1rem; }
  .hd-library-wide-only { display: none; }
}
@media (max-width: 480px) {
  .hd-library-hero { padding-bottom: 1.5rem; }
  .hd-library-lead { font-size: .9rem; }
  .hd-library-search { min-height: 58px; gap: .5rem; padding: .35rem .8rem; }
  .hd-library-search label { gap: .6rem; }
  .hd-library-search input { font-size: .82rem; }
  .hd-library-search svg { width: 20px; height: 20px; }
  .hd-library-search-clear { width: 32px; height: 36px; }
  .hd-library-results-heading { align-items: flex-start; padding-bottom: 1.25rem; }
  .hd-library-results-heading h2 { font-size: 1.15rem; }
  .hd-library-group { padding: 1.5rem 0; }
  .hd-library-group-heading { gap: .65rem; }
  .hd-library-group-heading h2 { font-size: .98rem; }
  .hd-library-group-heading p { display: none; }
  .hd-library-grid { grid-template-columns: minmax(0, 1fr); gap: .65rem; }
  .hd-library-card { display: grid; grid-template-columns: 38px minmax(0, 1fr) 16px; align-items: start; gap: .8rem; min-height: 0; padding: 1rem; }
  .hd-library-card-icon { width: 38px; height: 38px; margin: .1rem 0 0; }
  .hd-library-card-arrow { position: static; margin-top: .3rem; }
  .hd-library-card h3, .hd-library-card h4 { font-size: .9rem; }
  .hd-library-card p { font-size: .78rem; }
  .hd-library-topic-heading h3 { font-size: .85rem; }
  .hd-library-empty { padding: 2.5rem 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .hd-library-card, .hd-library-navigation summary > svg { transition: none; }
  .hd-library-card:hover { transform: none; }
}
