.cabinet-example-bar[hidden], .cabinet-example-dialog [hidden] { display: none !important; }
.cabinet-example-bar { margin: 6px 0; flex: 0 0 auto; }
.cabinet-example-bar > button {
    display: inline-flex; align-items: center; gap: 7px; min-height: 34px; max-width: 100%;
    padding: 5px 9px; border: 1px solid transparent; border-radius: 8px;
    background: transparent; color: #a9adad; font: 550 12px/1.3 Arial,sans-serif; cursor: pointer;
}
.cabinet-example-bar > button > svg { flex: none; width: 13px; height: 13px; }
.cabinet-example-bar > button:hover { background: #ffffff09; color: #e4e5e3; }

.cabinet-example-dialog {
    --cabinet-paper: #e9eae7;
    --cabinet-muted: #b3b7b7;
    --cabinet-line: #333636;
    box-sizing: border-box; margin: auto; padding: 0; width: min(844px, calc(100% - 28px));
    max-height: min(730px, calc(100dvh - 28px)); overflow: auto; overscroll-behavior: contain;
    border: 1px solid #414545; border-radius: 20px; background: #191b1b; color: var(--cabinet-paper);
    box-shadow: 0 20px 85px #000a; font: 14px/1.45 Arial,sans-serif; color-scheme: dark;
}
.cabinet-example-dialog[open] { animation: cabinet-arrive 270ms cubic-bezier(.2,.8,.2,1) both; }
.cabinet-example-dialog[data-cabinet-dialog][open] {
    display: grid; grid-template-rows: auto minmax(0,1fr) auto; overflow: hidden;
}
.cabinet-example-dialog[data-cabinet-type="text"] { height: min(644px, calc(100dvh - 28px)); }
.cabinet-example-dialog::backdrop { background: #080909ba; backdrop-filter: blur(4px); }
.cabinet-header {
    display: flex; align-items: center; gap: 13px; padding: 19px 22px;
    background: #1b1d1d; border-bottom: 1px solid var(--cabinet-line);
}
.cabinet-header-icon, .cabinet-thumb {
    display: grid; place-items: center; flex: none; overflow: hidden; width: 42px; height: 42px;
    border: 1px solid #3c4040; border-radius: 11px; background: #262929; color: #b7bdbd;
}
.cabinet-header-icon { font-size: 16px; }
.cabinet-header h2, .cabinet-example-card h3 {
    margin: 0; font: 700 24px/1.16 'Roboto Condensed',Arial,sans-serif; letter-spacing: -.02em;
}
.cabinet-category { margin: 0 0 4px; color: var(--cabinet-muted); font-size: 12px; }
.cabinet-close {
    flex: none; display: grid; place-items: center; margin-left: auto; padding: 0; width: 42px; height: 42px;
    border: 1px solid var(--cabinet-line); border-radius: 10px; background: #222525;
    color: var(--cabinet-paper); font: 23px/1 Arial,sans-serif; cursor: pointer;
}
.cabinet-browser { display: grid; grid-template-columns: minmax(194px,.87fr) minmax(0,2fr); min-height: 0; }
.cabinet-browser.cabinet-single { grid-template-columns: minmax(0,1fr); }
.cabinet-picker { min-width: 0; padding: 12px; overflow-y: auto; background: #171919; border-right: 1px solid var(--cabinet-line); }
.cabinet-option {
    display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px; min-height: 56px;
    text-align: left; border: 1px solid transparent; border-radius: 12px;
    background: transparent; color: var(--cabinet-paper); cursor: pointer; font: 600 13px/1.3 Arial,sans-serif;
    transition: background-color 160ms ease,border-color 160ms ease;
}
.cabinet-option + .cabinet-option { margin-top: 3px; }
.cabinet-option:hover { background: #222525; }
.cabinet-option[aria-pressed="true"] { background: #292c2c; border-color: #484d4d; }
.cabinet-option-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cabinet-option-arrow { color: #a3a9a9; padding-right: 2px; font-size: 19px; }
.cabinet-thumb { width: 38px; height: 38px; border-radius: 9px; }
.cabinet-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cabinet-stage { min-width: 0; min-height: 0; padding: 18px 21px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.cabinet-example-card:not([hidden]) { animation: cabinet-content-in 300ms cubic-bezier(.22,.75,.25,1) both; }
.cabinet-example-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cabinet-example-card h3 { font-size: 22px; }
.cabinet-kind { margin: 0; color: var(--cabinet-muted); font-size: 11px; }

.cabinet-illustration {
    display: grid; place-items: center; min-height: 86px; margin-bottom: 10px;
    border: 1px solid var(--cabinet-line); border-radius: 12px; overflow: hidden; background: #151717;
}
.cabinet-diagram { position: relative; color: #939b9b; }
.cabinet-diagram > span { display: block; }
.cabinet-diagram > span:nth-child(2) { --beat: 60ms; }
.cabinet-diagram > span:nth-child(3) { --beat: 120ms; }
.cabinet-diagram > span:nth-child(4) { --beat: 180ms; }
.cabinet-diagram > span:nth-child(5) { --beat: 240ms; }

[data-cabinet-motion="listing"] .cabinet-diagram {
    display: grid; grid-template-columns: 32px 1fr; width: 120px; padding: 11px; gap: 6px 9px;
    border: 1px solid #586060; background: #212424; border-radius: 8px;
}
[data-cabinet-motion="listing"] span:first-child { grid-row: span 4; background: #414848; border-radius: 4px; }
[data-cabinet-motion="listing"] span:not(:first-child) {
    height: 4px; border-radius: 4px; background: #818b8b; transform-origin: left;
    animation: cabinet-type 360ms var(--beat,0ms) ease-out both;
}
[data-cabinet-motion="listing"] span:nth-child(3) { width: 78%; }
[data-cabinet-motion="listing"] span:last-child { width: 51%; background: #646d6d; }

[data-cabinet-motion="storyboard"] .cabinet-diagram { display: flex; gap: 6px; }
[data-cabinet-motion="storyboard"] span {
    width: 35px; height: 25px; border: 1px solid #697272; border-radius: 5px;
    background: linear-gradient(142deg,transparent 52%,#505a5a 53% 66%,transparent 67%), #242727;
    animation: cabinet-frame 390ms var(--beat,0ms) ease-out both;
}
[data-cabinet-motion="leaflet"] span:nth-child(n+4),
[data-cabinet-motion="broadcast"] span:nth-child(n+4) { display: none; }

[data-cabinet-motion="leaflet"] .cabinet-diagram {
    display: flex; width: 110px; padding: 10px; flex-wrap: wrap; gap: 6px; border: 1px solid #657070;
    border-radius: 7px; background: linear-gradient(90deg,#272b2b 49%,#495151 50%,#222626 51%);
    animation: cabinet-unfold 540ms ease-out both;
}
[data-cabinet-motion="leaflet"] span { flex: 0 0 42%; height: 4px; background: #788282; border-radius: 4px; }
[data-cabinet-motion="leaflet"] span:nth-child(2) { margin-left: auto; }

[data-cabinet-motion="checklist"] .cabinet-diagram { display: grid; width: 124px; gap: 5px; }
[data-cabinet-motion="checklist"] span { height: 5px; margin-left: 17px; border-radius: 4px; background: #515959; position: relative; }
[data-cabinet-motion="checklist"] span::before {
    content: ''; position: absolute; top: -1px; left: -15px; width: 7px; height: 4px;
    border: solid #b3baba; border-width: 0 0 1px 1px;
    transform: rotate(-45deg); animation: cabinet-check 290ms var(--beat,0ms) ease-out both;
}

[data-cabinet-motion="route"] .cabinet-diagram { display: flex; width: 145px; justify-content: space-between; align-items: center; }
[data-cabinet-motion="route"] .cabinet-diagram::before { content: ''; position: absolute; inset: 50% 0 auto; height: 1px; background: #4c5555; }
[data-cabinet-motion="route"] span {
    width: 9px; height: 9px; background: #889292; border-radius: 50%; z-index: 1;
    animation: cabinet-waypoint 320ms var(--beat,0ms) ease-out both;
}
[data-cabinet-motion="wave"] .cabinet-diagram { display: flex; height: 42px; gap: 6px; align-items: center; }
[data-cabinet-motion="wave"] span {
    width: 6px; height: 40%; border-radius: 10px; background: #939d9d;
    animation: cabinet-wave 410ms var(--beat,0ms) ease-in-out both;
}
[data-cabinet-motion="wave"] span:nth-child(2n) { height: 70%; }
[data-cabinet-motion="wave"] span:nth-child(3) { height: 100%; }

[data-cabinet-motion="broadcast"] .cabinet-diagram { width: 75px; height: 66px; display: grid; place-items: center; }
[data-cabinet-motion="broadcast"] span {
    grid-area: 1/1; width: 29px; height: 29px; border: 1px solid #869090; border-radius: 50%;
    animation: cabinet-broadcast 450ms var(--beat,0ms) ease-out both;
}
[data-cabinet-motion="broadcast"] span:nth-child(2) { width: 46px; height: 46px; border-color: #657272; }
[data-cabinet-motion="broadcast"] span:nth-child(3) { width: 62px; height: 62px; border-color: #495353; }

[data-cabinet-motion="caption"] .cabinet-diagram {
    display: flex; align-items: flex-end; flex-wrap: wrap; align-content: flex-end; width: 116px; height: 60px;
    padding: 8px; gap: 4px; border-radius: 6px; border: 1px solid #505a5a; background: #222626;
}
[data-cabinet-motion="caption"] span {
    width: 26%; height: 5px; border-radius: 3px; background: #798383;
    animation: cabinet-caption 390ms var(--beat,0ms) ease-out both;
}
[data-cabinet-motion="caption"] span:nth-child(3) { width: 39%; }

.cabinet-pair { display: grid; grid-template-columns: repeat(auto-fit,minmax(125px,1fr)); gap: 9px; }
.cabinet-pair figure { min-width: 0; margin: 0; }
.cabinet-pair button {
    display: block; width: 100%; padding: 0; overflow: hidden; cursor: zoom-in;
    border: 1px solid var(--cabinet-line); border-radius: 12px; background: #141616;
}
.cabinet-pair button.cabinet-alpha { background: repeating-conic-gradient(#2a2c2c 0 25%,#404343 0 50%) 0/16px 16px; }
.cabinet-pair img, .cabinet-example-card > video {
    display: block; width: 100%; height: min(235px,35dvh); min-height: 110px; object-fit: contain;
}
.cabinet-example-card > video { border-radius: 12px; background: #141616; animation: cabinet-film 440ms ease-out both; }
.cabinet-pair img { animation: cabinet-photo 390ms ease-out both; }
.cabinet-pair figure + figure img { animation-delay: 90ms; }
[data-cabinet-id="person"] .cabinet-pair img { animation-name: cabinet-person; }
[data-cabinet-id="garment"] .cabinet-pair img { animation-name: cabinet-garment; }
.cabinet-pair figcaption { display: flex; justify-content: space-between; align-items: center; padding-top: 4px; color: var(--cabinet-muted); font-size: 12px; }
.cabinet-pair figcaption a { display: inline-grid; place-items: center; width: 36px; height: 32px; }
.cabinet-example-dialog a { color: #cbd0cf; text-underline-offset: 3px; }
.cabinet-meta { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0; color: var(--cabinet-muted); font-size: 12px; }
.cabinet-meta span { padding: 3px 7px; border: 1px solid var(--cabinet-line); border-radius: 6px; }
.cabinet-note { margin: 8px 0 0; color: var(--cabinet-muted); font-size: 12px; }
.cabinet-copy { display: grid; gap: 8px; margin-top: 10px; }
.cabinet-copy-duo { grid-template-columns: repeat(2, minmax(0,1fr)); align-items: stretch; }
.cabinet-copy > section {
    min-width: 0; padding: 11px 12px; border: 1px solid var(--cabinet-line); border-radius: 9px;
    background: #1e2121;
}
.cabinet-copy-duo > section:last-child { background: #232626; }
.cabinet-copy h4 { margin: 0 0 5px; color: var(--cabinet-muted); font: 650 12px/1.3 Arial,sans-serif; }
.cabinet-copy p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.5; }
.cabinet-answer > p + p { margin-top: 7px; }
.cabinet-copy > .cabinet-outcome {
    padding: 4px 0 1px; border: 0; background: transparent; color: var(--cabinet-muted);
}
.cabinet-copy > .cabinet-outcome h4 { color: var(--cabinet-paper); }
.cabinet-footer { padding: 12px 21px; background: #1b1d1d; border-top: 1px solid var(--cabinet-line); }
.cabinet-availability { margin: 0 0 10px; }
.cabinet-footer-actions, .cabinet-replace { display: flex; align-items: center; gap: 8px; }
.cabinet-footer-actions { justify-content: space-between; }
.cabinet-footer button {
    min-height: 40px; border: 1px solid #414747; border-radius: 9px; background: #292d2d;
    color: var(--cabinet-paper); cursor: pointer; padding: 7px 11px; font: 700 13px/1.25 Arial,sans-serif;
}
.cabinet-footer .cabinet-apply, .cabinet-footer [data-cabinet-confirm] { background: #d8dcda; color: #1d2321; border-color: #d8dcda; }
.cabinet-footer .cabinet-apply span { margin-left: 4px; }
.cabinet-replace { flex-wrap: wrap; margin-bottom: 10px; }
.cabinet-replace > p { margin: 0 auto 0 0; flex: 1 1 175px; }
.cabinet-message { margin: 0 0 8px; color: var(--cabinet-muted); }
.cabinet-message:empty { display: none; }
.cabinet-example-dialog :is(button,a,summary):focus-visible, .cabinet-example-bar > button:focus-visible { outline: 2px solid #cbd3d0; outline-offset: 2px; }
.cabinet-zoom { width: min(900px,calc(100% - 26px)); padding: 12px; }
.cabinet-zoom > img { display: block; margin: 8px 0 0; max-height: 76dvh; width: 100%; object-fit: contain; }

@keyframes cabinet-arrive { from { opacity: 0; transform: translateY(6px) scale(.993); } }
@keyframes cabinet-content-in { from { opacity: .4; transform: translateY(4px); } }
@keyframes cabinet-type { from { opacity: .3; transform: scaleX(.1); } }
@keyframes cabinet-frame { from { opacity: 0; transform: translateY(8px); } }
@keyframes cabinet-unfold { from { opacity: .25; transform: perspective(180px) rotateY(-38deg); } }
@keyframes cabinet-check { from { opacity: 0; transform: translateY(-3px) rotate(-45deg); } }
@keyframes cabinet-waypoint { from { opacity: .25; transform: scale(.4); } 65% { transform: scale(1.14); } }
@keyframes cabinet-wave { from { transform: scaleY(.25); } 65% { transform: scaleY(1.16); } }
@keyframes cabinet-broadcast { from { opacity: 0; transform: scale(.55); } }
@keyframes cabinet-caption { from { opacity: 0; transform: translateY(4px); } }
@keyframes cabinet-photo { from { opacity: .45; transform: scale(.98); } }
@keyframes cabinet-person { from { opacity: .55; clip-path: inset(8% 0 8%); } to { clip-path: inset(0); } }
@keyframes cabinet-garment { from { opacity: .55; transform: translateX(7px); } }
@keyframes cabinet-film { from { opacity: .4; } }

@media (max-width: 620px) {
    .cabinet-example-dialog { width: calc(100% - 16px); max-height: calc(100dvh - 16px); border-radius: 16px; }
    .cabinet-header { padding: 12px; gap: 9px; }
    .cabinet-header h2 { font-size: 19px; }
    .cabinet-header-icon { width: 34px; height: 34px; border-radius: 10px; }
    .cabinet-close { width: 40px; height: 40px; }
    .cabinet-browser { grid-template-columns: minmax(0,1fr); grid-template-rows: auto minmax(0,1fr); }
    .cabinet-browser.cabinet-single { grid-template-rows: minmax(0,1fr); }
    .cabinet-picker { display: flex; gap: 6px; padding: 8px 12px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--cabinet-line); scroll-snap-type: x proximity; }
    .cabinet-option { width: auto; flex: 0 0 clamp(138px,45%,168px); min-height: 52px; scroll-snap-align: start; font-size: 12px; }
    .cabinet-option + .cabinet-option { margin-top: 0; }
    .cabinet-option-arrow { display: none; }
    .cabinet-thumb { width: 31px; height: 31px; }
    .cabinet-stage, .cabinet-footer { padding: 12px; }
    .cabinet-example-card h3 { font-size: 20px; }
    .cabinet-illustration { min-height: 74px; }
    .cabinet-copy-duo { grid-template-columns: minmax(0,1fr); }
}
@media (prefers-reduced-motion: reduce) {
    .cabinet-example-dialog[open], .cabinet-example-card:not([hidden]),
    .cabinet-diagram, .cabinet-diagram > span, .cabinet-diagram > span::before,
    .cabinet-pair img, .cabinet-example-card > video { animation: none; }
    .cabinet-option { transition: none; }
}
