.tools-page .nav-link[aria-current="page"] {
    color: var(--dark);
}

.tools-hero {
    padding: 48px 0 80px;
}

.tools-hero__head {
    margin-bottom: 24px;
    text-align: left;
}

.tools-hero__eyebrow {
    color: var(--grey-400);
    font-size: 14px;
    line-height: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
}

.tools-hero__title {
    max-width: 760px;
}

.tools-hero__desc {
    margin-top: 16px;
    max-width: 760px;
    color: var(--grey-700);
    font-size: 18px;
    line-height: 28px;
    font-weight: 500;
}

.tools-privacy-note {
    margin-bottom: 20px;
    padding: 12px 16px;
    border: 1px solid var(--grey-200);
    border-radius: 12px;
    background: var(--white);
    color: var(--grey-700);
    font-size: 13px;
    line-height: 18px;
    font-weight: 500;
}

.tools-shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 0;
    border: 1px solid var(--grey-200);
    border-radius: 20px;
    background: var(--white);
    overflow: hidden;
}

.tools-sidebar {
    padding: 24px 0;
    border-right: 1px solid var(--grey-200);
    background: var(--white);
}

.tools-sidebar__label {
    margin: 0 16px 16px;
    color: var(--grey-400);
    font-size: 14px;
    line-height: 18px;
    font-weight: 700;
}

.tools-sidebar__list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tools-sidebar__item {
    padding: 10px 16px 10px 13px;
    border: none;
    border-left: 3px solid transparent;
    background: transparent;
    color: var(--grey-700);
    font-size: 14px;
    line-height: 20px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}

.tools-sidebar__item:hover,
.tools-sidebar__item:focus-visible {
    background: var(--grey-50);
    color: var(--dark);
    outline: none;
}

.tools-sidebar__item.is-active {
    border-left-color: var(--dark);
    background: var(--grey-50);
    color: var(--dark);
}

.tools-workspace {
    padding: 24px;
    min-width: 0;
}

.tools-mobile-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--grey-200);
    border-radius: 12px;
    background: var(--white);
    color: var(--dark);
    font-size: 14px;
    line-height: 20px;
    font-weight: 500;
}

.tools-mobile-trigger__chevron {
    width: 10px;
    height: 10px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 150ms ease;
}

.tools-mobile-trigger[aria-expanded="true"] .tools-mobile-trigger__chevron {
    transform: rotate(-135deg);
}

.tools-mobile-menu {
    margin-top: 8px;
    border: 1px solid var(--grey-200);
    border-radius: 12px;
    background: var(--white);
    overflow: hidden;
}

.tools-mobile-menu.hidden,
.tools-toolbar.hidden,
.tools-output.hidden,
.tools-clean-menu.hidden,
.tools-editor__drag-overlay.hidden {
    display: none;
}

.tools-mobile-menu__item {
    width: 100%;
    padding: 12px 14px;
    border: none;
    border-bottom: 1px solid var(--grey-200);
    background: var(--white);
    color: var(--dark);
    font-size: 14px;
    line-height: 20px;
    font-weight: 500;
    text-align: left;
}

.tools-mobile-menu__item:last-child {
    border-bottom: none;
}

.tools-mobile-menu__item.is-active {
    background: var(--grey-50);
}

.tools-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    padding: 12px 20px;
    border: 1px solid var(--grey-200);
    border-bottom: none;
    border-radius: 16px 16px 0 0;
    background: var(--white);
}

.tools-toolbar > .tools-cleaner-bar {
    flex: 1 1 100%;
}

.tools-editor-shell {
    border: 1px solid var(--grey-200);
    border-radius: 16px;
    background: var(--white);
    overflow: hidden;
    position: relative;
}

.tools-editor-shell.has-toolbar {
    border-radius: 0 0 16px 16px;
}

.tools-editor__mini-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--grey-200);
    background: var(--grey-50);
}

.tools-icon-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--grey-700);
    cursor: pointer;
    transition: background-color 150ms ease, color 150ms ease;
}

.tools-icon-btn:hover,
.tools-icon-btn:focus-visible,
.tools-icon-btn.is-active {
    background: var(--grey-50);
    color: var(--dark);
    outline: none;
}
.tools-icon-btn:disabled {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}

.tools-clean-menu-wrap {
    position: relative;
}

.tools-clean-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    padding: 6px;
    border: 1px solid var(--grey-200);
    border-radius: 12px;
    background: var(--white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    z-index: 8;
}

.tools-clean-menu__item {
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--dark);
    font-size: 13px;
    line-height: 18px;
    text-align: left;
    cursor: pointer;
}

.tools-clean-menu__item:hover,
.tools-clean-menu__item:focus-visible {
    background: var(--grey-50);
    outline: none;
}

.tools-editor__frame {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    min-height: 580px;
    max-height: min(80vh, 760px);
    align-items: stretch;
    overflow: hidden;
}

.tools-editor__line-numbers {
    padding: 16px 8px 42px 16px;
    border-right: 1px solid var(--grey-100);
    background: var(--grey-50);
    color: var(--grey-400);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 12px;
    line-height: 22px;
    text-align: right;
    user-select: none;
    min-height: 580px;
    max-height: min(80vh, 760px);
    overflow: auto;
    white-space: pre;
    box-sizing: border-box;
    scrollbar-width: none;
}

.tools-editor__line-numbers::-webkit-scrollbar {
    display: none;
}

.tools-editor__surface {
    position: relative;
    min-height: 580px;
    max-height: min(80vh, 760px);
    background: var(--white);
    overflow: hidden;
}

.tools-editor__highlight-layer,
.tools-editor__textarea {
    width: 100%;
    min-height: 580px;
    max-height: min(80vh, 760px);
    padding: 16px 20px 42px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 14px;
    line-height: 22px;
    letter-spacing: 0;
    tab-size: 4;
    box-sizing: border-box;
}

.tools-editor__highlight-layer {
    position: absolute;
    inset: 0;
    overflow: hidden;
    color: transparent;
    white-space: pre-wrap;
    word-break: break-word;
    pointer-events: none;
}

.tools-editor__highlight-layer mark {
    background: var(--warning-300);
    border-radius: 4px;
    color: transparent;
}

.tools-editor__highlight-layer mark.is-active {
    background: var(--warning);
}

.tools-editor__textarea {
    position: relative;
    z-index: 1;
    resize: none;
    border: none;
    background: transparent;
    color: var(--dark);
    outline: none;
    overflow: auto;
}

.tools-editor__textarea:focus {
    box-shadow: inset 0 0 0 1.5px var(--grey-400);
}

.tools-editor__drag-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(250, 250, 250, 0.88);
    color: var(--grey-400);
    font-size: 14px;
    line-height: 20px;
    font-weight: 500;
}

.tools-editor__resize-handle {
    width: 100%;
    height: 18px;
    border: none;
    border-top: 1px solid var(--grey-200);
    background: var(--white);
    cursor: ns-resize;
    position: relative;
}

.tools-editor__resize-handle::before {
    content: "";
    width: 42px;
    height: 6px;
    border-radius: 999px;
    background: repeating-linear-gradient(
        to right,
        var(--grey-400),
        var(--grey-400) 6px,
        transparent 6px,
        transparent 12px
    );
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    transition: background 150ms ease;
}

.tools-editor__resize-handle:hover::before,
.tools-editor__resize-handle:focus-visible::before {
    background: repeating-linear-gradient(
        to right,
        var(--grey-700),
        var(--grey-700) 6px,
        transparent 6px,
        transparent 12px
    );
}

.tools-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid var(--grey-200);
    background: var(--white);
    color: var(--grey-400);
    font-size: 12px;
    line-height: 18px;
}

.tools-status-bar.is-counter {
    align-items: stretch;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 14px;
    line-height: 20px;
}

.tools-status-bar__left,
.tools-status-bar__right {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tools-char-counter {
    margin-left: auto;
    font-size: 12px;
    line-height: 18px;
    color: var(--grey-400);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    flex-shrink: 0;
}

.tools-char-counter.is-warning {
    color: var(--warning-700);
}

.tools-char-counter.is-danger {
    color: var(--danger-400);
}

.tools-status-pill {
    padding: 8px 10px;
    border: 1px solid var(--grey-200);
    border-radius: 12px;
    background: var(--grey-50);
    color: var(--dark);
}

.tools-pill,
.tools-action,
.tools-segment,
.tools-chip,
.tools-inline-input,
.tools-number-input,
.tools-toggle {
    font-family: "Satoshi", sans-serif;
    font-size: 13px;
    line-height: 18px;
}

.tools-pill,
.tools-chip,
.tools-segment__item,
.tools-action,
.tools-output__copy,
.tools-output__copy-link {
    border-radius: 999px;
    transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}

.tools-pill,
.tools-segment__item,
.tools-chip,
.tools-output__copy {
    padding: 9px 14px;
    border: 1px solid var(--grey-200);
    background: var(--white);
    color: var(--dark);
    cursor: pointer;
}

.tools-pill:hover,
.tools-chip:hover,
.tools-segment__item:hover,
.tools-output__copy:hover,
.tools-pill:focus-visible,
.tools-chip:focus-visible,
.tools-segment__item:focus-visible,
.tools-output__copy:focus-visible {
    background: var(--grey-50);
    outline: none;
}

.tools-pill.is-active,
.tools-segment__item.is-active,
.tools-chip.is-active {
    background: var(--dark);
    border-color: var(--dark);
    color: var(--white);
}

.tools-chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tools-cleaner-bar__chips {
    flex: 1 1 auto;
    min-width: 0;
    align-content: flex-start;
    flex-wrap: nowrap;
    gap: 6px;
}

.tools-cleaner-bar__chips .tools-chip {
    padding: 6px 10px;
}

.tools-cleaner-bar {
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

.tools-cleaner-bar__action {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-start;
}

.tools-cleaner-bar__button {
    white-space: nowrap;
}

.tools-action {
    padding: 10px 16px;
    border: 1px solid var(--dark);
    background: var(--dark);
    color: var(--white);
    font-weight: 600;
    cursor: pointer;
}

.tools-action:hover,
.tools-action:focus-visible {
    background: var(--grey-900);
    border-color: var(--grey-900);
    outline: none;
}

.tools-inline-input,
.tools-number-input {
    min-width: 140px;
    padding: 10px 12px;
    border: 1px solid var(--grey-200);
    border-radius: 999px;
    background: var(--grey-50);
    color: var(--dark);
    outline: none;
}

.tools-inline-input::placeholder,
.tools-number-input::placeholder {
    color: var(--grey-400);
}

.tools-inline-input:focus,
.tools-number-input:focus {
    border-color: var(--dark);
    background: var(--white);
}

.tools-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--grey-700);
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.tools-regex-help {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    margin-right: 10px;
}

.tools-regex-help__trigger {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--grey-300);
    border-radius: 999px;
    background: var(--white);
    color: var(--grey-700);
    font-size: 12px;
    line-height: 1;
    font-weight: 700;
    cursor: help;
    flex: 0 0 20px;
}

.tools-regex-help__trigger:hover,
.tools-regex-help__trigger:focus-visible,
.tools-regex-help.is-open .tools-regex-help__trigger {
    border-color: var(--grey-400);
    background: var(--grey-50);
    color: var(--dark);
    outline: none;
}

.tools-toggle__label {
    display: inline-block;
    color: inherit;
}

.tools-toggle__track {
    width: 34px;
    height: 20px;
    border-radius: 999px;
    background: var(--grey-500);
    position: relative;
    flex: 0 0 34px;
    transition: background-color 150ms ease;
}

.tools-toggle__track::after {
    content: "";
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: var(--white);
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 150ms ease;
}

.tools-toggle.is-active .tools-toggle__track {
    background: var(--dark);
}

.tools-toggle:focus-visible {
    outline: 2px solid var(--grey-300);
    outline-offset: 4px;
    border-radius: 999px;
}

.tools-toggle.is-active .tools-toggle__track::after {
    transform: translateX(14px);
}

.tools-match-count,
.tools-muted-copy,
.tools-output__empty,
.tools-extract__hint {
    color: var(--grey-400);
    font-size: 12px;
    line-height: 18px;
}

.tools-regex-help__tooltip {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: min(280px, calc(100vw - 48px));
    padding: 10px 12px;
    border: 1px solid var(--grey-200);
    border-radius: 12px;
    background: var(--white);
    color: var(--grey-700);
    font-size: 12px;
    line-height: 18px;
    font-weight: 500;
    text-align: left;
    white-space: normal;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 8;
}

.tools-regex-help.is-open .tools-regex-help__tooltip {
    opacity: 1;
    visibility: visible;
}

.tools-error-inline {
    color: var(--danger-400);
    font-size: 12px;
    line-height: 18px;
    font-weight: 500;
}

.tools-output {
    margin-top: 12px;
    border: 1px solid var(--grey-200);
    border-radius: 16px;
    background: var(--grey-50);
    overflow: hidden;
}

.tools-output__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--grey-200);
    background: var(--grey-50);
}

.tools-output__label {
    color: var(--grey-700);
    font-size: 13px;
    line-height: 18px;
    font-weight: 500;
}

.tools-output__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tools-output__copy-link {
    border: none;
    background: transparent;
    color: var(--grey-700);
    padding: 0;
    cursor: pointer;
}

.tools-output__copy-link.hidden {
    display: none;
}

.tools-output__body {
    max-height: 300px;
    overflow: auto;
    padding: 16px;
}

.tools-output__code {
    margin: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 14px;
    line-height: 22px;
    color: var(--dark);
    white-space: pre-wrap;
    word-break: break-word;
}

.tools-output__slug {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 18px;
    line-height: 28px;
    color: var(--dark);
    word-break: break-word;
}
.tools-extract__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.tools-extract__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tools-extract__stat {
    padding: 10px 12px;
    border: 1px solid var(--grey-200);
    border-radius: 12px;
    background: var(--white);
    color: var(--dark);
    font-size: 13px;
    line-height: 18px;
    font-weight: 500;
}

.tools-extract__stat.is-empty {
    color: var(--grey-400);
}

.tools-extract__row {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 12px;
    transition: background-color 100ms ease;
}

.tools-extract__row:hover {
    background: var(--white);
}

.tools-extract__value {
    min-width: 0;
    flex: 1;
    color: var(--dark);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 14px;
    line-height: 20px;
    word-break: break-word;
}

.tools-extract__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.tools-extract__badge {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--grey-200);
    color: var(--grey-700);
    font-size: 11px;
    line-height: 16px;
    font-weight: 500;
}

.tools-extract__section {
    border-top: 1px solid var(--grey-200);
    padding-top: 12px;
    margin-top: 12px;
}

.tools-extract__section:first-child {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.tools-extract__section-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: none;
    background: transparent;
    color: var(--dark);
    font-size: 14px;
    line-height: 20px;
    font-weight: 700;
    padding: 4px 0 10px;
    cursor: pointer;
}

.tools-extract__section-body.hidden {
    display: none;
}

.tools-toast-root {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    z-index: 30;
    pointer-events: none;
}

.tools-toast {
    min-width: 180px;
    max-width: 400px;
    padding: 10px 16px;
    border-radius: 999px;
    background: var(--dark);
    color: var(--white);
    font-size: 13px;
    line-height: 18px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    opacity: 0;
    transition: opacity 200ms ease;
}

.tools-toast.is-visible {
    opacity: 1;
}
