/* =====================================================================
   Prompter – Design System
   Dark glass UI, Roboto, FontAwesome Pro (Light)
   ===================================================================== */

/* ---------------------------------------------------------------- Tokens */
:root {
  --bg-0: #06060a;
  --bg-1: #0a0a11;

  --surface:      rgba(255, 255, 255, .045);
  --surface-2:    rgba(255, 255, 255, .07);
  --surface-3:    rgba(255, 255, 255, .10);
  --surface-solid:#12131c;

  --stroke:        rgba(255, 255, 255, .085);
  --stroke-strong: rgba(255, 255, 255, .16);

  --text:      #eceef5;
  --text-dim:  #a3a7ba;
  --text-mute: #6d7185;

  /* Ein einziger Akzentton. Verläufe nur hell -> leicht dunkler im selben Ton. */
  --accent:      #7a6bf5;
  --accent-hi:   #8577ff;
  --accent-lo:   #6a58e8;
  --accent-dark: #5c4ad4;
  --accent-rgb:  122, 107, 245;
  --gradient:    linear-gradient(160deg, var(--accent-hi), var(--accent-lo));

  /* Sekundärer Akzent: rötliches Lila, rund 40 Grad vom Primärton entfernt.
     Nur zur Unterscheidung von Typen, nie für Zustände wie "gewählt". */
  --accent-2:      #cd4cf0;
  --accent-2-hi:   #d771f3;
  --accent-2-lo:   #bf33e6;
  --accent-2-rgb:  205, 76, 240;

  --gold: #ffc55c;
  --good: #4ade80;
  --warn: #fbbf24;
  --bad:  #fb7185;

  --font:      'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-cond: 'Roboto Condensed', 'Roboto', sans-serif;
  --font-mono: 'Roboto Mono', ui-monospace, 'SF Mono', monospace;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-pill: 999px;

  --blur: 22px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .30);
  --shadow-md: 0 12px 32px -12px rgba(0, 0, 0, .65);
  --shadow-lg: 0 32px 70px -24px rgba(0, 0, 0, .8);
  --glow: 0 0 0 1px rgba(var(--accent-rgb), .35), 0 8px 30px -8px rgba(var(--accent-rgb), .40);

  --ease: cubic-bezier(.22, 1, .36, 1);
  --sidebar-w: 264px;

  color-scheme: dark;
}

/* ------------------------------------------------------------------ Reset */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4 { margin: 0; font-weight: 500; letter-spacing: -.01em; }
p { margin: 0 0 .8em; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration: none; }

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

::selection { background: rgba(var(--accent-rgb), .35); }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.14) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .12);
  border-radius: var(--r-pill);
  border: 3px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.22); background-clip: content-box; }

/* ------------------------------------------------------------- Background */
.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.aurora::after {
  /* feines Rauschen gegen Banding */
  content: '';
  position: absolute;
  inset: -50%;
  opacity: .022;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.aurora__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform;
}
.aurora__blob--1 {
  width: 46vw; height: 46vw; top: -14vw; left: -8vw;
  background: radial-gradient(circle at 30% 30%, rgba(var(--accent-rgb), .38), transparent 68%);
  animation: drift-1 34s var(--ease) infinite alternate;
}
.aurora__blob--2 {
  width: 40vw; height: 40vw; top: 24vh; right: -12vw;
  background: radial-gradient(circle at 60% 40%, rgba(88, 78, 190, .30), transparent 68%);
  animation: drift-2 44s var(--ease) infinite alternate;
}
.aurora__blob--3 {
  width: 34vw; height: 34vw; bottom: -14vw; left: 26vw;
  background: radial-gradient(circle at 50% 50%, rgba(64, 60, 130, .28), transparent 70%);
  animation: drift-3 52s var(--ease) infinite alternate;
}

@keyframes drift-1 { to { transform: translate3d(9vw, 7vh, 0) scale(1.16); } }
@keyframes drift-2 { to { transform: translate3d(-11vw, -6vh, 0) scale(1.1); } }
@keyframes drift-3 { to { transform: translate3d(6vw, -9vh, 0) scale(1.22); } }

/* --------------------------------------------------------------- Struktur */
.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

.main {
  min-width: 0;
  padding: 26px 34px 64px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* --------------------------------------------------------------- Sidebar */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 16px 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.02));
  backdrop-filter: blur(var(--blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(160%);
  border-right: 1px solid var(--stroke);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px 20px;
}
.brand__mark {
  position: relative;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--gradient);
  box-shadow: 0 8px 22px -8px rgba(var(--accent-rgb), .9);
  font-size: 16px;
  color: #0b0b12;
  flex: 0 0 auto;
}
.brand__mark::after {
  content: '';
  position: absolute; inset: 1px;
  border-radius: 11px;
  background: linear-gradient(160deg, rgba(255,255,255,.45), transparent 60%);
  mix-blend-mode: overlay;
}
.brand__name {
  display: block;
  font-family: var(--font-cond);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1;
}
.brand__sub {
  display: block;
  font-size: 10.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-mute);
  font-family: var(--font-cond);
}

.nav { display: flex; flex-direction: column; gap: 2px; }

.nav__label {
  font-family: var(--font-cond);
  font-size: 10.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-mute);
  padding: 13px 12px 6px;
}
.nav__label:first-child { padding-top: 0; }

.nav__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  color: var(--text-dim);
  transition: color .22s var(--ease), background-color .22s var(--ease), transform .22s var(--ease);
  overflow: hidden;
}
.nav__item i {
  display: inline-block;
  width: 18px;
  text-align: center;
  font-size: 15px;
  transform-origin: center center;
  transition: transform .3s var(--ease);
}
.nav__item span { font-size: 13.5px; }
.nav__item:hover { color: var(--text); background: var(--surface); }
.nav__item:hover i { transform: scale(1.09); }
.nav__item.is-active {
  color: #fff;
  background: rgba(var(--accent-rgb), .20);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .30);
}
.nav__badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-mute);
  background: var(--surface-2);
  padding: 1px 7px;
  border-radius: var(--r-pill);
}

.sidebar__foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }

.mini-stat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--stroke);
}
.mini-stat i { color: var(--gold); font-size: 15px; }
.mini-stat b { font-family: var(--font-mono); font-size: 15px; font-weight: 500; }
.mini-stat span { font-size: 11px; color: var(--text-mute); display: block; line-height: 1.2; }

/* --------------------------------------------------------------- Topbar */
.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.topbar__title {
  font-family: var(--font-cond);
  font-size: 30px;
  font-weight: 300;
  letter-spacing: -.005em;
  line-height: 1.1;
}
.topbar__sub { color: var(--text-mute); font-size: 13px; margin-top: 3px; }
.topbar__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ----------------------------------------------------------------- Cards */
.card {
  position: relative;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(var(--blur)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(150%);
  box-shadow: var(--shadow-md);
  transition: border-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
}
.card--pad { padding: 20px 22px; }
.card--hover:hover { border-color: var(--stroke-strong); transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--stroke);
}
.card__title {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-cond);
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.card__title i { color: var(--accent); font-size: 13px; }
.card__body { padding: 18px 20px; }
.card__foot { padding: 14px 20px; border-top: 1px solid var(--stroke); }

.grid { display: grid; gap: 18px; }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* Passt sich der Anzahl Kacheln an – zwei füllen die Breite, vier teilen sie. */
.grid--auto { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid--sidebar { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }

/* ----------------------------------------------------------- Gruppentitel */
.group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 -6px 4px;
  font-family: var(--font-cond);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.group-head i { color: var(--accent); font-size: 13px; }
.group-head:first-child { margin-top: 0; }

/* --------------------------------------------------------- Einstiegskarte */
.entry {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 38px 22px 30px;
  overflow: hidden;
  text-align: center;
}
/* Weich ausgeblendeter Farbklecks hinter dem Icon */
.entry::before {
  content: '';
  position: absolute;
  top: -84px; left: 50%;
  width: 260px; height: 260px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--accent-rgb), .26), transparent 68%);
  filter: blur(32px);
  pointer-events: none;
  transition: opacity .3s var(--ease), transform .35s var(--ease);
}
.entry:hover::before { transform: translateX(-50%) scale(1.14); }
.entry > * { position: relative; }

.entry__icon {
  width: 72px; height: 72px;
  display: grid; place-items: center;
  border-radius: 22px;
  background: rgba(var(--accent-rgb), .10);
  border: 1px solid rgba(var(--accent-rgb), .22);
  color: var(--accent);
  font-size: 26px;
  box-shadow: 0 16px 38px -20px rgba(var(--accent-rgb), .9);
  transition: background-color .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}
.entry:hover .entry__icon {
  background: rgba(var(--accent-rgb), .16);
  border-color: rgba(var(--accent-rgb), .34);
  transform: translateY(-2px);
}

.entry__title {
  display: block;
  font-family: var(--font-cond);
  font-size: 16px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-dim);
  transition: color .25s var(--ease);
}
.entry:hover .entry__title { color: var(--text); }

.entry__count {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-mute);
}

/* ------------------------------------------------------------- KPI-Kachel */
.kpi { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.kpi__top { display: flex; align-items: center; justify-content: space-between; }
.kpi__icon {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  color: var(--accent);
  font-size: 14px;
}
.kpi__label {
  font-family: var(--font-cond);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.kpi__value {
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: -.02em;
}
.kpi__value small { font-size: 14px; color: var(--text-mute); margin-left: 4px; }
.kpi__hint { font-size: 12px; color: var(--text-mute); }

/* --------------------------------------------------------------- Buttons */
.btn {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--text);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .18s var(--ease), background-color .2s var(--ease),
              border-color .2s var(--ease), box-shadow .2s var(--ease), opacity .2s;
  -webkit-user-select: none; user-select: none;
}
.btn i { font-size: 13px; }
.btn:hover { background: var(--surface-3); border-color: var(--stroke-strong); }
.btn:active { transform: scale(.975); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn--primary {
  border-color: transparent;
  background: var(--gradient);
  color: #0a0a10;
  font-weight: 500;
  box-shadow: 0 8px 22px -12px rgba(var(--accent-rgb), .8);
}
.btn--primary:hover {
  background: linear-gradient(160deg, var(--accent), var(--accent-dark));
  border-color: transparent;
  box-shadow: 0 10px 26px -12px rgba(var(--accent-rgb), .85);
}

.btn--ghost { background: transparent; border-color: var(--stroke); }
.btn--ghost:hover { background: var(--surface); }

.btn--quiet { background: transparent; border-color: transparent; color: var(--text-dim); padding: 7px 10px; }
.btn--quiet:hover { background: var(--surface-2); color: var(--text); border-color: transparent; }

.btn--danger { color: var(--bad); border-color: rgba(251,113,133,.28); background: rgba(251,113,133,.08); }
.btn--danger:hover { background: rgba(251,113,133,.16); border-color: rgba(251,113,133,.45); }

.btn--sm { padding: 6px 11px; font-size: 12px; border-radius: var(--r-sm); }
.btn--lg { padding: 12px 22px; font-size: 14px; }
.btn--lg i { font-size: 14px; }
.btn--icon { padding: 0; width: 34px; height: 34px; flex: 0 0 auto; }
.btn--icon.btn--sm { width: 28px; height: 28px; }
.btn--block { width: 100%; }

.btn-group { display: inline-flex; gap: 6px; }

/* ----------------------------------------------------------------- Forms */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field__label {
  font-family: var(--font-cond);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-mute);
  display: flex; align-items: center; gap: 7px;
}
.field__hint { font-size: 11.5px; color: var(--text-mute); }

/* ------------------------------------------------------------ Variablen */
.varrow { display: flex; flex-direction: column; gap: 8px; }
.varrow__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.varrow__body { display: flex; flex-direction: column; gap: 6px; }

.varrow__slot {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  background: rgba(0, 0, 0, .18);
  border: 1px solid var(--stroke);
}
.varrow__slot-label { font-size: 11.5px; color: var(--text-dim); }
.varrow__slot-context { font-size: 10.5px; color: var(--text-mute); }

/* Noch nicht ausgefüllter Platzhalter */
.varrow__body.is-open > .input,
.varrow__slot.is-open .input {
  border-color: rgba(251, 113, 133, .35);
  box-shadow: inset 0 0 0 1px rgba(251, 113, 133, .18);
}
.field-row { display: flex; gap: 14px; flex-wrap: wrap; }
.field-row > .field { flex: 1 1 180px; }

.input, .textarea {
  width: 100%;
  padding: 10px 13px;
  background: rgba(0, 0, 0, .28);
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
  color: var(--text);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--text-mute); }
.input:focus, .textarea:focus {
  outline: none;
  border-color: rgba(var(--accent-rgb), .6);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .16);
  background: rgba(0, 0, 0, .38);
}
.textarea { resize: vertical; min-height: 84px; line-height: 1.6; }
.textarea--mono { font-family: var(--font-mono); font-size: 13px; }

.input-icon { position: relative; display: flex; align-items: center; }
.input-icon > i {
  position: absolute; left: 13px;
  color: var(--text-mute); font-size: 13px; pointer-events: none;
}
.input-icon .input { padding-left: 36px; }

/* Switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; -webkit-user-select: none; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__track {
  width: 40px; height: 22px;
  border-radius: var(--r-pill);
  background: rgba(255,255,255,.10);
  border: 1px solid var(--stroke);
  position: relative;
  transition: background-color .25s var(--ease);
  flex: 0 0 auto;
}
.switch__track::after {
  content: '';
  position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform .25s var(--ease);
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.switch input:checked + .switch__track { background: var(--gradient); border-color: transparent; }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch__text { font-size: 13px; color: var(--text-dim); }

/* Auswahl-Chip (auch als Button verwendbar) */
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 13px;
  border-radius: var(--r-pill);
  border: 1px solid var(--stroke);
  background: var(--surface);
  font-size: 12.5px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all .2s var(--ease);
  -webkit-user-select: none; user-select: none;
}
/* Als <label> mit Checkbox verwendet – das Kästchen selbst bleibt verborgen. */
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip i { font-size: 12px; }
.chip:hover { background: var(--surface-2); color: var(--text); }
.chip.is-on {
  color: #fff;
  border-color: rgba(var(--accent-rgb), .62);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .62);
  background: rgba(var(--accent-rgb), .16);
}
.chip-set { display: flex; flex-wrap: wrap; gap: 8px; }

/* ------------------------------------------------------- Icon-Picker */
.iconpick { display: flex; flex-direction: column; gap: 9px; }

.iconpick__field { display: flex; align-items: center; gap: 10px; }
.iconpick__preview {
  width: 40px; height: 40px;
  flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: var(--r-md);
  background: rgba(var(--accent-rgb), .10);
  border: 1px solid rgba(var(--accent-rgb), .22);
  color: var(--accent);
  font-size: 16px;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.iconpick__input { font-family: var(--font-mono); font-size: 13px; }

.iconpick__hint { margin: 0; font-size: 11.5px; color: var(--text-mute); }

.iconpick.is-unknown .iconpick__preview {
  background: rgba(251, 113, 133, .10);
  border-color: rgba(251, 113, 133, .28);
  color: var(--bad);
}
.iconpick.is-unknown .iconpick__hint { color: #ffb4be; }

.iconpick__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
  gap: 5px;
  max-height: 168px;
  overflow-y: auto;
  padding: 8px;
  border-radius: var(--r-md);
  background: rgba(0, 0, 0, .22);
  border: 1px solid var(--stroke);
}
.iconpick__opt {
  aspect-ratio: 1;
  display: grid; place-items: center;
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--r-sm);
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  transition: background-color .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease);
}
.iconpick__opt:hover { background: var(--surface-2); color: var(--text); }
.iconpick__opt.is-on {
  color: var(--accent);
  background: rgba(var(--accent-rgb), .16);
  border-color: rgba(var(--accent-rgb), .32);
}

/* ------------------------------------------------------- Custom Dropdown */
/* Breite = breitester Eintrag (Sizer im selben Grid-Feld), damit beim
   Wechsel der Auswahl nichts springt. */
.dd { position: relative; display: inline-block; }
.dd--block { display: block; }
/* In einer Spalte nicht auf volle Breite ziehen – die Breite kommt vom Sizer. */
.field > .dd:not(.dd--block),
.field > .dp:not(.dp--block) { align-self: flex-start; }

.dd__btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 13px;
  background: rgba(0, 0, 0, .28);
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
  cursor: pointer;
  text-align: left;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease);
}
.dd__btn:hover { border-color: var(--stroke-strong); }
.dd__btn:focus-visible { outline: none; border-color: rgba(var(--accent-rgb), .6); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .16); }
.dd.is-open .dd__btn { border-color: rgba(var(--accent-rgb), .6); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .16); }

.dd__lead { color: var(--accent); font-size: 13px; flex: 0 0 auto; }

.dd__value { display: grid; flex: 1 1 auto; min-width: 0; }
.dd__value > * { grid-area: 1 / 1; }
.dd__label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.dd__label.is-placeholder { color: var(--text-mute); }
/* Unsichtbarer Sizer: gibt die Breite vor, beansprucht aber keine Höhe. */
.dd__sizer { height: 0; overflow: hidden; visibility: hidden; pointer-events: none; }
.dd__sizer span { display: block; white-space: nowrap; font-size: 13px; }

.dd__caret { color: var(--text-mute); font-size: 11px; transition: transform .25s var(--ease); flex: 0 0 auto; }
.dd.is-open .dd__caret { transform: rotate(180deg); }

.dd__menu {
  position: absolute;
  z-index: 60;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
  border-radius: var(--r-md);
  background: rgba(19, 20, 29, .975);
  border: 1px solid var(--stroke-strong);
  backdrop-filter: blur(26px) saturate(170%);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(-6px) scale(.985);
  transform-origin: top center;
  pointer-events: none;
  transition: opacity .18s var(--ease), transform .18s var(--ease);
}
.dd.is-open .dd__menu { opacity: 1; transform: none; pointer-events: auto; }
.dd.is-up .dd__menu { top: auto; bottom: calc(100% + 6px); transform-origin: bottom center; }

.dd__option {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
  text-align: left;
  transition: background-color .14s var(--ease), color .14s var(--ease);
}
.dd__option i { width: 15px; text-align: center; font-size: 12px; color: var(--text-mute); }
.dd__option:hover, .dd__option.is-cursor { background: var(--surface-2); }
.dd__option.is-selected { color: #fff; background: rgba(var(--accent-rgb), .18); }
.dd__option.is-selected i { color: var(--accent); }
.dd__option .dd__check { margin-left: auto; color: var(--accent); font-size: 11px; opacity: 0; }
.dd__option.is-selected .dd__check { opacity: 1; }

.dd__sep { height: 1px; background: var(--stroke); margin: 5px 4px; }

/* ---------------------------------------------------- Custom Date Picker */
.dp { position: relative; display: inline-block; }
.dp--block { display: block; }

.dp__panel {
  position: absolute;
  z-index: 60;
  top: calc(100% + 6px);
  left: 0;
  width: 274px;
  padding: 12px;
  border-radius: var(--r-lg);
  background: rgba(19, 20, 29, .975);
  border: 1px solid var(--stroke-strong);
  backdrop-filter: blur(26px) saturate(170%);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(-6px) scale(.985);
  transform-origin: top left;
  pointer-events: none;
  transition: opacity .18s var(--ease), transform .18s var(--ease);
}
.dp.is-open .dp__panel { opacity: 1; transform: none; pointer-events: auto; }

.dp__head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 10px; }
.dp__month {
  font-family: var(--font-cond);
  font-size: 13px;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.dp__nav {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  border: 1px solid var(--stroke);
  background: var(--surface);
  cursor: pointer;
  font-size: 11px;
  color: var(--text-dim);
  transition: all .18s var(--ease);
}
.dp__nav:hover { background: var(--surface-3); color: var(--text); }

.dp__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp__dow {
  text-align: center;
  font-family: var(--font-cond);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-mute);
  padding-bottom: 5px;
}
.dp__day {
  aspect-ratio: 1;
  display: grid; place-items: center;
  border: 0;
  background: transparent;
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
  transition: background-color .15s var(--ease), color .15s var(--ease), transform .15s var(--ease);
}
.dp__day:hover { background: var(--surface-2); color: var(--text); transform: scale(1.06); }
.dp__day.is-muted { color: var(--text-mute); opacity: .45; }
.dp__day.is-today { box-shadow: inset 0 0 0 1px rgba(255,255,255,.24); color: var(--text); }
.dp__day.is-selected {
  background: var(--gradient);
  color: #0a0a10;
  font-weight: 500;
  box-shadow: 0 6px 18px -8px rgba(var(--accent-rgb), .9);
}
.dp__foot { display: flex; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--stroke); }

/* ---------------------------------------------------------------- Tabelle */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th {
  font-family: var(--font-cond);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-mute);
  text-align: left;
  font-weight: 400;
  padding: 10px 14px;
  border-bottom: 1px solid var(--stroke);
  white-space: nowrap;
}
.table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,.045);
  vertical-align: middle;
}
.table tbody tr { transition: background-color .18s var(--ease); }
.table tbody tr:hover { background: rgba(255,255,255,.028); }
.table tbody tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; font-family: var(--font-mono); }
.table td.shrink { width: 1%; white-space: nowrap; }

/* Tag direkt beim Bewerten anlegen */
.taginput { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.taginput__field { flex: 1 1 200px; }

/* ----------------------------------------------------------------- Sterne */
/* Ein Stern besteht aus zwei Glyphen: dem gedimmten ganzen und der
   linken Hälfte darüber. Daraus ergeben sich leer, halb und voll. */
.stars, .stars-input { display: inline-flex; gap: 3px; color: var(--gold); }
.stars { font-size: 13px; }
.stars--empty { color: var(--text-mute); }

.star {
  position: relative;
  display: inline-grid;
  place-items: center;
  line-height: 1;
}
/* Nur der ganze Stern bildet den leeren Zustand. Die Hälfte darüber ist
   unsichtbar, bis sie gebraucht wird – sonst überlagern sich beide. */
.star > i:first-child { opacity: .2; transition: opacity .12s var(--ease); }
.star > .star__half {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity .12s var(--ease);
}
.star.is-on > i:first-child { opacity: 1; }
.star.is-half > .star__half { opacity: 1; }

.stars-input { gap: 5px; }
.stars-input button {
  border: 0; background: transparent; cursor: pointer;
  font-size: 21px; padding: 2px 0;
  color: var(--gold);
}
/* Kein Skalieren beim Überfahren – die Füllung ist die Rückmeldung.
   Grössenänderungen liessen die Reihe unruhig wirken. */
.stars-input:hover { filter: brightness(1.06); }

/* ------------------------------------------------------------------- Tags */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  font-size: 11.5px;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  color: var(--text-dim);
  white-space: nowrap;
}
.tag i { font-size: 10.5px; }
.tag--accent{ color: #cfc7ff; border-color: rgba(var(--accent-rgb), .28); background: rgba(var(--accent-rgb), .12); }
/* Kategorie-Typ: Solo im primären Akzent, Stapelbar im sekundären. */
.tag--solo  { color: #d5cfff; border-color: rgba(var(--accent-rgb), .40);   background: rgba(var(--accent-rgb), .18); }
.tag--stack { color: #f3c4ff; border-color: rgba(var(--accent-2-rgb), .44); background: rgba(var(--accent-2-rgb), .20); }

.tag--plus  { color: #a7f3c9; border-color: rgba(74, 222, 128, .26); background: rgba(74, 222, 128, .10); }
.tag--minus { color: #ffb4be; border-color: rgba(251, 113, 133, .26); background: rgba(251, 113, 133, .10); }

.chip--plus.is-on {
  color: #d3fbe4;
  border-color: rgba(74, 222, 128, .5);
  box-shadow: inset 0 0 0 1px rgba(74, 222, 128, .5);
  background: rgba(74, 222, 128, .16);
}
.chip--minus.is-on {
  color: #ffd4da;
  border-color: rgba(251, 113, 133, .5);
  box-shadow: inset 0 0 0 1px rgba(251, 113, 133, .5);
  background: rgba(251, 113, 133, .16);
}

/* Ein Durchlauf */
.run {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: rgba(0, 0, 0, .20);
  border: 1px solid var(--stroke);
  transition: border-color .2s var(--ease);
}
.run:hover { border-color: var(--stroke-strong); }
.run__head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.run__note { font-size: 12.5px; color: var(--text-dim); line-height: 1.65; white-space: pre-wrap; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }

.pill-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-mute);
  background: var(--surface-2);
  padding: 1px 7px;
  border-radius: var(--r-pill);
}

/* ------------------------------------------------------------------ Modal */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
  background: rgba(4, 4, 8, .62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s var(--ease);
}
.overlay.is-open { opacity: 1; pointer-events: auto; }

.modal {
  width: min(640px, 100%);
  display: flex;
  flex-direction: column;
  border-radius: var(--r-xl);
  background: rgba(16, 17, 25, .88);
  border: 1px solid var(--stroke-strong);
  backdrop-filter: blur(30px) saturate(170%);
  -webkit-backdrop-filter: blur(30px) saturate(170%);
  box-shadow: var(--shadow-lg);
  transform: translateY(14px) scale(.97);
  opacity: 0;
  transition: transform .28s var(--ease), opacity .28s var(--ease);
}
.overlay.is-open .modal { transform: none; opacity: 1; }
.modal--wide { width: min(860px, 100%); }

.modal__head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--stroke);
}
.modal__title { font-family: var(--font-cond); font-size: 17px; letter-spacing: .01em; display: flex; align-items: center; gap: 10px; }
.modal__title i { color: var(--accent); font-size: 15px; }
.modal__body { padding: 20px 22px; display: flex; flex-direction: column; gap: 16px; }
.modal__foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--stroke);
}
.modal__foot .spacer { margin-right: auto; }

/* ------------------------------------------------------------------ Toast */
.toasts {
  position: fixed;
  right: 24px; bottom: 24px;
  z-index: 300;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 11px;
  min-width: 240px; max-width: 380px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: rgba(18, 19, 28, .9);
  border: 1px solid var(--stroke-strong);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  pointer-events: auto;
  animation: toast-in .34s var(--ease);
}
.toast.is-out { animation: toast-out .28s var(--ease) forwards; }
.toast i { font-size: 15px; }
.toast--success i { color: var(--good); }
.toast--error i { color: var(--bad); }
.toast--info i { color: var(--accent); }

@keyframes toast-in  { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes toast-out { to   { opacity: 0; transform: translateX(24px); } }

/* ------------------------------------------------------------------- Tabs */
.tabs {
  display: flex;
  gap: 4px;
  padding: 5px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--stroke);
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
}
.tab {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 15px;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--text-dim);
  white-space: nowrap;
  cursor: pointer;
  border: 0; background: transparent;
  transition: color .2s var(--ease), background-color .2s var(--ease);
}
.tab i { font-size: 12.5px; }
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.is-active {
  color: #fff;
  background: rgba(var(--accent-rgb), .20);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.10);
}

/* -------------------------------------------------------------- Utilities */
.mono { font-family: var(--font-mono); }
.dim { color: var(--text-dim); }
.mute { color: var(--text-mute); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stack { display: flex; flex-direction: column; }
.stack-2 { gap: 8px; } .stack-3 { gap: 12px; } .stack-4 { gap: 18px; } .stack-5 { gap: 26px; }
.row { display: flex; align-items: center; }
.row-2 { gap: 8px; } .row-3 { gap: 12px; } .row-4 { gap: 18px; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.push { margin-left: auto; }
.center { justify-content: center; }
.hidden { display: none !important; }
/* Auch dann, wenn eine Komponente sonst display setzt – etwa .btn. */
[hidden] { display: none !important; }
.good { color: var(--good); }
.bad { color: var(--bad); }
.gold { color: var(--gold); }
.accent { color: var(--accent); }

.empty {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 54px 24px 50px;
  text-align: center;
  color: var(--text-mute);
  overflow: hidden;
}
/* Subtiler Farbklecks hinter dem Icon */
.empty::before {
  content: '';
  position: absolute;
  top: -70px; left: 50%;
  width: 280px; height: 280px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--accent-rgb), .22), transparent 68%);
  filter: blur(34px);
  pointer-events: none;
}
.empty > * { position: relative; }

.empty__icon {
  width: 64px; height: 64px;
  display: grid; place-items: center;
  border-radius: 20px;
  background: rgba(var(--accent-rgb), .10);
  border: 1px solid rgba(var(--accent-rgb), .22);
  color: var(--accent);
  font-size: 22px;
  box-shadow: 0 14px 34px -18px rgba(var(--accent-rgb), .9);
}

.empty p { max-width: 340px; font-size: 13px; margin: 0; line-height: 1.65; }
.empty__title { font-family: var(--font-cond); font-size: 19px; color: var(--text); }

.divider { height: 1px; background: var(--stroke); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ==================================================================
   Builder
   ================================================================== */
.builder { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }

/* Art des Prompts */
.kindswitch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.kindswitch__opt {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "icon label" "icon hint";
  align-items: center;
  gap: 2px 14px;
  padding: 15px 18px;
  text-align: left;
  border: 1px solid var(--stroke);
  border-radius: var(--r-lg);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .22s var(--ease), background-color .22s var(--ease), transform .22s var(--ease);
}
.kindswitch__opt:hover { border-color: var(--stroke-strong); transform: translateY(-1px); }
.kindswitch__opt i {
  grid-area: icon;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  color: var(--text-dim);
  font-size: 15px;
  transition: all .22s var(--ease);
}
.kindswitch__label { grid-area: label; font-family: var(--font-cond); font-size: 15px; letter-spacing: .02em; }
.kindswitch__hint { grid-area: hint; font-size: 11.5px; color: var(--text-mute); }
.kindswitch__opt.is-on {
  border-color: rgba(var(--accent-rgb), .58);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .58);
  background: rgba(var(--accent-rgb), .12);
}
.kindswitch__opt.is-on i {
  background: rgba(var(--accent-rgb), .18);
  border-color: rgba(var(--accent-rgb), .34);
  color: var(--accent);
}

/* ------------------------------------------------------------------ Wizard */
.wizard { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.wizard__bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px 16px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(var(--blur)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(150%);
}

.stepper {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.stepper::-webkit-scrollbar { display: none; }

.stepper__item {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 7px 12px 7px 8px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-mute);
  font-size: 12.5px;
  cursor: pointer;
  transition: color .2s var(--ease), background-color .2s var(--ease), border-color .2s var(--ease);
}
.stepper__item:hover { color: var(--text-dim); background: var(--surface-2); }

.stepper__dot {
  width: 22px; height: 22px;
  flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--stroke-strong);
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1;
  transition: all .2s var(--ease);
}
.stepper__label { white-space: nowrap; }

.stepper__count {
  min-width: 17px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  background: rgba(var(--accent-rgb), .18);
  color: #cfc7ff;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 17px;
  text-align: center;
}

.stepper__item.is-done { color: var(--text-dim); }
.stepper__item.is-done .stepper__dot {
  border-color: rgba(var(--accent-rgb), .34);
  background: rgba(var(--accent-rgb), .14);
  color: var(--accent);
  font-size: 9px;
}
.stepper__item.is-current {
  color: #fff;
  background: rgba(var(--accent-rgb), .16);
  border-color: rgba(var(--accent-rgb), .34);
}
.stepper__item.is-current .stepper__dot {
  background: var(--accent);
  border-color: transparent;
  color: #0a0a10;
}

.progress {
  height: 3px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .07);
  overflow: hidden;
}
.progress__fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--accent-hi), var(--accent-lo));
  transition: width .35s var(--ease);
}

.wizard__step { display: flex; flex-direction: column; gap: 18px; animation: step-in .3s var(--ease); }
@keyframes step-in { from { opacity: 0; transform: translateX(8px); } }

.wizard__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 4px;
}
.wizard__count { font-size: 11.5px; color: var(--text-mute); }

/* Bausteine zur Auswahl */
.cat-block + .cat-block { margin-top: 14px; }
.cat-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  flex-wrap: wrap;
}
.cat-head__icon {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  color: var(--accent);
  font-size: 13px;
  flex: 0 0 auto;
}
.cat-head__name { display: block; font-family: var(--font-cond); font-size: 15px; letter-spacing: .02em; }
.cat-head__meta { display: block; font-size: 11.5px; color: var(--text-mute); }

.opt-grid {
  display: grid;
  gap: 9px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  padding: 0 18px 18px;
}
.opt {
  position: relative;
  display: flex; flex-direction: column; gap: 5px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, .20);
  cursor: pointer;
  transition: border-color .2s var(--ease), background-color .2s var(--ease), transform .2s var(--ease);
  -webkit-user-select: none; user-select: none;
}
.opt:hover { border-color: var(--stroke-strong); background: rgba(255, 255, 255, .05); transform: translateY(-1px); }
.opt__name { display: flex; align-items: center; gap: 8px; font-size: 13px; }
/* Eckig = Mehrfachauswahl, rund = eine Auswahl. */
.opt__tick {
  width: 15px; height: 15px;
  flex: 0 0 auto;
  display: grid; place-items: center;
  border: 1px solid var(--stroke-strong);
  color: transparent;
  transition: all .2s var(--ease);
}
.opt__tick--check { border-radius: 5px; font-size: 8px; }
.opt__tick--radio { border-radius: 50%; font-size: 5px; }
.opt__body {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-mute);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* Der zusätzliche Innenschatten wirkt wie ein zweites Randpixel, ohne
   dass sich das Layout um einen Pixel verschiebt. */
.opt.is-on {
  border-color: rgba(var(--accent-rgb), .62);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .62);
  background: rgba(var(--accent-rgb), .12);
}
.opt.is-on .opt__tick { background: var(--accent); border-color: transparent; color: #0a0a10; }
.opt.is-on .opt__body { color: var(--text-dim); }

/* Live-Vorschau */
.preview { position: sticky; top: 26px; display: flex; flex-direction: column; gap: 16px; }
.preview__text {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.75;
  padding: 16px;
  border-radius: var(--r-md);
  background: rgba(0, 0, 0, .32);
  border: 1px solid var(--stroke);
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.preview__text:empty::before {
  content: 'Noch nichts ausgewählt.';
  color: var(--text-mute);
  font-family: var(--font);
}
.preview__meta {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-mute);
}

.picked { display: flex; flex-wrap: wrap; gap: 6px; }
.picked:empty::before { content: 'Keine Bausteine gewählt'; color: var(--text-mute); font-size: 12px; }
.picked__chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 6px 4px 10px;
  border-radius: var(--r-pill);
  background: rgba(var(--accent-rgb), .12);
  border: 1px solid rgba(var(--accent-rgb), .28);
  font-size: 11.5px;
}
.picked__chip button {
  border: 0; background: transparent; cursor: pointer;
  color: var(--text-mute); font-size: 10px; padding: 2px 4px;
  border-radius: 50%;
  transition: color .18s, background-color .18s;
}
.picked__chip button:hover { color: var(--bad); background: rgba(251, 113, 133, .14); }

/* ==================================================================
   Listenzeile (Einstellungen)
   ================================================================== */
.row-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  transition: background-color .18s var(--ease);
}
.row-item:hover { background: rgba(255, 255, 255, .03); }
.row-item__main { min-width: 0; flex: 1 1 auto; }
.row-item__name { font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.row-item__meta { font-size: 11.5px; color: var(--text-mute); }
.row-item__actions { display: flex; gap: 4px; opacity: 0; transition: opacity .2s var(--ease); }
.row-item:hover .row-item__actions,
.row-item:focus-within .row-item__actions { opacity: 1; }

.row-item__icon {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  color: var(--accent);
  font-size: 13px;
  flex: 0 0 auto;
}

.drag-handle { cursor: grab; color: var(--text-mute); font-size: 12px; padding: 4px; }
.drag-handle:active { cursor: grabbing; }
.is-dragging { opacity: .4; }
.drop-target { box-shadow: inset 0 2px 0 0 var(--accent); }

/* ==================================================================
   Login
   ================================================================== */
.login {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 24px;
}
.login__card {
  width: min(400px, 100%);
  padding: 34px 32px;
  border-radius: var(--r-xl);
  background: rgba(16, 17, 25, .68);
  border: 1px solid var(--stroke-strong);
  backdrop-filter: blur(30px) saturate(170%);
  -webkit-backdrop-filter: blur(30px) saturate(170%);
  box-shadow: var(--shadow-lg);
}
.login__brand {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  margin-bottom: 26px;
  text-align: center;
}
.login__error {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 13px;
  border-radius: var(--r-md);
  background: rgba(251, 113, 133, .10);
  border: 1px solid rgba(251, 113, 133, .28);
  color: #ffc2ca;
  font-size: 12.5px;
  margin-bottom: 16px;
}

/* ==================================================================
   Responsive
   ================================================================== */
.sidebar__toggle { display: none; }

@media (max-width: 1240px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--sidebar { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1000px) {
  :root { --sidebar-w: 0px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 268px;
    z-index: 150;
    transform: translateX(-100%);
    transition: transform .32s var(--ease);
    background: rgba(12, 13, 20, .94);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after {
    content: '';
    position: fixed; inset: 0; z-index: 140;
    background: rgba(4, 4, 8, .6);
    backdrop-filter: blur(4px);
  }
  .sidebar__toggle { display: inline-flex; }
  .main { padding: 20px 18px 56px; }
  .grid--3, .grid--2 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .grid--4 { grid-template-columns: minmax(0, 1fr); }
  .topbar__title { font-size: 24px; }
  .toasts { left: 16px; right: 16px; bottom: 16px; }
  .toast { max-width: none; }
}

/* =====================================================================
   Testreihen
   ===================================================================== */
.end { justify-content: flex-end; }

.input--num { width: 88px; }

.card.is-done { opacity: .68; }
.card.is-done:hover { opacity: 1; }

.variant__no {
  display: grid; place-items: center;
  width: 22px; height: 22px;
  flex: 0 0 auto;
  border-radius: var(--r-pill);
  background: rgba(var(--accent-rgb), .16);
  border: 1px solid rgba(var(--accent-rgb), .30);
  color: #cfc7ff;
  font-family: var(--font-mono);
  font-size: 11px;
}

.variant.is-judged .variant__no {
  background: rgba(var(--accent-rgb), .28);
  border-color: rgba(var(--accent-rgb), .55);
  color: #fff;
}

/* Die Bewertung liegt eingeklappt unter dem Prompt; offen ist sie,
   solange die Variante noch nicht bewertet wurde. */
.variant__form { display: none; border-top: 1px solid var(--stroke); }
.variant__form.is-open { display: block; }

/* Eine Frage samt Antwort. */
.qa { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.qa__label {
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: .01em;
}

/* =====================================================================
   Vorschaubilder
   ===================================================================== */
/* Immer "contain": bei einer Pose ist der Rand – Kopf, Hände, Füsse –
   genau das, worauf es ankommt. Ein Beschnitt würde sie unkenntlich
   machen. */
.thumb {
  width: 34px; height: 42px;
  flex: 0 0 auto;
  border-radius: var(--r-sm);
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, .35);
  object-fit: contain;
}

.thumb--empty {
  display: grid; place-items: center;
  border-style: dashed;
  color: var(--text-mute);
  font-size: 12px;
}

.imgpick { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; }

.imgpick__tile {
  position: relative;
  width: 112px; height: 140px;
  flex: 0 0 auto;
  display: grid; place-items: center;
  padding: 0;
  border-radius: var(--r-md);
  border: 1px dashed var(--stroke-strong);
  background: rgba(0, 0, 0, .28);
  color: var(--text-mute);
  cursor: pointer;
  overflow: hidden;
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.imgpick__tile:hover,
.imgpick__tile.is-over {
  border-color: rgba(var(--accent-rgb), .62);
  background: rgba(var(--accent-rgb), .10);
  color: var(--text-dim);
}
.imgpick__tile.has-image { border-style: solid; }
.imgpick__tile img { width: 100%; height: 100%; object-fit: contain; }

.imgpick__empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center;
  line-height: 1.45;
}
.imgpick__empty i { font-size: 20px; }

.imgpick__busy {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: rgba(6, 6, 10, .72);
  color: var(--accent);
  font-size: 18px;
}

.imgpick__side { display: flex; flex-direction: column; gap: 9px; flex: 1 1 200px; min-width: 0; }

/* Im Builder sitzt das Bild über dem Namen und trägt die ganze Breite. */
.opt--image { padding-top: 0; overflow: hidden; }
.opt__image {
  width: calc(100% + 28px);
  height: 128px;
  margin: 0 -14px 7px;
  object-fit: contain;
  background: rgba(0, 0, 0, .35);
  border-bottom: 1px solid var(--stroke);
}

/* ------------------------------------------------------ Ergebnis-Screenshots */
.shot-drop {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 26px 20px;
  border-radius: var(--r-md);
  border: 1px dashed var(--stroke-strong);
  background: rgba(0, 0, 0, .22);
  color: var(--text-dim);
  font-size: 12.5px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.shot-drop:hover,
.shot-drop.is-over {
  border-color: rgba(var(--accent-rgb), .62);
  background: rgba(var(--accent-rgb), .10);
}
.shot-drop > i { font-size: 20px; color: var(--accent); }
.shot-drop .tiny { max-width: 46ch; line-height: 1.5; }

.shot-drop__busy {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  border-radius: var(--r-md);
  background: rgba(6, 6, 10, .78);
  color: var(--accent);
  font-size: 20px;
}

.shot { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.shot__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.shot img {
  display: block;
  width: 100%;
  border-radius: var(--r-md);
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, .35);
}
