/* Tool: compress-img */
body:where([data-tool="compress-img"]) {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #0a0a0a;
    direction: rtl;
}
:where(body[data-tool="compress-img"]) button {
    margin: 0;
}
:where(body[data-tool="compress-img"]) button:hover {
    box-shadow: none;
}
:where(body[data-tool="compress-img"]) .app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}
:where(body[data-tool="compress-img"]) .hstat {
    font-size: 12px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 5px;
}
:where(body[data-tool="compress-img"]) .hstat strong {
    color: var(--text-primary);
}
:where(body[data-tool="compress-img"]) .hstat-sep {
    color: var(--text-tertiary);
}
:where(body[data-tool="compress-img"]) .main {
    flex: 1;
    display: flex;
    overflow: hidden;
}
:where(body[data-tool="compress-img"]) .drop-screen {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
:where(body[data-tool="compress-img"]) .dropzone {
    width: 480px;
    max-width: calc(100vw - 40px);
    border-radius: 20px;
    padding: 56px 40px;
    text-align: center;
    cursor: pointer;
    background: var(--bg-secondary);
    transition: all 0.2s;
}
:where(body[data-tool="compress-img"]) .dropzone:hover,
:where(body[data-tool="compress-img"]) .dropzone.drag-over {
    border-color: var(--primary);
    background: rgba(124, 106, 247, 0.05);
}
:where(body[data-tool="compress-img"]) .drop-icon {
    font-size: 52px;
    margin-bottom: 16px;
    display: block;
}
:where(body[data-tool="compress-img"]) .dropzone h2 {
    font-size: 20px;
    margin-bottom: 8px;
}
:where(body[data-tool="compress-img"]) .dropzone p {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 24px;
    line-height: 1.7;
}
:where(body[data-tool="compress-img"]) .fmt-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-top: 14px;
}
:where(body[data-tool="compress-img"]) .fmt-pill {
    padding: 3px 10px;
    border-radius: 99px;
    background: var(--bg-quaternary);
    border: 1px solid var(--border-color);
    font-size: 11px;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}
:where(body[data-tool="compress-img"]) .workspace {
    flex: 1;
    display: flex;
    overflow: hidden;
    flex-direction: row-reverse;
}
:where(body[data-tool="compress-img"]) .panel {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
:where(body[data-tool="compress-img"]) .panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
}
:where(body[data-tool="compress-img"]) .panel-body::-webkit-scrollbar {
    width: 3px;
}
:where(body[data-tool="compress-img"]) .panel-body::-webkit-scrollbar-thumb {
    background: var(--bg-quaternary);
}
:where(body[data-tool="compress-img"]) .sec {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
}
:where(body[data-tool="compress-img"]) .sec-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    cursor: pointer;
    user-select: none;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-primary);
}
:where(body[data-tool="compress-img"]) .sec-hd:hover {
    background: rgba(255, 255, 255, 0.02);
}
:where(body[data-tool="compress-img"]) .sec-hd span {
    font-size: 13px;
}
:where(body[data-tool="compress-img"]) .arrow {
    font-size: 10px;
    color: var(--text-tertiary);
    transition: transform 0.18s;
}
:where(body[data-tool="compress-img"]) .sec.closed .arrow {
    transform: rotate(-90deg);
}
:where(body[data-tool="compress-img"]) .sec.closed .sec-bd {
    display: none;
}
:where(body[data-tool="compress-img"]) .sec-bd {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
:where(body[data-tool="compress-img"]) .row {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: space-between;
}
:where(body[data-tool="compress-img"]) .lbl {
    font-size: 11px;
    color: var(--text-primary);
    min-width: 72px;
    flex-shrink: 0;
}
:where(body[data-tool="compress-img"]) .ctrl {
    flex: 1;
}
:where(body[data-tool="compress-img"]) .inp {
    width: 100%;
    background: var(--bg-quaternary);
    border: 1px solid var(--border-color);
    border-radius: 7px;
    padding: 6px 9px;
    color: var(--text-primary);
    font-size: 12px;
    outline: none;
    transition: border-color 0.15s;
}
:where(body[data-tool="compress-img"]) .inp:focus {
    border-color: var(--primary);
}
:where(body[data-tool="compress-img"]) select.inp {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238b8baa' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 8px center;
    padding-left: 24px;
}
:where(body[data-tool="compress-img"]) .rrow {
    display: flex;
    align-items: center;
    gap: 8px;
}
:where(body[data-tool="compress-img"]) input[type="range"] {
    flex: 1;
    height: 3px;
    appearance: none;
    background: var(--bg-quaternary);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    margin: 0;
}
:where(body[data-tool="compress-img"]) input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--bg-secondary);
    transition: transform 0.15s;
}
:where(body[data-tool="compress-img"]) input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.25);
}
:where(body[data-tool="compress-img"]) .rval {
    font-size: 11px;
    color: var(--primary);
    min-width: 30px;
    text-align: center;
    background: var(--bg-quaternary);
    border-radius: 4px;
    padding: 2px 5px;
}
:where(body[data-tool="compress-img"]) .segs {
    display: flex;
    gap: 2px;
    background: var(--bg-quaternary);
    border-radius: 7px;
    padding: 2px;
}
:where(body[data-tool="compress-img"]) .seg {
    flex: 1;
    padding: 5px 3px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 11px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.14s;
}
:where(body[data-tool="compress-img"]) .seg.on {
    background: var(--primary);
    color: #fff;
}
:where(body[data-tool="compress-img"]) .ftabs {
    display: flex;
    gap: 2px;
    background: var(--bg-quaternary);
    border-radius: 7px;
    padding: 2px;
}
:where(body[data-tool="compress-img"]) .ftab {
    flex: 1;
    padding: 5px 2px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 11px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.14s;
    letter-spacing: 0.3px;
    margin: 0;
}
:where(body[data-tool="compress-img"]) .ftab:hover {
    color: var(--text-primary);
}
:where(body[data-tool="compress-img"]) .ftab.on {
    background: var(--primary);
    color: #fff;
}
:where(body[data-tool="compress-img"]) .dims {
    display: flex;
    gap: 6px;
    align-items: end;
}
:where(body[data-tool="compress-img"]) .df {
    flex: 1;
}
:where(body[data-tool="compress-img"]) .dlbl {
    font-size: 9px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}
:where(body[data-tool="compress-img"]) .di {
    width: 100%;
    background: var(--bg-quaternary);
    border: 1px solid var(--border-color);
    border-radius: 7px;
    padding: 7px 8px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    text-align: center;
    transition: border-color 0.15s;
}
:where(body[data-tool="compress-img"]) .di:focus {
    border-color: var(--primary);
}
:where(body[data-tool="compress-img"]) .lock-btn {
    background: var(--bg-quaternary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.14s;
    flex-shrink: 0;
}
:where(body[data-tool="compress-img"]) .lock-btn:hover {
    border-color: var(--primary);
}
:where(body[data-tool="compress-img"]) .lock-btn.on {
    border-color: var(--green);
}
:where(body[data-tool="compress-img"]) .size-card {
    background: var(--bg-quaternary);
    border-radius: 7px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 0;
}
:where(body[data-tool="compress-img"]) .sz {
    text-align: center;
    flex: 1;
}
:where(body[data-tool="compress-img"]) .sz-num {
    font-size: 16px;
    line-height: 1em;
}
:where(body[data-tool="compress-img"]) .sz-lbl {
    font-size: 9px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-top: 2px;
}
:where(body[data-tool="compress-img"]) .sz-arr {
    color: var(--text-tertiary);
    font-size: 14px;
}
:where(body[data-tool="compress-img"]) .sz-pct {
    font-size: 18px;
}
:where(body[data-tool="compress-img"]) .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 14px;
    border: none;
    border-radius: 7px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
}
:where(body[data-tool="compress-img"]) .btn-primary {
    background: var(--primary);
    color: #fff;
}
:where(body[data-tool="compress-img"]) .btn-primary:hover {
    background: #9b8ff7;
}
:where(body[data-tool="compress-img"]) .btn-ghost {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}
:where(body[data-tool="compress-img"]) .btn-green {
    background: #059669;
    color: #fff;
}
:where(body[data-tool="compress-img"]) .btn-green:hover {
    background: var(--green);
}
:where(body[data-tool="compress-img"]) .btn-sm {
    padding: 5px 10px;
    font-size: 11px;
}
:where(body[data-tool="compress-img"]) .btn-full {
    width: 100%;
}
:where(body[data-tool="compress-img"]) .btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
:where(body[data-tool="compress-img"]) .dl-panel {
    padding: 12px;
    flex-shrink: 0;
}
:where(body[data-tool="compress-img"]) .dl-info {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px !important;
    color: var(--text-primary);
    justify-content: flex-start;
    flex-direction: row-reverse;
}
:where(body[data-tool="compress-img"]) .badge {
    padding: 2px 7px;
    border-radius: 99px;
    font-size: 14px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
:where(body[data-tool="compress-img"]) .badge-p {
    padding: 4px 12px;
    background: rgba(124, 106, 247, 0.2);
    border-radius: 10px;
}
:where(body[data-tool="compress-img"]) .badge-g {
    background: rgba(52, 211, 153, 0.15);
    color: var(--green);
}
:where(body[data-tool="compress-img"]) #dl-sz {
    padding: 4px 12px;
    background: rgba(124, 106, 247, 0.2);
    border-radius: 10px;
}
:where(body[data-tool="compress-img"]) .prog-wrap {
    background: var(--bg-quaternary);
    border-radius: 3px;
    height: 3px;
    overflow: hidden;
    margin-top: 6px;
    display: none;
}
:where(body[data-tool="compress-img"]) .prog-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.2s;
}
:where(body[data-tool="compress-img"]) .preview-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
:where(body[data-tool="compress-img"]) .ptoolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px 20px;
    flex-shrink: 0;
}
:where(body[data-tool="compress-img"]) .zoom-ctrl {
    display: flex;
    align-items: center;
    gap: 4px;
}
:where(body[data-tool="compress-img"]) .zbtn {
    width: 34px;
    height: 34px;
    background: var(--bg-tertiary);
    border-radius: 7px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.14s;
    padding: 0;
}
:where(body[data-tool="compress-img"]) .zbtn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
:where(body[data-tool="compress-img"]) .zval {
    font-size: 11px;
    color: var(--text-primary);
    min-width: 34px;
    text-align: center;
}
:where(body[data-tool="compress-img"]) .preview-wrap {
    flex: 1;
    overflow: hidden;
    position: relative;
    cursor: grab;
    border-radius: 20px;
    margin: 20px;
}
:where(body[data-tool="compress-img"]) .preview-wrap:active {
    cursor: grabbing;
}
:where(body[data-tool="compress-img"]) .preview-wrap.wheel-zoom {
    cursor: crosshair;
}
:where(body[data-tool="compress-img"]) .compare-root {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 0 0;
    user-select: none;
}
:where(body[data-tool="compress-img"]) .compare-box {
    position: relative;
    overflow: hidden;
}
:where(body[data-tool="compress-img"]) .cimg-back {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    pointer-events: none;
}
:where(body[data-tool="compress-img"]) .cimg-front-wrap {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    overflow: hidden;
}
:where(body[data-tool="compress-img"]) .cimg-front {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    object-fit: fill;
    pointer-events: none;
}
:where(body[data-tool="compress-img"]) .c-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #fff;
    transform: translateX(-50%);
    cursor: col-resize;
    z-index: 10;
}
:where(body[data-tool="compress-img"]) .c-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #333;
    cursor: col-resize;
    border: 1px solid #bdbdbd;
}
:where(body[data-tool="compress-img"]) .c-label {
    position: absolute;
    top: 12px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    border-radius: 5px;
    padding: 3px 9px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    pointer-events: none;
    z-index: 5;
}
:where(body[data-tool="compress-img"]) .c-label-orig {
    left: 12px;
}
:where(body[data-tool="compress-img"]) .c-label-out {
    right: 12px;
}
:where(body[data-tool="compress-img"]) .empty-msg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--text-tertiary);
}
:where(body[data-tool="compress-img"]) .empty-msg span {
    font-size: 40px;
    display: block;
    margin-bottom: 10px;
}
:where(body[data-tool="compress-img"]) .thumbs {
    display: flex;
    gap: 5px;
    padding: 15px 14px;
    overflow-x: auto;
    flex-shrink: 0;
}
:where(body[data-tool="compress-img"]) .thumbs::-webkit-scrollbar {
    height: 3px;
}
:where(body[data-tool="compress-img"]) .thumbs::-webkit-scrollbar-thumb {
    background: var(--bg-quaternary);
}
:where(body[data-tool="compress-img"]) .th {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 7px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.15s;
    position: relative;
    background: var(--bg-tertiary);
}
:where(body[data-tool="compress-img"]) .th:hover {
    border-color: #a78bfa;
}
:where(body[data-tool="compress-img"]) .th.on {
    border-color: var(--primary);
}
:where(body[data-tool="compress-img"]) .th img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
:where(body[data-tool="compress-img"]) .th-del {
    position: absolute;
    top: 1px;
    right: 1px;
    background: rgba(248, 113, 113, 0.9);
    border: none;
    border-radius: 50px;
    font-size: 17px;
    text-align: center;
    cursor: pointer;
    color: #fff;
    display: none;
    padding: 5px;
    line-height: 10px;
    display: none;
}
:where(body[data-tool="compress-img"]) .th:hover .th-del {
    display: block;
}
:where(body[data-tool="compress-img"]) .th-add {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 7px;
    border: 2px dashed rgba(124, 106, 247, 0.35);
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--primary);
    transition: all 0.15s;
}
:where(body[data-tool="compress-img"]) .th-add:hover {
    border-color: var(--primary);
    background: rgba(124, 106, 247, 0.07);
}
:where(body[data-tool="compress-img"]) .proc-ov {
    position: absolute;
    inset: 0;
    background: rgba(12, 12, 17, 0.7);
    backdrop-filter: blur(3px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    z-index: 50;
}
:where(body[data-tool="compress-img"]) .spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--bg-quaternary);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: compress-img-spin 0.7s linear infinite;
}
@keyframes compress-img-spin {
    to {
        transform: rotate(360deg);
    }
}
:where(body[data-tool="compress-img"]) .proc-txt {
    font-size: 12px;
    color: var(--text-primary);
}
:where(body[data-tool="compress-img"]) p#h-name {
    width: 70px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
:where(body[data-tool="compress-img"]) div#hstats {
    display: flex;
}
:where(body[data-tool="compress-img"]) input[type="checkbox"] {
    accent-color: var(--primary);
    cursor: pointer;
}
@media (max-width: 768px) {:where(body[data-tool="compress-img"]) .workspace {
        flex-direction: column;
    }
:where(body[data-tool="compress-img"]) .panel {
        width: 100%;
    }

}

/* Stable image sizing for local files and generated previews. */
:where(body[data-tool="compress-img"]) .workspace,
:where(body[data-tool="compress-img"]) .preview-area,
:where(body[data-tool="compress-img"]) .preview-wrap {
    min-width: 0;
    min-height: 0;
}
:where(body[data-tool="compress-img"]) .thumbs {
    align-items: center;
    min-height: 76px;
}
:where(body[data-tool="compress-img"]) .th,
:where(body[data-tool="compress-img"]) .th-add {
    width: 58px;
    height: 58px;
}
:where(body[data-tool="compress-img"]) .th img {
    display: block;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    object-fit: cover;
}
:where(body[data-tool="compress-img"]) .th.is-error {
    border-color: var(--danger);
}
:where(body[data-tool="compress-img"]) .th.is-error::after {
    content: "!";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff;
    background: rgba(220, 53, 69, .72);
    font-weight: 700;
}