.case-gallery { width: 100%; margin: 30px auto 12px; color: var(--text, #232631); }
.case-gallery-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.case-gallery-eyebrow { margin: 0 0 6px; color: var(--muted, #8a90a1); font-size: 10px; letter-spacing: .17em; font-weight: 600; }
.case-gallery-heading h2 { margin: 0; font-size: 25px; font-weight: 650; letter-spacing: -.7px; line-height: 1.35; }
.case-gallery-subtitle { margin: 5px 0 0; font-size: 12px; color: var(--muted, #8a90a1); }
.case-gallery-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.case-gallery-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.case-gallery button { font: inherit; cursor: pointer; }
.case-filter { border: 1px solid transparent; background: transparent; border-radius: 20px; padding: 7px 12px; color: var(--muted, #737b90); font-size: 12px !important; transition: color 180ms, background 180ms, border-color 180ms; }
.case-filter:hover { color: var(--text, #242834); background: rgba(100, 102, 185, .055); }
.case-filter.active { color: var(--accent, #6561d7); background: rgba(108, 103, 220, .08); border-color: rgba(108, 103, 220, .12); }
.case-hidden-toggle { font-size: 11px !important; color: var(--muted, #7c8393); border: 0; background: transparent; white-space: nowrap; }
.case-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 15px; border: 1px solid rgba(128, 134, 162, .21); background: var(--studio-panel, #fff); color: var(--text, #232631); border-radius: 12px; font: inherit; font-size: 12px; white-space: nowrap; cursor: pointer; transition: box-shadow 180ms, background 180ms, opacity 180ms; }
.case-button:hover { background: rgba(121, 117, 203, .065); box-shadow: 0 3px 10px rgba(75, 66, 136, .05); }
.case-button-primary { background: var(--accent, #6561d7); color: var(--studio-bg, #fff); border-color: transparent; }
.case-button-primary:hover { background: var(--accent, #6561d7); box-shadow: 0 4px 18px rgba(105, 94, 202, .22); }
.case-button:disabled { cursor: default; opacity: .45; box-shadow: none; }
.case-gallery-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 20px; border-radius: 20px; border: 1px dashed rgba(134, 141, 170, .21); background: radial-gradient(ellipse at 50% 0%, rgba(154, 134, 226, .07), transparent 70%); text-align: center; }
.case-gallery-empty-icon { width: 40px; height: 40px; display: grid; place-items: center; background: rgba(112, 104, 214, .065); color: var(--accent, #6863d7); border-radius: 13px; font-size: 23px; }
.case-gallery-empty h3 { margin: 2px 0 0; font-size: 15px; font-weight: 550; }
.case-gallery-empty p { margin: 0 0 8px; font-size: 12px; color: var(--muted, #858b9c); }
.case-gallery-loading, .case-gallery-load-error { font-size: 12px; color: var(--muted, #858b9c); padding: 22px 0; }
.case-gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; align-items: start; }
.case-gallery-card { min-width: 0; }
.case-gallery-card.is-hidden { opacity: .66; }
.case-gallery-media { display: block; position: relative; width: 100%; aspect-ratio: var(--case-ratio, .5625); overflow: hidden; border: 0; border-radius: 17px; padding: 0; background: radial-gradient(ellipse at 20% 0%, #363b59, transparent 70%), #202330; color: #fff; isolation: isolate; }
.case-gallery-poster, .case-gallery-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; transition: opacity 220ms, transform 500ms cubic-bezier(.16, 1, .3, 1); }
.case-gallery-poster { z-index: 1; }
.case-gallery-preview { z-index: 2; opacity: 0; }
.case-gallery-media:not(:has(.case-gallery-poster)) .case-gallery-preview { opacity: 1; }
.case-gallery-preview.playing { opacity: 1; }
.case-gallery-media:hover .case-gallery-poster { transform: scale(1.025); }
.case-gallery-media-shade { position: absolute; inset: 0; z-index: 3; background: linear-gradient(180deg, rgba(0, 0, 0, .15), transparent 30%, transparent 55%, rgba(0, 0, 0, .4)); pointer-events: none; }
.case-gallery-play { position: absolute; left: 50%; top: 50%; z-index: 4; transform: translate(-50%, -50%); width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .32); background: rgba(21, 22, 28, .24); backdrop-filter: blur(12px); border-radius: 50%; font-size: 25px; padding-left: 2px; opacity: .95; transition: opacity 180ms; }
.case-gallery-media:hover .case-gallery-play { opacity: .4; }
.case-gallery-category { position: absolute; z-index: 4; left: 12px; bottom: 13px; font-size: 10px; font-weight: 500; letter-spacing: .03em; }
.case-gallery-duration { position: absolute; z-index: 4; right: 12px; bottom: 13px; font-size: 10px; font-variant-numeric: tabular-nums; opacity: .8; }
.case-gallery-hidden-badge { position: absolute; z-index: 4; top: 10px; left: 10px; border-radius: 6px; padding: 4px 7px; font-size: 10px; background: rgba(18, 19, 29, .7); }
.case-gallery-info { padding: 11px 2px 0; }
.case-gallery-info h3 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 550; }
.case-gallery-info p { margin: 4px 0 0; color: var(--muted, #8a90a1); font-size: 11px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.case-gallery-actions { display: flex; gap: 10px; align-items: center; padding: 9px 2px 0; }
.case-text-button { padding: 0; border: 0; background: none; color: var(--muted, #8a90a1); font-size: 10px !important; }
.case-text-button:hover { color: var(--accent, #6561d7); }
.case-order-button { display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 1px solid rgba(128, 134, 162, .15); border-radius: 7px; background: transparent; color: var(--muted, #8a90a1); font-size: 12px !important; }
.case-order-button:first-of-type { margin-left: auto; }
.case-order-button:disabled { opacity: .3; cursor: default; }
.case-gallery button:focus-visible, .case-dialog button:focus-visible { outline: 2px solid var(--accent, #6863d7); outline-offset: 3px; }
.case-dialog { width: min(600px, calc(100vw - 28px)); max-height: calc(100dvh - 32px); box-sizing: border-box; padding: 22px; border: 1px solid rgba(141, 141, 164, .22); border-radius: 24px; background: var(--studio-panel, #fff); color: var(--text, #232631); box-shadow: 0 24px 100px rgba(17, 20, 35, .22); overflow-y: auto; }
.case-dialog[open] { animation: case-dialog-enter 300ms cubic-bezier(.16, 1, .3, 1) both; }
.case-dialog::backdrop { background: rgba(15, 18, 33, .5); backdrop-filter: blur(10px); }
.case-dialog-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; }
.case-dialog-heading h2 { margin: 0; font-size: 17px; font-weight: 600; }
.case-dialog-close { width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: rgba(128, 134, 162, .08); color: var(--muted, #8a90a1); font: inherit; font-size: 24px; cursor: pointer; }
.case-upload-form { display: flex; flex-direction: column; gap: 14px; }
.case-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; font-size: 11px; font-weight: 500; }
.case-field input:not([type=file]), .case-field select, .case-field textarea { box-sizing: border-box; width: 100%; border: 1px solid rgba(128, 134, 162, .22); border-radius: 10px; padding: 10px 12px; background: var(--bg, #f7f8fc); color: var(--text, #232631); font: inherit; font-size: 12px; outline: none; }
.case-field input:focus, .case-field select:focus, .case-field textarea:focus { border-color: var(--accent, #6561d7); }
.case-field small { color: var(--muted, #8a90a1); font-size: 10px; font-weight: 400; }
.case-field input[type=file] { font-size: 11px; }
.case-field input[type=file]::file-selector-button { padding: 7px 10px; margin-right: 10px; border-radius: 7px; border: 1px solid rgba(128, 134, 162, .2); background: var(--studio-panel, #fff); color: var(--text, #232631); cursor: pointer; }
.case-form-paired { display: grid; grid-template-columns: 1.6fr 1fr; gap: 12px; }
.case-upload-drop { padding: 17px; border: 1px dashed rgba(128, 134, 162, .3); background: rgba(130, 117, 212, .03); border-radius: 15px; }
.case-upload-file-label { position: relative; display: flex; flex-direction: column; align-items: center; gap: 7px; cursor: pointer; padding: 5px 0; }
.case-upload-file-label input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.case-upload-file-label:focus-within { outline: 2px solid var(--accent, #6561d7); border-radius: 10px; outline-offset: 5px; }
.case-upload-icon { display: grid; place-items: center; width: 35px; height: 35px; color: var(--accent, #6561d7); background: rgba(130, 117, 212, .075); border-radius: 11px; font-size: 24px; }
.case-upload-file-label strong { font-size: 12px; font-weight: 500; }
.case-upload-file-label small { font-size: 10px; color: var(--muted, #8a90a1); }
.case-upload-filename { font-size: 10px; color: var(--muted, #8a90a1); overflow-wrap: anywhere; text-align: center; margin: 8px 0 0; }
.case-upload-filename:empty { display: none; }
.case-upload-preview { display: block; width: 100%; max-height: 170px; object-fit: contain; margin-top: 12px; border-radius: 9px; background: #13151d; }
.case-upload-preview[hidden], .case-upload-progress[hidden] { display: none; }
.case-form-error { margin: 0; font-size: 11px; line-height: 1.6; color: #bd5759; }
.case-form-error:empty { display: none; }
.case-upload-progress { display: flex; flex-direction: column; gap: 7px; font-size: 11px; color: var(--muted, #8a90a1); }
.case-upload-progress progress { width: 100%; height: 6px; accent-color: var(--accent, #6561d7); }
.case-form-footer { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.case-player-dialog { width: min(1000px, calc(100vw - 28px)); padding: 18px; }
.case-player-video { display: block; width: 100%; max-height: calc(100dvh - 170px); border-radius: 13px; object-fit: contain; background: #11121a; }
.case-player-description { font-size: 12px; color: var(--muted, #8a90a1); line-height: 1.7; margin: 12px 2px 0; white-space: pre-wrap; }
@keyframes case-dialog-enter { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (max-width: 640px) {
  .case-gallery { margin-top: 22px; }
  .case-gallery-heading h2 { font-size: 21px; }
  .case-gallery-heading { gap: 10px; }
  .case-gallery-subtitle { font-size: 10px; }
  .case-gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 12px; }
  .case-gallery-toolbar { align-items: flex-start; flex-direction: column; gap: 9px; }
  .case-filter { padding: 6px 10px; font-size: 11px !important; }
  .case-gallery-media { border-radius: 13px; }
  .case-gallery-info h3 { font-size: 12px; }
  .case-gallery-info p { font-size: 10px; }
  .case-dialog { padding: 18px; border-radius: 19px; }
  .case-form-paired { grid-template-columns: 1fr; gap: 14px; }
  .case-gallery-category { left: 9px; font-size: 9px; }
  .case-gallery-duration { right: 9px; font-size: 9px; }
  .case-gallery-actions { gap: 8px; flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  .case-gallery *, .case-dialog { animation: none !important; transition: none !important; }
}
