:root { 
    --bg-color: #000; 
    --text-color: #fff;
    --muted-color: #595959;
    --control-bg: #0a0a0a;
    --control-border: #222;
    --control-hover-color: #d8d8d8;
    --control-hover-border: #444;
    --card-border: rgba(255, 255, 255, 0.08); 
    --card-hover-border: rgba(255,255,255,0.18);
    --card-bg: rgba(20, 20, 22, 0.5); 
    --card-shadow: 0 0 0 1px rgba(255,255,255,0.05), 0 0 22px rgba(255,255,255,0.07), 0 10px 30px rgba(0,0,0,0.22);
    --control-shadow: 0 0 0 1px rgba(255,255,255,0.04), 0 0 18px rgba(255,255,255,0.06), 0 10px 24px rgba(0,0,0,0.18);
    --dropdown-shadow: 0 0 0 1px rgba(255,255,255,0.04), 0 0 20px rgba(255,255,255,0.06), 0 10px 30px rgba(0,0,0,0.28);
    --accent-gradient: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    --dropdown-bg: #0a0a0a;
    --dropdown-border: #222;
    --search-icon-color: #444;
    --size-color: #555;
    --footer-bg: rgba(255,255,255,0.03);
    --file-name-color: #fff;
    --disk-name-color: #8c8c8c;
    --disk-name-active-color: #f3f3f3;
    --quota-color: #4d4d4d;
    --quota-active-color: #6f6f6f;
    --sort-arrow-color: #444;
    --separator-color: rgba(255, 255, 255, 0.08);
    --item-glow-core: rgba(255, 255, 255, 0.14);
    --item-glow-mid: rgba(255, 255, 255, 0.06);
    --profile-surface-shadow: 0 0 0 1px rgba(255,255,255,0.03), 0 0 10px rgba(255,255,255,0.035), 0 8px 18px rgba(0,0,0,0.16);
}

@media (hover: none), (pointer: coarse) {
    .profile-toggle:hover,
    .theme-toggle:hover,
    .profile-drawer__close:hover,
    .disk-picker__close:hover,
    .filter-btn:hover,
    .select-btn:hover,
    .quick-upload-btn:hover,
    .quick-link-upload-btn:hover,
    .upload-modal__close:hover,
    .upload-link-modal__close:hover,
    .file-info-modal__close:hover,
    .selection-bar__btn:hover:not(:disabled),
    .upload-dock__cancel:hover:not(:disabled) {
        color: inherit;
        border-color: var(--control-border);
        box-shadow: none;
        transform: none;
    }

    .theme-toggle,
    .profile-toggle,
    .profile-drawer__close,
    .disk-picker__close,
    .upload-modal__close,
    .upload-link-modal__close,
    .file-info-modal__close {
        color: var(--control-hover-color);
    }

    .profile-link {
        border-color: var(--control-hover-border);
        box-shadow: var(--profile-surface-shadow);
    }

    .profile-link__icon {
        color: var(--control-hover-color);
    }

    .profile-link--support .profile-link__icon {
        color: #6da8ff;
    }

    .profile-link--danger,
    .profile-link--danger .profile-link__icon {
        color: #ff5a5f;
    }

    .disk-plan {
        border-color: var(--control-hover-border);
        box-shadow: var(--control-shadow);
    }

    .item-action[data-action="download"] {
        color: #74e28d;
        border-color: rgba(116, 226, 141, 0.28);
    }

    .item-action[data-action="rename"] {
        color: #fff;
        border-color: rgba(255, 255, 255, 0.28);
    }

    body[data-theme="light"] .item-action[data-action="rename"] {
        color: #111;
        border-color: rgba(17, 17, 17, 0.28);
    }

    .item-action[data-action="info"] {
        color: #fff;
        border-color: rgba(255, 255, 255, 0.28);
    }

    body[data-theme="light"] .item-action[data-action="info"] {
        color: #111;
        border-color: rgba(17, 17, 17, 0.28);
    }

    .item-action[data-action="link"] {
        color: #6da8ff;
        border-color: rgba(109, 168, 255, 0.28);
    }

    .item-action[data-action="move"] {
        color: #ffb952;
        border-color: rgba(255, 185, 82, 0.32);
    }

    .item-action[data-action="archive"] {
        color: #ff6db3;
        border-color: rgba(255, 109, 179, 0.32);
    }

    .item-action[data-action="delete"],
    .item-action--danger {
        color: #ff5a5f;
        border-color: rgba(255, 90, 95, 0.28);
    }

    .file-info-modal__action {
        border-color: var(--control-hover-border);
    }

    .file-info-modal__action--success,
    .file-info-modal__action--success:hover {
        border-color: rgba(116, 226, 141, 0.42);
    }

    .file-info-modal__action--link,
    .file-info-modal__action--link:hover {
        border-color: rgba(109, 168, 255, 0.42);
    }

    .file-info-modal__action--move,
    .file-info-modal__action--move:hover {
        border-color: rgba(255, 185, 82, 0.42);
    }

    .file-info-modal__action--archive,
    .file-info-modal__action--archive:hover {
        border-color: rgba(255, 109, 179, 0.42);
    }

    .file-info-modal__action--danger,
    .file-info-modal__action--danger:hover {
        border-color: rgba(255, 90, 95, 0.42);
    }
}


body[data-theme="light"] {
    --bg-color: #fff;
    --text-color: #111;
    --muted-color: #575757;
    --control-bg: #fff;
    --control-border: rgba(17, 17, 17, 0.28);
    --control-hover-color: #000;
    --control-hover-border: rgba(0, 0, 0, 0.56);
    --card-border: rgba(17, 17, 17, 0.22);
    --card-hover-border: rgba(0,0,0,0.46);
    --card-bg: #fff;
    --card-shadow: 0 10px 30px rgba(0,0,0,0.12);
    --control-shadow: 0 10px 24px rgba(0,0,0,0.1);
    --dropdown-shadow: 0 10px 30px rgba(0,0,0,0.12);
    --dropdown-bg: #fff;
    --dropdown-border: rgba(17, 17, 17, 0.28);
    --search-icon-color: #6f6f6f;
    --size-color: #6b6b6b;
    --footer-bg: #fff;
    --file-name-color: #111;
    --disk-name-color: #4f4f4f;
    --disk-name-active-color: #000;
    --quota-color: #7a7a7a;
    --quota-active-color: #4a4a4a;
    --sort-arrow-color: #666;
    --separator-color: rgba(17, 17, 17, 0.18);
    --item-glow-core: rgba(0, 0, 0, 0.08);
    --item-glow-mid: rgba(0, 0, 0, 0.03);
    --profile-surface-shadow: 0 10px 24px rgba(0,0,0,0.08);
}


body { 
    background: var(--bg-color); color: var(--text-color); font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0; display: flex; flex-direction: column; align-items: center; height: 100vh; overflow: hidden;
    transition: background-color 0.28s ease, color 0.28s ease;
}

button,
a,
[role="button"] {
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
}

button:focus,
button:focus-visible,
a:focus,
a:focus-visible,
[role="button"]:focus,
[role="button"]:focus-visible {
    outline: none;
    box-shadow: none;
}

body.is-auth {
    justify-content: center;
}

body.is-auth .app-shell,
body.is-auth .top-controls,
body.is-auth .profile-drawer {
    display: none;
}

.top-controls {
    position: fixed;
    top: 16px;
    left: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 300;
    pointer-events: none;
}

.top-controls > button {
    pointer-events: auto;
}

.auth-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-color);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 500;
}

body.is-auth .auth-overlay {
    display: flex;
}

.auth-card {
    width: min(100%, 400px);
    padding: 28px;
    border-radius: 24px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    box-shadow: var(--dropdown-shadow);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
}

.auth-brand__eyebrow {
    margin: 0;
    font-size: 0.74rem;
    color: var(--muted-color);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.auth-brand__title {
    margin: 0;
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-color);
}

.auth-view {
    display: none;
    flex-direction: column;
    gap: 12px;
}

.auth-view--active {
    display: flex;
}

.auth-view__head {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-view__copy {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.45;
    color: var(--muted-color);
}

.profile-drawer {
    position: fixed;
    inset: 0;
    z-index: 450;
    pointer-events: none;
    background: rgba(0, 0, 0, 0);
    transition: background-color 0.24s ease;
}

.profile-drawer__panel,
.disk-picker__panel,
.settings-panel__panel {
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
}

body[data-theme="light"] .profile-drawer {
    background: rgba(255, 255, 255, 0);
}

.profile-drawer.is-open {
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.38);
}

body[data-theme="light"] .profile-drawer.is-open {
    background: rgba(17, 17, 17, 0.1);
}

body[data-theme="light"] .profile-drawer__panel,
body[data-theme="light"] .disk-picker__panel,
body[data-theme="light"] .settings-panel__panel {
    background: rgba(242, 242, 244, 0.97);
}

.profile-drawer__panel {
    width: min(420px, calc(100vw - 28px));
    height: calc(100dvh - 28px);
    max-height: calc(100vh - 28px);
    margin: 14px;
    border-radius: 24px;
    border: 1px solid var(--card-border);
    background: rgba(18, 18, 20, 0.96);
    box-shadow: var(--dropdown-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateX(calc(-100% - 24px));
    transition: transform 0.26s ease, background-color 0.24s ease, border-color 0.24s ease;
}

.disk-picker {
    position: absolute;
    top: 14px;
    left: min(448px, calc(100vw - 448px));
    width: min(420px, calc(100vw - 28px));
    max-width: calc(100vw - 28px);
    height: calc(100dvh - 28px);
    max-height: calc(100vh - 28px);
    opacity: 0;
    pointer-events: none;
    transform: translateZ(0);
    will-change: opacity, transform;
    transition: opacity 0.22s ease;
}

.settings-panel {
    position: absolute;
    top: 14px;
    left: min(448px, calc(100vw - 448px));
    right: 14px;
    height: calc(100dvh - 28px);
    max-height: calc(100vh - 28px);
    opacity: 0;
    pointer-events: none;
    transform: translateZ(0);
    will-change: opacity, transform;
    transition: opacity 0.22s ease;
}

.disk-picker.is-open,
.settings-panel.is-open {
    opacity: 1;
    pointer-events: auto;
}

.disk-picker__panel,
.settings-panel__panel {
    width: 100%;
    height: 100%;
    border-radius: 24px;
    border: 1px solid var(--card-border);
    background: rgba(18, 18, 20, 0.96);
    box-shadow: var(--dropdown-shadow);
    overflow: hidden;
    will-change: transform, opacity;
    backface-visibility: hidden;
    contain: paint;
    transition: transform 0.24s ease, background-color 0.24s ease, border-color 0.24s ease;
}

.disk-picker__panel {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    transform: translate3d(-16px, 0, 0);
}

.settings-panel__panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    transform: translate3d(16px, 0, 0);
}

.disk-picker.is-open .disk-picker__panel,
.settings-panel.is-open .settings-panel__panel {
    transform: translate3d(0, 0, 0);
}

.profile-drawer.is-open .profile-drawer__panel {
    transform: translateX(0);
}

.profile-drawer__header,
.disk-picker__header,
.settings-panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 24px 12px;
}

.profile-drawer__eyebrow {
    margin: 0 0 8px;
    font-size: 0.76rem;
    color: var(--muted-color);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.profile-drawer__title {
    margin: 0;
    font-size: 1.7rem;
    color: var(--text-color);
}

.disk-picker__title {
    margin: 0;
    font-size: 1.35rem;
    color: var(--text-color);
}

.disk-attach-card {
    width: 100%;
    min-height: 58px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--control-border);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    box-sizing: border-box;
    min-width: 0;
}

.disk-attach-card.is-attached {
    border-color: rgba(116, 226, 141, 0.32);
    background: rgba(116, 226, 141, 0.06);
}

.disk-attach-card.is-unavailable {
    opacity: 0.56;
}

.disk-attach-card__copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.disk-attach-card__name {
    font-size: 0.96rem;
    font-weight: 700;
    color: var(--text-color);
}

.disk-attach-card__hint {
    font-size: 0.8rem;
    color: var(--muted-color);
    line-height: 1.35;
}

.disk-attach-card__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.disk-attach-card__action {
    min-width: 30px;
    height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(116, 226, 141, 0.32);
    color: #74e28d;
    background: rgba(116, 226, 141, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.disk-attach-card__action:hover:not(:disabled) {
    border-color: rgba(116, 226, 141, 0.5);
    background: rgba(116, 226, 141, 0.14);
}

.disk-attach-card__action:disabled {
    cursor: default;
    opacity: 0.72;
}

.disk-attach-card__action--secondary {
    border-color: rgba(255, 255, 255, 0.18);
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.06);
}

.disk-attach-card__action--secondary:hover:not(:disabled) {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
}

.disk-attach-card__action--danger {
    border-color: rgba(255, 90, 95, 0.28);
    color: #ff5a5f;
    background: rgba(255, 90, 95, 0.08);
}

.disk-attach-card__action--danger:hover:not(:disabled) {
    border-color: rgba(255, 90, 95, 0.5);
    background: rgba(255, 90, 95, 0.14);
}

.settings-panel__title {
    margin: 0;
    font-size: 1.35rem;
    color: var(--text-color);
}

.profile-drawer__close,
.disk-picker__close,
.settings-panel__close,
.profile-toggle,
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    border: 1px solid var(--control-border);
    background: var(--control-bg);
    color: var(--muted-color);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    position: relative;
    box-shadow: var(--control-shadow);
    transition: background-color 0.24s ease, border-color 0.24s ease, color 0.24s ease, transform 0.24s ease, box-shadow 0.24s ease, opacity 0.2s ease;
}

.profile-drawer__close:hover,
.disk-picker__close:hover,
.settings-panel__close:hover,
.profile-toggle:hover,
.theme-toggle:hover {
    color: var(--text-color);
    transform: translateY(-1px);
}

.profile-toggle.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.profile-drawer.is-open + .top-controls .profile-toggle {
    opacity: 0;
    pointer-events: none;
}

.profile-toggle-icon,
.profile-drawer__close svg,
.disk-picker__close svg,
.settings-panel__close svg {
    width: 17px;
    height: 17px;
}

.settings-panel__body {
    padding: 0 24px 24px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    overflow-y: auto;
    min-height: 0;
}

.settings-section {
    border: 1px solid var(--control-border);
    background: var(--control-bg);
    border-radius: 18px;
    padding: 18px;
    box-shadow: var(--profile-surface-shadow);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.settings-section--wide {
    grid-column: 1 / -1;
}

.settings-section--placeholder {
    min-height: 100%;
    opacity: 0.28;
}

.settings-section__head {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.settings-section__head--compact {
    gap: 0;
}

.settings-section__eyebrow {
    margin: 0;
    font-size: 0.74rem;
    color: var(--muted-color);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.settings-section__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-color);
}

.settings-grid {
    display: grid;
    gap: 10px;
}

.settings-grid--chips {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-chip {
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--control-border);
    background: rgba(255, 255, 255, 0.02);
    color: var(--muted-color);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.settings-chip.is-active {
    border-color: var(--control-hover-border);
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.05);
}

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-top: 1px solid var(--separator-color);
}

.settings-row:first-child {
    border-top: 0;
    padding-top: 0;
}

.settings-row:last-child {
    padding-bottom: 0;
}

.settings-row__actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.settings-row__title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
}

.settings-row__hint {
    margin-top: 4px;
    font-size: 0.8rem;
    color: var(--muted-color);
    line-height: 1.4;
}

.settings-badge {
    flex-shrink: 0;
    max-width: min(100%, 240px);
    padding: 7px 11px;
    border-radius: 999px;
    border: 1px solid var(--control-border);
    background: rgba(255, 255, 255, 0.02);
    color: var(--muted-color);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.settings-badge.is-on {
    color: var(--text-color);
    border-color: var(--control-hover-border);
}

.settings-action {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--control-border);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-color);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.settings-action:hover {
    border-color: var(--control-hover-border);
    color: var(--control-hover-color);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-1px);
}

.settings-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.settings-summary--compact {
    grid-template-columns: minmax(0, 180px);
}

.settings-summary__item {
    border: 1px solid var(--control-border);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-summary__label {
    font-size: 0.76rem;
    color: var(--muted-color);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.settings-summary__value {
    font-size: 0.96rem;
    font-weight: 700;
    color: var(--text-color);
}

.settings-workspace-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.settings-workspace-disk {
    border: 1px solid var(--control-border);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-workspace-disk__name {
    font-size: 0.96rem;
    font-weight: 700;
    color: var(--text-color);
}

.settings-workspace-disk__usage {
    font-size: 0.84rem;
    color: var(--muted-color);
}

.settings-workspace-disk__plan {
    font-size: 0.78rem;
    color: var(--muted-color);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.disk-picker__meta {
    padding: 0 24px 14px;
    color: var(--muted-color);
    font-size: 0.86rem;
}

.disk-picker__list {
    padding: 2px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    min-height: 0;
}

.disk-picker__list--attach {
    padding-bottom: 10px;
}

.disk-plan {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-radius: 16px;
    border: 1px solid var(--control-border);
    background: var(--control-bg);
    color: var(--text-color);
    text-decoration: none;
    box-shadow: var(--profile-surface-shadow);
    transition: border-color 0.22s ease, transform 0.22s ease, background-color 0.22s ease;
}

.disk-plan:hover {
    border-color: var(--control-hover-border);
    transform: translateY(-1px);
}

.disk-plan span:last-child {
    color: var(--muted-color);
    white-space: nowrap;
}

.profile-drawer__summary {
    padding: 0 18px 10px;
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    flex-direction: column;
    gap: 10px;
}

.profile-disk-list {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
}

.profile-disk-card__label {
    font-size: 0.76rem;
    color: var(--muted-color);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.profile-disk-card__heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 4px;
}

.profile-disk-card__quota {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-color);
}

.profile-disk-card__name {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-color);
}

.profile-disk-card__footer {
    margin-top: 3px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: nowrap;
}

.profile-disk-card__usage {
    margin-top: 0;
    color: var(--muted-color);
    font-size: 0.7rem;
    line-height: 1.2;
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
}

.profile-disk-tile {
    position: relative;
    border: 1px solid var(--control-border);
    background: var(--control-bg);
    border-radius: 12px;
    padding: 7px 9px;
    box-shadow: var(--profile-surface-shadow);
    transition: border-color 0.22s ease, background-color 0.22s ease;
}

.profile-disk-tile__main {
    width: 100%;
    text-align: left;
    font: inherit;
    color: var(--text-color);
    cursor: pointer;
    background: transparent;
    border: 0;
    padding: 0 30px 0 0;
}

.profile-disk-tile__main:disabled {
    cursor: default;
}

.profile-disk-tile__info {
    position: absolute;
    right: 9px;
    bottom: 7px;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-color);
    transition: border-color 0.22s ease, background-color 0.22s ease, transform 0.22s ease;
}

.profile-disk-tile__info:hover {
    border-color: rgba(255, 255, 255, 0.34);
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.profile-disk-tile__info svg {
    width: 10px;
    height: 10px;
    display: block;
}

body[data-theme="light"] .profile-disk-tile__info {
    border-color: rgba(17, 17, 17, 0.22);
    background: rgba(17, 17, 17, 0.03);
    color: #111;
}

body[data-theme="light"] .profile-disk-tile__info:hover {
    border-color: rgba(17, 17, 17, 0.42);
    background: rgba(17, 17, 17, 0.08);
}

.profile-upload-card {
    margin: 0 18px 12px;
    border: 1px solid rgba(255, 153, 61, 0.34);
    background: color-mix(in srgb, var(--control-bg) 92%, #ff9d3d 8%);
    border-radius: 18px;
    padding: 18px;
    box-shadow: var(--profile-surface-shadow);
    cursor: pointer;
    align-self: stretch;
    text-align: left;
    font: inherit;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color 0.22s ease, background-color 0.22s ease, transform 0.22s ease;
}

.profile-upload-card:hover,
.profile-upload-card.is-dragover {
    border-color: rgba(255, 153, 61, 0.56);
    background: color-mix(in srgb, var(--control-bg) 86%, #ff9d3d 14%);
    transform: translateY(-1px);
}

.profile-upload-card--link {
    border-color: rgba(109, 168, 255, 0.32);
    background: color-mix(in srgb, var(--control-bg) 92%, #6da8ff 8%);
}

.profile-upload-card--link:hover {
    border-color: rgba(109, 168, 255, 0.56);
    background: color-mix(in srgb, var(--control-bg) 86%, #6da8ff 14%);
    transform: translateY(-1px);
}

.profile-upload-card--link .profile-upload-card__icon,
.profile-upload-card__icon--link {
    color: #8ab9ff;
    background: rgba(109, 168, 255, 0.12);
}

.profile-upload-card__heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.profile-upload-card__body {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.profile-upload-card__icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffb15c;
    background: rgba(255, 157, 61, 0.12);
    flex-shrink: 0;
}

.profile-upload-card__icon svg {
    width: 18px;
    height: 18px;
}

.profile-upload-card__copy {
    min-width: 0;
    flex: 1;
    text-align: left;
}

.profile-upload-card__hint {
    font-size: 0.82rem;
    color: var(--muted-color);
}

.profile-upload-card__title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-color);
}

.profile-upload-card__status {
    margin-top: 8px;
    color: var(--muted-color);
    font-size: 0.92rem;
}

.profile-upload-card__status.is-error {
    color: #ff6b6b;
}

.profile-disk-list.is-hidden,
.profile-upload-card.is-hidden {
    display: none;
}

.upload-queue {
    display: none;
    flex-direction: column;
    gap: 10px;
}

.upload-queue.is-active {
    display: flex;
}

.upload-queue--card {
    margin-top: 14px;
}

.upload-item {
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 153, 61, 0.18);
    background: rgba(255, 157, 61, 0.06);
}

.upload-item.is-error {
    border-color: rgba(255, 90, 95, 0.28);
    background: rgba(255, 90, 95, 0.08);
}

.upload-item--link {
    border-color: rgba(109, 168, 255, 0.2);
    background: rgba(109, 168, 255, 0.08);
}

.upload-item--link .upload-item__bar {
    background: linear-gradient(90deg, #6da8ff, #9fd0ff);
}

.upload-item__bar.is-indeterminate {
    width: 42%;
    animation: uploadIndeterminate 1.1s ease-in-out infinite;
}

@keyframes uploadIndeterminate {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(260%); }
}

.upload-item__meta,
.upload-item__submeta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.upload-item__meta {
    margin-bottom: 6px;
}

.upload-item__submeta {
    margin-bottom: 8px;
    font-size: 0.78rem;
    color: var(--muted-color);
}

.upload-item__name,
.upload-item__detail {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-item__name {
    color: var(--text-color);
    font-size: 0.84rem;
    font-weight: 600;
}

.upload-item__detail {
    color: var(--muted-color);
    font-size: 0.78rem;
    text-align: right;
}

.upload-item__track {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

body[data-theme="light"] .upload-item__track {
    background: rgba(17, 17, 17, 0.1);
}

.upload-item__bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ff9d3d, #ffcf76);
    transition: width 0.18s ease;
}

.upload-item.is-error .upload-item__bar {
    background: linear-gradient(90deg, #ff5a5f, #ff8b8f);
}

.upload-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
    z-index: 250;
}

body[data-theme="light"] .upload-modal {
    background: rgba(17, 17, 17, 0.12);
}

.upload-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.upload-modal__card {
    width: min(100%, 320px);
    min-height: 320px;
    border-radius: 24px;
    border: 1px solid rgba(255, 153, 61, 0.34);
    background: color-mix(in srgb, var(--control-bg) 92%, #ff9d3d 8%);
    box-shadow: var(--dropdown-shadow);
    padding: 24px 22px 22px;
    display: flex;
    flex-direction: column;
    text-align: center;
    position: relative;
    transition: border-color 0.22s ease, background-color 0.22s ease, transform 0.22s ease;
}

.upload-modal__card.is-dragover {
    border-color: rgba(255, 153, 61, 0.58);
    background: color-mix(in srgb, var(--control-bg) 86%, #ff9d3d 14%);
    transform: translateY(-1px);
}

.upload-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    border: 1px solid var(--control-border);
    background: var(--control-bg);
    color: var(--muted-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: background-color 0.24s ease, border-color 0.24s ease, color 0.24s ease, transform 0.24s ease, box-shadow 0.24s ease;
}

.upload-modal__close:hover {
    color: var(--text-color);
    border-color: var(--control-hover-border);
    box-shadow: var(--control-shadow);
    transform: translateY(-1px);
}

.upload-modal__close svg {
    width: 15px;
    height: 15px;
}

.upload-modal__content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 10px;
}

.upload-modal__footer {
    margin-top: auto;
}

.upload-modal__icon {
    width: 68px;
    height: 68px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffb15c;
    background: rgba(255, 157, 61, 0.12);
    margin-bottom: 18px;
}

.upload-modal__icon svg {
    width: 30px;
    height: 30px;
}

.upload-modal__title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-color);
}

.upload-modal__field,
.upload-link-modal__field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.upload-modal__field-label,
.upload-link-modal__field-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted-color);
}

.upload-modal__select,
.upload-link-modal__select,
.app-dialog__select {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--control-border);
    background-color: var(--control-bg);
    color: var(--text-color);
    border-radius: 12px;
    padding: 10px 38px 10px 14px;
    font: inherit;
    box-sizing: border-box;
    outline: none;
}

.custom-select {
    position: relative;
    width: 100%;
}

.custom-select__native {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
    appearance: none;
    -webkit-appearance: none;
    overflow: hidden;
    clip-path: inset(50%);
}

.custom-select__trigger {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--control-border);
    background: var(--control-bg);
    color: var(--text-color);
    border-radius: 12px;
    padding: 10px 38px 10px 14px;
    font: inherit;
    text-align: left;
    box-sizing: border-box;
    cursor: pointer;
    position: relative;
}

.custom-select__trigger::after {
    content: '';
    position: absolute;
    right: 14px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 1.5px solid var(--muted-color);
    border-bottom: 1.5px solid var(--muted-color);
    transform: translateY(-60%) rotate(45deg);
}

.custom-select__menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    border-radius: 14px;
    border: 1px solid var(--control-border);
    background: rgba(18, 18, 20, 0.98);
    box-shadow: var(--dropdown-shadow);
    z-index: 40;
}

.custom-select.is-open .custom-select__menu {
    display: flex;
}

.custom-select.is-open .custom-select__trigger,
.custom-select__trigger:hover,
.custom-select__trigger:focus-visible {
    border-color: var(--control-hover-border);
}

.custom-select__option {
    min-height: 40px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-color);
    font: inherit;
    text-align: left;
    padding: 0 12px;
    cursor: pointer;
}

.custom-select__option:hover,
.custom-select__option.is-selected {
    border-color: var(--control-border);
    background: rgba(255, 255, 255, 0.04);
}

.custom-select__option.is-selected {
    position: relative;
    padding-left: 34px;
}

.custom-select__option.is-selected::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 50%;
    width: 7px;
    height: 12px;
    border-right: 2px solid var(--text-color);
    border-bottom: 2px solid var(--text-color);
    transform: translateY(-58%) rotate(45deg);
}

.upload-modal__subtitle {
    margin-top: 10px;
    color: var(--muted-color);
    font-size: 0.96rem;
    max-width: 220px;
}

.upload-link-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
    z-index: 520;
}

body[data-theme="light"] .upload-link-modal {
    background: rgba(17, 17, 17, 0.12);
}

.upload-link-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.upload-link-modal__card {
    width: min(100%, 360px);
    border-radius: 24px;
    border: 1px solid rgba(109, 168, 255, 0.32);
    background: color-mix(in srgb, var(--control-bg) 92%, #6da8ff 8%);
    box-shadow: var(--dropdown-shadow);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
}

.upload-link-modal__content {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-top: 22px;
}

.upload-link-modal__footer {
    margin-top: auto;
}

.upload-link-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    border: 1px solid var(--control-border);
    background: var(--control-bg);
    color: var(--muted-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: background-color 0.24s ease, border-color 0.24s ease, color 0.24s ease, transform 0.24s ease, box-shadow 0.24s ease;
}

.upload-link-modal__close:hover {
    color: var(--text-color);
    border-color: var(--control-hover-border);
    box-shadow: var(--control-shadow);
    transform: translateY(-1px);
}

.upload-link-modal__close svg {
    width: 15px;
    height: 15px;
}

.upload-link-modal__icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #8ab9ff;
    background: rgba(109, 168, 255, 0.12);
}

.upload-link-modal__icon svg {
    width: 24px;
    height: 24px;
}

.upload-link-modal__title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-top: 2px;
}

.upload-link-modal__input {
    width: 100%;
    border: 1px solid var(--control-border);
    background: var(--control-bg);
    color: var(--text-color);
    border-radius: 12px;
    padding: 13px 14px;
    font: inherit;
    box-sizing: border-box;
    outline: none;
}

.upload-link-modal__input:focus {
    border-color: rgba(109, 168, 255, 0.56);
}

.upload-link-modal__submit {
    border: 1px solid rgba(109, 168, 255, 0.42);
    background: rgba(109, 168, 255, 0.14);
    color: #8ab9ff;
    border-radius: 12px;
    padding: 12px 14px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
}

.upload-link-modal__note {
    color: var(--muted-color);
    font-size: 0.86rem;
    line-height: 1.4;
}

.file-info-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
    z-index: 255;
}

body[data-theme="light"] .file-info-modal {
    background: rgba(17, 17, 17, 0.12);
}

.file-info-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.file-info-modal__card {
    width: min(100%, 420px);
    border-radius: 22px;
    border: 1px solid var(--control-border);
    background: var(--control-bg);
    box-shadow: var(--dropdown-shadow);
    padding: 22px;
    position: relative;
}

.file-info-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    border: 1px solid var(--control-border);
    background: var(--control-bg);
    color: var(--muted-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: background-color 0.24s ease, border-color 0.24s ease, color 0.24s ease, transform 0.24s ease, box-shadow 0.24s ease;
}

.file-info-modal__close:hover {
    color: var(--text-color);
    border-color: var(--control-hover-border);
    box-shadow: var(--control-shadow);
    transform: translateY(-1px);
}

.file-info-modal__close svg {
    width: 15px;
    height: 15px;
}

.file-info-modal__icon {
    width: 54px;
    height: 64px;
    margin-bottom: 14px;
}

.file-info-modal__title {
    font-size: 1.28rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 16px;
    padding-right: 44px;
    word-break: break-word;
}

.file-info-modal__meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.file-info-modal__meta {
    border: 1px solid var(--control-border);
    background: color-mix(in srgb, var(--control-bg) 92%, transparent 8%);
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.file-info-modal__meta--full {
    grid-column: 1 / -1;
}

.file-info-modal__label {
    color: var(--muted-color);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.file-info-modal__value {
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: 600;
    word-break: break-word;
}

.file-info-modal__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.file-info-modal__action {
    min-height: 42px;
    border-radius: 12px;
    border: 1px solid var(--control-border);
    background: var(--control-bg);
    color: var(--text-color);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.22s ease, color 0.22s ease, background-color 0.22s ease;
}

.file-info-modal__action--success {
    color: #74e28d;
}

.file-info-modal__action--link {
    color: #6da8ff;
}

.file-info-modal__action--move {
    color: #ffb952;
}

.file-info-modal__action--archive {
    color: #ff6db3;
}

.file-info-modal__action--danger {
    color: #ff5a5f;
}

.file-info-modal__action:hover {
    border-color: var(--control-hover-border);
}

.file-info-modal__action--success:hover {
    border-color: rgba(116, 226, 141, 0.42);
    color: #74e28d;
}

.file-info-modal__action--link:hover {
    border-color: rgba(109, 168, 255, 0.42);
    color: #6da8ff;
}

.file-info-modal__action--move:hover {
    border-color: rgba(255, 185, 82, 0.42);
    color: #ffb952;
}

.file-info-modal__action--archive:hover {
    border-color: rgba(255, 109, 179, 0.42);
    color: #ff6db3;
}

.file-info-modal__action--danger:hover {
    border-color: rgba(255, 90, 95, 0.42);
    color: #ff5a5f;
}

.disk-info-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.56);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    z-index: 2550;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s ease;
}

.disk-info-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.disk-info-modal__card {
    position: relative;
    width: min(100%, 420px);
    border-radius: 22px;
    border: 1px solid var(--control-border);
    background: var(--control-bg);
    box-shadow: var(--dropdown-shadow);
    padding: 22px 20px 20px;
    box-sizing: border-box;
}

.disk-info-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 14px;
    border: 1px solid var(--control-border);
    background: rgba(255, 255, 255, 0.02);
    color: var(--muted-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.disk-info-modal__close:hover {
    color: var(--text-color);
    border-color: var(--control-hover-border);
}

.disk-info-modal__close svg {
    width: 15px;
    height: 15px;
}

.disk-info-modal__eyebrow {
    color: var(--muted-color);
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.disk-info-modal__title {
    margin-top: 10px;
    color: var(--text-color);
    font-size: 1.2rem;
    font-weight: 700;
    padding-right: 44px;
}

.disk-info-modal__meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
    margin-bottom: 18px;
}

.disk-info-modal__meta {
    border: 1px solid var(--control-border);
    background: color-mix(in srgb, var(--control-bg) 92%, transparent 8%);
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    box-sizing: border-box;
}

.disk-info-modal__meta--full {
    grid-column: 1 / -1;
}

.disk-info-modal__label {
    color: var(--muted-color);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.disk-info-modal__value {
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: 600;
    word-break: break-word;
}

.disk-info-modal__actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.disk-info-modal__action {
    min-height: 42px;
    border-radius: 12px;
    border: 1px solid var(--control-border);
    background: var(--control-bg);
    color: var(--text-color);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.22s ease, color 0.22s ease, background-color 0.22s ease;
}

.disk-info-modal__action--success {
    color: #74e28d;
}

.disk-info-modal__action--link {
    color: #6da8ff;
}

.disk-info-modal__action--danger {
    color: #ff5a5f;
}

.disk-info-modal__action:hover {
    border-color: var(--control-hover-border);
}

.disk-info-modal__action--success:hover {
    border-color: rgba(116, 226, 141, 0.42);
}

.disk-info-modal__action--link:hover {
    border-color: rgba(109, 168, 255, 0.42);
}

.disk-info-modal__action--danger:hover {
    border-color: rgba(255, 90, 95, 0.42);
}

.app-dialog {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.56);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    z-index: 2600;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s ease;
}

.app-dialog.is-open {
    opacity: 1;
    pointer-events: auto;
}

.app-dialog__card {
    position: relative;
    width: min(100%, 420px);
    border-radius: 22px;
    border: 1px solid var(--control-border);
    background: var(--control-bg);
    box-shadow: var(--dropdown-shadow);
    padding: 22px 20px 20px;
}

.app-dialog__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 14px;
    border: 1px solid var(--control-border);
    background: rgba(255, 255, 255, 0.02);
    color: var(--muted-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.app-dialog__close:hover {
    color: var(--text-color);
    border-color: var(--control-hover-border);
}

.app-dialog__close svg {
    width: 15px;
    height: 15px;
}

.app-dialog__eyebrow {
    color: var(--muted-color);
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.app-dialog__eyebrow.is-hidden {
    display: none;
}

.app-dialog__eyebrow.is-hidden + .app-dialog__title {
    margin-top: 0;
}

.app-dialog__title {
    margin-top: 0;
    color: var(--text-color);
    font-size: 1.2rem;
    font-weight: 700;
}

.app-dialog__copy {
    margin-top: 8px;
    color: var(--muted-color);
    font-size: 0.92rem;
    line-height: 1.45;
}

.app-dialog__copy strong {
    color: var(--text-color);
    font-weight: 700;
}

.app-dialog__fields {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.app-dialog__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.app-dialog__label {
    color: var(--muted-color);
    font-size: 0.78rem;
    font-weight: 600;
}

.app-dialog__input {
    width: 100%;
    min-height: 44px;
    border-radius: 14px;
    border: 1px solid var(--control-border);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-color);
    font: inherit;
    padding: 0 14px;
    outline: none;
    box-sizing: border-box;
}

.app-dialog__input:focus {
    border-color: var(--control-hover-border);
}

.app-dialog__input[readonly] {
    color: var(--muted-color);
}

.app-dialog__textarea {
    min-height: 220px;
    resize: vertical;
    padding: 14px;
    line-height: 1.45;
}

.app-dialog__actions {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.app-dialog__btn {
    min-height: 42px;
    border-radius: 12px;
    border: 1px solid var(--control-border);
    background: var(--control-bg);
    color: var(--text-color);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.app-dialog__btn:hover {
    border-color: var(--control-hover-border);
    color: var(--control-hover-color);
}

.app-dialog__btn--primary {
    border-color: rgba(109, 168, 255, 0.32);
    background: rgba(109, 168, 255, 0.1);
    color: #8ab9ff;
}

.app-dialog__btn--accent {
    border-color: rgba(255, 187, 82, 0.34);
    background: rgba(255, 187, 82, 0.12);
    color: #ffb952;
}

.app-dialog__btn--archive {
    border-color: rgba(255, 109, 179, 0.34);
    background: rgba(255, 109, 179, 0.12);
    color: #ff6db3;
}

.app-dialog__btn--danger {
    border-color: rgba(255, 90, 95, 0.32);
    background: rgba(255, 90, 95, 0.1);
    color: #ff5a5f;
}

.app-dialog__btn--danger:disabled {
    border-color: rgba(255, 90, 95, 0.2);
    background: rgba(255, 90, 95, 0.08);
    color: rgba(255, 90, 95, 0.5);
    opacity: 1;
}

.upload-dock-stack {
    position: fixed;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    width: min(92vw, 720px);
    display: none;
    flex-direction: column;
    gap: 10px;
    z-index: 260;
}

.upload-dock-stack.is-active {
    display: flex;
}

.upload-dock {
    width: 100%;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(255, 153, 61, 0.24);
    background: color-mix(in srgb, var(--control-bg) 94%, #ff9d3d 6%);
    box-shadow: var(--dropdown-shadow);
    backdrop-filter: blur(18px);
    display: none;
    transition: transform 0.26s ease, opacity 0.26s ease;
}

.upload-dock.is-active {
    display: block;
}

.upload-dock.is-hiding {
    opacity: 0;
    transform: translateY(24px);
}

.upload-dock--link {
    border-color: rgba(109, 168, 255, 0.28);
    background: color-mix(in srgb, var(--control-bg) 94%, #6da8ff 6%);
}

.upload-dock--archive {
    border-color: rgba(255, 109, 179, 0.28);
    background: color-mix(in srgb, var(--control-bg) 94%, #ff6db3 6%);
}

.upload-dock__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.upload-dock__header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.upload-dock__title {
    color: var(--text-color);
    font-weight: 600;
}

.upload-dock__summary {
    color: var(--muted-color);
    font-size: 0.82rem;
}

.upload-dock__cancel {
    border: 1px solid rgba(255, 90, 95, 0.22);
    background: rgba(255, 90, 95, 0.08);
    color: #ff7b80;
    border-radius: 10px;
    height: 30px;
    padding: 0 10px;
    font: inherit;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.22s ease, background-color 0.22s ease, color 0.22s ease, opacity 0.22s ease;
}

.upload-dock__cancel:hover:not(:disabled) {
    border-color: rgba(255, 90, 95, 0.4);
    background: rgba(255, 90, 95, 0.14);
    color: #ff9b9f;
}

.upload-dock__cancel:disabled {
    opacity: 0.45;
    cursor: default;
}

.upload-dock--link .upload-dock__title,
.upload-dock--link .upload-dock__summary {
    color: color-mix(in srgb, var(--text-color) 82%, #6da8ff 18%);
}

.upload-dock--archive .upload-dock__title,
.upload-dock--archive .upload-dock__summary {
    color: color-mix(in srgb, var(--text-color) 82%, #ff6db3 18%);
}

.upload-dock--archive .upload-item__bar {
    background: linear-gradient(90deg, #ff6db3, #ff95c9);
}

.upload-queue--global {
    max-height: min(32vh, 260px);
    overflow-y: auto;
    transition: transform 0.26s ease, opacity 0.26s ease;
}

.upload-queue--global.is-hiding {
    opacity: 0;
    transform: translateY(24px);
}

.profile-add-disk {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
    isolation: isolate;
    border: 1px solid rgba(92, 214, 128, 0.28);
    background: rgba(92, 214, 128, 0.08);
    color: #74e28d;
    border-radius: 16px;
    padding: 15px 18px;
    text-align: left;
    font: inherit;
    cursor: pointer;
    box-shadow: var(--profile-surface-shadow);
    transition: border-color 0.22s ease, background-color 0.22s ease, color 0.22s ease, box-shadow 0.22s ease;
}

.profile-add-disk:hover {
    border-color: rgba(92, 214, 128, 0.46);
    background: rgba(92, 214, 128, 0.12);
    box-shadow: 0 0 0 1px rgba(92, 214, 128, 0.08), var(--profile-surface-shadow);
}

.profile-add-disk__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    font-weight: 500;
    line-height: 1;
    flex-shrink: 0;
    transform: translateY(-0.5px);
}

.profile-add-disk__label {
    font-weight: 600;
}

.profile-drawer__actions {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 12px;
    padding: 12px 18px 0;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.profile-link {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    position: relative;
    z-index: 0;
    box-sizing: border-box;
    border: 1px solid var(--control-border);
    background: var(--control-bg);
    color: var(--text-color);
    border-radius: 16px;
    padding: 16px 18px;
    text-align: left;
    text-decoration: none;
    font: inherit;
    cursor: pointer;
    box-shadow: var(--profile-surface-shadow);
    transition: border-color 0.22s ease, color 0.22s ease, transform 0.22s ease, background-color 0.22s ease, box-shadow 0.22s ease;
}

.profile-link:hover {
    border-color: var(--control-hover-border);
    transform: translateY(-1px);
    z-index: 1;
}

.profile-link__icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--muted-color);
    flex-shrink: 0;
}

.profile-link__icon svg {
    width: 18px;
    height: 18px;
}

.profile-link:hover .profile-link__icon {
    color: var(--control-hover-color);
}

.profile-link--support .profile-link__icon {
    color: #6da8ff;
}

.profile-link--danger .profile-link__icon,
.profile-link--danger {
    color: #ff5a5f;
}

.profile-drawer__footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px 18px 18px;
    margin-top: auto;
}

.profile-link--danger {
    color: #ff5a5f;
}

.auth-card h2 {
    margin: 0;
    font-size: 1.35rem;
    color: var(--text-color);
}

.auth-card input {
    width: 100%;
    border: 1px solid var(--control-border);
    background: var(--control-bg);
    color: var(--text-color);
    border-radius: 12px;
    padding: 13px 14px;
    font: inherit;
    box-sizing: border-box;
    outline: none;
}

.auth-card input:focus {
    border-color: var(--control-hover-border);
}

.auth-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.auth-buttons--single {
    grid-template-columns: 1fr;
}

.auth-buttons button {
    border: 1px solid var(--control-hover-border);
    background: var(--text-color);
    color: var(--bg-color);
    border-radius: 12px;
    padding: 12px 14px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.auth-buttons button:hover {
    transform: translateY(-1px);
}

.auth-buttons .secondary {
    background: transparent;
    color: var(--text-color);
    border-color: var(--control-border);
}

.auth-switch {
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted-color);
}

.auth-switch__link {
    border: 0;
    background: transparent;
    color: var(--text-color);
    font: inherit;
    font-weight: 600;
    padding: 0;
    cursor: pointer;
}

.empty-state {
    width: min(100%, 420px);
    margin: 36px auto 0;
    padding: 22px 20px;
    border-radius: 20px;
    border: 1px solid var(--control-border);
    background: var(--control-bg);
    box-shadow: var(--profile-surface-shadow);
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: center;
}

.empty-state__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-color);
}

.empty-state__copy {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--muted-color);
}

.error-msg {
    min-height: 18px;
    margin: 0;
    font-size: 0.85rem;
    color: #ff6b6b;
}


.theme-toggle-icon {
    position: absolute;
    width: 17px;
    height: 17px;
    transition: opacity 0.24s ease, transform 0.24s ease;
}

.theme-toggle-sun {
    opacity: 0;
    transform: scale(0.8) rotate(-20deg);
}

.theme-toggle-moon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

body[data-theme="light"] .theme-toggle-sun {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

body[data-theme="light"] .theme-toggle-moon {
    opacity: 0;
    transform: scale(0.8) rotate(20deg);
}

.app-shell {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

header { margin: 18px 0 14px; flex-shrink: 0; z-index: 20; }
h1 { 
    font-size: clamp(2.5rem, 7vw, 3.5rem); font-weight: 900; margin: 0; 
    background: var(--accent-gradient); background-size: 400% 400%;
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    animation: gradientFlow 10s infinite linear;
}

@keyframes gradientFlow { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }


.search-container {
    width: 95%;
    max-width: 860px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    z-index: 100;
    position: relative;
}

.upload-actions-panel {
    width: 95%;
    max-width: 860px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.upload-action-block {
    width: 100%;
    min-height: 44px;
    border-radius: 12px;
    border: 1px solid var(--control-border);
    background: var(--control-bg);
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    box-sizing: border-box;
    text-align: left;
    font: inherit;
    cursor: pointer;
    transition: background-color 0.24s ease, border-color 0.24s ease, color 0.24s ease, box-shadow 0.2s ease;
}

.upload-action-block__icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.upload-action-block__copy {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.upload-action-block__title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-color);
}

.upload-action-block__hint {
    font-size: 0.74rem;
    color: var(--muted-color);
}

.upload-action-block--files {
    color: #ffb15c;
    border-color: rgba(255, 153, 61, 0.32);
    background: color-mix(in srgb, var(--control-bg) 92%, #ff9d3d 8%);
}

.upload-action-block--link {
    color: #6da8ff;
    border-color: rgba(109, 168, 255, 0.32);
    background: color-mix(in srgb, var(--control-bg) 92%, #6da8ff 8%);
}

.search-wrapper {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}
.search-wrapper input {
    width: 100%; height: 48px; background: var(--control-bg); border: 1px solid var(--control-border); border-radius: 12px;
    padding: 14px 45px 14px 20px; color: var(--text-color); outline: none; font-size: 1rem; box-sizing: border-box;
    transition: background-color 0.24s ease, border-color 0.24s ease, color 0.24s ease;
}
.search-icon { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; fill: var(--search-icon-color); }

.filter-dropdown {
    position: relative;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.back-btn,
.create-text-btn,
.create-folder-btn,
.select-btn {
    background: var(--control-bg);
    border: 1px solid var(--control-border);
    border-radius: 12px;
    width: 48px;
    height: 48px;
    cursor: pointer;
    color: var(--muted-color);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    transition: background-color 0.24s ease, border-color 0.24s ease, color 0.24s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.create-text-btn .control-icon {
    width: 18px;
    height: 18px;
}

.back-btn.is-hidden {
    display: none;
}

.filter-dropdown::before {
    content: none;
}

.filter-btn {
    background: var(--control-bg); border: 1px solid var(--control-border); border-radius: 12px;
    width: 48px; height: 48px; cursor: pointer; color: var(--muted-color); display: flex; align-items: center; justify-content: center;
    transition: background-color 0.24s ease, border-color 0.24s ease, color 0.24s ease, transform 0.2s ease; padding: 0; flex-shrink: 0;
}
.control-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.control-icon circle {
    fill: currentColor;
    stroke: none;
}

/* Control states */
.back-btn:hover,
.create-text-btn:hover,
.create-folder-btn:hover,
.select-btn:hover,
.select-btn.is-active,
.filter-btn:hover {
    color: var(--control-hover-color);
    border-color: var(--control-hover-border);
    box-shadow: var(--control-shadow);
}

.upload-action-block--files:hover,
.upload-action-block--files.is-active {
    color: #ffc57d;
    border-color: rgba(255, 153, 61, 0.52);
    box-shadow: var(--control-shadow);
}

.upload-action-block--link:hover,
.upload-action-block--link.is-active {
    color: #8ab9ff;
    border-color: rgba(109, 168, 255, 0.52);
    box-shadow: var(--control-shadow);
}

.filter-content {
    position: absolute;
    top: 0;
    left: calc(100% + 10px);
    right: auto;
    width: 220px;
    max-width: min(76vw, 220px);
    min-height: 48px;
    background: var(--dropdown-bg);
    border: 1px solid var(--dropdown-border);
    border-radius: 14px;
    display: none;
    flex-direction: column;
    z-index: 40;
    box-shadow: var(--dropdown-shadow);
    padding: 9px;
    gap: 8px;
    box-sizing: border-box;
}

.filter-dropdown.is-open .filter-content {
    display: flex;
}

.filter-content::after {
    content: '';
    position: absolute;
    top: 16px;
    left: -6px;
    width: 10px;
    height: 10px;
    background: var(--dropdown-bg);
    border-left: 1px solid var(--dropdown-border);
    border-bottom: 1px solid var(--dropdown-border);
    transform: rotate(45deg);
}

.filter-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-section + .filter-section {
    padding-top: 10px;
    border-top: 1px solid var(--separator-color);
}

.filter-section__label {
    padding: 0 4px;
    font-size: 0.72rem;
    color: var(--muted-color);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sort-item,
.filter-chip {
    width: 100%;
    border: 1px solid var(--control-border);
    background: transparent;
    color: var(--muted-color);
    border-radius: 11px;
    padding: 8px 10px;
    font: inherit;
    font-size: 0.84rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    transition: color 0.2s, border-color 0.2s, background-color 0.2s;
    box-sizing: border-box;
}

.sort-item:hover,
.filter-chip:hover,
.sort-item.is-active,
.filter-chip.is-active {
    color: var(--control-hover-color);
    border-color: var(--control-hover-border);
    background: rgba(255, 255, 255, 0.03);
}

.arrow { color: var(--sort-arrow-color); font-family: monospace; }

.selection-bar {
    width: 95%;
    max-width: 648px;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding: 12px 14px;
    border: 1px solid var(--control-border);
    border-radius: 14px;
    background: var(--control-bg);
    box-shadow: var(--control-shadow);
    box-sizing: border-box;
}

.selection-bar.is-active {
    display: flex;
}

.selection-bar__count {
    color: var(--text-color);
    font-weight: 600;
}

.selection-bar__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.selection-bar__btn {
    border: 1px solid var(--control-border);
    background: transparent;
    color: var(--text-color);
    border-radius: 12px;
    padding: 10px 14px;
    font: inherit;
    cursor: pointer;
    transition: border-color 0.22s ease, color 0.22s ease, background-color 0.22s ease, opacity 0.22s ease;
}

.selection-bar__btn:hover:not(:disabled) {
    border-color: var(--control-hover-border);
}

.selection-bar__btn:disabled {
    opacity: 0.42;
    cursor: default;
}

.selection-bar__btn--archive {
    color: #ff6db3;
}

.selection-bar__btn--move {
    color: #ffb952;
}

.selection-bar__btn--archive:hover:not(:disabled) {
    border-color: rgba(255, 109, 179, 0.42);
    color: #ff6db3;
}

.selection-bar__btn--move:hover:not(:disabled) {
    border-color: rgba(255, 185, 82, 0.42);
    color: #ffb952;
}


.selection-bar__btn--success {
    color: #74e28d;
}

.selection-bar__btn--success:hover:not(:disabled) {
    color: #8bf0a2;
}

.selection-bar__btn--danger {
    color: #ff5a5f;
}

.main-content { width: 100%; flex: 1; overflow-y: auto; -webkit-mask-image: linear-gradient(to bottom, transparent 0, black 15px, black calc(100% - 40px), transparent 100%); }
.grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; padding: 12px 32px 100px; box-sizing: border-box; }

.item { 
    --glow-x: 50%;
    --glow-y: 50%;
    --glow-opacity: 0;
    width: 238px; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 16px; padding: 13px 11px 40px;
    text-decoration: none; color: var(--file-name-color); display: flex; align-items: center; gap: 10px; backdrop-filter: blur(20px);
    transition: border-color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease, background-color 0.22s ease;
    opacity: 1; position: relative; overflow: hidden;
}

.item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--glow-x) var(--glow-y), var(--item-glow-core), var(--item-glow-mid) 18%, rgba(255, 255, 255, 0) 42%);
    opacity: var(--glow-opacity);
    transition: opacity 0.22s ease;
    pointer-events: none;
}

.item > * {
    position: relative;
    z-index: 1;
}

.item:hover {
    border-color: var(--card-hover-border);
    box-shadow: var(--card-shadow);
    transform: translateY(-2px);
}

.item.is-selecting {
    cursor: pointer;
}

.item.is-pending {
    cursor: progress;
    pointer-events: auto;
}

.item.is-pending:hover {
    transform: none;
}

.item.is-pending::before {
    opacity: 0;
}

.item.is-remote-pending {
    border-color: rgba(109, 168, 255, 0.24);
    background: color-mix(in srgb, var(--card-bg) 90%, #6da8ff 10%);
}

.item.is-upload-pending {
    border-color: rgba(255, 153, 61, 0.26);
    background: color-mix(in srgb, var(--card-bg) 90%, #ff9d3d 10%);
}

body[data-theme="light"] .item.is-remote-pending {
    border-color: rgba(58, 120, 255, 0.34);
    background: color-mix(in srgb, #ffffff 88%, #6da8ff 12%);
}

body[data-theme="light"] .item.is-upload-pending {
    border-color: rgba(255, 153, 61, 0.34);
    background: color-mix(in srgb, #ffffff 88%, #ff9d3d 12%);
}

.item.is-selected {
    border-color: rgba(83, 146, 255, 0.56);
    background: color-mix(in srgb, var(--card-bg) 88%, #5392ff 12%);
    box-shadow: var(--card-shadow);
}

body[data-theme="light"] .item.is-selected {
    border-color: rgba(58, 120, 255, 0.64);
    background: color-mix(in srgb, #ffffff 80%, #3a78ff 20%);
    box-shadow: 0 0 0 1px rgba(58, 120, 255, 0.16), var(--card-shadow);
}

.item-check {
    display: none !important;
}

.item-pending {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: color-mix(in srgb, var(--bg-color) 52%, transparent 48%);
    backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
    z-index: 3;
}

body[data-theme="light"] .item-pending {
    background: color-mix(in srgb, #ffffff 64%, rgba(58, 120, 255, 0.22) 36%);
}

.item.is-upload-pending .item-pending {
    background: color-mix(in srgb, var(--bg-color) 56%, rgba(255, 157, 61, 0.34) 44%);
}

body[data-theme="light"] .item.is-upload-pending .item-pending {
    background: color-mix(in srgb, #ffffff 64%, rgba(255, 157, 61, 0.28) 36%);
}

.item.is-pending .item-pending {
    opacity: 1;
}

.item-pending__spinner {
    width: 18px;
    height: 18px;
    border: 2px solid color-mix(in srgb, var(--text-color) 18%, transparent 82%);
    border-top-color: color-mix(in srgb, var(--text-color) 86%, transparent 14%);
    border-radius: 999px;
    animation: itemSpin 0.85s linear infinite;
}

.item.is-remote-pending .item-pending__spinner {
    border-color: rgba(109, 168, 255, 0.22);
    border-top-color: #84b7ff;
}

.item.is-upload-pending .item-pending__spinner {
    border-color: rgba(255, 157, 61, 0.22);
    border-top-color: #ffb15c;
}

.item-pending__label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-color);
}

.item.is-remote-pending .item-pending__label {
    color: color-mix(in srgb, var(--text-color) 82%, #6da8ff 18%);
}

.item.is-upload-pending .item-pending__label {
    color: color-mix(in srgb, var(--text-color) 82%, #ff9d3d 18%);
}

@keyframes itemSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.item-actions {
    position: absolute;
    right: 9px;
    bottom: 9px;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
}

.item-info-action {
    position: absolute;
    left: 9px;
    bottom: 9px;
    z-index: 2;
}

.item-action {
    width: 26px;
    height: 26px;
    border: 1px solid var(--control-border);
    border-radius: 10px;
    background: color-mix(in srgb, var(--control-bg) 96%, transparent 4%);
    color: var(--muted-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: border-color 0.22s ease, color 0.22s ease, background-color 0.22s ease;
}

.item-action svg {
    width: 15px;
    height: 15px;
}

.item.is-pending .item-actions,
.item.is-pending .file-icon-wrapper,
.item.is-pending .file-info {
    opacity: 0.22;
}

.item-action:disabled {
    opacity: 0.45;
    cursor: default;
}

.item-action:hover:not(:disabled) {
    border-color: var(--control-hover-border);
    color: var(--control-hover-color);
}

.item-action[data-action="download"]:hover:not(:disabled) {
    color: #74e28d;
    border-color: rgba(116, 226, 141, 0.28);
}

.item-action[data-action="info"]:hover:not(:disabled) {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.42);
}

body[data-theme="light"] .item-action[data-action="info"] {
    color: #111;
}

body[data-theme="light"] .item-action[data-action="info"]:hover:not(:disabled) {
    color: #111;
    border-color: rgba(17, 17, 17, 0.42);
}

.item-action[data-action="rename"]:hover:not(:disabled) {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.42);
}

body[data-theme="light"] .item-action[data-action="rename"]:hover:not(:disabled) {
    color: #111;
    border-color: rgba(17, 17, 17, 0.42);
}

.item-action[data-action="link"]:hover:not(:disabled) {
    color: #6da8ff;
    border-color: rgba(109, 168, 255, 0.28);
}

.item-action[data-action="view"]:hover:not(:disabled) {
    color: #9ad8ff;
    border-color: rgba(154, 216, 255, 0.34);
}

.item-action[data-action="move"]:hover:not(:disabled) {
    color: #ffb952;
    border-color: rgba(255, 185, 82, 0.38);
}

.item-action[data-action="archive"]:hover:not(:disabled) {
    color: #ff95c9;
    border-color: rgba(255, 109, 179, 0.38);
}

.item-action[data-action="delete"]:hover:not(:disabled),
.item-action--danger:hover:not(:disabled) {
    color: #ff5a5f;
    border-color: rgba(255, 90, 95, 0.28);
}

.item.is-selecting {
    padding-bottom: 11px;
}

.item.is-selecting .item-actions,
.item.is-selecting .item-info-action {
    display: none;
}

.file-icon-wrapper { width: 34px; height: 40px; flex-shrink: 0; align-self: center; }
.file-info { display: flex; flex-direction: column; overflow: hidden; min-width: 0; padding-right: 4px; }
.name-text { font-size: 0.89rem; font-weight: 600; color: var(--file-name-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.size { font-size: 0.76rem; color: var(--size-color); margin-top: 3px; font-weight: 600; }
.size__disk-label { color: var(--size-color); }
.size__disk-number { color: #ff5a5f; }

@media (max-width: 1180px) {
    .settings-panel {
        left: 50%;
        right: auto;
        width: min(760px, calc(100vw - 28px));
        transform: translateX(-50%);
        z-index: 2;
    }

    .settings-panel__body {
        grid-template-columns: 1fr;
    }

    .settings-grid--chips,
    .settings-summary {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .auth-card {
        width: min(100%, 320px);
        padding: 18px;
        border-radius: 16px;
    }

    .auth-buttons {
        grid-template-columns: 1fr;
    }

    .top-controls {
        top: 18px;
        left: 10px;
        right: 10px;
        width: calc(100vw - 20px);
        box-sizing: border-box;
    }

    header {
        margin: 18px 0 14px;
    }

    .top-controls > button {
        transform: none;
    }

    .profile-toggle,
    .theme-toggle,
    .profile-drawer__close,
    .disk-picker__close,
    .settings-panel__close {
        width: 38px;
        height: 38px;
        min-width: 38px;
        min-height: 38px;
        flex: 0 0 38px;
    }

    .search-container {
        width: calc(100vw - 20px);
        max-width: none;
        display: flex;
        gap: 8px;
        margin-bottom: 10px;
        align-items: center;
    }

    .search-wrapper {
        min-width: 0;
        flex: 1 1 auto;
    }

    .search-wrapper input {
        height: 40px;
        padding: 0 40px 0 14px;
        font-size: 0.95rem;
    }

    .search-icon {
        right: 12px;
        width: 18px;
        height: 18px;
    }

    .filter-dropdown {
        width: 40px;
        min-width: 40px;
        height: 40px;
        flex: 0 0 40px;
    }

    .filter-btn,
    .select-btn,
    .create-text-btn,
    .create-folder-btn,
    .back-btn {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        flex: 0 0 40px;
    }

    .upload-actions-panel {
        width: calc(100vw - 20px);
        max-width: none;
        gap: 8px;
        margin-bottom: 12px;
    }

    .upload-action-block {
        min-height: 44px;
        padding: 10px 12px;
        border-radius: 10px;
        gap: 10px;
    }

    .upload-action-block__icon {
        width: 22px;
        height: 22px;
    }

    .upload-action-block__title {
        font-size: 0.88rem;
    }

    .upload-action-block__hint {
        font-size: 0.72rem;
        line-height: 1.2;
    }

    .profile-toggle-icon,
    .theme-toggle-icon,
    .profile-drawer__close svg,
    .disk-picker__close svg,
    .settings-panel__close svg {
        width: 15px;
        height: 15px;
    }

    .profile-drawer__panel {
        width: calc(100vw - 20px);
        height: calc(100dvh - 20px);
        max-height: calc(100vh - 20px);
        margin: 10px;
        border-radius: 22px;
        overflow: hidden;
    }

    .disk-picker {
        top: 10px;
        left: 10px;
        right: 10px;
        width: auto;
        max-width: none;
        height: calc(100dvh - 20px);
        max-height: calc(100vh - 20px);
    }

    .disk-picker__panel,
    .settings-panel__panel {
        width: 100%;
        height: 100%;
        max-height: 100%;
        overflow: hidden;
    }

    .settings-panel {
        top: 10px;
        left: 10px;
        right: 10px;
        height: calc(100dvh - 20px);
        max-height: calc(100vh - 20px);
    }

    .profile-drawer__header,
    .disk-picker__header,
    .settings-panel__header {
        padding: 20px 20px 12px;
    }

    .settings-panel__header {
        position: relative;
        z-index: 2;
    }

    .upload-modal,
    .upload-link-modal {
        padding: 16px;
        box-sizing: border-box;
    }

    .settings-panel__body {
        padding: 6px 14px 14px;
        grid-template-columns: 1fr;
        gap: 12px;
        overflow-y: auto;
        min-height: 0;
        -webkit-mask-image: linear-gradient(to bottom, transparent 0, black 18px, black 100%);
        mask-image: linear-gradient(to bottom, transparent 0, black 18px, black 100%);
    }

    .settings-section {
        padding: 16px;
        border-radius: 16px;
    }

    .settings-grid--chips,
    .settings-summary {
        grid-template-columns: 1fr;
    }

    .settings-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .upload-modal__card {
        width: min(100%, 300px);
        min-height: 280px;
        padding: 20px 18px 18px;
        border-radius: 22px;
    }

    .upload-modal__content {
        padding-top: 4px;
    }

    .upload-link-modal__card {
        width: min(100%, 320px);
        padding: 20px 18px;
        border-radius: 22px;
    }

    .upload-modal__close,
    .upload-link-modal__close,
    .file-info-modal__close {
        top: 14px;
        right: 14px;
    }

    .file-info-modal,
    .disk-info-modal {
        align-items: flex-start;
        padding: 72px 14px 14px;
    }

    .file-info-modal__card,
    .disk-info-modal__card {
        width: min(100%, 360px);
        padding: 20px 18px 18px;
        box-sizing: border-box;
    }

    .app-dialog {
        padding: 16px;
    }

    .app-dialog__card {
        width: min(100%, 360px);
        padding: 20px 18px 18px;
    }

    .app-dialog__actions {
        grid-template-columns: 1fr;
    }

    .file-info-modal__meta-grid,
    .file-info-modal__actions,
    .disk-info-modal__meta-grid {
        grid-template-columns: 1fr;
    }

    .upload-dock-stack {
        width: calc(100vw - 20px);
        bottom: 10px;
        gap: 8px;
    }

    .upload-dock {
        width: 100%;
        padding: 10px 12px;
        border-radius: 14px;
    }

    .upload-queue--global {
        max-height: min(28vh, 220px);
    }

    .profile-drawer__footer {
        gap: 12px;
        padding: 12px 14px 14px;
    }

    .filter-content {
        width: 100%;
        max-width: none;
        min-height: 0;
        box-sizing: border-box;
    }

    .filter-content::after {
        content: none;
    }

    .profile-drawer__summary {
        padding: 0 14px 12px;
        gap: 10px;
        min-height: 0;
    }

    .profile-add-disk {
        padding: 12px 14px;
        border-radius: 14px;
        gap: 10px;
    }

    .profile-disk-list {
        gap: 8px;
        min-height: 0;
    }

    .profile-disk-tile {
        width: 100%;
        box-sizing: border-box;
        padding: 8px 10px;
    }

    .profile-disk-tile__main {
        padding-right: 32px;
    }

    .profile-disk-card__heading {
        margin-bottom: 3px;
    }

    .profile-disk-card__name {
        font-size: 0.82rem;
    }

    .profile-disk-card__usage {
        font-size: 0.68rem;
    }

    .profile-disk-tile__info {
        right: 10px;
        bottom: 8px;
        width: 22px;
        height: 22px;
    }

    .selection-bar {
        width: calc(100vw - 20px);
        padding: 10px 12px;
        margin-bottom: 10px;
        flex-wrap: wrap;
        box-sizing: border-box;
    }

    .selection-bar__actions {
        width: 100%;
        justify-content: flex-end;
        gap: 8px;
        flex-wrap: wrap;
    }

    .grid {
        width: 100%;
        justify-content: center;
        gap: 10px;
        padding: 10px 10px 100px;
    }

    .item {
        width: calc(50vw - 16px);
        max-width: 224px;
        min-width: 148px;
        padding: 11px 9px 38px;
        gap: 8px;
        box-sizing: border-box;
    }

    .item-actions {
        gap: 4px;
        right: 9px;
        bottom: 9px;
    }

    .item-info-action {
        left: 9px;
        bottom: 9px;
    }

    .item-action {
        width: 25px;
        height: 25px;
        border-radius: 8px;
    }

    .file-icon-wrapper {
        width: 32px;
        height: 38px;
    }

    .name-text {
        font-size: 0.85rem;
    }

    .size {
        font-size: 0.74rem;
    }

    .profile-upload-card__body {
        gap: 12px;
        flex: 1;
        align-items: center;
    }

    .profile-upload-card__icon {
        width: 32px;
        height: 32px;
    }

    .profile-drawer__actions {
        gap: 12px;
        padding: 12px 14px 0;
    }

    .profile-drawer__footer {
        padding: 12px 14px 14px;
    }
}

