:root{color-scheme:light;font-family:system-ui,sans-serif;color:#142126;background:#eef4f1;--green:#155b45;--line:#cad8d1}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0;line-height:1.5}
header,footer{background:#102b25;color:#fff;padding:1rem max(1rem,calc((100% - 65rem)/2));display:flex;justify-content:space-between;align-items:center;gap:1rem}
header a{color:inherit}.brand{text-decoration:none;font-weight:750}.brand span{display:inline-block;background:#c7ed85;color:#102b25;border-radius:.45rem;padding:.15rem .5rem;margin-right:.4rem}
main{max-width:65rem;margin:auto;padding:0 1rem 2rem}.intro{padding:2.5rem 0 1.4rem;max-width:44rem}
h1{font-size:clamp(2.15rem,6vw,4rem);line-height:1.03;letter-spacing:-.045em;margin:0}h1 em{color:var(--green);font-style:normal}
h2,p{margin:.25rem 0 .85rem}
form{display:grid;grid-template-columns:1fr 1fr;gap:1rem;align-items:start}
.panel{background:white;border:1px solid var(--line);border-radius:1rem;padding:clamp(1rem,3vw,1.6rem);box-shadow:0 4px 14px #102b2509}
.picker{display:block;border:1px dashed #6f9383;background:#f5faf7;padding:1rem;border-radius:.65rem;font-weight:700;cursor:pointer}
.picker input{display:block;margin-top:.6rem;max-width:100%;font:inherit}
.presets,.pair{display:flex;gap:.65rem;flex-wrap:wrap}.pair label{flex:1 1 7rem}
.presets label{cursor:pointer;border:1px solid var(--line);border-radius:.6rem;padding:.55rem .7rem}
.presets label:has(:checked){background:#e3f1e9;border-color:var(--green)}
label{font-size:.92rem}input[type=number],input[type=range]{display:block;width:100%;min-width:0;margin:.35rem 0 .5rem;accent-color:var(--green)}
input[type=number]{padding:.55rem;border:1px solid #829b90;border-radius:.45rem;font:inherit}
fieldset{border:0;padding:0;margin:0 0 .9rem}legend{font-weight:700;margin-bottom:.45rem}
button,.button{display:inline-block;background:var(--green);color:white;border:0;border-radius:.55rem;padding:.7rem 1rem;font:inherit;font-weight:700;text-decoration:none;cursor:pointer}button:disabled{opacity:.65;cursor:wait}
:focus-visible{outline:3px solid #2179a4;outline-offset:3px}
canvas,#output{display:block;width:auto;max-width:100%;max-height:17rem;object-fit:contain;background:white;margin:.7rem 0}
.hint,#source-size{color:#405850}.result{display:flex;gap:1.25rem;flex-wrap:wrap;align-items:center}
#status{min-height:1.5em;margin:.6rem 0}.help{padding:1.4rem 0 0;max-width:47rem}
@media(max-width:43rem){form{grid-template-columns:1fr}.intro{padding-top:1.65rem}}

#crop.draggable{touch-action:none;cursor:grab}
#crop.draggable:active{cursor:grabbing}

footer a{color:inherit}
