* {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

.screen {
  display: none;
  height: 100vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.screen.active {
  display: flex;
  flex-direction: column;
}

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(26, 58, 74, 0.95);
  align-items: center;
  justify-content: center;
}
.overlay.active {
  display: flex;
}

.pin-bg {
  background: linear-gradient(160deg, #87CEEB 0%, #2D8B9E 60%, #1a3a4a 100%);
}

.tap-card {
  background: white;
  border-radius: 20px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease;
}
.tap-card:active {
  transform: scale(0.98);
}

.btn-minus, .btn-plus {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  color: white;
  font-size: 28px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  -webkit-appearance: none;
}
.btn-minus {
  background: #e74c3c;
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.35);
}
.btn-plus {
  background: #2ecc71;
  box-shadow: 0 4px 12px rgba(46, 204, 113, 0.35);
}
.btn-minus:active, .btn-plus:active {
  transform: scale(0.9);
}

.badge-red { background: #e74c3c; color: white; }
.badge-yellow { background: #f39c12; color: white; }
.badge-green { background: #2ecc71; color: white; }

.cat-tab {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid #ddd;
  background: white;
  color: #666;
  transition: all 0.15s ease;
  -webkit-appearance: none;
}
.cat-tab.active {
  background: #2D8B9E;
  color: white;
  border-color: #2D8B9E;
}

.pin-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.1s ease;
  -webkit-appearance: none;
}
.pin-btn:active {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0.92);
}

.pin-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  transition: all 0.15s ease;
}
.pin-dot.filled {
  background: white;
  border-color: white;
}
.pin-dot.error {
  border-color: #e74c3c;
  background: #e74c3c;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}
.slide-right { animation: slideInRight 0.2s ease-out; }
.slide-left { animation: slideInLeft 0.2s ease-out; }

@keyframes scaleIn {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}
.success-check {
  animation: scaleIn 0.5s ease-out;
  font-size: 80px;
}

.view-toggle-btn {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #999;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-appearance: none;
}
.view-toggle-btn.active {
  background: white;
  color: #1a3a4a;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.hidden { display: none !important; }

.total-row {
  display: flex;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  gap: 10px;
}
.total-row-emoji { font-size: 20px; width: 28px; text-align: center; }
.total-row-name { flex: 1; font-size: 13px; font-weight: 600; color: #1a3a4a; }
.total-row-qty { font-size: 15px; font-weight: 800; min-width: 30px; text-align: center; }
.total-row-btns { display: flex; gap: 6px; }
.total-row-btns button {
  width: 34px; height: 34px; border-radius: 50%; border: none;
  font-size: 16px; font-weight: bold; color: white; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  -webkit-appearance: none;
}
.total-row-btns .mini-minus { background: #e74c3c; }
.total-row-btns .mini-plus { background: #2ecc71; }
.total-row-btns button:active { transform: scale(0.9); }

.review-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
}

.review-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin: 0 auto;
}
