:root {
    --color-primary: #e5322d;
    --color-primary-dark: #c72622;
    --color-success: #1f9d55;
    --color-success-bg: #eafaf0;
    --color-error: #e0342a;
    --color-error-bg: #fdecec;
    --color-text: #1f2430;
    --color-muted: #6b7280;
    --color-border: #e4e7eb;
    --color-bg: #f6f7f9;
    --color-card: #ffffff;
    --radius: 12px;
    --shadow: 0 2px 10px rgba(20, 20, 30, 0.06);
    font-size: 16px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.55;
}

.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 20px;
}

a { color: var(--color-primary); }

/* Header */
.site-header {
    background: var(--color-card);
    border-bottom: 1px solid var(--color-border);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
}
.back-home {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    text-decoration: none;
    color: var(--color-text);
    font-size: 0.95rem;
}
.back-home:hover { color: var(--color-primary); }
.brand {
    margin-left: auto;
    font-weight: 700;
    text-decoration: none;
    color: var(--color-text);
    font-size: 1.05rem;
}
.brand-mark {
    color: var(--color-primary);
}
.header-spacer { display: none; }

/* Hero */
.hero {
    text-align: center;
    padding: 40px 0 20px;
}
.hero h1 {
    font-size: 2rem;
    margin: 0 0 10px;
}
.hero-sub {
    color: var(--color-muted);
    max-width: 620px;
    margin: 0 auto;
    font-size: 1.05rem;
}

/* Ads */
.ad-slot {
    margin: 24px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 90px;
}
.ad-slot--placeholder {
    border: 1px dashed var(--color-border);
    border-radius: var(--radius);
    color: var(--color-muted);
    font-size: 0.85rem;
    background: repeating-linear-gradient(45deg, #fafafa, #fafafa 10px, #f2f2f2 10px, #f2f2f2 20px);
}

/* Tool card */
.tool-card {
    background: var(--color-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
    margin: 24px 0;
}
.tool-step { display: none; }
.tool-step.is-active { display: block; }

.dropzone {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius);
    padding: 48px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
    color: var(--color-muted);
}
.dropzone:hover, .dropzone:focus-visible, .dropzone.is-dragover {
    border-color: var(--color-primary);
    background: #fff6f5;
    outline: none;
}
.dropzone-icon { color: var(--color-primary); margin-bottom: 8px; }
.dropzone-title { font-size: 1.1rem; color: var(--color-text); margin: 8px 0 4px; }
.link-text { color: var(--color-primary); text-decoration: underline; }
.dropzone-hint { font-size: 0.85rem; margin: 0; }

.file-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    margin-bottom: 24px;
}
.file-summary svg { color: var(--color-primary); flex-shrink: 0; }
.file-summary-text { display: flex; flex-direction: column; overflow: hidden; }
.file-summary-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-summary-text span { color: var(--color-muted); font-size: 0.85rem; }
.link-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--color-primary);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 4px 8px;
}
.link-btn:hover { text-decoration: underline; }

fieldset.split-mode {
    border: none;
    padding: 0;
    margin: 0 0 24px;
}
fieldset.split-mode legend {
    font-weight: 600;
    margin-bottom: 12px;
    padding: 0;
}
.radio-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}
.radio-card:hover { border-color: var(--color-primary); }
.radio-card input { margin-top: 4px; accent-color: var(--color-primary); }
.radio-card-title { display: block; font-weight: 600; }
.radio-card-desc { display: block; color: var(--color-muted); font-size: 0.88rem; margin-top: 2px; }
.radio-card:has(input:checked) {
    border-color: var(--color-primary);
    background: #fff6f5;
}

.range-input-wrap {
    margin: 4px 0 4px 30px;
    padding: 14px 16px;
    background: var(--color-bg);
    border-radius: var(--radius);
}
.range-input-wrap label { font-weight: 600; font-size: 0.9rem; display: block; margin-bottom: 6px; }
.range-input-wrap input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 1rem;
}
.field-hint { color: var(--color-muted); font-size: 0.82rem; margin: 6px 0 0; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 22px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .15s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }
.btn-block { width: 100%; }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-primary:disabled { background: #f0a6a3; cursor: not-allowed; }
.btn-success { background: var(--color-success); color: #fff; }
.btn-success:hover { background: #17803f; }
.btn-secondary { background: var(--color-bg); color: var(--color-text); border: 1px solid var(--color-border); }

/* Progress */
.progress-label { text-align: center; font-weight: 600; margin-bottom: 16px; }
.progress-track {
    background: var(--color-bg);
    border-radius: 999px;
    height: 14px;
    overflow: hidden;
    border: 1px solid var(--color-border);
}
.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-primary), #ff6b5e);
    border-radius: 999px;
    transition: width .2s ease, background-color .3s ease;
}
.progress-bar.is-processing {
    background: repeating-linear-gradient(45deg, var(--color-primary), var(--color-primary) 12px, #ff8b80 12px, #ff8b80 24px);
    background-size: 200% 100%;
    animation: progress-stripes 1s linear infinite;
}
.progress-bar.is-done { background: var(--color-success); }
@keyframes progress-stripes {
    from { background-position: 0 0; }
    to { background-position: 34px 0; }
}
.progress-percent { text-align: center; color: var(--color-muted); margin-top: 10px; font-variant-numeric: tabular-nums; }

/* Compression compare stats */
.engine-note {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 12px 16px;
    color: var(--color-muted);
    font-size: 0.85rem;
    margin: 0 0 18px;
}
.compare-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 18px 0 6px;
}
.compare-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 20px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    min-width: 120px;
}
.compare-box--new { border-color: var(--color-success); background: var(--color-success-bg); }
.compare-label { font-size: 0.78rem; color: var(--color-muted); text-transform: uppercase; letter-spacing: .04em; }
.compare-value { font-weight: 700; font-size: 1.1rem; }
.compare-arrow { color: var(--color-muted); flex-shrink: 0; }
.saved-badge {
    text-align: center;
    color: var(--color-success);
    font-weight: 700;
    margin: 4px 0 22px;
}
.saved-badge--none { color: var(--color-muted); }

/* Result */
.result-success, .result-error {
    text-align: center;
    padding: 12px 0;
}
.result-success svg { color: var(--color-success); }
.result-success h2 { margin: 12px 0 4px; }
#result-summary { color: var(--color-muted); margin-bottom: 22px; }
.result-error svg { color: var(--color-error); }
#error-message { color: var(--color-error); font-weight: 600; margin: 10px 0 20px; }

/* Content sections */
.content-block { margin: 40px 0; }
.content-block h2 { font-size: 1.4rem; margin-bottom: 14px; }
.steps-list { padding-left: 20px; }
.steps-list li { margin-bottom: 10px; }
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}
.feature {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 18px;
}
.feature h3 { margin: 0 0 6px; font-size: 1.02rem; }
.feature p { margin: 0; color: var(--color-muted); font-size: 0.92rem; }

.faq details {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 10px;
}
.faq summary { font-weight: 600; cursor: pointer; }
.faq p { color: var(--color-muted); margin: 10px 0 0; }

/* Footer */
.site-footer {
    border-top: 1px solid var(--color-border);
    margin-top: 40px;
    padding: 24px 0 40px;
    color: var(--color-muted);
    font-size: 0.88rem;
    text-align: center;
}
.footer-inner p { margin: 4px 0; }

@media (max-width: 600px) {
    .tool-card { padding: 22px 18px; }
    .hero h1 { font-size: 1.6rem; }
}
