/* Let the phone browser move the page itself, so swipe-down can refresh. */
html:has(.page-home),
body:has(.page-home) {
  height: auto;
  overflow-y: auto;
  overscroll-behavior-y: auto;
}
body:has(.page-home) {
  min-height: 100dvh;
}
.page-home {
  overflow: visible;
  flex: none;
  min-height: auto;
}

.stock-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  align-items: start;
}
.stock-col {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.stock-col > * + * {
  margin-top: -3px;
}
.stock-name {
  text-align: center;
  font-weight: 900;
  font-size: 1.35rem;
  border: 3px solid var(--line);
  background: #fff;
  padding: 0.45rem 0.2rem;
}
.stock-qty {
  text-align: center;
  font-weight: 900;
  font-size: 2.4rem;
  line-height: 1.1;
  border: 3px solid var(--line);
  background: #fffdf6;
  padding: 0.55rem 0.2rem;
}
.stock-qty.is-neg { color: var(--danger); }
.btn-action-out { background: var(--game-orange); color: #142033; }

.page-history {
  overflow: hidden;
  padding: 0.3rem 0.4rem;
  padding-bottom: calc(0.3rem + var(--safe-bottom));
}
.history-panel {
  gap: 0.2rem;
  margin-top: 0;
  min-height: 0;
  overflow: hidden;
}
.page-history .screen-title { font-size: 1rem; }
.page-history .back-link { font-size: 0.9rem; }
.page-history .screen-bar { flex: none; }
.history-count {
  margin: 0;
  flex: none;
  text-align: center;
  font-weight: 800;
  font-size: 0.68rem;
  line-height: 1.1;
  color: var(--muted);
}
.move-list {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 3px solid var(--line);
  background: #fff;
  min-width: 0;
  overflow: hidden;
}
.move-row {
  flex: none;
  height: 1.2rem;
  display: grid;
  grid-template-columns: 34% 26% 22% 18%;
  width: 100%;
  min-width: 0;
  align-items: center;
  padding: 0 0.28rem;
  font-weight: 800;
  font-size: 0.62rem;
  line-height: 1;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  box-sizing: border-box;
}
.move-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.move-row:last-child { border-bottom: 0; }
.history-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
  flex: none;
}
.history-page-btn {
  min-height: 1.7rem;
  padding: 0.1rem 0.3rem;
  font-size: 0.85rem;
}
.history-pager-off { opacity: 0.35; }
.empty-hint { text-align: center; font-weight: 800; color: var(--muted); }

.helper-form { display: grid; gap: 0.35rem; }
.helper-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border: 3px solid var(--line);
  background: #fff;
  padding: 0.45rem 0.6rem;
  font-weight: 800;
  font-size: 1.15rem;
}
.helper-row input { width: 1.2rem; height: 1.2rem; }
