:root {
  --bg: #09080a;
  --panel: #121014;
  --panel-2: #19151b;
  --panel-3: #211a22;
  --line: #332b34;
  --line-strong: #493a43;
  --text: #f2edef;
  --muted: #a3989e;
  --accent: #7a1f3d;
  --accent-strong: #9b2b50;
  --accent-soft: rgba(122, 31, 61, .18);
  --gold: #c6a15b;
  --gold-bright: #dfc37d;
  --gold-soft: rgba(198, 161, 91, .13);
  --purple: #553565;
  --purple-strong: #744789;
  --purple-soft: rgba(85, 53, 101, .18);
  --danger: #b94a5d;
  --success: #7f9f7a;
  --radius: 18px;
  --shadow: 0 22px 75px rgba(0,0,0,.38);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 20% -10%, rgba(85, 53, 101, .18), transparent 34%),
    radial-gradient(circle at 85% 0%, rgba(122, 31, 61, .14), transparent 28%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, textarea { font: inherit; }
button { color: inherit; }

.app-shell { min-height: 100vh; }
.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(11,11,16,.78);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 13px;
  display: grid; place-items: center;
  font-weight: 900; letter-spacing: -.04em;
  background: linear-gradient(135deg, var(--accent-strong), var(--purple-strong));
  box-shadow: 0 8px 30px rgba(122,31,61,.28);
}
.brand-title { font-weight: 800; font-size: 17px; letter-spacing: -.02em; }
.brand-title span { color: var(--gold-bright); font-weight: 650; }
.brand-subtitle { color: var(--muted); font-size: 12px; margin-top: 1px; }

.top-actions { display: flex; gap: 10px; }
.button {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 14px;
  cursor: pointer;
  transition: .18s ease;
}
.button:hover { transform: translateY(-1px); border-color: #3c3c4b; }
.button.ghost { background: #15151c; }
.button.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent-strong), #6f233d);
  font-weight: 750;
}

.workspace {
  display: grid;
  grid-template-columns: 236px minmax(420px, 1fr) minmax(320px, 410px);
  gap: 16px;
  padding: 16px;
  max-width: 1880px;
  margin: 0 auto;
  min-height: calc(100vh - 76px);
}

.panel {
  background: linear-gradient(180deg, rgba(23,23,32,.92), rgba(16,16,23,.96));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.section-label {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
}

.sidebar {
  padding: 18px 12px 14px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.search-box {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 14px 0;
  background: #0e0e14;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0 10px;
}
.search-box span { color: var(--muted); font-size: 18px; }
.search-box input {
  width: 100%;
  border: 0; outline: 0;
  color: var(--text);
  background: transparent;
  padding: 10px 0;
  font-size: 13px;
}
.search-box input::placeholder { color: #676778; }

.category-nav { display: flex; flex-direction: column; gap: 5px; }
.category-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 11px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #b8b8c5;
  cursor: pointer;
  text-align: left;
  transition: .16s ease;
}
.category-button:hover { background: #191921; color: white; }
.category-button.active {
  background: var(--accent-soft);
  border-color: rgba(122,31,61,.34);
  color: #f3dfc3;
}
.category-button .count {
  min-width: 24px;
  padding: 2px 7px;
  text-align: center;
  border-radius: 999px;
  background: #22222d;
  color: var(--muted);
  font-size: 11px;
}
.category-button.active .count { color: #e3c47f; background: rgba(122,31,61,.28); }
.sidebar-footer {
  margin-top: auto;
  padding: 15px 10px 4px;
  color: var(--muted);
  font-size: 11px;
  display: flex;
  gap: 5px;
}
.sidebar-footer strong { color: #c8c8d2; }

.builder { padding: 22px; overflow: hidden; }
.builder-head, .prompt-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
h1, h2 { margin: 4px 0 0; letter-spacing: -.035em; }
h1 { font-size: 27px; }
h2 { font-size: 22px; }
.selection-pill {
  padding: 7px 10px;
  border: 1px solid var(--line);
  background: #111118;
  color: var(--muted);
  border-radius: 999px;
  font-size: 12px;
}
.selection-pill span { color: var(--text); font-weight: 800; }

.module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.module-card {
  background: #121219;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  min-width: 0;
}
.module-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.module-card h3 { margin: 0; font-size: 14px; }
.module-card .mode { color: #666678; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.option-list { display: flex; flex-wrap: wrap; gap: 7px; }
.option-button {
  border: 1px solid #2c2c39;
  background: #1a1a22;
  color: #bcbcc9;
  border-radius: 9px;
  padding: 7px 9px;
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  transition: .14s ease;
}
.option-button:hover { color: #fff; border-color: #464657; background: #20202a; }
.option-button.selected {
  color: #f7efe2;
  border-color: rgba(198,161,91,.62);
  background: rgba(122,31,61,.24);
  box-shadow: inset 0 0 0 1px rgba(198,161,91,.08);
}
.empty-state {
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  gap: 8px;
}
.empty-state strong { color: var(--text); }
.empty-symbol {
  width: 48px; height: 48px; border-radius: 14px;
  border: 1px dashed #3b3b49;
  display: grid; place-items: center;
  font-size: 24px; color: #7c7c8e;
}

.prompt-panel {
  padding: 20px;
  align-self: start;
  position: sticky;
  top: 92px;
}
.status-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: #61d695;
  box-shadow: 0 0 16px rgba(97,214,149,.65);
}
#promptOutput {
  width: 100%;
  min-height: 310px;
  resize: vertical;
  outline: none;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #0c0c12;
  color: #efeff5;
  padding: 14px;
  line-height: 1.55;
  font-size: 13px;
}
#promptOutput:focus { border-color: rgba(198,161,91,.48); }
#promptOutput::placeholder { color: #5b5b69; }
.prompt-meta {
  display: flex;
  justify-content: space-between;
  padding: 8px 2px 16px;
  color: #737385;
  font-size: 10px;
  border-bottom: 1px solid var(--line);
}
.prompt-meta strong { color: #a8a8b5; }
.selected-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0 9px;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 800;
}
.text-button {
  border: 0; background: transparent; padding: 3px;
  color: #c6a15b; font-size: 10px; cursor: pointer;
  text-transform: uppercase;
}
.selected-list { display: flex; flex-direction: column; gap: 6px; }
.selected-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 9px;
  border: 1px solid #252532;
  border-radius: 9px;
  background: #15151d;
  font-size: 11px;
}
.selected-item .selected-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selected-item small { color: #77778a; display: block; margin-top: 2px; }
.remove-button {
  flex: 0 0 auto;
  width: 24px; height: 24px; border-radius: 7px;
  border: 0; background: #22222c; color: #9494a5;
  cursor: pointer;
}
.remove-button:hover { background: #31202a; color: #ffb6d8; }
.selected-placeholder { color: #686879; font-size: 11px; padding: 8px 1px; }

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  background: #20202a;
  border: 1px solid #3a3a49;
  color: white;
  padding: 10px 13px;
  border-radius: 10px;
  font-size: 12px;
  transition: .2s ease;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1180px) {
  .workspace { grid-template-columns: 210px 1fr; }
  .prompt-panel { grid-column: 1 / -1; position: static; }
  #promptOutput { min-height: 220px; }
}
@media (max-width: 760px) {
  .topbar { height: auto; padding: 13px; align-items: flex-start; }
  .brand-subtitle { display: none; }
  .top-actions { gap: 6px; }
  .button { padding: 9px 10px; font-size: 12px; }
  .workspace { grid-template-columns: 1fr; padding: 10px; }
  .sidebar { min-height: auto; }
  .category-nav { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
  .sidebar-footer { margin-top: 10px; }
  .module-grid { grid-template-columns: 1fr; }
  .builder { padding: 16px; }
  .prompt-panel { grid-column: auto; }
}

/* PromptLab v0.2 – Formatbereich */
.version-tag {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 5px;
  border: 1px solid #343444;
  border-radius: 999px;
  color: #8d8d9f;
  font-size: 9px;
  vertical-align: 1px;
}
.builder-status {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.format-badge {
  padding: 7px 10px;
  border: 1px solid var(--line);
  background: #111118;
  color: #777789;
  border-radius: 999px;
  font-size: 12px;
  transition: .16s ease;
}
.format-badge.active {
  color: #f3dfc3;
  border-color: rgba(226,43,138,.30);
  background: rgba(226,43,138,.10);
}
.module-card.category-format {
  grid-column: 1 / -1;
}
.category-format .option-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}
.option-button.format-option {
  min-height: 54px;
  padding: 10px 8px;
  font-weight: 700;
  text-align: center;
  background: #171720;
}
.option-button.format-option.selected {
  background: linear-gradient(180deg, rgba(226,43,138,.19), rgba(139,92,246,.09));
}
@media (max-width: 900px) {
  .category-format .option-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .builder-head { align-items: flex-start; }
  .builder-status { justify-content: flex-start; }
  .category-format .option-list { grid-template-columns: 1fr 1fr; }
}

/* PromptLab v0.3 – Randomizer */
.randomizer-panel {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(360px, 1.2fr);
  gap: 18px;
  align-items: center;
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid rgba(122,31,61,.34);
  border-radius: 14px;
  background:
    radial-gradient(circle at 0% 0%, rgba(122,31,61,.18), transparent 42%),
    linear-gradient(135deg, rgba(24,20,31,.96), rgba(18,18,26,.96));
}
.randomizer-copy h2 {
  margin: 4px 0 5px;
  font-size: 18px;
}
.randomizer-copy p {
  margin: 0;
  color: #818194;
  font-size: 11px;
  line-height: 1.5;
  max-width: 520px;
}
.randomizer-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.button.random-primary {
  border-color: rgba(226,43,138,.44);
  background: linear-gradient(135deg, rgba(226,43,138,.26), rgba(139,92,246,.22));
  color: #ffe6f3;
  font-weight: 760;
}
.button.random-secondary {
  background: #15151e;
  border-color: #30303d;
  color: #d3d3df;
}
.category-randomizer {
  display: flex;
  gap: 8px;
  width: 100%;
  justify-content: flex-end;
}
.category-randomizer select {
  min-width: 170px;
  border: 1px solid #30303d;
  border-radius: 11px;
  background: #101017;
  color: #d8d8e3;
  padding: 9px 34px 9px 11px;
  outline: none;
}
.category-randomizer select:focus {
  border-color: rgba(198,161,91,.48);
}
.module-title-wrap {
  min-width: 0;
}
.module-title-wrap .mode {
  display: block;
  margin-top: 4px;
}
.module-random-button {
  flex: 0 0 auto;
  border: 1px solid #30303d;
  background: #181820;
  color: #9696a7;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 10px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.module-random-button:hover {
  color: #ffd9eb;
  border-color: rgba(226,43,138,.42);
  background: rgba(198,161,91,.08);
}
.option-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.option-button.locked {
  border-color: rgba(139,92,246,.65);
  box-shadow: inset 0 0 0 1px rgba(139,92,246,.10);
}
.option-lock {
  display: inline-flex;
  align-items: center;
  padding: 1px 4px;
  border-radius: 999px;
  background: rgba(139,92,246,.18);
  color: #cbb8ff;
  font-size: 8px;
  line-height: 1.25;
  letter-spacing: .06em;
}
.selected-item.locked {
  border-color: rgba(139,92,246,.34);
  background: linear-gradient(90deg, rgba(139,92,246,.08), #15151d 38%);
}
.selected-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}
.lock-button {
  border: 1px solid #2d2d3a;
  background: #202029;
  color: #858597;
  border-radius: 7px;
  padding: 5px 7px;
  font-size: 9px;
  cursor: pointer;
}
.lock-button:hover {
  color: #e8e2ff;
  border-color: #4b4263;
}
.lock-button.active {
  color: #d9ccff;
  border-color: rgba(139,92,246,.46);
  background: rgba(139,92,246,.14);
}

@media (max-width: 980px) {
  .randomizer-panel { grid-template-columns: 1fr; }
  .randomizer-actions, .category-randomizer { justify-content: flex-start; }
}
@media (max-width: 560px) {
  .randomizer-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .randomizer-actions > .button { width: 100%; }
  .category-randomizer {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr;
  }
  .category-randomizer select { width: 100%; min-width: 0; }
}


/* PromptLab v0.3.1 – feste Kennzeichnung / Signatur */
.signature-panel {
  margin: 14px 0 2px;
  padding: 13px;
  border: 1px solid rgba(139,92,246,.30);
  border-radius: 12px;
  background:
    radial-gradient(circle at 100% 0%, rgba(139,92,246,.10), transparent 44%),
    #111118;
}
.signature-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.signature-panel h3 {
  margin: 4px 0 0;
  font-size: 13px;
  letter-spacing: -.01em;
}
.signature-status {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 4px 7px;
  border: 1px solid #343442;
  border-radius: 999px;
  color: #9191a3;
  background: #17171f;
  font-size: 9px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.signature-status.active {
  color: #bff2d1;
  border-color: rgba(97,214,149,.30);
  background: rgba(97,214,149,.08);
}
.signature-status.disabled {
  color: #ffb6c2;
  border-color: rgba(255,91,110,.28);
  background: rgba(255,91,110,.07);
}
.signature-preview {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 11px 0 8px;
  padding: 10px 11px;
  border: 1px solid #292936;
  border-radius: 9px;
  background: #0c0c12;
  transition: .18s ease;
}
.signature-preview strong {
  color: #f0d5e6;
  font-size: 12px;
}
.signature-preview span {
  color: #8b8b9c;
  font-size: 10px;
}
.signature-preview.disabled {
  opacity: .38;
  text-decoration: line-through;
}
.signature-hint {
  margin: 0 0 10px;
  color: #777789;
  font-size: 10px;
  line-height: 1.45;
}
.button.signature-button {
  width: 100%;
  padding: 8px 10px;
  border-color: #343442;
  background: #181820;
  color: #aaaabb;
  font-size: 10px;
  font-weight: 700;
}
.button.signature-button:hover {
  color: #ffd4de;
  border-color: rgba(255,91,110,.38);
}
.button.signature-button.restore {
  color: #d8ccff;
  border-color: rgba(139,92,246,.40);
  background: rgba(139,92,246,.10);
}

/* PromptLab v0.4 – Referenzbild-System */
.reference-badge {
  padding: 7px 10px;
  border: 1px solid var(--line);
  background: #111118;
  color: #777789;
  border-radius: 999px;
  font-size: 12px;
  transition: .16s ease;
}
.reference-badge.active {
  color: #d9ccff;
  border-color: rgba(139,92,246,.34);
  background: rgba(139,92,246,.11);
}
.category-button.reference-nav {
  margin-bottom: 5px;
}
.category-button.reference-nav .count {
  min-width: 34px;
  color: #cdbdff;
}
.reference-builder {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.reference-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(139,92,246,.28);
  border-radius: 14px;
  background:
    radial-gradient(circle at 100% 0%, rgba(139,92,246,.12), transparent 42%),
    linear-gradient(135deg, rgba(23,21,32,.96), rgba(17,17,25,.96));
}
.reference-intro h2 {
  margin: 4px 0 6px;
  font-size: 20px;
}
.reference-intro p {
  margin: 0;
  max-width: 720px;
  color: #858598;
  font-size: 11px;
  line-height: 1.55;
}
.master-switch {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.master-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.switch-track {
  width: 42px;
  height: 23px;
  padding: 3px;
  border: 1px solid #393948;
  border-radius: 999px;
  background: #16161e;
  transition: .18s ease;
}
.switch-track span {
  display: block;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #747486;
  transition: .18s ease;
}
.master-switch input:checked + .switch-track {
  border-color: rgba(139,92,246,.52);
  background: rgba(139,92,246,.18);
}
.master-switch input:checked + .switch-track span {
  transform: translateX(18px);
  background: #cbb8ff;
  box-shadow: 0 0 14px rgba(139,92,246,.42);
}
.master-switch strong {
  font-size: 11px;
  color: #b6b6c4;
}
.reference-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: .18s ease;
}
.reference-content.disabled {
  opacity: .42;
  filter: saturate(.55);
}
.reference-content.disabled select,
.reference-content.disabled input,
.reference-content.disabled button,
.reference-content.disabled label {
  pointer-events: none;
}
.reference-slots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.reference-slot {
  min-width: 0;
  padding: 13px;
  border: 1px solid #292936;
  border-radius: 13px;
  background: #121219;
  transition: .18s ease;
}
.reference-slot.active {
  border-color: rgba(139,92,246,.38);
  box-shadow: inset 0 0 0 1px rgba(139,92,246,.06);
}
.reference-slot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.slot-active {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #c7c7d3;
  font-size: 11px;
  font-weight: 720;
  cursor: pointer;
}
.slot-active input {
  accent-color: #8b5cf6;
}
.slot-number {
  color: #6f6f82;
  font-size: 10px;
  font-weight: 800;
}
.reference-preview {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  aspect-ratio: 16 / 7;
  margin-bottom: 10px;
  border: 1px solid #262633;
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(139,92,246,.08), transparent 55%),
    #0c0c12;
}
.reference-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #09090d;
}
.reference-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #626275;
}
.reference-placeholder span {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border: 1px solid #343443;
  border-radius: 9px;
  color: #9a8cc2;
  font-size: 13px;
  font-weight: 850;
}
.reference-placeholder small {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .09em;
}
.reference-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 8px;
}
.reference-field > span {
  color: #737385;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 800;
}
.reference-field select {
  width: 100%;
  border: 1px solid #30303d;
  border-radius: 9px;
  background: #101017;
  color: #d9d9e4;
  padding: 8px 9px;
  outline: none;
}
.reference-field select:focus {
  border-color: rgba(139,92,246,.50);
}

.reference-role-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.reference-role-grid label {
  position: relative;
  cursor: pointer;
}
.reference-role-grid input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.reference-role-grid span {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 8px;
  border: 1px solid #2d2d3a;
  border-radius: 9px;
  background: #181820;
  color: #9999aa;
  font-size: 9px;
  transition: .14s ease;
}
.reference-role-grid input:checked + span {
  border-color: rgba(139,92,246,.50);
  background: rgba(139,92,246,.12);
  color: #ded5ff;
}

.reference-upload {
  display: block;
  overflow: hidden;
  width: 100%;
  border: 1px dashed #353545;
  border-radius: 9px;
  background: #15151d;
  color: #9696a8;
  padding: 8px 9px;
  font-size: 10px;
  cursor: pointer;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reference-upload:hover {
  border-color: rgba(139,92,246,.44);
  color: #d9ccff;
}
.reference-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.reference-remove-file {
  margin-top: 7px;
}
.reference-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.reference-settings-card {
  padding: 14px;
  border: 1px solid #292936;
  border-radius: 13px;
  background: #121219;
}
.reference-settings-card h3 {
  margin: 4px 0 11px;
  font-size: 13px;
  letter-spacing: -.01em;
}
.fidelity-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
.fidelity-options label,
.reference-check-grid label {
  position: relative;
  cursor: pointer;
}
.fidelity-options input,
.reference-check-grid input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.fidelity-options span,
.reference-check-grid span {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 9px;
  border: 1px solid #2d2d3a;
  border-radius: 9px;
  background: #181820;
  color: #9999aa;
  font-size: 10px;
  transition: .14s ease;
}
.fidelity-options input:checked + span,
.reference-check-grid input:checked + span {
  border-color: rgba(139,92,246,.50);
  background: rgba(139,92,246,.12);
  color: #ded5ff;
}
.reference-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
.reference-protect-toggle {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid #292936;
  cursor: pointer;
}
.reference-protect-toggle input {
  margin-top: 3px;
  accent-color: #8b5cf6;
}
.reference-protect-toggle span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.reference-protect-toggle strong {
  color: #c8c8d5;
  font-size: 10px;
}
.reference-protect-toggle small {
  color: #777789;
  font-size: 9px;
  line-height: 1.4;
}
.reference-actions-card p {
  margin: 0 0 11px;
  color: #777789;
  font-size: 10px;
  line-height: 1.5;
}
.reference-actions-card .button {
  width: 100%;
  font-size: 10px;
}
.module-card.reference-protected {
  border-color: rgba(139,92,246,.28);
}
.module-card.reference-protected .mode {
  color: #9e8bd0;
}
.module-random-button:disabled {
  opacity: .48;
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 780px) {
  .reference-intro { align-items: flex-start; flex-direction: column; }
  .reference-slots, .reference-settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .fidelity-options, .reference-check-grid, .reference-role-grid { grid-template-columns: 1fr; }
}


/* v0.4.4 – steuerbarer Randomizer-Pool pro Modul */
.randomizer-pool-status {
  margin-top: 9px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  color: #8c8c9e;
  font-size: 10px;
}
.randomizer-pool-status strong { color: #ececf5; }
.randomizer-pool-global-actions { display: inline-flex; gap: 9px; }
.randomizer-pool-global-actions .text-button { font-size: 10px; }
.module-head-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.module-pool-toggle {
  border: 1px solid #3b2735;
  background: rgba(91, 35, 66, .12);
  color: #7e7180;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 9px;
  line-height: 1;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}
.module-pool-toggle.active {
  border-color: rgba(226,43,138,.46);
  background: rgba(226,43,138,.13);
  color: #ffd5e9;
}
.module-pool-toggle:hover { border-color: rgba(198,161,91,.62); color: #f7efe2; }
.module-card.randomizer-disabled {
  border-color: #252530;
}
.module-card.randomizer-disabled .option-list { opacity: .82; }
@media (max-width: 620px) {
  .module-card-head { align-items: flex-start; flex-direction: column; }
  .module-head-actions { width: 100%; }
  .module-head-actions > button { flex: 1 1 auto; }
}

/* PromptLab v0.4.4 hotfix: honor native hidden attribute */
[hidden] {
  display: none !important;
}

/* v0.4.5: Prompt-Sprache */
.prompt-head-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.prompt-language-control {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(9, 9, 16, 0.72);
}

.prompt-language-control > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.prompt-language-control select {
  min-width: 92px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 9px;
  background: var(--input-bg, #0b0b12);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

@media (max-width: 900px) {
  .prompt-head-tools {
    align-items: flex-end;
    flex-direction: column-reverse;
    gap: 8px;
  }

  .prompt-language-control > span {
    display: none;
  }
}


/* v0.5.0 – sichtbare, sortierte Untergruppen innerhalb großer Module */
.module-card.module-wide {
  grid-column: 1 / -1;
}

.option-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.option-group {
  min-width: 0;
  border: 1px solid #262632;
  border-radius: 11px;
  background: #101017;
  overflow: hidden;
}

.option-group > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 9px 11px;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid transparent;
  background: #15151d;
}

.option-group > summary::-webkit-details-marker {
  display: none;
}

.option-group > summary::before {
  content: '›';
  flex: 0 0 auto;
  color: #8d8d9f;
  font-size: 17px;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform .15s ease;
}

.option-group[open] > summary::before {
  transform: rotate(90deg);
}

.option-group[open] > summary {
  border-bottom-color: #262632;
}

.option-group-title {
  margin-right: auto;
  color: #d8d8e3;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.option-group-meta {
  flex: 0 0 auto;
  color: #747486;
  font-size: 9px;
  white-space: nowrap;
}

.option-list.option-list-grouped {
  padding: 10px;
}

.module-card.randomizer-disabled .option-groups {
  opacity: .86;
}

@media (max-width: 1120px) {
  .option-groups {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .module-card.module-wide {
    grid-column: auto;
  }
}

/* v0.6.0 – Mood Randomizer */
.mood-panel {
  grid-column: 1 / -1;
  margin-top: 2px;
  padding-top: 14px;
  border-top: 1px solid rgba(139,92,246,.20);
}
.mood-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.mood-head h3 {
  margin: 4px 0 5px;
  font-size: 16px;
}
.mood-head p {
  margin: 0;
  max-width: 760px;
  color: #818194;
  font-size: 11px;
  line-height: 1.5;
}
.mood-status {
  flex: 0 0 auto;
  border: 1px solid #30303d;
  border-radius: 999px;
  padding: 7px 10px;
  background: #12121a;
  color: #858597;
  font-size: 10px;
  white-space: nowrap;
}
.mood-status strong { color: #f2d9ff; }
.mood-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}
.mood-chip {
  border: 1px solid #30303d;
  border-radius: 999px;
  padding: 7px 10px;
  background: #14141d;
  color: #9c9cad;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease, transform .15s ease;
}
.mood-chip:hover {
  transform: translateY(-1px);
  color: #fff;
  border-color: rgba(139,92,246,.48);
}
.mood-chip.active {
  color: #ffe9f6;
  border-color: rgba(226,43,138,.56);
  background: linear-gradient(135deg, rgba(122,31,61,.34), rgba(139,92,246,.20));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.025);
}
.mood-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.button.mood-primary {
  border-color: rgba(139,92,246,.52);
  background: linear-gradient(135deg, rgba(139,92,246,.27), rgba(122,31,61,.28));
  color: #f5eaff;
  font-weight: 760;
}
.button.mood-secondary {
  background: #15151e;
  border-color: rgba(139,92,246,.34);
  color: #d8d1e9;
}
.mood-actions button:disabled,
.button.mood-primary:disabled,
.button.mood-secondary:disabled {
  opacity: .42;
  cursor: not-allowed;
  transform: none;
}
.mood-empty {
  color: #77778a;
  font-size: 10px;
}
@media (max-width: 620px) {
  .mood-head { flex-direction: column; }
  .mood-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .mood-actions .text-button { grid-column: 1 / -1; justify-self: start; }
}

/* === v0.7.0 · Charaktere, Freitext, Priorität, Projekte, Verlauf === */
.character-workspace {
  margin: 0 0 1rem;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  background: rgba(255,255,255,.025);
  overflow: hidden;
}
.character-workspace:empty { display: none; }
.character-workspace-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 1rem .85rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.character-workspace-head h3 { margin: .1rem 0 .25rem; font-size: 1rem; }
.character-workspace-head p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.45; }
.character-tabs { display: flex; flex-wrap: wrap; gap: .5rem; padding: .85rem 1rem; }
.character-tab {
  display: flex; align-items: center; gap: .45rem;
  border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.04);
  color: var(--text); padding: .55rem .72rem; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: .8rem;
}
.character-tab.active { border-color: rgba(255,62,177,.65); background: rgba(255,62,177,.12); }
.character-tab.disabled { opacity: .52; }
.character-tab .dot { width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; opacity: .65; }
.character-editor-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: .75rem; padding: 0 1rem 1rem;
}
.character-card { border: 1px solid rgba(255,255,255,.08); border-radius: 14px; padding: .8rem; background: rgba(0,0,0,.16); }
.character-card.active { border-color: rgba(138,84,255,.55); }
.character-card-top { display:flex; justify-content:space-between; align-items:center; gap:.65rem; margin-bottom:.65rem; }
.character-card label { font-size:.75rem; color:var(--muted); }
.character-name-input, .relation-select, .relation-custom-input {
  width:100%; border:1px solid rgba(255,255,255,.1); border-radius:10px; background:rgba(0,0,0,.28); color:var(--text);
  padding:.55rem .62rem; font:inherit; font-size:.8rem;
}
.character-enable { display:flex; align-items:center; gap:.45rem; color:var(--muted); font-size:.75rem; }
.character-edit-button { margin-top:.55rem; width:100%; }
.relation-area { border-top:1px solid rgba(255,255,255,.07); padding: .9rem 1rem 1rem; }
.relation-builder-grid { display:grid; grid-template-columns: 1fr 1.3fr 1fr auto; gap:.55rem; align-items:end; }
.relation-list { display:flex; flex-direction:column; gap:.45rem; margin-top:.7rem; }
.relation-item { display:flex; justify-content:space-between; gap:.65rem; align-items:center; padding:.55rem .65rem; border:1px solid rgba(255,255,255,.07); border-radius:10px; background:rgba(255,255,255,.025); font-size:.78rem; }
.relation-item button { flex:0 0 auto; }
.active-character-note { font-size:.78rem; color:var(--muted); white-space:nowrap; }
.module-card.character-scoped .module-title-wrap h3::after { content:' · Charakter'; color:var(--muted); font-size:.7rem; font-weight:500; }

.prompt-tools-stack { display:flex; flex-direction:column; gap:.55rem; margin:.8rem 0; }
.tool-drawer { border:1px solid rgba(255,255,255,.08); border-radius:14px; background:rgba(255,255,255,.025); overflow:hidden; }
.tool-drawer > summary { cursor:pointer; list-style:none; padding:.72rem .8rem; font-size:.82rem; font-weight:700; display:flex; justify-content:space-between; gap:.5rem; }
.tool-drawer > summary::-webkit-details-marker { display:none; }
.tool-drawer > summary::after { content:'+'; color:var(--muted); }
.tool-drawer[open] > summary::after { content:'–'; }
.tool-drawer-body { border-top:1px solid rgba(255,255,255,.07); padding:.75rem; display:flex; flex-direction:column; gap:.55rem; }
.field-label { color:var(--muted); font-size:.7rem; text-transform:uppercase; letter-spacing:.08em; font-weight:700; }
.tool-input, .tool-select, .tool-textarea {
  width:100%; box-sizing:border-box; border:1px solid rgba(255,255,255,.1); border-radius:10px; background:rgba(0,0,0,.28); color:var(--text);
  padding:.58rem .65rem; font:inherit; font-size:.78rem;
}
.tool-textarea { resize:vertical; min-height:58px; line-height:1.4; }
.tool-button-row { display:flex; flex-wrap:wrap; gap:.45rem; align-items:center; }
.button.compact { min-height:0; padding:.52rem .7rem; font-size:.75rem; }
.text-button.danger { color:#ff7f9e; }
.tool-separator { height:1px; background:rgba(255,255,255,.07); margin:.25rem 0; }
.tool-hint { margin:0; color:var(--muted); font-size:.7rem; line-height:1.45; }
.custom-block-list { display:flex; flex-direction:column; gap:.4rem; }
.custom-block-row { display:flex; justify-content:space-between; gap:.55rem; align-items:flex-start; padding:.55rem .6rem; border:1px solid rgba(255,255,255,.07); border-radius:10px; background:rgba(255,255,255,.025); }
.custom-block-row strong { display:block; font-size:.75rem; }
.custom-block-row small { display:block; margin-top:.2rem; color:var(--muted); font-size:.67rem; line-height:1.35; }

.priority-list { display:flex; flex-direction:column; gap:.35rem; max-height:360px; overflow:auto; padding-right:.15rem; }
.priority-row { display:grid; grid-template-columns:auto 1fr auto; gap:.5rem; align-items:center; padding:.48rem .5rem; border:1px solid rgba(255,255,255,.065); border-radius:9px; background:rgba(0,0,0,.18); cursor:grab; }
.priority-row.active { border-color:rgba(255,62,177,.3); background:rgba(255,62,177,.055); }
.priority-row.dragging { opacity:.45; }
.priority-handle { color:var(--muted); font-size:.8rem; letter-spacing:-.15em; }
.priority-label { min-width:0; font-size:.74rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.priority-label small { color:var(--muted); margin-left:.4rem; }
.priority-actions { display:flex; gap:.2rem; }
.priority-actions button { width:25px; height:25px; padding:0; border:1px solid rgba(255,255,255,.08); border-radius:7px; background:rgba(255,255,255,.035); color:var(--muted); cursor:pointer; }
.priority-actions button:hover { color:var(--text); border-color:rgba(255,255,255,.18); }

.history-list { display:flex; flex-direction:column; gap:.45rem; max-height:300px; overflow:auto; }
.history-item { border:1px solid rgba(255,255,255,.07); border-radius:10px; padding:.55rem .6rem; background:rgba(0,0,0,.18); }
.history-item-head { display:flex; justify-content:space-between; gap:.5rem; align-items:center; }
.history-item strong { font-size:.72rem; }
.history-item time { color:var(--muted); font-size:.62rem; }
.history-item p { margin:.28rem 0 .4rem; color:var(--muted); font-size:.67rem; line-height:1.35; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.history-item-actions { display:flex; justify-content:flex-end; gap:.4rem; }

@media (max-width: 1180px) {
  .character-editor-grid { grid-template-columns:1fr; }
  .relation-builder-grid { grid-template-columns:1fr 1fr; }
}
@media (max-width: 720px) {
  .relation-builder-grid { grid-template-columns:1fr; }
  .character-workspace-head { flex-direction:column; }
}

/* === v0.7.0 final · kompakte Werkzeugbereiche & Rubriken-Randomizer === */
.workspace-drawer {
  margin: 0 0 1rem;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 18px;
  background: rgba(255,255,255,.025);
  overflow: hidden;
}
.workspace-drawer-summary,
.character-drawer-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .82rem 1rem;
  user-select: none;
}
.workspace-drawer-summary::-webkit-details-marker,
.character-drawer-summary::-webkit-details-marker { display: none; }
.workspace-drawer-summary > span:first-child,
.character-drawer-summary > span:first-child { min-width: 0; }
.workspace-drawer-summary strong,
.character-drawer-summary strong { display:block; margin:.08rem 0; font-size:.9rem; }
.workspace-drawer-summary small,
.character-drawer-summary small { display:block; color:var(--muted); font-size:.7rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.workspace-drawer-state {
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 999px;
  color: var(--muted);
  padding: .38rem .58rem;
  font-size: .67rem;
  text-transform: uppercase;
  letter-spacing: .055em;
  font-weight: 700;
}
.workspace-drawer .state-closed,
.character-drawer .state-closed { display:none; }
.workspace-drawer:not([open]) .state-open,
.character-drawer:not([open]) .state-open { display:none; }
.workspace-drawer:not([open]) .state-closed,
.character-drawer:not([open]) .state-closed { display:inline; }
.workspace-drawer > .randomizer-panel {
  margin: 0;
  border: 0;
  border-top: 1px solid rgba(255,255,255,.07);
  border-radius: 0;
}

.character-workspace {
  margin: 0 0 1rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}
.character-drawer {
  border: 1px solid rgba(255,255,255,.085);
  border-radius: 16px;
  background: rgba(255,255,255,.02);
  overflow: hidden;
}
.character-drawer-body { border-top:1px solid rgba(255,255,255,.07); }
.relation-custom-fields {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:.55rem;
  margin-top:.55rem;
}
.relation-custom-fields[hidden] { display:none !important; }

.module-head-actions { flex-wrap:wrap; justify-content:flex-end; }
.module-groups-toggle {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: .35rem .2rem;
  font: inherit;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .045em;
}
.module-groups-toggle:hover { color:var(--text); }
.option-group > summary {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto auto;
  align-items:center;
  gap:.55rem;
}
.group-random-toggle {
  border:1px solid rgba(255,255,255,.1);
  border-radius:999px;
  background:rgba(255,255,255,.035);
  color:var(--muted);
  padding:.28rem .45rem;
  font:inherit;
  font-size:.58rem;
  font-weight:700;
  cursor:pointer;
  white-space:nowrap;
}
.group-random-toggle.active {
  color:#ff8bca;
  border-color:rgba(255,62,177,.42);
  background:rgba(255,62,177,.08);
}
.option-group.randomizer-disabled { opacity:.72; }
.option-group.randomizer-disabled .option-list { opacity:.68; }

.tool-drawer > summary {
  min-height: 42px;
  align-items:center;
}
.tool-drawer > summary::before {
  content:'';
  width:6px;
  height:6px;
  border-radius:50%;
  background:rgba(255,62,177,.7);
  margin-right:.25rem;
  flex:0 0 auto;
}
.tool-drawer > summary { justify-content:flex-start; }
.tool-drawer > summary::after { margin-left:auto; }

@media (max-width: 760px) {
  .workspace-drawer-summary,
  .character-drawer-summary { align-items:flex-start; }
  .workspace-drawer-state { margin-top:.1rem; }
  .relation-custom-fields { grid-template-columns:1fr; }
  .option-group > summary { grid-template-columns:minmax(0,1fr) auto; }
  .option-group-meta { display:none; }
}


/* PromptLab v0.8.0 – Modulverwaltung, Modulsets und eindeutige Einstellungen */
.module-manager-open {
  width: 100%; margin: 0 0 12px; padding: 9px 10px; border-radius: 10px;
  border: 1px solid rgba(139,92,246,.32); background: rgba(139,92,246,.09);
  color: #d9ccff; cursor: pointer; font-weight: 750; font-size: 11px; text-align: left;
}
.module-manager-open:hover { background: rgba(139,92,246,.15); border-color: rgba(139,92,246,.5); }
.module-manager-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; }
.module-manager-modal[hidden] { display: none !important; }
.module-manager-backdrop { position: absolute; inset: 0; background: rgba(3,3,7,.78); backdrop-filter: blur(8px); }
.module-manager-dialog { position: relative; width: min(1050px, 96vw); max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; }
.module-manager-head { display: flex; justify-content: space-between; gap: 24px; padding: 20px 22px 14px; border-bottom: 1px solid var(--line); }
.module-manager-head h2 { margin-top: 3px; }
.module-manager-head p { margin: 8px 0 0; max-width: 760px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.module-manager-close { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 10px; background: #181820; color: #aaaabd; cursor: pointer; font-size: 22px; }
.module-manager-body { padding: 16px 22px 22px; overflow: auto; }
.module-set-panel { margin-bottom: 14px; }
.module-set-buttons { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 7px; }
.module-set-button { border: 1px solid #343445; background: #181821; color: #c8c8d5; border-radius: 9px; padding: 8px 10px; cursor: pointer; font-size: 11px; }
.module-set-button:hover { border-color: rgba(226,43,138,.55); color: white; }
.module-manager-toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.module-manager-toolbar .tool-input { margin: 0; flex: 1; }
.module-manager-quick { display: flex; gap: 8px; }
.module-manager-legend { display: flex; flex-wrap: wrap; gap: 10px 16px; color: #77778a; font-size: 9px; letter-spacing: .06em; margin: 8px 0 12px; }
.module-manager-list { display: flex; flex-direction: column; gap: 8px; }
.module-manager-category { border: 1px solid var(--line); border-radius: 11px; background: #111118; overflow: hidden; }
.module-manager-category > summary { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; cursor: pointer; font-size: 12px; font-weight: 800; }
.module-manager-category > summary small { color: var(--muted); font-weight: 500; }
.module-manager-rows { border-top: 1px solid var(--line); }
.module-manager-row { display: grid; grid-template-columns: minmax(180px,1fr) auto; gap: 16px; align-items: center; padding: 10px 12px; border-bottom: 1px solid #20202a; }
.module-manager-row:last-child { border-bottom: 0; }
.module-manager-row.disabled .module-manager-info { opacity: .48; }
.module-manager-info strong { display: block; font-size: 12px; }
.module-manager-info small { display: block; margin-top: 3px; color: #6f6f80; font-size: 9px; }
.module-manager-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.manager-toggle { border: 1px solid #30303d; background: #17171f; color: #77778a; border-radius: 8px; padding: 6px 8px; cursor: pointer; font-size: 9px; font-weight: 800; }
.manager-toggle.active { color: #ffd9ec; border-color: rgba(198,161,91,.48); background: rgba(122,31,61,.18); }
body.modal-open { overflow: hidden; }
.mood-family { width: 100%; }
.mood-family + .mood-family { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.06); }
.mood-family-title { color: #858598; font-size: 9px; font-weight: 850; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 6px; }
.mood-family-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.option-group-meta { white-space: nowrap; }
@media (max-width: 760px) {
  .module-manager-modal { padding: 8px; }
  .module-manager-dialog { width: 100%; max-height: 96vh; }
  .module-manager-head { padding: 15px; }
  .module-manager-body { padding: 12px 15px 16px; }
  .module-manager-toolbar { flex-direction: column; align-items: stretch; }
  .module-manager-row { grid-template-columns: 1fr; gap: 8px; }
  .module-manager-actions { justify-content: flex-start; }
}


/* PromptLab v0.9.0 – Idee → automatische Modulauswahl */
.idea-panel {
  margin: 0 0 1rem;
  padding: 1rem;
  border: 1px solid rgba(226,43,138,.24);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(226,43,138,.065), rgba(139,92,246,.035));
}
.idea-panel-head { display:flex; justify-content:space-between; gap:1rem; align-items:flex-start; margin-bottom:.75rem; }
.idea-panel-head h2 { margin:.08rem 0 .2rem; font-size:1rem; }
.idea-panel-head p { margin:0; color:var(--muted); font-size:.72rem; line-height:1.45; max-width:760px; }
.idea-match-count { flex:0 0 auto; border:1px solid rgba(255,255,255,.09); border-radius:999px; padding:.35rem .55rem; color:var(--muted); font-size:.64rem; font-weight:750; }
.idea-input { width:100%; resize:vertical; min-height:82px; border:1px solid rgba(255,255,255,.11); border-radius:12px; background:#0f0f16; color:var(--text); padding:.78rem .85rem; font:inherit; font-size:.82rem; line-height:1.5; outline:none; }
.idea-input:focus { border-color:rgba(226,43,138,.58); box-shadow:0 0 0 3px rgba(198,161,91,.08); }
.idea-actions { display:flex; flex-wrap:wrap; gap:.5rem; align-items:center; margin-top:.65rem; }
.idea-primary { background:linear-gradient(135deg, #d72889, #8f55e8); border-color:transparent; }
.idea-actions button:disabled { opacity:.38; cursor:not-allowed; }
.idea-results { display:grid; grid-template-columns:1.2fr 1fr .8fr; gap:.65rem; margin-top:.8rem; }
.idea-results[hidden] { display:none !important; }
.idea-result-column { min-width:0; border:1px solid rgba(255,255,255,.07); border-radius:12px; background:rgba(0,0,0,.16); padding:.65rem; }
.idea-result-title { display:flex; justify-content:space-between; gap:.5rem; align-items:center; padding-bottom:.45rem; margin-bottom:.45rem; border-bottom:1px solid rgba(255,255,255,.055); color:#b9b9c7; font-size:.67rem; font-weight:800; text-transform:uppercase; letter-spacing:.055em; }
.idea-result-title strong { color:#fff; }
.idea-result-list { display:flex; flex-direction:column; gap:.38rem; }
.idea-result-item { display:grid; grid-template-columns:auto minmax(0,1fr); gap:.45rem; align-items:start; padding:.42rem .48rem; border-radius:9px; background:rgba(255,255,255,.025); }
.idea-result-item > span { color:#77d9a5; font-weight:900; }
.idea-result-item strong { display:block; font-size:.7rem; line-height:1.25; }
.idea-result-item small { display:block; margin-top:.12rem; color:var(--muted); font-size:.6rem; line-height:1.25; }
.idea-ambiguous-item { padding:.45rem .48rem; border-radius:9px; background:rgba(255,184,77,.045); border:1px solid rgba(255,184,77,.11); }
.idea-ambiguous-term { color:#e6c078; font-size:.68rem; font-weight:800; margin-bottom:.35rem; }
.idea-ambiguous-choices { display:flex; flex-wrap:wrap; gap:.3rem; }
.idea-ambiguous-choices button { border:1px solid rgba(255,255,255,.1); border-radius:999px; background:rgba(255,255,255,.035); color:#c5c5d0; padding:.28rem .45rem; font:inherit; font-size:.6rem; cursor:pointer; }
.idea-ambiguous-choices button:hover { color:white; border-color:rgba(226,43,138,.42); }
.idea-result-unmatched .idea-result-list { flex-direction:row; flex-wrap:wrap; align-content:flex-start; }
.idea-unmatched-chip { border:1px solid rgba(255,255,255,.08); border-radius:999px; padding:.28rem .43rem; color:#aaaabd; background:rgba(255,255,255,.025); font-size:.62rem; }
.idea-result-empty { color:var(--muted); font-size:.65rem; line-height:1.35; }
.idea-hint { margin:.65rem 0 0; color:#6f6f80; font-size:.62rem; line-height:1.45; }
@media (max-width: 980px) { .idea-results { grid-template-columns:1fr; } }
@media (max-width: 700px) { .idea-panel-head { flex-direction:column; } .idea-actions .button { flex:1 1 100%; } }

/* PromptLab v0.9.1 – semantische Konfliktlogik */
.option-button.conflict-blocked {
  opacity: .48;
  border-style: dashed;
  border-color: rgba(255, 166, 77, .28);
}
.option-button.conflict-blocked:hover {
  opacity: .68;
  border-color: rgba(255, 166, 77, .55);
  background: rgba(255, 166, 77, .055);
}
.option-conflict {
  margin-left: .38rem;
  padding: .08rem .28rem;
  border: 1px solid rgba(255, 166, 77, .3);
  border-radius: 999px;
  color: #d7a96c;
  font-size: .48rem;
  font-weight: 850;
  letter-spacing: .055em;
}
.manager-fixed {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(119, 217, 165, .28);
  background: rgba(119, 217, 165, .075);
  color: #8fddb2;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .035em;
}

/* PromptLab v0.9.5 – Kohärenz-/Konfliktlogik & Smart Idea Parser */
.random-detail-control {
  display:grid;
  grid-template-columns:auto minmax(150px, 220px);
  gap:.4rem .65rem;
  align-items:center;
  margin-top:.65rem;
  padding:.6rem .7rem;
  border:1px solid rgba(255,255,255,.07);
  border-radius:10px;
  background:rgba(255,255,255,.02);
}
.random-detail-control > span { color:#c8c8d5; font-size:.68rem; font-weight:800; }
.random-detail-control select {
  width:100%; border:1px solid rgba(255,255,255,.1); border-radius:8px;
  background:#111118; color:#ececf2; padding:.42rem .5rem; font:inherit; font-size:.68rem;
}
.random-detail-control small { grid-column:1 / -1; color:#6f6f80; font-size:.58rem; line-height:1.35; }
.plausibility-panel {
  margin:.55rem 0 .8rem; border:1px solid rgba(255,180,74,.24); border-radius:10px;
  background:rgba(255,180,74,.045); overflow:hidden;
}
.plausibility-panel[hidden] { display:none !important; }
.plausibility-panel > summary {
  display:flex; align-items:center; justify-content:space-between; gap:.65rem;
  padding:.55rem .65rem; cursor:pointer; color:#e2c183; font-size:.66rem; font-weight:800;
}
.plausibility-panel > summary strong {
  min-width:20px; height:20px; display:grid; place-items:center; border-radius:999px;
  background:rgba(255,180,74,.13); color:#ffd18d; font-size:.62rem;
}
.plausibility-warnings { border-top:1px solid rgba(255,180,74,.13); padding:.55rem .65rem; display:grid; gap:.4rem; }
.plausibility-warning { color:#c9b995; font-size:.61rem; line-height:1.42; display:grid; grid-template-columns:auto 1fr; gap:.45rem; align-items:start; }
.plausibility-warning strong { color:#ffd18d; min-width:4.7rem; letter-spacing:.055em; font-size:.54rem; }
.plausibility-warning.fusion { color:#cfc5ee; }
.plausibility-warning.fusion strong { color:#bca8ff; }
.plausibility-warning.bridge { color:#a9d7c2; }
.plausibility-warning.bridge strong { color:#79deb0; }
.plausibility-warning.exposure { color:#e2c6a8; }
.plausibility-warning.exposure strong { color:#ffbd7a; }
.option-button.soft-conflict { border-color:rgba(255,180,74,.28); }
.option-soft-conflict {
  margin-left:.35rem; padding:.07rem .28rem; border:1px solid rgba(255,180,74,.25);
  border-radius:999px; color:#d8b878; font-size:.48rem; font-weight:850; letter-spacing:.045em;
}
@media (max-width:760px) {
  .random-detail-control { grid-template-columns:1fr; }
  .random-detail-control small { grid-column:auto; }
}


/* v0.9.7 – hierarchische Navigation */
.category-nav {
  gap: 0;
}

.category-standalone {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-bottom: 8px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.category-groups {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.category-group {
  border-radius: 10px;
  overflow: hidden;
}

.category-group-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px 7px;
  color: #8e8ea0;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: .09em;
  font-size: 10px;
  font-weight: 850;
  user-select: none;
}

.category-group-summary::-webkit-details-marker { display: none; }

.category-group-summary:hover {
  color: #d7d7e2;
  background: rgba(255,255,255,.025);
}

.category-group-chevron {
  font-size: 16px;
  line-height: 1;
  transform: rotate(90deg);
  transition: transform .16s ease;
  color: #656577;
}

.category-group:not([open]) .category-group-chevron {
  transform: rotate(0deg);
}

.category-group-children {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0 0 5px 10px;
  margin-left: 7px;
  border-left: 1px solid #292936;
}

.category-child {
  position: relative;
  padding: 8px 9px 8px 12px;
  font-size: 12px;
  border-radius: 8px;
}

.category-child::before {
  content: "";
  position: absolute;
  left: -11px;
  top: 50%;
  width: 8px;
  height: 1px;
  background: #323240;
}

.category-child.active::before {
  background: rgba(226,43,138,.8);
}

.category-child .count {
  min-width: 20px;
  padding: 1px 6px;
  font-size: 10px;
}

/* Idee → Prompt soll im Alltag kompakt bleiben. */
.idea-drawer {
  margin-bottom: 16px;
}

.idea-drawer-summary {
  min-height: 64px;
}

.idea-panel-inner {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  margin: 0;
  background: transparent;
}

.idea-drawer:not([open]) .idea-drawer-summary {
  border-radius: inherit;
}



/* v0.10.0 – ruhige, geführte Bedienoberfläche */
.workflow-panel {
  margin: 2px 0 12px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(198,161,91,.055), rgba(85,53,101,.055));
}
.workflow-head { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.workflow-switch {
  display:flex;
  padding:3px;
  border:1px solid var(--line);
  border-radius:9px;
  background:#0d0b0e;
}
.workflow-mode-button {
  border:0;
  border-radius:6px;
  padding:5px 8px;
  background:transparent;
  color:#8f858b;
  font-size:10px;
  font-weight:850;
  cursor:pointer;
}
.workflow-mode-button.active {
  background:var(--gold-soft);
  color:var(--gold-bright);
  box-shadow:inset 0 0 0 1px rgba(198,161,91,.18);
}
.guide-panel { padding-top:10px; }
.guide-panel[hidden], .guide-summary-panel[hidden] { display:none !important; }
.guide-progress-head { display:flex; justify-content:space-between; gap:8px; color:#91868d; font-size:9px; }
.guide-progress-head strong { color:var(--gold-bright); }
.guide-progress-track { height:4px; margin:7px 0 10px; overflow:hidden; border-radius:999px; background:#241e24; }
.guide-progress-track span { display:block; height:100%; width:0; border-radius:inherit; background:linear-gradient(90deg,var(--accent-strong),var(--gold)); transition:width .2s ease; }
.guide-panel h3 { margin:0 0 4px; font-size:12px; color:#f0e8eb; }
.guide-panel p { margin:0; color:#91868d; font-size:10px; line-height:1.45; }
.guide-actions { display:flex; gap:6px; margin-top:9px; }
.guide-primary, .guide-secondary {
  border:1px solid var(--line);
  border-radius:8px;
  padding:6px 8px;
  font-size:9px;
  font-weight:850;
  cursor:pointer;
}
.guide-primary { background:var(--accent-soft); color:#f0cfd9; border-color:rgba(122,31,61,.45); }
.guide-secondary { background:#171318; color:#b9adb3; }
.guide-beginner-note { margin-top:9px !important; padding-top:8px; border-top:1px solid var(--line); color:#776e74 !important; }
.guide-beginner-note strong { color:#ad9c78; }

.category-label-wrap { min-width:0; display:flex; align-items:center; gap:6px; }
.category-label-wrap > span { min-width:0; overflow:hidden; text-overflow:ellipsis; }
.guide-nav-badge {
  flex:0 0 auto;
  padding:2px 5px;
  border-radius:999px;
  font-size:7px;
  font-style:normal;
  letter-spacing:.06em;
  font-weight:900;
}
.guide-nav-badge.step { color:#e3c47f; background:rgba(198,161,91,.12); border:1px solid rgba(198,161,91,.22); }
.guide-nav-badge.optional { color:#9e9199; background:#201a20; border:1px solid #342c34; }
.guide-nav-badge.pro { color:#c4a5ce; background:var(--purple-soft); border:1px solid rgba(116,71,137,.3); }

.category-group-summary { color:#a99063; }
.category-group-summary:hover { color:var(--gold-bright); }
.category-button.active {
  background:linear-gradient(90deg, rgba(122,31,61,.26), rgba(85,53,101,.12));
  border-color:rgba(198,161,91,.28);
  color:#f1e6e9;
  box-shadow:inset 3px 0 0 var(--gold);
}
.category-button.active .count { color:var(--gold-bright); background:rgba(198,161,91,.10); }
.category-child.active::before { background:var(--gold); }
.reference-nav { color:#c8b88e; }

.idea-drawer { border-color:rgba(85,53,101,.42); }
.idea-drawer > summary { background:linear-gradient(90deg, rgba(85,53,101,.14), rgba(18,16,20,.35)); }
.randomizer-drawer { border-color:rgba(116,71,137,.32); }
.randomizer-drawer > summary { background:linear-gradient(90deg, rgba(85,53,101,.12), rgba(18,16,20,.35)); }
.workspace-drawer-summary strong { color:#eee6ea; }
.workspace-drawer-state { color:#b99cc4; }

.guide-summary-panel {
  margin:0 0 12px;
  padding:12px;
  border:1px solid rgba(198,161,91,.24);
  border-radius:12px;
  background:linear-gradient(135deg, rgba(198,161,91,.07), rgba(85,53,101,.07));
}
.guide-summary-head { display:flex; justify-content:space-between; align-items:flex-start; gap:10px; }
.guide-summary-head strong { display:block; margin-top:3px; font-size:12px; color:#eee6e8; }
.guide-summary-head > span { color:#9a8f83; font-size:9px; }
.guide-summary-chips { display:flex; flex-wrap:wrap; gap:5px; margin-top:9px; }
.guide-summary-chips span { padding:4px 6px; border-radius:7px; background:#191419; border:1px solid #302730; color:#bcb1b7; font-size:9px; }
.guide-summary-chips span.more { color:var(--gold-bright); border-color:rgba(198,161,91,.25); background:var(--gold-soft); }
.guide-next-hint { margin-top:9px; padding-top:8px; border-top:1px solid var(--line); color:#b89c70; font-size:9px; font-weight:750; }

.negative-free-card { border-color:rgba(185,74,93,.28); background:linear-gradient(180deg, rgba(85,22,35,.12), #121014); }
.negative-free-hint { color:#9f9298; font-size:11px; margin:-2px 0 10px; }
.negative-free-field { display:block; margin-top:8px; }
.negative-free-field span { display:block; margin-bottom:4px; color:#a99da3; font-size:9px; text-transform:uppercase; letter-spacing:.08em; font-weight:800; }
.negative-free-field textarea { width:100%; resize:vertical; min-height:58px; border:1px solid var(--line); border-radius:9px; background:#0d0b0e; color:var(--text); padding:9px 10px; outline:none; }
.negative-free-field textarea:focus { border-color:rgba(185,74,93,.48); }
.group-guide-badge { margin-left:7px; padding:2px 5px; border-radius:999px; font-size:7px; font-style:normal; letter-spacing:.06em; color:#c3a2cd; background:var(--purple-soft); border:1px solid rgba(116,71,137,.28); vertical-align:middle; }

.option-button.selected {
  color:#f3eadf;
  border-color:rgba(198,161,91,.52);
  background:linear-gradient(135deg, rgba(122,31,61,.22), rgba(85,53,101,.14));
  box-shadow:inset 0 0 0 1px rgba(198,161,91,.06);
}
.button.primary { box-shadow:0 8px 24px rgba(122,31,61,.18); }
.status-dot { background:var(--gold); box-shadow:0 0 14px rgba(198,161,91,.42); }

@media (max-width: 1180px) {
  .workflow-head { align-items:flex-start; flex-direction:column; }
}


/* v0.10.1 – griffigere Prompt-Auswahlbuttons */
.option-list {
  gap: 9px;
}

.option-button {
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.25;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background .14s ease, border-color .14s ease, color .14s ease, box-shadow .14s ease, transform .08s ease;
}

.option-button:hover:not(:disabled) {
  color: #fff8ed;
  border-color: rgba(198,161,91,.48);
  background: linear-gradient(135deg, rgba(122,31,61,.18), rgba(85,53,101,.12));
  box-shadow: 0 0 0 1px rgba(198,161,91,.05), 0 5px 14px rgba(0,0,0,.16);
}

.option-button:active:not(:disabled) {
  transform: translateY(1px) scale(.99);
}

.option-button:focus-visible {
  outline: 2px solid rgba(224,194,122,.78);
  outline-offset: 2px;
}

.option-button.selected {
  border-color: rgba(224,194,122,.72);
  background: linear-gradient(135deg, rgba(122,31,61,.32), rgba(85,53,101,.20));
  box-shadow: inset 0 0 0 1px rgba(224,194,122,.08), 0 5px 16px rgba(0,0,0,.14);
}

.option-button.format-option {
  min-height: 54px;
  padding: 11px 12px;
}

@media (max-width: 720px) {
  .option-button {
    min-height: 44px;
    padding: 11px 14px;
    font-size: 13px;
  }
}


/* v0.10.2 – mitlaufende Seitenbereiche für lange Modullisten */
@media (min-width: 761px) {
  .sidebar {
    position: sticky;
    top: 92px;
    align-self: start;
    max-height: calc(100vh - 108px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .prompt-panel {
    max-height: calc(100vh - 108px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .sidebar,
  .prompt-panel {
    scrollbar-width: thin;
    scrollbar-color: rgba(198,161,91,.34) rgba(14,12,16,.55);
  }

  .sidebar::-webkit-scrollbar,
  .prompt-panel::-webkit-scrollbar {
    width: 8px;
  }

  .sidebar::-webkit-scrollbar-track,
  .prompt-panel::-webkit-scrollbar-track {
    background: rgba(14,12,16,.55);
    border-radius: 999px;
  }

  .sidebar::-webkit-scrollbar-thumb,
  .prompt-panel::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(122,31,61,.70), rgba(198,161,91,.52));
    border-radius: 999px;
    border: 2px solid rgba(14,12,16,.55);
  }
}

/* Unterhalb der Dreispaltenansicht bleibt der rechte Promptbereich bewusst im Dokumentfluss. */
@media (min-width: 761px) and (max-width: 1180px) {
  .prompt-panel {
    max-height: none;
    overflow-y: visible;
  }
}

@media (max-width: 760px) {
  .sidebar,
  .prompt-panel {
    position: static;
    top: auto;
    max-height: none;
    overflow: visible;
    scrollbar-gutter: auto;
  }
}


/* v0.10.3 – alle drei Arbeitsbereiche bleiben auf Desktop im Blick */
@media (min-width: 761px) {
  .builder {
    position: sticky;
    top: 92px;
    align-self: start;
    max-height: calc(100vh - 108px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scroll-behavior: smooth;
  }

  .builder {
    scrollbar-width: thin;
    scrollbar-color: rgba(198,161,91,.34) rgba(14,12,16,.55);
  }

  .builder::-webkit-scrollbar { width: 8px; }
  .builder::-webkit-scrollbar-track {
    background: rgba(14,12,16,.55);
    border-radius: 999px;
  }
  .builder::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(122,31,61,.70), rgba(198,161,91,.52));
    border-radius: 999px;
    border: 2px solid rgba(14,12,16,.55);
  }
}

@media (max-width: 760px) {
  .builder {
    position: static;
    max-height: none;
    overflow-y: visible;
  }
}


/* v0.11.0 – intelligenter Prompt-Compiler */
.compiler-panel{margin:0 0 14px;padding:14px;border:1px solid rgba(198,161,91,.24);border-radius:13px;background:linear-gradient(145deg,rgba(30,23,27,.96),rgba(20,16,24,.96))}
.compiler-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.compiler-head strong{display:block;color:#efe6d2;font-size:13px;margin-top:2px}.compiler-head small{display:block;max-width:520px;margin-top:4px;color:#8e858c;font-size:10px;line-height:1.4}
.compiler-mode{display:inline-flex;gap:3px;padding:3px;border:1px solid #332b31;border-radius:10px;background:#0e0c10;flex:0 0 auto}.compiler-mode-button{border:0;border-radius:7px;padding:7px 9px;background:transparent;color:#807780;font-size:10px;font-weight:800;cursor:pointer}.compiler-mode-button:hover{color:#e5d7dc;background:#1a151b}.compiler-mode-button.active{color:#16100d;background:linear-gradient(135deg,#b9914e,#dec276);box-shadow:0 4px 16px rgba(198,161,91,.16)}
.compiler-stats{display:flex;flex-wrap:wrap;gap:7px;margin-top:12px}.compiler-stats span{padding:5px 8px;border:1px solid #2c262c;border-radius:999px;color:#837982;background:#100d11;font-size:10px}.compiler-stats strong{color:#d9d0d5}.compiler-stats .compiler-used strong{color:#c6a15b}.compiler-stats .compiler-suppressed strong{color:#a84a64}.compiler-summary{margin-top:9px;color:#9e939a;font-size:10px;line-height:1.45}
.compiler-details{margin-top:10px;border-top:1px solid #2b252b;padding-top:8px}.compiler-details[hidden]{display:none!important}.compiler-details summary{color:#c6a15b;cursor:pointer;font-size:10px;font-weight:800;list-style:none}.compiler-details summary::-webkit-details-marker{display:none}.compiler-decision-list{display:flex;flex-direction:column;gap:6px;margin-top:8px}.compiler-decision{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 9px;border-radius:9px;border:1px solid #30262c;background:#130f13}.compiler-decision-copy{min-width:0}.compiler-decision-copy strong{display:inline-block;margin-right:7px;color:#b85b74;font-size:9px;letter-spacing:.08em}.compiler-decision-copy span{color:#aaa0a6;font-size:10px;line-height:1.35}.compiler-budget .compiler-decision-copy strong{color:#c6a15b}.compiler-soft .compiler-decision-copy strong{color:#76548e}
.compiler-priority-button,.importance-button{flex:0 0 auto;border:1px solid #3a3034;border-radius:8px;background:#191419;color:#9d8f96;padding:6px 8px;font-size:9px;font-weight:800;cursor:pointer}.compiler-priority-button:hover,.importance-button:hover{border-color:#80683d;color:#dbc47f}.compiler-priority-button.active,.importance-button.active{border-color:rgba(198,161,91,.55);background:rgba(198,161,91,.11);color:#dfc474}.selected-item.compiler-suppressed{opacity:.72;border-style:dashed}.selected-item.compiler-suppressed .selected-text>small{color:#a84a64}.selected-item.important{border-color:rgba(198,161,91,.42);box-shadow:inset 3px 0 0 rgba(198,161,91,.7)}.selected-actions{flex-wrap:wrap;justify-content:flex-end}
@media(max-width:1280px){.compiler-head{flex-direction:column}.compiler-mode{width:100%}.compiler-mode-button{flex:1 1 0}}

/* v0.13.2 – echte globale PromptLab-Suche */
.global-search-results {
  margin: -5px 0 14px;
  max-height: min(58vh, 680px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border: 1px solid rgba(132, 96, 190, .28);
  border-radius: 12px;
  background: #0c0c12;
  box-shadow: 0 14px 36px rgba(0,0,0,.24);
}
.global-search-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 10px 11px;
  border-bottom: 1px solid var(--line);
  background: rgba(13,13,19,.96);
  backdrop-filter: blur(8px);
}
.global-search-head strong { color: #f0d5a1; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.global-search-head span { color: var(--muted); font-size: 10px; }
.global-search-section { padding: 9px; display: grid; gap: 7px; }
.global-search-section + .global-search-section { border-top: 1px solid var(--line); }
.global-search-section-label { color: #847f90; font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; padding: 0 2px 2px; }
.global-search-category-result,
.global-search-result-main,
.global-search-hit {
  font: inherit;
  cursor: pointer;
}
.global-search-category-result {
  width: 100%;
  border: 1px solid rgba(123, 48, 91, .34);
  border-radius: 9px;
  background: rgba(87,31,62,.14);
  color: var(--text);
  padding: 8px 9px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  text-align: left;
}
.global-search-category-result:hover { border-color: rgba(218,174,88,.46); background: rgba(87,31,62,.25); }
.global-search-category-result span { font-weight: 700; font-size: 12px; }
.global-search-category-result small { color: var(--muted); font-size: 9px; }
.global-search-result-card {
  border: 1px solid #242430;
  border-radius: 10px;
  overflow: hidden;
  background: #111119;
}
.global-search-result-card:hover { border-color: rgba(130,78,182,.43); }
.global-search-result-main {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 9px 10px 8px;
  text-align: left;
  display: grid;
  gap: 2px;
}
.global-search-result-main:hover { background: rgba(104,61,151,.11); }
.global-search-breadcrumb { color: #9d719e; font-size: 9px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.global-search-result-main strong { font-size: 12px; line-height: 1.3; }
.global-search-result-main small { color: var(--muted); font-size: 9px; }
.global-search-hit-list {
  padding: 0 8px 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.global-search-hit {
  border: 1px solid rgba(218,174,88,.24);
  border-radius: 999px;
  background: rgba(218,174,88,.07);
  color: #dfd4c3;
  padding: 5px 7px;
  font-size: 9px;
  line-height: 1.15;
  text-align: left;
}
.global-search-hit small { color: #9e8e76; font-size: 8px; }
.global-search-hit:hover { border-color: rgba(218,174,88,.55); background: rgba(218,174,88,.13); color: white; }
.global-search-hit.group-hit { border-color: rgba(129,78,181,.34); background: rgba(129,78,181,.09); }
.global-search-more { color: var(--muted); font-size: 9px; align-self: center; padding: 4px 2px; }
.global-search-overflow,
.global-search-empty { color: var(--muted); font-size: 10px; line-height: 1.45; padding: 10px; }
.global-search-empty { display: grid; gap: 4px; }
.global-search-empty strong { color: #d7c5aa; font-size: 11px; }
.sidebar.global-search-active .workflow-panel,
.sidebar.global-search-active .category-nav { display: none; }
.sidebar.global-search-active .module-manager-open { margin-bottom: 0; }
.option-button.global-search-focus {
  outline: 2px solid rgba(229,190,101,.88);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(129,78,181,.18), 0 0 26px rgba(218,174,88,.16);
  animation: global-search-pulse 1.05s ease-in-out 2;
}
@keyframes global-search-pulse {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-1px); }
}
@media (max-width: 760px) {
  .global-search-results { max-height: 52vh; }
}



/* v0.16.1 – integriertes PromptLab Testlabor, sichtbares Dialogfenster */
.testlab-modal{position:fixed;inset:0;z-index:120;display:grid;place-items:center;padding:18px;isolation:isolate}.testlab-modal[hidden]{display:none!important}.testlab-backdrop{position:absolute;inset:0;z-index:0;background:rgba(3,3,7,.82);backdrop-filter:blur(9px)}.testlab-dialog{position:relative;z-index:1;width:min(1180px,97vw);max-height:92vh;overflow:hidden;display:flex;flex-direction:column;background:linear-gradient(180deg,rgba(23,23,32,.985),rgba(16,16,23,.995));color:var(--text)}.testlab-head{display:flex;justify-content:space-between;gap:24px;padding:20px 22px 14px;border-bottom:1px solid var(--line)}.testlab-head h2{margin-top:3px}.testlab-head p{margin:8px 0 0;max-width:820px;color:var(--muted);font-size:12px;line-height:1.5}.testlab-close{width:36px;height:36px;border:1px solid var(--line);border-radius:10px;background:#181820;color:#aaaabd;cursor:pointer;font-size:22px}.testlab-body{padding:16px 22px 22px;overflow:auto}.testlab-toolbar{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:14px}.testlab-control-row{display:grid;grid-template-columns:150px minmax(260px,1fr) auto;gap:14px;align-items:end;padding:12px;border:1px solid #28232b;border-radius:12px;background:#0e0d12}.testlab-stress-control{display:grid;gap:6px;color:#8f8790;font-size:10px}.testlab-stress-control .tool-select{margin:0}.testlab-progress-wrap{display:grid;gap:7px}.testlab-progress-head{display:flex;justify-content:space-between;gap:12px;font-size:10px}.testlab-progress-head strong{color:#dfca97}.testlab-progress-head span{color:var(--muted)}.testlab-progress{height:6px;border-radius:999px;background:#1b181f;overflow:hidden;border:1px solid #2a252e}.testlab-progress span{display:block;width:0;height:100%;background:linear-gradient(90deg,#6f233f,#c6a15b);transition:width .18s ease}.testlab-summary{display:grid;grid-template-columns:repeat(6,minmax(120px,1fr));gap:8px;margin:14px 0}.testlab-metric{padding:11px 12px;border:1px solid #29242d;border-radius:11px;background:linear-gradient(145deg,#121018,#0d0c11);display:grid;gap:4px}.testlab-metric>span{color:#86808a;font-size:9px;font-weight:800;text-transform:uppercase;letter-spacing:.07em}.testlab-metric>strong{color:#e9dfcc;font-size:18px}.testlab-metric>small{color:#6f6973;font-size:9px}.testlab-metric.pass{border-color:rgba(198,161,91,.38);box-shadow:inset 0 0 0 1px rgba(198,161,91,.05)}.testlab-metric.pass>strong{color:#d9bc78}.testlab-metric.warn{border-color:rgba(126,83,153,.48)}.testlab-metric.warn>strong{color:#ae86c8}.testlab-metric.fail{border-color:rgba(157,50,76,.62);background:linear-gradient(145deg,rgba(70,21,34,.24),#0d0c11)}.testlab-metric.fail>strong{color:#d26b82}.testlab-system-line{margin:0 0 14px;padding:9px 11px;border-left:3px solid #674a73;background:#111017;color:#aaa2aa;font-size:10px;line-height:1.45}.testlab-results-head{display:flex;justify-content:space-between;gap:12px;align-items:center;margin:14px 0 8px}.testlab-results-head strong{display:block;color:#dcd3c4;font-size:12px;margin-top:2px}.testlab-filter{display:inline-flex;gap:3px;padding:3px;border:1px solid #2d2730;border-radius:9px;background:#0d0c10}.testlab-filter-button{border:0;border-radius:6px;padding:6px 8px;background:transparent;color:#7e7781;font-size:9px;font-weight:800;cursor:pointer}.testlab-filter-button.active{background:#251923;color:#d8bd80}.testlab-result-list{display:flex;flex-direction:column;gap:6px;min-height:70px}.testlab-result{display:grid;grid-template-columns:72px minmax(0,1fr) auto;gap:10px;align-items:start;padding:9px 10px;border:1px solid #27232b;border-radius:9px;background:#101016}.testlab-result-badge{font-size:8px;font-weight:900;letter-spacing:.08em;text-transform:uppercase}.testlab-result.pass .testlab-result-badge{color:#c7ad6c}.testlab-result.warn .testlab-result-badge{color:#a47bc0}.testlab-result.fail .testlab-result-badge{color:#cc6079}.testlab-result-copy strong{display:block;color:#d5ccd1;font-size:10px;line-height:1.35}.testlab-result-copy small{display:block;margin-top:3px;color:#77717a;font-size:9px;line-height:1.4}.testlab-result-suite{color:#68626d;font-size:8px;text-transform:uppercase;letter-spacing:.06em}.testlab-empty{padding:16px;border:1px dashed #2c2730;border-radius:10px;color:#716b75;font-size:10px;text-align:center}.testlab-running .testlab-toolbar button,.testlab-running .testlab-stress-control select{pointer-events:none;opacity:.56}.testlab-running #qaCopyReport{pointer-events:none}.testlab-result-list .testlab-result[hidden]{display:none!important}
@media(max-width:1180px){.testlab-summary{grid-template-columns:repeat(3,1fr)}}
@media(max-width:760px){.testlab-modal{padding:7px}.testlab-dialog{width:100%;max-height:97vh}.testlab-head{padding:14px}.testlab-body{padding:12px 14px 16px}.testlab-control-row{grid-template-columns:1fr}.testlab-summary{grid-template-columns:repeat(2,1fr)}.testlab-results-head{align-items:flex-start;flex-direction:column}.testlab-result{grid-template-columns:58px 1fr}.testlab-result-suite{display:none}}


/* PromptLab v0.17.0 – eigener Modulbaustein-Editor */
.group-add-option,
.module-add-option {
  border:1px solid rgba(198,161,91,.28);
  border-radius:999px;
  background:rgba(198,161,91,.07);
  color:#d7bd82;
  padding:.28rem .48rem;
  font:inherit;
  font-size:.58rem;
  font-weight:800;
  letter-spacing:.045em;
  cursor:pointer;
  white-space:nowrap;
}
.group-add-option:hover,
.module-add-option:hover { color:#fff0c9; border-color:rgba(224,194,122,.58); background:rgba(198,161,91,.13); }
.option-group > summary { grid-template-columns:minmax(0,1fr) auto auto auto; }

.custom-option-entry { position:relative; display:inline-flex; flex-direction:column; gap:3px; max-width:100%; }
.custom-option-entry > .option-button { width:100%; }
.custom-option-tools { display:flex; align-items:center; justify-content:flex-end; gap:4px; min-height:16px; padding:0 2px; }
.custom-option-tools > span { margin-right:auto; color:#c9aa66; font-size:7px; font-weight:900; letter-spacing:.08em; }
.custom-option-tools button { border:0; background:transparent; color:#8e8490; padding:1px 3px; font:inherit; font-size:8px; cursor:pointer; }
.custom-option-tools button:hover { color:#efd18e; }

.custom-option-modal { position:fixed; inset:0; z-index:140; display:grid; place-items:center; padding:18px; }
.custom-option-modal[hidden] { display:none !important; }
.custom-option-backdrop { position:absolute; inset:0; background:rgba(3,3,7,.82); backdrop-filter:blur(9px); }
.custom-option-dialog { position:relative; width:min(920px,96vw); max-height:92vh; overflow:hidden; display:flex; flex-direction:column; box-shadow:0 28px 90px rgba(0,0,0,.52); }
.custom-option-head { display:flex; justify-content:space-between; gap:22px; padding:20px 22px 14px; border-bottom:1px solid var(--line); }
.custom-option-head h2 { margin:3px 0 0; font-size:20px; }
.custom-option-head p { margin:6px 0 0; color:#b69c6d; font-size:11px; }
.custom-option-close { width:36px; height:36px; border:1px solid var(--line); border-radius:10px; background:#181820; color:#aaaabd; cursor:pointer; font-size:22px; }
.custom-option-body { padding:16px 22px 20px; overflow:auto; }
.custom-option-topline { display:flex; align-items:end; justify-content:space-between; gap:14px; margin-bottom:14px; }
.custom-option-group-field { min-width:260px; }
.custom-option-group-field > span,
.custom-option-grid label > span { display:block; margin-bottom:5px; color:#a99da3; font-size:9px; font-weight:800; letter-spacing:.07em; text-transform:uppercase; }
.custom-option-tabs { display:flex; padding:3px; border:1px solid var(--line); border-radius:10px; background:#0d0c11; }
.custom-option-tab { border:0; border-radius:7px; background:transparent; color:#8e8791; padding:7px 12px; cursor:pointer; font:inherit; font-size:10px; font-weight:800; }
.custom-option-tab.active { color:#171112; background:linear-gradient(180deg,#e3c777,#c9a75c); }
.custom-option-grid { display:grid; grid-template-columns:1fr 1fr; gap:11px; }
.custom-option-grid label.wide { grid-column:1/-1; }
.custom-option-grid .tool-input,
.custom-option-grid .tool-textarea { width:100%; }
.custom-option-grid .tool-textarea { resize:vertical; min-height:74px; }
.syntax-input { font-family:ui-monospace,SFMono-Regular,Consolas,monospace; font-size:11px; }
.custom-option-syntax-help { display:flex; flex-direction:column; gap:7px; margin-bottom:10px; padding:12px; border:1px solid rgba(198,161,91,.22); border-radius:10px; background:rgba(198,161,91,.05); }
.custom-option-syntax-help strong { color:#ead6a3; font-size:11px; }
.custom-option-syntax-help code { overflow:auto; color:#d9cadf; font-size:10px; white-space:nowrap; }
.custom-option-syntax-help span { color:#8f8792; font-size:10px; line-height:1.45; }
.custom-option-syntax { width:100%; min-height:170px; resize:vertical; border:1px solid var(--line); border-radius:10px; background:#0b0a0e; color:#e8dde4; padding:12px; outline:none; font:11px/1.55 ui-monospace,SFMono-Regular,Consolas,monospace; }
.custom-option-syntax:focus { border-color:rgba(198,161,91,.5); box-shadow:0 0 0 2px rgba(198,161,91,.08); }
.custom-option-validation { min-height:20px; margin:10px 0 0; color:#968d96; font-size:10px; }
.custom-option-validation.ok { color:#91d3aa; }
.custom-option-validation.error { color:#ff9caf; }
.custom-option-actions { display:grid; grid-template-columns:auto 1fr auto auto; align-items:center; gap:8px; margin-top:8px; padding-top:12px; border-top:1px solid var(--line); }
.custom-option-note { margin:10px 0 0; color:#756e78; font-size:9px; line-height:1.5; }
body.modal-open { overflow:hidden; }

@media (max-width:760px) {
  .option-group > summary { grid-template-columns:minmax(0,1fr) auto auto; }
  .option-group-meta { display:none; }
  .custom-option-dialog { max-height:96vh; }
  .custom-option-topline { align-items:stretch; flex-direction:column; }
  .custom-option-group-field { min-width:0; }
  .custom-option-grid { grid-template-columns:1fr; }
  .custom-option-grid label.wide { grid-column:auto; }
  .custom-option-actions { grid-template-columns:1fr 1fr; }
  .custom-option-actions > span { display:none; }
  #deleteCustomOption { grid-column:1/-1; justify-self:start; }
}


/* v0.17.1 – alle Module nutzen die volle Breite des Arbeitsbereichs.
   Nur die Rubriken innerhalb eines Moduls verteilen sich responsiv auf Spalten. */
.module-grid {
  grid-template-columns: minmax(0, 1fr);
}
.module-grid > .module-card {
  grid-column: 1 / -1;
  width: 100%;
}
@media (max-width: 780px) {
  .module-grid > .module-card,
  .module-card.module-wide {
    grid-column: 1 / -1;
  }
}
