    /* ---------------------------
       Design Tokens
       --------------------------- */
    :root{ color-scheme: light dark; }

    /* Light Theme */
    [data-theme="light"]{
      --bg: #ffffff;
      --bg-elev: #f5f7fb;        /* helles Grau */
      --bg-table-header: #0b0c10;
      --text-table-header: #e9e9ee;
      --surface: #ffffff;
      --text: #111314;
      --text-dim: #4b5563;       /* Grau 600 */
      --text-muted: #6b7280;     /* Grau 500 */
      --accent: #0a84ff;         /* Blau */
      --border: #e5e7eb;         /* Haarlinie hell */
      --primary-button-text: #111314;

      --shadow-1: 0 1px 2px rgba(17,19,20,0.04);
      --shadow-2: 0 4px 16px rgba(17,19,20,0.08);
    }

    /* Dark Theme */
    [data-theme="dark"]{
      --bg: #0b0c10;
      --bg-elev: #12141a;
      --bg-table-header: #f5f7fb;
      --text-table-header: #111314;
      --surface: #14161d;
      --text: #e9e9ee;
      --text-dim: #babcc6;
      --text-muted: #9499a6;
      --accent: #0a84ff;
      --border: #242736;
      --primary-button-text: #fff;

      --shadow-1: 0 1px 2px rgba(0,0,0,0.35);
      --shadow-2: 0 10px 30px rgba(0,0,0,0.35);
    }

    /* Base */
    *, *::before, *::after { box-sizing: border-box; }
    html, body { height: 100%; }
    body{
      margin: 0;
      font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
      color: var(--text);
      background: var(--bg);
      line-height: 1.5;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      letter-spacing: 0.1px;
      transition: background-color .25s ease, color .25s ease;
    }
    img{ max-width: 100%; display: block; }
    a{ color: inherit; text-decoration: none; }
    .container{ width: 100%; max-width: 1220px; padding: 0 20px; margin: 0 auto; }

    /* Focus (minimal sichtbar, Tastaturfreundlich) */
    :focus-visible{
      outline: 2px solid var(--accent);
      outline-offset: 2px;
      border-radius: 8px;
    }
    /* Map controls */
    #controls{z-index:2001;}    
    #controls{position:fixed;top:84px;left:16px;z-index:950;width:clamp(260px,50vw,420px);max-height:min(70vh,640px);overflow:auto;background:color-mix(in srgb,var(--bg) 82%,transparent);border:1px solid var(--border);border-radius:16px;box-shadow:0 10px 30px rgba(0,0,0,.22);-webkit-backdrop-filter:saturate(120%) blur(12px);backdrop-filter:saturate(120%) blur(12px);padding:14px 16px;}
    @supports not (background: color-mix(in srgb, black, white)){#controls{background:rgba(20,22,34,.85);}}
    #controls .drag-handle{display:flex;align-items:center;gap:8px;cursor:grab;margin:0 0 10px;font-size:16px;touch-action:none;}
    #controls .drag-handle:active{cursor:grabbing;}
    #controls.dragging{cursor:grabbing;user-select:none;}
    @media(max-width:640px){#controls{width:min(92vw,420px);left:12px;right:auto;}}
    
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="date"],
    input[type="number"],
    input[type="search"],
    input[type="file"],
    select,
    textarea{background:var(--bg-elev);border:1px solid var(--border);padding:10px 14px;border-radius:12px;color:var(--text);font-size:15px;transition:background .2s ease,border-color .2s ease,box-shadow .2s ease, color .2s ease;}
    [data-theme="light"] input,[data-theme="light"] select,[data-theme="light"] textarea{background:#f7f8fa;border-color:#d0d3da;color:#111;}
    [data-theme="dark"] input,[data-theme="dark"] select,[data-theme="dark"] textarea{background:#1b1e27;border-color:#2f3544;color:#e9e9ee;}
    [data-theme="light"] input:hover,[data-theme="light"] select:hover,[data-theme="light"] textarea:hover{background:#eef0f4;} [data-theme="dark"] input:hover,[data-theme="dark"] select:hover,[data-theme="dark"] textarea:hover{background:#232734;}
    input:focus,select:focus,textarea:focus{outline:2px solid var(--accent);outline-offset:2px;box-shadow:0 0 0 4px rgba(10,132,255,.15);}
    ::placeholder{color:var(--text-muted);}
    
    /* Minimize-Button Styling */
    .minimize-btn { background: none; border: none; color: var(--text-muted); font-size: 1.1em; cursor: pointer; padding: 4px 8px; border-radius: 6px; transition: all 0.2s; margin-left: auto;           /* schiebt ihn nach rechts */ }
    .minimize-btn:hover { color: var(--text); background: var(--bg-elev); }
    .minimize-btn.minimized i { transform: rotate(0deg); }
    /* Zustand wenn minimiert */
    #controls.minimized { height: 48px !important;     /* nur Header sichtbar */ overflow: hidden; transition: height 0.3s ease; }
    #controls.minimized #controls-content { display: none; }
    #controls.minimized { box-shadow: 0 4px 12px rgba(0,0,0,0.15); border-radius: 12px; }
    
    /* ---------------------------
       Header (Sticky, minimal)
       --------------------------- */
    header.site-header{
      position: sticky; top: 0; z-index: 1000;
      background: color-mix(in srgb, var(--bg) 86%, transparent);
      border-bottom: 1px solid var(--border);
      -webkit-backdrop-filter: saturate(120%) blur(10px);
      backdrop-filter: saturate(120%) blur(10px);
    }
    /* Fallback falls color-mix nicht verfügbar ist */
    @supports not (background: color-mix(in srgb, black, white)){
      header.site-header{ background: var(--bg); }
    }

    .nav{
      display: grid; grid-template-columns: auto 1fr auto; align-items: center;
      height: 64px; gap: 12px;
    }
    .brand{ display:flex; align-items:center; gap:10px; font-weight:600; }
    .brand .logo{
      width: 22px; height: 22px; border-radius: 6px;
      background: var(--text);
      mask: radial-gradient(circle at 30% 30%, #000 45%, transparent 46%);
    }

    .nav-center{ display:none; justify-content:center; gap: 8px; }
    .nav-item{ position: relative; --dd-gap: 8px; }
    /* Hover-Bridge verhindert das "Loch" zwischen Link und Panel */
    .nav-item.has-dropdown::after{ content:""; position:absolute; left:0; right:0; top:100%; height: var(--dd-gap); }

    .nav-link{ color: var(--text-dim); padding: 8px 10px; border-radius: 8px; display:inline-flex; align-items:center; gap:6px; }
    .nav-link:hover{ color: var(--text); background: var(--bg-elev); }

    /* Dropdown (Hover + Focus within) */
    .has-dropdown:focus-within > .dropdown,
    .has-dropdown:hover > .dropdown { opacity:1; visibility:visible; transform: translateY(0); }

    .dropdown{
      position: absolute; left: 0; top: calc(100% + var(--dd-gap));
      background: var(--surface); border:1px solid var(--border); border-radius:12px; box-shadow: var(--shadow-2);
      padding: 10px; min-width: 220px; opacity:0; visibility:hidden; transform: translateY(6px);
      transition: opacity .15s ease, transform .15s ease, visibility .15s ease; z-index: 1001;
      /* wichtige Änderung: pointer-events immer erlaubt, Visibility verhindert Klicks wenn zu */
      pointer-events: auto;
    }
    .dropdown .group{ display:grid; gap:6px; }
    .dropdown a{ display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:8px; color: var(--text-dim); }
    .dropdown a:hover{ background: var(--bg-elev); color: var(--text); }
    .dropdown .label{ font-size:11px; text-transform:uppercase; letter-spacing:.3px; color: var(--text-muted); padding:4px 8px; }
    .dropdown hr{ border: none; border-top:1px solid var(--border); margin:8px 0; }

    .dropdown.right{ left: auto; right: 0; }

    .nav-cta{ display:flex; justify-content:end; align-items:center; gap: 8px; }

    /* Buttons (minimal) */
    .btn{ display:inline-flex; align-items:center; justify-content:center; gap:8px;
      padding: 10px 14px; border-radius: 10px; font-weight:600; font-size:14px;
      border: 1px solid var(--border); background: var(--surface); color: var(--text);
      box-shadow: var(--shadow-1); transition: background .15s ease, border-color .15s ease, transform .05s ease;
      cursor: pointer; }
    .btn:hover{ background: var(--bg-elev); }
    .btn:active{ transform: translateY(1px); }

    .btn-slim{ display:inline-flex; align-items:center; justify-content:center; gap:8px;
      padding: 5px 12px; border-radius: 4px;
      border: 1px solid var(--border); background: var(--surface); color: var(--text);
      box-shadow: var(--shadow-1); transition: background .15s ease, border-color .15s ease, transform .05s ease;
      cursor: pointer; }
    .btn-slim:hover{ background: var(--bg-elev); }
    .btn-slim:active{ transform: translateY(1px); }

    .btn-primary{ background: var(--accent); color: #fff; border-color: transparent; box-shadow: none; }
    .btn-primary:hover{ filter: brightness(1.05); color: var(--primary-button-text);}
    
    .btn-delete{ background: #d32f2f; margin-top: 5px; margin-bottom: 5px;  }
    .btn-delete:hover{ background-color: #9e4343; }
    
    .btn-warn{ background: #ffc107; margin-top: 5px; margin-bottom: 5px; }
    .btn-warn:hover{ background-color: #e5ae07; }
    
    .btn-add{ background: #28a745; margin-top: 5px; margin-bottom: 5px; }
    .btn-add:hover{ background: #1e8535; }

    /* Icon-Toggles */
    .icon-btn{ width:40px; height:40px; padding:0; display:inline-grid; place-items:center; }
    
    .btn .btn-text { display: inline; }
    @media (max-width: 860px) {
      .nav-cta .btn {
        width:40px; height:40px; padding:0; display:inline-grid; place-items:center;
      }
      .nav-cta .btn .btn-text { display: none; }
      .nav-cta .btn { justify-content: center; }
    }

    .page-error{ color:red !important;}
    .page-success{ color:green !important;;}
    
    /* Menu styles */
    .token-row.valid    { background: #4caf50; }
    .token-row.used     { background: #e9bb3f; }
    .token-row.expired  { background: #a92222; }

    /* Mobile Menü */
    .nav-toggle{ border-radius: 10px; border: 1px solid var(--border); background: var(--surface); }
    .mobile-menu{ display:none; border-bottom:1px solid var(--border); background: var(--bg); }
    .mobile-menu a{ display:block; padding:12px 20px; color: var(--text-dim); }
    .mobile-menu a:hover{ color: var(--text); background: var(--bg-elev); }
    /* Mobile dropdowns */
    .mobile-accordion { border-top:1px solid var(--border); }
    .m-acc-item { border-top:1px solid var(--border); }
    .m-acc-btn {
      width:100%; text-align:left; padding:12px 20px; background:transparent; border:0; color:var(--text);
      font: inherit; display:flex; align-items:center; justify-content:space-between;
    }
    .m-acc-btn .hint { color: var(--text-dim); font-size:13px; }
    .m-acc-panel { display:none; padding:0 0 8px; background: var(--bg); }
    .m-acc-panel a { padding-left:32px; }

    /* ---------------------------
       Hero (schlicht)
       --------------------------- */
    .hero{ padding: 72px 0 56px; display:grid; gap:32px; align-items:center; }
    .eyebrow{ color: var(--text-muted); font-size: 13px; letter-spacing:.3px; text-transform: uppercase; }
    h1{ font-size: clamp(32px, 5vw, 56px); line-height:1.05; margin: 8px 0 12px; font-weight: 700; letter-spacing: -0.3px; }
    .lead{ color: var(--text-dim); font-size: clamp(16px, 1.4vw, 20px); max-width: 70ch; }
    .hero-actions{ display:flex; flex-wrap:wrap; gap:10px; margin-top: 24px; }

    .hero-media{ border:1px solid var(--border); border-radius:16px; min-height:240px; background: var(--bg-elev); }
    .placeholder-media{ display:grid; place-items:center; height:100%; color: var(--text-muted); font-size:14px; text-align:center; padding:24px; }

    /* ---------------------------
       Feature Cards (dezent)
       --------------------------- */
    .section{ padding: 28px 0; }
    .section-main{ padding:0 1rem 0 1rem;}
    .section-tight{ padding: 10px 0;}
    .grid{ display:grid; gap: 20px; grid-template-columns: repeat(12, 1fr); }
    .flex{ display:flex; gap: 20px; grid-template-columns: repeat(12, 1fr); flex-wrap: wrap;}
    .card{ grid-column: span 4; background: var(--surface); border:1px solid var(--border); border-radius:14px; padding:20px; box-shadow: var(--shadow-1); min-width: 250px}
    .card h3{ margin: 0 0 6px; font-size: 18px; }
    .card p{ margin: 0; color: var(--text-dim); }

    /* ---------------------------
       Callout / CTA (flach)
       --------------------------- */
    .callout{ background: var(--bg-elev); border:1px solid var(--border); border-radius:16px; padding:32px; text-align:center; box-shadow: var(--shadow-1); }
    .callout h2{ font-size: clamp(22px, 3vw, 34px); margin: 0 0 8px; }
    .callout p{ color: var(--text-dim); margin: 0 auto 18px; max-width: 68ch; }
 
     /* ---------------------------
       Formgrid 
       --------------------------- */   
    .form-grid { display: grid; grid-template-columns: 1fr; gap: 16px 24px; max-width: 520px; margin: 0 auto; padding: 10px 0; text-align: left; }
    .form-grid label { display: flex; align-items: center; font-weight: 500; }
    .form-grid input,
    .form-grid select { width: 100%; }

    .field.checkbox { display: flex !important; flex-direction: row !important; align-items: flex-start !important; gap: 0.75rem; }
    .field.checkbox input[type="checkbox"] { margin-top: 3px; flex-shrink: 0; width: 20px; }
    .field.checkbox label { display: block !important; line-height: 1.45; }

    /* ---------------------------
       Footer (minimal, ordentlich)
       --------------------------- */
    footer.site-footer{ margin-top:72px; border-top:1px solid var(--border); background: var(--bg); }
    .footer-top{ padding: 36px 1rem 24px 1rem; display:grid; gap:24px; grid-template-columns: 1.2fr 1fr 1fr 1fr; }
    .footer-brand{ display:grid; gap:10px; }
    .footer-brand .brandline{ display:flex; align-items:center; gap:10px; font-weight:600; }
    .footer-brand p{ color: var(--text-muted); margin: 0; }

    .footer-col h4{ font-size: 12px; text-transform: uppercase; letter-spacing:.3px; color: var(--text-muted); margin: 0 0 10px; }
    .footer-links{ display:grid; gap: 8px; }
    .footer-links a{ color: var(--text-dim); }
    .footer-links a:hover{ color: var(--text); }

    .footer-bottom{ border-top:1px solid var(--border); padding: 16px 1rem 0 1rem; display:flex; flex-wrap:wrap; gap:10px; align-items:center; justify-content:space-between; color: var(--text-muted); font-size: 13px; }
    .pill{ display:inline-flex; align-items:center; gap:6px; padding:6px 10px; border-radius:999px; background: var(--bg-elev); border:1px solid var(--border); color: var(--text-dim); }

    /* Responsive */
    @media (min-width: 860px){ .nav-center{ display:flex; } .nav-toggle{ display:none; } .mobile-menu{ display: none !important; } .hero{ grid-template-columns: 1.2fr 1fr; } .hero-media{ min-height:300px; } }
    @media (max-width: 1024px){ .card{ grid-column: span 6; } .footer-top{ grid-template-columns: 1fr 1fr; } }
    @media (max-width: 640px){ .grid{ grid-template-columns: repeat(6, 1fr); } .card{ grid-column: span 6; } .footer-top{ grid-template-columns: 1fr; } .nav{ grid-template-columns: auto 1fr auto; } .nav-cta .btn{ padding: 9px 12px; } }

    /* Motion */
    .fade-in{ opacity:0; transform: translateY(6px); animation: fadeIn .5s ease forwards; }
    .fade-in.delay-1{ animation-delay: .1s; }
    .fade-in.delay-2{ animation-delay: .2s; }
    .fade-in.delay-3{ animation-delay: .3s; }
    @keyframes fadeIn{ to { opacity:1; transform: translateY(0); } }

    /* Tables */
    .table-style-1 { width:100%; border-collapse:separate; border-spacing:0; margin:24px 0; font-size:15px; background:var(--surface); border:1px solid var(--border); border-radius:12px; overflow:hidden; }
    .table-style-1 thead th { background:var(--bg-table-header); color:var(--text-table-header); text-align:left; padding:14px 18px; font-weight:600; letter-spacing:0.2px; border-bottom:1px solid var(--border); }
    .table-style-1 tbody td { padding:12px 18px; border-bottom:1px solid var(--border); color:var(--text-dim); }
    .table-style-1 tbody tr:last-child td { border-bottom:none; }
    .table-style-1 tbody tr:hover td { background:var(--bg-elev); color:var(--text); transition:background .15s ease,color .15s ease; }
    .table-style-1.zebra tbody tr:nth-child(even) td { background:color-mix(in srgb, var(--bg) 80%, transparent); }
    .table-style-1 thead th:first-child { border-top-left-radius:12px; }
    .table-style-1 thead th:last-child { border-top-right-radius:12px; }
    .table-style-1 tbody tr:last-child td:first-child { border-bottom-left-radius:12px; }
    .table-style-1 tbody tr:last-child td:last-child { border-bottom-right-radius:12px; }
    
    .table-style-1 tr.status-planned td:first-child{border-left:4px solid #ffc107;} .table-style-1 tr.status-done td:first-child{border-left:4px solid #28a745;} .table-style-1 tr.status-visible td:first-child{border-left:4px solid #6c757d;} .table-style-1 tr.status-cancelled td:first-child{border-left:4px solid #dc3545;} .table-style-1 tr.status-invisible td:first-child{border-left:4px solid #adb5bd; opacity: 0.7;}
    
    /* controls table */
    .table-style-2{width:100%;border-collapse:separate;border-spacing:0;margin:12px 0;font-size:10px;line-height:1.35;background:var(--surface);border:1px solid var(--border);border-radius:10px;overflow:hidden;table-layout:fixed;}
    .table-style-2 thead th{background:var(--bg-table-header);color:var(--text-table-header);text-align:left;padding:8px 12px;font-weight:600;letter-spacing:.2px;border-bottom:1px solid var(--border);white-space:nowrap;}
    .table-style-2 tbody td{padding:8px 12px;border-bottom:1px solid var(--border);color:var(--text-dim);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
    .table-style-2 tbody tr:last-child td{border-bottom:none;}
    .table-style-2 tbody tr:hover td{background:var(--bg-elev);color:var(--text);transition:background .15s ease,color .15s ease;}
    .table-style-2 thead th:first-child{border-top-left-radius:10px;}
    .table-style-2 thead th:last-child{border-top-right-radius:10px;}
    .table-style-2 tbody tr:last-child td:first-child{border-bottom-left-radius:10px;}
    .table-style-2 tbody tr:last-child td:last-child{border-bottom-right-radius:10px;}
    .table-style-2.sticky thead th{position:sticky;top:0;z-index:1;}
    .table-style-2.zebra tbody tr:nth-child(even) td{background:color-mix(in srgb,var(--bg) 90%,transparent);}
    .table-wrap{overflow:auto;max-width:100%;}
    .table-style-2 input[type="text"],.table-style-2 input[type="email"],.table-style-2 input[type="password"],.table-style-2 input[type="date"],.table-style-2 input[type="number"],.table-style-2 input[type="search"],.table-style-2 select,.table-style-2 textarea{font-size:12px;line-height:1.25;padding:6px 8px;height:28px;border-radius:8px;border:1px solid var(--border);background:var(--bg-elev);color:var(--text);transition:background .15s ease,border-color .15s ease,box-shadow .15s ease;}
    .table-style-2 input:focus,.table-style-2 select:focus,.table-style-2 textarea:focus{outline:2px solid var(--accent);outline-offset:2px;box-shadow:0 0 0 3px rgba(10,132,255,.12);}
    
    /* Mobile Responsive */
    @media (max-width:700px){
      .table-style-1 thead { display:none; }
      .table-style-1 tbody tr { display:block; margin-bottom:14px; border:1px solid var(--border); border-radius:10px; overflow:hidden; background:var(--surface); }
      .table-style-1 tbody td { display:flex; justify-content:space-between; padding:12px 16px; font-size:14px; border-bottom:1px solid var(--border); }
      .table-style-1 tbody td:last-child { border-bottom:none; }
      .table-style-1 tbody td::before { content:attr(data-label); font-weight:600; color:var(--text); padding-right:10px; }
    }




.send-form-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  align-items: end;
}

.send-form-grid > * {
  min-width: 0;
}

/* Untere Kontrollzeile: nebeneinander auf großen/mittleren Screens */
.bottom-controls {
  grid-column: span 12;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
}

.control-group {
  flex: 1 1 180px;          /* wachsen & schrumpfen, min. Breite */
  min-width: 160px;
  max-width: 240px;         /* verhindert, dass Vorschau zu breit wird */
}

.button-group {
  flex: 1 1 auto;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  min-width: 220px;         /* Buttons brauchen Platz */
}

.button-group button {
  white-space: nowrap;
  padding: 8px 16px;
}

/* ────────────────────────────────────────────────
   Responsive: Erst ab 768px stapeln wir die Kontrollen
───────────────────────────────────────────────── */
@media (max-width: 768px) {
  .send-form-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .bottom-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .control-group {
    max-width: none;        /* volle Breite auf Mobile */
  }

  .button-group {
    justify-content: stretch;
    margin-top: 8px;
  }

  .button-group button {
    flex: 1;
  }
}

@media (max-width: 480px) {
  .button-group {
    flex-direction: column;
    gap: 10px;
  }

  .button-group button {
    width: 100%;
  }
}

.dup-db,
.dup-csv {
  position: relative;
  background: rgba(0, 0, 0, 0.03);
  transition: background 0.2s ease;
}

.dup-db::before,
.dup-csv::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  transition: width 0.2s ease;
}

.dup-db::before {
  background: linear-gradient(to bottom, #ef4444, #dc2626);
}

.dup-csv::before {
  background: linear-gradient(to bottom, #f59e0b, #d97706);
}

.dup-db:hover::before,
.dup-csv:hover::before {
  width: 6px;
}

.dup-db:hover,
.dup-csv:hover {
  background: rgba(0, 0, 0, 0.06);
}