.regex-card {
  overflow: hidden;
}

.regex-examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 22px;
  padding: 12px;
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 13px;
  background: rgba(14, 165, 233, 0.06);
}

.regex-example-label {
  margin-right: 4px;
  color: var(--gt-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.regex-examples .gt-button {
  min-height: 34px;
  padding: 0 11px;
  font-size: 0.78rem;
}

.regex-input-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
  gap: 18px;
}

.regex-input-column,
.regex-result-column {
  min-width: 0;
}

.regex-input-column {
  display: grid;
  align-content: start;
  gap: 0;
}

.regex-flags-field {
  margin-top: 17px;
}

.regex-input-column .gt-helper {
  margin-top: 5px;
}

.regex-input-column .gt-field:last-of-type {
  margin-top: 17px;
}

.regex-result-column {
  padding: 16px;
  border: 1px solid var(--gt-line);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.38);
}

.regex-result-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.regex-result-heading .gt-button {
  min-height: 36px;
  padding: 0 11px;
  font-size: 0.78rem;
}

.regex-panel-label {
  display: block;
  color: var(--gt-text);
  font-size: 1rem;
  font-weight: 750;
}

.regex-match-count {
  display: block;
  margin-top: 1px;
  color: var(--gt-accent);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.regex-result-column .gt-status {
  margin-top: 10px;
}

.regex-highlight {
  min-height: 155px;
  max-height: 280px;
  margin-top: 10px;
  overflow: auto;
  padding: 13px;
  border: 1px solid var(--gt-line);
  border-radius: 11px;
  color: #dbeafe;
  background: #081522;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.83rem;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.regex-highlight mark {
  border-radius: 4px;
  color: #082f49;
  background: #7dd3fc;
  box-shadow: 0 0 0 2px rgba(125, 211, 252, 0.16);
}

.regex-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 13px;
  margin-top: 16px;
}

.regex-detail-grid section {
  min-width: 0;
}

.regex-detail-grid h3 {
  margin: 0 0 8px;
  color: var(--gt-muted);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.regex-match-list {
  display: grid;
  gap: 6px;
  max-height: 170px;
  margin: 0;
  padding: 0 0 0 24px;
  overflow: auto;
  color: var(--gt-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
}

.regex-match-list li {
  padding: 5px 7px;
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 7px;
  background: rgba(15, 31, 51, 0.68);
  overflow-wrap: anywhere;
}

.regex-groups {
  max-height: 170px;
  overflow: auto;
}

.regex-groups table {
  width: 100%;
  border-collapse: collapse;
  color: var(--gt-muted);
  font-size: 0.76rem;
  table-layout: fixed;
}

.regex-groups th,
.regex-groups td {
  padding: 6px 5px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.13);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.regex-groups th {
  color: var(--gt-subtle);
  font-weight: 700;
}

.regex-groups td:last-child {
  color: var(--gt-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.regex-detail-grid .gt-empty-state {
  margin: 0;
  padding: 13px 10px;
  font-size: 0.76rem;
}

.regex-privacy-note {
  max-width: 760px;
}

@media (max-width: 760px) {
  .regex-input-grid,
  .regex-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .regex-result-column {
    padding: 13px;
  }
}

@media (max-width: 480px) {
  .regex-result-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .regex-result-heading .gt-button {
    width: 100%;
  }

  .regex-highlight {
    min-height: 130px;
  }
}
