*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #0f0f0f;
  --surface:  #181818;
  --surface2: #222222;
  --border:   rgba(255,255,255,.07);
  --border2:  rgba(255,255,255,.12);
  --text:     #f0ede8;
  --muted:    #888;
  --accent:   #c8a882;
  --accent2:  #e8c9a0;
  --green:    #4caf7d;
  --red:      #e05c5c;
  --blue:     #5b9bd5;
  --sans:     'DM Sans', sans-serif;
  --serif:    'DM Serif Display', serif;
}

html, body { height: 100%; overflow: hidden; }

/* ===== MOBILE / PWA ===== */
@media (max-width: 768px) {
  body { flex-direction: column; }

  .sidebar {
    width: 100% !important;
    height: 60px !important;
    min-height: 60px;
    flex-shrink: 0;
    flex-direction: row !important;
    padding: 0 .5rem;
    border-right: none !important;
    border-top: 1px solid var(--border);
    position: fixed;
    bottom: 0; left: 0; right: 0;
    top: auto !important;
    z-index: 100;
    overflow: visible;
    justify-content: space-around;
    align-items: center;
  }

  /* Verstecke alles außer den Nav-Items */
  .sidebar-logo,
  .sidebar-footer,
  .nav-label,
  .nav-section:last-of-type { display: none !important; }

  /* Alle nav-sections nebeneinander */
  .nav-section {
    display: flex !important;
    flex-direction: row !important;
    padding: 0 !important;
    gap: 0;
    flex: 1;
    justify-content: space-around;
  }

  .nav-item {
    flex-direction: column !important;
    padding: .3rem .4rem !important;
    font-size: .58rem !important;
    gap: .15rem !important;
    border-radius: 8px;
    flex: 1;
    text-align: center;
    align-items: center !important;
    justify-content: center;
    min-width: 0;
  }
  .nav-item span:last-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 52px;
  }
  .nav-badge {
    position: absolute;
    top: 0; right: 0;
    font-size: .5rem;
    padding: 1px 4px;
  }
  .nav-icon { font-size: 1.1rem !important; }

  /* Main content über der Bottom-Nav */
  .main-content {
    margin-left: 0 !important;
    padding-bottom: 68px !important;
    height: 100dvh !important;
    overflow-y: auto;
    flex: 1;
  }

  .content-header {
    padding: .6rem .75rem !important;
    flex-wrap: wrap;
    gap: .4rem;
  }
  .gallery-toolbar {
    flex-wrap: wrap;
    gap: .35rem;
    padding: .4rem .5rem !important;
  }
  .gallery-grid.sort-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .btn { font-size: .72rem !important; padding: .38rem .6rem !important; }
  .publish-btn { font-size: .72rem !important; }
  .header-actions { gap: .35rem; flex-wrap: wrap; }
  .form-grid { grid-template-columns: 1fr !important; }
  .form-card { padding: .75rem !important; }
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  display: flex;
  flex-direction: column;
}

/* ===== TITLE BAR ===== */
.titlebar {
  height: 44px;
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.2rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  -webkit-app-region: drag;
  user-select: none;
}
.titlebar-left {
  display: flex;
  align-items: center;
  gap: .6rem;
  -webkit-app-region: no-drag;
}
.tb-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  cursor: pointer;
}
.tb-dot.red   { background: #ff5f57; }
.tb-dot.yellow{ background: #ffbd2e; }
.tb-dot.green { background: #28c840; }
.titlebar-center {
  font-family: var(--serif);
  font-size: .85rem;
  color: var(--muted);
  letter-spacing: .06em;
}
.titlebar-right {
  display: flex;
  align-items: center;
  gap: .8rem;
  -webkit-app-region: no-drag;
}
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}
.status-text {
  font-size: .72rem;
  color: var(--muted);
  letter-spacing: .04em;
}

/* ===== LAYOUT ===== */
.app {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 220px;
  background: #0d0d0d;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}
.sidebar-logo {
  padding: 1.5rem 1.2rem 1rem;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo-name {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--accent2);
  font-style: italic;
}
.sidebar-logo-sub {
  font-size: .68rem;
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-top: .2rem;
}
.nav-section {
  padding: 1rem .8rem .4rem;
}
.nav-label {
  font-size: .62rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 .4rem;
  margin-bottom: .4rem;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .6rem .8rem;
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
  transition: all .2s;
  font-size: .85rem;
  font-weight: 400;
  margin-bottom: 2px;
}
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active { background: var(--surface2); color: var(--text); }
.nav-item.active .nav-icon { color: var(--accent); }
.nav-icon { font-size: 1rem; width: 18px; text-align: center; }
.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #000;
  font-size: .6rem;
  font-weight: 700;
  padding: .1rem .4rem;
  border-radius: 99px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  margin-top: auto;
  padding: 1rem .8rem;
  border-top: 1px solid var(--border);
}
.publish-btn {
  width: 100%;
  background: var(--accent);
  color: #1a1008;
  border: none;
  border-radius: 8px;
  padding: .75rem 1rem;
  font-family: var(--sans);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  transition: background .2s, transform .1s;
  letter-spacing: .02em;
}
.publish-btn:hover { background: var(--accent2); transform: translateY(-1px); }
.publish-btn:active { transform: translateY(0); }

/* ===== MAIN CONTENT ===== */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ===== TOP BAR ===== */
.topbar {
  height: 52px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  flex-shrink: 0;
}
.topbar-title {
  font-size: 1rem;
  font-weight: 500;
}
.topbar-actions {
  display: flex;
  gap: .6rem;
  align-items: center;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem 1rem;
  border-radius: 7px;
  border: 1px solid var(--border2);
  background: var(--surface);
  color: var(--text);
  font-family: var(--sans);
  font-size: .78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
}
.btn:hover { background: var(--surface2); border-color: rgba(255,255,255,.2); }
.btn-primary {
  background: var(--accent);
  color: #1a1008;
  border-color: transparent;
}
.btn-primary:hover { background: var(--accent2); }

/* ===== CONTENT AREA ===== */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}
.content::-webkit-scrollbar { width: 4px; }
.content::-webkit-scrollbar-track { background: transparent; }
.content::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

/* ===== DASHBOARD ===== */
.dashboard { display: none; }
.dashboard.active { display: block; }

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.2rem;
  transition: border-color .2s;
}
.stat-card:hover { border-color: var(--border2); }
.stat-label {
  font-size: .7rem;
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: .6rem;
}
.stat-value {
  font-family: var(--serif);
  font-size: 2rem;
  color: var(--accent2);
  line-height: 1;
  margin-bottom: .3rem;
}
.stat-sub {
  font-size: .72rem;
  color: var(--muted);
}

.section-title {
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Recent activity */
.activity-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.activity-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .9rem 1.2rem;
  border-bottom: 1px solid var(--border);
  transition: background .2s;
}
.activity-item:last-child { border-bottom: none; }
.activity-item:hover { background: var(--surface2); }
.activity-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  flex-shrink: 0;
}
.activity-icon.img { background: rgba(200,168,130,.15); }
.activity-icon.text { background: rgba(91,155,213,.15); }
.activity-icon.publish { background: rgba(76,175,125,.15); }
.activity-text { flex: 1; }
.activity-text strong { font-weight: 500; font-size: .85rem; }
.activity-text span { font-size: .75rem; color: var(--muted); display: block; margin-top: .1rem; }
.activity-time { font-size: .72rem; color: var(--muted); }

/* Quick actions */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.quick-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.4rem;
  cursor: pointer;
  transition: all .2s;
  text-align: center;
}
.quick-card:hover {
  border-color: var(--accent);
  background: rgba(200,168,130,.05);
  transform: translateY(-2px);
}
.quick-icon { font-size: 1.8rem; margin-bottom: .8rem; }
.quick-label { font-size: .85rem; font-weight: 500; margin-bottom: .3rem; }
.quick-desc { font-size: .72rem; color: var(--muted); line-height: 1.5; }

/* ===== GALERIE VIEW ===== */
.galerie-view { display: none; }
.galerie-view.active { display: block; }

.gallery-toolbar {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}
.search-input {
  flex: 1;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .5rem .9rem;
  color: var(--text);
  font-family: var(--sans);
  font-size: .82rem;
  outline: none;
  transition: border-color .2s;
}
.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--muted); }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

/* ===== SORT GRID (gleichmäßig, zeilenweise) ===== */
.gallery-grid.sort-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.gallery-grid.sort-grid .gallery-item {
  cursor: grab;
  position: relative;
  break-inside: avoid;
}
.gallery-grid.sort-grid .gallery-item:active { cursor: grabbing; }
.gallery-grid.sort-grid .sort-num {
  position: absolute;
  top: 6px; left: 6px;
  background: rgba(0,0,0,.75);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  z-index: 10;
  pointer-events: none;
}
.gallery-grid.sort-grid .gallery-item {
  cursor: grab;
  position: relative;
}
.gallery-grid.sort-grid .gallery-item:active { cursor: grabbing; }

/* Positionsnummer Badge */
.position-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0,0,0,.8);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  z-index: 10;
  pointer-events: none;
  min-width: 22px;
  text-align: center;
  letter-spacing: .02em;
}

/* Drag Highlight */
.gallery-item.sortable-ghost { opacity: .25; }
.gallery-item.sortable-chosen { box-shadow: 0 0 0 2px var(--accent); border-radius: 6px; }

/* ===== MASONRY VORSCHAU ===== */
.gallery-grid.masonry-preview {
  display: block;
  columns: 3;
  column-gap: 1rem;
}
.gallery-grid.masonry-preview .gallery-item {
  break-inside: avoid;
  margin-bottom: 1rem;
  border-radius: 4px;
  cursor: default;
}
.gallery-grid.masonry-preview .gallery-thumb { height: auto; aspect-ratio: unset; background: transparent; display: block; }
.gallery-grid.masonry-preview .gallery-thumb img { height: auto; width: 100%; object-fit: unset; display: block; }

/* Drag & Drop Styling */
.gallery-item.dragging {
  opacity: .35;
  transform: scale(.97);
}
.gallery-item.drag-over {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px var(--accent);
}

/* View toggle button */
.view-toggle {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.view-toggle-btn {
  padding: .45rem .75rem;
  font-size: .85rem;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--muted);
  transition: all .15s;
}
.view-toggle-btn.active {
  background: var(--surface2);
  color: var(--accent);
}
.gallery-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: all .2s;
  position: relative;
}

.gallery-item:hover .gallery-overlay { opacity: 1; }
.overlay-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(20,20,20,.85);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .82rem; cursor: pointer;
  transition: background .15s;
  flex-shrink: 0;
}
.overlay-btn:hover { background: rgba(60,60,60,.95); }

/* ===== SOLD STEMPEL ===== */
.sold-stamp {
  position: absolute;
  top: 8px; left: 8px;
  transform: rotate(-18deg) scale(0);
  width: 62px; height: 62px;
  border: 2.5px solid #e05c5c;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #e05c5c;
  font-size: .68rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase;
  pointer-events: none;
  transition: transform .3s cubic-bezier(.175,.885,.32,1.4), opacity .2s;
  opacity: 0;
  z-index: 6;
  background: rgba(224,92,92,.08);
}
.sold-stamp::before {
  content: '';
  position: absolute; inset: 4px;
  border: 1px solid rgba(224,92,92,.3);
  border-radius: 50%;
}
.gallery-item.is-sold .sold-stamp {
  transform: rotate(-18deg) scale(1);
  opacity: 1;
}
.gallery-item.is-sold .gallery-thumb { filter: grayscale(30%) brightness(.85); }
/* Sold-Badge unten links */
.sold-badge { display: none !important; }

.gallery-thumb {
  width: 100%;
  aspect-ratio: unset;
  background: var(--surface2);
  display: block;
  overflow: hidden;
}
.gallery-thumb img { width: 100%; height: auto; display: block; object-fit: unset; }
.gallery-info {
  padding: .7rem .8rem;
}
.gallery-name {
  font-size: .8rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: .2rem;
}
.gallery-meta {
  font-size: .68rem;
  color: var(--muted);
}
.gallery-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.7);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  opacity: 0;
  transition: opacity .2s;
}

.gallery-item.is-featured::after {
  content: '★ Titelbild';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #0f0f0f;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .08em;
  padding: 3px 10px;
  border-radius: 3px;
  pointer-events: none;
  z-index: 10;
  white-space: nowrap;
}
.upload-zone {
  border: 2px dashed var(--border2);
  border-radius: 10px;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  cursor: pointer;
  transition: all .2s;
  color: var(--muted);
  font-size: .78rem;
}
.upload-zone:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(200,168,130,.04);
}
.upload-zone .icon { font-size: 1.5rem; }

/* ===== TEXTE VIEW ===== */
.texte-view { display: none; }
.texte-view.active { display: block; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.form-group.full { grid-column: 1 / -1; }
.form-label {
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.form-input, .form-textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .65rem .9rem;
  color: var(--text);
  font-family: var(--sans);
  font-size: .88rem;
  outline: none;
  transition: border-color .2s;
}
.form-input:focus, .form-textarea:focus { border-color: var(--accent); }
.form-textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.6;
}
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.4rem;
  margin-bottom: 1.2rem;
}
.form-card-title {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.save-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

/* ===== KONTAKT VIEW ===== */
.kontakt-view { display: none; }
.kontakt-view.active { display: block; }

/* ===== PUBLISH VIEW ===== */
.publish-view { display: none; }
.publish-view.active { display: block; }

.publish-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 1.2rem;
  max-width: 640px;
}
.publish-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.publish-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: rgba(76,175,125,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.publish-title { font-size: 1.1rem; font-weight: 500; }
.publish-sub { font-size: .8rem; color: var(--muted); margin-top: .2rem; }

.progress-bar {
  background: var(--surface2);
  border-radius: 99px;
  height: 6px;
  overflow: hidden;
  margin: 1rem 0;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 99px;
  width: 0%;
  transition: width .4s ease;
}

.deploy-log {
  background: #0a0a0a;
  border-radius: 8px;
  padding: 1rem;
  font-family: 'Courier New', monospace;
  font-size: .75rem;
  color: #4caf7d;
  max-height: 160px;
  overflow-y: auto;
  line-height: 1.7;
}
.deploy-log .muted { color: var(--muted); }
.deploy-log .warn  { color: var(--accent); }

.big-publish-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #1a1008;
  border: none;
  border-radius: 12px;
  padding: 1.1rem;
  font-family: var(--sans);
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  transition: all .2s;
  letter-spacing: .02em;
}
.big-publish-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(200,168,130,.3); }

/* ===== BESTÄTIGUNGS-DIALOG ===== */
let _confirmCallback = null;

function confirmDelete(name, callback) {
  _confirmCallback = callback;
  document.getElementById('confirmText').textContent = `"${name}" wird aus der Galerie entfernt.`;
  const modal = document.getElementById('confirmModal');
  modal.style.display = 'flex';
}

function closeConfirm(confirmed) {
  document.getElementById('confirmModal').style.display = 'none';
  if (confirmed && _confirmCallback) _confirmCallback();
  _confirmCallback = null;
}

// ESC schließt den Dialog
document.addEventListener('keydown', e => {
  if (e.key === 'Escape') closeConfirm(false);
});

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: .7rem 1.4rem;
  font-size: .82rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: .6rem;
  transition: transform .3s ease;
  z-index: 999;
  white-space: nowrap;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success .toast-icon { color: var(--green); }
.toast.error .toast-icon { color: var(--red); }

/* ===== EDIT-MODAL ===== */
.edit-modal-backdrop {
  display:none;position:fixed;inset:0;
  background:rgba(0,0,0,.75);
  z-index:9997;align-items:center;justify-content:center;
}
.edit-modal-backdrop.open { display:flex; }
.edit-modal {
  background:#181818;
  border:1px solid rgba(255,255,255,.1);
  border-radius:16px;
  width:420px;max-width:92vw;
  padding:1.8rem;
}
.edit-modal-title {
  font-size:1rem;font-weight:600;
  margin-bottom:1.2rem;color:var(--accent2);
  display:flex;justify-content:space-between;align-items:center;
}
.edit-modal-close {
  background:none;border:none;color:#888;
  font-size:1.1rem;cursor:pointer;
}

/* ===== BILD-INFO MODAL ===== */
.img-modal-backdrop {
  display:none;position:fixed;inset:0;
  background:rgba(0,0,0,.75);
  z-index:9998;align-items:center;justify-content:center;
}
.img-modal-backdrop.open { display:flex; }
.img-modal {
  background:#181818;
  border:1px solid rgba(255,255,255,.1);
  border-radius:16px;
  width:460px;max-width:92vw;
  overflow:hidden;
}
.img-modal-preview {
  width:100%;height:200px;
  object-fit:cover;display:block;
}
.img-modal-body { padding:1.5rem; }
.img-modal-title {
  font-size:1rem;font-weight:600;
  margin-bottom:1.2rem;color:var(--accent2);
}
.img-modal-grid {
  display:grid;grid-template-columns:1fr 1fr;
  gap:.8rem;margin-bottom:.8rem;
}
.img-modal-group { display:flex;flex-direction:column;gap:.4rem; }
.img-modal-group.full { grid-column:1/-1; }
.img-modal-label {
  font-size:.65rem;letter-spacing:.1em;
  text-transform:uppercase;color:var(--muted);
}
.img-modal-input, .img-modal-select {
  background:#0f0f0f;
  border:1px solid rgba(255,255,255,.1);
  border-radius:8px;
  padding:.6rem .8rem;
  color:var(--text);
  font-family:var(--sans);font-size:.85rem;
  outline:none;
  transition:border-color .2s;
  width:100%;
}
.img-modal-input:focus,.img-modal-select:focus { border-color:var(--accent); }
.img-modal-select option { background:#181818; }
.img-modal-footer {
  display:flex;gap:.6rem;justify-content:flex-end;
  margin-top:1.2rem;
}
.img-modal-cancel {
  background:none;border:1px solid rgba(255,255,255,.1);
  border-radius:8px;padding:.55rem 1.1rem;
  color:var(--muted);cursor:pointer;font-size:.82rem;
  font-family:var(--sans);
}
.img-modal-confirm {
  background:var(--accent);border:none;
  border-radius:8px;padding:.55rem 1.3rem;
  color:#1a1008;font-weight:700;cursor:pointer;
  font-size:.82rem;font-family:var(--sans);
  transition:background .2s;
}
.img-modal-confirm:hover { background:var(--accent2); }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }
.content > * { animation: fadeIn .3s ease both; }