/* One upload language for item images, evidence and imports. Native inputs stay in the form. */
.bk-file-picker {
    --file-accent: var(--bk-accent, #182c46);
    --file-ink: var(--bk-ink, #14243b);
    --file-muted: var(--bk-muted, #617087);
    --file-line: var(--bk-line, #dce3ed);
    --file-soft: var(--bk-soft, #f2f5f9);
    --file-surface: var(--bk-surface, #fff);
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    min-width: 0;
    max-width: 100%;
    margin: 6px 0 0;
    padding: 12px;
    border: 1px dashed var(--file-line);
    border-radius: var(--bk-radius, 8px);
    color: var(--file-ink);
    background: var(--file-soft);
    text-align: start;
    line-height: 1.5;
    font-size: 12px;
    font-weight: 400;
    cursor: default;
    box-sizing: border-box;
}
.bk-file-picker *, .bk-file-picker *::before, .bk-file-picker *::after { box-sizing: border-box; }
.bk-file-picker[hidden], .bk-file-picker [hidden] { display: none !important; }
.bk-file-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 58px;
    width: 58px;
    height: 58px;
    overflow: hidden;
    border: 1px solid var(--file-line);
    border-radius: var(--bk-control-radius, 6px);
    color: var(--file-muted);
    background: var(--file-surface);
}
.bk-file-preview svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.bk-file-preview img { display: block; width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.bk-file-preview.has-multiple { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 2px; padding: 3px; }
.bk-file-preview.has-multiple img { padding: 0; border-radius: 2px; }
.bk-file-content { display: block; flex: 1; min-width: 0; }
.bk-file-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.bk-file-choose {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    position: relative;
    min-height: 32px;
    max-width: 100%;
    padding: 5px 10px;
    overflow: hidden;
    border: 1px solid var(--file-line);
    border-radius: var(--bk-control-radius, 6px);
    color: var(--file-ink);
    background: var(--file-surface);
    font-size: 12px;
    font-weight: 600;
    line-height: 20px;
    cursor: pointer;
}
.bk-file-choose svg { flex-shrink: 0; width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.bk-file-choose:hover { border-color: var(--file-muted); }
.bk-file-choose:focus-within { outline: 2px solid var(--file-accent); outline-offset: 2px; }
.bk-file-picker input[type="file"].bk-file-native {
    position: absolute !important;
    inset: 0 !important;
    z-index: 1;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    opacity: 0;
    font-size: 16px;
    cursor: pointer;
}
.bk-file-clear { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 4px 7px; border-radius: var(--bk-control-radius, 6px); color: var(--file-muted); font-size: 12px; cursor: pointer; }
.bk-file-clear:hover { color: var(--file-ink); background: var(--file-surface); }
.bk-file-clear:focus-visible { outline: 2px solid var(--file-accent); outline-offset: 1px; }
.bk-file-picker .bk-file-status { display: block; margin: 6px 0 0; color: var(--file-muted); font-size: 11px; font-weight: 400; line-height: 1.5; overflow-wrap: anywhere; }
.bk-file-names { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin-top: 3px; color: var(--file-ink); font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.bk-file-picker.is-disabled { opacity: .6; }
.bk-file-picker.is-disabled .bk-file-choose, .bk-file-picker.is-disabled .bk-file-native { cursor: not-allowed; }
.bk-file-picker.is-invalid { border-color: #b54747; }
.bk-file-picker.is-invalid .bk-file-status { color: #a43c3c; }
.bk-file-field { min-width: 0; }
.bk-file-field > label { display: block; margin: 0; }
.bookkeeping .bk-file-field > small { display: block; margin-top: 7px; color: var(--bk-muted, #617087); font-size: 11px; line-height: 1.5; }
.bk-item-image-field .bk-file-preview { flex-basis: 76px; width: 76px; height: 76px; }
.bk-item-image-field .bk-file-picker { padding: 14px; gap: 14px; }
/* Existing logo and library editors keep their validation, queue and drop handlers. */
.bk-profile-logo, .bk-library-dropzone, .dropzone { border-radius: var(--bk-radius, 8px); }
.bk-profile-upload, .bk-library-file-picker { border-radius: var(--bk-control-radius, 6px); }
.dropzone { border: 1px dashed var(--bk-line, #dce3ed); background: var(--bk-soft, #f2f5f9); color: var(--bk-ink, #14243b); }
.dropzone .dz-message { color: var(--bk-muted, #617087); font-size: 13px; }
.dropzone .dz-preview .dz-image { border-radius: var(--bk-control-radius, 6px); }
/* The native control remains usable and consistent before JS or with scripting disabled. */
input[type="file"]:not(.bk-file-native):not(.bk-profile-file-input):not(.dz-hidden-input)::file-selector-button {
    margin-inline-end: 10px;
    padding: 5px 10px;
    border: 1px solid var(--bk-line, #dce3ed);
    border-radius: var(--bk-control-radius, 6px);
    color: var(--bk-ink, #14243b);
    background: var(--bk-surface, #fff);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
@media (max-width: 575px) {
    .bk-file-picker { padding: 10px; gap: 10px; }
    .bk-file-preview { flex-basis: 48px; width: 48px; height: 48px; }
    .bk-file-choose, .bk-file-clear { min-height: 38px; }
    .bk-item-image-field .bk-file-picker { padding: 12px; gap: 12px; }
    .bk-item-image-field .bk-file-preview { flex-basis: 62px; width: 62px; height: 62px; }
}
@media (forced-colors: active) {
    .bk-file-picker, .bk-file-preview, .bk-file-choose { border-color: ButtonText; }
    .bk-file-choose:focus-within, .bk-file-clear:focus-visible { outline-color: Highlight; }
}
