/* Shared catalogue navigation, filters and results. */
.catalog-branches {
  --branch-ink: #662019;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  margin: 0 0 24px;
  background: #f8f3f2;
  border: 1px solid #ede1de;
  border-radius: 16px;
}
.catalog-branches > .catalog-branch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--branch-ink);
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.25;
  text-decoration: none;
  text-align: center;
  overflow-wrap: break-word;
}
.catalog-branch > svg { width: 18px; height: 18px; flex: none; }
.catalog-branches > .catalog-branch:hover { background: #fff; color: #662019; border-color: #d9c5c1; }
.catalog-branches > .catalog-branch[aria-current="page"] { background: #88281e; border-color: #88281e; color: white; }
.catalog-branches a:focus-visible, .catalog-picker :focus-visible, .catalog-subnav a:focus-visible, #app .list a:focus-visible, #app .list button:focus-visible { outline: 3px solid #88281e; outline-offset: 3px; }
#app .catalog-intro { align-items: flex-end; padding-block: 27px 22px; }
#app .catalog-intro h1 { max-width: 26ch; margin: 0; font-size: clamp(29px, 4.5vw, 52px); line-height: 1.09; letter-spacing: -.035em; }
#app .catalog-intro .breadcrumb { display: flex; flex-wrap: wrap; gap: 5px 9px; margin-bottom: 13px; line-height: 1.4; }
#app .catalog-intro .office-label { flex: none; }
.catalog-description { max-width: 76ch; margin: 0 0 24px; font-size: 16px; line-height: 1.55; color: #333333; }
#app .search-form { margin: 0; }
#app .search-input:focus-within { border-color: #88281e; }
#app .unified-layout { grid-template-columns: minmax(220px, 272px) minmax(0, 1fr); gap: clamp(18px,3vw,40px); padding-top: 24px; align-items: start; }
#app .unified-sidebar { display: grid; gap: 16px; min-width: 0; }
.catalog-picker {
  min-width: 0; padding: 18px; border: 1px solid #ede1de;
  border-radius: 15px; background: #fdfbfa; color: #333333;
}
.catalog-picker h2 { margin: 0 0 12px; font-size: 18px; line-height: 1.3; font-weight: 700; }
.catalog-picker-search {
  display: flex; gap: 8px; align-items: center; width: 100%;
  min-height: 44px; padding: 0 10px; border: 1px solid #ae827b;
  border-radius: 8px; background: white; color: #56504f;
}
.catalog-picker-search svg { flex: none; width: 17px; height: 17px; }
.catalog-picker .catalog-picker-search input { font: inherit; width: 100%; min-width: 0; height: 42px; border: none; background: transparent; }
.catalog-picker-search:focus-within { outline: 2px solid #88281e; outline-offset: 1px; }
.catalog-picker-search input:focus-visible { outline: none; }
.catalog-picker nav, .catalog-nav.unified-sidebar .catalog-picker nav { display: grid; gap: 2px; max-height: min(56vh,540px); margin: 10px 0 0; padding: 2px; overflow-x: hidden; overflow-y: auto; }
.catalog-picker .picker-link { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; padding: 8px; border-radius: 7px; color: #333333; text-decoration: none; line-height: 1.36; font-size: 14px; overflow-wrap: anywhere; }
.catalog-picker .picker-link small { color: #56504f; font-size: 12px; font-variant-numeric: tabular-nums; }
.catalog-picker .picker-link small:first-child { display: inline; }
.catalog-picker .picker-matches .picker-link span small { display: block; margin-top: 3px; }
.catalog-picker .picker-link:hover, .catalog-picker .picker-link[aria-current] { background: #ede1de; color: #88281e; }
.catalog-picker .picker-link[aria-current] { font-weight: 700; }
.catalog-picker .picker-more { cursor: pointer; min-height: 42px; margin-top: 7px; padding: 5px 8px; border: 0; background: transparent; font: inherit; font-size: 14px; font-weight: 700; color: #88281e; }
.catalog-picker [hidden] { display: none !important; }
#study-empty { margin: 14px 4px 0; font-size: 14px; }
.catalog-subnav { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 20px; }
.catalog-subnav a { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 10px; border: 1px solid #ede1de; border-radius: 8px; color: #88281e; text-decoration: none; font-size: 14px; line-height: 1.3; }
.catalog-subnav a:hover, .catalog-subnav a[aria-current] { background: #f8f3f2; border-color: #ae827b; }
#app .unified-layout .test-row { min-height: auto; align-items: center; padding: 17px 0; }
#app .unified-layout .test-row h3 { margin: 6px 0; overflow-wrap: anywhere; }
#app .unified-layout .test-row h3 a { text-underline-offset: .16em; }
#app .unified-layout .test-row h3 a:hover { text-decoration: underline; color: #88281e; }
#app .unified-layout .test-buy { font-variant-numeric: tabular-nums; }
#app .unified-layout .test-category { line-height: 1.4; }
#app .unified-layout .test-row .add { min-height: 44px; min-width: 44px; }
#app .unified-layout .results { min-width: 0; }
#app .unified-layout .filters { flex-wrap: wrap; }
#app .unified-layout .help { margin: 0; }
#app:has(.detail-layout) .catalog-branches { margin-block: 16px 20px; }
#app .detail-layout { min-width: 0; }
#app .detail-layout h1 { overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .catalog-branches > .catalog-branch { gap: 5px; padding: 7px; }
  .catalog-branch > svg { display: none; }
  #app .unified-layout { grid-template-columns: minmax(190px, 32%) minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .catalog-branches { grid-template-columns: repeat(6,minmax(0,1fr)); padding: 4px; gap: 4px; margin-bottom: 16px; border-radius: 13px; }
  .catalog-branches > .catalog-branch { grid-column: span 2; min-height: 44px; font-size: 13px; border-radius: 8px; }
  .catalog-branches > .catalog-branch:nth-last-child(-n+2) { grid-column: span 3; }
  #app .catalog-intro { padding-block: 18px 14px; }
  #app .catalog-intro .office-label { margin: 12px 0 0; }
  #app .unified-layout { display: flex; flex-direction: column; gap: 20px; padding-top: 18px; }
  #app .unified-sidebar, #app .unified-layout .results { width: 100%; }
  #app .unified-layout .help { display: none; }
  .catalog-picker { padding: 12px; }
  .catalog-picker h2 { font-size: 16px; }
  .catalog-nav.unified-sidebar .catalog-picker nav { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; max-height: 235px; }
  .catalog-picker .picker-link { min-height: 44px; }
  .catalog-picker .catalog-picker-search input { font-size: 16px; }
  #app .unified-layout .results-top { align-items: stretch; padding-bottom: 12px; }
  #app .unified-layout .test-buy { justify-content: space-between; }
  .catalog-subnav a { min-height: 44px; }
}
@media(max-width: 380px) {
  .catalog-branches > .catalog-branch { padding: 5px 3px; }
  .catalog-nav.unified-sidebar .catalog-picker nav { grid-template-columns: 1fr; max-height: 196px; }
}


/* Catalogue typography and controls */
#app .catalog-intro h1, .topics-page main h1 {
  font-family: Georgia, serif;
  font-weight: 600;
  letter-spacing: -.038em;
  color: #382621;
}
#app .catalog-intro { border-top: 3px solid #88281e; margin-top: 12px; }
#app .search-form { background: #faf6f3; border: 1px solid #e6d9d3; border-radius: 16px; padding: clamp(12px, 2vw, 24px); }
#app .search-input { background: white; border-color: #ad9187; }
#app .search-options small { font-size: 12px; line-height: 1.45; }
.catalog-picker .picker-link small { white-space: nowrap; flex: none; }
.catalog-picker .picker-link span { min-width: 0; }
.picker-disclosure { display: none; }
#app .test-buy strong, #app .detail-price { white-space: nowrap; font-variant-numeric: tabular-nums; }
#app .list > :hover { background: #fcf9f7; }
.topics-page .topic-letters a { min-width: 42px; min-height: 42px; font-weight: 650; }
.topics-page .topics-alphabet section { border: 1px solid #e6d9d3; border-radius: 14px; padding: 18px; background: #fff; }
.topics-page .topics-alphabet section h2 { color: #88281e; font-family: Georgia,serif; }
.topics-page .topics-alphabet li + li { margin-top: 8px; }
.topics-page .topics-search { background: #faf6f3; }
dialog[open] { max-height: 90dvh; overflow-y: auto; overscroll-behavior: contain; }
dialog button, .basket-button { min-height: 44px; }
dialog input:not([type=checkbox]) { font-size: 16px; }
@media(max-width:800px) {
  #app .catalog-intro { padding-block: 14px 10px; }
  #app .catalog-intro h1, .topics-page main h1 { font-size: clamp(32px,7.8vw,44px); }
  .catalog-picker .picker-disclosure { display:flex; align-items:center; justify-content:space-between; width:100%; min-height:46px; border:0; background:transparent; color:#552720; font:inherit; font-weight:650; text-align:left; padding:8px 12px; cursor:pointer; }
  .picker-disclosure::after { content:'+'; font-size:22px; font-weight:400; }
  .picker-disclosure[aria-expanded=true]::after { content:'−'; }
  .catalog-picker:has(.picker-disclosure) { padding:0; background:#faf6f3; }
  .catalog-picker:has(.picker-disclosure) h2 { display:none; }
  .picker-disclosure[aria-expanded=false] + .picker-body { display:none; }
  .catalog-picker .picker-body { padding:0 12px 12px; }
  #app .catalog-picker nav { grid-template-columns:1fr; }
  #app .catalog-picker .picker-link { min-height:44px; }
  #app .unified-layout { gap:16px; }
  #app .test-buy button { min-height:44px; min-width:44px; }
  .topics-page .topic-letters { gap:4px; }
  .topics-page .topic-letters a { min-width:44px; min-height:44px; }
}
@media(max-width:600px) {
  .site-head .phone-small, .site-head .phone small { display:none; }
  body .site-head,.topics-page .site-head { display:flex; align-items:center; justify-content:space-between; gap:6px; flex-wrap:nowrap; padding:10px 14px; }
  .site-head .city { display:none; }
  body .site-head img,.topics-page .site-head img { width:clamp(95px,28vw,125px); height:auto; }
  body .site-head .phone { font:600 13px/1.25 system-ui,sans-serif; white-space:nowrap; }
  .catalog-branches>.catalog-branch { letter-spacing:0; font-family:system-ui,sans-serif; }
  .topics-search-row button { min-height:44px; }
  dialog[open] { max-width:calc(100vw - 16px); padding:16px; }
}
@media(max-width:600px){
  body .site-head > a:first-child { flex:0 0 auto; }
  body .site-head > div { width:auto; flex:0 1 auto; margin-left:auto; margin-right:6px; }
  body .site-head > .basket-button { flex:0 0 auto; }
  #app .filters { grid-template-columns:minmax(0,1fr); gap:6px; }
  #app .filters select { width:100%; }
}

.filter-switch{display:none}
#app .catalog-intro + .search-form{margin-bottom:14px}
.topics-page .topics-basket{display:inline-flex;align-items:center;min-height:44px;padding:0 10px;color:#88281e;border:1px solid #ddccc5;border-radius:8px;text-decoration:none}
.topics-page .office select{font:inherit;min-height:44px;border:1px solid #cbbab2;background:white;border-radius:7px;padding:4px 8px}
.topics-page main:has(.topics-alphabet)>header{background:none;padding:8px 0;margin:0}
.topics-page main:has(.topics-alphabet)>header p{display:none}
.topics-page main:has(.topics-alphabet)>header h1{margin:8px 0}
#app .list .test-main h3{margin:0 0 5px}
#app .list .test-meta{margin:5px 0 0}
@media(max-width:800px){
#app .filter-switch{display:block;border:1px solid #d4c3bc;border-radius:8px;background:#fff;color:#77291e;padding:6px 12px;min-height:44px;font:inherit;cursor:pointer}
#app .filter-switch[aria-expanded=false]+.filters{display:none}
#app .filter-switch[aria-expanded=true]+.filters{margin-top:8px}
#app .results-top{display:flex;flex-direction:row;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px}
#app .catalog-intro .office-label{display:flex;align-items:center;gap:8px;margin:5px 0 0}
#app .catalog-intro .office-label select{width:auto;max-width:100%;min-height:40px}
#app .catalog-intro{padding-bottom:6px}
#app .catalog-intro .breadcrumb{margin-bottom:5px}
#app .search-form .search-options{margin-top:4px}
#app .search-form .search-options:not(:focus-within):not(:has(input:checked)) small{display:none}
#app .search-form{padding:8px 10px}
#app .unified-layout{padding-top:8px;gap:12px}
#app .unified-layout .test-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:8px}
#app .unified-layout .test-buy{display:flex;flex-direction:column;align-items:flex-end;gap:6px}
dialog[open] .lcp-order-form{padding-bottom:max(12px,env(safe-area-inset-bottom))}
dialog[open] .lcp-order-form button[type=submit]{position:sticky;bottom:0;z-index:1}
.topics-page .patient-nav{margin-block:4px;padding-block:4px}
.topics-page .site-head .phone{font-size:12px}
}
