.page-tool--regex-replacement-tester .tool-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.page-tool--regex-replacement-tester .tool-options {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.page-tool--regex-replacement-tester .tool-options__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 14px 20px;
    align-items: start;
}

.page-tool--regex-replacement-tester .tool-mono {
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.page-tool--regex-replacement-tester .tool-flags {
    border: 0;
    margin: 0;
    padding: 0;
}

.page-tool--regex-replacement-tester .tool-flags .label {
    padding: 0;
}

.page-tool--regex-replacement-tester .tool-flags__inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 18px;
    min-height: 42px;
}

.page-tool--regex-replacement-tester .tool-choice {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.86rem;
    color: var(--ink-2);
    cursor: pointer;
    font-family: var(--font-mono);
}

.page-tool--regex-replacement-tester .tool-choice input {
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: var(--accent);
    cursor: pointer;
}

.page-tool--regex-replacement-tester .tool-choice__note {
    color: var(--muted);
    font-family: inherit;
}

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

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

.page-tool--regex-replacement-tester .tool-status {
    min-height: 0;
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.78rem;
}

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

.page-tool--regex-replacement-tester .tool-pane {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.page-tool--regex-replacement-tester .tool-pane__body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

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

.page-tool--regex-replacement-tester .tool-textarea:focus {
    box-shadow: none;
}

.page-tool--regex-replacement-tester #result-output {
    background: var(--surface-2);
    color: var(--ink-2);
}

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

.page-tool--regex-replacement-tester .tool-hint--note code {
    padding: 0.05rem 0.3rem;
    border-radius: var(--radius-xs);
    background: var(--surface-3);
    color: var(--ink-2);
    font-family: var(--font-mono);
}

.page-tool--regex-replacement-tester .tool-matches {
    max-height: 26rem;
    overflow: auto;
    background: var(--surface);
}

.page-tool--regex-replacement-tester .tool-matches .empty-state {
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 2rem 1.25rem;
}

.page-tool--regex-replacement-tester .tool-match-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.page-tool--regex-replacement-tester .tool-match {
    padding: 11px 16px;
    border-bottom: 1px solid var(--line);
    font-size: 0.82rem;
}

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

.page-tool--regex-replacement-tester .tool-match:last-child {
    border-bottom: 0;
}

.page-tool--regex-replacement-tester .tool-match__head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.page-tool--regex-replacement-tester .tool-match__index {
    flex: 0 0 auto;
    color: var(--faint);
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

.page-tool--regex-replacement-tester .tool-match__value {
    flex: 1 1 auto;
    min-width: 0;
    font-family: var(--font-mono);
    color: var(--accent);
    overflow-wrap: anywhere;
}

.page-tool--regex-replacement-tester .tool-match__empty {
    color: var(--faint);
    font-style: italic;
    font-family: var(--font-mono);
}

.page-tool--regex-replacement-tester .tool-match__at {
    flex: 0 0 auto;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

.page-tool--regex-replacement-tester .tool-groups {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
}

.page-tool--regex-replacement-tester .tool-group {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
}

.page-tool--regex-replacement-tester .tool-group__name {
    color: var(--faint);
    font-family: var(--font-mono);
}

.page-tool--regex-replacement-tester .tool-group__value {
    font-family: var(--font-mono);
    color: var(--ink-2);
    overflow-wrap: anywhere;
}

.page-tool--regex-replacement-tester .tool-group__value--unset {
    color: var(--faint);
    font-style: italic;
}

.page-tool--regex-replacement-tester .tool-matches__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--regex-replacement-tester .tool-about__text {
    max-width: 80ch;
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

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

    .page-tool--regex-replacement-tester .tool-textarea {
        min-height: 13rem;
    }

    .page-tool--regex-replacement-tester .tool-matches {
        max-height: 22rem;
    }
}
