:root {
  --bg: #f6f2e8;
  --bg-accent: #e5f0e5;
  --card: rgba(255, 255, 255, 0.78);
  --line: rgba(22, 33, 22, 0.12);
  --text: #0f2016;
  --muted: #4f6157;
  --brand: #0f6a4a;
  --brand-2: #ee6f2d;
  --radius-xl: 26px;
  --radius-lg: 14px;
  --shadow-md: 0 12px 32px rgba(27, 40, 27, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Manrope, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(120% 120% at 10% -10%, #f6dca8 0%, transparent 45%),
    radial-gradient(90% 90% at 110% 10%, #bdddc4 0%, transparent 42%),
    linear-gradient(160deg, var(--bg) 0%, #eff6f0 45%, var(--bg-accent) 100%);
  padding: 28px;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(52px);
  opacity: 0.45;
  pointer-events: none;
}

.ambient-a {
  top: -150px;
  right: -120px;
  background: #f6a451;
}

.ambient-b {
  left: -100px;
  bottom: -140px;
  background: #7ac79a;
}

.topbar {
  max-width: 1400px;
  margin: 0 auto 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  animation: rise 0.7s ease both;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand h1 {
  font-family: Syne, "Trebuchet MS", sans-serif;
  margin: 0;
  font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.4rem);
  letter-spacing: 0.02em;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 600;
}

.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-family: Syne, "Trebuchet MS", sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(130deg, var(--brand) 0%, #1e8a66 48%, var(--brand-2) 100%);
  box-shadow: var(--shadow-md);
}

.header-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.86rem;
}

.layout {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 1.2fr 1fr;
  gap: 16px;
}

.card {
  border-radius: var(--radius-xl);
  background: var(--card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  padding: 20px;
  animation: rise 0.75s ease both;
}

.card:nth-child(2) {
  animation-delay: 0.06s;
}

.card:nth-child(3) {
  animation-delay: 0.1s;
}

.card:nth-child(4) {
  animation-delay: 0.14s;
}

.card:nth-child(5) {
  animation-delay: 0.18s;
}

.card:nth-child(6) {
  animation-delay: 0.22s;
}

.card-head h2 {
  margin: 0;
  font-family: Syne, "Trebuchet MS", sans-serif;
}

.card-head p {
  margin: 8px 0 16px;
  color: var(--muted);
}

.drop-zone {
  border: 2px dashed rgba(17, 34, 25, 0.22);
  border-radius: var(--radius-lg);
  min-height: 210px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 18px;
  transition: all 0.2s ease;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.75), rgba(240, 250, 244, 0.75));
}

.drop-zone:hover,
.drop-zone:focus-visible,
.drop-zone.active {
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(24, 92, 63, 0.15);
}

.drop-zone:focus-visible {
  outline: 3px solid rgba(15, 106, 74, 0.32);
}

.drop-zone h3 {
  margin: 0;
  font-size: 1.28rem;
}

.drop-zone p {
  margin: 7px 0 12px;
  color: var(--muted);
}

.drop-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: linear-gradient(130deg, rgba(15, 106, 74, 0.15), rgba(238, 111, 45, 0.15));
  color: var(--brand);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.drop-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.meta-grid .label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 700;
}

.meta-grid p {
  margin: 4px 0 0;
  font-weight: 700;
}

.batch-head {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.batch-head h3,
.batch-head p {
  margin: 0;
}

.batch-head p {
  color: var(--muted);
  font-weight: 700;
}

.batch-list {
  margin-top: 10px;
  max-height: 240px;
  overflow: auto;
  display: grid;
  gap: 8px;
}

.batch-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(17, 34, 25, 0.14);
  background: rgba(255, 255, 255, 0.62);
  border-radius: 12px;
  padding: 8px;
}

.batch-item.active {
  border-color: var(--brand);
  background: rgba(15, 106, 74, 0.08);
}

.batch-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
}

.batch-meta h4 {
  margin: 0;
  font-size: 0.9rem;
}

.batch-meta p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.batch-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.preview-wrap {
  background:
    linear-gradient(45deg, #dce7dc 25%, #cdddcd 25%, #cdddcd 50%, #dce7dc 50%, #dce7dc 75%, #cdddcd 75%);
  background-size: 22px 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  overflow: hidden;
  min-height: 340px;
  max-height: 520px;
  position: relative;
  cursor: grab;
}

.preview-wrap.panning {
  cursor: grabbing;
}

#previewCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

.preview-hint {
  position: absolute;
  bottom: 12px;
  right: 12px;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(17, 34, 25, 0.16);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.zoom-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}

.preview-controls {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.stack {
  display: grid;
  gap: 12px;
}

.inline-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

label {
  font-size: 0.92rem;
  font-weight: 700;
  color: #24382c;
}

input[type="text"],
input[type="number"],
select,
input[type="color"] {
  width: 100%;
  margin-top: 6px;
  border: 1px solid rgba(17, 34, 25, 0.2);
  background: rgba(255, 255, 255, 0.88);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text);
  font: inherit;
}

input[type="range"] {
  width: 100%;
  margin-top: 6px;
  accent-color: var(--brand);
}

.switch {
  display: flex;
  align-items: center;
  gap: 8px;
}

.format-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.format-grid label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(17, 34, 25, 0.15);
  background: rgba(255, 255, 255, 0.5);
  font-size: 0.86rem;
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  font-family: Manrope, "Segoe UI", sans-serif;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.btn.primary {
  background: linear-gradient(130deg, var(--brand) 0%, #1d8a63 58%, var(--brand-2) 100%);
  color: #fff;
  box-shadow: 0 14px 26px rgba(20, 88, 61, 0.22);
}

.btn.secondary {
  background: rgba(15, 106, 74, 0.13);
  color: #1a5f45;
  border: 1px solid rgba(15, 106, 74, 0.22);
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.8);
  color: #264235;
  border: 1px solid rgba(17, 34, 25, 0.18);
}

.btn.tiny {
  padding: 6px 10px;
  font-size: 0.78rem;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.support-note {
  margin: 8px 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.result-card {
  border: 1px solid rgba(17, 34, 25, 0.15);
  background: rgba(255, 255, 255, 0.66);
  border-radius: 14px;
  overflow: hidden;
}

.result-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

.result-body {
  padding: 10px;
}

.result-body h4 {
  margin: 0 0 6px;
  font-size: 0.95rem;
}

.result-body .mini {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.result-body p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.84rem;
}

.result-body .btn {
  width: 100%;
}

.footer {
  max-width: 1400px;
  margin: 16px auto 0;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1190px) {
  .layout {
    grid-template-columns: 1fr 1fr;
  }

  .action-card {
    grid-column: span 2;
  }

  .preview-card {
    grid-column: span 2;
  }
}

@media (max-width: 860px) {
  body {
    padding: 14px;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .inline-fields,
  .meta-grid {
    grid-template-columns: 1fr;
  }

  .format-grid {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 16px;
  }

  .preview-wrap {
    min-height: 260px;
    max-height: 360px;
  }

  .btn {
    width: 100%;
  }

  .action-row .btn,
  .drop-actions .btn,
  .batch-actions .btn,
  .zoom-actions .btn {
    width: auto;
  }

  .batch-item {
    grid-template-columns: 48px 1fr;
  }

  .batch-actions {
    grid-column: span 2;
    justify-content: flex-end;
  }
}
