.design-page dialog.product-library {
  width:min(960px,calc(100vw - 32px));
  max-width:none;
  height:min(680px,calc(100dvh - 32px));
  max-height:calc(100dvh - 32px);
  padding:0;
  overflow:hidden;
  border:1px solid #dbe3e5;
  border-radius:16px;
  color:#30464f;
  background:#fff;
  box-shadow:0 24px 80px #1d343a30;
}
.product-library[open] {display:flex;flex-direction:column}
.product-library::backdrop,.product-page-viewer::backdrop {background:#1c303e70;backdrop-filter:blur(4px)}
.library-heading {padding:20px 24px 16px;display:flex;align-items:center;gap:16px}
.library-heading>div {flex:1;min-width:0}
.design-page .library-heading h2 {margin:0;font-size:21px;line-height:1.4}
.design-page .library-heading p {font-size:12px;color:#73838b;margin:5px 0 0;line-height:1.5}
.library-heading .button {min-height:40px}
.library-back {display:none}
.library-tools {display:flex;gap:10px;padding:0 24px}
.library-tools input,.library-tools select {border:1px solid #d9e1e5;border-radius:9px;padding:11px 12px;background:#fff;min-width:0;color:inherit;font:inherit;font-size:14px;min-height:44px}
.library-tools input {flex:1}
.library-tools select {max-width:36%}
.design-page .library-result-count {font-size:12px;color:#73838b;padding:10px 24px;margin:0;line-height:1.5}
.library-body {display:grid;grid-template-columns:34% minmax(0,1fr);min-height:0;flex:1;border-top:1px solid #edf0f2}
.library-list {overflow:auto;overscroll-behavior:contain;background:#f7f9fa;border-right:1px solid #e7edef;padding:8px}
.library-item {display:block;width:100%;text-align:left;padding:13px 14px;border:1px solid transparent;border-radius:9px;background:none;color:inherit;font:inherit;cursor:pointer;min-height:64px}
.library-item strong {display:block;font-size:14px;line-height:1.55;font-weight:500;overflow-wrap:anywhere}
.library-item span {display:block;font-size:12px;color:#7a8c94;margin-top:3px}
.library-item:hover {background:#eef3f5}
.library-item[aria-pressed=true] {border-color:#cadce3;background:#e8f0f3}
.library-item:focus-visible,.library-disclosure summary:focus-visible,.library-back:focus-visible {outline:2px solid #427f8c;outline-offset:-2px}
.design-page .library-empty {padding:12px;font-size:13px}
.library-detail {padding:24px 28px;overflow:auto;overscroll-behavior:contain;min-width:0;outline:none}
.library-detail h3 {margin:7px 0 9px;font-size:22px;line-height:1.5;font-weight:600;overflow-wrap:anywhere}
.library-category {font-size:12px;color:#547b87}
.design-page .library-meta {font-size:12px;line-height:1.8;color:#778a93;margin:0 0 16px}
.library-detail h4 {font-size:13px;margin:18px 0 8px}
.library-detail p,.library-detail li {overflow-wrap:anywhere}
.library-preview {padding:0;list-style:none;margin:18px 0 22px}
.library-preview li {font-size:13px;line-height:1.8;margin:5px 0;color:#4f6873}
.library-disclosure {border-top:1px solid #e8edef}
.library-disclosure>summary {display:flex;justify-content:space-between;align-items:center;gap:12px;padding:15px 0;min-height:48px;cursor:pointer;font-size:13px;font-weight:500;color:#405e6a;list-style:none}
.library-disclosure>summary::after {content:'+';font-size:17px;font-weight:400;color:#81949c}
.library-disclosure[open]>summary::after {content:'−'}
.library-disclosure>summary::-webkit-details-marker {display:none}
.library-specs li {font-size:13px;line-height:1.9;margin:4px 0}
.library-specs ul {padding-left:20px;margin:0 0 16px}
.library-specs details {font-size:13px;margin:6px 0 18px}
.library-specs details summary {cursor:pointer;padding:10px 0;min-height:40px}
.design-page .library-sources p {font-size:12px;color:#7a8a92;margin:0 0 10px}
.library-page-links {display:flex;gap:10px;flex-wrap:wrap;padding-bottom:16px}
.library-actions {display:flex;align-items:center;gap:12px 24px;flex-wrap:wrap;padding:16px 24px;border-top:1px solid #e7edef;background:#fff;flex-shrink:0}
.library-actions[hidden] {display:none}
.library-action-copy {flex:1;min-width:0}
.library-action-copy strong {display:block;font-size:13px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.design-page .library-action-copy p {font-size:12px;color:#788b94;margin:4px 0 0;line-height:1.5}
.library-actions>.button {min-height:44px;min-width:136px;font-size:13px;justify-content:center}
.design-page .library-action-error {width:100%;margin:0;color:#a04437;font-size:12px;line-height:1.5}
.design-page dialog.product-page-viewer {padding:0;width:min(1360px,96vw);max-width:96vw;max-height:94dvh;border:1px solid #dde5e8;border-radius:12px;background:#f5f7f8}
.product-page-viewer header {position:sticky;top:0;background:#fff;padding:12px 20px;display:flex;align-items:center;justify-content:space-between;gap:15px;font-size:13px;z-index:1;border-bottom:1px solid #e0e7eb}
.product-page-viewer header button {min-height:44px;flex-shrink:0}
.product-page-viewer img {display:block;width:100%;height:auto}
.product-page-viewer p {padding:16px}
.builder-library-entry {display:flex;justify-content:space-between;align-items:center;gap:10px;margin:10px 0 14px;color:#7a8c94;font-size:11px}
.builder-library-entry .inline-link {font-size:12px}
@media(max-width:640px) {
  .design-page dialog.product-library {width:calc(100vw - 16px);height:calc(100dvh - 16px);max-height:calc(100dvh - 16px);border-radius:12px}
  .library-heading {padding:14px 16px;gap:10px}
  .design-page .library-heading h2 {font-size:18px}
  .design-page .library-heading p {font-size:11px}
  .library-heading .button {min-height:44px;padding:8px 12px}
  .library-tools {padding:0 16px;gap:6px}
  .library-tools input,.library-tools select {font-size:16px;padding:10px;min-width:0}
  .library-tools input {width:100px}
  .library-tools select {max-width:36%}
  .design-page .library-result-count {padding:9px 16px}
  .library-body {display:block;overflow:hidden}
  .library-list {height:100%;border-right:0;padding:8px}
  .library-item {padding:13px 14px;min-height:68px}
  .library-detail {display:none;height:100%;padding:20px}
  .library-detail h3 {font-size:20px}
  .library-actions {display:none;padding:14px 16px;gap:10px}
  .library-actions>.button {width:100%;font-size:14px;min-height:46px}
  .library-action-copy strong {display:none}
  .design-page .library-action-copy p {margin:0}
  .product-library.is-reading .library-back {display:block;border:0;background:transparent;color:#405e6a;font:inherit;font-size:13px;min-height:44px;padding:0;cursor:pointer}
  .product-library.is-reading .library-heading>div,.product-library.is-reading .library-tools,.design-page .product-library.is-reading .library-result-count,.product-library.is-reading .library-list {display:none}
  .product-library.is-reading .library-heading {justify-content:space-between}
  .product-library.is-reading .library-detail {display:block}
  .product-library.is-reading .library-actions:not([hidden]) {display:flex}
  .product-page-viewer header {padding:10px 12px}
}
