:root {
  --bg: #f3f1e9;
  --surface: rgba(255,255,255,.82);
  --surface-solid: #ffffff;
  --text: #183126;
  --muted: #68766f;
  --green-900: #173b2a;
  --green-800: #1e4e36;
  --green-700: #2b6647;
  --green-600: #367957;
  --green-100: #e5efe8;
  --line: rgba(24,49,38,.12);
  --shadow: 0 18px 55px rgba(28, 48, 37, .09);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 10% 0%, rgba(98, 145, 113, .13), transparent 28rem),
    radial-gradient(circle at 100% 20%, rgba(194, 171, 120, .12), transparent 26rem),
    var(--bg);
}

button, input { font: inherit; }

button {
  -webkit-tap-highlight-color: transparent;
}

.page-shell {
  width: min(1500px, calc(100% - 40px));
  margin: 0 auto;
  padding: 42px 0 28px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 28px;
}

.eyebrow {
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
  color: var(--green-600);
}

h1 {
  margin: 0;
  font-size: clamp(40px, 5vw, 68px);
  line-height: .95;
  letter-spacing: -.045em;
}

.subtitle {
  margin: 15px 0 0;
  max-width: 620px;
  font-size: 17px;
  line-height: 1.55;
  color: var(--muted);
}

.demo-controls {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.62);
  box-shadow: 0 8px 30px rgba(32,52,41,.05);
  backdrop-filter: blur(12px);
}

.name-field {
  display: grid;
  gap: 5px;
  padding-left: 10px;
}

.name-field span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
}

.name-field input {
  width: 148px;
  padding: 8px 0 7px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-weight: 750;
}

.secondary-button, .primary-button {
  border: 0;
  cursor: pointer;
  font-weight: 800;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.secondary-button {
  min-height: 44px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--green-800);
}

.secondary-button:hover { background: #f8fbf9; }
.secondary-button:active, .primary-button:active { transform: translateY(1px); }

.intro-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
  padding: 16px 18px;
  border: 1px solid rgba(41, 85, 61, .10);
  border-radius: 16px;
  background: rgba(228, 238, 231, .72);
  color: #315541;
  font-size: 13px;
}

.intro-card div {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.status-pill, .availability-badge {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
}

.status-pill {
  padding: 6px 9px;
  background: rgba(255,255,255,.74);
  color: var(--green-700);
}

.bins-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.bin-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  padding: 20px;
  border: 1px solid rgba(24,49,38,.09);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255,255,255,.90), rgba(255,255,255,.78)),
    var(--surface);
  box-shadow: var(--shadow);
}

.bin-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 45%;
  background: linear-gradient(180deg, rgba(67, 116, 82, .07), transparent);
  pointer-events: none;
}

.bin-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 66px;
  align-items: center;
  min-height: 360px;
  border-radius: 22px;
  background:
    radial-gradient(ellipse at 40% 85%, rgba(25, 52, 37, .08), transparent 44%),
    linear-gradient(180deg, #f1f5f1 0%, #ebeee8 100%);
  overflow: hidden;
}

.bin-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, rgba(255,255,255,.72), transparent 36%),
    repeating-linear-gradient(0deg, rgba(21,48,33,.015) 0, rgba(21,48,33,.015) 1px, transparent 1px, transparent 6px);
  pointer-events: none;
}

.bin-wrap {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-width: 0;
  height: 100%;
  padding: 12px 0 8px 8px;
}

.bin-svg {
  position: relative;
  z-index: 1;
  display: block;
  width: min(100%, 235px);
  height: auto;
  filter: saturate(.92) contrast(1.02);
  transform: translateY(2px);
}

.fill-control {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  align-content: center;
  height: 100%;
  padding: 18px 8px 18px 0;
}

.fill-value {
  display: flex;
  align-items: baseline;
  gap: 1px;
  margin-bottom: 15px;
  font-size: 11px;
  font-weight: 850;
  color: var(--green-700);
}

.fill-number {
  font-size: 20px;
  color: var(--green-900);
}

.fill-slider {
  width: 238px;
  height: 22px;
  margin: 102px 0;
  appearance: none;
  -webkit-appearance: none;
  transform: rotate(-90deg);
  transform-origin: center;
  background: transparent;
  cursor: grab;
}

.fill-slider:active { cursor: grabbing; }

.fill-slider::-webkit-slider-runnable-track {
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, #d7ded9, #6a9b7b);
  box-shadow: inset 0 0 0 1px rgba(22,61,41,.08);
}

.fill-slider::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 23px;
  height: 23px;
  margin-top: -8px;
  border: 4px solid white;
  border-radius: 50%;
  background: var(--green-700);
  box-shadow: 0 2px 9px rgba(21,53,36,.30);
}

.fill-slider::-moz-range-track {
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, #d7ded9, #6a9b7b);
}

.fill-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 4px solid white;
  border-radius: 50%;
  background: var(--green-700);
  box-shadow: 0 2px 9px rgba(21,53,36,.30);
}

.fill-scale {
  position: absolute;
  right: 3px;
  top: 70px;
  bottom: 54px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 9px;
  font-weight: 750;
  color: #819087;
}

.bin-meta {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin: 18px 1px 17px;
}

.bin-title {
  margin: 0 0 5px;
  font-size: 20px;
  letter-spacing: -.025em;
}

.fill-label {
  margin: 0;
  min-height: 36px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.availability-badge {
  padding: 6px 8px;
  background: var(--green-100);
  color: var(--green-700);
}

.availability-badge.full {
  background: #f0ece5;
  color: #837765;
}

.primary-button {
  width: 100%;
  min-height: 52px;
  border-radius: 15px;
  background: var(--green-900);
  color: white;
  box-shadow: 0 10px 22px rgba(23,59,42,.16);
}

.primary-button:hover {
  background: var(--green-800);
  transform: translateY(-1px);
  box-shadow: 0 13px 25px rgba(23,59,42,.19);
}

.primary-button:disabled {
  cursor: not-allowed;
  background: #b7c0bb;
  box-shadow: none;
  transform: none;
}

footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 26px 0 4px;
  color: #829087;
  font-size: 11px;
  font-weight: 700;
}

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  display: grid;
  gap: 10px;
  width: min(380px, calc(100vw - 40px));
}

.toast {
  padding: 15px 17px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 16px;
  background: rgba(24, 54, 39, .94);
  color: white;
  box-shadow: 0 14px 36px rgba(15, 32, 23, .24);
  backdrop-filter: blur(12px);
  animation: toast-in .24s ease-out both;
}

.toast strong {
  display: block;
  margin-bottom: 3px;
  font-size: 13px;
}

.toast span {
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255,255,255,.82);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: none; }
}

.claim-dialog {
  width: min(430px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: white;
  box-shadow: 0 28px 90px rgba(19,45,31,.25);
}

.claim-dialog::backdrop {
  background: rgba(17,35,25,.38);
  backdrop-filter: blur(3px);
}

.claim-dialog form {
  position: relative;
  padding: 30px;
  text-align: center;
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #f0f3f0;
  color: var(--muted);
  cursor: pointer;
  font-size: 22px;
}

.dialog-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--green-100);
  color: var(--green-700);
  font-size: 23px;
  font-weight: 900;
}

.claim-dialog h2 {
  margin: 0 0 9px;
  font-size: 24px;
  letter-spacing: -.03em;
}

.claim-dialog p {
  margin: 0 auto 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.dialog-ok {
  max-width: 160px;
}

@media (max-width: 1180px) {
  .bins-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 24px, 580px);
    padding-top: 26px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 20px;
  }

  .demo-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .name-field {
    padding: 6px 10px 0;
  }

  .name-field input { width: 100%; }

  .intro-card {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .bin-card { padding: 14px; }

  .bin-stage { min-height: 340px; }

  .bin-svg { width: min(100%, 225px); }
}
