.bib-wrap,
.bib-wrap * {
  box-sizing: border-box;
}

.bib-wrap {
  --bib-font: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --bib-display-font: "Fraunces", "Georgia", serif;
  --bib-font-size: 16px;
  --bib-header-title-size: 48px;
  --bib-header-subtitle-size: 17px;
  --bib-card-title-size: 18px;
  --bib-author-size: 15px;
  --bib-meta-size: 14px;
  --bib-detail-title-size: 32px;
  --bib-detail-subtitle-size: 20px;
  --bib-button-size: 14px;
  --bib-kicker-size: 11px;
  --bib-label-size: 14px;
  --bib-input-size: 16px;
  --bib-stat-value-size: 24px;
  --bib-stat-label-size: 12px;
  --bib-summary-count-size: 17px;
  --bib-summary-meta-size: 14px;
  --bib-pagination-size: 14px;
  --bib-empty-size: 17px;
  --bib-detail-text-size: 16px;
  --bib-detail-summary-size: 16px;
  --bib-excerpt-size: 14px;
  --bib-autocomplete-size: 15px;
  --bib-advanced-label-size: 13px;
  --bib-link-size: 15px;
  --bib-loading-size: 14px;
  --bib-tech-size: 15px;
  --bib-font-title: "Fraunces", "Georgia", serif;
  --bib-font-subtitle: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --bib-font-author: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --bib-font-meta: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --bib-font-button: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --bib-font-kicker: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --bib-font-excerpt: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --bib-font-tech: ui-monospace, Menlo, Consolas, "Liberation Mono", "Courier New", monospace;
  --bib-font-label: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --bib-font-input: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --bib-font-stat-value: "Fraunces", "Georgia", serif;
  --bib-font-stat-label: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --bib-font-summary-count: "Fraunces", "Georgia", serif;
  --bib-font-summary-meta: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --bib-font-pagination: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --bib-font-empty: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --bib-font-detail-text: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --bib-font-detail-summary: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --bib-font-autocomplete: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --bib-font-link: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --bib-font-advanced: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --bib-font-loading: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --bib-weight-base: 500;
  --bib-weight-title: 700;
  --bib-weight-subtitle: 600;
  --bib-weight-author: 600;
  --bib-weight-meta: 600;
  --bib-weight-button: 700;
  --bib-weight-kicker: 700;
  --bib-weight-excerpt: 500;
  --bib-weight-tech: 500;
  --bib-weight-label: 700;
  --bib-weight-input: 500;
  --bib-weight-stat-value: 700;
  --bib-weight-stat-label: 600;
  --bib-weight-summary-count: 700;
  --bib-weight-summary-meta: 600;
  --bib-weight-pagination: 600;
  --bib-weight-empty: 600;
  --bib-weight-detail-text: 500;
  --bib-weight-detail-summary: 500;
  --bib-weight-autocomplete: 500;
  --bib-weight-link: 600;
  --bib-weight-advanced: 700;
  --bib-weight-loading: 600;
  --bib-style-base: normal;
  --bib-style-title: normal;
  --bib-style-subtitle: normal;
  --bib-style-author: normal;
  --bib-style-meta: normal;
  --bib-style-button: normal;
  --bib-style-kicker: normal;
  --bib-style-excerpt: normal;
  --bib-style-tech: normal;
  --bib-style-label: normal;
  --bib-style-input: normal;
  --bib-style-stat-value: normal;
  --bib-style-stat-label: normal;
  --bib-style-summary-count: normal;
  --bib-style-summary-meta: normal;
  --bib-style-pagination: normal;
  --bib-style-empty: normal;
  --bib-style-detail-text: normal;
  --bib-style-detail-summary: normal;
  --bib-style-autocomplete: normal;
  --bib-style-link: normal;
  --bib-style-advanced: normal;
  --bib-style-loading: normal;
  --bib-text: #2a1f14;
  --bib-primary: #7a4b2e;
  --bib-primary-2: #c08b5a;
  --bib-primary-soft: rgba(122, 75, 46, 0.12);
  --bib-primary-soft-strong: rgba(122, 75, 46, 0.26);
  --bib-primary-focus: rgba(122, 75, 46, 0.2);
  --bib-primary-shadow: rgba(122, 75, 46, 0.25);
  --bib-primary-shadow-strong: rgba(122, 75, 46, 0.3);
  --bib-accent: #0d6b5b;
  --bib-accent-2: #3aa68b;
  --bib-accent-soft: rgba(13, 107, 91, 0.12);
  --bib-accent-soft-strong: rgba(13, 107, 91, 0.22);
  --bib-accent-2-soft: rgba(58, 166, 139, 0.12);
  --bib-accent-2-soft-strong: rgba(58, 166, 139, 0.22);
  --bib-accent-shadow: rgba(13, 107, 91, 0.25);
  --bib-accent-shadow-strong: rgba(13, 107, 91, 0.3);
  --bib-muted: #6f655b;
  --bib-info-text: #325f8e;
  --bib-info-soft: rgba(50, 95, 142, 0.12);
  --bib-info-soft-strong: rgba(50, 95, 142, 0.2);
  --bib-title-color: #2a1f14;
  --bib-subtitle-color: #6f655b;
  --bib-author-color: #325f8e;
  --bib-chip-color: #7a4b2e;
  --bib-chip-cota-color: #325f8e;
  --bib-card-button-text: #7a4b2e;
  --bib-card-button-border: #e7ddd0;
  --bib-card-button-bg: #ffffff;
  --bib-card-button-hover-bg: #f2e6d8;
  --bib-button-primary-text: #ffffff;
  --bib-button-outline-bg: #ffffff;
  --bib-button-outline-text: #2a1f14;
  --bib-pagination-disabled-text: #a3aab8;
  --bib-pagination-disabled-border: #d5dbe5;
  --bib-error-color: #b83b2d;
  --bib-tech-bg: #0a0a0a;
  --bib-tech-text: #e8e8e8;
  --bib-tech-copy-bg: #ffffff;
  --bib-tech-copy-text: #2a1f14;
  --bib-highlight-color: #ffea99;
  --bib-autocomplete-bg: #ffffff;
  --bib-excerpt-color: #6f655b;
  --bib-kicker-color: #6f655b;
  --bib-label-color: #6f655b;
  --bib-input-text-color: #2a1f14;
  --bib-input-bg-color: #fbfaf8;
  --bib-input-focus-bg-color: #ffffff;
  --bib-input-border-color: #e7ddd0;
  --bib-input-focus-border-color: #7a4b2e;
  --bib-link-clear-color: #6f655b;
  --bib-link-clear-hover-color: #7a4b2e;
  --bib-advanced-label-color: #7a4b2e;
  --bib-stat-value-color: #2a1f14;
  --bib-stat-label-color: #6f655b;
  --bib-summary-count-color: #2a1f14;
  --bib-summary-meta-color: #6f655b;
  --bib-pagination-text-color: #2a1f14;
  --bib-pagination-hover-color: #7a4b2e;
  --bib-pagination-active-bg: #7a4b2e;
  --bib-pagination-active-text: #ffffff;
  --bib-pagination-border-color: #e7ddd0;
  --bib-pagination-bg: #ffffff;
  --bib-pagination-hover-bg: #fbfaf8;
  --bib-pagination-disabled-bg: #ffffff;
  --bib-empty-text-color: #6f655b;
  --bib-loading-text-color: #2a1f14;
  --bib-autocomplete-text-color: #2a1f14;
  --bib-detail-text-color: #2a1f14;
  --bib-detail-summary-text-color: #2a1f14;
  --bib-surface-alt: #fbfaf8;
  --bib-bg: #f6f0e7;
  --bib-surface: #ffffff;
  --bib-border: #e7ddd0;
  --bib-cover-ratio: 2 / 3;
  --bib-cover-fit: contain;
  --bib-card-title-lines: 2;
  --bib-card-excerpt-lines: 3;
  --bib-pattern-size: 26px;
  --bib-wrap-max-width: 1200px;
  --bib-wrap-border-width: 1px;
  --bib-card-border-width: 1px;
  --bib-panel-shadow: 0 28px 60px rgba(25, 20, 14, 0.16);
  --bib-search-shadow: 0 16px 40px rgba(37, 26, 12, 0.12);
  --bib-stat-shadow: none;
  --bib-summary-shadow: none;
  --bib-card-hover-shadow: 0 28px 70px rgba(0, 0, 0, 0.2);
  --bib-detail-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  --bib-isbd-shadow: 0 14px 30px rgba(0, 0, 0, 0.08);
  --bib-discovery-shadow: 0 16px 36px rgba(0, 0, 0, 0.1);
  --bib-tech-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  --bib-copy-shadow: 0 6px 14px rgba(0, 0, 0, 0.1);
  --bib-autocomplete-shadow: 0 12px 28px rgba(30, 34, 90, 0.12);
  --bib-pattern-opacity: 0.35;
  --bib-ambient-opacity: 1;
  --bib-surface-glow: rgba(255, 255, 255, 0.75);
  --bib-pattern-dot: rgba(0, 0, 0, 0.04);
  --bib-pattern-grid: rgba(0, 0, 0, 0.06);
  --bib-card-gloss-light-opacity: 0.9;
  --bib-card-gloss-mid-opacity: 0.2;
  --bib-card-gloss-dark-opacity: 0.08;
  --bib-thumb-tint: rgba(0, 0, 0, 0.05);
  --bib-thumb-border: rgba(0, 0, 0, 0.06);
  --bib-wrap-radius: 28px;
  --bib-wrap-padding-y: 56px;
  --bib-wrap-padding-x: 24px;
  --bib-panel-radius: 24px;
  --bib-panel-padding: 24px;
  --bib-search-radius: 20px;
  --bib-search-padding: 20px;
  --bib-input-radius: 12px;
  --bib-button-radius: 10px;
  --bib-card-radius: 18px;
  --bib-stat-radius: 0;
  --bib-summary-radius: 0;
  --bib-advanced-radius: 16px;
  --bib-pagination-radius: 12px;
  --bib-empty-radius: 18px;
  --bib-detail-cover-radius: 18px;
  --bib-detail-summary-radius: 16px;
  --bib-tech-radius: 14px;
  --bib-autocomplete-radius: 12px;
  --bib-highlight-radius: 4px;
  --bib-isbd-radius: 18px;
  --bib-isbd-cover-radius: 14px;
  --bib-discovery-radius: 18px;
  --bib-discovery-item-radius: 14px;
  --bib-discovery-cover-radius: 10px;
  --bib-card-shadow: 0 22px 60px rgba(39, 26, 10, 0.18);
  --bib-card-padding: 10px;
  --bib-card-gap-row: 4px;
  --bib-card-gap-col: 12px;
  --bib-grid-cols: 3;
  --bib-grid-cols-md: 2;
  --bib-gap: 28px;
  --bib-density: 1;
  --bib-stagger: 60ms;
  --bib-loading-overlay-bg: rgba(255, 255, 255, 0.75);
  /* ── derived opacity tiers (overridden per-theme by PHP inline style) ─── */
  --bib-text-ghost:    rgba(42, 31, 20, 0.04);
  --bib-text-hairline: rgba(42, 31, 20, 0.08);
  --bib-text-thin:     rgba(42, 31, 20, 0.10);
  --bib-text-faint:    rgba(42, 31, 20, 0.14);
  --bib-text-dim:      rgba(42, 31, 20, 0.28);
  --bib-text-subtle:   rgba(42, 31, 20, 0.46);
  --bib-primary-glow:          rgba(122, 75, 46, 0.05);
  --bib-primary-border:        rgba(122, 75, 46, 0.34);
  --bib-surface-overlay:     rgba(255, 255, 255, 0.92);
  --bib-surface-hi:          rgba(255, 255, 255, 0.96);
  --bib-surface-alt-overlay: rgba(250, 248, 244, 0.82);
  --bib-surface-alt-hi:      rgba(250, 248, 244, 0.96);
  --bib-surface-soft:        rgba(250, 248, 244, 0.50);
  --bib-error-soft:          rgba(184, 59, 45, 0.16);
  --bib-detail-fact-cols: 2;
  --bib-detail-fact-cols-tablet: 2;
  --bib-detail-fact-cols-mobile: 1;
  font-family: var(--bib-font);
  font-weight: var(--bib-weight-base);
  font-style: var(--bib-style-base);
  font-size: var(--bib-font-size);
  color: var(--bib-text);
  max-width: var(--bib-wrap-max-width);
  margin: 0 auto;
  padding: var(--bib-wrap-padding-y) var(--bib-wrap-padding-x);
  background: var(--bib-bg);
  border: none;
  border-radius: var(--bib-wrap-radius);
  position: relative;
  overflow: hidden;
}

.bib-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 14% 12%, var(--bib-surface-glow), transparent 46%),
    radial-gradient(circle at 80% 18%, var(--bib-accent-2-soft), transparent 48%),
    radial-gradient(circle at 18% 88%, var(--bib-primary-soft), transparent 52%);
  opacity: var(--bib-ambient-opacity);
  pointer-events: none;
}

.bib-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--bib-pattern-dot) 1px, transparent 1px);
  background-size: var(--bib-pattern-size) var(--bib-pattern-size);
  opacity: var(--bib-pattern-opacity);
  pointer-events: none;
}

.bib-wrap[data-pattern="grid"]::after {
  background-image:
    linear-gradient(var(--bib-pattern-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bib-pattern-grid) 1px, transparent 1px);
}

.bib-wrap[data-pattern="none"]::after {
  display: none;
}

.bib-wrap > * {
  position: relative;
  z-index: 1;
}

.bib-wrap a {
  color: inherit;
  text-decoration: none;
}

.bib-wrap h1,
.bib-wrap h2,
.bib-wrap h3,
.bib-wrap h4 {
  font-family: var(--bib-font-title);
  color: var(--bib-title-color);
  font-weight: var(--bib-weight-title);
  margin: 0 0 0.4em 0;
  line-height: 1.15;
}

.bib-wrap [hidden] {
  display: none !important;
}

.bib-header {
  display: flex;
  gap: 32px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
}

.bib-wrap[data-header-layout="stack"] .bib-header {
  flex-direction: column;
  align-items: flex-start;
}

.bib-wrap[data-header-align="center"] .bib-header {
  align-items: center;
  text-align: center;
}

.bib-wrap[data-header-align="center"] .bib-heading {
  text-align: center;
  margin: 0 auto;
}

.bib-wrap[data-header-align="center"] .bib-stats {
  justify-content: center;
  text-align: center;
}

.bib-heading {
  max-width: 640px;
}

.bib-kicker {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: var(--bib-kicker-size);
  color: var(--bib-kicker-color);
  font-family: var(--bib-font-kicker);
  font-weight: var(--bib-weight-kicker);
  font-style: var(--bib-style-kicker);
}

.bib-title {
  font-size: clamp(calc(var(--bib-header-title-size) * 0.7), 3.6vw, var(--bib-header-title-size));
  margin-top: 0.2rem;
  color: var(--bib-title-color);
  font-family: var(--bib-font-title);
  font-weight: var(--bib-weight-title);
  font-style: var(--bib-style-title);
}

.bib-subtitle {
  font-size: var(--bib-header-subtitle-size);
  color: var(--bib-subtitle-color);
  max-width: 540px;
  margin: 0.6rem 0 0;
  font-family: var(--bib-font-subtitle);
  font-weight: var(--bib-weight-subtitle);
  font-style: var(--bib-style-subtitle);
}

.bib-stats {
  display: grid;
  gap: 12px;
  min-width: 180px;
}

.bib-stat {
  background: var(--bib-surface);
  border: var(--bib-wrap-border-width) solid var(--bib-border);
  border-radius: var(--bib-stat-radius);
  padding: 12px 16px;
  box-shadow: var(--bib-stat-shadow);
}

.bib-stat-value {
  display: block;
  font-size: var(--bib-stat-value-size);
  font-weight: var(--bib-weight-stat-value);
  font-family: var(--bib-font-stat-value);
  font-style: var(--bib-style-stat-value);
  color: var(--bib-stat-value-color);
}

.bib-stat-label {
  display: block;
  font-size: var(--bib-stat-label-size);
  color: var(--bib-stat-label-color);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--bib-font-stat-label);
  font-weight: var(--bib-weight-stat-label);
  font-style: var(--bib-style-stat-label);
}

.bib-panel {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.bib-search {
  display: grid;
  gap: 18px;
  padding: var(--bib-search-padding);
  border: var(--bib-wrap-border-width) solid var(--bib-border);
  border-radius: var(--bib-search-radius);
  background: var(--bib-surface);
  box-shadow: var(--bib-search-shadow);
}

.bib-search .row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bib-search .row.actions {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 18px;
}

.bib-search-grid .row.two-col {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.bib-wrap[data-search-layout="stack"] .bib-search-grid .row.two-col {
  grid-template-columns: 1fr;
}

@media (max-width: 760px) {
  .bib-search-grid .row.two-col {
    grid-template-columns: 1fr;
  }
}

.bib-search label {
  font-size: var(--bib-label-size);
  color: var(--bib-label-color);
  font-family: var(--bib-font-label);
  font-weight: var(--bib-weight-label);
  font-style: var(--bib-style-label);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.bib-search input,
.bib-search select {
  border: var(--bib-wrap-border-width) solid var(--bib-input-border-color);
  border-radius: var(--bib-input-radius);
  padding: 12px 14px;
  width: 100%;
  font-size: var(--bib-input-size);
  background: var(--bib-input-bg-color);
  color: var(--bib-input-text-color);
  font-family: var(--bib-font-input);
  font-weight: var(--bib-weight-input);
  font-style: var(--bib-style-input);
  transition: border 0.2s, box-shadow 0.2s, background 0.2s;
}

.bib-search input:focus,
.bib-search select:focus {
  border-color: var(--bib-input-focus-border-color);
  outline: none;
  background: var(--bib-input-focus-bg-color);
  box-shadow: 0 0 0 4px var(--bib-primary-focus);
}

.bib-search .btn,
.detalhe-acoes .btn {
  border: none;
  background: linear-gradient(120deg, var(--bib-primary) 0%, var(--bib-primary-2) 100%);
  color: var(--bib-button-primary-text);
  padding: 12px 24px;
  border-radius: var(--bib-button-radius);
  cursor: pointer;
  font-size: calc(var(--bib-button-size) + 2px);
  font-family: var(--bib-font-button);
  font-weight: var(--bib-weight-button);
  font-style: var(--bib-style-button);
  letter-spacing: 0.02em;
  box-shadow: 0 14px 30px var(--bib-primary-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.bib-search .btn:hover,
.detalhe-acoes .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px var(--bib-primary-shadow-strong);
  filter: brightness(1.05);
}

.bib-cta .btn {
  background: var(--bib-card-button-bg) !important;
  color: var(--bib-card-button-text) !important;
  border: 1px solid var(--bib-card-button-border) !important;
  box-shadow: none !important;
  padding: 8px 14px !important;
  border-radius: var(--bib-button-radius) !important;
  font-family: var(--bib-font-button);
  font-weight: var(--bib-weight-button);
  font-style: var(--bib-style-button);
  letter-spacing: 0.02em;
  text-transform: none;
  font-size: var(--bib-button-size);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.bib-cta .btn:hover,
.bib-cta .btn:focus {
  background: var(--bib-card-button-hover-bg) !important;
  color: var(--bib-card-button-text) !important;
  border-color: var(--bib-card-button-border) !important;
}

.bib-search .btn-outline,
.btn.btn-outline {
  border: 1px solid var(--bib-border);
  background: var(--bib-button-outline-bg);
  color: var(--bib-button-outline-text);
  box-shadow: none;
  border-radius: var(--bib-button-radius);
  font-size: var(--bib-button-size);
  font-family: var(--bib-font-button);
  font-weight: var(--bib-weight-button);
  font-style: var(--bib-style-button);
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.bib-search .btn-outline:hover,
.btn.btn-outline:hover {
  border-color: var(--bib-primary);
  color: var(--bib-primary);
  background: var(--bib-card-button-hover-bg);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px var(--bib-primary-soft);
}

.bib-search .btn-outline:focus,
.btn.btn-outline:focus {
  border-color: var(--bib-primary);
  color: var(--bib-primary);
  background: var(--bib-card-button-hover-bg);
  box-shadow: 0 0 0 3px var(--bib-primary-focus);
}

.bib-search .link-clear {
  font-size: var(--bib-link-size);
  color: var(--bib-link-clear-color);
  text-decoration: underline;
  background: transparent;
  border: none;
  padding: 0 4px;
  cursor: pointer;
  font-family: var(--bib-font-link);
  font-weight: var(--bib-weight-link);
  font-style: var(--bib-style-link);
}

.bib-search .link-clear:hover {
  color: var(--bib-link-clear-hover-color);
}

.bib-search .actions-group {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.bib-search .order-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 170px;
}

.bib-advanced {
  border: none;
  border-top: 1px solid var(--bib-border);
  border-radius: 0;
  padding: 14px 0 0;
  background: transparent;
}

.bib-advanced summary {
  cursor: pointer;
  font-family: var(--bib-font-advanced);
  font-weight: var(--bib-weight-advanced);
  font-style: var(--bib-style-advanced);
  color: var(--bib-advanced-label-color);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: var(--bib-advanced-label-size);
}

.bib-advanced[open] summary {
  margin-bottom: 14px;
}

.ano-range {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ano-range .sep {
  color: var(--bib-muted);
}

.bib-filtros-act {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 12px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: var(--bib-meta-size);
  font-family: var(--bib-font-meta);
  font-weight: var(--bib-weight-meta);
  font-style: var(--bib-style-meta);
  background: var(--bib-accent-soft);
  color: var(--bib-chip-color);
  border: 1px solid var(--bib-accent-soft-strong);
}

.chip:hover {
  background: var(--bib-accent-soft-strong);
}

.chip-cota {
  background: transparent !important;
  color: var(--bib-chip-cota-color);
  border: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font-family: var(--bib-font-meta);
  font-weight: var(--bib-weight-meta);
  flex: 0 0 100%;
  width: 100%;
  margin-bottom: 8px;
}

.chip-clear {
  background: var(--bib-primary-soft);
  border-color: var(--bib-primary-soft-strong);
  color: var(--bib-primary);
}

.bib-card .chip,
.bib-detalhe .chip,
.detalhe-temas a {
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  display: inline !important;
  color: var(--bib-chip-color);
  margin-right: 10px;
  white-space: normal;
}

.bib-card .chip.chip-cota,
.bib-detalhe .chip.chip-cota {
  color: var(--bib-chip-cota-color) !important;
}

.bib-meta-mini .chip.chip-cota {
  color: var(--bib-chip-cota-color) !important;
}


.bib-autor .lnk-autor,
.detalhe-autor a {
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  display: inline !important;
  color: var(--bib-author-color);
  margin-right: 10px;
  white-space: normal;
}

.bib-card .chip:hover,
.bib-detalhe .chip:hover,
.bib-autor .lnk-autor:hover,
.detalhe-autor a:hover,
.detalhe-temas a:hover {
  background: transparent;
  color: inherit;
  text-decoration: underline;
}

.bib-summary {
  margin-bottom: 16px;
}

.bib-summary-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 14px 18px;
  border-radius: var(--bib-summary-radius);
  background: var(--bib-surface);
  border: var(--bib-wrap-border-width) solid var(--bib-border);
  box-shadow: var(--bib-summary-shadow);
}

.bib-summary-card.is-empty {
  justify-content: center;
  font-family: var(--bib-font-empty);
  font-weight: var(--bib-weight-empty);
  font-style: var(--bib-style-empty);
  color: var(--bib-empty-text-color);
  font-size: var(--bib-summary-meta-size);
}

.bib-error {
  color: var(--bib-error-color);
}

.bib-summary-count {
  font-size: var(--bib-summary-count-size);
  font-family: var(--bib-font-summary-count);
  font-weight: var(--bib-weight-summary-count);
  font-style: var(--bib-style-summary-count);
  color: var(--bib-summary-count-color);
}

.bib-summary-meta {
  font-size: var(--bib-summary-meta-size);
  color: var(--bib-summary-meta-color);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--bib-font-summary-meta);
  font-weight: var(--bib-weight-summary-meta);
  font-style: var(--bib-style-summary-meta);
}

.bib-grid {
  display: grid;
  grid-template-columns: repeat(var(--bib-grid-cols), minmax(0, 1fr));
  gap: var(--bib-gap);
  margin-top: 18px;
  align-items: stretch;
}

.bib-grid > .bib-discovery {
  grid-column: 1 / -1;
}

.bib-wrap[data-view="isbd"] .bib-grid {
  display: block;
}

@media (max-width: 980px) {
  .bib-grid {
    grid-template-columns: repeat(var(--bib-grid-cols-md), minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .bib-grid {
    grid-template-columns: 1fr;
  }
}

.bib-card {
  border: var(--bib-card-border-width) solid var(--bib-border);
  border-radius: var(--bib-card-radius);
  background: var(--bib-surface);
  display: grid;
  grid-template-columns: minmax(0, var(--bib-card-cover-width)) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  gap: calc((var(--bib-card-gap-row) + 3px) * var(--bib-density)) calc((var(--bib-card-gap-col) + 4px) * var(--bib-density));
  padding: calc((var(--bib-card-padding) + 6px) * var(--bib-density));
  box-shadow: var(--bib-card-shadow);
  position: relative;
  overflow: hidden;
  min-height: 0;
  height: 100%;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  animation: bib-rise 0.6s ease both;
  animation-delay: calc(var(--i) * var(--bib-stagger));
  align-items: start;
  align-content: start;
}

.bib-card.is-coverless {
  grid-template-columns: 1fr;
}

.bib-isbd-item.is-coverless,
.bib-discovery-item.is-coverless {
  grid-template-columns: 1fr;
}

.bib-card.is-coverless .bib-titulo,
.bib-card.is-coverless .bib-titulo a {
  grid-column: 1;
  grid-row: 1;
}

.bib-card.is-coverless .bib-info {
  grid-column: 1;
  grid-row: 2;
}

.bib-wrap[data-motion="off"] .bib-card {
  animation: none;
}

.bib-wrap[data-motion="off"] .bib-card:hover {
  transform: none;
  box-shadow: var(--bib-card-shadow);
}

.bib-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    150deg,
    rgba(255, 255, 255, var(--bib-card-gloss-light-opacity)) 0%,
    rgba(255, 255, 255, var(--bib-card-gloss-mid-opacity)) 46%,
    rgba(0, 0, 0, var(--bib-card-gloss-dark-opacity)) 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.bib-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--bib-card-hover-shadow);
}

.bib-card:hover::before {
  opacity: 1;
}

.bib-wrap[data-layout="gallery"] .bib-card {
  grid-template-columns: 1fr;
  grid-template-rows: auto auto 1fr;
}

.bib-wrap[data-layout="editorial"] .bib-card {
  grid-template-columns: 1fr;
  grid-template-rows: auto auto 1fr;
}

.bib-wrap[data-layout="gallery"] .bib-thumb {
  grid-column: 1;
  grid-row: 1;
  width: min(100%, var(--bib-card-cover-gallery-width));
  max-width: var(--bib-card-cover-gallery-width);
  min-height: 0;
}

.bib-wrap[data-layout="editorial"] .bib-thumb {
  grid-column: 1;
  grid-row: 1;
  width: min(100%, var(--bib-card-cover-top-width));
  max-width: var(--bib-card-cover-top-width);
  min-height: 0;
}

.bib-wrap[data-layout="gallery"] .bib-info {
  grid-column: 1;
  grid-row: 3;
}

.bib-wrap[data-layout="editorial"] .bib-info {
  grid-column: 1;
  grid-row: 3;
}

.bib-wrap[data-layout="gallery"] .bib-titulo,
.bib-wrap[data-layout="gallery"] .bib-titulo a {
  grid-column: 1;
  grid-row: 2;
}

.bib-wrap[data-layout="editorial"] .bib-titulo,
.bib-wrap[data-layout="editorial"] .bib-titulo a {
  grid-column: 1;
  grid-row: 2;
}

.bib-thumb {
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: start;
  aspect-ratio: var(--bib-cover-ratio);
  overflow: hidden;
  border-radius: max(0px, calc(var(--bib-card-radius) - 2px));
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  box-shadow: none;
}

.bib-thumb img {
  width: 100%;
  height: 100%;
  object-fit: var(--bib-cover-fit);
  display: block;
  border-radius: max(0px, calc(var(--bib-card-radius) - 12px));
  background: linear-gradient(145deg, var(--bib-thumb-tint), transparent);
}

.bib-titulo,
.bib-titulo a {
  grid-column: 2;
  grid-row: 1;
  font-size: var(--bib-card-title-size);
  font-family: var(--bib-font-title);
  font-weight: var(--bib-weight-title);
  font-style: var(--bib-style-title);
  color: var(--bib-title-color);
  margin: 0;
  line-height: 1.25;
}

.bib-titulo {
  display: -webkit-box;
  -webkit-line-clamp: var(--bib-card-title-lines);
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bib-titulo a {
  display: block;
}

.bib-titulo a:hover {
  color: var(--bib-primary);
}

.bib-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  grid-column: 2;
  grid-row: 2;
  gap: 8px;
  padding-bottom: 2px;
  align-self: stretch;
}

.bib-autor {
  font-size: var(--bib-author-size);
  color: var(--bib-author-color);
  font-family: var(--bib-font-author);
  font-weight: var(--bib-weight-author);
  font-style: var(--bib-style-author);
  display: block;
  line-height: 1.4;
}

.bib-autor .lnk-autor {
  display: inline;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--bib-author-color);
  border: 0;
  font-weight: inherit;
  font-family: inherit;
  margin-right: 10px;
}

.bib-autor .lnk-autor:hover {
  text-decoration: underline;
}

.bib-meta-mini {
  display: flex;
  flex-wrap: wrap;
  column-gap: 10px;
  row-gap: 6px;
  width: 100%;
  line-height: 1.4;
  font-size: var(--bib-meta-size);
  font-family: var(--bib-font-meta);
  font-weight: var(--bib-weight-meta);
  font-style: var(--bib-style-meta);
}

.bib-meta-note {
  font-size: calc(var(--bib-meta-size) - 1px);
  color: var(--bib-subtitle-color);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.45;
}

.bib-excerpt {
  font-size: var(--bib-excerpt-size);
  color: var(--bib-excerpt-color);
  font-family: var(--bib-font-excerpt);
  font-weight: var(--bib-weight-excerpt);
  font-style: var(--bib-style-excerpt);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: var(--bib-card-excerpt-lines);
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bib-spacer {
  display: none;
}

.bib-cta {
  margin-top: auto;
  padding-top: 10px;
  margin-bottom: 2px;
}

.bib-wrap[data-card-align="center"] .bib-card {
  text-align: center;
}

.bib-wrap[data-card-align="center"] .bib-thumb {
  justify-self: center;
}

.bib-wrap[data-card-align="center"] .bib-card-head,
.bib-wrap[data-card-align="center"] .bib-meta-mini,
.bib-wrap[data-card-align="center"] .bib-cta,
.bib-wrap[data-card-align="center"] .bib-isbd-body {
  align-items: center;
}

.bib-wrap[data-card-align="center"] .bib-meta-mini {
  justify-content: center;
}

.bib-wrap[data-card-align="center"] .bib-isbd-body,
.bib-wrap[data-card-align="center"] .bib-discovery-body,
.bib-wrap[data-card-align="center"] .bib-discovery-meta {
  text-align: center;
}

.bib-paginacao {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 32px 0 10px;
  flex-wrap: wrap;
}

.bib-paginacao a {
  border: var(--bib-wrap-border-width) solid var(--bib-pagination-border-color);
  padding: 10px 16px;
  border-radius: var(--bib-pagination-radius);
  color: var(--bib-pagination-text-color);
  font-weight: var(--bib-weight-pagination);
  font-size: var(--bib-pagination-size);
  min-width: 48px;
  text-align: center;
  transition: border 0.2s, color 0.2s, background 0.2s;
  background: var(--bib-pagination-bg);
  font-family: var(--bib-font-pagination);
  font-style: var(--bib-style-pagination);
}

.bib-paginacao a:hover {
  border-color: var(--bib-pagination-hover-color);
  color: var(--bib-pagination-hover-color);
  background: var(--bib-pagination-hover-bg);
}

.bib-paginacao a.act {
  background: var(--bib-pagination-active-bg);
  color: var(--bib-pagination-active-text);
  border-color: var(--bib-pagination-active-bg);
}

.bib-paginacao a.dis {
  color: var(--bib-pagination-disabled-text);
  border-color: var(--bib-pagination-disabled-border);
  background: var(--bib-pagination-disabled-bg);
  cursor: not-allowed;
  pointer-events: none;
}

.bib-paginacao .dots {
  padding: 10px 6px;
  color: var(--bib-pagination-text-color);
  opacity: 0.6;
  font-weight: var(--bib-weight-pagination);
  font-size: var(--bib-pagination-size);
}

.bib-summary:empty,
.bib-grid:empty,
.bib-paginacao:empty,
.bib-filtros-act:empty {
  display: none;
}

.bib-empty {
  text-align: center;
  padding: 48px 24px;
  border: var(--bib-wrap-border-width) dashed var(--bib-border);
  border-radius: var(--bib-empty-radius);
  font-size: var(--bib-empty-size);
  background: var(--bib-surface);
  color: var(--bib-empty-text-color);
  font-family: var(--bib-font-empty);
  font-weight: var(--bib-weight-empty);
  font-style: var(--bib-style-empty);
}

.bib-wrap.is-loading::after {
  content: attr(data-loading);
  position: fixed;
  inset: 0;
  background: var(--bib-loading-overlay-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--bib-loading-size);
  color: var(--bib-loading-text-color);
  font-family: var(--bib-font-loading);
  font-weight: var(--bib-weight-loading);
  font-style: var(--bib-style-loading);
  z-index: 9999;
}

.bib-detalhe .detalhe-head {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  margin-bottom: 32px;
}

@media (max-width: 900px) {
  .bib-detalhe .detalhe-head {
    grid-template-columns: 1fr;
  }
}

.detalhe-capa-box {
  border-radius: var(--bib-detail-cover-radius);
  background: var(--bib-surface);
  border: var(--bib-wrap-border-width) solid var(--bib-border);
  padding: 14px;
  box-shadow: var(--bib-card-shadow);
}

.detalhe-capa-box img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.detalhe-titulo {
  font-size: var(--bib-detail-title-size);
  font-family: var(--bib-font-title);
  font-weight: var(--bib-weight-title);
  font-style: var(--bib-style-title);
  margin: 0 0 0.15rem 0;
  color: var(--bib-title-color);
}

.detalhe-subtitulo {
  font-size: var(--bib-detail-subtitle-size);
  color: var(--bib-subtitle-color);
  margin-bottom: 0.45rem;
  font-family: var(--bib-font-subtitle);
  font-weight: var(--bib-weight-subtitle);
  font-style: var(--bib-style-subtitle);
}

.detalhe-autor {
  margin: 10px 0 16px;
  display: block;
  font-size: var(--bib-author-size);
  color: var(--bib-subtitle-color);
  font-family: var(--bib-font-author);
  font-weight: var(--bib-weight-author);
  font-style: var(--bib-style-author);
  line-height: 1.5;
}

.detalhe-autor a {
  background: transparent;
  color: var(--bib-author-color);
  padding: 0;
  border-radius: 0;
  border: 0;
  font-weight: inherit;
  font-family: inherit;
}

.detalhe-lista div {
  margin: 6px 0;
  font-size: var(--bib-detail-text-size);
  color: var(--bib-detail-text-color);
  font-family: var(--bib-font-detail-text);
  font-weight: var(--bib-weight-detail-text);
  font-style: var(--bib-style-detail-text);
}

.detalhe-lista strong,
.detalhe-autor strong,
.detalhe-temas strong {
  color: var(--bib-info-text);
}

.detalhe-temas {
  margin-top: 16px;
  display: block;
  line-height: 1.5;
  font-size: var(--bib-meta-size);
  font-family: var(--bib-font-meta);
  font-weight: var(--bib-weight-meta);
  font-style: var(--bib-style-meta);
}

.detalhe-temas a {
  text-decoration: none;
  background: transparent;
  color: var(--bib-chip-color);
  padding: 0;
  border-radius: 0;
  border: 0;
  font-weight: var(--bib-weight-meta);
  font-family: var(--bib-font-meta);
}

.detalhe-acoes {
  margin-top: 20px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.detalhe-acoes .btn-outline {
  background: var(--bib-button-outline-bg);
  color: var(--bib-button-outline-text);
  border: 1px solid var(--bib-border);
  box-shadow: none;
}

.detalhe-resumo {
  margin: 32px 0;
}

.detalhe-resumo .conteudo {
  background: var(--bib-surface);
  border: var(--bib-wrap-border-width) solid var(--bib-border);
  border-radius: var(--bib-detail-summary-radius);
  padding: 24px;
  font-size: var(--bib-detail-summary-size);
  color: var(--bib-detail-summary-text-color);
  font-family: var(--bib-font-detail-summary);
  font-weight: var(--bib-weight-detail-summary);
  font-style: var(--bib-style-detail-summary);
  box-shadow: var(--bib-detail-shadow);
}

.detalhe-isbd {
  display: grid;
  grid-template-columns: var(--bib-detail-isbd-cover-width) 1fr;
  gap: 20px;
  margin: 30px 0;
  padding: 20px 22px;
  border-radius: var(--bib-isbd-radius);
  border: 1px solid var(--bib-border);
  background:
    linear-gradient(135deg, var(--bib-surface) 0%, var(--bib-surface-alt) 100%);
  box-shadow: var(--bib-isbd-shadow);
}

.detalhe-isbd-cover {
  border-radius: var(--bib-isbd-cover-radius);
}

.detalhe-isbd-cover img {
  width: 100%;
  height: 100%;
  display: block;
}

.detalhe-isbd-body h2 {
  margin: 0 0 8px 0;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bib-subtitle-color);
}

.detalhe-isbd-line {
  margin: 0;
  font-size: var(--bib-detail-text-size);
  font-family: var(--bib-font-detail-text);
  font-weight: var(--bib-weight-detail-text);
  font-style: var(--bib-style-detail-text);
  color: var(--bib-detail-text-color);
  line-height: 1.7;
}

.bib-isbd {
  display: grid;
  gap: 18px;
}

.bib-isbd-item {
  display: grid;
  grid-template-columns: var(--bib-isbd-cover-width) 1fr;
  gap: 18px;
  padding: 18px;
  border-radius: var(--bib-isbd-radius);
  border: var(--bib-wrap-border-width) solid var(--bib-border);
  background: linear-gradient(130deg, var(--bib-surface) 0%, var(--bib-surface-alt) 100%);
  box-shadow: var(--bib-isbd-shadow);
}

.bib-isbd-cover {
  border-radius: var(--bib-isbd-cover-radius);
  display: block;
}

.bib-isbd-cover img {
  width: 100%;
  height: 100%;
  display: block;
}

.bib-isbd-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bib-isbd-meta {
  font-size: var(--bib-meta-size);
  color: var(--bib-subtitle-color);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bib-isbd-line {
  font-size: calc(var(--bib-detail-text-size) * 0.98);
  font-family: var(--bib-font-detail-text);
  font-weight: var(--bib-weight-detail-text);
  font-style: var(--bib-style-detail-text);
  color: var(--bib-detail-text-color);
  line-height: 1.7;
  text-decoration: none;
}

.bib-isbd-line:hover {
  color: var(--bib-primary);
}

.bib-isbd-cta .btn {
  padding: 8px 14px;
  font-size: var(--bib-button-size);
}

.bib-discovery {
  margin-top: 18px;
  padding: 24px;
  border-radius: var(--bib-discovery-radius);
  border: 1px solid var(--bib-border);
  background:
    radial-gradient(circle at 8% 12%, var(--bib-primary-soft), transparent 45%),
    radial-gradient(circle at 90% 16%, var(--bib-accent-2-soft), transparent 46%),
    linear-gradient(145deg, var(--bib-surface) 0%, var(--bib-surface-alt) 100%);
  box-shadow: var(--bib-discovery-shadow);
}

.bib-discovery-head {
  margin-bottom: 16px;
}

.bib-discovery-head h2 {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  color: var(--bib-title-color);
  font-family: var(--bib-font-title);
  font-weight: var(--bib-weight-title);
}

.bib-discovery-head p {
  margin: 8px 0 0 0;
  color: var(--bib-subtitle-color);
  font-size: var(--bib-summary-meta-size);
  font-family: var(--bib-font-summary-meta);
}

.bib-discovery-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.bib-discovery-item {
  display: grid;
  grid-template-columns: var(--bib-discovery-cover-width) 1fr;
  gap: 12px;
  padding: 14px;
  border-radius: var(--bib-discovery-item-radius);
  border: 1px solid var(--bib-border);
  background: var(--bib-surface);
}

.bib-discovery-cover {
  display: block;
  border-radius: var(--bib-discovery-cover-radius);
  align-self: start;
}

.bib-discovery-cover img {
  width: 100%;
  height: 100%;
  display: block;
}

.detalhe-isbd-cover,
.bib-isbd-cover,
.bib-discovery-cover {
  overflow: hidden;
  aspect-ratio: var(--bib-cover-ratio);
  background: var(--bib-card-cover-shell-bg);
  padding: var(--bib-card-cover-shell-padding);
  border: 1px solid var(--bib-card-cover-shell-border);
  box-shadow: var(--bib-card-cover-shell-shadow);
}

.detalhe-isbd-cover img,
.bib-isbd-cover img,
.bib-discovery-cover img {
  object-fit: var(--bib-cover-fit);
  background: linear-gradient(145deg, var(--bib-thumb-tint), transparent);
  box-shadow: inset 0 0 0 1px var(--bib-card-cover-inner-border);
}

.bib-discovery-body {
  min-width: 0;
}

.bib-discovery-body h3 {
  margin: 0;
  font-size: var(--bib-card-title-size);
  line-height: 1.3;
}

.bib-discovery-body h3 a {
  display: -webkit-box;
  -webkit-line-clamp: var(--bib-card-title-lines);
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--bib-title-color);
  text-decoration: none;
  font-family: var(--bib-font-title);
  font-weight: var(--bib-weight-title);
  font-style: var(--bib-style-title);
}

.bib-discovery-body h3 a:hover {
  color: var(--bib-primary);
}

.bib-discovery-meta {
  margin: 6px 0 0 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--bib-subtitle-color);
}

.bib-discovery-summary {
  margin: 9px 0 12px 0;
  font-size: var(--bib-excerpt-size);
  color: var(--bib-excerpt-color);
  line-height: 1.5;
  font-family: var(--bib-font-excerpt);
  font-weight: var(--bib-weight-excerpt);
  font-style: var(--bib-style-excerpt);
  display: -webkit-box;
  -webkit-line-clamp: var(--bib-card-excerpt-lines);
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bib-discovery-body .btn {
  padding: 7px 12px;
  font-size: 0.82rem;
  margin-top: 2px;
}

.tech-actions .btn.btn-outline,
.bib-discovery-body .btn.btn-outline {
  border-color: var(--bib-card-button-border);
  color: var(--bib-card-button-text);
  background: var(--bib-card-button-bg);
}

.tech-actions .btn.btn-outline:hover,
.tech-actions .btn.btn-outline:focus,
.bib-discovery-body .btn.btn-outline:hover,
.bib-discovery-body .btn.btn-outline:focus {
  border-color: var(--bib-card-button-border);
  color: var(--bib-card-button-text);
  background: var(--bib-card-button-hover-bg);
}

.detalhe-tech {
  margin: 38px 0;
}

.tech-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.tech-block {
  background: var(--bib-tech-bg);
  color: var(--bib-tech-text);
  border-radius: var(--bib-tech-radius);
  padding: 18px;
  font-family: var(--bib-font-tech);
  font-weight: var(--bib-weight-tech);
  font-style: var(--bib-style-tech);
  font-size: var(--bib-tech-size);
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: var(--bib-tech-shadow);
}

.tech-block-wrap {
  position: relative;
  margin-bottom: 14px;
}

.btn-copy {
  position: absolute;
  top: 10px;
  right: 10px;
  border: 1px solid var(--bib-border);
  background: var(--bib-tech-copy-bg);
  color: var(--bib-tech-copy-text);
  border-radius: calc(var(--bib-button-radius) - 2px);
  padding: 6px 10px;
  font-size: var(--bib-button-size);
  font-family: var(--bib-font-button);
  font-weight: var(--bib-weight-button);
  font-style: var(--bib-style-button);
  box-shadow: var(--bib-copy-shadow);
  transition: transform 0.12s, box-shadow 0.12s, border 0.12s;
}

.btn-copy:hover {
  transform: translateY(-1px);
}

.btn-copy:focus {
  outline: 2px solid var(--bib-primary);
  outline-offset: 2px;
}

.bib-wrap .hl {
  background: var(--bib-highlight-color);
  padding: 0 0.2em;
  border-radius: var(--bib-highlight-radius);
}

.bib-wrap .ac-wrap {
  position: relative;
}

.bib-wrap .ac-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  background: var(--bib-autocomplete-bg);
  border: 1px solid var(--bib-border);
  border-radius: var(--bib-autocomplete-radius);
  box-shadow: var(--bib-autocomplete-shadow);
  max-height: 232px;
  overflow: auto;
}

.bib-wrap .ac-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: var(--bib-autocomplete-size);
  font-family: var(--bib-font-autocomplete);
  font-weight: var(--bib-weight-autocomplete);
  font-style: var(--bib-style-autocomplete);
  color: var(--bib-autocomplete-text-color);
}

.bib-wrap .ac-item:hover,
.bib-wrap .ac-item[aria-selected="true"] {
  background: var(--bib-accent-soft);
  color: var(--bib-primary);
}

@keyframes bib-rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bib-card,
  .bib-search .btn,
  .detalhe-acoes .btn {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 900px) {
  .bib-header {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .detalhe-isbd {
    grid-template-columns: 1fr;
  }

  .bib-isbd-item {
    grid-template-columns: 1fr;
  }

  .bib-discovery-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .bib-panel {
    padding: 16px;
  }

  .bib-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
  }

  .bib-thumb {
    grid-column: 1;
    grid-row: 1;
  }

  .bib-titulo,
  .bib-titulo a {
    grid-column: 1;
    grid-row: 2;
  }

  .bib-info {
    grid-column: 1;
    grid-row: 3;
  }

  .bib-discovery {
    padding: 16px;
  }
}

/* Editorial premium, low-contrast luxury overrides */
.bib-wrap {
  border-radius: var(--bib-wrap-radius);
  border: none;
  background: var(--bib-bg);
}

.bib-wrap::before {
  background:
    radial-gradient(circle at 12% 8%, var(--bib-primary-soft), transparent 52%);
  opacity: calc(var(--bib-ambient-opacity) * 0.4);
}

.bib-wrap::after {
  opacity: calc(var(--bib-pattern-opacity) * 0.4);
}

.bib-header {
  margin-bottom: 24px;
}

.bib-kicker {
  letter-spacing: 0.18em;
  opacity: 0.8;
}

.bib-title {
  line-height: 1.08;
}

.bib-subtitle {
  line-height: 1.45;
}

.bib-stat {
  border-radius: var(--bib-stat-radius);
  background: var(--bib-surface);
  box-shadow: var(--bib-stat-shadow);
}

.bib-panel {
  background: transparent;
  border: none;
  box-shadow: none;
}

.bib-search {
  border-radius: var(--bib-search-radius);
  background: var(--bib-surface);
  box-shadow: var(--bib-search-shadow);
}

.bib-search .row.actions {
  gap: 14px;
}

.bib-search input,
.bib-search select {
  border-radius: var(--bib-input-radius);
  background: var(--bib-input-bg-color);
}

.bib-search input:focus,
.bib-search select:focus {
  box-shadow: 0 0 0 3px var(--bib-primary-focus);
}

.bib-search .btn,
.detalhe-acoes .btn {
  background: var(--bib-primary);
  color: var(--bib-button-primary-text);
  border-radius: var(--bib-button-radius);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
  transform: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.bib-search .btn:hover,
.detalhe-acoes .btn:hover {
  transform: none;
  filter: none;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
  background: var(--bib-primary-2);
}

.bib-search .btn-outline,
.btn.btn-outline,
.bib-cta .btn {
  border-radius: var(--bib-button-radius) !important;
}

.bib-advanced {
  border: none;
  border-top: 1px solid var(--bib-border);
  border-radius: 0;
  background: transparent;
}

.bib-filtros-act {
  gap: 8px;
}

.chip {
  border-radius: 999px;
  background: var(--bib-surface-alt);
  border-color: var(--bib-border);
  color: var(--bib-chip-color);
}

.chip:hover {
  background: var(--bib-surface);
  border-color: var(--bib-primary);
}

.bib-summary-card {
  border-radius: var(--bib-summary-radius);
  background: var(--bib-surface);
  box-shadow: var(--bib-summary-shadow);
}

.bib-card {
  border-radius: var(--bib-card-radius);
  background: var(--bib-surface);
  box-shadow: var(--bib-card-shadow);
}

.bib-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--bib-card-hover-shadow);
}

.bib-thumb {
  border-radius: max(0px, calc(var(--bib-card-radius) - 2px));
  border: none;
  background: transparent;
  box-shadow: none;
}

.bib-paginacao a {
  border-radius: var(--bib-pagination-radius);
  background: var(--bib-pagination-bg);
}

.bib-paginacao a.act {
  box-shadow: none;
}

.detalhe-capa-box { border-radius: var(--bib-detail-cover-radius); }
.detalhe-resumo .conteudo { border-radius: var(--bib-detail-summary-radius); }
.detalhe-isbd { border-radius: var(--bib-isbd-radius); }
.bib-isbd-item { border-radius: var(--bib-isbd-radius); }
.bib-discovery { border-radius: var(--bib-discovery-radius); }
.bib-discovery-item { border-radius: var(--bib-discovery-item-radius); }

.detalhe-capa-box,
.detalhe-resumo .conteudo {
  box-shadow: var(--bib-detail-shadow);
}

.detalhe-isbd,
.bib-isbd-item {
  box-shadow: var(--bib-isbd-shadow);
}

.bib-discovery,
.bib-discovery-item {
  box-shadow: var(--bib-discovery-shadow);
}

.detalhe-isbd {
  margin-top: 28px;
  border-color: var(--bib-border);
}

.bib-isbd-item {
  border-color: var(--bib-border);
}

.bib-discovery {
  border-color: var(--bib-border);
}

/* Atlas: discreet luxury */
.bib-wrap[data-theme="atlas"] {
  background:
    linear-gradient(160deg, var(--bib-bg) 0%, var(--bib-surface-alt) 50%, var(--bib-bg) 100%);
  border-color: var(--bib-border);
}

.bib-wrap[data-theme="atlas"]::before {
  opacity: 0.24;
}

.bib-wrap[data-theme="atlas"] .bib-header {
  border-bottom: 1px solid var(--bib-primary-soft);
  padding-bottom: 14px;
}

.bib-wrap[data-theme="atlas"] .bib-kicker {
  color: var(--bib-kicker-color);
  letter-spacing: 0.16em;
}

.bib-wrap[data-theme="atlas"] .bib-title {
  letter-spacing: 0.01em;
}

.bib-wrap[data-theme="atlas"] .bib-panel {
  border-color: var(--bib-border);
  box-shadow: var(--bib-panel-shadow);
}

.bib-wrap[data-theme="atlas"] .bib-search {
  background: var(--bib-surface-alt);
  border-color: var(--bib-border);
}

.bib-wrap[data-theme="atlas"] .bib-search input,
.bib-wrap[data-theme="atlas"] .bib-search select {
  border-color: var(--bib-input-border-color);
}

.bib-wrap[data-theme="atlas"] .bib-search input:focus,
.bib-wrap[data-theme="atlas"] .bib-search select:focus {
  border-color: var(--bib-input-focus-border-color);
  box-shadow: 0 0 0 3px var(--bib-primary-focus);
}

.bib-wrap[data-theme="atlas"] .bib-search .btn,
.bib-wrap[data-theme="atlas"] .detalhe-acoes .btn {
  background: var(--bib-primary);
}

.bib-wrap[data-theme="atlas"] .bib-search .btn:hover,
.bib-wrap[data-theme="atlas"] .detalhe-acoes .btn:hover {
  background: var(--bib-primary-2);
}

.bib-wrap[data-theme="atlas"] .bib-search .btn-outline,
.bib-wrap[data-theme="atlas"] .btn.btn-outline {
  border-color: var(--bib-border) !important;
  color: var(--bib-button-outline-text) !important;
  background: var(--bib-button-outline-bg) !important;
}

.bib-wrap[data-theme="atlas"] .bib-search .btn-outline:hover,
.bib-wrap[data-theme="atlas"] .bib-search .btn-outline:focus,
.bib-wrap[data-theme="atlas"] .btn.btn-outline:hover,
.bib-wrap[data-theme="atlas"] .btn.btn-outline:focus {
  border-color: var(--bib-primary) !important;
  color: var(--bib-primary) !important;
  background: var(--bib-card-button-hover-bg) !important;
}

.bib-wrap[data-theme="atlas"] .bib-cta .btn,
.bib-wrap[data-theme="atlas"] .bib-isbd-cta .btn,
.bib-wrap[data-theme="atlas"] .bib-discovery-body .btn {
  border-color: var(--bib-card-button-border) !important;
  color: var(--bib-card-button-text) !important;
  background: var(--bib-card-button-bg) !important;
}

.bib-wrap[data-theme="atlas"] .bib-cta .btn:hover,
.bib-wrap[data-theme="atlas"] .bib-cta .btn:focus,
.bib-wrap[data-theme="atlas"] .bib-isbd-cta .btn:hover,
.bib-wrap[data-theme="atlas"] .bib-isbd-cta .btn:focus,
.bib-wrap[data-theme="atlas"] .bib-discovery-body .btn:hover,
.bib-wrap[data-theme="atlas"] .bib-discovery-body .btn:focus {
  border-color: var(--bib-card-button-border) !important;
  color: var(--bib-card-button-text) !important;
  background: var(--bib-card-button-hover-bg) !important;
}

.bib-wrap[data-theme="atlas"] .chip {
  background: var(--bib-surface-alt);
  border-color: var(--bib-border);
  color: var(--bib-chip-color);
}

.bib-wrap[data-theme="atlas"] .chip:hover {
  background: var(--bib-surface);
  border-color: var(--bib-primary);
}

.bib-wrap[data-theme="atlas"] .bib-summary-card {
  border-bottom-color: var(--bib-border);
}

.bib-wrap[data-theme="atlas"] .bib-card {
  border-color: var(--bib-border);
  background: linear-gradient(165deg, var(--bib-surface) 0%, var(--bib-surface-alt) 100%);
  box-shadow: var(--bib-card-shadow);
}

.bib-wrap[data-theme="atlas"] .bib-card:hover {
  box-shadow: var(--bib-card-hover-shadow);
}

.bib-wrap[data-theme="atlas"] .bib-paginacao a:not(.act):not(.dis) {
  border-color: var(--bib-pagination-border-color);
  background: var(--bib-pagination-bg);
}

.bib-wrap[data-theme="atlas"] .bib-paginacao a:not(.act):not(.dis):hover {
  border-color: var(--bib-pagination-hover-color);
  color: var(--bib-pagination-hover-color);
  background: var(--bib-pagination-hover-bg);
}

.bib-wrap[data-theme="atlas"] .bib-paginacao a.act {
  border-color: var(--bib-pagination-active-bg);
  color: var(--bib-pagination-active-text);
  background: var(--bib-pagination-active-bg);
}

.bib-wrap[data-theme="atlas"] .bib-paginacao a.dis {
  border-color: var(--bib-pagination-disabled-border);
  color: var(--bib-pagination-disabled-text);
  background: var(--bib-pagination-disabled-bg);
}

.bib-wrap[data-theme="atlas"] .detalhe-capa-box,
.bib-wrap[data-theme="atlas"] .detalhe-resumo .conteudo,
.bib-wrap[data-theme="atlas"] .detalhe-isbd,
.bib-wrap[data-theme="atlas"] .bib-isbd-item,
.bib-wrap[data-theme="atlas"] .bib-discovery,
.bib-wrap[data-theme="atlas"] .bib-discovery-item {
  border-color: var(--bib-border);
  box-shadow: var(--bib-discovery-shadow);
}

.bib-wrap[data-theme="atelier"] {
  background:
    linear-gradient(180deg, var(--bib-bg) 0%, var(--bib-surface-alt) 52%, var(--bib-bg) 100%);
}

.bib-wrap[data-theme="atelier"] .bib-header {
  padding-bottom: 10px;
}

.bib-wrap[data-theme="atelier"] .bib-search,
.bib-wrap[data-theme="atelier"] .bib-card,
.bib-wrap[data-theme="atelier"] .bib-summary-card {
  border-bottom-color: var(--bib-border);
}

.bib-wrap[data-theme="atelier"] .bib-discovery,
.bib-wrap[data-theme="atelier"] .bib-discovery-item {
  border-color: var(--bib-border);
  box-shadow: var(--bib-stat-shadow);
}

.bib-wrap[data-theme="atelier"] .chip {
  color: var(--bib-chip-color);
}

.bib-wrap[data-theme="arcana"] {
  background:
    radial-gradient(circle at 12% 8%, var(--bib-primary-soft), transparent 40%),
    linear-gradient(180deg, var(--bib-bg) 0%, var(--bib-surface-alt) 58%, var(--bib-bg) 100%);
}

.bib-wrap[data-theme="arcana"] .bib-header {
  border-bottom: 1px solid var(--bib-border);
  padding-bottom: 14px;
}

.bib-wrap[data-theme="arcana"] .bib-search,
.bib-wrap[data-theme="arcana"] .bib-card,
.bib-wrap[data-theme="arcana"] .detalhe-capa-box,
.bib-wrap[data-theme="arcana"] .detalhe-resumo .conteudo,
.bib-wrap[data-theme="arcana"] .bib-isbd-item,
.bib-wrap[data-theme="arcana"] .bib-discovery-item {
  border-color: var(--bib-border);
  box-shadow: var(--bib-detail-shadow);
}

.bib-wrap[data-theme="arcana"] .bib-card {
  background: linear-gradient(180deg, var(--bib-surface) 0%, var(--bib-surface-alt) 100%);
}

.bib-wrap[data-theme="folio"] {
  background:
    linear-gradient(160deg, var(--bib-bg) 0%, var(--bib-surface-alt) 44%, var(--bib-bg) 100%);
}

.bib-wrap[data-theme="folio"]::before {
  opacity: 0.18;
}

.bib-wrap[data-theme="folio"] .bib-header {
  border-bottom: 1px solid var(--bib-border);
  padding-bottom: 16px;
}

.bib-wrap[data-theme="folio"] .bib-kicker {
  letter-spacing: 0.18em;
}

.bib-wrap[data-theme="folio"] .bib-search,
.bib-wrap[data-theme="folio"] .bib-card,
.bib-wrap[data-theme="folio"] .detalhe-capa-box,
.bib-wrap[data-theme="folio"] .detalhe-resumo .conteudo,
.bib-wrap[data-theme="folio"] .detalhe-isbd,
.bib-wrap[data-theme="folio"] .bib-isbd-item,
.bib-wrap[data-theme="folio"] .bib-discovery,
.bib-wrap[data-theme="folio"] .bib-discovery-item {
  border-color: var(--bib-border);
  box-shadow: var(--bib-isbd-shadow);
}

.bib-wrap[data-theme="folio"] .bib-card {
  background: linear-gradient(180deg, var(--bib-surface) 0%, var(--bib-surface-alt) 100%);
}

.bib-wrap[data-theme="folio"] .chip {
  color: var(--bib-chip-color);
}

.bib-wrap[data-card-cta="solid"] .bib-cta .btn,
.bib-wrap[data-card-cta="solid"] .bib-isbd-cta .btn,
.bib-wrap[data-card-cta="solid"] .bib-discovery-body .btn {
  background: linear-gradient(120deg, var(--bib-primary) 0%, var(--bib-primary-2) 100%) !important;
  color: var(--bib-button-primary-text) !important;
  border-color: transparent !important;
  box-shadow: 0 10px 24px var(--bib-primary-shadow) !important;
}

.bib-wrap[data-card-cta="solid"] .bib-cta .btn:hover,
.bib-wrap[data-card-cta="solid"] .bib-cta .btn:focus,
.bib-wrap[data-card-cta="solid"] .bib-isbd-cta .btn:hover,
.bib-wrap[data-card-cta="solid"] .bib-isbd-cta .btn:focus,
.bib-wrap[data-card-cta="solid"] .bib-discovery-body .btn:hover,
.bib-wrap[data-card-cta="solid"] .bib-discovery-body .btn:focus {
  background: linear-gradient(120deg, var(--bib-primary) 0%, var(--bib-primary-2) 100%) !important;
  color: var(--bib-button-primary-text) !important;
  border-color: transparent !important;
  box-shadow: 0 14px 32px var(--bib-primary-shadow-strong) !important;
}

.bib-wrap[data-card-cta="link"] .bib-cta .btn,
.bib-wrap[data-card-cta="link"] .bib-isbd-cta .btn,
.bib-wrap[data-card-cta="link"] .bib-discovery-body .btn {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  color: var(--bib-primary) !important;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.bib-wrap[data-card-cta="link"] .bib-cta .btn:hover,
.bib-wrap[data-card-cta="link"] .bib-cta .btn:focus,
.bib-wrap[data-card-cta="link"] .bib-isbd-cta .btn:hover,
.bib-wrap[data-card-cta="link"] .bib-isbd-cta .btn:focus,
.bib-wrap[data-card-cta="link"] .bib-discovery-body .btn:hover,
.bib-wrap[data-card-cta="link"] .bib-discovery-body .btn:focus {
  background: transparent !important;
  color: var(--bib-primary-2) !important;
  border: 0 !important;
}

@media print {
  body.bib-print-mode {
    background: #fff !important;
  }

  body.bib-print-mode * {
    visibility: hidden !important;
  }

  body.bib-print-mode .bib-print-target,
  body.bib-print-mode .bib-print-target * {
    visibility: visible !important;
  }

  body.bib-print-mode .bib-print-target {
    position: absolute !important;
    inset: 0 auto auto 0 !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
    border: none !important;
  }

  body.bib-print-mode .detalhe-acoes,
  body.bib-print-mode .detalhe-tech,
  body.bib-print-mode .detalhe-rel {
    display: none !important;
  }

  body.bib-print-mode .bib-wrap.bib-detalhe,
  body.bib-print-mode .bib-panel,
  body.bib-print-mode .detalhe-head,
  body.bib-print-mode .detalhe-resumo,
  body.bib-print-mode .detalhe-isbd {
    background: #fff !important;
    box-shadow: none !important;
    border-color: #d7d7d7 !important;
  }

  body.bib-print-mode .detalhe-head {
    gap: 24px !important;
  }

  body.bib-print-mode .detalhe-capa-box img {
    max-height: 240px !important;
  }
}

/* =========================================================
   Pacote 1 — "Quis dizer..." and search history
   ========================================================= */
.bib-wrap .bib-dym {
  margin: 10px 0 4px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--bib-surface-soft);
  border: 1px dashed var(--bib-border, rgba(0, 0, 0, 0.12));
  font-size: 0.95em;
}
.bib-wrap .bib-dym-head {
  font-weight: 600;
  color: var(--bib-text-subtle);
  margin-bottom: 4px;
}
.bib-wrap .bib-dym-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bib-wrap .bib-dym-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.bib-wrap .bib-dym-orig {
  font-style: italic;
  opacity: 0.75;
}
.bib-wrap .bib-dym-arrow { opacity: 0.6; }
.bib-wrap .bib-dym-link {
  text-decoration: underline dotted;
  padding: 2px 6px;
  border-radius: 6px;
}
.bib-wrap .bib-dym-link:hover {
  background: var(--bib-primary-soft, rgba(0, 0, 0, 0.05));
}

.bib-history {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 40;
  background: var(--bib-surface, #fff);
  border: 1px solid var(--bib-border, rgba(0, 0, 0, 0.15));
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  padding: 6px 0;
  max-height: 260px;
  overflow-y: auto;
}
.bib-history[hidden] { display: none; }
.bib-history-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  font-size: 0.8em;
  color: var(--bib-text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.bib-history-clear {
  background: transparent;
  border: none;
  color: var(--bib-primary, inherit);
  cursor: pointer;
  font-size: inherit;
  padding: 2px 4px;
  border-radius: 4px;
}
.bib-history-clear:hover { text-decoration: underline; }
.bib-history-list { list-style: none; margin: 0; padding: 0; }
.bib-history-item button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 8px 14px;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.bib-history-item button:hover,
.bib-history-item button:focus {
  background: var(--bib-primary-soft, rgba(0, 0, 0, 0.06));
  outline: none;
}

/* =========================================================
   Pacote 2 — Detail page: share, QR, lightbox, exports
   ========================================================= */
.bib-wrap .detalhe-capa-box.is-zoomable {
  position: relative;
  cursor: zoom-in;
  transition: transform 0.18s ease;
}
.bib-wrap .detalhe-capa-box.is-zoomable:hover { transform: translateY(-2px); }
.bib-wrap .detalhe-capa-box.is-zoomable:focus-within { outline: 2px solid var(--bib-primary, #4a90e2); outline-offset: 2px; }
.bib-wrap .detalhe-capa-zoom {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  pointer-events: none;
}

.bib-wrap .bib-qr-panel {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--bib-border, rgba(0, 0, 0, 0.14));
  border-radius: 12px;
  background: var(--bib-surface-soft);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.bib-wrap .bib-qr-panel[hidden] { display: none; }
.bib-wrap .bib-qr-code {
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 6px;
}
.bib-wrap .bib-qr-code svg { width: 100%; height: 100%; }
.bib-wrap .bib-qr-url {
  font-family: var(--bib-font-tech);
  font-size: 0.85em;
  word-break: break-all;
  color: var(--bib-text-subtle);
}

.bib-wrap .detalhe-exports {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--bib-border, rgba(0, 0, 0, 0.1));
  font-size: 0.92em;
}
.bib-wrap .detalhe-exports-label {
  color: var(--bib-text-subtle);
  margin-right: 4px;
}
.bib-wrap .bib-export-link {
  font-size: 0.9em;
  padding: 4px 10px;
}

.bib-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: bib-lb-fade 0.18s ease;
}
.bib-lightbox[hidden] { display: none; }
.bib-lightbox .bib-lightbox-img {
  max-width: 92vw;
  max-height: 90vh;
  object-fit: contain;
  box-shadow: 0 10px 60px rgba(0, 0, 0, 0.6);
  background: #fff;
  border-radius: 4px;
}
.bib-lightbox .bib-lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: #111;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.bib-lightbox .bib-lightbox-close:hover { background: #fff; }
@keyframes bib-lb-fade { from { opacity: 0; } to { opacity: 1; } }

.bib-wrap .bib-share-flash {
  position: absolute;
  background: #111;
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.85em;
  pointer-events: none;
  animation: bib-flash 1.6s ease forwards;
}
@keyframes bib-flash {
  0% { opacity: 0; transform: translateY(4px); }
  15% { opacity: 1; transform: translateY(0); }
  85% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-4px); }
}

/* =========================================================
   Pacote 5 — Accessibility & UX polish
   ========================================================= */
.bib-aria-live {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.bib-wrap .bib-empty {
  padding: 28px 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  color: var(--bib-text-subtle);
}
.bib-wrap .bib-empty-msg { font-size: 1.05em; }
.bib-wrap .bib-empty-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: center;
  max-width: 640px;
}
.bib-wrap .bib-empty-suggestions-label { margin-right: 4px; }
.bib-wrap .chip-ghost {
  padding: 4px 10px;
  border: 1px dashed var(--bib-border, rgba(0, 0, 0, 0.2));
  border-radius: 999px;
  font-size: 0.9em;
  text-decoration: none;
  color: inherit;
  background: transparent;
}
.bib-wrap .chip-ghost:hover {
  border-color: var(--bib-primary, #4a90e2);
  background: var(--bib-primary-soft, rgba(74, 144, 226, 0.08));
}

.bib-wrap .bib-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.bib-wrap .bib-skeleton-card {
  border: 1px solid var(--bib-border, rgba(0, 0, 0, 0.08));
  border-radius: 10px;
  padding: 14px;
  background: var(--bib-surface, #fff);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bib-wrap .bib-skeleton-cover {
  height: 180px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(0,0,0,0.06) 0%, rgba(0,0,0,0.12) 50%, rgba(0,0,0,0.06) 100%);
  background-size: 200% 100%;
  animation: bib-shimmer 1.2s ease-in-out infinite;
}
.bib-wrap .bib-skeleton-line {
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(0,0,0,0.06) 0%, rgba(0,0,0,0.12) 50%, rgba(0,0,0,0.06) 100%);
  background-size: 200% 100%;
  animation: bib-shimmer 1.2s ease-in-out infinite;
}
.bib-wrap .bib-skeleton-line.short { width: 55%; }
.bib-wrap .bib-skeleton-line.mid { width: 80%; }
@keyframes bib-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .bib-wrap .bib-skeleton-cover,
  .bib-wrap .bib-skeleton-line { animation: none; }
}

.bib-back-top {
  position: fixed;
  right: 20px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--bib-primary, #4a90e2);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.25);
  z-index: 50;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.bib-back-top.is-visible { opacity: 1; transform: translateY(0); }
.bib-back-top[hidden] { display: none; }

.bib-kbd-toggle {
  position: fixed;
  right: 20px;
  bottom: 76px;
  border: 1px solid var(--bib-border, rgba(0, 0, 0, 0.15));
  background: var(--bib-surface, #fff);
  border-radius: 999px;
  padding: 6px 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  font-size: 0.9em;
  color: inherit;
  z-index: 49;
}
.bib-kbd-toggle-label { font-weight: 500; }
@media (max-width: 600px) {
  .bib-kbd-toggle-label { display: none; }
  .bib-kbd-toggle { padding: 8px 10px; }
}

.bib-kbd-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.bib-kbd-modal[hidden] { display: none; }
.bib-kbd-modal .bib-kbd-dialog {
  background: var(--bib-surface, #fff);
  color: var(--bib-text, inherit);
  border-radius: 12px;
  padding: 22px 24px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}
.bib-kbd-modal h3 { margin: 0 0 10px; font-size: 1.1em; }
.bib-kbd-modal .bib-kbd-body {
  font-size: 0.95em;
  line-height: 1.6;
  margin: 0 0 16px;
  white-space: pre-wrap;
}

.bib-wrap .bib-search { position: relative; }
.bib-wrap .bib-share-btn.is-copied {
  background: var(--bib-success, #3aa14a);
  color: #fff;
  border-color: transparent;
}

/* =========================================================
   OPAC interface refresh
   ========================================================= */
.bib-wrap {
  max-width: min(1320px, calc(100vw - 32px));
  padding: clamp(28px, 4vw, 52px);
}

.bib-wrap .bib-panel {
  display: grid;
  gap: 24px;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.bib-wrap .bib-header {
  display: block;
  margin-bottom: 30px;
}

.bib-wrap .bib-heading {
  max-width: none;
}

.bib-wrap .bib-header-meta {
  margin-top: 20px;
}

.bib-wrap .bib-kicker,
.bib-wrap .bib-section-kicker,
.bib-wrap .bib-summary-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bib-muted);
}

.bib-wrap .bib-section-kicker::before,
.bib-wrap .bib-summary-kicker::before {
  content: "";
  width: 26px;
  height: 1px;
  background: currentColor;
  opacity: 0.45;
}

.bib-wrap .bib-title {
  margin: 0;
}

.bib-wrap .bib-subtitle {
  max-width: 62ch;
  margin-top: 12px;
  font-size: clamp(1rem, 1.35vw, 1.12rem);
  line-height: 1.65;
}

.bib-wrap .bib-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  gap: 0;
}

.bib-wrap .bib-stat {
  display: grid;
  gap: 4px;
  min-height: 0;
  padding: 18px 0;
  border-top: 1px solid var(--bib-text-hairline);
  border-right: none;
  border-bottom: none;
  border-left: none;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

/* Right column stats get a left-rule separator */
.bib-wrap .bib-stats > .bib-stat:nth-child(even) {
  padding-left: 20px;
  border-left: 1px solid var(--bib-text-hairline);
}

.bib-wrap .bib-search {
  gap: 22px;
  padding: clamp(16px, 2.2vw, 24px);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--bib-text-hairline);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.bib-wrap .bib-search-body {
  display: grid;
  gap: 18px;
}

.bib-wrap .bib-search-grid .row.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.bib-wrap .bib-search .cell {
  display: grid;
  gap: 8px;
}

.bib-wrap .bib-search input,
.bib-wrap .bib-search select {
  min-height: 52px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--bib-text-thin);
}

.bib-wrap .bib-search input::placeholder {
  color: var(--bib-text-subtle);
}

.bib-wrap .bib-advanced {
  padding: 14px 0 0;
  border: none;
  border-top: 1px solid var(--bib-text-hairline);
  background: transparent;
}

.bib-wrap .bib-advanced summary {
  list-style: none;
}

.bib-wrap .bib-advanced summary::-webkit-details-marker {
  display: none;
}

.bib-wrap .bib-search .row.actions {
  align-items: stretch;
  justify-content: space-between;
  gap: 16px;
}

.bib-wrap .bib-search-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  flex: 1 1 520px;
}

.bib-wrap .bib-search .order-group {
  flex: 1 1 160px;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--bib-text-hairline);
  background: rgba(255, 255, 255, 0.88);
}

.bib-wrap .bib-search .actions-group {
  justify-content: flex-end;
  align-items: center;
  align-self: end;
  margin-left: auto;
}

.bib-wrap .bib-search .btn,
.bib-wrap .detalhe-acoes .btn {
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--bib-primary) 0%, #9b6642 100%);
  box-shadow: 0 14px 28px var(--bib-primary-shadow);
}

.bib-wrap .bib-search .btn:hover,
.bib-wrap .detalhe-acoes .btn:hover {
  background: linear-gradient(135deg, #6e4025 0%, #8f5b38 100%);
  box-shadow: 0 18px 36px var(--bib-primary-shadow);
}

.bib-wrap .bib-search .btn-outline,
.bib-wrap .btn.btn-outline {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: none;
}

.bib-wrap .bib-results-shell {
  display: grid;
  gap: 18px;
}

.bib-wrap .bib-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border: none;
  border-top: 1px solid var(--bib-text-hairline);
  background: none;
}

.bib-wrap .bib-filter-label {
  padding-top: 7px;
  color: var(--bib-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.bib-wrap .bib-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1 1 0;
}

.bib-wrap .chip,
.bib-wrap .chip-ghost {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--bib-text-thin);
  background: rgba(255, 255, 255, 0.88);
  color: var(--bib-chip-color);
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.bib-wrap .chip:hover,
.bib-wrap .chip-ghost:hover {
  background: rgba(255, 255, 255, 1);
  border-color: var(--bib-primary-border);
  transform: translateY(-1px);
}

.bib-wrap .chip-clear {
  background: var(--bib-primary-soft);
  color: var(--bib-primary);
}

.bib-wrap .bib-summary-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
  padding: 18px 0;
  border: none;
  border-bottom: 1px solid var(--bib-text-hairline);
  background: none;
  box-shadow: none;
}

.bib-wrap .bib-summary-main {
  display: grid;
  gap: 6px;
}

.bib-wrap .bib-summary-count {
  font-size: clamp(1.25rem, 1.9vw, 1.6rem);
}

.bib-wrap .bib-summary-meta {
  align-self: center;
  text-align: right;
  font-size: 0.76rem;
  letter-spacing: 0.14em;
}

.bib-wrap .bib-dym {
  padding: 10px 0;
  border: none;
  border-top: 1px solid var(--bib-text-hairline);
  background: none;
}

.bib-wrap .bib-grid {
  margin-top: 6px;
  gap: clamp(18px, 2vw, 24px);
}

.bib-wrap .bib-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--bib-text-hairline);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.bib-wrap .bib-card::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.24), transparent 42%);
}

.bib-wrap .bib-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.10);
}

.bib-wrap .bib-thumb {
  width: 100%;
  max-width: none;
  grid-column: auto;
  grid-row: auto;
  padding: 0;
  border-radius: 12px;
  border: none;
  background: transparent;
  box-shadow: none;
}

.bib-wrap .bib-thumb img {
  border-radius: 10px;
  box-shadow: none;
}

.bib-wrap .bib-info {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 10px;
  grid-column: auto;
  grid-row: auto;
  padding: 0;
}

.bib-wrap .bib-meta-note {
  order: 1;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--bib-muted);
}

.bib-wrap .bib-titulo,
.bib-wrap .bib-titulo a {
  order: 2;
  grid-column: auto;
  grid-row: auto;
  margin: 0;
  font-size: clamp(1.05rem, 1.35vw, 1.2rem);
  line-height: 1.24;
}

.bib-wrap .bib-autor {
  order: 3;
  font-size: 0.97rem;
}

.bib-wrap .bib-autor .lnk-autor {
  color: var(--bib-author-color);
}

.bib-wrap .bib-meta-mini {
  order: 4;
  gap: 8px;
  margin-top: 4px;
}

.bib-wrap .bib-card .chip,
.bib-wrap .bib-detalhe .chip {
  display: inline-flex !important;
  align-items: center !important;
  min-height: 30px;
  padding: 6px 10px !important;
  border-radius: 999px !important;
  border: 1px solid var(--bib-text-thin) !important;
  background: rgba(255, 255, 255, 0.84) !important;
  box-shadow: none !important;
  color: var(--bib-chip-color) !important;
  margin-right: 0 !important;
  text-decoration: none;
}

.bib-wrap .bib-card .chip.chip-cota,
.bib-wrap .bib-detalhe .chip.chip-cota {
  color: var(--bib-chip-cota-color) !important;
  background: var(--bib-info-soft) !important;
  flex: 0 0 auto;
  width: auto;
  margin-bottom: 0;
}

.bib-wrap .bib-card .chip:hover,
.bib-wrap .bib-detalhe .chip:hover {
  text-decoration: none;
  border-color: var(--bib-primary-soft-strong) !important;
  background: rgba(255, 255, 255, 1) !important;
}

.bib-wrap .bib-excerpt {
  order: 5;
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.65;
}

.bib-wrap .bib-card-footer {
  margin-top: auto;
  display: flex;
  align-items: flex-end;
}

.bib-wrap .bib-spacer {
  display: block;
  flex: 1 1 auto;
}

.bib-wrap .bib-cta {
  width: 100%;
  margin-top: 12px;
  padding-top: 0;
}

.bib-wrap .bib-cta .btn {
  width: 100%;
  justify-content: center;
  min-height: 46px;
  border-radius: 14px !important;
}

.bib-wrap .bib-paginacao {
  margin: 8px 0 0;
  gap: 8px;
}

.bib-wrap .bib-paginacao a,
.bib-wrap .bib-paginacao .dots {
  min-width: 44px;
  padding: 10px 14px;
  border-radius: 999px;
}

.bib-wrap .bib-discovery {
  padding: clamp(20px, 2.4vw, 28px);
  border: 1px solid var(--bib-text-hairline);
  box-shadow: 0 18px 42px rgba(30, 22, 15, 0.08);
}

.bib-wrap .bib-discovery-head {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.bib-wrap .bib-discovery-list {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.bib-wrap .bib-discovery-item {
  padding: 16px;
  border: 1px solid var(--bib-text-hairline);
  background: rgba(255, 255, 255, 0.82);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.bib-wrap .bib-discovery-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(30, 22, 15, 0.10);
}

.bib-wrap.bib-detalhe {
  max-width: min(1280px, calc(100vw - 32px));
}

.bib-wrap.bib-detalhe .detalhe-head {
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: clamp(24px, 3vw, 40px);
  align-items: start;
}

.bib-wrap .detalhe-capa {
  position: sticky;
  top: 24px;
}

.bib-wrap .detalhe-capa-box {
  padding: 18px;
  border: 1px solid var(--bib-text-hairline);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(246, 240, 231, 0.72) 100%);
  box-shadow: 0 22px 48px rgba(30, 22, 15, 0.10);
}

.bib-wrap .detalhe-meta {
  display: grid;
  gap: 14px;
  align-content: start;
}

.bib-wrap .detalhe-backlink {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bib-primary);
  text-decoration: none;
}

.bib-wrap .detalhe-backlink:hover {
  text-decoration: underline;
}

.bib-wrap .detalhe-titulo {
  margin: 0;
  font-size: clamp(2rem, 3.1vw, 3.2rem);
  line-height: 1.04;
}

.bib-wrap .detalhe-subtitulo {
  margin-bottom: 2px;
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
  line-height: 1.5;
}

.bib-wrap .detalhe-autor {
  margin: 0;
  font-size: 1rem;
}

.bib-wrap .detalhe-lista-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 6px;
}

.bib-wrap .detalhe-lista-grid div {
  margin: 0;
  min-height: 64px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--bib-text-hairline);
  background: rgba(255, 255, 255, 0.76);
  line-height: 1.55;
}

/* In the detail page the fact cards are flat rows — override the generic card style above */
.bib-wrap.bib-detalhe .detalhe-lista-grid div {
  min-height: 0;
  padding: 16px 0;
  border-radius: 0;
  border: none;
  border-top: 1px solid var(--bib-text-hairline);
  background: none;
}

.bib-wrap .detalhe-temas {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 2px;
}

.bib-wrap .detalhe-temas strong {
  flex: 0 0 100%;
  margin-bottom: 2px;
}

.bib-wrap .detalhe-acoes {
  margin-top: 4px;
}

.bib-wrap .detalhe-exports {
  margin-top: 2px;
  padding-top: 16px;
  border-top: 1px solid var(--bib-text-hairline);
}

.bib-wrap .detalhe-export-link,
.bib-wrap .bib-export-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--bib-text-thin);
  background: rgba(255, 255, 255, 0.92);
  color: var(--bib-button-outline-text);
  box-shadow: none;
  text-decoration: none;
}

.bib-wrap .bib-export-link:hover,
.bib-wrap .bib-export-link:focus {
  border-color: var(--bib-primary-soft-strong);
  background: rgba(255, 255, 255, 1);
  color: var(--bib-primary);
}

.bib-wrap .detalhe-isbd,
.bib-wrap .detalhe-resumo .conteudo,
.bib-wrap .detalhe-tech,
.bib-wrap .detalhe-rel {
  border: 1px solid var(--bib-text-hairline);
  box-shadow: 0 18px 42px rgba(30, 22, 15, 0.08);
}

.bib-wrap .detalhe-resumo,
.bib-wrap .detalhe-tech,
.bib-wrap .detalhe-rel {
  margin-top: 34px;
}

.bib-wrap .detalhe-rel {
  padding: 24px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(249, 246, 241, 1) 100%);
}

.bib-wrap .detalhe-resumo h2,
.bib-wrap .detalhe-rel h2,
.bib-wrap .detalhe-tech h2,
.bib-wrap .detalhe-isbd-body h2 {
  margin-bottom: 12px;
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bib-muted);
}

.bib-wrap .detalhe-resumo .conteudo {
  padding: 24px 26px;
  line-height: 1.8;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(249, 246, 241, 1) 100%);
}

.bib-wrap .detalhe-tech {
  padding: 24px;
  border-radius: 24px;
  background: linear-gradient(180deg, var(--bib-surface-alt-hi) 0%, var(--bib-surface-hi) 100%);
}

.bib-wrap .tech-actions {
  margin-bottom: 16px;
}

.bib-wrap .bib-history,
.bib-wrap .ac-list {
  border-radius: 16px;
  border: 1px solid var(--bib-text-thin);
  box-shadow: 0 18px 36px rgba(30, 22, 15, 0.10);
}

@media (max-width: 980px) {
  .bib-wrap .bib-search .row.actions {
    flex-direction: column;
  }

  .bib-wrap .bib-search .actions-group {
    margin-left: 0;
    justify-content: flex-start;
  }

  .bib-wrap.bib-detalhe .detalhe-head {
    grid-template-columns: 1fr;
  }

  .bib-wrap .detalhe-capa {
    position: static;
  }
}

@media (max-width: 720px) {
  .bib-wrap {
    max-width: calc(100vw - 20px);
    padding: 20px 16px;
  }

  .bib-wrap .bib-stats,
  .bib-wrap .detalhe-lista-grid,
  .bib-wrap .bib-search-grid .row.two-col {
    grid-template-columns: 1fr;
  }

  .bib-wrap .bib-summary-card {
    grid-template-columns: 1fr;
  }

  .bib-wrap .bib-summary-meta {
    text-align: left;
  }

  .bib-wrap .bib-search .actions-group,
  .bib-wrap .bib-search-toolbar {
    width: 100%;
  }

  .bib-wrap .bib-search .btn,
  .bib-wrap .bib-search .btn-outline,
  .bib-wrap .bib-search .link-clear {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .bib-wrap .bib-search .link-clear {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--bib-text-hairline);
    text-decoration: none;
  }
}

/* =========================================================
   Search experience refresh — phase 3
   ========================================================= */
.bib-wrap .bib-search {
  gap: 18px;
}

.bib-wrap .bib-search-body {
  gap: 14px;
}

.bib-wrap .bib-search-primary {
  display: grid;
  gap: 10px;
  padding: 0;
  border: none;
  background: transparent;
}

.bib-wrap .bib-search-primary > label {
  margin-bottom: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bib-muted);
}

.bib-wrap .bib-search-primary .ac-wrap {
  position: relative;
}

.bib-wrap .bib-search .bib-search-primary-input {
  min-height: 52px;
  padding: 14px 16px;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.98);
}

.bib-wrap .bib-search-primary-help {
  margin: 0;
  color: var(--bib-subtitle-color);
  font-size: 0.88rem;
  line-height: 1.55;
}

.bib-wrap .bib-refine {
  padding: 14px 0 0;
  border-radius: 0;
  border: none;
  border-top: 1px solid var(--bib-text-hairline);
  background: transparent;
}

.bib-wrap .bib-refine summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bib-muted);
}

.bib-wrap .bib-refine summary::-webkit-details-marker {
  display: none;
}

.bib-wrap .bib-refine summary::after {
  content: "+";
  font-size: 1rem;
  color: var(--bib-muted);
  opacity: 0.6;
}

.bib-wrap .bib-refine[open] summary::after {
  content: "−";
}

.bib-wrap .bib-refine-grid {
  margin-top: 14px;
}

.bib-wrap .bib-search .row.actions {
  padding-top: 4px;
  border-top: 1px solid var(--bib-text-hairline);
  justify-content: flex-end;
}

.bib-wrap .bib-search .actions-group {
  gap: 10px;
}

.bib-wrap .bib-search .link-clear {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--bib-text-hairline);
  background: rgba(255, 255, 255, 0.88);
}

.bib-wrap .bib-results-shell {
  gap: 14px;
}

.bib-wrap .bib-summary-card {
  padding: 16px 0;
}

.bib-wrap .bib-summary-count {
  font-size: clamp(1.15rem, 1.75vw, 1.45rem);
}

.bib-wrap .bib-summary-meta {
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: none;
  color: var(--bib-muted);
}

.bib-wrap .bib-results-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  padding: 16px 0;
  border: none;
  border-bottom: 1px solid var(--bib-text-hairline);
  background: none;
}

.bib-wrap .bib-results-toolbar-copy {
  display: grid;
  gap: 6px;
}

.bib-wrap .bib-results-toolbar-copy strong {
  font-size: 1.02rem;
  line-height: 1.3;
  color: var(--bib-title-color);
}

.bib-wrap .bib-results-toolbar-copy p {
  margin: 0;
  color: var(--bib-subtitle-color);
  font-size: 0.88rem;
  line-height: 1.55;
}

.bib-wrap .bib-results-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  justify-content: flex-end;
}

.bib-wrap .bib-inline-control {
  display: grid;
  gap: 6px;
  min-width: 154px;
}

.bib-wrap .bib-inline-control > span {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bib-muted);
}

.bib-wrap .bib-inline-control select {
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
}

.bib-wrap .bib-results-toolbar .btn-outline.export {
  min-height: 44px;
  padding: 10px 15px;
  border-radius: 14px !important;
  align-self: end;
}

.bib-wrap .bib-filter-bar {
  padding: 12px 0;
  gap: 10px;
}

.bib-wrap .bib-filter-label {
  padding-top: 0;
}

.bib-wrap .chip,
.bib-wrap .chip-ghost {
  min-height: 36px;
  padding: 7px 12px;
}

.bib-wrap .bib-empty {
  display: grid;
  gap: 10px;
  padding: 26px 24px;
  border-radius: 24px;
  border: 1px solid var(--bib-text-hairline);
  background:
    radial-gradient(circle at top right, var(--bib-primary-glow), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 244, 237, 1) 100%);
}

.bib-wrap .bib-empty-title {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 1.65rem);
  line-height: 1.18;
}

.bib-wrap .bib-empty-context,
.bib-wrap .bib-empty-msg {
  margin: 0;
  color: var(--bib-subtitle-color);
}

.bib-wrap .bib-empty-actions {
  margin-top: 2px;
}

.bib-wrap .bib-empty-actions .btn {
  min-height: 42px;
  border-radius: 14px !important;
}

.bib-wrap .bib-idle-hero {
  display: grid;
  gap: 16px;
  padding: clamp(22px, 2.8vw, 30px);
  border-radius: 26px;
  border: 1px solid var(--bib-text-hairline);
  background:
    radial-gradient(circle at top right, var(--bib-primary-glow), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 244, 237, 1) 100%);
  box-shadow: 0 18px 42px rgba(30, 22, 15, 0.08);
}

.bib-wrap .bib-idle-hero-copy {
  max-width: 720px;
}

.bib-wrap .bib-idle-hero h2 {
  margin: 0;
  font-size: clamp(1.5rem, 2.25vw, 2rem);
  line-height: 1.12;
}

.bib-wrap .bib-idle-hero p {
  margin: 10px 0 0;
  color: var(--bib-subtitle-color);
  line-height: 1.7;
}

.bib-wrap .bib-idle-hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 980px) {
  .bib-wrap .bib-results-toolbar {
    grid-template-columns: 1fr;
  }

  .bib-wrap .bib-results-toolbar-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .bib-wrap .bib-search-primary {
    padding: 16px;
  }

  .bib-wrap .bib-search .bib-search-primary-input {
    min-height: 58px;
    padding: 16px;
  }

  .bib-wrap .bib-results-toolbar-actions,
  .bib-wrap .bib-inline-control {
    width: 100%;
  }

  .bib-wrap .bib-inline-control {
    min-width: 0;
  }

  .bib-wrap .bib-results-toolbar .btn-outline.export,
  .bib-wrap .bib-search .actions-group .btn,
  .bib-wrap .bib-search .actions-group .link-clear {
    width: 100%;
  }

  .bib-wrap .bib-search .actions-group {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
}

/* =========================================================
   Results cards refresh — phase 4
   ========================================================= */
.bib-wrap .bib-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(18px, 2vw, 26px);
  align-items: stretch;
}

.bib-wrap[data-view="cards"] .bib-grid {
  display: grid;
}

.bib-wrap .bib-card {
  display: grid;
  grid-template-columns: min(220px, 35%) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  gap: 18px;
  padding: clamp(18px, 2vw, 24px);
  border-radius: 20px;
  border: 1px solid var(--bib-text-hairline);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  min-height: 100%;
  height: 100%;
  align-content: start;
}

.bib-wrap .bib-card::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 36%);
}

.bib-wrap .bib-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.10);
}

.bib-wrap .bib-card.is-coverless {
  grid-template-rows: 1fr;
}

.bib-wrap .bib-thumb {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  margin: 0;
  padding: 0;
  border-radius: 14px;
  background: transparent;
  box-shadow: none;
  border: none;
  aspect-ratio: var(--bib-cover-ratio);
  overflow: hidden;
  align-self: start;
}

.bib-wrap .bib-thumb img {
  border-radius: 12px;
  box-shadow: none;
}

.bib-wrap .bib-card-head {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  gap: 8px;
  align-content: start;
}

.bib-wrap .bib-card-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bib-muted);
}

.bib-wrap .bib-titulo,
.bib-wrap .bib-titulo a {
  margin: 0;
  font-size: clamp(1.08rem, 1.3vw, 1.3rem);
  line-height: 1.2;
}

.bib-wrap .bib-titulo {
  -webkit-line-clamp: 3;
}

.bib-wrap .bib-autor {
  font-size: 0.96rem;
  line-height: 1.6;
  color: var(--bib-author-color);
}

.bib-wrap .bib-autor .lnk-autor {
  margin-right: 0;
}

.bib-wrap .bib-author-sep {
  color: var(--bib-text-dim);
}

.bib-wrap .bib-excerpt {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--bib-excerpt-color);
  -webkit-line-clamp: 2;
}

.bib-wrap .bib-card-footer {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.bib-wrap .bib-card-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-height: 32px;
}

/* Cota chip stays as a pill; topic links are now .tema-link (inline + underline) */
.bib-wrap .bib-card-signals .chip.chip-cota {
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--bib-text-thin);
  background: var(--bib-info-soft);
  color: var(--bib-chip-cota-color);
  font-size: 0.75rem;
  font-weight: 600;
  margin-right: 8px;
}

.bib-wrap .bib-cta {
  width: 100%;
  margin-top: 0;
  padding-top: 0;
}

.bib-wrap .bib-cta .btn {
  width: 100%;
  min-height: 44px;
  border-radius: 16px !important;
  justify-content: center;
}

.bib-wrap .bib-isbd {
  display: grid;
  gap: 14px;
}

.bib-wrap .bib-isbd-item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 18px;
  padding: 18px 20px;
  border-radius: 22px;
  border: 1px solid var(--bib-text-hairline);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(249, 246, 241, 1) 100%);
  box-shadow: 0 14px 34px rgba(30, 22, 15, 0.08);
}

.bib-wrap .bib-isbd-cover {
  width: 100%;
  align-self: start;
  border-radius: 18px;
}

.bib-wrap .bib-isbd-cover img {
  border-radius: 12px;
}

.bib-wrap .bib-isbd-body {
  display: grid;
  gap: 12px;
  align-content: start;
}

.bib-wrap .bib-isbd-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: baseline;
  justify-content: space-between;
}

.bib-wrap .bib-isbd-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bib-muted);
}

.bib-wrap .bib-isbd-kicker::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
  opacity: 0.4;
}

.bib-wrap .bib-isbd-meta {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bib-muted);
}

.bib-wrap .bib-isbd-line {
  font-family: var(--bib-font-title);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--bib-title-color);
  text-decoration: none;
}

.bib-wrap .bib-isbd-line:hover,
.bib-wrap .bib-isbd-line:focus {
  color: var(--bib-primary);
}

.bib-wrap .bib-isbd-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding-top: 2px;
}

.bib-wrap .bib-isbd-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bib-wrap .bib-isbd-signals .chip {
  min-height: 30px;
  padding: 5px 10px !important;
}

.bib-wrap .bib-isbd-cta .btn {
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px !important;
}

.bib-wrap .bib-isbd-item.is-coverless {
  grid-template-columns: 1fr;
}

.bib-wrap[data-card-align="center"] .bib-card,
.bib-wrap[data-card-align="center"] .bib-isbd-body {
  text-align: center;
}

.bib-wrap[data-card-align="center"] .bib-card-signals,
.bib-wrap[data-card-align="center"] .bib-card-kicker,
.bib-wrap[data-card-align="center"] .bib-isbd-head,
.bib-wrap[data-card-align="center"] .bib-isbd-foot {
  justify-content: center;
}

@media (max-width: 980px) {
  .bib-wrap .bib-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .bib-wrap .bib-grid {
    grid-template-columns: 1fr;
  }

  .bib-wrap .bib-card {
    padding: 18px;
    border-radius: 22px;
  }

  .bib-wrap .bib-thumb {
    width: min(100%, 180px);
  }

  .bib-wrap .bib-isbd-item {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .bib-wrap .bib-isbd-cover {
    max-width: 108px;
  }

  .bib-wrap .bib-isbd-foot {
    flex-direction: column;
    align-items: flex-start;
  }

  .bib-wrap[data-card-align="center"] .bib-isbd-foot {
    align-items: center;
  }
}

/* =========================================================
   Fase 5 — Detail page refresh
   ========================================================= */
.bib-wrap.bib-detalhe {
  max-width: min(1320px, calc(100vw - 32px));
  gap: clamp(28px, 4vw, 42px);
}

.bib-wrap.bib-detalhe .detalhe-head {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 52px);
  align-items: start;
  margin-bottom: clamp(30px, 4vw, 42px);
}

.bib-wrap.bib-detalhe .detalhe-capa {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 18px;
  align-self: start;
}

.bib-wrap.bib-detalhe .detalhe-capa-box,
.bib-wrap.bib-detalhe .detalhe-utility-card,
.bib-wrap.bib-detalhe .detalhe-facts,
.bib-wrap.bib-detalhe .detalhe-summary-card,
.bib-wrap.bib-detalhe .detalhe-reference-card,
.bib-wrap.bib-detalhe .detalhe-tech,
.bib-wrap.bib-detalhe .detalhe-rel,
.bib-wrap.bib-detalhe .detalhe-temas-wrap {
  border: 1px solid var(--bib-text-hairline);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 244, 237, 0.92) 100%);
  box-shadow: 0 22px 46px rgba(30, 22, 15, 0.08);
}

.bib-wrap.bib-detalhe .detalhe-capa-box {
  padding: 20px;
  border-radius: 28px;
}

.bib-wrap.bib-detalhe .detalhe-capa-box img {
  border-radius: 18px;
}

.bib-wrap.bib-detalhe .detalhe-main {
  display: grid;
  gap: 22px;
  align-content: start;
}

.bib-wrap.bib-detalhe .detalhe-head-copy {
  display: grid;
  gap: 12px;
}

.bib-wrap.bib-detalhe .detalhe-backlink {
  width: fit-content;
}

.bib-wrap.bib-detalhe .detalhe-titulo {
  margin: 0;
  font-size: clamp(2.4rem, 4vw, 4.1rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.bib-wrap.bib-detalhe .detalhe-subtitulo {
  margin: 0;
  max-width: 48rem;
  font-size: clamp(1.05rem, 1.5vw, 1.34rem);
  line-height: 1.6;
  color: var(--bib-muted);
  color: color-mix(in srgb, var(--bib-text, #1f2937) 74%, white);
}

.bib-wrap.bib-detalhe .detalhe-autor {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
  margin: 0;
  font-size: 1rem;
}

.bib-wrap.bib-detalhe .detalhe-autor strong {
  color: var(--bib-text, #1f2937);
}

.bib-wrap.bib-detalhe .detalhe-autor a {
  color: var(--bib-primary);
  text-decoration: none;
}

.bib-wrap.bib-detalhe .detalhe-autor a:hover,
.bib-wrap.bib-detalhe .detalhe-autor a:focus {
  text-decoration: underline;
}

.bib-wrap.bib-detalhe .detalhe-editorial {
  display: grid;
  gap: 14px;
  margin-top: 4px;
  padding-top: 18px;
  border-top: 1px solid var(--bib-text-hairline);
}

.bib-wrap.bib-detalhe .detalhe-edition-line {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.7;
  color: var(--bib-muted);
}

.bib-wrap.bib-detalhe .detalhe-signals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 28px;
}

.bib-wrap.bib-detalhe .detalhe-signal {
  display: grid;
  gap: 3px;
  padding: 13px 0;
  border-top: 1px solid var(--bib-text-hairline);
  border-right: none;
  margin: 0;
}

.bib-wrap.bib-detalhe .detalhe-signal-label {
  font-size: 0.61rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bib-muted);
}

.bib-wrap.bib-detalhe .detalhe-signal-value {
  font-size: 0.93rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--bib-text, #1f2937);
}

.bib-wrap.bib-detalhe .detalhe-section-head,
.bib-wrap.bib-detalhe .detalhe-related-head {
  display: grid;
  gap: 8px;
}

.bib-wrap.bib-detalhe .detalhe-section-head-compact {
  gap: 6px;
}

.bib-wrap.bib-detalhe .detalhe-section-head .bib-section-kicker,
.bib-wrap.bib-detalhe .detalhe-related-head .bib-section-kicker {
  margin: 0;
}

.bib-wrap.bib-detalhe .detalhe-section-head h2,
.bib-wrap.bib-detalhe .detalhe-related-head h2 {
  margin: 0;
  font-size: clamp(1.16rem, 1.7vw, 1.5rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
  text-transform: none;
  color: var(--bib-text, #1f2937);
}

.bib-wrap.bib-detalhe .detalhe-section-note {
  margin: 0;
  max-width: 64ch;
  font-size: 0.96rem;
  line-height: 1.65;
  color: var(--bib-muted);
}

.bib-wrap.bib-detalhe .detalhe-temas-wrap,
.bib-wrap.bib-detalhe .detalhe-facts,
.bib-wrap.bib-detalhe .detalhe-utility-card,
.bib-wrap.bib-detalhe .detalhe-summary-card,
.bib-wrap.bib-detalhe .detalhe-reference-card,
.bib-wrap.bib-detalhe .detalhe-tech,
.bib-wrap.bib-detalhe .detalhe-rel {
  padding: 24px;
  border-radius: 28px;
}

.bib-wrap.bib-detalhe .detalhe-temas-wrap {
  display: grid;
  gap: 14px;
}

.bib-wrap.bib-detalhe .detalhe-head-topics {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--bib-text-hairline);
}

.bib-wrap.bib-detalhe .detalhe-head-tech {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--bib-text-hairline);
}

.bib-wrap.bib-detalhe .detalhe-head-tech .tech-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 0;
}

.bib-wrap.bib-detalhe .tech-link {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--bib-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  cursor: pointer;
  transition: color 0.15s;
}

.bib-wrap.bib-detalhe .tech-link:hover,
.bib-wrap.bib-detalhe .tech-link[aria-expanded="true"],
.bib-wrap.bib-detalhe .tech-link.is-active {
  color: var(--bib-primary);
  text-decoration-color: var(--bib-primary);
}

.bib-wrap.bib-detalhe .detalhe-head-tech .tech-block-wrap {
  margin-top: 4px;
}

.bib-wrap.bib-detalhe .detalhe-temas {
  display: block;
  line-height: 1.9;
  margin: 0;
}

.bib-wrap.bib-detalhe .detalhe-temas strong {
  display: none;
}

/* ── Temas: inline underlined links separated by · ───────────────── */
.bib-wrap .tema-link {
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  color: var(--bib-text, #1f2937);
  text-decoration-color: color-mix(in srgb, var(--bib-text, #1f2937) 35%, transparent);
  transition: color 0.15s, text-decoration-color 0.15s;
  padding: 0;
  border: none;
  background: none;
  border-radius: 0;
  display: inline;
  margin-right: 0;
}

.bib-wrap .tema-link:hover {
  color: var(--bib-primary);
  text-decoration-color: var(--bib-primary);
  text-decoration-color: color-mix(in srgb, var(--bib-primary) 70%, transparent);
}

.bib-wrap .tema-sep {
  color: var(--bib-muted);
  font-weight: 400;
  user-select: none;
  padding: 0 0.3em;
}

.bib-wrap .tema-more {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--bib-muted);
}

/* Card signals area: topics are inline tema-links, no chip borders */
.bib-wrap .bib-card-signals {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0;
  line-height: 1.8;
  min-height: 0;
}

.bib-wrap.bib-detalhe .detalhe-facts {
  display: grid;
  gap: 18px;
}

.bib-wrap.bib-detalhe .detalhe-lista-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 32px;
  margin: 0;
}

.bib-wrap.bib-detalhe .detalhe-fact-card {
  min-height: 0;
  margin: 0;
  padding: 16px 0;
  border-top: 1px solid var(--bib-text-hairline);
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-bottom: none;
  background: none;
}

.bib-wrap.bib-detalhe .detalhe-fact-card dt {
  margin: 0;
  font-size: 0.61rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bib-muted);
}

.bib-wrap.bib-detalhe .detalhe-fact-card dd {
  margin: 5px 0 0;
  font-size: 0.97rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--bib-text, #1f2937);
}

.bib-wrap.bib-detalhe .detalhe-utility-card {
  display: grid;
  gap: 16px;
}

.bib-wrap.bib-detalhe .detalhe-acoes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
}

.bib-wrap.bib-detalhe .detalhe-acoes .btn {
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 999px;
}

.bib-wrap.bib-detalhe .bib-qr-panel {
  margin-top: 0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
}

.bib-wrap.bib-detalhe .detalhe-exports {
  gap: 8px;
  margin-top: 0;
  padding-top: 16px;
  border-top: 1px solid var(--bib-text-hairline);
}

.bib-wrap.bib-detalhe .detalhe-body-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.95fr);
  gap: 24px;
  align-items: start;
}

.bib-wrap.bib-detalhe .detalhe-body-grid .detalhe-resumo,
.bib-wrap.bib-detalhe .detalhe-body-grid .detalhe-tech,
.bib-wrap.bib-detalhe .detalhe-body-grid .detalhe-isbd {
  margin-top: 0;
}

.bib-wrap.bib-detalhe .detalhe-summary-card {
  display: grid;
  gap: 16px;
  grid-row: 1 / span 2;
}

.bib-wrap.bib-detalhe .detalhe-summary-card .conteudo {
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 1.02rem;
  line-height: 1.9;
  color: var(--bib-text, #1f2937);
}

.bib-wrap.bib-detalhe .detalhe-reference-card {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.bib-wrap.bib-detalhe .detalhe-reference-card .detalhe-isbd-body {
  display: grid;
  gap: 14px;
  width: 100%;
  min-width: 0;
  grid-column: 1 / -1;
}

.bib-wrap.bib-detalhe .detalhe-isbd-line {
  margin: 0;
  width: 100%;
  max-width: none;
  padding: 18px 20px;
  border-left: 4px solid var(--bib-primary, #7a4b2e);
  border-left: 4px solid color-mix(in srgb, var(--bib-primary, #7a4b2e) 72%, white);
  border-radius: 0 18px 18px 0;
  background: rgba(255, 255, 255, 0.84);
  font-size: 1rem;
  line-height: 1.78;
  box-sizing: border-box;
  word-break: normal;
  overflow-wrap: break-word;
}

.bib-wrap.bib-detalhe .detalhe-tech {
  display: grid;
  gap: 16px;
}

.bib-wrap.bib-detalhe .tech-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
}

.bib-wrap.bib-detalhe .detalhe-tech .tech-block-wrap {
  margin-top: 0;
}

.bib-wrap.bib-detalhe .detalhe-rel {
  display: grid;
  gap: 20px;
}

.bib-wrap.bib-detalhe .detalhe-rel .bib-grid {
  grid-template-columns: repeat(var(--bib-grid-cols), minmax(0, 1fr));
  gap: 18px;
}

@media (max-width: 1080px) {
  .bib-wrap.bib-detalhe .detalhe-body-grid {
    grid-template-columns: 1fr;
  }

  .bib-wrap.bib-detalhe .detalhe-summary-card {
    grid-row: auto;
  }
}

@media (max-width: 980px) {
  .bib-wrap.bib-detalhe .detalhe-head {
    grid-template-columns: 1fr;
  }

  .bib-wrap.bib-detalhe .detalhe-capa {
    position: static;
  }
}

@media (max-width: 720px) {
  .bib-wrap.bib-detalhe {
    max-width: calc(100vw - 20px);
  }

  .bib-wrap.bib-detalhe .detalhe-capa-box,
  .bib-wrap.bib-detalhe .detalhe-utility-card,
  .bib-wrap.bib-detalhe .detalhe-facts,
  .bib-wrap.bib-detalhe .detalhe-summary-card,
  .bib-wrap.bib-detalhe .detalhe-reference-card,
  .bib-wrap.bib-detalhe .detalhe-tech,
  .bib-wrap.bib-detalhe .detalhe-rel,
  .bib-wrap.bib-detalhe .detalhe-temas-wrap {
    padding: 18px;
    border-radius: 22px;
  }

  .bib-wrap.bib-detalhe .detalhe-titulo {
    max-width: none;
    font-size: clamp(2rem, 9vw, 2.8rem);
  }

  .bib-wrap.bib-detalhe .detalhe-lista-grid {
    grid-template-columns: 1fr;
  }

  .bib-wrap.bib-detalhe .detalhe-acoes .btn,
  .bib-wrap.bib-detalhe .bib-export-link {
    width: 100%;
  }

  .bib-wrap.bib-detalhe .detalhe-acoes,
  .bib-wrap.bib-detalhe .detalhe-exports {
    flex-direction: column;
    align-items: stretch;
  }
}

@media print {
  body.bib-print-mode .detalhe-utility-card,
  body.bib-print-mode .bib-qr-panel,
  body.bib-print-mode .detalhe-exports,
  body.bib-print-mode .detalhe-tech,
  body.bib-print-mode .detalhe-rel {
    display: none !important;
  }

  body.bib-print-mode .detalhe-head {
    grid-template-columns: 180px 1fr !important;
  }

  body.bib-print-mode .detalhe-facts,
  body.bib-print-mode .detalhe-summary-card,
  body.bib-print-mode .detalhe-reference-card {
    box-shadow: none !important;
    background: #fff !important;
    border-color: #d7d7d7 !important;
  }
}

.bib-wrap .bib-search-help-stack {
  display: grid;
  gap: 6px;
}

.bib-wrap .bib-search-inline-note {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--bib-muted);
}

.bib-wrap .bib-search-inline-note-focus {
  font-weight: 600;
  color: var(--bib-primary);
}

.bib-back-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.bib-back-top-icon {
  font-size: 1rem;
  line-height: 1;
}

.bib-back-top-text {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.bib-wrap.bib-detalhe .detalhe-layout-builder {
  display: grid;
  gap: 24px;
}

/* Reset any stray individual margins so only the grid gap controls spacing */
.bib-wrap.bib-detalhe .detalhe-resumo,
.bib-wrap.bib-detalhe .detalhe-isbd,
.bib-wrap.bib-detalhe .detalhe-rel {
  margin: 0;
}

.bib-wrap.bib-detalhe .detalhe-region {
  display: grid;
  gap: 24px;
  align-items: start;
}

.bib-wrap.bib-detalhe .detalhe-region-hero,
.bib-wrap.bib-detalhe .detalhe-region-body {
  grid-template-columns: repeat(var(--detail-region-cols, 1), minmax(0, 1fr));
  grid-auto-flow: row dense;
}

.bib-wrap.bib-detalhe .detalhe-region-footer {
  grid-template-columns: 1fr;
}

.bib-wrap.bib-detalhe .detalhe-block {
  min-width: 0;
  align-self: start;
}

.bib-wrap.bib-detalhe .detalhe-block .detalhe-capa {
  position: static;
  top: auto;
}

.bib-wrap.bib-detalhe .detail-span-2 {
  grid-column: span 2;
}

.bib-wrap.bib-detalhe .detail-span-3 {
  grid-column: span 3;
}

.bib-wrap.bib-detalhe .detail-span-4 {
  grid-column: span 4;
}

.bib-wrap.bib-detalhe .detail-span-full {
  grid-column: 1 / -1;
}

.bib-wrap.bib-detalhe .detalhe-lista-grid {
  grid-template-columns: repeat(var(--bib-detail-fact-cols, 2), minmax(0, 1fr));
}

.bib-wrap.bib-detalhe .detail-fact-span-2 {
  grid-column: span 2;
}

.bib-wrap.bib-detalhe .detail-fact-span-3 {
  grid-column: span 3;
}

.bib-wrap.bib-detalhe .detail-fact-span-4 {
  grid-column: span 4;
}

.bib-wrap.bib-detalhe .detail-fact-span-full {
  grid-column: 1 / -1;
}

@media (max-width: 980px) {
  .bib-wrap.bib-detalhe .detalhe-region-hero,
  .bib-wrap.bib-detalhe .detalhe-region-body {
    grid-template-columns: 1fr;
  }

  .bib-wrap.bib-detalhe .detalhe-lista-grid {
    grid-template-columns: repeat(var(--bib-detail-fact-cols-tablet, 1), minmax(0, 1fr));
  }

  .bib-wrap.bib-detalhe .detail-span-2,
  .bib-wrap.bib-detalhe .detail-span-3,
  .bib-wrap.bib-detalhe .detail-span-4,
  .bib-wrap.bib-detalhe .detail-span-full,
  .bib-wrap.bib-detalhe .detail-fact-span-2,
  .bib-wrap.bib-detalhe .detail-fact-span-3,
  .bib-wrap.bib-detalhe .detail-fact-span-4,
  .bib-wrap.bib-detalhe .detail-fact-span-full {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .bib-wrap.bib-detalhe .detalhe-lista-grid {
    grid-template-columns: repeat(var(--bib-detail-fact-cols-mobile, 1), minmax(0, 1fr));
  }
}

/* =========================================================
   Fase 6 — Accessibility, performance and finish
   ========================================================= */
.bib-wrap a:focus-visible,
.bib-wrap button:focus-visible,
.bib-wrap summary:focus-visible,
.bib-wrap [tabindex]:focus-visible,
.bib-wrap .chip:focus-visible,
.bib-wrap .chip-ghost:focus-visible,
.bib-wrap .bib-export-link:focus-visible,
.bib-wrap .detalhe-autor a:focus-visible {
  outline: 3px solid var(--bib-primary, #7a4b2e);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--bib-primary-soft, rgba(122, 75, 46, 0.14));
}

.bib-wrap .bib-history-item button:focus-visible,
.bib-lightbox .bib-lightbox-close:focus-visible {
  outline: 3px solid var(--bib-primary, #7a4b2e);
  outline-offset: 3px;
}

.bib-wrap[aria-busy="true"] {
  cursor: progress;
}

.bib-wrap.is-loading::before {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.74) 0%, rgba(248, 244, 237, 0.82) 100%);
  backdrop-filter: blur(2px);
  z-index: 9998;
}

.bib-wrap.is-loading::after {
  content: attr(data-loading);
  position: fixed;
  top: 50%;
  left: 50%;
  inset: auto;
  min-width: 220px;
  padding: 16px 18px 16px 22px;
  border: 1px solid var(--bib-text-thin);
  border-left: 4px solid var(--bib-primary, #7a4b2e);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 244, 237, 0.96) 100%);
  box-shadow: 0 24px 50px rgba(30, 22, 15, 0.16);
  transform: translate(-50%, -50%);
  text-align: left;
  letter-spacing: 0.01em;
  z-index: 9999;
}

.bib-wrap.is-loading .bib-search,
.bib-wrap.is-loading .bib-results-toolbar,
.bib-wrap.is-loading [data-role="filters"],
.bib-wrap.is-loading [data-role="pagination"] {
  pointer-events: none;
}

.bib-wrap .bib-skeleton-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.bib-wrap .bib-summary-card.is-empty {
  gap: 10px;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  padding: 18px 20px;
  border: 1px solid var(--bib-error-soft);
  background: linear-gradient(180deg, rgba(255, 250, 249, 1) 0%, rgba(255, 244, 242, 1) 100%);
}

.bib-wrap .bib-error {
  font-weight: 700;
}

.bib-wrap .bib-error-note {
  font-size: 0.94em;
  line-height: 1.6;
  color: var(--bib-muted);
}

.bib-wrap .tech-actions .btn.btn-outline.is-active,
.bib-wrap .btn.btn-outline.is-active {
  border-color: var(--bib-primary, #7a4b2e);
  background: var(--bib-primary, #7a4b2e);
  color: #fff;
  box-shadow: 0 16px 28px var(--bib-primary-shadow);
}

.bib-wrap .bib-qr-panel:focus-visible {
  outline: 3px solid var(--bib-primary, #7a4b2e);
  outline-offset: 3px;
}

.bib-lightbox .bib-lightbox-img {
  border-radius: 12px;
}

@media (max-width: 720px) {
  .bib-wrap.is-loading::after {
    min-width: min(240px, calc(100vw - 40px));
    padding: 14px 16px 14px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bib-wrap .detalhe-capa-box.is-zoomable,
  .bib-lightbox,
  .bib-wrap.is-loading::before,
  .bib-wrap.is-loading::after,
  .bib-wrap .tech-actions .btn.btn-outline.is-active,
  .bib-wrap .btn.btn-outline.is-active {
    animation: none !important;
    transition: none !important;
  }
}

/* =========================================================
   Backoffice fidelity overrides
   Ensure admin controls win over later editorial hardcodes.
   ========================================================= */
.bib-wrap {
  max-width: min(var(--bib-wrap-max-width), calc(100vw - 32px));
  padding: var(--bib-wrap-padding-y) var(--bib-wrap-padding-x);
  border: none;
  border-radius: var(--bib-wrap-radius);
}

.bib-wrap .bib-panel {
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.bib-wrap .bib-title {
  font-size: var(--bib-header-title-size);
  font-family: var(--bib-font-title);
  font-weight: var(--bib-weight-title);
  font-style: var(--bib-style-title);
  color: var(--bib-title-color);
}

.bib-wrap .bib-subtitle {
  font-size: var(--bib-header-subtitle-size);
  font-family: var(--bib-font-subtitle);
  font-weight: var(--bib-weight-subtitle);
  font-style: var(--bib-style-subtitle);
  color: var(--bib-subtitle-color);
}

.bib-wrap .bib-kicker,
.bib-wrap .bib-section-kicker,
.bib-wrap .bib-summary-kicker,
.bib-wrap .bib-card-kicker,
.bib-wrap .bib-isbd-kicker,
.bib-wrap .bib-filter-label,
.bib-wrap .bib-back-top-text {
  font-size: var(--bib-kicker-size);
  font-family: var(--bib-font-kicker);
  font-weight: var(--bib-weight-kicker);
  font-style: var(--bib-style-kicker);
  color: var(--bib-kicker-color);
}

.bib-wrap .bib-stat {
  border-top-color: var(--bib-border);
  border-left-color: var(--bib-border);
  border-radius: var(--bib-stat-radius);
  background: none;
  box-shadow: var(--bib-stat-shadow);
}

.bib-wrap .bib-stat-value {
  font-size: var(--bib-stat-value-size);
  font-family: var(--bib-font-stat-value);
  font-weight: var(--bib-weight-stat-value);
  font-style: var(--bib-style-stat-value);
  color: var(--bib-stat-value-color);
}

.bib-wrap .bib-stat-label {
  font-size: var(--bib-stat-label-size);
  font-family: var(--bib-font-stat-label);
  font-weight: var(--bib-weight-stat-label);
  font-style: var(--bib-style-stat-label);
  color: var(--bib-stat-label-color);
}

.bib-wrap .bib-search {
  padding: var(--bib-search-padding);
  border-color: var(--bib-border);
  border-radius: var(--bib-search-radius);
  background: var(--bib-surface);
  box-shadow: var(--bib-search-shadow);
}

.bib-wrap .bib-search label {
  font-size: var(--bib-label-size);
  font-family: var(--bib-font-label);
  font-weight: var(--bib-weight-label);
  font-style: var(--bib-style-label);
  color: var(--bib-label-color);
}

.bib-wrap .bib-advanced {
  border: none;
  border-top: 1px solid var(--bib-border);
  border-radius: 0;
  background: transparent;
  padding: 14px 0 0;
}

.bib-wrap .bib-advanced summary {
  font-size: var(--bib-advanced-label-size);
  font-family: var(--bib-font-advanced);
  font-weight: var(--bib-weight-advanced);
  font-style: var(--bib-style-advanced);
  color: var(--bib-advanced-label-color);
}

.bib-wrap .bib-search input,
.bib-wrap .bib-search select {
  border-color: var(--bib-input-border-color);
  border-radius: var(--bib-input-radius);
  background: var(--bib-input-bg-color);
  color: var(--bib-input-text-color);
  font-size: var(--bib-input-size);
  font-family: var(--bib-font-input);
  font-weight: var(--bib-weight-input);
  font-style: var(--bib-style-input);
}

.bib-wrap .bib-search input:focus,
.bib-wrap .bib-search select:focus {
  border-color: var(--bib-input-focus-border-color);
  background: var(--bib-input-focus-bg-color);
}

.bib-wrap .bib-search .order-group {
  border-color: var(--bib-border);
  border-radius: var(--bib-advanced-radius);
  background: var(--bib-surface);
}

.bib-wrap .bib-search .link-clear {
  font-size: var(--bib-link-size);
  font-family: var(--bib-font-link);
  font-weight: var(--bib-weight-link);
  font-style: var(--bib-style-link);
  color: var(--bib-link-clear-color);
}

.bib-wrap .bib-search .link-clear:hover,
.bib-wrap .bib-search .link-clear:focus {
  color: var(--bib-link-clear-hover-color);
}

.bib-wrap .bib-search .btn,
.bib-wrap .detalhe-acoes .btn,
.bib-wrap .bib-cta .btn,
.bib-wrap .bib-isbd-cta .btn,
.bib-wrap .bib-discovery-body .btn {
  border-radius: var(--bib-button-radius) !important;
}

.bib-wrap .bib-search .btn:not(.btn-outline),
.bib-wrap .detalhe-acoes .btn:not(.btn-outline) {
  background: var(--bib-primary);
  color: var(--bib-button-primary-text);
}

.bib-wrap .bib-search .btn-outline,
.bib-wrap .detalhe-acoes .btn-outline,
.bib-wrap .bib-export-link,
.bib-wrap .detalhe-export-link {
  background: var(--bib-button-outline-bg);
  color: var(--bib-button-outline-text);
  border-color: var(--bib-border);
}

.bib-wrap .ac-list {
  border-color: var(--bib-border);
  border-radius: var(--bib-autocomplete-radius);
  background: var(--bib-autocomplete-bg);
  box-shadow: var(--bib-autocomplete-shadow);
}

.bib-wrap .ac-item {
  font-size: var(--bib-autocomplete-size);
  font-family: var(--bib-font-autocomplete);
  font-weight: var(--bib-weight-autocomplete);
  font-style: var(--bib-style-autocomplete);
  color: var(--bib-autocomplete-text-color);
}

.bib-wrap .bib-summary-card {
  border-bottom-color: var(--bib-border);
  border-radius: var(--bib-summary-radius);
  background: none;
  box-shadow: var(--bib-summary-shadow);
}

.bib-wrap .bib-summary-count {
  font-size: var(--bib-summary-count-size);
  font-family: var(--bib-font-summary-count);
  font-weight: var(--bib-weight-summary-count);
  font-style: var(--bib-style-summary-count);
  color: var(--bib-summary-count-color);
}

.bib-wrap .bib-summary-meta {
  font-size: var(--bib-summary-meta-size);
  font-family: var(--bib-font-summary-meta);
  font-weight: var(--bib-weight-summary-meta);
  font-style: var(--bib-style-summary-meta);
  color: var(--bib-summary-meta-color);
}

.bib-wrap .bib-summary-card.is-empty {
  border-radius: var(--bib-empty-radius);
  color: var(--bib-empty-text-color);
}

.bib-wrap .bib-grid {
  grid-template-columns: repeat(var(--bib-grid-cols), minmax(0, 1fr));
  gap: var(--bib-gap);
}

.bib-wrap .bib-card {
  display: grid;
  grid-template-columns: minmax(0, var(--bib-card-cover-width)) minmax(0, 1fr);
  grid-template-rows: minmax(var(--bib-card-head-slot), auto) 1fr;
  --bib-card-kicker-slot: calc((var(--bib-kicker-size) * 1.25) + 0.3rem);
  --bib-card-title-slot: calc((var(--bib-card-title-size) * var(--bib-card-title-lines) * 1.25) + 0.2rem);
  --bib-card-author-slot: calc((var(--bib-author-size) * 3 * 1.55) + 0.2rem);
  --bib-card-head-slot: max(
    10.5rem,
    calc(var(--bib-card-kicker-slot) + var(--bib-card-title-slot) + var(--bib-card-author-slot) + 1rem)
  );
  --bib-card-signals-slot: 2rem;
  --bib-card-excerpt-slot: calc((var(--bib-excerpt-size) * var(--bib-card-excerpt-lines) * 1.7) + 0.85rem);
  --bib-card-cta-slot: 3.5rem;
  gap: calc((var(--bib-card-gap-row) + 3px) * var(--bib-density))
    calc((var(--bib-card-gap-col) + 4px) * var(--bib-density));
  padding: calc((var(--bib-card-padding) + 6px) * var(--bib-density));
  border-width: var(--bib-card-border-width);
  border-style: solid;
  border-color: var(--bib-border);
  border-radius: var(--bib-card-radius);
  background: var(--bib-surface);
  box-shadow: var(--bib-card-shadow);
}

.bib-wrap .bib-card:hover {
  box-shadow: var(--bib-card-hover-shadow);
}

.bib-wrap .bib-card.is-coverless {
  grid-template-columns: 1fr;
}

.bib-wrap[data-layout="editorial"] .bib-card,
.bib-wrap[data-layout="gallery"] .bib-card {
  grid-template-columns: 1fr;
  grid-template-rows: auto auto 1fr;
}

.bib-wrap .bib-thumb {
  grid-column: 1;
  grid-row: 1;
  width: min(100%, var(--bib-card-cover-width));
  max-width: var(--bib-card-cover-width);
  margin: 0;
  padding: 0;
  border-radius: max(0px, calc(var(--bib-card-radius) - 2px));
  border: none;
  background: transparent;
  box-shadow: none;
  aspect-ratio: var(--bib-cover-ratio);
  overflow: hidden;
  align-self: start;
}

.bib-wrap[data-layout="editorial"] .bib-thumb {
  grid-column: 1;
  grid-row: 1;
  width: min(100%, var(--bib-card-cover-top-width));
  max-width: var(--bib-card-cover-top-width);
  margin: 0 auto;
}

.bib-wrap[data-layout="gallery"] .bib-thumb {
  grid-column: 1;
  grid-row: 1;
  width: min(100%, var(--bib-card-cover-gallery-width));
  max-width: var(--bib-card-cover-gallery-width);
  margin: 0 auto;
}

.bib-wrap .bib-thumb img {
  border-radius: max(0px, calc(var(--bib-card-radius) - 2px));
  object-fit: var(--bib-cover-fit);
}

.bib-wrap .bib-isbd-cover img,
.bib-wrap .detalhe-isbd-cover img {
  border-radius: max(0px, calc(var(--bib-isbd-cover-radius) - 4px));
  object-fit: var(--bib-cover-fit);
  box-shadow: inset 0 0 0 1px var(--bib-card-cover-inner-border);
}

.bib-wrap .bib-discovery-cover img {
  border-radius: max(0px, calc(var(--bib-discovery-cover-radius) - 4px));
  object-fit: var(--bib-cover-fit);
  box-shadow: inset 0 0 0 1px var(--bib-card-cover-inner-border);
}

/* bib-info removed — card-head and card-footer are now direct children of bib-card */
.bib-wrap .bib-card-head {
  grid-column: 2;
  grid-row: 1;
}

.bib-wrap[data-layout="editorial"] .bib-card-head,
.bib-wrap[data-layout="gallery"] .bib-card-head {
  grid-column: 1;
  grid-row: 2;
}

.bib-wrap[data-layout="editorial"] .bib-card-footer,
.bib-wrap[data-layout="gallery"] .bib-card-footer {
  grid-row: 3;
}

.bib-wrap .bib-card.is-coverless .bib-card-head {
  grid-column: 1 / -1;
  grid-row: 1;
}

.bib-wrap .bib-meta-note {
  font-size: var(--bib-meta-size);
  font-family: var(--bib-font-meta);
  font-weight: var(--bib-weight-meta);
  font-style: var(--bib-style-meta);
  color: var(--bib-muted);
}

.bib-wrap .bib-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows:
    minmax(var(--bib-card-kicker-slot), auto)
    minmax(var(--bib-card-title-slot), auto)
    minmax(var(--bib-card-author-slot), auto);
  align-content: start;
  gap: 10px;
  min-height: 0;
  min-block-size: var(--bib-card-head-slot);
}

.bib-wrap .bib-card-kicker {
  grid-row: 1;
  min-block-size: var(--bib-card-kicker-slot);
  align-content: start;
}

.bib-wrap .bib-card-kicker.is-empty {
  visibility: hidden;
}

.bib-wrap .bib-titulo,
.bib-wrap .bib-titulo a {
  font-size: var(--bib-card-title-size);
  font-family: var(--bib-font-title);
  font-weight: var(--bib-weight-title);
  font-style: var(--bib-style-title);
  color: var(--bib-title-color);
  -webkit-line-clamp: var(--bib-card-title-lines);
}

.bib-wrap .bib-titulo {
  grid-row: 2;
  min-block-size: var(--bib-card-title-slot);
  align-self: start;
}

.bib-wrap .bib-autor {
  font-size: var(--bib-author-size);
  font-family: var(--bib-font-author);
  font-weight: var(--bib-weight-author);
  font-style: var(--bib-style-author);
  color: var(--bib-author-color);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 0;
  grid-row: 3;
  min-block-size: var(--bib-card-author-slot);
  align-self: start;
}

.bib-wrap .bib-excerpt {
  font-size: var(--bib-excerpt-size);
  font-family: var(--bib-font-excerpt);
  font-weight: var(--bib-weight-excerpt);
  font-style: var(--bib-style-excerpt);
  color: var(--bib-excerpt-color);
  -webkit-line-clamp: var(--bib-card-excerpt-lines);
}

/* card-footer: full-width row, flex column — topics + excerpt + CTA */
.bib-wrap .bib-card-footer {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  gap: calc(var(--bib-card-gap-row) * var(--bib-density));
  min-height: 0;
}

.bib-wrap .bib-card-footer .bib-card-signals {
  align-self: flex-start;
}

.bib-wrap .bib-card-footer .bib-excerpt {
  margin: 0;
  min-block-size: var(--bib-card-excerpt-slot);
  order: 0; /* reset base order:5 so signals→excerpt→cta follows DOM order */
}

.bib-wrap .bib-card:not(.has-excerpt) .bib-card-footer .bib-excerpt {
  display: none;
}

.bib-wrap .bib-card-footer .bib-cta {
  margin-top: auto;
  padding-top: 16px;
}

.bib-wrap .bib-isbd-item {
  grid-template-columns: var(--bib-isbd-cover-width) minmax(0, 1fr);
  border-color: var(--bib-border);
  border-radius: var(--bib-isbd-radius);
  background: linear-gradient(130deg, var(--bib-surface) 0%, var(--bib-surface-alt) 100%);
  box-shadow: var(--bib-isbd-shadow);
}

.bib-wrap .bib-isbd-cover,
.bib-wrap .detalhe-isbd-cover {
  overflow: hidden;
  border-radius: var(--bib-isbd-cover-radius);
  aspect-ratio: var(--bib-cover-ratio);
  background: var(--bib-card-cover-shell-bg);
  padding: var(--bib-card-cover-shell-padding);
  border: 1px solid var(--bib-card-cover-shell-border);
  box-shadow: var(--bib-card-cover-shell-shadow);
}

.bib-wrap .bib-discovery-cover {
  overflow: hidden;
  border-radius: var(--bib-discovery-cover-radius);
  aspect-ratio: var(--bib-cover-ratio);
  background: var(--bib-card-cover-shell-bg);
  padding: var(--bib-card-cover-shell-padding);
  border: 1px solid var(--bib-card-cover-shell-border);
  box-shadow: var(--bib-card-cover-shell-shadow);
}

.bib-wrap .bib-isbd-body {
  text-align: inherit;
}

.bib-wrap .bib-isbd-meta {
  font-size: var(--bib-meta-size);
  font-family: var(--bib-font-meta);
  font-weight: var(--bib-weight-meta);
  font-style: var(--bib-style-meta);
  color: var(--bib-subtitle-color);
}

.bib-wrap .bib-isbd-line {
  font-size: calc(var(--bib-detail-text-size) * 0.98);
  font-family: var(--bib-font-detail-text);
  font-weight: var(--bib-weight-detail-text);
  font-style: var(--bib-style-detail-text);
  color: var(--bib-detail-text-color);
}

.bib-wrap .bib-discovery {
  border-color: var(--bib-border);
  border-radius: var(--bib-discovery-radius);
  background:
    radial-gradient(circle at 8% 12%, var(--bib-primary-soft), transparent 45%),
    radial-gradient(circle at 90% 16%, var(--bib-accent-2-soft), transparent 46%),
    linear-gradient(145deg, var(--bib-surface) 0%, var(--bib-surface-alt) 100%);
  box-shadow: var(--bib-discovery-shadow);
}

.bib-wrap .bib-discovery-item {
  grid-template-columns: var(--bib-discovery-cover-width) minmax(0, 1fr);
  border-color: var(--bib-border);
  border-radius: var(--bib-discovery-item-radius);
  background: var(--bib-surface);
  box-shadow: var(--bib-discovery-shadow);
}

.bib-wrap .bib-paginacao a,
.bib-wrap .bib-paginacao .dots {
  border-radius: var(--bib-pagination-radius);
}

.bib-wrap.is-loading::before {
  background: var(--bib-loading-overlay-bg);
}

.bib-wrap.is-loading::after {
  color: var(--bib-loading-text-color);
  font-size: var(--bib-loading-size);
  font-family: var(--bib-font-loading);
  font-weight: var(--bib-weight-loading);
  font-style: var(--bib-style-loading);
}

.bib-wrap .bib-error {
  color: var(--bib-error-color);
}

.bib-wrap.bib-detalhe {
  max-width: min(var(--bib-wrap-max-width), calc(100vw - 32px));
}

.bib-wrap.bib-detalhe .detalhe-capa-box {
  border-color: var(--bib-border);
  border-radius: var(--bib-detail-cover-radius);
  background: linear-gradient(180deg, var(--bib-surface) 0%, var(--bib-surface-alt) 100%);
  box-shadow: var(--bib-detail-shadow);
}

.bib-wrap.bib-detalhe .detalhe-facts,
.bib-wrap.bib-detalhe .detalhe-summary-card,
.bib-wrap.bib-detalhe .detalhe-utility-card,
.bib-wrap.bib-detalhe .detalhe-temas-wrap {
  border-color: var(--bib-border);
  border-radius: var(--bib-detail-summary-radius);
  background: linear-gradient(180deg, var(--bib-surface) 0%, var(--bib-surface-alt) 100%);
  box-shadow: var(--bib-detail-shadow);
}

.bib-wrap.bib-detalhe .detalhe-reference-card {
  border-color: var(--bib-border);
  border-radius: var(--bib-isbd-radius);
  background: linear-gradient(180deg, var(--bib-surface) 0%, var(--bib-surface-alt) 100%);
  box-shadow: var(--bib-isbd-shadow);
}

.bib-wrap.bib-detalhe .detalhe-tech {
  border-color: var(--bib-border);
  border-radius: var(--bib-tech-radius);
  background: linear-gradient(180deg, var(--bib-surface-alt) 0%, var(--bib-surface) 100%);
  box-shadow: var(--bib-tech-shadow);
}

.bib-wrap.bib-detalhe .detalhe-rel {
  border-color: var(--bib-border);
  border-radius: var(--bib-discovery-radius);
  background: linear-gradient(180deg, var(--bib-surface) 0%, var(--bib-surface-alt) 100%);
  box-shadow: var(--bib-discovery-shadow);
}

.bib-wrap.bib-detalhe .detalhe-titulo {
  font-size: var(--bib-detail-title-size);
  font-family: var(--bib-font-title);
  font-weight: var(--bib-weight-title);
  font-style: var(--bib-style-title);
  color: var(--bib-title-color);
}

.bib-wrap.bib-detalhe .detalhe-subtitulo {
  font-size: var(--bib-detail-subtitle-size);
  font-family: var(--bib-font-subtitle);
  font-weight: var(--bib-weight-subtitle);
  font-style: var(--bib-style-subtitle);
  color: var(--bib-subtitle-color);
}

.bib-wrap.bib-detalhe .detalhe-autor {
  font-size: var(--bib-author-size);
  font-family: var(--bib-font-author);
  font-weight: var(--bib-weight-author);
  font-style: var(--bib-style-author);
  color: var(--bib-author-color);
}

.bib-wrap.bib-detalhe .detalhe-edition-line {
  font-size: var(--bib-meta-size);
  font-family: var(--bib-font-meta);
  font-weight: var(--bib-weight-meta);
  font-style: var(--bib-style-meta);
  color: var(--bib-subtitle-color);
}

.bib-wrap.bib-detalhe .detalhe-lista-grid {
  grid-template-columns: repeat(var(--bib-detail-fact-cols, 2), minmax(0, 1fr));
}

@media (max-width: 980px) {
  .bib-wrap.bib-detalhe .detalhe-lista-grid {
    grid-template-columns: repeat(var(--bib-detail-fact-cols-tablet, 1), minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .bib-wrap.bib-detalhe .detalhe-lista-grid {
    grid-template-columns: repeat(var(--bib-detail-fact-cols-mobile, 1), minmax(0, 1fr));
  }
}

.bib-wrap.bib-detalhe .detalhe-fact-card dt {
  font-size: var(--bib-label-size);
  font-family: var(--bib-font-label);
  font-weight: var(--bib-weight-label);
  font-style: var(--bib-style-label);
  color: var(--bib-label-color);
}

.bib-wrap.bib-detalhe .detalhe-fact-card dd {
  font-size: var(--bib-detail-text-size);
  font-family: var(--bib-font-detail-text);
  font-weight: var(--bib-weight-detail-text);
  font-style: var(--bib-style-detail-text);
  color: var(--bib-detail-text-color);
}

.bib-wrap.bib-detalhe .detalhe-summary-card .conteudo {
  font-size: var(--bib-detail-summary-size);
  font-family: var(--bib-font-detail-summary);
  font-weight: var(--bib-weight-detail-summary);
  font-style: var(--bib-style-detail-summary);
  color: var(--bib-detail-summary-text-color);
}

.bib-wrap.bib-detalhe .detalhe-isbd-line {
  font-size: var(--bib-detail-text-size);
  font-family: var(--bib-font-detail-text);
  font-weight: var(--bib-weight-detail-text);
  font-style: var(--bib-style-detail-text);
  color: var(--bib-detail-text-color);
}

@media (max-width: 720px) {
  /* Stack cards vertically: cover top, head middle, footer bottom */
  .bib-wrap .bib-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
  }

  .bib-wrap .bib-thumb,
  .bib-wrap[data-layout="editorial"] .bib-thumb,
  .bib-wrap[data-layout="gallery"] .bib-thumb {
    grid-column: 1;
    grid-row: 1;
    width: min(100%, var(--bib-card-cover-top-width));
    max-width: var(--bib-card-cover-top-width);
    margin: 0 auto;
  }

  .bib-wrap .bib-card:not(.is-coverless) .bib-card-head,
  .bib-wrap[data-layout="editorial"] .bib-card-head,
  .bib-wrap[data-layout="gallery"] .bib-card-head {
    grid-column: 1;
    grid-row: 2;
    min-block-size: 0;
  }

  .bib-wrap .bib-card-footer,
  .bib-wrap[data-layout="editorial"] .bib-card-footer,
  .bib-wrap[data-layout="gallery"] .bib-card-footer {
    grid-row: 3;
  }

  .bib-wrap .bib-card.is-coverless .bib-card-footer {
    grid-row: 2;
  }

  .bib-wrap .bib-isbd-item {
    grid-template-columns: 1fr;
  }

  .bib-wrap .bib-isbd-cover {
    max-width: var(--bib-isbd-cover-width);
  }
}

@media (max-width: 980px) {
  .bib-wrap .bib-grid {
    grid-template-columns: repeat(var(--bib-grid-cols-md), minmax(0, 1fr));
  }

  .bib-wrap.bib-detalhe .detalhe-rel .bib-grid {
    grid-template-columns: repeat(var(--bib-grid-cols-md), minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .bib-wrap {
    padding: 16px 12px;
  }

  .bib-wrap .bib-grid {
    grid-template-columns: 1fr;
  }

  .bib-wrap.bib-detalhe .detalhe-rel .bib-grid {
    grid-template-columns: 1fr;
  }
}
