:root {
  color-scheme: light;
  font: 16px/1.5 system-ui, sans-serif;
  color: #23332c;
  background: #f3f4ed;
  --line: #dce1d7;
  --muted: #4e6256;
}
* { box-sizing: border-box; }
body { margin: 0; }
main { width: min(1120px, calc(100% - 32px)); margin: 40px auto; }
header { margin-bottom: 25px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); letter-spacing: -.05em; line-height: 1.1; }
header p { color: var(--muted); margin-top: 9px; }
h2, legend { font-weight: 700; font-size: 1.13rem; }
.workspace { display: grid; grid-template-columns: minmax(240px, .42fr) minmax(0, 1fr); gap: 16px; }
.card { background: #fffefa; border: 1px solid var(--line); border-radius: 17px; padding: 21px; }
fieldset { border: 0; padding: 0; margin: 0; }
fieldset + fieldset { margin-top: 23px; }
legend { padding: 0; margin-bottom: 8px; }
label { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 0; }
label span { white-space: nowrap; color: var(--muted); font-size: .85rem; }
input { font: inherit; font-size: 1rem; color: inherit; width: 7rem; min-height: 40px; padding: 6px 8px; border: 1px solid #aeb9af; border-radius: 7px; background: #fff; }
input:focus-visible { outline: 2px solid #367956; outline-offset: 2px; }
.view { background: #e8eee1; display: flex; flex-direction: column; }
canvas { display: block; width: 100%; height: clamp(240px, 34vw, 340px); margin: auto 0; }
.dimensions { text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; min-height: 24px; }
.results { margin-top: 16px; }
.result-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
#count, #stock, .note { color: var(--muted); }
#stock { margin-top: 6px; overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; margin: 14px 0; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 8px; text-align: right; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { text-align: left; }
thead { background: #eef1e8; }
.note { font-size: .9rem; max-width: 76ch; }
@media (max-width: 640px) {
  main { margin: 24px auto; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 15px; }
  th, td { padding: 8px 5px; font-size: .88rem; }
}
