.library {
  padding-bottom: 64px;
}

.lib-back { color: #326957; font-size: 14px; }

.lib-retry {
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid #8fb6a3;
  border-radius: 6px;
  background: #fff;
  color: #174c39;
  font: inherit;
  cursor: pointer;
}

.lib-retry:focus-visible {
  outline: 2px solid #2b9870;
  outline-offset: 2px;
}

.lib-notice {
  margin: 0 0 22px;
  padding: 12px 16px;
  background: #f3f7f4;
  border-left: 2px solid #8fb6a3;
  color: #4e6458;
  font-size: 13px;
  line-height: 1.7;
}

.lib-filters input:focus-visible,
.lib-filters select:focus-visible {
  outline: 2px solid #2b9870;
  outline-offset: 2px;
}

.lib-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 24px 0;
}

.lib-filters--products {
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

.lib-brand-toggle {
  display: none;
}

.lib-brand-filter {
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.lib-brand-filter > legend,
.lib-price-type-filter > legend {
  color: #263f34;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

.lib-brand-filter > legend,
.lib-price-type-filter > legend {
  margin-bottom: 8px;
  padding: 0;
}

.lib-brand-grid,
.lib-price-type-filter__choices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(164px, 1fr));
  gap: 7px 9px;
}

.lib-filters .lib-brand-choice {
  position: relative;
  display: block;
  cursor: pointer;
}

.lib-brand-choice input[type='checkbox'] {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  clip-path: inset(50%);
}

.lib-brand-choice__content,
.lib-price-type-option__label,
.lib-brand-toggle,
.lib-price-type-filter__toggle {
  box-sizing: border-box;
  min-height: 44px;
  padding: 6px 11px;
  border: 1px solid #e0e9e3;
  border-radius: 6px;
  background: #fff;
  color: #263f34;
  font-size: 14px;
  line-height: 1.35;
}

.lib-brand-toggle,
.lib-price-type-filter__toggle {
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: start;
  font-family: inherit;
  cursor: pointer;
}

.lib-price-type-filter__toggle { display: flex; }
.lib-price-type-filter--mobile-toggle > .lib-price-type-filter__toggle { display: none; }

:is(.lib-brand-toggle, .lib-price-type-filter__toggle)::after {
  content: '';
  flex: none;
  width: 7px;
  height: 7px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

:is(.lib-brand-toggle, .lib-price-type-filter__toggle)[aria-expanded='true']::after { transform: translateY(2px) rotate(225deg); }
:is(.lib-brand-toggle, .lib-price-type-filter__toggle):focus-visible { outline: 2px solid #2b9870; outline-offset: 2px; }

.lib-price-type-filter--toggle > .lib-price-type-filter__choices {
  max-block-size: min(50svh, 340px);
  overflow-y: auto;
  overscroll-behavior: contain;
  margin-top: 6px;
  padding: 6px;
  border: 1px solid #e0e9e3;
  border-radius: 6px;
}

.lib-price-type-filter--toggle > [aria-expanded='false'] + .lib-price-type-filter__choices { display: none; }

.lib-brand-choice__content,
.lib-price-type-option__label {
  display: flex;
  align-items: center;
  overflow-wrap: anywhere;
}

.lib-brand-choice__content {
  justify-content: space-between;
  gap: 8px;
}

.lib-brand-choice__count {
  color: #4e685b;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: end;
}


.lib-brand-choice:hover .lib-brand-choice__content,
.lib-price-type-option:hover .lib-price-type-option__label {
  border-color: #8fb6a3;
}

.lib-brand-choice input:checked + .lib-brand-choice__content,
.lib-price-type-option input:checked + .lib-price-type-option__label {
  border-color: #488a71;
  background: #eaf4ef;
  color: #154936;
  font-weight: 650;
}

.lib-brand-choice input:focus-visible + .lib-brand-choice__content,
.lib-price-type-option input:focus-visible + .lib-price-type-option__label {
  outline: 2px solid #2b9870;
  outline-offset: 2px;
}

.lib-price-type-filter {
  position: relative;
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.lib-price-type-option {
  position: relative;
  min-width: 0;
}

.lib-price-type-option label { height: 100%; cursor: pointer; }

.lib-price-type-option input[type='checkbox'] {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  clip-path: inset(50%);
}

.lib-price-type-option__label { height: 100%; }
.lib-price-type-option--has-help .lib-price-type-option__label { padding-inline-end: 44px; }

.lib-price-type-option__help {
  position: absolute;
  inset: 0 0 0 auto;
  display: grid;
  place-items: center;
  width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #356351;
  font: inherit;
  cursor: pointer;
}

.lib-price-type-option__help span {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.lib-price-type-option__help:hover,
.lib-price-type-option__help[aria-expanded='true'] { color: #154936; }

.lib-price-type-option__help:focus-visible {
  outline: 2px solid #2b9870;
  outline-offset: -4px;
}

.lib-price-type-filter__help {
  position: absolute;
  inset: 100% 0 auto;
  z-index: 2;
  max-inline-size: 760px;
  padding: 10px 13px;
  border: 1px solid #a9c2b6;
  border-radius: 6px;
  background: #f3f8f5;
  color: #263f34;
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.lib-filters label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  color: #52675c;
  font-size: 13px;
}

.lib-filters input,
.lib-filters select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid #d6e1da;
  border-radius: 6px;
  padding: 0 11px;
  background: #fff;
  color: #1d3228;
  font: inherit;
}

.lib-filters select { text-overflow: ellipsis; }

.lib-count {
  margin: 18px 0;
  color: #60736a;
  font-size: 13px;
}

.lib-list {
  border-top: 1px solid #dce6e0;
}

.lib-project,
.lib-price-row {
  padding: 19px 0;
  border-bottom: 1px solid #e1e9e4;
}

.lib-project {
  display: block;
}

.lib-project:hover h3 {
  color: #257b5d;
}

.lib-project h3,
.lib-price-row h3 {
  margin: 0 0 8px;
  color: #1b3327;
  font-size: 17px;
  line-height: 1.5;
}

.lib-meta {
  color: #60756a;
  font-size: 13px;
  line-height: 1.7;
}

.lib-detail {
  margin-top: 24px;
}

.lib-detail h2 {
  margin: 18px 0;
  font-size: clamp(23px, 2.5vw, 32px);
  line-height: 1.35;
}

.lib-detail-value {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  margin: 12px 0;
  color: #1d4937;
  font-size: 23px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.lib-detail > h3 {
  margin: 32px 0 12px;
  font-size: 19px;
}

.lib-detail > dl {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 12px 24px;
  font-size: 14px;
  line-height: 1.7;
}

.lib-detail > dl > dt {
  color: #6a7c72;
}

.lib-detail > dl > dd {
  margin: 0;
  color: #263d30;
  overflow-wrap: anywhere;
}

.lib-sources {
  display: grid;
  gap: 10px;
}

.lib-source {
  padding: 14px 16px;
  border: 1px solid #e1eae4;
  border-radius: 7px;
}

.lib-source a {
  color: #246d50;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.lib-source span {
  display: block;
  margin-top: 6px;
  color: #718178;
  font-size: 12px;
}

.lib-price-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
}

.lib-price-row > :first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.lib-quote-row {
  align-items: center;
  gap: clamp(14px, 2.5vw, 36px);
}

.lib-quote-row:has(> .lib-quote-actions) {
  grid-template-areas: 'info price' 'actions price';
  row-gap: 0;
}

.lib-quote-row:has(> .lib-quote-actions) > .lib-quote-info { grid-area: info; }
.lib-quote-row:has(> .lib-quote-actions) > .lib-value { grid-area: price; }
.lib-quote-row > .lib-quote-actions { grid-area: actions; }

.lib-quote-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 18px;
}

.lib-quote-actions > :is(a, button) {
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  line-height: 20px;
}

.lib-quote-favorite {
  gap: 6px;
  min-inline-size: 58px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #49665c;
  cursor: pointer;
}

.lib-quote-favorite__icon {
  flex: none;
  inline-size: 12px;
  block-size: 15px;
  background: currentColor;
  clip-path: polygon(evenodd, 0 0, 100% 0, 100% 100%, 50% 76%, 0 100%, 0 0, 12% 10%, 12% 83%, 50% 65%, 88% 83%, 88% 10%, 12% 10%);
}

.lib-quote-favorite:is(:hover, [aria-pressed='true']) { color: #14634e; }
.lib-quote-favorite:hover span:last-child { text-decoration: underline; text-underline-offset: 3px; }
.lib-quote-favorite[aria-pressed='true'] .lib-quote-favorite__icon {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 76%, 0 100%);
}
.lib-quote-favorite[aria-disabled='true'] { opacity: .55; cursor: wait; }
.lib-quote-favorite:focus-visible,
.lib-favorite-feedback :is(a, button):focus-visible { outline: 2px solid #20866d; outline-offset: 2px; }

.lib-favorite-feedback {
  position: fixed;
  z-index: 30;
  inset-inline: 16px;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: max-content;
  max-width: calc(100% - 32px);
  min-height: 48px;
  gap: 12px;
  margin-inline: auto;
  padding: 2px 14px;
  border: 1px solid #d5e1dc;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 16px #173b321c;
  color: #213b31;
  font-size: 14px;
}

.lib-favorite-feedback[hidden] { display: none; }
.lib-favorite-feedback :is(a, button) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 4px;
  border: none;
  background: transparent;
  color: #176b57;
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.lib-quote-row .lib-value {
  position: relative;
  color: #1d4937;
  font-size: clamp(22px, 1.85vw, 28px);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
  text-align: right;
  white-space: nowrap;
}

.lib-quote-row .lib-type {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 4px);
}

.lib-type {
  color: #52715f;
  font-size: 12px;
  font-weight: 500;
}

.lib-link {
  color: #287255;
  font-size: 13px;
}

.lib-quote-row a:is(.lib-quote-title, .lib-quote-model, .lib-quote-amount) {
  color: inherit;
}

.lib-quote-row a:is(.lib-quote-title, .lib-quote-model) {
  text-underline-offset: .2em;
}

.lib-quote-row a.lib-quote-model {
  text-decoration: underline;
  text-decoration-color: #afc7b8;
}

.lib-quote-row a.lib-quote-amount {
  text-decoration: none;
}

.lib-quote-row a:is(.lib-quote-title, .lib-quote-model, .lib-quote-amount):is(:hover, :focus-visible) {
  color: #126f5b;
}

.lib-quote-row a:is(.lib-quote-title, .lib-quote-model):is(:hover, :focus-visible) {
  text-decoration-color: currentColor;
  text-decoration-line: underline;
}

.lib-empty {
  padding: 42px 0;
  color: #65796e;
  line-height: 1.8;
}

.lib-error {
  color: #984438;
}

.lib-access {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  padding: 22px 24px;
  margin: 24px 0;
  border: 1px solid #dce8e1;
  border-radius: 8px;
  background: #f3f8f5;
}

.lib-access h3 { margin: 0; color: #173b32; font-size: 18px; }
.lib-access p { margin: 4px 0 0; color: #486457; font-size: 14px; line-height: 1.6; }
.lib-access .lib-access-action {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  flex: none;
  padding: 0 18px;
  border-radius: 6px;
  background: #17654f;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.lib-access .lib-access-action:hover { background: #124e3d; }
.lib-access .lib-access-action:focus-visible { outline: 2px solid #207d64; outline-offset: 3px; }

.lib-price-fog {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-height: clamp(340px, 32vw, 410px);
  overflow: hidden;
  padding: 20px;
  background: #f9fbf9;
}

.lib-price-fog__rows {
  position: absolute;
  inset: 0;
  overflow: hidden;
  filter: blur(4.5px);
  opacity: .76;
  user-select: none;
  pointer-events: none;
}

.lib-price-fog::after {
  position: absolute;
  inset: 0;
  content: '';
  background: linear-gradient(180deg, rgba(249, 251, 249, .18), rgba(249, 251, 249, .62) 59%, #fff);
  pointer-events: none;
}

.lib-access.lib-price-fog__prompt {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 18px;
  width: min(440px, 100%);
  margin: 0;
  padding: 25px 20px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 38px rgba(23, 59, 50, .08);
  text-align: center;
}

.lib-price-fog__prompt h3 { font-size: 21px; }
.lib-price-fog__prompt p { margin-top: 8px; white-space: pre-line; }

@media (max-width: 760px) {
  .library { padding-bottom: 44px; }
  .lib-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lib-filters:not(.lib-filters--products) label:first-child { grid-column: 1 / -1; }
  .lib-filters--products { grid-template-columns: minmax(0, 1fr); gap: 16px; margin-block: 18px 20px; }
  .lib-brand-toggle,
  .lib-price-type-filter--mobile-toggle > .lib-price-type-filter__toggle { display: flex; }
  .lib-brand-grid,
  .lib-price-type-filter--mobile-toggle > .lib-price-type-filter__choices {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: min-content;
    max-block-size: min(50svh, 340px);
    overflow-y: auto;
    overscroll-behavior: contain;
    margin-top: 6px;
    padding: 6px;
    border: 1px solid #e0e9e3;
    border-radius: 6px;
  }
  .lib-brand-toggle[aria-expanded='false'] + .lib-brand-grid,
  .lib-price-type-filter--mobile-toggle > [aria-expanded='false'] + .lib-price-type-filter__choices { display: none; }
  .lib-price-type-filter__choices { grid-template-columns: minmax(0, 1fr); }
  .lib-detail > dl { grid-template-columns: 90px minmax(0, 1fr); gap: 10px 14px; }
  .lib-price-row { grid-template-columns: minmax(0, 1fr); }
  .lib-project h3, .lib-price-row h3 { font-size: 16px; }
  .lib-quote-row { gap: 7px; padding-block: 15px; }
  .lib-quote-row:has(> .lib-quote-actions) { grid-template-areas: 'info' 'price' 'actions'; row-gap: 5px; }
  .lib-quote-row h3 { margin-bottom: 5px; }
  .lib-quote-row .lib-value { font-size: 22px; text-align: left; white-space: normal; }
  .lib-quote-row .lib-type { position: static; margin-top: 2px; }
  .lib-access { align-items: flex-start; flex-direction: column; padding: 18px; }
  .lib-price-fog { min-height: 380px; padding-inline: 14px; }
  .lib-access.lib-price-fog__prompt { max-width: 296px; }
}

.lib-equipment-group { grid-column: 1 / -1; margin-top: 8px; color: #64746c; font-size: 13px; font-weight: 600; }
