.inventory-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 16px; }
.vending-frame { border-radius: 28px; padding: 16px; background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.04)); border: 1px solid var(--line); }
.spring-grid { display: grid; grid-template-columns: repeat(5, minmax(92px,1fr)); gap: 10px; }
.spring-cell { min-height: 112px; border-radius: 18px; border: 1px solid var(--line); background: rgba(255,255,255,.07); padding: 10px; position: relative; transition: .16s ease; overflow: hidden; }
.spring-cell:hover, .spring-cell.selected { transform: translateY(-2px); border-color: rgba(94,234,212,.62); background: rgba(94,234,212,.1); }
.spring-cell.disabled { opacity: .55; border-style: dashed; }
.spring-no { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.product-name { font-size: 13px; font-weight: 800; line-height: 1.2; min-height: 32px; }
.product-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; margin-top: 8px; }
.stock-bar { height: 7px; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,.1); margin-top: 10px; }
.stock-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.row-note { color: var(--muted); font-size: 12px; margin-top: 12px; line-height: 1.5; }
.spring-cell.low-stock .stock-bar span { background: linear-gradient(90deg, var(--warn), var(--danger)); }
.spring-cell.empty .product-name { color: var(--muted); font-style: italic; }

/* Spring editor modal — hidden on desktop, shown as bottom-sheet on mobile */
.spring-editor-modal {
  display: none;
}

.spring-editor-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 999;
}

.spring-editor-modal-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.4);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.spring-editor-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 0;
  flex-shrink: 0;
}

.spring-editor-modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.spring-editor-modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 28px;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}

.spring-editor-modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.spring-editor-modal-body {
  padding: 16px 20px 24px;
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 780px) {
  .spring-editor-modal.is-open {
    display: block;
  }

  /* Hide the desktop side panel on mobile — the modal replaces it */
  .inventory-layout .panel:last-child {
    display: none;
  }
}

@media (min-width: 781px) {
  .spring-editor-modal {
    display: none !important;
  }
}
