/* Design Brain V0.2.2 · full-frame browsing and Detail Overlay */

/* Browsing mode */
.browse-mode-wrap { position: relative; }
.browse-mode-button { display: flex; align-items: center; gap: 6px; min-width: 66px; padding: 0 10px; }
.browse-mode-button span { font-size: 11px; font-weight: 560; }
.browse-mode-button i { margin-left: auto; color: #8b8b88; font-size: 9px; font-style: normal; }
.browse-menu { top: 40px; right: 0; width: 250px; padding: 6px; }
.browse-menu > header { display: grid; gap: 3px; padding: 8px 9px 10px; border-bottom: 1px solid var(--line); }
.browse-menu > header b { font-size: 11px; }
.browse-menu > header span { color: var(--muted); font-size: 9px; }
.browse-menu > button,
.browse-category-options button { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 37px; padding: 7px 9px; border: 0; border-radius: 6px; background: transparent; text-align: left; }
.browse-menu > button:hover,
.browse-category-options button:hover { background: #efefed; }
.browse-menu button > span { display: grid; gap: 2px; }
.browse-menu button b { font-size: 10px; font-weight: 560; }
.browse-menu button small { color: #92928f; font-size: 8px; }
.browse-menu button > i { opacity: 0; font-size: 10px; font-style: normal; }
.browse-menu button[aria-checked="true"] > i { opacity: 1; }
.browse-category-options { margin-top: 4px; padding-top: 5px; border-top: 1px solid var(--line); }
.browse-category-options > span { display: block; padding: 5px 9px 3px; color: #969693; font-size: 8px; letter-spacing: .04em; }
.browse-category-options button { min-height: 31px; padding-left: 17px; }
.browse-menu .reshuffle-button { margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 6px 6px; }
.browse-menu .reshuffle-button > i { opacity: 1; color: #6f6f6c; font-size: 14px; }

/* Every visual preview keeps the complete frame. The element's actual ratio is
   updated from naturalWidth/naturalHeight after the preview loads. */
.asset-thumb { height: auto; min-height: 42px; }
.asset-thumb img { width: 100%; height: 100%; object-fit: contain; object-position: center; }
.asset-thumb.transparent img { padding: 0; object-fit: contain; }
.document-preview img { object-fit: contain; }
.similar-preview img { object-fit: contain; }

/* Grouped category browsing */
.masonry.is-grouped { display: grid; gap: 30px; padding-top: 16px; column-width: auto; column-gap: 0; }
.asset-group { min-width: 0; }
.asset-group-head { display: flex; align-items: baseline; gap: 8px; margin: 0 0 11px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.asset-group-head h2 { margin: 0; font-size: 14px; font-weight: 620; letter-spacing: -.15px; }
.asset-group-head span { color: #8a8a87; font-size: 9px; }
.masonry-group { column-width: var(--columns); column-gap: var(--gap); }
.masonry-group .asset-card { margin-bottom: var(--gap); }
.masonry.density-compact .masonry-group { --gap: 7px; }

/* Overlay replaces the pushed right Inspector. */
.app-shell,
.app-shell.has-inspector { grid-template-columns: 210px minmax(0, 1fr); }
.detail-overlay { position: fixed; z-index: 650; inset: 0; display: grid; place-items: center; padding: 26px; background: rgba(26,26,24,.30); animation: detail-overlay-in .15s ease-out; }
.detail-card { display: grid; grid-template-columns: minmax(0, 63fr) minmax(360px, 37fr); width: min(1460px, calc(100vw - 52px)); height: min(920px, calc(100vh - 52px)); overflow: hidden; border: 1px solid rgba(0,0,0,.14); border-radius: 14px; background: #f7f7f5; box-shadow: 0 28px 90px rgba(0,0,0,.26), 0 4px 16px rgba(0,0,0,.09); animation: detail-card-in .17s cubic-bezier(.2,.75,.3,1); }
.detail-media { position: relative; display: flex; min-width: 0; min-height: 0; flex-direction: column; background: #e8e8e5; border-right: 1px solid var(--line); }
.detail-media .preview-stage { flex: 1; width: 100%; min-height: 0; margin: 0; aspect-ratio: auto; border-radius: 0; background: #e8e8e5; }
.detail-media .preview-stage[data-bg="checker"] { background-color: #eee; background-image: linear-gradient(45deg,#d6d6d3 25%,transparent 25%),linear-gradient(-45deg,#d6d6d3 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#d6d6d3 75%),linear-gradient(-45deg,transparent 75%,#d6d6d3 75%); background-size: 22px 22px; background-position: 0 0,0 11px,11px -11px,-11px 0; }
.detail-media .preview-stage[data-bg="white"] { background: #fff; }
.detail-media .preview-stage[data-bg="black"] { background: #070707; }
.detail-media .preview-art { display: grid; place-items: center; min-width: 0; min-height: 0; }
.detail-media .preview-art img { display: block; width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; object-position: center; }
.detail-media .preview-art .source-placeholder { width: 100%; height: 100%; }
.detail-media .background-switch { position: absolute; z-index: 5; right: 14px; bottom: 14px; gap: 12px; padding: 5px 6px 5px 9px; border: 1px solid rgba(0,0,0,.1); border-radius: 8px; background: rgba(248,248,246,.96); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.detail-info { display: flex; min-width: 0; min-height: 0; flex-direction: column; background: #fbfbfa; }
.detail-info .inspector-head { flex: 0 0 auto; min-height: 70px; }
.detail-info .inspector-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.detail-info .inspector-content { padding: 4px 20px 0; }
.detail-nav { display: flex; align-items: center; gap: 3px; margin-left: 10px; }
.detail-nav > span { margin: 0 5px 0 0; color: #979794; font-size: 9px; white-space: nowrap; }
.detail-nav button { display: grid; place-items: center; width: 27px; height: 27px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #6f6f6c; font-size: 13px; }
.detail-nav button:hover:not(:disabled) { background: #ececea; color: #20201f; }
.detail-nav button:disabled { opacity: .28; }
.detail-nav .close-button { margin-left: 4px; font-size: 19px; }
.detail-info .inspector-section { padding-block: 20px; }
.detail-info .quicklook-note { margin: 0; }
.detail-info .quicklook-note kbd + kbd { margin-left: 3px; }
.detail-overlay .inspector-similar { top: 14px; right: 14px; }

@keyframes detail-overlay-in { from { background: rgba(26,26,24,0); } }
@keyframes detail-card-in { from { opacity: 0; transform: scale(.985) translateY(4px); } }

@media (max-width: 1180px) {
  .app-shell,
  .app-shell.has-inspector { grid-template-columns: 184px minmax(0,1fr); }
  .detail-overlay { padding: 18px; }
  .detail-card { grid-template-columns: minmax(0, 60fr) minmax(360px, 40fr); width: calc(100vw - 36px); height: calc(100vh - 36px); }
  .browse-mode-button { min-width: 58px; }
}

@media (prefers-reduced-motion: reduce) {
  .detail-overlay,
  .detail-card { animation: none; }
}
