/* =========================================================
   Regex Tester – Styles (nur auf /webmaster-tools/regex-tester geladen)
   ========================================================= */
.rx { --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, "Liberation Mono", monospace; display: grid; gap: 18px; position: relative; }

.rx-card {
  position: relative; padding: 22px 24px; border-radius: 22px;
  background: rgba(255,255,255,.85); border: 1px solid rgba(255,255,255,.95);
  box-shadow: var(--shadow);
}
.rx-card__head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.rx-label { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 600; color: var(--ink); letter-spacing: 0; }
.rx-label .i { width: 17px; height: 17px; color: var(--blue); }
.rx-sublabel { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.rx-sublabel small { font-weight: 400; color: var(--muted); margin-left: 6px; }
.rx-hint { font-size: 13px; color: var(--muted); }

/* Ausdruck */
.rx-pattern__field {
  display: flex; align-items: center; gap: 4px; padding: 0 16px; height: 56px; border-radius: 14px;
  background: #fff; border: 1.5px solid rgba(15,19,48,.12);
  font-family: var(--mono); font-size: 17px; transition: border-color .25s, box-shadow .25s;
}
.rx-pattern__field:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(91,140,255,.15); }
.rx-pattern__field.is-error { border-color: #e5484d; box-shadow: 0 0 0 4px rgba(229,72,77,.12); }
.rx-pattern__field input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font: inherit; color: var(--ink); }
.rx-delim { color: #9aa0bd; font-weight: 600; }
.rx-flagstring { min-width: 1ch; color: var(--violet); font-weight: 600; }
.rx-error { margin-top: 10px; padding: 10px 14px; border-radius: 10px; font-size: 13.5px; color: #b42318; background: rgba(229,72,77,.08); border: 1px solid rgba(229,72,77,.25); }

.rx-flags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.rx-flag {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 8px; border-radius: 10px;
  font-size: 12.5px; color: var(--muted); background: rgba(15,19,48,.04); border: 1px solid rgba(15,19,48,.08);
  transition: background .2s, color .2s, border-color .2s;
}
.rx-flag b { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; font-family: var(--mono); font-size: 13px; background: #fff; color: var(--ink); border: 1px solid rgba(15,19,48,.1); }
.rx-flag:hover { border-color: rgba(91,140,255,.5); }
.rx-flag[aria-pressed="true"] { color: var(--ink); background: rgba(91,140,255,.1); border-color: rgba(91,140,255,.45); }
.rx-flag[aria-pressed="true"] b { background: var(--grad); color: #fff; border-color: transparent; }

.rx-select select {
  appearance: none; -webkit-appearance: none; height: 38px; padding: 0 36px 0 14px; border-radius: 10px; cursor: pointer;
  font: inherit; font-size: 13.5px; color: var(--ink); background: #fff; border: 1px solid rgba(15,19,48,.14);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235d6280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
}

/* Arbeitsbereich */
.rx-workspace { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }

.rx-actions { display: flex; align-items: center; gap: 10px; }
.rx-status { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rx-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 10px;
  font-size: 12.5px; font-weight: 600; color: var(--ink); background: #fff; border: 1px solid rgba(15,19,48,.12);
  transition: border-color .2s, background .2s, transform .2s var(--ease);
}
.rx-btn .i { width: 14px; height: 14px; }
.rx-btn:hover { border-color: var(--ink); }
.rx-btn:active { transform: scale(.97); }

/* Editor mit Markierungen hinter dem Textfeld */
.rx-editor { position: relative; border-radius: 14px; background: #fff; border: 1.5px solid rgba(15,19,48,.12); transition: border-color .25s, box-shadow .25s; }
.rx-editor:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(91,140,255,.15); }
.rx-backdrop, .rx-editor textarea {
  font-family: var(--mono); font-size: 14.5px; line-height: 1.65; padding: 16px 18px; letter-spacing: 0;
  white-space: pre-wrap; overflow-wrap: anywhere; word-break: normal; tab-size: 4;
  scrollbar-gutter: stable;   /* gleiche Textbreite in Textfeld und Markierungen, auch mit Scrollbalken */
}
.rx-backdrop { position: absolute; inset: 0; overflow: hidden; border-radius: 13px; color: transparent; pointer-events: none; }
.rx-highlights { white-space: inherit; overflow-wrap: inherit; }
.rx-editor textarea {
  position: relative; display: block; width: 100%; min-height: 300px; resize: vertical; margin: 0;
  border: 0; outline: 0; border-radius: 13px; background: transparent; color: var(--ink); caret-color: var(--ink);
}
.rx-mark { color: transparent; border-radius: 3px; padding: 0; }
.rx-mark--0 { background: rgba(91, 140, 255, .28); box-shadow: 0 0 0 1px rgba(91, 140, 255, .45); }
.rx-mark--1 { background: rgba(155, 123, 255, .28); box-shadow: 0 0 0 1px rgba(155, 123, 255, .45); }
.rx-mark--zero { display: inline-block; width: 2px; height: 1.2em; margin: 0 -1px; vertical-align: -0.2em; background: var(--orange); }

/* Trefferliste */
.rx-results { position: sticky; top: 96px; max-height: calc(100vh - 120px); display: flex; flex-direction: column; }
.rx-count { min-width: 30px; padding: 3px 10px; border-radius: 999px; text-align: center; font-size: 13px; font-weight: 700; color: #fff; background: var(--grad); font-variant-numeric: tabular-nums; }
.rx-matches { list-style: none; margin: 0; padding: 0 4px 0 0; display: grid; gap: 8px; overflow: auto; min-height: 0; }
.rx-matches > li { border-radius: 12px; background: rgba(15,19,48,.035); border: 1px solid rgba(15,19,48,.06); }
.rx-match { display: grid; gap: 4px; width: 100%; padding: 10px 12px; text-align: left; border-radius: 12px; transition: background .2s; }
.rx-match:hover { background: rgba(91,140,255,.08); }
.rx-match__meta { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rx-match__no { font-weight: 700; color: var(--blue); }
.rx-match__value { font-family: var(--mono); font-size: 13.5px; color: var(--ink); overflow-wrap: anywhere; }
.rx-match__value em, .rx-groups em { font-family: var(--font, inherit); font-style: italic; color: var(--muted); font-size: 12px; }
.rx-ws { color: #b4b9d4; }
.rx-groups { margin: 0; padding: 0 12px 10px; display: grid; gap: 4px; }
.rx-groups > div { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: baseline; font-size: 12.5px; }
.rx-groups dt { display: flex; gap: 5px; align-items: center; color: var(--muted); }
.rx-groups dt b { font-weight: 600; color: var(--violet); }
.rx-groups dt span { min-width: 18px; padding: 0 5px; border-radius: 5px; text-align: center; font-size: 11px; font-weight: 700; color: var(--ink); background: rgba(15,19,48,.07); }
.rx-groups dd { margin: 0; font-family: var(--mono); color: var(--ink); overflow-wrap: anywhere; }
.rx-more { padding: 10px 12px; font-size: 12.5px; color: var(--muted); background: none !important; border: 0 !important; }
.rx-empty { font-size: 13.5px; color: var(--muted); padding: 6px 2px; }

/* Ersetzen / Code / Spickzettel */
.rx-tabs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: -6px 0 18px; padding-bottom: 12px; border-bottom: 1px solid rgba(15,19,48,.08); }
.rx-tab { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: var(--muted); transition: background .2s, color .2s; }
.rx-tab .i { width: 15px; height: 15px; }
.rx-tab:hover { color: var(--ink); background: rgba(15,19,48,.04); }
.rx-tab.is-active { color: var(--ink); background: rgba(91,140,255,.12); }
.rx-share { margin-left: auto; }

.rx-input {
  width: 100%; height: 48px; padding: 0 16px; border-radius: 12px; outline: 0;
  font-family: var(--mono); font-size: 15px; color: var(--ink); background: #fff; border: 1.5px solid rgba(15,19,48,.12);
  transition: border-color .25s, box-shadow .25s;
}
.rx-input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(91,140,255,.15); }
.rx-output { margin-top: 16px; }
.rx-output__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.rx-output__head .rx-sublabel { margin: 0; }
.rx-pre {
  margin: 0; padding: 16px 18px; border-radius: 12px; min-height: 60px; max-height: 360px; overflow: auto;
  font-family: var(--mono); font-size: 14px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere;
  color: var(--ink); background: rgba(15,19,48,.04); border: 1px solid rgba(15,19,48,.07);
}
.rx-pre--code { color: #dfe4ff; background: #0f1330; border-color: #0f1330; white-space: pre; overflow-wrap: normal; }
.rx-langs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.rx-lang { padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); border: 1px solid rgba(15,19,48,.12); background: #fff; }
.rx-lang.is-active { color: #fff; background: var(--ink); border-color: var(--ink); }
.rx-langs__copy { margin-left: auto; }
#rxCodeHint { margin-top: 10px; }

.rx-cheats { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; margin-top: 14px; }
.rx-cheat h3 { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.rx-cheat ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.rx-token { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border-radius: 8px; text-align: left; font-size: 13px; color: var(--muted); transition: background .2s; }
.rx-token code { min-width: 74px; padding: 2px 8px; border-radius: 6px; font-family: var(--mono); font-size: 13px; color: var(--ink); background: rgba(91,140,255,.1); }
.rx-token:hover { background: rgba(15,19,48,.05); color: var(--ink); }

/* Toast */
.rx-toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 80; translate: -50% 20px; opacity: 0; pointer-events: none;
  padding: 12px 20px; border-radius: 999px; font-size: 14px; font-weight: 500; color: #fff; background: var(--ink);
  box-shadow: 0 20px 40px -14px rgba(0,0,0,.5); transition: opacity .3s, translate .4s var(--ease);
}
.rx-toast.is-visible { opacity: 1; translate: -50% 0; }

@media (max-width: 900px) {
  .rx-workspace { grid-template-columns: 1fr; }
  .rx-results { position: static; max-height: 480px; }
  .rx-share { margin-left: 0; }
}
@media (max-width: 560px) {
  .rx-card { padding: 18px 16px; border-radius: 18px; }
  .rx-pattern__field { font-size: 15px; padding: 0 12px; }
  .rx-flag span { display: none; }
  .rx-flag { padding: 6px; }
  .rx-editor textarea { min-height: 220px; }
}
