:root {
  --bg: #f4f7f5;
  --card: #ffffff;
  --ink: #12201a;
  --muted: #5b6b63;
  --line: #dfe7e2;
  --brand: #0f9d58;
  --brand-dark: #0b7a44;
  --accent: #ffcc33;
  --danger: #c0392b;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(18, 32, 26, .08);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1512;
    --card: #16201b;
    --ink: #e8f0ec;
    --muted: #9fb1a8;
    --line: #26332d;
    --brand: #25c26e;
    --brand-dark: #1ea35c;
    --shadow: 0 6px 24px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}
a { color: var(--brand-dark); }
@media (prefers-color-scheme: dark) { a { color: var(--brand); } }
img, video, canvas { max-width: 100%; }

.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }

header.site {
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
header.site .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-top: 12px; padding-bottom: 12px;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; color: var(--ink); text-decoration: none; }
.logo svg { width: 32px; height: 32px; flex: none; }
nav.top { display: flex; gap: 14px; font-size: .95rem; flex-wrap: wrap; }
nav.top a { text-decoration: none; color: var(--muted); }
nav.top a:hover { color: var(--ink); }

.hero { padding: 28px 0 8px; }
.hero h1 { font-size: clamp(1.6rem, 4.5vw, 2.3rem); line-height: 1.15; margin: 0 0 10px; }
.hero p { margin: 0; color: var(--muted); font-size: 1.05rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin: 18px 0;
}
.card h2 { margin: 0 0 4px; font-size: 1.15rem; }
.card .hint { margin: 0 0 12px; color: var(--muted); font-size: .93rem; }
.step-n {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: .85rem; font-weight: 800; margin-right: 8px;
}

.drop {
  display: block; border: 2px dashed var(--line); border-radius: 12px; padding: 18px; text-align: center;
  cursor: pointer; color: var(--muted); transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--brand); background: rgba(15, 157, 88, .06); }
.drop input { display: none; }
.drop strong { color: var(--ink); }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.tab {
  border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 999px;
  padding: 8px 14px; font: inherit; font-size: .93rem; cursor: pointer;
}
.tab[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 12px 18px; font: inherit; font-weight: 700; cursor: pointer;
  background: var(--brand); color: #fff; text-decoration: none;
}
.btn:hover { background: var(--brand-dark); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.big { width: 100%; padding: 15px; font-size: 1.05rem; }
.btn.rec { background: var(--danger); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

label.field { display: block; margin: 10px 0; font-size: .95rem; }
label.field span { display: block; margin-bottom: 4px; color: var(--muted); }
input[type="range"] { width: 100%; accent-color: var(--brand); }
input[type="text"], select {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); font: inherit;
}
input[type="color"] { width: 44px; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: none; padding: 2px; }

.preview-box {
  width: 100%; max-width: 320px; aspect-ratio: 1 / 1; margin: 8px auto;
  border-radius: 14px; overflow: hidden; border: 1px solid var(--line);
  background-image: linear-gradient(45deg, #ccc 25%, transparent 25%), linear-gradient(-45deg, #ccc 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ccc 75%), linear-gradient(-45deg, transparent 75%, #ccc 75%);
  background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}
.preview-box canvas { width: 100%; height: 100%; display: block; }

.status { font-size: .93rem; color: var(--muted); min-height: 1.4em; margin: 8px 0 0; }
.status.err { color: var(--danger); }
.ok-box { border-left: 4px solid var(--brand); padding: 10px 14px; background: rgba(15, 157, 88, .07); border-radius: 8px; }
.warn-box { border-left: 4px solid var(--accent); padding: 10px 14px; background: rgba(255, 204, 51, .12); border-radius: 8px; }
.hidden { display: none !important; }

.result video { width: 100%; max-width: 320px; display: block; margin: 8px auto; border-radius: 14px; }

.ad-slot { margin: 18px 0; min-height: 0; }

.prose { overflow-wrap: anywhere; }
.prose h2 { margin-top: 28px; }
.prose li { margin: 6px 0; }
.faq details { border-bottom: 1px solid var(--line); padding: 10px 0; }
.faq summary { cursor: pointer; font-weight: 700; }

.kofi { text-align: center; }
.kofi .btn { background: #ff5e5b; }
.kofi .btn:hover { background: #e54d4a; }

footer.site { margin-top: 40px; padding: 24px 0 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
footer.site nav { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
footer.site a { color: var(--muted); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
