:root {
  color-scheme: light;
  --ink: #202923;
  --muted: #59675e;
  --paper: #f7f8f4;
  --line: #dce2d9;
  --accent: #d9f590;
  font: 16px/1.5 system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }
[hidden] { display: none !important; }
.shell { width: min(100% - 2.5rem, 61rem); margin-inline: auto; }
.top { border-bottom: 1px solid var(--line); }
.bar, .foot { display: flex; justify-content: space-between; align-items: center; gap: 1.25rem; }
.bar { min-height: 4.5rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-size: 1.15rem; font-weight: 800; text-decoration: none; }
.mark { display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: .55rem; background: var(--accent); }
nav { display: flex; gap: 1.5rem; font-size: .88rem; }
nav a, .foot a { text-decoration: none; }
nav a:hover, .foot a:hover { text-decoration: underline; }
.intro { margin-block: clamp(2.7rem, 7vw, 5.1rem) 2.25rem; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(3.25rem, 10vw, 6.3rem); font-weight: 820; letter-spacing: -.085em; line-height: .98; }
h1 span { color: #548134; }
.intro p { margin-top: 1.2rem; max-width: 38rem; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.2rem); }
.tool { display: grid; grid-template-columns: 1.2fr 1fr; gap: 1rem; }
.drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 19rem;
  padding: 1.5rem;
  border: 2px dashed #aebfa8;
  border-radius: 1.15rem;
  background: #edf3e8;
  text-align: center;
  cursor: pointer;
}
.drop:hover, .drop.dragging { background: #e4f0cf; border-color: #548134; }
.drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop strong { margin-top: .9rem; overflow-wrap: anywhere; max-width: 100%; }
.drop small { margin-top: .75rem; }
.drop small, .drop > span:not(.upload-icon) { color: var(--muted); }
.upload-icon { display: grid; place-items: center; width: 3rem; height: 3rem; border: 1px solid #cbd7c5; border-radius: .8rem; background: #fff; font-size: 1.65rem; }
.settings, .result { border: 1px solid var(--line); border-radius: 1.15rem; background: #fff; padding: 1.35rem; }
.settings { display: grid; gap: .9rem; align-content: start; }
h2 { font-size: 1.2rem; line-height: 1.25; letter-spacing: -.025em; }
.settings label { display: block; font-size: .86rem; font-weight: 650; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
select, button, input { font: inherit; }
select { display: block; width: 100%; margin-top: .35rem; padding: .55rem; border: 1px solid var(--line); border-radius: .5rem; color: var(--ink); background: #fff; }
output { float: right; color: var(--muted); font-variant-numeric: tabular-nums; }
input[type="range"] { display: block; width: 100%; margin: .35rem 0 0; accent-color: #46713b; }
.mode-note { color: var(--muted); font-size: .85rem; }
button, .download { display: inline-flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .75rem .9rem; border: 1px solid transparent; border-radius: .65rem; background: #233229; color: #fff; font-weight: 650; text-decoration: none; cursor: pointer; }
button:disabled { background: #e8ece6; color: #59675e; cursor: default; }
button:not(:disabled):hover, .download:hover { background: #35503b; }
.status, .result { grid-column: 1 / -1; }
.status { color: var(--muted); }
.status.error { color: #a22c32; }
.result { display: grid; grid-template-columns: minmax(0, 12rem) 1fr; gap: 1.25rem; align-items: center; }
figure { margin: 0; display: grid; place-items: center; min-height: 5rem; background: #edf1e9; border-radius: .65rem; overflow: hidden; }
figure img { display: block; max-width: 100%; max-height: 12rem; }
.result p { margin-block: .4rem .8rem; color: var(--muted); }
.guide { margin-block: 3.25rem; max-width: 46rem; }
.guide h2 { font-size: 1.55rem; margin-bottom: 1rem; }
details { border-top: 1px solid var(--line); }
details:last-child { border-bottom: 1px solid var(--line); }
summary { font-weight: 650; padding-block: .85rem; cursor: pointer; }
details p { padding-bottom: 1rem; color: var(--muted); }
.foot { padding-block: 1.2rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
:focus-visible, .drop:has(input:focus-visible) { outline: 3px solid #548134; outline-offset: 3px; }
@media (max-width: 42rem) {
  .tool { grid-template-columns: 1fr; }
  .drop { min-height: 13rem; }
  .result { grid-template-columns: 1fr; }
  .bar { min-height: 4rem; }
  nav { gap: .8rem; }
}
@media (max-width: 23rem) {
  .shell { width: calc(100% - 1.5rem); }
  .field-pair { grid-template-columns: 1fr; }
}
