/* =========================================================
   QR Studio – style.css
   Design: Cyberpunk Dark Mode | Neon Glow | Glassmorphism | iOS Feel
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* ── Design Tokens ─────────────────────────────────────── */
:root {
  --font-family:    'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Neon Akzente (aus Systemprompt) */
  --neon-purple:    #a855f7;
  --neon-pink:      #ec4899;
  --neon-cyan:      #00e5ff;
  --neon-red:       #ef4444;
  --neon-glow:      rgba(236, 72, 153, 0.35);

  --neon-violet:    #7b2fff;
  --neon-blue:      #00b4ff;
  --neon-magenta:   #d400ff;

  /* Hintergründe & Oberflächen */
  --bg-core:        #07070a;
  --bg-primary:     #07070a;
  --bg-surface:     rgba(18, 16, 26, 0.72);
  --bg-surface-elevated: rgba(28, 24, 42, 0.82);
  --bg-surface-hover:   rgba(40, 34, 60, 0.88);
  --bg-sidebar:     rgba(14, 10, 24, 0.78);
  --bg-panel:       rgba(255, 255, 255, 0.04);
  --bg-panel-hover: rgba(255, 255, 255, 0.08);
  --bg-input:       rgba(255, 255, 255, 0.06);

  /* Borders & Glassmorphism */
  --border:         rgba(255, 255, 255, 0.10);
  --border-bright:  rgba(255, 255, 255, 0.22);
  --border-glow:    rgba(168, 85, 247, 0.5);
  --glass-blur:     blur(24px) saturate(170%);

  /* Texte */
  --text-primary:   #ffffff;
  --text-secondary: rgba(240, 240, 255, 0.72);
  --text-muted:     rgba(240, 240, 255, 0.45);

  /* Radien & Schatten */
  --radius-xs:      6px;
  --radius-sm:      10px;
  --radius-md:      16px;
  --radius-lg:      24px;
  --radius-xl:      28px;
  --radius-pill:    9999px;

  --shadow-sm:      0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-hover:   0 12px 32px rgba(236, 72, 153, 0.25);

  --transition:     0.22s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow:0.38s cubic-bezier(0.16, 1, 0.3, 1);

  --sidebar-width:  460px;
  --header-h:       68px;
}

/* Dynamischer Hellmodus */
@media (prefers-color-scheme: light) {
  :root {
    --bg-core:        #f5f6fa;
    --bg-primary:     #f5f6fa;
    --bg-surface:     rgba(255, 255, 255, 0.78);
    --bg-surface-elevated: rgba(255, 255, 255, 0.92);
    --bg-surface-hover:   rgba(255, 255, 255, 0.98);
    --bg-sidebar:     rgba(245, 246, 250, 0.85);
    --bg-panel:       rgba(255, 255, 255, 0.75);
    --bg-panel-hover: rgba(255, 255, 255, 0.92);
    --bg-input:       rgba(0, 0, 0, 0.05);

    --border:         rgba(0, 0, 0, 0.08);
    --border-bright:  rgba(0, 0, 0, 0.16);
    --border-glow:    rgba(139, 92, 246, 0.35);
    --glass-blur:     blur(24px) saturate(150%);

    --neon-purple:    #8b5cf6;
    --neon-pink:      #db2777;
    --neon-cyan:      #0284c7;
    --neon-red:       #dc2626;
    --neon-glow:      rgba(219, 39, 119, 0.2);

    --text-primary:   #0f172a;
    --text-secondary: #334155;
    --text-muted:     #64748b;

    --shadow-sm:      0 4px 16px rgba(0, 0, 0, 0.06);
    --shadow-hover:   0 12px 32px rgba(219, 39, 119, 0.18);
  }
}

/* ── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark light;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  background: var(--bg-core);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

/* ── Ambient Background (Glowing Blobs & Dot Grid aus Systemprompt) ── */
.glow-bg {
  position: fixed;
  inset: 0;
  background-color: var(--bg-core);
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  mix-blend-mode: screen;
  filter: blur(110px);
  opacity: 0.22;
  pointer-events: none;
}
@media (prefers-color-scheme: light) {
  .blob {
    mix-blend-mode: multiply;
    opacity: 0.14;
  }
}

.blob-purple {
  background-color: var(--neon-purple);
  top: -10%;
  left: -5%;
  animation: move-purple 16s infinite alternate ease-in-out;
}
.blob-pink {
  background-color: var(--neon-pink);
  bottom: -10%;
  right: -5%;
  animation: move-pink 14s infinite alternate ease-in-out;
}
.blob-cyan {
  background-color: var(--neon-cyan);
  top: 40%;
  left: 25%;
  animation: move-cyan 18s infinite alternate ease-in-out;
}

.dot-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(217, 191, 255, 0.15) 0.7px, transparent 0.7px);
  background-size: 24px 24px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent 85%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent 85%);
}
@media (prefers-color-scheme: light) {
  .dot-grid {
    background-image: radial-gradient(rgba(100, 116, 139, 0.18) 0.7px, transparent 0.7px);
  }
}

@keyframes move-purple {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(100px, 70px, 0) scale(1.18); }
  100% { transform: translate3d(-50px, 120px, 0) scale(0.92); }
}
@keyframes move-pink {
  0%   { transform: translate3d(0, 0, 0) scale(0.95); }
  50%  { transform: translate3d(-120px, -70px, 0) scale(1.22); }
  100% { transform: translate3d(70px, 50px, 0) scale(1.08); }
}
@keyframes move-cyan {
  0%   { transform: translate3d(0, 0, 0) scale(1.1); }
  50%  { transform: translate3d(-70px, 90px, 0) scale(0.88); }
  100% { transform: translate3d(80px, -80px, 0) scale(1.15); }
}

/* ── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(123, 47, 255, 0.4);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--neon-pink);
}

/* ── Header ────────────────────────────────────────────── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--bg-surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition-smooth), border-color var(--transition-smooth);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* 1. Plattform-Logo (oben links) */
.platform-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: transform var(--transition);
}
.platform-brand:hover {
  transform: scale(1.06);
}
.platform-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 8px;
}

.header-divider {
  width: 1px;
  height: 24px;
  background: var(--border-bright);
}

/* 2. Spezifisches App-Icon & Titel */
.app-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.45);
  transition: transform var(--transition);
}
.app-identity:hover .app-logo {
  transform: scale(1.05) rotate(4deg);
}

.app-title-group {
  display: flex;
  flex-direction: column;
}

.app-title {
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(90deg, #ffffff 0%, #ff6eb4 45%, #00f5ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.4px;
  line-height: 1.15;
}
@media (prefers-color-scheme: light) {
  .app-title {
    background: linear-gradient(90deg, #0f172a 0%, #db2777 50%, #0284c7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
}

.app-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Desktop Navigation (nur sichtbar ab 601px) */
.desktop-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hdr-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  transition: all var(--transition);
}
.hdr-btn:hover {
  background: var(--bg-panel-hover);
  color: var(--text-primary);
  border-color: var(--border-glow);
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.2);
}
.hdr-btn-icon {
  font-size: 14px;
}

.header-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--neon-cyan);
  border: 1px solid rgba(0, 245, 255, 0.35);
  padding: 5px 12px;
  border-radius: 20px;
  background: rgba(0, 245, 255, 0.07);
  letter-spacing: 0.5px;
}

/* Mobile Hamburger Button (nur sichtbar bis 600px) */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 8px;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.hamburger-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition);
}
.hamburger-btn:hover {
  background: var(--bg-panel-hover);
  border-color: var(--border-glow);
}

/* ── App Layout ────────────────────────────────────────── */
.app-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  align-items: start;
  min-height: calc(100vh - var(--header-h));
}

/* ── Sidebar / Accordion Column ────────────────────────── */
.sidebar {
  width: 100%;
  border-right: 1px solid var(--border);
  background: var(--bg-sidebar);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 24px 20px 80px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Accordion Section (Abschnitt 1, 2, 3) ─────────────── */
.accordion-sec {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.accordion-sec:hover {
  border-color: rgba(123, 47, 255, 0.35);
}
.accordion-sec.open {
  border-color: rgba(123, 47, 255, 0.45);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  cursor: pointer;
  user-select: none;
  background: rgba(255, 255, 255, 0.015);
  transition: background var(--transition);
  gap: 12px;
}
.accordion-header:hover {
  background: var(--bg-panel-hover);
}

.accordion-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sec-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--neon-violet), var(--neon-pink));
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(123, 47, 255, 0.4);
}

.sec-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.sec-icon.pink   { background: rgba(255, 45, 155, 0.15); border: 1px solid rgba(255, 45, 155, 0.25); }
.sec-icon.violet { background: rgba(123, 47, 255, 0.15); border: 1px solid rgba(123, 47, 255, 0.25); }
.sec-icon.cyan   { background: rgba(0, 245, 255, 0.15);  border: 1px solid rgba(0, 245, 255, 0.25); }

.sec-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.1px;
  line-height: 1.2;
}

.sec-desc {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

.accordion-chevron {
  color: var(--text-secondary);
  font-size: 14px;
  transition: transform var(--transition);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.accordion-sec.open .accordion-chevron {
  transform: rotate(180deg);
}

.accordion-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.accordion-sec.collapsed .accordion-body {
  display: none;
}

/* ── Sub-Groups inside Sections ────────────────────────── */
.sub-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sub-group-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.collapsible-sub {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

/* ── Form Elements ─────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.7px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  padding: 11px 14px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  appearance: none;
  -webkit-appearance: none;
  line-height: 1.4;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--neon-violet);
  box-shadow: 0 0 0 3px rgba(123, 47, 255, 0.2);
  background: rgba(123, 47, 255, 0.08);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23a392c7' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}

.form-select option {
  background: #140228;
  color: var(--text-primary);
}

/* ── Dynamic Fields Container ──────────────────────────── */
.dynamic-fields-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Color Swatches & Hex ──────────────────────────────── */
.color-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-swatch {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  overflow: hidden;
  flex-shrink: 0;
  padding: 0;
  background: none;
  transition: border-color var(--transition), transform var(--transition);
}
.color-swatch:hover {
  border-color: var(--neon-violet);
  transform: scale(1.05);
}
.color-swatch input[type="color"] {
  width: 120%;
  height: 120%;
  margin: -10%;
  border: none;
  padding: 0;
  cursor: pointer;
  background: none;
}

.color-hex {
  flex: 1;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  letter-spacing: 0.5px;
}

/* ── Toggles ───────────────────────────────────────────── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.toggle-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  flex: 1;
}

.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-track {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition);
  border: 1px solid var(--border);
}

.toggle input:checked + .toggle-track {
  background: linear-gradient(90deg, var(--neon-violet), var(--neon-pink));
  border-color: transparent;
  box-shadow: 0 0 12px rgba(123, 47, 255, 0.5);
}

.toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.toggle input:checked + .toggle-track::after {
  transform: translateX(20px);
}

/* ── Segmented Control ─────────────────────────────────── */
.segmented {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 4px;
}

.segmented-btn {
  flex: 1;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  white-space: nowrap;
}

.segmented-btn.active {
  background: linear-gradient(135deg, var(--neon-violet), var(--neon-pink));
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(123, 47, 255, 0.4);
}

.segmented-btn:hover:not(.active) {
  color: var(--text-secondary);
  background: var(--bg-panel-hover);
}

/* ── Theme Presets Grid ────────────────────────────────── */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.theme-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 6px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  color: var(--text-secondary);
}

.theme-btn:hover {
  border-color: rgba(123, 47, 255, 0.4);
  transform: translateY(-2px);
  background: var(--bg-panel-hover);
}

.theme-btn.active {
  border-color: var(--neon-pink);
  background: rgba(255, 45, 155, 0.12);
  box-shadow: 0 0 16px rgba(255, 45, 155, 0.3);
  color: #ffffff;
}

.theme-icon {
  font-size: 18px;
  line-height: 1;
}
.theme-name {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Upload Dropzone Area ──────────────────────────────── */
.upload-area {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-input);
  position: relative;
  overflow: hidden;
}
.upload-area:hover {
  border-color: var(--neon-violet);
  background: rgba(123, 47, 255, 0.08);
}
.upload-area.has-image {
  border-style: solid;
  border-color: var(--neon-pink);
  background: rgba(255, 45, 155, 0.06);
}
.upload-icon {
  font-size: 24px;
  margin-bottom: 4px;
}
.upload-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}
.upload-hint {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 3px;
}
.upload-preview {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: var(--radius-xs);
  margin: 0 auto 6px;
  display: block;
}
.upload-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  background: rgba(255, 45, 155, 0.85);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.upload-remove:hover {
  background: var(--neon-pink);
}

/* ── Range Slider ──────────────────────────────────────── */
.range-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.range-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--neon-cyan);
  min-width: 44px;
  text-align: right;
  font-family: 'Courier New', monospace;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--neon-violet), var(--neon-pink));
  box-shadow: 0 0 10px rgba(123, 47, 255, 0.6);
  cursor: pointer;
  transition: transform var(--transition);
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* ── Gradient Preview Strip ────────────────────────────── */
.gradient-preview {
  height: 26px;
  border-radius: var(--radius-xs);
  transition: all var(--transition);
  border: 1px solid var(--border);
  margin-top: 2px;
}

/* ── Buttons & Export Grid ─────────────────────────────── */
.export-buttons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 16px;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  user-select: none;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-primary {
  background: linear-gradient(135deg, var(--neon-violet) 0%, var(--neon-pink) 100%);
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(123, 47, 255, 0.35);
  grid-column: 1 / -1;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(255, 45, 155, 0.45);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-panel);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  border-color: rgba(123, 47, 255, 0.4);
  color: var(--text-primary);
  background: var(--bg-panel-hover);
  transform: translateY(-1px);
}

.btn-copy {
  background: rgba(0, 245, 255, 0.08);
  color: var(--neon-cyan);
  border: 1px solid rgba(0, 245, 255, 0.25);
  grid-column: 1 / -1;
}
.btn-copy:hover {
  background: rgba(0, 245, 255, 0.16);
  border-color: rgba(0, 245, 255, 0.5);
  box-shadow: 0 0 20px rgba(0, 245, 255, 0.2);
}

.btn-icon {
  font-size: 15px;
}

/* ── Divider & Info Hints ──────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 2px 0;
}

.info-hint {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.025);
  border-radius: var(--radius-xs);
  border-left: 2px solid var(--neon-violet);
}

/* ══════════════════════════════════════════════════════════
   MAIN LIVE PREVIEW AREA (Sticky Desktop, Stacked Mobile)
══════════════════════════════════════════════════════════ */
.main-area {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 28px;
  gap: 20px;
  overflow-y: auto;
}

.mobile-preview-bar {
  display: none;
}

.preview-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: 460px;
  position: relative;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.preview-card-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.preview-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.preview-header-badges {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-badge-status {
  font-size: 10px;
  font-weight: 700;
  color: #00ffaa;
  background: rgba(0, 255, 170, 0.1);
  border: 1px solid rgba(0, 255, 170, 0.3);
  padding: 3px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.preview-badge-status.scan-good {
  color: #00ffaa;
  background: rgba(0, 255, 170, 0.12);
  border-color: rgba(0, 255, 170, 0.35);
  box-shadow: 0 0 10px rgba(0, 255, 170, 0.2);
}

.preview-badge-status.scan-opt {
  color: #00f5ff;
  background: rgba(0, 245, 255, 0.12);
  border-color: rgba(0, 245, 255, 0.35);
  box-shadow: 0 0 10px rgba(0, 245, 255, 0.2);
}

.preview-badge-status.scan-dense {
  color: #ffaa00;
  background: rgba(255, 170, 0, 0.12);
  border-color: rgba(255, 170, 0, 0.35);
  box-shadow: 0 0 10px rgba(255, 170, 0, 0.2);
}

.preview-canvas-wrapper {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow:
    0 0 40px rgba(123, 47, 255, 0.25),
    0 20px 60px rgba(0, 0, 0, 0.6);
  background: rgba(0, 0, 0, 0.3);
  transition: transform var(--transition);
}

#preview-canvas {
  display: block;
  max-width: 300px;
  max-height: 300px;
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}

.preview-empty {
  width: 280px;
  height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
}
.preview-empty-icon {
  font-size: 44px;
  opacity: 0.4;
}
.preview-empty-text {
  font-size: 13px;
  opacity: 0.6;
}

.preview-quick-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding-top: 4px;
}

/* ── Toast Notification ────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(90px);
  background: rgba(18, 5, 34, 0.96);
  border: 1px solid var(--border-glow);
  color: var(--text-primary);
  padding: 13px 24px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 9999;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s;
  opacity: 0;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 25px rgba(123, 47, 255, 0.3);
  backdrop-filter: blur(16px);
  pointer-events: none;
  white-space: nowrap;
}
.toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ── iOS / Mobile Save Image Modal ─────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 0, 10, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #110224;
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-xl);
  padding: 24px;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(123, 47, 255, 0.3);
  transform: scale(0.95);
  transition: transform var(--transition);
}
.modal-overlay.visible .modal-card {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}
.modal-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
}
.modal-close:hover {
  background: rgba(255, 45, 155, 0.6);
  color: #ffffff;
}

.modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.modal-preview-img {
  max-width: 240px;
  max-height: 240px;
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  user-select: auto;
  -webkit-user-select: auto;
  -webkit-touch-callout: default;
}

.modal-instructions {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  text-align: center;
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--neon-cyan);
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 4px;
}

/* ── Dynamic Island (Status & Feedback Pill aus Systemprompt) ── */
.dynamic-island-container {
  position: fixed;
  top: 14px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 10001;
  pointer-events: none;
}

.dynamic-island {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(10, 5, 20, 0.92);
  border: 1px solid var(--border-glow);
  color: #ffffff;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.7), 0 0 20px rgba(168, 85, 247, 0.35);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transform: translateY(-80px) scale(0.9);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
  pointer-events: auto;
  max-width: 90vw;
}
@media (prefers-color-scheme: light) {
  .dynamic-island {
    background: rgba(255, 255, 255, 0.95);
    color: #0f172a;
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.15), 0 0 20px rgba(219, 39, 119, 0.2);
  }
}
.dynamic-island.expanded {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.island-icon {
  font-size: 16px;
  display: flex;
  align-items: center;
}

.island-text {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

/* ── Swipe Edge Indikator (Nur mobil bis 600px sichtbar) ── */
.swipe-edge {
  display: none;
  position: fixed;
  top: 40%;
  right: 0;
  width: 4px;
  height: 60px;
  background: linear-gradient(to bottom, transparent, var(--neon-pink), transparent);
  border-radius: 4px 0 0 4px;
  opacity: 0.6;
  z-index: 150;
  pointer-events: none;
}

/* ── Slide-Out Backdrop & Panel (aus Systemprompt) ── */
.panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(0, 0, 0, 0.65);
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.panel-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.settings-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(340px, 86vw);
  background: var(--bg-surface-elevated);
  border-left: 1px solid var(--border-bright);
  z-index: 401;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.6);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}
.settings-panel.open {
  transform: translateX(0);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 20px 16px;
  border-bottom: 1px solid var(--border);
}

.panel-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 6px;
}

.panel-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.panel-close {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.panel-close:hover {
  background: var(--neon-pink);
  color: #ffffff;
  border-color: var(--neon-pink);
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.menu-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.menu-section-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
}

.menu-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.menu-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
}
.menu-link:hover, .menu-link.active {
  background: var(--bg-panel-hover);
  border-color: var(--border-glow);
  color: var(--neon-pink);
}

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

/* ── Scroll-Animationen (aus Systemprompt) ── */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1), 
              transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-on-scroll.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE DESIGN (Tablets & Mobile Phones)
══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  :root {
    --header-h: 62px;
  }

  .app-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 18px 14px 28px;
  }

  .main-area {
    position: static;
    height: auto;
    padding: 24px 14px 60px;
    justify-content: flex-start;
  }

  .mobile-preview-bar {
    display: block;
    width: 100%;
    max-width: 460px;
  }
  .mobile-preview-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(236, 72, 153, 0.15));
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
  }

  #preview-canvas {
    max-width: 260px;
    max-height: 260px;
  }

  .theme-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .form-input,
  .form-select,
  .form-textarea,
  input[type="text"],
  input[type="url"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  input[type="datetime-local"] {
    font-size: 16px !important;
  }

  .header-badge {
    display: none;
  }
}

/* ── Mobile Viewport Spezifikationen (<= 600px nach Systemprompt) ── */
@media (max-width: 600px) {
  .app-header {
    padding: 0 16px;
  }

  .desktop-nav {
    display: none;
  }

  .hamburger-btn {
    display: flex;
  }

  .swipe-edge {
    display: block;
  }

  .app-subtitle {
    display: none;
  }
  
  .hdr-btn-text {
    display: none;
  }
}

@media (max-width: 480px) {
  .app-title {
    font-size: 17px;
  }

  .header-divider {
    display: none;
  }

  .platform-logo {
    width: 28px;
    height: 28px;
  }

  .app-logo {
    width: 30px;
    height: 30px;
  }

  .hdr-btn {
    padding: 6px 8px;
  }

  .export-buttons-grid {
    grid-template-columns: 1fr;
  }

  .theme-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
