/* Destructive confirmations and folders workspace */

.delete-confirm-overlay {
    position: fixed;
    z-index: 1400;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 22px;
    overflow: hidden auto;
    opacity: 0;
    background:
        radial-gradient(circle at 50% 26%, rgba(219, 83, 105, 0.105), transparent 35%),
        radial-gradient(circle at 18% 82%, rgba(116, 88, 211, 0.08), transparent 34%),
        rgba(3, 5, 13, 0.76);
    -webkit-backdrop-filter: blur(18px) saturate(128%);
    backdrop-filter: blur(18px) saturate(128%);
    animation: none;
    transition: opacity 220ms ease;
}

.delete-confirm-overlay.open {
    opacity: 1;
}

.delete-confirm-dialog {
    position: relative;
    width: min(100%, 520px);
    max-width: none;
    padding: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 27px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.045), transparent 44%),
        rgba(10, 13, 26, 0.92);
    color: var(--text-primary);
    box-shadow:
        0 34px 88px rgba(0, 0, 0, 0.48),
        0 8px 28px rgba(0, 0, 0, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.075);
    text-align: left;
    opacity: 0;
    transform: translateY(18px) scale(0.965);
    -webkit-backdrop-filter: blur(42px) saturate(148%);
    backdrop-filter: blur(42px) saturate(148%);
    animation: none;
    transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1), opacity 220ms ease;
    isolation: isolate;
}

.delete-confirm-overlay.open .delete-confirm-dialog {
    opacity: 1;
    transform: none;
}

.dcd-aurora {
    position: absolute;
    z-index: -1;
    top: -110px;
    right: -80px;
    width: 260px;
    height: 230px;
    border-radius: 50%;
    background: rgba(219, 76, 105, 0.095);
    filter: blur(54px);
    pointer-events: none;
}

.dcd-close {
    position: absolute;
    z-index: 4;
    top: 16px;
    right: 16px;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.065);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.025);
    color: rgba(217, 210, 228, 0.48);
    cursor: pointer;
    font: inherit;
    font-size: 0.68rem;
    transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.dcd-close:hover {
    color: #fff;
    background: rgba(238, 91, 113, 0.12);
    transform: rotate(5deg);
}

.dcd-header {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    align-items: start;
    gap: 14px;
    padding-right: 40px;
}

.delete-confirm-dialog .dcd-icon {
    display: grid;
    width: 54px;
    height: 54px;
    margin: 0;
    place-items: center;
    border: 1px solid rgba(246, 106, 128, 0.18);
    border-radius: 17px;
    background:
        linear-gradient(145deg, rgba(244, 106, 126, 0.17), rgba(176, 54, 84, 0.065)),
        rgba(255, 255, 255, 0.018);
    color: #fa7891;
    box-shadow: 0 10px 26px rgba(121, 31, 58, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.delete-confirm-dialog .dcd-icon i {
    color: inherit;
    font-size: 1.15rem;
}

.delete-confirm-dialog .dcd-folder-icon {
    border-color: rgba(177, 148, 252, 0.18);
    background: linear-gradient(145deg, rgba(145, 112, 235, 0.18), rgba(76, 93, 194, 0.07));
    color: #b89cff;
}

.dcd-heading {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.dcd-heading small {
    color: rgba(245, 126, 146, 0.65);
    font-size: 0.59rem;
    font-weight: 720;
    letter-spacing: 0.075em;
    text-transform: uppercase;
}

.dcd-folder-dialog .dcd-heading small {
    color: rgba(186, 159, 252, 0.68);
}

.delete-confirm-dialog .dcd-heading h3 {
    margin: 0;
    color: rgba(248, 245, 252, 0.94);
    font-size: 1.22rem;
    font-weight: 760;
    letter-spacing: -0.035em;
    line-height: 1.12;
}

.delete-confirm-dialog .dcd-heading p {
    margin: 1px 0 0;
    color: rgba(194, 187, 208, 0.5);
    font-size: 0.72rem;
    line-height: 1.45;
}

.dcd-message-preview,
.dcd-chat-preview,
.dcd-folder-summary,
.dcd-warning {
    margin-top: 17px;
    border: 1px solid rgba(255, 255, 255, 0.055);
    background: rgba(255, 255, 255, 0.022);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.dcd-message-preview {
    display: grid;
    grid-template-columns: 37px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 61px;
    padding: 9px 11px;
    border-radius: 16px;
}

.dcd-message-preview > span {
    display: grid;
    width: 37px;
    height: 37px;
    place-items: center;
    border-radius: 12px;
    background: rgba(141, 111, 225, 0.1);
    color: rgba(188, 165, 248, 0.75);
    font-size: 0.69rem;
}

.dcd-message-preview > div,
.dcd-chat-preview > div,
.dcd-folder-summary > div {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.dcd-message-preview small,
.dcd-chat-preview small,
.dcd-folder-summary small {
    color: rgba(184, 177, 198, 0.42);
    font-size: 0.57rem;
}

.dcd-message-preview strong,
.dcd-chat-preview strong {
    overflow: hidden;
    color: rgba(235, 231, 243, 0.82);
    font-size: 0.72rem;
    font-weight: 620;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dcd-choice-list {
    display: grid;
    gap: 7px;
    margin-top: 10px;
}

.delete-confirm-actions .dcd-choice,
.dcd-choice-list .dcd-choice {
    display: grid;
    width: 100%;
    min-height: 66px;
    grid-template-columns: 38px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border: 1px solid rgba(255, 255, 255, 0.055);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.018);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.dcd-choice-list .dcd-choice:hover {
    transform: translateY(-1px);
    border-color: rgba(178, 153, 246, 0.13);
    background: rgba(150, 118, 235, 0.05);
}

.dcd-choice-list .dcd-choice-danger:hover {
    border-color: rgba(245, 103, 126, 0.17);
    background: rgba(223, 72, 100, 0.055);
}

.dcd-choice-icon {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 12px;
    background: rgba(139, 108, 226, 0.085);
    color: rgba(188, 165, 248, 0.78);
    font-size: 0.68rem;
}

.dcd-choice-danger .dcd-choice-icon {
    background: rgba(225, 75, 103, 0.09);
    color: #f6788f;
}

.dcd-choice-copy {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.dcd-choice-copy strong {
    color: rgba(240, 236, 247, 0.88);
    font-size: 0.73rem;
    font-weight: 680;
}

.dcd-choice-copy small {
    overflow: hidden;
    color: rgba(184, 177, 199, 0.42);
    font-size: 0.58rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dcd-choice > i {
    color: rgba(193, 183, 211, 0.25);
    font-size: 0.55rem;
}

.dcd-chat-preview {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 24px 42px;
    align-items: center;
    gap: 10px;
    min-height: 76px;
    padding: 10px 12px;
    border-radius: 18px;
}

.dcd-chat-avatar,
.dcd-delete-target {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 15px;
}

.dcd-chat-avatar {
    background: linear-gradient(145deg, rgba(154, 123, 242, 0.95), rgba(83, 72, 175, 0.96));
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
    font-size: 0.85rem;
    font-weight: 740;
}

.dcd-chat-preview > div > span {
    overflow: hidden;
    color: rgba(181, 174, 196, 0.4);
    font-size: 0.57rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dcd-chat-preview > div > span i {
    margin-right: 4px;
    color: rgba(179, 156, 241, 0.55);
}

.dcd-chat-preview > i {
    color: rgba(202, 191, 219, 0.22);
    font-size: 0.66rem;
}

.dcd-delete-target {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(241, 98, 122, 0.12);
    background: rgba(225, 72, 100, 0.07);
    color: rgba(247, 115, 137, 0.72);
    font-size: 0.75rem;
}

.dcd-warning {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 12px;
    border-color: rgba(240, 150, 73, 0.1);
    border-radius: 15px;
    background: rgba(222, 130, 50, 0.04);
}

.dcd-warning > i {
    margin-top: 2px;
    color: rgba(247, 170, 91, 0.66);
    font-size: 0.7rem;
}

.dcd-warning > span {
    display: grid;
    gap: 3px;
}

.dcd-warning strong {
    color: rgba(236, 221, 205, 0.77);
    font-size: 0.66rem;
}

.dcd-warning small {
    color: rgba(198, 181, 165, 0.43);
    font-size: 0.57rem;
    line-height: 1.4;
}

.dcd-folder-summary {
    display: flex;
    min-height: 68px;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: 17px;
}

.dcd-folder-summary > span:first-child {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 13px;
    background: rgba(142, 111, 231, 0.09);
    color: rgba(187, 161, 251, 0.75);
}

.dcd-folder-summary strong {
    color: rgba(239, 235, 247, 0.87);
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

.dcd-safe-pill {
    display: inline-flex !important;
    min-height: 29px;
    margin-left: auto;
    align-items: center;
    gap: 5px;
    padding: 0 9px;
    border: 1px solid rgba(73, 196, 147, 0.11);
    border-radius: 10px;
    background: rgba(55, 168, 124, 0.055);
    color: rgba(102, 211, 168, 0.64);
    font-size: 0.55rem;
    font-weight: 640;
}

.dcd-footer {
    display: flex;
    min-height: 43px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.045);
}

.dcd-footer > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(180, 173, 193, 0.35);
    font-size: 0.53rem;
}

.dcd-footer > span i {
    color: rgba(168, 145, 230, 0.52);
}

.dcd-footer button {
    min-height: 36px;
    padding: 0 14px;
    border-radius: 12px;
    font: inherit;
    font-size: 0.66rem;
    font-weight: 650;
    cursor: pointer;
    transition: transform 150ms ease, background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.dcd-footer-actions {
    justify-content: flex-end;
}

.dcd-footer-actions button {
    min-width: 132px;
}

.dcd-footer .btn-cancel-delete {
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.025);
    color: rgba(214, 207, 225, 0.59);
}

.dcd-footer .btn-cancel-delete:hover {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(244, 240, 250, 0.9);
}

.dcd-footer .btn-confirm-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid rgba(245, 103, 126, 0.21);
    background: linear-gradient(145deg, rgba(224, 76, 102, 0.18), rgba(180, 52, 80, 0.1));
    color: #fb8ca0;
}

.dcd-footer .btn-confirm-delete:hover {
    border-color: rgba(247, 111, 133, 0.4);
    background: linear-gradient(145deg, rgba(230, 79, 106, 0.3), rgba(190, 53, 82, 0.2));
    color: #fff;
    transform: translateY(-1px);
}

.delete-confirm-dialog button:disabled {
    cursor: wait;
    opacity: 0.56;
    pointer-events: none;
}

/* Folders management workspace */
#folders-modal.folders-overlay {
    padding: 22px;
    background:
        radial-gradient(circle at 26% 16%, rgba(124, 91, 220, 0.14), transparent 36%),
        radial-gradient(circle at 80% 86%, rgba(45, 162, 146, 0.07), transparent 30%),
        rgba(3, 5, 13, 0.75);
    -webkit-backdrop-filter: blur(16px) saturate(128%);
    backdrop-filter: blur(16px) saturate(128%);
}

#folders-modal .fm-workspace {
    position: relative;
    width: min(100%, 760px);
    max-width: 760px;
    max-height: min(760px, 91dvh);
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 29px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.04), transparent 43%),
        rgba(9, 12, 24, 0.91);
    box-shadow: 0 36px 92px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.075);
    -webkit-backdrop-filter: blur(44px) saturate(148%);
    backdrop-filter: blur(44px) saturate(148%);
    isolation: isolate;
}

#folders-modal .fm-aurora {
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    filter: blur(58px);
    pointer-events: none;
}

#folders-modal .fm-aurora-one {
    top: -130px;
    left: -70px;
    width: 320px;
    height: 260px;
    background: rgba(128, 91, 225, 0.13);
}

#folders-modal .fm-aurora-two {
    right: -90px;
    bottom: -140px;
    width: 300px;
    height: 270px;
    background: rgba(45, 169, 149, 0.065);
}

#folders-modal .fm-hero {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) 36px;
    align-items: center;
    gap: 14px;
    padding: 20px 20px 14px;
}

#folders-modal .fm-hero-icon {
    display: grid;
    width: 56px;
    height: 56px;
    place-items: center;
    border: 1px solid rgba(204, 184, 255, 0.18);
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(158, 124, 244, 0.92), rgba(84, 74, 178, 0.94));
    color: #fff;
    box-shadow: 0 12px 28px rgba(61, 41, 147, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    font-size: 1rem;
}

#folders-modal .fm-hero-copy {
    display: grid;
    min-width: 0;
    gap: 4px;
}

#folders-modal .fm-eyebrow {
    color: rgba(184, 158, 249, 0.66);
    font-size: 0.59rem;
    font-weight: 720;
    letter-spacing: 0.075em;
    text-transform: uppercase;
}

#folders-modal .fm-hero h3 {
    margin: 0;
    color: rgba(247, 244, 252, 0.94);
    font-size: 1.25rem;
    font-weight: 760;
    letter-spacing: -0.035em;
    line-height: 1.1;
}

#folders-modal .fm-hero p {
    max-width: 550px;
    margin: 0;
    color: rgba(190, 184, 203, 0.47);
    font-size: 0.68rem;
    line-height: 1.4;
}

#folders-modal .fm-close {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.065);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.025);
    color: rgba(214, 207, 225, 0.48);
    cursor: pointer;
    font: inherit;
}

#folders-modal .fm-close:hover {
    background: rgba(151, 119, 236, 0.09);
    color: #fff;
}

#folders-modal .fm-overview {
    display: flex;
    min-height: 64px;
    align-items: center;
    gap: 9px;
    margin: 0 20px;
    padding: 9px;
    border: 1px solid rgba(255, 255, 255, 0.055);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.02);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

#folders-modal .fm-overview > div {
    display: flex;
    min-width: 138px;
    min-height: 44px;
    align-items: center;
    gap: 9px;
    padding: 5px 9px;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.018);
}

#folders-modal .fm-overview-icon {
    display: grid;
    width: 31px;
    height: 31px;
    flex: 0 0 31px;
    place-items: center;
    border-radius: 10px;
    background: rgba(143, 111, 231, 0.09);
    color: rgba(188, 163, 250, 0.76);
    font-size: 0.62rem;
}

#folders-modal .fm-overview > div > span:last-child {
    display: grid;
    gap: 1px;
}

#folders-modal .fm-overview strong {
    color: rgba(239, 235, 247, 0.86);
    font-size: 0.79rem;
    font-variant-numeric: tabular-nums;
}

#folders-modal .fm-overview small {
    color: rgba(183, 176, 197, 0.4);
    font-size: 0.54rem;
}

#folders-modal .fm-sync-pill {
    display: inline-flex;
    min-height: 32px;
    margin-left: auto;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    border: 1px solid rgba(77, 198, 151, 0.11);
    border-radius: 11px;
    background: rgba(51, 165, 122, 0.055);
    color: rgba(106, 215, 172, 0.66);
    font-size: 0.56rem;
    font-weight: 650;
}

#folders-modal .fm-body {
    display: grid;
    min-height: 0;
    grid-template-columns: minmax(255px, 0.85fr) minmax(320px, 1.15fr);
    gap: 10px;
    padding: 10px 20px 20px;
    overflow: hidden;
}

#folders-modal .fm-create-panel,
#folders-modal .fm-library {
    min-width: 0;
    min-height: 0;
    padding: 13px;
    border: 1px solid rgba(255, 255, 255, 0.055);
    border-radius: 19px;
    background: rgba(255, 255, 255, 0.018);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

#folders-modal .fm-library {
    display: flex;
    flex-direction: column;
}

#folders-modal .fm-section-head {
    display: flex;
    min-height: 36px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

#folders-modal .fm-section-head > span:first-child {
    display: grid;
    gap: 2px;
}

#folders-modal .fm-section-head small {
    color: rgba(183, 176, 197, 0.4);
    font-size: 0.54rem;
    font-weight: 650;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

#folders-modal .fm-section-head strong {
    color: rgba(240, 236, 248, 0.88);
    font-size: 0.79rem;
    font-weight: 690;
}

#folders-modal .fm-counter,
#folders-modal .fm-library-badge {
    display: inline-flex;
    min-height: 25px;
    align-items: center;
    gap: 5px;
    padding: 0 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    color: rgba(186, 179, 200, 0.38);
    font-size: 0.52rem;
    font-variant-numeric: tabular-nums;
}

#folders-modal .fm-create-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
}

#folders-modal .fm-name-field {
    display: grid;
    min-width: 0;
    min-height: 46px;
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: center;
    padding: 0 8px;
    border: 1px solid rgba(255, 255, 255, 0.065);
    border-radius: 14px;
    background: rgba(4, 7, 16, 0.27);
    color: rgba(181, 159, 241, 0.58);
    transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

#folders-modal .fm-name-field:focus-within {
    border-color: rgba(170, 143, 244, 0.28);
    background: rgba(10, 13, 26, 0.58);
    box-shadow: 0 0 0 3px rgba(139, 108, 226, 0.065);
}

#folders-modal .fm-create-bar input {
    width: 100%;
    min-width: 0;
    height: 42px;
    padding: 0 4px;
    border: 0;
    outline: 0;
    background: transparent;
    color: rgba(241, 237, 248, 0.9);
    font: inherit;
    font-size: 0.7rem;
}

#folders-modal .fm-create-bar input::placeholder {
    color: rgba(181, 174, 195, 0.34);
}

#folders-modal .fm-create-bar > button {
    display: inline-flex;
    min-width: 94px;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 13px;
    border: 1px solid rgba(192, 171, 250, 0.16);
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(151, 119, 237, 0.28), rgba(88, 75, 183, 0.14));
    color: rgba(242, 237, 255, 0.92);
    font: inherit;
    font-size: 0.66rem;
    font-weight: 680;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09);
    transition: transform 160ms ease, filter 160ms ease, opacity 160ms ease;
}

#folders-modal .fm-create-bar > button:disabled {
    cursor: default;
    filter: saturate(0.55);
    opacity: 0.42;
}

#folders-modal .fm-create-bar > button.has-value:not(:disabled):hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
}

#folders-modal .fm-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 9px;
}

#folders-modal .fm-suggestions button {
    min-height: 27px;
    padding: 0 9px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.018);
    color: rgba(195, 188, 209, 0.46);
    font: inherit;
    font-size: 0.55rem;
    cursor: pointer;
    transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}

#folders-modal .fm-suggestions button:hover {
    border-color: rgba(171, 144, 245, 0.15);
    background: rgba(143, 111, 231, 0.06);
    color: rgba(224, 214, 246, 0.78);
}

#folders-modal .folders-list {
    display: grid;
    min-height: 0;
    gap: 6px;
    overflow: hidden auto;
    scrollbar-width: thin;
}

#folders-modal .folder-item.fm-folder-card {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) 34px;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.045);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.014);
    transition: border-color 160ms ease, background 160ms ease;
}

#folders-modal .folder-item.fm-folder-card + .folder-item.fm-folder-card {
    border-top: 1px solid rgba(255, 255, 255, 0.045);
}

#folders-modal .folder-item.fm-folder-card:hover,
#folders-modal .folder-item.fm-folder-card.active {
    border-color: rgba(164, 136, 240, 0.12);
    background: rgba(137, 105, 224, 0.045);
}

#folders-modal .fm-folder-open {
    display: grid;
    min-width: 0;
    min-height: 57px;
    grid-template-columns: 36px minmax(0, 1fr) auto 13px;
    align-items: center;
    gap: 9px;
    padding: 7px 4px 7px 9px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

#folders-modal .folder-item-icon {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(151, 119, 237, 0.18), rgba(79, 83, 181, 0.07));
    color: rgba(188, 162, 250, 0.78);
    font-size: 0.72rem;
}

#folders-modal .fm-folder-card:nth-child(3n + 2) .folder-item-icon {
    background: linear-gradient(145deg, rgba(55, 178, 156, 0.13), rgba(45, 117, 145, 0.05));
    color: rgba(91, 211, 181, 0.75);
}

#folders-modal .fm-folder-card:nth-child(3n) .folder-item-icon {
    background: linear-gradient(145deg, rgba(225, 143, 72, 0.13), rgba(165, 76, 99, 0.05));
    color: rgba(239, 174, 105, 0.74);
}

#folders-modal .fm-folder-copy {
    display: grid;
    min-width: 0;
    gap: 3px;
}

#folders-modal .folder-item-name {
    overflow: hidden;
    color: rgba(237, 233, 245, 0.84);
    font-size: 0.68rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#folders-modal .fm-folder-copy small {
    overflow: hidden;
    color: rgba(182, 175, 196, 0.38);
    font-size: 0.53rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#folders-modal .folder-item-chats {
    min-width: 24px;
    padding: 3px 7px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
    color: rgba(197, 188, 213, 0.45);
    font-size: 0.53rem;
    font-variant-numeric: tabular-nums;
}

#folders-modal .fm-folder-chevron {
    color: rgba(193, 183, 211, 0.22);
    font-size: 0.5rem;
}

#folders-modal .folder-item-del {
    display: grid;
    width: 31px;
    height: 31px;
    place-items: center;
    margin-right: 5px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: rgba(217, 114, 134, 0.38);
    opacity: 1;
    cursor: pointer;
    font-size: 0.6rem;
    transition: border-color 150ms ease, background 150ms ease, color 150ms ease, transform 150ms ease;
}

#folders-modal .folder-item-del:hover {
    border-color: rgba(241, 104, 127, 0.13);
    background: rgba(221, 70, 99, 0.07);
    color: #f47b91;
    transform: none;
}

#folders-modal .folders-empty {
    display: flex;
    min-height: 184px;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 20px;
    text-align: center;
}

#folders-modal .folders-empty-visual {
    position: relative;
    display: grid;
    width: 62px;
    height: 62px;
    margin-bottom: 5px;
    place-items: center;
    border: 1px solid rgba(177, 150, 246, 0.1);
    border-radius: 21px;
    background: rgba(143, 111, 231, 0.055);
    color: rgba(184, 158, 247, 0.58);
    font-size: 1.25rem;
}

#folders-modal .folders-empty-visual i:last-child {
    position: absolute;
    right: -4px;
    bottom: -4px;
    display: grid;
    width: 23px;
    height: 23px;
    place-items: center;
    border: 3px solid rgba(10, 13, 25, 0.96);
    border-radius: 50%;
    background: linear-gradient(145deg, #9178ec, #5f6edc);
    color: #fff;
    font-size: 0.47rem;
}

#folders-modal .folders-empty > span:not(.folders-empty-visual) {
    color: rgba(233, 228, 242, 0.75);
    font-size: 0.75rem;
    font-weight: 670;
}

#folders-modal .folders-empty > small {
    max-width: 250px;
    color: rgba(181, 174, 195, 0.4);
    font-size: 0.57rem;
    line-height: 1.4;
}

#folders-modal .folders-empty > button {
    min-height: 33px;
    margin-top: 7px;
    padding: 0 11px;
    border: 1px solid rgba(181, 154, 247, 0.15);
    border-radius: 11px;
    background: rgba(143, 111, 231, 0.075);
    color: rgba(213, 199, 247, 0.78);
    font: inherit;
    font-size: 0.59rem;
    font-weight: 650;
    cursor: pointer;
}

/* Light theme */
[data-theme="light"] .delete-confirm-overlay,
[data-theme="light"] #folders-modal.folders-overlay {
    background:
        radial-gradient(circle at 48% 22%, rgba(180, 105, 142, 0.1), transparent 36%),
        radial-gradient(circle at 18% 82%, rgba(113, 91, 195, 0.08), transparent 34%),
        rgba(226, 230, 239, 0.72);
}

[data-theme="light"] .delete-confirm-dialog,
[data-theme="light"] #folders-modal .fm-workspace {
    border-color: rgba(255, 255, 255, 0.92);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.27) 48%),
        rgba(244, 245, 250, 0.91);
    color: #292534;
    box-shadow: 0 32px 82px rgba(54, 43, 79, 0.18), inset 0 1px 0 #fff;
}

[data-theme="light"] :is(.delete-confirm-dialog .dcd-heading h3, #folders-modal .fm-hero h3, #folders-modal .fm-section-head strong, #folders-modal .folder-item-name, .dcd-choice-copy strong, .dcd-message-preview strong, .dcd-chat-preview strong, .dcd-folder-summary strong) {
    color: rgba(39, 31, 53, 0.91);
}

[data-theme="light"] :is(.delete-confirm-dialog .dcd-heading p, #folders-modal .fm-hero p, #folders-modal .fm-section-head small, #folders-modal .fm-folder-copy small, #folders-modal .fm-overview small, .dcd-choice-copy small, .dcd-message-preview small, .dcd-chat-preview small, .dcd-folder-summary small) {
    color: rgba(65, 53, 83, 0.55);
}

[data-theme="light"] :is(.dcd-message-preview, .dcd-chat-preview, .dcd-folder-summary, .dcd-warning, #folders-modal .fm-overview, #folders-modal .fm-create-panel, #folders-modal .fm-library, #folders-modal .folder-item.fm-folder-card) {
    border-color: rgba(66, 50, 96, 0.075);
    background: rgba(255, 255, 255, 0.38);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

[data-theme="light"] .dcd-choice-list .dcd-choice {
    border-color: rgba(66, 50, 96, 0.075);
    background: rgba(255, 255, 255, 0.34);
}

[data-theme="light"] :is(.dcd-close, #folders-modal .fm-close, .dcd-footer .btn-cancel-delete, #folders-modal .fm-counter, #folders-modal .fm-library-badge, #folders-modal .fm-suggestions button) {
    border-color: rgba(66, 50, 96, 0.075);
    background: rgba(255, 255, 255, 0.42);
    color: rgba(61, 50, 78, 0.57);
}

[data-theme="light"] #folders-modal .fm-name-field {
    border-color: rgba(66, 50, 96, 0.09);
    background: rgba(255, 255, 255, 0.5);
}

[data-theme="light"] #folders-modal .fm-name-field:focus-within {
    border-color: rgba(129, 99, 211, 0.3);
    background: rgba(255, 255, 255, 0.82);
}

[data-theme="light"] #folders-modal .fm-create-bar input {
    color: #2f293a;
}

[data-theme="light"] #folders-modal .folder-item-chats {
    background: rgba(65, 49, 96, 0.055);
    color: rgba(65, 53, 83, 0.55);
}

[data-theme="light"] #folders-modal .folders-empty-visual i:last-child {
    border-color: rgba(245, 246, 250, 0.98);
}

[data-theme="light"] #folders-modal .folders-empty > span:not(.folders-empty-visual) {
    color: rgba(43, 34, 57, 0.78);
}

[data-theme="light"] #folders-modal .folders-empty > small {
    color: rgba(65, 53, 83, 0.52);
}

@media (max-width: 680px) {
    .delete-confirm-overlay,
    #folders-modal.folders-overlay {
        align-items: end;
        padding: 0;
    }

    .delete-confirm-dialog {
        width: 100%;
        max-height: 91dvh;
        padding: 18px 16px calc(14px + env(safe-area-inset-bottom, 0px));
        overflow-y: auto;
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 27px 27px 0 0;
        transform: translateY(28px);
    }

    .delete-confirm-dialog::before,
    #folders-modal .fm-workspace::before {
        position: absolute;
        z-index: 5;
        top: 7px;
        left: 50%;
        width: 38px;
        height: 4px;
        border-radius: 999px;
        content: "";
        background: rgba(255, 255, 255, 0.14);
        transform: translateX(-50%);
    }

    .dcd-header {
        grid-template-columns: 48px minmax(0, 1fr);
        gap: 11px;
        padding-top: 7px;
        padding-right: 34px;
    }

    .delete-confirm-dialog .dcd-icon {
        width: 48px;
        height: 48px;
        border-radius: 15px;
    }

    .delete-confirm-dialog .dcd-heading h3 {
        font-size: 1.1rem;
    }

    .dcd-choice-copy small {
        white-space: normal;
    }

    .dcd-chat-preview {
        grid-template-columns: 42px minmax(0, 1fr) 18px 38px;
        gap: 8px;
    }

    .dcd-chat-avatar {
        width: 42px;
        height: 42px;
        border-radius: 14px;
    }

    .dcd-delete-target {
        width: 38px;
        height: 38px;
        border-radius: 13px;
    }

    .dcd-footer:not(.dcd-footer-actions) > span {
        display: none;
    }

    .dcd-footer:not(.dcd-footer-actions) .btn-cancel-delete {
        width: 100%;
    }

    .dcd-footer-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .dcd-footer-actions button {
        min-width: 0;
    }

    .dcd-folder-summary {
        flex-wrap: wrap;
    }

    .dcd-safe-pill {
        margin-left: auto;
    }

    #folders-modal .fm-workspace {
        width: 100%;
        max-width: none;
        max-height: 94dvh;
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 28px 28px 0 0;
        transform: translateY(28px);
    }

    #folders-modal.active .fm-workspace {
        transform: none;
    }

    #folders-modal .fm-hero {
        grid-template-columns: 48px minmax(0, 1fr) 34px;
        gap: 11px;
        padding: 23px 15px 12px;
    }

    #folders-modal .fm-hero-icon {
        width: 48px;
        height: 48px;
        border-radius: 16px;
    }

    #folders-modal .fm-hero p {
        display: none;
    }

    #folders-modal .fm-overview {
        margin: 0 15px;
    }

    #folders-modal .fm-overview > div {
        min-width: 0;
        flex: 1;
    }

    #folders-modal .fm-sync-pill {
        display: none;
    }

    #folders-modal .fm-body {
        display: flex;
        max-height: calc(94dvh - 148px);
        flex-direction: column;
        gap: 8px;
        padding: 9px 15px calc(14px + env(safe-area-inset-bottom, 0px));
        overflow-y: auto;
    }

    #folders-modal .fm-create-panel,
    #folders-modal .fm-library {
        flex: 0 0 auto;
        padding: 12px;
    }

    #folders-modal .folders-list {
        max-height: 265px;
    }
}

@media (max-width: 390px) {
    .dcd-chat-preview > i,
    .dcd-delete-target,
    #folders-modal .fm-overview > div:nth-child(2) {
        display: none;
    }

    .dcd-chat-preview {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    #folders-modal .fm-create-bar {
        grid-template-columns: 1fr;
    }

    #folders-modal .fm-create-bar > button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .delete-confirm-overlay,
    .delete-confirm-dialog,
    #folders-modal .fm-workspace {
        transition: none !important;
        animation: none !important;
    }
}
