.hmp-upload.form-row {
    flex: 0 0 100%;
    min-width: 0;
    width: 100%;
    margin: 0 0 16px;
    padding: 14px 16px;
    border: 1px solid #cbd6c7;
    border-radius: 8px;
    background: #f4f8f1;
    color: #11171b;
}

.hmp-upload .hmp-upload-label {
    display: block;
    margin: 0 0 8px;
    font-size: 1rem;
    line-height: 1.35;
    color: #11171b;
}

.hmp-upload-label span {
    margin-inline-start: 4px;
    color: #4b5850;
    font-size: .86rem;
    font-weight: 400;
}

.hmp-upload-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
}

.hmp-upload-picker {
    position: relative;
    max-width: 100%;
}

.hmp-upload-picker input {
    max-width: 100%;
    margin: 0;
}

.hmp-upload-action {
    display: none;
}

.hmp-upload-enhanced .hmp-upload-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 7px 13px;
    border: 1px solid #4c711b;
    border-radius: 5px;
    background: #a9f943;
    color: #11171b;
    font-size: .9rem;
    font-weight: 700;
    line-height: 1.2;
}

.hmp-upload-enhanced .hmp-upload-picker input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.hmp-upload-picker:focus-within,
.hmp-upload .hmp-upload-clear:focus-visible {
    outline: 2px solid #285213;
    outline-offset: 3px;
    border-radius: 5px;
}

.hmp-upload-picker:hover .hmp-upload-action {
    background: #96e832;
}

.hmp-upload-help,
.hmp-upload-error {
    font-size: .85rem;
    line-height: 1.4;
    color: #415047;
}

.hmp-upload-selection {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hmp-upload .hmp-upload-zoom {
    position: relative;
    display: block;
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid #cbd6c7;
    border-radius: 5px;
    background: #eaf0e7;
    cursor: zoom-in;
}

.hmp-upload-zoom .hmp-upload-preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.hmp-upload-zoom svg {
    position: absolute;
    inset: auto 3px 3px auto;
    box-sizing: content-box;
    padding: 3px;
    border-radius: 4px;
    background: #11171b;
    color: #fff;
    pointer-events: none;
}

.hmp-upload-zoom:focus-visible,
.hmp-upload-dialog .hmp-upload-dialog-close:focus-visible {
    outline: 2px solid #285213;
    outline-offset: 3px;
}

.hmp-upload .hmp-upload-zoom[hidden],
.hmp-upload .hmp-upload-preview[hidden] {
    display: none;
}

.hmp-upload-selection:has(.hmp-upload-zoom:not([hidden])) {
    padding-block-start: 8px;
}

.hmp-upload-filename {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: .9rem;
    line-height: 1.4;
}

.hmp-upload .hmp-upload-clear {
    flex: 0 0 auto;
    min-height: 44px;
    margin: 0;
    padding: 0 2px;
    border: 0;
    background: transparent;
    color: #294d1b;
    font-size: .85rem;
    font-weight: 600;
    text-decoration: underline;
    text-transform: none;
    letter-spacing: normal;
}

.hmp-upload .hmp-upload-clear[hidden] {
    display: none;
}

.hmp-upload-error {
    display: block;
    color: #9a201c;
    font-weight: 600;
}

.hmp-upload-error:not(:empty) {
    margin-top: 4px;
}

.hmp-upload-dialog:not([open]) {
    display: none;
}

.hmp-upload-dialog {
    width: min(92vw, 880px);
    max-height: 92vh;
    max-height: 92dvh;
    margin: auto;
    padding: 12px;
    overflow: auto;
    border: 1px solid #cbd6c7;
    border-radius: 10px;
    background: #f4f8f1;
    color: #11171b;
}

.hmp-upload-dialog::backdrop {
    background: rgb(10 15 18 / 78%);
}

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

.hmp-upload-dialog-header h2 {
    margin: 0;
    color: #11171b;
    font-size: clamp(1rem, 3vw, 1.25rem);
    line-height: 1.25;
}

.hmp-upload-dialog .hmp-upload-dialog-close {
    flex: 0 0 auto;
    min-height: 44px;
    margin: 0;
    padding: 0 12px;
    border: 1px solid #4c711b;
    border-radius: 5px;
    background: #a9f943;
    color: #11171b;
    font-size: .9rem;
    font-weight: 700;
    letter-spacing: normal;
    text-transform: none;
}

.hmp-upload-dialog-image {
    display: block;
    width: 100%;
    max-height: min(70vh, 760px);
    max-height: min(70dvh, 760px);
    border-radius: 5px;
    background: #eaf0e7;
    object-fit: contain;
}

@media (max-width: 549px) {
    .hmp-upload-selection {
        padding-inline-end: 36px;
    }
}
