[hidden] { display: none !important; }
:root {
  --bg: #0f1214;
  --panel: #171b1e;
  --panel-2: #1e2327;
  --line: #2a3035;
  --text: #e8ecee;
  --muted: #8b959c;
  --accent: #22c55e;
  --accent-ink: #052e14;
  --c-blur: #22c55e;
  --c-masked: #f5b301;
  --c-player: #38bdf8;
  --c-off: #9aa3a9;
  --c-manual: #e879f9;
  --danger: #f87171;
  --radius: 10px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.45 "Segoe UI", system-ui, -apple-system, sans-serif;
}
button, input { font: inherit; color: inherit; }

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 22px; border-bottom: 1px solid var(--line); background: var(--panel);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand h1 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: .1px; }
.brand p { margin: 1px 0 0; color: var(--muted); font-size: 12.5px; }
.logo {
  width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 0 38%, color-mix(in srgb, var(--accent) 35%, transparent) 62%, transparent 72%);
  filter: blur(.4px);
}
.engine { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.engine.ok::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 7px; vertical-align: 1px; }
.engine.err { color: var(--danger); }

.layout { display: grid; grid-template-columns: 290px 1fr; min-height: calc(100% - 62px); }
.side { border-right: 1px solid var(--line); padding: 8px 18px 24px; background: var(--panel); }
.side section { padding: 14px 0; border-bottom: 1px solid var(--line); }
.side section:last-child { border-bottom: 0; }
.side h2 { margin: 0 0 10px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .9px; color: var(--muted); font-weight: 600; }
.lbl { display: flex; justify-content: space-between; margin: 10px 0 6px; font-weight: 550; }
.lbl output { color: var(--muted); font-weight: 400; }
.hint { color: var(--muted); font-size: 12px; margin: 6px 0 0; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.check { display: flex; gap: 9px; align-items: flex-start; margin: 8px 0; cursor: pointer; }
.check input { accent-color: var(--accent); margin-top: 3px; width: 15px; height: 15px; }
.row { display: flex; gap: 8px; margin-top: 8px; }
input[type=text] {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 7px;
  padding: 7px 9px; font-size: 12.5px;
}
input[type=text]:focus { outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); border-color: transparent; }

.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.side .seg { display: flex; }
.seg button { flex: 1; border: 0; background: none; padding: 6px 11px; border-radius: 6px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--panel-2); color: var(--text); box-shadow: 0 0 0 1px var(--line); }

.legend div { display: flex; align-items: center; gap: 9px; margin: 6px 0; color: var(--muted); }
.lg { width: 16px; height: 12px; border-radius: 50%; border: 2px solid; display: inline-block; }
.lg.blur { border-color: var(--c-blur); }
.lg.masked { border-color: var(--c-masked); border-style: dashed; }
.lg.player { border-color: var(--c-player); border-style: dashed; }
.lg.off { border-color: var(--c-off); border-style: dotted; }
.lg.manual { border-color: var(--c-manual); }

.btn {
  border: 1px solid var(--line); background: var(--panel-2); padding: 8px 14px; border-radius: 8px;
  cursor: pointer; font-weight: 550; white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: #3a4248; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.small { padding: 5px 10px; font-size: 12.5px; }
.btn.icon { width: 34px; padding: 6px 0; font-size: 18px; line-height: 1; }
.btn.toggle.on { border-color: var(--accent); color: var(--accent); }

.main { padding: 22px; min-width: 0; }
.drop {
  display: block; border: 1.5px dashed #3a4248; border-radius: 14px; padding: 30px 20px;
  text-align: center; cursor: pointer; transition: .15s; background: var(--panel);
}
.drop:hover, .drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--panel)); }
.drop-inner { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); }
.drop-inner strong { color: var(--text); font-size: 15px; }
.drop.compact { padding: 14px; }
.drop.compact svg { display: none; }

.toolbar { display: flex; align-items: center; gap: 10px; margin: 18px 0 14px; flex-wrap: wrap; }
.status { color: var(--muted); }
.spacer { flex: 1; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
}
.card .thumb { position: relative; aspect-ratio: 3 / 2; background: #0a0c0d; cursor: zoom-in; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .badge {
  position: absolute; left: 8px; top: 8px; background: rgb(0 0 0 / .65); backdrop-filter: blur(6px);
  padding: 3px 8px; border-radius: 99px; font-size: 11.5px;
}
.card .badge.done { color: var(--accent); }
.card .badge.err { color: var(--danger); }
.card .bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); transition: width .2s; }
.card .meta { padding: 9px 11px 10px; }
.card .name { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .counts { color: var(--muted); font-size: 12px; margin-top: 2px; min-height: 18px; }
.card .actions { display: flex; gap: 6px; margin-top: 8px; }
.card .actions .btn { padding: 4px 9px; font-size: 12px; }
.card .actions .x { margin-left: auto; color: var(--muted); }

.editor { position: fixed; inset: 0; background: #08090a; display: flex; flex-direction: column; z-index: 10; }
.ed-bar {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px; background: var(--panel);
  border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.ed-title { display: flex; flex-direction: column; min-width: 0; max-width: 32vw; }
.ed-title strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-title span { color: var(--muted); font-size: 12px; }
.ed-view { position: relative; flex: 1; overflow: hidden; cursor: grab; touch-action: none; }
.ed-view.panning { cursor: grabbing; }
.ed-view.adding { cursor: crosshair; }
.stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.stage canvas { position: absolute; left: 0; top: 0; image-rendering: auto; }
.ed-hint {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  background: rgb(0 0 0 / .7); padding: 6px 12px; border-radius: 99px; color: #c7cdd1; font-size: 12.5px;
  pointer-events: none; white-space: nowrap;
}

.toast {
  position: fixed; right: 20px; bottom: 20px; background: var(--panel-2); border: 1px solid var(--line);
  padding: 10px 14px; border-radius: 9px; z-index: 20; max-width: 460px; box-shadow: 0 8px 30px rgb(0 0 0 / .4);
}
.toast.err { border-color: var(--danger); }

@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
  /* Auf dem Handy zuerst Bilder auswählen, Einstellungen darunter */
  .main { padding: 16px; order: -1; }
  .side { border-right: 0; border-top: 1px solid var(--line); }
  .ed-bar { gap: 6px; padding: 6px 8px; }
  .ed-bar .btn { padding: 6px 10px; font-size: 13px; }
  .ed-bar .spacer { display: none; }
  .ed-title { max-width: none; order: -1; flex: 1 1 100%; padding: 0 2px; }
  .ed-title span { white-space: normal; }
  .ed-hint { white-space: normal; text-align: center; width: max-content; max-width: calc(100% - 24px); }
  .toast { left: 12px; right: 12px; bottom: 12px; max-width: none; }
}
.overlay { position: absolute; left: 0; top: 0; pointer-events: none; }

/* Webversion */
.side .about { font-size: 12px; color: var(--muted); line-height: 1.5; }
.side .about p { margin: 0 0 8px; }
.side .about a { color: inherit; }
