:root {
  --bg: #f7f5f1;
  --card: #ffffff;
  --ink: #1b2521;
  --muted: #7a827c;
  --line: #e9e6df;
  --accent: #12715a;
  --accent-2: #0e5a48;
  --accent-soft: #e4f3ed;
  --coral: #d8623a;
  --coral-soft: #fbeee7;
  --amber-soft: #fbf1dd;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(27, 37, 33, .05), 0 6px 20px rgba(27, 37, 33, .04);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { color-scheme: light; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.wrap { max-width: 560px; margin: 0 auto; padding: 16px 16px 40px; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px;
}
.brand { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 9px; letter-spacing: -0.02em; }
.dot { width: 26px; height: 26px; border-radius: 9px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 600; }
h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.03em; margin: 8px 0 14px; }
h2 { font-size: 15px; font-weight: 600; letter-spacing: -0.02em; margin: 22px 2px 10px; }
h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 8px; }
p { margin: 4px 0; }
.muted { color: var(--muted); font-size: 13px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
label { display: block; font-size: 12.5px; font-weight: 500; color: var(--muted); margin: 10px 0 5px; }
input, select, textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; font-family: inherit; background: #fcfcfb; color: var(--ink);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input::placeholder, textarea::placeholder { color: #a9afa8; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3.5px var(--accent-soft); }
textarea { resize: vertical; min-height: 70px; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; }

button {
  appearance: none; border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 11px 15px; border-radius: 10px; font-size: 14px; font-weight: 500; font-family: inherit; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  transition: background .15s, border-color .15s, transform .05s;
}
button:hover { background: #f6f8f6; border-color: #dcded8; }
button:active { transform: scale(.985); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(18, 113, 90, .22); }
button.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
button.ghost { background: transparent; border-color: transparent; color: var(--accent); box-shadow: none; }
button.danger { color: var(--coral); border-color: #f1d8cd; }
button.sm { padding: 7px 11px; font-size: 13px; border-radius: 9px; }
.btnfull { width: 100%; }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 20px; background: var(--accent-soft); color: var(--accent-2); }
.pill.coral { background: var(--coral-soft); color: #b4491f; }

.list-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 0; border-top: 1px solid var(--line); }
.list-item:first-child { border-top: none; }

/* строка предмета с иконкой */
.item-row { display: flex; align-items: center; gap: 11px; padding: 9px 0; border-top: 1px solid var(--line); }
.item-row:first-child { border-top: none; }
.ibadge { flex: none; width: 38px; height: 38px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.ibadge svg { width: 21px; height: 21px; }
.ibadge.coral { background: var(--coral-soft); color: var(--coral); }
.item-main { flex: 1; min-width: 0; }
.item-title { font-size: 14.5px; font-weight: 500; }
.item-qty { color: var(--muted); font-weight: 400; }
.syn { font-size: 12px; color: var(--muted); margin-top: 1px; }

.hidden { display: none !important; }
.spacer { height: 10px; }
.error { color: var(--coral); font-size: 13px; margin-top: 8px; }
.ok { color: var(--accent); font-size: 13px; margin-top: 8px; }

/* фото + зоны */
.photo-wrap { position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #eef2f0; touch-action: none; user-select: none; }
.photo-wrap img { width: 100%; display: block; }
.photo-empty { display: grid; place-items: center; height: 190px; color: var(--muted); font-size: 14px; text-align: center; padding: 14px; }
.zbox { position: absolute; border: 2.5px solid var(--coral); background: rgba(216, 98, 58, .16); border-radius: 6px; box-sizing: border-box; }
.zbox .zlbl { position: absolute; top: -11px; left: -2px; background: var(--coral); color: #fff; font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 8px; white-space: nowrap; box-shadow: 0 2px 6px rgba(216, 98, 58, .3); }
.zbox.hl { animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .38; } }

.qrbox { text-align: center; }
.qrbox img { width: 210px; height: 210px; background: #fff; padding: 10px; border-radius: 14px; border: 1px solid var(--line); }

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 2px; }
.chips button { border-radius: 22px; padding: 8px 14px; font-size: 13px; background: #fcfcfb; }
.result { display: flex; gap: 12px; align-items: flex-start; border-top: 1px solid var(--line); padding: 13px 0; }
.result:first-child { border-top: none; }
.result .ibadge { margin-top: 1px; }
.path { font-size: 12px; color: var(--accent-2); background: var(--accent-soft); display: inline-block; padding: 2px 9px; border-radius: 7px; margin: 3px 0 7px; }

.tabbar { display: flex; gap: 5px; background: #e7e4dc; border-radius: 12px; padding: 4px; margin-bottom: 14px; }
.tabbar button { flex: 1; border: none; background: transparent; color: #545b56; font-weight: 500; box-shadow: none; }
.tabbar button:hover { background: rgba(255,255,255,.5); color: var(--ink); }
.tabbar button.active { background: #fff; color: var(--accent); box-shadow: 0 1px 3px rgba(27, 37, 33, .14); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
