:root {
  color-scheme: light;
  font-family: system-ui, sans-serif;
  background: #f7f5ec;
  color: #20332c;
  --forest: #123e32;
  --muted: #4b6256;
  --line: #cbd9ca;
  --surface: #fffef8;
  --lime: #d9f3a6;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  border-top: 6px solid var(--forest);
}

main {
  width: min(100% - 2rem, 42rem);
  margin-inline: auto;
  padding-block: clamp(2.4rem, 8vw, 5rem) 2rem;
}

p, h1, figure, dl, dd { margin: 0; }

.brand {
  display: inline-block;
  padding: .3rem .66rem .36rem;
  border-radius: .35rem;
  background: var(--lime);
  color: var(--forest);
  font-size: .875rem;
  font-weight: 800;
  letter-spacing: -.025em;
}

h1 {
  margin-block: 1.1rem .7rem;
  color: var(--forest);
  font-size: clamp(2.1rem, 7vw, 3.65rem);
  font-weight: 750;
  line-height: 1;
  letter-spacing: -.04em;
}

.intro > p:last-child {
  max-width: 34rem;
  color: var(--muted);
  line-height: 1.55;
}

.workspace {
  margin-top: 1.8rem;
  padding: clamp(.85rem, 3vw, 1.4rem);
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: var(--surface);
  box-shadow: 0 .45rem 1.8rem rgba(18, 62, 50, .06);
}

.drop-area {
  overflow: hidden;
  border: 1px dashed #7e9b87;
  border-radius: .75rem;
  background: #f3f7ed;
}

.picker {
  position: relative;
  display: flex;
  min-height: 12.6rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  padding: 1.4rem;
  text-align: center;
  cursor: pointer;
}

.picker input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.drop-area:hover, .drop-area.drag-over { background: #eaf3df; }

.drop-area:focus-within, .drop-area.drag-over, .selection.drag-over, button:focus-visible {
  outline: 3px solid #2a7957;
  outline-offset: 3px;
}

.upload-mark {
  display: grid;
  width: 2.85rem;
  height: 2.85rem;
  margin-bottom: .35rem;
  place-items: center;
  border-radius: .75rem;
  background: var(--forest);
  color: var(--lime);
  font-size: 1.65rem;
  line-height: 1;
}

.picker-title {
  color: var(--forest);
  font-size: 1.05rem;
  font-weight: 720;
}

.picker-detail, .file-details, dt, .safety {
  color: var(--muted);
  font-size: .875rem;
  line-height: 1.5;
}

.selection {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: #f3f7ed;
}

.selection img {
  display: block;
  width: 100%;
  max-height: 22rem;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #e8eee4;
}

.file-details {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
  padding: .35rem .7rem .35rem .9rem;
}

#file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

button {
  min-height: 2.75rem;
  border-radius: .55rem;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.replace {
  flex: none;
  padding-inline: .5rem;
  border: 0;
  background: transparent;
  color: var(--forest);
  text-decoration: underline;
  text-underline-offset: .15em;
}

.actions { margin-top: 1rem; }

.classify {
  width: 100%;
  padding: .6rem 1rem;
  border: 0;
  background: var(--forest);
  color: white;
}

.classify:hover:not(:disabled) { background: #1d5b44; }
.classify:disabled { cursor: wait; opacity: .8; }

.results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .7rem;
  margin-top: 1rem;
}

.result {
  min-width: 0;
  padding: .75rem .9rem;
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: #eff5e8;
}

.result.attention {
  border-color: #dfba85;
  background: #fff1dc;
}

dd {
  margin-top: .2rem;
  color: var(--forest);
  font-size: 1.12rem;
  font-weight: 720;
  overflow-wrap: anywhere;
}

.attention dd { color: #734001; }

.error {
  margin-top: .8rem;
  color: #8b241a;
  font-size: .95rem;
  line-height: 1.45;
}

.safety { margin: .85rem .15rem 0; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 28rem) {
  .results { grid-template-columns: 1fr; }
}
