/* --- Library List View Styles --- */
.library_header {
    flex-direction: column;
    align-items: stretch;
}

.title-scrollbar {
    --scrollbar-bottom: calc(-3 * var(--ws-unit, 1px));
    --scrollbar-thumb-top: auto;
    --scrollbar-thumb-expanded-top: auto;
    position: absolute;
    left: calc(32 * var(--ws-unit, 1px));
    right: calc(32 * var(--ws-unit, 1px));
    bottom: var(--scrollbar-bottom);
    top: auto;
    height: calc(12 * var(--ws-unit, 1px));
    background-color: transparent;
    z-index: 10;
}

.title-scrollbar .custom-scrollbar-thumb,
.title-scrollbar.horizontal-scrollbar .custom-scrollbar-thumb {
    position: absolute;
    top: auto;
    right: auto;
    width: auto;
    bottom: calc(2 * var(--ws-unit, 1px));
    left: 0;
    height: calc(3 * var(--ws-unit, 1px));
    background-color: var(--theme-scrollbar, #606060);
    border-radius: calc(3 * var(--ws-unit, 1px));
    transition: height 0.2s ease, background-color 0.2s ease;
}

.title-scrollbar:hover .custom-scrollbar-thumb,
.title-scrollbar .custom-scrollbar-thumb.scrolling,
.title-scrollbar.horizontal-scrollbar:hover .custom-scrollbar-thumb,
.title-scrollbar.horizontal-scrollbar .custom-scrollbar-thumb.scrolling,
.title-scrollbar.horizontal-scrollbar .custom-scrollbar-thumb:active {
    height: calc(8 * var(--ws-unit, 1px));
}

.library_title {
    color: var(--theme-text-emphasis, #ffffff);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    margin: 0;
}

.library_header_controls {
    display: flex;
    align-items: center;
    gap: calc(8 * var(--ws-unit, 1px));
}

.library_icon_btn.ws-header-btn {
    border: calc(1 * var(--ws-unit, 1px)) solid transparent;
    background-color: transparent;
    transition: background-color var(--duration-fast, 150ms) ease,
        border-color var(--duration-fast, 150ms) ease,
        transform var(--duration-fast, 150ms) var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1));
}

.library_icon_btn.ws-header-btn:hover {
    border-color: transparent;
    background-color: var(--bg-hover, rgba(255, 255, 255, 0.1));
}

.library_icon_btn.ws-header-btn.active {
    border-color: transparent;
    background-color: rgba(139, 92, 246, 0.2);
}

.library_icon_btn.ws-header-btn.active:hover {
    background-color: rgba(139, 92, 246, 0.3);
}

.library_icon_btn.active img {
    opacity: 1;
    filter: invert(66%) sepia(35%) saturate(1200%) hue-rotate(215deg) brightness(100%) contrast(101%);
}

.library_icon_btn.ws-header-btn img {
    width: calc(22 * var(--ws-unit, 1px));
    height: calc(22 * var(--ws-unit, 1px));
    object-fit: contain;
    display: block;
}

.library_filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: calc(18 * var(--ws-unit, 1px)) calc(32 * var(--ws-unit, 1px)) 0;
}

.library_filter_chips {
    display: flex;
    align-items: center;
    gap: calc(10 * var(--ws-unit, 1px));
}

#view_library_drive .library_filters {
    position: relative;
    min-width: 0;
    gap: var(--spacing-md);
}

/* 되돌아갈 칩이 있을 때만 왼쪽 경계를 부드럽게 가린다. */
#view_library_drive .library_filters:has(> .library_filter_chips.has-overflow-left)::before {
    content: '';
    position: absolute;
    top: calc(18 * var(--ws-unit, 1px));
    bottom: 0;
    left: calc(32 * var(--ws-unit, 1px));
    width: var(--spacing-xxl);
    background: linear-gradient(to right, var(--bg-primary), transparent);
    pointer-events: none;
    z-index: 2;
}

#view_library_drive .library_header_controls {
    position: relative;
    flex: 0 0 auto;
    margin-left: auto;
}

/* 선택창까지 잘리는 마스크 대신 고정 버튼 앞에만 배경 그라데이션을 겹친다. */
#view_library_drive .library_filter_chips.has-overflow-right + .library_header_controls::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    right: calc(100% + var(--spacing-md));
    width: var(--spacing-xxl);
    background: linear-gradient(to right, transparent, var(--bg-primary));
    pointer-events: none;
    z-index: 2;
}

#view_library_drive .library_filter_chips {
    flex: 1;
    min-width: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#view_library_drive .library_filter_chips::-webkit-scrollbar {
    display: none;
}

#view_library_drive .library_filter_chips > .filter_chip_container {
    flex: 0 0 auto;
}

/* 필터 선택창은 칩 스크롤 영역 밖으로 펼쳐지도록 화면 기준으로 배치한다. */
#view_library_drive .library_filter_chips .filter_dropdown {
    position: fixed;
    right: auto;
    max-width: calc(100vw - calc(16 * var(--ws-unit, 1px)));
}

.filter_chip {
    height: calc(32 * var(--ws-unit, 1px));
    box-sizing: border-box;
    background-color: rgba(var(--theme-foreground-rgb, 255, 255, 255), 0.05);
    border: calc(1 * var(--ws-unit, 1px)) solid transparent;
    color: var(--theme-text-primary, #d1d1d1);
    padding: 0 calc(12 * var(--ws-unit, 1px));
    border-radius: calc(8 * var(--ws-unit, 1px));
    font-size: calc(14 * var(--ws-unit, 1px)) !important;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0;

    transition: background-color var(--duration-fast, 150ms) ease,
        border-color var(--duration-fast, 150ms) ease,
        transform var(--duration-fast, 150ms) var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1));
}

.filter_chip:hover,
.filter_chip.is_open,
.filter_chip_container:has(.filter_dropdown.show) .filter_chip {
    background-color: rgba(var(--theme-foreground-rgb, 255, 255, 255), 0.1);
    border-color: transparent;
}

.filter_chip:active {
    transform: scale(0.96);
}

.filter_chip .filter_down_icon {
    width: calc(14 * var(--ws-unit, 1px));
    height: calc(14 * var(--ws-unit, 1px));
    opacity: 0.7;
    margin-left: calc(6 * var(--ws-unit, 1px));
}

.filter_chip.active {
    background-color: rgba(139, 92, 246, 0.2);
    border-color: transparent;
    color: var(--theme-accent-text, #a78bfa);
}

.filter_chip.active:hover,
.filter_chip.active.is_open,
.filter_chip_container:has(.filter_dropdown.show) .filter_chip.active {
    background-color: rgba(139, 92, 246, 0.28);
    border-color: transparent;
}

.filter_chip.active .filter_down_icon {
    opacity: 0.8;
}

/* Filter Clear Button (X) */
.filter_clear_btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 0;
    overflow: hidden;
    opacity: 0;
    transition: width var(--duration-normal, 200ms) var(--ease-out, ease-out), opacity var(--duration-normal, 200ms) ease, margin var(--duration-normal, 200ms) ease, padding var(--duration-normal, 200ms) ease;
    cursor: pointer;
    border-left: calc(1 * var(--ws-unit, 1px)) solid transparent;
    margin-left: 0;
    padding-left: 0;
}

.filter_chip.active .filter_clear_btn {
    width: calc(24 * var(--ws-unit, 1px));
    opacity: 1;
    margin-left: calc(6 * var(--ws-unit, 1px));
    padding-left: calc(6 * var(--ws-unit, 1px));
    border-left: calc(1 * var(--ws-unit, 1px)) solid rgba(139, 92, 246, 0.3);
}

.filter_clear_btn img {
    width: calc(14 * var(--ws-unit, 1px));
    height: calc(14 * var(--ws-unit, 1px));
    opacity: 0.8;
    transition: opacity 0.2s;
}

.filter_clear_btn:hover img {
    opacity: 1;
}

.filter_chip_text {
    font-size: calc(14 * var(--ws-unit, 1px)) !important;
    white-space: nowrap;
}

/* Filter Dropdown Menu */
.filter_chip_container {
    position: relative;
    display: inline-block;
}

.filter_dropdown {
    position: absolute;
    top: calc(100% + calc(8 * var(--ws-unit, 1px)));
    left: 0;
    width: calc(220 * var(--ws-unit, 1px));
    max-height: calc(280 * var(--ws-unit, 1px));
    display: flex;
    flex-direction: column;
    background-color: var(--theme-surface-main, #1e1e1e);
    border: calc(1 * var(--ws-unit, 1px)) solid var(--theme-border, #333);
    border-radius: calc(12 * var(--ws-unit, 1px));
    box-shadow: 0 calc(10 * var(--ws-unit, 1px)) calc(30 * var(--ws-unit, 1px)) var(--theme-shadow, rgba(0, 0, 0, 0.5));
    z-index: 1000;
    padding: 0 0 calc(4 * var(--ws-unit, 1px)) 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(calc(-10 * var(--ws-unit, 1px)));
    transition: opacity var(--duration-normal, 200ms) ease, transform var(--duration-normal, 200ms) var(--ease-out, ease-out), visibility var(--duration-normal, 200ms) ease;
    backdrop-filter: blur(calc(10 * var(--ws-unit, 1px)));
    overflow: hidden;
}

.filter_dropdown_content {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.filter_dropdown_content::-webkit-scrollbar {
    display: none;
}

/* Custom scrollbar inside type filter dropdown */
.custom-scrollbar-track.filter-type-scrollbar {
    position: absolute;
    top: calc(6 * var(--ws-unit, 1px));
    bottom: calc(6 * var(--ws-unit, 1px));
    right: calc(3 * var(--ws-unit, 1px));
    width: calc(14 * var(--ws-unit, 1px));
    background-color: transparent;
    z-index: 10;
}

.custom-scrollbar-track.filter-type-scrollbar .custom-scrollbar-thumb {
    position: absolute;
    right: calc(2 * var(--ws-unit, 1px));
    top: 0;
    width: calc(3 * var(--ws-unit, 1px));
    background-color: rgba(var(--theme-foreground-rgb, 255, 255, 255), 0.25);
    border-radius: calc(3 * var(--ws-unit, 1px));
    transition: width 0.2s ease, background-color 0.2s ease;
}

.custom-scrollbar-track.filter-type-scrollbar:hover .custom-scrollbar-thumb,
.custom-scrollbar-track.filter-type-scrollbar .custom-scrollbar-thumb.scrolling {
    width: calc(6 * var(--ws-unit, 1px));
    background-color: rgba(var(--theme-foreground-rgb, 255, 255, 255), 0.5);
}

.filter_dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Date Filter Popup Specific (Apple Fluid Motion Standards) */
.date_filter_popup {
    padding: 0;
    width: calc(210 * var(--ws-unit, 1px));
    max-height: calc(300 * var(--ws-unit, 1px));
    transform-origin: top center;
    transition: max-height 360ms cubic-bezier(0.32, 0.72, 0, 1),
        opacity 220ms ease,
        transform 260ms cubic-bezier(0.32, 0.72, 0, 1);
}

.date_filter_popup.has_custom,
.filter_dropdown.has_custom {
    max-height: calc(480 * var(--ws-unit, 1px));
}

.date_filter_item {
    margin: calc(4 * var(--ws-unit, 1px)) calc(4 * var(--ws-unit, 1px)) 0px calc(4 * var(--ws-unit, 1px));
    padding: 0 calc(8 * var(--ws-unit, 1px));
    min-height: calc(32 * var(--ws-unit, 1px));
    border-radius: calc(6 * var(--ws-unit, 1px));
    font-size: calc(14 * var(--ws-unit, 1px)) !important;
    color: var(--theme-text-primary, #d1d1d1);
    cursor: pointer;
    transition: background-color 150ms ease, color 150ms ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
}

.date_filter_item:hover {
    background-color: rgba(var(--theme-foreground-rgb, 255, 255, 255), 0.05);
}

.date_filter_item.active {
    background-color: rgba(139, 92, 246, 0.15);
    color: var(--theme-accent-text, #a78bfa);
    font-weight: 600;
}

.custom_date_section {
    padding: 0 calc(8 * var(--ws-unit, 1px));
    border-top: calc(1 * var(--ws-unit, 1px)) solid transparent;
    margin-top: calc(4 * var(--ws-unit, 1px));
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(calc(-8 * var(--ws-unit, 1px)));
    transform-origin: top center;
    transition: max-height 380ms cubic-bezier(0.32, 0.72, 0, 1),
        opacity 240ms ease,
        transform 350ms cubic-bezier(0.32, 0.72, 0, 1),
        padding 320ms cubic-bezier(0.32, 0.72, 0, 1),
        border-color 200ms ease;
}

.custom_date_section.show {
    padding: calc(8 * var(--ws-unit, 1px)) calc(12 * var(--ws-unit, 1px)) calc(4 * var(--ws-unit, 1px));
    border-top: calc(1 * var(--ws-unit, 1px)) solid rgba(var(--theme-foreground-rgb, 255, 255, 255), 0.12);
    max-height: calc(240 * var(--ws-unit, 1px));
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {

    .date_filter_popup,
    .filter_dropdown,
    .custom_date_section {
        transition: opacity 200ms ease !important;
        transform: none !important;
    }
}

.date_input_with_icon {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.date_input_with_icon input {
    flex: 1;
    padding-right: calc(32 * var(--ws-unit, 1px)) !important;
    /* 공간 확보 */
    cursor: pointer;
}

.calendar_open_icon {
    position: absolute;
    right: calc(8 * var(--ws-unit, 1px));
    width: calc(16 * var(--ws-unit, 1px));
    height: calc(16 * var(--ws-unit, 1px));
    cursor: pointer;
    filter: invert(1) brightness(1.5);
    opacity: 0.9;
    transition: opacity 0.2s;
    z-index: 10;
}

.calendar_open_icon:hover {
    opacity: 1;
}

.custom_date_inputs {
    display: flex;
    flex-direction: column;
    gap: calc(8 * var(--ws-unit, 1px));
}

.date_input_group {
    display: flex;
    align-items: center;
    gap: calc(8 * var(--ws-unit, 1px));
}

.date_input_group label {
    font-size: calc(12 * var(--ws-unit, 1px));
    color: var(--theme-text-secondary, #a0a0a0);
    width: calc(30 * var(--ws-unit, 1px));
}

.date_input_group input {
    flex: 1;
    background-color: var(--theme-surface-panel, #2a2a2a);
    border: calc(1 * var(--ws-unit, 1px)) solid var(--theme-border, #444);
    border-radius: calc(6 * var(--ws-unit, 1px));
    padding: calc(4 * var(--ws-unit, 1px)) calc(8 * var(--ws-unit, 1px));
    color: var(--theme-text-emphasis, #fff);
    font-size: calc(13 * var(--ws-unit, 1px));
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    outline: none;
    box-sizing: border-box;
    width: 0;
    min-width: 0;
}

.date_input_group input::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(0.9);
    cursor: pointer;
}

.date_input_group input:focus {
    border-color: #8B5CF6;
}

.filter_dropdown_divider {
    height: calc(1 * var(--ws-unit, 1px));
    background-color: var(--theme-surface-input, #333);
    margin: calc(5 * var(--ws-unit, 1px)) calc(8 * var(--ws-unit, 1px)) calc(1 * var(--ws-unit, 1px)) calc(8 * var(--ws-unit, 1px));
}

#filter_shared_scope_dropdown {
    position: fixed;
    right: auto;
    max-width: calc(100vw - calc(16 * var(--ws-unit, 1px)));
}

#filter_shared_scope_dropdown button {
    background-color: transparent;
    border: 0;
    text-align: left;
    flex-shrink: 0;
}

#filter_shared_scope_dropdown button:hover {
    background-color: rgba(var(--theme-foreground-rgb, 255, 255, 255), 0.05);
}

#filter_shared_scope_dropdown button.active {
    background-color: rgba(139, 92, 246, 0.15);
}

.filter_dropdown_footer {
    padding: calc(12 * var(--ws-unit, 1px)) calc(16 * var(--ws-unit, 1px));
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--theme-surface-panel, #252525);
    border-bottom-left-radius: calc(12 * var(--ws-unit, 1px));
    border-bottom-right-radius: calc(12 * var(--ws-unit, 1px));
}

.filter_footer_right {
    display: flex;
    gap: calc(8 * var(--ws-unit, 1px));
}

.filter_btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: calc(13 * var(--ws-unit, 1px));
    font-weight: 600;
    padding: calc(6 * var(--ws-unit, 1px)) calc(12 * var(--ws-unit, 1px));
    border-radius: calc(6 * var(--ws-unit, 1px));
    transition: all 0.2s;
}

.filter_btn_reset {
    color: var(--theme-text-muted, #888);
    padding-left: 0;
}

.filter_btn_reset:hover {
    color: var(--theme-danger-text, #ff6b6b);
}

.filter_btn_cancel {
    color: var(--theme-text-primary, #d1d1d1);
}

.filter_btn_cancel:hover {
    background-color: rgba(var(--theme-foreground-rgb, 255, 255, 255), 0.05);
}

.filter_btn_apply {
    background-color: #8B5CF6;
    color: #fff;
}

.filter_btn_apply:hover {
    background-color: #7c3aed;
    box-shadow: 0 0 calc(12 * var(--ws-unit, 1px)) rgba(139, 92, 246, 0.3);
}

.filter_dropdown_item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: calc(4 * var(--ws-unit, 1px)) calc(4 * var(--ws-unit, 1px)) 0px calc(4 * var(--ws-unit, 1px));
    padding: 0 calc(8 * var(--ws-unit, 1px));
    min-height: calc(32 * var(--ws-unit, 1px));
    color: var(--theme-text-primary, #e0e0e0);
    font-size: calc(14 * var(--ws-unit, 1px)) !important;
    cursor: pointer;
    transition: background-color 0.15s;
    border-radius: calc(6 * var(--ws-unit, 1px));
    box-sizing: border-box;
}

.filter_dropdown_item>span:first-child {
    display: flex;
    align-items: center;
    gap: calc(10 * var(--ws-unit, 1px));
}

.filter_dropdown_item:hover {
    background-color: rgba(var(--theme-foreground-rgb, 255, 255, 255), 0.05);
}

.filter_dropdown_item.active {
    background-color: rgba(139, 92, 246, 0.15);
    color: var(--theme-accent-text, #a78bfa);
    font-weight: 600;
}

.filter_item_icon {
    width: calc(20 * var(--ws-unit, 1px));
    height: calc(20 * var(--ws-unit, 1px));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: calc(14 * var(--ws-unit, 1px));
    border-radius: calc(4 * var(--ws-unit, 1px));
    flex-shrink: 0;
}

/* Custom Icon Colors (Matching the image) */
.icon_folder {
    color: var(--theme-text-muted, #5f6368);
}

.icon_doc {
    color: #4285f4;
}

.icon_sheet {
    color: #0f9d58;
}

.icon_slide {
    color: #f4b400;
}

.icon_video {
    color: #a142f4;
}

.icon_gem {
    color: #1a73e8;
}

.icon_form {
    color: #673ab7;
}

.icon_image {
    color: #ea4335;
}

.icon_pdf {
    color: #ff5252;
}

.icon_zip {
    color: var(--theme-text-muted, #757575);
}

.icon_audio {
    color: #ff3d00;
}

.icon_draw {
    color: #ff7043;
}

.icon_site {
    color: #3f51b5;
}

.icon_shortcut {
    color: var(--theme-text-secondary, #9e9e9e);
}


#view_library_drive,
#view_library_shared {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.library_list_container {
    flex: 1;

    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Library Path Footer (Breadcrumb Style) */
.library_footer {
    height: calc(48 * var(--ws-unit, 1px));
    flex: 0 0 calc(48 * var(--ws-unit, 1px));

    background-color: transparent;
    display: flex;
    align-items: center;
    padding: 0;
    position: relative;
    transition: all 0.3s ease;
}

.breadcrumb_scroll_area {
    display: flex;
    align-items: center;
    padding: 0 calc(20 * var(--ws-unit, 1px));
    gap: 0px;
    font-size: calc(13 * var(--ws-unit, 1px));
    color: var(--theme-text-primary, #e0e0e0);
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    width: 100%;
    height: 100%;
}

.breadcrumb_scroll_area::-webkit-scrollbar {
    display: none;
}

.library_footer.hidden {
    display: none;

}

.breadcrumb_item {
    display: inline-flex;
    align-items: center;
    gap: calc(8 * var(--ws-unit, 1px));
    padding: calc(6 * var(--ws-unit, 1px)) calc(10 * var(--ws-unit, 1px));
    border-radius: calc(8 * var(--ws-unit, 1px));
    cursor: pointer;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.breadcrumb_item:hover {
    background-color: rgba(var(--theme-foreground-rgb, 255, 255, 255), 0.05);
}

.breadcrumb_icon {
    width: calc(16 * var(--ws-unit, 1px));
    height: calc(16 * var(--ws-unit, 1px));
    opacity: 0.7;
}

.breadcrumb_separator {
    display: inline-flex;
    align-items: center;
    opacity: 0.3;
    padding: 0 calc(4 * var(--ws-unit, 1px));
    flex-shrink: 0;
}

.breadcrumb_segment.clickable {
    cursor: pointer;
    padding: calc(4 * var(--ws-unit, 1px)) calc(8 * var(--ws-unit, 1px));
    border-radius: calc(6 * var(--ws-unit, 1px));
    transition: background-color 0.2, color 0.2s;
}

.breadcrumb_segment.clickable:hover {
    background-color: rgba(var(--theme-foreground-rgb, 255, 255, 255), 0.1);
    color: var(--theme-text-emphasis, #fff);
}

.breadcrumb_item_icon {
    margin-right: calc(6 * var(--ws-unit, 1px));
    font-size: calc(14 * var(--ws-unit, 1px));
}


.breadcrumb_more {
    width: calc(28 * var(--ws-unit, 1px));
    height: calc(28 * var(--ws-unit, 1px));
    border-radius: 50%;
    background-color: rgba(var(--theme-foreground-rgb, 255, 255, 255), 0.05);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 0 calc(4 * var(--ws-unit, 1px));
    transition: all 0.2s;
    font-weight: bold;
    color: var(--theme-text-muted, #888);
    flex-shrink: 0;
}

.breadcrumb_more:hover {
    background-color: rgba(var(--theme-foreground-rgb, 255, 255, 255), 0.12);
    color: var(--theme-text-emphasis, #fff);
}

.active_chip {
    background-color: rgba(var(--theme-foreground-rgb, 255, 255, 255), 0.08);
    border: calc(1 * var(--ws-unit, 1px)) solid rgba(var(--theme-foreground-rgb, 255, 255, 255), 0.1);
    font-weight: 500;
}

.chip_icon {
    font-size: calc(14 * var(--ws-unit, 1px));
}

#selected_file_name {
    max-width: calc(300 * var(--ws-unit, 1px));
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Horizontal Scrollbar for Footer */
.library_footer .horizontal-scrollbar {
    position: absolute;
    bottom: 0;
    left: calc(20 * var(--ws-unit, 1px));
    right: auto;
    top: auto;
    width: calc(100% - calc(40 * var(--ws-unit, 1px)));
    height: calc(20 * var(--ws-unit, 1px));

    background-color: transparent;
    z-index: 10;
}

.library_footer .horizontal-scrollbar .custom-scrollbar-thumb {
    position: absolute;

    top: auto;

    right: auto;

    width: auto;


    bottom: calc(3 * var(--ws-unit, 1px));

    left: 0;
    height: calc(3 * var(--ws-unit, 1px));
    background-color: var(--theme-scrollbar, #606060);
    border-radius: calc(3 * var(--ws-unit, 1px));
    transition: height 0.2s ease, background-color 0.2s ease;

}

.library_footer .horizontal-scrollbar:hover .custom-scrollbar-thumb,
.library_footer .horizontal-scrollbar .custom-scrollbar-thumb.scrolling {
    height: calc(8 * var(--ws-unit, 1px));

}

/* Selected state for items */
.library_list_item.selected {
    background-color: rgba(139, 92, 246, 0.35) !important;
    border-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}

.library_grid_item.selected {
    background-color: var(--bg-hover, rgba(255, 255, 255, 0.12)) !important;
    border-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}

.library_grid_item.selected::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(139, 92, 246, 0.35);
    border-radius: var(--radius-lg, calc(16 * var(--ws-unit, 1px)));
    pointer-events: none;
    z-index: 5;
}

.library_grid_item.selected .grid_item_header_overlay {
    background-color: rgba(139, 92, 246, 0.5);
}

.library_list_header {
    display: flex;
    align-items: center;
    margin: 0 calc(32 * var(--ws-unit, 1px));
    padding: calc(10 * var(--ws-unit, 1px)) calc(15 * var(--ws-unit, 1px));
    border-bottom: calc(1 * var(--ws-unit, 1px)) solid var(--theme-border, #404040);
    color: var(--theme-text-secondary, #a0a0a0);
    font-size: calc(14 * var(--ws-unit, 1px)) !important;
    font-weight: 600;
}

.header_col {
    display: flex;
    align-items: center;
}

.header_col_inner {
    display: inline-flex;
    align-items: center;
    gap: calc(6 * var(--ws-unit, 1px));
    padding: calc(4 * var(--ws-unit, 1px)) calc(8 * var(--ws-unit, 1px));
    margin-left: calc(-8 * var(--ws-unit, 1px));
    /* Offset padding for alignment */
    border-radius: calc(6 * var(--ws-unit, 1px));
    font-size: calc(14 * var(--ws-unit, 1px)) !important;
    transition: background-color 0.2s, color 0.2s;
}

.library_list_header .library_icon_btn {
    padding: calc(4 * var(--ws-unit, 1px));
}

.col_name {
    flex: 1;
}

.col_date {
    width: calc(150 * var(--ws-unit, 1px));
}

.header_col[data-sort] .header_col_inner {
    cursor: pointer;
    user-select: none;
}

.header_col[data-sort] .header_col_inner:hover {
    background-color: rgba(var(--theme-foreground-rgb, 255, 255, 255), 0.05);
    color: var(--theme-text-primary, #d1d1d1);
}

.header_col[data-sort].active .header_col_inner {
    color: var(--theme-accent-text, #8B5CF6);

}

.header_col[data-sort].active .header_col_inner:hover {
    background-color: rgba(139, 92, 246, 0.1);
}

.sort_icon_wrapper {
    display: none;
    align-items: center;
    justify-content: center;
    width: calc(20 * var(--ws-unit, 1px));
    height: calc(20 * var(--ws-unit, 1px));
}

.header_col[data-sort].active .sort_icon_wrapper {
    display: flex;
}

.sort_icon {
    width: calc(12 * var(--ws-unit, 1px));
    height: calc(12 * var(--ws-unit, 1px));
    filter: invert(66%) sepia(35%) saturate(1200%) hue-rotate(215deg) brightness(100%) contrast(101%);

}

.col_action {
    width: calc(40 * var(--ws-unit, 1px));
    justify-content: flex-end;
    position: relative;
}

/* Sort Panel Dropdown */
.sort_panel_wrapper {
    position: relative;
}

.sort_panel_btn {
    border-radius: 50%;
    transition: background-color 0.2s;
}

.sort_panel_btn.active {
    background-color: rgba(var(--theme-foreground-rgb, 255, 255, 255), 0.12);
}

.sort_panel_dropdown {
    display: none;
    position: absolute;
    top: calc(100% + calc(8 * var(--ws-unit, 1px)));
    right: 0;
    width: calc(200 * var(--ws-unit, 1px));
    background-color: var(--theme-surface-panel, #252525);
    border: calc(1 * var(--ws-unit, 1px)) solid var(--theme-border, #404040);
    border-radius: calc(12 * var(--ws-unit, 1px));
    box-shadow: 0 calc(8 * var(--ws-unit, 1px)) calc(24 * var(--ws-unit, 1px)) var(--theme-shadow, rgba(0, 0, 0, 0.6));
    z-index: 500;
    overflow: hidden;
    padding: calc(6 * var(--ws-unit, 1px)) 0;
}

.sort_panel_dropdown.show {
    display: block;
}

.sort_panel_section {
    padding: calc(4 * var(--ws-unit, 1px)) 0;
}

/* 정렬 기준, 정렬 방향 텍스트 (12px) */
.sort_panel_dropdown .sort_panel_section_title,
.sort_panel_dropdown.show .sort_panel_section_title {
    font-size: calc(12 * var(--ws-unit, 1px)) !important;
    font-weight: 600;
    color: var(--theme-text-muted, #888888);
    padding: calc(6 * var(--ws-unit, 1px)) calc(16 * var(--ws-unit, 1px)) calc(4 * var(--ws-unit, 1px));
    letter-spacing: calc(0.5 * var(--ws-unit, 1px));
    line-height: 1.4;
}

/* 나머지 항목 (14px) */
.sort_panel_dropdown .sort_panel_item,
.sort_panel_dropdown.show .sort_panel_item {
    display: flex;
    align-items: center;
    gap: calc(10 * var(--ws-unit, 1px));
    padding: calc(9 * var(--ws-unit, 1px)) calc(16 * var(--ws-unit, 1px));
    font-size: calc(14 * var(--ws-unit, 1px)) !important;
    font-weight: 500;
    color: var(--theme-text-primary, #d1d1d1);
    cursor: pointer;
    transition: background-color 0.15s;
    user-select: none;
    line-height: 1.4;
}

.sort_panel_dropdown .sort_panel_item span,
.sort_panel_dropdown.show .sort_panel_item span {
    font-size: calc(14 * var(--ws-unit, 1px)) !important;
}

.sort_panel_item:hover {
    background-color: rgba(var(--theme-foreground-rgb, 255, 255, 255), 0.07);
}

.sort_panel_item.active {
    background-color: rgba(139, 92, 246, 0.12);
    color: var(--theme-accent-text, #a78bfa);
}

.sort_panel_dropdown .sort_panel_check,
.sort_panel_dropdown.show .sort_panel_check {
    font-size: calc(14 * var(--ws-unit, 1px)) !important;
    font-weight: 700;
    color: var(--theme-accent-text, #a78bfa);
    width: calc(16 * var(--ws-unit, 1px));
    flex-shrink: 0;
    opacity: 0;
}

.sort_panel_item.active .sort_panel_check {
    opacity: 1;
}

.sort_panel_divider {
    height: calc(1 * var(--ws-unit, 1px));
    background-color: var(--theme-surface-input, #383838);
    margin: calc(5 * var(--ws-unit, 1px)) calc(8 * var(--ws-unit, 1px)) calc(1 * var(--ws-unit, 1px)) calc(8 * var(--ws-unit, 1px));
}


.library_file_list {
    flex: 1;
    overflow-y: auto;
    margin-top: calc(5 * var(--ws-unit, 1px));
    scrollbar-width: none;
    position: relative;
    padding: 0 calc(32 * var(--ws-unit, 1px));
    /* Firefox */
}

.library_file_list::-webkit-scrollbar {
    display: none;
    /* Hide native scrollbar */
}

.library_list_item {
    display: flex;
    align-items: center;
    padding: calc(12 * var(--ws-unit, 1px)) calc(15 * var(--ws-unit, 1px));
    border-bottom: calc(1 * var(--ws-unit, 1px)) solid var(--theme-border, #303030);
    color: var(--theme-text-primary, #d1d1d1);
    font-size: calc(14 * var(--ws-unit, 1px));
    font-weight: 500;
    cursor: pointer;
    border-radius: calc(8 * var(--ws-unit, 1px));
    transition: background-color 0.2s;
}

.library_list_item:hover {
    background-color: rgba(139, 92, 246, 0.15);
}

.col_name {
    flex: 1;
    display: flex;
    align-items: center;
    gap: calc(15 * var(--ws-unit, 1px));
    min-width: 0;
    /* Important for ellipsis */
}

.list_item_icon {
    width: calc(24 * var(--ws-unit, 1px));
    height: calc(24 * var(--ws-unit, 1px));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(18 * var(--ws-unit, 1px));
    flex-shrink: 0;
}

.list_item_title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--theme-text-primary, #e0e0e0);
}

.col_date,
.col_size {
    width: calc(150 * var(--ws-unit, 1px));
    color: var(--theme-text-secondary, #a0a0a0);
    font-size: calc(14 * var(--ws-unit, 1px)) !important;
}

:is(#view_library_drive, #view_library_shared) .col_date {
    flex: 0 0 max(10.75%, calc(96 * var(--ws-unit, 1px)));
    min-width: 0;
    text-align: start;
    white-space: nowrap;
}

:is(#view_library_drive, #view_library_shared) .library_list_container {
    container: library-list / inline-size;
}

:is(#view_library_drive, #view_library_shared) .col_action {
    --library-action-size: calc(32 * var(--ws-unit, 1px));
}

:is(#view_library_drive, #view_library_shared) .col_action :is(.sort_panel_btn, .library_action_btn) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--library-action-size);
    height: var(--library-action-size);
    padding: 0;
}

@container library-list (max-width: 600px) {
    :is(#view_library_drive, #view_library_shared) .col_action {
        --library-action-size: calc(28 * var(--ws-unit, 1px));
        flex: 0 0 var(--library-action-size);
        min-width: 0;
    }

    #view_library_shared .col_share_user {
        display: none;
    }
}

#view_library_shared .col_share_user {
    flex: 0 1 min(30%, calc(180 * var(--ws-unit, 1px)));
    min-width: 0;
    padding-right: var(--spacing-lg, 16px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--theme-text-secondary, #a0a0a0);
    font-size: var(--font-size-base);
}

#view_library_shared .library_list_item {
    position: relative;
}

#view_library_shared .library_list_item > .col_action > .library_action_btn {
    position: relative;
    z-index: 3;
}

#view_library_shared .library_list_item .col_share_user {
    --share-avatar-height: calc(32.5 * var(--ws-unit, 1px));
    min-block-size: var(--share-avatar-height);
}

#view_library_shared .library_list_item .col_share_user:is(:hover, :has(.library_share_avatar:focus-visible)) {
    overflow: visible;
    --share-avatar-inset: var(--share-avatar-origin, 0px);
    --share-avatar-scale: 1.25;
    --share-avatar-gap: calc(4 * var(--ws-unit, 1px));
    --share-avatar-overlap: 0px;
    --share-avatar-overflow: flex;
    --share-avatar-overflow-opacity: 1;
    --share-avatar-summary: none;
}

#view_library_shared .library_list_item .col_share_user:is(:hover, :has(.library_share_avatar:focus-visible)) > .library_share_avatars {
    position: absolute;
    inset-inline: 0;
    inset-block-start: 50%;
    inline-size: auto;
    transform: translateY(-50%);
    z-index: 2;
}

.library_share_avatar_backdrop {
    --share-avatar-backdrop-padding: calc(10 * var(--ws-unit, 1px));
    display: none;
    position: absolute;
    z-index: 1;
    inset-block-start: 50%;
    inset-inline-start: max(0px, calc(var(--share-avatar-backdrop-start, 0px) - var(--share-avatar-backdrop-padding)));
    inset-inline-end: max(0px, calc(var(--share-avatar-backdrop-end, 0px) - var(--share-avatar-backdrop-padding)));
    block-size: var(--share-avatar-height);
    transform: translateY(-50%);
    border-radius: calc(6 * var(--ws-unit, 1px));
    -webkit-backdrop-filter: blur(calc(4 * var(--ws-unit, 1px)));
    backdrop-filter: blur(calc(4 * var(--ws-unit, 1px)));
    pointer-events: none;
}

.library_list_item .col_share_user:is(:hover, :has(.library_share_avatar:focus-visible)) > .library_share_avatar_backdrop:not([hidden]) {
    display: block;
}

.library_share_avatars {
    display: flex;
    align-items: center;
    gap: var(--share-avatar-gap, 0px);
    block-size: var(--share-avatar-height);
    inline-size: max-content;
    max-inline-size: 100%;
    padding-inline-start: calc(var(--share-avatar-inset, 0px) + var(--share-avatar-center-padding, 0px));
    overflow-x: auto;
    scrollbar-width: none;
    isolation: isolate;
}

.library_share_avatars:is(.has_share_avatar_clip_left, .has_share_avatar_clip_right) {
    --share-avatar-fade-width: min(calc(18 * var(--ws-unit, 1px)), 25%);
    mask-image: linear-gradient(to right,
        var(--share-avatar-mask-left, #000), #000 var(--share-avatar-fade-width),
        #000 calc(100% - var(--share-avatar-fade-width)), var(--share-avatar-mask-right, #000));
}

.library_share_avatars.has_share_avatar_clip_left {
    --share-avatar-mask-left: transparent;
}

.library_share_avatars.has_share_avatar_clip_right {
    --share-avatar-mask-right: transparent;
}

.library_share_avatars.is_name_centered::after {
    content: '';
    flex: 0 0 calc(100% - 32.5 * var(--ws-unit, 1px));
}

.library_share_avatar {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    outline-offset: -2px;
}

.library_share_avatar + .library_share_avatar {
    margin-inline-start: var(--share-avatar-overlap,
        calc((-7 - 3 * (var(--share-avatar-count) - 2)) * var(--ws-unit, 1px)));
}

.library_share_avatar_overflow {
    display: var(--share-avatar-overflow, none);
    opacity: var(--share-avatar-overflow-opacity, 0);
}

.library_share_avatar_face {
    position: relative;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: calc(26 * var(--share-avatar-scale, 1) * var(--ws-unit, 1px));
    height: calc(26 * var(--share-avatar-scale, 1) * var(--ws-unit, 1px));
    border: calc(2 * var(--ws-unit, 1px)) solid var(--bg-primary);
    border-radius: 50%;
    overflow: hidden;
    color: #fff;
    font-size: calc(11 * var(--share-avatar-scale, 1) * var(--ws-unit, 1px));
    font-weight: 600;
    line-height: 1;
}

.library_share_avatar_face img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.library_share_avatar_more {
    display: var(--share-avatar-summary, inline);
    margin-inline-start: calc(4 * var(--ws-unit, 1px));
}

.library_share_avatar_name {
    display: grid;
    grid-template-columns: minmax(0, 0fr);
    overflow: hidden;
    white-space: nowrap;
    color: var(--theme-text-primary);
    opacity: 0;
}

.library_share_avatar_name > span {
    max-inline-size: calc(166 * var(--ws-unit, 1px));
    padding-inline-start: calc(6 * var(--ws-unit, 1px));
    overflow: hidden;
    text-overflow: ellipsis;
}

.library_share_avatar:is(:focus-visible, .is_name_open) .library_share_avatar_name {
    grid-template-columns: minmax(0, 1fr);
    opacity: 1;
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .library_share_avatars {
        --share-avatar-motion: 320ms cubic-bezier(0.28, 0.12, 0.26, 1);
        --share-avatar-name-motion: 250ms cubic-bezier(0.28, 0.12, 0.26, 1);
        transition: column-gap var(--share-avatar-motion);
    }

    .library_share_avatar {
        transition: margin-inline-start var(--share-avatar-motion);
    }

    .library_share_avatar_overflow {
        transition: margin-inline-start var(--share-avatar-motion), opacity var(--share-avatar-motion);
    }

    @starting-style {
        .library_share_avatar_overflow {
            opacity: 0;
        }
    }

    .library_share_avatar_face {
        transition: width var(--share-avatar-motion), height var(--share-avatar-motion), font-size var(--share-avatar-motion);
    }

    .library_share_avatar_name {
        transition: grid-template-columns var(--share-avatar-name-motion), opacity var(--share-avatar-name-motion);
    }
}

#view_library_shared .grid_view_mode .col_share_user {
    display: none;
}

.col_action {
    width: calc(40 * var(--ws-unit, 1px));
    display: flex;
    justify-content: flex-end;
}

.library_rename_input {
    flex: 1;
    background-color: var(--theme-surface-input, #3c4043);
    border: calc(1 * var(--ws-unit, 1px)) solid #8B5CF6;
    border-radius: calc(4 * var(--ws-unit, 1px));
    color: var(--theme-text-emphasis, #fff);
    padding: calc(2 * var(--ws-unit, 1px)) calc(8 * var(--ws-unit, 1px));
    font-size: calc(14 * var(--ws-unit, 1px));
    font-family: inherit;
    outline: none;
    width: 100%;
}

.library_action_btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: calc(4 * var(--ws-unit, 1px));
    border-radius: calc(4 * var(--ws-unit, 1px));
    opacity: 0.6;
    /* Always visible */
    transition: opacity 0.2s, background-color 0.2s;
}

.library_list_item:hover .library_action_btn {
    opacity: 0.8;
}

.library_action_btn:hover {
    opacity: 1 !important;
    background-color: var(--theme-surface-hover, #404040);
}

.library_action_btn img {
    width: calc(16 * var(--ws-unit, 1px));
    height: calc(16 * var(--ws-unit, 1px));
}

/* Removed duplicate empty state class */

/* Library Custom Scrollbar Override */
.custom-scrollbar-track.library-scrollbar {
    --scrollbar-top: calc(40 * var(--ws-unit, 1px));
    --scrollbar-bottom: calc(20 * var(--ws-unit, 1px));
    --scrollbar-right: 0px;
    --scrollbar-track-size: calc(12 * var(--ws-unit, 1px));

    --scrollbar-thumb-size: calc(4 * var(--ws-unit, 1px));
    --scrollbar-thumb-right: calc(4 * var(--ws-unit, 1px));
    --scrollbar-thumb-expanded-size: calc(8 * var(--ws-unit, 1px));
    --scrollbar-thumb-expanded-right: calc(2 * var(--ws-unit, 1px));
}

/* --- Library Grid View --- */
.library_file_list.grid_mode {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(calc(280 * var(--ws-unit, 1px)), 1fr));
    grid-auto-rows: max-content;
    gap: calc(20 * var(--ws-unit, 1px));
    padding: calc(20 * var(--ws-unit, 1px)) calc(32 * var(--ws-unit, 1px));
    align-content: start;
}

.library_grid_item {
    position: relative;
    background-color: var(--bg-tertiary, #28282c);
    border-radius: var(--radius-lg, calc(16 * var(--ws-unit, 1px)));
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: none;
    transition: box-shadow var(--duration-fast, 150ms) ease;
    cursor: pointer;
    height: calc(240 * var(--ws-unit, 1px));
    min-height: calc(200 * var(--ws-unit, 1px));
    box-sizing: border-box;
}

.library_grid_item:hover {
    box-shadow: none;
    background-color: var(--bg-hover, rgba(255, 255, 255, 0.1));
}

.library_grid_item:not(.selected):hover::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(139, 92, 246, 0.15);
    border-radius: var(--radius-lg, calc(16 * var(--ws-unit, 1px)));
    pointer-events: none;
    z-index: 4;
    transition: background-color 0.15s ease;
}

.grid_item_preview_full {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-secondary, #202024);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 1;
}

.grid_item_preview_full img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--duration-slow, 300ms) var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1));
}

.library_grid_item:hover .grid_item_preview_full img {
    transform: none;
}

.grid_item_preview_full .preview_placeholder {
    font-size: calc(56 * var(--ws-unit, 1px));
    opacity: 0.3;
    color: var(--text-muted, #808080);
}

.grid_item_header_overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 2;
    padding: calc(12 * var(--ws-unit, 1px)) calc(16 * var(--ws-unit, 1px));
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(var(--theme-surface-rgb, 30, 30, 35), 0.35);
    backdrop-filter: blur(calc(16 * var(--ws-unit, 1px)));
    -webkit-backdrop-filter: blur(calc(16 * var(--ws-unit, 1px)));
    box-sizing: border-box;
    pointer-events: auto;
}

.grid_header_left_info {
    display: flex;
    flex-direction: column;
    gap: calc(3 * var(--ws-unit, 1px));
    flex: 1;
    min-width: 0;
    margin-right: calc(12 * var(--ws-unit, 1px));
}

.grid_item_title {
    font-size: var(--font-size-base, calc(14 * var(--ws-unit, 1px)));
    font-weight: var(--font-weight-semibold, 600);
    color: var(--text-primary, #ffffff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    text-shadow: 0 calc(1 * var(--ws-unit, 1px)) calc(3 * var(--ws-unit, 1px)) var(--theme-shadow, rgba(0, 0, 0, 0.6));
}

.grid_item_date {
    font-size: var(--font-size-xs, calc(12 * var(--ws-unit, 1px)));
    color: var(--text-secondary, rgba(255, 255, 255, 0.75));
    font-weight: var(--font-weight-regular, 400);
    text-shadow: 0 calc(1 * var(--ws-unit, 1px)) calc(2 * var(--ws-unit, 1px)) var(--theme-shadow, rgba(0, 0, 0, 0.6));
}

.grid_item_action {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.grid_item_action .library_action_btn {
    width: calc(28 * var(--ws-unit, 1px));
    height: calc(28 * var(--ws-unit, 1px));
    border-radius: 50%;
    border: none;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color var(--duration-fast, 150ms) ease,
        transform var(--duration-fast, 150ms) ease;
}

.grid_item_action .library_action_btn:hover {
    background-color: rgba(var(--theme-foreground-rgb, 255, 255, 255), 0.15);
    border: none;
}

.grid_item_action .library_action_btn:active {
    transform: scale(0.92);
}

.grid_item_action .library_action_btn img {
    width: calc(16 * var(--ws-unit, 1px));
    height: calc(16 * var(--ws-unit, 1px));
    opacity: 0.9;
}

/* View Mode Toggle (Apple Segmented Control Standards) */
.view_mode_toggle {
    display: flex;
    align-items: center;
    height: calc(32 * var(--ws-unit, 1px));
    box-sizing: border-box;
    background-color: rgba(var(--theme-foreground-rgb, 255, 255, 255), 0.06);
    border-radius: calc(16 * var(--ws-unit, 1px));
    padding: calc(2 * var(--ws-unit, 1px));
    border: calc(1 * var(--ws-unit, 1px)) solid rgba(var(--theme-foreground-rgb, 255, 255, 255), 0.1);
    backdrop-filter: blur(calc(12 * var(--ws-unit, 1px)));
    -webkit-backdrop-filter: blur(calc(12 * var(--ws-unit, 1px)));
    position: relative;
    overflow: hidden;
}

.view_mode_indicator {
    position: absolute;
    top: 0;
    bottom: 0;
    margin-top: auto;
    margin-bottom: auto;
    left: calc(2 * var(--ws-unit, 1px));
    width: calc(32 * var(--ws-unit, 1px));
    height: calc(26 * var(--ws-unit, 1px));
    background-color: rgba(var(--theme-foreground-rgb, 255, 255, 255), 0.18);
    border-radius: calc(13 * var(--ws-unit, 1px));
    box-shadow: 0 calc(1 * var(--ws-unit, 1px)) calc(4 * var(--ws-unit, 1px)) var(--theme-shadow, rgba(0, 0, 0, 0.2)), inset 0 calc(1 * var(--ws-unit, 1px)) 0 rgba(var(--theme-foreground-rgb, 255, 255, 255), 0.15);
    transition: background-color 200ms ease;
    z-index: 0;
    pointer-events: none;
    will-change: transform;
}

.view_mode_btn {
    background: transparent;
    border: none;
    cursor: pointer;
    width: calc(32 * var(--ws-unit, 1px));
    height: calc(26 * var(--ws-unit, 1px));
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: calc(13 * var(--ws-unit, 1px));
    transition: transform 120ms cubic-bezier(0.23, 1, 0.32, 1), opacity 200ms ease;
    position: relative;
    z-index: 1;
    user-select: none;
}

.view_mode_btn:active {
    transform: scale(0.92);
}

.view_mode_btn img {
    width: calc(16 * var(--ws-unit, 1px));
    height: calc(16 * var(--ws-unit, 1px));
    opacity: 0.45;
    transition: opacity 200ms ease, transform 200ms cubic-bezier(0.32, 0.72, 0, 1);
}

.view_mode_btn.active img {
    opacity: 1;
    transform: scale(1.05);
}

.view_mode_btn:hover:not(.active) {
    background-color: rgba(var(--theme-foreground-rgb, 255, 255, 255), 0.06);
}

.view_mode_btn:hover img {
    opacity: 0.85;
}

/* Grid / List Active Indicator - Apple Fluid Physics (Spring Damping 0.85, Response 0.48s) */
@keyframes stretchToGrid {
    0% {
        transform: translateX(0) scale(1, 1);
        animation-timing-function: cubic-bezier(0.32, 0, 0.2, 1);
    }

    32% {
        /* 가속 구간: 이동 방향(우측)으로 부드럽고 쫀득하게 스트레치 (Fluid Stretch) */
        transform: translateX(46%) scale(1.18, 0.94);
        animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
    }

    68% {
        /* 감속 및 부드러운 반동: 목표 지점을 살짝 넘어가며 가볍게 스쿼시 (Soft Overshoot & Squish) */
        transform: translateX(102%) scale(0.97, 1.03);
        animation-timing-function: cubic-bezier(0.25, 1, 0.5, 1);
    }

    86% {
        /* 미세 잔여 탄성 복원 */
        transform: translateX(99.6%) scale(1.008, 0.995);
        animation-timing-function: cubic-bezier(0.25, 1, 0.5, 1);
    }

    100% {
        /* 안정화: 2번째 버튼에 정확하게 안착 */
        transform: translateX(100%) scale(1, 1);
    }
}

@keyframes stretchToList {
    0% {
        transform: translateX(100%) scale(1, 1);
        animation-timing-function: cubic-bezier(0.32, 0, 0.2, 1);
    }

    32% {
        /* 가속 구간: 좌측으로 부드럽고 쫀득하게 스트레치 (Fluid Stretch) */
        transform: translateX(54%) scale(1.18, 0.94);
        animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
    }

    68% {
        /* 감속 및 부드러운 반동: 0 지점을 살짝 넘어가며 가볍게 스쿼시 (Soft Overshoot & Squish) */
        transform: translateX(-2%) scale(0.97, 1.03);
        animation-timing-function: cubic-bezier(0.25, 1, 0.5, 1);
    }

    86% {
        /* 미세 잔여 탄성 복원 */
        transform: translateX(0.4%) scale(1.008, 0.995);
        animation-timing-function: cubic-bezier(0.25, 1, 0.5, 1);
    }

    100% {
        /* 안정화: 첫 번째 버튼에 정확하게 안착 */
        transform: translateX(0) scale(1, 1);
    }
}

.view_mode_toggle.grid_active .view_mode_indicator {
    transform: translateX(100%);
    animation: stretchToGrid 480ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.view_mode_toggle.list_active .view_mode_indicator {
    transform: translateX(0);
    animation: stretchToList 480ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}



@media (prefers-reduced-motion: reduce) {
    .view_mode_indicator {
        transition: opacity 150ms ease !important;
        transform: none !important;
    }

    .view_mode_btn,
    .view_mode_btn img {
        transition: opacity 150ms ease !important;
        transform: none !important;
    }
}

/* Hide date column in grid mode */
.library_list_container.grid_view_mode .library_list_header .col_date {
    display: none;
}



/* Library Empty State */
.library_empty_state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    color: var(--theme-text-secondary, rgba(var(--theme-foreground-rgb, 255, 255, 255), 0.4));
    font-size: calc(16 * var(--ws-unit, 1px));
    font-weight: 500;
    text-align: center;
    padding: 0;
    pointer-events: none;
}
