.tool-remove-extra-spaces { max-width: 720px; margin: var(--space-6) auto 0; }

.res-field {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: var(--space-4);
    margin-bottom: var(--space-4);
}
.res-label {
    display: flex; justify-content: space-between; align-items: baseline;
    font-weight: 500; font-size: .9rem; margin-bottom: var(--space-2); color: var(--text);
}
.res-count { font-size: .78rem; color: var(--text-muted); font-weight: 400; }
.res-textarea {
    width: 100%; resize: vertical; padding: var(--space-3);
    border: 1px solid var(--border); border-radius: var(--radius);
    background: #fff; color: inherit; font: inherit; font-size: .9rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    line-height: 1.55;
}
.res-textarea:focus {
    outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary);
}
.res-textarea--output { background: #f8fafc; }

.res-fieldset {
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: var(--space-4); margin-bottom: var(--space-4); background: var(--surface);
}
.res-fieldset__legend {
    padding: 0 var(--space-2); font-size: .78rem; font-weight: 700;
    letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted);
}
.res-checkbox {
    display: flex; align-items: center; gap: var(--space-2);
    font-size: .9rem; cursor: pointer; padding: var(--space-1) 0;
}
.res-checkbox input[type="checkbox"] {
    width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer;
}

.res-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }

.res-btn {
    display: inline-block; padding: .6rem 1.1rem; border: 1px solid var(--border);
    background: var(--surface); color: var(--text); border-radius: var(--radius);
    font: inherit; font-weight: 500; cursor: pointer;
    transition: border-color .12s ease, background-color .12s ease, color .12s ease;
}
.res-btn:hover, .res-btn:focus-visible { border-color: var(--primary); color: var(--primary); outline: none; }
.res-btn--primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.res-btn--primary:hover, .res-btn--primary:focus-visible { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }

.res-hint { font-size: .85rem; color: var(--success); min-height: 1.2em; }
.res-hint.is-error { color: var(--danger); }

@media (max-width: 380px) {
    .res-actions { flex-direction: column; align-items: stretch; }
    .res-actions .res-btn { width: 100%; text-align: center; }
}