:root {
  --bg: #f5f4f0;
  --surface: #ffffff;
  --surface-soft: #edf2ef;
  --surface-warm: #f1ede5;
  --ink: #1b2825;
  --muted: #66736f;
  --line: #d9e1de;
  --brand: #42645d;
  --brand-dark: #2f4f48;
  --brand-soft: #dfeae6;
  --accent: #a88456;
  --danger: #9b4242;
  --success: #3e735d;
  --shadow: 0 22px 58px rgba(33, 55, 49, .10);
  --shadow-sm: 0 8px 24px rgba(33, 55, 49, .07);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --container: 1280px;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; overflow-y: auto; }
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body.filters-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -.03em; }
h1 { font-size: clamp(2.25rem, 4.6vw, 4.8rem); }
h2 { font-size: clamp(1.65rem, 2.5vw, 2.65rem); }
h3 { font-size: 1.15rem; }

.container { width: min(calc(100% - 40px), var(--container)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 1000; left: 16px; top: 10px; transform: translateY(-150%); color: #fff; background: var(--ink); padding: 10px 14px; border-radius: 10px; }
.skip-link:focus { transform: none; }
.icon { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.eyebrow { display: inline-block; margin-bottom: 10px; color: var(--brand); font-size: .76rem; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.meta-muted { color: #87918e; font-size: .83rem; }

.site-header { position: relative; z-index: 40; border-bottom: 1px solid rgba(66,100,93,.12); background: rgba(255,255,255,.95); backdrop-filter: blur(18px); }
.header-inner { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.brand { min-width: 0; display: flex; align-items: center; gap: 13px; }
.brand img { width: 58px; height: 50px; object-fit: contain; }
.brand span { min-width: 0; display: flex; flex-direction: column; }
.brand strong { font-size: 1.08rem; letter-spacing: -.02em; }
.brand small { max-width: 330px; margin-top: 2px; color: var(--muted); font-size: .72rem; line-height: 1.25; }
.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a { min-height: 44px; display: flex; align-items: center; gap: 7px; padding: 10px 13px; border-radius: 12px; color: #53615d; font-size: .92rem; font-weight: 720; }
.main-nav a:hover, .main-nav a.active { color: var(--brand-dark); background: var(--surface-soft); }
.selection-count { min-width: 22px; height: 22px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 999px; color: #fff; background: var(--brand); font-size: .71rem; }
.menu-toggle { display: none; align-items: center; gap: 8px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fff; }
.header-search-wrap { padding: 11px 0 14px; border-top: 1px solid rgba(66,100,93,.08); background: #fbfcfb; }
.header-search { max-width: 900px; margin: auto; }

.search-form { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow-sm); }
.search-form > .icon { width: 24px; height: 24px; margin-left: 12px; color: var(--brand); }
.search-form input { flex: 1; min-width: 0; height: 48px; padding: 0 4px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 1rem; }
.search-form input::placeholder { color: #8a9692; }
.search-form:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(66,100,93,.12), var(--shadow-sm); }
.suggestions { position: absolute; z-index: 90; top: calc(100% + 10px); left: 0; right: 0; max-height: min(56vh, 430px); overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.suggestions a { display: flex; justify-content: space-between; gap: 18px; padding: 13px 16px; border-bottom: 1px solid #edf1ef; }
.suggestions a:last-child { border-bottom: 0; }
.suggestions a:hover, .suggestions a:focus { background: var(--surface-soft); }
.suggestions strong { display: block; }
.suggestions small { display: block; margin-top: 2px; color: var(--muted); }
.suggestions em { color: var(--muted); font-style: normal; white-space: nowrap; }

.button { min-height: 44px; padding: 10px 17px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 12px; font-weight: 780; transition: transform .16s ease, background .16s ease, border-color .16s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: default; opacity: .5; }
.button--primary { color: #fff; background: var(--brand); box-shadow: 0 8px 20px rgba(66,100,93,.18); }
.button--primary:hover:not(:disabled) { background: var(--brand-dark); }
.button--secondary { color: var(--brand-dark); border-color: #d2dfda; background: var(--surface-soft); }
.button--secondary:hover { background: #dce9e4; }
.button--ghost { color: var(--ink); border-color: var(--line); background: #fff; }
.button--light { color: var(--brand-dark); background: #fff; }
.button--large { min-height: 54px; padding: 13px 23px; border-radius: 14px; }
.button--block { width: 100%; }
.button--save { color: var(--brand-dark); border-color: var(--line); background: #fff; }
.button--save.saved { color: #fff; border-color: var(--brand); background: var(--brand); }

.hero { position: relative; overflow: hidden; padding: 70px 0 62px; background: radial-gradient(circle at 88% 15%, rgba(255,255,255,.85) 0 12%, transparent 32%), linear-gradient(135deg,#f4f1ea 0%,#eaf1ee 60%,#e2ece7 100%); }
.hero::before { content: ""; position: absolute; width: 560px; height: 560px; right: -190px; top: -260px; border-radius: 50%; border: 1px solid rgba(66,100,93,.13); box-shadow: 0 0 0 75px rgba(66,100,93,.035), 0 0 0 150px rgba(66,100,93,.025); }
.hero-layout { position: relative; display: grid; grid-template-columns: minmax(0,1.55fr) minmax(300px,.65fr); gap: 58px; align-items: center; }
.hero-copy { position: relative; z-index: 2; }
.hero h1 { max-width: 900px; margin-bottom: 18px; }
.hero-copy > p { max-width: 760px; margin-bottom: 0; color: var(--muted); font-size: 1.08rem; }
.hero-search { max-width: 900px; margin-top: 28px; padding: 9px; }
.hero-search input { height: 58px; font-size: 1.08rem; }
.hero-links { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.hero-links a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 13px; border: 1px solid rgba(66,100,93,.15); border-radius: 12px; color: var(--brand-dark); background: rgba(255,255,255,.72); font-weight: 730; }
.hero-links a:hover { background: #fff; box-shadow: var(--shadow-sm); }
.hero-note { max-width: 850px; display: flex; align-items: flex-start; gap: 9px; margin-top: 20px; color: #63706c; font-size: .88rem; }
.hero-note .icon { margin-top: 2px; color: var(--brand); }
.hero-side { position: relative; z-index: 2; display: grid; gap: 12px; padding: 26px; border: 1px solid rgba(255,255,255,.75); border-radius: var(--radius-xl); background: rgba(255,255,255,.52); box-shadow: var(--shadow-sm); backdrop-filter: blur(12px); }
.hero-side img { width: min(250px,100%); max-height: 180px; margin: 0 auto 8px; object-fit: contain; filter: drop-shadow(0 18px 24px rgba(40,58,53,.14)); }
.hero-side > div { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px; padding: 14px 15px; border: 1px solid rgba(66,100,93,.11); border-radius: 14px; background: rgba(255,255,255,.75); }
.hero-side strong { color: var(--brand-dark); font-size: 1.3rem; }
.hero-side span { color: var(--muted); font-size: .84rem; line-height: 1.35; }

.section-block { padding-top: 66px; padding-bottom: 66px; }
.section-block--soft { background: #e9eeeb; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.section-heading h2 { margin-bottom: 0; }
.section-heading p { margin: 8px 0 0; color: var(--muted); }
.section-heading > a { display: inline-flex; align-items: center; gap: 8px; color: var(--brand); font-weight: 780; white-space: nowrap; }
.genre-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.genre-grid a { min-height: 86px; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; align-content: center; gap: 4px 10px; padding: 18px 19px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; box-shadow: 0 5px 18px rgba(33,55,49,.04); }
.genre-grid a span { font-weight: 790; line-height: 1.25; }
.genre-grid a small { color: var(--muted); }
.genre-grid a .icon { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--brand); }
.genre-grid a:hover { transform: translateY(-2px); border-color: #b9cbc5; box-shadow: var(--shadow-sm); }

.catalog-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; }
.catalog-grid--four { grid-template-columns: repeat(4,minmax(0,1fr)); }
.catalog-card { min-width: 0; display: grid; grid-template-columns: 116px minmax(0,1fr); gap: 16px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; box-shadow: 0 6px 22px rgba(33,55,49,.05); }
.catalog-card__cover { align-self: start; }
.catalog-card__body { min-width: 0; display: flex; flex-direction: column; }
.catalog-card__meta, .result-card__topline, .selection-item__genre { color: var(--brand); font-size: .74rem; font-weight: 830; letter-spacing: .06em; text-transform: uppercase; }
.catalog-card h3 { min-height: 2.6em; margin: 7px 0 8px; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.catalog-card h3 a:hover { color: var(--brand); }
.catalog-card__author { min-height: 2.8em; margin: 0 0 10px; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; color: #45534f; font-size: .88rem; }
.catalog-card__footer { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; padding-top: 14px; }
.catalog-card__footer .button { min-height: 42px; padding: 8px 10px; font-size: .86rem; }

.genre-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.genre-chip { max-width: 100%; display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px; color: var(--brand-dark); background: var(--brand-soft); font-size: .77rem; font-weight: 700; line-height: 1.2; }
.genre-chip:hover { background: #cee0da; }
.genre-chips--compact { min-height: 29px; overflow: hidden; flex-wrap: nowrap; }
.genre-chips--compact .genre-chip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.genre-chips--large { margin: 18px 0 4px; }
.genre-chips--large .genre-chip { padding: 7px 11px; font-size: .84rem; }

.book-cover { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; color: #fff; border-radius: 8px 14px 14px 8px; box-shadow: 0 13px 27px rgba(31,48,44,.20); isolation: isolate; }
.book-cover::before { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(145deg,rgba(255,255,255,.2),transparent 38%),linear-gradient(0deg,rgba(0,0,0,.38),transparent 72%); }
.book-cover::after { content: ""; position: absolute; left: 10px; top: 0; bottom: 0; width: 2px; background: rgba(255,255,255,.34); box-shadow: 4px 0 0 rgba(0,0,0,.08); }
.book-cover--small { width: 100px; aspect-ratio: .68; padding: 13px 10px 12px 18px; }
.book-cover--medium { width: 116px; aspect-ratio: .68; padding: 16px 12px 14px 20px; }
.book-cover--large { width: min(100%,310px); aspect-ratio: .68; padding: 32px 25px 28px 38px; border-radius: 13px 21px 21px 13px; }
.book-cover strong { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; font-family: Georgia,"Times New Roman",serif; line-height: 1.12; }
.book-cover--small strong { font-size: .68rem; }
.book-cover--medium strong { font-size: .82rem; }
.book-cover--large strong { font-size: clamp(1.35rem,2.2vw,2.15rem); }
.book-cover small { margin-top: 7px; opacity: .9; line-height: 1.25; }
.book-cover--small small { font-size: .54rem; }
.book-cover--medium small { font-size: .61rem; }
.book-cover--large small { font-size: .95rem; }
.book-cover em { margin-top: 13px; opacity: .68; font-size: .53rem; font-style: normal; letter-spacing: .08em; text-transform: uppercase; }
.book-cover__mark { position: absolute; right: 10px; top: 11px; opacity: .30; }
.book-cover__mark .icon { width: 36px; height: 36px; }
.book-cover--large .book-cover__mark { right: 23px; top: 23px; }
.book-cover--large .book-cover__mark .icon { width: 70px; height: 70px; }
.book-cover--sage { background: #5d7e75; }
.book-cover--blue { background: #566d84; }
.book-cover--sand { background: #9a7650; }
.book-cover--plum { background: #715c70; }
.book-cover--graphite { background: #485755; }
.book-cover--olive { background: #6c7350; }

.help-banner { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 30px 34px; border-radius: var(--radius-xl); color: #fff; background: linear-gradient(125deg,#35564f,#58756e); box-shadow: var(--shadow); }
.help-banner > div { display: flex; align-items: center; gap: 21px; }
.help-banner__icon { width: 46px; height: 46px; }
.help-banner h2 { margin-bottom: 7px; }
.help-banner p { margin: 0; color: rgba(255,255,255,.82); }
.help-banner .button { white-space: nowrap; }

.search-page { padding-top: 46px; padding-bottom: 76px; }
.search-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 28px; }
.search-heading h1 { margin-bottom: 9px; font-size: clamp(2rem,3.4vw,3.55rem); }
.search-heading p { margin: 0; color: var(--muted); }
.search-layout { display: grid; grid-template-columns: 285px minmax(0,1fr); gap: 22px; align-items: start; }
.filters-panel { position: sticky; top: 18px; padding: 21px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow-sm); }
.filters-panel__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 17px; }
.filters-panel__head h2 { margin: 0; font-size: 1.2rem; }
.filter-close, .filter-toggle { display: none; }
.filters-panel form { display: grid; gap: 14px; }
label { display: grid; gap: 7px; color: #394743; font-size: .88rem; font-weight: 740; }
label > span { color: var(--danger); }
label small { color: var(--muted); font-weight: 500; }
input, select, textarea { width: 100%; border: 1px solid #cdd8d4; border-radius: 11px; outline: 0; color: var(--ink); background: #fff; }
input, select { height: 46px; padding: 0 12px; }
textarea { min-height: 110px; padding: 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(66,100,93,.11); }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.check-row { grid-template-columns: auto 1fr; align-items: center; gap: 9px; }
.check-row input { width: 20px; height: 20px; accent-color: var(--brand); }
.check-row span { color: var(--ink); }
.results-column { min-width: 0; }
.results-toolbar { min-height: 54px; display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 13px; padding: 8px 10px 8px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.results-toolbar > span { font-size: .88rem; font-weight: 750; }
.results-toolbar label { display: flex; align-items: center; gap: 9px; }
.results-toolbar select { width: auto; min-width: 185px; height: 38px; }
.results-list { display: grid; gap: 12px; }
.result-card { display: grid; grid-template-columns: 100px minmax(0,1fr) 150px; gap: 18px; align-items: stretch; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; box-shadow: 0 5px 18px rgba(33,55,49,.045); }
.result-card__cover { align-self: start; }
.result-card__content { min-width: 0; }
.result-card__topline { display: flex; flex-wrap: wrap; gap: 7px 14px; }
.result-card__topline span + span { color: #78837f; }
.result-card h2 { margin: 7px 0 5px; font-size: 1.32rem; }
.result-card h2 a:hover { color: var(--brand); }
.result-card__author { margin-bottom: 10px; color: #42514d; font-weight: 700; }
.result-card__description { margin: 12px 0 0; color: var(--muted); font-size: .9rem; }
.fund-line { display: flex; flex-direction: column; gap: 3px; margin-top: 13px; padding: 10px 12px; border-radius: 11px; background: var(--surface-soft); }
.fund-line strong { color: var(--brand-dark); font-size: .85rem; }
.fund-line span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .78rem; }
.result-card__actions { display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; }
.result-card__actions .button { width: 100%; padding-inline: 10px; }
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 28px; }
.pagination a { width: 43px; height: 43px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: #fff; font-weight: 760; }
.pagination a.current, .pagination a:hover { color: #fff; border-color: var(--brand); background: var(--brand); }
.empty-state { min-height: 360px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 38px; border: 1px dashed #b9c8c3; border-radius: var(--radius-lg); background: rgba(255,255,255,.65); text-align: center; }
.empty-state__icon { width: 54px; height: 54px; margin-bottom: 17px; color: var(--brand); }
.empty-state p { max-width: 480px; color: var(--muted); }

.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-bottom: 27px; color: var(--muted); font-size: .86rem; }
.breadcrumbs a:hover { color: var(--brand); }
.breadcrumbs .icon { width: 15px; height: 15px; }
.book-page { padding-top: 34px; padding-bottom: 78px; }
.book-detail { display: grid; grid-template-columns: minmax(220px,310px) minmax(0,1fr) 320px; gap: 36px; align-items: start; }
.book-detail__media { display: flex; flex-direction: column; align-items: center; }
.cover-note { max-width: 310px; margin-top: 15px; color: var(--muted); font-size: .8rem; text-align: center; }
.book-detail__main h1 { margin-bottom: 10px; font-size: clamp(2.25rem,4vw,4.1rem); }
.book-subtitle { color: var(--muted); font-size: 1.14rem; }
.book-authors { margin-bottom: 0; color: var(--brand-dark); font-size: 1.2rem; font-weight: 770; }
.book-actions { display: flex; flex-wrap: wrap; gap: 9px; margin: 24px 0; }
.availability-note { display: flex; align-items: flex-start; gap: 12px; padding: 16px; border: 1px solid #cbdcd6; border-radius: 14px; background: var(--surface-soft); }
.availability-note > .icon { width: 23px; height: 23px; margin-top: 1px; color: var(--brand); }
.availability-note strong { display: block; margin-bottom: 3px; }
.availability-note p { margin: 0; color: var(--muted); font-size: .9rem; }
.book-description { margin-top: 28px; }
.book-description h2 { font-size: 1.35rem; }
.book-description p { color: #4b5955; }
.book-meta-card { padding: 23px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow-sm); }
.book-meta-card h2 { font-size: 1.18rem; }
.book-meta-card dl { margin: 0; }
.book-meta-card dl > div { padding: 12px 0; border-top: 1px solid #edf1ef; }
.book-meta-card dt { color: var(--muted); font-size: .76rem; font-weight: 790; letter-spacing: .05em; text-transform: uppercase; }
.book-meta-card dd { margin: 4px 0 0; font-weight: 650; overflow-wrap: anywhere; }
.holdings-section, .recommendations { margin-top: 60px; }
.holdings-total { padding: 9px 14px; border-radius: 999px; color: var(--brand-dark); background: var(--brand-soft); }
.branch-list { display: grid; gap: 10px; }
.branch-card { display: grid; grid-template-columns: 52px minmax(0,1fr) 90px auto; align-items: center; gap: 17px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.branch-card__icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; color: var(--brand); background: var(--surface-soft); }
.branch-card__icon .icon { width: 27px; height: 27px; }
.branch-card h3 { margin-bottom: 4px; }
.branch-card p { margin: 0; color: var(--muted); font-size: .87rem; }
.branch-details { display: flex; flex-wrap: wrap; gap: 7px 16px; margin-top: 7px; color: #52605c; font-size: .82rem; }
.branch-card__count { text-align: center; }
.branch-card__count strong { display: block; color: var(--brand-dark); font-size: 1.65rem; line-height: 1; }
.branch-card__count span { color: var(--muted); font-size: .76rem; }
.branch-phone { display: inline-flex; align-items: center; gap: 7px; color: var(--brand); font-size: .85rem; font-weight: 760; white-space: nowrap; }
.holdings-disclaimer { display: flex; align-items: flex-start; gap: 9px; margin: 14px 0 0; padding: 13px 15px; border-radius: 12px; color: var(--muted); background: #e9ece8; font-size: .84rem; }
.holdings-disclaimer .icon { margin-top: 2px; }
.empty-inline { padding: 19px; border: 1px dashed #bcc9c5; border-radius: 14px; color: var(--muted); background: rgba(255,255,255,.58); }

.form-page { padding-top: 52px; padding-bottom: 78px; display: grid; grid-template-columns: minmax(0,.9fr) minmax(420px,1.1fr); gap: 52px; align-items: start; }
.form-page__intro h1 { font-size: clamp(2.25rem,4vw,4rem); }
.form-page__intro > p { color: var(--muted); font-size: 1.03rem; }
.request-book-summary { display: flex; align-items: center; gap: 17px; margin: 26px 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; }
.request-book-summary strong { display: block; font-size: 1.08rem; }
.request-book-summary span { display: block; margin-top: 4px; color: var(--muted); }
.request-selection-summary { max-height: 420px; overflow-y: auto; display: grid; gap: 8px; margin-top: 25px; padding-right: 4px; }
.request-selection-summary > div { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.request-selection-summary > div > span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--brand); font-size: .75rem; font-weight: 800; }
.request-selection-summary p { margin: 0; }
.request-selection-summary strong, .request-selection-summary small { display: block; }
.request-selection-summary small { margin-top: 3px; color: var(--muted); }
.form-card { padding: 29px; border: 1px solid var(--line); border-radius: var(--radius-xl); background: #fff; box-shadow: var(--shadow); }
.form-card h2 { margin-bottom: 23px; }
.form-card form { display: grid; gap: 16px; }
.form-errors { margin-bottom: 17px; padding: 14px 16px; border: 1px solid #dfbaba; border-radius: 12px; color: #7b3434; background: #fff1f1; }
.form-errors ul { margin: 7px 0 0; padding-left: 20px; }
.privacy-note { margin: 0; color: var(--muted); font-size: .8rem; text-align: center; }
.honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
.help-example { margin-top: 25px; padding: 18px; border-radius: 15px; background: var(--surface-soft); }
.help-example span { color: var(--brand); font-size: .73rem; font-weight: 830; letter-spacing: .09em; text-transform: uppercase; }
.help-example p { margin: 5px 0 0; font-family: Georgia,serif; font-size: 1.16rem; }

.status-page { min-height: 62vh; display: grid; place-items: center; padding-top: 58px; padding-bottom: 58px; }
.status-card { width: min(100%,660px); padding: 42px; border: 1px solid var(--line); border-radius: var(--radius-xl); background: #fff; box-shadow: var(--shadow); text-align: center; }
.status-card h1 { font-size: clamp(2rem,4vw,3.3rem); }
.status-card p { color: var(--muted); }
.status-card .button { margin: 5px; }
.status-icon { width: 70px; height: 70px; margin-bottom: 20px; color: var(--brand); }
.status-card--error .status-icon { color: var(--danger); }

.selection-page { padding-top: 50px; padding-bottom: 78px; }
.selection-hero { display: flex; justify-content: space-between; align-items: end; gap: 28px; margin-bottom: 26px; }
.selection-hero h1 { margin-bottom: 7px; }
.selection-hero p { margin-bottom: 0; color: var(--muted); }
.selection-toolbar { display: flex; gap: 9px; }
.selection-list { display: grid; gap: 11px; }
.selection-list__head { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }
.selection-list__head label { display: flex; align-items: center; gap: 8px; }
.selection-list__head input { width: 19px; height: 19px; accent-color: var(--brand); }
.selection-list__head span { color: var(--muted); font-size: .85rem; }
.selection-item { display: grid; grid-template-columns: 30px 100px minmax(0,1fr) auto; gap: 17px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.selection-item__check { display: grid; place-items: center; }
.selection-item__check input { width: 21px; height: 21px; accent-color: var(--brand); }
.selection-item__content h2 { margin: 5px 0 4px; font-size: 1.18rem; }
.selection-item__content p { margin: 0; color: var(--muted); }
.selection-item__genre { margin-top: 7px; }
.selection-item__fund { display: block; margin-top: 8px; color: var(--brand-dark); font-size: .83rem; }
.selection-item__actions { display: flex; gap: 8px; }
.loading-state { min-height: 220px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); }
.loading-state .icon { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.site-footer { padding: 34px 0; border-top: 1px solid rgba(66,100,93,.13); background: #e6ebe7; }
.footer-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 38px; }
.footer-grid p { max-width: 690px; margin: 7px 0 0; color: var(--muted); font-size: .88rem; }
.footer-contacts { display: grid; align-content: start; gap: 7px; }
.footer-contacts a, .footer-contacts span { display: flex; align-items: center; gap: 8px; color: #4e5b57; font-size: .88rem; }
.toast { position: fixed; z-index: 120; left: 50%; bottom: 24px; transform: translateX(-50%); min-width: 280px; max-width: calc(100% - 30px); padding: 13px 17px; border-radius: 13px; color: #fff; background: #24332f; box-shadow: var(--shadow); text-align: center; }

@media (max-width: 1120px) {
  .catalog-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .genre-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .book-detail { grid-template-columns: 250px minmax(0,1fr); }
  .book-meta-card { grid-column: 1 / -1; }
  .branch-card { grid-template-columns: 52px minmax(0,1fr) 80px; }
  .branch-phone { grid-column: 2 / -1; }
}

@media (max-width: 900px) {
  .container { width: min(calc(100% - 28px),var(--container)); }
  .header-inner { min-height: 74px; }
  .brand img { width: 50px; height: 43px; }
  .brand small { max-width: 230px; }
  .menu-toggle { display: inline-flex; }
  .main-nav { position: absolute; top: 74px; left: 14px; right: 14px; display: none; flex-direction: column; align-items: stretch; padding: 11px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
  .main-nav.open { display: flex; }
  .main-nav a { justify-content: space-between; }
  .hero { padding-top: 48px; }
  .hero-layout { grid-template-columns: 1fr; gap: 28px; }
  .hero-side { grid-template-columns: 1fr 1fr; }
  .hero-side img { display: none; }
  .genre-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .search-layout { grid-template-columns: 1fr; }
  .filter-toggle { display: inline-flex; }
  .filters-panel { position: fixed; z-index: 90; inset: 0 0 0 auto; width: min(92vw,400px); overflow-y: auto; transform: translateX(105%); transition: transform .22s ease; border-radius: 0; }
  .filters-panel.open { transform: none; }
  .filter-close { width: 42px; height: 42px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
  .result-card { grid-template-columns: 100px minmax(0,1fr); }
  .result-card__actions { grid-column: 2; flex-direction: row; justify-content: flex-start; }
  .result-card__actions .button { width: auto; }
  .form-page { grid-template-columns: 1fr; gap: 28px; }
  .footer-grid { grid-template-columns: 1fr; }
  .selection-item { grid-template-columns: 30px 90px minmax(0,1fr); }
  .selection-item__actions { grid-column: 3; }
}

@media (max-width: 680px) {
  body { font-size: 15px; }
  .brand strong { font-size: .98rem; }
  .brand small { max-width: 165px; font-size: .64rem; }
  .menu-toggle span { display: none; }
  .header-search-wrap { padding: 9px 0; }
  .header-search .button { width: 48px; padding: 0; font-size: 0; }
  .header-search .button::before { content: "→"; font-size: 1.15rem; }
  .hero { padding: 38px 0 42px; }
  .hero h1 { font-size: 2.45rem; }
  .hero-copy > p { font-size: .95rem; }
  .hero-search { display: grid; grid-template-columns: auto minmax(0,1fr); padding: 7px; }
  .hero-search .button { grid-column: 1 / -1; width: 100%; }
  .hero-side { grid-template-columns: 1fr; padding: 17px; }
  .section-block { padding-top: 46px; padding-bottom: 46px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .genre-grid { gap: 9px; }
  .genre-grid a { min-height: 82px; padding: 15px; }
  .catalog-grid { grid-template-columns: 1fr; gap: 11px; }
  .catalog-card { grid-template-columns: 100px minmax(0,1fr); padding: 13px; }
  .catalog-card__cover .book-cover--medium { width: 100px; }
  .catalog-card__footer { grid-template-columns: 1fr; }
  .help-banner { align-items: flex-start; flex-direction: column; padding: 24px; }
  .help-banner > div { align-items: flex-start; }
  .help-banner__icon { width: 36px; height: 36px; }
  .help-banner .button { width: 100%; }
  .search-page { padding-top: 32px; }
  .search-heading { align-items: flex-start; }
  .search-heading h1 { font-size: 2rem; }
  .results-toolbar { align-items: flex-start; flex-direction: column; }
  .results-toolbar label, .results-toolbar select { width: 100%; }
  .result-card { grid-template-columns: 82px minmax(0,1fr); gap: 13px; padding: 13px; }
  .result-card__cover .book-cover--small { width: 82px; }
  .result-card h2 { font-size: 1.08rem; }
  .result-card__topline span + span, .result-card__description { display: none; }
  .result-card__actions { grid-column: 1 / -1; }
  .result-card__actions .button { flex: 1; }
  .fund-line span { white-space: normal; }
  .book-page { padding-top: 23px; }
  .book-detail { grid-template-columns: 1fr; gap: 24px; }
  .book-detail__media .book-cover--large { width: min(220px,68vw); }
  .book-detail__main h1 { font-size: 2.25rem; }
  .book-meta-card { grid-column: auto; }
  .book-actions { display: grid; }
  .book-actions .button { width: 100%; }
  .branch-card { grid-template-columns: 45px minmax(0,1fr) 60px; gap: 11px; padding: 14px; }
  .branch-card__icon { width: 45px; height: 45px; }
  .branch-card__count strong { font-size: 1.35rem; }
  .branch-phone { grid-column: 2 / -1; }
  .field-pair { grid-template-columns: 1fr; }
  .form-card { padding: 21px; }
  .selection-hero { align-items: flex-start; flex-direction: column; }
  .selection-toolbar { width: 100%; display: grid; grid-template-columns: 1fr auto; }
  .selection-item { grid-template-columns: 26px 76px minmax(0,1fr); gap: 11px; padding: 12px; }
  .selection-item__cover .book-cover--small { width: 76px; }
  .selection-item__content h2 { font-size: 1rem; }
  .selection-item__actions { grid-column: 1 / -1; justify-content: flex-end; }
  .selection-list__head { align-items: flex-start; flex-direction: column; }
}

/* v1.3.0 — выравнивание карточек и компактная корзина */
:root { --container: 1440px; }
.button { text-align: center; line-height: 1.2; white-space: nowrap; }
.button--cart {
  width: 48px;
  min-width: 48px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  flex: 0 0 48px;
}
.button--cart .icon { width: 22px; height: 22px; }
.button--cart.saved .icon { transform: scale(1.04); }
.catalog-card { min-height: 350px; }
.catalog-card__footer {
  grid-template-columns: minmax(0,1fr) 48px;
  align-items: center;
}
.catalog-card__footer .button { width: 100%; min-width: 0; }
.catalog-card__footer .button--cart { width: 48px; }
.result-card__actions { align-items: center; }
.result-card__actions > .button:not(.button--cart) { align-self: stretch; }
.result-card__actions .button--cart { width: 48px; margin-inline: auto; }
.hero-side { align-content: center; }
.hero-side > div { min-height: 66px; }

@media (max-width: 680px) {
  .catalog-card__footer { grid-template-columns: minmax(0,1fr) 46px; }
  .catalog-card__footer .button--cart,
  .result-card__actions .button--cart { width: 46px; min-width: 46px; flex: 0 0 46px; }
  .result-card__actions .button--cart { flex: 0 0 46px; }
}

/* v1.4.0 — карточки, текстовые обложки и корзина */
.book-cover { justify-content: flex-start; gap: 8px; }
.book-cover__genre {
  position: relative;
  z-index: 1;
  display: block;
  margin-bottom: auto;
  overflow: hidden;
  color: rgba(255,255,255,.82);
  font-size: .54rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.book-cover--medium .book-cover__genre { font-size: .6rem; }
.book-cover--large .book-cover__genre { font-size: .8rem; }
.book-cover strong { margin-top: auto; }
.book-cover em {
  margin-top: 2px;
  opacity: .82;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .06em;
}
.book-cover--large em { font-size: .9rem; }
.button--cart {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
  box-shadow: 0 7px 18px rgba(66,100,93,.2);
}
.button--cart:hover:not(:disabled) { background: var(--brand-dark); }
.button--cart.saved { color: #fff; background: #805f39; border-color: #805f39; }
.button--cart .icon { display: block; stroke-width: 2; }
.catalog-card__footer,
.result-card__actions { overflow: visible; }
.catalog-card__footer .button,
.result-card__actions .button { align-items: center; justify-content: center; text-align: center; }
.catalog-card__footer .button--secondary { white-space: nowrap; }
.request-number {
  display: inline-block;
  margin: 8px 0 22px;
  padding: 9px 13px;
  border-radius: 10px;
  color: var(--brand-dark);
  background: var(--surface-soft);
  font-size: .9rem;
}

@media (max-width: 680px) {
  .book-cover__genre { font-size: .5rem; }
  .book-cover--large .book-cover__genre { font-size: .72rem; }
}
.empty-state--error .empty-state__icon { color: var(--danger); }

/* v1.5.0 — подсказки, текстовые обложки и устойчивое выравнивание */
.hero {
  overflow: visible;
  z-index: 10;
}
.hero::before { pointer-events: none; }
.hero-copy, .hero-search { position: relative; z-index: 20; }
.suggestions {
  z-index: 500;
  max-height: min(58vh, 460px);
}
.section-block--genres,
.section-block--soft {
  position: relative;
  z-index: 1;
}

.book-cover {
  justify-content: flex-start;
  gap: 0;
}
.book-cover__title {
  order: 1;
  margin: 0 !important;
  flex: 0 0 auto;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}
.book-cover__genre {
  order: 2;
  margin: 8px 0 0;
  flex: 0 0 auto;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: rgba(255,255,255,.78);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: .045em;
  text-transform: uppercase;
}
.book-cover__author {
  order: 3;
  margin: 9px 0 0;
  flex: 0 0 auto;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  opacity: .92;
  line-height: 1.3;
}
.book-cover__year {
  order: 4;
  margin-top: auto !important;
  padding-top: 10px;
  opacity: .78;
  font-weight: 800;
  letter-spacing: .06em;
}
.book-cover--small .book-cover__genre { font-size: .5rem; }
.book-cover--medium .book-cover__genre { font-size: .56rem; }
.book-cover--large .book-cover__genre { font-size: .78rem; }
.book-cover--large .book-cover__author { font-size: .96rem; }
.book-cover--large .book-cover__year { font-size: .9rem; }

@media (max-width: 680px) {
  .suggestions { max-height: min(52vh, 390px); }
  .book-cover__genre { font-size: .48rem; }
  .book-cover--large .book-cover__genre { font-size: .7rem; }
}

/* v1.6.0 — точные типы материалов, ровный поиск и расширенная пагинация */
.search-form {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 8px;
  padding: 7px;
}
.search-form > .icon {
  width: 22px;
  height: 22px;
  margin-left: 9px;
}
.search-form input,
.search-form input:focus {
  height: 50px;
  padding: 0 8px;
  border: 0 !important;
  border-radius: 0;
  outline: 0;
  background: transparent;
  box-shadow: none !important;
}
.search-form .button {
  min-height: 50px;
  align-self: stretch;
}
.hero-search input,
.hero-search .button { min-height: 58px; }

.pagination {
  flex-wrap: wrap;
  align-items: center;
}
.pagination__ellipsis {
  min-width: 28px;
  height: 43px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
}
.pagination__arrow { font-size: 1.3rem; }

.book-meta-card dd { line-height: 1.42; }

@media (max-width: 680px) {
  .search-form { grid-template-columns: 23px minmax(0,1fr) auto; gap: 5px; }
  .search-form > .icon { width: 20px; height: 20px; margin-left: 6px; }
  .hero-search { grid-template-columns: 23px minmax(0,1fr); }
  .hero-search .button { grid-column: 1 / -1; }
  .pagination { gap: 6px; }
  .pagination a { width: 39px; height: 39px; }
  .pagination__ellipsis { height: 39px; }
}


/* v1.7.2 — видимая кнопка мобильного меню */
@media (max-width: 900px) {
  .menu-toggle {
    min-width: 48px;
    min-height: 46px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 45;
  }
  .menu-toggle .icon { width: 25px; height: 25px; display: block; }
}
@media (max-width: 680px) {
  .menu-toggle span { display: none; }
  .menu-toggle { padding: 9px 11px; }
}

/* v1.8.0 — возрастной рейтинг и сведения об экземплярах */
.age-rating {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 23px;
  margin-left: 7px;
  padding: 3px 8px;
  border: 1px solid #c9d9d3;
  border-radius: 999px;
  color: var(--brand-dark);
  background: #eef5f2;
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1;
  text-transform: none;
  vertical-align: middle;
}
.age-rating--large { margin-left: 0; padding: 7px 11px; font-size: .84rem; }
.book-cover__age {
  order: 4;
  align-self: flex-start;
  margin-top: 8px;
  padding: 3px 7px;
  border: 1px solid rgba(255,255,255,.42);
  border-radius: 999px;
  color: #fff;
  background: rgba(0,0,0,.16);
  font-size: .55rem;
  font-style: normal;
  font-weight: 850;
  line-height: 1;
}
.book-cover__year { order: 5; }
.book-cover--large .book-cover__age { padding: 5px 9px; font-size: .78rem; }
.catalog-card__meta .age-rating { margin-left: 5px; }
.result-card__topline .age-rating { margin-left: 6px; }
@media (max-width: 680px) {
  .age-rating { font-size: .68rem; }
  .book-cover__age { font-size: .5rem; }
}

/* v1.8.1 — примечания о содержании */
.book-meta-card dl > .book-meta-card__content-note {
  margin-top: 12px;
  padding: 15px 16px;
  border: 1px solid #e6b8ae;
  border-radius: 13px;
  background: #fff0ec;
}
.book-meta-card__content-note dt {
  color: #8b2f25;
}
.book-meta-card__content-note dd {
  color: #70251e;
  font-weight: 760;
  line-height: 1.55;
}
.book-cover__age {
  background: rgba(255,255,255,.92);
  color: #253e37;
  border-color: rgba(255,255,255,.9);
  box-shadow: 0 2px 8px rgba(0,0,0,.14);
}


/* v1.8.2 — компактные карточки, уточнение к заглавию и фильтр структурных подразделений */
.book-title-info {
  max-width: 900px;
  margin: -4px 0 12px;
  color: #53635e;
  font-size: clamp(1.02rem,1.55vw,1.28rem);
  font-weight: 650;
  line-height: 1.38;
}
.catalog-grid { align-items: start; }
.catalog-card {
  min-height: 0;
  grid-template-columns: 106px minmax(0,1fr);
  gap: 14px;
  padding: 14px;
}
.catalog-card__cover .book-cover--medium { width: 106px; }
.catalog-card h3 {
  min-height: 0;
  margin: 6px 0 7px;
  -webkit-line-clamp: 3;
  line-height: 1.16;
}
.catalog-card__author {
  min-height: 0;
  margin-bottom: 8px;
  -webkit-line-clamp: 3;
  line-height: 1.38;
}
.catalog-card__footer {
  margin-top: 12px;
  padding-top: 0;
}
.catalog-card__footer .button { min-height: 40px; }
.book-cover--medium {
  padding: 13px 10px 12px 17px;
}
.book-cover--medium .book-cover__title {
  font-size: .76rem;
  line-height: 1.08;
  -webkit-line-clamp: 5;
}
.book-cover--medium.book-cover--title-long .book-cover__title { font-size: .68rem; -webkit-line-clamp: 6; }
.book-cover--medium.book-cover--title-very-long .book-cover__title { font-size: .61rem; -webkit-line-clamp: 7; }
.book-cover--medium .book-cover__genre { margin-top: 6px; font-size: .51rem; -webkit-line-clamp: 3; }
.book-cover--medium .book-cover__author { margin-top: 6px; font-size: .57rem; -webkit-line-clamp: 3; }
.book-cover--medium .book-cover__age { margin-top: 6px; }
.book-cover--medium .book-cover__year { padding-top: 6px; }
.book-cover--small.book-cover--title-long .book-cover__title { font-size: .61rem; -webkit-line-clamp: 6; }
.book-cover--small.book-cover--title-very-long .book-cover__title { font-size: .55rem; -webkit-line-clamp: 7; }

@media (max-width: 680px) {
  .catalog-card { grid-template-columns: 92px minmax(0,1fr); gap: 12px; padding: 12px; }
  .catalog-card__cover .book-cover--medium { width: 92px; }
  .catalog-card h3 { -webkit-line-clamp: 4; }
  .catalog-card__author { -webkit-line-clamp: 3; }
  .book-title-info { margin-top: -2px; font-size: 1rem; }
}


/* v1.8.3 — одинаковая высота новинок, крупные обложки результатов и стабильный фильтр структурных подразделений */
.catalog-grid {
  align-items: stretch;
  grid-auto-rows: 1fr;
}
.catalog-card {
  height: 100%;
  min-height: 0;
  align-self: stretch;
  grid-template-columns: 100px minmax(0,1fr);
  gap: 13px;
  padding: 13px;
}
.catalog-card__cover .book-cover--medium { width: 100px; }
.catalog-card__body {
  height: 100%;
  display: grid;
  grid-template-rows: auto 3.5em 4.15em 30px auto;
  align-content: start;
}
.catalog-card h3 {
  height: 3.5em;
  min-height: 0;
  margin: 6px 0 6px;
  -webkit-line-clamp: 3;
}
.catalog-card__author {
  height: 4.15em;
  min-height: 0;
  margin: 0 0 7px;
  -webkit-line-clamp: 3;
}
.catalog-card .genre-chips--compact {
  height: 30px;
  min-height: 30px;
}
.catalog-card__footer {
  margin-top: 9px;
  padding-top: 0;
}

/* В результатах используется та же информативная текстовая обложка, что в новинках. */
.result-card { grid-template-columns: 106px minmax(0,1fr) 150px; }
.result-card__cover .book-cover--medium { width: 106px; }

/* Явная минимальная ширина помогает старым браузерам Windows раскрывать select. */
.filters-panel select[name="location"] {
  display: block;
  min-width: 100%;
  pointer-events: auto;
}

@media (max-width: 980px) {
  .result-card { grid-template-columns: 106px minmax(0,1fr); }
  .result-card__actions { grid-column: 2; }
}

@media (max-width: 680px) {
  .catalog-card { grid-template-columns: 88px minmax(0,1fr); gap: 11px; padding: 11px; }
  .catalog-card__cover .book-cover--medium { width: 88px; }
  .catalog-card__body { grid-template-rows: auto 4.65em 4.15em 30px auto; }
  .catalog-card h3 { height: 4.65em; -webkit-line-clamp: 4; }
  .result-card { grid-template-columns: 88px minmax(0,1fr); }
  .result-card__cover .book-cover--medium { width: 88px; }
  .result-card__actions { grid-column: 1 / -1; }
}


/* v1.8.4 — защита текста карточек и реальные места хранения */
.catalog-card__body,
.catalog-card h3,
.catalog-card h3 a,
.catalog-card__author,
.result-card__content,
.result-card h2,
.result-card h2 a,
.result-card__author {
  min-width: 0;
  max-width: 100%;
}
.catalog-card h3,
.catalog-card h3 a {
  overflow: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.catalog-card h3 a {
  display: block;
  max-height: 100%;
}
.catalog-card__author {
  overflow: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.catalog-card .genre-chips--compact {
  min-width: 0;
  max-width: 100%;
}
.catalog-card .genre-chips--compact .genre-chip {
  min-width: 0;
  max-width: 100%;
}
.book-cover__title,
.book-cover__genre,
.book-cover__author {
  max-width: 100%;
  overflow: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.filters-panel select[name="location"] {
  width: 100%;
  max-width: 100%;
}


/* v1.8.6 — компактные миниатюры, устойчивые формы и подтверждение заказа */
.book-cover__author { display: none !important; }
.book-cover {
  min-width: 0;
  height: auto;
}
.book-cover__title,
.book-cover__genre {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
}
.book-cover__genre { order: 2; }
.book-cover__age { order: 3; align-self: flex-start; }
.book-cover__year { order: 4; margin-top: auto !important; }
.book-cover--small .book-cover__title,
.book-cover--medium .book-cover__title { -webkit-line-clamp: 6; }
.book-cover--large .book-cover__title { -webkit-line-clamp: 7; }
.book-cover--small .book-cover__genre,
.book-cover--medium .book-cover__genre { -webkit-line-clamp: 4; }
.book-cover--large .book-cover__genre { -webkit-line-clamp: 5; }

.form-page > *,
.form-card,
.form-card form,
.field-pair > *,
.request-book-summary > *,
.request-selection-summary > *,
.book-detail > *,
.book-detail__content,
.book-meta-card,
.result-card > *,
.catalog-card > * { min-width: 0; }

.form-card input,
.form-card select,
.form-card textarea,
.filters-panel input,
.filters-panel select,
.filters-panel textarea { width: 100%; max-width: 100%; }

.button {
  min-width: 0;
  max-width: 100%;
  text-align: center;
  line-height: 1.25;
}

.book-actions,
.selection-toolbar,
.result-card__actions,
.catalog-card__footer,
.request-confirm-modal__actions { min-width: 0; }

.request-confirm-modal[hidden] { display: none !important; }
.request-confirm-modal {
  position: fixed;
  z-index: 3000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}
.request-confirm-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(21,35,31,.58);
  backdrop-filter: blur(3px);
}
.request-confirm-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(100%,620px);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: clamp(24px,4vw,38px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: #fff;
  box-shadow: 0 28px 80px rgba(13,31,25,.30);
}
.request-confirm-modal__dialog h2 { margin: 8px 0 13px; font-size: clamp(1.65rem,4vw,2.35rem); }
.request-confirm-modal__dialog p { margin: 0; color: var(--ink); font-size: 1.02rem; line-height: 1.65; }
.request-confirm-modal__actions { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,.7fr); gap: 12px; margin-top: 25px; }
.request-confirm-open { overflow: hidden; }

@media (max-width: 760px) {
  .form-page { padding-top: 28px; padding-bottom: 48px; gap: 22px; }
  .form-card { padding: 20px 16px; }
  .form-page__intro h1 { font-size: clamp(2rem,12vw,3rem); overflow-wrap: anywhere; }
  .book-actions { display: grid; grid-template-columns: 1fr; gap: 9px; }
  .book-actions .button { width: 100%; white-space: normal; }
  .selection-toolbar { display: grid; grid-template-columns: 1fr; width: 100%; }
  .selection-toolbar .button { width: 100%; white-space: normal; }
  .request-selection-summary div { grid-template-columns: 34px minmax(0,1fr); }
  .request-book-summary { align-items: flex-start; }
  .request-confirm-modal { padding: 12px; align-items: end; }
  .request-confirm-modal__dialog { width: 100%; max-height: calc(100vh - 24px); padding: 24px 18px; border-radius: 22px 22px 14px 14px; }
  .request-confirm-modal__actions { grid-template-columns: 1fr; }
  .request-confirm-modal__actions .button { width: 100%; white-space: normal; }
  .result-card__actions { width: 100%; }
  .result-card__actions .button { white-space: normal; }
}

@media (max-width: 430px) {
  .field-pair { grid-template-columns: 1fr; }
  .form-card { border-radius: 18px; }
  .book-cover--large { width: min(230px,72vw); }
}

/* v1.8.7 — возраст и год на общей нижней строке миниатюры */
.book-cover__footer {
  order: 4;
  margin-top: auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 22px;
}
.book-cover__footer .book-cover__age,
.book-cover__footer .book-cover__year {
  order: initial;
  margin: 0 !important;
  flex: 0 0 auto;
}
.book-cover__footer .book-cover__year {
  margin-left: auto !important;
  padding-top: 0;
}
.book-cover__title,
.book-cover__genre {
  flex: 0 0 auto;
}
.form-card input[data-phone-mask],
.form-card input[data-contact-mask] {
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
}

/* v1.8.11 — устойчивое выравнивание, длинные подписи и мобильные панели */
.button {
  white-space: normal;
  overflow-wrap: anywhere;
  word-wrap: break-word;
}
.button--cart { white-space: nowrap; }
.brand img { height: auto; }
.brand strong,
.brand small,
.section-heading > div,
.search-heading > div,
.help-banner > div,
.footer-grid > div,
.footer-contacts a,
.footer-contacts span,
.breadcrumbs,
.branch-card > div,
.selection-item__content,
.suggestions a > span {
  min-width: 0;
  max-width: 100%;
}
.brand strong,
.brand small,
.section-heading h2,
.section-heading p,
.search-heading h1,
.search-heading p,
.help-banner h2,
.help-banner p,
.footer-grid,
.footer-contacts a,
.footer-contacts span,
.breadcrumbs,
.branch-card h3,
.branch-details,
.branch-phone,
.selection-item__content h2,
.selection-item__content p,
.suggestions strong,
.suggestions small {
  overflow-wrap: anywhere;
  word-wrap: break-word;
}
.suggestions__status {
  padding: 14px 16px;
  color: var(--muted);
  font-size: .9rem;
}
.suggestions a { align-items: flex-start; }
.suggestions a > span { flex: 1 1 auto; }
.suggestions em { flex: 0 0 auto; }

a:focus,
button:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(66,100,93,.25);
  outline-offset: 2px;
}
.search-form input:focus {
  outline: 2px solid rgba(66,100,93,.24);
  outline-offset: -2px;
  border-radius: 10px;
}

@media (max-width: 900px) {
  body.filters-open::before {
    content: "";
    position: fixed;
    z-index: 80;
    inset: 0;
    background: rgba(21,35,31,.46);
  }
  .filters-panel {
    box-shadow: -18px 0 55px rgba(21,35,31,.22);
  }
}

@media (max-width: 680px) {
  .search-heading {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  .search-heading .filter-toggle { width: 100%; }
  .section-heading > a { white-space: normal; }
  .help-banner .button { white-space: normal; }
  .suggestions { left: -7px; right: -7px; }
  .result-card__actions {
    display: grid;
    grid-template-columns: minmax(0,1fr) 46px;
    align-items: stretch;
  }
  .result-card__actions > .button:not(.button--cart) { width: 100%; }
  .selection-item__actions { flex-wrap: wrap; }
  .selection-item__actions .button { flex: 1 1 150px; }
}

@media (max-width: 480px) {
  .header-inner { gap: 12px; }
  .brand { gap: 9px; }
  .brand img { width: 44px; height: auto; }
  .brand small { display: none; }
  .brand strong { font-size: .9rem; }
  .genre-grid { grid-template-columns: 1fr; }
  .hero-links { display: grid; grid-template-columns: 1fr; }
  .hero-links a { justify-content: center; }
  .hero-side > div { grid-template-columns: minmax(72px,auto) minmax(0,1fr); }
  .branch-card {
    grid-template-columns: 42px minmax(0,1fr);
  }
  .branch-card__count,
  .branch-phone { grid-column: 2; justify-self: start; text-align: left; }
  .pagination { justify-content: flex-start; }
}

/* v1.8.12 — быстрые подсказки и устойчивые миниатюры */
.book-cover__footer .book-cover__year {
  order: 1;
  margin: 0 !important;
  padding: 0;
  line-height: 1;
}
.book-cover__footer .book-cover__age {
  order: 2;
  margin: 0 0 0 auto !important;
  line-height: 1;
}

/* Ограничение применяется к самой ссылке: длинный заголовок больше не
   выходит из своей строки и не накладывается на автора. */
.catalog-card__body {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.catalog-card h3 {
  display: block;
  height: auto;
  min-height: 3.48em;
  max-height: 3.48em;
  overflow: hidden;
}
.catalog-card h3 a {
  display: -webkit-box;
  max-height: 3.48em;
  overflow: hidden;
  line-height: 1.16;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.catalog-card__author {
  display: -webkit-box;
  height: auto;
  min-height: 4.14em;
  max-height: 4.14em;
  overflow: hidden;
  line-height: 1.38;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.catalog-card__footer { margin-top: auto; }

.help-banner > div { flex: 1 1 0; }
.help-banner .button {
  flex: 0 1 230px;
  min-width: 0;
  max-width: 230px;
  white-space: normal;
  text-align: center;
}

@media (max-width: 1050px) {
  .help-banner {
    align-items: stretch;
    flex-direction: column;
    gap: 22px;
  }
  .help-banner > div { width: 100%; }
  .help-banner .button {
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 680px) {
  .catalog-card h3 {
    min-height: 4.64em;
    max-height: 4.64em;
  }
  .catalog-card h3 a {
    max-height: 4.64em;
    -webkit-line-clamp: 4;
  }
}

/* v1.8.15 — отдельный автор и живые подсказки в расширенном поиске */
.author-autocomplete {
  position: relative;
  min-width: 0;
}
.author-suggestions {
  position: absolute;
  z-index: 520;
  top: calc(100% + 7px);
  left: 0;
  right: 0;
  max-height: 310px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}
.author-suggestions__item {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid #edf1ef;
  color: var(--ink);
  background: #fff;
  text-align: left;
}
.author-suggestions__item:last-child { border-bottom: 0; }
.author-suggestions__item:hover,
.author-suggestions__item:focus {
  outline: 0;
  background: var(--surface-soft);
}
.author-suggestions__item strong {
  min-width: 0;
  overflow-wrap: anywhere;
}
.author-suggestions__item small {
  flex: 0 0 auto;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}
.author-suggestions__status {
  padding: 11px 12px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.35;
}

/* v1.8.16 — живые подсказки названий в расширенном поиске */
.title-autocomplete {
  position: relative;
  min-width: 0;
}
.title-suggestions {
  position: absolute;
  z-index: 530;
  top: calc(100% + 7px);
  left: 0;
  right: 0;
  max-height: 310px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}
.title-suggestions__item {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid #edf1ef;
  color: var(--ink);
  background: #fff;
  text-align: left;
}
.title-suggestions__item:last-child { border-bottom: 0; }
.title-suggestions__item:hover,
.title-suggestions__item:focus {
  outline: 0;
  background: var(--surface-soft);
}
.title-suggestions__item strong {
  min-width: 0;
  overflow-wrap: anywhere;
}
.title-suggestions__item small {
  flex: 0 0 auto;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}
.title-suggestions__status {
  padding: 11px 12px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.35;
}

