/* PDF Compress: level cards, target-size chips, progress and result. */

.pdfc-levels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 10px;
    margin: 6px 0 14px;
    padding: 0;
    border: 0;
    min-width: 0;
}

.pdfc-levels legend {
    padding: 0;
    margin-bottom: 10px;
}

.pdfc-level {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    cursor: pointer;
    transition: border-color 140ms ease, background-color 140ms ease;
}

.pdfc-level:hover { border-color: var(--primary); }

.pdfc-level:has(input:checked) {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 8%, var(--bg));
    box-shadow: 0 0 0 1px var(--primary);
}

.pdfc-level:focus-within {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.pdfc-level input {
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    flex: none;
    accent-color: var(--primary);
}

.pdfc-level__copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.pdfc-level__copy strong { font-size: 0.95rem; }

.pdfc-level__copy span {
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.pdfc-target {
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px dashed var(--border);
    border-radius: 10px;
}

.pdfc-target[hidden] { display: none; }

.pdfc-target__label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 600;
}

.pdfc-target__chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.pdfc-chip {
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}

.pdfc-chip:hover { border-color: var(--primary); }

.pdfc-chip[aria-pressed="true"] {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.pdfc-custom {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
}

.pdfc-custom input {
    width: 6.5em;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
}

.pdfc-custom:has(input:focus),
.pdfc-custom.is-active input {
    color: var(--primary);
}

.pdfc-custom.is-active input { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }

.pdfc-note {
    margin: 0 0 14px;
    padding: 8px 12px;
    border-left: 3px solid #d97706;
    border-radius: 6px;
    background: color-mix(in srgb, #f59e0b 10%, var(--bg));
    font-size: 0.85rem;
}

.pdfc-note[hidden] { display: none; }

.pdfc-progress { margin: 4px 0 14px; }
.pdfc-progress[hidden] { display: none; }

.pdfc-progress__track {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--border);
}

.pdfc-progress__track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--primary);
    transition: width 200ms ease;
}

.pdfc-progress__text {
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.pdfc-result[hidden] { display: none; }

.pdfc-result__sizes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.pdfc-result__sizes div {
    display: grid;
    gap: 2px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    text-align: center;
}

.pdfc-result__sizes span {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.pdfc-result__sizes strong { font-size: 1.1rem; }

#pdfc-size-saved { color: #15803d; }

:root[data-theme="dark"] #pdfc-size-saved { color: #4ade80; }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) #pdfc-size-saved { color: #4ade80; }
}

.pdfc-result__info {
    margin: 10px 0;
    font-size: 0.9rem;
}

.pdfc-result__info a { color: var(--primary); }

.pdfc-preview {
    margin: 0;
    text-align: center;
}

.pdfc-preview canvas {
    display: block;
    max-width: min(100%, 520px);
    height: auto;
    margin: 0 auto;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.pdfc-preview figcaption {
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.pdfc-preview figcaption a { color: var(--primary); }

@media (max-width: 600px) {
    .pdfc-levels { grid-template-columns: 1fr; }
    .pdfc-result__sizes { gap: 6px; }
    .pdfc-result__sizes strong { font-size: 0.95rem; }
}
