/* Gallery workspace refresh: collections, filters, and prompt-first cards. */

body {
    background: #f4f6f8 !important;
    background-image: none !important;
}

.main-container {
    max-width: 1760px;
    padding-right: clamp(16px, 2vw, 32px);
    padding-left: clamp(16px, 2vw, 32px);
}

.gallery-layout {
    gap: 16px;
}

/* Collections navigation */
.category-sidebar {
    width: 220px;
    flex: 0 0 220px;
    height: fit-content;
    padding: 12px;
    border: 1px solid #eadfbf;
    border-radius: 8px;
    background: #fffdf7;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.05);
    position: sticky;
    top: 84px;
    transition: width 0.18s ease, flex-basis 0.18s ease;
}

.sidebar-header-actions {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.sidebar-collapse-btn {
    width: 30px;
    height: 32px;
    min-width: 30px;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    background: rgba(255, 255, 255, 0.76);
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.sidebar-collapse-btn:hover {
    border-color: #f59e0b;
    color: #b45309;
    background: #fffbeb;
}

.sidebar-collapse-btn i {
    min-width: 0;
    font-size: 10px;
    transition: transform 0.18s ease;
}

.category-sidebar.is-collapsed {
    width: 58px;
    flex-basis: 58px;
    padding: 10px;
}

.category-sidebar.is-collapsed .sidebar-heading-copy,
.category-sidebar.is-collapsed .add-category-btn,
.category-sidebar.is-collapsed .category-name,
.category-sidebar.is-collapsed .category-count,
.category-sidebar.is-collapsed .category-section-label,
.category-sidebar.is-collapsed .category-actions {
    display: none !important;
}

.category-sidebar.is-collapsed .sidebar-header {
    min-height: 34px;
    margin-bottom: 8px;
    padding: 0 0 8px;
    justify-content: center;
}

.category-sidebar.is-collapsed .sidebar-header-actions {
    width: 100%;
    justify-content: center;
}

.category-sidebar.is-collapsed .sidebar-collapse-btn i {
    transform: rotate(180deg);
}

.category-sidebar.is-collapsed .category-item {
    width: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 2px;
    justify-content: center;
}

.category-sidebar.is-collapsed .category-item.active::before {
    left: -7px;
}

.category-sidebar .sidebar-header {
    min-height: 48px;
    margin: 0 0 10px;
    padding: 0 2px 10px;
    border: 0;
    border-bottom: 1px solid rgba(245, 158, 11, 0.16);
}

.sidebar-heading-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.category-sidebar .sidebar-heading-copy h3 {
    margin: 0;
    color: #111827;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-heading-icon {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border: 1px solid #fde68a;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #b45309;
    background: #fffbeb;
}

.sidebar-heading-icon i {
    min-width: 0;
    color: #b45309 !important;
    font-size: 12px;
}

.sidebar-heading-copy > span {
    color: #94a3b8;
    font-size: 11px;
    line-height: 1.35;
}

.category-sidebar .add-category-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    flex: 0 0 32px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    color: #475569;
    background: #ffffff;
    box-shadow: none;
    font-size: 12px;
    transition: border-color 0.18s ease, color 0.18s ease, background-color 0.18s ease;
}

.category-sidebar .add-category-btn:hover {
    border-color: #f59e0b;
    color: #b45309;
    background: #fffbeb;
}

.category-sidebar .category-list {
    gap: 5px;
}

.category-sidebar .category-item {
    min-height: 44px;
    gap: 9px;
    padding: 5px 8px 5px 6px;
    border: 1px solid rgba(226, 232, 240, 0.78);
    border-radius: 7px;
    color: #475569;
    background: rgba(255, 255, 255, 0.52);
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.category-sidebar .category-icon {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border: 1px solid color-mix(in srgb, var(--category-color, #64748b) 22%, #e2e8f0);
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--category-color, #64748b);
    background: color-mix(in srgb, var(--category-color, #64748b) 10%, #ffffff);
}

.category-sidebar .category-icon i {
    width: auto;
    min-width: 0;
    color: currentColor !important;
    font-size: 12px;
}

.category-sidebar .category-item:hover {
    color: #111827;
    border-color: #fcd34d;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 3px 10px rgba(120, 53, 15, 0.07);
    transform: translateX(2px);
}

.category-sidebar .category-item.active {
    border-color: #f59e0b;
    color: #92400e;
    background: #ffffff;
    box-shadow: 0 3px 12px rgba(180, 83, 9, 0.1);
    font-weight: 600;
}

.category-sidebar .category-item.active::before {
    content: '';
    position: absolute;
    top: 9px;
    bottom: 9px;
    left: -7px;
    width: 3px;
    border-radius: 2px;
    background: #d97706;
}

.category-sidebar .category-name {
    font-size: 13px;
}

.category-sidebar .category-count {
    min-width: 22px;
    min-height: 20px;
    padding: 1px 6px;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    color: #94a3b8;
    background: rgba(248, 250, 252, 0.9);
    font-size: 10px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.category-sidebar .category-item.active .category-count {
    color: #b45309;
    border-color: #fde68a;
    background: #fffbeb;
}

.category-section-label {
    min-height: 28px;
    margin: 10px 4px 2px;
    padding-top: 8px;
    border-top: 1px solid rgba(226, 232, 240, 0.9);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.category-sidebar .category-actions {
    right: 5px;
}

.category-sidebar .cat-action-btn {
    width: 24px;
    height: 24px;
    border: 1px solid #e5e7eb;
    border-radius: 5px;
    box-shadow: none;
}

/* Quiet, tool-like page heading */
.gallery-header {
    margin-bottom: 20px;
    padding-bottom: 0;
}

.gallery-header .header-top {
    margin-bottom: 18px;
    align-items: center;
    position: relative;
    padding-left: 14px;
}

.gallery-header .header-top::before {
    content: '';
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 0;
    width: 3px;
    border-radius: 2px;
    background: #f59e0b;
}

.gallery-header .gallery-title {
    margin: 0 0 4px;
    color: #111827;
    background: none;
    -webkit-text-fill-color: currentColor;
    font-size: 28px;
    font-weight: 750;
    line-height: 1.2;
    letter-spacing: 0;
}

.gallery-header .gallery-subtitle {
    color: #64748b;
    font-size: 13px;
}

.gallery-header .header-stats .stat-item {
    gap: 5px;
    padding: 0;
    border: 0;
    border-radius: 0;
    color: #64748b;
    background: transparent;
}

.gallery-header .header-stats .stat-number {
    color: #111827;
    font-size: 16px;
    font-weight: 700;
}

.gallery-header .header-stats .stat-label {
    color: #94a3b8;
    font-size: 12px;
}

/* Search and media toolbar */
.gallery-toolbar {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.gallery-toolbar-top {
    gap: 10px;
    padding: 0 0 14px;
}

.media-type-switch {
    min-height: 40px;
    padding: 3px;
    border-color: #e2e8f0;
    border-radius: 7px;
    background: #f8fafc;
}

.media-type-option {
    min-height: 32px;
    border-radius: 5px;
}

.media-type-option.active {
    color: #92400e;
}

.gallery-search-form .search-input {
    height: 40px;
    border-color: #d7dde5;
    border-radius: 7px;
    color: #111827;
    background: #ffffff;
}

.gallery-search-form .search-input:focus {
    border-color: #d97706;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1);
}

.gallery-search-form .search-btn {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
}

/* Parameter picker */
.gallery-filter-surface {
    position: relative;
    overflow: visible;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.gallery-filter-heading {
    min-height: 46px;
    padding: 7px 9px 7px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
}

.gallery-filter-mobile-toggle {
    min-height: 32px;
    padding: 0;
    border: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #334155;
    background: transparent;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.gallery-filter-mobile-toggle > i:first-child {
    color: #d97706;
}

.gallery-filter-mobile-toggle strong {
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #92400e;
    background: #fef3c7;
    font-size: 10px;
}

.filter-toggle-chevron {
    display: inline-block;
    color: #94a3b8;
    font-size: 9px;
    transition: transform 0.18s ease;
}

.gallery-view-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gallery-filter-panel {
    display: none;
}

.gallery-filter-panel.is-open {
    display: block;
    position: relative;
    z-index: 40;
}

.gallery-filter-mobile-toggle[aria-expanded="true"] .filter-toggle-chevron {
    transform: rotate(180deg);
}

.gallery-filter-row {
    padding: 12px;
    border: 0;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: flex-end;
    gap: 12px;
    background: transparent;
}

.gallery-filter-group {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.gallery-date-filter,
.gallery-aspect-filter,
.gallery-resolution-filter {
    grid-column: span 2;
}

.gallery-filter-group legend,
.gallery-select-control > span {
    min-height: 18px;
    margin: 0 0 5px;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
}

.gallery-filter-group legend i,
.gallery-select-control > span i {
    color: #94a3b8;
    font-size: 10px;
}

.gallery-segmented {
    width: 100%;
    height: 36px;
    padding: 3px;
    border: 1px solid #dfe4ea;
    border-radius: 7px;
    display: inline-flex;
    align-items: stretch;
    gap: 2px;
    background: #ffffff;
}

.gallery-segmented label {
    min-width: 0;
    margin: 0;
    flex: 1 1 0;
    display: flex;
    cursor: pointer;
}

.gallery-segmented input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.gallery-segmented label > span {
    width: 100%;
    min-width: 38px;
    height: 28px;
    padding: 0 8px;
    border: 1px solid transparent;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: #64748b;
    background: transparent;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    transition: color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.gallery-segmented label:hover > span {
    color: #1f2937;
    background: #f8fafc;
}

.gallery-segmented input:checked + span {
    color: #92400e;
    background: #fef3c7;
    box-shadow: inset 0 0 0 1px #fde68a;
}

.gallery-segmented input:focus-visible + span {
    outline: 2px solid #f59e0b;
    outline-offset: 1px;
}

.gallery-aspect-options label > span {
    min-width: 44px;
}

.gallery-aspect-options i {
    font-size: 9px;
}

.aspect-shape {
    display: inline-block;
    border: 1.5px solid currentColor;
    border-radius: 1px;
}

.aspect-shape.square { width: 9px; height: 9px; }
.aspect-shape.landscape { width: 12px; height: 8px; }
.aspect-shape.portrait { width: 8px; height: 12px; }

.gallery-select-control {
    min-width: 0;
    max-width: none;
    position: relative;
    display: block;
}

.gallery-select-control::after {
    content: '\f078';
    position: absolute;
    right: 10px;
    bottom: 13px;
    color: #94a3b8;
    font-family: 'Font Awesome 5 Free';
    font-size: 8px;
    font-weight: 900;
    pointer-events: none;
}

.gallery-select-control select {
    width: 100%;
    height: 36px;
    padding: 0 28px 0 10px;
    border: 1px solid #dfe4ea;
    border-radius: 7px;
    outline: 0;
    appearance: none;
    color: #334155;
    background: #ffffff;
    font: inherit;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.gallery-select-control select:hover {
    border-color: #cbd5e1;
}

.gallery-select-control select:focus-visible {
    border-color: #d97706;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1);
}

.gallery-model-filter {
    min-width: 0;
    grid-column: span 3;
}

.gallery-model-picker::after {
    display: none;
}

.gallery-model-trigger {
    width: 100%;
    height: 36px;
    min-width: 0;
    padding: 0 10px 0 7px;
    border: 1px solid #dfe4ea;
    border-radius: 7px;
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) 12px;
    align-items: center;
    gap: 7px;
    color: #334155;
    background: #ffffff;
    font: inherit;
    font-size: 11px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.gallery-model-trigger:hover {
    border-color: #cbd5e1;
}

.gallery-model-trigger:focus-visible,
.gallery-model-picker.open .gallery-model-trigger {
    border-color: #d97706;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1);
}

.gallery-model-trigger-value {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gallery-model-trigger-chevron {
    min-width: 0;
    color: #94a3b8;
    font-size: 8px;
    transition: transform 0.15s ease;
}

.gallery-model-picker.open .gallery-model-trigger-chevron {
    transform: rotate(180deg);
}

.gallery-model-picker .gallery-model-native {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    border: 0;
    white-space: nowrap;
}

.gallery-model-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    z-index: 90;
    max-height: 320px;
    padding: 5px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid #dfe4ea;
    border-radius: 7px;
    display: none;
    background: #ffffff;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.16);
}

.gallery-model-picker.open .gallery-model-menu {
    display: block;
}

body.gallery-model-menu-open .pwa-client-notice-root {
    visibility: hidden;
    pointer-events: none;
}

.video-poster-open {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    display: block;
    overflow: hidden;
    background: #f1f5f9;
    cursor: pointer;
}

.video-poster-open .video-poster {
    position: relative;
    z-index: 1;
    display: block;
}

.video-poster-open .video-poster[hidden] {
    display: none;
}

.video-poster-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    background: #f1f5f9;
    font-size: 36px;
}

.gallery-model-option {
    width: 100%;
    min-height: 38px;
    padding: 4px 7px;
    border: 0;
    border-radius: 5px;
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) 16px;
    align-items: center;
    gap: 8px;
    color: #475569;
    background: transparent;
    font: inherit;
    font-size: 11px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.gallery-model-option:hover,
.gallery-model-option:focus-visible {
    color: #111827;
    background: #f8fafc;
    outline: 0;
}

.gallery-model-option.selected {
    color: #92400e;
    background: #fffbeb;
}

.gallery-model-option > span:nth-child(2) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gallery-model-option-icon {
    width: 24px;
    height: 24px;
    min-width: 24px;
    border: 1px solid #e5e7eb;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: #64748b;
    background: #ffffff;
}

.gallery-model-option-icon img {
    width: 15px;
    height: 15px;
    display: block;
    object-fit: contain;
}

.gallery-model-option-icon i {
    min-width: 0;
    color: currentColor;
    font-size: 10px;
}

.gallery-model-option-check {
    min-width: 0;
    color: #d97706;
    font-size: 9px;
    opacity: 0;
}

.gallery-model-option.selected .gallery-model-option-check {
    opacity: 1;
}

.gallery-sort-filter {
    min-width: 0;
    grid-column: span 3;
}

.gallery-density-control {
    height: 32px;
    margin: 0;
    padding: 2px;
    border-color: #e2e8f0;
    border-radius: 6px;
}

.gallery-density-control button {
    width: 28px;
    height: 26px;
}

.gallery-density-control button.active {
    color: #92400e;
    background: #fef3c7;
}

.filter-clear-btn {
    height: 30px;
    padding: 0 8px;
    border: 0;
    color: #64748b;
    background: transparent;
    font-size: 11px;
}

.filter-clear-btn:hover {
    border: 0;
    color: #b45309;
    background: #fffbeb;
}

.gallery-custom-dates {
    padding: 0 12px 12px;
    border: 0;
    background: transparent;
}

.gallery-custom-dates.visible {
    padding-top: 0;
}

.gallery-custom-dates label {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
}

.gallery-custom-dates input {
    height: 36px;
    border-color: #dfe4ea;
    border-radius: 7px;
    font-size: 11px;
}

.gallery-custom-dates .filter-apply-btn {
    height: 36px;
    align-self: flex-end;
    border-radius: 7px;
}

.active-filter-summary {
    padding-left: 2px;
    padding-right: 2px;
}

/* Prompt-first image cards */
.gallery-groups {
    --gallery-column-width: 198px;
    --gallery-grid-gap: 12px;
}

.gallery-groups[data-density="compact"] {
    --gallery-column-width: 154px;
    --gallery-grid-gap: 8px;
}

.gallery-groups[data-density="large"] {
    --gallery-column-width: 286px;
    --gallery-grid-gap: 16px;
}

.gallery-image-card {
    border-color: #e2e8f0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.gallery-image-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.09);
}

.gallery-image-card .card-info {
    gap: 8px;
    padding: 10px;
}

.gallery-image-card .image-name {
    color: #1e293b;
    font-size: 12px;
    font-weight: 700;
}

.gallery-prompt-summary {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    margin: 0;
    padding: 7px 7px 7px 8px;
    border: 1px solid #edf0f3;
    border-radius: 6px;
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr) 15px;
    align-items: start;
    gap: 6px;
    color: #64748b;
    background: #f8fafc;
    font: inherit;
    font-size: 10.5px;
    line-height: 1.45;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.gallery-prompt-summary > i:first-child {
    min-width: 0;
    margin-top: 2px;
    color: #d97706;
    font-size: 9px;
}

.gallery-prompt-summary > span {
    min-width: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    word-break: break-word;
}

.gallery-prompt-summary .gallery-prompt-copy {
    min-width: 0;
    margin-top: 2px;
    color: #94a3b8;
    font-size: 10px;
    opacity: 0;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.gallery-prompt-summary:hover {
    border-color: #fcd34d;
    color: #334155;
    background: #fffbeb;
}

.gallery-prompt-summary:hover .gallery-prompt-copy,
.gallery-prompt-summary:focus-visible .gallery-prompt-copy {
    color: #b45309;
    opacity: 1;
}

.gallery-prompt-summary:focus-visible {
    outline: 2px solid #f59e0b;
    outline-offset: 1px;
}

.gallery-prompt-summary.copied {
    border-color: #86efac;
    color: #166534;
    background: #f0fdf4;
}

.gallery-prompt-summary.copied .gallery-prompt-copy {
    color: #16a34a;
    opacity: 1;
}

.gallery-groups[data-density="compact"] .gallery-prompt-summary {
    min-height: 34px;
    padding-top: 6px;
    padding-bottom: 6px;
}

.gallery-groups[data-density="compact"] .gallery-prompt-summary > span {
    -webkit-line-clamp: 1;
}

.gallery-groups[data-density="large"] .gallery-prompt-summary > span {
    -webkit-line-clamp: 3;
}

@media (max-width: 1180px) {
    .gallery-filter-row {
        gap: 10px;
    }
}

@media (max-width: 1024px) {
    .gallery-layout {
        gap: 20px;
    }

    .category-sidebar {
        width: 100%;
        flex-basis: auto;
        padding: 10px;
        border: 1px solid rgba(245, 158, 11, 0.2);
        border-radius: 8px;
        overflow: hidden;
        position: static;
    }

    .sidebar-collapse-btn {
        display: none;
    }

    .category-sidebar.is-collapsed {
        width: 100%;
        flex-basis: auto;
        padding: 10px;
    }

    .category-sidebar.is-collapsed .sidebar-heading-copy,
    .category-sidebar.is-collapsed .add-category-btn {
        display: flex !important;
    }

    .category-sidebar.is-collapsed .category-name,
    .category-sidebar.is-collapsed .category-count {
        display: inline !important;
    }

    .category-sidebar.is-collapsed .sidebar-header {
        min-height: 48px;
        margin-bottom: 8px;
        padding: 0 2px 10px;
        justify-content: space-between;
    }

    .category-sidebar.is-collapsed .sidebar-header-actions {
        width: auto;
        justify-content: flex-end;
    }

    .category-sidebar.is-collapsed .category-item {
        width: auto;
        min-width: max-content;
        min-height: 44px;
        padding: 5px 8px 5px 6px;
        justify-content: flex-start;
    }

    .category-sidebar .sidebar-header {
        margin-bottom: 8px;
    }

    .category-sidebar .category-list {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 6px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .category-sidebar .category-list::-webkit-scrollbar {
        display: none;
    }

    .category-sidebar .category-item {
        min-width: max-content;
        flex: 0 0 auto;
        background: rgba(255, 255, 255, 0.64);
    }

    .category-sidebar .category-item:hover {
        transform: none;
    }

    .category-sidebar .category-section-label,
    .category-sidebar .category-actions,
    .category-sidebar .category-item.active::before {
        display: none !important;
    }

    .category-sidebar .category-item:hover .category-count {
        display: inline;
    }
}

@media (max-width: 768px) {
    .gallery-header .gallery-title {
        font-size: 23px;
    }

    .gallery-header .header-top {
        flex-direction: row;
        align-items: flex-end;
    }

    .gallery-toolbar-top {
        padding-bottom: 10px;
    }

    .gallery-filter-heading {
        border-bottom: 0;
    }

    .gallery-filter-mobile-toggle {
        cursor: pointer;
    }

    .filter-toggle-chevron {
        display: inline-block;
    }

    .gallery-filter-mobile-toggle[aria-expanded="true"] .filter-toggle-chevron {
        transform: rotate(180deg);
    }

    .gallery-filter-panel {
        display: none;
        border-top: 1px solid #e5e7eb;
    }

    .gallery-filter-panel.is-open {
        display: block;
    }

    .gallery-filter-row {
        display: flex;
        padding: 10px;
    }

    .gallery-filter-group,
    .gallery-select-control,
    .gallery-model-filter,
    .gallery-sort-filter {
        width: 100%;
        min-width: 0;
        max-width: none;
    }

    .gallery-model-menu {
        position: fixed;
        top: auto;
        right: 12px;
        bottom: 12px;
        left: 12px;
        z-index: 10060;
        width: auto;
        max-height: min(62vh, 420px);
    }

    .gallery-segmented {
        width: 100%;
    }

    .gallery-segmented label {
        flex: 1 1 0;
    }

    .gallery-segmented label > span {
        width: 100%;
        min-width: 0;
        padding: 0 5px;
    }

    .gallery-view-controls .filter-clear-btn span {
        display: none;
    }

    .gallery-custom-dates.visible {
        padding: 0 10px 10px;
        align-items: flex-end;
    }

    .gallery-groups {
        --gallery-column-width: 180px;
        --gallery-grid-gap: 10px;
    }

    .gallery-groups[data-density="compact"] {
        --gallery-column-width: 145px;
        --gallery-grid-gap: 8px;
    }

    .gallery-groups[data-density="large"] {
        --gallery-column-width: 270px;
        --gallery-grid-gap: 12px;
    }

    .gallery-prompt-summary .gallery-prompt-copy {
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .sidebar-heading-copy > span {
        display: none;
    }

    .category-sidebar .sidebar-header {
        min-height: 40px;
    }

    .category-sidebar .category-icon {
        width: 25px;
        height: 25px;
        flex-basis: 25px;
    }

    .category-sidebar .category-item {
        min-height: 38px;
        padding: 3px 7px 3px 4px;
    }

    .gallery-header .header-stats {
        margin-bottom: 2px;
    }

    .gallery-filter-heading {
        padding-left: 10px;
    }

    .gallery-density-control {
        width: auto;
    }

    .gallery-density-control button {
        flex: 0 0 28px;
    }

    .gallery-aspect-options label > span {
        flex-direction: column;
        gap: 2px;
        font-size: 9px;
    }

    .gallery-custom-dates.visible {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .gallery-custom-dates label {
        width: 100%;
    }

    .gallery-custom-dates input {
        width: 100%;
        box-sizing: border-box;
    }

    .gallery-custom-dates .filter-apply-btn {
        width: 100%;
        grid-column: 1 / -1;
    }

    .gallery-groups[data-density="large"] {
        --gallery-column-width: 100%;
    }

    .gallery-image-card .card-info {
        padding: 9px;
    }
}
