h1 {
  margin-top: 32px;
  margin-bottom: 8px;
  font-size: 2rem;
}

.lede {
  color: var(--muted);
  margin-top: 0;
  margin-bottom: 28px;
  max-width: 60ch;
}

.tool {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  align-items: start;
}

.tool__controls,
.tool__output {
  display: flex;
  flex-direction: column;
}

label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
}

select, input[type="number"], input[type="range"] {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  margin-bottom: 16px;
}

input[type="range"] { padding: 0; accent-color: var(--accent); }

.dropzone {
  border: 2px dashed var(--line);
  border-radius: 8px;
  padding: 24px 16px;
  text-align: center;
  color: var(--muted);
  margin-bottom: 12px;
  transition: border-color 0.15s, background 0.15s;
}

.dropzone p { margin: 0; }

.dropzone--active {
  border-color: var(--accent);
  background: var(--bg);
}

.filepick {
  display: inline;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
  font-weight: 600;
  margin: 0;
}

.filemeta {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 12px;
  word-break: break-all;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field { margin-bottom: 4px; }

.checkline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 16px;
}

.checkline input { accent-color: var(--accent); width: 16px; height: 16px; }

.presets {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.presets button {
  flex: 1;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 6px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
}

.presets button:hover { border-color: var(--accent); color: var(--accent); }

.note {
  font-size: 0.8rem;
  color: var(--muted);
  margin: -10px 0 16px;
}

.preview {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 14px;
}

.preview canvas { max-width: 100%; max-height: 100%; }

.stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
}

.stat__label {
  font-size: 0.85rem;
  color: var(--muted);
}

.stat__value {
  font-size: 1rem;
  font-weight: 700;
}

.stat__value.smaller { color: #1e8e3e; }
.stat__value.larger { color: #c0392b; }

button#downloadBtn {
  font: inherit;
  font-weight: 600;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
}

button#downloadBtn:hover:not(:disabled) { filter: brightness(1.08); }

button#downloadBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hint {
  color: #c0392b;
  font-size: 0.85rem;
  margin: 0 0 12px;
}

.faq { margin-top: 48px; max-width: 70ch; }

.faq h2 { font-size: 1.3rem; margin-top: 32px; }

details {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

details summary {
  cursor: pointer;
  font-weight: 600;
}

@media (max-width: 640px) {
  .tool { grid-template-columns: 1fr; }
  .stat { flex-direction: column; align-items: flex-start; gap: 2px; }
}
