.rxt-page {
    --rxt-ink: #172033;
    --rxt-muted: #6e7a90;
    --rxt-line: #dce3ee;
    --rxt-soft: #f6f7fb;
    --rxt-violet: #6946e8;
    --rxt-violet-dark: #5232c7;
    --rxt-pink: #dc3f83;
    width: min(1460px, calc(100% - 32px));
    margin: 0 auto;
    color: var(--rxt-ink);
}

.rxt-page *, .rxt-page *::before, .rxt-page *::after { box-sizing: border-box; }
.rxt-page button, .rxt-page input, .rxt-page textarea { font: inherit; }

.rxt-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; padding: 38px 4px 24px; }
.rxt-hero > div:first-child { max-width: 800px; }
.rxt-eyebrow { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 10px; color: #5e6880; font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.rxt-eyebrow i { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; color: #fff; background: linear-gradient(135deg, var(--rxt-violet), var(--rxt-pink)); font: 800 .78rem ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0; box-shadow: 0 8px 20px rgba(105, 70, 232, .22); }
.rxt-hero h1 { margin: 0 0 9px; color: #111a2b; font-size: clamp(1.9rem, 3vw, 2.7rem); font-weight: 830; letter-spacing: -.045em; }
.rxt-hero p { margin: 0; color: var(--rxt-muted); font-size: 1rem; line-height: 1.6; }
.rxt-local-note { display: flex; min-width: 265px; align-items: center; gap: 11px; padding: 12px 15px; border: 1px solid #e2ddf6; border-radius: 13px; background: #f8f6ff; }
.rxt-local-note > span { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: #39ad70; box-shadow: 0 0 0 5px rgba(57, 173, 112, .11); }
.rxt-local-note strong, .rxt-local-note small { display: block; }
.rxt-local-note strong { font-size: .8rem; }
.rxt-local-note small { margin-top: 2px; color: #747087; font-size: .7rem; }

.rxt-presets { display: flex; align-items: stretch; gap: 18px; margin-bottom: 18px; }
.rxt-section-intro { width: 150px; flex: 0 0 150px; padding: 7px 0; }
.rxt-section-intro > span, .rxt-section-label { color: #929caf; font-size: .65rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.rxt-section-intro h2 { margin: 4px 0 0; font-size: 1rem; font-weight: 800; }
.rxt-preset-list { display: grid; min-width: 0; flex: 1; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.rxt-preset-list button { display: flex; min-width: 0; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--rxt-line); border-radius: 12px; color: var(--rxt-ink); background: #fff; text-align: left; cursor: pointer; transition: border-color .16s, box-shadow .16s, transform .16s; }
.rxt-preset-list button:hover { border-color: #b7a8f0; box-shadow: 0 8px 20px rgba(58, 46, 110, .09); transform: translateY(-1px); }
.rxt-preset-list button.is-active { border-color: #9c86ec; background: #faf9ff; box-shadow: inset 0 0 0 1px rgba(105, 70, 232, .12), 0 8px 20px rgba(58, 46, 110, .08); }
.rxt-preset-list button.is-active i { color: #fff; background: var(--rxt-violet); }
.rxt-preset-list button > span { min-width: 0; }
.rxt-preset-list i { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border-radius: 9px; color: var(--rxt-violet); background: #f0edff; font: 800 .72rem ui-monospace, SFMono-Regular, Menlo, monospace; transition: color .16s, background .16s; }
.rxt-preset-list strong, .rxt-preset-list small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rxt-preset-list strong { font-size: .78rem; }
.rxt-preset-list small { margin-top: 2px; color: #818b9e; font-size: .65rem; }

.rxt-workbench { overflow: hidden; border: 1px solid #cfd7e5; border-radius: 18px; background: #fff; box-shadow: 0 18px 50px rgba(28, 42, 68, .1); }
.rxt-expression-bar { display: grid; min-height: 76px; grid-template-columns: 120px minmax(260px, 1fr) auto auto; gap: 14px; align-items: center; padding: 13px 17px; border-bottom: 1px solid var(--rxt-line); background: #fbfcfe; }
.rxt-expression-label span, .rxt-expression-label strong { display: block; }
.rxt-expression-label span, .rxt-panel-head > div > span { margin-bottom: 3px; color: #929caf; font-size: .61rem; font-weight: 800; letter-spacing: .13em; }
.rxt-expression-label strong, .rxt-panel-head > div > strong { font-size: .84rem; }
.rxt-pattern-field { display: flex; height: 44px; min-width: 0; overflow: hidden; align-items: center; border: 1px solid #cec6ef; border-radius: 11px; background: #fff; box-shadow: 0 0 0 3px rgba(105, 70, 232, .05); }
.rxt-pattern-field:focus-within { border-color: #8d71eb; box-shadow: 0 0 0 4px rgba(105, 70, 232, .11); }
.rxt-pattern-field b { color: #9a8fc3; font: 700 1.05rem ui-monospace, SFMono-Regular, Menlo, monospace; }
.rxt-pattern-field b:first-child { padding-left: 13px; }
.rxt-pattern-field b:last-child { padding-right: 13px; }
.rxt-pattern-field input { min-width: 0; flex: 1; height: 42px; padding: 8px 5px; border: 0; color: #34206f; background: transparent; font: .84rem ui-monospace, SFMono-Regular, Menlo, monospace; outline: 0; }
.rxt-pattern-field input::placeholder { color: #a39eaf; }
.rxt-flags { display: flex; gap: 5px; margin: 0; padding: 0; border: 0; }
.rxt-flags label { cursor: pointer; }
.rxt-flags input { position: absolute; opacity: 0; pointer-events: none; }
.rxt-flags span { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid #d8dfea; border-radius: 8px; color: #7b8799; background: #fff; font: 800 .72rem ui-monospace, SFMono-Regular, Menlo, monospace; transition: all .15s; }
.rxt-flags label:hover span { border-color: #b9abef; color: var(--rxt-violet); }
.rxt-flags input:checked + span { border-color: var(--rxt-violet); color: #fff; background: var(--rxt-violet); box-shadow: 0 5px 12px rgba(105, 70, 232, .18); }
.rxt-pattern-actions { display: flex; gap: 6px; }
.rxt-pattern-actions button, .rxt-input-panel footer button, .rxt-output-head button, .rxt-code-head button { min-height: 34px; padding: 7px 10px; border: 1px solid #d7deea; border-radius: 8px; color: #637188; background: #fff; font-size: .69rem; font-weight: 750; cursor: pointer; }
.rxt-pattern-actions button:hover, .rxt-input-panel footer button:hover, .rxt-output-head button:hover, .rxt-code-head button:hover { border-color: #b5a6ed; color: var(--rxt-violet); }

.rxt-workspace-grid { display: grid; min-height: 650px; grid-template-columns: minmax(0, 1fr) minmax(470px, .92fr); }
.rxt-input-panel { display: flex; min-width: 0; flex-direction: column; border-right: 1px solid var(--rxt-line); }
.rxt-result-panel { min-width: 0; background: #fbfcfe; }
.rxt-panel-head { display: flex; min-height: 65px; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 17px; border-bottom: 1px solid var(--rxt-line); }
.rxt-panel-head > div > span, .rxt-panel-head > div > strong { display: block; }
.rxt-panel-head > small { color: #8c97a9; font-size: .64rem; }
.rxt-input-panel textarea { width: 100%; min-height: 500px; flex: 1; padding: 18px; border: 0; color: #263248; background: #fff; font: .8rem/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; outline: 0; resize: none; }
.rxt-input-panel textarea:focus { box-shadow: inset 0 0 0 2px rgba(105, 70, 232, .08); }
.rxt-input-panel footer { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 14px; border-top: 1px solid var(--rxt-line); color: #8792a4; font-size: .62rem; }
.rxt-input-panel kbd { margin-right: 3px; padding: 2px 4px; border: 1px solid #d4dbe6; border-bottom-width: 2px; border-radius: 4px; color: #606d82; background: #f7f9fc; font-size: .55rem; }
.rxt-run-state { display: flex; align-items: center; gap: 7px; color: #758197; font-size: .65rem; font-weight: 750; }
.rxt-run-state i { width: 8px; height: 8px; border-radius: 50%; background: #40b779; box-shadow: 0 0 0 4px rgba(64, 183, 121, .11); }
.rxt-run-state.is-running i { background: #f2ae34; animation: rxtPulse .8s infinite alternate; }
.rxt-run-state.is-error i { background: #da3e66; }
@keyframes rxtPulse { to { opacity: .35; } }

.rxt-tabs { display: flex; gap: 4px; overflow-x: auto; padding: 8px 12px 0; border-bottom: 1px solid var(--rxt-line); background: #f7f9fc; }
.rxt-tabs button { display: flex; flex: 0 0 auto; align-items: center; gap: 6px; padding: 10px 12px; border: 0; border-bottom: 2px solid transparent; color: #748097; background: transparent; font-size: .7rem; font-weight: 800; cursor: pointer; }
.rxt-tabs button:hover { color: var(--rxt-ink); }
.rxt-tabs button.is-active { border-bottom-color: var(--rxt-violet); color: var(--rxt-violet); }
.rxt-tabs button span { min-width: 19px; padding: 2px 5px; border-radius: 10px; color: #78849a; background: #e9edf4; font-size: .55rem; text-align: center; }
.rxt-tabs button.is-active span { color: var(--rxt-violet); background: #ebe7ff; }
.rxt-tab-panel { padding: 14px; }
.rxt-stats-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; color: #536177; font-size: .7rem; font-weight: 750; }
.rxt-stats-row small { color: #8b96a8; font: .62rem ui-monospace, SFMono-Regular, Menlo, monospace; }
.rxt-alert { margin-bottom: 9px; padding: 9px 11px; border: 1px solid #efb5c3; border-radius: 9px; color: #a52c4c; background: #fff3f6; font-size: .67rem; line-height: 1.45; }
.rxt-alert.is-warning { border-color: #efd79d; color: #866020; background: #fff9eb; }
.rxt-highlight { min-height: 180px; max-height: 270px; overflow: auto; padding: 14px; border: 1px solid #dce2ed; border-radius: 11px; color: #263248; background: #fff; font: .74rem/1.75 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.rxt-highlight mark { padding: 1px 0; border-radius: 3px; color: inherit; background: #dfd7ff; box-shadow: 0 0 0 1px rgba(105, 70, 232, .16); cursor: pointer; }
.rxt-highlight mark:nth-of-type(3n + 2) { background: #ffd9e9; box-shadow: 0 0 0 1px rgba(220, 63, 131, .14); }
.rxt-highlight mark:nth-of-type(3n) { background: #d5f2e3; box-shadow: 0 0 0 1px rgba(45, 159, 98, .14); }
.rxt-highlight mark.is-active { color: #fff; background: var(--rxt-violet); box-shadow: 0 0 0 2px rgba(105, 70, 232, .28); }
.rxt-highlight .rxt-zero { display: inline-block; width: 2px; height: 1.2em; vertical-align: -.2em; background: var(--rxt-pink); }
.rxt-empty-state { display: grid; min-height: 150px; place-items: center; padding: 20px; color: #7f8a9d; text-align: center; }
.rxt-empty-state i { display: grid; width: 42px; height: 42px; margin: 0 auto 9px; place-items: center; border-radius: 12px; color: var(--rxt-violet); background: #f0edff; font: 800 .8rem ui-monospace, SFMono-Regular, Menlo, monospace; }
.rxt-empty-state strong, .rxt-empty-state small { display: block; }
.rxt-empty-state strong { color: #536076; font-size: .75rem; }
.rxt-empty-state small { margin-top: 4px; font-size: .65rem; }
.rxt-match-list { max-height: 250px; overflow: auto; margin-top: 10px; }
.rxt-match-card { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; margin-bottom: 7px; padding: 9px 10px; border: 1px solid #e0e5ed; border-radius: 10px; background: #fff; cursor: pointer; }
.rxt-match-card:hover, .rxt-match-card.is-active { border-color: #b7a7ee; background: #faf9ff; }
.rxt-match-number { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 7px; color: var(--rxt-violet); background: #efecff; font-size: .6rem; font-weight: 850; }
.rxt-match-summary { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.rxt-match-summary code { overflow: hidden; color: #3e2a7a; font: .68rem ui-monospace, SFMono-Regular, Menlo, monospace; text-overflow: ellipsis; white-space: nowrap; }
.rxt-match-summary small { flex: 0 0 auto; color: #919bad; font-size: .57rem; }
.rxt-group-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.rxt-group-list span { display: inline-flex; max-width: 100%; align-items: center; gap: 5px; padding: 3px 6px; border-radius: 6px; color: #667287; background: #f1f4f8; font-size: .58rem; }
.rxt-group-list b { color: #54427f; }
.rxt-group-list code { overflow: hidden; color: #354158; font-size: .58rem; text-overflow: ellipsis; white-space: nowrap; }

.rxt-replace-field > span { display: block; margin-bottom: 6px; color: #68758b; font-size: .67rem; font-weight: 800; }
.rxt-replace-field input { width: 100%; height: 41px; padding: 8px 11px; border: 1px solid #d6ddea; border-radius: 9px; color: #3f2c77; background: #fff; font: .74rem ui-monospace, SFMono-Regular, Menlo, monospace; outline: 0; }
.rxt-replace-field input:focus { border-color: #9278eb; box-shadow: 0 0 0 3px rgba(105, 70, 232, .1); }
.rxt-replace-field small { display: block; margin-top: 5px; color: #8b96a8; font-size: .6rem; }
.rxt-output-head, .rxt-code-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 16px 0 8px; }
.rxt-output-head strong, .rxt-code-head strong { font-size: .73rem; }
.rxt-code-head small { display: block; margin-top: 3px; color: #8b96a8; font-size: .6rem; }
#rxtReplacementResult { width: 100%; min-height: 370px; padding: 13px; border: 1px solid #dce2ed; border-radius: 10px; color: #2c384d; background: #fff; font: .72rem/1.65 ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical; }
.rxt-explain-head strong, .rxt-explain-head small { display: block; }
.rxt-explain-head strong { font-size: .75rem; }
.rxt-explain-head small { margin-top: 3px; color: #8b96a8; font-size: .61rem; }
.rxt-explanation { position: relative; max-height: 480px; overflow: auto; margin-top: 12px; padding: 3px 0; }
.rxt-token { position: relative; display: grid; grid-template-columns: 28px minmax(65px, auto) 1fr; gap: 9px; align-items: center; margin-left: calc(var(--rxt-depth) * 16px); padding: 8px 9px 8px 0; border-bottom: 1px solid #e8ecf2; transition: background .15s; }
.rxt-token:hover { background: #faf9ff; }
.rxt-token-order { position: relative; z-index: 1; display: grid; width: 24px; height: 24px; place-items: center; border: 1px solid #d7cff4; border-radius: 50%; color: #6850bd; background: #fff; font: 800 .52rem ui-monospace, SFMono-Regular, Menlo, monospace; }
.rxt-token:not(:last-child) .rxt-token-order::after { position: absolute; z-index: -1; top: 23px; bottom: -18px; left: 50%; width: 1px; background: #ddd7f1; content: ''; }
.rxt-token code { max-width: 180px; overflow: hidden; padding: 4px 7px; border-radius: 6px; color: #5538b5; background: #eeeaff; font: .64rem ui-monospace, SFMono-Regular, Menlo, monospace; text-overflow: ellipsis; white-space: nowrap; }
.rxt-token > span:last-child { color: #627087; font-size: .65rem; line-height: 1.4; }
.rxt-token > span:last-child small { display: block; margin-bottom: 1px; color: #9586ca; font-size: .52rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.rxt-branch { display: flex; align-items: center; gap: 7px; margin-left: calc(37px + var(--rxt-depth) * 16px); padding: 5px 0; color: #9a86dd; }
.rxt-branch::before, .rxt-branch::after { width: 18px; height: 1px; background: #ddd6f4; content: ''; }
.rxt-branch code { color: #6b4ed2; font: 850 .7rem ui-monospace, SFMono-Regular, Menlo, monospace; }
.rxt-branch span { font-size: .53rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.rxt-code-tabs { display: flex; gap: 5px; margin: 10px 0; }
.rxt-code-tabs button { padding: 6px 9px; border: 1px solid #d7deea; border-radius: 7px; color: #748097; background: #fff; font-size: .63rem; font-weight: 750; cursor: pointer; }
.rxt-code-tabs button.is-active { border-color: var(--rxt-violet); color: #fff; background: var(--rxt-violet); }
.rxt-tab-panel pre { min-height: 365px; margin: 0; overflow: auto; padding: 14px; border-radius: 11px; color: #dce5f3; background: #0d1524; font: .7rem/1.65 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; }
.rxt-statusbar { display: flex; min-height: 40px; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--rxt-line); color: #808b9e; background: #fafbfd; font-size: .59rem; }
.rxt-statusbar span:first-child { display: flex; align-items: center; gap: 7px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.rxt-statusbar i { width: 7px; height: 7px; border-radius: 50%; background: #3fbd76; box-shadow: 0 0 0 4px rgba(63, 189, 118, .1); }
.rxt-statusbar b { color: #5b687e; }

.rxt-cheatsheet { display: grid; grid-template-columns: 285px 1fr; gap: 34px; padding: 44px 4px 18px; }
.rxt-cheatsheet h2, .rxt-about h2 { margin: 6px 0 9px; font-size: 1.4rem; letter-spacing: -.025em; }
.rxt-cheatsheet p, .rxt-about > div:first-child p { margin: 0; color: var(--rxt-muted); font-size: .78rem; line-height: 1.62; }
.rxt-cheat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.rxt-cheat-grid button { display: flex; min-width: 0; align-items: center; gap: 8px; padding: 9px; border: 1px solid var(--rxt-line); border-radius: 9px; color: #6c778a; background: #fff; text-align: left; cursor: pointer; }
.rxt-cheat-grid button:hover { border-color: #b6a6ee; color: var(--rxt-violet); background: #fbfaff; }
.rxt-cheat-grid code { min-width: 42px; color: var(--rxt-violet); font-weight: 850; }
.rxt-cheat-grid span { overflow: hidden; font-size: .63rem; text-overflow: ellipsis; white-space: nowrap; }
.rxt-about { display: grid; grid-template-columns: minmax(270px, .72fr) 1.28fr; gap: 42px; padding: 28px 4px 22px; }
.rxt-feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rxt-feature-grid article { padding: 15px; border: 1px solid var(--rxt-line); border-radius: 12px; }
.rxt-feature-grid i { display: grid; width: 35px; height: 35px; margin-bottom: 12px; place-items: center; border-radius: 9px; color: var(--rxt-violet); background: #f0edff; font: 800 .68rem ui-monospace, SFMono-Regular, Menlo, monospace; }
.rxt-feature-grid strong { font-size: .76rem; }
.rxt-feature-grid p { margin: 5px 0 0; color: var(--rxt-muted); font-size: .67rem; line-height: 1.5; }
.rxt-seo { width: min(980px, 100%); margin: 15px auto 35px; }
.rxt-toast { position: fixed; z-index: 1100; right: 22px; bottom: 22px; padding: 10px 14px; border-radius: 9px; color: #fff; background: #1c273a; box-shadow: 0 12px 30px rgba(10, 20, 38, .23); font-size: .72rem; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .18s, transform .18s; }
.rxt-toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 1120px) {
    .rxt-expression-bar { grid-template-columns: 100px minmax(240px, 1fr) auto; }
    .rxt-pattern-actions { grid-column: 3; grid-row: 2; justify-content: flex-end; }
    .rxt-flags { grid-column: 2; grid-row: 2; }
    .rxt-workspace-grid { grid-template-columns: 1fr; }
    .rxt-input-panel { border-right: 0; border-bottom: 1px solid var(--rxt-line); }
    .rxt-input-panel textarea { min-height: 340px; }
    .rxt-preset-list { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
    .rxt-page { width: min(100% - 20px, 1460px); }
    .rxt-hero { align-items: flex-start; padding: 24px 1px 18px; }
    .rxt-local-note { display: none; }
    .rxt-hero h1 { font-size: 1.85rem; }
    .rxt-hero p { font-size: .85rem; }
    .rxt-presets { display: block; }
    .rxt-section-intro { width: auto; padding: 0 1px 8px; }
    .rxt-preset-list { display: flex; overflow-x: auto; padding-bottom: 5px; scroll-snap-type: x mandatory; }
    .rxt-preset-list button { min-width: 225px; scroll-snap-align: start; }
    .rxt-workbench { border-radius: 13px; }
    .rxt-expression-bar { grid-template-columns: 1fr auto; gap: 9px; padding: 12px; }
    .rxt-expression-label { grid-column: 1; }
    .rxt-pattern-actions { grid-column: 2; grid-row: 1; }
    .rxt-pattern-field { grid-column: 1 / -1; grid-row: 2; }
    .rxt-flags { grid-column: 1 / -1; grid-row: 3; overflow-x: auto; }
    .rxt-flags span { width: 38px; }
    .rxt-workspace-grid { min-height: 0; }
    .rxt-panel-head { padding: 11px 12px; }
    .rxt-input-panel textarea { min-height: 320px; padding: 13px; }
    .rxt-input-panel footer span { display: none; }
    .rxt-tab-panel { padding: 11px; }
    .rxt-highlight { min-height: 160px; }
    .rxt-match-summary { display: block; }
    .rxt-match-summary small { display: block; margin-top: 4px; }
    .rxt-statusbar span:nth-child(2) { display: none; }
    .rxt-cheatsheet, .rxt-about { display: block; padding-top: 32px; }
    .rxt-cheat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 18px; }
    .rxt-feature-grid { grid-template-columns: 1fr; margin-top: 20px; }
}

@media (max-width: 430px) {
    .rxt-expression-label span, .rxt-panel-head > div > span { display: none; }
    .rxt-pattern-actions button:last-child { font-size: .64rem; }
    .rxt-tabs button { padding: 9px 8px; font-size: .64rem; }
    .rxt-statusbar span:last-child { font-size: .53rem; }
    .rxt-cheat-grid span { white-space: normal; }
}
