.rx-pattern {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.rx-pattern input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  min-width: 0;
}
#flags { flex: 0 0 70px; color: var(--accent-2); font-weight: 600; }
.rx-delim {
  color: var(--text-dim);
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
}

.rx-status {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  min-height: 18px;
}
.rx-status.is-err { color: #fda4a4; }
.rx-status.is-ok  { color: #86efac; }

.rx-counts {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-muted);
}
.rx-counts strong { color: var(--text); }

/* Highlighted test pane uses a translucent overlay above the textarea.
   We render a pre layer with marked spans behind the textarea so the
   user can still select / edit normally. */
.rx-highlights {
  display: none; /* showing match details below instead — cleaner */
}

.rx-matches {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}
.rx-match {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  color: var(--text);
}
.rx-match-header {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 12px;
}
.rx-match-tag {
  background: var(--accent-grad);
  color: white;
  border-radius: 999px;
  padding: 2px 8px;
  font-weight: 700;
}
.rx-match-text {
  background: rgba(34, 211, 238, 0.12);
  color: #a5f3fc;
  padding: 4px 8px;
  border-radius: 4px;
  word-break: break-all;
}
.rx-group {
  font-size: 12px;
  color: var(--text-muted);
  padding-left: 12px;
}
.rx-group strong { color: var(--text); }

.rx-cheats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 6px 16px;
  font-size: 13px;
  color: var(--text-muted);
}
.rx-cheats code {
  background: var(--bg-elev-2);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--accent-2);
  margin-right: 4px;
}
