:root {
  color-scheme: light;
  --paper: #f3f0e8;
  --ink: #1b1914;
  --muted: #5e584e;
  --card: #fffcf7;
  --line: #d9d2c5;
  --green: #0e6b52;
  --green-ink: #08382c;
  --warn: #8d3d12;
  --low: #f6e4d4;
  --focus: #0e6b52;
}

* { box-sizing: border-box; }
html { font-size: 18px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.45 system-ui, "Segoe UI", sans-serif;
}
a { color: var(--green-ink); }
a:hover { text-decoration: none; }
.top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  align-items: center;
  padding: 0.8rem 1.2rem;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.brand { font-weight: 700; text-decoration: none; color: var(--ink); }
nav { display: flex; flex-wrap: wrap; gap: 0.7rem; }
nav a { text-decoration: none; }
nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 0.2rem; }
.logout { margin-left: auto; }
button, input, select, textarea {
  font: inherit;
  color: inherit;
}
button, .logout button {
  background: var(--green);
  color: white;
  border: 0;
  border-radius: 0.4rem;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
}
button:hover { background: var(--green-ink); }
.logout button { background: transparent; color: var(--ink); border: 1px solid var(--line); padding: 0.25rem 0.6rem; }
main { max-width: 52rem; margin: 0 auto; padding: 1.2rem; }
h1 { font-size: 1.7rem; line-height: 1.15; margin: 0 0 0.6rem; }
h2 { font-size: 1.2rem; margin: 1.6rem 0 0.5rem; }
.lead, .muted { color: var(--muted); }
.flash, .error {
  background: var(--card);
  border-left: 4px solid var(--green);
  padding: 0.7rem 0.9rem;
}
.error { border-left-color: var(--warn); }
label { display: grid; gap: 0.25rem; font-size: 0.92rem; }
input, select, textarea {
  width: 100%;
  background: white;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  padding: 0.55rem 0.65rem;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
.weigh-form input { font-size: 1.35rem; padding: 0.7rem; }
.stack, .inline-form, .weigh-form { display: grid; gap: 0.8rem; margin: 0.8rem 0 1.2rem; }
@media (min-width: 720px) {
  .inline-form, .weigh-form { grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); align-items: end; }
  .inline-form button, .weigh-form button { margin-bottom: 0.05rem; }
}
.check { display: flex; gap: 0.5rem; align-items: center; }
.check input { width: auto; }
fieldset { border: 1px solid var(--line); border-radius: 0.5rem; }
.narrow { max-width: 24rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { text-align: left; padding: 0.45rem 0.55rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.low { background: var(--low); }
.remain { font-size: 2.4rem; font-variant-numeric: tabular-nums; margin: 0.2rem 0; }
.remain span { font-size: 1rem; color: var(--muted); }
.bar {
  height: 0.7rem;
  background: var(--line);
  border-radius: 99px;
  position: relative;
  overflow: hidden;
}
.bar::before {
  content: "";
  display: block;
  height: 100%;
  width: var(--p);
  background: var(--green);
}
.bar span { display: block; margin-top: 0.35rem; color: var(--muted); font-size: 0.9rem; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0.6rem; }
.facts div { background: var(--card); border: 1px solid var(--line); border-radius: 0.4rem; padding: 0.5rem 0.7rem; }
dt { color: var(--muted); font-size: 0.8rem; }
dd { margin: 0; }
.dot { display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 50%; border: 1px solid var(--line); vertical-align: baseline; }
.slots, .maker-list, .tare-list, .checks { list-style: none; padding: 0; }
.slots li, .maker-list li, .tare-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.8rem;
  align-items: baseline;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}
.preview { min-height: 1.4rem; font-weight: 650; margin: 0; }
.prose li { margin: 0.35rem 0; }
.sheet { display: flex; flex-wrap: wrap; gap: 3mm; align-items: flex-start; }
.label {
  box-sizing: border-box;
  border: 0.3mm dashed #666;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background: white;
  container-type: size;
}
.label strong {
  font-size: 58cqh;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.label span { font-size: 22cqh; line-height: 1.1; max-width: 100%; overflow: hidden; white-space: nowrap; }
@media print {
  .top, .no-print, .flash { display: none !important; }
  body { background: white; }
  main { max-width: none; padding: 0; }
  .label { break-inside: avoid; }
  @page { margin: 10mm; }
}
