.hrx-library {
  --hrx-bg: #080808;
  --hrx-bg-2: #111111;
  --hrx-surface: #171717;
  --hrx-surface-2: #202020;
  --hrx-border: #333333;
  --hrx-border-strong: #4a4a4a;
  --hrx-text: #f7f7f2;
  --hrx-muted: #a7a7a0;
  --hrx-yellow: #FFED00;
  --hrx-yellow-text: #101010;
  --hrx-green: #45d483;
  --hrx-red: #ff5f6d;
  --hrx-cyan: #54d7e8;
  --hrx-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(255, 237, 0, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    var(--hrx-bg);
  background-size: 56px 56px;
  color: var(--hrx-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

.hrx-library *,
.hrx-library *::before,
.hrx-library *::after {
  box-sizing: border-box;
}

.hrx-library button,
.hrx-library input,
.hrx-library select {
  font: inherit;
}

.hrx-library button {
  letter-spacing: 0;
}

.hrx-loading {
  padding: 48px 24px;
  color: var(--hrx-muted);
  text-align: center;
}

.hrx-icon {
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.hrx-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  border-bottom: 1px solid var(--hrx-border);
  background: rgba(8, 8, 8, 0.92);
  backdrop-filter: blur(16px);
  padding: 0 max(20px, calc((100vw - 1320px) / 2));
}

.hrx-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.hrx-brand__mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 237, 0, 0.5);
  border-radius: 8px;
  background: var(--hrx-yellow);
  color: var(--hrx-yellow-text);
  font-weight: 950;
}

.hrx-brand strong,
.hrx-brand small {
  display: block;
}

.hrx-brand strong {
  font-size: 15px;
  line-height: 1.1;
}

.hrx-brand small {
  color: var(--hrx-muted);
  font-size: 12px;
}

.hrx-topbar__filter,
.hrx-mobile-filter {
  display: none;
}

.hrx-main {
  width: min(100% - 40px, 1320px);
  margin: 0 auto;
  padding: 28px 0 64px;
}

.hrx-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  align-items: end;
  gap: 28px;
  border-bottom: 1px solid var(--hrx-border);
  padding: 26px 0 30px;
}

.hrx-kicker {
  margin: 0 0 8px;
  color: var(--hrx-yellow);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.hrx-hero h1 {
  max-width: 780px;
  margin: 0;
  color: var(--hrx-text);
  font-size: clamp(34px, 5vw, 64px);
  line-height: 0.98;
  letter-spacing: 0;
}

.hrx-hero__text {
  max-width: 650px;
  margin: 16px 0 0;
  color: var(--hrx-muted);
  font-size: 18px;
}

.hrx-hero__panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  border: 1px solid var(--hrx-border);
  border-radius: 8px;
  background: rgba(23, 23, 23, 0.88);
  padding: 10px;
}

.hrx-hero__panel div {
  min-width: 0;
  border: 1px solid var(--hrx-border);
  border-radius: 8px;
  background: #101010;
  padding: 14px 12px;
}

.hrx-hero__panel strong {
  display: block;
  color: var(--hrx-yellow);
  font-size: 28px;
  line-height: 1;
}

.hrx-hero__panel span {
  display: block;
  margin-top: 6px;
  color: var(--hrx-muted);
  font-size: 12px;
  font-weight: 700;
}

.hrx-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  align-items: start;
  gap: 26px;
  padding-top: 26px;
}

.hrx-filter-rail {
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.hrx-filters {
  border: 1px solid var(--hrx-border);
  border-radius: 8px;
  background: rgba(17, 17, 17, 0.94);
  box-shadow: var(--hrx-shadow);
}

.hrx-filters__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--hrx-border);
  padding: 16px;
}

.hrx-filters__head strong,
.hrx-filters__head span {
  display: block;
}

.hrx-filters__head strong {
  font-size: 16px;
}

.hrx-filters__head span {
  color: var(--hrx-muted);
  font-size: 12px;
}

.hrx-filters__head button,
.hrx-filters__close {
  border: 1px solid var(--hrx-border);
  border-radius: 8px;
  background: var(--hrx-surface-2);
  color: var(--hrx-text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 10px;
}

.hrx-filter-group {
  border-bottom: 1px solid var(--hrx-border);
  padding: 12px 16px 14px;
}

.hrx-filter-group:last-child {
  border-bottom: 0;
}

.hrx-filter-group summary {
  color: var(--hrx-text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 850;
}

.hrx-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
}

.hrx-advanced-stack {
  display: grid;
  gap: 14px;
  padding-top: 12px;
}

.hrx-advanced-group {
  display: grid;
  gap: 8px;
}

.hrx-advanced-group > span {
  color: var(--hrx-muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.hrx-advanced-group .hrx-chip-grid {
  padding-top: 0;
}

.hrx-chip,
.hrx-active-chip,
.hrx-view,
.hrx-empty button,
.hrx-apply {
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease, transform 150ms ease;
}

.hrx-chip {
  border: 1px solid var(--hrx-border);
  background: #202020;
  color: var(--hrx-text);
  font-size: 13px;
  font-weight: 750;
  padding: 7px 10px;
}

.hrx-chip:hover,
.hrx-active-chip:hover {
  border-color: rgba(255, 237, 0, 0.55);
}

.hrx-chip.is-selected {
  border-color: var(--hrx-yellow);
  background: var(--hrx-yellow);
  color: var(--hrx-yellow-text);
}

.hrx-results {
  min-width: 0;
}

.hrx-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.hrx-search {
  position: relative;
}

.hrx-search .hrx-icon {
  position: absolute;
  top: 50%;
  left: 13px;
  color: var(--hrx-muted);
  transform: translateY(-50%);
}

.hrx-search input,
.hrx-sort select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--hrx-border);
  border-radius: 8px;
  background: var(--hrx-surface);
  color: var(--hrx-text);
  outline: none;
}

.hrx-search input {
  padding: 10px 14px 10px 42px;
}

.hrx-search input:focus,
.hrx-sort select:focus {
  border-color: var(--hrx-yellow);
}

.hrx-sort {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--hrx-muted);
  font-size: 13px;
  font-weight: 800;
}

.hrx-sort select {
  min-width: 190px;
  background-color: var(--hrx-surface);
  color: var(--hrx-text);
  color-scheme: dark;
  -webkit-text-fill-color: var(--hrx-text);
  padding: 10px;
}

.hrx-sort select option {
  background: #171717;
  color: var(--hrx-text);
}

.hrx-active-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.hrx-active-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(255, 237, 0, 0.28);
  background: rgba(255, 237, 0, 0.09);
  color: var(--hrx-yellow);
  font-size: 13px;
  font-weight: 800;
  padding: 7px 10px;
}

.hrx-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.hrx-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 22px;
  border: 1px solid var(--hrx-border);
  border-radius: 8px;
  background: var(--hrx-surface);
  padding: 12px;
}

.hrx-pagination span {
  color: var(--hrx-muted);
  font-size: 13px;
  font-weight: 800;
}

.hrx-pagination div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.hrx-pagination button {
  min-width: 36px;
  min-height: 34px;
  border: 1px solid var(--hrx-border);
  border-radius: 8px;
  background: #202020;
  color: var(--hrx-text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
  padding: 6px 10px;
}

.hrx-pagination button.is-active {
  border-color: var(--hrx-yellow);
  background: var(--hrx-yellow);
  color: var(--hrx-yellow-text);
}

.hrx-pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.hrx-card {
  display: flex;
  min-width: 0;
  min-height: 100%;
  flex-direction: column;
  border: 1px solid var(--hrx-border);
  border-radius: 8px;
  background: rgba(23, 23, 23, 0.96);
  padding: 18px;
  transition: border-color 150ms ease, transform 150ms ease, background 150ms ease;
}

.hrx-card:hover {
  border-color: rgba(255, 237, 0, 0.5);
  background: #1c1c1c;
  transform: translateY(-2px);
}

.hrx-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hrx-level,
.hrx-intensity {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 900;
  padding: 4px 9px;
}

.hrx-level--beginner {
  border: 1px solid rgba(69, 212, 131, 0.35);
  background: rgba(69, 212, 131, 0.09);
  color: var(--hrx-green);
}

.hrx-level--intermediate {
  border: 1px solid rgba(84, 215, 232, 0.35);
  background: rgba(84, 215, 232, 0.09);
  color: var(--hrx-cyan);
}

.hrx-level--advanced {
  border: 1px solid rgba(255, 95, 109, 0.35);
  background: rgba(255, 95, 109, 0.09);
  color: var(--hrx-red);
}

.hrx-intensity {
  background: #242424;
  color: var(--hrx-muted);
}

.hrx-card h2 {
  margin: 14px 0 0;
  color: var(--hrx-text);
  font-size: 22px;
  line-height: 1.14;
  letter-spacing: 0;
}

.hrx-card > p {
  display: -webkit-box;
  min-height: 44px;
  margin: 10px 0 0;
  overflow: hidden;
  color: var(--hrx-muted);
  font-size: 14px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.hrx-metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  margin-top: 16px;
}

.hrx-metrics div {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: var(--hrx-muted);
  font-size: 13px;
  font-weight: 700;
}

.hrx-metrics span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hrx-metrics .hrx-icon {
  color: var(--hrx-yellow);
}

.hrx-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
  margin-top: 16px;
  margin-bottom: 14px;
}

.hrx-card-tags span {
  flex: 0 1 auto;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--hrx-border);
  border-radius: 8px;
  background: #222222;
  color: var(--hrx-text);
  font-size: 12px;
  font-weight: 800;
  padding: 5px 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hrx-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
  margin-bottom: 14px;
}

.hrx-tags span {
  border: 1px solid var(--hrx-border);
  border-radius: 8px;
  background: #222222;
  color: var(--hrx-text);
  font-size: 12px;
  font-weight: 800;
  padding: 5px 8px;
}

.hrx-tags--large span {
  font-size: 13px;
  padding: 7px 10px;
}

.hrx-view {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  align-self: flex-start;
  width: auto;
  min-height: 36px;
  margin-top: auto;
  border: 1px solid var(--hrx-yellow);
  background: var(--hrx-yellow);
  color: var(--hrx-yellow-text);
  font-size: 13px;
  font-weight: 950;
  padding: 7px 12px;
}

.hrx-view:hover {
  transform: translateY(-1px);
}

.hrx-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.68);
}

.hrx-drawer,
.hrx-detail {
  position: fixed;
  z-index: 50;
  background: var(--hrx-bg-2);
  box-shadow: var(--hrx-shadow);
}

.hrx-drawer--filters {
  inset: 0 0 0 auto;
  width: min(420px, 100vw);
  overflow: auto;
  border-left: 1px solid var(--hrx-border);
  padding: 16px;
}

.hrx-drawer--filters .hrx-filters {
  box-shadow: none;
}

.hrx-filters__close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
}

.hrx-apply {
  width: 100%;
  min-height: 46px;
  margin-top: 14px;
  border: 1px solid var(--hrx-yellow);
  background: var(--hrx-yellow);
  color: var(--hrx-yellow-text);
  font-weight: 950;
}

.hrx-detail {
  inset: 28px 28px 28px auto;
  width: min(720px, calc(100vw - 56px));
  overflow: auto;
  border: 1px solid var(--hrx-border);
  border-radius: 8px;
}

.hrx-detail__bar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  justify-content: flex-end;
  border-bottom: 1px solid var(--hrx-border);
  background: rgba(17, 17, 17, 0.96);
  padding: 10px;
}

.hrx-detail__close {
  all: unset;
  box-sizing: border-box !important;
  display: grid !important;
  place-items: center !important;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  max-width: 32px !important;
  max-height: 32px !important;
  border: 1px solid var(--hrx-border);
  border-radius: 8px;
  background: #232323;
  color: var(--hrx-text);
  cursor: pointer;
  line-height: 1 !important;
  padding: 0 !important;
}

.hrx-detail__close .hrx-icon {
  width: 14px !important;
  height: 14px !important;
}

.hrx-detail__hero {
  border-bottom: 1px solid var(--hrx-border);
  background: #141414;
  padding: 28px;
}

.hrx-detail__hero h2 {
  margin: 18px 0 0;
  color: var(--hrx-text);
  font-size: clamp(28px, 6vw, 48px);
  line-height: 1;
  letter-spacing: 0;
}

.hrx-detail__hero p {
  margin: 14px 0 0;
  color: var(--hrx-muted);
  font-size: 16px;
}

.hrx-detail__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.hrx-detail__stats div,
.hrx-variants article,
.hrx-block-list {
  border: 1px solid var(--hrx-border);
  border-radius: 8px;
  background: #1b1b1b;
}

.hrx-detail__stats div {
  min-width: 0;
  padding: 12px;
}

.hrx-detail__stats span,
.hrx-variants span {
  display: block;
  color: var(--hrx-yellow);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.hrx-detail__stats strong {
  display: block;
  margin-top: 6px;
  color: var(--hrx-text);
  font-size: 14px;
  line-height: 1.25;
}

.hrx-detail-section {
  padding: 24px 28px 0;
}

.hrx-detail-section:last-child {
  padding-bottom: 28px;
}

.hrx-detail-section h3 {
  margin: 0 0 12px;
  color: var(--hrx-text);
  font-size: 18px;
}

.hrx-block-list {
  margin-bottom: 12px;
  padding: 14px;
}

.hrx-block-list h4 {
  margin: 0 0 10px;
  color: var(--hrx-yellow);
  font-size: 13px;
  text-transform: uppercase;
}

.hrx-structured-list {
  display: grid;
  gap: 10px;
}

.hrx-plain-step {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  color: var(--hrx-muted);
}

.hrx-plain-step span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(255, 237, 0, 0.12);
  color: var(--hrx-yellow);
  font-size: 12px;
  font-weight: 950;
}

.hrx-plain-step p {
  margin: 2px 0 0;
}

.hrx-round-group {
  border: 1px solid rgba(255, 237, 0, 0.22);
  border-radius: 8px;
  background: rgba(255, 237, 0, 0.055);
  padding: 12px;
}

.hrx-round-group strong {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 8px;
  background: var(--hrx-yellow);
  color: var(--hrx-yellow-text);
  font-size: 12px;
  font-weight: 950;
  padding: 4px 9px;
  text-transform: uppercase;
}

.hrx-round-group ul {
  display: grid;
  gap: 7px;
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--hrx-muted);
}

.hrx-round-group li::marker {
  color: var(--hrx-yellow);
}

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

.hrx-variants article {
  padding: 14px;
}

.hrx-variants p {
  margin: 8px 0 0;
  color: var(--hrx-muted);
}

.hrx-empty {
  display: grid;
  place-items: center;
  min-height: 360px;
  border: 1px solid var(--hrx-border);
  border-radius: 8px;
  background: var(--hrx-surface);
  padding: 36px;
  text-align: center;
}

.hrx-empty .hrx-icon {
  width: 42px;
  height: 42px;
  color: var(--hrx-muted);
}

.hrx-empty h2 {
  margin: 14px 0 0;
}

.hrx-empty p {
  max-width: 430px;
  color: var(--hrx-muted);
}

.hrx-empty button {
  border: 1px solid var(--hrx-yellow);
  background: var(--hrx-yellow);
  color: var(--hrx-yellow-text);
  font-weight: 950;
  padding: 10px 14px;
}

@media (max-width: 1180px) {
  .hrx-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hrx-detail__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .hrx-topbar {
    padding-inline: 18px;
  }

  .hrx-topbar__filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    border: 1px solid var(--hrx-border);
    border-radius: 8px;
    background: var(--hrx-surface);
    color: var(--hrx-text);
    cursor: pointer;
    font-weight: 900;
    padding: 8px 12px;
  }

  .hrx-main {
    width: min(100% - 28px, 1320px);
  }

  .hrx-hero {
    grid-template-columns: 1fr;
  }

  .hrx-hero__panel {
    max-width: 520px;
  }

  .hrx-layout {
    grid-template-columns: 1fr;
  }

  .hrx-filter-rail {
    display: none;
  }

  .hrx-toolbar {
    grid-template-columns: 1fr;
  }

  .hrx-mobile-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    border: 1px solid var(--hrx-border);
    border-radius: 8px;
    background: var(--hrx-surface);
    color: var(--hrx-text);
    cursor: pointer;
    font-weight: 900;
  }

  .hrx-mobile-filter span {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    border-radius: 8px;
    background: var(--hrx-yellow);
    color: var(--hrx-yellow-text);
    font-size: 12px;
  }

  .hrx-sort {
    justify-content: space-between;
  }
}

@media (max-width: 740px) {
  .hrx-brand small {
    display: none;
  }

  .hrx-main {
    padding-top: 18px;
  }

  .hrx-hero {
    padding-top: 16px;
  }

  .hrx-hero h1 {
    font-size: clamp(32px, 12vw, 46px);
  }

  .hrx-hero__text {
    font-size: 16px;
  }

  .hrx-hero__panel,
  .hrx-card-grid,
  .hrx-variants,
  .hrx-detail__stats {
    grid-template-columns: 1fr;
  }

  .hrx-sort {
    align-items: stretch;
    flex-direction: column;
  }

  .hrx-sort select {
    min-width: 0;
  }

  .hrx-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .hrx-pagination div {
    justify-content: flex-start;
  }

  .hrx-drawer--filters {
    inset: auto 0 0;
    width: 100%;
    max-height: 86vh;
    border-top: 1px solid var(--hrx-border);
    border-left: 0;
  }

  .hrx-detail {
    inset: auto 0 0;
    width: 100%;
    max-height: 92vh;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 8px 8px 0 0;
  }

  .hrx-detail__hero {
    padding: 24px 18px;
  }

  .hrx-detail-section {
    padding-right: 18px;
    padding-left: 18px;
  }

  .hrx-card {
    padding: 16px;
  }
}
