:root {
  --bg: #f4f5f7; --card: #fff; --ink: #1c1f24; --muted: #6b7280; --line: #e2e5ea;
  --primary: #1f6feb; --primary-ink: #fff; --danger: #d92d20;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14161a; --card: #1e2127; --ink: #eceff4; --muted: #98a2b3; --line: #2f343c; --primary: #4c8dff; --danger: #ff6b5e; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 -apple-system, "Segoe UI", "Noto Sans KR", sans-serif; }
.wrap { max-width: 560px; margin: 0 auto; padding: 16px; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.wrap--narrow { max-width: 380px; padding-top: 12vh; }
.wrap--wide { max-width: 960px; }
h1 { font-size: 20px; margin: 0; }
h2 { font-size: 17px; margin: 0 0 8px; }
.bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 8px; }
.bar nav { display: flex; align-items: center; gap: 12px; }
.inline { display: inline; margin: 0; }
.link { background: none; border: 0; padding: 4px; color: var(--primary); font: inherit; cursor: pointer; text-decoration: none; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row--nowrap { flex-wrap: nowrap; }
input[type=search], input[type=password], input[type=text], textarea {
  width: 100%; padding: 11px 12px; font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px;
}
textarea { resize: vertical; min-height: 56px; }
label { display: block; margin-bottom: 6px; font-weight: 600; }
.btn { padding: 11px 16px; font: inherit; font-weight: 600; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; white-space: nowrap; }
.btn--primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.muted, .hint { color: var(--muted); font-size: 14px; margin: 6px 0; }
.error { color: var(--danger); margin: 8px 0; }
.camera { position: relative; border-radius: 10px; overflow: hidden; background: #000; margin-bottom: 8px; }
.camera video { display: block; width: 100%; max-height: 46vh; object-fit: cover; }
.camera__guide { position: absolute; left: 10%; right: 10%; top: 36%; bottom: 36%; border: 2px solid rgba(255,255,255,.85); border-radius: 8px; box-shadow: 0 0 0 9999px rgba(0,0,0,.25); pointer-events: none; }
.list { list-style: none; margin: 10px 0 0; padding: 0; }
.list li button { width: 100%; text-align: left; padding: 10px 4px; background: none; border: 0; border-bottom: 1px solid var(--line); font: inherit; color: var(--ink); cursor: pointer; }
.list small { display: block; color: var(--muted); }
.result dl { margin: 10px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: baseline; }
.result dt { color: var(--muted); }
.result dd { margin: 0; font-size: 22px; font-weight: 700; white-space: pre-line; }
#rStock.is-empty { font-size: 16px; font-weight: 500; color: var(--muted); }
#rLocation.is-empty { font-size: 16px; font-weight: 500; color: var(--muted); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table td.num { white-space: nowrap; }
.table .name { font-weight: 600; }
.table .code { color: var(--muted); font-size: 12px; }
.table textarea { min-width: 200px; }
.saved { color: var(--primary); font-size: 13px; }
