:root {
  --bg: #f5f6f0; --panel: #fff; --ink: #1f2a1b; --muted: #5f6b58; --line: #dde3d2;
  --accent: #2d5025; --accent-ink: #fff; --warn: #d4461a; --hover: #f1f4ea;
  --soft: #eef2e3; --focus: #fec700; --qty-bg: #fffbe6; --ok: #2f7d32; --amber: #a66b00;
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); padding: 8px 14px; }
button:hover { background: var(--hover); }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.primary:hover { background: #223d1c; }
button.danger { color: var(--warn); border-color: #f0c2b2; }
button:disabled { opacity: .45; cursor: default; }
button.big { width: 100%; padding: 14px; font-size: 18px; }
input[type=text], input[type=search], input[type=number], input[type=password], input[type=date], select, textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fff; width: 100%; font-size: 16px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(254,199,0,.35); }
textarea { min-height: 70px; resize: vertical; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 19px; color: var(--accent); text-decoration: none; }
.who { margin-left: auto; font-size: 14px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.who button { padding: 4px 10px; font-size: 13px; }
.banner { background: #fff4cc; border-bottom: 1px solid #f0dc8a; padding: 8px 16px; font-size: 14px; }
.view { max-width: 760px; margin: 0 auto; padding: 16px; }
h2 { font-size: 21px; margin: 4px 0 12px; color: var(--accent); }
h3 { font-size: 16px; margin: 18px 0 8px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 16px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); min-height: 96px; }
.tile:hover { border-color: var(--accent); }
.tile b { font-size: 17px; color: var(--accent); }
.tile span { font-size: 13px; color: var(--muted); }
.stats { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0 0; }
.stat { flex: 1 1 140px; background: var(--soft); border-radius: 10px; padding: 10px 12px; text-decoration: none; color: var(--ink); }
.stat b { display: block; font-size: 22px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label, .label { font-weight: 600; font-size: 15px; }
.hint { font-size: 13px; color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > * { flex: 1 1 auto; }
.row.end { justify-content: flex-end; }
.row.end > * { flex: 0 0 auto; }
.picker { position: relative; }
.suggest { position: absolute; left: 0; right: 0; top: 100%; z-index: 4; background: #fff; border: 1px solid var(--line); border-radius: 8px; max-height: 320px; overflow: auto; box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.suggest button { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 10px 12px; }
.suggest button:last-child { border-bottom: 0; }
.chosen { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--soft); border-radius: 8px; font-weight: 600; }
.chosen button { margin-left: auto; font-size: 13px; padding: 4px 10px; }
.sizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.size { text-align: left; padding: 10px 12px; border: 2px solid var(--line); }
.size b { display: block; font-size: 15px; }
.size span { font-size: 12px; color: var(--muted); }
.size.on { border-color: var(--accent); background: var(--soft); }
.size:disabled { opacity: .4; }
.stepper { display: inline-flex; }
.stepper button { width: 52px; font-size: 24px; font-weight: 700; padding: 0; background: #ffe680; border: 2px solid var(--focus); color: #5a4300; }
.stepper button:first-child { border-radius: 10px 0 0 10px; border-right: 0; }
.stepper button:last-child { border-radius: 0 10px 10px 0; border-left: 0; }
.stepper input { width: 110px; text-align: center; font-size: 24px; font-weight: 700; border: 2px solid var(--focus); background: var(--qty-bg); border-radius: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 14px; }
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.chip .shade { font-size: 11px; opacity: .8; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { flex: 1; border: 0; border-radius: 0; border-right: 1px solid var(--line); padding: 10px 6px; }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--accent); color: #fff; }
.entry { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.entry .head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.entry .what { font-size: 16px; font-weight: 600; margin: 4px 0; }
.entry .notes { font-size: 14px; white-space: pre-wrap; }
.entry .steps { margin: 8px 0 0; padding-left: 0; list-style: none; font-size: 14px; }
.entry .steps li { padding: 3px 0 3px 24px; position: relative; }
.entry .steps li::before { content: "○"; position: absolute; left: 4px; color: var(--muted); }
.entry .steps li.done::before { content: "✓"; color: var(--ok); }
.entry .steps li.err { color: var(--warn); }
.entry .steps li.err::before { content: "!"; color: var(--warn); font-weight: 700; }
.entry .steps li.note::before { content: "i"; }
.entry .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.entry .actions input { flex: 1 1 200px; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--soft); color: var(--accent); }
.pill.pending { background: #fff4cc; color: var(--amber); }
.pill.done { background: #e3f2e1; color: var(--ok); }
.pill.rejected, .pill.failed { background: #fde3d9; color: var(--warn); }
.pill.to-enter { background: #e6eefc; color: #2d4f9e; }
.pill.cancelled { background: #eee; color: #777; }
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
td.n, th.n { text-align: right; }
.due-now { color: var(--warn); font-weight: 600; }
.due-soon { color: var(--amber); font-weight: 600; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; background: var(--panel); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; font-size: 12px; text-decoration: none; color: var(--muted); position: relative; }
.tabs a.on { color: var(--accent); font-weight: 700; }
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.badge { position: absolute; top: 3px; left: calc(50% + 6px); background: var(--warn); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 6px; }
.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); background: #1f2a1b; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 15px; z-index: 9; max-width: 90vw; }
.toast.error { background: var(--warn); }
.err { color: var(--warn); font-weight: 600; }
.login { max-width: 380px; margin: 40px auto; }
details summary { cursor: pointer; font-weight: 600; }
@media (min-width: 900px) { .view { max-width: 900px; } }
