:root {
  --brand: #2f9172;
  --ink: #0f1c18;
}

[x-cloak] { display: none !important; }

body.bg-mesh {
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(174, 224, 203, 0.55), transparent 55%),
    radial-gradient(900px 500px at -10% 20%, rgba(213, 239, 229, 0.7), transparent 50%),
    linear-gradient(180deg, #f7fbf9 0%, #eef6f2 45%, #f5f8f6 100%);
  color: var(--ink);
}

.noise-overlay {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.tool-card {
  display: block;
  border-radius: 1.75rem;
  border: 1px solid rgba(47, 145, 114, 0.12);
  background: rgba(255, 255, 255, 0.82);
  padding: 1.35rem;
  box-shadow: 0 18px 50px -28px rgba(15, 28, 24, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.tool-card:hover {
  transform: translateY(-3px);
  border-color: rgba(47, 145, 114, 0.35);
  box-shadow: 0 22px 55px -24px rgba(34, 116, 91, 0.35);
}

.dropzone {
  border: 2px dashed rgba(47, 145, 114, 0.35);
  border-radius: 1.75rem;
  background: rgba(255, 255, 255, 0.75);
  padding: 2.5rem 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.dropzone-active,
.dropzone:hover {
  border-color: #2f9172;
  background: rgba(238, 248, 244, 0.95);
}

.field {
  width: 100%;
  border-radius: 1rem;
  border: 1px solid #d5efe5;
  background: #fff;
  padding: 0.7rem 0.95rem;
  font-size: 0.875rem;
}

.field:focus {
  outline: none;
  border-color: #2f9172;
  box-shadow: 0 0 0 3px rgba(47, 145, 114, 0.2);
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

main > section {
  animation: rise-in 0.45s ease both;
}

.dropzone-compact {
  padding: 1.5rem 1rem;
}

@media (min-width: 640px) {
  .dropzone-compact {
    padding: 2.5rem 1.25rem;
  }
}

.btn-primary {
  border-radius: 1rem;
  background: #22745b;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  padding: 0.75rem 1rem;
  transition: background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary:hover { background: #1c5d4a; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  border-radius: 1rem;
  border: 1px solid #d5efe5;
  background: #fff;
  color: #1c5d4a;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.65rem 0.85rem;
  transition: background 0.15s ease, border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn-secondary:hover { background: #eef8f4; border-color: #7cc9ad; }
.btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }

.chip {
  border-radius: 999px;
  border: 1px solid #d5efe5;
  background: #fff;
  color: #24352f;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  min-height: 2rem;
  -webkit-tap-highlight-color: transparent;
}
.chip-active {
  background: #22745b;
  border-color: #22745b;
  color: #fff;
}

.crop-wrap {
  width: 100%;
  max-height: min(62vh, 520px);
  background: #0f1c18;
  border-radius: 1rem;
  overflow: hidden;
  touch-action: none;
}

.crop-wrap img {
  display: block;
  max-width: 100%;
}

/* Cropper.js mobile polish */
.cropper-container {
  direction: ltr; /* cropper math is LTR; keep UI chrome RTL outside */
}
.cropper-view-box,
.cropper-face {
  border-radius: 2px;
}
.cropper-line,
.cropper-point {
  background-color: #2f9172;
}
.cropper-point {
  width: 8px;
  height: 8px;
  opacity: 0.95;
}
.cropper-point.point-se {
  width: 10px;
  height: 10px;
}

@media (max-width: 640px) {
  .tool-card:hover {
    transform: none;
  }
  .crop-wrap {
    max-height: min(55vh, 420px);
  }
  .cropper-point {
    width: 12px;
    height: 12px;
  }
  .cropper-point.point-se {
    width: 14px;
    height: 14px;
  }
}
