* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f5f5;
  color: #333;
  min-height: 100vh;
}

.screen { display: none; padding: 16px; max-width: 480px; margin: 0 auto; }
.screen.active { display: block; }

.header { text-align: center; margin-bottom: 20px; }
.header h1 { font-size: 22px; color: #e63946; margin-bottom: 4px; }
.header h2 { font-size: 20px; color: #333; }
.subtitle { color: #888; font-size: 14px; }

/* Outlet grid */
.outlet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.outlet-btn {
  background: #fff;
  border: 2px solid #ddd;
  border-radius: 12px;
  padding: 20px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}
.outlet-btn:active { transform: scale(0.97); border-color: #e63946; }
.outlet-btn .name { font-size: 18px; font-weight: 700; color: #e63946; }
.outlet-btn .code { font-size: 11px; color: #999; margin-top: 4px; }

/* Back button */
.btn-back {
  position: absolute;
  left: 16px;
  top: 16px;
  background: none;
  border: none;
  font-size: 18px;
  color: #e63946;
  cursor: pointer;
  padding: 8px;
}

/* Form fields */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: #555; }
.input-field {
  width: 100%;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  background: #fff;
}

/* Camera button */
.camera-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #e63946;
  color: #fff;
  border-radius: 16px;
  padding: 40px 20px;
  cursor: pointer;
  margin: 20px 0;
  transition: background 0.15s;
}
.camera-btn:active { background: #c5303c; }
.gallery-btn { background: #1a73e8; margin-top: 0; }
.gallery-btn:active { background: #1558b0; }
.camera-icon { font-size: 48px; margin-bottom: 8px; }
.camera-btn span:last-child { font-size: 16px; font-weight: 600; }

/* Preview */
#preview-area { text-align: center; }
#preview-img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 8px;
  border: 2px solid #ddd;
  margin-bottom: 8px;
}
#preview-size { font-size: 12px; color: #888; margin-bottom: 12px; }

.preview-actions, .result-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

/* Buttons */
.btn {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: #e63946; color: #fff; }
.btn-primary:active { background: #c5303c; }
.btn-secondary { background: #eee; color: #333; }
.btn-secondary:active { background: #ddd; }

/* Loading spinner */
#loading { text-align: center; padding: 40px 0; }
.spinner {
  width: 48px; height: 48px;
  border: 4px solid #eee;
  border-top: 4px solid #e63946;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
#loading-text { color: #888; font-size: 14px; }

/* Result banner */
.banner {
  padding: 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  text-align: center;
  font-weight: 600;
}
.banner-success { background: #d4edda; color: #155724; }
.banner-error { background: #f8d7da; color: #721c24; }
.banner-warn { background: #fff3cd; color: #856404; }

/* Result table */
.result-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}
.result-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
}
.result-table td:first-child { color: #888; width: 50%; }
.result-table td:last-child { font-weight: 600; text-align: right; }
.result-table tr.highlight td { background: #fff9e6; }

/* POS label */
.pos-label {
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: #e63946;
  background: #fff3cd;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.pos-section-title {
  font-size: 16px;
  font-weight: 700;
  color: #555;
  margin: 16px 0 8px;
  padding: 8px 12px;
  background: #eee;
  border-radius: 8px;
  text-align: center;
}

.combined-title {
  color: #fff;
  background: #e63946;
  margin-top: 20px;
}

.drive-link {
  display: block;
  text-align: center;
  margin: 12px 0;
  color: #1a73e8;
  font-size: 13px;
}
