/* ==========================================================
   Galerie - Privater Bereich
   ========================================================== */

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

/* Native [hidden]-Attribut respektieren (CSS-Regeln wie display:flex würden es sonst überschreiben) */
[hidden] { display: none !important; }

:root {
  --bg: #0a0a0c;
  --bg-soft: #14141a;
  --line: #1f1f28;
  --line-soft: #2a2a35;
  --ink: #ece6d8;
  --ink-soft: #8a8a96;
  --ink-mute: #4a4a55;
  --accent: #d4b78a;
  --accent-soft: rgba(212, 183, 138, 0.4);
  --danger: #c46d6d;
  --ok: #7eb88a;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--accent); color: var(--bg); }

/* ============================ LOGIN ============================ */
.login-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% 30%, #1a1a22 0%, #0a0a0c 65%);
  padding: 20px;
}
.login-box { text-align: center; padding: 50px 40px; max-width: 380px; width: 100%; }
.login-mark {
  width: 60px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  margin: 0 auto 32px;
}
.login-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 44px; font-weight: 400;
  letter-spacing: 0.15em; color: var(--ink);
}
.login-subtitle {
  font-size: 10px; letter-spacing: 0.4em; text-transform: uppercase;
  color: var(--ink-mute); margin-top: 8px; margin-bottom: 48px;
}
.login-form input[type=password] {
  width: 100%; background: transparent; border: none;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink); font-size: 15px; padding: 14px 4px;
  text-align: center; letter-spacing: 0.15em;
  font-family: inherit; transition: border-color 0.4s ease;
}
.login-form input[type=password]:focus { outline: none; border-bottom-color: var(--accent); }
.login-form button {
  margin-top: 36px; background: transparent;
  border: 1px solid var(--accent); color: var(--accent);
  padding: 13px 40px; font-size: 10px; font-weight: 500;
  letter-spacing: 0.3em; text-transform: uppercase;
  cursor: pointer; font-family: inherit; transition: all 0.4s ease;
}
.login-form button:hover { background: var(--accent); color: var(--bg); letter-spacing: 0.35em; }
.login-error {
  margin-top: 28px; color: var(--danger);
  font-size: 11px; letter-spacing: 0.1em; animation: shake 0.4s;
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* ============================ HEADER ============================ */
.gallery-body { min-height: 100vh; }

.gallery-header {
  padding: 28px 40px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line);
  gap: 20px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 16px; }
.brand-mark { width: 24px; height: 1px; background: var(--accent); }
.gallery-header h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 28px; font-weight: 400;
  letter-spacing: 0.2em; color: var(--ink);
}
.gallery-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-block; background: transparent;
  border: 1px solid var(--line-soft); color: var(--ink-soft);
  padding: 10px 22px; font-size: 10px;
  letter-spacing: 0.25em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; font-family: inherit;
  transition: all 0.3s ease;
}
.btn-primary { border-color: var(--accent); color: var(--accent); }
.btn-primary:hover { background: var(--accent); color: var(--bg); }
.btn-ghost:hover { color: var(--accent); border-color: var(--accent); }

/* ============================ BREADCRUMB ============================ */
.breadcrumb {
  padding: 18px 40px;
  display: flex; align-items: center; gap: 12px;
  font-size: 12px; letter-spacing: 0.1em;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.crumb { color: var(--ink-soft); text-decoration: none; transition: color 0.2s; }
.crumb:hover { color: var(--accent); }
.crumb-cur {
  color: var(--accent);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 15px;
  letter-spacing: 0.12em;
}
.crumb-sep { color: var(--ink-mute); }

/* ============================ FLASH ============================ */
.flash {
  margin: 16px 40px 0;
  padding: 12px 18px;
  border-left: 2px solid var(--accent);
  background: var(--bg-soft);
  font-size: 12px;
  letter-spacing: 0.05em;
}
.flash-ok { border-left-color: var(--ok); color: var(--ok); }
.flash-error { border-left-color: var(--danger); color: var(--danger); }

/* ============================ NEUER ORDNER ============================ */
.newfolder {
  margin: 20px 40px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  background: var(--bg-soft);
  display: flex; gap: 10px; flex-wrap: wrap;
  align-items: center;
}
.newfolder input[type=text] {
  flex: 1; min-width: 200px;
  background: transparent; border: none;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink); font-size: 14px;
  padding: 8px 4px; font-family: inherit;
  letter-spacing: 0.05em;
}
.newfolder input[type=text]:focus {
  outline: none; border-bottom-color: var(--accent);
}

/* ============================ GRID ============================ */
.grid {
  padding: 24px 30px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.tile {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg-soft);
}

/* Foto-Kachel */
.tile-photo {
  cursor: grab;
  user-select: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.tile-photo:active { cursor: grabbing; }
.tile-photo.dragging {
  opacity: 0.35;
  transform: scale(0.95);
}
.tile-photo.removing {
  opacity: 0;
  transform: scale(0.85);
  pointer-events: none;
}
.tile-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 1s ease, opacity 0.5s;
  opacity: 0.92;
  pointer-events: none;
}
.tile-photo:hover img { transform: scale(1.07); opacity: 1; }
.tile-photo::after {
  content: ''; position: absolute; inset: 0;
  border: 1px solid transparent;
  transition: border-color 0.4s ease;
  pointer-events: none;
}
.tile-photo:hover::after { border-color: var(--accent-soft); }

/* Action-Buttons (Download / Löschen) */
.tile-actions {
  position: absolute;
  top: 8px; right: 8px;
  z-index: 5;
  display: flex;
  gap: 6px;
  opacity: 0.85;
  transition: opacity 0.25s, transform 0.25s;
}
.tile-photo:hover .tile-actions,
.tile-folder:hover .tile-actions {
  opacity: 1;
  transform: scale(1.05);
}

.tile-action,
.tile-action-form button {
  background: rgba(0,0,0,0.65);
  border: 1px solid var(--accent-soft);
  color: var(--accent);
  width: 30px; height: 30px;
  font-size: 17px; line-height: 1;
  cursor: pointer;
  font-family: inherit;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
  transition: all 0.2s;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.tile-action:hover,
.tile-action-form button:hover {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  transform: scale(1.1);
}
.tile-action-delete:hover,
.tile-action-form button:hover {
  background: var(--danger) !important;
  border-color: var(--danger) !important;
  color: #fff !important;
}
.tile-action-form { display: inline-flex; }
.tile-action-form button {
  padding: 0;
  font-size: 17px;
}

/* Drop-Target Highlight (für Bild-Verschieben) */
.tile-folder.drop-target {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.tile-folder.drop-target::before {
  content: '↓';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 48px;
  color: var(--accent);
  z-index: 10;
  text-shadow: 0 4px 12px rgba(0,0,0,0.9);
  pointer-events: none;
  animation: float 1s ease-in-out infinite alternate;
}
.crumb.drop-target {
  background: var(--accent);
  color: var(--bg) !important;
  padding: 4px 12px;
  border-radius: 2px;
}

/* Ordner-Kachel */
.tile-folder { cursor: pointer; }
.tile-link {
  display: block; position: absolute; inset: 0;
  text-decoration: none; color: inherit;
}
.tile-folder img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(0.6) saturate(0.8);
  transition: filter 0.5s, transform 1s ease;
}
.tile-folder:hover img {
  filter: brightness(0.85) saturate(1);
  transform: scale(1.04);
}
.folder-shade {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,0.85) 100%);
  pointer-events: none;
}
.folder-empty-art {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 60px; color: var(--accent);
  opacity: 0.18;
  font-family: 'Cormorant Garamond', Georgia, serif;
  background: linear-gradient(135deg, #14141a, #0c0c12);
  transition: opacity 0.4s;
}
.tile-folder:hover .folder-empty-art { opacity: 0.35; }

.folder-meta {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 14px 16px;
  color: var(--ink);
  z-index: 2;
}
.folder-name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 18px;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}
.folder-count {
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.85;
}

/* Ordner-Outline beim Hover */
.tile-folder::after {
  content: ''; position: absolute; inset: 0;
  border: 1px solid transparent;
  transition: border-color 0.4s ease;
  pointer-events: none; z-index: 3;
}
.tile-folder:hover::after { border-color: var(--accent-soft); }

/* Lösch-Button auf leerem Ordner (Legacy-Klasse falls noch verwendet) */
.tile-delete {
  position: absolute;
  top: 8px; right: 8px;
  z-index: 4;
  opacity: 0;
  transition: opacity 0.3s;
}
.tile-folder:hover .tile-delete { opacity: 1; }
.tile-delete button {
  background: rgba(0,0,0,0.7);
  border: 1px solid var(--accent-soft);
  color: var(--accent);
  width: 28px; height: 28px;
  font-size: 16px; line-height: 1;
  cursor: pointer;
  font-family: inherit;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.tile-delete button:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.footer-count {
  text-align: center;
  padding: 30px 20px 40px;
  color: var(--ink-mute);
  font-size: 10px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
}

/* ============================ EMPTY STATE ============================ */
.empty { text-align: center; padding: 80px 20px; color: var(--ink-mute); }
.empty-icon { font-size: 48px; color: var(--accent); opacity: 0.4; margin-bottom: 24px; }
.empty-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 22px; letter-spacing: 0.1em;
  color: var(--ink-soft); margin-bottom: 16px;
}
.empty-hint { font-size: 12px; line-height: 2; letter-spacing: 0.05em; }
.empty-hint code {
  background: var(--bg-soft); padding: 3px 10px; border-radius: 2px;
  color: var(--accent); font-family: 'Courier New', monospace; font-size: 11px;
}

/* ============================ SLIDESHOW ============================ */
.slide-body { background: #000; overflow: hidden; height: 100vh; width: 100vw; position: relative; }
.stage { position: fixed; inset: 0; background: #000; }
.slide {
  position: absolute; inset: 0;
  background-position: center; background-size: contain; background-repeat: no-repeat;
  opacity: 0; transform-origin: center;
  transition: opacity 1.6s cubic-bezier(.4,.0,.2,1);
}
.slide.active { opacity: 1; }

@keyframes kb-0 { from { transform: scale(1.0) translate(0%, 0%); } to { transform: scale(1.12) translate(-2%, -1%); } }
@keyframes kb-1 { from { transform: scale(1.12) translate(0%, 0%); } to { transform: scale(1.0) translate(2%, 1%); } }
@keyframes kb-2 { from { transform: scale(1.0) translate(2%, -1%); } to { transform: scale(1.1) translate(-1%, 2%); } }
@keyframes kb-3 { from { transform: scale(1.1) translate(-2%, 1%); } to { transform: scale(1.0) translate(1%, -2%); } }
.slide.kb-0.active { animation: kb-0 9s ease-out forwards; }
.slide.kb-1.active { animation: kb-1 9s ease-out forwards; }
.slide.kb-2.active { animation: kb-2 9s ease-out forwards; }
.slide.kb-3.active { animation: kb-3 9s ease-out forwards; }

.slide-shell { position: fixed; inset: 0; pointer-events: none; z-index: 10; opacity: 0; transition: opacity 0.5s; }
.slide-body:hover .slide-shell,
.slide-body.ui-visible .slide-shell { opacity: 1; }

.ui-btn {
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--accent-soft);
  color: var(--accent);
  width: 48px; height: 48px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 20px; cursor: pointer; font-family: inherit;
  text-decoration: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  pointer-events: auto; user-select: none;
}
.ui-btn:hover { background: var(--accent); color: #000; border-color: var(--accent); }
.ui-play.is-playing { font-size: 12px; }

.ui-close { position: absolute; top: 20px; right: 20px; }

/* Download-Button in Slideshow */
.ui-dl {
  position: absolute;
  top: 20px; right: 80px;
  font-size: 20px;
}

/* Cover-Stern in Slideshow */
.ui-cover {
  position: absolute;
  top: 20px; right: 140px;
  font-size: 22px;
  color: var(--accent);
}
.ui-cover.is-cover {
  color: #ffd864;
  background: rgba(255, 216, 100, 0.18);
  border-color: rgba(255, 216, 100, 0.7);
}
.ui-cover.is-cover:hover {
  background: #ffd864;
  color: #000;
  border-color: #ffd864;
}
.ui-cover.pulse {
  animation: cover-pulse 0.6s ease-out;
}
@keyframes cover-pulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.35); box-shadow: 0 0 24px rgba(255, 216, 100, 0.7); }
  100% { transform: scale(1); box-shadow: 0 0 0 rgba(255, 216, 100, 0); }
}
.slide-controls {
  position: absolute; bottom: 32px; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 12px;
}
.slide-counter {
  position: absolute; top: 20px; left: 24px;
  font-size: 11px; letter-spacing: 0.3em;
  color: var(--accent);
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 12px 16px;
  border: 1px solid var(--accent-soft);
  pointer-events: auto;
}
.counter-sep { margin: 0 6px; opacity: 0.5; }

/* ============================ UPLOAD ============================ */
.drop-zone {
  position: fixed; inset: 0;
  background: rgba(10, 10, 12, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.drop-zone.active {
  opacity: 1;
  pointer-events: auto;
}
.drop-inner {
  text-align: center;
  padding: 60px 40px;
  border: 2px dashed var(--accent);
  max-width: 500px;
  width: 80%;
}
.drop-icon {
  font-size: 72px;
  color: var(--accent);
  margin-bottom: 20px;
  animation: float 1.5s ease-in-out infinite alternate;
}
@keyframes float {
  from { transform: translateY(0); }
  to { transform: translateY(-8px); }
}
.drop-text {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 32px;
  letter-spacing: 0.1em;
  color: var(--ink);
  margin-bottom: 12px;
}
.drop-sub {
  font-size: 12px;
  letter-spacing: 0.15em;
  color: var(--ink-soft);
}
.drop-sub strong {
  color: var(--accent);
  font-weight: 400;
}

.upload-progress {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: rgba(10, 10, 12, 0.95);
  border: 1px solid var(--accent-soft);
  padding: 14px 20px;
  min-width: 280px;
  max-width: 90%;
  z-index: 1001;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.4s cubic-bezier(.5, 1.6, .4, 1);
}
.upload-progress.visible {
  transform: translateX(-50%) translateY(0);
}
.upload-progress-text {
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 8px;
  text-align: center;
  text-transform: uppercase;
}
.upload-progress-track {
  height: 2px;
  background: var(--line-soft);
  overflow: hidden;
}
.upload-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #f0d9a8);
  width: 0%;
  transition: width 0.2s ease;
}
.upload-progress.error .upload-progress-bar {
  background: var(--danger);
}
.upload-progress.error .upload-progress-text {
  color: var(--danger);
}

/* ============================ MOBILE ============================ */
@media (max-width: 700px) {
  .gallery-header { padding: 20px; }
  .gallery-header h1 { font-size: 22px; }
  .breadcrumb { padding: 14px 20px; font-size: 11px; gap: 8px; }
  .crumb-cur { font-size: 14px; }
  .flash, .newfolder { margin-left: 20px; margin-right: 20px; }
  .grid { padding: 14px; gap: 8px; grid-template-columns: repeat(2, 1fr); }
  .folder-name { font-size: 15px; }
  .folder-count { font-size: 8px; }
  .login-title { font-size: 36px; }
  .login-box { padding: 30px 20px; }
  .slide-controls { bottom: 24px; }
  .ui-btn { width: 44px; height: 44px; }
  .slide-counter { top: 16px; left: 16px; font-size: 10px; padding: 10px 12px; }
  .ui-close { top: 16px; right: 16px; }
  .ui-dl    { top: 16px; right: 68px; font-size: 16px; }
  .ui-cover { top: 16px; right: 120px; font-size: 18px; }
  .slide-shell { opacity: 1; }
  .slide-body:not(.ui-visible) .slide-shell { opacity: 0; }
  .tile-actions { opacity: 1; }
  .tile-delete { opacity: 1; }
  .tile-photo { cursor: pointer; }
}

@media (max-width: 420px) {
  .gallery-header { flex-direction: column; align-items: flex-start; }
}

/* ════════════════════════════════════════════════════════════
   EDITOR
   ════════════════════════════════════════════════════════════ */

.editor-body {
  min-height: 100vh;
  background: #0a0a0c;
  display: flex; flex-direction: column;
}

.editor-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  gap: 16px;
  flex-wrap: wrap;
}
.editor-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 18px;
  letter-spacing: 0.1em;
  color: var(--ink);
  flex: 1; text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  min-width: 0;
}
.editor-header-actions { display: flex; gap: 10px; }

/* Vergleichs-Button aktiver Zustand */
#compare-btn.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg);
}

/* Badge "Original-Vorschau" auf dem Canvas */
.compare-badge {
  position: absolute;
  top: 16px; left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: var(--accent);
  padding: 8px 18px;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  border: 1px solid var(--accent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
  z-index: 5;
  animation: badge-fade 0.25s ease-out;
}
@keyframes badge-fade {
  from { opacity: 0; transform: translate(-50%, -8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

.editor-layout {
  display: grid;
  grid-template-columns: 160px 1fr 280px;
  flex: 1;
  min-height: 0;
}

.editor-tools {
  border-right: 1px solid var(--line);
  padding: 16px 0;
  display: flex; flex-direction: column;
  background: var(--bg-soft);
}
.tool-tab {
  background: transparent;
  border: none;
  color: var(--ink-soft);
  padding: 14px 20px;
  text-align: left;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.1em;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: all 0.2s;
}
.tool-tab:hover { color: var(--ink); background: rgba(255,255,255,0.03); }
.tool-tab.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: rgba(212, 183, 138, 0.08);
}

.editor-canvas-wrap {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  overflow: hidden;
}
.editor-canvas-box {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  display: inline-block;
}
#editor-canvas {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 160px);
  background: #1a1a22;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.editor-status {
  position: absolute;
  bottom: 8px; left: 24px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
}
.editor-status.error { color: var(--danger); }

.editor-options {
  border-left: 1px solid var(--line);
  padding: 20px;
  overflow-y: auto;
  background: var(--bg-soft);
}
.tool-panel { display: none; }
.tool-panel.active { display: block; }
.tool-panel h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 18px;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 16px;
  font-weight: 400;
}

.btn-row { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.op-btn {
  flex: 1;
  background: transparent;
  border: 1px solid var(--line-soft);
  color: var(--ink-soft);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.2s;
}
.op-btn:hover { color: var(--accent); border-color: var(--accent); }
.op-btn-primary { border-color: var(--accent); color: var(--accent); }
.op-btn-primary:hover { background: var(--accent); color: #000; }
.op-btn.small { padding: 6px 10px; font-size: 10px; }
.op-btn.active { background: var(--accent); color: #000; border-color: var(--accent); }

.hint {
  font-size: 11px;
  color: var(--ink-mute);
  line-height: 1.6;
  margin-bottom: 12px;
}

.slider-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  margin-bottom: 14px;
}
.slider-label span {
  float: right;
  color: var(--accent);
  font-family: 'Courier New', monospace;
}
.slider-label input[type=range] {
  width: 100%;
  margin-top: 8px;
  accent-color: var(--accent);
}
.color-label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  margin-bottom: 12px;
}
.color-label input[type=color] {
  width: 50px; height: 32px;
  border: 1px solid var(--line-soft);
  background: transparent;
  cursor: pointer;
}

#text-input {
  width: 100%;
  background: transparent;
  border: 1px solid var(--line-soft);
  color: var(--ink);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 13px;
  margin-bottom: 12px;
}
#text-input:focus { outline: none; border-color: var(--accent); }

.filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.filter-btn {
  background: transparent;
  border: 1px solid var(--line-soft);
  color: var(--ink-soft);
  padding: 10px;
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.2s;
}
.filter-btn:hover { color: var(--accent); border-color: var(--accent); }
.filter-btn.active { background: var(--accent); color: #000; border-color: var(--accent); }

/* Crop-Overlay */
.crop-overlay {
  position: absolute;
  pointer-events: auto;
  cursor: crosshair;
}
.crop-box {
  position: absolute;
  border: 1.5px solid var(--accent);
  box-shadow:
    0 0 0 9999px rgba(0,0,0,0.6),
    0 0 12px rgba(212, 183, 138, 0.4);
  cursor: move;
}
.crop-handle {
  position: absolute;
  width: 14px; height: 14px;
  background: var(--accent);
  border: 2px solid #000;
}
.crop-handle.nw { top: -7px; left: -7px; cursor: nwse-resize; }
.crop-handle.ne { top: -7px; right: -7px; cursor: nesw-resize; }
.crop-handle.sw { bottom: -7px; left: -7px; cursor: nesw-resize; }
.crop-handle.se { bottom: -7px; right: -7px; cursor: nwse-resize; }

/* Background-Removal Progress */
.bg-progress { margin-top: 16px; }
.bg-progress-track {
  height: 3px;
  background: var(--line-soft);
  overflow: hidden;
}
.bg-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #f0d9a8);
  transition: width 0.3s ease;
}
.bg-progress-text {
  margin-top: 8px;
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--accent);
  text-transform: uppercase;
}

/* Save-Modal */
.save-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.save-modal-inner {
  max-width: 500px; width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  padding: 32px;
  text-align: center;
}
.save-modal h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 28px;
  letter-spacing: 0.15em;
  color: var(--ink);
  font-weight: 400;
  margin-bottom: 8px;
}
.save-modal p {
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 24px;
  letter-spacing: 0.05em;
}
.save-options {
  display: flex; flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.save-option {
  background: transparent;
  border: 1px solid var(--line-soft);
  color: var(--ink);
  padding: 16px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all 0.2s;
}
.save-option:hover {
  border-color: var(--accent);
  background: rgba(212, 183, 138, 0.05);
}
.save-option strong {
  display: block;
  font-size: 14px;
  color: var(--accent);
  margin-bottom: 4px;
  letter-spacing: 0.05em;
}
.save-option span {
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
  line-height: 1.5;
}

/* Save-Loading Overlay */
.save-loading {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 1100;
}
.save-loading-inner { text-align: center; }
.spinner {
  width: 50px; height: 50px;
  border: 2px solid var(--line-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#save-loading-text {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--accent);
  text-transform: uppercase;
}

/* Slideshow: Edit-Button Position */
.ui-edit {
  position: absolute;
  top: 20px; right: 140px;
  font-size: 18px;
}
.ui-cover {
  position: absolute;
  top: 20px; right: 200px;
}

/* Editor: Responsive */
@media (max-width: 900px) {
  .editor-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }
  .editor-tools {
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 0;
  }
  .tool-tab {
    border-left: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
  }
  .tool-tab.active {
    border-left-color: transparent;
    border-bottom-color: var(--accent);
  }
  .editor-options {
    border-left: none;
    border-top: 1px solid var(--line);
    max-height: 35vh;
  }
  #editor-canvas { max-height: 50vh; }
  .ui-edit { right: 120px; font-size: 16px; }
  .ui-cover { right: 172px; }
}
