:root{
  --direkt-bg:#0f1216;
  --direkt-panel:#151a21;
  --direkt-text:#e8eef6;
  --direkt-muted:#a8b3c2;
  --direkt-border:#263041;
  --direkt-accent:#5aa9ff;
  --direkt-danger:#ff5a6a;
  --direkt-ok:#43d39e;
  --direkt-radius:14px;
  --direkt-shadow: 0 12px 30px rgba(0,0,0,.35);
  --direkt-font: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

#direktBubble{
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 999999;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: var(--direkt-accent);
  color: #071018;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow: var(--direkt-shadow);
  cursor: pointer;
  user-select:none;
}

#direktBubble span{
  font-size: 22px;
}

#direktPanel{
  position: fixed;
  right: 18px;
  bottom: 84px;
  z-index: 999999;
  width: min(420px, calc(100vw - 36px));
  max-height: min(75vh, 720px);
  background: var(--direkt-panel);
  color: var(--direkt-text);
  border: 1px solid var(--direkt-border);
  border-radius: var(--direkt-radius);
  box-shadow: var(--direkt-shadow);
  font-family: var(--direkt-font);
  overflow: hidden;
  display:none;
}

#direktPanel.open{ display:block; }

#direktPanelHeader{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--direkt-border);
}

#direktPanelHeader .title{
  font-weight: 700;
  font-size: 14px;
  letter-spacing:.2px;
}

#direktPanelHeader .actions{
  display:flex;
  gap:8px;
}

.direktBtn{
  background: transparent;
  color: var(--direkt-text);
  border: 1px solid var(--direkt-border);
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 12px;
}

.direktBtn.primary{
  background: var(--direkt-accent);
  color: #071018;
  border-color: transparent;
  font-weight: 700;
}

.direktBtn.danger{
  border-color: rgba(255,90,106,.5);
  color: #ffd6db;
}

#direktPanelBody{
  padding: 12px;
  overflow:auto;
}

.direktNotice{
  font-size: 12px;
  line-height: 1.35;
  color: var(--direkt-muted);
  border: 1px solid var(--direkt-border);
  border-radius: 12px;
  padding: 10px 10px;
  margin-bottom: 10px;
  background: rgba(0,0,0,.12);
}

.direktNotice strong{ color: var(--direkt-text); }

.direktRow{ display:flex; gap:10px; flex-wrap:wrap; }

.direktField{
  width: 100%;
  margin-top: 10px;
}

.direktField label{
  display:block;
  font-size: 12px;
  color: var(--direkt-muted);
  margin-bottom: 6px;
}

.direktField input,
.direktField textarea,
.direktField select{
  width: 100%;
  background: #0e1218;
  border: 1px solid var(--direkt-border);
  border-radius: 12px;
  color: var(--direkt-text);
  padding: 10px 10px;
  font-family: var(--direkt-font);
  font-size: 13px;
  outline: none;
}

.direktField textarea{ min-height: 78px; resize: vertical; }

.direktField input:disabled,
.direktField textarea:disabled{
  opacity: .55;
  cursor:not-allowed;
}

.direktTabs{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  margin: 10px 0 8px 0;
}

.direktTab{
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--direkt-border);
  color: var(--direkt-muted);
  font-size: 12px;
  cursor:pointer;
  user-select:none;
}

.direktTab.active{
  border-color: rgba(90,169,255,.7);
  color: var(--direkt-text);
  background: rgba(90,169,255,.12);
}

.direktHelp{
  margin-top: 8px;
  border: 1px solid var(--direkt-border);
  border-radius: 12px;
  overflow:hidden;
}

.direktHelp summary{
  padding: 10px 10px;
  cursor:pointer;
  color: var(--direkt-text);
  font-size: 12px;
  background: rgba(0,0,0,.10);
}

.direktHelp .content{
  padding: 10px 10px;
  color: var(--direkt-muted);
  font-size: 12px;
  line-height: 1.35;
}

.direktDivider{
  height:1px;
  background: var(--direkt-border);
  margin: 12px 0;
}

.direktCodeBox{
  padding: 10px 10px;
  border: 1px dashed rgba(90,169,255,.6);
  border-radius: 12px;
  background: rgba(90,169,255,.08);
  color: var(--direkt-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}
/* === FIX: Panel scrollbar machen === */
#direktPanel {
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
}

/* Header bleibt sichtbar */
#direktPanelHeader {
  flex: 0 0 auto;
}

/* Inhalt scrollt */
#direktPanelBody {
  flex: 1 1 auto;
  overflow-y: auto;
  padding-bottom: 96px; /* Platz für unteren Rand */
}

/* Mobile / kleinere Screens */
@media (max-height: 700px) {
  #direktPanel {
    max-height: calc(100vh - 16px);
  }
  #direktPanelBody {
    padding-bottom: 120px;
  }
}
/* === KONTRAST-FIX: Beispiele lesbar machen === */

/* Container der Beispiele */
.direktExamples,
.direktExampleBox,
.exampleBox,
.examplesBox {
  background: #11161d !important;         /* dunkler als Panel */
  border: 1px solid #263041 !important;
  color: #e8eef6 !important;
}

/* Listen/Text in der Beispiele-Box */
.direktExamples *,
.direktExampleBox *,
.exampleBox *,
.examplesBox * {
  color: #e8eef6 !important;
  opacity: 1 !important;
}

/* Der "Beispiele anzeigen"-Button innerhalb */
.direktExamples button,
.direktExampleBox button,
.exampleBox button,
.examplesBox button {
  background: #151a21 !important;
  border: 1px solid #263041 !important;
  color: #e8eef6 !important;
}
:root{
  --direkt-muted: #c6d0df; /* statt sehr hellem Grau */
}
/* === KONTRAST-FIX v2: trifft ALLE Example-Boxen sicher === */
/* Alles innerhalb des Panels, dessen Klasse 'example' enthält */
#direktPanelBody [class*="example" i],
#direktPanelBody [class*="examples" i]{
  background: #0f1216 !important;
  border: 1px solid #263041 !important;
  color: #e8eef6 !important;
}

/* Text/Listen IMMER hell, keine Transparenz */
#direktPanelBody [class*="example" i] *,
#direktPanelBody [class*="examples" i] *{
  color: #e8eef6 !important;
  opacity: 1 !important;
  filter: none !important;
}

/* Der "Beispiele anzeigen"-Button/summary selbst */
#direktPanelBody [class*="example" i] button,
#direktPanelBody [class*="examples" i] button,
#direktPanelBody [class*="example" i] summary,
#direktPanelBody [class*="examples" i] summary{
  background: #151a21 !important;
  border: 1px solid #263041 !important;
  color: #e8eef6 !important;
}
/* === KONTRAST-FIX v3: Details/Summary im Panel (trifft Beispiele sicher) === */
#direktPanelBody details{
  background: #0f1216 !important;
  border: 1px solid #263041 !important;
  border-radius: 12px !important;
  color: #e8eef6 !important;
  overflow: hidden !important;
}

#direktPanelBody details summary{
  background: rgba(90,169,255,.12) !important;
  color: #e8eef6 !important;
  font-weight: 700 !important;
  border-bottom: 1px solid #263041 !important;
}

/* Inhalt in Details: volle Lesbarkeit, keine "blasse" Optik */
#direktPanelBody details *{
  color: #e8eef6 !important;
  opacity: 1 !important;
  filter: none !important;
}

/* Falls die Box inline hellgrau gesetzt ist: überschreiben */
#direktPanelBody details[style]{
  background: #0f1216 !important;
}
#direktPanelBody details summary[style]{
  background: rgba(90,169,255,.12) !important;
  color: #e8eef6 !important;
}
