/* Regex studio — tokens only, stacks on small screens */
.rx-wrap { padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px)); }
.rx-samples { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.rx-samples .chip { cursor: pointer; user-select: none; }
.rx-bar { position: sticky; top: var(--dash-header-h, 64px); z-index: 20; margin-bottom: 14px; box-shadow: var(--shadow); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.rx-bar-row { display: flex; flex-direction: column; gap: 6px; }
.rx-bar-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 12px; }
.rx-flags { display: flex; flex-wrap: wrap; gap: 6px; }
.rx-flags .chip { cursor: pointer; user-select: none; min-width: 36px; justify-content: center; }
.rx-flags .chip input { display: none; }
.rx-error { color: var(--bad) !important; margin: 0; font-size: .82rem; }
.rx-ok { margin: 0; font-size: .82rem; color: var(--good); }
.rx-mono { font-family: var(--font-mono, ui-monospace, Consolas, monospace) !important; }
.rx-main { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rx-highlight {
    min-height: 180px;
    max-height: min(40vh, 320px);
    overflow: auto;
    padding: 12px 14px;
    border-radius: var(--radius-sm, 10px);
    border: 1px solid var(--line);
    background: var(--panel-2);
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0 0 14px;
    color: var(--text);
    font-size: .86rem;
    line-height: 1.55;
}
.rx-highlight mark {
    background: color-mix(in srgb, var(--accent) 28%, transparent);
    color: inherit;
    border-radius: 3px;
    padding: 0 2px;
}
.rx-table-wrap { overflow: auto; max-height: 260px; }
.rx-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.rx-table th, .rx-table td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.rx-table th { color: var(--text-dim); font-weight: 600; }
.rx-table code { font-family: var(--font-mono, ui-monospace, Consolas, monospace); }
.rx-replace-row { display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; align-items: end; margin-bottom: 10px; }
.rx-replace-row .form-label { grid-column: 1 / -1; margin: 0; }
.rx-replace-acts { display: flex; gap: 8px; }
.rx-cheat { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.rx-cheat article {
    border: 1px solid var(--line);
    background: var(--panel-2);
    border-radius: var(--radius-sm, 10px);
    padding: 10px 12px;
}
.rx-cheat code { color: var(--accent); font-family: var(--font-mono, ui-monospace, Consolas, monospace); }
.rx-cheat p { margin: 4px 0 0; color: var(--text-dim); font-size: .8rem; }

@media (max-width: 900px) {
    .rx-main { grid-template-columns: 1fr; }
    .rx-bar { position: static; }
    .rx-replace-row { grid-template-columns: 1fr; }
    .rx-bar-meta { flex-direction: column; align-items: stretch; }
}
