/* Catcher — palette + base layout.
 *
 * Borrows the eHacking-family palette and header structure from the
 * existing JSF/PrimeFaces modules (root, json, oidc, …) so that catcher
 * feels harmonious without being a 1:1 clone. Catcher-native components
 * (tree view, mock editor, decoder) can use modern HTML and don't have
 * to honour PrimeFaces' .ui-* class system.
 */

:root {
  --rub-blau:        #003560;
  --uni-gruen:       #89ba17;
  --etikett-gruen:   #7fad18;
  --dunkles-rot:     #dc3545;
  --neutral-border:  #c8c8c8;
  --neutral-bg:      #ffffff;
  --muted:           #5b6770;
  --font-stack:      "Open Sans", "Helvetica Neue", sans-serif;
  --mono-stack:      "SF Mono", "Menlo", "Consolas", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-stack);
  font-size: 14px;
  color: #1a1a1a;
  background: var(--neutral-bg);
}

a { color: var(--rub-blau); }
a:hover { color: var(--etikett-gruen); }

.page-container {
  min-height: 100vh;
  max-width: min(1920px, 100%);
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  flex-direction: column;
}

.page-header {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  border-bottom: 1px solid var(--neutral-border);
}
.page-header h1 {
  margin: 0;
  flex: 1;
  text-align: center;
  color: var(--rub-blau);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.page-header .rub-logo,
.page-header .nds-logo,
.page-header .buw-logo {
  height: 44px;
  width: auto;
  max-width: 200px;
}
.page-header .rub-logo { margin-right: 12px; }
.page-header .header-logos-left,
.page-header .header-logos-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ── Primary + sub navbar ─────────────────────────────────────────
 * The nav lives directly under the header, full-width within the page
 * container. The active section is rendered as a non-link <span> with a
 * RUB-blau background so the user always knows where they are. Sub-items
 * for the active section (when the section has more pages) get their own
 * lower strip with a softer green-tinted background so they read as
 * children rather than peers of the primary entries.
 */
nav.catcher-nav {
  border-bottom: 1px solid var(--neutral-border);
}
.catcher-nav ul {
  list-style: none;
  margin: 0;
  padding: 0 64px;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}
.catcher-nav-primary {
  background: #f4f6f8;
  border-bottom: 1px solid var(--neutral-border);
}
.catcher-nav-primary li {
  display: flex;
}
.catcher-nav-primary .nav-link {
  display: inline-block;
  padding: 12px 18px;
  text-decoration: none;
  color: var(--rub-blau);
  font-weight: 600;
  font-size: 14px;
  border-right: 1px solid transparent;
}
.catcher-nav-primary li:first-child .nav-link { border-left: 1px solid transparent; }
.catcher-nav-primary .nav-link:hover {
  background: #e7ecf1;
  color: var(--rub-blau);
}
.catcher-nav-primary .nav-link-active {
  background: var(--rub-blau);
  color: #ffffff;
  cursor: default;
}
.catcher-nav-primary .nav-link-active:hover { background: var(--rub-blau); color: #ffffff; }

.catcher-nav-sub {
  background: #fbfcf7;
}
.catcher-nav-sub li { display: flex; }
.catcher-nav-sub .nav-sub-link {
  display: inline-block;
  padding: 8px 16px;
  text-decoration: none;
  color: var(--rub-blau);
  font-size: 13px;
  font-weight: 500;
}
.catcher-nav-sub .nav-sub-link::before {
  content: "↳ ";
  color: var(--etikett-gruen);
  margin-right: 2px;
}
.catcher-nav-sub .nav-sub-link:hover {
  background: #eef5d8;
}
.catcher-nav-sub .nav-sub-link-active {
  background: var(--uni-gruen);
  color: #ffffff;
  cursor: default;
}
.catcher-nav-sub .nav-sub-link-active::before {
  color: #ffffff;
}
.catcher-nav-sub .nav-sub-link-active:hover { background: var(--uni-gruen); color: #ffffff; }

main.main-content {
  flex: 1;
  padding: 20px 48px 32px;
}

main.main-content h2 {
  color: var(--rub-blau);
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 12px;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--rub-blau);
}

main.main-content h3 {
  color: var(--rub-blau);
  font-size: 16px;
  font-weight: 600;
  margin: 24px 0 8px;
}

main.main-content p { line-height: 1.5; }

/* Forms */
.form-card {
  max-width: 480px;
  margin: 24px auto;
  padding: 24px 28px;
  border: 1px solid var(--neutral-border);
  border-radius: 4px;
  background: #fafafa;
}
.form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}
.form-row label {
  font-weight: 600;
  color: #1a1a1a;
}
.form-row input[type="text"],
.form-row input[type="password"] {
  padding: 8px 10px;
  font-family: var(--font-stack);
  font-size: 14px;
  border: 1px solid var(--neutral-border);
  border-radius: 3px;
  background: #fff;
}
.form-row input[type="text"]:focus,
.form-row input[type="password"]:focus {
  outline: none;
  border-color: var(--etikett-gruen);
  box-shadow: 0 0 0 2px rgba(127, 173, 24, 0.15);
}

button.primary,
input[type="submit"].primary {
  background: var(--rub-blau);
  color: #fff;
  border: 1px solid var(--rub-blau);
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 3px;
  cursor: pointer;
}
button.primary:hover,
input[type="submit"].primary:hover {
  background: var(--uni-gruen);
  border-color: var(--etikett-gruen);
}

.error-banner {
  margin: 12px 0;
  padding: 10px 14px;
  background: #fdecea;
  border: 1px solid var(--dunkles-rot);
  color: var(--dunkles-rot);
  border-radius: 3px;
}

/* Code-like, monospace values (salts, URLs, recovery tokens) */
code, .mono {
  font-family: var(--mono-stack);
  font-size: 13px;
}

.salt-display {
  display: inline-block;
  padding: 4px 8px;
  background: #222;
  color: #e5e5e5;
  border-radius: 3px;
  font-family: var(--mono-stack);
  letter-spacing: 0.5px;
  word-break: break-all;
}

.url-list {
  list-style: none;
  padding: 0;
  margin: 12px 0;
}
.url-list li {
  margin: 6px 0;
  font-family: var(--mono-stack);
  font-size: 13px;
}
.url-list .label {
  display: inline-block;
  width: 110px;
  color: var(--muted);
  font-family: var(--font-stack);
  font-weight: 600;
}

.muted { color: var(--muted); }

/* ─── Decoder (Phase 7) ────────────────────────────────────────────── */

.dec-node {
  margin: 8px 0;
  padding: 8px 10px;
  border: 1px solid var(--neutral-border);
  border-left: 3px solid var(--rub-blau);
  border-radius: 3px;
  background: #fafafa;
}
.dec-d0 { border-left-color: var(--rub-blau); }
.dec-d1 { border-left-color: var(--uni-gruen); margin-left: 16px; background: #f5faea; }
.dec-d2 { border-left-color: var(--etikett-gruen); margin-left: 16px; }
.dec-d3 { border-left-color: #777; margin-left: 16px; }
.dec-d4 { border-left-color: var(--neutral-border); margin-left: 16px; }
.dec-d5 { border-left-color: var(--neutral-border); margin-left: 16px; }
.dec-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.dec-kind {
  font-family: var(--mono-stack);
  font-size: 12px;
  padding: 1px 8px;
  background: var(--rub-blau);
  color: #fff;
  border-radius: 8px;
  text-transform: uppercase;
  font-weight: 600;
}
.dec-meta {
  font-size: 11px;
  padding: 1px 6px;
  border: 1px solid var(--etikett-gruen);
  color: var(--etikett-gruen);
  border-radius: 8px;
  text-transform: uppercase;
}
.dec-output {
  margin: 4px 0;
  padding: 6px 8px;
  background: #222;
  color: #e5e5e5;
  border-radius: 3px;
  white-space: pre-wrap;
  overflow-x: auto;
  max-height: 260px;
  font-size: 12px;
}
.dec-children { margin-top: 8px; padding-left: 12px; border-left: 1px dashed var(--neutral-border); }
.dec-child { margin: 6px 0; }
.dec-childname { font-family: var(--mono-stack); font-size: 12px; color: var(--muted); }
.dec-arrow {
  margin: 6px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

/* ─── Keys (Phase 5.5) ─────────────────────────────────────────────── */

.keys-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
}
.keys-table th, .keys-table td {
  text-align: left;
  padding: 4px 8px;
  border-bottom: 1px solid #eee;
  font-size: 13px;
}
.keys-table th { color: var(--muted); font-weight: 600; }

/* ─── Mocks (Phase 5) ──────────────────────────────────────────────── */

.mocks-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
}
.mocks-table th, .mocks-table td {
  text-align: left;
  padding: 4px 8px;
  border-bottom: 1px solid #eee;
  font-size: 13px;
}
.mocks-table th { color: var(--muted); font-weight: 600; }

/* Drag&drop reorder (ISSUES 2026-05-11) */
.mocks-table tr.mock-row { transition: background 0.15s; }
.mocks-table tr.mock-row:hover { background: #fbfcf7; }
.mocks-table tr.mock-row.dragging { opacity: 0.4; background: #eef5d8; }
.mocks-table td.drag-handle {
  cursor: grab;
  color: var(--muted);
  user-select: none;
  width: 24px;
  text-align: center;
  font-size: 16px;
}
.mocks-table td.drag-handle:active { cursor: grabbing; }
.mocks-table td.drag-handle-locked {
  cursor: not-allowed;
  color: var(--neutral-border);
}
.mocks-default-table tr.mock-row-default { background: #f4f6f8; }
.mocks-default-table tr.mock-row-default:hover { background: #eef0f2; }
.drag-handle-hint {
  display: inline-block;
  padding: 0 4px;
  color: var(--muted);
  font-weight: 600;
}
.reorder-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--uni-gruen);
  color: #fff;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  z-index: 1000;
  animation: toastIn 0.15s ease-out;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.mef-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 16px;
  margin: 12px 0;
}
.mef-row { display: flex; align-items: center; gap: 8px; }
.mef-label { width: 110px; color: var(--muted); font-weight: 600; }
.mef-input { flex: 1; padding: 4px 8px; border: 1px solid var(--neutral-border); border-radius: 3px; font-size: 13px; }
.mef-body {
  width: 100%;
  font-family: var(--mono-stack);
  font-size: 13px;
  padding: 8px;
  border: 1px solid var(--neutral-border);
  border-radius: 3px;
  background: #fafafa;
}
.mef-headers-block, .mef-ae-block, .mef-preview-block { margin: 18px 0; }
.mef-headers .mef-hrow, .mef-ae .mef-arule {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 6px;
  margin: 4px 0;
  align-items: start;
}
.mef-headers input, .mef-headers textarea, .mef-ae input, .mef-ae textarea {
  padding: 4px 8px;
  border: 1px solid var(--neutral-border);
  border-radius: 3px;
  font-size: 13px;
  line-height: 1.4;
  box-sizing: border-box;
}
/* Shared multi-line code-style editor for header values + auto-extract
   expressions. Both fields can carry long single-line content (CSP
   directives, materialised claims-JSON) or multi-line content the user
   wants to read at a glance — the resize grip + autosizing on input
   gives them both. Font comes from the `.mono` class on the element
   so the expression textarea matches the name input next to it.

   Soft-wrap (`white-space: pre-wrap` + `overflow-wrap: anywhere`)
   instead of horizontal scrolling: a long single-line value (the
   materialised mIdP claims-JSON, a CSP directive) would otherwise
   either grow a horizontal scrollbar that eats ~15px of vertical
   space and crushes the visible text row, or — with `overflow-x:
   hidden` — clip the end of the value off the right edge. Wrapping
   keeps newlines the user typed (`pre-wrap`) and breaks long
   unbroken JSON tokens at quote / colon / comma boundaries so the
   whole value stays visible; the autosize pass grows the textarea
   vertically to fit. */
.mef-ae-expr, .mef-hval {
  resize: vertical;
  min-height: 28px;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
/* Multi-line expressions look like a multi-line JSON / XML payload —
   give the textarea a faint left rule to mark it as a "code editor"
   without going full syntax highlighting (which would need a real
   tokenizer per format). Background flips to a JSON-leaning tint
   when the first char looks like `{` / `[` / `<`, signalled via the
   data-shape attribute set in JS. */
.mef-ae-expr[data-shape="json"] {
  background: #fffefb;
  border-left: 3px solid #b58900;
}
.mef-ae-expr[data-shape="xml"] {
  background: #fbfbff;
  border-left: 3px solid #268bd2;
}
.mef-add { margin-top: 4px; font-size: 12px; padding: 4px 10px; cursor: pointer; background: #fff; border: 1px dashed var(--neutral-border); border-radius: 3px; }
.mef-add:hover { border-color: var(--etikett-gruen); }
.mef-preview-btn { padding: 4px 12px; font-size: 12px; cursor: pointer; }
.mef-preview-out {
  margin-top: 8px;
  padding: 8px 10px;
  background: #222;
  color: #e5e5e5;
  border-radius: 3px;
  white-space: pre-wrap;
  overflow-x: auto;
  font-size: 12px;
}
/* Template-test page — collapsed Tips block at the top with chaining /
 * back-ref / gotchas notes. Closed by default so the editor is the
 * first thing users see. (ISSUES 2026-05-12.) */
.tpl-test-tips {
  margin: 8px 0 12px;
  font-size: 13px;
}
.tpl-test-tips > summary {
  cursor: pointer;
  color: var(--rub-blau);
  user-select: none;
  font-weight: 600;
}
.tpl-test-tips > summary:hover { color: var(--etikett-gruen); }
.tpl-test-tips-body {
  margin-top: 8px;
  padding: 10px 14px;
  background: #f4f6f8;
  border-left: 3px solid var(--rub-blau);
  border-radius: 0 3px 3px 0;
}
.tpl-test-tips-body p { margin: 6px 0; }
.tpl-test-tips-body pre {
  background: #222;
  color: #e5e5e5;
  padding: 6px 8px;
  border-radius: 3px;
  font-size: 12px;
  margin: 4px 0;
  overflow-x: auto;
}
.tpl-test-tips-body ol, .tpl-test-tips-body ul { margin: 4px 0 4px 18px; padding: 0; }
.tpl-test-tips-body li { margin: 6px 0; }

/* Per-segment breakdown panel — only visible when the rendered
 * template is a pipeline. One row per `|` segment with the
 * progressive expression and what it resolved to. (ISSUES 2026-05-13.) */
.tpl-test-steps { margin-top: 16px; }
.tpl-test-steps h3 { margin: 12px 0 6px; }
.tpl-test-steps-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.tpl-test-steps-table th,
.tpl-test-steps-table td {
  padding: 4px 8px;
  border-bottom: 1px solid var(--neutral-border);
  vertical-align: top;
  text-align: left;
  font-family: var(--mono-stack);
}
.tpl-test-steps-table th {
  font-weight: 600;
  color: var(--muted);
  font-family: var(--font-stack);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.tpl-test-steps-table td:first-child { width: 36px; color: var(--muted); }
.tpl-test-steps-table td:nth-child(2) { color: var(--rub-blau); }
.tpl-test-steps-table td:nth-child(3) {
  word-break: break-all;
  background: #fafafa;
}

/* ─── Template-test utility page ─────────────────────────────────────
 * Two-column layout: editor + Render button + output on the left, a
 * cheat-sheet of clickable snippet chips on the right. Mirrors the
 * mock editor's preview pane idiom but standalone so users can poke at
 * the templating engine without creating a mock first. (ISSUES 2026-05-12.) */
.tpl-test-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  margin-top: 12px;
}
@media (max-width: 980px) {
  .tpl-test-layout { grid-template-columns: 1fr; }
}
.tpl-test-main { min-width: 0; }
.tpl-test-label {
  display: block;
  font-weight: 600;
  color: var(--rub-blau);
  margin: 12px 0 4px;
  font-size: 13px;
}
.tpl-test-out {
  min-height: 80px;
}
.tpl-test-side {
  padding: 12px 14px;
  border: 1px solid var(--neutral-border);
  border-radius: 4px;
  background: #fafafa;
}
.tpl-test-side h3 {
  margin: 0 0 4px;
  font-size: 14px;
}
.tpl-test-side h4 {
  margin: 14px 0 4px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  font-weight: 600;
}
.tpl-test-chips {
  list-style: none;
  padding: 0;
  margin: 0;
}
.tpl-test-chips li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 2px 0;
  font-size: 12px;
}
.tpl-test-chips button {
  font-family: var(--mono-stack);
  font-size: 11px;
  padding: 2px 8px;
  background: #fff;
  border: 1px solid var(--neutral-border);
  border-radius: 3px;
  color: var(--rub-blau);
  cursor: pointer;
  flex-shrink: 0;
}
.tpl-test-chips button:hover {
  background: rgba(127, 173, 24, 0.12);
  border-color: var(--etikett-gruen);
}
.tpl-test-chips .muted {
  font-size: 11px;
}
.mef-actions {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.mef-delete {
  padding: 6px 14px;
  background: var(--dunkles-rot);
  color: #fff;
  border: 1px solid var(--dunkles-rot);
  border-radius: 3px;
  cursor: pointer;
}
.mef-status { font-size: 12px; }
/* Status-code input with reason-phrase hint next to it (ISSUES
 * 2026-05-12). `.mef-status-wrap` is a small flexbox so the label sits
 * inline with the number input but stays out of the way. */
.mef-status-wrap { display: flex; align-items: center; gap: 8px; flex: 1; }
.mef-status-input { flex: 0 0 90px; }
.mef-status-label { font-size: 12px; font-style: italic; }

/* Templating autocomplete dropdown */
.tpl-autocomplete {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  background: #fff;
  border: 1px solid var(--neutral-border);
  border-radius: 3px;
  font-family: var(--mono-stack);
  font-size: 12px;
  z-index: 999;
  min-width: 220px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.tpl-autocomplete li {
  padding: 3px 10px;
  cursor: pointer;
  display: flex;
  align-items: baseline;
  gap: 12px;
  white-space: nowrap;
}
.tpl-autocomplete-name { flex: 0 0 auto; }
.tpl-autocomplete-preview {
  /* Current value preview shown next to the variable name (ISSUES
   * 2026-05-11). Grey + truncated so it reads as "here's what it
   * resolves to right now" without dominating the suggestion line. */
  color: #888;
  font-size: 11px;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}
.tpl-autocomplete li:hover { background: rgba(127, 173, 24, 0.12); }
.tpl-autocomplete li.selected {
  background: var(--rub-blau);
  color: #fff;
}
.tpl-autocomplete li.selected .tpl-autocomplete-preview {
  /* On the selected row use a slightly lighter grey that's still legible
   * against the RUB-blau background. */
  color: #d0d8e2;
}
.tpl-autocomplete-description {
  /* Description for built-ins / req-hints — italic to distinguish from
   * a variable's literal current value (which is non-italic mono-ish
   * text). Same colour budget as the preview slot so the dropdown stays
   * visually calm.
   * ISSUES 2026-05-12: "Some Variables like {{uuid do not show the
   * values on typing. … we should show a brief description what it is." */
  color: #777;
  font-style: italic;
  font-size: 11px;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 360px;
}
.tpl-autocomplete li.selected .tpl-autocomplete-description { color: #d0d8e2; }
.tpl-autocomplete li.selected:hover { background: var(--rub-blau); }

/* Vars page — raw template vs. resolved value styling */
.var-value-template { color: var(--muted); font-style: italic; }
.var-value-resolved { color: var(--rub-blau); font-weight: 600; }

/* mSP quick-config form */
.msp-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 24px;
  margin-top: 8px;
}
.msp-field { display: flex; flex-direction: column; gap: 2px; }
.msp-field-wide { grid-column: 1 / -1; }
.msp-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.msp-input {
  font-family: var(--mono-stack);
  font-size: 13px;
  padding: 4px 6px;
  border: 1px solid var(--neutral-border);
  border-radius: 2px;
}
.msp-input:focus { outline: 2px solid var(--uni-gruen); outline-offset: -2px; }

/* Mock-editor preset bar (replaces the /templates submenu) */
.mock-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 8px 0 16px;
  padding: 8px 12px;
  background: #fbfcf7;
  border: 1px solid var(--neutral-border);
  border-radius: 3px;
}
.mock-presets-label { font-size: 12px; color: var(--muted); font-weight: 600; margin-right: 4px; }
.mock-presets-sep   { color: var(--neutral-border); margin: 0 4px; }
.mock-preset-btn {
  font-size: 12px;
  padding: 3px 10px;
  border: 1px solid var(--neutral-border);
  background: #fff;
  border-radius: 2px;
  cursor: pointer;
}
.mock-preset-btn:hover {
  border-color: var(--etikett-gruen);
  background: rgba(127, 173, 24, 0.08);
}
.mock-preset-tmpl { color: var(--rub-blau); font-weight: 600; }

/* Helper page (Phase 5) */
.helper-page section { margin: 18px 0; }
.helper-page .quick-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.helper-page .quick-btn {
  padding: 6px 14px;
  background: var(--rub-blau);
  color: #fff;
  border-radius: 3px;
  text-decoration: none;
  font-weight: 600;
}
.helper-page .quick-btn:hover { background: var(--uni-gruen); text-decoration: none; }

/* ─── Vars panel (Phase 4) ─────────────────────────────────────────── */

.vars-panel {
  margin: 12px 0 18px;
  padding: 10px 16px;
  border: 1px solid var(--neutral-border);
  border-radius: 3px;
  background: #fafafa;
}
.vars-panel summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--rub-blau);
}
.vars-table {
  width: 100%;
  margin: 12px 0 8px;
  border-collapse: collapse;
  table-layout: fixed;
}
.vars-table th, .vars-table td {
  text-align: left;
  padding: 4px 8px;
  border-bottom: 1px solid #eee;
  font-size: 13px;
  vertical-align: top;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.vars-table th { color: var(--muted); font-weight: 600; }
/* Column widths (ISSUES 2026-05-12 v3): single combined cell stacks
 * template / resolved / description vertically. The cell itself takes
 * the bulk of the width; checkbox + Name + Delete flank it. */
.vars-table th:nth-child(1), .vars-table td:nth-child(1) { width: 3%; text-align: center; }
.vars-table th:nth-child(2), .vars-table td:nth-child(2) { width: 18%; }
.vars-table th:nth-child(3), .vars-table td:nth-child(3) { width: 72%; }
.vars-table th:nth-child(4), .vars-table td:nth-child(4) {
  /* One icon-only delete button (~28px). The rename pencil now lives
   * next to the variable name (var-edit-cell on the name column), so
   * this column only needs to fit the trash can. */
  width: 40px;
  white-space: nowrap;
}

/* Stacked value cell: three lines max — raw template, resolved value
 * (only when templated), description. Each line truncates with
 * ellipsis to keep rows compact; full text on hover via title=. */
.vars-table .var-cell {
  font-size: 13px;
  vertical-align: top;
  padding-top: 8px;
  padding-bottom: 8px;
}
.vars-table .var-cell .var-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
}
.vars-table .var-cell .var-line > span:not(.var-value-arrow) {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 0 1 auto;
}
/* Top line — raw template OR literal value. */
.vars-table .var-cell .var-line-template,
.vars-table .var-cell .var-line-value {
  font-size: 13px;
}
.vars-table .var-cell .var-value-template { font-style: italic; color: #555; }
/* Middle line — resolved value (only present for templated vars).
 * Indented slightly with the ↳ arrow so the eye reads it as a
 * "renders to" hint. */
.vars-table .var-cell .var-line-resolved {
  padding-left: 4px;
  font-size: 12.5px;
  margin-top: 1px;
}
.vars-table .var-cell .var-value-resolved { color: var(--rub-blau); font-weight: 600; }
.vars-table .var-cell .var-value-arrow {
  color: var(--etikett-gruen);
  font-weight: 600;
  flex: 0 0 auto;
}
/* Bottom line — description, smaller and muted. */
.vars-table .var-cell .var-line-description {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 4px;
  font-family: var(--font-stack);
}
.vars-table .var-cell .var-line-description .var-description-text {
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Edit-input replaces the line when the pencil is clicked. Takes the
 * full row width so long values are easier to read. */
.vars-table .var-line-editing { width: 100%; }
.vars-table .var-line-editing .var-edit-input { flex: 1 1 auto; min-width: 0; }
/* Long monospace values get a single-line ellipsis preview with the full
 * value available on hover (via the existing `title` attribute). Keeps
 * rows from ballooning to 6+ lines on materialised mIdP/mSP claim JSON. */
.vars-table td.mono {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 0; /* required so the cell respects its column width when truncating */
}

/* Editable-cell flex layout: the text shrinks with ellipsis while the
 * pencil stays parked on the right edge of the cell. Lives in an inner
 * <div> rather than directly on the <td> because `display: flex` on a
 * table cell collapses the cell's resolved width in Blink/WebKit. */
.vars-table .var-edit-cell {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  overflow: visible;
}
.vars-table .var-edit-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Inline edit pencil + edit-input on the Variables table (ISSUES
 * 2026-05-12). The pencil is unobtrusive: only opacity 0.6 when the row
 * is hovered, full opacity on direct hover. The edit-input replaces the
 * cell content while editing; Enter commits, Escape reverts, blur
 * commits. */
.vars-table .var-edit-pencil {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 4px;
  margin-left: 6px;
  font-size: 11px;
  opacity: 0;
  transition: opacity 0.12s;
  vertical-align: baseline;
}
.vars-table tr:hover .var-edit-pencil { opacity: 0.6; }
.vars-table .var-edit-pencil:hover { opacity: 1; }
.vars-table .var-edit-input {
  width: 100%;
  padding: 2px 4px;
  font-family: var(--mono-stack);
  font-size: 13px;
  border: 1px solid var(--rub-blau);
  border-radius: 2px;
  background: #fff;
  box-sizing: border-box;
}

/* 2026-05-13 env-vars split: per-row "written by ↳ /path/of/mock" line
 * under each runtime var, plus per-section help blocks. The link is
 * styled like an inline crumb — etikett-gruen on hover so users can
 * tell at a glance which paragraph belongs to which mock.
 */
.vars-table .var-cell .var-line-writers {
  font-size: 11.5px;
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: baseline;
}
.vars-table .var-cell .var-writers-prefix {
  font-style: italic;
}
.vars-table .var-cell .var-writer-link {
  color: var(--rub-blau);
  text-decoration: none;
  font-size: 11.5px;
}
.vars-table .var-cell .var-writer-link:hover {
  color: var(--etikett-gruen);
  text-decoration: underline;
}

/* Section help blocks — short prose describing the role of each
 * table. Sits between the h3 and the table, narrow line-height so it
 * doesn't dominate the layout. */
.vars-section {
  margin-top: 8px;
}
.vars-section-help {
  font-size: 12.5px;
  line-height: 1.5;
  margin: 4px 0 12px 0;
  max-width: 78ch;
}
.vars-section h3 code,
.vars-section h4 code {
  font-size: 0.9em;
  background: rgba(0, 53, 145, 0.06);
  padding: 1px 6px;
  border-radius: 3px;
}

.vars-add {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr auto;
  gap: 6px;
  margin-top: 8px;
}
.vars-add input {
  padding: 4px 8px;
  font-family: var(--font-stack);
  font-size: 13px;
  border: 1px solid var(--neutral-border);
  border-radius: 3px;
}
.vars-add button { font-size: 13px; padding: 4px 12px; }

.alias-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 12px;
}
.alias-input {
  padding: 3px 8px;
  font-family: var(--mono-stack);
  font-size: 13px;
  border: 1px solid var(--neutral-border);
  border-radius: 3px;
}
.alias-row button {
  padding: 3px 10px;
  font-size: 12px;
  cursor: pointer;
}
/* Help block right under the alias-row, collapsed by default. Explains
 * what an alias is good for and how to consume it from templates.
 * (ISSUES 2026-05-12.) */
.alias-help {
  margin: -6px 0 12px;
  padding: 0;
  font-size: 12px;
}
.alias-help > summary {
  cursor: pointer;
  color: var(--rub-blau);
  user-select: none;
}
.alias-help > summary:hover { color: var(--etikett-gruen); }
.alias-help-body {
  margin: 6px 0 0;
  padding: 8px 12px;
  background: #f4f6f8;
  border-left: 3px solid var(--rub-blau);
  border-radius: 0 3px 3px 0;
}
.alias-help-body p { margin: 4px 0; }
.alias-help-body ul { margin: 4px 0 4px 14px; padding: 0; }
.alias-help-body li { margin: 2px 0; }

.kv-value {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}
.kv-value > .kv-text {
  flex: 1 1 0;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
}
.kv-value > .copy-backref { flex: 0 0 auto; }
.copy-backref {
  font-size: 11px;
  padding: 0 4px;
  background: transparent;
  border: 1px solid var(--neutral-border);
  border-radius: 3px;
  cursor: pointer;
}
.copy-backref:hover { background: rgba(127, 173, 24, 0.12); }

/* ─── Tree view (Phase 3) ──────────────────────────────────────────── */

/* Three-pane layout (tree / list / detail) with a responsive ladder:
 *   <  900px : single column — tree, list, detail stack vertically
 *   <  1280px: tree on the left (260px), list+detail share the right column
 *   >= 1280px: three side-by-side columns; each scrolls independently
 *   >= 1700px: detail column expands so big response bodies have room
 *
 * The layout tracks an `is-detail-open` / `no-detail` class so the layout
 * grid can give the list more space when nothing is selected. */
.tree-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 12px;
  align-items: start;
}
.tree-pane, .list-pane, .req-detail { min-width: 0; }
.tree-layout.no-detail .req-detail { display: none; }

@media (min-width: 900px) {
  /* Two grid children (tree, list) when no detail is open. */
  .tree-layout.no-detail {
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  }
  /* When detail is open at mid-viewport, we still only have two columns, so
   * pin the tree-pane to span both rows on the left and stack list/detail in
   * column 2. Without this, the 3rd grid child wraps under the tree. */
  .tree-layout:not(.no-detail) {
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    grid-template-rows: auto auto;
  }
  .tree-layout:not(.no-detail) .tree-pane  { grid-column: 1; grid-row: 1 / -1; }
  .tree-layout:not(.no-detail) .list-pane  { grid-column: 2; grid-row: 1; }
  .tree-layout:not(.no-detail) .req-detail { grid-column: 2; grid-row: 2; }
}
@media (min-width: 1280px) {
  /* Three columns side-by-side. Reset the row-span placement so the panes
   * flow naturally across the three columns again. The placement rules in
   * the 900 px block use `:not(.no-detail)` (specificity 0,3,0) so the
   * reset selector here must match it to actually win — a plain
   * `.tree-layout .tree-pane` (0,2,0) would lose to the 900px placements. */
  .tree-layout:not(.no-detail) {
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr) minmax(0, 1.4fr);
    grid-template-rows: auto;
  }
  .tree-layout.no-detail {
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  }
  .tree-layout:not(.no-detail) .tree-pane,
  .tree-layout:not(.no-detail) .list-pane,
  .tree-layout:not(.no-detail) .req-detail {
    grid-column: auto;
    grid-row: auto;
  }
  .tree-pane, .list-pane, .req-detail {
    max-height: calc(100vh - 220px);
    overflow-y: auto;
  }
  .req-detail {
    position: sticky;
    top: 8px;
    border-left: 3px solid var(--rub-blau);
    padding: 0 16px 16px 16px;
  }
}
@media (min-width: 1700px) {
  .tree-layout {
    grid-template-columns: 260px minmax(380px, 1fr) minmax(0, 2fr);
  }
}
.tree-pane {
  border-right: 1px solid var(--neutral-border);
  padding-right: 16px;
}
.tree-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.tree-controls button {
  font-size: 12px;
  padding: 4px 10px;
  background: #fff;
  border: 1px solid var(--neutral-border);
  border-radius: 3px;
  cursor: pointer;
  color: #1a1a1a;
}
.tree-controls button.primary {
  background: var(--rub-blau);
  color: #fff;
  border-color: var(--rub-blau);
}
.tree-controls button:hover { border-color: var(--etikett-gruen); }

/* Show-all button styled like a sub-nav row (ISSUES 2026-05-11): same RUB-blau
 * text, pale-green hover, and a " ↳ " arrow so it reads as "this is the catch-all
 * sibling of the path entries below". */
.tree-controls button.tree-nav-pill {
  background: #fbfcf7;
  color: var(--rub-blau);
  border: 1px solid var(--neutral-border);
  font-weight: 500;
  padding: 4px 12px 4px 8px;
}
.tree-controls button.tree-nav-pill::before {
  content: "↳ ";
  color: var(--etikett-gruen);
  margin-right: 2px;
}
.tree-controls button.tree-nav-pill:hover {
  background: #eef5d8;
  border-color: var(--etikett-gruen);
}

.tree-list, .tree-list ul {
  list-style: none;
  padding-left: 12px;
  margin: 0;
}
.tree-list > li > ul { border-left: 1px dashed var(--neutral-border); }
.tree-list li {
  margin: 2px 0;
  line-height: 1.4;
}
.tree-leaf {
  /* `inline-flex` would refuse to wrap the path text on long unbroken
   * segments like `.well-known/appspecific/com.chrome.devtools.json`,
   * leaking past the 260px tree-pane and producing a horizontal
   * scrollbar. Plain inline lets the inner mono span wrap, the count
   * badge stays right of the wrapped text. (ISSUES 2026-05-12.) */
  display: inline;
  padding: 1px 4px;
  border-radius: 2px;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.tree-leaf .mono { margin-right: 6px; }
.tree-leaf:hover { background: rgba(127, 173, 24, 0.12); text-decoration: none; }
/* Nested tree entries (anything inside a child `<ul>`) get a small
 * `↳` indent character so the parent relation reads at a glance.
 * The dashed left-border on .tree-list ul already gives the indent;
 * the ↳ adds the visual cue the user asked for. (ISSUES 2026-05-12.)
 * Rendered as a sibling pseudo-element on the leaf (not on .mono)
 * with a margin instead of a literal space — `overflow-wrap: anywhere`
 * on .tree-leaf would otherwise break right after the space and the
 * ↳ ended up alone on its own line for long paths like
 * `.well-known/appspecific/com.chrome.devtools.json`. */
.tree-list ul .tree-leaf::before {
  content: "↳";
  color: var(--etikett-gruen);
  font-family: var(--font-stack);
  margin-right: 4px;
}
.tree-prefix {
  margin-left: 6px;
  font-size: 11px;
  color: var(--muted);
}
.tree-count {
  display: inline-block;
  min-width: 1.5em;
  padding: 0 4px;
  background: var(--rub-blau);
  color: #fff;
  font-family: var(--mono-stack);
  font-size: 11px;
  border-radius: 8px;
  text-align: center;
}
.tree-row.flash, .req-row.flash {
  animation: catcher-flash 0.8s ease-out;
}
@keyframes catcher-flash {
  0% { background: rgba(127, 173, 24, 0.45); }
  100% { background: transparent; }
}

/* The list-pane is naturally scrollable on wide screens via its parent's
 * max-height; on narrow screens it just flows with the page. */
.list-pane { min-width: 0; }

/* Syntax-highlight overlay on the mock-editor body (ISSUES 2026-05-12).
 * Technique: a relative wrapper holds a <pre> overlay and the textarea
 * stacked on top. Textarea text is transparent so only the caret +
 * selection are visible; colors come from the <pre> underneath. Scroll
 * is mirrored in JS. Font, padding, line-height, border MUST match
 * exactly or characters drift between the two layers.
 *
 * Token colours are calibrated against catcher.css's RUB-blau / uni-
 * grün palette so the highlighter feels native, not VS-Code-stamped. */
.syntax-wrap {
  position: relative;
  margin: 0;
}
.syntax-overlay {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid transparent; /* match textarea border so positions align */
  background: #fbfcf7;
  color: #1a1a1a;
  font-family: var(--mono-stack);
  font-size: 13px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto; /* matches textarea overflow so wrapping aligns */
  pointer-events: none;
  border-radius: 3px;
  z-index: 1;
}
textarea.syntax-textarea {
  position: relative;
  z-index: 2;
  background: transparent;
  color: transparent;
  caret-color: #1a1a1a;
  padding: 8px 10px;
  font-family: var(--mono-stack);
  font-size: 13px;
  line-height: 1.4;
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
}
/* Plain (no syntax) mode: drop the overlay's background so the
 * textarea behaves like a normal input. Selection still works in this
 * mode because color: transparent only hides text, not selection. */
.syntax-wrap-plain .syntax-overlay { background: transparent; }
.syntax-wrap-plain textarea.syntax-textarea { color: #1a1a1a; }

/* Token classes — same vibe as the existing var-value-* + nav palette. */
.hl-str     { color: #007a4d; }              /* uni-gruen darker — strings */
.hl-num     { color: #b03060; }              /* indianred — numbers */
.hl-kw      { color: var(--rub-blau); font-weight: 600; }  /* keywords + literals */
.hl-key     { color: #5b4099; font-weight: 600; }   /* JSON object keys */
.hl-tag     { color: var(--rub-blau); font-weight: 600; }  /* XML/HTML tag names */
.hl-attr    { color: #7c5400; }              /* XML/HTML attribute names */
.hl-comment { color: #6e6e6e; font-style: italic; }

/* Batch-action bar above the Mocks / Variables / Keys tables (ISSUES
 * 2026-05-12). Holds "Delete selected (N)" and "Delete all" buttons.
 * The Delete-selected button is disabled (greyed) until at least one
 * row is checked. */
.batch-actions {
  display: flex;
  gap: 12px;
  margin: 8px 0;
  font-size: 12px;
}
.batch-actions button[data-batch-action] {
  color: var(--dunkles-rot);
}
.batch-actions button[data-batch-action]:disabled {
  color: var(--muted);
  cursor: not-allowed;
}
.batch-select-all, .batch-row-cb {
  cursor: pointer;
}

/* Unified row-action button — used for Copy / Edit / Rename / Delete
 * across mocks_list, vars_page, keys_list, and tree.ejs (ISSUES
 * 2026-05-12). Single canonical styling so the same affordance looks
 * the same everywhere the user sees it; applied identically to
 * <button> and <a> elements so navigation links blend in with mutation
 * buttons in the same action group. */
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: transparent;
  border: 1px solid var(--neutral-border);
  border-radius: 3px;
  padding: 2px 8px;
  font-size: 12px;
  line-height: 1.5;
  cursor: pointer;
  color: inherit;
  text-decoration: none;
  font-family: inherit;
}
.action-btn:hover {
  background: rgba(127, 173, 24, 0.12);
  border-color: var(--etikett-gruen);
  text-decoration: none;
}
.action-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
.action-btn.action-btn-danger:hover {
  background: rgba(220, 53, 69, 0.10);
  border-color: var(--dunkles-rot);
}
/* Tighter density for icon-only action buttons in tables. */
.action-btn.action-btn-iconly {
  padding: 1px 5px;
  font-size: 13px;
}
/* Action-cell wrapper — gives the row's `<td>` consistent spacing
 * between adjacent action buttons (Copy / Edit / Rename / Delete)
 * across mocks_list, vars_page, keys_list. nowrap keeps the buttons
 * always side-by-side; column widths are sized to fit so they don't
 * spill out of the table. */
.row-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  align-items: center;
}

/* Mocks-table "copy full URL" button next to each path pattern (ISSUES
 * 2026-05-12). Uses the shared .action-btn styling; only fades up on
 * row hover so resting rows stay visually quiet. The opacity rule
 * here is what makes this button feel inline-with-text rather than a
 * blocky table cell action. */
.mocks-table .mock-copy-url-btn {
  margin-left: 4px;
  vertical-align: baseline;
  opacity: 0;
  transition: opacity 0.12s;
}
.mocks-table tr:hover .mock-copy-url-btn { opacity: 0.65; }
.mocks-table .mock-copy-url-btn:hover { opacity: 1; }

/* Summary bar above the request list (ISSUES 2026-05-12). Shows the
 * canonical URL of the current selection + Copy + Edit-mock buttons.
 * Wraps to two lines on narrow viewports so the URL stays readable. */
.req-summary-bar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}
.req-summary-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.req-summary-url {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  background: #f6f7f4;
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid var(--neutral-border);
}

.req-list {
  list-style: none;
  padding: 0;
  margin: 12px 0;
}
.req-row {
  display: grid;
  /* Column 1 = batch-select checkbox (auto so it takes only its width),
   * 2 = timestamp, 3 = response status (added 2026-05-16),
   * 4 = method, 5 = path, 6 = optional edit-mock, 7 = copy.
   * Edit-mock falls back to a placeholder span on rows without one so
   * the Copy column stays aligned. */
  grid-template-columns: auto 17ch 4ch 5ch 1fr auto auto;
  gap: 8px;
  padding: 4px 6px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  border-left: 3px solid transparent;
  align-items: center;
}
.req-row .req-status {
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  border-radius: 3px;
  padding: 1px 4px;
  color: #fff;
  background: var(--muted);
}
.req-row .req-status-2xx { background: var(--etikett-gruen); }
.req-row .req-status-3xx { background: #4a8bb0; }
.req-row .req-status-4xx { background: #c97f0b; }
.req-row .req-status-5xx { background: var(--dunkles-rot); }
.req-row .req-status-1xx { background: #555; }
.req-row .req-status-pending {
  background: transparent;
  color: var(--muted);
  font-weight: 400;
}
.req-row .batch-row-cb {
  margin: 0;
  /* Larger hit target on touch without growing the visual checkbox. */
  cursor: pointer;
}
.req-batch-actions {
  /* Sit between the URL summary bar and the list. Match the existing
   * batch-actions container; add the inline "Select all" label and
   * keep things on one line. */
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-bottom: 1px solid #eee;
}
.req-batch-selectall {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #444;
  cursor: pointer;
  user-select: none;
}
/* `.copy-url` and `.edit-mock-btn` are legacy hooks kept on tree-row
 * action buttons for JS targeting + per-context micro-tweaks. The
 * shared `.action-btn` class on the same element provides the styling
 * (border, padding, hover) — no duplicate rules here. */
/* The "add mock" row button uses the green-plus emoji to signal a
 * create action, paired with the green accent on hover so it's
 * visually distinct from the edit ✏️ neighbour and the copy 📋. */
.req-row .add-mock-btn:hover { border-color: var(--etikett-gruen); }
.req-row:hover { background: #f5faea; }
.req-row.selected {
  background: rgba(0, 53, 96, 0.08);
  border-left-color: var(--rub-blau);
}
.req-row.selected:hover { background: rgba(0, 53, 96, 0.12); }

.btn-close-detail {
  float: right;
  width: 28px;
  height: 28px;
  border: 1px solid var(--neutral-border);
  background: #fff;
  border-radius: 3px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: var(--muted);
  margin-top: 8px;
}
.btn-close-detail:hover { background: rgba(127, 173, 24, 0.12); color: var(--rub-blau); }

/* Noise toggle — visually small in the tree controls. */
.tree-noise-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
  margin-left: auto;
  white-space: nowrap;
}
.tree-noise-toggle input { margin: 0; }
.req-method {
  font-family: var(--mono-stack);
  font-weight: 600;
  color: var(--rub-blau);
}
/* `min-width: 0` is the unlock for the wrap rules below: grid items
 * default to `min-width: auto` (= min-content), which is the longest
 * unbreakable token. A single long path like
 * `.well-known/appspecific/com.chrome.devtools.json` blows past `1fr`
 * and the row gets a horizontal scrollbar. Pinning min-width=0 lets
 * the cell actually shrink so `overflow-wrap: anywhere` can do its
 * job and the path wraps onto the next line like in the path tree
 * on the left. (ISSUES 2026-05-12.) */
.req-path {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.req-ts { color: var(--muted); font-size: 12px; }

.req-detail {
  margin-top: 16px;
  padding: 12px 16px;
  border: 1px solid var(--neutral-border);
  border-radius: 3px;
  background: #fafafa;
}
.req-detail h3 {
  margin: 0 0 6px;
  font-family: var(--mono-stack);
  font-size: 14px;
  color: var(--rub-blau);
  /* Long, space-less query strings (OIDC `/authorize?scope=…&redirect_uri=…`)
   * have no whitespace, so the default `overflow-wrap: normal` can't break
   * them and they overflow the pane on the right. `anywhere` wraps wherever
   * necessary and (unlike `word-break: break-all`) doesn't disrupt the
   * min-content calculation of the parent grid. */
  overflow-wrap: anywhere;
}
.req-detail h4 {
  margin: 12px 0 4px;
  font-size: 13px;
  color: var(--rub-blau);
}
.header-dl {
  display: grid;
  /* minmax(0, 1fr) lets the value column shrink below its intrinsic content
   * width. Without this, a flex child inside dd (the kv-value text node)
   * can't be coaxed into wrapping when the column itself stays max-content. */
  grid-template-columns: minmax(60px, max-content) minmax(0, 1fr);
  gap: 2px 12px;
  margin: 0;
}
.header-dl dt { color: var(--muted); word-break: break-all; }
.header-dl dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.req-body {
  padding: 8px 10px;
  background: #222;
  color: #e5e5e5;
  border-radius: 3px;
  overflow-x: auto;
  font-size: 12px;
  max-height: 360px;
}

footer.page-footer {
  padding: 16px 64px;
  border-top: 1px solid var(--neutral-border);
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* ── Phase 8: settings + banners ──────────────────────────────── */

.ok-banner {
  background: #e8f4d6;
  border: 1px solid var(--uni-gruen);
  border-left: 4px solid var(--uni-gruen);
  padding: 8px 12px;
  margin: 8px 0;
  border-radius: 3px;
}
.err-banner {
  background: #fbeaec;
  border: 1px solid var(--dunkles-rot);
  border-left: 4px solid var(--dunkles-rot);
  padding: 8px 12px;
  margin: 8px 0;
  border-radius: 3px;
}
.settings-section {
  margin: 24px 0;
  padding: 16px;
  border: 1px solid var(--neutral-border);
  border-radius: 3px;
  background: #fafafa;
}
.settings-section h3 {
  margin-top: 0;
}
.settings-table {
  border-collapse: collapse;
  margin: 8px 0;
}
.settings-table th {
  text-align: left;
  color: var(--muted);
  padding: 4px 12px 4px 0;
  font-weight: normal;
  width: 160px;
  vertical-align: top;
}
.settings-table td {
  padding: 4px 0;
}
/* Wider, three-column variant for /config Export: label | action(s) |
 * note. Pads the action column so the download buttons don't sit flush
 * against the note. (ISSUES 2026-05-12.) */
.export-table th { width: 220px; padding-right: 16px; }
.export-table td { padding: 8px 16px 8px 0; }
.export-table td:nth-child(2) { white-space: nowrap; }
.export-table td:nth-child(2) .action-btn + .action-btn { margin-left: 6px; }
.export-table td:nth-child(3) { font-size: 12px; max-width: 380px; }
.inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 8px 0;
}
.inline-form input[type="password"],
.inline-form input[type="text"] {
  padding: 6px 8px;
  border: 1px solid var(--neutral-border);
  border-radius: 3px;
  font-family: inherit;
  font-size: inherit;
  min-width: 200px;
}

/* ── Phase 9: config import textarea ──────────────────────────── */

.config-import-form textarea {
  width: 100%;
  min-height: 200px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  padding: 8px;
  border: 1px solid var(--neutral-border);
  border-radius: 3px;
}

/* Instructor multi-salt tree view (ISSUES 2026-05-12). */
.instructor-tree { margin-top: 12px; }
.instructor-tree .salt-block {
  margin: 10px 0;
  padding: 10px 14px;
  border: 1px solid var(--neutral-border);
  border-radius: 4px;
  background: #fafafa;
}
.instructor-tree .salt-block[open] { border-color: var(--rub-blau); }
.instructor-tree summary {
  cursor: pointer;
  padding: 2px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
}
.instructor-tree .salt-name {
  color: var(--rub-blau);
  font-weight: 600;
  font-size: 14px;
}
.instructor-tree .salt-admin-link {
  margin-left: auto;
  font-size: 12px;
  color: var(--uni-gruen);
  text-decoration: none;
}
.instructor-tree .salt-admin-link:hover { text-decoration: underline; }
.instructor-tree .path-tree {
  list-style: none;
  margin: 6px 0 0 6px;
  padding: 0 0 0 16px;
  border-left: 1px dotted var(--neutral-border);
}
.instructor-tree .path-node {
  font-size: 13px;
  padding: 1px 0;
}

/* ── Bundle layout — shared by the mIdP + mSP tabs (2026-05-15/16) ─
 * The bundle page leads with action buttons (Enable, or Disable +
 * Reset), then an optional Quick config / Apply preset block (gated
 * to superusers), then a chronological tab strip with the materialised
 * mocks shown inline below it. Class names are bundle-* so the same
 * stylesheet drives both mIdP and mSP without copy/paste. Per-bundle
 * specifics (the mIdP flow dropdown) keep their own classes below. */
.bundle-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 16px 0;
}
.bundle-actions .inline-form { margin: 0; }

.midp-flow-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 16px;
  padding: 10px 14px;
  background: #fbfcf7;
  border: 1px solid var(--neutral-border);
  border-radius: 3px;
}
.midp-flow-bar .inline-form { margin: 0; flex-wrap: wrap; }
.midp-flow-bar select.msp-input { min-width: 280px; }

.bundle-menubar-section {
  margin: 24px 0;
}
.bundle-menubar {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  background: #fbfcf7;
  border: 1px solid var(--neutral-border);
  border-bottom: none;
  border-radius: 3px 3px 0 0;
  padding: 0;
}
.bundle-tab {
  display: inline-block;
  padding: 8px 14px;
  text-decoration: none;
  color: var(--rub-blau);
  font-size: 13px;
  font-weight: 500;
  border-right: 1px solid var(--neutral-border);
}
.bundle-tab:last-child { border-right: none; }
.bundle-tab:hover { background: #eef5d8; }
.bundle-tab-active {
  background: var(--uni-gruen);
  color: #ffffff;
  cursor: default;
}
.bundle-tab-active:hover { background: var(--uni-gruen); color: #ffffff; }

.bundle-tab-panel {
  background: #fafafa;
  border: 1px solid var(--neutral-border);
  border-radius: 0 0 3px 3px;
  padding: 16px;
}
.bundle-tab-panel h3 {
  margin-top: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.bundle-tab-panel h3 code {
  background: #fff;
  padding: 1px 6px;
  border: 1px solid var(--neutral-border);
  border-radius: 2px;
  font-size: 13px;
}
.bundle-mock-link {
  margin-left: auto;
  font-size: 12px;
  text-decoration: none;
}
.bundle-mock-link:hover { text-decoration: underline; }

.bundle-vars-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}
.bundle-vars-table th,
.bundle-vars-table td {
  text-align: left;
  padding: 4px 12px 4px 0;
  vertical-align: top;
  font-size: 13px;
}
.bundle-vars-table th {
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--neutral-border);
}
.bundle-vars-table .bundle-var-value {
  max-width: 480px;
  word-break: break-all;
}

/* Vars tab — renders the same `_vars_body` partial used by the
 * standalone Variables page directly inline (no iframe — that double-
 * scrollbar setup was awkward; ISSUES 2026-05-16). The bundle panel
 * widens its padding because the var tables are visually heavier
 * than a single mock-editor form. */
.bundle-tab-panel.bundle-vars-panel {
  padding: 12px 16px 20px;
}

/* Merged Quick config + presets block. Quick config inputs render via
 * the shared .msp-form grid (named for the original mSP page that
 * introduced it — re-used unchanged here). Below them, a single
 * horizontal preset strip — pill-style buttons that wrap so the row
 * stays one band even with 6+ presets. Placeholder presets get a
 * dashed border + ⏳ suffix so users can tell at a glance which are
 * live and which still inherit a generic preset's values. */
.bundle-config-section .bundle-preset-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--neutral-border);
}
.bundle-preset-bar-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  margin-right: 4px;
}
.bundle-preset-form { margin: 0; }
.bundle-preset-btn {
  background: #ffffff;
  color: var(--rub-blau);
  border: 1px solid var(--neutral-border);
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
}
.bundle-preset-btn:hover {
  background: #eef5d8;
  border-color: var(--etikett-gruen);
}
.bundle-preset-btn-active {
  background: var(--rub-blau);
  color: #ffffff;
  border-color: var(--rub-blau);
}
.bundle-preset-btn-active:hover {
  background: var(--rub-blau);
  color: #ffffff;
  border-color: var(--rub-blau);
}
.bundle-preset-btn-todo {
  border-style: dashed;
  color: var(--muted);
}
.bundle-preset-btn-todo::after {
  content: ' ⏳';
}

/* ── Template hover tooltip (2026-05-15) ─────────────────────────
 * Shown when the mouse hovers over a `{{...}}` expression inside an
 * editor field. Two lines: the literal expression on top, the
 * rendered value below. Uses absolute positioning relative to the
 * viewport (style.left/top set by JS). */
.tpl-hover-tooltip {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  background: #1e2530;
  color: #f6f7f5;
  padding: 6px 10px;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  font-size: 12px;
  line-height: 1.4;
  max-width: 480px;
  white-space: pre-wrap;
}
.tpl-hover-tooltip .tpl-hover-expr {
  color: #e9efb1;
  word-break: break-all;
}
.tpl-hover-tooltip .tpl-hover-arrow {
  color: #92a2bf;
  font-weight: bold;
  margin: 2px 0;
}
.tpl-hover-tooltip .tpl-hover-value {
  color: #ffffff;
  word-break: break-all;
}
.tpl-hover-tooltip .muted {
  color: #92a2bf;
}
