/* ============================================================
   Image Compressor — page styles
   Uses the same tokens/patterns as styles/main.css and
   styles/dev-tools.css so the page matches the other tools.
   ============================================================ */

/* Header title sits between the site title and the 46px homepage style. */
.logo .logo-title {
    font-size: 30px;
    line-height: 1.2;
}

.cmp-title {
    font-size: 26px;
    line-height: 1.3;
    align-items: flex-start;
}

.cmp-title svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.cmp-subtitle {
    margin: 0 0 18px;
    font-size: 14px;
    line-height: 1.65;
    color: #5f6368;
}

.cmp-privacy {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: -6px 0 10px;
    color: #137333;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
}

.cmp-privacy svg {
    flex-shrink: 0;
    margin-top: 2px;
}

/* Shown only when JavaScript is disabled: the controls below stay inert. */
.cmp-noscript {
    margin: 0 0 18px;
    padding: 12px 14px;
    border: 1px solid #f0c36d;
    border-radius: 8px;
    background: #fff8e5;
    color: #6b4a00;
    font-size: 14px;
    line-height: 1.6;
}

/* ---- drop zone ---- */
.cmp-dropzone {
    display: block;
    border: 2px dashed #c4c7cc;
    border-radius: 12px;
    padding: 22px 16px;
    text-align: center;
    background: #fafbfc;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}

.cmp-dropzone:hover,
.cmp-dropzone:focus-visible,
.cmp-dropzone.dragover {
    border-color: #1a73e8;
    background: #e8f0fe;
    outline: none;
}

.cmp-dropzone-icon {
    display: block;
    color: #1a73e8;
    line-height: 0;
    margin-bottom: 6px;
}

.cmp-dropzone-text {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #1f2328;
}

.cmp-dropzone-hint {
    display: block;
    margin-top: 6px;
    font-size: 12.5px;
    color: #5f6368;
}

/* ---- parameter panel ---- */
/* Two columns: the quality slider owns a full row of its own, then the output
   format and the max-dimension input share the second row. */
.cmp-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-top: 16px;
}

.cmp-field {
    min-width: 0;
}

.cmp-field-slider {
    grid-column: 1 / -1;
}

.cmp-field-slider .cmp-field-label {
    margin-bottom: 4px;
}

.cmp-field-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #3c4043;
    margin-bottom: 7px;
}

.cmp-quality-value {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: 13px;
    color: #1a73e8;
    background: #e8f0fe;
    border-radius: 6px;
    padding: 1px 8px;
}

/* Lossless mode: the read-out stays visible (the slider is disabled, so it is the
   only place that states why), but drops the accent colour. */
.cmp-quality-value.is-lossless {
    color: #3c4043;
    background: #f1f3f4;
}

.cmp-quality-ends {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    color: #5f6368;
}

/* Direction hints are drawn with pseudo-elements so the translated text stays
   clean (no arrow characters to maintain in every language pack). */
.cmp-quality-ends span:first-child::before {
    content: '\2190'; /* ← */
    margin-right: 4px;
    color: #9aa0a6;
}

.cmp-quality-ends span:last-child::after {
    content: '\2192'; /* → */
    margin-left: 4px;
    color: #9aa0a6;
}

.cmp-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 24px;
    margin: 0;
    background: transparent;
    cursor: pointer;
}

.cmp-range:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.cmp-range::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 999px;
    background: #dadce0;
}

.cmp-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    margin-top: -7px;
    border-radius: 50%;
    background: #1a73e8;
    border: 3px solid #fff;
    box-shadow: 0 1px 4px rgba(16, 42, 74, .35);
}

.cmp-range::-moz-range-track {
    height: 6px;
    border-radius: 999px;
    background: #dadce0;
}

.cmp-range::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #1a73e8;
    border: 3px solid #fff;
    box-shadow: 0 1px 4px rgba(16, 42, 74, .35);
}

.cmp-select {
    width: 100%;
    padding: 10px 10px;
    font-size: 13.5px;
    line-height: 1.3;
    color: #1f2328;
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    box-sizing: border-box;
}

.cmp-select:focus,
.cmp-number:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, .15);
}

.cmp-number {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.3;
    color: #1f2328;
    border: 1px solid #dadce0;
    border-radius: 8px;
    box-sizing: border-box;
}

.cmp-number.is-invalid {
    border-color: #d93025;
    box-shadow: 0 0 0 3px rgba(217, 48, 37, .12);
}

.cmp-field-hint {
    margin-top: 5px;
    font-size: 11.5px;
    line-height: 1.45;
    color: #80868b;
}

/* ---- actions ---- */
/* One primary action, so it is centred and wide enough to read as "the" step:
   full column width up to 380px, then capped so it never looks like a bar. */
.cmp-actions {
    justify-content: center;
}

.cmp-actions .dev-tool-btn {
    width: 100%;
    max-width: 380px;
    justify-content: center;
    padding: 12px 24px;
    font-size: 15px;
}

.dev-tool-btn[disabled] {
    opacity: .55;
    cursor: not-allowed;
}

/* ---- results ---- */
.cmp-results {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid #eaeaea;
}

.cmp-results[hidden] {
    display: none;
}

.cmp-results-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin-bottom: 12px;
}

.cmp-results-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #1f2328;
}

.cmp-summary {
    font-size: 13px;
    font-weight: 600;
    color: #137333;
}

.cmp-summary.is-larger {
    color: #d93025;
}

.cmp-results-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: auto;
}

.cmp-mini-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #3c4043;
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
}

.cmp-mini-btn:hover {
    background: #f1f3f4;
    border-color: #c4c7cc;
}

.cmp-mini-btn.primary {
    color: #fff;
    background: #1a73e8;
    border-color: #1a73e8;
}

.cmp-mini-btn.primary:hover {
    background: #1765cc;
    border-color: #1765cc;
}

.cmp-mini-btn[disabled] {
    opacity: .55;
    cursor: not-allowed;
}

.cmp-list {
    display: grid;
    gap: 10px;
}

.cmp-card {
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #e3e6ea;
    border-radius: 10px;
}

.cmp-card[data-state="working"] {
    border-color: #c6dafc;
    background: #f8fbff;
}

.cmp-card[data-state="error"] {
    border-color: #f4c7c3;
    background: #fefaf9;
}

.cmp-card-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.cmp-card-name {
    flex: 1 1 200px;
    min-width: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1f2328;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cmp-card-sizes {
    font-size: 13px;
    color: #5f6368;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.cmp-card-sizes strong {
    color: #1f2328;
}

.cmp-arrow {
    margin: 0 6px;
    color: #9aa0a6;
}

.cmp-badge {
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    border-radius: 999px;
    background: #e6f4ea;
    color: #137333;
}

.cmp-badge.is-larger {
    background: #fce8e6;
    color: #d93025;
}

.cmp-badge.is-neutral,
.cmp-badge.is-queued {
    background: #f1f3f4;
    color: #5f6368;
}

.cmp-badge.is-working {
    background: #e8f0fe;
    color: #1a73e8;
}

.cmp-card-download {
    margin-left: auto;
}

.cmp-card-note {
    margin: 8px 0 0;
    font-size: 12px;
    line-height: 1.5;
}

.cmp-card-note.warn {
    color: #b06000;
}

.cmp-card-note.error {
    color: #d93025;
}

.cmp-card-dims {
    margin: 6px 0 0;
    font-size: 12px;
    color: #80868b;
}

/* ---- explanation blocks ---- */
.cmp-guide {
    display: grid;
    gap: 8px;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}

.cmp-guide li {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 0;
    padding: 10px 12px;
    background: #fafbfc;
    border: 1px solid #e3e6ea;
    border-radius: 9px;
}

.cmp-guide b {
    flex-shrink: 0;
    color: #1a73e8;
    font-variant-numeric: tabular-nums;
}

.cmp-related {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.cmp-related a {
    padding: 9px 14px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    color: #1a73e8;
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 8px;
}

.cmp-related a:hover {
    background: #e8f0fe;
    border-color: #1a73e8;
}

/* ---- responsive ---- */
@media (max-width: 640px) {
    .cmp-title {
        font-size: 20px;
    }

    .cmp-privacy {
        font-size: 13px;
    }

    .cmp-dropzone {
        padding: 18px 12px;
    }

    .cmp-options {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .cmp-field-slider {
        grid-column: auto;
    }

    .cmp-results-actions {
        margin-left: 0;
    }

    .cmp-card-download {
        margin-left: 0;
        width: 100%;
    }
}

.geo-answer-title {
    margin: 12px 0 6px;
    font-size: 16px;
    line-height: 1.4;
}

.cmp-key-facts {
    margin: 18px 0 0;
    padding: 14px 16px;
    background: #f8f9fa;
    border: 1px solid #e6e9ed;
    border-radius: 10px;
}

.cmp-key-facts h2 {
    margin: 0 0 8px;
    font-size: 16px;
    line-height: 1.4;
}

.cmp-key-facts ul {
    margin: 0;
    padding-left: 20px;
    font-size: 14px;
    line-height: 1.6;
    color: #3c4043;
}

.cmp-key-facts li + li {
    margin-top: 6px;
}
