/* Native FilePond owns uploads and URLs. The globally configured field marker
   owns its appearance, including when a modal leaves its authoring wrapper. */
.ct-workspace-upload .filepond--root { border:1px dashed var(--ct-border-strong); border-radius:8px; background:#fdfdfd; box-shadow:none; }
.ct-workspace-upload .filepond--root[data-upload-count] { height:var(--ct-upload-height) !important; transition:height 260ms var(--ct-ease); }
.ct-workspace-upload[data-upload-density=compact] .filepond--root[data-upload-count="0"] { --ct-upload-height:80px; }
.ct-workspace-upload .filepond--panel-root { background:transparent; box-shadow:none; }
.ct-workspace-upload .filepond--browser { opacity:0; }
.ct-workspace-upload .filepond--drop-label { min-height:64px; color:var(--ct-text); font-family:var(--font-sans); }
.ct-workspace-upload .ct-upload-target { display:grid; grid-template-columns:32px minmax(0,auto); justify-content:center; column-gap:10px; row-gap:2px; padding:0 8px; text-align:start; }
.ct-workspace-upload .ct-upload-icon { grid-column:1; grid-row:1 / span 2; width:32px; height:32px; margin:0; border-radius:8px; }
.ct-workspace-upload .ct-upload-target strong { grid-column:2; align-self:end; }
.ct-workspace-upload .ct-upload-target > [data-upload-formats]:last-child { grid-column:2; text-align:start; align-self:start; }
/* Keep the prompt measurable so removing the last file can restore it. */
.ct-workspace-upload [data-upload-count] .filepond--drop-label { transform:none !important; transition:opacity 160ms var(--ct-ease),transform 260ms var(--ct-ease); }
.ct-workspace-upload [data-upload-count="0"] .filepond--drop-label { transform:translateY(calc((var(--ct-upload-height) - var(--ct-upload-prompt-height) - 2px) / 2)) !important; }
/* Filament declares prompt opacity !important in its components layer. */
@layer components {
    .ct-workspace-upload [data-upload-multiple=false]:not([data-upload-count="0"]) .filepond--drop-label { opacity:0 !important; pointer-events:none; }
    .ct-workspace-upload [data-upload-count="0"] .filepond--drop-label,
    .ct-workspace-upload [data-upload-multiple=true] .filepond--drop-label { opacity:1 !important; }
}
.ct-workspace-upload [data-upload-count] .filepond--list-scroller { height:var(--ct-upload-list-height) !important; max-height:none; margin:0; inset-inline:4px; transform:translateY(var(--ct-upload-prompt-height)) !important; overflow:hidden; scrollbar-gutter:auto; transition:height 260ms var(--ct-ease),transform 260ms var(--ct-ease); }
.ct-workspace-upload [data-upload-overflow] .filepond--list-scroller { overflow-y:auto; overscroll-behavior:contain; }
.ct-workspace-upload .filepond--label-action { color:var(--ct-text); text-decoration:none; }
.ct-workspace-upload .filepond--item { margin-block:4px; }
.ct-workspace-upload .filepond--item-panel { background:var(--ct-surface); border:1px solid var(--ct-border); border-radius:6px; }
.ct-workspace-upload [data-upload-multiple=false][data-upload-count="1"] .filepond--item-panel { border-width:0; }
.ct-workspace-upload [data-upload-multiple=true] .filepond--item { border-radius:6px; box-shadow:0 1px 2px #0000000a; }
.ct-workspace-upload [data-upload-multiple=false][data-upload-count="1"] .filepond--item-panel { box-shadow:none; }
.ct-workspace-upload .filepond--file { --ct-upload-action-gap:14px; --ct-upload-action-edge:9px; position:relative; padding:12px; padding-inline:calc(var(--ct-upload-action-edge) + 60px) calc(var(--ct-upload-action-edge) + 64px); min-height:58px; align-items:center; color:var(--ct-text); }
.ct-workspace-upload [data-upload-multiple=true] .filepond--file { --ct-upload-action-edge:14px; }
.ct-workspace-upload .filepond--file-info { position:static; margin:0; padding:0; min-width:0; align-self:center; transform:none !important; will-change:auto; }
.ct-workspace-upload .filepond--file-info::before { content:""; position:absolute; inset-inline-start:calc(var(--ct-upload-action-edge) + 32px); top:50%; transform:translateY(-50%); width:18px; height:18px; background:currentColor; mask:url('/icons/harmonized/document-text.svg') center/contain no-repeat; }
.ct-workspace-upload .filepond--file-info-main { display:block; font-family:var(--font-sans); font-size:12px; line-height:18px; white-space:normal; overflow-wrap:anywhere; text-overflow:clip; }
.ct-workspace-upload .filepond--file-info-sub { font-family:var(--font-sans); font-size:11px; line-height:16px; color:var(--ct-muted); opacity:1; }
.ct-workspace-upload :is(.filepond--open-icon,.filepond--download-icon) { position:absolute; top:50%; transform:translateY(-50%); width:18px; height:18px; margin:0; background:var(--ct-muted); }
.ct-workspace-upload .filepond--open-icon { inset-inline-end:calc(var(--ct-upload-action-edge) + 18px + var(--ct-upload-action-gap)); mask-image:url('/icons/harmonized/arrow-top-right-on-square.svg'); }
.ct-workspace-upload .filepond--download-icon { inset-inline-end:var(--ct-upload-action-edge); mask-image:url('/icons/harmonized/arrow-down-tray.svg'); }
.ct-workspace-upload .filepond--file:not(:has(.filepond--download-icon)) .filepond--open-icon { inset-inline-end:var(--ct-upload-action-edge); }
.ct-workspace-upload :is(.filepond--open-icon,.filepond--download-icon):hover { background:var(--ct-primary); }
.ct-workspace-upload .filepond--action-remove-item { inset-inline-start:var(--ct-upload-action-edge); top:50%; transform:translateY(-50%) !important; display:grid; place-items:center; width:18px; height:18px; margin:0; color:var(--ct-muted); background:transparent; }
.ct-workspace-upload .filepond--action-remove-item::after { content:none; }
.ct-workspace-upload .filepond--action-remove-item > svg { position:static; transform:none; width:18px; height:18px; margin:0; background:currentColor; mask:url('/icons/harmonized/x-mark.svg') center/contain no-repeat; }
.ct-workspace-upload .filepond--action-remove-item > svg > * { visibility:hidden; }
.ct-workspace-upload .filepond--action-remove-item:hover { color:var(--ct-danger); }
/* Keep file metadata readable over any image without changing the image itself. */
.ct-workspace-upload .filepond--item:has(.filepond--image-preview) .filepond--file-info { flex:0 1 auto; background:var(--ct-surface); border-radius:4px; padding:4px 8px; }
.ct-workspace-upload .filepond--item:has(.filepond--image-preview) .filepond--file-info::before,
.ct-workspace-upload .filepond--item:has(.filepond--image-preview) :is(.filepond--open-icon,.filepond--download-icon) { color:var(--ct-muted); background-color:var(--ct-surface); }
.ct-workspace-upload .filepond--item:has(.filepond--image-preview) .filepond--action-remove-item { background:var(--ct-surface); }
.ct-workspace-upload [data-filepond-item-state*=error] .filepond--item-panel { border-color:var(--ct-danger); background:var(--ct-danger-soft); }
.ct-workspace-upload [data-filepond-item-state*=error] .filepond--file-status { color:var(--ct-danger); }
/* The saved source keeps native file actions in the reference's single file row. */
.ct-product .ct-source-upload-section[data-source-operation] .ct-upload-target { color:var(--ct-text); line-height:1.5; }
.ct-product:dir(rtl) .ct-source-upload-section .ct-upload-target { direction:rtl; }
.ct-product .ct-source-upload-section[data-source-operation=edit] .filepond--file { min-height:44px; align-items:center; font-weight:400; }
.ct-product .ct-source-upload-section[data-source-operation=edit] .filepond--file-info { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:10px; font-size:12px; line-height:18px; }
.ct-product .ct-source-upload-section[data-source-operation=edit] .filepond--file-info-sub { font-size:.8em; line-height:1.5; white-space:nowrap; }
.ct-product .ct-source-upload-section[data-source-operation=edit] [data-filepond-item-state=idle] .filepond--file-status { display:none; }
/* FilePond caches its loading height. Let a saved PDF row follow its real wrapped
   content; native pending/error layouts and the surrounding list measurement remain. */
.ct-workspace-upload [data-filepond-item-state=idle]:not(:has(.filepond--image-preview)) { height:auto !important; }
.ct-workspace-upload [data-filepond-item-state=idle]:not(:has(.filepond--image-preview)) :is(.filepond--file-wrapper,.filepond--file) { height:auto; }
.ct-product .ct-source-upload-section[data-source-operation=edit] [data-filepond-item-state=idle] .filepond--file { border:1px solid var(--ct-border); border-radius:6px; background:var(--ct-surface); }
.ct-product .ct-source-upload-section[data-source-operation=edit] [data-upload-multiple=false][data-upload-count="1"] [data-filepond-item-state=idle] .filepond--file { border-width:0; }
.ct-product .ct-source-upload-section[data-source-operation=edit] [data-filepond-item-state=idle] .filepond--item-panel { display:none; }
@media(prefers-reduced-motion:reduce) {
    .ct-workspace-upload .filepond--root[data-upload-count],
    .ct-workspace-upload [data-upload-count] .filepond--list-scroller { transition:none; }
    .ct-workspace-upload [data-upload-count] .filepond--drop-label { transition:opacity 100ms var(--ct-ease); }
    .ct-workspace-upload [data-upload-count] .filepond--list { display:flex; flex-direction:column; }
    .ct-workspace-upload [data-upload-count] .filepond--item { position:relative; flex:none; transform:none !important; }
    .ct-workspace-upload [data-upload-removing] { display:none; }
}

/* A completed temporary upload retains native success feedback below its name.
   Side-by-side status text must not consume the filename on narrow forms. */
.ct-workspace-upload [data-filepond-item-state=processing-complete]:not(:has(.filepond--image-preview)) { height:auto !important; }
.ct-workspace-upload [data-filepond-item-state=processing-complete]:not(:has(.filepond--image-preview)) :is(.filepond--file-wrapper,.filepond--file) { height:auto; }
.ct-workspace-upload [data-filepond-item-state=processing-complete]:not(:has(.filepond--image-preview)) .filepond--file { display:grid; grid-template-columns:minmax(0,1fr); gap:4px; }
.ct-workspace-upload [data-filepond-item-state=processing-complete]:not(:has(.filepond--image-preview)) .filepond--file:not(:has(.filepond--open-icon,.filepond--download-icon)) { padding-inline-end:12px; }
.ct-workspace-upload [data-filepond-item-state=processing-complete]:not(:has(.filepond--image-preview)) .filepond--file-status { margin:0; text-align:start; transform:none !important; }
