.filePicker {
    color: #1e293b;
    font-size: 13px;
    line-height: 1.4;
    text-align: left;
}

    .filePicker [hidden] {
        display: none !important;
    }

/* which part shows: the file card, the drop area with the phone code, or "No file" when read-only */
.filePickerCurrent,
.filePickerNone,
.filePickerSources,
.filePickerKeep {
    display: none;
}

.filePicker_hasFile .filePickerCurrent {
    display: flex;
}

.filePicker_readOnly:not(.filePicker_hasFile) .filePickerNone {
    display: block;
}

.filePicker:not(.filePicker_readOnly):not(.filePicker_hasFile) .filePickerSources,
.filePicker_choosing .filePickerSources {
    display: flex;
}

.filePicker_choosing .filePickerCurrent {
    display: none;
}

.filePicker_hasFile.filePicker_choosing .filePickerKeep {
    display: inline-block;
}

.filePicker_choosing.filePicker_uploading .filePickerKeep {
    display: none;
}

.filePicker_readOnly .filePickerReplace {
    display: none;
}

/* the file card */
.filePickerCurrent {
    align-items: center;
    gap: 14px;
    padding: 12px;
    border: 1px solid #dfe4ea;
    border-radius: 10px;
    background-color: #f8fafc;
}

.filePickerThumb {
    flex: none;
    border-radius: 6px;
}

    .filePickerThumb img {
        display: block;
        max-width: 112px;
        max-height: 96px;
        border: 1px solid #dfe4ea;
        border-radius: 6px;
        background-color: #ffffff;
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
        transition: border-color 0.15s, box-shadow 0.15s;
    }

    .filePickerThumb:hover img,
    .filePickerCurrent:has(.filePickerName:hover) .filePickerThumb img {
        border-color: #2b6cb0;
        box-shadow: 0 2px 8px rgba(43, 108, 176, 0.25);
    }

.filePickerCurrentText {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.filePickerName {
    overflow: hidden;
    color: #1e293b !important;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    text-overflow: ellipsis;
    white-space: nowrap;
}

    .filePickerName:hover {
        color: #2b6cb0 !important;
        text-decoration: underline !important;
    }

.filePickerCurrentHint {
    color: #64748b;
    font-size: 12px;
}

.filePickerButton {
    flex: none;
    height: 30px;
    padding: 0 12px;
    border: 1px solid #c3cad4;
    border-radius: 6px;
    background-color: #ffffff;
    color: #002e5f;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

    .filePickerButton:hover {
        border-color: #8d97a5;
        background-color: #f1f4f8;
    }

    .filePickerButton:focus-visible {
        outline: 2px solid #2b6cb0;
        outline-offset: 2px;
    }

.filePickerNone {
    color: #64748b;
    font-style: italic;
}

/* the drop area */
.filePickerSources {
    gap: 14px;
}

.filePickerDrop {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 196px;
    box-sizing: border-box;
    padding: 16px;
    border: 2px dashed #c3cad4;
    border-radius: 10px;
    background-color: #f8fafc;
    text-align: center;
    transition: border-color 0.15s, background-color 0.15s;
}

    .filePickerDrop:hover {
        border-color: #2b6cb0;
        background-color: #f1f6fc;
    }

    .filePickerDrop:focus-visible {
        outline: 3px solid rgba(43, 108, 176, 0.35);
        outline-offset: 2px;
    }

    .filePickerDrop.disabled {
        cursor: default !important;
    }

.filePicker_dragOver .filePickerDrop {
    border-style: solid;
    border-color: #2b6cb0;
    background-color: #e6f0fa;
}

.filePickerDropEmpty,
.filePickerDropBusy {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    max-width: 100%;
}

.filePickerDropEmpty,
.filePicker_uploading .filePickerDropBusy {
    display: flex;
}

.filePicker_uploading .filePickerDropEmpty {
    display: none;
}

.filePickerDropIcon {
    width: 40px;
    height: 40px;
    margin-bottom: 6px;
    padding: 10px;
    border-radius: 50%;
    background-color: #e6f0fa;
    fill: none;
    stroke: #2b6cb0;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.filePicker_dragOver .filePickerDropIcon {
    background-color: #2b6cb0;
    stroke: #ffffff;
}

.filePickerDropTitle {
    font-size: 15px;
    font-weight: 600;
}

.filePickerDropHint {
    color: #64748b;
    font-size: 12px;
}

    .filePickerDropHint u {
        color: #2b6cb0;
        font-weight: 600;
        text-decoration: none;
    }

.filePickerTouchOnly {
    display: none;
}

.filePickerSpinner {
    display: block;
    width: 28px;
    height: 28px;
    box-sizing: border-box;
    margin-bottom: 6px;
    border: 3px solid #d5e3f3;
    border-top-color: #2b6cb0;
    border-radius: 50%;
    animation: filePickerSpin 0.8s linear infinite;
}

@keyframes filePickerSpin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .filePickerSpinner {
        animation-duration: 2.4s;
    }
}

/* the phone code */
.filePickerPhone {
    display: flex;
    flex: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 196px;
    box-sizing: border-box;
    padding: 14px 14px 12px 14px;
    border: 1px solid #dfe4ea;
    border-radius: 10px;
    background-color: #ffffff;
    text-align: center;
}

.filePickerPhoneQr {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 128px;
    height: 128px;
    margin-bottom: 10px;
    border-radius: 6px;
    background-color: #f8fafc;
}

    .filePickerPhoneQr > * {
        display: none;
    }

.filePicker[data-phone="error"] .filePickerPhoneQr {
    display: none;
}

.filePickerPhoneCode {
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    transition: opacity 0.2s;
}

    .filePickerPhoneCode svg {
        display: block;
        width: 100%;
        height: 100%;
    }

.filePicker[data-phone="idle"] .filePickerPhoneShow,
.filePicker[data-phone="creating"] .filePickerSpinner,
.filePicker[data-phone="waiting"] .filePickerPhoneCode,
.filePicker[data-phone="sending"] .filePickerPhoneCode,
.filePicker[data-phone="expired"] .filePickerPhoneCode {
    display: block;
}

.filePicker[data-phone="sending"] .filePickerPhoneCode,
.filePicker[data-phone="expired"] .filePickerPhoneCode {
    opacity: 0.12;
}

.filePicker[data-phone="sending"] .filePickerPhoneQr .filePickerSpinner {
    position: absolute;
    display: block;
    margin: 0;
}

.filePickerPhoneShow {
    width: 100%;
    height: 100%;
    padding: 0;
    border: 1px dashed #c3cad4;
    border-radius: 6px;
    background-color: transparent;
    color: #2b6cb0;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

    .filePickerPhoneShow:hover {
        border-color: #2b6cb0;
        background-color: #f1f6fc;
    }

    .filePickerPhoneShow svg {
        display: block;
        width: 32px;
        height: 32px;
        margin: 0 auto 6px auto;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.6;
        stroke-linecap: round;
    }

.filePickerPhoneTitle {
    margin: 0 0 2px 0;
    font-size: 13px;
    font-weight: 600;
}

.filePickerPhoneStatus {
    margin: 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.35;
}

    .filePickerPhoneStatus:empty {
        display: none;
    }

.filePickerLinkButton {
    margin: 0;
    padding: 2px 4px;
    border: 0 none;
    background: none;
    color: #2b6cb0;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

    .filePickerLinkButton:hover {
        text-decoration: underline;
    }

    .filePickerLinkButton:empty {
        display: none !important;
    }

.filePickerPhoneRetry {
    margin-top: 6px;
}

/* under the picker: errors, and the way back to the current file */
.filePickerFooter {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.filePickerMessage {
    margin: 8px 0 0 0;
    color: #9b2c2c;
}

    .filePickerMessage:empty {
        display: none;
    }

.filePickerKeep {
    margin: 6px 0 0 auto;
}

@media (hover: none) and (pointer: coarse) {
    .filePickerPointerOnly,
    .filePickerPhone {
        display: none;
    }

    .filePickerTouchOnly {
        display: inline;
    }

    .filePickerDrop {
        min-height: 150px;
    }
}

@media (max-width: 560px) {
    .filePickerSources {
        flex-direction: column;
    }

    .filePickerPhone {
        width: auto;
    }

    .filePickerCurrent {
        flex-wrap: wrap;
    }
}
