/* Regex Tester — 485Tech */
.rt-container {
  max-width: 880px;
  margin: 0 auto;
}
.rt-row {
  margin-bottom: 1rem;
}
.rt-input-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-3);
  margin-bottom: 0.4rem;
}
.rt-pattern-wrap {
  display: flex;
  align-items: center;
  gap: 0;
}
.rt-pattern-wrap .rt-input {
  flex: 1;
  border: 1px solid var(--ink-8);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  padding: 0.65rem 0.75rem;
}
.rt-pattern-wrap .rt-input:first-of-type {
  border-right: 0;
  border-radius: var(--r-2) 0 0 var(--r-2);
}
.rt-pattern-wrap .rt-input:last-of-type {
  border-left: 0;
  border-radius: 0 var(--r-2) var(--r-2) 0;
}
.rt-pattern-wrap .rt-delim {
  color: var(--ink-3);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  padding: 0 0.5rem;
}
.rt-flags {
  width: 100px !important;
  text-align: center;
}
.rt-text {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--ink-8);
  border-radius: var(--r-2);
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  padding: 0.75rem;
  resize: vertical;
  min-height: 140px;
}
.rt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.rt-count {
  font-size: 0.9rem;
  color: var(--ink-3);
  font-weight: 600;
}
.rt-status {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: var(--r-1);
}
.rt-status-error {
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.1);
}
.rt-output {
  background: var(--paper-2);
  border: 1px solid var(--ink-8);
  border-radius: var(--r-2);
  padding: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  min-height: 100px;
  max-height: 400px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.rt-output mark.regex-match {
  background: rgba(34, 197, 94, 0.2);
  color: #15803d;
  border-radius: 2px;
  padding: 0 2px;
}
.rt-output .regex-group {
  background: rgba(10, 111, 217, 0.15);
  color: #0a6fd9;
  border-radius: 2px;
  padding: 0 2px;
  font-weight: 600;
}
.rt-groups {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.rt-match-card {
  background: var(--paper-2);
  border: 1px solid var(--ink-8);
  border-radius: var(--r-2);
  padding: 0.75rem;
}
.rt-match-header {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  color: var(--ink-3);
}
.rt-match-num {
  font-weight: 700;
  color: var(--blue);
}
.rt-match-full {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.rt-group {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.9rem;
}
.rt-label {
  font-size: 0.8rem;
  color: var(--ink-3);
  font-weight: 600;
}
.rt-match-full code, .rt-group code {
  background: rgba(0,0,0,0.04);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
}
.rt-empty {
  color: var(--ink-3);
  font-size: 0.9rem;
  text-align: center;
  padding: 1rem;
}
@media (max-width: 640px) {
  .rt-pattern-wrap {
    flex-wrap: wrap;
  }
  .rt-pattern-wrap .rt-input:first-of-type {
    flex-basis: calc(100% - 80px);
    border-radius: var(--r-2);
    border-right: 1px solid var(--ink-8);
  }
  .rt-pattern-wrap .rt-input:last-of-type {
    border-radius: var(--r-2);
    border-left: 1px solid var(--ink-8);
  }
  .rt-delim:first-of-type {
    display: none;
  }
  .rt-delim:last-of-type {
    display: none;
  }
}