:root {
  --bg: #0c1a16;
  --bg-2: #0f201b;
  --card: #13241f;
  --card-2: #18302a;
  --ink: #f7f4ea;
  --muted: #b7c9c3;
  --gold: #e4c35a;
  --gold-dim: rgba(228, 195, 90, 0.14);
  --line: #2d4a42;
  --ok: #2dd4a8;
  --warn: #f59e0b;
  --danger: #f87171;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --max: 480px;
  --max-wide: 720px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
input, select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  background: #1a332c;
  border: 1px solid var(--line);
  color: var(--ink);
  outline: none;
}
input:focus, select:focus { border-color: var(--gold); }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

.ey {
  letter-spacing: 0.16em;
  font-size: 11px;
  color: var(--gold);
  font-weight: 700;
  text-transform: uppercase;
}
.h1 { font-size: 22px; font-weight: 800; margin: 6px 0 4px; }
.h2 { font-size: 18px; font-weight: 800; margin: 0 0 8px; }
.sub { color: var(--muted); font-size: 14px; line-height: 1.45; }
.line {
  font-style: italic;
  color: var(--gold);
  font-size: 14px;
  line-height: 1.4;
  opacity: 0.95;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 10px;
}
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.btn {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--gold);
  color: #0c1a16;
  font-weight: 800;
  font-size: 15px;
  transition: transform 0.12s ease, opacity 0.12s ease;
  text-align: center;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.98); opacity: 0.9; }
.btn.ghost {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--line);
}
.btn.sm {
  width: auto;
  padding: 10px 14px;
  font-size: 13px;
  display: inline-block;
}
.btn.danger { background: #7f1d1d; color: #fecaca; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chip {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #1a332c;
  font-weight: 700;
  font-size: 13px;
  color: var(--muted);
}
.chip.on {
  background: var(--gold);
  color: #0c1a16;
  border-color: var(--gold);
}
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: #1a332c;
  color: var(--gold);
  border: 1px solid var(--line);
}
.field { margin-bottom: 12px; }
.field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 28px 12px;
  font-size: 14px;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-b));
  transform: translateX(-50%) translateY(80px);
  opacity: 0;
  background: #1a332c;
  border: 1px solid var(--gold);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  z-index: 40;
  transition: 0.2s ease;
  pointer-events: none;
  white-space: nowrap;
  max-width: 90vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast.on {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* —— Landing —— */
.land {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.land-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(14px + var(--safe-t)) 18px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(12, 26, 22, 0.92);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
}
.land-nav .brand { font-weight: 800; font-size: 15px; }
.land-hero {
  padding: 36px 20px 28px;
  max-width: var(--max-wide);
  margin: 0 auto;
  width: 100%;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(228, 195, 90, 0.2), transparent 55%),
    radial-gradient(ellipse at 90% 40%, rgba(45, 212, 168, 0.07), transparent 50%),
    var(--bg);
}
.land-hero .display {
  font-size: clamp(28px, 7vw, 40px);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 10px 0 14px;
}
.land-cta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 22px;
  max-width: 360px;
}
.land-section {
  padding: 28px 20px;
  max-width: var(--max-wide);
  margin: 0 auto;
  width: 100%;
}
.land-section + .land-section { padding-top: 8px; }
.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
}
@media (min-width: 560px) {
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .land-cta { flex-direction: row; max-width: none; }
  .land-cta .btn { width: auto; min-width: 160px; }
}
.feature {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
}
.feature .t { font-weight: 800; margin-bottom: 6px; }
.feature .d { color: var(--muted); font-size: 13px; line-height: 1.45; }
.corridor-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.corridor-pill {
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--gold-dim);
  border: 1px solid var(--line);
  font-weight: 700;
  font-size: 13px;
}
.land-foot {
  margin-top: auto;
  padding: 24px 20px calc(28px + var(--safe-b));
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.proof {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
}
.proof .card { margin: 0; text-align: center; padding: 12px 8px; }
.proof .n { font-size: 18px; font-weight: 800; color: var(--gold); }
.proof .l { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* —— App shell —— */
.app {
  min-height: 100dvh;
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}
.screen { display: none; flex: 1; flex-direction: column; min-height: 100dvh; }
.screen.on { display: flex; }
.pad { padding: calc(16px + var(--safe-t)) 16px calc(24px + var(--safe-b)); }
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(12px + var(--safe-t)) 16px 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(12, 26, 22, 0.92);
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(8px);
}
.topbar .back {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #1a332c;
  border: 1px solid var(--line);
  font-size: 18px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.stat {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.stat.three { grid-template-columns: 1fr 1fr 1fr; }
.stat .card { margin: 0; text-align: center; }
.stat .n { font-size: 20px; font-weight: 800; color: var(--gold); }
.stat .l { font-size: 11px; color: var(--muted); margin-top: 2px; }
.search-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.search-row input { flex: 1; }
.sku {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.sku:last-child { border-bottom: none; }
.sku .name { font-weight: 700; font-size: 14px; }
.sku .meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.qty { font-weight: 800; font-size: 18px; color: var(--ok); }
.qty.low { color: var(--warn); }
.qty.out { color: var(--danger); }
.log { font-size: 13px; }
.log .item { padding: 10px 0; border-bottom: 1px solid var(--line); }
.log .item:last-child { border-bottom: none; }
.log .when { color: var(--muted); font-size: 11px; }
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
}
.pager .info { font-size: 12px; color: var(--muted); }
.pad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 280px;
  margin: 12px auto 0;
}
.pad-key {
  height: 56px;
  border-radius: 14px;
  background: #1a332c;
  border: 1px solid var(--line);
  font-size: 22px;
  font-weight: 700;
}
.pad-key:active { background: #243f37; }
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 20;
  padding: 16px;
  padding-bottom: calc(16px + var(--safe-b));
}
.modal.on { display: flex; }
.sheet {
  width: 100%;
  max-width: 480px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px 20px 16px 16px;
  padding: 18px;
  animation: up 0.18s ease;
  max-height: 85dvh;
  overflow-y: auto;
}
@keyframes up {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  background: #1a332c;
  border-radius: 12px;
  padding: 4px;
  border: 1px solid var(--line);
}
.tab {
  flex: 1;
  padding: 10px 8px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
.tab.on { background: var(--gold); color: #0c1a16; }
.hq-totals {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}
.hq-totals strong { color: var(--ink); }
.muted-link {
  display: block;
  text-align: center;
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
}
