/* Recipe UI ownership: Library. Responsive rules stay with this owner. */

.library-results-shell {
  padding: 1.25rem 1.5rem 1.5rem;
}

.library-widget {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.library-hero {
  padding: 1.05rem 1.4rem 1.2rem;
}

.library-hero-intro {
  max-width: 46rem;
  margin: 0 auto 0.7rem;
  text-align: center;
}

.library-hero h1 {
  margin: 0;
  font-family: "EB Garamond", Georgia, serif;
  font-weight: 600;
  font-size: var(--recipe-font-display);
  letter-spacing: 0.01em;
}

.library-search-shell {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0.75rem auto 0;
  text-align: left;
}

.library-search-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(7.8rem, 8.6rem);
  gap: 0.45rem;
  align-items: end;
}

.library-search-field {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.library-search-input,
.library-search-select {
  height: 2.3rem;
  min-height: 2.3rem;
  border-radius: var(--recipe-radius-small);
  border: 1px solid color-mix(in srgb, var(--recipe-ink) 10%, transparent);
  background: var(--recipe-surface);
  box-shadow: none;
  box-sizing: border-box;
}

.library-search-input {
  padding-inline: 0.72rem;
  font-size: var(--recipe-font-compact);
}

.library-search-input:focus,
.library-search-select:focus,
.library-filter-select:focus,
.library-filter-input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--recipe-ink) 26%, transparent);
  box-shadow: none;
}

.library-search-select {
  padding: 0 1.7rem 0 0.6rem;
  font-size: var(--recipe-font-metadata);
}

.library-search-submit {
  height: 2.3rem;
  min-height: 2.3rem;
  padding: 0 0.85rem;
  border-radius: var(--recipe-radius-small);
  white-space: nowrap;
  background: var(--recipe-ink);
  border-color: var(--recipe-ink);
  box-shadow: none;
  font-size: var(--recipe-font-metadata);
  line-height: 1;
}

.library-search-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  justify-content: center;
}

.library-status-toggle {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
  justify-content: center;
}

.library-tool-btn {
  min-height: 2rem;
  padding: 0.3rem 0.68rem;
  border-radius: var(--recipe-radius-small);
  border: 1px solid color-mix(in srgb, var(--recipe-ink) 10%, transparent);
  background: var(--recipe-surface);
  box-shadow: none;
  font-weight: 600;
  font-size: var(--recipe-font-metadata);
  letter-spacing: 0.02em;
}

.library-tool-btn:hover {
  border-color: color-mix(in srgb, var(--recipe-ink) 18%, transparent);
  background: var(--recipe-surface);
  transform: none;
}

.library-status-btn.active {
  background: var(--recipe-ink);
  color: var(--recipe-surface);
  border-color: var(--recipe-ink);
}

.library-tool-btn__label {
  opacity: 0.78;
}

.library-tool-btn__value {
  font-weight: 600;
}

.library-filter-panel {
  margin-top: 0.2rem;
  padding: 1rem 1.05rem;
  border: 1px solid color-mix(in srgb, var(--recipe-ink) 10%, transparent);
  border-radius: var(--recipe-radius-small);
  background: var(--recipe-surface);
  box-shadow: var(--recipe-shadow-overlay);
  text-align: left;
}

.library-filter-grid {
  display: grid;
  grid-template-columns: minmax(15rem, 1fr) minmax(18rem, 1.3fr);
  gap: 1rem;
}

.library-filter-group {
  padding: 0.75rem;
  border-radius: var(--recipe-radius-medium);
  border: 1px solid color-mix(in srgb, var(--recipe-ink) 6%, transparent);
  background: var(--recipe-warning-wash);
  box-shadow: none;
}

.library-filter-group--full {
  grid-column: 1 / -1;
}

.library-filter-group-head {
  margin-bottom: 0.85rem;
}

.library-filter-heading {
  display: block;
  margin: 0 0 0.35rem;
  font-size: var(--recipe-font-metadata);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--recipe-ink);
}

.library-filter-copy {
  margin: 0;
  font-size: var(--recipe-font-control);
  color: var(--gray-4);
  line-height: 1.45;
}

.library-filter-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.library-filter-chip {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}

.library-filter-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.library-filter-chip span {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--recipe-radius-small);
  border: 1px solid color-mix(in srgb, var(--recipe-ink) 8%, transparent);
  background: var(--recipe-surface);
  box-shadow: none;
  font-weight: 600;
  font-size: var(--recipe-font-metadata);
  color: var(--ink);
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.library-filter-chip:hover span {
  transform: none;
  border-color: color-mix(in srgb, var(--recipe-ink) 18%, transparent);
}

.library-filter-chip input:checked + span {
  background: var(--recipe-ink);
  border-color: var(--recipe-ink);
  box-shadow: none;
  color: var(--recipe-surface);
}

.library-filter-stack {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.library-filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.library-filter-select,
.library-filter-input {
  min-height: 2.45rem;
  border-radius: var(--recipe-radius-small);
  border: 1px solid color-mix(in srgb, var(--recipe-ink) 10%, transparent);
  background: var(--recipe-surface);
  box-shadow: none;
}

.library-filter-input {
  padding-inline: 0.8rem;
}

.library-filter-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding-top: 0.95rem;
  border-top: 1px solid color-mix(in srgb, var(--recipe-information) 8%, transparent);
}

.library-filter-clear {
  min-height: 2.45rem;
  padding-inline: 0.95rem;
  border-radius: var(--recipe-radius-status);
  font-weight: 700;
}

@media (max-width: 840px) {
.library-results-shell {
    padding: 1rem;
  }

.library-search-main {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

.library-search-submit {
    width: 100%;
  }

.library-filter-grid {
    grid-template-columns: 1fr;
  }

.library-filter-group--full {
    grid-column: auto;
  }
}

.filter-picker-dropdown .library-filter-grid {
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.filter-picker-dropdown .library-filter-group--full {
  grid-column: auto;
}

.library-hero.recipe-hero {
  padding: 1rem 1.25rem 1.05rem;
}

.library-hero .library-hero-intro {
  margin-bottom: 0.55rem;
}

.library-hero h1 {
  font-size: var(--recipe-font-display);
}

.library-hero .library-search-shell {
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.library-hero .library-search-main {
  grid-template-columns: minmax(14rem, 1fr) auto;
  gap: 0.4rem;
}

.library-hero .library-search-input,
.library-hero .library-search-select,
.library-hero .library-search-submit {
  height: 2.05rem;
  min-height: 2.05rem;
  border-radius: var(--recipe-radius-medium);
  font-size: var(--recipe-font-metadata);
}

.library-hero .library-search-submit {
  padding: 0 0.75rem;
  letter-spacing: 0;
}

.library-hero .library-search-submit::before,
.library-hero .library-tool-btn::before {
  display: none;
}

.library-hero .library-search-tools {
  justify-content: flex-start;
  gap: 0.35rem;
  max-width: 900px;
  margin: 0 auto;
}

.library-hero .library-status-toggle {
  gap: 0.12rem;
  padding: 0.15rem;
  border: 1px solid color-mix(in srgb, var(--recipe-ink) 10%, transparent);
  border-radius: var(--recipe-radius-medium);
  background: var(--recipe-canvas);
}

.library-hero .library-tool-btn {
  min-height: 1.8rem;
  padding: 0.22rem 0.55rem;
  border-radius: var(--recipe-radius-medium);
  box-shadow: none;
  font-size: var(--recipe-font-metadata);
  line-height: 1;
  letter-spacing: 0;
}

.library-hero .library-status-toggle .library-tool-btn {
  border-color: transparent;
  background: transparent;
}

.library-hero .library-tool-btn:not(.library-status-btn) {
  background: var(--recipe-surface);
}

.library-hero .library-tool-btn:hover {
  transform: none;
  box-shadow: none;
}

.library-widget {
  gap: 0.75rem;
}

.library-results-shell {
  padding: 1rem 1.15rem 1.25rem;
}

.library-widget .lib-tabs {
  justify-content: flex-start;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid color-mix(in srgb, var(--recipe-ink) 8%, transparent);
}

.library-widget .lib-list {
  gap: 0.6rem;
}

.library-widget .lib-item {
  border-width: 1px;
  border-radius: var(--recipe-radius-medium);
  padding: 0.85rem 1rem;
  box-shadow: var(--recipe-shadow-surface);
}

.library-widget .lib-item::before,
.library-widget .lib-item::after {
  display: none;
}

.library-widget .lib-item:hover {
  transform: none;
  box-shadow: var(--recipe-shadow-surface);
}

.library-widget .lib-title {
  margin-bottom: 0.4rem;
  font-size: var(--recipe-font-subheading);
}

.library-widget .lib-meta {
  gap: 0.4rem;
}

.library-widget .lib-chip {
  padding: 0.25rem 0.55rem;
  border-width: 1px;
  font-size: var(--recipe-font-metadata);
}

.library-widget .lib-actions {
  margin-top: 0.8rem;
  padding-top: 0.75rem;
  gap: 0.45rem;
}

.library-widget .lib-action {
  padding: 0.32rem 0.65rem;
  border-radius: var(--recipe-radius-medium);
  font-size: var(--recipe-font-metadata);
}

@media (max-width: 840px) {
.page-library .library-hero.recipe-hero {
    margin-bottom: 0.55rem;
    padding: 0.7rem 0.9rem;
  }

.page-library .library-hero .library-search-shell {
    gap: 0.35rem;
    margin-top: 0;
  }

.page-library .library-results-shell {
    padding: 0.75rem 0.85rem 0.9rem;
  }

.page-library .library-widget {
    gap: 0.55rem;
  }

.page-library .library-widget .lib-tabs {
    margin-bottom: 0.55rem;
    padding-bottom: 0.5rem;
  }

.library-hero .library-search-main {
    grid-template-columns: 1fr;
  }

.library-hero .library-search-tools {
    justify-content: flex-start;
  }

.library-hero .library-status-toggle,
  .library-hero .library-tool-btn:not(.library-status-btn),
  .library-hero .month-picker-trigger-wrap,
  .library-hero .filter-picker-trigger-wrap {
    width: 100%;
  }

.library-hero .library-search-tools {
    width: 100%;
  }

.library-hero .library-status-toggle .library-tool-btn {
    flex: 1 1 0;
  }

.library-hero .month-picker-trigger-wrap .library-tool-btn,
  .library-hero .filter-picker-trigger-wrap .library-tool-btn {
    width: 100%;
  }

.library-hero .library-search-submit {
    display: none;
  }

.library-hero .library-search-shell--query-active .library-search-submit {
    display: block;
  }

.library-hero .library-graph-tool {
    display: none;
  }

.library-widget .lib-list {
    gap: 0.5rem;
  }

.library-widget .lib-item.recipe-card {
    display: grid;
    grid-template-columns: 5rem minmax(0, 1fr);
    gap: 0.7rem;
    align-items: start;
    padding: 0.65rem 0.75rem;
  }

.library-widget .lib-item.recipe-card .thumb-container {
    width: 5rem;
    height: 5rem;
    flex-basis: 5rem;
  }

.library-widget .lib-body {
    display: grid;
    gap: 0.35rem;
  }

.library-widget .lib-card-title-row {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 0.55rem;
  }

.library-widget .lib-title {
    margin: 0;
    font-size: var(--recipe-font-body);
    line-height: 1.15;
  }

.library-widget .lib-desc,
  .library-widget .library-mobile-hidden {
    display: none;
  }

.library-widget .lib-actions {
    display: flex;
    margin-top: 0.15rem;
    padding-top: 0.35rem;
  }

.library-widget .lib-actions > * {
    display: none;
  }

.library-widget .lib-actions > a.view-details-link {
    display: inline-flex;
  }

.library-widget .lib-meta {
    gap: 0.28rem;
  }

.library-widget .lib-chip {
    max-width: 100%;
    padding: 0.2rem 0.48rem;
    border-radius: var(--recipe-radius-status);
    font-size: var(--recipe-font-metadata);
    line-height: 1.1;
  }
}

@media (max-width: 640px) {
.library-hero .library-search-main {
    grid-template-columns: 1fr;
    gap: 0.42rem;
  }
}

@media (max-width: 840px) {
.page-library #main-content {
    margin-top: 0.55rem;
  }
}
