:root {
  --bg: #f4f0e8;
  --ink: #1b1f24;
  --card: rgba(255, 255, 255, 0.82);
  --line: #c5bcae;
  --brand: #006d77;
  --brand-warm: #f18f01;
  --ok: #2a9d8f;
  --warn: #e76f51;
  --muted: #5d6672;
  --radius: 20px;
  --shadow: 0 10px 30px rgba(27, 31, 36, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, #f2cc8f 0%, transparent 35%),
    radial-gradient(circle at 90% 10%, #83c5be 0%, transparent 30%),
    var(--bg);
  min-height: 100vh;
}

.shell {
  width: min(1100px, 100% - 2rem);
  margin: 0 auto;
  padding: 1.25rem 0 2rem;
}

.hero {
  margin-bottom: 1rem;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--brand);
}

h1,
h2,
h3 {
  font-family: "Fraunces", serif;
  margin: 0.2rem 0 0.4rem;
}

h1 {
  font-size: clamp(1.9rem, 2.5vw, 2.8rem);
}

.subhead {
  max-width: 700px;
  color: var(--muted);
  margin-top: 0;
}

.grid {
  display: grid;
  gap: 0.9rem;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card,
.tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(3px);
}

.tile {
  padding: 1rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  transition: transform 180ms ease, border-color 180ms ease;
}

.tile:hover {
  transform: translateY(-3px);
  border-color: var(--brand);
}

.tile span {
  color: var(--brand);
  font-weight: 700;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

.back {
  text-decoration: none;
  color: var(--brand);
  font-weight: 700;
}

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.6rem;
  background: #fff;
  font-size: 0.9rem;
}

.card {
  padding: 0.95rem;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.7rem;
}

.stat strong {
  display: block;
  font-size: 1.3rem;
  font-family: "Fraunces", serif;
}

.muted {
  color: var(--muted);
}

.list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.65rem;
}

.item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.65rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}

.item strong {
  display: block;
}

.chip {
  font-size: 0.82rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  font-weight: 700;
}

.chip.ok {
  background: color-mix(in oklab, var(--ok), #fff 80%);
  color: #0f5f55;
}

.chip.warn {
  background: color-mix(in oklab, var(--warn), #fff 82%);
  color: #8e2f16;
}

.chip.neutral {
  background: #eef1f4;
  color: #44515f;
}

.tap-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.tap {
  border: 0;
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 1rem 0.7rem;
  min-height: 86px;
  font: inherit;
  font-weight: 700;
  color: inherit;
}

.tap:active,
.tap.active {
  background: #dceeea;
  border-color: var(--brand);
}

.qty {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.qty button {
  border: 0;
  background: #fff;
  width: 34px;
  height: 34px;
  font: inherit;
  font-weight: 700;
}

.qty span {
  width: 34px;
  display: grid;
  place-items: center;
  font-weight: 700;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

.footer-actions {
  position: sticky;
  bottom: 0.7rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 0.8rem;
}

.action {
  border: 0;
  border-radius: 999px;
  padding: 0.8rem;
  font: inherit;
  font-weight: 700;
}

.action.primary {
  background: var(--brand);
  color: #fff;
}

.action.secondary {
  background: #fff;
  border: 1px solid var(--line);
}

.board {
  display: grid;
  gap: 0.75rem;
}

.stock-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.stock-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.75rem;
  display: grid;
  gap: 0.5rem;
  box-shadow: var(--shadow);
}

.icon-badge {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #ecf3f4;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
}

.stock-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.stock-meta {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
}

.stock-meta strong {
  color: var(--ink);
  font-weight: 700;
}

.stock-controls {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.4rem;
}

.stock-value {
  font-weight: 700;
  text-align: center;
}

.stock-btn {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  min-height: 40px;
  font: inherit;
  font-weight: 700;
}

.stock-btn:active {
  background: #dceeea;
}

.need-row {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.7rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}

.need-left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.need-qty {
  background: #e6f3f1;
  color: #0f5f55;
  border: 1px solid #b8ddd8;
  border-radius: 999px;
  padding: 0.3rem 0.6rem;
  font-weight: 700;
  white-space: nowrap;
}

.need-right {
  display: grid;
  justify-items: end;
  gap: 0.35rem;
}

.buy-controls {
  display: inline-grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  gap: 0.25rem;
}

.buy-btn {
  min-height: 32px;
  min-width: 32px;
  border-radius: 10px;
}

.buy-value {
  min-width: 28px;
  text-align: center;
  font-weight: 700;
}

.settle-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--brand);
  border-radius: 999px;
  padding: 0.3rem 0.6rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
}

.settle-btn:disabled {
  opacity: 0.55;
}

.priority-chip {
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid var(--line);
  background: #f1f4f7;
  color: #455364;
}

.priority-chip.high {
  background: #ffe4dd;
  border-color: #f0b4a5;
  color: #922d11;
}

.priority-chip.medium {
  background: #fff3d8;
  border-color: #efd5a4;
  color: #7d5700;
}

.priority-chip.low {
  background: #e4f3ed;
  border-color: #b8ddcc;
  color: #186043;
}

.empty-note {
  text-align: center;
  color: var(--muted);
  padding: 1rem;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: #fff;
}

.lane {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.7rem;
}

.lane header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.45rem;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal > * {
  animation: rise 400ms ease both;
}

.reveal > *:nth-child(2) { animation-delay: 50ms; }
.reveal > *:nth-child(3) { animation-delay: 100ms; }
.reveal > *:nth-child(4) { animation-delay: 150ms; }
.reveal > *:nth-child(5) { animation-delay: 200ms; }

@media (max-width: 900px) {
  .grid.three,
  .grid.two,
  .stat-row {
    grid-template-columns: 1fr;
  }

  .stock-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tap-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 430px) {
  .shell {
    width: min(1100px, 100% - 1rem);
  }

  .tap-grid {
    grid-template-columns: 1fr;
  }

  .stock-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
