.page-tool--html-formatter .tool-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.page-tool--html-formatter .tool-controls__body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.page-tool--html-formatter .tool-options {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px;
}

.page-tool--html-formatter .tool-options .field {
    margin: 0;
    min-width: 170px;
}

.page-tool--html-formatter .tool-check {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1.35;
}

.page-tool--html-formatter .tool-check input {
    flex: 0 0 auto;
    margin-top: 2px;
}

.page-tool--html-formatter .tool-check strong {
    display: block;
    color: var(--ink);
    font-weight: 600;
}

.page-tool--html-formatter .tool-check small {
    display: block;
    color: var(--muted);
    font-size: 0.76rem;
}

.page-tool--html-formatter .tool-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.page-tool--html-formatter .tool-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
}

.page-tool--html-formatter .tool-pane {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.page-tool--html-formatter .tool-pane__body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.page-tool--html-formatter .tool-textarea {
    display: block;
    flex: 1 1 auto;
    min-height: 27rem;
    padding: 14px 16px;
    border: 0;
    border-radius: 0;
    background: var(--surface);
    font-size: 0.84rem;
    line-height: 1.55;
    resize: vertical;
}

.page-tool--html-formatter .tool-textarea:focus {
    box-shadow: none;
}

.page-tool--html-formatter .tool-hint {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.page-tool--html-formatter .tool-hint code {
    padding: 0.05rem 0.35rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-xs);
    background: var(--surface-3);
    color: var(--ink-2);
    font-family: var(--font-mono);
}

.page-tool--html-formatter .tool-hint--note {
    padding: 11px 16px;
    border-top: 1px solid var(--line);
    background: var(--surface-2);
}

.page-tool--html-formatter .tool-status {
    min-height: 0;
    margin: 0;
    padding: 11px 16px;
    border-bottom: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--muted);
}

.page-tool--html-formatter .tool-status.status {
    margin: 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
}

.page-tool--html-formatter .tool-status.status--error {
    background: var(--danger-soft);
    color: var(--danger);
}

.page-tool--html-formatter .tool-status.status--success {
    background: var(--success-soft);
    color: var(--success);
}

.page-tool--html-formatter .tool-error {
    margin: 0;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--danger-soft);
    color: var(--danger);
    font-size: 0.82rem;
}

.page-tool--html-formatter .tool-error__message {
    margin: 0 0 4px;
    font-family: var(--font-mono);
    font-weight: 600;
}

.page-tool--html-formatter .tool-error__hint {
    margin: 0;
    color: var(--danger);
    opacity: 0.85;
    font-size: 0.76rem;
}

.page-tool--html-formatter .tool-error__hint code {
    font-family: var(--font-mono);
}

.page-tool--html-formatter .tool-warning {
    margin: 0;
    padding: 10px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-3);
    color: var(--ink-2);
    font-size: 0.78rem;
}

.page-tool--html-formatter .tool-output {
    flex: 1 1 auto;
    min-height: 0;
    max-height: 27rem;
    margin: 0;
    padding: 14px 16px;
    border: 0;
    border-radius: 0;
    background: var(--surface);
    overflow: auto;
    white-space: pre;
}

.page-tool--html-formatter .tool-output:empty::before {
    content: 'Formatted HTML appears here.';
    color: var(--faint);
    font-family: var(--font-sans);
}

.page-tool--html-formatter .tool-stats {
    margin: 0;
    padding: 10px 16px;
    border-top: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.74rem;
}

.page-tool--html-formatter .tool-stats:empty {
    display: none;
}

.page-tool--html-formatter .tool-output__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 11px 16px;
    border-top: 1px solid var(--line);
    background: var(--surface-2);
}

.page-tool--html-formatter .tool-about__text {
    max-width: 80ch;
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.page-tool--html-formatter .tool-about__text code {
    padding: 0.05rem 0.3rem;
    border-radius: var(--radius-xs);
    background: var(--surface-3);
    color: var(--ink-2);
    font-family: var(--font-mono);
}

@media (max-width: 860px) {
    .page-tool--html-formatter .tool-workspace {
        grid-template-columns: 1fr;
    }

    .page-tool--html-formatter .tool-textarea,
    .page-tool--html-formatter .tool-output {
        min-height: 16rem;
    }

    .page-tool--html-formatter .tool-output {
        max-height: 22rem;
    }
}
