.page-tool--css-selector-match-tester .tool-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.page-tool--css-selector-match-tester .tool-selector__body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.page-tool--css-selector-match-tester .search--selector .search__input {
    font-family: var(--font-mono);
    font-size: 0.95rem;
}

.page-tool--css-selector-match-tester .tool-hint {
    margin: 0;
    color: var(--muted);
    font-size: 0.8rem;
}

.page-tool--css-selector-match-tester .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--css-selector-match-tester .tool-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

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

.page-tool--css-selector-match-tester .tool-pane {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.page-tool--css-selector-match-tester .tool-pane__body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.page-tool--css-selector-match-tester .tool-textarea {
    display: block;
    flex: 1 1 auto;
    min-height: 26rem;
    padding: 14px 16px;
    border: 0;
    border-radius: 0;
    background: var(--surface);
}

.page-tool--css-selector-match-tester .tool-textarea:focus {
    box-shadow: none;
}

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

.page-tool--css-selector-match-tester .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--css-selector-match-tester .tool-status.status {
    margin: 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
}

.page-tool--css-selector-match-tester .tool-status.status--error {
    background: var(--danger-soft);
    color: var(--danger);
}

.page-tool--css-selector-match-tester .tool-status.status--success {
    background: var(--success-soft);
    color: var(--success);
}

.page-tool--css-selector-match-tester .tool-results {
    flex: 1 1 auto;
    min-height: 0;
    max-height: 26rem;
    overflow: auto;
    background: var(--surface);
}

.page-tool--css-selector-match-tester .tool-results .empty-state {
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 2.5rem 1.25rem;
}

.page-tool--css-selector-match-tester .tool-match-list {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: match;
}

.page-tool--css-selector-match-tester .tool-match {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 9px 16px;
    border-bottom: 1px solid var(--line);
    font-size: 0.82rem;
    counter-increment: match;
}

.page-tool--css-selector-match-tester .tool-match:nth-child(even) {
    background: var(--surface-2);
}

.page-tool--css-selector-match-tester .tool-match:last-child {
    border-bottom: 0;
}

.page-tool--css-selector-match-tester .tool-match::before {
    content: counter(match);
    flex: 0 0 2em;
    text-align: right;
    color: var(--faint);
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

.page-tool--css-selector-match-tester .tool-match__tag {
    flex: 0 0 auto;
    font-family: var(--font-mono);
    color: var(--accent);
    overflow-wrap: anywhere;
}

.page-tool--css-selector-match-tester .tool-match__text {
    min-width: 0;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page-tool--css-selector-match-tester .tool-results__note {
    margin: 0;
    padding: 11px 16px;
    border-top: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--muted);
    font-size: 0.78rem;
}

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

.page-tool--css-selector-match-tester .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--css-selector-match-tester .tool-workspace {
        grid-template-columns: 1fr;
    }

    .page-tool--css-selector-match-tester .tool-textarea {
        min-height: 16rem;
    }

    .page-tool--css-selector-match-tester .tool-results {
        max-height: 22rem;
    }
}

@media (max-width: 640px) {
    .page-tool--css-selector-match-tester .tool-match {
        flex-wrap: wrap;
        row-gap: 3px;
    }

    .page-tool--css-selector-match-tester .tool-match__tag {
        flex: 1 1 auto;
        min-width: 0;
    }

    .page-tool--css-selector-match-tester .tool-match__text {
        flex: 1 1 100%;
        overflow: visible;
        white-space: normal;
    }
}
