:root, :root[data-theme], html, html[data-theme] {
  /* Farben angelehnt an das Deutsche-Bahn-Design-System (Dark Mode):
     kühle Grautöne ("cool gray") als Flächen, DB-Rot als Akzent. */
  --jp-black:  #0c1319;  /* Night-Hintergrund */
  --jp-dark:   #131821;  /* Ebene 1 */
  --jp-card:   #1c2530;  /* Cool Gray 800 (Karten/Flächen) */
  --jp-border: #354049;  /* Cool Gray 700 (Linien) */
  --jp-gold:   #c8a84b;  /* Jazzpotatoes-Gold (Akzent) */
  --jp-red-soft: rgba(200, 168, 75, 0.15);
  --jp-orange: #d4a017;  /* Gold (primär) */
  --jp-orange-dark: #b8860b; /* Gold (Hover) */
  --jp-white:  #f4f7f9;
  --jp-muted:  #8a949f;  /* Cool Gray 400 */
  --db-red:    #c8a84b;  /* Alias → Gold */
  --jp-font:   'DB Screen Sans', 'Helvetica Neue', Arial, sans-serif;

  /* Keine CSS-Variable mehr nötig für den Tabellenkopf-Offset */

  /* Pico-Variablen überschreiben, damit die ganze App dem Theme folgt. */
  --pico-font-family: var(--jp-font);
  --pico-background-color: var(--jp-black);
  --pico-color: var(--jp-white);
  --pico-primary: var(--jp-orange);
  --pico-primary-hover: var(--jp-orange-dark);
  --pico-primary-background: var(--jp-orange);
  --pico-primary-hover-background: var(--jp-orange-dark);
  --pico-secondary: var(--jp-gold);
  --pico-secondary-hover: var(--jp-gold);
  --pico-secondary-background: transparent;
  --pico-secondary-hover-background: rgba(200,168,75,0.12);
  --pico-secondary-border: var(--jp-gold);
  --pico-muted-color: var(--jp-muted);
  --pico-card-background-color: var(--jp-card);
  --pico-card-border-color: var(--jp-border);
  --pico-border-radius: 4px;
  --pico-form-element-background-color: var(--jp-dark);
  --pico-form-element-border-color: var(--jp-border);
  --pico-form-element-color: var(--jp-white);
  --pico-form-element-active-background-color: var(--jp-dark);
  --pico-form-element-active-border-color: var(--jp-gold);
  --pico-form-element-focus-color: var(--jp-gold);
  --pico-table-border-color: var(--jp-border);
  --pico-table-row-striped-background-color: transparent;
  --pico-table-row-stripped-background-color: transparent;
}

/* Formularelemente einheitlich dunkel */
input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]),
select,
textarea {
  background-color: var(--jp-dark);
  border: 1px solid var(--jp-border);
  color: var(--jp-white);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--jp-gold);
  background-color: var(--jp-dark);
  color: var(--jp-white);
  outline: none;
}
/* Pico Container: volle Höhe durchreichen, kein eigenes Scrollen. */
.container {
  display: flex; flex-direction: column;
  height: 100%; max-width: 100%; padding: 0;
}
@media (max-width: 576px) {
  .container { --pico-spacing: 0; }
}

html { height: 100%; overflow: hidden; }
body {
  background: var(--jp-black); color: var(--jp-white); font-family: var(--jp-font);
  display: flex; flex-direction: column;
  height: 100%; overflow: hidden;
}
.jp-page-main {
  flex: 1 1 0; overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column;
  min-height: 0;
}
a { color: var(--jp-gold); }
a:hover { color: var(--jp-orange); }

h1, h2, h3 {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 800;
  color: var(--jp-white);
}

/* Kompakter App-Header im Stil der Webseite. */
.jp-nav-sticky {
  position: -webkit-sticky; position: sticky; top: 0; z-index: 100;
  background: var(--jp-black);
  width: 100%;
}
.jp-header {
  display: flex; align-items: center; gap: .75rem;
  background: var(--jp-card);
  border-bottom: 2px solid var(--jp-gold);
  padding: 0.4rem 1.5rem;
  margin-bottom: 0;
}
.jp-header .jp-title {
  font-size: 0.95rem; font-weight: 900; text-transform: uppercase;
  letter-spacing: 0.15em; margin: 0;
}
.jp-header .jp-title .accent { color: var(--jp-gold); }
.jp-header .jp-sub {
  font-size: .62rem; text-transform: uppercase;
  letter-spacing: 0.2em; margin-left: auto;
  background: linear-gradient(90deg, #ff0000, #ff7700, #ffff00, #00cc00, #0000ff, #8b00ff);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  cursor: pointer;
  user-select: none;
  transition: transform .15s ease, filter .15s ease;
}
.jp-header .jp-sub:hover {
  transform: scale(1.08);
  filter: brightness(1.25);
}

/* Buttons klar in Marken-Optik. */
button, [role=button], input[type=submit], input[type=button] {
  font-size: .8rem; padding: .25rem .75rem; width: auto;
}
button.primary, [role=button].primary {
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700;
  border-radius: 2px; border: none;
}
button.secondary, [role=button].secondary {
  border: 1px solid var(--jp-border); color: var(--jp-white);
  background: transparent; border-radius: 2px;
}
button.secondary:hover, [role=button].secondary:hover {
  border-color: var(--jp-gold); color: var(--jp-gold); background: var(--jp-red-soft);
}

/* Tabellenkopf mit Gold-Linie, dezent. */
th {
  color: var(--jp-gold); text-transform: uppercase; letter-spacing: 0.06em;
  font-size: 0.75rem;
}
th a { color: var(--jp-gold); text-decoration: none; }
th a:hover { color: var(--jp-orange); }

/* --- Kompakte Bedienleiste: Menü + Filter immer in einer Zeile. --- */
.jp-toolbar {
  display: flex; align-items: center; gap: .5rem;
  flex-wrap: nowrap; margin-bottom: 0;
  padding: 0.35rem 1.5rem;
  background: var(--jp-dark);
  border-bottom: 1px solid var(--jp-border);
  /* overflow: visible (default) – damit Dropdown-Menüs und aufgeklappter Filter
     nicht geclippt werden. flex-wrap:nowrap verhindert den Zeilenumbruch. */
}
.jp-toolbar > * { margin: 0; flex-shrink: 0; }
details.dropdown summary,
.jp-toolbar details > summary {
  font-size: .75rem; padding: .2rem .6rem;
  border-color: var(--jp-border);
}
.jp-toolbar details { font-size: .78rem; }
.jp-toolbar .jp-add {
  font-size: .75rem; padding: .2rem .8rem; width: auto; white-space: nowrap;
}
/* Filter: nimmt den verbleibenden Platz; overflow:hidden nur auf dem Summary-Text, nicht auf dem Container */
.jp-toolbar .jp-filter { flex: 1 1 0; min-width: 0; }
.jp-toolbar .jp-filter > summary { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.jp-toolbar .jp-filter[open] > summary { border-color: var(--jp-gold); }
.jp-filter label { font-size: .7rem; margin-bottom: .15rem; }
.jp-filter input, .jp-filter select { font-size: .8rem; padding: .2rem .35rem; margin-bottom: .2rem; }
.jp-count { font-size: .68rem; color: var(--jp-muted); margin: 0 0 .3rem 0; padding: 0 1.5rem; }

/* Setliste-Tabelle prominent und gut lesbar. */
.jp-setlist-wrap { overflow-x: auto; width: 100%; -webkit-overflow-scrolling: touch; padding: 0 1.5rem; }
@media (max-width: 600px) {
  .jp-setlist-wrap { padding: 0 0.5rem; }
}
.jp-setlist { margin-top: .5rem; width: 100%; border-collapse: separate; border-spacing: 0; }
.jp-setlist tr, .jp-setlist td {
  background: transparent !important;
}
.jp-setlist td, .jp-setlist th {
  padding: 0.5rem 0.8rem;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--jp-border);
}
/* Multiline-Zellen: Zeilenumbrüche sichtbar machen */
.jp-setlist td { white-space: pre-wrap; word-break: break-word; }
.jp-setlist tr:last-child td { border-bottom: none; }
.jp-setlist td a.jp-open { color: var(--jp-white); text-decoration: none; font-weight: 700; font-size: 0.92rem; }
.jp-setlist td a.jp-open:hover { color: var(--jp-orange); }
/* Aktive/ausgewählte Zeile hervorheben */
.jp-setlist tbody tr:hover td { background: rgba(200,168,75,0.06) !important; }
/* Primäre Spalten (Titel, Tonart) stärker betonen */
.jp-setlist td.jp-col-primary { font-weight: 700; color: var(--jp-white); }
.jp-setlist td.jp-col-secondary { color: var(--jp-muted); font-size: 0.82rem; }
/* Kompakte Spalten: kurze Werte (BPM, Groove, Tags …) */
.jp-setlist td.jp-col-compact { color: var(--jp-muted); font-size: 0.8rem; }
/* Auf kleinen Screens (Hochformat): Card-Layout — breite Spalten nehmen volle Breite,
   kompakte Spalten fließen in einer zweiten Zeile inline. */
@media (max-width: 600px) and (orientation: portrait) {
  /* Tabellenkopf ausblenden – Labels erscheinen als ::before auf den Zellen */
  .jp-setlist thead { display: none; }
  /* Jede Zeile wird zur Karte */
  .jp-setlist tbody tr {
    display: block;
    border-bottom: 2px solid var(--jp-border);
    padding: 0.35rem 0;
  }
  .jp-setlist tr:last-child { border-bottom: none; }
  /* Breite Zellen (Titel, Ablauf, Steve …) nehmen volle Breite */
  .jp-setlist td {
    display: block;
    width: 100%;
    padding: 0.2rem 0.5rem;
    border-bottom: none;
    font-size: 0.88rem;
    box-sizing: border-box;
  }
  /* Erste Zelle (Titel/Link) etwas prominenter */
  .jp-setlist td:first-child {
    padding-top: 0.35rem;
    padding-bottom: 0.1rem;
  }
  /* Kompakte Zellen: inline-block, fließen zusammen in zweiter Zeile */
  .jp-setlist td.jp-col-compact {
    display: inline-block;
    width: auto;
    padding: 0.1rem 0.4rem 0.1rem 0;
    font-size: 0.75rem;
    vertical-align: middle;
    white-space: nowrap;
  }
  /* Label-Prefix via data-label */
  .jp-setlist td.jp-col-compact[data-label]::before {
    content: attr(data-label) ": ";
    color: var(--jp-gold);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: 0.1em;
  }
  /* Action-Zelle kompakt */
  .jp-setlist td:last-child {
    display: inline-block;
    width: auto;
    padding: 0.1rem 0.4rem;
    vertical-align: middle;
  }
  .jp-setlist td a.jp-open { font-size: 0.9rem; }
}
/* Auf kleinen Screens Querformat: sekundäre Spalten ausblenden, Padding reduzieren */
@media (max-width: 600px) and (orientation: landscape) {
  .jp-setlist td.jp-col-secondary, .jp-setlist th.jp-col-secondary { display: none; }
  .jp-setlist td, .jp-setlist th { padding: 0.4rem 0.45rem; font-size: 0.82rem; }
  .jp-setlist td a.jp-open { font-size: 0.86rem; }
}

/* Tabellenkopf beim Scrollen fixieren — sticky relativ zum scrollenden .jp-page-main. */
.jp-setlist thead th {
  position: -webkit-sticky; position: sticky;
  top: 0;
  z-index: 50;
  background: var(--jp-card);
  box-shadow: inset 0 -2px 0 var(--jp-gold);
  font-size: 0.72rem;
}
@media (max-width: 600px) {
  .jp-header { padding: 0.5rem 1rem; }
  /* Toolbar bleibt auch auf kleinen Screens in einer Zeile */
  .jp-toolbar { padding: 0.4rem 0.75rem; flex-wrap: nowrap; gap: 0.4rem; }
}
@media (max-width: 480px) {
  /* P1.1: Filter + Menü in einer Zeile, kein Umbruch */
  .jp-toolbar { padding: 0.35rem 0.5rem; gap: 0.3rem; }
  .jp-toolbar .jp-filter > summary { font-size: .72rem; padding: .15rem .45rem; }
}
/* P2.1: iOS Safe-Area-Insets für Notch-Geräte. */
@supports (padding: env(safe-area-inset-top)) {
  .jp-nav-sticky { padding-top: env(safe-area-inset-top); }
  .jp-fs { padding-bottom: max(2vh, env(safe-area-inset-bottom)); }
}
/* P3.2: Landscape auf Handy — zweispaltiges Layout Songinfo | BeatDetector. */
@media (max-height: 500px) and (orientation: landscape) {
  .jp-fs { flex-direction: row; flex-wrap: wrap; padding: 1vh 2vw; }
  /* Titel + kompakte Nav nebeneinander in einer Zeile */
  .jp-fs h1 { flex: 1 1 auto; font-size: clamp(0.9rem, 2.5vh, 1.4rem); margin-bottom: 0; min-width: 0; }
  /* Nav-Bar: kompakt, auto-Breite, an den Titel angehängt (nicht volle Breite) */
  .jp-fs .jp-fs-nav-bar { flex: 0 0 auto; order: 0; margin: 0; gap: 0.35rem; }
  .jp-fs .jp-fs-nav-bar .jp-fs-nav { width: 1.7rem; height: 1.7rem; font-size: 0.85rem; }
  .jp-fs .jp-fs-nav-bar .jp-fs-nav-pos { font-size: 0.65rem; min-width: 2.5rem; }
  /* Song-Info-Spalte breiter, damit alle Felder (inkl. BPM) sichtbar bleiben */
  .jp-fs dl { flex: 1 1 55%; max-width: 62%; overflow: auto; font-size: clamp(0.7rem, 2vh, 1rem); }
  .jp-fs dt { font-size: clamp(0.55rem, 1.4vh, 0.75rem); }
  .jp-fs dd { font-size: clamp(0.75rem, 2vh, 1.3rem); }
  .jp-bd { flex: 1 1 35%; min-width: 0; margin-top: 0; }
}

/* --- Fullscreen-Ansicht eines Songs --------------------------------- */
.jp-fs {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--jp-black); color: var(--jp-white);
  display: flex; flex-direction: column;
  padding: clamp(0.75rem, 2vh, 2rem) clamp(1rem, 4vw, 4rem);
  box-sizing: border-box;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
.jp-fs-close {
  position: absolute; top: 1.5rem; right: 2rem;
  font-size: 2rem; color: var(--jp-gold); text-decoration: none;
  z-index: 1010; transition: transform 0.2s;
}
.jp-fs-close:hover { color: var(--jp-orange); transform: scale(1.2); }
@media (max-width: 480px) {
  .jp-fs-close { top: 0.5rem; right: 0.75rem; font-size: 1.6rem;
    min-width: 2.75rem; min-height: 2.75rem;
    display: flex; align-items: center; justify-content: center; }
  .jp-fs-burger { top: 2.5rem !important; }
  .jp-fs-blink { top: 0.6rem; right: 2.5rem; }
  .jp-fs h1 { padding-right: 3rem; }
  .jp-fs-nav { width: 2.75rem; height: 2.75rem; }
  button, summary { min-height: 2.75rem; }
}
.jp-fs h1 {
  font-size: clamp(1rem, 3vh, 2rem);
  margin: 0 0 .5vh 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex-shrink: 0;
  border-left: 6px solid var(--jp-gold);
  padding-left: 1.5rem;
  padding-right: 5rem;
}
.jp-fs-blink {
  position: absolute; top: 1.2rem; right: 4rem;
  z-index: 1011; display: flex; align-items: center; gap: .4rem;
}
/* Spalten-Daten: flüssige Skalierung passend zum Viewport */
.jp-fs dl {
  display: grid; grid-template-columns: max-content 1fr; gap: clamp(0.25rem, 0.8vh, 1rem) clamp(0.75rem, 2vw, 2rem);
  margin: 0.8vh 0; flex-shrink: 1; flex-grow: 1; overflow-y: auto;
  max-height: 78vh;
  background: transparent !important;
}
.jp-fs dt {
  color: var(--jp-muted); text-transform: uppercase; letter-spacing: .08em;
  font-size: clamp(0.6rem, 1.4vh, 0.85rem); align-self: start; padding-top: .15em;
  background: transparent !important; border: none !important;
}
.jp-fs dd {
  margin: 0; font-size: clamp(0.85rem, 2vh, 1.4rem); line-height: 1.25;
  font-weight: 600; white-space: pre-wrap; word-break: break-word;
  background: transparent !important; border: none !important;
}
@media (max-height: 720px) {
  .jp-fs { padding: 0.5rem 1rem; }
  .jp-fs h1 { font-size: clamp(0.95rem, 2vh, 1.3rem); margin-bottom: 0.2rem; }
  .jp-fs dt { font-size: 0.65rem; }
  .jp-fs dd { font-size: 0.85rem; }
  .jp-fs .jp-drum-widget, .jp-fs .jp-pianoroll-widget { max-height: 240px; overflow-y: auto; }
}

  /* Dezenter BPM-Blink-Indikator: kleiner Punkt, kein Vollbild-Blitz. */
.jp-blink {
  display: inline-block; width: 14px; height: 14px; border-radius: 50%;
  background: var(--jp-orange); vertical-align: middle; margin-left: .6rem;
  opacity: 0.25;
  animation-name: jp-pulse; animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}
@keyframes jp-pulse {
  0%   { opacity: 0.2; transform: scale(0.85); }
  15%  { opacity: 1;   transform: scale(1.15); }
  100% { opacity: 0.2; transform: scale(0.85); }
}
.jp-tempo-label { font-size: .8rem; color: var(--jp-muted); margin-left: .5rem; }

.jp-click-btn {
  background: none; border: none; padding: 0; margin-left: 0.8rem;
  cursor: pointer; color: var(--jp-muted); vertical-align: middle;
  font-size: 1.2rem; transition: color 0.2s;
}
.jp-click-btn:hover { color: var(--jp-gold); }
.jp-click-btn.active { color: var(--jp-gold); }

/* --- DB-Logo im Header: abgerundetes Rechteck mit "JP". ------------- */
.jp-logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.1rem; height: 1.5rem; flex: 0 0 auto;
  background: var(--jp-gold); color: #000;
  border-radius: 5px; font-weight: 800; font-size: .9rem;
  letter-spacing: 0.01em; line-height: 1; text-transform: none;
}
.jp-fs .jp-logo { display: none; }

/* --- Live-Tempo-Erkennung (Beat Detection) im Fullscreen ---------- */
.jp-bd { margin-top: auto; flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; }
.jp-bd h3 { font-size: 0.9rem; margin-bottom: 0.3rem; flex-shrink: 0; }
.jp-bd-controls { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .3rem; flex-shrink: 0; }
.jp-bd-controls button { padding: .2rem .6rem; font-size: .8rem; margin: 0; width: auto; }
.jp-bd-status { font-size: .75rem; color: var(--jp-muted); }
.jp-bd-readout { font-size: .85rem; color: var(--jp-muted); margin-bottom: .2rem; flex-shrink: 0; }
.jp-bd-current { color: var(--db-red); font-weight: 800; font-size: 1.2rem; }
/* Canvas-Wrapper: nimmt nur den verbleibenden Platz ein (dynamisch kleiner wenn dl mehr Platz braucht) */
.jp-bd-canvas-wrap { flex: 1 1 0; min-height: 120px; max-height: 45vh; position: relative; }
.jp-bd-canvas {
  width: 100%; height: 100%;
  border: 1px solid var(--jp-border); border-radius: 2px; background: transparent;
  display: block;
}
.jp-bd-hint { font-size: .65rem; color: var(--jp-muted); margin-top: .3rem; flex-shrink: 0; }

/* --- PDF-Modal-Overlay (über dem Fullscreen) ---------------- */
.jp-pdf-modal {
  display: none; position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.92);
  flex-direction: column;
}
.jp-pdf-modal.open { display: flex; }
.jp-pdf-modal-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: .5rem 1rem; background: var(--jp-card);
  border-bottom: 2px solid var(--jp-gold); flex-shrink: 0;
}
.jp-pdf-modal-title { font-size: .85rem; color: var(--jp-white); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jp-pdf-modal-close {
  font-size: 1.6rem; color: var(--jp-gold); background: none;
  border: none; cursor: pointer; padding: .1rem .4rem; line-height: 1;
  flex-shrink: 0;
}
.jp-pdf-modal-close:hover { color: var(--jp-orange); }
.jp-pdf-modal iframe {
  flex: 1 1 0; width: 100%; border: none; background: #fff;
}

/* --- Single-Field-Edit-Modal im Fullscreen ------------------- */
.jp-edit-modal {
  position: fixed; inset: 0; z-index: 3000;
  background: rgba(0,0,0,0.75);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.jp-edit-modal-box {
  background: var(--jp-card); border: 1px solid var(--jp-gold);
  border-radius: 8px; padding: 1.25rem 1.5rem;
  width: 100%; max-width: 28rem;
  box-shadow: 0 8px 32px rgba(0,0,0,.6);
}
.jp-edit-modal-box h3 {
  margin: 0 0 .8rem; font-size: 1rem; color: var(--jp-gold);
}
.jp-edit-modal-box input,
.jp-edit-modal-box textarea {
  width: 100%; font-size: 1rem; margin-bottom: .8rem;
  background-color: var(--jp-black) !important;
  border: 1px solid var(--jp-border) !important;
  color: var(--jp-white) !important;
}
.jp-edit-modal-box textarea {
  resize: vertical;
  min-height: 5rem;
  font-family: inherit;
  line-height: 1.4;
  box-sizing: border-box;
}
.jp-edit-modal-box input:focus,
.jp-edit-modal-box textarea:focus {
  border-color: var(--jp-gold) !important;
  background-color: var(--jp-black) !important;
  color: var(--jp-white) !important;
  outline: none !important;
}
.jp-edit-modal-actions {
  display: flex; gap: .6rem; justify-content: flex-end; margin-top: .4rem;
}
/* Wertezellen im Fullscreen long-pressable machen */
.jp-fs dd[data-field] {
  cursor: pointer;
  border-radius: 4px;
  background: transparent !important;
  transition: background .15s;
}
.jp-fs dd[data-field]:active { background: rgba(200,168,75,.12) !important; }
/* Editierbare Zellen in der Listenansicht */
td.jp-editable[data-field] {
  cursor: pointer;
  border-radius: 3px;
  background: transparent !important;
  transition: background .15s;
  user-select: none;
  -webkit-touch-callout: none;
}
td.jp-editable[data-field] a {
  -webkit-touch-callout: none;
}
td.jp-editable[data-field]:active { background: rgba(200,168,75,.12) !important; }

/* --- Prev/Next-Navigationsleiste im Fullscreen-Modal --------- */
.jp-fs-nav-bar {
  display: flex; align-items: center; gap: 1rem;
  margin: 0.5vh 0 0.5vh 0; flex-shrink: 0;
}
.jp-fs-nav {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.2rem; height: 2.2rem; border-radius: 4px;
  font-size: 1.1rem; font-weight: 700;
  color: var(--jp-gold); border: 1px solid var(--jp-border);
  background: transparent; text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.jp-fs-nav:hover { background: rgba(200,168,75,0.15) !important; border-color: var(--jp-gold); color: var(--jp-gold); }
.jp-fs-nav-disabled {
  opacity: 0.3; cursor: default; pointer-events: none;
}
.jp-fs-nav-pos {
  font-size: 0.78rem; color: var(--jp-muted);
  min-width: 4rem; text-align: center;
}

/* Buttons im Fullscreen einheitlich ohne harte Hintergrundboxen */
.jp-fs button.secondary,
.jp-fs [role=button].secondary,
.jp-fs #jp-pdf-btn {
  background: transparent !important;
  border: 1px solid var(--jp-border) !important;
  color: var(--jp-white);
}
.jp-fs button.secondary:hover,
.jp-fs [role=button].secondary:hover,
.jp-fs #jp-pdf-btn:hover {
  background: rgba(200,168,75,0.12) !important;
  border-color: var(--jp-gold) !important;
  color: var(--jp-gold) !important;
}

/* Konfigurierbare Parameter der Tempo-Erkennung. */
.jp-bd-config {
  display: flex; flex-wrap: wrap; gap: .8rem 1.2rem;
  align-items: flex-end; margin-bottom: .8rem;
}
.jp-bd-config label {
  display: flex; flex-direction: column; gap: .15rem;
  font-size: .72rem; color: var(--jp-muted); margin: 0;
}
.jp-bd-config input {
  width: 6.5rem; font-size: .85rem; padding: .2rem .35rem; margin: 0;
}

/* --- Drum Step Grid & Notation Styling --- */
.jp-drum-widget, .jp-pianoroll-widget {
  background: rgba(28, 37, 48, 0.75);
  border: 1px solid var(--jp-border);
  border-radius: 8px;
  padding: 0.75rem;
  margin: 0.4rem 0 0.8rem;
  max-width: 100%;
}
.jp-notation-title {
  font-weight: 600;
  color: var(--jp-gold);
  font-size: 0.88rem;
}
.jp-drum-controls, .jp-pianoroll-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}
.jp-drum-controls button, .jp-pianoroll-controls button {
  padding: 0.25rem 0.65rem;
  font-size: 0.82rem;
  margin: 0;
  border-radius: 4px;
}
.jp-bpm-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  font-weight: bold;
  background: rgba(200, 168, 75, 0.15);
  color: var(--jp-gold);
  border: 1px solid rgba(200, 168, 75, 0.3);
  border-radius: 4px;
}
.jp-drum-grid-wrap, .jp-pianoroll-grid-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.3rem;
}
.jp-drum-grid, .jp-pianoroll-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 520px;
}
.jp-drum-track-row, .jp-pianoroll-track-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.jp-drum-track-label, .jp-pianoroll-track-label {
  width: 48px;
  font-size: 0.8rem;
  font-weight: bold;
  color: var(--jp-white);
  text-align: right;
  padding-right: 6px;
  flex-shrink: 0;
}
.jp-drum-steps, .jp-pianoroll-steps {
  display: flex;
  gap: 3px;
  flex: 1;
}
.jp-drum-step, .jp-pianoroll-step {
  flex: 1;
  min-width: 26px;
  max-width: 36px;
  height: 32px;
  padding: 0;
  margin: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--jp-border);
  border-radius: 4px;
  color: var(--jp-white);
  font-size: 0.75rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition: background 0.1s, border-color 0.1s, transform 0.05s;
}
.jp-drum-step:hover, .jp-pianoroll-step:hover {
  background: rgba(200, 168, 75, 0.2);
  border-color: var(--jp-gold);
}
.jp-drum-step:active, .jp-pianoroll-step:active {
  transform: scale(0.92);
}
.jp-drum-step.quarter, .jp-pianoroll-step.quarter {
  border-left: 2px solid rgba(200, 168, 75, 0.55);
}
.jp-drum-step.bar-end, .jp-pianoroll-step.bar-end {
  border-right: 3px solid var(--jp-gold) !important;
  margin-right: 5px !important;
}
.jp-drum-step.hit, .jp-pianoroll-step.hit {
  background: var(--jp-gold) !important;
  color: var(--jp-black) !important;
  border-color: var(--jp-orange-dark) !important;
}
.jp-pianoroll-step.sustain {
  background: rgba(200, 168, 75, 0.45) !important;
  color: var(--jp-white) !important;
  border-color: rgba(200, 168, 75, 0.6) !important;
  border-left: none !important;
  font-size: 0.8rem;
  letter-spacing: -1px;
}
.jp-dur-btn.active {
  background: var(--jp-gold) !important;
  color: var(--jp-black) !important;
  border-color: var(--jp-orange-dark) !important;
  font-weight: 700 !important;
}
.jp-drum-step.active-cursor, .jp-pianoroll-step.active-cursor {
  box-shadow: 0 0 8px 2px #ffffff;
  border-color: #ffffff !important;
}
.jp-drum-tab-preview, .jp-pianoroll-tab-preview {
  font-family: monospace;
  font-size: 0.75rem;
  line-height: 1.35;
  background: rgba(0, 0, 0, 0.45);
  color: var(--jp-muted);
  padding: 0.45rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 0.6rem;
  margin-bottom: 0;
  white-space: pre;
  overflow-x: auto;
}
.jp-notation-note {
  font-size: 0.9rem;
  color: var(--jp-white);
  margin: 0.3rem 0;
}

/* --- Startseite: Karten-Grid --------------------------------------- */
.jp-start-content {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 60vh; padding: 1rem;
  flex: 1 1 0; overflow-y: auto; min-height: 0; width: 100%;
  -webkit-overflow-scrolling: touch;
}
.jp-start-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem; max-width: 54rem; width: 100%;
  margin: 0 auto;
}
@media (max-width: 480px) {
  .jp-start-grid { grid-template-columns: 1fr; }
}
.jp-start-card {
  display: flex; flex-direction: column; align-items: center;
  padding: 1.5rem 1rem;
  background: var(--jp-card); border: 1px solid var(--jp-border);
  border-radius: 8px; cursor: pointer;
  transition: border-color .15s, background .15s;
  text-align: center; color: var(--jp-white);
  min-height: 9rem;
}
.jp-start-card:hover {
  border-color: var(--jp-gold);
  background: rgba(200,168,75,.08);
}
.jp-start-card strong { color: var(--jp-gold); font-size: 1.05rem; }

/* --- Button für Statistiken auf der Startseite -------------------- */
.jp-start-stats-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .35rem .85rem; font-size: .84rem;
  border: 1px solid var(--jp-border); border-radius: 6px;
  background: transparent; color: var(--jp-muted);
  text-decoration: none;
  transition: border-color .15s, color .15s, background .15s;
}
.jp-start-stats-btn:hover {
  border-color: var(--jp-gold); color: var(--jp-gold);
  background: rgba(200,168,75,.08);
}

/* --- Bühnen-Schnellauswahl auf der Startseite ---------------------- */
.jp-stage-section {
  margin-top: 2.5rem;
  padding: 1.2rem 1rem 1rem;
  border-top: 1px solid var(--jp-border);
  text-align: center;
}
.jp-stage-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  justify-content: center;
  margin-top: .5rem;
}
.jp-stage-chip {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .45rem 1rem;
  background: var(--jp-card);
  border: 1px solid var(--jp-gold);
  border-radius: 999px;
  color: var(--jp-gold);
  font-size: .9rem;
  font-weight: 600;
  transition: background .15s, color .15s, transform .1s;
  cursor: pointer;
}
.jp-stage-chip:hover {
  background: var(--jp-gold);
  color: var(--jp-black);
  transform: scale(1.04);
}

/* --- Link-Buttons in der Listenansicht ----------------------------- */
.jp-link-btn {
  display: inline-flex; align-items: center; gap: .25rem;
  font-size: .75rem; padding: .15rem .45rem;
  border: 1px solid var(--jp-border); border-radius: 4px;
  background: transparent !important; color: var(--jp-white);
  text-decoration: none; white-space: nowrap;
  transition: border-color .12s, background .12s;
  margin: .1rem .2rem .1rem 0;
}
.jp-link-btn:hover { border-color: var(--jp-gold); background: rgba(200,168,75,.12) !important; color: var(--jp-gold); }

/* --- Tag-Chips (klickbare Tags in der Listenansicht) --------------- */
.jp-tag-chip {
  display: inline-block; font-size: .72rem; padding: .1rem .45rem;
  border: 1px solid var(--jp-border); border-radius: 999px;
  background: transparent !important; color: var(--jp-muted);
  text-decoration: none; white-space: nowrap;
  margin: .05rem .15rem .05rem 0;
  transition: border-color .12s, background .12s, color .12s;
}
.jp-tag-chip:hover { border-color: var(--jp-gold); color: var(--jp-gold); background: rgba(200,168,75,.12) !important; }
/* Tag mit *.5-Reihenfolge (z. B. Set1.5): dezent goldene Umrandung */
.jp-tag-chip.jp-tag-half {
  background: transparent !important; border-color: var(--jp-gold); color: var(--jp-gold);
  font-weight: 600;
}
.jp-tag-chip.jp-tag-half:hover { background: rgba(200,168,75,.18) !important; }
/* Tabellenzeile: Song hat mindestens einen *.5-Tag – dezent markiert mit Gold-Linie */
tr.jp-row-half {
  box-shadow: inset 3px 0 0 var(--jp-gold);
  background: transparent !important;
}
tr.jp-row-half td { background: transparent !important; }
tr.jp-row-half:hover td { background: rgba(200,168,75,.08) !important; }
tr.jp-row-half:nth-child(even) td { background: transparent !important; }

/* --- Toast-Notifications ------------------------------------------- */
#jp-toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  background: var(--jp-card); color: var(--jp-white);
  border: 1px solid var(--jp-gold); border-radius: 6px;
  padding: .55rem 1.2rem; font-size: .9rem; z-index: 3000;
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
#jp-toast.show { opacity: 1; pointer-events: auto; }
#jp-toast.error { border-color: #e05; }

/* --- Offline-Indikator --------------------------------------------- */
#jp-offline-bar {
  display: none; position: fixed; top: 0; left: 0; right: 0;
  background: #5a1a1a; color: #f5c6c6; font-size: .82rem; text-align: center;
  padding: .35rem 1rem; z-index: 4000;
  border-bottom: 1px solid #c84b4b; letter-spacing: .01em;
}

/* --- Offline-Modus: Bearbeiten-Buttons ausblenden ------------------- */
body.jp-offline [data-offline-hide] { display: none !important; }

/* --- PWA-Installprompt --------------------------------------------- */
#jp-install-bar {
  display: none; background: rgba(200,168,75,.12);
  border-bottom: 1px solid var(--jp-gold);
  padding: .4rem 1rem; font-size: .82rem; text-align: center;
  color: var(--jp-white);
}
#jp-install-bar button {
  margin-left: .6rem; padding: .15rem .65rem; font-size: .82rem;
}

/* --- Statistik-Seite (Stats View) --------------------------------- */
.jp-stats-page {
  padding: 1.2rem 1.5rem;
  width: 100%;
  box-sizing: border-box;
}
.jp-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.jp-stat-card {
  background: var(--jp-card);
  border: 1px solid var(--jp-border);
  border-radius: 8px;
  padding: 1.2rem 0.9rem;
  text-align: center;
  transition: border-color .15s, transform .12s, box-shadow .15s;
}
.jp-stat-card:hover {
  border-color: var(--jp-gold);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
.jp-stat-icon {
  font-size: 1.8rem;
  margin-bottom: .2rem;
  display: block;
}
.jp-stat-num {
  font-size: clamp(1.8rem, 4vw, 2.3rem);
  font-weight: 700;
  color: var(--jp-gold);
  line-height: 1.1;
  margin: .2rem 0;
}
.jp-stat-label {
  font-size: .8rem;
  color: var(--jp-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 600;
}
.jp-stat-sub {
  font-size: .78rem;
  color: var(--jp-muted);
  margin-top: .3rem;
}
.jp-stats-section {
  background: var(--jp-card);
  border: 1px solid var(--jp-border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}
.jp-stats-section h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.25rem;
  color: var(--jp-gold);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.jp-stats-music-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.jp-stats-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.jp-stats-bar-bg {
  background: rgba(255,255,255,.07);
  border-radius: 999px;
  height: 8px;
  width: 100%;
  min-width: 45px;
  max-width: 130px;
  overflow: hidden;
  margin-top: 4px;
}
.jp-stats-bar-fill {
  background: var(--jp-gold);
  height: 100%;
  border-radius: 999px;
  transition: width .3s ease;
}
.jp-stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.jp-stats-table th {
  text-align: left;
  padding: .6rem .8rem;
  border-bottom: 1px solid var(--jp-border);
  color: var(--jp-muted);
  font-size: .8rem;
  text-transform: uppercase;
  white-space: nowrap;
}
.jp-stats-table td {
  padding: .6rem .8rem;
  border-bottom: 1px solid rgba(255,255,255,.05);
  vertical-align: middle;
}
.jp-stats-table tr:last-child td {
  border-bottom: none;
}
.jp-stats-badge {
  display: inline-block;
  padding: .15rem .55rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  background: rgba(200,168,75,.15);
  color: var(--jp-gold);
  border: 1px solid rgba(200,168,75,.3);
}
.jp-todo-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 1.2rem;
  background: rgba(255,255,255,.02);
  border: 1px solid var(--jp-border);
  border-radius: 6px;
  margin-bottom: .6rem;
  gap: 1rem;
}

/* Responsives Skalieren für kleine Bildschirme (Mobile / Handys) */
@media (max-width: 600px) {
  .jp-stats-page {
    padding: 0.65rem 0.5rem;
  }
  .jp-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.2rem;
  }
  .jp-stat-card {
    padding: 0.75rem 0.4rem;
    border-radius: 6px;
  }
  .jp-stat-icon {
    font-size: 1.35rem;
    margin-bottom: 0.1rem;
  }
  .jp-stat-num {
    font-size: 1.55rem;
    margin: 0.1rem 0;
  }
  .jp-stat-label {
    font-size: 0.68rem;
    letter-spacing: 0.02em;
  }
  .jp-stat-sub {
    font-size: 0.65rem;
    margin-top: 0.15rem;
  }
  .jp-stats-section {
    padding: 0.85rem 0.65rem;
    margin-bottom: 1.2rem;
    border-radius: 6px;
  }
  .jp-stats-section h3 {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
  }
  .jp-stats-section p {
    font-size: 0.8rem !important;
    margin-bottom: 0.7rem !important;
  }
  .jp-stats-music-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .jp-stats-table th,
  .jp-stats-table td {
    padding: 0.45rem 0.35rem;
    font-size: 0.78rem;
  }
  .jp-stats-bar-bg {
    max-width: 80px;
    height: 6px;
  }
  .jp-todo-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.75rem 0.85rem;
    gap: 0.6rem;
  }
  .jp-todo-card .jp-link-btn {
    align-self: flex-start;
  }
}

@media (max-width: 360px) {
  .jp-stats-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Bühnenset-Editor --- */
.jp-sets-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.jp-sets-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--jp-card);
  border-bottom: 1px solid var(--jp-border);
  padding: 0.6rem 1.25rem;
}
.jp-sets-toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.jp-sets-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.jp-sets-grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 1.25rem;
  flex: 1 1 0;
  min-height: 0;
  padding: 1rem 1.25rem;
  overflow: hidden;
}
.jp-sets-col {
  background: var(--jp-card);
  border: 1px solid var(--jp-border);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.jp-sets-col-header {
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--jp-border);
  background: var(--jp-dark);
}
.jp-sets-col-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.jp-sets-search-bar {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--jp-dark);
  border-bottom: 1px solid var(--jp-border);
  flex-wrap: wrap;
}
.jp-sets-search-bar input,
.jp-sets-search-bar select {
  font-size: 0.8rem;
  padding: 0.35rem 0.6rem;
  margin: 0;
}
.jp-sets-list {
  flex: 1 1 0;
  overflow-y: auto;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.jp-pool-item, .jp-set-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--jp-dark);
  border: 1px solid var(--jp-border);
  border-radius: 4px;
  padding: 0.45rem 0.65rem;
  gap: 0.5rem;
  transition: background 0.15s, border-color 0.15s;
}
.jp-pool-item:hover, .jp-set-item:hover {
  border-color: var(--jp-gold);
}
.jp-pool-item.in-set {
  opacity: 0.7;
}
.jp-set-item.jp-dragging {
  opacity: 0.35;
  border: 1px dashed var(--jp-gold);
}
.jp-set-item.jp-drag-over {
  border-top: 2px solid var(--jp-orange);
  background: rgba(200, 168, 75, 0.15);
}
.jp-drag-handle {
  cursor: grab;
  color: var(--jp-muted);
  user-select: none;
  font-size: 1.15rem;
  line-height: 1;
  padding: 0 0.2rem;
}
.jp-drag-handle:active {
  cursor: grabbing;
}
.jp-pos-badge {
  background: var(--jp-card);
  border: 1px solid var(--jp-border);
  color: var(--jp-gold);
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 3px;
  padding: 0.15rem 0.4rem;
  min-width: 1.8rem;
  text-align: center;
}
.jp-song-info {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.jp-song-title {
  font-weight: 600;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.jp-song-meta {
  display: flex;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--jp-muted);
  margin-top: 0.15rem;
  flex-wrap: wrap;
}
.jp-song-badge {
  background: var(--jp-card);
  border: 1px solid var(--jp-border);
  border-radius: 3px;
  padding: 0.05rem 0.35rem;
  font-size: 0.72rem;
}
.jp-song-badge.key-warn {
  border-color: #e53935;
  color: #ff5252;
  font-weight: bold;
}
.jp-item-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.jp-btn-icon {
  background: transparent;
  border: 1px solid var(--jp-border);
  color: var(--jp-white);
  padding: 0.3rem 0.55rem;
  font-size: 0.82rem;
  min-width: 32px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  cursor: pointer;
  line-height: 1;
  margin: 0;
  user-select: none;
}
.jp-btn-icon:hover {
  border-color: var(--jp-gold);
  color: var(--jp-gold);
}
.jp-btn-icon.jp-btn-del:hover {
  border-color: #e53935;
  color: #ff5252;
}
.jp-sets-stats-bar {
  padding: 0.5rem 0.75rem;
  background: var(--jp-dark);
  border-bottom: 1px solid var(--jp-border);
  font-size: 0.78rem;
  color: var(--jp-muted);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.jp-sets-tabs {
  display: none;
  background: var(--jp-card);
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--jp-border);
  gap: 0.5rem;
}
.jp-tab-btn {
  flex: 1;
  text-align: center;
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  background: var(--jp-dark);
  border: 1px solid var(--jp-border);
  color: var(--jp-muted);
  margin: 0;
}
.jp-tab-btn.active {
  background: var(--jp-orange);
  border-color: var(--jp-orange);
  color: #000;
}
@media (max-width: 768px) {
  .jp-sets-tabs {
    display: flex;
  }
  .jp-sets-grid {
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
    overflow-y: auto;
  }
  .jp-sets-col {
    min-height: 440px;
    height: 100%;
  }
  .jp-sets-col.jp-tab-hidden {
    display: none !important;
  }
  .jp-sets-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .jp-sets-toolbar-left, .jp-sets-toolbar-right {
    width: 100%;
    justify-content: stretch;
  }
  .jp-sets-toolbar-left > *, .jp-sets-toolbar-right > * {
    flex: 1 1 auto;
  }
}

/* --- Einstellungsseite / Cards / Matrix --- */
.jp-settings-wrap {
  max-width: 980px;
  margin: 0 auto;
  width: 100%;
}
.jp-card {
  background: var(--jp-card);
  border: 1px solid var(--jp-border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}
.jp-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0;
  margin-bottom: 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--jp-white);
}
.jp-card-desc {
  color: var(--jp-muted);
  font-size: 0.84rem;
  margin-bottom: 1rem;
  line-height: 1.45;
}
.jp-settings-matrix-wrap {
  overflow-x: auto;
  border: 1px solid var(--jp-border);
  border-radius: 6px;
  background: var(--jp-dark);
  margin-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
}
.jp-settings-matrix {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0;
  font-size: 0.88rem;
}
.jp-settings-matrix th {
  background: var(--jp-card);
  color: var(--jp-white);
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--jp-border);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.jp-settings-matrix td {
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--jp-border);
  vertical-align: middle;
}
.jp-settings-matrix tr:last-child td {
  border-bottom: none;
}
.jp-settings-matrix th:first-child,
.jp-settings-matrix td:first-child {
  position: sticky;
  left: 0;
  background: var(--jp-dark);
  z-index: 2;
  box-shadow: 2px 0 4px rgba(0,0,0,0.25);
}
.jp-settings-matrix th:first-child {
  background: var(--jp-card);
  z-index: 3;
}
.jp-settings-matrix tr:hover td {
  background-color: rgba(200, 168, 75, 0.05);
}
.jp-settings-matrix tr:hover td:first-child {
  background-color: var(--jp-dark);
}
.jp-matrix-checkbox {
  width: 1.25rem !important;
  height: 1.25rem !important;
  margin: 0 !important;
  cursor: pointer;
  accent-color: var(--jp-gold);
}
.jp-matrix-select {
  font-size: 0.84rem !important;
  padding: 0.35rem 0.65rem !important;
  margin: 0 !important;
  border-radius: 4px;
}
.jp-bpm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}
.jp-bpm-grid label {
  margin-bottom: 0 !important;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--jp-white);
}
.jp-bpm-grid input {
  margin-top: 0.35rem !important;
  margin-bottom: 0 !important;
  font-size: 0.88rem !important;
  padding: 0.45rem 0.65rem !important;
}
.jp-settings-details {
  border-top: 1px solid var(--jp-border);
  padding-top: 0.85rem;
  margin-top: 0.75rem;
}
.jp-settings-footer {
  position: sticky;
  bottom: 0;
  background: var(--jp-card);
  border-top: 2px solid var(--jp-gold);
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  z-index: 95;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.4);
  border-radius: 0 0 8px 8px;
  margin-top: 1rem;
}
@media (max-width: 600px) {
  .jp-card {
    padding: 1rem 1rem;
  }
  .jp-settings-footer {
    flex-direction: column-reverse;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
  }
  .jp-settings-footer button,
  .jp-settings-footer a {
    width: 100%;
    text-align: center;
    margin: 0;
  }
}

/* ==========================================================================
   EINHORN- & REGENBOGEN-THEME (UNICORN / RAINBOW MODE)
   Verspieltes, farbenfrohes Alternativ-Styling mit magischen Regenbogen-Akzenten
   ========================================================================== */
:root[data-theme="unicorn"],
:root[data-jp-theme="unicorn"],
html[data-theme="unicorn"],
html[data-jp-theme="unicorn"],
html.jp-theme-unicorn,
[data-theme="unicorn"],
[data-jp-theme="unicorn"],
.jp-theme-unicorn {
  --jp-black:  #fdf4ff;  /* Sanfter Traum-Hintergrund */
  --jp-dark:   #f6e6fc;  /* Fliederhell */
  --jp-card:   #ffffff;  /* Weiße Glaskarten */
  --jp-border: #f0c6f7;  /* Sanftes Pastell-Pink */
  --jp-gold:   #ff007f;  /* Knalliges Hot Pink / Magenta */
  --jp-red-soft: rgba(255, 0, 127, 0.12);
  --jp-orange: #ff3399;  /* Pink-Magenta (primär) */
  --jp-orange-dark: #d8006c; /* Deep Hot Pink (Hover) */
  --jp-white:  #29063b;  /* Tiefer Kontrast für perfekten Lesekomfort */
  --jp-muted:  #7d4d8c;  /* Sanftes Violett für sekundären Text */
  --db-red:    #ff007f;
  --jp-font:   'Quicksand', 'Nunito', 'Comic Sans MS', 'DB Screen Sans', 'Helvetica Neue', Arial, sans-serif;

  --pico-font-family: var(--jp-font);
  --pico-background-color: var(--jp-black);
  --pico-color: var(--jp-white);
  --pico-primary: #ff007f;
  --pico-primary-hover: #d8006c;
  --pico-primary-background: linear-gradient(90deg, #ff007f, #b388ff);
  --pico-primary-hover-background: linear-gradient(90deg, #d8006c, #9c27b0);
  --pico-secondary: #aa00ff;
  --pico-secondary-hover: #7200ca;
  --pico-secondary-background: transparent;
  --pico-secondary-hover-background: rgba(255, 0, 127, 0.1);
  --pico-secondary-border: #d500f9;
  --pico-muted-color: var(--jp-muted);
  --pico-card-background-color: var(--jp-card);
  --pico-card-border-color: var(--jp-border);
  --pico-border-radius: 12px;
  --pico-form-element-background-color: #ffffff;
  --pico-form-element-border-color: #e1bee7;
  --pico-form-element-color: #29063b;
  --pico-form-element-active-background-color: #ffffff;
  --pico-form-element-active-border-color: #ff007f;
  --pico-form-element-focus-color: #ff007f;
  --pico-table-border-color: #f3d4fb;
  --pico-table-row-striped-background-color: transparent;
  --pico-table-row-stripped-background-color: transparent;
}

@keyframes jpRainbowGlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

[data-theme="unicorn"] body,
[data-jp-theme="unicorn"] body,
html.jp-theme-unicorn body {
  background: linear-gradient(135deg, #fff2f9 0%, #f3e8ff 25%, #e1f5fe 60%, #e8f5e9 100%) fixed !important;
  color: #29063b !important;
}

[data-theme="unicorn"] .jp-nav-sticky,
[data-jp-theme="unicorn"] .jp-nav-sticky,
html.jp-theme-unicorn .jp-nav-sticky {
  background: rgba(255, 245, 253, 0.94) !important;
  backdrop-filter: blur(12px);
}

[data-theme="unicorn"] .jp-header,
[data-jp-theme="unicorn"] .jp-header,
html.jp-theme-unicorn .jp-header {
  background: rgba(255, 255, 255, 0.95) !important;
  border-bottom: 3px solid transparent !important;
  border-image: linear-gradient(90deg, #ff007f, #ff9100, #ffd600, #00e676, #00b0ff, #d500f9) 1 !important;
  box-shadow: 0 4px 20px rgba(255, 0, 127, 0.15) !important;
}

[data-theme="unicorn"] .jp-logo,
[data-jp-theme="unicorn"] .jp-logo,
html.jp-theme-unicorn .jp-logo {
  background: linear-gradient(135deg, #ff007f, #aa00ff, #00d4ff) !important;
  color: #ffffff !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 10px rgba(255, 0, 127, 0.4) !important;
}
[data-theme="unicorn"] .jp-logo::after,
[data-jp-theme="unicorn"] .jp-logo::after,
html.jp-theme-unicorn .jp-logo::after {
  content: "🦄";
  font-size: 0.8rem;
  margin-left: 3px;
}

[data-theme="unicorn"] .jp-header .jp-title .accent,
[data-jp-theme="unicorn"] .jp-header .jp-title .accent,
html.jp-theme-unicorn .jp-header .jp-title .accent {
  background: linear-gradient(90deg, #ff007f, #ff6d00, #aa00ff) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}

[data-theme="unicorn"] .jp-header .jp-sub,
[data-jp-theme="unicorn"] .jp-header .jp-sub,
html.jp-theme-unicorn .jp-header .jp-sub {
  font-weight: 900 !important;
  font-size: 0.7rem !important;
  background: linear-gradient(90deg, #ff007f, #ff9100, #ffd600, #00e676, #00b0ff, #d500f9) !important;
  background-size: 200% auto !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  animation: jpRainbowGlow 3s linear infinite !important;
}

[data-theme="unicorn"] .jp-toolbar,
[data-jp-theme="unicorn"] .jp-toolbar,
html.jp-theme-unicorn .jp-toolbar {
  background: rgba(255, 255, 255, 0.9) !important;
  border-bottom: 1px solid #f0c6f7 !important;
  box-shadow: 0 2px 8px rgba(224, 64, 251, 0.06);
}

[data-theme="unicorn"] .jp-toolbar details > summary,
[data-jp-theme="unicorn"] .jp-toolbar details > summary,
html.jp-theme-unicorn .jp-toolbar details > summary {
  border-color: #e1bee7 !important;
  color: #7b1fa2 !important;
  background: #ffffff !important;
  border-radius: 8px !important;
}

[data-theme="unicorn"] .jp-toolbar .jp-filter[open] > summary,
[data-jp-theme="unicorn"] .jp-toolbar .jp-filter[open] > summary,
html.jp-theme-unicorn .jp-toolbar .jp-filter[open] > summary {
  border-color: #ff007f !important;
  box-shadow: 0 0 8px rgba(255, 0, 127, 0.25) !important;
}

[data-theme="unicorn"] .jp-start-card,
[data-jp-theme="unicorn"] .jp-start-card,
html.jp-theme-unicorn .jp-start-card {
  background: rgba(255, 255, 255, 0.95) !important;
  border: 2px solid #f3d1f8 !important;
  border-radius: 16px !important;
  box-shadow: 0 8px 24px rgba(224, 64, 251, 0.12) !important;
  color: #29063b !important;
}
[data-theme="unicorn"] .jp-start-card:hover,
[data-jp-theme="unicorn"] .jp-start-card:hover,
html.jp-theme-unicorn .jp-start-card:hover {
  border-color: #ff007f !important;
  transform: translateY(-4px) scale(1.02) !important;
  box-shadow: 0 12px 32px rgba(255, 0, 127, 0.22) !important;
}
[data-theme="unicorn"] .jp-start-card strong,
[data-jp-theme="unicorn"] .jp-start-card strong,
html.jp-theme-unicorn .jp-start-card strong {
  color: #aa00ff !important;
  font-size: 1.15rem !important;
}

[data-theme="unicorn"] .jp-start-stats-btn,
[data-jp-theme="unicorn"] .jp-start-stats-btn,
html.jp-theme-unicorn .jp-start-stats-btn {
  border-color: #f3d1f8 !important;
  color: #7b1fa2 !important;
  background: rgba(255, 255, 255, 0.8) !important;
}
[data-theme="unicorn"] .jp-start-stats-btn:hover,
[data-jp-theme="unicorn"] .jp-start-stats-btn:hover,
html.jp-theme-unicorn .jp-start-stats-btn:hover {
  border-color: #ff007f !important;
  color: #ff007f !important;
  background: #ffffff !important;
  box-shadow: 0 4px 12px rgba(255, 0, 127, 0.2) !important;
}

[data-theme="unicorn"] .jp-stage-chip,
[data-jp-theme="unicorn"] .jp-stage-chip,
html.jp-theme-unicorn .jp-stage-chip {
  background: linear-gradient(135deg, #ff007f, #aa00ff) !important;
  color: #ffffff !important;
  border-radius: 24px !important;
  padding: 0.4rem 1rem !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 12px rgba(255, 0, 127, 0.3) !important;
}
[data-theme="unicorn"] .jp-stage-chip:hover,
[data-jp-theme="unicorn"] .jp-stage-chip:hover,
html.jp-theme-unicorn .jp-stage-chip:hover {
  transform: translateY(-2px) scale(1.05) !important;
  box-shadow: 0 6px 18px rgba(255, 0, 127, 0.45) !important;
}

[data-theme="unicorn"] button.primary,
[data-jp-theme="unicorn"] button.primary,
[data-theme="unicorn"] [role=button].primary,
[data-jp-theme="unicorn"] [role=button].primary,
html.jp-theme-unicorn button.primary,
html.jp-theme-unicorn [role=button].primary {
  background: linear-gradient(90deg, #ff007f 0%, #ff5252 25%, #ffb100 50%, #00e676 75%, #00b0ff 100%) !important;
  background-size: 200% auto !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  border: none !important;
  border-radius: 20px !important;
  box-shadow: 0 4px 14px rgba(255, 0, 127, 0.35) !important;
}
[data-theme="unicorn"] button.primary:hover,
[data-jp-theme="unicorn"] button.primary:hover,
[data-theme="unicorn"] [role=button].primary:hover,
[data-jp-theme="unicorn"] [role=button].primary:hover,
html.jp-theme-unicorn button.primary:hover,
html.jp-theme-unicorn [role=button].primary:hover {
  transform: translateY(-2px) scale(1.02) !important;
  box-shadow: 0 6px 20px rgba(255, 0, 127, 0.5) !important;
}

[data-theme="unicorn"] button.secondary,
[data-jp-theme="unicorn"] button.secondary,
[data-theme="unicorn"] [role=button].secondary,
[data-jp-theme="unicorn"] [role=button].secondary,
html.jp-theme-unicorn button.secondary,
html.jp-theme-unicorn [role=button].secondary {
  background: #ffffff !important;
  border: 2px solid #e1bee7 !important;
  color: #aa00ff !important;
  font-weight: 700 !important;
  border-radius: 20px !important;
  box-shadow: 0 2px 8px rgba(170, 0, 255, 0.1) !important;
}
[data-theme="unicorn"] button.secondary:hover,
[data-jp-theme="unicorn"] button.secondary:hover,
[data-theme="unicorn"] [role=button].secondary:hover,
[data-jp-theme="unicorn"] [role=button].secondary:hover,
html.jp-theme-unicorn button.secondary:hover,
html.jp-theme-unicorn [role=button].secondary:hover {
  border-color: #ff007f !important;
  color: #ff007f !important;
  background: #fff0f6 !important;
}

[data-theme="unicorn"] .jp-setlist thead th,
[data-jp-theme="unicorn"] .jp-setlist thead th,
html.jp-theme-unicorn .jp-setlist thead th {
  background: #fce8fd !important;
  color: #7b1fa2 !important;
  font-weight: 800 !important;
  box-shadow: inset 0 -3px 0 #ff007f !important;
}

[data-theme="unicorn"] .jp-setlist td,
[data-jp-theme="unicorn"] .jp-setlist td,
html.jp-theme-unicorn .jp-setlist td {
  border-bottom: 1px solid #f3d4fb !important;
  color: #29063b;
}

[data-theme="unicorn"] .jp-setlist tbody tr:hover td,
[data-jp-theme="unicorn"] .jp-setlist tbody tr:hover td,
html.jp-theme-unicorn .jp-setlist tbody tr:hover td {
  background: rgba(255, 0, 127, 0.08) !important;
}

[data-theme="unicorn"] .jp-setlist td a.jp-open,
[data-jp-theme="unicorn"] .jp-setlist td a.jp-open,
html.jp-theme-unicorn .jp-setlist td a.jp-open {
  color: #8e24aa !important;
  font-weight: 800 !important;
}
[data-theme="unicorn"] .jp-setlist td a.jp-open:hover,
[data-jp-theme="unicorn"] .jp-setlist td a.jp-open:hover,
html.jp-theme-unicorn .jp-setlist td a.jp-open:hover {
  color: #ff007f !important;
}

[data-theme="unicorn"] input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]),
[data-jp-theme="unicorn"] input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]),
[data-theme="unicorn"] select,
[data-jp-theme="unicorn"] select,
[data-theme="unicorn"] textarea,
[data-jp-theme="unicorn"] textarea,
html.jp-theme-unicorn input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]),
html.jp-theme-unicorn select,
html.jp-theme-unicorn textarea {
  background-color: #ffffff !important;
  border: 1.5px solid #e1bee7 !important;
  color: #29063b !important;
  border-radius: 8px !important;
}

[data-theme="unicorn"] input:focus,
[data-jp-theme="unicorn"] input:focus,
[data-theme="unicorn"] select:focus,
[data-jp-theme="unicorn"] select:focus,
[data-theme="unicorn"] textarea:focus,
[data-jp-theme="unicorn"] textarea:focus,
html.jp-theme-unicorn input:focus,
html.jp-theme-unicorn select:focus,
html.jp-theme-unicorn textarea:focus {
  border-color: #ff007f !important;
  background-color: #ffffff !important;
  color: #29063b !important;
  box-shadow: 0 0 0 3px rgba(255, 0, 127, 0.2) !important;
  outline: none !important;
}

[data-theme="unicorn"] .jp-fs,
[data-jp-theme="unicorn"] .jp-fs,
html.jp-theme-unicorn .jp-fs {
  background: linear-gradient(135deg, #fff0f6 0%, #f3e8ff 35%, #e1f5fe 70%, #ecfdf5 100%) !important;
  color: #29063b !important;
}
[data-theme="unicorn"] .jp-fs dt,
[data-jp-theme="unicorn"] .jp-fs dt,
html.jp-theme-unicorn .jp-fs dt {
  color: #aa00ff !important;
  font-weight: 800 !important;
}
[data-theme="unicorn"] .jp-fs dd,
[data-jp-theme="unicorn"] .jp-fs dd,
html.jp-theme-unicorn .jp-fs dd {
  color: #29063b !important;
}
[data-theme="unicorn"] .jp-fs h1,
[data-jp-theme="unicorn"] .jp-fs h1,
html.jp-theme-unicorn .jp-fs h1 {
  background: linear-gradient(90deg, #ff007f, #aa00ff, #00b0ff) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}
[data-theme="unicorn"] .jp-fs-close,
[data-jp-theme="unicorn"] .jp-fs-close,
html.jp-theme-unicorn .jp-fs-close {
  color: #ff007f !important;
}
[data-theme="unicorn"] .jp-fs-nav,
[data-jp-theme="unicorn"] .jp-fs-nav,
html.jp-theme-unicorn .jp-fs-nav {
  background: #ffffff !important;
  border-color: #f0c6f7 !important;
  color: #aa00ff !important;
}
[data-theme="unicorn"] .jp-fs-nav:hover,
[data-jp-theme="unicorn"] .jp-fs-nav:hover,
html.jp-theme-unicorn .jp-fs-nav:hover {
  background: #fff0f6 !important;
  border-color: #ff007f !important;
  color: #ff007f !important;
}

[data-theme="unicorn"] .jp-edit-modal-box,
[data-jp-theme="unicorn"] .jp-edit-modal-box,
html.jp-theme-unicorn .jp-edit-modal-box {
  background: #ffffff !important;
  border: 2px solid #ff4081 !important;
  box-shadow: 0 16px 48px rgba(255, 0, 127, 0.25) !important;
  color: #29063b !important;
}
[data-theme="unicorn"] .jp-edit-modal-box h3,
[data-jp-theme="unicorn"] .jp-edit-modal-box h3,
html.jp-theme-unicorn .jp-edit-modal-box h3 {
  color: #aa00ff !important;
}

[data-theme="unicorn"] #jp-toast,
[data-jp-theme="unicorn"] #jp-toast,
html.jp-theme-unicorn #jp-toast {
  background: linear-gradient(135deg, #ff007f, #aa00ff) !important;
  color: #ffffff !important;
  border: 2px solid #ffd600 !important;
  font-weight: 700 !important;
  box-shadow: 0 6px 20px rgba(255, 0, 127, 0.4) !important;
}

[data-theme="unicorn"] .jp-setlist tr,
[data-theme="unicorn"] .jp-setlist td,
[data-theme="unicorn"] .jp-tag-chip,
[data-theme="unicorn"] .jp-link-btn,
[data-theme="unicorn"] .jp-fs dl,
[data-theme="unicorn"] .jp-fs dt,
[data-theme="unicorn"] .jp-fs dd,
[data-jp-theme="unicorn"] .jp-setlist tr,
[data-jp-theme="unicorn"] .jp-setlist td,
[data-jp-theme="unicorn"] .jp-tag-chip,
[data-jp-theme="unicorn"] .jp-link-btn,
[data-jp-theme="unicorn"] .jp-fs dl,
[data-jp-theme="unicorn"] .jp-fs dt,
[data-jp-theme="unicorn"] .jp-fs dd,
html.jp-theme-unicorn .jp-setlist tr,
html.jp-theme-unicorn .jp-setlist td,
html.jp-theme-unicorn .jp-tag-chip,
html.jp-theme-unicorn .jp-link-btn,
html.jp-theme-unicorn .jp-fs dl,
html.jp-theme-unicorn .jp-fs dt,
html.jp-theme-unicorn .jp-fs dd {
  background: transparent !important;
}

[data-theme="unicorn"] .jp-stat-card,
[data-jp-theme="unicorn"] .jp-stat-card,
html.jp-theme-unicorn .jp-stat-card,
[data-theme="unicorn"] .jp-stats-section,
[data-jp-theme="unicorn"] .jp-stats-section,
html.jp-theme-unicorn .jp-stats-section {
  background: rgba(255, 255, 255, 0.95) !important;
  border: 2px solid #f3d1f8 !important;
  box-shadow: 0 4px 16px rgba(224, 64, 251, 0.1) !important;
  color: #29063b !important;
}
[data-theme="unicorn"] .jp-stat-num,
[data-jp-theme="unicorn"] .jp-stat-num,
html.jp-theme-unicorn .jp-stat-num {
  color: #ff007f !important;
}
[data-theme="unicorn"] .jp-stats-section h3,
[data-jp-theme="unicorn"] .jp-stats-section h3,
html.jp-theme-unicorn .jp-stats-section h3 {
  color: #aa00ff !important;
}
[data-theme="unicorn"] .jp-stats-bar-fill,
[data-jp-theme="unicorn"] .jp-stats-bar-fill,
html.jp-theme-unicorn .jp-stats-bar-fill {
  background: linear-gradient(90deg, #ff007f, #aa00ff) !important;
}
[data-theme="unicorn"] .jp-stats-badge,
[data-jp-theme="unicorn"] .jp-stats-badge,
html.jp-theme-unicorn .jp-stats-badge {
  background: rgba(255, 0, 127, 0.1) !important;
  color: #ff007f !important;
  border-color: #f3d1f8 !important;
}
[data-theme="unicorn"] .jp-todo-card,
[data-jp-theme="unicorn"] .jp-todo-card,
html.jp-theme-unicorn .jp-todo-card {
  background: #ffffff !important;
  border-color: #f3d1f8 !important;
}
[data-theme="unicorn"] .jp-card,
[data-jp-theme="unicorn"] .jp-card,
html.jp-theme-unicorn .jp-card {
  background: #ffffff !important;
  border-color: #f0c6f7 !important;
  box-shadow: 0 4px 16px rgba(255, 0, 127, 0.08) !important;
}
[data-theme="unicorn"] .jp-card-title,
[data-jp-theme="unicorn"] .jp-card-title,
html.jp-theme-unicorn .jp-card-title {
  color: #29063b !important;
}
[data-theme="unicorn"] .jp-settings-matrix-wrap,
[data-jp-theme="unicorn"] .jp-settings-matrix-wrap,
html.jp-theme-unicorn .jp-settings-matrix-wrap {
  border-color: #f0c6f7 !important;
  background: #ffffff !important;
}
[data-theme="unicorn"] .jp-settings-matrix th,
[data-jp-theme="unicorn"] .jp-settings-matrix th,
html.jp-theme-unicorn .jp-settings-matrix th {
  background: #fdf4ff !important;
  color: #ff007f !important;
  border-color: #f0c6f7 !important;
}
[data-theme="unicorn"] .jp-settings-matrix td,
[data-jp-theme="unicorn"] .jp-settings-matrix td,
html.jp-theme-unicorn .jp-settings-matrix td {
  border-color: #f8e1fa !important;
}
[data-theme="unicorn"] .jp-settings-matrix th:first-child,
[data-jp-theme="unicorn"] .jp-settings-matrix th:first-child,
html.jp-theme-unicorn .jp-settings-matrix th:first-child {
  background: #fdf4ff !important;
  box-shadow: 2px 0 4px rgba(255, 0, 127, 0.1) !important;
}
[data-theme="unicorn"] .jp-settings-matrix td:first-child,
[data-jp-theme="unicorn"] .jp-settings-matrix td:first-child,
html.jp-theme-unicorn .jp-settings-matrix td:first-child {
  background: #ffffff !important;
  box-shadow: 2px 0 4px rgba(255, 0, 127, 0.1) !important;
}
[data-theme="unicorn"] .jp-settings-matrix tr:hover td,
[data-jp-theme="unicorn"] .jp-settings-matrix tr:hover td,
html.jp-theme-unicorn .jp-settings-matrix tr:hover td {
  background-color: rgba(255, 0, 127, 0.04) !important;
}
[data-theme="unicorn"] .jp-settings-matrix tr:hover td:first-child,
[data-jp-theme="unicorn"] .jp-settings-matrix tr:hover td:first-child,
html.jp-theme-unicorn .jp-settings-matrix tr:hover td:first-child {
  background-color: #ffffff !important;
}
[data-theme="unicorn"] .jp-settings-footer,
[data-jp-theme="unicorn"] .jp-settings-footer,
html.jp-theme-unicorn .jp-settings-footer {
  background: #ffffff !important;
  border-top: 2px solid #ff007f !important;
  box-shadow: 0 -4px 16px rgba(255, 0, 127, 0.15) !important;
}
[data-theme="unicorn"] .jp-bpm-grid label,
[data-jp-theme="unicorn"] .jp-bpm-grid label,
html.jp-theme-unicorn .jp-bpm-grid label {
  color: #29063b !important;
}

/* --- J-AI Chat Styles ----------------------------------------- */
.jp-jai-page {
  display: flex; flex-direction: column; height: 100vh; overflow: hidden;
}
.jp-jai-layout {
  display: flex; flex-direction: column; flex: 1; height: calc(100vh - 65px); max-width: 960px; margin: 0 auto; width: 100%; padding: 0.5rem 1rem 1rem; box-sizing: border-box; overflow-y: auto; overflow-x: hidden;
}
.jp-jai-top-bar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; padding: 0.5rem 0.75rem; background: var(--jp-card); border: 1px solid var(--jp-border); border-radius: 8px; margin-bottom: 0.6rem; flex-shrink: 0;
}
.jp-jai-top-info {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.82rem; color: var(--jp-muted);
}
.jp-jai-badge {
  display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.15rem 0.5rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600;
}
.jp-jai-badge-webmcp {
  background: rgba(46, 204, 113, 0.15); color: #2ecc71; border: 1px solid rgba(46, 204, 113, 0.4);
}
.jp-jai-badge-fallback {
  background: rgba(200, 168, 75, 0.15); color: var(--jp-gold); border: 1px solid rgba(200, 168, 75, 0.4);
}
.jp-jai-badge-model {
  background: rgba(140, 150, 165, 0.15); color: var(--jp-white); border: 1px solid var(--jp-border);
}
.jp-jai-panel {
  background: var(--jp-card); border: 1px solid var(--jp-gold); border-radius: 8px; padding: 1rem 1.25rem; margin-bottom: 0.75rem; flex-shrink: 0; box-shadow: 0 4px 12px rgba(0,0,0,0.3); max-height: 75vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.jp-jai-chat-history {
  flex: 1; overflow-y: auto; padding: 0.75rem 0.5rem; display: flex; flex-direction: column; gap: 0.75rem; scroll-behavior: smooth;
}
.jp-jai-msg {
  display: flex; flex-direction: column; max-width: 85%;
}
.jp-jai-msg-user {
  align-self: flex-end; align-items: flex-end;
}
.jp-jai-msg-user .jp-jai-bubble {
  background: rgba(200, 168, 75, 0.18); border: 1px solid var(--jp-gold); color: var(--jp-white); border-radius: 12px 12px 2px 12px; padding: 0.65rem 0.9rem; font-size: 0.92rem; word-break: break-word;
}
.jp-jai-msg-assistant {
  align-self: flex-start; align-items: flex-start;
}
.jp-jai-msg-assistant .jp-jai-bubble {
  background: var(--jp-card); border: 1px solid var(--jp-border); color: var(--jp-white); border-radius: 12px 12px 12px 2px; padding: 0.75rem 1rem; font-size: 0.92rem; line-height: 1.45; word-break: break-word;
}
.jp-jai-tool-pill {
  display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.75rem; padding: 0.2rem 0.55rem; background: rgba(0,0,0,0.25); border: 1px solid var(--jp-border); border-radius: 6px; color: var(--jp-muted); margin-bottom: 0.4rem;
}
.jp-jai-input-bar {
  display: flex; gap: 0.5rem; padding: 0.6rem 0.75rem; background: var(--jp-card); border: 1px solid var(--jp-border); border-radius: 8px; flex-shrink: 0; align-items: flex-end; margin-top: 0.4rem;
}
.jp-jai-input-bar textarea {
  flex: 1; min-height: 44px; max-height: 160px; resize: none; margin: 0; padding: 0.55rem 0.75rem; font-family: inherit; font-size: 0.92rem; background: var(--jp-black); border: 1px solid var(--jp-border); color: var(--jp-white); border-radius: 6px; box-sizing: border-box;
}
.jp-jai-input-bar textarea:focus {
  border-color: var(--jp-gold); outline: none;
}
.jp-jai-suggestions {
  display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem;
}
.jp-jai-suggestion-chip {
  background: rgba(200, 168, 75, 0.1); border: 1px solid var(--jp-gold); color: var(--jp-white); padding: 0.35rem 0.75rem; border-radius: 999px; font-size: 0.8rem; cursor: pointer; transition: all 0.15s;
}
.jp-jai-suggestion-chip:hover {
  background: var(--jp-gold); color: var(--jp-black);
}
@keyframes jpPulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.1); }
}
.jp-typing-dot {
  width: 6px; height: 6px; background: var(--jp-gold); border-radius: 50%; display: inline-block; animation: jpPulse 1.2s infinite ease-in-out;
}
.jp-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.jp-typing-dot:nth-child(3) { animation-delay: 0.4s; }

[data-theme="unicorn"] .jp-jai-top-bar,
[data-jp-theme="unicorn"] .jp-jai-top-bar,
html.jp-theme-unicorn .jp-jai-top-bar,
[data-theme="unicorn"] .jp-jai-input-bar,
[data-jp-theme="unicorn"] .jp-jai-input-bar,
html.jp-theme-unicorn .jp-jai-input-bar,
[data-theme="unicorn"] .jp-jai-panel,
[data-jp-theme="unicorn"] .jp-jai-panel,
html.jp-theme-unicorn .jp-jai-panel {
  background: #ffffff !important; border-color: #f0c6f7 !important; color: #29063b !important;
}
[data-theme="unicorn"] .jp-jai-msg-assistant .jp-jai-bubble,
[data-jp-theme="unicorn"] .jp-jai-msg-assistant .jp-jai-bubble,
html.jp-theme-unicorn .jp-jai-msg-assistant .jp-jai-bubble {
  background: #ffffff !important; border-color: #f0c6f7 !important; color: #29063b !important;
}
[data-theme="unicorn"] .jp-jai-input-bar textarea,
[data-jp-theme="unicorn"] .jp-jai-input-bar textarea,
html.jp-theme-unicorn .jp-jai-input-bar textarea {
  background: #fdf4ff !important; border-color: #f0c6f7 !important; color: #29063b !important;
}
