/* ===========================================================
   REGEX TESTER STYLES
=========================================================== */
.rx-root .rx-body { gap: 4px; }

/* input + overlay stack */
.rx-pane .rx-input-wrap {
  position: relative; padding: 0;
  background: #ffffff; overflow: hidden;
}
.rx-textarea, .rx-highlight {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  width: 100%; height: 100%; box-sizing: border-box;
  margin: 0; padding: 6px 8px;
  font-family: "Courier New", Courier, monospace;
  font-size: 13px; line-height: 1.5;
  white-space: pre-wrap; word-wrap: break-word;
  overflow: auto;
  border: none; outline: none;
  letter-spacing: 0; tab-size: 4;
}
.rx-highlight {
  color: transparent;          /* show only the marks; the textarea draws the text */
  pointer-events: none;
  z-index: 1;
}
.rx-textarea {
  background: transparent;
  color: #000;
  caret-color: #000080;
  resize: none;
  z-index: 2;
}
.rx-textarea:focus { background: rgba(255,255,232,0.4); }

.rx-highlight mark.rx-hit {
  border-radius: 2px; padding: 0 1px;
  color: transparent; /* match the overlay so it doesn't double-draw */
}
.rx-highlight mark.rx-hit-0 { background: #ffe680; }   /* warm yellow */
.rx-highlight mark.rx-hit-1 { background: #b8e0ff; }   /* cool blue   */

.rx-stats {
  font-weight: normal; font-size: 10px;
  color: #cce4ff; margin-left: 8px;
}

/* matches panel */
.rx-match {
  border-bottom: 1px solid #d0d0d0;
  padding: 6px 8px;
}
.rx-match:nth-child(even) { background: #f6f6f6; }
.rx-match-head {
  display: flex; gap: 10px; align-items: baseline;
  margin-bottom: 3px;
}
.rx-match-num {
  font-weight: bold; color: #000080;
  font-family: "Courier New", monospace; font-size: 12px;
}
.rx-match-pos { color: #808080; font-size: 10px; }
.rx-match-body code {
  display: block; padding: 3px 6px;
  background: #ffffe1; border: 1px solid #d8d8a0;
  font-family: "Courier New", monospace; font-size: 12px;
  color: #000; word-break: break-all; white-space: pre-wrap;
}
.rx-groups {
  margin-top: 4px; padding-left: 12px;
  border-left: 2px solid #c0c0c0;
}
.rx-group {
  display: flex; gap: 6px; align-items: baseline;
  margin: 2px 0;
}
.rx-group-num {
  color: #800000; font-family: "Courier New", monospace;
  font-size: 11px; min-width: 90px;
}
.rx-group code {
  background: #f0f0f0; border: 1px solid #c8c8c8;
  padding: 1px 4px; font-family: "Courier New", monospace;
  font-size: 11px; color: #000;
}

.rx-empty {
  padding: 20px; text-align: center;
  color: #808080; font-style: italic;
  font-family: Verdana, sans-serif;
}
.rx-empty.rx-err {
  color: #a00000; font-style: normal;
  font-family: "Courier New", monospace;
}

/* replacement section */
.rx-replace {
  background: #c0c0c0; border-top: 2px groove #ffffff;
  display: flex; flex-direction: column; flex-shrink: 0;
  max-height: 220px;
}
.rx-replace.hidden { display: none; }
.rx-replace-body {
  display: flex; flex-direction: column; gap: 4px;
  padding: 6px; min-height: 0;
}
.rx-replace-body input[type=text] {
  border: 2px inset #ffffff; background: #ffffff;
  padding: 3px 6px; font-family: "Courier New", monospace;
  font-size: 12px; flex-shrink: 0;
}
.rx-replace-output {
  flex: 1; min-height: 80px; max-height: 160px;
  background: #ffffff; border: 2px inset #ffffff;
  padding: 4px 6px; overflow: auto;
  font-family: "Courier New", monospace; font-size: 12px;
  white-space: pre-wrap; word-wrap: break-word;
  color: #006000;
}
