/* ═══════════════════════════════════════════
   Regex Tester
   Shared component styles come from css/tool-base.css.
   ═══════════════════════════════════════════ */

.rt-layout {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: start;
}
.rt-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}
.rt-card {
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--t-border-glass);
  border-radius: var(--t-radius);
  background: var(--t-bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.rt-label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-tertiary, #888);
}
.rt-label-gap { margin-top: 1rem; }
.rt-pattern-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.rt-slash {
  font-family: var(--t-mono);
  font-size: 1.05rem;
  color: var(--text-tertiary, #888);
  flex-shrink: 0;
}
.rt-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.72rem 0.9rem;
  border: 1.5px solid var(--t-border);
  border-radius: var(--t-radius-sm);
  background: var(--t-bg);
  color: var(--text);
  font-family: var(--t-mono);
  font-size: 0.9rem;
}
.rt-input:focus {
  outline: none;
  border-color: var(--t-accent);
  box-shadow: 0 0 0 3px var(--t-accent-light);
}
.rt-flags-display {
  font-family: var(--t-mono);
  font-size: 0.9rem;
  color: var(--t-accent);
  font-weight: 700;
  min-width: 1.2em;
}
.rt-flags {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.6rem;
}
.rt-flag {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--t-border);
  border-radius: 100px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--t-mono);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .2s, color .2s, background .2s;
}
.rt-flag:hover { border-color: var(--t-accent); color: var(--t-accent); background: var(--t-accent-light); }
.rt-flag.active {
  background: linear-gradient(135deg, var(--t-accent), var(--t-accent-2));
  color: #fff;
  border-color: transparent;
}
.rt-textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 160px;
  resize: vertical;
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--t-border);
  border-radius: var(--t-radius-sm);
  background: var(--t-bg);
  color: var(--text);
  font-family: var(--t-mono);
  font-size: 0.82rem;
  line-height: 1.55;
}
.rt-textarea:focus {
  outline: none;
  border-color: var(--t-accent);
  box-shadow: 0 0 0 3px var(--t-accent-light);
}
.rt-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.85rem;
  flex-wrap: wrap;
}
.rt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.66rem 1.2rem;
  border-radius: 100px;
  font-family: var(--t-font);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid var(--t-border);
  background: var(--t-bg);
  color: var(--text-secondary);
  transition: transform .2s, filter .2s, border-color .2s, color .2s, background .2s;
}
.rt-btn:hover { transform: translateY(-1px); }
.rt-btn-primary {
  flex: 1;
  border-color: transparent;
  background: linear-gradient(135deg, var(--t-accent), var(--t-accent-2));
  color: #fff;
}
.rt-btn-primary:hover { filter: brightness(1.08); }
.rt-btn-ghost:hover {
  border-color: var(--t-accent);
  color: var(--t-accent);
  background: var(--t-accent-light);
}
.rt-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}
.rt-card-title { margin: 0; font-size: 0.92rem; font-weight: 800; color: var(--text); }
.rt-badge {
  padding: 0.15rem 0.65rem;
  border-radius: 100px;
  background: var(--t-accent-light);
  border: 1px solid var(--t-accent);
  color: var(--text);
  font-family: var(--t-mono);
  font-size: 0.75rem;
  font-weight: 700;
}
.rt-mini-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--t-border);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  font-size: 0.85rem;
  transition: border-color .2s, background .2s;
}
.rt-mini-btn:hover { border-color: var(--t-accent); background: var(--t-accent-light); }
.rt-highlight {
  padding: 0.9rem 1rem;
  border: 1px solid var(--t-border);
  border-radius: var(--t-radius-sm);
  background: var(--t-bg);
  font-family: var(--t-mono);
  font-size: 0.82rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 260px;
  overflow: auto;
  color: var(--text-secondary);
}
.rt-highlight mark {
  background: var(--t-accent);
  color: #fff;
  border-radius: 3px;
  padding: 0 2px;
}
.rt-matches {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 320px;
  overflow: auto;
}
.rt-empty { color: var(--text-tertiary, #888); font-size: 0.8rem; }
.rt-match {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--t-border);
  border-radius: var(--t-radius-sm);
  background: var(--t-bg);
  font-size: 0.78rem;
}
.rt-match-index {
  flex-shrink: 0;
  min-width: 1.6rem;
  height: 1.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--t-accent-light);
  color: var(--t-accent);
  font-family: var(--t-mono);
  font-size: 0.7rem;
  font-weight: 800;
}
.rt-match-body { min-width: 0; }
.rt-match-value {
  font-family: var(--t-mono);
  font-weight: 700;
  color: var(--text);
  overflow-wrap: anywhere;
}
.rt-match-meta {
  font-size: 0.7rem;
  color: var(--text-tertiary, #888);
  font-family: var(--t-mono);
  margin-top: 0.15rem;
  overflow-wrap: anywhere;
}
.rt-cheatsheet {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 0.9rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.rt-cheatsheet code {
  font-family: var(--t-mono);
  color: var(--t-accent);
  font-weight: 700;
  margin-right: 0.25rem;
}
.rt-notice {
  margin: 0;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--t-border);
  border-radius: var(--t-radius-sm);
  background: var(--t-bg);
  color: var(--text-tertiary, #888);
  font-size: 0.75rem;
  line-height: 1.5;
}

@media (max-width: 768px) {
  .rt-layout { grid-template-columns: 1fr; }
  .rt-cheatsheet { grid-template-columns: 1fr; }
}
