/* A single scrollable content area. The original choose button stays in view. */
dialog.r33-material-dialog,dialog.r33-simple-material-dialog{position:fixed;inset:0;width:min(1050px,calc(100vw - 40px));height:min(820px,calc(100vh - 40px));height:min(820px,calc(100dvh - 40px));max-width:none;max-height:calc(100vh - 40px);max-height:calc(100dvh - 40px);margin:auto;padding:0;overflow:hidden;box-sizing:border-box;border:1px solid #d8d0c4;border-radius:12px;background:#faf8f4;color:#28251f}
dialog.r33-material-dialog[open],dialog.r33-simple-material-dialog[open]{display:grid;grid-template-rows:auto minmax(0,1fr) auto}
.r33-material-dialog>.material-dialog-header,.r33-simple-material-dialog>.smp-dialog-header{position:static;padding:16px 22px;gap:16px;background:#faf8f4;border-bottom:1px solid #ddd5c8}
.r33-material-dialog>.material-dialog-header h2,.r33-simple-material-dialog>.smp-dialog-header h2{margin:0;font-size:26px;line-height:1.2}
.r33-material-dialog>.material-dialog-header .icon-button{min-width:44px;min-height:44px;flex-shrink:0}
.r33-material-dialog>.material-dialog-body,.r33-simple-material-dialog>.smp-dialog-body,.r33-simple-material-dialog>.smp-zoom-view{min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain;padding:18px 22px;-webkit-overflow-scrolling:touch;scrollbar-gutter:stable}
.r33-material-footer{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 22px max(14px,env(safe-area-inset-bottom));border-top:1px solid #d8d0c4;background:#faf8f4;box-shadow:0 -4px 18px #29262008;min-width:0;z-index:5}
.r33-material-footer>.r33-material-selection{min-width:0;margin:0;font:14px/1.4 Arial,sans-serif;color:#40382e;overflow-wrap:anywhere}
.r33-material-footer>.material-select,.r33-material-footer>.smp-choose{display:block;flex-shrink:0;margin:0;min-height:48px;max-width:65%;width:auto;padding:12px 20px;border:1px solid #302d29;border-radius:5px;background:#302d29;color:#fff;white-space:normal;font:14px/1.35 Arial,sans-serif;cursor:pointer}
.r33-material-footer>button:focus-visible{outline:3px solid #a28b6d;outline-offset:3px}
.r33-material-dialog .fabric-detail>.button{margin:0 0 12px;min-height:44px}
.r33-material-dialog .fabric-detail>.section-heading{margin:0 0 16px}
.r33-material-dialog .fabric-detail>.section-heading h3{font-size:29px;line-height:1.15;margin:6px 0}
.r33-material-dialog .fabric-detail>.section-heading p{margin:0}
.r33-material-dialog .fabric-detail-layout{display:grid;grid-template-columns:minmax(200px,.8fr) minmax(0,1.2fr);align-items:start;gap:24px}
.r33-material-dialog .fabric-detail-visual,.r33-material-dialog .fabric-detail-info{width:auto;min-width:0}
.r33-material-dialog .fabric-swatch-main{min-height:160px;height:320px;margin:0;padding:22px 16px 35px;background:#eee9df}
.r33-material-dialog .fabric-swatch-main img{width:auto;height:auto;max-width:100%;max-height:100%;object-fit:contain;box-shadow:none}
.r33-material-dialog .fabric-swatch-main>span,.r33-material-dialog .fabric-swatch-main figcaption{bottom:8px;font-size:11px}
.r33-material-dialog .fabric-selected-code{margin:0;padding-top:9px;font-size:14px}
.r33-material-dialog .fabric-detail-visual>.muted{font-size:11px;line-height:1.5;margin-top:6px}
.r33-material-dialog .fabric-detail-info>h3{font-size:14px;margin:0 0 10px;letter-spacing:0}
.r33-material-dialog .fabric-swatch-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(72px,1fr));gap:8px;margin:0;max-height:none;overflow:visible}
.r33-material-dialog .fabric-swatch-button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;min-width:0;min-height:86px;padding:7px 4px;border:1px solid #ddd5c8;border-radius:5px;background:#fff;font-size:12px;color:#40382e}
.r33-material-dialog .fabric-swatch-button img{display:block;width:auto;height:auto;max-width:100%;max-height:57px;aspect-ratio:auto;object-fit:contain;flex:0 0 auto}
.r33-material-dialog .fabric-swatch-button span{margin:0;font-size:12px;line-height:1.3;overflow-wrap:anywhere}
.r33-material-dialog .fabric-swatch-button.active,.r33-material-dialog .fabric-swatch-button[aria-pressed=true]{border:2px solid #6c5941;padding:6px 3px;background:#f3eee5}
.r33-material-dialog .fabric-swatch-button:focus-visible{outline:2px solid #8f7656;outline-offset:2px}
.r33-material-dialog .simple-fabric-technical{margin-top:18px;padding-top:12px}
.r33-material-dialog .fabric-card-image{height:95px;aspect-ratio:auto}
.r33-material-dialog .fabric-card-image img{width:auto;height:auto;max-width:100%;max-height:95px;object-fit:contain}
.r33-material-dialog .fabric-card-body h3{font-size:22px}
.r33-material-dialog .materials-grid{gap:20px 14px}
.r33-simple-material-dialog .smp-zoom-view h3{font-size:24px;margin:12px 0}
.r33-simple-material-dialog .smp-zoom-pictures{min-height:0;align-items:center;gap:14px}
.r33-simple-material-dialog .smp-zoom-pictures img{width:auto;height:auto;max-width:100%;max-height:52dvh;object-fit:contain}
.r33-simple-material-dialog .smp-preview{align-items:center}
.r33-simple-material-dialog .smp-preview img{width:auto;height:auto;max-width:100%;max-height:100%;object-fit:contain;flex:0 1 auto}
.r33-simple-material-dialog .smp-card-choice .smp-preview{height:100px}
.r33-simple-material-dialog .smp-digital-zoom{align-items:stretch;min-height:160px}
.r33-simple-material-dialog .smp-digital-zoom>span{width:100%;min-height:160px}
.r33-material-dialog img.r33-original-sample,.r33-simple-material-dialog img.r33-original-sample{width:auto;height:auto;max-width:min(100%,var(--r33-image-width));max-height:min(100%,var(--r33-image-height))}
.r33-material-dialog .fabric-swatch-button img.r33-original-sample{max-height:min(57px,var(--r33-image-height))}
.r33-material-dialog .fabric-card-image img.r33-original-sample{max-height:min(95px,var(--r33-image-height))}
.r33-simple-material-dialog .smp-zoom-pictures img.r33-original-sample{max-height:min(52dvh,var(--r33-image-height))}
@media(max-width:700px){
 dialog.r33-material-dialog,dialog.r33-simple-material-dialog{inset:0;width:100vw;height:100vh;height:100dvh;max-height:100vh;max-height:100dvh;margin:0;border:0;border-radius:0}
 .r33-material-dialog>.material-dialog-header,.r33-simple-material-dialog>.smp-dialog-header{padding:12px 16px;gap:12px}
 .r33-material-dialog>.material-dialog-header h2,.r33-simple-material-dialog>.smp-dialog-header h2{font-size:22px}
 .r33-material-dialog>.material-dialog-body,.r33-simple-material-dialog>.smp-dialog-body,.r33-simple-material-dialog>.smp-zoom-view{padding:14px 16px}
 .r33-material-footer{display:flex;flex-direction:column;align-items:stretch;gap:8px;padding:10px 16px max(12px,env(safe-area-inset-bottom))}
 .r33-material-footer>.r33-material-selection{font-size:13px;line-height:1.3}
 .r33-material-footer>.material-select,.r33-material-footer>.smp-choose{width:100%;max-width:none;min-height:48px;padding:11px 12px}
 .r33-material-dialog .fabric-detail-layout{display:block}
 .r33-material-dialog .fabric-swatch-main{height:210px;min-height:210px;padding:12px 12px 28px}
 .r33-material-dialog .fabric-detail-visual{margin-bottom:16px}
 .r33-material-dialog .fabric-detail>.section-heading h3{font-size:27px}
 .r33-material-dialog .fabric-swatch-grid{grid-template-columns:repeat(auto-fill,minmax(70px,1fr));gap:8px;max-height:none;overflow:visible}
 .r33-material-dialog .fabric-detail-info>h3{font-size:14px}
 .r33-material-dialog .fabric-card-image{height:80px}
 .r33-simple-material-dialog .smp-card-choice .smp-preview{height:90px}
}
@media(max-height:480px) and (min-width:701px){
 dialog.r33-material-dialog,dialog.r33-simple-material-dialog{height:calc(100vh - 16px);height:calc(100dvh - 16px);max-height:calc(100vh - 16px);max-height:calc(100dvh - 16px)}
 .r33-material-dialog>.material-dialog-header,.r33-simple-material-dialog>.smp-dialog-header,.r33-material-footer{padding-top:8px;padding-bottom:8px}
}

/* R37: hardware photographs have their own thumbnail and detail layout. */
dialog.smp-hardware-dialog.r33-simple-material-dialog[open]{display:flex;flex-direction:column}
.smp-hardware-dialog .smp-hardware-model>img.r33-original-sample{width:96px;height:72px;max-width:96px;max-height:72px;object-fit:contain}
.smp-hardware-dialog .smp-hardware-photo>img.r33-original-sample{width:100%;height:230px;max-width:100%;max-height:230px;object-fit:contain}
.smp-hardware-dialog .smp-hardware-enlarged{flex:1;min-height:0}
.smp-hardware-dialog .smp-hardware-enlarged>img.r33-original-sample{width:100%;height:auto;max-width:100%;max-height:none;object-fit:contain}
@media(max-width:700px){
 .smp-hardware-dialog .smp-hardware-model>img.r33-original-sample{width:100%;height:52px;max-width:100%;max-height:52px}
 .smp-hardware-dialog .smp-hardware-photo>img.r33-original-sample{height:165px;max-height:165px}
}
