:root {
  --bg: #f5f3ee;
  --bg-2: #efece5;
  --bg-card: #ffffff;
  --bg-tile-1: #ede8df;
  --bg-tile-2: #f4ddd9;
  --bg-tile-3: #fbe8d8;
  --bg-tile-4: #dde5ec;
  --ink: #1a1a1a;
  --ink-muted: #6b6b6b;
  --ink-soft: #9a9a9a;
  --accent: #d92d2d;
  --accent-soft: #fdebeb;
  --green: #4a7c4e;
  --border: #e5e1d8;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 24px 48px -12px rgba(0,0,0,0.18);
  --radius-lg: 20px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--ink); font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; -webkit-font-smoothing: antialiased; line-height: 1.5; overflow-x: hidden; }
.mono { font-family: 'JetBrains Mono', monospace; }
.container { max-width: 1320px; margin: 0 auto; padding: 0 40px; }
@media (max-width: 720px) { .container { padding: 0 20px; } }
::selection { background: var(--accent); color: white; }

nav { position: sticky; top: 0; background: rgba(245, 243, 238, 0.85); backdrop-filter: saturate(180%) blur(12px); z-index: 50; border-bottom: 1px solid transparent; transition: border-color 0.3s var(--ease); }
nav.scrolled { border-bottom-color: var(--border); }
.nav-inner { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; }
.logo { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.logo-dot { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; animation: pulse 2.4s var(--ease) infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.2); opacity: 0.7; } }
.nav-links { display: flex; gap: 8px; align-items: center; }
.nav-links a { color: var(--ink); text-decoration: none; font-size: 13px; padding: 8px 14px; border-radius: 999px; transition: background 0.15s; }
.nav-links a:hover { background: rgba(0,0,0,0.05); }

.hero { padding: 90px 0 60px; }
.hero-tag { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-muted); margin-bottom: 36px; display: flex; align-items: center; gap: 10px; font-weight: 500; }
.hero-tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.hero h1 { font-weight: 700; font-size: clamp(40px, 7vw, 88px); line-height: 1; letter-spacing: -0.035em; max-width: 1180px; margin-bottom: 32px; }
.hero h1 .accent { color: var(--accent); }
.hero-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 60px; flex-wrap: wrap; }
.hero-lead { font-size: 18px; color: var(--ink-muted); max-width: 580px; line-height: 1.55; }

.btn-pill { display: inline-flex; align-items: center; gap: 10px; border: 1px solid var(--ink); border-radius: 999px; padding: 14px 26px; background: transparent; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--ink); text-decoration: none; transition: all 0.25s var(--ease); font-family: inherit; white-space: nowrap; }
.btn-pill:hover { background: var(--ink); color: var(--bg); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-pill.primary { background: var(--accent); color: white; border-color: var(--accent); }
.btn-pill.primary:hover { background: #c52525; border-color: #c52525; }
.btn-pill .arrow { transition: transform 0.3s var(--ease); }
.btn-pill:hover .arrow { transform: translateX(4px); }

.filter-section { padding-top: 48px; }
.filter-wrap { position: sticky; top: 64px; z-index: 30; padding: 16px 0; background: rgba(245, 243, 238, 0.85); backdrop-filter: saturate(180%) blur(12px); }
.filter-shell { background: white; border: 1px solid var(--border); border-radius: 999px; padding: 6px; display: flex; align-items: center; gap: 4px; box-shadow: var(--shadow-sm); overflow-x: auto; scrollbar-width: none; }
.filter-shell::-webkit-scrollbar { display: none; }
.filter-search { display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 12px; border-right: 1px solid var(--border); margin-right: 4px; flex-shrink: 0; }
.filter-search svg { width: 14px; height: 14px; color: var(--ink-soft); flex-shrink: 0; }
.filter-search input { border: 0; background: transparent; outline: none; font-size: 13px; font-family: inherit; color: var(--ink); width: 140px; padding: 0; }
.filter-search input::placeholder { color: var(--ink-soft); }
.filter-chip { border: 0; background: transparent; border-radius: 999px; padding: 8px 14px; font-size: 13px; color: var(--ink-muted); cursor: pointer; transition: all 0.2s var(--ease); font-family: inherit; white-space: nowrap; display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.filter-chip:hover { color: var(--ink); background: var(--bg); }
.filter-chip.active { background: var(--ink); color: white; }
.filter-chip .count { opacity: 0.5; font-size: 11px; font-family: 'JetBrains Mono', monospace; }
.filter-chip.active .count { opacity: 0.7; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding: 32px 0 80px; }
@media (max-width: 1024px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } }

.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; cursor: pointer; transition: all 0.4s var(--ease-out); display: flex; flex-direction: column; position: relative; opacity: 0; animation: cardIn 0.6s var(--ease-out) forwards; }
@keyframes cardIn { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--ink); }
.card-preview { aspect-ratio: 16/10; position: relative; overflow: hidden; background: var(--bg-tile-1); border-bottom: 1px solid var(--border); }
.card-preview iframe { width: 250%; height: 250%; border: 0; transform: scale(0.4); transform-origin: 0 0; pointer-events: none; background: white; transition: transform 0.6s var(--ease-out); }
.card:hover .card-preview iframe { transform: scale(0.42); }
.card-preview-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 50%, rgba(0,0,0,0.08) 100%); pointer-events: none; opacity: 0; transition: opacity 0.3s var(--ease); }
.card:hover .card-preview-overlay { opacity: 1; }
.card-play { position: absolute; bottom: 14px; right: 14px; width: 40px; height: 40px; background: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--ink); box-shadow: var(--shadow-md); opacity: 0; transform: translateY(8px) scale(0.85); transition: all 0.3s var(--ease-out); pointer-events: none; z-index: 2; }
.card:hover .card-play { opacity: 1; transform: translateY(0) scale(1); }
.card-play svg { width: 14px; height: 14px; margin-left: 2px; }
.card-tag { position: absolute; top: 14px; left: 14px; background: rgba(255,255,255,0.95); backdrop-filter: blur(8px); border-radius: 999px; padding: 6px 12px; font-family: 'JetBrains Mono', monospace; font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink); font-weight: 500; z-index: 2; box-shadow: var(--shadow-sm); }
.card-actions-hover { position: absolute; top: 14px; right: 14px; display: flex; gap: 6px; opacity: 0; transform: translateY(-4px); transition: all 0.25s var(--ease); z-index: 2; }
.card:hover .card-actions-hover { opacity: 1; transform: translateY(0); }
.card-action { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,0.95); backdrop-filter: blur(8px); border: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm); transition: all 0.15s; color: var(--ink); padding: 0; }
.card-action:hover { background: white; transform: scale(1.08); }
.card-action.del:hover { background: var(--accent); color: white; }
.card-action.edit:hover { background: var(--ink); color: white; }
.card-action svg { width: 14px; height: 14px; }
.card-body { padding: 24px 24px 22px; flex: 1; display: flex; flex-direction: column; }
.card-title { font-size: 19px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; margin-bottom: 10px; color: var(--ink); }
.card-desc { font-size: 14px; color: var(--ink-muted); line-height: 1.55; margin-bottom: 20px; flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 16px; border-top: 1px solid var(--border); gap: 12px; }
.card-tags { font-family: 'JetBrains Mono', monospace; font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-muted); display: flex; align-items: center; gap: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.card-tags::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.card-link { font-size: 13px; color: var(--ink); display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; transition: gap 0.2s var(--ease); }
.card:hover .card-link { gap: 8px; }

.empty { grid-column: 1 / -1; text-align: center; padding: 100px 20px; }
.empty-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--bg-card); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; color: var(--ink-soft); }
.empty h3 { font-size: 22px; font-weight: 600; margin-bottom: 8px; letter-spacing: -0.01em; }
.empty p { color: var(--ink-muted); font-size: 14px; margin-bottom: 20px; }

.modal-overlay { position: fixed; inset: 0; background: rgba(20,20,20,0.55); backdrop-filter: blur(6px); z-index: 100; display: none; align-items: center; justify-content: center; padding: 24px; opacity: 0; transition: opacity 0.25s var(--ease); }
.modal-overlay.active { display: flex; opacity: 1; }
.modal { background: var(--bg-card); border-radius: var(--radius-lg); width: 100%; max-width: 480px; padding: 36px; position: relative; box-shadow: var(--shadow-lg); transform: translateY(16px) scale(0.98); transition: transform 0.35s var(--ease-out); max-height: 90vh; overflow-y: auto; }
.modal-overlay.active .modal { transform: translateY(0) scale(1); }
.modal-large { max-width: 1280px; height: 92vh; padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.modal-close { position: absolute; top: 16px; right: 16px; background: var(--bg-2); border: 0; border-radius: 50%; width: 36px; height: 36px; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--ink); transition: all 0.15s; z-index: 10; }
.modal-close:hover { background: var(--ink); color: var(--bg); }
.modal-close svg { width: 16px; height: 16px; }
.modal-eyebrow { font-family: 'JetBrains Mono', monospace; font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-muted); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.modal-eyebrow::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.modal h2 { font-size: 28px; font-weight: 700; letter-spacing: -0.025em; margin-bottom: 8px; line-height: 1.1; }
.modal-sub { color: var(--ink-muted); font-size: 14px; margin-bottom: 28px; line-height: 1.5; }

.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-family: 'JetBrains Mono', monospace; font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-muted); margin-bottom: 8px; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea { width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; font-size: 14px; font-family: inherit; background: var(--bg); color: var(--ink); transition: all 0.15s; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--ink); background: white; }
.form-group textarea { resize: vertical; min-height: 90px; }
.form-group textarea.code { font-family: 'JetBrains Mono', monospace; font-size: 12px; min-height: 140px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.btn-block { width: 100%; padding: 14px; font-size: 15px; font-weight: 500; cursor: pointer; border-radius: 999px; transition: all 0.2s var(--ease); font-family: inherit; display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; }
.btn-block.primary { background: var(--accent); color: white; }
.btn-block.primary:hover { background: #c52525; transform: translateY(-1px); box-shadow: 0 8px 20px -8px rgba(217,45,45,0.5); }

.file-drop { border: 1.5px dashed var(--border); border-radius: 12px; padding: 28px 20px; text-align: center; cursor: pointer; transition: all 0.2s var(--ease); background: var(--bg); display: block; }
.file-drop:hover { border-color: var(--ink); background: var(--bg-2); }
.file-drop.drag { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.01); }
.file-drop input { display: none; }
.file-drop-icon { width: 36px; height: 36px; margin: 0 auto 10px; color: var(--ink-soft); }
.file-drop-text { font-size: 13px; color: var(--ink-muted); }
.file-drop-text strong { color: var(--ink); font-weight: 600; }
.file-drop-meta { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--ink-soft); margin-top: 6px; text-transform: uppercase; letter-spacing: 0.08em; }
.file-success { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 13px; }
.file-success-icon { width: 20px; height: 20px; background: var(--green); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; flex-shrink: 0; }
.file-success-icon svg { width: 12px; height: 12px; }
.file-success-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-success-clear { background: transparent; border: 0; cursor: pointer; color: var(--ink-soft); padding: 4px; display: flex; }
.file-success-clear:hover { color: var(--accent); }

.toggle-row { display: flex; gap: 4px; background: var(--bg); border-radius: 10px; padding: 4px; margin-bottom: 12px; }
.toggle-row button { flex: 1; padding: 9px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; font-size: 12px; color: var(--ink-muted); transition: all 0.2s var(--ease); font-family: inherit; font-weight: 500; }
.toggle-row button.active { background: white; color: var(--ink); box-shadow: var(--shadow-sm); }

.modal-large-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: var(--bg-card); flex-shrink: 0; gap: 12px; }
.viewer-meta { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.viewer-cat { font-family: 'JetBrains Mono', monospace; font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-muted); background: var(--bg); padding: 5px 10px; border-radius: 999px; flex-shrink: 0; }
.viewer-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-actions { display: flex; gap: 6px; align-items: center; }
.device-toggle { display: flex; background: var(--bg); border-radius: 999px; padding: 3px; gap: 2px; }
.device-btn { border: 0; background: transparent; border-radius: 999px; width: 32px; height: 28px; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--ink-muted); transition: all 0.2s var(--ease); }
.device-btn:hover { color: var(--ink); }
.device-btn.active { background: white; color: var(--ink); box-shadow: var(--shadow-sm); }
.device-btn svg { width: 14px; height: 14px; }
.viewer-btn { background: transparent; border: 1px solid var(--border); border-radius: 999px; padding: 7px 12px; font-size: 12px; cursor: pointer; color: var(--ink); transition: all 0.15s; display: flex; align-items: center; gap: 6px; font-family: inherit; }
.viewer-btn:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.viewer-btn svg { width: 13px; height: 13px; }
@media (max-width: 720px) { .viewer-btn span { display: none; } .viewer-btn { padding: 7px 10px; } }
.modal-large-body { flex: 1; overflow: hidden; background: var(--bg-2); display: flex; align-items: center; justify-content: center; padding: 0; transition: padding 0.3s var(--ease); }
.modal-large-body.tablet, .modal-large-body.mobile { padding: 24px; }
.viewer-frame-wrap { width: 100%; height: 100%; transition: all 0.4s var(--ease-out); background: white; overflow: hidden; }
.viewer-frame-wrap.tablet { width: 820px; height: min(100%, 1100px); max-height: 100%; border-radius: 16px; box-shadow: var(--shadow-lg); }
.viewer-frame-wrap.mobile { width: 390px; height: min(100%, 800px); max-height: 100%; border-radius: 28px; box-shadow: var(--shadow-lg); }
.modal-large-body iframe { width: 100%; height: 100%; border: 0; }
.viewer-fullscreen { position: fixed !important; inset: 0 !important; height: 100vh !important; max-width: none !important; border-radius: 0 !important; z-index: 200 !important; }

.admin-bar { background: var(--ink); color: var(--bg); padding: 10px 0; font-size: 13px; position: sticky; top: 0; z-index: 60; }
.admin-bar-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.admin-bar .badge { font-family: 'JetBrains Mono', monospace; font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; display: flex; align-items: center; gap: 8px; }
.admin-bar .badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 0 rgba(74,222,128,0.6); animation: ping 1.6s var(--ease) infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(74,222,128,0.6); } 100% { box-shadow: 0 0 0 8px rgba(74,222,128,0); } }
.admin-actions { display: flex; gap: 8px; }
.admin-actions button { background: transparent; color: var(--bg); border: 1px solid rgba(255,255,255,0.25); border-radius: 999px; padding: 6px 14px; font-size: 12px; cursor: pointer; font-family: inherit; transition: all 0.15s; display: flex; align-items: center; gap: 6px; }
.admin-actions button:hover { background: white; color: var(--ink); border-color: white; }

footer { border-top: 1px solid var(--border); padding: 40px 0; margin-top: 60px; }
.foot-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.foot-left { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-muted); }
.foot-status { font-family: 'JetBrains Mono', monospace; font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-muted); display: flex; align-items: center; gap: 8px; }
.foot-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-soft); }

.toast-wrap { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 250; pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 999px; font-size: 13px; box-shadow: var(--shadow-lg); transform: translateY(20px); opacity: 0; transition: all 0.35s var(--ease-out); display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--accent); }
.toast-dot { width: 6px; height: 6px; border-radius: 50%; background: #4ade80; }
.toast.error .toast-dot { background: white; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.3); }




/* ============ Drag & Drop ============ */
.card.draggable { cursor: grab; }
.card.draggable:active { cursor: grabbing; }
.card.dragging { opacity: 0.4; transform: scale(0.98); }
.card.drag-over { box-shadow: 0 0 0 2px var(--accent), var(--shadow-lg); border-color: var(--accent); }

.drag-handle {
  position: absolute;
  top: 14px;
  right: 96px;  /* links neben Edit/Delete-Buttons */
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateY(-4px);
  transition: all 0.25s var(--ease);
  cursor: grab;
  z-index: 2;
}
.card:hover .drag-handle { opacity: 1; transform: translateY(0); }
.drag-handle:hover { color: var(--ink); background: white; }
.drag-handle svg { width: 14px; height: 14px; }