/* Layout bridge: the original Booth Catalog Explorer page design, using
   Asset Alley's existing filter, search, and archive controls. */
:root { color-scheme: light; }
body { color: var(--ink); }
.page-shell { width: min(1500px, calc(100vw - 32px)); }
.app { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 18px; align-items: start; margin: 0; }
.main { display: grid; grid-column: 1; grid-row: 1; min-width: 0; gap: 16px; }
.sidebar { grid-column: 2; grid-row: 1; position: sticky; top: 14px; display: grid; gap: 12px; min-width: 0; max-height: calc(100vh - 28px); overflow: auto; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; backdrop-filter: none; }
.sidebar__panel { padding: 15px; }
.sidebar .tabs { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; padding: 9px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); box-shadow: var(--shadow); }
.sidebar .tabs button { min-height: 42px; padding: 0 8px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-weight: 750; }
.sidebar .tabs button.active { background: var(--accent-soft); color: var(--accent-deep); border: 0; }
.filter-summary,.filter-group { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.filter-summary { margin: 0; padding: 13px 15px; color: var(--muted); }
.filter-group { margin: 0; padding: 14px; }
.group-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:9px; }
.group-toggle { border:0; padding:0; background:transparent; color:inherit; font-weight:inherit; text-align:left; }
.btn { display:inline-flex; align-items:center; justify-content:center; min-height:42px; padding:0 14px; border:1px solid var(--line); border-radius:999px; background:var(--panel-strong); color:var(--ink); font-weight:700; cursor:pointer; transition:background .16s,border-color .16s,transform .16s; }
.btn:hover { border-color:var(--accent); background:var(--accent-soft); }
.btn:disabled { opacity:.45; cursor:not-allowed; }
.btn.small { min-height:32px; padding:0 11px; font-size:.78rem; }
.btn.ghost { background:transparent; color:var(--muted); }
.full { width:100%; }
.group-title { padding:0; }
.scroll-list { max-height:230px; overflow:auto; margin-top:7px; }
.choice { display:flex; align-items:center; gap:8px; min-height:32px; padding:4px 6px; border-radius:9px; color:var(--ink); cursor:pointer; }
.choice:hover { background:var(--accent-soft); }
.choice input { width:16px; height:16px; margin:0; accent-color:var(--accent); }
.choice .count { margin-left:auto; color:var(--muted); font-size:.75rem; font-variant-numeric:tabular-nums; }
.tree-child { padding-left:25px; }
.feature-list { display:grid; grid-template-columns:1fr; }
.summary-muted { color:var(--muted); font-size:.8rem; }
.small-select { width:100%; }
.range-wrap { display:grid; gap:8px; }
.range-row { display:flex; align-items:center; gap:8px; }
.range-row input[type=range] { width:100%; accent-color:var(--accent); }
.range-value { color:var(--muted); font-size:.8rem; }
.switch-row { display:flex; align-items:center; gap:8px; margin-top:7px; }
.switch-row input { accent-color:var(--accent); }
.group-title { color: var(--ink); font-weight: 800; }
.btn,.searchbox,.main-search,.select,.small-select { color: var(--ink); }
.btn { border-radius: 999px; }
.searchbox,.main-search,.select,.small-select { min-height: 46px; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(255,255,255,.8); padding: 0 13px; }
.feature-list { grid-template-columns: 1fr; }
.range-wrap input[type=range],.choice input { accent-color: var(--accent); }
.toolbar { display: grid; grid-template-columns: minmax(240px,1fr) minmax(130px,170px) minmax(110px,140px) minmax(110px,140px); gap: 10px; padding: 14px; }
.toolbar>.searchbar { grid-column:1; grid-row:1; }
.toolbar>#sort { grid-column:2; grid-row:1; }
.toolbar>#time { grid-column:3; grid-row:1; }
.toolbar>#perPage { grid-column:4; grid-row:1; }
.select { min-height:46px; padding:0 13px; border:1px solid var(--line); border-radius:var(--radius-md); background:rgba(255,255,255,.8); color:var(--ink); }
.searchbar { display: flex; gap: 10px; align-items: center; }
.searchbar #mobileFilters { display:none; }
.search-wrap { min-width: 0; flex: 1; }
.main-search { width: 100%; min-height:50px; padding:0 15px; border:1px solid var(--line); border-radius:var(--radius-md); background:var(--panel); color:var(--ink); }
.gear { min-width:46px; min-height:46px; }
.runtime { padding:11px 14px; border:1px solid rgba(42,122,82,.25); border-radius:var(--radius-md); background:rgba(42,122,82,.1); color:#2a7a52; }
.popover { position:absolute; z-index:10; top:calc(100% + 8px); right:0; width:min(290px,90vw); padding:14px; border:1px solid var(--line); border-radius:var(--radius-lg); background:var(--panel-strong); box-shadow:var(--shadow); }
.scope-row { display:flex; align-items:center; gap:8px; padding:6px 0; font-size:.83rem; }
.scope-row input { accent-color:var(--accent); }
.result-count { color: var(--muted); white-space: nowrap; }
.clear-all-toolbar { flex: 0 0 auto; min-height: 38px; white-space: nowrap; }
.runtime { white-space: nowrap; }
.discovery-shelf { padding: 18px; }
.shelf-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.shelf-head h2 { margin: 0; font-family: var(--font-display); font-size: clamp(1.25rem,2vw,1.8rem); line-height: 1.1; }
.shelf-head .eyebrow { margin: 0 0 7px; }
.shelf-copy { margin: 5px 0 0; color: var(--muted); font-size: .88rem; }
.shelf-toggle { flex: 0 0 auto; }
.shelf-content[hidden] { display: none !important; }
.mini-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.mini-card { display: grid; grid-template-columns: 86px minmax(0,1fr); min-width: 0; overflow: hidden; border: 2px solid rgba(0,0,0,.88); border-radius: 17px; background: rgba(255,251,245,.92); box-shadow: 0 10px 28px rgba(58,37,23,.12); cursor: pointer; }
.mini-card__image { width: 86px; height: 92px; background: #f2e8d8; object-fit: cover; }
.mini-card__body { display: flex; min-width: 0; flex-direction: column; justify-content: center; padding: 9px 11px; }
.mini-card__title { overflow: hidden; color: var(--ink); font-size: .85rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.mini-card__meta { overflow: hidden; margin-top: 4px; color: var(--muted); font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.mini-card__actions { display: flex; gap: 6px; margin-top: 6px; }
.mini-card__actions button { padding: 0; border: 0; background: transparent; color: var(--accent-deep); font-size: .72rem; font-weight: 800; }
.library-panel .sidebar__head { gap: 8px; }
.library-panel .sidebar__title-row { align-items: baseline; }
.library-panel .sidebar__title-row h2 { font-family: var(--font-display); }
.library-panel .sidebar__head-actions { gap: 5px; }
.library-panel .sidebar__toggle { min-height: 34px; padding: 0 11px; }
.library-panel .sidebar__list { max-height: 255px; }
.library-item { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 6px; border-radius: 12px; cursor: pointer; }
.library-item:hover { background: var(--accent-soft); }
.library-item img { width: 46px; height: 46px; flex: 0 0 auto; border-radius: 9px; background: #f2e8d8; object-fit: cover; }
.library-item__body { min-width: 0; flex: 1; }
.library-item__title { overflow: hidden; font-size: .78rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.library-item__meta { overflow: hidden; color: var(--muted); font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.library-item button { border: 0; background: transparent; color: var(--muted); font-size: 1.15rem; }
.library-empty { padding: 13px 6px; color: var(--muted); font-size: .8rem; }
.grid { grid-template-columns: repeat(5,minmax(0,1fr)); gap: 16px; }
.card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 2px solid rgba(0,0,0,.88); border-radius: 24px; background: rgba(255,251,245,.92); box-shadow: var(--shadow); transition: transform 180ms ease, box-shadow 180ms ease; }
.card:hover { transform: translateY(-3px); box-shadow: 0 20px 50px rgba(58,37,23,.18); }
.thumb { position: relative; width: 100%; aspect-ratio: 1/1; overflow: hidden; background: linear-gradient(135deg,rgba(216,87,51,.14),rgba(102,119,53,.08)),#f2e8d8; }
.thumb>img { width: 100%; height: 100%; object-fit: cover; transition: transform 220ms ease; }
.card:hover .thumb>img { transform: scale(1.04); }
.badges { inset: 10px 10px auto; gap: 6px; }
.badge { min-height: 28px; padding: 3px 10px; border-radius: 999px; font-size: .75rem; box-shadow: none; }
.price-badge { position: absolute; top: auto; right: auto; bottom: 11px; left: 11px; min-height: 34px; padding: 5px 12px; border-radius: 999px; background: rgba(20,24,31,.86); font-size: .86rem; }
.carousel-arrow { position:absolute; z-index:2; top:46%; width:38px; height:38px; border:1px solid rgba(255,255,255,.65); border-radius:50%; background:rgba(20,24,31,.78); color:white; font-size:1.2rem; }
.carousel-arrow.prev { left:9px; }.carousel-arrow.next { right:9px; }
.thumb-strip { position:absolute; z-index:2; right:0; bottom:0; left:0; display:flex; justify-content:center; gap:5px; overflow:hidden; padding:6px; background:rgba(20,24,31,.62); }
.thumb-strip img { width:36px; height:36px; border:2px solid rgba(255,255,255,.45); border-radius:7px; object-fit:cover; opacity:.65; }.thumb-strip img.selected { border-color:white; opacity:1; }
.card-body { display: flex; flex: 1; flex-direction: column; gap: 9px; padding: 14px; }
.card-title { min-height: 0; overflow: hidden; font-family: var(--font-display); font-size: 1rem; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.category-date { margin: 0; color: var(--muted); font-size: .78rem; }
.excerpt { display:none; }
.metadata-button { display:flex; width:100%; align-items:center; gap:6px; margin:auto 0 0; padding:8px 10px; border:1px solid var(--line); border-radius:999px; background:rgba(255,255,255,.7); color:var(--ink); text-align:left; cursor:pointer; }
.metadata-button .meta-count { margin-left:auto; color:var(--muted); font-size:.68rem; white-space:nowrap; }
.metadata-button .chevron { font-size:1rem; }
.metadata { display:none !important; padding:10px; border:1px solid var(--line); border-radius:14px; background:rgba(255,255,255,.68); color:var(--ink); font-size:.78rem; }
.metadata.open { display:block !important; max-height:240px; overflow:auto; }
.metadata-label { margin:9px 0 4px; color:var(--muted); font-size:.68rem; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.tagchips { display:flex; flex-wrap:wrap; gap:5px; }
.tagchip { padding:3px 8px; border:1px solid var(--line); border-radius:999px; background:var(--accent-soft); color:var(--muted); font-size:.68rem; }
.asset-card__actions { gap:8px; margin-top:auto; padding:10px; border:1px solid var(--line); border-radius:16px; background:rgba(31,36,48,.055); }
.asset-card__inspect,.asset-card__save,.asset-card__copy { border:1px solid rgba(31,36,48,.08); border-radius:11px; background:rgba(255,255,255,.88); }
.asset-card__cta { border-radius:11px; }
.asset-card__inspect:hover,.asset-card__save:hover,.asset-card__copy:hover { background:var(--accent-soft); }
.explore-items { border:0; background:transparent; color:var(--accent-deep); padding:0 12px 8px; font-size:.75rem; }
.explore-items:hover { text-decoration:underline; }
.metadata { border-top: 1px solid var(--line); }
.foot { min-height: 48px; height: auto; border-top: 1px solid var(--line); }
.foot button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: rgba(255,255,255,.76); color: var(--accent-deep); }
.pages { display: flex; justify-content: center; align-items: center; gap: 10px; padding: 20px; }
.pages button { min-height: 46px; }
.empty { border-radius: var(--radius-xl); background: var(--panel); }
.modal { border: 2px solid rgba(0,0,0,.88); border-radius: var(--radius-xl); }
.modal-backdrop { position:fixed; z-index:30; inset:0; display:grid; place-items:center; padding:22px; background:rgba(20,24,31,.72); backdrop-filter:blur(6px); }
.modal { width:min(1000px,100%); max-height:calc(100vh - 44px); overflow:auto; background:var(--panel-strong); box-shadow:var(--shadow); }
.modal-head { position:sticky; z-index:1; top:0; display:flex; justify-content:space-between; padding:14px 18px; border-bottom:1px solid var(--line); background:var(--panel-strong); }
.detail { display:grid; grid-template-columns:1fr 1fr; gap:22px; padding:20px; }
.hero-image { width:100%; aspect-ratio:1; border-radius:var(--radius-lg); background:#f2e8d8; object-fit:contain; }
.gallery { display:flex; gap:7px; overflow:auto; padding:8px 0; }
.gallery img { width:64px; height:58px; border-radius:9px; object-fit:cover; cursor:pointer; }
.note { padding:8px; color:var(--muted); font-size:.78rem; }
.placeholder { display:grid; width:100%; height:100%; place-items:center; color:var(--muted); }
.toolbar { grid-template-columns: minmax(170px,1fr) minmax(130px,170px) minmax(110px,135px); }.toolbar .page-controls { display:none; }
@media (max-width: 1100px) { .page-shell { width: min(100vw - 28px,1500px); }.app { grid-template-columns: 1fr; }.main { grid-column:1; grid-row:1; }.sidebar { grid-column:1; grid-row:2; position:relative; top:auto; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); max-height:none; overflow:visible; }.sidebar>.tabs,.sidebar>.filter-summary,.sidebar>#clearAll { grid-column:1/-1; }.sidebar .filter-group,.sidebar .library-panel { align-self:start; }.mini-grid { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media (max-width: 980px) { .grid { grid-template-columns:repeat(3,minmax(0,1fr)); }.toolbar { grid-template-columns:repeat(3,minmax(0,1fr)); }.toolbar .select:first-child { min-width:0; } }
@media (max-width: 720px) { .page-shell { width:min(100vw - 20px,1500px); padding-top:16px; }.hero { grid-template-columns:1fr; }.hero__copy,.hero__meta,.discovery-shelf { padding:13px; }.hero h1 { max-width:none; font-size:clamp(2rem,9vw,3rem); }.hero__stats { grid-template-columns:repeat(3,minmax(0,1fr)); }.toolbar { grid-template-columns:1fr 1fr; }.toolbar .select:first-child { grid-column:1/-1; }.page-controls { display:none; }.searchbar { flex-wrap:wrap; }.runtime { display:none; }.result-count { margin-left:auto; }.sidebar { display:none; }.sidebar.expanded { display:grid; }.grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }.mini-grid { grid-template-columns:1fr 1fr; }.card-body { padding:10px; }.card-title { font-size:.9rem; }.excerpt { display:none; } }
@media (max-width: 520px) { .hero__stats { grid-template-columns:1fr; }.hero__links { gap:7px; }.hero__jump { padding:0 12px; }.toolbar { display:flex; overflow-x:auto; flex-wrap:nowrap; }.toolbar select { flex:0 0 auto; min-width:104px; }.toolbar .select:first-child { min-width:140px; }.grid { gap:8px; }.card-body { padding:8px; gap:6px; }.category-date { font-size:.68rem; }.metadata-button { padding:6px; gap:4px; font-size:.68rem; }.metadata-button .meta-count { font-size:.58rem; }.foot { gap:4px; padding:5px; font-size:.7rem; }.author-icon { width:19px; height:19px; }.foot button { width:28px; height:28px; }.badges { inset:6px 6px auto; gap:3px; }.badge { min-height:23px; padding:2px 6px; font-size:.62rem; }.price-badge { bottom:7px; left:7px; min-height:27px; }.mini-grid { grid-template-columns:1fr; }.sidebar { grid-template-columns:1fr; }.sidebar>.tabs,.sidebar>.filter-summary,.sidebar>#clearAll { grid-column:1; }.library-panel .sidebar__head { flex-wrap:wrap; }.detail { grid-template-columns:1fr; } }
@media (max-width: 720px) { .searchbar #mobileFilters { display:inline-flex; } }

/* Keep toolbar controls above the cards and give the search popover a local anchor. */
.toolbar { position: relative; z-index: 50; overflow: visible; }
.searchbar { position: relative; z-index: 51; min-width: 0; }
.search-wrap { position: relative; z-index: 52; }
.popover { z-index: 1000; }
@media (max-width: 980px) {
  .toolbar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .toolbar > .searchbar { grid-column: 1 / -1; grid-row: 1; }
  .toolbar > #sort { grid-column: 1; grid-row: 2; }
  .toolbar > #time { grid-column: 2; grid-row: 2; }
  .toolbar > #perPage { grid-column: 3; grid-row: 2; }
}
@media (max-width: 720px) {
  .toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar > .searchbar { grid-column: 1 / -1; grid-row: 1; }
  .toolbar > #sort { grid-column: 1 / -1; grid-row: 2; }
  .toolbar > #time { grid-column: 1; grid-row: 3; }
  .toolbar > #perPage { grid-column: 2; grid-row: 3; }
}
@media (max-width: 520px) {
  .toolbar { display: grid; overflow: visible; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar > .searchbar { grid-column: 1 / -1; grid-row: 1; width: 100%; flex-wrap: wrap; }
  .toolbar > #sort { grid-column: 1 / -1; grid-row: 2; }
  .toolbar > #time { grid-column: 1; grid-row: 3; }
  .toolbar > #perPage { grid-column: 2; grid-row: 3; }
}
