:root {
  color-scheme: light;
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
  color: #1d302d;
  background: #edf3ee;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at top left, #d6e8df, transparent 55%), #edf3ee; }
.page { width: min(1050px, 92%); margin: 32px auto; display: grid; gap: 18px; }
.hero, .panel { border: 1px solid #d5e2d9; border-radius: 18px; padding: 26px; background: #fff; box-shadow: 0 12px 35px #173a2510; }
.hero { background: #133b32; color: #f8fff9; }
.back { color: #c1e9d1; text-decoration: none; }
.eyebrow { color: #b6d6c2; font-size: .75rem; font-weight: bold; letter-spacing: .14em; margin-top: 30px; }
h1 { font-size: clamp(2.4rem, 6vw, 4rem); line-height: 1; margin: 0 0 16px; }
h2 { font-size: 1.3rem; margin: 0 0 16px; }
p { line-height: 1.55; }
.hero p { max-width: 66ch; }
.privacy { font-weight: bold; color: #c6ead5; margin-bottom: 0; }
.upload { display: flex; flex-direction: column; gap: 6px; border: 2px dashed #91b6a0; border-radius: 12px; padding: 22px; background: #f3f9f4; cursor: pointer; }
.upload span, .hint, .settings label span { font-size: .88rem; color: #536d60; }
#image-file { margin-top: 12px; max-width: 100%; }
#status { margin-bottom: 0; font-weight: bold; }
#status.error { color: #a22c24; }
#workspace { display: grid; gap: 18px; }
#workspace[hidden] { display: none; }
.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; margin-bottom: 20px; }
.preset-label { font-weight: bold; margin: 0 0 10px; }
.preset-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.preset-button { color: #17684d; background: #e7f2eb; border: 1px solid #9bbba8; }
.preset-button:hover { background: #d3e8da; }
.preset-button[aria-pressed="true"] { color: white; background: #17684d; border-color: #17684d; }
.advanced-settings { border: 1px solid #d5e2d9; border-radius: 10px; margin: 16px 0; padding: 12px 14px; }
.advanced-settings summary { cursor: pointer; font-weight: bold; }
.advanced-settings[open] .settings { margin-top: 20px; }
label { font-weight: bold; }
.checkbox-setting { display: flex; align-items: center; gap: 8px; }
.settings label { display: grid; align-content: start; gap: 8px; }
.settings label span { font-weight: normal; }
input[type="number"] { width: 100%; padding: 8px; border: 1px solid #aebfb4; border-radius: 7px; font: inherit; }
input[type="range"] { width: 100%; accent-color: #17684d; }
button { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; padding: 10px 15px; background: #17684d; color: white; font: inherit; font-weight: bold; cursor: pointer; text-decoration: none; }
button:hover { background: #104c38; }
.download { background: #24559b; }
.download:hover { background: #1c4279; }
button:disabled { opacity: .5; cursor: not-allowed; }
button:focus-visible, input:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid #e4a927; outline-offset: 3px; }
.scan-wrap { overflow: auto; background: #15241d; border-radius: 10px; text-align: center; line-height: 0; }
#scan { max-width: 100%; height: auto; cursor: crosshair; touch-action: none; }
.crops { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 15px; margin-top: 20px; }
.crop { border: 1px solid #d5e2d9; border-radius: 12px; padding: 14px; min-width: 0; }
.crop h3 { margin: 0 0 10px; font-size: 1rem; }
.crop-preview { height: 150px; display: flex; align-items: center; justify-content: center; padding: 6px; border-radius: 6px; background: #e7ece8; }
.crop-preview canvas { display: block; flex-shrink: 0; width: min(100%, calc(138px * var(--preview-ratio))); height: auto; max-height: 100%; outline: 1px solid #536d60; }
.coordinates { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 12px 0; }
.coordinates label { font-size: .8rem; }
.coordinates input { display: block; margin-top: 4px; font-size: .9rem; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
#download-status:empty { display: none; }
#download-status.error { color: #a22c24; }
.remove { color: #83372f; background: #f9eae8; }
.remove:hover { background: #f0d7d3; }
footer { text-align: center; color: #536d60; font-size: .85rem; padding: 8px; }
@media (max-width: 600px) {
  .page { width: 94%; margin: 16px auto; }
  .hero, .panel { padding: 18px; }
}
