:root {
  color-scheme: light;
  --bg: #f4f7f6;
  --surface: #ffffff;
  --ink: #15211f;
  --muted: #66736f;
  --line: #d7dfdc;
  --accent: #087f6f;
  --accent-strong: #056255;
  --warn: #9c6410;
  --danger: #b42318;
  --shadow: 0 12px 28px rgba(18, 43, 38, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(100%, 620px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px max(22px, env(safe-area-inset-bottom));
}

.topbar {
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.topbar > div {
  grid-column: 2;
  min-width: 0;
  text-align: center;
}

.build-tag {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.05em;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 1.75rem;
  line-height: 1.08;
}

h2 {
  font-size: 1rem;
}

.step {
  display: none;
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.step.is-active {
  display: block;
}

.step-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.step-number {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e2f3ef;
  color: var(--accent-strong);
  font-weight: 800;
}

.entry-form {
  display: grid;
  gap: 10px;
}

.menu-options {
  display: grid;
  gap: 10px;
}

.settings-group {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.settings-group legend {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.radio-row {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  min-height: 52px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  color: var(--ink);
}

.radio-row input {
  width: 18px;
  min-height: 18px;
  padding: 0;
}

.menu-option {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 14px;
  border: 1px solid var(--line);
  background: #fbfdfc;
  color: var(--ink);
  text-align: left;
}

.menu-title,
.menu-detail {
  display: block;
}

.menu-title {
  font-size: 1.05rem;
  font-weight: 900;
}

.menu-detail {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 650;
}

.menu-arrow {
  color: var(--accent);
  font-size: 1.8rem;
  line-height: 1;
}

label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0;
  padding: 0 14px;
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(8, 127, 111, 0.16);
}

button {
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 52px;
  min-width: 52px;
  padding: 0;
  background: #e7eeec;
  color: var(--ink);
  font-size: 1.4rem;
}

.icon-button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.25;
}

.back-button {
  grid-column: 1;
  justify-self: start;
}

.exit-button {
  grid-column: 3;
  justify-self: end;
  background: #fff0ed;
  color: var(--danger);
}

.sku-summary {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.location-list {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

/* In-counting list is a bounded, scrollable panel so the action buttons below stay reachable. */
#monthEndReviewList {
  max-height: 40vh;
  overflow-y: auto;
}

.progress-block {
  margin: 14px 0 10px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.reset-count-button {
  width: 100%;
  min-height: 46px;
  margin-bottom: 10px;
  border: 1px solid #f2c7be;
  background: #fff0ed;
  color: var(--danger);
}

.location-products {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.location-option,
.location-product {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  color: var(--ink);
  text-align: left;
}

.location-option.is-complete {
  background: #eef7f2;
  color: var(--muted);
}

.location-option.is-current {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(8, 127, 111, 0.16);
}

.location-product {
  grid-template-columns: 58px 1fr auto;
  min-height: 74px;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  background:
    linear-gradient(
      90deg,
      var(--progress-color, rgba(34, 197, 94, 0.18)) 0 var(--progress, 0%),
      #fbfdfc var(--progress, 0%) 100%
    );
}

.location-product.is-over {
  --progress-color: rgba(59, 130, 246, 0.22);
}

.location-product > * {
  position: relative;
  z-index: 1;
}

.location-product:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(8, 127, 111, 0.16);
  outline: none;
}

.location-address {
  font-size: 1rem;
  font-weight: 850;
}

.location-meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.pill {
  border-radius: 999px;
  background: #e2f3ef;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 850;
  padding: 6px 8px;
}

.pill.negative {
  background: #ffe9e6;
  color: var(--danger);
}

.pill.complete {
  background: #dff5e8;
  color: #17613a;
}

.review-actions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.complete-button,
.empty-button {
  min-height: 64px;
  font-size: 1.02rem;
}

.empty-button {
  border: 1px solid #f2c7be;
  background: #fff0ed;
  color: var(--danger);
}

.skip-button {
  min-height: 56px;
  font-size: 1.02rem;
  border: 1px solid var(--line);
  background: #f6f8f7;
  color: var(--muted);
}

.product-thumb {
  width: 50px;
  height: 50px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  background: #e7eeec;
}

.product {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.product img,
.image-fallback {
  width: 74px;
  height: 74px;
  border-radius: 8px;
  border: 1px solid var(--line);
  object-fit: cover;
  background: #e7eeec;
}

.image-fallback {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 900;
}

.product-title {
  font-size: 0.98rem;
  font-weight: 850;
}

.product-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
}

.quantity-row {
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  gap: 8px;
}

.quantity-row input {
  text-align: center;
  font-size: 2rem;
}

.status {
  min-height: 22px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.status.error {
  color: var(--danger);
}

.status.warn {
  color: var(--warn);
}

@media (min-width: 720px) {
  .shell {
    padding-top: 30px;
  }
}
