.image-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: #fff;
    color: #292929;
    font-family: 'Nunito', sans-serif;
}

.image-page *,
.image-page *::before,
.image-page *::after {
    box-sizing: border-box;
}

.image-page header {
    background-color: #fff !important;
}

.image-tool {
    width: min(100% - 36px, 700px);
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    padding: 96px 0 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    animation: image-arrive .5s ease both;
}

.image-tool__eyebrow {
    display: inline-block;
    margin-bottom: 10px;
    color: #898989;
    font: 600 11px/1 'Nunito', sans-serif;
    letter-spacing: .18em;
}

.image-tool__intro h1 {
    margin: 0;
    color: #333;
    font: 600 clamp(30px, 4vw, 39px)/1.15 'Source Sans Pro', sans-serif;
    letter-spacing: -.025em;
}

.image-tool__intro p {
    margin: 10px 0 26px;
    color: #777;
    font: 400 16px/1.5 'Nunito', sans-serif;
}

.image-tool__workspace {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.image-tool form {
    margin: 0;
}

.image-tool input[type=file] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

.image-tool input[type=file]:focus-visible+.image-tool__drop {
    outline: 3px solid #767676;
    outline-offset: 4px;
}

.image-tool__drop {
    min-height: 235px;
    padding: 24px;
    border: 1.5px dashed #d6d6d6;
    border-radius: 18px;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
}

.image-tool__drop:hover,
.image-tool__drop.is-dragging {
    border-color: #777;
    background: #f7f7f7;
}

.image-tool__upload-icon {
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    margin-bottom: 15px;
    border-radius: 15px;
    background: #f0f0f0;
    color: #444;
    font-size: 21px;
}

.image-tool__drop-title {
    color: #353535;
    font: 600 19px/1.3 'Source Sans Pro', sans-serif;
}

.image-tool__drop-subtitle {
    margin-top: 5px;
    color: #767676;
    font-size: 14px;
}

.image-tool__drop-subtitle span {
    color: #333;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.image-tool__drop-note {
    margin-top: 19px;
    color: #9a9a9a;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: .02em;
}

.image-tool__selected {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 16px;
    padding: 12px;
    border: 1px solid #e9e9e9;
    border-radius: 16px;
    text-align: left;
}

.image-tool__selected[hidden],
.image-tool__result[hidden],
#button-loading[hidden],
#button-label[hidden] {
    display: none !important;
}

.image-tool__formats {
    margin: 20px 0 0;
    padding: 0;
    border: 0;
    text-align: left;
}

.image-tool__formats legend {
    margin-bottom: 10px;
    color: #575757;
    font: 600 13px/1.3 'Nunito', sans-serif;
}

.image-tool__format-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.image-tool__format-options label {
    position: relative;
    cursor: pointer;
}

.image-tool__format-options input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.image-tool__format-options span {
    display: block;
    padding: 8px 13px;
    border: 1px solid #dedede;
    border-radius: 9px;
    color: #555;
    font: 600 13px/1.2 'Nunito', sans-serif;
    transition: border-color .2s, background .2s, color .2s;
}

.image-tool__format-options label:hover span {
    border-color: #777;
}

.image-tool__format-options input:checked+span {
    border-color: #222;
    background: #222;
    color: #fff;
}

.image-tool__format-options input:focus-visible+span {
    outline: 2px solid #555;
    outline-offset: 3px;
}

.image-tool__compression-input {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    color: #555;
    font-size: 13px;
}

.image-tool__compression-input[hidden] {
    display: none;
}

.image-tool__compression-input input {
    width: 90px;
    height: 38px;
    padding: 7px 10px;
    border: 1px solid #d2d2d2;
    border-radius: 8px;
    background: #fff;
    color: #333;
    font: 600 14px/1 'Nunito', sans-serif;
}

.image-tool__compression-input input:focus-visible {
    outline: 2px solid #555;
    outline-offset: 2px;
}

.image-tool__webp-option {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-top: 15px;
    color: #555;
    font-size: 13px;
    cursor: pointer;
}

.image-tool__webp-option input {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: #222;
}

.image-tool__compression-note {
    margin: 9px 0 0;
    color: #888;
    font-size: 12px;
    line-height: 1.4;
}

.image-tool__target-warning {
    margin: 8px 0 0;
    color: #a63825;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
}

.image-tool__pdf-compression {
    margin-top: 22px;
    text-align: left;
}

.image-tool__pdf-compression-heading,
.image-tool__pdf-estimate {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.image-tool__pdf-compression-heading label {
    color: #454545;
    font-size: 14px;
    font-weight: 600;
}

.image-tool__pdf-compression-heading span,
.image-tool__pdf-estimate span {
    color: #818181;
    font-size: 12px;
}

.image-tool__pdf-compression-controls {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 12px;
}

.image-tool__pdf-compression-controls input[type=range] {
    flex: 1;
    min-width: 0;
    height: 6px;
    margin: 0;
    border-radius: 3px;
    background: linear-gradient(to right, #222 var(--progress, 60%), #dfdfdf var(--progress, 60%));
    appearance: none;
    cursor: pointer;
}

.image-tool__pdf-compression-controls input[type=range]::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: #222;
    box-shadow: 0 0 0 1px #222;
    appearance: none;
}

.image-tool__pdf-compression-controls input[type=range]::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: #222;
    box-shadow: 0 0 0 1px #222;
}

.image-tool__pdf-compression-controls input[type=range]:focus-visible {
    outline: 2px solid #555;
    outline-offset: 7px;
}

.image-tool__pdf-compression-number {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 6px 9px;
    border: 1px solid #d2d2d2;
    border-radius: 8px;
    color: #444;
    font-size: 14px;
    font-weight: 600;
}

.image-tool__pdf-compression-number:focus-within {
    outline: 2px solid #555;
    outline-offset: 2px;
}

.image-tool__pdf-compression-number input {
    width: 38px;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #333;
    font: inherit;
    text-align: right;
    appearance: textfield;
}

.image-tool__pdf-compression-number input::-webkit-inner-spin-button,
.image-tool__pdf-compression-number input::-webkit-outer-spin-button {
    margin: 0;
    appearance: none;
}

.image-tool__pdf-estimate {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid #ededed;
}

.image-tool__pdf-estimate strong {
    color: #424242;
    font-size: 13px;
    font-weight: 600;
    text-align: right;
}

.image-tool__thumbnail {
    flex: 0 0 52px;
    height: 52px;
    overflow: hidden;
    border-radius: 10px;
    background: #f1f1f1;
}

.image-tool__thumbnail img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-tool__file-info {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.image-tool__file-info strong {
    overflow: hidden;
    color: #303030;
    font-size: 14px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-tool__file-info span {
    color: #8d8d8d;
    font-size: 12px;
}

.image-tool__remove {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: #f4f4f4;
    color: #666;
    cursor: pointer;
}

.image-tool__remove:hover {
    background: #e9e9e9;
    color: #111;
}

.image-tool__convert,
.image-tool__download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 52px;
    padding: 12px 28px;
    border: 0;
    border-radius: 13px;
    background: #111;
    color: #fff;
    font: 600 16px/1.2 'Source Sans Pro', sans-serif;
    text-decoration: none;
    box-shadow: none;
    cursor: pointer;
    transition: background .2s;
}

.image-tool__convert {
    min-width: 220px;
    margin-top: 22px;
}

.image-tool__convert:hover:not(:disabled),
.image-tool__download:hover {
    background: #333;
}

.image-tool__convert:disabled {
    background: #b5b5b5;
    box-shadow: none;
    cursor: not-allowed;
}

.image-tool__spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 6px;
    border: 2px solid #fff8;
    border-top-color: #fff;
    border-radius: 50%;
    vertical-align: -3px;
    animation: image-spin .7s linear infinite;
}

.image-tool__result {
    margin-top: 28px;
    padding-top: 25px;
    border-top: 1px solid #ededed;
    animation: image-arrive .4s ease both;
}

.image-tool__result-heading {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    color: #263d2d;
    font-size: 17px;
    font-weight: 600;
}

.image-tool__result-heading i {
    color: #35a45d;
    font-size: 20px;
}

.image-tool__result-details {
    margin: -4px 0 14px;
    color: #6c6c6c;
    font-size: 13px;
    line-height: 1.4;
}

.image-tool__result-preview {
    display: grid;
    place-items: center;
    min-height: 210px;
    max-height: 330px;
    padding: 15px;
    overflow: hidden;
    border-radius: 17px;
    background: #f7f7f7;
}

.image-tool__result-preview img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 6px;
}

.image-tool__result-file {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    color: #555;
    font-size: 14px;
    font-weight: 600;
}

.image-tool__result-file i {
    color: #333;
    font-size: 44px;
}

.image-tool__result-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 18px;
    text-align: left;
}

.image-tool__result-actions>span {
    min-width: 0;
    overflow: hidden;
    color: #656565;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-tool__download {
    flex: 0 0 auto;
    min-height: 50px;
    padding: 10px 22px;
    font-size: 15px;
}

@keyframes image-arrive {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes image-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 600px) {
    .image-tool {
        padding-top: 92px;
    }

    .image-tool__intro p {
        font-size: 15px;
    }

    .image-tool__drop {
        min-height: 220px;
        padding: 18px;
    }

    .image-tool__drop-title {
        font-size: 18px;
    }

    .image-tool__convert {
        width: 100%;
    }

    .image-tool__result-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .image-tool__download {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {

    .image-tool,
    .image-tool__result {
        animation: none;
    }

    .image-tool__drop,
    .image-tool__convert,
    .image-tool__download {
        transition: none;
    }
}

.image-tool__thumbnail span {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: #777;
    font-size: 20px;
}

.image-tool__thumbnail img[hidden],
.image-tool__thumbnail span[hidden] {
    display: none;
}

.image-tool__result-preview video {
    max-width: 100%;
    max-height: 300px;
    border-radius: 6px;
}
