:root {
  --green: #22c55e;
  --green-dark: #16a34a;
  --green-light: #dcfce7;
  --green-pale: #f0fdf4;
  --orange: #f97316;
  --text: #14532d;
  --muted: #4b5563;
  --bg: #f0fdf4;
  --card: #ffffff;
  --border: #bbf7d0;
  --radius: 16px;
  --shadow: 0 4px 20px rgba(22, 163, 74, 0.12);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 18px; -webkit-text-size-adjust: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--green-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  color: #fff;
  padding: 1rem 1.25rem;
  text-align: center;
  box-shadow: var(--shadow);
}
.site-header .brand {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.site-header .tagline {
  font-size: 0.95rem;
  opacity: 0.95;
  margin-top: 0.25rem;
}
.site-nav {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}
.site-nav a {
  color: #fff;
  background: rgba(255,255,255,0.2);
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}
.site-nav a:hover { background: rgba(255,255,255,0.35); }

main {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2rem;
}

.hero {
  text-align: center;
  margin-bottom: 1.5rem;
}
.hero h1 {
  font-size: 1.45rem;
  margin-bottom: 0.5rem;
}
.hero p { color: var(--muted); font-size: 1rem; }

.privacy-banner {
  background: var(--green-light);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
  text-align: center;
  font-weight: 600;
}

.tool-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 560px) {
  .tool-grid { grid-template-columns: 1fr 1fr; }
}
.tool-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform 0.15s, box-shadow 0.15s;
}
.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(22, 163, 74, 0.18);
}
.tool-card .icon { font-size: 2.2rem; }
.tool-card h2 { font-size: 1.15rem; }
.tool-card p { color: var(--muted); font-size: 0.95rem; flex: 1; }
.tool-card .btn {
  margin-top: 0.5rem;
  text-align: center;
}

.btn {
  display: inline-block;
  background: var(--green);
  color: #fff !important;
  border: none;
  border-radius: 12px;
  padding: 0.9rem 1.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none !important;
  min-height: 52px;
  line-height: 1.2;
  transition: background 0.15s;
}
.btn:hover { background: var(--green-dark); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary {
  background: #fff;
  color: var(--green-dark) !important;
  border: 2px solid var(--green);
}
.btn-secondary:hover { background: var(--green-light); }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.btn-row .btn { flex: 1; min-width: 140px; }

.panel {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}
.panel h1 { font-size: 1.35rem; margin-bottom: 0.35rem; }
.panel .desc { color: var(--muted); margin-bottom: 1rem; }

.dropzone {
  border: 3px dashed var(--green);
  border-radius: var(--radius);
  background: var(--green-pale);
  padding: 1.75rem 1rem;
  text-align: center;
  cursor: pointer;
  margin-bottom: 1rem;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.dropzone.dragover { background: var(--green-light); border-color: var(--green-dark); }
.dropzone .dz-icon { font-size: 2.5rem; }
.dropzone strong { font-size: 1.1rem; }
.dropzone span { color: var(--muted); font-size: 0.95rem; }
.dropzone input[type=file] { display: none; }

.controls {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1rem;
}
.controls label {
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.controls input[type=range] { width: 100%; height: 36px; }
.controls select, .controls input[type=number] {
  font-size: 1.05rem;
  padding: 0.7rem 0.85rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  min-height: 52px;
  background: #fff;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  border: 2px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 48px;
}
.chip.active {
  background: var(--green);
  color: #fff;
  border-color: var(--green-dark);
}

.preview-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 1rem 0;
}
@media (min-width: 560px) {
  .preview-wrap { grid-template-columns: 1fr 1fr; }
}
.preview-box {
  background: #f8fafc;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem;
  text-align: center;
}
.preview-box h3 {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  color: var(--muted);
}
.preview-box img, .preview-box canvas {
  max-width: 100%;
  max-height: 280px;
  border-radius: 8px;
  background:
    linear-gradient(45deg, #e5e7eb 25%, transparent 25%),
    linear-gradient(-45deg, #e5e7eb 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e5e7eb 75%),
    linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.meta { font-size: 0.9rem; color: var(--muted); margin-top: 0.35rem; }

.status {
  margin: 0.75rem 0;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-weight: 600;
  display: none;
}
.status.show { display: block; }
.status.info { background: #e0f2fe; color: #075985; }
.status.ok { background: var(--green-light); color: var(--green-dark); }
.status.err { background: #fee2e2; color: #991b1b; }

.ad-slot {
  border: 2px dashed #cbd5e1;
  background: #f8fafc;
  color: #94a3b8;
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
  font-size: 0.85rem;
  margin: 1.25rem 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-footer {
  background: #fff;
  border-top: 2px solid var(--border);
  padding: 1.25rem 1rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}
.site-footer a { font-weight: 600; }

.back-link {
  display: inline-block;
  margin-bottom: 0.75rem;
  font-weight: 700;
  font-size: 1rem;
}
